@neohm/nestend 3.3.7 → 3.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -7
- package/dist/admin/controllers/admin.tenant.user.controller.js +1 -1
- package/dist/admin/controllers/admin.tenant.user.controller.js.map +1 -1
- package/dist/admin/libraries/bulk.user.data.processor.js +1 -1
- package/dist/admin/libraries/bulk.user.data.processor.js.map +1 -1
- package/dist/admin/libraries/client.user.data.processor.js +1 -1
- package/dist/admin/libraries/client.user.data.processor.js.map +1 -1
- package/dist/admin/libraries/tenant.delete.processor.js +1 -1
- package/dist/admin/libraries/tenant.delete.processor.js.map +1 -1
- package/dist/auth/controllers/auth.controller.d.ts +1 -0
- package/dist/auth/controllers/auth.controller.d.ts.map +1 -1
- package/dist/auth/controllers/auth.controller.js +5 -1
- package/dist/auth/controllers/auth.controller.js.map +1 -1
- package/dist/auth/entities/user.entity.d.ts +2 -2
- package/dist/auth/entities/user.entity.d.ts.map +1 -1
- package/dist/auth/entities/user.entity.js +3 -3
- package/dist/auth/entities/user.entity.js.map +1 -1
- package/dist/auth/services/auth.service.js +2 -2
- package/dist/auth/services/auth.service.js.map +1 -1
- package/dist/auth/services/impersonation.service.js +1 -1
- package/dist/auth/services/impersonation.service.js.map +1 -1
- package/dist/auth/types/auth.types.d.ts +1 -0
- package/dist/auth/types/auth.types.d.ts.map +1 -1
- package/dist/common/subscribers/common.subscriber.d.ts +3 -5
- package/dist/common/subscribers/common.subscriber.d.ts.map +1 -1
- package/dist/common/subscribers/common.subscriber.js +13 -25
- package/dist/common/subscribers/common.subscriber.js.map +1 -1
- package/dist/constants/entity.constants.d.ts +1 -0
- package/dist/constants/entity.constants.d.ts.map +1 -1
- package/dist/constants/entity.constants.js +1 -0
- package/dist/constants/entity.constants.js.map +1 -1
- package/dist/constants/entity.maps.d.ts +3 -1
- package/dist/constants/entity.maps.d.ts.map +1 -1
- package/dist/constants/entity.maps.js +3 -1
- package/dist/constants/entity.maps.js.map +1 -1
- package/dist/document/controllers/document.controller.d.ts +15 -0
- package/dist/document/controllers/document.controller.d.ts.map +1 -0
- package/dist/document/controllers/document.controller.js +88 -0
- package/dist/document/controllers/document.controller.js.map +1 -0
- package/dist/document/document.module.d.ts.map +1 -1
- package/dist/document/document.module.js +23 -1
- package/dist/document/document.module.js.map +1 -1
- package/dist/document/dtos/set.document.dto.d.ts +6 -0
- package/dist/document/dtos/set.document.dto.d.ts.map +1 -0
- package/dist/document/dtos/set.document.dto.js +43 -0
- package/dist/document/dtos/set.document.dto.js.map +1 -0
- package/dist/document/dtos/upload.document.dto.d.ts +4 -0
- package/dist/document/dtos/upload.document.dto.d.ts.map +1 -0
- package/dist/document/dtos/upload.document.dto.js +31 -0
- package/dist/document/dtos/upload.document.dto.js.map +1 -0
- package/dist/document/entities/document.entity.d.ts +10 -0
- package/dist/document/entities/document.entity.d.ts.map +1 -0
- package/dist/document/entities/document.entity.js +43 -0
- package/dist/document/entities/document.entity.js.map +1 -0
- package/dist/{common/entities/document.entity.d.ts → document/entities/document.upload.entity.d.ts} +6 -7
- package/dist/document/entities/document.upload.entity.d.ts.map +1 -0
- package/dist/{common/entities/document.entity.js → document/entities/document.upload.entity.js} +24 -28
- package/dist/document/entities/document.upload.entity.js.map +1 -0
- package/dist/document/enums/document.default.enum.d.ts +8 -1
- package/dist/document/enums/document.default.enum.d.ts.map +1 -1
- package/dist/document/enums/document.default.enum.js +9 -1
- package/dist/document/enums/document.default.enum.js.map +1 -1
- package/dist/document/es6.classes.d.ts +8 -3
- package/dist/document/es6.classes.d.ts.map +1 -1
- package/dist/document/es6.classes.js +8 -3
- package/dist/document/es6.classes.js.map +1 -1
- package/dist/document/services/document.service.d.ts +17 -11
- package/dist/document/services/document.service.d.ts.map +1 -1
- package/dist/document/services/document.service.js +91 -50
- package/dist/document/services/document.service.js.map +1 -1
- package/dist/document/subscribers/document.subscriber.d.ts +9 -0
- package/dist/document/subscribers/document.subscriber.d.ts.map +1 -0
- package/dist/document/subscribers/document.subscriber.js +31 -0
- package/dist/document/subscribers/document.subscriber.js.map +1 -0
- package/dist/document/subscribers/document.upload.subscriber.d.ts +9 -0
- package/dist/document/subscribers/document.upload.subscriber.d.ts.map +1 -0
- package/dist/document/subscribers/document.upload.subscriber.js +31 -0
- package/dist/document/subscribers/document.upload.subscriber.js.map +1 -0
- package/dist/document/types/document.types.d.ts +0 -11
- package/dist/document/types/document.types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/migrations/{1749600000013.CreateSysDocumentDetailsTable.d.ts → 1749600000013.CreateSysDocumentUploadsTable.d.ts} +2 -2
- package/dist/migrations/1749600000013.CreateSysDocumentUploadsTable.d.ts.map +1 -0
- package/dist/migrations/{1749600000013.CreateSysDocumentDetailsTable.js → 1749600000013.CreateSysDocumentUploadsTable.js} +9 -10
- package/dist/migrations/1749600000013.CreateSysDocumentUploadsTable.js.map +1 -0
- package/dist/migrations/1749600000028.CreateSysDocumentsTable.d.ts +6 -0
- package/dist/migrations/1749600000028.CreateSysDocumentsTable.d.ts.map +1 -0
- package/dist/migrations/1749600000028.CreateSysDocumentsTable.js +29 -0
- package/dist/migrations/1749600000028.CreateSysDocumentsTable.js.map +1 -0
- package/dist/tenant/entities/tenant.entity.js +3 -3
- package/dist/tenant/entities/tenant.entity.js.map +1 -1
- package/package.json +1 -1
- package/dist/common/entities/document.entity.d.ts.map +0 -1
- package/dist/common/entities/document.entity.js.map +0 -1
- package/dist/migrations/1749600000013.CreateSysDocumentDetailsTable.d.ts.map +0 -1
- package/dist/migrations/1749600000013.CreateSysDocumentDetailsTable.js.map +0 -1
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.es6Classes = void 0;
|
|
4
|
+
const document_controller_1 = require("./controllers/document.controller");
|
|
4
5
|
const document_service_1 = require("./services/document.service");
|
|
5
6
|
const minio_bucket_document_service_1 = require("./services/minio.bucket.document.service");
|
|
6
7
|
const pdf_service_1 = require("./services/pdf.service");
|
|
7
8
|
const s3_bucket_document_service_1 = require("./services/s3.bucket.document.service");
|
|
9
|
+
const document_subscriber_1 = require("./subscribers/document.subscriber");
|
|
10
|
+
const document_upload_subscriber_1 = require("./subscribers/document.upload.subscriber");
|
|
11
|
+
const set_document_dto_1 = require("./dtos/set.document.dto");
|
|
12
|
+
const upload_document_dto_1 = require("./dtos/upload.document.dto");
|
|
8
13
|
exports.es6Classes = {
|
|
9
|
-
controllers: [],
|
|
14
|
+
controllers: [document_controller_1.DocumentController],
|
|
10
15
|
services: [
|
|
11
16
|
document_service_1.DocumentService,
|
|
12
17
|
minio_bucket_document_service_1.MinioBucketDocumentService,
|
|
@@ -14,8 +19,8 @@ exports.es6Classes = {
|
|
|
14
19
|
pdf_service_1.PdfService,
|
|
15
20
|
],
|
|
16
21
|
libraries: [],
|
|
17
|
-
dtos: [],
|
|
22
|
+
dtos: [set_document_dto_1.SetDocumentDto, upload_document_dto_1.UploadDocumentDto],
|
|
18
23
|
jobs: [],
|
|
19
|
-
subscribers: [],
|
|
24
|
+
subscribers: [document_subscriber_1.DocumentSubscriber, document_upload_subscriber_1.DocumentUploadSubscriber],
|
|
20
25
|
};
|
|
21
26
|
//# sourceMappingURL=es6.classes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/document/es6.classes.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;AAC9D,4FAAsF;AACtF,wDAAoD;AACpD,sFAAgF;
|
|
1
|
+
{"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/document/es6.classes.ts"],"names":[],"mappings":";;;AAAA,2EAAuE;AACvE,kEAA8D;AAC9D,4FAAsF;AACtF,wDAAoD;AACpD,sFAAgF;AAChF,2EAAuE;AACvE,yFAAoF;AACpF,8DAAyD;AACzD,oEAA+D;AAElD,QAAA,UAAU,GAAG;IACxB,WAAW,EAAE,CAAC,wCAAkB,CAAC;IACjC,QAAQ,EAAE;QACR,kCAAe;QACf,0DAA0B;QAC1B,oDAAuB;QACvB,wBAAU;KACF;IACV,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,CAAC,iCAAc,EAAE,uCAAiB,CAAC;IACzC,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,CAAC,wCAAkB,EAAE,qDAAwB,CAAU;CACrE,CAAC"}
|
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
import { Logger } from '@nestjs/common';
|
|
2
2
|
import { Readable } from 'stream';
|
|
3
3
|
import { DataSource } from 'typeorm';
|
|
4
|
-
import {
|
|
4
|
+
import { SetDocumentDto } from '../dtos/set.document.dto';
|
|
5
|
+
import { DocumentEntity } from '../entities/document.entity';
|
|
6
|
+
import { DocumentUploadEntity } from '../entities/document.upload.entity';
|
|
7
|
+
import { SystemPropertyService } from '../../common/services/system.property.service';
|
|
5
8
|
import { MinioBucketDocumentService } from './minio.bucket.document.service';
|
|
6
9
|
import { S3BucketDocumentService } from './s3.bucket.document.service';
|
|
7
|
-
import { BucketDocumentStorage, DocumentLinkOptions, PresignedUrlOptions,
|
|
10
|
+
import { BucketDocumentStorage, DocumentLinkOptions, PresignedUrlOptions, UploadDocumentOptions, UploadableFile } from '../types/document.types';
|
|
8
11
|
export declare class DocumentService {
|
|
9
12
|
private readonly s3BucketDocumentService;
|
|
10
13
|
private readonly minioBucketDocumentService;
|
|
14
|
+
private readonly systemPropertyService;
|
|
11
15
|
private readonly dataSource;
|
|
12
16
|
protected readonly logger: Logger;
|
|
13
|
-
constructor(s3BucketDocumentService: S3BucketDocumentService, minioBucketDocumentService: MinioBucketDocumentService, dataSource: DataSource);
|
|
17
|
+
constructor(s3BucketDocumentService: S3BucketDocumentService, minioBucketDocumentService: MinioBucketDocumentService, systemPropertyService: SystemPropertyService, dataSource: DataSource);
|
|
18
|
+
resolvePathPrefix(pathIdentifier: string): Promise<string>;
|
|
19
|
+
assertUploadable(files: UploadableFile[]): void;
|
|
14
20
|
uploadDocument(files: UploadableFile[], options?: UploadDocumentOptions): Promise<string[]>;
|
|
15
|
-
uploadDocuments(files: UploadableFile[], options?: UploadDocumentOptions): Promise<
|
|
16
|
-
uploadSingleDocument(file: UploadableFile, options?: UploadDocumentOptions): Promise<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
getDocumentLink(document: DocumentEntity, options?: DocumentLinkOptions): Promise<string>;
|
|
21
|
+
uploadDocuments(files: UploadableFile[], options?: UploadDocumentOptions): Promise<DocumentUploadEntity[]>;
|
|
22
|
+
uploadSingleDocument(file: UploadableFile, options?: UploadDocumentOptions): Promise<DocumentUploadEntity>;
|
|
23
|
+
setDocument(dto: SetDocumentDto): Promise<DocumentEntity>;
|
|
24
|
+
deleteUpload(uploadUuid: string): Promise<void>;
|
|
25
|
+
getDocumentLink(upload: DocumentUploadEntity, options?: DocumentLinkOptions): Promise<string>;
|
|
22
26
|
getPresignedUrl(objectPath: string, options?: PresignedUrlOptions): Promise<string>;
|
|
23
27
|
documentExists(objectPath: string): Promise<boolean>;
|
|
24
|
-
getDocumentStream(
|
|
28
|
+
getDocumentStream(upload: DocumentUploadEntity): Promise<Readable>;
|
|
25
29
|
findDocumentsBySource(sourceType: string, sourceId: string): Promise<DocumentEntity[]>;
|
|
26
30
|
getActiveStorage(): BucketDocumentStorage;
|
|
27
31
|
getStorageByDriver(driver: string): BucketDocumentStorage;
|
|
28
32
|
generateStoredName(originalName: string): string;
|
|
33
|
+
private envNumber;
|
|
29
34
|
private buildObjectPath;
|
|
30
35
|
private get documentRepository();
|
|
36
|
+
private get uploadRepository();
|
|
31
37
|
}
|
|
32
38
|
//# sourceMappingURL=document.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.service.d.ts","sourceRoot":"","sources":["../../../src/document/services/document.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAc,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"document.service.d.ts","sourceRoot":"","sources":["../../../src/document/services/document.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGpD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAc,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAItF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAKvE,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAOjC,qBACa,eAAe;IAIxB,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAC3C,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAN7B,SAAS,CAAC,QAAQ,CAAC,MAAM,SAAoC;gBAG1C,uBAAuB,EAAE,uBAAuB,EAChD,0BAA0B,EAAE,0BAA0B,EACtD,qBAAqB,EAAE,qBAAqB,EAC5C,UAAU,EAAE,UAAU;IASnC,iBAAiB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KAAK,kBAAkB,GAE7B;IAED,OAAO,KAAK,gBAAgB,GAE3B;CACF"}
|
|
@@ -15,23 +15,48 @@ const common_1 = require("@nestjs/common");
|
|
|
15
15
|
const crypto_1 = require("crypto");
|
|
16
16
|
const path_1 = require("path");
|
|
17
17
|
const typeorm_1 = require("typeorm");
|
|
18
|
-
const document_entity_1 = require("
|
|
18
|
+
const document_entity_1 = require("../entities/document.entity");
|
|
19
|
+
const document_upload_entity_1 = require("../entities/document.upload.entity");
|
|
19
20
|
const storage_driver_enum_1 = require("../../common/enums/storage.driver.enum");
|
|
21
|
+
const system_property_service_1 = require("../../common/services/system.property.service");
|
|
20
22
|
const bad_request_exception_1 = require("../../global/exceptions/bad.request.exception");
|
|
21
23
|
const not_found_exception_1 = require("../../global/exceptions/not.found.exception");
|
|
22
24
|
const operation_exception_1 = require("../../global/exceptions/operation.exception");
|
|
23
25
|
const minio_bucket_document_service_1 = require("./minio.bucket.document.service");
|
|
24
26
|
const s3_bucket_document_service_1 = require("./s3.bucket.document.service");
|
|
27
|
+
const document_default_enum_1 = require("../enums/document.default.enum");
|
|
25
28
|
let DocumentService = DocumentService_1 = class DocumentService {
|
|
26
|
-
constructor(s3BucketDocumentService, minioBucketDocumentService, dataSource) {
|
|
29
|
+
constructor(s3BucketDocumentService, minioBucketDocumentService, systemPropertyService, dataSource) {
|
|
27
30
|
this.s3BucketDocumentService = s3BucketDocumentService;
|
|
28
31
|
this.minioBucketDocumentService = minioBucketDocumentService;
|
|
32
|
+
this.systemPropertyService = systemPropertyService;
|
|
29
33
|
this.dataSource = dataSource;
|
|
30
34
|
this.logger = new common_1.Logger(DocumentService_1.name);
|
|
31
35
|
}
|
|
36
|
+
async resolvePathPrefix(pathIdentifier) {
|
|
37
|
+
const property = `${document_default_enum_1.DocumentConstant.PATH_PROPERTY_PREFIX}${pathIdentifier}`;
|
|
38
|
+
const pathPrefix = await this.systemPropertyService.get(property);
|
|
39
|
+
if (!pathPrefix)
|
|
40
|
+
throw new bad_request_exception_1.BadRequestException(`Unknown path_identifier "${pathIdentifier}": system property "${property}" is not set.`);
|
|
41
|
+
if (!/^(?!.*\.\.)[a-zA-Z0-9][a-zA-Z0-9._\-/]*$/.test(pathPrefix))
|
|
42
|
+
throw new operation_exception_1.OperationException(`System property "${property}" is not a usable key prefix.`);
|
|
43
|
+
return pathPrefix;
|
|
44
|
+
}
|
|
45
|
+
assertUploadable(files) {
|
|
46
|
+
if (!files?.length)
|
|
47
|
+
throw new bad_request_exception_1.BadRequestException(`At least one file is required under the "${document_default_enum_1.DocumentConstant.UPLOAD_FIELD_NAME}" field.`);
|
|
48
|
+
const maxFiles = this.envNumber('DOCUMENT_MAX_UPLOAD_FILES', document_default_enum_1.DocumentDefault.MAX_UPLOAD_FILES);
|
|
49
|
+
if (files.length > maxFiles)
|
|
50
|
+
throw new bad_request_exception_1.BadRequestException(`At most ${maxFiles} files can be uploaded at once.`);
|
|
51
|
+
const maxSizeMb = this.envNumber('DOCUMENT_MAX_UPLOAD_SIZE_MB', document_default_enum_1.DocumentDefault.MAX_UPLOAD_SIZE_MB);
|
|
52
|
+
const maxBytes = maxSizeMb * document_default_enum_1.DocumentDefault.BYTES_PER_MB;
|
|
53
|
+
const oversized = files.find((file) => file.size > maxBytes);
|
|
54
|
+
if (oversized)
|
|
55
|
+
throw new bad_request_exception_1.BadRequestException(`"${oversized.originalname}" exceeds the ${maxSizeMb} MB per-file limit.`);
|
|
56
|
+
}
|
|
32
57
|
async uploadDocument(files, options) {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
58
|
+
const uploads = await this.uploadDocuments(files, options);
|
|
59
|
+
return Promise.all(uploads.map((upload) => this.getDocumentLink(upload)));
|
|
35
60
|
}
|
|
36
61
|
async uploadDocuments(files, options) {
|
|
37
62
|
return Promise.all(files.map((file) => this.uploadSingleDocument(file, options)));
|
|
@@ -40,54 +65,61 @@ let DocumentService = DocumentService_1 = class DocumentService {
|
|
|
40
65
|
const storage = this.getActiveStorage();
|
|
41
66
|
const storedName = this.generateStoredName(file.originalname);
|
|
42
67
|
const objectPath = this.buildObjectPath(storedName, options?.pathPrefix);
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
68
|
+
const url = await storage.upload(objectPath, file.buffer, file.mimetype);
|
|
69
|
+
const upload = await this.uploadRepository.save(this.uploadRepository.create({
|
|
70
|
+
original_name: file.originalname,
|
|
71
|
+
stored_name: storedName,
|
|
72
|
+
mime_type: file.mimetype,
|
|
73
|
+
size_bytes: file.size,
|
|
74
|
+
storage_driver: storage.driver,
|
|
46
75
|
path: objectPath,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
mimeType: file.mimetype,
|
|
50
|
-
sizeBytes: file.size,
|
|
51
|
-
storageDriver: storage.driver,
|
|
52
|
-
};
|
|
53
|
-
if (options?.persist)
|
|
54
|
-
await this.persistDocumentRecord(storedDocument, options);
|
|
55
|
-
return storedDocument;
|
|
56
|
-
}
|
|
57
|
-
async persistDocumentRecord(storedDocument, options) {
|
|
58
|
-
if (!options.createdBy || !options.sourceType || !options.sourceId) {
|
|
59
|
-
throw new bad_request_exception_1.BadRequestException('Persisting a document record requires createdBy, sourceType and sourceId options.');
|
|
60
|
-
}
|
|
61
|
-
return this.documentRepository.save(this.documentRepository.create({
|
|
62
|
-
original_name: storedDocument.originalName,
|
|
63
|
-
stored_name: storedDocument.storedName,
|
|
64
|
-
mime_type: storedDocument.mimeType,
|
|
65
|
-
size_bytes: storedDocument.sizeBytes,
|
|
66
|
-
storage_driver: storedDocument.storageDriver,
|
|
67
|
-
path: storedDocument.path,
|
|
68
|
-
is_public: options.isPublic ?? false,
|
|
69
|
-
source_type: options.sourceType,
|
|
70
|
-
source_id: options.sourceId,
|
|
71
|
-
created_by: options.createdBy,
|
|
76
|
+
url,
|
|
77
|
+
is_public: options?.isPublic ?? false,
|
|
72
78
|
}));
|
|
79
|
+
if (options?.sourceType && options?.sourceId)
|
|
80
|
+
await this.setDocument({
|
|
81
|
+
upload_id: upload.id,
|
|
82
|
+
source_type: options.sourceType,
|
|
83
|
+
source_id: options.sourceId,
|
|
84
|
+
});
|
|
85
|
+
return upload;
|
|
86
|
+
}
|
|
87
|
+
async setDocument(dto) {
|
|
88
|
+
const upload = await this.uploadRepository.findOne({
|
|
89
|
+
where: { id: dto.upload_id },
|
|
90
|
+
});
|
|
91
|
+
if (!upload)
|
|
92
|
+
throw new not_found_exception_1.NotFoundException(`Upload "${dto.upload_id}" was not found.`);
|
|
93
|
+
const existing = await this.documentRepository.findOne({
|
|
94
|
+
where: {
|
|
95
|
+
upload_id: dto.upload_id,
|
|
96
|
+
source_type: dto.source_type,
|
|
97
|
+
source_id: dto.source_id,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
if (existing)
|
|
101
|
+
return existing;
|
|
102
|
+
return this.documentRepository.save(this.documentRepository.create({ ...dto }));
|
|
73
103
|
}
|
|
74
|
-
async
|
|
75
|
-
const
|
|
76
|
-
where: { id:
|
|
104
|
+
async deleteUpload(uploadUuid) {
|
|
105
|
+
const upload = await this.uploadRepository.findOne({
|
|
106
|
+
where: { id: uploadUuid },
|
|
107
|
+
});
|
|
108
|
+
if (!upload)
|
|
109
|
+
throw new not_found_exception_1.NotFoundException(`Upload "${uploadUuid}" was not found.`);
|
|
110
|
+
const attachedCount = await this.documentRepository.count({
|
|
111
|
+
where: { upload_id: uploadUuid },
|
|
112
|
+
withDeleted: true,
|
|
77
113
|
});
|
|
78
|
-
if (
|
|
79
|
-
throw new
|
|
80
|
-
await this.getStorageByDriver(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const storage = this.getStorageByDriver(document.storage_driver);
|
|
88
|
-
if (document.is_public && !options?.signed)
|
|
89
|
-
return storage.getPublicUrl(document.path);
|
|
90
|
-
return storage.getPresignedUrl(document.path, options);
|
|
114
|
+
if (attachedCount)
|
|
115
|
+
throw new operation_exception_1.OperationException(`Upload "${uploadUuid}" is attached to ${attachedCount} document record(s) and cannot be deleted.`);
|
|
116
|
+
await this.getStorageByDriver(upload.storage_driver).delete(upload.path);
|
|
117
|
+
await this.uploadRepository.softDelete({ id: uploadUuid });
|
|
118
|
+
}
|
|
119
|
+
async getDocumentLink(upload, options) {
|
|
120
|
+
if (upload.is_public && !options?.signed)
|
|
121
|
+
return upload.url;
|
|
122
|
+
return this.getStorageByDriver(upload.storage_driver).getPresignedUrl(upload.path, options);
|
|
91
123
|
}
|
|
92
124
|
async getPresignedUrl(objectPath, options) {
|
|
93
125
|
return this.getActiveStorage().getPresignedUrl(objectPath, options);
|
|
@@ -95,12 +127,13 @@ let DocumentService = DocumentService_1 = class DocumentService {
|
|
|
95
127
|
async documentExists(objectPath) {
|
|
96
128
|
return this.getActiveStorage().exists(objectPath);
|
|
97
129
|
}
|
|
98
|
-
async getDocumentStream(
|
|
99
|
-
return this.getStorageByDriver(
|
|
130
|
+
async getDocumentStream(upload) {
|
|
131
|
+
return this.getStorageByDriver(upload.storage_driver).getStream(upload.path);
|
|
100
132
|
}
|
|
101
133
|
async findDocumentsBySource(sourceType, sourceId) {
|
|
102
134
|
return this.documentRepository.find({
|
|
103
135
|
where: { source_type: sourceType, source_id: sourceId },
|
|
136
|
+
relations: { upload: true },
|
|
104
137
|
order: { created_at: 'DESC' },
|
|
105
138
|
});
|
|
106
139
|
}
|
|
@@ -126,6 +159,10 @@ let DocumentService = DocumentService_1 = class DocumentService {
|
|
|
126
159
|
.replace(/[^.a-z0-9]/g, '');
|
|
127
160
|
return `${(0, crypto_1.randomUUID)()}${extension}`;
|
|
128
161
|
}
|
|
162
|
+
envNumber(variable, fallback) {
|
|
163
|
+
const parsed = Number(process.env[variable]);
|
|
164
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
|
165
|
+
}
|
|
129
166
|
buildObjectPath(storedName, pathPrefix) {
|
|
130
167
|
if (!pathPrefix)
|
|
131
168
|
return storedName;
|
|
@@ -134,12 +171,16 @@ let DocumentService = DocumentService_1 = class DocumentService {
|
|
|
134
171
|
get documentRepository() {
|
|
135
172
|
return this.dataSource.getRepository(document_entity_1.DocumentEntity);
|
|
136
173
|
}
|
|
174
|
+
get uploadRepository() {
|
|
175
|
+
return this.dataSource.getRepository(document_upload_entity_1.DocumentUploadEntity);
|
|
176
|
+
}
|
|
137
177
|
};
|
|
138
178
|
exports.DocumentService = DocumentService;
|
|
139
179
|
exports.DocumentService = DocumentService = DocumentService_1 = __decorate([
|
|
140
180
|
(0, common_1.Injectable)(),
|
|
141
181
|
__metadata("design:paramtypes", [s3_bucket_document_service_1.S3BucketDocumentService,
|
|
142
182
|
minio_bucket_document_service_1.MinioBucketDocumentService,
|
|
183
|
+
system_property_service_1.SystemPropertyService,
|
|
143
184
|
typeorm_1.DataSource])
|
|
144
185
|
], DocumentService);
|
|
145
186
|
//# sourceMappingURL=document.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.service.js","sourceRoot":"","sources":["../../../src/document/services/document.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,mCAAoC;AACpC,+BAA+B;AAE/B,qCAAiD;
|
|
1
|
+
{"version":3,"file":"document.service.js","sourceRoot":"","sources":["../../../src/document/services/document.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,mCAAoC;AACpC,+BAA+B;AAE/B,qCAAiD;AAEjD,iEAA6D;AAC7D,+EAA0E;AAC1E,gFAAuE;AACvE,2FAAsF;AACtF,yFAAoF;AACpF,qFAAgF;AAChF,qFAAiF;AACjF,mFAA6E;AAC7E,6EAAuE;AACvE,0EAGwC;AAejC,IAAM,eAAe,uBAArB,MAAM,eAAe;IAG1B,YACmB,uBAAgD,EAChD,0BAAsD,EACtD,qBAA4C,EAC5C,UAAsB;QAHtB,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,+BAA0B,GAA1B,0BAA0B,CAA4B;QACtD,0BAAqB,GAArB,qBAAqB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AC,aAAa,EAAE,EAAE,CAAC,CAAC;QAC9B,OAAO,GAAG,IAAA,mBAAU,GAAE,GAAG,SAAS,EAAE,CAAC;IACvC,CAAC;IAEO,SAAS,CAAC,QAAgB,EAAE,QAAgB;QAClD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnE,CAAC;IAEO,eAAe,CAAC,UAAkB,EAAE,UAAmB;QAC7D,IAAI,CAAC,UAAU;YAAE,OAAO,UAAU,CAAC;QACnC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC;IACjE,CAAC;IAED,IAAY,kBAAkB;QAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,gCAAc,CAAC,CAAC;IACvD,CAAC;IAED,IAAY,gBAAgB;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,6CAAoB,CAAC,CAAC;IAC7D,CAAC;CACF,CAAA;AA5PY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAKiC,oDAAuB;QACpB,0DAA0B;QAC/B,+CAAqB;QAChC,oBAAU;GAP9B,eAAe,CA4P3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataSource } from 'typeorm';
|
|
2
|
+
import { CommonSubscriber } from '../../common/subscribers/common.subscriber';
|
|
3
|
+
import { DocumentEntity } from '../entities/document.entity';
|
|
4
|
+
export declare class DocumentSubscriber extends CommonSubscriber<DocumentEntity> {
|
|
5
|
+
protected readonly datasource: DataSource;
|
|
6
|
+
constructor(datasource: DataSource);
|
|
7
|
+
listenTo(): typeof DocumentEntity;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=document.subscriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.subscriber.d.ts","sourceRoot":"","sources":["../../../src/document/subscribers/document.subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,qBACa,kBAAmB,SAAQ,gBAAgB,CAAC,cAAc,CAAC;IAC1D,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU;gBAAtB,UAAU,EAAE,UAAU;IAKrD,QAAQ;CAGT"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DocumentSubscriber = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const common_subscriber_1 = require("../../common/subscribers/common.subscriber");
|
|
15
|
+
const document_entity_1 = require("../entities/document.entity");
|
|
16
|
+
let DocumentSubscriber = class DocumentSubscriber extends common_subscriber_1.CommonSubscriber {
|
|
17
|
+
constructor(datasource) {
|
|
18
|
+
super();
|
|
19
|
+
this.datasource = datasource;
|
|
20
|
+
datasource.subscribers.push(this);
|
|
21
|
+
}
|
|
22
|
+
listenTo() {
|
|
23
|
+
return document_entity_1.DocumentEntity;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.DocumentSubscriber = DocumentSubscriber;
|
|
27
|
+
exports.DocumentSubscriber = DocumentSubscriber = __decorate([
|
|
28
|
+
(0, typeorm_1.EventSubscriber)(),
|
|
29
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
30
|
+
], DocumentSubscriber);
|
|
31
|
+
//# sourceMappingURL=document.subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.subscriber.js","sourceRoot":"","sources":["../../../src/document/subscribers/document.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAsD;AACtD,kFAA8E;AAC9E,iEAA6D;AAItD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,oCAAgC;IACtE,YAA+B,UAAsB;QACnD,KAAK,EAAE,CAAC;QADqB,eAAU,GAAV,UAAU,CAAY;QAEnD,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,QAAQ;QACN,OAAO,gCAAc,CAAC;IACxB,CAAC;CACF,CAAA;AATY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,yBAAe,GAAE;qCAE2B,oBAAU;GAD1C,kBAAkB,CAS9B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataSource } from 'typeorm';
|
|
2
|
+
import { CommonSubscriber } from '../../common/subscribers/common.subscriber';
|
|
3
|
+
import { DocumentUploadEntity } from '../entities/document.upload.entity';
|
|
4
|
+
export declare class DocumentUploadSubscriber extends CommonSubscriber<DocumentUploadEntity> {
|
|
5
|
+
protected readonly datasource: DataSource;
|
|
6
|
+
constructor(datasource: DataSource);
|
|
7
|
+
listenTo(): typeof DocumentUploadEntity;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=document.upload.subscriber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.upload.subscriber.d.ts","sourceRoot":"","sources":["../../../src/document/subscribers/document.upload.subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,qBACa,wBAAyB,SAAQ,gBAAgB,CAAC,oBAAoB,CAAC;IACtE,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU;gBAAtB,UAAU,EAAE,UAAU;IAKrD,QAAQ;CAGT"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DocumentUploadSubscriber = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const common_subscriber_1 = require("../../common/subscribers/common.subscriber");
|
|
15
|
+
const document_upload_entity_1 = require("../entities/document.upload.entity");
|
|
16
|
+
let DocumentUploadSubscriber = class DocumentUploadSubscriber extends common_subscriber_1.CommonSubscriber {
|
|
17
|
+
constructor(datasource) {
|
|
18
|
+
super();
|
|
19
|
+
this.datasource = datasource;
|
|
20
|
+
datasource.subscribers.push(this);
|
|
21
|
+
}
|
|
22
|
+
listenTo() {
|
|
23
|
+
return document_upload_entity_1.DocumentUploadEntity;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.DocumentUploadSubscriber = DocumentUploadSubscriber;
|
|
27
|
+
exports.DocumentUploadSubscriber = DocumentUploadSubscriber = __decorate([
|
|
28
|
+
(0, typeorm_1.EventSubscriber)(),
|
|
29
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
30
|
+
], DocumentUploadSubscriber);
|
|
31
|
+
//# sourceMappingURL=document.upload.subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.upload.subscriber.js","sourceRoot":"","sources":["../../../src/document/subscribers/document.upload.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAsD;AACtD,kFAA8E;AAC9E,+EAA0E;AAInE,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,oCAAsC;IAClF,YAA+B,UAAsB;QACnD,KAAK,EAAE,CAAC;QADqB,eAAU,GAAV,UAAU,CAAY;QAEnD,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,QAAQ;QACN,OAAO,6CAAoB,CAAC;IAC9B,CAAC;CACF,CAAA;AATY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,yBAAe,GAAE;qCAE2B,oBAAU;GAD1C,wBAAwB,CASpC"}
|
|
@@ -8,20 +8,9 @@ export interface UploadableFile {
|
|
|
8
8
|
export interface UploadDocumentOptions {
|
|
9
9
|
pathPrefix?: string;
|
|
10
10
|
isPublic?: boolean;
|
|
11
|
-
persist?: boolean;
|
|
12
|
-
createdBy?: string;
|
|
13
11
|
sourceType?: string;
|
|
14
12
|
sourceId?: string;
|
|
15
13
|
}
|
|
16
|
-
export interface StoredDocument {
|
|
17
|
-
link: string;
|
|
18
|
-
path: string;
|
|
19
|
-
storedName: string;
|
|
20
|
-
originalName: string;
|
|
21
|
-
mimeType: string;
|
|
22
|
-
sizeBytes: number;
|
|
23
|
-
storageDriver: string;
|
|
24
|
-
}
|
|
25
14
|
export interface PresignedUrlOptions {
|
|
26
15
|
expirySeconds?: number;
|
|
27
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.types.d.ts","sourceRoot":"","sources":["../../../src/document/types/document.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAMlC,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IAEpC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,
|
|
1
|
+
{"version":3,"file":"document.types.d.ts","sourceRoot":"","sources":["../../../src/document/types/document.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAMlC,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IAEpC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAElC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAE9D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAGD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,eAAe,CACb,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IACzC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,qBAAqB;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,8 @@ export { SystemFailedJobEntity } from './common/entities/system.failed.job.entit
|
|
|
32
32
|
export { SystemPropertyEntity } from './common/entities/system.property.entity';
|
|
33
33
|
export { SystemNotificationEntity } from './common/entities/system.notification.entity';
|
|
34
34
|
export { SystemAuditLogEntity } from './common/entities/system.audit.log.entity';
|
|
35
|
-
export { DocumentEntity } from './
|
|
35
|
+
export { DocumentEntity } from './document/entities/document.entity';
|
|
36
|
+
export { DocumentUploadEntity } from './document/entities/document.upload.entity';
|
|
36
37
|
export { SystemScheduledTaskEntity } from './common/entities/system.scheduled.task.entity';
|
|
37
38
|
export { ScheduledEventEntity } from './common/entities/scheduled.event.entity';
|
|
38
39
|
export { UserDeviceTokenEntity } from './notification/entities/user.device.token.entity';
|
|
@@ -79,11 +80,12 @@ export { EmailNotificationDefault } from './notification/enums/email.notificatio
|
|
|
79
80
|
export { EmailTemplateIdentifier } from './notification/enums/email.template.identifier.enum';
|
|
80
81
|
export { RenderedEmailTemplate, SendEmailOptions, } from './notification/types/email.notification.types';
|
|
81
82
|
export { DocumentService } from './document/services/document.service';
|
|
83
|
+
export { SetDocumentDto } from './document/dtos/set.document.dto';
|
|
82
84
|
export { S3BucketDocumentService } from './document/services/s3.bucket.document.service';
|
|
83
85
|
export { MinioBucketDocumentService } from './document/services/minio.bucket.document.service';
|
|
84
|
-
export { DocumentDefault } from './document/enums/document.default.enum';
|
|
86
|
+
export { DocumentDefault, DocumentConstant, } from './document/enums/document.default.enum';
|
|
85
87
|
export { StorageDriver } from './common/enums/storage.driver.enum';
|
|
86
|
-
export { UploadableFile, UploadDocumentOptions,
|
|
88
|
+
export { UploadableFile, UploadDocumentOptions, PresignedUrlOptions, DocumentLinkOptions, BucketDocumentStorage, } from './document/types/document.types';
|
|
87
89
|
export { PdfService } from './document/services/pdf.service';
|
|
88
90
|
export { PdfDefault, PdfConstant } from './document/enums/pdf.default.enum';
|
|
89
91
|
export { PdfRenderOptions, PdfPaperFormat, PdfMargin, } from './document/types/pdf.types';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EA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E,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAG/E,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EACjB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.baseJobMaps = exports.baseEntityMaps = exports.baseJobConstants = exports.baseEntityConstants = exports.createDataSourceOptions = exports.SeederUtility = exports.MigrationUtility = exports.Hash = exports.ServerEnvironmentEnum = exports.success = exports.buildPaginated = exports.SentryMonitoringAdapter = exports.MonitoringService = exports.MonitoringInterceptor = exports.LoggingInterceptor = exports.GlobalExceptionFilter = exports.BadRequestException = exports.NotFoundException = exports.OperationException = exports.AccessException = exports.SortDirection = exports.FilterValueTypeEnum = exports.FilterOperatorEnum = exports.SortDto = exports.FilterDto = exports.CommonListFilterDto = exports.DatabaseEventDto = exports.CommonPayloadDto = exports.CommonParamsDto = exports.CommonSubscriber = exports.CommonListProcessor = exports.CommonDataProcessor = exports.CommonController = void 0;
|
|
3
|
+
exports.AuthUtility = exports.AdminAuthService = exports.AuthService = exports.ApiKeyContext = exports.AdminAuth = exports.Auth = exports.TenantContextMiddleware = exports.ApiKeyMiddleware = exports.AdminJwtMiddleware = exports.JwtMiddleware = exports.EmailNotificationLogEntity = exports.EmailTemplateEntity = exports.UserDeviceTokenEntity = exports.ScheduledEventEntity = exports.SystemScheduledTaskEntity = exports.DocumentUploadEntity = exports.DocumentEntity = exports.SystemAuditLogEntity = exports.SystemNotificationEntity = exports.SystemPropertyEntity = exports.SystemFailedJobEntity = exports.ActivityLogEntity = exports.SystemConstantEntity = exports.SystemConstantTypeEntity = exports.TenantEntity = exports.SystemAdminUserRoleEntity = exports.SystemAdminRoleEntity = exports.AdminUserEntity = exports.TenantScopeEntity = exports.ApiScopeEntity = exports.ScopeEntity = exports.ApiKeyEntity = exports.SystemAuthSessionEntity = exports.SystemRefreshTokenEntity = exports.SystemRoleEntity = exports.UserRoleEntity = exports.UserDetailsEntity = exports.UserEntity = exports.CommonTenantEntity = exports.CommonAdminEntity = exports.CommonEntity = exports.RootEntity = exports.DocumentModule = exports.NotificationModule = exports.AdminModule = exports.TenantModule = exports.AuthModule = exports.SystemPropertyModule = exports.QueueModule = exports.CommonModule = void 0;
|
|
4
|
+
exports.OverlapPolicy = exports.CatchUpPolicy = exports.ScheduleKind = exports.CommonJob = exports.QueueService = exports.SqlTarget = exports.SqlService = exports.AuditAction = exports.AuditService = exports.SystemPropertyService = exports.ApiContentTypeEnum = exports.ApiRequestTypeEnum = exports.RemoteRequestService = exports.CacheService = exports.EncryptionService = exports.PdfConstant = exports.PdfDefault = exports.PdfService = exports.StorageDriver = exports.DocumentConstant = exports.DocumentDefault = exports.MinioBucketDocumentService = exports.S3BucketDocumentService = exports.SetDocumentDto = exports.DocumentService = exports.EmailTemplateIdentifier = exports.EmailNotificationDefault = exports.EmailRecipientDto = exports.EmailNotificationOptionsDto = exports.EmailNotificationLogAttributesDto = exports.EmailTemplateAttributesDto = exports.ProcessEmailNotification = exports.EmailNotificationService = exports.FcmInvalidTokenErrorCode = exports.FcmPushNotificationService = exports.NotificationService = exports.TenantContextService = exports.ScopeService = exports.ApiKeyScopes = exports.ApiKeyGuard = exports.ApiKeyService = exports.TenantRole = exports.RoleTier = exports.GlobalAdminRoles = exports.UserType = exports.CurrentUser = exports.Public = exports.JwtRefreshGuard = exports.JwtAuthGuard = exports.AccessRevocation = void 0;
|
|
5
|
+
exports.baseJobMaps = exports.baseEntityMaps = exports.baseJobConstants = exports.baseEntityConstants = exports.createDataSourceOptions = exports.SeederUtility = exports.MigrationUtility = exports.Hash = exports.ServerEnvironmentEnum = exports.success = exports.buildPaginated = exports.SentryMonitoringAdapter = exports.MonitoringService = exports.MonitoringInterceptor = exports.LoggingInterceptor = exports.GlobalExceptionFilter = exports.BadRequestException = exports.NotFoundException = exports.OperationException = exports.AccessException = exports.SortDirection = exports.FilterValueTypeEnum = exports.FilterOperatorEnum = exports.SortDto = exports.FilterDto = exports.CommonListFilterDto = exports.DatabaseEventDto = exports.CommonPayloadDto = exports.CommonParamsDto = exports.CommonSubscriber = exports.CommonListProcessor = exports.CommonDataProcessor = exports.CommonController = exports.IsTimezone = exports.IsCronExpression = exports.ScheduledEventStatus = void 0;
|
|
6
6
|
var common_module_1 = require("./common/common.module");
|
|
7
7
|
Object.defineProperty(exports, "CommonModule", { enumerable: true, get: function () { return common_module_1.CommonModule; } });
|
|
8
8
|
var queue_module_1 = require("./common/queue.module");
|
|
@@ -69,8 +69,10 @@ var system_notification_entity_1 = require("./common/entities/system.notificatio
|
|
|
69
69
|
Object.defineProperty(exports, "SystemNotificationEntity", { enumerable: true, get: function () { return system_notification_entity_1.SystemNotificationEntity; } });
|
|
70
70
|
var system_audit_log_entity_1 = require("./common/entities/system.audit.log.entity");
|
|
71
71
|
Object.defineProperty(exports, "SystemAuditLogEntity", { enumerable: true, get: function () { return system_audit_log_entity_1.SystemAuditLogEntity; } });
|
|
72
|
-
var document_entity_1 = require("./
|
|
72
|
+
var document_entity_1 = require("./document/entities/document.entity");
|
|
73
73
|
Object.defineProperty(exports, "DocumentEntity", { enumerable: true, get: function () { return document_entity_1.DocumentEntity; } });
|
|
74
|
+
var document_upload_entity_1 = require("./document/entities/document.upload.entity");
|
|
75
|
+
Object.defineProperty(exports, "DocumentUploadEntity", { enumerable: true, get: function () { return document_upload_entity_1.DocumentUploadEntity; } });
|
|
74
76
|
var system_scheduled_task_entity_1 = require("./common/entities/system.scheduled.task.entity");
|
|
75
77
|
Object.defineProperty(exports, "SystemScheduledTaskEntity", { enumerable: true, get: function () { return system_scheduled_task_entity_1.SystemScheduledTaskEntity; } });
|
|
76
78
|
var scheduled_event_entity_1 = require("./common/entities/scheduled.event.entity");
|
|
@@ -152,12 +154,15 @@ var email_template_identifier_enum_1 = require("./notification/enums/email.templ
|
|
|
152
154
|
Object.defineProperty(exports, "EmailTemplateIdentifier", { enumerable: true, get: function () { return email_template_identifier_enum_1.EmailTemplateIdentifier; } });
|
|
153
155
|
var document_service_1 = require("./document/services/document.service");
|
|
154
156
|
Object.defineProperty(exports, "DocumentService", { enumerable: true, get: function () { return document_service_1.DocumentService; } });
|
|
157
|
+
var set_document_dto_1 = require("./document/dtos/set.document.dto");
|
|
158
|
+
Object.defineProperty(exports, "SetDocumentDto", { enumerable: true, get: function () { return set_document_dto_1.SetDocumentDto; } });
|
|
155
159
|
var s3_bucket_document_service_1 = require("./document/services/s3.bucket.document.service");
|
|
156
160
|
Object.defineProperty(exports, "S3BucketDocumentService", { enumerable: true, get: function () { return s3_bucket_document_service_1.S3BucketDocumentService; } });
|
|
157
161
|
var minio_bucket_document_service_1 = require("./document/services/minio.bucket.document.service");
|
|
158
162
|
Object.defineProperty(exports, "MinioBucketDocumentService", { enumerable: true, get: function () { return minio_bucket_document_service_1.MinioBucketDocumentService; } });
|
|
159
163
|
var document_default_enum_1 = require("./document/enums/document.default.enum");
|
|
160
164
|
Object.defineProperty(exports, "DocumentDefault", { enumerable: true, get: function () { return document_default_enum_1.DocumentDefault; } });
|
|
165
|
+
Object.defineProperty(exports, "DocumentConstant", { enumerable: true, get: function () { return document_default_enum_1.DocumentConstant; } });
|
|
161
166
|
var storage_driver_enum_1 = require("./common/enums/storage.driver.enum");
|
|
162
167
|
Object.defineProperty(exports, "StorageDriver", { enumerable: true, get: function () { return storage_driver_enum_1.StorageDriver; } });
|
|
163
168
|
var pdf_service_1 = require("./document/services/pdf.service");
|