@ssdev-toolkit/nestjs-dms
v1.0.0
Published
Document metadata plus blob storage. Default storage is Firebase; the host may pass `IStorageProvider` (for example Google Drive).
Readme
@ssdev-toolkit/nestjs-dms
Document metadata plus blob storage. Default storage is Firebase; the host may pass IStorageProvider (for example Google Drive).
Install
npm install @ssdev-toolkit/nestjs-core @ssdev-toolkit/nestjs-dmsThe host registers IDocumentRepository and IDocumentEntityAccessPort. For Google Drive (or any non-Firebase provider), pass storageProvider into DmsModule.forRoot / forRootAsync.
What it does
DmsModule.forRoot/forRootAsyncDmsFacade— upload, list, download, signed URL, delete (bus-only; do not injectIDocumentRepositoryfrom other modules)DownloadDocumentQueryfor sibling modules
Usage
await this.dms.upload({
buffer,
fileName: 'receipt.pdf',
contentType: 'application/pdf',
mappings: [{ entityType: 'donation', entityId }],
visibility: 'internal',
userId: user.userId,
userPermissions,
});OAuth-backed storage should obtain tokens through OAUTH_ACCESS_TOKEN_PORT (token vault), not by importing vault repositories.
Build (this repo)
npm run build -w @ssdev-toolkit/nestjs-dmsOverview: root README.
