@solidxai/core 0.1.13-beta.2 → 0.1.13-beta.21
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 +10107 -0
- package/CLAUDE.md +5 -6
- package/README.md +19 -0
- package/dist/commands/run-tests.command.d.ts +9 -1
- package/dist/commands/run-tests.command.d.ts.map +1 -1
- package/dist/commands/run-tests.command.js +69 -6
- package/dist/commands/run-tests.command.js.map +1 -1
- package/dist/commands/seed.command.d.ts +2 -0
- package/dist/commands/seed.command.d.ts.map +1 -1
- package/dist/commands/seed.command.js +21 -0
- package/dist/commands/seed.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/chatter-message.constants.d.ts +1 -0
- package/dist/constants/chatter-message.constants.d.ts.map +1 -1
- package/dist/constants/chatter-message.constants.js +3 -1
- package/dist/constants/chatter-message.constants.js.map +1 -1
- 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/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 +12 -0
- package/dist/constants/media-file-types.d.ts.map +1 -1
- package/dist/constants/media-file-types.js +66 -1
- 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/constants/user.constants.d.ts +2 -0
- package/dist/constants/user.constants.d.ts.map +1 -0
- package/dist/constants/user.constants.js +5 -0
- package/dist/constants/user.constants.js.map +1 -0
- 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/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/chatter-message.controller.d.ts +5 -0
- package/dist/controllers/chatter-message.controller.d.ts.map +1 -1
- package/dist/controllers/chatter-message.controller.js +14 -0
- package/dist/controllers/chatter-message.controller.js.map +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/field-metadata.controller.d.ts +2 -2
- 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/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/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/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/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/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/saved-filters.entity.js +3 -3
- package/dist/entities/saved-filters.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.d.ts.map +1 -1
- package/dist/entities/user.entity.js +36 -0
- 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 +7 -6
- package/dist/entities/workflow-trigger-execution.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/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 +7 -0
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.d.ts.map +1 -1
- package/dist/helpers/field-crud-managers/MediaFieldCrudManager.js +66 -32
- 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 +19 -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/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/solid-registry.js +1 -1
- package/dist/helpers/solid-registry.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 +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -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/interfaces.d.ts +1 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.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 +51 -30
- package/dist/seeders/module-metadata-seeder.service.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 +290 -78
- 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 +9 -5
- package/dist/services/authentication.service.d.ts.map +1 -1
- package/dist/services/authentication.service.js +102 -23
- package/dist/services/authentication.service.js.map +1 -1
- package/dist/services/chatter-message.service.d.ts +16 -1
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +100 -16
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud-helper.service.d.ts +6 -4
- package/dist/services/crud-helper.service.d.ts.map +1 -1
- package/dist/services/crud-helper.service.js +32 -48
- package/dist/services/crud-helper.service.js.map +1 -1
- package/dist/services/crud.service.d.ts +13 -1
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +94 -68
- 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 +53 -0
- package/dist/services/draft-publish-helper.service.d.ts.map +1 -0
- package/dist/services/draft-publish-helper.service.js +402 -0
- package/dist/services/draft-publish-helper.service.js.map +1 -0
- 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/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-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 +3 -2
- package/dist/services/media.service.d.ts.map +1 -1
- package/dist/services/media.service.js +45 -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/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/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/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 +248 -12
- package/dist/services/settings/default-settings-provider.service.d.ts.map +1 -1
- package/dist/services/settings/default-settings-provider.service.js +143 -6
- 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/nodes/execution-fail.node.d.ts +6 -0
- package/dist/services/workflow/nodes/execution-fail.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/execution-fail.node.js +81 -0
- package/dist/services/workflow/nodes/execution-fail.node.js.map +1 -0
- package/dist/services/workflow/nodes/for-each.node.d.ts +2 -0
- package/dist/services/workflow/nodes/for-each.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/for-each.node.js +114 -5
- package/dist/services/workflow/nodes/for-each.node.js.map +1 -1
- package/dist/services/workflow/nodes/if.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/if.node.js +7 -0
- package/dist/services/workflow/nodes/if.node.js.map +1 -1
- package/dist/services/workflow/nodes/log-write.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/log-write.node.js +2 -0
- package/dist/services/workflow/nodes/log-write.node.js.map +1 -1
- package/dist/services/workflow/nodes/loop-until.node.d.ts +12 -0
- package/dist/services/workflow/nodes/loop-until.node.d.ts.map +1 -0
- package/dist/services/workflow/nodes/loop-until.node.js +281 -0
- package/dist/services/workflow/nodes/loop-until.node.js.map +1 -0
- package/dist/services/workflow/nodes/parallel.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/parallel.node.js +7 -0
- package/dist/services/workflow/nodes/parallel.node.js.map +1 -1
- package/dist/services/workflow/nodes/sequential.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/sequential.node.js +7 -0
- package/dist/services/workflow/nodes/sequential.node.js.map +1 -1
- package/dist/services/workflow/nodes/switch.node.d.ts.map +1 -1
- package/dist/services/workflow/nodes/switch.node.js +7 -0
- package/dist/services/workflow/nodes/switch.node.js.map +1 -1
- package/dist/services/workflow/workflow-definition-validator.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-definition-validator.service.js +5 -2
- package/dist/services/workflow/workflow-definition-validator.service.js.map +1 -1
- package/dist/services/workflow/workflow-expression.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-expression.service.js +5 -0
- package/dist/services/workflow/workflow-expression.service.js.map +1 -1
- package/dist/services/workflow/workflow-node-registry.service.d.ts +2 -1
- package/dist/services/workflow/workflow-node-registry.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-node-registry.service.js +7 -0
- package/dist/services/workflow/workflow-node-registry.service.js.map +1 -1
- package/dist/services/workflow/workflow-runtime.service.d.ts +8 -0
- package/dist/services/workflow/workflow-runtime.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-runtime.service.js +197 -32
- package/dist/services/workflow/workflow-runtime.service.js.map +1 -1
- package/dist/services/workflow-definition.service.d.ts +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 +28 -40
- package/dist/solid-core.module.js.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.d.ts +5 -0
- package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
- package/dist/testing/adapters/ui/playwright-adapter.js +17 -1
- package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
- package/dist/testing/adapters/ui/ui.types.d.ts +2 -0
- package/dist/testing/adapters/ui/ui.types.d.ts.map +1 -1
- package/dist/testing/adapters/ui/ui.types.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/testing/steps/ui/actions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/actions.step.js +6 -2
- package/dist/testing/steps/ui/actions.step.js.map +1 -1
- package/dist/testing/steps/ui/assertions.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/assertions.step.js +11 -3
- package/dist/testing/steps/ui/assertions.step.js.map +1 -1
- package/dist/testing/steps/ui/form.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/form.step.js +9 -3
- package/dist/testing/steps/ui/form.step.js.map +1 -1
- package/dist/testing/steps/ui/manual.step.js +1 -1
- package/dist/testing/steps/ui/manual.step.js.map +1 -1
- package/dist/testing/steps/ui/navigation.step.d.ts.map +1 -1
- package/dist/testing/steps/ui/navigation.step.js +3 -1
- package/dist/testing/steps/ui/navigation.step.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/dist/types/workflow-dsl.types.d.ts +14 -0
- package/dist/types/workflow-dsl.types.d.ts.map +1 -1
- package/dist/types/workflow-dsl.types.js.map +1 -1
- package/package.json +2 -2
- package/src/commands/run-tests.command.ts +64 -4
- package/src/commands/seed.command.ts +19 -0
- package/src/config/cache.options.ts +9 -1
- package/src/constants/chatter-message.constants.ts +12 -0
- package/src/constants/draft-publish-fields.ts +5 -0
- package/src/constants/error-messages.ts +14 -0
- package/src/constants/media-file-types.ts +128 -0
- package/src/constants/success-messages.ts +5 -0
- package/src/constants/user.constants.ts +13 -0
- package/src/controllers/authentication.controller.ts +5 -2
- package/src/controllers/chatter-message.controller.ts +8 -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/controllers/mpin-authentication.controller.ts +67 -0
- package/src/dtos/basic-filters.dto.ts +0 -4
- 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/common.entity.ts +24 -0
- package/src/entities/dashboard-user-layout.entity.ts +2 -2
- package/src/entities/field-metadata.entity.ts +3 -0
- package/src/entities/saved-filters.entity.ts +3 -3
- package/src/entities/user-device-credential.entity.ts +130 -0
- package/src/entities/user.entity.ts +53 -36
- 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 +7 -6
- package/src/factories/mail.factory.ts +7 -1
- 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 +90 -37
- package/src/helpers/file-download.helper.ts +45 -0
- package/src/helpers/model-metadata-helper.service.ts +32 -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/solid-registry.ts +1 -1
- package/src/helpers/typeorm-db-helper.ts +12 -1
- package/src/index.ts +10 -0
- package/src/interfaces/active-user-data.interface.ts +9 -0
- package/src/interfaces.ts +1 -0
- package/src/repository/user-device-credential.repository.ts +17 -0
- package/src/seeders/module-metadata-seeder.service.ts +61 -39
- package/src/seeders/module-test-data.service.ts +6 -0
- package/src/seeders/seed-data/solid-core-metadata.json +290 -78
- package/src/services/api-key.service.ts +13 -1
- package/src/services/authentication.service.ts +203 -41
- package/src/services/chatter-message.service.ts +180 -19
- package/src/services/crud-helper.service.ts +35 -50
- package/src/services/crud.service.ts +132 -105
- package/src/services/datasource-introspection.service.ts +5 -0
- package/src/services/draft-publish-helper.service.ts +581 -0
- package/src/services/field-metadata.service.ts +5 -2
- package/src/services/internationalisation-helper.service.ts +148 -0
- package/src/services/media-storage.utils.ts +26 -1
- package/src/services/media.service.ts +68 -36
- package/src/services/metadata-validation.service.ts +39 -0
- package/src/services/model-metadata.service.ts +4 -1
- package/src/services/module-metadata.service.ts +10 -1
- package/src/services/mpin.service.ts +447 -0
- package/src/services/object.utils.ts +10 -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 +154 -6
- package/src/services/user.service.ts +18 -3
- package/src/services/view-metadata.service.ts +5 -145
- package/src/services/workflow/nodes/execution-fail.node.ts +82 -0
- package/src/services/workflow/nodes/for-each.node.ts +140 -6
- package/src/services/workflow/nodes/if.node.ts +7 -0
- package/src/services/workflow/nodes/log-write.node.ts +2 -0
- package/src/services/workflow/nodes/loop-until.node.ts +343 -0
- package/src/services/workflow/nodes/parallel.node.ts +7 -0
- package/src/services/workflow/nodes/sequential.node.ts +7 -0
- package/src/services/workflow/nodes/switch.node.ts +7 -0
- package/src/services/workflow/workflow-definition-validator.service.ts +5 -2
- package/src/services/workflow/workflow-expression.service.ts +5 -0
- package/src/services/workflow/workflow-node-registry.service.ts +11 -0
- package/src/services/workflow/workflow-runtime.service.ts +274 -39
- package/src/solid-core.module.ts +46 -15
- package/src/testing/README.md +75 -3
- package/src/testing/adapters/ui/playwright-adapter.ts +25 -0
- package/src/testing/adapters/ui/ui.types.ts +2 -0
- 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/testing/steps/ui/actions.step.ts +8 -4
- package/src/testing/steps/ui/assertions.step.ts +18 -5
- package/src/testing/steps/ui/form.step.ts +16 -6
- package/src/testing/steps/ui/manual.step.ts +1 -1
- package/src/testing/steps/ui/navigation.step.ts +4 -2
- package/src/theme/theme-registry.ts +181 -0
- package/src/types/workflow-dsl.types.ts +43 -0
|
@@ -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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AAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,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;;+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,wBAAw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C;;IACI,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,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]),
|
|
@@ -347,8 +347,8 @@ export declare class FieldMetadataController {
|
|
|
347
347
|
value: unknown;
|
|
348
348
|
}[];
|
|
349
349
|
mediaTypes: {
|
|
350
|
-
label:
|
|
351
|
-
value:
|
|
350
|
+
label: "file" | "image" | "audio" | "video" | "pdf";
|
|
351
|
+
value: "file" | "image" | "audio" | "video" | "pdf";
|
|
352
352
|
}[];
|
|
353
353
|
relationTypes: {
|
|
354
354
|
label: unknown;
|
|
@@ -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;IAC1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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,+DAA+D;AAC/D,6CAAmE;AACnE,uFAAgG;AAChG,yFAAmF;AACnF,yFAAmF;AAEnF,+EAAkE;AAGlE,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,0CAAuB,CAAA;IACvB,0CAAuB,CAAA;AACzB,CAAC,EAHI,eAAe,KAAf,eAAe,QAGnB;AAIM,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAA6B,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;IAAG,CAAC;IAI5D,AAAN,KAAK,CAAC,iBAAiB,CAA2B,eAAuB,EAAmB,MAAc,EAAS,GAAa;QAC9H,MAAM,sBAAsB,GAAI,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,eAAe,EAAE,MAAsB,CAAC,CAAC;QAC/G,IAAI,sBAAsB,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC3C,MAAM,IAAI,qCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QAGD,GAAG,CAAC,SAAS,CAAC,qBAAqB,EAAE,yBAAyB,sBAAsB,CAAC,QAAQ,GAAG,CAAC,CAAC;QAClG,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAC/D,GAAG,CAAC,SAAS,CAAC,+BAA+B,EAAE,mCAAmC,CAAC,CAAC;QAEpF,sBAAsB,CAAC,MAAM,CAAC,IAAI,CA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AC;;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;sCApIU,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,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,0CAAuB,CAAA;IACvB,0CAAuB,CAAA;AACzB,CAAC,EAHI,eAAe,KAAf,eAAe,QAGnB;AAIM,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACtC,YAA6B,OAAiC;QAAjC,YAAO,GAAP,OAAO,CAA0B;IAAG,CAAC;IAI5D,AAAN,KAAK,CAAC,iBAAiB,CAA2B,eAAuB,EAAmB,MAAc,EAAS,GAAa;QAC9H,MAAM,sBAAsB,GAAI,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,eAAe,EAAE,MAAsB,CAAC,CAAC;QAC/G,IAAI,sBAAsB,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC3C,MAAM,IAAI,qCAA4B,CAAC,uCAAuC,CAAC,CAAC;QAClF,CAAC;QAGD,IAAA,6CAAsB,EAAC,GAAG,EAAE;YAC1B,QAAQ,EAAE,sBAAsB,CAAC,QAAQ;YACzC,QAAQ,EAAE,sBAAsB,CAAC,QAAQ;SAC1C,CAAC,CAAC;QAEH,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAIK,AAAN,KAAK,CAAC,qBAAqB,CAA2B,eAAuB;QAE3E,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;IAKD,MAAM,CAAS,SAA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AAA;;;;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,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
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,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AASnC,qBAIa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,YAAY;IAKlD,MAAM,CAAS,SAAS,EAAE,cAAc,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAkC,mBAAmB,EAAE,sBAAsB;IAOzK,UAAU,CAAS,UAAU,EAAE,cAAc,EAAE,EAAmB,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAO,EAAkC,mBAAmB,EAAE,sBAAsB;IAQvL,MAAM,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,cAAc,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAkC,mBAAmB,EAAE,sBAAsB;IAOlM,aAAa,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,cAAc,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAkC,mBAAmB,EAAE,sBAAsB;IASzM,MAAM,CAAkB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAU,SAAS,EAAE,cAAc,EAAkC,mBAAmB,EAAE,sBAAsB;IAQnK,WAAW,CAAS,GAAG,EAAE,MAAM,EAAE,EAAkC,mBAAmB,EAAE,sBAAsB;;;;IAM9G,OAAO,CAAc,EAAE,EAAE,MAAM,EAAkC,mBAAmB,EAAE,sBAAsB;;;;IAe5G,QAAQ,CAAU,KAAK,EAAE,GAAG,EAAkC,mBAAmB,EAAE,sBAAsB;IAQzG,QAAQ,CAAc,EAAE,EAAE,MAAM,EAAwB,WAAW,EAAE,MAAM,EAAS,GAAG,EAAE,QAAQ,EAAkC,mBAAmB,EAAE,sBAAsB;IAuB9K,OAAO,CAAc,EAAE,EAAE,MAAM,EAAW,KAAK,EAAE,GAAG,EAAkC,mBAAmB,EAAE,sBAAsB;IAMjI,UAAU,CAAS,GAAG,EAAE,MAAM,EAAE,EAAkC,mBAAmB,EAAE,sBAAsB;IAM7G,MAAM,CAAc,EAAE,EAAE,MAAM,EAAkC,mBAAmB,EAAE,sBAAsB;CAKlH"}
|
|
@@ -24,6 +24,8 @@ const solid_request_context_decorator_1 = require("../decorators/solid-request-c
|
|
|
24
24
|
const solid_request_context_dto_1 = require("../dtos/solid-request-context.dto");
|
|
25
25
|
const update_media_dto_1 = require("../dtos/update-media.dto");
|
|
26
26
|
const media_service_1 = require("../services/media.service");
|
|
27
|
+
const media_file_types_1 = require("../constants/media-file-types");
|
|
28
|
+
const file_download_helper_1 = require("../helpers/file-download.helper");
|
|
27
29
|
var ShowSoftDeleted;
|
|
28
30
|
(function (ShowSoftDeleted) {
|
|
29
31
|
ShowSoftDeleted["INCLUSIVE"] = "inclusive";
|
|
@@ -60,11 +62,14 @@ let MediaController = class MediaController {
|
|
|
60
62
|
async download(id, disposition, res, solidRequestContext) {
|
|
61
63
|
const media = await this.service.findOne(+id, {}, solidRequestContext);
|
|
62
64
|
const { stream, fileName, mimeType } = await this.service.fileDownloadStream(media);
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const isInlineSafe = media_file_types_1.INLINE_SAFE_EXTENSIONS.has((0, media_file_types_1.getLowercaseFileExtension)(fileName) ?? '');
|
|
66
|
+
const requestedInline = disposition !== 'attachment';
|
|
67
|
+
(0, file_download_helper_1.setFileDownloadHeaders)(res, {
|
|
68
|
+
fileName,
|
|
69
|
+
mimeType: isInlineSafe ? mimeType : 'application/octet-stream',
|
|
70
|
+
disposition: requestedInline && isInlineSafe ? 'inline' : 'attachment',
|
|
71
|
+
crossOriginResourcePolicy: true,
|
|
72
|
+
});
|
|
68
73
|
stream.pipe(res);
|
|
69
74
|
}
|
|
70
75
|
async findOne(id, query, solidRequestContext) {
|
|
@@ -132,7 +137,7 @@ __decorate([
|
|
|
132
137
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
133
138
|
(0, common_1.Post)('/upload'),
|
|
134
139
|
(0, common_1.UseInterceptors)((0, platform_express_1.AnyFilesInterceptor)()),
|
|
135
|
-
openapi.ApiResponse({ status: 201, type:
|
|
140
|
+
openapi.ApiResponse({ status: 201, type: Object }),
|
|
136
141
|
__param(0, (0, common_1.UploadedFiles)()),
|
|
137
142
|
__param(1, (0, common_1.Body)()),
|
|
138
143
|
__param(2, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
|
|
@@ -182,7 +187,7 @@ __decorate([
|
|
|
182
187
|
__decorate([
|
|
183
188
|
(0, auth_decorator_1.Auth)(auth_type_enum_1.AuthType.MediaSignedUrl),
|
|
184
189
|
(0, swagger_1.ApiQuery)({ name: 'token', required: true, type: String, description: "Short-lived signed token obtained from a private Media record's URL - not entered manually." }),
|
|
185
|
-
(0, swagger_1.ApiQuery)({ name: 'disposition', required: false, enum: ['inline', 'attachment'], description: "'inline' (default) renders/previews in the browser, matching public media. Pass 'attachment' to force a browser download (e.g. from a download button)." }),
|
|
190
|
+
(0, swagger_1.ApiQuery)({ name: 'disposition', required: false, enum: ['inline', 'attachment'], description: "'inline' (default) renders/previews in the browser, matching public media - it applies only to types safe to render inline (images, audio, video, pdf); anything else is always downloaded. Pass 'attachment' to force a browser download (e.g. from a download button)." }),
|
|
186
191
|
(0, common_1.Get)(':id/download'),
|
|
187
192
|
openapi.ApiResponse({ status: 200 }),
|
|
188
193
|
__param(0, (0, common_1.Param)('id')),
|
|
@@ -217,7 +222,7 @@ __decorate([
|
|
|
217
222
|
__decorate([
|
|
218
223
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
219
224
|
(0, common_1.Delete)(':id'),
|
|
220
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/media.entity").Media }),
|
|
225
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/media.entity").Media] }),
|
|
221
226
|
__param(0, (0, common_1.Param)('id')),
|
|
222
227
|
__param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
|
|
223
228
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.controller.js","sourceRoot":"","sources":["../../src/controllers/media.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoI;AACpI,+DAA+D;AAC/D,6CAAmE;AACnE,iEAAqD;AACrD,4DAAoD;AACpD,+DAA2D;AAC3D,mGAA8F;AAC9F,iFAA4E;AAC5E,+DAA2D;AAC3D,6DAA0D;AAG1D,IAAK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terceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { Auth } from 'src/decorators/auth.decorator';\nimport { AuthType } from 'src/enums/auth-type.enum';\nimport { CreateMediaDto } from 'src/dtos/create-media.dto';\nimport { SolidRequestContextDecorator } from 'src/decorators/solid-request-context.decorator';\nimport { SolidRequestContextDto } from 'src/dtos/solid-request-context.dto';\nimport { UpdateMediaDto } from 'src/dtos/update-media.dto';\nimport { MediaService } from 'src/services/media.service';\nimport { Response } from 'express';\n\nenum ShowSoftDeleted {\n INCLUSIVE = \"inclusive\",\n EXCLUSIVE = \"exclusive\",\n}\n\n@ApiTags('Solid Core')\n@Controller('media')\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: true, login: true, burst: true, sustained: true }) //Skip all\nexport class MediaController {\n constructor(private readonly service: MediaService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.create(createDto, files, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateMediaDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = [], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.insertMany(createDtos, filesArray, solidRequestContext);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.update(id, updateDto, files, false, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.update(id, updateDto, files, true, solidRequestContext);\n }\n\n // @Public()\n // @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @ApiBearerAuth(\"jwt\")\n @Post('/upload')\n @UseInterceptors(AnyFilesInterceptor())\n upload(@UploadedFiles() files: Array<Express.Multer.File>, @Body() createDto: CreateMediaDto, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n // this.logger.log(`Creating a new model: ${JSON.stringify(createDto)}`);\n return this.service.upload(createDto, files, solidRequestContext);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.recoverMany(ids, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.recover(id, solidRequestContext);\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, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.find(query, solidRequestContext);\n }\n\n @Auth(AuthType.MediaSignedUrl)\n @ApiQuery({ name: 'token', required: true, type: String, description: \"Short-lived signed token obtained from a private Media record's URL - not entered manually.\" })\n @ApiQuery({ name: 'disposition', required: false, enum: ['inline', 'attachment'], description: \"'inline' (default) renders/previews in the browser, matching public media. Pass 'attachment' to force a browser download (e.g. from a download button).\" })\n @Get(':id/download')\n async download(@Param('id') id: string, @Query('disposition') disposition: string, @Res() res: Response, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n const media = await this.service.findOne(+id, {}, solidRequestContext);\n const { stream, fileName, mimeType } = await this.service.fileDownloadStream(media);\n\n const contentDisposition = disposition === 'attachment' ? 'attachment' : 'inline';\n res.setHeader('Content-Disposition', `${contentDisposition}; filename=\"${fileName}\"`);\n res.setHeader('Content-Type', mimeType);\n res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin');\n res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');\n stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.findOne(+id, query, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.deleteMany(ids, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.delete(id, solidRequestContext);\n }\n\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"media.controller.js","sourceRoot":"","sources":["../../src/controllers/media.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAoI;AACpI,+DAA+D;AAC/D,6CAAmE;AACnE,iEAAqD;AACrD,4DAAoD;AACpD,+DAA2D;AAC3D,mGAA8F;AAC9F,iFAA4E;AAC5E,+DAA2D;AAC3D,6DAA0D;AAE1D,oEAAmG;AACnG,0EAA0E;AAE1E,IA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Files, UseInterceptors } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { Auth } from 'src/decorators/auth.decorator';\nimport { AuthType } from 'src/enums/auth-type.enum';\nimport { CreateMediaDto } from 'src/dtos/create-media.dto';\nimport { SolidRequestContextDecorator } from 'src/decorators/solid-request-context.decorator';\nimport { SolidRequestContextDto } from 'src/dtos/solid-request-context.dto';\nimport { UpdateMediaDto } from 'src/dtos/update-media.dto';\nimport { MediaService } from 'src/services/media.service';\nimport { Response } from 'express';\nimport { getLowercaseFileExtension, INLINE_SAFE_EXTENSIONS } from 'src/constants/media-file-types';\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('media')\n// @UseGuards(ThrottlerGuard)\n// @SkipThrottle({ short: true, login: true, burst: true, sustained: true }) //Skip all\nexport class MediaController {\n constructor(private readonly service: MediaService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.create(createDto, files, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateMediaDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = [], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.insertMany(createDtos, filesArray, solidRequestContext);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.update(id, updateDto, files, false, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateMediaDto, @UploadedFiles() files: Array<Express.Multer.File>, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.update(id, updateDto, files, true, solidRequestContext);\n }\n\n // @Public()\n // @SkipThrottle({ short: false, login: true, burst: true, sustained: true }) //Enable the short throttle only\n @ApiBearerAuth(\"jwt\")\n @Post('/upload')\n @UseInterceptors(AnyFilesInterceptor())\n upload(@UploadedFiles() files: Array<Express.Multer.File>, @Body() createDto: CreateMediaDto, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n // this.logger.log(`Creating a new model: ${JSON.stringify(createDto)}`);\n return this.service.upload(createDto, files, solidRequestContext);\n }\n\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.recoverMany(ids, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.recover(id, solidRequestContext);\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, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.find(query, solidRequestContext);\n }\n\n @Auth(AuthType.MediaSignedUrl)\n @ApiQuery({ name: 'token', required: true, type: String, description: \"Short-lived signed token obtained from a private Media record's URL - not entered manually.\" })\n @ApiQuery({ name: 'disposition', required: false, enum: ['inline', 'attachment'], description: \"'inline' (default) renders/previews in the browser, matching public media - it applies only to types safe to render inline (images, audio, video, pdf); anything else is always downloaded. Pass 'attachment' to force a browser download (e.g. from a download button).\" })\n @Get(':id/download')\n async download(@Param('id') id: string, @Query('disposition') disposition: string, @Res() res: Response, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n const media = await this.service.findOne(+id, {}, solidRequestContext);\n const { stream, fileName, mimeType } = await this.service.fileDownloadStream(media);\n\n // Mirror the static-serve hardening in SolidCoreModule: only a small allowlist of media\n // types is ever safe to render inline. Anything else is forced to download rather than be\n // displayed/executed, regardless of the mimetype the record was stored with - nosniff\n // alone would not help here, since it faithfully honours a declared text/html.\n const isInlineSafe = INLINE_SAFE_EXTENSIONS.has(getLowercaseFileExtension(fileName) ?? '');\n const requestedInline = disposition !== 'attachment';\n\n setFileDownloadHeaders(res, {\n fileName,\n mimeType: isInlineSafe ? mimeType : 'application/octet-stream',\n disposition: requestedInline && isInlineSafe ? 'inline' : 'attachment',\n crossOriginResourcePolicy: true,\n });\n\n stream.pipe(res);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.findOne(+id, query, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[], @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.deleteMany(ids, solidRequestContext);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number, @SolidRequestContextDecorator() solidRequestContext: SolidRequestContextDto) {\n return this.service.delete(id, solidRequestContext);\n }\n\n\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export declare class MenuItemMetadataController {
|
|
|
13
13
|
findUserMenus(activeUser: ActiveUserData): Promise<any[]>;
|
|
14
14
|
findOne(id: string, query: any, solidRequestContext: SolidRequestContextDto): Promise<import("..").MenuItemMetadata>;
|
|
15
15
|
deleteMany(ids: number[], solidRequestContext: SolidRequestContextDto): Promise<any>;
|
|
16
|
-
delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").MenuItemMetadata>;
|
|
16
|
+
delete(id: number, solidRequestContext: SolidRequestContextDto): Promise<import("..").MenuItemMetadata[]>;
|
|
17
17
|
partialUpdate(id: number, updateDto: UpdateMenuItemMetadataDto, files: Array<Express.Multer.File>): Promise<import("..").MenuItemMetadata>;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=menu-item-metadata.controller.d.ts.map
|
|
@@ -146,7 +146,7 @@ __decorate([
|
|
|
146
146
|
__decorate([
|
|
147
147
|
(0, swagger_1.ApiBearerAuth)("jwt"),
|
|
148
148
|
(0, common_1.Delete)(':id'),
|
|
149
|
-
openapi.ApiResponse({ status: 200, type: require("../entities/menu-item-metadata.entity").MenuItemMetadata }),
|
|
149
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/menu-item-metadata.entity").MenuItemMetadata] }),
|
|
150
150
|
__param(0, (0, common_1.Param)('id')),
|
|
151
151
|
__param(1, (0, solid_request_context_decorator_1.SolidRequestContextDecorator)()),
|
|
152
152
|
__metadata("design:type", Function),
|
|
@@ -19,6 +19,6 @@ export declare class ModelSequenceController {
|
|
|
19
19
|
findMany(query: any): Promise<any>;
|
|
20
20
|
findOne(id: string, query: any): Promise<import("..").ModelSequence>;
|
|
21
21
|
deleteMany(ids: number[]): Promise<any>;
|
|
22
|
-
delete(id: number): Promise<import("..").ModelSequence>;
|
|
22
|
+
delete(id: number): Promise<import("..").ModelSequence[]>;
|
|
23
23
|
}
|
|
24
24
|
//# sourceMappingURL=model-sequence.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/model-sequence.entity").ModelSequence }),
|
|
168
|
+
openapi.ApiResponse({ status: 200, type: [require("../entities/model-sequence.entity").ModelSequence] }),
|
|
169
169
|
__param(0, (0, common_1.Param)('id')),
|
|
170
170
|
__metadata("design:type", Function),
|
|
171
171
|
__metadata("design:paramtypes", [Number]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-package.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/module-package.controller.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"module-package.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/module-package.controller.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,qBAEa,uBAAuB;IAE5B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBAApB,oBAAoB,EAAE,oBAAoB;IAMzD,qBAAqB,CACN,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;;;;;;;;;;;;;uBAFxB,CAAC;;;;2BAEL,CA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AE,EAAE,MAAM,EACf,GAAG,EAAE,wBAAwB;;;;;;;;;;;;;uBA3DX,CAAC;;;;2BAEL,CAAC;2BAC3B,CAAH;;;;;;;;;;;;;;2BAW0F,CAAC;2BACpE,CAAC;;;;;;;;2BAfS,CAAC;;;;+BAEL,CAAC;+BAC3B,CAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+DS,OAAO,CACI,EAAE,EAAE,MAAM,EACf,GAAG,EAAE,uBAAuB;;;;;;;;;;;;;uBApEV,CAAC;;;;2BAEL,CAAC;2BAC3B,CAAH;;;;;;;;;;;;;;2BAW0F,CAAC;2BACpE,CAAC;;;;;;;;2BAfS,CAAC;;;;+BAEL,CAAC;+BAC3B,CAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEA"}
|
|
@@ -19,6 +19,7 @@ const platform_express_1 = require("@nestjs/platform-express");
|
|
|
19
19
|
const swagger_1 = require("@nestjs/swagger");
|
|
20
20
|
const confirm_module_package_import_dto_1 = require("../dtos/confirm-module-package-import.dto");
|
|
21
21
|
const run_module_package_build_dto_1 = require("../dtos/run-module-package-build.dto");
|
|
22
|
+
const file_download_helper_1 = require("../helpers/file-download.helper");
|
|
22
23
|
const run_module_package_seed_dto_1 = require("../dtos/run-module-package-seed.dto");
|
|
23
24
|
const module_package_service_1 = require("../services/module-package.service");
|
|
24
25
|
let ModulePackageController = class ModulePackageController {
|
|
@@ -30,9 +31,7 @@ let ModulePackageController = class ModulePackageController {
|
|
|
30
31
|
}
|
|
31
32
|
async exportModulePackage(moduleName, res) {
|
|
32
33
|
const archive = await this.modulePackageService.exportModulePackage(moduleName);
|
|
33
|
-
|
|
34
|
-
res.setHeader('Content-Type', archive.mimeType);
|
|
35
|
-
res.setHeader('Access-Control-Expose-Headers', 'Content-Disposition, Content-Type');
|
|
34
|
+
(0, file_download_helper_1.setFileDownloadHeaders)(res, { fileName: archive.fileName, mimeType: archive.mimeType });
|
|
36
35
|
res.sendFile(archive.filePath);
|
|
37
36
|
}
|
|
38
37
|
async getLatestResumableImport() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-package.controller.js","sourceRoot":"","sources":["../../src/controllers/module-package.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+DAA+D;AAC/D,6CAAyD;AAEzD,iGAA2F;AAC3F,uFAAiF;AACjF,qFAA+E;AAC/E,+EAA2E;AAIpE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAChC,YACqB,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAC3D,CAAC;IAKC,AAAN,KAAK,CAAC,qBAAqB,CACN,KAAiC;QAElD,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACA,UAAkB,EAChC,GAAa;QAEpB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAChF,
|
|
1
|
+
{"version":3,"file":"module-package.controller.js","sourceRoot":"","sources":["../../src/controllers/module-package.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+DAA+D;AAC/D,6CAAyD;AAEzD,iGAA2F;AAC3F,uFAAiF;AACjF,0EAA0E;AAC1E,qFAA+E;AAC/E,+EAA2E;AAIpE,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAChC,YACqB,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAC3D,CAAC;IAKC,AAAN,KAAK,CAAC,qBAAqB,CACN,KAAiC;QAElD,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACA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M,uDAAwB;;uDAGxC;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,aAAI,EAAC,iBAAiB,CAAC;;IAEnB,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAM,qDAAuB;;sDAGvC;kCA9EQ,uBAAuB;IAFnC,IAAA,mBAAU,EAAC,iBAAiB,CAAC;IAC7B,IAAA,iBAAO,EAAC,YAAY,CAAC;qCAGyB,6CAAoB;GAFtD,uBAAuB,CA+EnC","sourcesContent":["import {\n Controller,\n Get,\n Param,\n Post,\n Body,\n Res,\n UploadedFiles,\n UseInterceptors,\n} from '@nestjs/common';\nimport { AnyFilesInterceptor } from '@nestjs/platform-express';\nimport { ApiBearerAuth, ApiTags } from '@nestjs/swagger';\nimport { Response } from 'express';\nimport { ConfirmModulePackageImportDto } from 'src/dtos/confirm-module-package-import.dto';\nimport { RunModulePackageBuildDto } from 'src/dtos/run-module-package-build.dto';\nimport { setFileDownloadHeaders } from 'src/helpers/file-download.helper';\nimport { RunModulePackageSeedDto } from 'src/dtos/run-module-package-seed.dto';\nimport { ModulePackageService } from 'src/services/module-package.service';\n\n@Controller('module-packages')\n@ApiTags('Solid Core')\nexport class ModulePackageController {\n constructor(\n private readonly modulePackageService: ModulePackageService,\n ) { }\n\n @ApiBearerAuth('jwt')\n @Post('import/validate')\n @UseInterceptors(AnyFilesInterceptor())\n async validateImportPackage(\n @UploadedFiles() files: Array<Express.Multer.File>,\n ) {\n return this.modulePackageService.validateUpload(files?.[0]);\n }\n\n @ApiBearerAuth('jwt')\n @Get('export/:moduleName')\n async exportModulePackage(\n @Param('moduleName') moduleName: string,\n @Res() res: Response,\n ) {\n const archive = await this.modulePackageService.exportModulePackage(moduleName);\n setFileDownloadHeaders(res, { fileName: archive.fileName, mimeType: archive.mimeType });\n res.sendFile(archive.filePath);\n }\n\n @ApiBearerAuth('jwt')\n @Get('import/resumable/latest')\n async getLatestResumableImport() {\n return this.modulePackageService.getLatestResumableImport();\n }\n\n @ApiBearerAuth('jwt')\n @Post('runtime/clear')\n async clearPackageRuntime() {\n return this.modulePackageService.clearPackageRuntime();\n }\n\n @ApiBearerAuth('jwt')\n @Post('import/:id/confirm')\n async confirmImport(\n @Param('id') id: string,\n @Body() dto: ConfirmModulePackageImportDto,\n ) {\n return this.modulePackageService.confirmImport(id, dto);\n }\n\n @ApiBearerAuth('jwt')\n @Post('import/:id/dismiss')\n async dismissImport(\n @Param('id') id: string,\n ) {\n return this.modulePackageService.dismissImport(id);\n }\n\n @ApiBearerAuth('jwt')\n @Get('import/:id/status')\n async getImportStatus(\n @Param('id') id: string,\n ) {\n return this.modulePackageService.getStatus(id);\n }\n\n @ApiBearerAuth('jwt')\n @Post('import/:id/build')\n async runBuild(\n @Param('id') id: string,\n @Body() dto: RunModulePackageBuildDto,\n ) {\n return this.modulePackageService.runBuild(id, dto);\n }\n\n @ApiBearerAuth('jwt')\n @Post('import/:id/seed')\n async runSeed(\n @Param('id') id: string,\n @Body() dto: RunModulePackageSeedDto,\n ) {\n return this.modulePackageService.runSeed(id, dto);\n }\n}\n"]}
|