@solidxai/core 0.1.13-beta.9 → 0.1.13
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 +7465 -0
- package/README.md +19 -0
- package/dist/commands/run-tests.command.d.ts +2 -0
- package/dist/commands/run-tests.command.d.ts.map +1 -1
- package/dist/commands/run-tests.command.js +20 -3
- package/dist/commands/run-tests.command.js.map +1 -1
- package/dist/config/cache.options.d.ts.map +1 -1
- package/dist/config/cache.options.js +2 -2
- package/dist/config/cache.options.js.map +1 -1
- package/dist/constants/error-messages.d.ts +7 -0
- package/dist/constants/error-messages.d.ts.map +1 -1
- package/dist/constants/error-messages.js +7 -0
- package/dist/constants/error-messages.js.map +1 -1
- package/dist/constants/media-file-types.d.ts +3 -0
- package/dist/constants/media-file-types.d.ts.map +1 -1
- package/dist/constants/media-file-types.js +47 -8
- package/dist/constants/media-file-types.js.map +1 -1
- package/dist/constants/success-messages.d.ts +3 -0
- package/dist/constants/success-messages.d.ts.map +1 -1
- package/dist/constants/success-messages.js +3 -0
- package/dist/constants/success-messages.js.map +1 -1
- package/dist/controllers/authentication.controller.d.ts +1 -1
- package/dist/controllers/authentication.controller.d.ts.map +1 -1
- package/dist/controllers/authentication.controller.js +4 -3
- package/dist/controllers/authentication.controller.js.map +1 -1
- package/dist/controllers/field-metadata.controller.d.ts +2 -2
- package/dist/controllers/mpin-authentication.controller.d.ts +44 -0
- package/dist/controllers/mpin-authentication.controller.d.ts.map +1 -0
- package/dist/controllers/mpin-authentication.controller.js +102 -0
- package/dist/controllers/mpin-authentication.controller.js.map +1 -0
- package/dist/dtos/change-mpin.dto.d.ts +6 -0
- package/dist/dtos/change-mpin.dto.d.ts.map +1 -0
- package/dist/dtos/change-mpin.dto.js +39 -0
- package/dist/dtos/change-mpin.dto.js.map +1 -0
- package/dist/dtos/create-field-metadata.dto.d.ts +3 -6
- package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
- package/dist/dtos/create-field-metadata.dto.js +15 -10
- package/dist/dtos/create-field-metadata.dto.js.map +1 -1
- package/dist/dtos/create-model-sequence.dto.d.ts +1 -1
- package/dist/dtos/create-model-sequence.dto.d.ts.map +1 -1
- package/dist/dtos/create-model-sequence.dto.js +1 -1
- package/dist/dtos/create-model-sequence.dto.js.map +1 -1
- package/dist/dtos/mpin-login.dto.d.ts +5 -0
- package/dist/dtos/mpin-login.dto.d.ts.map +1 -0
- package/dist/dtos/mpin-login.dto.js +33 -0
- package/dist/dtos/mpin-login.dto.js.map +1 -0
- package/dist/dtos/setup-mpin.dto.d.ts +7 -0
- package/dist/dtos/setup-mpin.dto.d.ts.map +1 -0
- package/dist/dtos/setup-mpin.dto.js +47 -0
- package/dist/dtos/setup-mpin.dto.js.map +1 -0
- package/dist/entities/dashboard-user-layout.entity.js +2 -2
- package/dist/entities/dashboard-user-layout.entity.js.map +1 -1
- package/dist/entities/field-metadata.entity.d.ts +1 -0
- package/dist/entities/field-metadata.entity.d.ts.map +1 -1
- package/dist/entities/field-metadata.entity.js +5 -1
- package/dist/entities/field-metadata.entity.js.map +1 -1
- package/dist/entities/user-device-credential.entity.d.ts +18 -0
- package/dist/entities/user-device-credential.entity.d.ts.map +1 -0
- package/dist/entities/user-device-credential.entity.js +91 -0
- package/dist/entities/user-device-credential.entity.js.map +1 -0
- package/dist/entities/user.entity.js +2 -2
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/view-metadata.entity.js.map +1 -1
- package/dist/entities/workflow-execution-artifact.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution-artifact.entity.js +4 -3
- package/dist/entities/workflow-execution-artifact.entity.js.map +1 -1
- package/dist/entities/workflow-execution-log.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution-log.entity.js +4 -3
- package/dist/entities/workflow-execution-log.entity.js.map +1 -1
- package/dist/entities/workflow-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution.entity.js +3 -2
- package/dist/entities/workflow-execution.entity.js.map +1 -1
- package/dist/entities/workflow-secret.entity.d.ts.map +1 -1
- package/dist/entities/workflow-secret.entity.js +3 -2
- package/dist/entities/workflow-secret.entity.js.map +1 -1
- package/dist/entities/workflow-step-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-step-execution.entity.js +3 -2
- package/dist/entities/workflow-step-execution.entity.js.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.js +6 -5
- package/dist/entities/workflow-trigger-execution.entity.js.map +1 -1
- package/dist/filters/http-exception.filter.d.ts.map +1 -1
- package/dist/filters/http-exception.filter.js +5 -1
- package/dist/filters/http-exception.filter.js.map +1 -1
- package/dist/helpers/bootstrap.helper.d.ts +5 -2
- package/dist/helpers/bootstrap.helper.d.ts.map +1 -1
- package/dist/helpers/bootstrap.helper.js +7 -3
- package/dist/helpers/bootstrap.helper.js.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts +6 -0
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js +54 -27
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js.map +1 -1
- package/dist/helpers/file-download.helper.d.ts.map +1 -1
- package/dist/helpers/file-download.helper.js +6 -1
- package/dist/helpers/file-download.helper.js.map +1 -1
- package/dist/helpers/security.helper.d.ts +5 -1
- package/dist/helpers/security.helper.d.ts.map +1 -1
- package/dist/helpers/security.helper.js +15 -4
- package/dist/helpers/security.helper.js.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.d.ts.map +1 -1
- package/dist/helpers/solid-core-error-codes-provider.service.js +45 -0
- package/dist/helpers/solid-core-error-codes-provider.service.js.map +1 -1
- package/dist/helpers/solid-microservice-adapter.service.d.ts.map +1 -1
- package/dist/helpers/solid-microservice-adapter.service.js +1 -1
- package/dist/helpers/solid-microservice-adapter.service.js.map +1 -1
- package/dist/helpers/typeorm-db-helper.d.ts.map +1 -1
- package/dist/helpers/typeorm-db-helper.js +9 -0
- package/dist/helpers/typeorm-db-helper.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/active-user-data.interface.d.ts +1 -0
- package/dist/interfaces/active-user-data.interface.d.ts.map +1 -1
- package/dist/interfaces/active-user-data.interface.js.map +1 -1
- package/dist/repository/user-device-credential.repository.d.ts +12 -0
- package/dist/repository/user-device-credential.repository.d.ts.map +1 -0
- package/dist/repository/user-device-credential.repository.js +34 -0
- package/dist/repository/user-device-credential.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +7 -3
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +168 -2
- package/dist/services/api-key.service.d.ts.map +1 -1
- package/dist/services/api-key.service.js +1 -1
- package/dist/services/api-key.service.js.map +1 -1
- package/dist/services/authentication.service.d.ts +5 -4
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +50 -19
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +5 -1
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +48 -13
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts +1 -2
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +2 -16
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +2 -1
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/draft-publish-helper.service.d.ts +1 -0
- package/dist/services/draft-publish-helper.service.d.ts.map +1 -1
- package/dist/services/draft-publish-helper.service.js +38 -4
- package/dist/services/draft-publish-helper.service.js.map +1 -1
- package/dist/services/field-metadata.service.d.ts +2 -2
- package/dist/services/field-metadata.service.d.ts.map +1 -1
- package/dist/services/field-metadata.service.js +4 -1
- package/dist/services/field-metadata.service.js.map +1 -1
- package/dist/services/media-storage.utils.d.ts +1 -0
- package/dist/services/media-storage.utils.d.ts.map +1 -1
- package/dist/services/media-storage.utils.js +12 -1
- package/dist/services/media-storage.utils.js.map +1 -1
- package/dist/services/media.service.d.ts.map +1 -1
- package/dist/services/media.service.js +1 -0
- package/dist/services/media.service.js.map +1 -1
- package/dist/services/module-metadata.service.d.ts.map +1 -1
- package/dist/services/module-metadata.service.js +9 -1
- package/dist/services/module-metadata.service.js.map +1 -1
- package/dist/services/mpin.service.d.ts +67 -0
- package/dist/services/mpin.service.d.ts.map +1 -0
- package/dist/services/mpin.service.js +282 -0
- package/dist/services/mpin.service.js.map +1 -0
- package/dist/services/refresh-token-ids-storage.service.d.ts +25 -6
- package/dist/services/refresh-token-ids-storage.service.d.ts.map +1 -1
- package/dist/services/refresh-token-ids-storage.service.js +80 -42
- package/dist/services/refresh-token-ids-storage.service.js.map +1 -1
- package/dist/services/setting.service.d.ts.map +1 -1
- package/dist/services/setting.service.js +6 -1
- package/dist/services/setting.service.js.map +1 -1
- package/dist/services/settings/default-settings-provider.service.d.ts +202 -6
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +114 -3
- package/dist/services/settings/default-settings-provider.service.js.map +1 -1
- package/dist/solid-core.module.d.ts +1 -3
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +14 -39
- package/dist/solid-core.module.js.map +1 -1
- package/dist/testing/reporter/console-reporter.d.ts +3 -0
- package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
- package/dist/testing/reporter/console-reporter.js +2 -0
- package/dist/testing/reporter/console-reporter.js.map +1 -1
- package/dist/testing/reporter/progress-reporter.d.ts +64 -0
- package/dist/testing/reporter/progress-reporter.d.ts.map +1 -0
- package/dist/testing/reporter/progress-reporter.js +224 -0
- package/dist/testing/reporter/progress-reporter.js.map +1 -0
- package/dist/testing/reporter/reporter.types.d.ts +3 -0
- package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
- package/dist/testing/reporter/reporter.types.js.map +1 -1
- package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
- package/dist/testing/runner/run-from-metadata.js +1 -0
- package/dist/testing/runner/run-from-metadata.js.map +1 -1
- package/dist/theme/theme-registry.d.ts +14 -0
- package/dist/theme/theme-registry.d.ts.map +1 -0
- package/dist/theme/theme-registry.js +147 -0
- package/dist/theme/theme-registry.js.map +1 -0
- package/package.json +2 -2
- package/src/commands/run-tests.command.ts +17 -3
- package/src/config/cache.options.ts +9 -1
- package/src/constants/error-messages.ts +14 -0
- package/src/constants/media-file-types.ts +87 -9
- package/src/constants/success-messages.ts +5 -0
- package/src/controllers/authentication.controller.ts +5 -2
- package/src/controllers/mpin-authentication.controller.ts +67 -0
- package/src/dtos/change-mpin.dto.ts +18 -0
- package/src/dtos/create-field-metadata.dto.ts +17 -9
- package/src/dtos/create-model-sequence.dto.ts +1 -1
- package/src/dtos/mpin-login.dto.ts +24 -0
- package/src/dtos/setup-mpin.dto.ts +51 -0
- package/src/entities/dashboard-user-layout.entity.ts +2 -2
- package/src/entities/field-metadata.entity.ts +3 -0
- package/src/entities/user-device-credential.entity.ts +130 -0
- package/src/entities/user.entity.ts +2 -2
- package/src/entities/view-metadata.entity.ts +2 -2
- package/src/entities/workflow-execution-artifact.entity.ts +4 -3
- package/src/entities/workflow-execution-log.entity.ts +4 -3
- package/src/entities/workflow-execution.entity.ts +3 -2
- package/src/entities/workflow-secret.entity.ts +3 -2
- package/src/entities/workflow-step-execution.entity.ts +3 -2
- package/src/entities/workflow-trigger-execution.entity.ts +6 -5
- package/src/filters/http-exception.filter.ts +11 -1
- package/src/helpers/bootstrap.helper.ts +43 -6
- package/src/helpers/field-crud-managers/MediaFieldCrudManager.ts +73 -34
- package/src/helpers/file-download.helper.ts +15 -1
- package/src/helpers/security.helper.ts +35 -8
- package/src/helpers/solid-core-error-codes-provider.service.ts +53 -0
- package/src/helpers/solid-microservice-adapter.service.ts +6 -1
- package/src/helpers/typeorm-db-helper.ts +12 -1
- package/src/index.ts +6 -0
- package/src/interfaces/active-user-data.interface.ts +9 -0
- package/src/repository/user-device-credential.repository.ts +17 -0
- package/src/seeders/module-metadata-seeder.service.ts +11 -3
- package/src/seeders/seed-data/solid-core-metadata.json +168 -2
- package/src/services/api-key.service.ts +13 -1
- package/src/services/authentication.service.ts +127 -36
- package/src/services/chatter-message.service.ts +78 -15
- package/src/services/crud-helper.service.ts +19 -16
- package/src/services/crud.service.ts +3 -1
- package/src/services/draft-publish-helper.service.ts +56 -4
- package/src/services/field-metadata.service.ts +5 -2
- package/src/services/media-storage.utils.ts +26 -1
- package/src/services/media.service.ts +1 -0
- package/src/services/module-metadata.service.ts +10 -1
- package/src/services/mpin.service.ts +447 -0
- package/src/services/refresh-token-ids-storage.service.ts +229 -90
- package/src/services/setting.service.ts +8 -1
- package/src/services/settings/default-settings-provider.service.ts +119 -3
- package/src/solid-core.module.ts +26 -12
- package/src/testing/README.md +2 -1
- package/src/testing/reporter/console-reporter.ts +4 -0
- package/src/testing/reporter/progress-reporter.ts +251 -0
- package/src/testing/reporter/reporter.types.ts +3 -0
- package/src/testing/runner/run-from-metadata.ts +1 -0
- package/src/theme/theme-registry.ts +181 -0
- package/CLAUDE.md +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution-log.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAAgE;AAChE,qFAAwE;
|
|
1
|
+
{"version":3,"file":"workflow-execution-log.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCA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;oDAC7B;AAIf;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAC3B;AAIjB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACrB;AAIvB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;8BAC7B,IAAI;wDAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACnC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAClC;+BAlDL,oBAAoB;IADhC,IAAA,gBAAM,EAAC,2BAA2B,CAAC;GACvB,oBAAoB,CAmDhC","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowExecution } from './workflow-execution.entity';\nimport { WorkflowStepExecution } from './workflow-step-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_execution_log')\nexport class WorkflowExecutionLog extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n logKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { nullable: false })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @ManyToOne(() => WorkflowStepExecution, { nullable: true })\n @JoinColumn()\n workflowStepExecution: WorkflowStepExecution;\n\n @Index()\n @Column({ type: \"varchar\", default: \"info\" })\n level: string = \"info\";\n\n @Column({ type: \"text\" })\n message: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n eventType: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n source: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n nodeId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n nodeType: string;\n\n @Index()\n @Column({ type: \"integer\", nullable: true })\n sequenceNumber: number;\n\n @Index()\n @Column({ ...getColumnType('datetime') })\n occurredAt: Date;\n\n @Column({ type: \"simple-json\", nullable: true })\n context: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n metadata: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAGjF,qBACa,iBAAkB,SAAQ,YAAY;IAG/C,mBAAmB,EAAE,MAAM,CAAC;IAK5B,kBAAkB,EAAE,kBAAkB,CAAC;IAIvC,WAAW,EAAE,MAAM,CAAC;IAGpB,mBAAmB,EAAE,MAAM,CAAC;IAI5B,MAAM,EAAE,MAAM,CAAa;IAI3B,WAAW,EAAE,MAAM,CAAY;IAI/B,SAAS,EAAE,IAAI,CAAC;IAIhB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,YAAY,EAAE,GAAG,CAAC;IAMlB,aAAa,EAAE,GAAG,CAAC;IAGnB,iBAAiB,EAAE,MAAM,CAAC;IAI1B,kBAAkB,EAAE,MAAM,CAAC;IAG3B,kBAAkB,EAAE,MAAM,CAAC;IAG3B,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,EAAE,GAAG,CAAC;IAIlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAGhD,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;IAG9C,0BAA0B,EAAE,yBAAyB,EAAE,CAAC;CAC3D"}
|
|
@@ -17,6 +17,7 @@ const workflow_definition_entity_1 = require("./workflow-definition.entity");
|
|
|
17
17
|
const workflow_step_execution_entity_1 = require("./workflow-step-execution.entity");
|
|
18
18
|
const workflow_execution_log_entity_1 = require("./workflow-execution-log.entity");
|
|
19
19
|
const workflow_execution_artifact_entity_1 = require("./workflow-execution-artifact.entity");
|
|
20
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
20
21
|
let WorkflowExecution = class WorkflowExecution extends common_entity_1.CommonEntity {
|
|
21
22
|
constructor() {
|
|
22
23
|
super(...arguments);
|
|
@@ -60,12 +61,12 @@ __decorate([
|
|
|
60
61
|
], WorkflowExecution.prototype, "triggerType", void 0);
|
|
61
62
|
__decorate([
|
|
62
63
|
(0, typeorm_1.Index)(),
|
|
63
|
-
(0, typeorm_1.Column)({
|
|
64
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
64
65
|
__metadata("design:type", Date)
|
|
65
66
|
], WorkflowExecution.prototype, "startedAt", void 0);
|
|
66
67
|
__decorate([
|
|
67
68
|
(0, typeorm_1.Index)(),
|
|
68
|
-
(0, typeorm_1.Column)({
|
|
69
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
69
70
|
__metadata("design:type", Date)
|
|
70
71
|
], WorkflowExecution.prototype, "finishedAt", void 0);
|
|
71
72
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAkF;AAClF,6EAAiE;AACjE,qFAAyE;AACzE,mFAAuE;AACvE,6FAAiF;
|
|
1
|
+
{"version":3,"file":"workflow-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAkF;AAClF,6EAAiE;AACjE,qFAAyE;AACzE,mFAAuE;AACvE,6FAAiF;AACjF,oEAA8D;AAGvD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,4BAAY;IAA5C;;QAmBH,WAAM,GAAW,SAAS,CAAC;QAI3B,gBAAW,GAAW,QAAQ,CAAC;KAkDlC;;;;CAAA,CAAA;AAzEY,8CAAiB;AAG1B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;8DACA;AAK5B;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+CAAkB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC7E,IAAA,oBAAU,GAAE;8BACO,+CAAkB;6DAAC;AAIvC;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EA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6DACjB;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;;6DAC1C;AAG3B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACpB;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAC9B;AAIlB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACjB;AAG1B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sDAAqB,EAAE,qBAAqB,CAAC,EAAE,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iEAC5E;AAGhD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oDAAoB,EAAE,oBAAoB,CAAC,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gEAC3E;AAG9C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8DAAyB,EAAE,yBAAyB,CAAC,EAAE,CAAC,yBAAyB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qEAChF;4BAxE/C,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;GACnB,iBAAiB,CAyE7B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';\nimport { WorkflowDefinition } from './workflow-definition.entity'\nimport { WorkflowStepExecution } from './workflow-step-execution.entity';\nimport { WorkflowExecutionLog } from './workflow-execution-log.entity';\nimport { WorkflowExecutionArtifact } from './workflow-execution-artifact.entity';\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_execution')\nexport class WorkflowExecution extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n executionIdentifier: string;\n\n @Index()\n @ManyToOne(() => WorkflowDefinition, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n workflowDefinition: WorkflowDefinition;\n\n @Index()\n @Column({ type: \"varchar\" })\n workflowKey: string;\n\n @Column({ type: \"varchar\", nullable: true })\n workflowDisplayName: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"created\" })\n status: string = \"created\";\n\n @Index()\n @Column({ type: \"varchar\", default: \"manual\" })\n triggerType: string = \"manual\";\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n startedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n finishedAt: Date;\n\n @Column({ type: \"bigint\", nullable: true })\n durationMs: bigint;\n\n @Column({ type: \"simple-json\", nullable: true })\n inputPayload: any;\n\n // Retained for schema/backward compatibility only. Combined workflow output\n // is no longer persisted here because large loops can make this payload\n // duplicate all step outputs and cause OOMs; use step execution outputs.\n @Column({ type: \"simple-json\", nullable: true })\n outputPayload: any;\n\n @Column({ type: \"varchar\", nullable: true })\n definitionVersion: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n definitionChecksum: string;\n\n @Column({ name: \"definition_snapshot\", type: \"text\", nullable: true})\n definitionSnapshot: string;\n\n @Column({ type: \"text\", nullable: true })\n errorSummary: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n errorDetails: any;\n\n @Index()\n @Column({ type: \"bigint\", nullable: true })\n requestedByUserId: bigint;\n\n @OneToMany(() => WorkflowStepExecution, workflowStepExecution => workflowStepExecution.workflowExecution, { cascade: true })\n workflowStepExecutions: WorkflowStepExecution[];\n\n @OneToMany(() => WorkflowExecutionLog, workflowExecutionLog => workflowExecutionLog.workflowExecution, { cascade: true })\n workflowExecutionLogs: WorkflowExecutionLog[];\n\n @OneToMany(() => WorkflowExecutionArtifact, workflowExecutionArtifact => workflowExecutionArtifact.workflowExecution, { cascade: true })\n workflowExecutionArtifacts: WorkflowExecutionArtifact[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-secret.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBACa,cAAe,SAAQ,YAAY;IAG5C,GAAG,EAAE,MAAM,CAAC;IAIZ,WAAW,EAAE,MAAM,CAAC;IAGpB,WAAW,EAAE,MAAM,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC;IAId,SAAS,EAAE,MAAM,CAAY;IAI7B,MAAM,EAAE,MAAM,CAAY;IAG1B,aAAa,EAAE,IAAI,CAAC;IAGpB,cAAc,EAAE,IAAI,CAAC;CACxB"}
|
|
@@ -13,6 +13,7 @@ exports.WorkflowSecret = void 0;
|
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const common_entity_1 = require("./common.entity");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
16
17
|
let WorkflowSecret = class WorkflowSecret extends common_entity_1.CommonEntity {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
@@ -53,11 +54,11 @@ __decorate([
|
|
|
53
54
|
__metadata("design:type", String)
|
|
54
55
|
], WorkflowSecret.prototype, "status", void 0);
|
|
55
56
|
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)({
|
|
57
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
57
58
|
__metadata("design:type", Date)
|
|
58
59
|
], WorkflowSecret.prototype, "lastRotatedAt", void 0);
|
|
59
60
|
__decorate([
|
|
60
|
-
(0, typeorm_1.Column)({
|
|
61
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
61
62
|
__metadata("design:type", Date)
|
|
62
63
|
], WorkflowSecret.prototype, "lastAccessedAt", void 0);
|
|
63
64
|
exports.WorkflowSecret = WorkflowSecret = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAgD;
|
|
1
|
+
{"version":3,"file":"workflow-secret.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAgD;AAChD,oEAA8D;AAGvD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;IAAzC;;QAiBH,cAAS,GAAW,QAAQ,CAAC;QAI7B,WAAM,GAAW,QAAQ,CAAC;KAO7B;;;;CAAA,CAAA;AA5BY,wCAAc;AAGvB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2CAChB;AAIZ;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;mDACR;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACrB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACX;AAId;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;iDAClB;AAI7B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;8CACrB;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;8BAC1C,IAAI;qDAAC;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;8BACzC,IAAI;sDAAC;yBA3BZ,cAAc;IAD1B,IAAA,gBAAM,EAAC,oBAAoB,CAAC;GAChB,cAAc,CA4B1B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index } from 'typeorm';\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_secret')\nexport class WorkflowSecret extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n key: string;\n\n @Index()\n @Column({ type: \"varchar\" })\n displayName: string;\n\n @Column({ type: \"text\", nullable: true })\n description: string;\n\n @Column({ type: \"text\" })\n value: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"string\" })\n valueType: string = \"string\";\n\n @Index()\n @Column({ type: \"varchar\", default: \"active\" })\n status: string = \"active\";\n\n @Column({ nullable: true, ...getColumnType('datetime') })\n lastRotatedAt: Date;\n\n @Column({ nullable: true, ...getColumnType('datetime') })\n lastAccessedAt: Date;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-step-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/D,qBACa,qBAAsB,SAAQ,YAAY;IAGnD,gBAAgB,EAAE,MAAM,CAAC;IAKzB,iBAAiB,EAAE,iBAAiB,CAAC;IAIrC,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAIjB,QAAQ,EAAE,MAAM,CAAU;IAI1B,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE,MAAM,CAAa;IAI3B,aAAa,EAAE,MAAM,CAAK;IAG1B,UAAU,EAAE,MAAM,CAAK;IAGvB,UAAU,EAAE,MAAM,CAAC;IAInB,YAAY,EAAE,MAAM,CAAC;IAIrB,sBAAsB,EAAE,MAAM,CAAC;IAI/B,cAAc,EAAE,MAAM,CAAC;IAIvB,SAAS,EAAE,IAAI,CAAC;IAIhB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,GAAG,CAAC;IAGlB,aAAa,EAAE,GAAG,CAAC;IAGnB,cAAc,EAAE,GAAG,CAAC;IAGpB,YAAY,EAAE,GAAG,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,EAAE,GAAG,CAAC;CACrB"}
|
|
@@ -14,6 +14,7 @@ const openapi = require("@nestjs/swagger");
|
|
|
14
14
|
const common_entity_1 = require("./common.entity");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const workflow_execution_entity_1 = require("./workflow-execution.entity");
|
|
17
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
17
18
|
let WorkflowStepExecution = class WorkflowStepExecution extends common_entity_1.CommonEntity {
|
|
18
19
|
constructor() {
|
|
19
20
|
super(...arguments);
|
|
@@ -92,12 +93,12 @@ __decorate([
|
|
|
92
93
|
], WorkflowStepExecution.prototype, "sequenceNumber", void 0);
|
|
93
94
|
__decorate([
|
|
94
95
|
(0, typeorm_1.Index)(),
|
|
95
|
-
(0, typeorm_1.Column)({
|
|
96
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
96
97
|
__metadata("design:type", Date)
|
|
97
98
|
], WorkflowStepExecution.prototype, "startedAt", void 0);
|
|
98
99
|
__decorate([
|
|
99
100
|
(0, typeorm_1.Index)(),
|
|
100
|
-
(0, typeorm_1.Column)({
|
|
101
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
101
102
|
__metadata("design:type", Date)
|
|
102
103
|
], WorkflowStepExecution.prototype, "finishedAt", void 0);
|
|
103
104
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAA+D;
|
|
1
|
+
{"version":3,"file":"workflow-step-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAA+D;AAC/D,oEAA8D;AAGvD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,4BAAY;IAAhD;;QAmBH,aAAQ,GAAW,MAAM,CAAC;QAQ1B,WAAM,GAAW,SAAS,CAAC;QAI3B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AI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DAC5B;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DAC9B;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DACpB;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DAC9B;gCAjFT,qBAAqB;IADjC,IAAA,gBAAM,EAAC,4BAA4B,CAAC;GACxB,qBAAqB,CAkFjC","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowExecution } from './workflow-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_step_execution')\nexport class WorkflowStepExecution extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n stepExecutionKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @Column({ type: \"varchar\" })\n nodeId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n nodeName: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"task\" })\n nodeKind: string = \"task\";\n\n @Index()\n @Column({ type: \"varchar\" })\n nodeType: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"created\" })\n status: string = \"created\";\n\n @Index()\n @Column({ type: \"integer\", default: 1 })\n attemptNumber: number = 1;\n\n @Column({ type: \"integer\", nullable: true, default: 0 })\n retryCount: number = 0;\n\n @Column({ type: \"integer\", nullable: true })\n maxRetries: number;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n parentNodeId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n parentStepExecutionKey: string;\n\n @Index()\n @Column({ type: \"integer\", nullable: true })\n sequenceNumber: number;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n startedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n finishedAt: Date;\n\n @Column({ type: \"bigint\", nullable: true })\n durationMs: bigint;\n\n @Column({ type: \"bigint\", nullable: true })\n timeoutMs: bigint;\n\n @Column({ type: \"simple-json\", nullable: true })\n inputPayload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n outputPayload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n runtimeContext: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n nodeSnapshot: any;\n\n @Column({ type: \"text\", nullable: true })\n errorSummary: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n errorDetails: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-trigger-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-trigger-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/D,qBACa,wBAAyB,SAAQ,YAAY;IAGtD,mBAAmB,EAAE,MAAM,CAAC;IAK5B,kBAAkB,EAAE,kBAAkB,CAAC;IAKvC,iBAAiB,EAAE,iBAAiB,CAAC;IAIrC,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAIpB,WAAW,EAAE,MAAM,CAAC;IAIpB,MAAM,EAAE,MAAM,CAAc;IAI5B,OAAO,EAAE,OAAO,CAAS;IAIzB,OAAO,EAAE,IAAI,CAAC;IAId,SAAS,EAAE,IAAI,CAAC;IAIhB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAInB,MAAM,EAAE,MAAM,CAAC;IAIf,aAAa,EAAE,MAAM,CAAC;IAItB,cAAc,EAAE,MAAM,CAAC;IAGvB,OAAO,EAAE,GAAG,CAAC;IAGb,eAAe,EAAE,GAAG,CAAC;IAGrB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,EAAE,GAAG,CAAC;IAGlB,QAAQ,EAAE,GAAG,CAAC;CACjB"}
|
|
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const workflow_definition_entity_1 = require("./workflow-definition.entity");
|
|
17
17
|
const workflow_execution_entity_1 = require("./workflow-execution.entity");
|
|
18
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
18
19
|
let WorkflowTriggerExecution = class WorkflowTriggerExecution extends common_entity_1.CommonEntity {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -33,13 +34,13 @@ __decorate([
|
|
|
33
34
|
], WorkflowTriggerExecution.prototype, "triggerExecutionKey", void 0);
|
|
34
35
|
__decorate([
|
|
35
36
|
(0, typeorm_1.Index)(),
|
|
36
|
-
(0, typeorm_1.ManyToOne)(() => workflow_definition_entity_1.WorkflowDefinition, {
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => workflow_definition_entity_1.WorkflowDefinition, { nullable: false }),
|
|
37
38
|
(0, typeorm_1.JoinColumn)(),
|
|
38
39
|
__metadata("design:type", workflow_definition_entity_1.WorkflowDefinition)
|
|
39
40
|
], WorkflowTriggerExecution.prototype, "workflowDefinition", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
(0, typeorm_1.Index)(),
|
|
42
|
-
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, {
|
|
43
|
+
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, { nullable: true }),
|
|
43
44
|
(0, typeorm_1.JoinColumn)(),
|
|
44
45
|
__metadata("design:type", workflow_execution_entity_1.WorkflowExecution)
|
|
45
46
|
], WorkflowTriggerExecution.prototype, "workflowExecution", void 0);
|
|
@@ -69,17 +70,17 @@ __decorate([
|
|
|
69
70
|
], WorkflowTriggerExecution.prototype, "matched", void 0);
|
|
70
71
|
__decorate([
|
|
71
72
|
(0, typeorm_1.Index)(),
|
|
72
|
-
(0, typeorm_1.Column)({
|
|
73
|
+
(0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
73
74
|
__metadata("design:type", Date)
|
|
74
75
|
], WorkflowTriggerExecution.prototype, "firedAt", void 0);
|
|
75
76
|
__decorate([
|
|
76
77
|
(0, typeorm_1.Index)(),
|
|
77
|
-
(0, typeorm_1.Column)({
|
|
78
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
78
79
|
__metadata("design:type", Date)
|
|
79
80
|
], WorkflowTriggerExecution.prototype, "startedAt", void 0);
|
|
80
81
|
__decorate([
|
|
81
82
|
(0, typeorm_1.Index)(),
|
|
82
|
-
(0, typeorm_1.Column)({
|
|
83
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
83
84
|
__metadata("design:type", Date)
|
|
84
85
|
], WorkflowTriggerExecution.prototype, "finishedAt", void 0);
|
|
85
86
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-trigger-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,6EAAkE;AAClE,2EAA+D;
|
|
1
|
+
{"version":3,"file":"workflow-trigger-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,6EAAkE;AAClE,2EAA+D;AAC/D,oEAA8D;AAGvD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,4BAAY;IAAnD;;QA4BH,WAAM,GAAW,UAAU,CAAC;QAI5B,YAAO,GAAY,KAAK,CAAC;KA2C5B;;skBA3CsB,KAAK;;CA2C3B,CAAA;AA3EY,4DAAwB;AAGjC;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;qEACA;AAK5B;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+CAAkB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxD,IAAA,oBAAU,GAAE;8BACO,+CAAkB;oEAAC;AAKvC;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACtD,IAAA,oBAAU,GAAE;8BACM,6CAAiB;mEAAC;AAIrC;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2DACV;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6DACxB;AAIpB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,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AAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACnC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iEAC3B;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DACpB;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8DAC9B;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAClC;mCA1EL,wBAAwB;IADpC,IAAA,gBAAM,EAAC,+BAA+B,CAAC;GAC3B,wBAAwB,CA2EpC","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowDefinition } from './workflow-definition.entity';\nimport { WorkflowExecution } from './workflow-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_trigger_execution')\nexport class WorkflowTriggerExecution extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n triggerExecutionKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowDefinition, { nullable: false })\n @JoinColumn()\n workflowDefinition: WorkflowDefinition;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { nullable: true })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @Column({ type: \"varchar\" })\n triggerId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n triggerName: string;\n\n @Index()\n @Column({ type: \"varchar\" })\n triggerType: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"received\" })\n status: string = \"received\";\n\n @Index()\n @Column({ nullable: true, default: false })\n matched: boolean = false;\n\n @Index()\n @Column({ ...getColumnType('datetime') })\n firedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n startedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n finishedAt: Date;\n\n @Column({ type: \"bigint\", nullable: true })\n durationMs: bigint;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n source: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n correlationId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n idempotencyKey: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n payload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n triggerSnapshot: any;\n\n @Column({ type: \"text\", nullable: true })\n errorSummary: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n errorDetails: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n metadata: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exception.filter.d.ts","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":"AACA,OAAO,EACH,eAAe,EAEf,aAAa,EAIhB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAItE,qBAEa,mBAAoB,YAAW,eAAe;IAG3C,OAAO,CAAC,QAAQ,CAAC,WAAW;IAFxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;gBAElC,WAAW,EAAE,kBAAkB;IAI5D,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"http-exception.filter.d.ts","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":"AACA,OAAO,EACH,eAAe,EAEf,aAAa,EAIhB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAItE,qBAEa,mBAAoB,YAAW,eAAe;IAG3C,OAAO,CAAC,QAAQ,CAAC,WAAW;IAFxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;gBAElC,WAAW,EAAE,kBAAkB;IAI5D,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa;CAoD5C"}
|
|
@@ -26,10 +26,14 @@ let HttpExceptionFilter = HttpExceptionFilter_1 = class HttpExceptionFilter {
|
|
|
26
26
|
const request = ctx.getRequest();
|
|
27
27
|
const isHttp = exception instanceof common_1.HttpException;
|
|
28
28
|
const explicitStatus = isHttp ? exception.getStatus() : undefined;
|
|
29
|
+
const rawStatus = exception?.status ?? exception?.statusCode;
|
|
30
|
+
const derivedStatus = typeof rawStatus === 'number' && rawStatus >= 400 && rawStatus < 600
|
|
31
|
+
? rawStatus
|
|
32
|
+
: undefined;
|
|
29
33
|
const code = this.errorMapper.mapException(exception);
|
|
30
34
|
const defaultStatus = this.errorMapper.getHttpStatus(code);
|
|
31
35
|
const message = code === 'solidx-unknown-error' ? `${exception?.message}` : this.errorMapper.getMessage(code);
|
|
32
|
-
const status = explicitStatus ?? defaultStatus ?? 500;
|
|
36
|
+
const status = explicitStatus ?? derivedStatus ?? defaultStatus ?? 500;
|
|
33
37
|
this.logger.error(`[${status} ${logging_interceptor_1.HttpStatusCodeMessages[status] || 'Internal Server Error'}] ${request?.method} ${request?.url} - ${exception?.message || message} [code=${code}]`);
|
|
34
38
|
if (exception?.stack) {
|
|
35
39
|
this.logger.error(exception.stack);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/filters/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,2CAOwB;AAExB,6EAA6E;AAC7E,0EAAsE;AAM/D,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAG5B,YAA6B,WAA+B;QAA/B,gBAAW,GAAX,WAAW,CAAoB;QAF3C,WAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAA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AAE,IAAI;YACf,KAAK,EAAE,OAAO;YAGd,IAAI,EAAE,KAAK;SACd,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA3DY,kDAAmB;8BAAnB,mBAAmB;IAF/B,IAAA,cAAK,GAAE;IACP,IAAA,mBAAU,GAAE;qCAIiC,yCAAkB;GAHnD,mBAAmB,CA2D/B","sourcesContent":["// src/common/filters/http-exception.filter.ts\nimport {\n ExceptionFilter,\n Catch,\n ArgumentsHost,\n Logger,\n Injectable,\n HttpException,\n} from '@nestjs/common';\nimport { Response, Request } from 'express';\nimport { HttpStatusCodeMessages } from '../interceptors/logging.interceptor';\nimport { ErrorMapperService } from 'src/helpers/error-mapper.service';\nimport { ErrorCode } from 'src/interfaces';\n\n\n@Catch()\n@Injectable()\nexport class HttpExceptionFilter implements ExceptionFilter {\n private readonly logger = new Logger(HttpExceptionFilter.name);\n\n constructor(private readonly errorMapper: ErrorMapperService) {\n this.logger.debug('HttpExceptionFilter initialized');\n }\n\n catch(exception: any, host: ArgumentsHost) {\n const ctx = host.switchToHttp();\n const response = ctx.getResponse<Response>();\n const request = ctx.getRequest<Request>();\n\n const isHttp = exception instanceof HttpException;\n const explicitStatus = isHttp ? exception.getStatus() : undefined;\n\n // Errors from http-errors-style libraries (e.g. body-parser's PayloadTooLargeError)\n // are plain Errors carrying their own status. Honour it rather than collapsing to 500.\n const rawStatus = exception?.status ?? exception?.statusCode;\n const derivedStatus =\n typeof rawStatus === 'number' && rawStatus >= 400 && rawStatus < 600\n ? rawStatus\n : undefined;\n\n // Canonical code + static message\n const code: ErrorCode = this.errorMapper.mapException(exception);\n const defaultStatus = this.errorMapper.getHttpStatus(code);\n const message = code === 'solidx-unknown-error' ? `${exception?.message}` : this.errorMapper.getMessage(code);\n\n // derivedStatus must precede defaultStatus: getHttpStatus() returns a hard 500\n // for unmatched codes, so it is never undefined and would always win otherwise.\n const status = explicitStatus ?? derivedStatus ?? defaultStatus ?? 500;\n\n // Logging\n this.logger.error(\n `[${status} ${HttpStatusCodeMessages[status] || 'Internal Server Error'}] ${request?.method} ${request?.url} - ${exception?.message || message} [code=${code}]`,\n );\n if (exception?.stack) {\n this.logger.error(exception.stack);\n }\n\n // Preserve any extra data the exception carried (optional)\n const extra =\n (isHttp && (exception.getResponse?.() as any)) ??\n exception?.response ??\n {};\n\n // Keep your legacy shape; add canonical code\n response.status(status).json({\n statusCode: status,\n statusCodeMessage: HttpStatusCodeMessages[status] || 'Internal Server Error',\n // Keeping this for backward compatibility..\n message: message,\n errorCode: code,\n error: message,\n // We can make this conditional based on whether we are running in prod mode or dev mode...\n // errorStack: exception.stack,\n data: extra,\n });\n }\n}"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NestExpressApplication } from '@nestjs/platform-express';
|
|
2
|
+
import { PermissionsPolicyConfig, SolidSecurityOptions } from './security.helper';
|
|
2
3
|
export interface SolidSwaggerOptions {
|
|
3
4
|
title?: string;
|
|
4
5
|
description?: string;
|
|
@@ -8,8 +9,10 @@ export interface SolidBootstrapOptions {
|
|
|
8
9
|
globalPrefix?: string;
|
|
9
10
|
swagger?: SolidSwaggerOptions | false;
|
|
10
11
|
permissionsPolicyOverrides?: Partial<PermissionsPolicyConfig>;
|
|
12
|
+
security?: SolidSecurityOptions;
|
|
11
13
|
verboseBootstrap?: boolean;
|
|
14
|
+
bodyLimit?: string;
|
|
12
15
|
}
|
|
13
|
-
export declare function bootstrapSolidApp(appModuleFactory: () => Promise<any>, options?: SolidBootstrapOptions): Promise<
|
|
16
|
+
export declare function bootstrapSolidApp(appModuleFactory: () => Promise<any>, options?: SolidBootstrapOptions): Promise<NestExpressApplication>;
|
|
14
17
|
export declare function bootstrapSolidCli(appModuleFactory: () => Promise<any>): Promise<void>;
|
|
15
18
|
//# sourceMappingURL=bootstrap.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAalE,OAAO,EAGL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAyB3B,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IAEpC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,OAAO,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IAEtC,0BAA0B,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAE9D,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAU3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAeD,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,EACpC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAgJjC;AAgBD,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,GACnC,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -36,10 +36,11 @@ function registerGlobalProcessHandlers() {
|
|
|
36
36
|
}
|
|
37
37
|
async function bootstrapSolidApp(appModuleFactory, options = {}) {
|
|
38
38
|
registerGlobalProcessHandlers();
|
|
39
|
-
const { globalPrefix = 'api', swagger = {}, permissionsPolicyOverrides = {}, verboseBootstrap = false } = options;
|
|
39
|
+
const { globalPrefix = 'api', swagger = {}, permissionsPolicyOverrides = {}, security = {}, verboseBootstrap = false, bodyLimit = '10mb', } = options;
|
|
40
40
|
const startTime = Date.now();
|
|
41
41
|
const appModule = await appModuleFactory();
|
|
42
42
|
const app = await core_1.NestFactory.create(appModule, {
|
|
43
|
+
bodyParser: false,
|
|
43
44
|
logger: nest_winston_1.WinstonModule.createLogger({ ...(0, winston_logger_1.createWinstonLoggerConfig)(), level: verboseBootstrap ? 'debug' : 'error' }),
|
|
44
45
|
});
|
|
45
46
|
const apiEnabled = (0, environment_helper_1.parseBooleanEnv)('API_ENABLED', true);
|
|
@@ -48,11 +49,11 @@ async function bootstrapSolidApp(appModuleFactory, options = {}) {
|
|
|
48
49
|
app
|
|
49
50
|
.get(nest_winston_1.WINSTON_MODULE_NEST_PROVIDER)
|
|
50
51
|
.log('API server disabled via API_ENABLED=false. Skipping HTTP listen.', 'Bootstrap');
|
|
51
|
-
return;
|
|
52
|
+
return app;
|
|
52
53
|
}
|
|
53
54
|
const server = app.getHttpAdapter().getInstance();
|
|
54
55
|
server.get('/', (_req, res) => res.status(200).send('SOLID OK'));
|
|
55
|
-
app.use((0, helmet_1.default)((0, security_helper_1.buildDefaultSecurityHeaderOptions)()));
|
|
56
|
+
app.use((0, helmet_1.default)((0, security_helper_1.buildDefaultSecurityHeaderOptions)(security)));
|
|
56
57
|
const isSwaggerPath = (path) => path === '/docs' ||
|
|
57
58
|
path === '/docs/' ||
|
|
58
59
|
path.startsWith('/docs/') ||
|
|
@@ -82,6 +83,8 @@ async function bootstrapSolidApp(appModuleFactory, options = {}) {
|
|
|
82
83
|
}
|
|
83
84
|
next();
|
|
84
85
|
});
|
|
86
|
+
app.useBodyParser('json', { limit: bodyLimit });
|
|
87
|
+
app.useBodyParser('urlencoded', { limit: bodyLimit, extended: true });
|
|
85
88
|
app.useGlobalPipes(new common_1.ValidationPipe({
|
|
86
89
|
transform: true,
|
|
87
90
|
transformOptions: { enableImplicitConversion: true },
|
|
@@ -116,6 +119,7 @@ async function bootstrapSolidApp(appModuleFactory, options = {}) {
|
|
|
116
119
|
app.useLogger(app.get(nest_winston_1.WINSTON_MODULE_NEST_PROVIDER));
|
|
117
120
|
const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
118
121
|
process.stdout.write(`\x1b[32mServer started on port ${port} in ${elapsed}s\x1b[0m\n`);
|
|
122
|
+
return app;
|
|
119
123
|
}
|
|
120
124
|
async function bootstrapSolidCli(appModuleFactory) {
|
|
121
125
|
registerGlobalProcessHandlers();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.helper.js","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":";;;;;AAoEA,8CAiIC;AAgBD,8CA0CC;AA/PD,2CAA4E;AAC5E,uCAAsD;AACtD,qDAAgD;AAChD,6CAAiE;AAEjE,oDAA4B;AAC5B,4CAAoB;AACpB,2BAAgC;AAChC,+BAA+B;AAC/B,+CAA2E;AAC3E,mDAAgD;AAChD,sDAA8D;AAC9D,yFAAoF;AACpF,+CAAwD;AACxD,uDAA6H;AAC7H,6DAAuD;AAIvD,SAAS,6BAA6B;IACpC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,GAAG,EAAE,EAAE;QACtC,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAGH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;QAChC,IAAI,OAAO,CAAC,IAAI,KAAK,oBAAoB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,C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GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnF,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC;QACvC,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,GAAG,KAAK,CAAC,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,MAAM,CAAC;IAGvC,MAAM,GAAG,GAAG,MAAM,+BAAc,CAAC,oBAAoB,CAAC,SAAS,EAAE;QAC/D,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;KACjF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,+BAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common';\nimport { NestFactory, Reflector } from '@nestjs/core';\nimport { WsAdapter } from '@nestjs/platform-ws';\nimport { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';\nimport { NextFunction, Request, Response } from 'express';\nimport helmet from 'helmet';\nimport qs from 'qs';\nimport { existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { WINSTON_MODULE_NEST_PROVIDER, WinstonModule } from 'nest-winston';\nimport { CommandFactory } from 'nest-commander';\nimport { createWinstonLoggerConfig } from '../winston.logger';\nimport { WrapResponseInterceptor } from '../interceptors/wrap-response.interceptor';\nimport { buildDefaultCorsOptions } from './cors.helper';\nimport { buildDefaultSecurityHeaderOptions, buildPermissionsPolicyHeader, PermissionsPolicyConfig } from './security.helper';\nimport { parseBooleanEnv } from './environment.helper';\n\n// ---- Shared process handlers ----\n\nfunction registerGlobalProcessHandlers() {\n process.on('unhandledRejection', (reason, promise) => {\n console.error('Unhandled Rejection at:', promise, 'reason:', reason);\n });\n\n process.on('uncaughtException', (err) => {\n console.error('Uncaught Exception thrown:', err);\n });\n\n // Suppress pg deprecation warning caused by TypeORM's internal query scheduling\n process.on('warning', (warning) => {\n if (warning.name === 'DeprecationWarning' && (warning.message.includes('client.query()') || warning.message.includes('punycode'))) {\n return;\n }\n console.warn(warning);\n });\n}\n\n// ---- HTTP server bootstrap ----\n\nexport interface SolidSwaggerOptions {\n title?: string;\n description?: string;\n version?: string;\n}\n\nexport interface SolidBootstrapOptions {\n /** Global API prefix. Defaults to 'api'. Set to '' to disable. */\n globalPrefix?: string;\n /** Swagger configuration. Set to false to disable Swagger entirely. */\n swagger?: SolidSwaggerOptions | false;\n /** Permissions-Policy header overrides (merged with defaults). */\n permissionsPolicyOverrides?: Partial<PermissionsPolicyConfig>;\n /** Show full NestJS init logs during bootstrap (route mapping, module deps, pollers). Defaults to false. */\n verboseBootstrap?: boolean;\n}\n\n/**\n * Bootstraps a SolidX NestJS HTTP application with sensible defaults:\n * security headers, CORS, Winston logger, ValidationPipe,\n * WrapResponseInterceptor, qs deep query parsing, Swagger, and the\n * pg BIGINT type parser.\n *\n * @example\n * // main.ts\n * bootstrapSolidApp(() => AppModule.forRoot(), {\n * swagger: { title: 'My API', description: 'My API description' },\n * });\n */\nexport async function bootstrapSolidApp(\n appModuleFactory: () => Promise<any>,\n options: SolidBootstrapOptions = {},\n): Promise<void> {\n registerGlobalProcessHandlers();\n\n const { globalPrefix = 'api', swagger = {}, permissionsPolicyOverrides = {}, verboseBootstrap = false } = options;\n\n const startTime = Date.now();\n const appModule = await appModuleFactory();\n const app = await NestFactory.create(appModule, {\n logger: WinstonModule.createLogger({ ...createWinstonLoggerConfig(), level: verboseBootstrap ? 'debug' : 'error' }),\n });\n\n const apiEnabled = parseBooleanEnv('API_ENABLED', true);\n\n if (!apiEnabled) {\n await app.init();\n app\n .get(WINSTON_MODULE_NEST_PROVIDER)\n .log('API server disabled via API_ENABLED=false. Skipping HTTP listen.', 'Bootstrap');\n return;\n }\n\n // Health check at root path\n const server = app.getHttpAdapter().getInstance();\n server.get('/', (_req, res) => res.status(200).send('SOLID OK'));\n\n // Security headers\n app.use(helmet(buildDefaultSecurityHeaderOptions()));\n\n // Nest's Swagger UI HTML injects inline styles; keep CSP strict elsewhere.\n const isSwaggerPath = (path: string) =>\n path === '/docs' ||\n path === '/docs/' ||\n path.startsWith('/docs/') ||\n path === '/docs-json' ||\n path === '/docs-yaml';\n\n app.use((req: Request, res: Response, next: NextFunction) => {\n if (isSwaggerPath(req.path)) {\n res.removeHeader('Content-Security-Policy');\n }\n next();\n });\n\n // Permissions-Policy header\n app.use((_req: Request, res: Response, next: NextFunction) => {\n res.setHeader('Permissions-Policy', buildPermissionsPolicyHeader(permissionsPolicyOverrides));\n next();\n });\n\n const port = process.env.PORT || 3000;\n\n if (globalPrefix) {\n app.setGlobalPrefix(globalPrefix);\n }\n\n // qs-based deep query parsing (dot notation, nested objects, arrays)\n app.use((req: Request, _res: Response, next: NextFunction) => {\n if (req.query) {\n req.query = qs.parse(req.url.split('?')[1], {\n allowDots: true,\n depth: 20,\n arrayLimit: 100,\n });\n }\n next();\n });\n\n // Global ValidationPipe\n app.useGlobalPipes(\n new ValidationPipe({\n transform: true,\n transformOptions: { enableImplicitConversion: true },\n }),\n );\n\n // Swagger\n if (swagger !== false) {\n const { title = process.env.SOLID_APP_NAME, description = process.env.SOLID_APP_DESCRIPTION, version = '1.0' } = swagger;\n const swaggerConfig = new DocumentBuilder()\n .setTitle(title)\n .setDescription(description)\n .setVersion(version)\n .setExternalDoc('Postman Collection', '/docs-json')\n .addBearerAuth(\n {\n description: 'Please enter token in following format: Bearer <JWT>',\n name: 'Authorization',\n bearerFormat: 'Bearer',\n scheme: 'Bearer',\n type: 'http',\n in: 'Header',\n },\n 'jwt',\n )\n .build();\n const document = SwaggerModule.createDocument(app, swaggerConfig);\n SwaggerModule.setup('/docs', app, document);\n }\n\n // Global interceptor\n app.useGlobalInterceptors(\n new ClassSerializerInterceptor(app.get(Reflector), {\n enableImplicitConversion: true, // optional but handy\n // groups: ['client'], // if you use groups\n }),\n new WrapResponseInterceptor()\n );\n\n // CORS\n app.enableCors(buildDefaultCorsOptions());\n\n // Fix pg returning BIGINT columns as strings\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const types = require('pg').types;\n types.setTypeParser(types.builtins.INT8, (val: string) => parseInt(val));\n\n app.useWebSocketAdapter(new WsAdapter(app));\n\n await app.listen(port);\n\n // Wire up Winston as the runtime logger only AFTER listen — this suppresses all\n // framework init noise (route mapping, module deps, onModuleInit) during boot.\n app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));\n\n const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);\n process.stdout.write(`\\x1b[32mServer started on port ${port} in ${elapsed}s\\x1b[0m\\n`);\n}\n\n// ---- CLI bootstrap ----\n\n/**\n * Bootstraps a SolidX NestJS CLI application using nest-commander.\n * Handles verbose flag stripping, project root validation, and clean process exit.\n *\n * @example\n * // main-cli.ts\n * #!/usr/bin/env node\n * import { bootstrapSolidCli } from '@solidxai/core';\n * import { AppModule } from './app.module';\n *\n * bootstrapSolidCli(() => AppModule.forRoot());\n */\nexport async function bootstrapSolidCli(\n appModuleFactory: () => Promise<any>,\n): Promise<void> {\n registerGlobalProcessHandlers();\n\n process.on('exit', (code) => {\n if (code !== 0) {\n console.error(`Exiting with error status code: ${code}`);\n }\n });\n\n // Validate that cwd is a valid Solid API project\n const packageJsonPath = resolve(process.cwd(), 'package.json');\n if (!existsSync(packageJsonPath)) {\n console.error('Does not seem to be a valid solid-api project.');\n console.error('Exit reason: missing package.json in the current directory.');\n process.exit(1);\n }\n\n // Strip --verbose / -v before nest-commander processes argv\n const showLogs = process.argv.includes('--verbose') || process.argv.includes('-v');\n for (const flag of ['--verbose', '-v']) {\n const idx = process.argv.indexOf(flag);\n if (idx !== -1) process.argv.splice(idx, 1);\n }\n\n const appModule = await appModuleFactory();\n process.env.SOLID_CLI_RUNNING = 'true';\n\n // @ts-ignore\n const app = await CommandFactory.createWithoutRunning(appModule, {\n logger: showLogs ? ['debug', 'error', 'fatal', 'log', 'verbose', 'warn'] : false,\n });\n\n try {\n await CommandFactory.runApplication(app);\n } catch (e) {\n console.error('CLI exited abruptly due to an error:', e);\n process.exit(1);\n }\n\n process.exit(0);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bootstrap.helper.js","sourceRoot":"","sources":["../../src/helpers/bootstrap.helper.ts"],"names":[],"mappings":";;;;;AAuFA,8CAmJC;AAgBD,8CA0CC;AApSD,2CAA4E;AAC5E,uCAAsD;AAEtD,qDAAgD;AAChD,6CAAiE;AAEjE,oDAA4B;AAC5B,4CAAoB;AACpB,2BAAgC;AAChC,+BAA+B;AAC/B,+CAA2E;AAC3E,mDAAgD;AAChD,sDAA8D;AAC9D,yFAAoF;AACpF,+CAAwD;AACxD,uDAK2B;AAC3B,6DAAuD;AAIvD,SAAS,6BAA6B;IACpC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;QACnD,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,mB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S,EAAE;QAC/D,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;KACjF,CAAC,CAAC;IAEH,IAAI,CAAC;QACH,MAAM,+BAAc,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC","sourcesContent":["import { ClassSerializerInterceptor, ValidationPipe } from '@nestjs/common';\nimport { NestFactory, Reflector } from '@nestjs/core';\nimport { NestExpressApplication } from '@nestjs/platform-express';\nimport { WsAdapter } from '@nestjs/platform-ws';\nimport { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';\nimport { NextFunction, Request, Response } from 'express';\nimport helmet from 'helmet';\nimport qs from 'qs';\nimport { existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { WINSTON_MODULE_NEST_PROVIDER, WinstonModule } from 'nest-winston';\nimport { CommandFactory } from 'nest-commander';\nimport { createWinstonLoggerConfig } from '../winston.logger';\nimport { WrapResponseInterceptor } from '../interceptors/wrap-response.interceptor';\nimport { buildDefaultCorsOptions } from './cors.helper';\nimport {\n buildDefaultSecurityHeaderOptions,\n buildPermissionsPolicyHeader,\n PermissionsPolicyConfig,\n SolidSecurityOptions,\n} from './security.helper';\nimport { parseBooleanEnv } from './environment.helper';\n\n// ---- Shared process handlers ----\n\nfunction registerGlobalProcessHandlers() {\n process.on('unhandledRejection', (reason, promise) => {\n console.error('Unhandled Rejection at:', promise, 'reason:', reason);\n });\n\n process.on('uncaughtException', (err) => {\n console.error('Uncaught Exception thrown:', err);\n });\n\n // Suppress pg deprecation warning caused by TypeORM's internal query scheduling\n process.on('warning', (warning) => {\n if (warning.name === 'DeprecationWarning' && (warning.message.includes('client.query()') || warning.message.includes('punycode'))) {\n return;\n }\n console.warn(warning);\n });\n}\n\n// ---- HTTP server bootstrap ----\n\nexport interface SolidSwaggerOptions {\n title?: string;\n description?: string;\n version?: string;\n}\n\nexport interface SolidBootstrapOptions {\n /** Global API prefix. Defaults to 'api'. Set to '' to disable. */\n globalPrefix?: string;\n /** Swagger configuration. Set to false to disable Swagger entirely. */\n swagger?: SolidSwaggerOptions | false;\n /** Permissions-Policy header overrides (merged with defaults). */\n permissionsPolicyOverrides?: Partial<PermissionsPolicyConfig>;\n /** Security header overrides, including iframe frame-ancestor allowlists. */\n security?: SolidSecurityOptions;\n /** Show full NestJS init logs during bootstrap (route mapping, module deps, pollers). Defaults to false. */\n verboseBootstrap?: boolean;\n /**\n * Max request body size for JSON and urlencoded payloads, as a `bytes`-compatible\n * string (e.g. '10mb', '512kb'). Defaults to '10mb'.\n *\n * Does NOT apply to multipart/form-data uploads: body-parser matches on Content-Type,\n * so multipart requests skip these parsers entirely and are handled by Multer. Raise\n * this only for large structured JSON (e.g. /bulk arrays), bearing in mind the parsed\n * object graph can retain several times the raw byte size.\n */\n bodyLimit?: string;\n}\n\n/**\n * Bootstraps a SolidX NestJS HTTP application with sensible defaults:\n * security headers, CORS, Winston logger, ValidationPipe,\n * WrapResponseInterceptor, qs deep query parsing, Swagger, and the\n * pg BIGINT type parser.\n *\n * @example\n * // main.ts\n * bootstrapSolidApp(() => AppModule.forRoot(), {\n * swagger: { title: 'My API', description: 'My API description' },\n * security: { frameAncestors: [\"'self'\", 'https://portal.example.com'] },\n * });\n */\nexport async function bootstrapSolidApp(\n appModuleFactory: () => Promise<any>,\n options: SolidBootstrapOptions = {},\n): Promise<NestExpressApplication> {\n registerGlobalProcessHandlers();\n\n const {\n globalPrefix = 'api',\n swagger = {},\n permissionsPolicyOverrides = {},\n security = {},\n verboseBootstrap = false,\n bodyLimit = '10mb',\n } = options;\n\n const startTime = Date.now();\n const appModule = await appModuleFactory();\n const app = await NestFactory.create<NestExpressApplication>(appModule, {\n // Nest's default parsers are registered during init() with a 100kb limit, ahead of\n // any module middleware. Disable them so the parsers below own the limit outright.\n bodyParser: false,\n logger: WinstonModule.createLogger({ ...createWinstonLoggerConfig(), level: verboseBootstrap ? 'debug' : 'error' }),\n });\n\n const apiEnabled = parseBooleanEnv('API_ENABLED', true);\n\n if (!apiEnabled) {\n await app.init();\n app\n .get(WINSTON_MODULE_NEST_PROVIDER)\n .log('API server disabled via API_ENABLED=false. Skipping HTTP listen.', 'Bootstrap');\n return app;\n }\n\n // Health check at root path\n const server = app.getHttpAdapter().getInstance();\n server.get('/', (_req, res) => res.status(200).send('SOLID OK'));\n\n // Security headers\n app.use(helmet(buildDefaultSecurityHeaderOptions(security)));\n\n // Nest's Swagger UI HTML injects inline styles; keep CSP strict elsewhere.\n const isSwaggerPath = (path: string) =>\n path === '/docs' ||\n path === '/docs/' ||\n path.startsWith('/docs/') ||\n path === '/docs-json' ||\n path === '/docs-yaml';\n\n app.use((req: Request, res: Response, next: NextFunction) => {\n if (isSwaggerPath(req.path)) {\n res.removeHeader('Content-Security-Policy');\n }\n next();\n });\n\n // Permissions-Policy header\n app.use((_req: Request, res: Response, next: NextFunction) => {\n res.setHeader('Permissions-Policy', buildPermissionsPolicyHeader(permissionsPolicyOverrides));\n next();\n });\n\n const port = process.env.PORT || 3000;\n\n if (globalPrefix) {\n app.setGlobalPrefix(globalPrefix);\n }\n\n // qs-based deep query parsing (dot notation, nested objects, arrays)\n app.use((req: Request, _res: Response, next: NextFunction) => {\n if (req.query) {\n req.query = qs.parse(req.url.split('?')[1], {\n allowDots: true,\n depth: 20,\n arrayLimit: 100,\n });\n }\n next();\n });\n\n // Body parsers — replaces Nest's default 100kb parsers (disabled via bodyParser: false).\n // Registered here so the middleware order Nest applied by default is preserved:\n // helmet -> CSP -> Permissions-Policy -> qs -> body parsers -> routes.\n app.useBodyParser('json', { limit: bodyLimit });\n app.useBodyParser('urlencoded', { limit: bodyLimit, extended: true });\n\n // Global ValidationPipe\n app.useGlobalPipes(\n new ValidationPipe({\n transform: true,\n transformOptions: { enableImplicitConversion: true },\n }),\n );\n\n // Swagger\n if (swagger !== false) {\n const { title = process.env.SOLID_APP_NAME, description = process.env.SOLID_APP_DESCRIPTION, version = '1.0' } = swagger;\n const swaggerConfig = new DocumentBuilder()\n .setTitle(title)\n .setDescription(description)\n .setVersion(version)\n .setExternalDoc('Postman Collection', '/docs-json')\n .addBearerAuth(\n {\n description: 'Please enter token in following format: Bearer <JWT>',\n name: 'Authorization',\n bearerFormat: 'Bearer',\n scheme: 'Bearer',\n type: 'http',\n in: 'Header',\n },\n 'jwt',\n )\n .build();\n const document = SwaggerModule.createDocument(app, swaggerConfig);\n SwaggerModule.setup('/docs', app, document);\n }\n\n // Global interceptor\n app.useGlobalInterceptors(\n new ClassSerializerInterceptor(app.get(Reflector), {\n enableImplicitConversion: true, // optional but handy\n // groups: ['client'], // if you use groups\n }),\n new WrapResponseInterceptor()\n );\n\n // CORS\n app.enableCors(buildDefaultCorsOptions());\n\n // Fix pg returning BIGINT columns as strings\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const types = require('pg').types;\n types.setTypeParser(types.builtins.INT8, (val: string) => parseInt(val));\n\n app.useWebSocketAdapter(new WsAdapter(app));\n\n await app.listen(port);\n\n // Wire up Winston as the runtime logger only AFTER listen — this suppresses all\n // framework init noise (route mapping, module deps, onModuleInit) during boot.\n app.useLogger(app.get(WINSTON_MODULE_NEST_PROVIDER));\n\n const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);\n process.stdout.write(`\\x1b[32mServer started on port ${port} in ${elapsed}s\\x1b[0m\\n`);\n\n return app;\n}\n\n// ---- CLI bootstrap ----\n\n/**\n * Bootstraps a SolidX NestJS CLI application using nest-commander.\n * Handles verbose flag stripping, project root validation, and clean process exit.\n *\n * @example\n * // main-cli.ts\n * #!/usr/bin/env node\n * import { bootstrapSolidCli } from '@solidxai/core';\n * import { AppModule } from './app.module';\n *\n * bootstrapSolidCli(() => AppModule.forRoot());\n */\nexport async function bootstrapSolidCli(\n appModuleFactory: () => Promise<any>,\n): Promise<void> {\n registerGlobalProcessHandlers();\n\n process.on('exit', (code) => {\n if (code !== 0) {\n console.error(`Exiting with error status code: ${code}`);\n }\n });\n\n // Validate that cwd is a valid Solid API project\n const packageJsonPath = resolve(process.cwd(), 'package.json');\n if (!existsSync(packageJsonPath)) {\n console.error('Does not seem to be a valid solid-api project.');\n console.error('Exit reason: missing package.json in the current directory.');\n process.exit(1);\n }\n\n // Strip --verbose / -v before nest-commander processes argv\n const showLogs = process.argv.includes('--verbose') || process.argv.includes('-v');\n for (const flag of ['--verbose', '-v']) {\n const idx = process.argv.indexOf(flag);\n if (idx !== -1) process.argv.splice(idx, 1);\n }\n\n const appModule = await appModuleFactory();\n process.env.SOLID_CLI_RUNNING = 'true';\n\n // @ts-ignore\n const app = await CommandFactory.createWithoutRunning(appModule, {\n logger: showLogs ? ['debug', 'error', 'fatal', 'log', 'verbose', 'warn'] : false,\n });\n\n try {\n await CommandFactory.runApplication(app);\n } catch (e) {\n console.error('CLI exited abruptly due to an error:', e);\n process.exit(1);\n }\n\n process.exit(0);\n}\n"]}
|
|
@@ -9,6 +9,7 @@ export interface MediaFieldOptions {
|
|
|
9
9
|
fieldName: string | undefined | null;
|
|
10
10
|
mediaMaxSizeKb: number | undefined | null;
|
|
11
11
|
mediaTypes: string[];
|
|
12
|
+
mediaAllowedExtensions?: string[] | null;
|
|
12
13
|
isUpdate: boolean | undefined | null;
|
|
13
14
|
}
|
|
14
15
|
export declare class MediaFieldCrudManager implements FieldCrudManager {
|
|
@@ -18,6 +19,11 @@ export declare class MediaFieldCrudManager implements FieldCrudManager {
|
|
|
18
19
|
validate(dto: any, files: Array<Express.Multer.File>): ValidationError[];
|
|
19
20
|
private applyValidations;
|
|
20
21
|
private validateDangerousFiles;
|
|
22
|
+
private validateCommon;
|
|
23
|
+
private validateRequired;
|
|
24
|
+
private validateSize;
|
|
25
|
+
private validateTypes;
|
|
26
|
+
private validateAllowedExtensions;
|
|
21
27
|
private validateMediaSingle;
|
|
22
28
|
private validateMediaMultiple;
|
|
23
29
|
transformForCreate(dto: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/MediaFieldCrudManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGnE,oBAAY,cAAc;IACtB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;CAClC;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,cAAc,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC1C,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;CACxC;AA6DD,qBAAa,qBAAsB,YAAW,gBAAgB;IAE9C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,iBAAiB;IAGvD,OAAO,CAAC,gBAAgB;
|
|
1
|
+
{"version":3,"file":"MediaFieldCrudManager.d.ts","sourceRoot":"","sources":["../../../src/helpers/field-crud-managers/MediaFieldCrudManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGnE,oBAAY,cAAc;IACtB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;CAClC;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,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