@solidxai/core 0.1.13-beta.6 → 0.1.13-beta.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/CHANGELOG.md +1076 -0
- package/dist/constants/draft-publish-fields.d.ts +2 -0
- package/dist/constants/draft-publish-fields.d.ts.map +1 -0
- package/dist/constants/draft-publish-fields.js +5 -0
- package/dist/constants/draft-publish-fields.js.map +1 -0
- package/dist/constants/media-file-types.d.ts +9 -0
- package/dist/constants/media-file-types.d.ts.map +1 -1
- package/dist/constants/media-file-types.js +27 -1
- package/dist/constants/media-file-types.js.map +1 -1
- package/dist/controllers/action-metadata.controller.d.ts +1 -1
- package/dist/controllers/action-metadata.controller.js +1 -1
- package/dist/controllers/agent-event.controller.d.ts +1 -1
- package/dist/controllers/agent-event.controller.js +1 -1
- package/dist/controllers/agent-session.controller.d.ts +1 -1
- package/dist/controllers/agent-session.controller.js +1 -1
- package/dist/controllers/dashboard-user-layout.controller.d.ts +1 -1
- package/dist/controllers/dashboard-user-layout.controller.js +1 -1
- package/dist/controllers/email-template.controller.d.ts +1 -1
- package/dist/controllers/email-template.controller.js +1 -1
- package/dist/controllers/export-template.controller.d.ts +1 -1
- package/dist/controllers/export-template.controller.d.ts.map +1 -1
- package/dist/controllers/export-template.controller.js +6 -4
- package/dist/controllers/export-template.controller.js.map +1 -1
- package/dist/controllers/export-transaction.controller.d.ts +1 -1
- package/dist/controllers/export-transaction.controller.js +1 -1
- package/dist/controllers/import-transaction-error-log.controller.d.ts +1 -1
- package/dist/controllers/import-transaction-error-log.controller.js +1 -1
- package/dist/controllers/import-transaction.controller.d.ts +1 -1
- package/dist/controllers/import-transaction.controller.d.ts.map +1 -1
- package/dist/controllers/import-transaction.controller.js +7 -7
- package/dist/controllers/import-transaction.controller.js.map +1 -1
- package/dist/controllers/list-of-values.controller.d.ts +1 -1
- package/dist/controllers/list-of-values.controller.js +1 -1
- package/dist/controllers/locale.controller.d.ts +1 -1
- package/dist/controllers/locale.controller.js +1 -1
- package/dist/controllers/mcp-audit-log.controller.d.ts +1 -1
- package/dist/controllers/mcp-audit-log.controller.js +1 -1
- package/dist/controllers/media.controller.d.ts +2 -2
- package/dist/controllers/media.controller.d.ts.map +1 -1
- package/dist/controllers/media.controller.js +13 -8
- package/dist/controllers/media.controller.js.map +1 -1
- package/dist/controllers/menu-item-metadata.controller.d.ts +1 -1
- package/dist/controllers/menu-item-metadata.controller.js +1 -1
- package/dist/controllers/model-sequence.controller.d.ts +1 -1
- package/dist/controllers/model-sequence.controller.js +1 -1
- package/dist/controllers/module-package.controller.d.ts.map +1 -1
- package/dist/controllers/module-package.controller.js +2 -3
- package/dist/controllers/module-package.controller.js.map +1 -1
- package/dist/controllers/mq-message-queue.controller.d.ts +1 -1
- package/dist/controllers/mq-message-queue.controller.js +1 -1
- package/dist/controllers/mq-message.controller.d.ts +1 -1
- package/dist/controllers/mq-message.controller.js +1 -1
- package/dist/controllers/permission-metadata.controller.d.ts +1 -1
- package/dist/controllers/permission-metadata.controller.js +1 -1
- package/dist/controllers/role-metadata.controller.d.ts +1 -1
- package/dist/controllers/role-metadata.controller.js +1 -1
- package/dist/controllers/saved-filters.controller.d.ts +1 -1
- package/dist/controllers/saved-filters.controller.js +1 -1
- package/dist/controllers/scheduled-job.controller.d.ts +1 -1
- package/dist/controllers/scheduled-job.controller.js +1 -1
- package/dist/controllers/security-rule.controller.d.ts +1 -1
- package/dist/controllers/security-rule.controller.js +1 -1
- package/dist/controllers/sms-template.controller.d.ts +1 -1
- package/dist/controllers/sms-template.controller.js +1 -1
- package/dist/controllers/user-activity-history.controller.d.ts +1 -1
- package/dist/controllers/user-activity-history.controller.js +1 -1
- package/dist/controllers/user-view-metadata.controller.d.ts +1 -1
- package/dist/controllers/user-view-metadata.controller.js +1 -1
- package/dist/controllers/user.controller.d.ts +2 -2
- package/dist/controllers/user.controller.js +2 -2
- package/dist/controllers/view-metadata.controller.d.ts +2 -2
- package/dist/controllers/view-metadata.controller.js +1 -1
- package/dist/controllers/workflow-definition.controller.d.ts +1 -1
- package/dist/controllers/workflow-definition.controller.js +1 -1
- package/dist/controllers/workflow-execution-artifact.controller.d.ts +1 -1
- package/dist/controllers/workflow-execution-artifact.controller.js +1 -1
- package/dist/controllers/workflow-execution-log.controller.d.ts +1 -1
- package/dist/controllers/workflow-execution-log.controller.js +1 -1
- package/dist/controllers/workflow-execution.controller.d.ts +1 -1
- package/dist/controllers/workflow-execution.controller.js +1 -1
- package/dist/controllers/workflow-secret.controller.d.ts +1 -1
- package/dist/controllers/workflow-secret.controller.js +1 -1
- package/dist/controllers/workflow-step-execution.controller.d.ts +1 -1
- package/dist/controllers/workflow-step-execution.controller.js +1 -1
- package/dist/controllers/workflow-trigger-execution.controller.d.ts +1 -1
- package/dist/controllers/workflow-trigger-execution.controller.js +1 -1
- package/dist/dtos/basic-filters.dto.d.ts +0 -1
- package/dist/dtos/basic-filters.dto.d.ts.map +1 -1
- package/dist/dtos/basic-filters.dto.js +1 -6
- package/dist/dtos/basic-filters.dto.js.map +1 -1
- package/dist/entities/common.entity.d.ts +4 -0
- package/dist/entities/common.entity.d.ts.map +1 -1
- package/dist/entities/common.entity.js +25 -1
- package/dist/entities/common.entity.js.map +1 -1
- package/dist/entities/user.entity.js +2 -2
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/factories/mail.factory.d.ts.map +1 -1
- package/dist/factories/mail.factory.js +4 -0
- package/dist/factories/mail.factory.js.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts +1 -0
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js +18 -11
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js.map +1 -1
- package/dist/helpers/file-download.helper.d.ts +9 -0
- package/dist/helpers/file-download.helper.d.ts.map +1 -0
- package/dist/helpers/file-download.helper.js +14 -0
- package/dist/helpers/file-download.helper.js.map +1 -0
- package/dist/helpers/model-metadata-helper.service.d.ts.map +1 -1
- package/dist/helpers/model-metadata-helper.service.js +30 -1
- package/dist/helpers/model-metadata-helper.service.js.map +1 -1
- package/dist/helpers/solid-registry.js +1 -1
- package/dist/helpers/solid-registry.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/seeders/module-test-data.service.d.ts +3 -1
- package/dist/seeders/module-test-data.service.d.ts.map +1 -1
- package/dist/seeders/module-test-data.service.js +8 -2
- package/dist/seeders/module-test-data.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +30 -2
- package/dist/services/authentication.service.d.ts +4 -1
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +52 -4
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +1 -0
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +8 -0
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts +5 -2
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +30 -32
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/crud.service.d.ts +11 -1
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +79 -66
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/datasource-introspection.service.d.ts.map +1 -1
- package/dist/services/datasource-introspection.service.js.map +1 -1
- package/dist/services/draft-publish-helper.service.d.ts +52 -0
- package/dist/services/draft-publish-helper.service.d.ts.map +1 -0
- package/dist/services/draft-publish-helper.service.js +368 -0
- package/dist/services/draft-publish-helper.service.js.map +1 -0
- package/dist/services/internationalisation-helper.service.d.ts +19 -0
- package/dist/services/internationalisation-helper.service.d.ts.map +1 -0
- package/dist/services/internationalisation-helper.service.js +107 -0
- package/dist/services/internationalisation-helper.service.js.map +1 -0
- package/dist/services/locale.service.d.ts +1 -1
- package/dist/services/media.service.d.ts +3 -2
- package/dist/services/media.service.d.ts.map +1 -1
- package/dist/services/media.service.js +44 -29
- package/dist/services/media.service.js.map +1 -1
- package/dist/services/metadata-validation.service.d.ts +7 -0
- package/dist/services/metadata-validation.service.d.ts.map +1 -0
- package/dist/services/metadata-validation.service.js +42 -0
- package/dist/services/metadata-validation.service.js.map +1 -0
- package/dist/services/model-metadata.service.d.ts.map +1 -1
- package/dist/services/model-metadata.service.js +2 -1
- package/dist/services/model-metadata.service.js.map +1 -1
- package/dist/services/object.utils.d.ts +2 -0
- package/dist/services/object.utils.d.ts.map +1 -0
- package/dist/services/object.utils.js +11 -0
- package/dist/services/object.utils.js.map +1 -0
- package/dist/services/settings/default-settings-provider.service.d.ts +6 -6
- package/dist/services/settings/default-settings-provider.service.js +3 -3
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/services/user.service.d.ts +2 -2
- package/dist/services/user.service.d.ts.map +1 -1
- package/dist/services/user.service.js +9 -3
- package/dist/services/user.service.js.map +1 -1
- package/dist/services/view-metadata.service.d.ts +1 -2
- package/dist/services/view-metadata.service.d.ts.map +1 -1
- package/dist/services/view-metadata.service.js +3 -55
- package/dist/services/view-metadata.service.js.map +1 -1
- package/dist/services/workflow-definition.service.d.ts +1 -1
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +10 -1
- package/dist/solid-core.module.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/draft-publish-fields.ts +5 -0
- package/src/constants/media-file-types.ts +50 -0
- package/src/controllers/export-template.controller.ts +5 -3
- package/src/controllers/import-transaction.controller.ts +6 -6
- package/src/controllers/media.controller.ts +17 -6
- package/src/controllers/module-package.controller.ts +2 -3
- package/src/dtos/basic-filters.dto.ts +0 -4
- package/src/entities/common.entity.ts +20 -0
- package/src/entities/user.entity.ts +2 -2
- package/src/factories/mail.factory.ts +7 -1
- package/src/helpers/field-crud-managers/MediaFieldCrudManager.ts +26 -12
- package/src/helpers/file-download.helper.ts +31 -0
- package/src/helpers/model-metadata-helper.service.ts +32 -1
- package/src/helpers/solid-registry.ts +1 -1
- package/src/index.ts +2 -0
- package/src/seeders/module-test-data.service.ts +6 -0
- package/src/seeders/seed-data/solid-core-metadata.json +30 -2
- package/src/services/authentication.service.ts +76 -5
- package/src/services/chatter-message.service.ts +16 -0
- package/src/services/crud-helper.service.ts +16 -34
- package/src/services/crud.service.ts +98 -103
- package/src/services/datasource-introspection.service.ts +5 -0
- package/src/services/draft-publish-helper.service.ts +529 -0
- package/src/services/internationalisation-helper.service.ts +148 -0
- package/src/services/media.service.ts +67 -36
- package/src/services/metadata-validation.service.ts +39 -0
- package/src/services/model-metadata.service.ts +4 -1
- package/src/services/object.utils.ts +10 -0
- package/src/services/settings/default-settings-provider.service.ts +3 -3
- package/src/services/user.service.ts +18 -3
- package/src/services/view-metadata.service.ts +5 -145
- package/src/solid-core.module.ts +16 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-publish-fields.d.ts","sourceRoot":"","sources":["../../src/constants/draft-publish-fields.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oCAAoC,oFAAqF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DRAFT_PUBLISH_VERSIONING_FIELD_NAMES = void 0;
|
|
4
|
+
exports.DRAFT_PUBLISH_VERSIONING_FIELD_NAMES = ['isPublished', 'isLatest', 'initialEntityVersionId', 'publishedTracker'];
|
|
5
|
+
//# sourceMappingURL=draft-publish-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-publish-fields.js","sourceRoot":"","sources":["../../src/constants/draft-publish-fields.ts"],"names":[],"mappings":";;;AAIa,QAAA,oCAAoC,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,wBAAwB,EAAE,kBAAkB,CAAU,CAAC","sourcesContent":["// The versioning columns CommonEntity adds for draft/publish support. These don't exist on\n// legacy tables (see LegacyCommonEntityWithExistingId) and don't carry over when a new draft\n// version is copied from its source entity, so both of those call sites share this list rather\n// than each hand-enumerating the same four names.\nexport const DRAFT_PUBLISH_VERSIONING_FIELD_NAMES = ['isPublished', 'isLatest', 'initialEntityVersionId', 'publishedTracker'] as const;\n"]}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export type MediaCategory = 'image' | 'audio' | 'video' | 'file' | 'pdf';
|
|
2
2
|
export declare const DANGEROUS_EXTENSIONS: Set<string>;
|
|
3
|
+
export declare const DANGEROUS_MIME_TYPES: Set<string>;
|
|
4
|
+
export declare function getLowercaseFileExtension(fileName?: string | null): string | undefined;
|
|
5
|
+
export interface UploadedFileLike {
|
|
6
|
+
mimetype?: string;
|
|
7
|
+
originalname?: string;
|
|
8
|
+
filename?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getUploadedFileName(file?: UploadedFileLike | null): string;
|
|
11
|
+
export declare function isDangerousMediaFile(file?: UploadedFileLike | null): boolean;
|
|
3
12
|
export declare const EXT_TO_MEDIA_TYPE: Record<string, MediaCategory>;
|
|
4
13
|
export declare const INLINE_SAFE_EXTENSIONS: Set<string>;
|
|
5
14
|
//# sourceMappingURL=media-file-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-file-types.d.ts","sourceRoot":"","sources":["../../src/constants/media-file-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAazE,eAAO,MAAM,oBAAoB,aAI/B,CAAC;
|
|
1
|
+
{"version":3,"file":"media-file-types.d.ts","sourceRoot":"","sources":["../../src/constants/media-file-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAazE,eAAO,MAAM,oBAAoB,aAI/B,CAAC;AAQH,eAAO,MAAM,oBAAoB,aAE/B,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAWtF;AAGD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,mBAAmB,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAAG,MAAM,CAE1E;AAQD,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAO5E;AASD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAM3D,CAAC;AAMF,eAAO,MAAM,sBAAsB,aAKjC,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INLINE_SAFE_EXTENSIONS = exports.EXT_TO_MEDIA_TYPE = exports.DANGEROUS_EXTENSIONS = void 0;
|
|
3
|
+
exports.INLINE_SAFE_EXTENSIONS = exports.EXT_TO_MEDIA_TYPE = exports.DANGEROUS_MIME_TYPES = exports.DANGEROUS_EXTENSIONS = void 0;
|
|
4
|
+
exports.getLowercaseFileExtension = getLowercaseFileExtension;
|
|
5
|
+
exports.getUploadedFileName = getUploadedFileName;
|
|
6
|
+
exports.isDangerousMediaFile = isDangerousMediaFile;
|
|
4
7
|
const IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'tiff', 'heic', 'heif'];
|
|
5
8
|
const AUDIO_EXTENSIONS = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac', 'webm'];
|
|
6
9
|
const VIDEO_EXTENSIONS = ['mp4', 'mov', 'avi', 'mkv', 'mpeg', 'mpg', '3gp', '3g2', 'webm', 'ogg'];
|
|
@@ -11,6 +14,29 @@ exports.DANGEROUS_EXTENSIONS = new Set([
|
|
|
11
14
|
'js', 'mjs', 'php', 'phtml', 'jsp', 'asp', 'aspx',
|
|
12
15
|
'exe', 'sh', 'bat', 'cmd', 'ps1', 'jar', 'dll',
|
|
13
16
|
]);
|
|
17
|
+
exports.DANGEROUS_MIME_TYPES = new Set([
|
|
18
|
+
'image/svg+xml', 'text/html', 'application/xhtml+xml',
|
|
19
|
+
]);
|
|
20
|
+
function getLowercaseFileExtension(fileName) {
|
|
21
|
+
if (!fileName) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const lastDotIndex = fileName.lastIndexOf('.');
|
|
25
|
+
if (lastDotIndex < 0 || lastDotIndex === fileName.length - 1) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return fileName.slice(lastDotIndex + 1).toLowerCase();
|
|
29
|
+
}
|
|
30
|
+
function getUploadedFileName(file) {
|
|
31
|
+
return file?.originalname ?? file?.filename ?? '';
|
|
32
|
+
}
|
|
33
|
+
function isDangerousMediaFile(file) {
|
|
34
|
+
const ext = getLowercaseFileExtension(getUploadedFileName(file));
|
|
35
|
+
if (ext && exports.DANGEROUS_EXTENSIONS.has(ext)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return exports.DANGEROUS_MIME_TYPES.has((file?.mimetype || '').toLowerCase().trim());
|
|
39
|
+
}
|
|
14
40
|
exports.EXT_TO_MEDIA_TYPE = {
|
|
15
41
|
...Object.fromEntries(IMAGE_EXTENSIONS.map((ext) => [ext, 'image'])),
|
|
16
42
|
...Object.fromEntries(AUDIO_EXTENSIONS.map((ext) => [ext, 'audio'])),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-file-types.js","sourceRoot":"","sources":["../../src/constants/media-file-types.ts"],"names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AE,EAAE,CAAC,CAAC,GAAG,EAAE,OAAgB,CAAC,CAAC,CAAC;IAC7E,GAAG,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAe,CAAC,CAAC,CAAC;IAC/E,CAAC,aAAa,CAAC,EAAE,KAAK;CACzB,CAAC;AAMW,QAAA,sBAAsB,GAAG,IAAI,GAAG,CAAS;IAClD,GAAG,gBAAgB;IACnB,GAAG,gBAAgB;IACnB,GAAG,gBAAgB;IACnB,aAAa;CAChB,CAAC,CAAC","sourcesContent":["export type MediaCategory = 'image' | 'audio' | 'video' | 'file' | 'pdf';\n\nconst IMAGE_EXTENSIONS = ['png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'tiff', 'heic', 'heif'];\nconst AUDIO_EXTENSIONS = ['mp3', 'wav', 'ogg', 'aac', 'm4a', 'flac', 'webm'];\nconst VIDEO_EXTENSIONS = ['mp4', 'mov', 'avi', 'mkv', 'mpeg', 'mpg', '3gp', '3g2', 'webm', 'ogg'];\nconst DOCUMENT_EXTENSIONS = ['txt', 'md', 'csv', 'json', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'zip', 'rar', '7z'];\nconst PDF_EXTENSION = 'pdf';\n\n/**\n * Extensions that must never be accepted as media uploads, regardless of declared mimetype or\n * admin-configured mediaTypes allowlist. Checked before any other resolution so a spoofed\n * Content-Type (e.g. application/octet-stream on an .html file) can't bypass this.\n */\nexport const DANGEROUS_EXTENSIONS = new Set([\n 'html', 'htm', 'xhtml', 'svg', 'xml',\n 'js', 'mjs', 'php', 'phtml', 'jsp', 'asp', 'aspx',\n 'exe', 'sh', 'bat', 'cmd', 'ps1', 'jar', 'dll',\n]);\n\n\n/**\n * Mimetypes that are never safe to accept, regardless of extension. These render as active\n * content in a browser (svg can carry <script>), so they are rejected even when the filename\n * looks harmless. Kept alongside DANGEROUS_EXTENSIONS so upload paths check both.\n */\nexport const DANGEROUS_MIME_TYPES = new Set([\n 'image/svg+xml', 'text/html', 'application/xhtml+xml',\n]);\n\nexport function getLowercaseFileExtension(fileName?: string | null): string | undefined {\n if (!fileName) {\n return undefined;\n }\n\n const lastDotIndex = fileName.lastIndexOf('.');\n if (lastDotIndex < 0 || lastDotIndex === fileName.length - 1) {\n return undefined;\n }\n\n return fileName.slice(lastDotIndex + 1).toLowerCase();\n}\n\n/** Minimal shape of an uploaded file, so this module stays free of framework imports. */\nexport interface UploadedFileLike {\n mimetype?: string;\n originalname?: string;\n filename?: string;\n}\n\n/** originalname is the client-supplied name; filename is multer's on-disk name. */\nexport function getUploadedFileName(file?: UploadedFileLike | null): string {\n return file?.originalname ?? file?.filename ?? '';\n}\n\n/**\n * Single predicate for \"must never be stored\". Shared by every upload entry point\n * (MediaFieldCrudManager, chatter attachments) so the rules can't drift between them.\n * Extension is checked before mimetype so a spoofed Content-Type (e.g.\n * application/octet-stream on an .html file) can't bypass it.\n */\nexport function isDangerousMediaFile(file?: UploadedFileLike | null): boolean {\n const ext = getLowercaseFileExtension(getUploadedFileName(file));\n if (ext && DANGEROUS_EXTENSIONS.has(ext)) {\n return true;\n }\n\n return DANGEROUS_MIME_TYPES.has((file?.mimetype || '').toLowerCase().trim());\n}\n\n/**\n * Single source of truth for extension -> coarse media category. Shared by upload-time\n * validation (MediaFieldCrudManager) and serve-time header hardening (ServeStaticModule), so\n * both agree on which extensions belong to which category and neither drifts out of sync.\n * webm/ogg are shared between AUDIO_EXTENSIONS and VIDEO_EXTENSIONS - last one wins here, they\n * default to 'video' since that's the more common upload case.\n */\nexport const EXT_TO_MEDIA_TYPE: Record<string, MediaCategory> = {\n ...Object.fromEntries(IMAGE_EXTENSIONS.map((ext) => [ext, 'image' as const])),\n ...Object.fromEntries(AUDIO_EXTENSIONS.map((ext) => [ext, 'audio' as const])),\n ...Object.fromEntries(VIDEO_EXTENSIONS.map((ext) => [ext, 'video' as const])),\n ...Object.fromEntries(DOCUMENT_EXTENSIONS.map((ext) => [ext, 'file' as const])),\n [PDF_EXTENSION]: 'pdf',\n};\n\n/**\n * Extensions safe to serve inline with their natural Content-Type; everything else served from\n * media-files-storage is forced to application/octet-stream + Content-Disposition: attachment.\n */\nexport const INLINE_SAFE_EXTENSIONS = new Set<string>([\n ...IMAGE_EXTENSIONS,\n ...AUDIO_EXTENSIONS,\n ...VIDEO_EXTENSIONS,\n PDF_EXTENSION,\n]);\n"]}
|
|
@@ -11,6 +11,6 @@ export declare class ActionMetadataController {
|
|
|
11
11
|
findMany(query: any, solidRequestContext: SolidRequestContextDto): Promise<any>;
|
|
12
12
|
findOne(id: string, query: any, solidRequestContext: SolidRequestContextDto): Promise<import("..").ActionMetadata>;
|
|
13
13
|
deleteMany(ids: number[], solidRequestContext: SolidRequestContextDto): Promise<any>;
|
|
14
|
-
delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").ActionMetadata>;
|
|
14
|
+
delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").ActionMetadata[]>;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=action-metadata.controller.d.ts.map
|
|
@@ -129,7 +129,7 @@ __decorate([
|
|
|
129
129
|
__decorate([
|
|
130
130
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
131
131
|
(0, common_1.Delete)(':id'),
|
|
132
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/action-metadata.entity").ActionMetadata }),
|
|
132
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/action-metadata.entity").ActionMetadata] }),
|
|
133
133
|
__param(0, (0, common_1.Param)('id')),
|
|
134
134
|
__param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
|
|
135
135
|
__metadata("design:type", Function),
|
|
@@ -11,6 +11,6 @@ export declare class AgentEventController {
|
|
|
11
11
|
findMany(query: any): Promise<any>;
|
|
12
12
|
findOne(id: string, query: any): Promise<import("..").AgentEvent>;
|
|
13
13
|
deleteMany(ids: number[]): Promise<any>;
|
|
14
|
-
delete(id: number): Promise<import("..").AgentEvent>;
|
|
14
|
+
delete(id: number): Promise<import("..").AgentEvent[]>;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=agent-event.controller.d.ts.map
|
|
@@ -133,7 +133,7 @@ __decorate([
|
|
|
133
133
|
__decorate([
|
|
134
134
|
(0, swagger_1.ApiBearerAuth)('jwt'),
|
|
135
135
|
(0, common_1.Delete)(':id'),
|
|
136
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/agent-event.entity").AgentEvent }),
|
|
136
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/agent-event.entity").AgentEvent] }),
|
|
137
137
|
__param(0, (0, common_1.Param)('id')),
|
|
138
138
|
__metadata("design:type", Function),
|
|
139
139
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -11,6 +11,6 @@ export declare class AgentSessionController {
|
|
|
11
11
|
findMany(query: any): Promise<any>;
|
|
12
12
|
findOne(id: string, query: any): Promise<import("..").AgentSession>;
|
|
13
13
|
deleteMany(ids: number[]): Promise<any>;
|
|
14
|
-
delete(id: number): Promise<import("..").AgentSession>;
|
|
14
|
+
delete(id: number): Promise<import("..").AgentSession[]>;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=agent-session.controller.d.ts.map
|
|
@@ -133,7 +133,7 @@ __decorate([
|
|
|
133
133
|
__decorate([
|
|
134
134
|
(0, swagger_1.ApiBearerAuth)('jwt'),
|
|
135
135
|
(0, common_1.Delete)(':id'),
|
|
136
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/agent-session.entity").AgentSession }),
|
|
136
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/agent-session.entity").AgentSession] }),
|
|
137
137
|
__param(0, (0, common_1.Param)('id')),
|
|
138
138
|
__metadata("design:type", Function),
|
|
139
139
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -19,6 +19,6 @@ export declare class DashboardUserLayoutController {
|
|
|
19
19
|
findMany(query: any): Promise<any>;
|
|
20
20
|
findOne(id: string, query: any): Promise<import("..").DashboardUserLayout>;
|
|
21
21
|
deleteMany(ids: number[]): Promise<any>;
|
|
22
|
-
delete(id: number): Promise<import("..").DashboardUserLayout>;
|
|
22
|
+
delete(id: number): Promise<import("..").DashboardUserLayout[]>;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=dashboard-user-layout.controller.d.ts.map
|
|
@@ -165,7 +165,7 @@ __decorate([
|
|
|
165
165
|
__decorate([
|
|
166
166
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
167
167
|
(0, common_1.Delete)(':id'),
|
|
168
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/dashboard-user-layout.entity").DashboardUserLayout }),
|
|
168
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/dashboard-user-layout.entity").DashboardUserLayout] }),
|
|
169
169
|
__param(0, (0, common_1.Param)('id')),
|
|
170
170
|
__metadata("design:type", Function),
|
|
171
171
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -12,7 +12,7 @@ export declare class EmailTemplateController {
|
|
|
12
12
|
findMany(query: any): Promise<any>;
|
|
13
13
|
findOne(id: string, query: any): Promise<import("..").EmailTemplate>;
|
|
14
14
|
deleteMany(ids: number[]): Promise<any>;
|
|
15
|
-
delete(id: number): Promise<import("..").EmailTemplate>;
|
|
15
|
+
delete(id: number): Promise<import("..").EmailTemplate[]>;
|
|
16
16
|
generateMailgenTemplate(templateType: string): any;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=email-template.controller.d.ts.map
|
|
@@ -190,7 +190,7 @@ __decorate([
|
|
|
190
190
|
__decorate([
|
|
191
191
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
192
192
|
(0, common_1.Delete)(':id'),
|
|
193
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/email-template.entity").EmailTemplate }),
|
|
193
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/email-template.entity").EmailTemplate] }),
|
|
194
194
|
__param(0, (0, common_1.Param)('id')),
|
|
195
195
|
__metadata("design:type", Function),
|
|
196
196
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -14,7 +14,7 @@ export declare class ExportTemplateController {
|
|
|
14
14
|
findMany(query: any): Promise<any>;
|
|
15
15
|
findOne(id: string, query: any): Promise<import("..").ExportTemplate>;
|
|
16
16
|
deleteMany(ids: number[]): Promise<any>;
|
|
17
|
-
delete(id: number): Promise<import("..").ExportTemplate>;
|
|
17
|
+
delete(id: number): Promise<import("..").ExportTemplate[]>;
|
|
18
18
|
startExportSync(dto: StartExportSyncDto, res: Response, activeUser: ActiveUserData): Promise<void>;
|
|
19
19
|
startExportAsync(dto: StartExportSyncDto): Promise<import("..").ExportTransaction>;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-template.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/export-template.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"export-template.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/export-template.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAG3E,qBAEa,wBAAwB;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,qBAAqB;IAK3D,MAAM,CAAS,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAOrG,UAAU,CAAS,UAAU,EAAE,uBAAuB,EAAE,EAAmB,UAAU,GAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAO;IAQnH,MAAM,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAO9H,aAAa,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAgB/H,QAAQ,CAAU,KAAK,EAAE,GAAG;IAM5B,OAAO,CAAc,EAAE,EAAE,MAAM,EAAW,KAAK,EAAE,GAAG;IAKpD,UAAU,CAAS,GAAG,EAAE,MAAM,EAAE;IAMhC,MAAM,CAAc,EAAE,EAAE,MAAM;IAM9B,eAAe,CAAS,GAAG,EAAE,kBAAkB,EAAS,GAAG,EAAE,QAAQ,EAAiB,UAAU,EAAE,cAAc;IAuBhH,gBAAgB,CAAS,GAAG,EAAE,kBAAkB;CAUvD"}
|
|
@@ -22,6 +22,7 @@ const create_export_template_dto_1 = require("../dtos/create-export-template.dto
|
|
|
22
22
|
const update_export_template_dto_1 = require("../dtos/update-export-template.dto");
|
|
23
23
|
const export_dto_1 = require("../dtos/export.dto");
|
|
24
24
|
const active_user_decorator_1 = require("../decorators/active-user.decorator");
|
|
25
|
+
const file_download_helper_1 = require("../helpers/file-download.helper");
|
|
25
26
|
let ExportTemplateController = class ExportTemplateController {
|
|
26
27
|
constructor(service) {
|
|
27
28
|
this.service = service;
|
|
@@ -61,9 +62,10 @@ let ExportTemplateController = class ExportTemplateController {
|
|
|
61
62
|
if (exportFileInfo.exportStream === null) {
|
|
62
63
|
throw new common_1.InternalServerErrorException("Export stream is null");
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
(0, file_download_helper_1.setFileDownloadHeaders)(res, {
|
|
66
|
+
fileName: exportFileInfo.fileName,
|
|
67
|
+
mimeType: exportFileInfo.mimeType,
|
|
68
|
+
});
|
|
67
69
|
exportFileInfo.exportStream.pipe(res);
|
|
68
70
|
}
|
|
69
71
|
async startExportAsync(dto) {
|
|
@@ -163,7 +165,7 @@ __decorate([
|
|
|
163
165
|
__decorate([
|
|
164
166
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
165
167
|
(0, common_1.Delete)(':id'),
|
|
166
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/export-template.entity").ExportTemplate }),
|
|
168
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/export-template.entity").ExportTemplate] }),
|
|
167
169
|
__param(0, (0, common_1.Param)('id')),
|
|
168
170
|
__metadata("design:type", Function),
|
|
169
171
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-template.controller.js","sourceRoot":"","sources":["../../src/controllers/export-template.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkK;AAClK,+DAA+D;AAC/D,6CAAmE;AACnE,iFAA4E;AAC5E,mFAA6E;AAC7E,mFAA6E;AAE7E,mDAAyD;AACzD,+EAAkE;AAK3D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YAA6B,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IAAG,CAAC;IAK/D,MAAM,CAAS,SAAkC,EAAmB,KAAiC;QACnG,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EA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,cAAK,GAAE,CAAA;;;;uDAE9C;AAGK;IADL,IAAA,eAAM,EAAC,OAAO,CAAC;;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;;;;0DAEvB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sDAExB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,mBAAmB,CAAC;;IACH,WAAA,IAAA,aAAI,GAAE,CAAA;IAA2B,WAAA,IAAA,YAAG,GAAE,CAAA;IAAkB,WAAA,IAAA,kCAAU,GAAE,CAAA;;qCAAxD,+BAAkB;;+DAkBpD;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,oBAAoB,CAAC;;IACH,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,+BAAkB;;gEAQrD;mCAjGU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEU,+CAAqB;GADhD,wBAAwB,CAmGpC","sourcesContent":["import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch, Res, InternalServerErrorException } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { ExportTemplateService } from '../services/export-template.service';\nimport { CreateExportTemplateDto } from '../dtos/create-export-template.dto';\nimport { UpdateExportTemplateDto } from '../dtos/update-export-template.dto';\nimport { Response } from 'express';\nimport { StartExportSyncDto } from 'src/dtos/export.dto';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\n\n@ApiTags('Solid Core') \n@Controller('export-template') //FIXME: Change this to the model plural name \nexport class ExportTemplateController { \n constructor(private readonly service: ExportTemplateService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateExportTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateExportTemplateDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateExportTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateExportTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files, true);\n }\n \n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'showOnlySoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array }) \n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) { \n return this.service.find(query); \n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/startExport/sync')\n async startExportSync(@Body() dto: StartExportSyncDto, @Res() res: Response, @ActiveUser() activeUser: ActiveUserData) {\n const { filters, ...rest } = dto;\n let updateDto = { ...rest };\n // Check if templateName is present → create template\n if (updateDto?.templateName) {\n const newTemplate = await this.service.create(updateDto, []);\n updateDto = { ...updateDto, id: newTemplate.id };\n }\n const exportFileInfo = await this.service.startExportSync(updateDto, filters, activeUser);\n if (exportFileInfo.exportStream === null) {\n throw new InternalServerErrorException(\"Export stream is null\");\n }\n // ✅ Set response headers for streaming\n res.setHeader('Content-Disposition', `attachment; filename=\"${exportFileInfo.fileName}\"`);\n res.setHeader('Content-Type', exportFileInfo.mimeType);\n res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');\n // Pipe the strea to the response as an excel file\n exportFileInfo.exportStream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/startExport/async')\n async startExportAsync(@Body() dto: StartExportSyncDto) {\n const { filters, ...rest } = dto;\n let updateDto = { ...rest };\n if (updateDto.templateName) {\n const newTemplate = await this.service.create(updateDto, []);\n updateDto = { ...updateDto, id: newTemplate.id };\n }\n return this.service.startExportAsync(updateDto, filters);\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"export-template.controller.js","sourceRoot":"","sources":["../../src/controllers/export-template.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkK;AAClK,+DAA+D;AAC/D,6CAAmE;AACnE,iFAA4E;AAC5E,mFAA6E;AAC7E,mFAA6E;AAE7E,mDAAyD;AACzD,+EAAkE;AAElE,0EAA0E;AAInE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YAA6B,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IA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AAA,IAAA,cAAK,GAAE,CAAA;;;;uDAE9C;AAGK;IADL,IAAA,eAAM,EAAC,OAAO,CAAC;;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;;;;0DAEvB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sDAExB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,mBAAmB,CAAC;;IACH,WAAA,IAAA,aAAI,GAAE,CAAA;IAA2B,WAAA,IAAA,YAAG,GAAE,CAAA;IAAkB,WAAA,IAAA,kCAAU,GAAE,CAAA;;qCAAxD,+BAAkB;;+DAmBpD;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,oBAAoB,CAAC;;IACH,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,+BAAkB;;gEAQrD;mCAlGU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEU,+CAAqB;GADhD,wBAAwB,CAoGpC","sourcesContent":["import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch, Res, InternalServerErrorException } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { ExportTemplateService } from '../services/export-template.service';\nimport { CreateExportTemplateDto } from '../dtos/create-export-template.dto';\nimport { UpdateExportTemplateDto } from '../dtos/update-export-template.dto';\nimport { Response } from 'express';\nimport { StartExportSyncDto } from 'src/dtos/export.dto';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\nimport { setFileDownloadHeaders } from 'src/helpers/file-download.helper';\n\n@ApiTags('Solid Core') \n@Controller('export-template') //FIXME: Change this to the model plural name \nexport class ExportTemplateController { \n constructor(private readonly service: ExportTemplateService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateExportTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateExportTemplateDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateExportTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateExportTemplateDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files, true);\n }\n \n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'showOnlySoftDeleted', required: false, type: Boolean })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array }) \n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) { \n return this.service.find(query); \n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/startExport/sync')\n async startExportSync(@Body() dto: StartExportSyncDto, @Res() res: Response, @ActiveUser() activeUser: ActiveUserData) {\n const { filters, ...rest } = dto;\n let updateDto = { ...rest };\n // Check if templateName is present → create template\n if (updateDto?.templateName) {\n const newTemplate = await this.service.create(updateDto, []);\n updateDto = { ...updateDto, id: newTemplate.id };\n }\n const exportFileInfo = await this.service.startExportSync(updateDto, filters, activeUser);\n if (exportFileInfo.exportStream === null) {\n throw new InternalServerErrorException(\"Export stream is null\");\n }\n // ✅ Set response headers for streaming\n setFileDownloadHeaders(res, {\n fileName: exportFileInfo.fileName,\n mimeType: exportFileInfo.mimeType,\n });\n // Pipe the strea to the response as an excel file\n exportFileInfo.exportStream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/startExport/async')\n async startExportAsync(@Body() dto: StartExportSyncDto) {\n const { filters, ...rest } = dto;\n let updateDto = { ...rest };\n if (updateDto.templateName) {\n const newTemplate = await this.service.create(updateDto, []);\n updateDto = { ...updateDto, id: newTemplate.id };\n }\n return this.service.startExportAsync(updateDto, filters);\n }\n\n}\n"]}
|
|
@@ -11,6 +11,6 @@ export declare class ExportTransactionController {
|
|
|
11
11
|
findMany(query: any): Promise<any>;
|
|
12
12
|
findOne(id: string, query: any): Promise<import("..").ExportTransaction>;
|
|
13
13
|
deleteMany(ids: number[]): Promise<any>;
|
|
14
|
-
delete(id: number): Promise<import("..").ExportTransaction>;
|
|
14
|
+
delete(id: number): Promise<import("..").ExportTransaction[]>;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=export-transaction.controller.d.ts.map
|
|
@@ -136,7 +136,7 @@ __decorate([
|
|
|
136
136
|
__decorate([
|
|
137
137
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
138
138
|
(0, common_1.Delete)(':id'),
|
|
139
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/export-transaction.entity").ExportTransaction }),
|
|
139
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/export-transaction.entity").ExportTransaction] }),
|
|
140
140
|
__param(0, (0, common_1.Param)('id')),
|
|
141
141
|
__metadata("design:type", Function),
|
|
142
142
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -19,6 +19,6 @@ export declare class ImportTransactionErrorLogController {
|
|
|
19
19
|
findMany(query: any): Promise<any>;
|
|
20
20
|
findOne(id: string, query: any): Promise<import("..").ImportTransactionErrorLog>;
|
|
21
21
|
deleteMany(ids: number[]): Promise<any>;
|
|
22
|
-
delete(id: number): Promise<import("..").ImportTransactionErrorLog>;
|
|
22
|
+
delete(id: number): Promise<import("..").ImportTransactionErrorLog[]>;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=import-transaction-error-log.controller.d.ts.map
|
|
@@ -165,7 +165,7 @@ __decorate([
|
|
|
165
165
|
__decorate([
|
|
166
166
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
167
167
|
(0, common_1.Delete)(':id'),
|
|
168
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/import-transaction-error-log.entity").ImportTransactionErrorLog }),
|
|
168
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/import-transaction-error-log.entity").ImportTransactionErrorLog] }),
|
|
169
169
|
__param(0, (0, common_1.Param)('id')),
|
|
170
170
|
__metadata("design:type", Function),
|
|
171
171
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -27,6 +27,6 @@ export declare class ImportTransactionController {
|
|
|
27
27
|
startImportSync(id: string, activeUser: ActiveUserData): Promise<import("../services/import-transaction.service").ImportSyncResult>;
|
|
28
28
|
startImportAsync(id: string): Promise<void>;
|
|
29
29
|
deleteMany(ids: number[]): Promise<any>;
|
|
30
|
-
delete(id: number): Promise<import("..").ImportTransaction>;
|
|
30
|
+
delete(id: number): Promise<import("..").ImportTransaction[]>;
|
|
31
31
|
}
|
|
32
32
|
//# sourceMappingURL=import-transaction.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-transaction.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/import-transaction.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"import-transaction.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/import-transaction.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAQ3E,qBAEa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,wBAAwB;IAIxD,iBAAiB,CAA2B,eAAe,EAAE,MAAM,EAAmB,MAAM,EAAE,MAAM,EAAS,GAAG,EAAE,QAAQ;IAiB1H,qBAAqB,CAA2B,eAAe,EAAE,MAAM;IAQ7E,MAAM,CAAS,SAAS,EAAE,0BAA0B,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAOxG,UAAU,CAAS,UAAU,EAAE,0BAA0B,EAAE,EAAmB,UAAU,GAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAO;IAQtH,MAAM,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,0BAA0B,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAOjI,aAAa,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,0BAA0B,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAMlI,WAAW,CAAS,GAAG,EAAE,MAAM,EAAE;;;;IAMjC,OAAO,CAAc,EAAE,EAAE,MAAM;;;;IAe/B,QAAQ,CAAU,KAAK,EAAE,GAAG;IAM5B,OAAO,CAAc,EAAE,EAAE,MAAM,EAAW,KAAK,EAAE,GAAG;IAMpD,oBAAoB,CAAc,EAAE,EAAE,MAAM;IAM5C,2BAA2B,CAAc,EAAE,EAAE,MAAM,EAAS,GAAG,EAAE,QAAQ;IAazE,eAAe,CAAc,EAAE,EAAE,MAAM,EAAgB,UAAU,EAAE,cAAc;IAOjF,gBAAgB,CAAc,EAAE,EAAE,MAAM;IAMxC,UAAU,CAAS,GAAG,EAAE,MAAM,EAAE;IAMhC,MAAM,CAAc,EAAE,EAAE,MAAM;CAIrC"}
|
|
@@ -21,6 +21,7 @@ const import_transaction_service_1 = require("../services/import-transaction.ser
|
|
|
21
21
|
const create_import_transaction_dto_1 = require("../dtos/create-import-transaction.dto");
|
|
22
22
|
const update_import_transaction_dto_1 = require("../dtos/update-import-transaction.dto");
|
|
23
23
|
const active_user_decorator_1 = require("../decorators/active-user.decorator");
|
|
24
|
+
const file_download_helper_1 = require("../helpers/file-download.helper");
|
|
24
25
|
var ShowSoftDeleted;
|
|
25
26
|
(function (ShowSoftDeleted) {
|
|
26
27
|
ShowSoftDeleted["INCLUSIVE"] = "inclusive";
|
|
@@ -35,9 +36,10 @@ let ImportTransactionController = class ImportTransactionController {
|
|
|
35
36
|
if (importTemplateFileInfo.stream === null) {
|
|
36
37
|
throw new common_1.InternalServerErrorException("Sample Import template stream is null");
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
(0, file_download_helper_1.setFileDownloadHeaders)(res, {
|
|
40
|
+
fileName: importTemplateFileInfo.fileName,
|
|
41
|
+
mimeType: importTemplateFileInfo.mimeType,
|
|
42
|
+
});
|
|
41
43
|
importTemplateFileInfo.stream.pipe(res);
|
|
42
44
|
}
|
|
43
45
|
async getImportInstructions(modelMetadataId) {
|
|
@@ -75,9 +77,7 @@ let ImportTransactionController = class ImportTransactionController {
|
|
|
75
77
|
if (stream === null) {
|
|
76
78
|
throw new common_1.InternalServerErrorException("Failed records stream is null");
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
res.setHeader('Content-Type', mimeType);
|
|
80
|
-
res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');
|
|
80
|
+
(0, file_download_helper_1.setFileDownloadHeaders)(res, { fileName, mimeType });
|
|
81
81
|
stream.pipe(res);
|
|
82
82
|
}
|
|
83
83
|
async startImportSync(id, activeUser) {
|
|
@@ -257,7 +257,7 @@ __decorate([
|
|
|
257
257
|
__decorate([
|
|
258
258
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
259
259
|
(0, common_1.Delete)(':id'),
|
|
260
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/import-transaction.entity").ImportTransaction }),
|
|
260
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/import-transaction.entity").ImportTransaction] }),
|
|
261
261
|
__param(0, (0, common_1.Param)('id')),
|
|
262
262
|
__metadata("design:type", Function),
|
|
263
263
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-transaction.controller.js","sourceRoot":"","sources":["../../src/controllers/import-transaction.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkK;AAClK,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2BAA2B;IAFvC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,oBAAoB,CAAC;qCAEO,qDAAwB;GADnD,2BAA2B,CAsIvC","sourcesContent":["import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch, InternalServerErrorException, Res } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { ImportFormat, ImportTransactionService } from '../services/import-transaction.service';\nimport { CreateImportTransactionDto } from '../dtos/create-import-transaction.dto';\nimport { UpdateImportTransactionDto } from '../dtos/update-import-transaction.dto';\nimport { Response } from 'express';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\n\nenum ShowSoftDeleted {\n INCLUSIVE = \"inclusive\",\n EXCLUSIVE = \"exclusive\",\n}\n\n@ApiTags('Solid Core')\n@Controller('import-transaction')\nexport class ImportTransactionController {\n constructor(private readonly service: ImportTransactionService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Get('/import-template/:modelMetadataId/:format')\n async getImportTemplate(@Param('modelMetadataId') modelMetadataId: number, @Param('format') format: string, @Res() res: Response) {\n const importTemplateFileInfo = await this.service.getImportTemplate(+modelMetadataId, format as ImportFormat);\n if (importTemplateFileInfo.stream === null) {\n throw new InternalServerErrorException(\"Sample Import template stream is null\");\n }\n\n // ✅ Set response headers for streaming\n res.setHeader('Content-Disposition', `attachment; filename=\"${importTemplateFileInfo.fileName}\"`);\n res.setHeader('Content-Type', importTemplateFileInfo.mimeType);\n res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');\n // Pipe the stream to the response as an excel file\n importTemplateFileInfo.stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/import-instructions/:modelMetadataId')\n async getImportInstructions(@Param('modelMetadataId') modelMetadataId: number) {\n // return this.service.getImportInstructions(modelMetadataId);\n return this.service.getImportInstructions(modelMetadataId);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateImportTransactionDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateImportTransactionDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateImportTransactionDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateImportTransactionDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files, true);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[]) {\n return this.service.recoverMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number) {\n return this.service.recover(id);\n }\n \n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array }) \n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) { \n return this.service.find(query); \n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id/import-mapping-info')\n async getImportMappingInfo(@Param('id') id: string) {\n return this.service.getImportMappingInfo(+id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id/export-failed-import-records')\n async exportFailedImportedImports(@Param('id') id: string, @Res() res: Response) {\n const {stream, fileName, mimeType} = await this.service.exportFailedImportedImports(+id);\n if (stream === null) {\n throw new InternalServerErrorException(\"Failed records stream is null\");\n }\n // ✅ Set response headers for streaming\n res.setHeader('Content-Disposition', `attachment; filename=\"${fileName}\"`);\n res.setHeader('Content-Type', mimeType);\n res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');\n // Pipe the strea to the response as an excel file\n stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(':id/start-import/sync')\n async startImportSync(@Param('id') id: string, @ActiveUser() activeUser: ActiveUserData) {\n console.log(\"Active User in startImportSync:\", activeUser);\n return this.service.startImportSync(+id, activeUser);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(':id/start-import/async')\n async startImportAsync(@Param('id') id: string) {\n return this.service.startImportAsync(+id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"import-transaction.controller.js","sourceRoot":"","sources":["../../src/controllers/import-transaction.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAkK;AAClK,+DAA+D;AAC/D,6CAAmE;AACnE,uFAAgG;AAChG,yFAAmF;AACnF,yFAAmF;AAEnF,+EAAkE;AAElE,0EAA0E;AAE1E,I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DAE9C;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,yBAAyB,CAAC;;IACH,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;uEAEtC;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,kCAAkC,CAAC;;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,YAAG,GAAE,CAAA;;;;8EAShE;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,uBAAuB,CAAC;;IACP,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,kCAAU,GAAE,CAAA;;;;kEAG3D;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,wBAAwB,CAAC;;IACP,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;mEAElC;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,OAAO,CAAC;;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;;;;6DAEvB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;yDAExB;sCAnIU,2BAA2B;IAFvC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,oBAAoB,CAAC;qCAEO,qDAAwB;GADnD,2BAA2B,CAqIvC","sourcesContent":["import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch, InternalServerErrorException, Res } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { ImportFormat, ImportTransactionService } from '../services/import-transaction.service';\nimport { CreateImportTransactionDto } from '../dtos/create-import-transaction.dto';\nimport { UpdateImportTransactionDto } from '../dtos/update-import-transaction.dto';\nimport { Response } from 'express';\nimport { ActiveUser } from 'src/decorators/active-user.decorator';\nimport { ActiveUserData } from 'src/interfaces/active-user-data.interface';\nimport { setFileDownloadHeaders } from 'src/helpers/file-download.helper';\n\nenum ShowSoftDeleted {\n INCLUSIVE = \"inclusive\",\n EXCLUSIVE = \"exclusive\",\n}\n\n@ApiTags('Solid Core')\n@Controller('import-transaction')\nexport class ImportTransactionController {\n constructor(private readonly service: ImportTransactionService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Get('/import-template/:modelMetadataId/:format')\n async getImportTemplate(@Param('modelMetadataId') modelMetadataId: number, @Param('format') format: string, @Res() res: Response) {\n const importTemplateFileInfo = await this.service.getImportTemplate(+modelMetadataId, format as ImportFormat);\n if (importTemplateFileInfo.stream === null) {\n throw new InternalServerErrorException(\"Sample Import template stream is null\");\n }\n\n // ✅ Set response headers for streaming\n setFileDownloadHeaders(res, {\n fileName: importTemplateFileInfo.fileName,\n mimeType: importTemplateFileInfo.mimeType,\n });\n // Pipe the stream to the response as an excel file\n importTemplateFileInfo.stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/import-instructions/:modelMetadataId')\n async getImportInstructions(@Param('modelMetadataId') modelMetadataId: number) {\n // return this.service.getImportInstructions(modelMetadataId);\n return this.service.getImportInstructions(modelMetadataId);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateImportTransactionDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateImportTransactionDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateImportTransactionDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateImportTransactionDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files, true);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[]) {\n return this.service.recoverMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number) {\n return this.service.recover(id);\n }\n \n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array }) \n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) { \n return this.service.find(query); \n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id/import-mapping-info')\n async getImportMappingInfo(@Param('id') id: string) {\n return this.service.getImportMappingInfo(+id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id/export-failed-import-records')\n async exportFailedImportedImports(@Param('id') id: string, @Res() res: Response) {\n const {stream, fileName, mimeType} = await this.service.exportFailedImportedImports(+id);\n if (stream === null) {\n throw new InternalServerErrorException(\"Failed records stream is null\");\n }\n // ✅ Set response headers for streaming\n setFileDownloadHeaders(res, { fileName, mimeType });\n // Pipe the strea to the response as an excel file\n stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(':id/start-import/sync')\n async startImportSync(@Param('id') id: string, @ActiveUser() activeUser: ActiveUserData) {\n console.log(\"Active User in startImportSync:\", activeUser);\n return this.service.startImportSync(+id, activeUser);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post(':id/start-import/async')\n async startImportAsync(@Param('id') id: string) {\n return this.service.startImportAsync(+id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n\n}\n"]}
|
|
@@ -19,6 +19,6 @@ export declare class ListOfValuesController {
|
|
|
19
19
|
findMany(query: any): Promise<any>;
|
|
20
20
|
findOne(id: string, query: any): Promise<import("..").ListOfValues>;
|
|
21
21
|
deleteMany(ids: number[]): Promise<any>;
|
|
22
|
-
delete(id: number): Promise<import("..").ListOfValues>;
|
|
22
|
+
delete(id: number): Promise<import("..").ListOfValues[]>;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=list-of-values.controller.d.ts.map
|
|
@@ -165,7 +165,7 @@ __decorate([
|
|
|
165
165
|
__decorate([
|
|
166
166
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
167
167
|
(0, common_1.Delete)(':id'),
|
|
168
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/list-of-values.entity").ListOfValues }),
|
|
168
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/list-of-values.entity").ListOfValues] }),
|
|
169
169
|
__param(0, (0, common_1.Param)('id')),
|
|
170
170
|
__metadata("design:type", Function),
|
|
171
171
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -19,6 +19,6 @@ export declare class LocaleController {
|
|
|
19
19
|
findMany(query: any): Promise<any>;
|
|
20
20
|
findOne(id: string, query: any): Promise<import("..").Locale>;
|
|
21
21
|
deleteMany(ids: number[]): Promise<any>;
|
|
22
|
-
delete(id: number): Promise<import("..").Locale>;
|
|
22
|
+
delete(id: number): Promise<import("..").Locale[]>;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=locale.controller.d.ts.map
|
|
@@ -165,7 +165,7 @@ __decorate([
|
|
|
165
165
|
__decorate([
|
|
166
166
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
167
167
|
(0, common_1.Delete)(':id'),
|
|
168
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/locale.entity").Locale }),
|
|
168
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/locale.entity").Locale] }),
|
|
169
169
|
__param(0, (0, common_1.Param)('id')),
|
|
170
170
|
__metadata("design:type", Function),
|
|
171
171
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -11,6 +11,6 @@ export declare class McpAuditLogController {
|
|
|
11
11
|
findMany(query: any): Promise<any>;
|
|
12
12
|
findOne(id: string, query: any): Promise<import("..").McpAuditLog>;
|
|
13
13
|
deleteMany(ids: number[]): Promise<any>;
|
|
14
|
-
delete(id: number): Promise<import("..").McpAuditLog>;
|
|
14
|
+
delete(id: number): Promise<import("..").McpAuditLog[]>;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=mcp-audit-log.controller.d.ts.map
|
|
@@ -133,7 +133,7 @@ __decorate([
|
|
|
133
133
|
__decorate([
|
|
134
134
|
(0, swagger_1.ApiBearerAuth)('jwt'),
|
|
135
135
|
(0, common_1.Delete)(':id'),
|
|
136
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/mcp-audit-log.entity").McpAuditLog }),
|
|
136
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/mcp-audit-log.entity").McpAuditLog] }),
|
|
137
137
|
__param(0, (0, common_1.Param)('id')),
|
|
138
138
|
__metadata("design:type", Function),
|
|
139
139
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -10,7 +10,7 @@ export declare class MediaController {
|
|
|
10
10
|
insertMany(createDtos: CreateMediaDto[], filesArray: Express.Multer.File[][], solidRequestContext: SolidRequestContextDto): Promise<import("..").Media[]>;
|
|
11
11
|
update(id: number, updateDto: UpdateMediaDto, files: Array<Express.Multer.File>, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
|
|
12
12
|
partialUpdate(id: number, updateDto: UpdateMediaDto, files: Array<Express.Multer.File>, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
|
|
13
|
-
upload(files: Array<Express.Multer.File>, createDto: CreateMediaDto, solidRequestContext: SolidRequestContextDto): Promise<any
|
|
13
|
+
upload(files: Array<Express.Multer.File>, createDto: CreateMediaDto, solidRequestContext: SolidRequestContextDto): Promise<any>;
|
|
14
14
|
recoverMany(ids: number[], solidRequestContext: SolidRequestContextDto): Promise<{
|
|
15
15
|
message: string;
|
|
16
16
|
recoveredIds: number[];
|
|
@@ -23,6 +23,6 @@ export declare class MediaController {
|
|
|
23
23
|
download(id: string, disposition: string, res: Response, solidRequestContext: SolidRequestContextDto): Promise<void>;
|
|
24
24
|
findOne(id: string, query: any, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
|
|
25
25
|
deleteMany(ids: number[], solidRequestContext: SolidRequestContextDto): Promise<any>;
|
|
26
|
-
delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media>;
|
|
26
|
+
delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").Media[]>;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=media.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/media.controller.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,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