@rytass/bpm-core-nestjs-module 0.1.3 → 0.1.5
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 +49 -0
- package/LICENSE +21 -0
- package/README.md +143 -0
- package/package.json +3 -3
- package/src/index.js +18 -0
- package/src/index.js.map +1 -0
- package/src/lib/attachment/attachment-options.d.ts +44 -0
- package/src/lib/attachment/attachment-options.js +62 -0
- package/src/lib/attachment/attachment-options.js.map +1 -0
- package/src/lib/attachment/attachment-storage.provider.d.ts +4 -0
- package/src/lib/attachment/attachment-storage.provider.js +35 -0
- package/src/lib/attachment/attachment-storage.provider.js.map +1 -0
- package/src/lib/attachment/{attachment-storage.token.ts → attachment-storage.token.d.ts} +1 -3
- package/src/lib/attachment/attachment-storage.token.js +5 -0
- package/src/lib/attachment/attachment-storage.token.js.map +1 -0
- package/src/lib/attachment/attachment.controller.d.ts +8 -0
- package/src/lib/attachment/attachment.controller.js +38 -0
- package/src/lib/attachment/attachment.controller.js.map +1 -0
- package/src/lib/attachment/attachment.entity.d.ts +14 -0
- package/src/lib/attachment/attachment.entity.js +74 -0
- package/src/lib/attachment/attachment.entity.js.map +1 -0
- package/src/lib/attachment/attachment.module.d.ts +27 -0
- package/src/lib/attachment/attachment.module.js +103 -0
- package/src/lib/attachment/attachment.module.js.map +1 -0
- package/src/lib/attachment/attachment.mutations.d.ts +8 -0
- package/src/lib/attachment/attachment.mutations.js +35 -0
- package/src/lib/attachment/attachment.mutations.js.map +1 -0
- package/src/lib/attachment/attachment.queries.d.ts +9 -0
- package/src/lib/attachment/attachment.queries.js +78 -0
- package/src/lib/attachment/attachment.queries.js.map +1 -0
- package/src/lib/attachment/attachment.service.d.ts +49 -0
- package/src/lib/attachment/attachment.service.js +276 -0
- package/src/lib/attachment/attachment.service.js.map +1 -0
- package/src/lib/attachment/dto/upload-attachment.input.d.ts +11 -0
- package/src/lib/attachment/dto/upload-attachment.input.js +68 -0
- package/src/lib/attachment/dto/upload-attachment.input.js.map +1 -0
- package/src/lib/attachment/index.js +9 -0
- package/src/lib/attachment/index.js.map +1 -0
- package/src/lib/bpm/bpm-root.module.d.ts +155 -0
- package/src/lib/bpm/bpm-root.module.js +170 -0
- package/src/lib/bpm/bpm-root.module.js.map +1 -0
- package/src/lib/bpm/index.js +5 -0
- package/src/lib/bpm/index.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth-context.d.ts +24 -0
- package/src/lib/bpm-auth/bpm-auth-context.extractor.d.ts +4 -0
- package/src/lib/bpm-auth/bpm-auth-context.extractor.js +69 -0
- package/src/lib/bpm-auth/bpm-auth-context.extractor.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth-context.js +15 -0
- package/src/lib/bpm-auth/bpm-auth-context.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth.authorization.d.ts +12 -0
- package/src/lib/bpm-auth/bpm-auth.authorization.js +67 -0
- package/src/lib/bpm-auth/bpm-auth.authorization.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth.decorators.d.ts +3 -0
- package/src/lib/bpm-auth/bpm-auth.decorators.js +11 -0
- package/src/lib/bpm-auth/bpm-auth.decorators.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth.guard.d.ts +7 -0
- package/src/lib/bpm-auth/bpm-auth.guard.js +24 -0
- package/src/lib/bpm-auth/bpm-auth.guard.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth.module.d.ts +6 -0
- package/src/lib/bpm-auth/bpm-auth.module.js +69 -0
- package/src/lib/bpm-auth/bpm-auth.module.js.map +1 -0
- package/src/lib/bpm-auth/bpm-auth.options.d.ts +11 -0
- package/src/lib/bpm-auth/bpm-auth.options.js +3 -0
- package/src/lib/bpm-auth/bpm-auth.options.js.map +1 -0
- package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.d.ts +10 -0
- package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.js +40 -0
- package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.js.map +1 -0
- package/src/lib/bpm-auth/index.js +10 -0
- package/src/lib/bpm-auth/index.js.map +1 -0
- package/src/lib/common/filters/all-exceptions.filter.d.ts +25 -0
- package/src/lib/common/filters/all-exceptions.filter.js +93 -0
- package/src/lib/common/filters/all-exceptions.filter.js.map +1 -0
- package/src/lib/common/index.js +5 -0
- package/src/lib/common/index.js.map +1 -0
- package/src/lib/common/iso-duration.d.ts +1 -0
- package/src/lib/common/iso-duration.js +27 -0
- package/src/lib/common/iso-duration.js.map +1 -0
- package/src/lib/condition/condition.module.d.ts +2 -0
- package/src/lib/condition/condition.module.js +16 -0
- package/src/lib/condition/condition.module.js.map +1 -0
- package/src/lib/condition/condition.service.d.ts +16 -0
- package/src/lib/condition/condition.service.js +82 -0
- package/src/lib/condition/condition.service.js.map +1 -0
- package/src/lib/condition/index.js +6 -0
- package/src/lib/condition/index.js.map +1 -0
- package/src/lib/database/data-source.d.ts +4 -0
- package/src/lib/database/data-source.js +7 -0
- package/src/lib/database/data-source.js.map +1 -0
- package/src/lib/database/index.js +6 -0
- package/src/lib/database/index.js.map +1 -0
- package/src/lib/database/migration-runner.d.ts +1 -0
- package/src/lib/database/migration-runner.js +23 -0
- package/src/lib/database/migration-runner.js.map +1 -0
- package/src/lib/database/typeorm.config.d.ts +14 -0
- package/src/lib/database/typeorm.config.js +135 -0
- package/src/lib/database/typeorm.config.js.map +1 -0
- package/src/lib/delegation/delegation-rule.entity.d.ts +19 -0
- package/src/lib/delegation/delegation-rule.entity.js +99 -0
- package/src/lib/delegation/delegation-rule.entity.js.map +1 -0
- package/src/lib/delegation/delegation.enums.d.ts +10 -0
- package/src/lib/delegation/delegation.enums.js +23 -0
- package/src/lib/delegation/delegation.enums.js.map +1 -0
- package/src/lib/delegation/delegation.module.d.ts +2 -0
- package/src/lib/delegation/delegation.module.js +22 -0
- package/src/lib/delegation/delegation.module.js.map +1 -0
- package/src/lib/delegation/delegation.mutations.d.ts +11 -0
- package/src/lib/delegation/delegation.mutations.js +87 -0
- package/src/lib/delegation/delegation.mutations.js.map +1 -0
- package/src/lib/delegation/delegation.queries.d.ts +10 -0
- package/src/lib/delegation/delegation.queries.js +91 -0
- package/src/lib/delegation/delegation.queries.js.map +1 -0
- package/src/lib/delegation/delegation.service.d.ts +56 -0
- package/src/lib/delegation/delegation.service.js +268 -0
- package/src/lib/delegation/delegation.service.js.map +1 -0
- package/src/lib/delegation/dto/delegation-rule.input.d.ts +24 -0
- package/src/lib/delegation/dto/delegation-rule.input.js +143 -0
- package/src/lib/delegation/dto/delegation-rule.input.js.map +1 -0
- package/src/lib/delegation/index.js +9 -0
- package/src/lib/delegation/index.js.map +1 -0
- package/src/lib/form/dto/form-definition.input.d.ts +21 -0
- package/src/lib/form/dto/form-definition.input.js +103 -0
- package/src/lib/form/dto/form-definition.input.js.map +1 -0
- package/src/lib/form/form-definition-version.entity.d.ts +17 -0
- package/src/lib/form/form-definition-version.entity.js +84 -0
- package/src/lib/form/form-definition-version.entity.js.map +1 -0
- package/src/lib/form/form-definition.entity.d.ts +13 -0
- package/src/lib/form/form-definition.entity.js +66 -0
- package/src/lib/form/form-definition.entity.js.map +1 -0
- package/src/lib/form/form-schema-lint.object.d.ts +4 -0
- package/src/lib/form/form-schema-lint.object.js +20 -0
- package/src/lib/form/form-schema-lint.object.js.map +1 -0
- package/src/lib/form/form-schema.validator.d.ts +13 -0
- package/src/lib/form/form-schema.validator.js +354 -0
- package/src/lib/form/form-schema.validator.js.map +1 -0
- package/src/lib/form/form.enums.d.ts +9 -0
- package/src/lib/form/form.enums.js +22 -0
- package/src/lib/form/form.enums.js.map +1 -0
- package/src/lib/form/form.module.d.ts +2 -0
- package/src/lib/form/form.module.js +27 -0
- package/src/lib/form/form.module.js.map +1 -0
- package/src/lib/form/form.mutations.d.ts +14 -0
- package/src/lib/form/form.mutations.js +88 -0
- package/src/lib/form/form.mutations.js.map +1 -0
- package/src/lib/form/form.queries.d.ts +16 -0
- package/src/lib/form/form.queries.js +96 -0
- package/src/lib/form/form.queries.js.map +1 -0
- package/src/lib/form/form.service.d.ts +35 -0
- package/src/lib/form/form.service.js +297 -0
- package/src/lib/form/form.service.js.map +1 -0
- package/src/lib/form/index.js +12 -0
- package/src/lib/form/index.js.map +1 -0
- package/src/lib/identity/identity-options.d.ts +13 -0
- package/src/lib/identity/identity-options.js +20 -0
- package/src/lib/identity/identity-options.js.map +1 -0
- package/src/lib/identity/identity.module.d.ts +17 -0
- package/src/lib/identity/identity.module.js +65 -0
- package/src/lib/identity/identity.module.js.map +1 -0
- package/src/lib/identity/identity.queries.d.ts +12 -0
- package/src/lib/identity/identity.queries.js +79 -0
- package/src/lib/identity/identity.queries.js.map +1 -0
- package/src/lib/identity/identity.service.d.ts +22 -0
- package/src/lib/identity/identity.service.js +141 -0
- package/src/lib/identity/identity.service.js.map +1 -0
- package/src/lib/identity/index.js +7 -0
- package/src/lib/identity/index.js.map +1 -0
- package/src/lib/identity/member-base.adapter.d.ts +95 -0
- package/src/lib/identity/member-base.adapter.js +137 -0
- package/src/lib/identity/member-base.adapter.js.map +1 -0
- package/src/lib/identity/member-metadata-cache.entity.d.ts +8 -0
- package/src/lib/identity/member-metadata-cache.entity.js +39 -0
- package/src/lib/identity/member-metadata-cache.entity.js.map +1 -0
- package/src/lib/identity/member-profile.object.d.ts +8 -0
- package/src/lib/identity/member-profile.object.js +37 -0
- package/src/lib/identity/member-profile.object.js.map +1 -0
- package/src/lib/identity/member-resolver.interface.d.ts +79 -0
- package/src/lib/identity/member-resolver.interface.js +19 -0
- package/src/lib/identity/member-resolver.interface.js.map +1 -0
- package/src/lib/migrations/0000000000001-enable-postgres-extensions.d.ts +6 -0
- package/src/lib/migrations/0000000000001-enable-postgres-extensions.js +17 -0
- package/src/lib/migrations/0000000000001-enable-postgres-extensions.js.map +1 -0
- package/src/lib/migrations/0000000001000-identity-organization-foundation.d.ts +6 -0
- package/src/lib/migrations/{0000000001000-identity-organization-foundation.ts → 0000000001000-identity-organization-foundation.js} +29 -38
- package/src/lib/migrations/0000000001000-identity-organization-foundation.js.map +1 -0
- package/src/lib/migrations/0000000002000-form-builder-foundation.d.ts +6 -0
- package/src/lib/migrations/{0000000002000-form-builder-foundation.ts → 0000000002000-form-builder-foundation.js} +21 -22
- package/src/lib/migrations/0000000002000-form-builder-foundation.js.map +1 -0
- package/src/lib/migrations/0000000003000-approval-template-foundation.d.ts +6 -0
- package/src/lib/migrations/{0000000003000-approval-template-foundation.ts → 0000000003000-approval-template-foundation.js} +21 -24
- package/src/lib/migrations/0000000003000-approval-template-foundation.js.map +1 -0
- package/src/lib/migrations/0000000004000-workflow-engine-foundation.d.ts +6 -0
- package/src/lib/migrations/{0000000004000-workflow-engine-foundation.ts → 0000000004000-workflow-engine-foundation.js} +34 -46
- package/src/lib/migrations/0000000004000-workflow-engine-foundation.js.map +1 -0
- package/src/lib/migrations/0000000005000-delegation-rules.d.ts +6 -0
- package/src/lib/migrations/{0000000005000-delegation-rules.ts → 0000000005000-delegation-rules.js} +19 -20
- package/src/lib/migrations/0000000005000-delegation-rules.js.map +1 -0
- package/src/lib/migrations/0000000006000-notifications-sla.d.ts +6 -0
- package/src/lib/migrations/{0000000006000-notifications-sla.ts → 0000000006000-notifications-sla.js} +23 -26
- package/src/lib/migrations/0000000006000-notifications-sla.js.map +1 -0
- package/src/lib/migrations/0000000007000-signatures-attachments.d.ts +6 -0
- package/src/lib/migrations/{0000000007000-signatures-attachments.ts → 0000000007000-signatures-attachments.js} +27 -28
- package/src/lib/migrations/0000000007000-signatures-attachments.js.map +1 -0
- package/src/lib/migrations/0000000008000-approval-template-categories.d.ts +6 -0
- package/src/lib/migrations/{0000000008000-approval-template-categories.ts → 0000000008000-approval-template-categories.js} +25 -28
- package/src/lib/migrations/0000000008000-approval-template-categories.js.map +1 -0
- package/src/lib/migrations/0000000009000-task-candidates.d.ts +6 -0
- package/src/lib/migrations/{0000000009000-task-candidates.ts → 0000000009000-task-candidates.js} +23 -26
- package/src/lib/migrations/0000000009000-task-candidates.js.map +1 -0
- package/src/lib/migrations/0000000010000-notification-delivery-state.d.ts +6 -0
- package/src/lib/migrations/{0000000010000-notification-delivery-state.ts → 0000000010000-notification-delivery-state.js} +17 -16
- package/src/lib/migrations/0000000010000-notification-delivery-state.js.map +1 -0
- package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.d.ts +6 -0
- package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.js +22 -0
- package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.js.map +1 -0
- package/src/lib/migrations/0000000012000-notification-sla-idempotency.d.ts +6 -0
- package/src/lib/migrations/0000000012000-notification-sla-idempotency.js +21 -0
- package/src/lib/migrations/0000000012000-notification-sla-idempotency.js.map +1 -0
- package/src/lib/migrations/0000000013000-workflow-query-indexes.d.ts +6 -0
- package/src/lib/migrations/0000000013000-workflow-query-indexes.js +80 -0
- package/src/lib/migrations/0000000013000-workflow-query-indexes.js.map +1 -0
- package/src/lib/migrations/index.d.ts +16 -0
- package/src/lib/migrations/index.js +49 -0
- package/src/lib/migrations/index.js.map +1 -0
- package/src/lib/notification/dto/notification-preference.input.d.ts +9 -0
- package/src/lib/notification/dto/notification-preference.input.js +53 -0
- package/src/lib/notification/dto/notification-preference.input.js.map +1 -0
- package/src/lib/notification/index.js +11 -0
- package/src/lib/notification/index.js.map +1 -0
- package/src/lib/notification/notification-delivery-scheduler.service.d.ts +13 -0
- package/src/lib/notification/notification-delivery-scheduler.service.js +53 -0
- package/src/lib/notification/notification-delivery-scheduler.service.js.map +1 -0
- package/src/lib/notification/notification-delivery.service.d.ts +23 -0
- package/src/lib/notification/notification-delivery.service.js +245 -0
- package/src/lib/notification/notification-delivery.service.js.map +1 -0
- package/src/lib/notification/notification-dispatcher.token.d.ts +7 -0
- package/src/lib/notification/notification-dispatcher.token.js +5 -0
- package/src/lib/notification/notification-dispatcher.token.js.map +1 -0
- package/src/lib/notification/notification-options.d.ts +215 -0
- package/src/lib/notification/notification-options.js +128 -0
- package/src/lib/notification/notification-options.js.map +1 -0
- package/src/lib/notification/notification-options.module.d.ts +23 -0
- package/src/lib/notification/notification-options.module.js +41 -0
- package/src/lib/notification/notification-options.module.js.map +1 -0
- package/src/lib/notification/notification-preference.entity.d.ts +10 -0
- package/src/lib/notification/notification-preference.entity.js +50 -0
- package/src/lib/notification/notification-preference.entity.js.map +1 -0
- package/src/lib/notification/notification-sla-scheduler.service.d.ts +13 -0
- package/src/lib/notification/notification-sla-scheduler.service.js +51 -0
- package/src/lib/notification/notification-sla-scheduler.service.js.map +1 -0
- package/src/lib/notification/notification-template.d.ts +13 -0
- package/src/lib/notification/notification-template.js +61 -0
- package/src/lib/notification/notification-template.js.map +1 -0
- package/src/lib/notification/notification.entity.d.ts +23 -0
- package/src/lib/notification/notification.entity.js +122 -0
- package/src/lib/notification/notification.entity.js.map +1 -0
- package/src/lib/notification/notification.enums.d.ts +24 -0
- package/src/lib/notification/notification.enums.js +45 -0
- package/src/lib/notification/notification.enums.js.map +1 -0
- package/src/lib/notification/notification.module.d.ts +2 -0
- package/src/lib/notification/notification.module.js +45 -0
- package/src/lib/notification/notification.module.js.map +1 -0
- package/src/lib/notification/notification.mutations.d.ts +11 -0
- package/src/lib/notification/notification.mutations.js +64 -0
- package/src/lib/notification/notification.mutations.js.map +1 -0
- package/src/lib/notification/notification.queries.d.ts +11 -0
- package/src/lib/notification/notification.queries.js +77 -0
- package/src/lib/notification/notification.queries.js.map +1 -0
- package/src/lib/notification/notification.service.d.ts +81 -0
- package/src/lib/notification/notification.service.js +621 -0
- package/src/lib/notification/notification.service.js.map +1 -0
- package/src/lib/organization/dto/manager-resolution.input.d.ts +18 -0
- package/src/lib/organization/dto/manager-resolution.input.js +107 -0
- package/src/lib/organization/dto/manager-resolution.input.js.map +1 -0
- package/src/lib/organization/dto/membership.input.d.ts +16 -0
- package/src/lib/organization/dto/membership.input.js +99 -0
- package/src/lib/organization/dto/membership.input.js.map +1 -0
- package/src/lib/organization/dto/org-unit.input.d.ts +24 -0
- package/src/lib/organization/dto/org-unit.input.js +119 -0
- package/src/lib/organization/dto/org-unit.input.js.map +1 -0
- package/src/lib/organization/dto/position.input.d.ts +13 -0
- package/src/lib/organization/dto/position.input.js +70 -0
- package/src/lib/organization/dto/position.input.js.map +1 -0
- package/src/lib/organization/index.js +16 -0
- package/src/lib/organization/index.js.map +1 -0
- package/src/lib/organization/json-metadata.d.ts +1 -0
- package/src/lib/organization/json-metadata.js +14 -0
- package/src/lib/organization/json-metadata.js.map +1 -0
- package/src/lib/organization/manager-resolution.entity.d.ts +11 -0
- package/src/lib/organization/manager-resolution.entity.js +55 -0
- package/src/lib/organization/manager-resolution.entity.js.map +1 -0
- package/src/lib/organization/membership.entity.d.ts +11 -0
- package/src/lib/organization/membership.entity.js +60 -0
- package/src/lib/organization/membership.entity.js.map +1 -0
- package/src/lib/organization/org-unit-tree-commit-result.object.d.ts +4 -0
- package/src/lib/organization/org-unit-tree-commit-result.object.js +17 -0
- package/src/lib/organization/org-unit-tree-commit-result.object.js.map +1 -0
- package/src/lib/organization/org-unit.entity.d.ts +13 -0
- package/src/lib/organization/org-unit.entity.js +64 -0
- package/src/lib/organization/org-unit.entity.js.map +1 -0
- package/src/lib/organization/organization-summary.object.d.ts +6 -0
- package/src/lib/organization/organization-summary.object.js +28 -0
- package/src/lib/organization/organization-summary.object.js.map +1 -0
- package/src/lib/organization/organization.enums.d.ts +11 -0
- package/src/lib/organization/organization.enums.js +22 -0
- package/src/lib/organization/organization.enums.js.map +1 -0
- package/src/lib/organization/organization.module.d.ts +2 -0
- package/src/lib/organization/organization.module.js +35 -0
- package/src/lib/organization/organization.module.js.map +1 -0
- package/src/lib/organization/organization.mutations.d.ts +26 -0
- package/src/lib/organization/organization.mutations.js +148 -0
- package/src/lib/organization/organization.mutations.js.map +1 -0
- package/src/lib/organization/organization.queries.d.ts +23 -0
- package/src/lib/organization/organization.queries.js +202 -0
- package/src/lib/organization/organization.queries.js.map +1 -0
- package/src/lib/organization/organization.service.d.ts +102 -0
- package/src/lib/organization/organization.service.js +751 -0
- package/src/lib/organization/organization.service.js.map +1 -0
- package/src/lib/organization/position.entity.d.ts +9 -0
- package/src/lib/organization/position.entity.js +48 -0
- package/src/lib/organization/position.entity.js.map +1 -0
- package/src/lib/organization/resolved-manager.object.d.ts +4 -0
- package/src/lib/organization/resolved-manager.object.js +20 -0
- package/src/lib/organization/resolved-manager.object.js.map +1 -0
- package/src/lib/signature/index.js +8 -0
- package/src/lib/signature/index.js.map +1 -0
- package/src/lib/signature/signature-options.d.ts +33 -0
- package/src/lib/signature/signature-options.js +51 -0
- package/src/lib/signature/signature-options.js.map +1 -0
- package/src/lib/signature/signature-verification.object.d.ts +6 -0
- package/src/lib/signature/signature-verification.object.js +28 -0
- package/src/lib/signature/signature-verification.object.js.map +1 -0
- package/src/lib/signature/signature.entity.d.ts +16 -0
- package/src/lib/signature/signature.entity.js +88 -0
- package/src/lib/signature/signature.entity.js.map +1 -0
- package/src/lib/signature/signature.module.d.ts +11 -0
- package/src/lib/signature/signature.module.js +60 -0
- package/src/lib/signature/signature.module.js.map +1 -0
- package/src/lib/signature/signature.queries.d.ts +11 -0
- package/src/lib/signature/signature.queries.js +46 -0
- package/src/lib/signature/signature.queries.js.map +1 -0
- package/src/lib/signature/signature.service.d.ts +25 -0
- package/src/lib/signature/signature.service.js +124 -0
- package/src/lib/signature/signature.service.js.map +1 -0
- package/src/lib/template/approval-template-category.entity.d.ts +9 -0
- package/src/lib/template/approval-template-category.entity.js +49 -0
- package/src/lib/template/approval-template-category.entity.js.map +1 -0
- package/src/lib/template/approval-template-version.entity.d.ts +21 -0
- package/src/lib/template/approval-template-version.entity.js +106 -0
- package/src/lib/template/approval-template-version.entity.js.map +1 -0
- package/src/lib/template/approval-template.entity.d.ts +14 -0
- package/src/lib/template/approval-template.entity.js +74 -0
- package/src/lib/template/approval-template.entity.js.map +1 -0
- package/src/lib/template/dto/approval-template.input.d.ts +36 -0
- package/src/lib/template/dto/approval-template.input.js +187 -0
- package/src/lib/template/dto/approval-template.input.js.map +1 -0
- package/src/lib/template/index.js +12 -0
- package/src/lib/template/index.js.map +1 -0
- package/src/lib/template/template.enums.d.ts +14 -0
- package/src/lib/template/template.enums.js +31 -0
- package/src/lib/template/template.enums.js.map +1 -0
- package/src/lib/template/template.module.d.ts +2 -0
- package/src/lib/template/template.module.js +33 -0
- package/src/lib/template/template.module.js.map +1 -0
- package/src/lib/template/template.mutations.d.ts +20 -0
- package/src/lib/template/template.mutations.js +139 -0
- package/src/lib/template/template.mutations.js.map +1 -0
- package/src/lib/template/template.queries.d.ts +16 -0
- package/src/lib/template/template.queries.js +133 -0
- package/src/lib/template/template.queries.js.map +1 -0
- package/src/lib/template/template.service.d.ts +64 -0
- package/src/lib/template/template.service.js +521 -0
- package/src/lib/template/template.service.js.map +1 -0
- package/src/lib/template/workflow-definition.validator.d.ts +9 -0
- package/src/lib/template/workflow-definition.validator.js +362 -0
- package/src/lib/template/workflow-definition.validator.js.map +1 -0
- package/src/lib/testing/cel-js.jest.d.ts +15 -0
- package/src/lib/testing/cel-js.jest.js +27 -0
- package/src/lib/testing/cel-js.jest.js.map +1 -0
- package/src/lib/workflow-engine/activity-log.entity.d.ts +12 -0
- package/src/lib/workflow-engine/activity-log.entity.js +62 -0
- package/src/lib/workflow-engine/activity-log.entity.js.map +1 -0
- package/src/lib/workflow-engine/approval-instance-page-info.object.d.ts +8 -0
- package/src/lib/workflow-engine/approval-instance-page-info.object.js +36 -0
- package/src/lib/workflow-engine/approval-instance-page-info.object.js.map +1 -0
- package/src/lib/workflow-engine/approval-instance.entity.d.ts +22 -0
- package/src/lib/workflow-engine/approval-instance.entity.js +113 -0
- package/src/lib/workflow-engine/approval-instance.entity.js.map +1 -0
- package/src/lib/workflow-engine/dto/cancel-approval-instance.input.d.ts +5 -0
- package/src/lib/workflow-engine/dto/cancel-approval-instance.input.js +29 -0
- package/src/lib/workflow-engine/dto/cancel-approval-instance.input.js.map +1 -0
- package/src/lib/workflow-engine/dto/decide-task.input.d.ts +9 -0
- package/src/lib/workflow-engine/dto/decide-task.input.js +47 -0
- package/src/lib/workflow-engine/dto/decide-task.input.js.map +1 -0
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.d.ts +6 -0
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.js +34 -0
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.js.map +1 -0
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.d.ts +6 -0
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js +34 -0
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.js.map +1 -0
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.d.ts +7 -0
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.js +40 -0
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.js.map +1 -0
- package/src/lib/workflow-engine/index.js +24 -0
- package/src/lib/workflow-engine/index.js.map +1 -0
- package/src/lib/workflow-engine/task-candidate.entity.d.ts +14 -0
- package/src/lib/workflow-engine/task-candidate.entity.js +72 -0
- package/src/lib/workflow-engine/task-candidate.entity.js.map +1 -0
- package/src/lib/workflow-engine/task-decision.entity.d.ts +12 -0
- package/src/lib/workflow-engine/task-decision.entity.js +60 -0
- package/src/lib/workflow-engine/task-decision.entity.js.map +1 -0
- package/src/lib/workflow-engine/task.entity.d.ts +20 -0
- package/src/lib/workflow-engine/task.entity.js +109 -0
- package/src/lib/workflow-engine/task.entity.js.map +1 -0
- package/src/lib/workflow-engine/workflow-condition-evaluator.d.ts +5 -0
- package/src/lib/workflow-engine/workflow-condition-evaluator.js +107 -0
- package/src/lib/workflow-engine/workflow-condition-evaluator.js.map +1 -0
- package/src/lib/workflow-engine/workflow-dashboard-summary.object.d.ts +8 -0
- package/src/lib/workflow-engine/workflow-dashboard-summary.object.js +36 -0
- package/src/lib/workflow-engine/workflow-dashboard-summary.object.js.map +1 -0
- package/src/lib/workflow-engine/workflow-dry-run.object.d.ts +21 -0
- package/src/lib/workflow-engine/workflow-dry-run.object.js +86 -0
- package/src/lib/workflow-engine/workflow-dry-run.object.js.map +1 -0
- package/src/lib/workflow-engine/workflow-engine.enums.d.ts +58 -0
- package/src/lib/workflow-engine/workflow-engine.enums.js +95 -0
- package/src/lib/workflow-engine/workflow-engine.enums.js.map +1 -0
- package/src/lib/workflow-engine/workflow-engine.module.d.ts +9 -0
- package/src/lib/workflow-engine/workflow-engine.module.js +76 -0
- package/src/lib/workflow-engine/workflow-engine.module.js.map +1 -0
- package/src/lib/workflow-engine/workflow-engine.mutations.d.ts +19 -0
- package/src/lib/workflow-engine/workflow-engine.mutations.js +106 -0
- package/src/lib/workflow-engine/workflow-engine.mutations.js.map +1 -0
- package/src/lib/workflow-engine/workflow-engine.queries.d.ts +29 -0
- package/src/lib/workflow-engine/workflow-engine.queries.js +225 -0
- package/src/lib/workflow-engine/workflow-engine.queries.js.map +1 -0
- package/src/lib/workflow-engine/workflow-engine.service.d.ts +145 -0
- package/src/lib/workflow-engine/workflow-engine.service.js +2785 -0
- package/src/lib/workflow-engine/workflow-engine.service.js.map +1 -0
- package/src/lib/workflow-engine/{workflow-engine.tokens.ts → workflow-engine.tokens.d.ts} +3 -9
- package/src/lib/workflow-engine/workflow-engine.tokens.js +5 -0
- package/src/lib/workflow-engine/workflow-engine.tokens.js.map +1 -0
- package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.d.ts +18 -0
- package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.js +39 -0
- package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.js.map +1 -0
- package/src/lib/workflow-engine/workflow-token.entity.d.ts +10 -0
- package/src/lib/workflow-engine/workflow-token.entity.js +50 -0
- package/src/lib/workflow-engine/workflow-token.entity.js.map +1 -0
- package/eslint.config.mjs +0 -20
- package/jest.config.cts +0 -15
- package/project.json +0 -58
- package/src/lib/attachment/attachment-options.spec.ts +0 -45
- package/src/lib/attachment/attachment-options.ts +0 -130
- package/src/lib/attachment/attachment-storage.provider.spec.ts +0 -79
- package/src/lib/attachment/attachment-storage.provider.ts +0 -60
- package/src/lib/attachment/attachment.controller.ts +0 -39
- package/src/lib/attachment/attachment.entity.ts +0 -59
- package/src/lib/attachment/attachment.module.ts +0 -149
- package/src/lib/attachment/attachment.mutations.ts +0 -22
- package/src/lib/attachment/attachment.queries.ts +0 -65
- package/src/lib/attachment/attachment.service.spec.ts +0 -319
- package/src/lib/attachment/attachment.service.ts +0 -477
- package/src/lib/attachment/dto/upload-attachment.input.ts +0 -60
- package/src/lib/bpm/bpm-root.module.spec.ts +0 -138
- package/src/lib/bpm/bpm-root.module.ts +0 -320
- package/src/lib/bpm-auth/bpm-auth-context.extractor.ts +0 -106
- package/src/lib/bpm-auth/bpm-auth-context.ts +0 -40
- package/src/lib/bpm-auth/bpm-auth.authorization.ts +0 -80
- package/src/lib/bpm-auth/bpm-auth.decorators.ts +0 -19
- package/src/lib/bpm-auth/bpm-auth.guard.ts +0 -31
- package/src/lib/bpm-auth/bpm-auth.module.spec.ts +0 -106
- package/src/lib/bpm-auth/bpm-auth.module.ts +0 -69
- package/src/lib/bpm-auth/bpm-auth.options.ts +0 -21
- package/src/lib/bpm-auth/configurable-bpm-auth-context.accessor.ts +0 -55
- package/src/lib/common/filters/all-exceptions.filter.ts +0 -138
- package/src/lib/common/iso-duration.ts +0 -31
- package/src/lib/condition/condition.module.ts +0 -8
- package/src/lib/condition/condition.service.spec.ts +0 -50
- package/src/lib/condition/condition.service.ts +0 -141
- package/src/lib/database/data-source.ts +0 -7
- package/src/lib/database/migration-runner.ts +0 -24
- package/src/lib/database/typeorm.config.ts +0 -217
- package/src/lib/delegation/delegation-rule.entity.ts +0 -84
- package/src/lib/delegation/delegation.enums.ts +0 -21
- package/src/lib/delegation/delegation.module.ts +0 -14
- package/src/lib/delegation/delegation.mutations.ts +0 -92
- package/src/lib/delegation/delegation.queries.ts +0 -111
- package/src/lib/delegation/delegation.service.spec.ts +0 -295
- package/src/lib/delegation/delegation.service.ts +0 -482
- package/src/lib/delegation/dto/delegation-rule.input.ts +0 -125
- package/src/lib/form/dto/form-definition.input.ts +0 -73
- package/src/lib/form/form-definition-version.entity.ts +0 -66
- package/src/lib/form/form-definition.entity.ts +0 -54
- package/src/lib/form/form-schema-lint.object.ts +0 -10
- package/src/lib/form/form-schema.validator.spec.ts +0 -180
- package/src/lib/form/form-schema.validator.ts +0 -538
- package/src/lib/form/form.enums.ts +0 -20
- package/src/lib/form/form.module.ts +0 -19
- package/src/lib/form/form.mutations.ts +0 -68
- package/src/lib/form/form.queries.ts +0 -72
- package/src/lib/form/form.service.spec.ts +0 -144
- package/src/lib/form/form.service.ts +0 -490
- package/src/lib/identity/identity-options.ts +0 -41
- package/src/lib/identity/identity.module.ts +0 -96
- package/src/lib/identity/identity.queries.ts +0 -61
- package/src/lib/identity/identity.service.spec.ts +0 -105
- package/src/lib/identity/identity.service.ts +0 -200
- package/src/lib/identity/member-base.adapter.spec.ts +0 -77
- package/src/lib/identity/member-base.adapter.ts +0 -244
- package/src/lib/identity/member-metadata-cache.entity.ts +0 -27
- package/src/lib/identity/member-profile.object.ts +0 -28
- package/src/lib/identity/member-resolver.interface.ts +0 -47
- package/src/lib/migrations/0000000000001-enable-postgres-extensions.ts +0 -14
- package/src/lib/migrations/0000000011000-remove-attachment-encryption-key.ts +0 -19
- package/src/lib/migrations/0000000012000-notification-sla-idempotency.ts +0 -22
- package/src/lib/migrations/0000000013000-workflow-query-indexes.ts +0 -113
- package/src/lib/migrations/index.ts +0 -47
- package/src/lib/notification/dto/notification-preference.input.ts +0 -46
- package/src/lib/notification/notification-delivery-scheduler.service.ts +0 -69
- package/src/lib/notification/notification-delivery.service.spec.ts +0 -315
- package/src/lib/notification/notification-delivery.service.ts +0 -339
- package/src/lib/notification/notification-dispatcher.token.ts +0 -13
- package/src/lib/notification/notification-options.module.ts +0 -67
- package/src/lib/notification/notification-options.spec.ts +0 -93
- package/src/lib/notification/notification-options.ts +0 -452
- package/src/lib/notification/notification-preference.entity.ts +0 -35
- package/src/lib/notification/notification-sla-scheduler.service.ts +0 -66
- package/src/lib/notification/notification-template.spec.ts +0 -33
- package/src/lib/notification/notification-template.ts +0 -97
- package/src/lib/notification/notification.entity.ts +0 -102
- package/src/lib/notification/notification.enums.ts +0 -45
- package/src/lib/notification/notification.module.ts +0 -37
- package/src/lib/notification/notification.mutations.ts +0 -47
- package/src/lib/notification/notification.queries.ts +0 -64
- package/src/lib/notification/notification.service.spec.ts +0 -412
- package/src/lib/notification/notification.service.ts +0 -974
- package/src/lib/organization/dto/manager-resolution.input.ts +0 -91
- package/src/lib/organization/dto/membership.input.ts +0 -77
- package/src/lib/organization/dto/org-unit.input.ts +0 -96
- package/src/lib/organization/dto/position.input.ts +0 -50
- package/src/lib/organization/json-metadata.ts +0 -15
- package/src/lib/organization/manager-resolution.entity.ts +0 -44
- package/src/lib/organization/membership.entity.ts +0 -50
- package/src/lib/organization/org-unit-tree-commit-result.object.ts +0 -8
- package/src/lib/organization/org-unit.entity.ts +0 -53
- package/src/lib/organization/organization-summary.object.ts +0 -16
- package/src/lib/organization/organization.enums.ts +0 -19
- package/src/lib/organization/organization.module.ts +0 -27
- package/src/lib/organization/organization.mutations.ts +0 -115
- package/src/lib/organization/organization.queries.ts +0 -188
- package/src/lib/organization/organization.service.spec.ts +0 -760
- package/src/lib/organization/organization.service.ts +0 -1216
- package/src/lib/organization/position.entity.ts +0 -39
- package/src/lib/organization/resolved-manager.object.ts +0 -10
- package/src/lib/signature/signature-options.spec.ts +0 -60
- package/src/lib/signature/signature-options.ts +0 -120
- package/src/lib/signature/signature-verification.object.ts +0 -16
- package/src/lib/signature/signature.entity.ts +0 -62
- package/src/lib/signature/signature.module.ts +0 -80
- package/src/lib/signature/signature.queries.ts +0 -37
- package/src/lib/signature/signature.service.spec.ts +0 -134
- package/src/lib/signature/signature.service.ts +0 -205
- package/src/lib/template/approval-template-category.entity.ts +0 -40
- package/src/lib/template/approval-template-version.entity.ts +0 -82
- package/src/lib/template/approval-template.entity.ts +0 -64
- package/src/lib/template/dto/approval-template.input.ts +0 -147
- package/src/lib/template/template.enums.ts +0 -30
- package/src/lib/template/template.module.ts +0 -25
- package/src/lib/template/template.mutations.ts +0 -106
- package/src/lib/template/template.queries.ts +0 -119
- package/src/lib/template/template.service.spec.ts +0 -476
- package/src/lib/template/template.service.ts +0 -820
- package/src/lib/template/workflow-definition.validator.spec.ts +0 -595
- package/src/lib/template/workflow-definition.validator.ts +0 -539
- package/src/lib/testing/cel-js.jest.ts +0 -46
- package/src/lib/workflow-engine/activity-log.entity.ts +0 -48
- package/src/lib/workflow-engine/approval-instance-page-info.object.ts +0 -22
- package/src/lib/workflow-engine/approval-instance.entity.ts +0 -86
- package/src/lib/workflow-engine/dto/cancel-approval-instance.input.ts +0 -18
- package/src/lib/workflow-engine/dto/decide-task.input.ts +0 -33
- package/src/lib/workflow-engine/dto/dry-run-approval-workflow.input.ts +0 -22
- package/src/lib/workflow-engine/dto/resubmit-approval-instance.input.ts +0 -22
- package/src/lib/workflow-engine/dto/submit-approval-instance.input.ts +0 -27
- package/src/lib/workflow-engine/task-candidate.entity.ts +0 -56
- package/src/lib/workflow-engine/task-decision.entity.ts +0 -43
- package/src/lib/workflow-engine/task.entity.ts +0 -85
- package/src/lib/workflow-engine/workflow-condition-evaluator.ts +0 -168
- package/src/lib/workflow-engine/workflow-dashboard-summary.object.ts +0 -22
- package/src/lib/workflow-engine/workflow-dry-run.object.ts +0 -58
- package/src/lib/workflow-engine/workflow-engine.enums.ts +0 -99
- package/src/lib/workflow-engine/workflow-engine.module.ts +0 -75
- package/src/lib/workflow-engine/workflow-engine.mutations.ts +0 -85
- package/src/lib/workflow-engine/workflow-engine.queries.ts +0 -229
- package/src/lib/workflow-engine/workflow-engine.service.spec.ts +0 -2689
- package/src/lib/workflow-engine/workflow-engine.service.ts +0 -4707
- package/src/lib/workflow-engine/workflow-service-task-dispatcher.token.ts +0 -69
- package/src/lib/workflow-engine/workflow-token.entity.ts +0 -40
- package/tsconfig.json +0 -24
- package/tsconfig.lib.json +0 -16
- package/tsconfig.spec.json +0 -16
- /package/src/{index.ts → index.d.ts} +0 -0
- /package/src/lib/attachment/{index.ts → index.d.ts} +0 -0
- /package/src/lib/bpm/{index.ts → index.d.ts} +0 -0
- /package/src/lib/bpm-auth/{index.ts → index.d.ts} +0 -0
- /package/src/lib/common/{index.ts → index.d.ts} +0 -0
- /package/src/lib/condition/{index.ts → index.d.ts} +0 -0
- /package/src/lib/database/{index.ts → index.d.ts} +0 -0
- /package/src/lib/delegation/{index.ts → index.d.ts} +0 -0
- /package/src/lib/form/{index.ts → index.d.ts} +0 -0
- /package/src/lib/identity/{index.ts → index.d.ts} +0 -0
- /package/src/lib/notification/{index.ts → index.d.ts} +0 -0
- /package/src/lib/organization/{index.ts → index.d.ts} +0 -0
- /package/src/lib/signature/{index.ts → index.d.ts} +0 -0
- /package/src/lib/template/{index.ts → index.d.ts} +0 -0
- /package/src/lib/workflow-engine/{index.ts → index.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,55 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
Releases are managed by [`nx release`](https://nx.dev/recipes/nx-release) with
|
|
10
10
|
Conventional Commits — see `nx.json` for the release config.
|
|
11
11
|
|
|
12
|
+
## 0.1.5 — 2026-05-28
|
|
13
|
+
|
|
14
|
+
### Documentation
|
|
15
|
+
|
|
16
|
+
- **Identity contract clarifications.** `BPMMemberResolver.resolve` JSDoc
|
|
17
|
+
now states the unknown-id contract explicitly (throw
|
|
18
|
+
`MemberNotFoundException`); `resolveMany` documents the diverging
|
|
19
|
+
partial-success contract (omit unknown ids from the returned `Map`).
|
|
20
|
+
Both methods cross-link `identityMemberMetadataCacheTtlMs`
|
|
21
|
+
(default 5 min) so consumers know BPM caches their resolver responses.
|
|
22
|
+
- **`BPMRootModule` JSDoc dangling refs removed.** The previous
|
|
23
|
+
references to `docs/10-bpm-embedding-auth.md` and
|
|
24
|
+
`docs/11-consumer-quickstart.md` (files that never shipped) are now
|
|
25
|
+
inline pointers to the README sections.
|
|
26
|
+
- **New "Organization data ownership" README section.** Documents that
|
|
27
|
+
BPM is authoritative for `org_units`, `positions`, `memberships`, and
|
|
28
|
+
`manager_resolutions` (no host-injectable resolver pattern, unlike
|
|
29
|
+
members), the rationale (approver-routing / tree-diff hot path), the
|
|
30
|
+
mirror pattern using `OrgUnit.code` as the natural key and the
|
|
31
|
+
`metadata` JSON for host foreign-keys, and an idempotent worked
|
|
32
|
+
example using only `@rytass/bpm-core-client/organization` exports.
|
|
33
|
+
|
|
34
|
+
### Why a patch
|
|
35
|
+
|
|
36
|
+
No public type signatures change. JSDoc + README only.
|
|
37
|
+
|
|
38
|
+
## 0.1.4 — 2026-05-27
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- **Re-publish of the 0.1.3 release.** The 0.1.3 tarball was inadvertently
|
|
43
|
+
published from `libs/bpm-core/` instead of from `dist/libs/bpm-core/`,
|
|
44
|
+
shipping only TypeScript sources with `main: "./src/index.js"` pointing
|
|
45
|
+
at non-existent files. 0.1.3 has been **deprecated on npm**. The
|
|
46
|
+
publish procedure (`docs/api-reference.md` Publish Procedure section
|
|
47
|
+
and `tools/publish/finalize-dist-package.mjs` header) now codifies the
|
|
48
|
+
correct flow: `nx build` → `finalize-dist-package.mjs` →
|
|
49
|
+
`cd dist/libs/<pkg> && npm publish`.
|
|
50
|
+
|
|
51
|
+
### Documentation
|
|
52
|
+
|
|
53
|
+
- Publish-procedure-from-dist section added to `docs/api-reference.md`.
|
|
54
|
+
- `tools/publish/finalize-dist-package.mjs` header warning expanded.
|
|
55
|
+
|
|
56
|
+
## 0.1.3 — 2026-05-27 (deprecated on npm)
|
|
57
|
+
|
|
58
|
+
**DO NOT INSTALL — broken release.** Published from source dir instead
|
|
59
|
+
of dist dir; tarball contains only `.ts` files. Use 0.1.4 or newer.
|
|
60
|
+
|
|
12
61
|
## 0.1.2 — 2026-05-27
|
|
13
62
|
|
|
14
63
|
### Fixed
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rytass
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -275,6 +275,149 @@ export interface BPMMemberResolver {
|
|
|
275
275
|
}
|
|
276
276
|
```
|
|
277
277
|
|
|
278
|
+
## Organization Data Ownership
|
|
279
|
+
|
|
280
|
+
> **Read this before integrating BPM into a host that already has its own
|
|
281
|
+
> organization model.** The org-integration shape is **asymmetric** with
|
|
282
|
+
> member integration above — knowing which side owns what saves a day of
|
|
283
|
+
> source spelunking.
|
|
284
|
+
|
|
285
|
+
### Ownership claim
|
|
286
|
+
|
|
287
|
+
BPM is the **sole authority** for four organization tables:
|
|
288
|
+
|
|
289
|
+
| Table | Owns |
|
|
290
|
+
|---|---|
|
|
291
|
+
| `org_units` | Department / division / company nodes (typed by `OrgUnitType`) |
|
|
292
|
+
| `positions` | Job titles, with optional org-unit scoping |
|
|
293
|
+
| `memberships` | Member × org-unit × position relations (the join table that puts a member at a position inside a unit) |
|
|
294
|
+
| `manager_resolutions` | "Who is whose manager" rules (per-member, per-org-unit, or per-position scope), consumed by the `ORG_MANAGER` approver resolver |
|
|
295
|
+
|
|
296
|
+
There is **no** host-injectable `OrgUnitResolver` / `PositionResolver` /
|
|
297
|
+
`MembershipResolver` pattern, deliberately so. If you went looking for
|
|
298
|
+
the symmetric counterpart to `BPMMemberResolver`, stop now — it doesn't
|
|
299
|
+
exist, and the rest of this section explains why and what to do instead.
|
|
300
|
+
|
|
301
|
+
### Why no resolver
|
|
302
|
+
|
|
303
|
+
The BPM workflow engine reads the org graph on hot paths:
|
|
304
|
+
|
|
305
|
+
- **Approver routing** — every running instance evaluates `UserTaskNode`
|
|
306
|
+
candidates (resolved via `DIRECT`, `POSITION`, `ORG_MANAGER`, or
|
|
307
|
+
`CANDIDATE_GROUP`) against the current org snapshot. A `ParallelGateway`
|
|
308
|
+
fanning out to "all managers in the IT division" may touch dozens of
|
|
309
|
+
membership rows in one step.
|
|
310
|
+
- **Tree-diff commits** — `commitOrgUnitTreeDraft` writes batched moves
|
|
311
|
+
inside a single transaction, with referential integrity against
|
|
312
|
+
`memberships` and `manager_resolutions`. Round-tripping each lookup
|
|
313
|
+
through a host adapter would make this prohibitively chatty.
|
|
314
|
+
- **Reporting** — admin dashboards aggregate counts across the full graph.
|
|
315
|
+
|
|
316
|
+
A read-through adapter would force the host to mirror BPM's tree
|
|
317
|
+
semantics (ltree paths, soft-delete masking, position-vs-org-unit join
|
|
318
|
+
shape) anyway. We chose to make BPM authoritative so the contract is one
|
|
319
|
+
direction only.
|
|
320
|
+
|
|
321
|
+
### Mirror pattern
|
|
322
|
+
|
|
323
|
+
Host applications that already maintain their own org structure should
|
|
324
|
+
**mirror their data into BPM** through the GraphQL mutations exposed by
|
|
325
|
+
`@rytass/bpm-core-client/organization`. Three rules keep this idempotent
|
|
326
|
+
and observable:
|
|
327
|
+
|
|
328
|
+
1. **`OrgUnit.code` is your natural key.** Every `createOrgUnit` /
|
|
329
|
+
`createPosition` accepts a `code` field that you control. BPM enforces
|
|
330
|
+
uniqueness; use your host's stable identifier here (e.g. an LDAP DN
|
|
331
|
+
slug or a internal ERP code). On a re-sync, look up existing entities
|
|
332
|
+
by `code` before deciding INSERT vs UPDATE.
|
|
333
|
+
2. **`metadata` is the host-FK stash.** Both `OrgUnit` and `Membership`
|
|
334
|
+
carry an opaque `metadata` JSON object that BPM never introspects.
|
|
335
|
+
Store your host's primary key here (e.g. `{ shuttleOrgUnitId: 12345 }`)
|
|
336
|
+
so you can chase the back-pointer when reconciling.
|
|
337
|
+
3. **Soft delete via `deleteOrgUnit` / `deleteMembership`.** Deletes set
|
|
338
|
+
`deletedAt` rather than removing rows. BPM's query layer hides
|
|
339
|
+
soft-deleted rows automatically; reading `orgUnitCount()` will report
|
|
340
|
+
the live count.
|
|
341
|
+
|
|
342
|
+
### Worked example: idempotent sync
|
|
343
|
+
|
|
344
|
+
The example below uses only published exports from
|
|
345
|
+
`@rytass/bpm-core-client/organization`. It pushes a host org tree into
|
|
346
|
+
BPM, handling the create-or-update path by checking `code` matches.
|
|
347
|
+
Verified exports: `orgUnits`, `createOrgUnit`, `updateOrgUnit`,
|
|
348
|
+
`deleteOrgUnit`, `createPosition`, `createMembership`, `updateMembership`,
|
|
349
|
+
`createManagerResolution`, `commitOrgUnitTreeDraft`.
|
|
350
|
+
|
|
351
|
+
```ts
|
|
352
|
+
import {
|
|
353
|
+
createOrgUnit,
|
|
354
|
+
updateOrgUnit,
|
|
355
|
+
createPosition,
|
|
356
|
+
createMembership,
|
|
357
|
+
orgUnits,
|
|
358
|
+
type OrgUnitRecord,
|
|
359
|
+
} from '@rytass/bpm-core-client/organization';
|
|
360
|
+
|
|
361
|
+
interface HostOrgUnit {
|
|
362
|
+
readonly hostId: string; // e.g. ERP primary key — your host-FK
|
|
363
|
+
readonly code: string; // stable across sync runs
|
|
364
|
+
readonly name: string;
|
|
365
|
+
readonly type: 'COMPANY' | 'DIVISION' | 'DEPARTMENT' | 'TEAM';
|
|
366
|
+
readonly parentCode: string | null;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
async function syncOrgUnit(host: HostOrgUnit): Promise<OrgUnitRecord> {
|
|
370
|
+
// 1. Look up by host's stable code; BPM enforces uniqueness.
|
|
371
|
+
const existing = (
|
|
372
|
+
await orgUnits({ page: 1, pageSize: 1, searchText: host.code })
|
|
373
|
+
).find((u) => u.code === host.code);
|
|
374
|
+
|
|
375
|
+
const parentId = host.parentCode
|
|
376
|
+
? (await orgUnits({ searchText: host.parentCode })).find(
|
|
377
|
+
(u) => u.code === host.parentCode,
|
|
378
|
+
)?.id ?? null
|
|
379
|
+
: null;
|
|
380
|
+
|
|
381
|
+
// 2. Stash the host-FK back into metadata so future reconciliations
|
|
382
|
+
// can chase the pointer either direction.
|
|
383
|
+
const metadataJson = JSON.stringify({ hostId: host.hostId });
|
|
384
|
+
|
|
385
|
+
if (existing) {
|
|
386
|
+
return updateOrgUnit({
|
|
387
|
+
id: existing.id,
|
|
388
|
+
input: {
|
|
389
|
+
code: host.code,
|
|
390
|
+
name: host.name,
|
|
391
|
+
type: host.type,
|
|
392
|
+
parentId,
|
|
393
|
+
metadataJson,
|
|
394
|
+
},
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return createOrgUnit({
|
|
399
|
+
code: host.code,
|
|
400
|
+
name: host.name,
|
|
401
|
+
type: host.type,
|
|
402
|
+
parentId,
|
|
403
|
+
metadataJson,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
The same pattern works for `Position` (key on `code`), `Membership`
|
|
409
|
+
(unique by `memberId × orgUnitId × positionId`), and
|
|
410
|
+
`ManagerResolution` (unique by scope shape + active flag). For bulk
|
|
411
|
+
tree-shape changes (multi-node moves under a single parent),
|
|
412
|
+
`commitOrgUnitTreeDraft` accepts the full draft in one transaction.
|
|
413
|
+
|
|
414
|
+
### What you do NOT mirror
|
|
415
|
+
|
|
416
|
+
Member identity itself stays in your host's user table — BPM reaches it
|
|
417
|
+
through `BPMMemberResolver` (see the previous section). Only the
|
|
418
|
+
**org structure** (who reports where, what unit they sit in, who manages
|
|
419
|
+
them) needs to live inside BPM.
|
|
420
|
+
|
|
278
421
|
## Root Module Configuration
|
|
279
422
|
|
|
280
423
|
Use `BPMRootModule.forRoot()` for static configuration or
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rytass/bpm-core-nestjs-module",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Embeddable NestJS BPM approval workflow module: workflow engine, approval templates, forms, organization/member contracts, attachments, signatures, notifications, delegation, and TypeORM migrations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bpm",
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"@nestjs/core": "^11.0.0",
|
|
142
142
|
"@nestjs/graphql": "^13.4.0",
|
|
143
143
|
"@nestjs/typeorm": "^11.0.1",
|
|
144
|
-
"@rytass/bpm-core-shared": "^0.1.
|
|
144
|
+
"@rytass/bpm-core-shared": "^0.1.5",
|
|
145
145
|
"@rytass/secret-adapter-vault-nestjs": "^0.4.5 || ^0.5.0",
|
|
146
146
|
"express": "^4.0.0 || ^5.0.0",
|
|
147
147
|
"graphql": "^16.0.0",
|
|
@@ -165,4 +165,4 @@
|
|
|
165
165
|
"nodemailer": "^8.0.7",
|
|
166
166
|
"tslib": "^2.3.0"
|
|
167
167
|
}
|
|
168
|
-
}
|
|
168
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib/attachment"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/bpm"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/bpm-auth"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/common"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/condition"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./lib/database"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/delegation"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./lib/form"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/identity"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lib/notification"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./lib/organization"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./lib/signature"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./lib/template"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./lib/workflow-engine"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/bpm-core/src/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,oDAA0B;AAC1B,yDAA+B;AAC/B,uDAA6B;AAC7B,0DAAgC;AAChC,yDAA+B;AAC/B,2DAAiC;AACjC,qDAA2B;AAC3B,yDAA+B;AAC/B,6DAAmC;AACnC,6DAAmC;AACnC,0DAAgC;AAChC,yDAA+B;AAC/B,gEAAsC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InjectionToken } from '@nestjs/common';
|
|
2
|
+
export interface BPMRootAttachmentOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Public HTTP base URL used to build signed attachment download and preview
|
|
5
|
+
* URLs.
|
|
6
|
+
*/
|
|
7
|
+
readonly attachmentPublicBaseUrl?: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Route prefix used by the host application for BPM attachment endpoints.
|
|
10
|
+
*
|
|
11
|
+
* Drives both the Nest controller mount path and the path embedded in BPM
|
|
12
|
+
* signed attachment URLs. Defaults to `/attachments`.
|
|
13
|
+
*/
|
|
14
|
+
readonly attachmentRoutePrefix?: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* HMAC secret used to sign attachment download and preview tokens.
|
|
17
|
+
*/
|
|
18
|
+
readonly attachmentSignedUrlSecret?: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Signed attachment URL lifetime in seconds.
|
|
21
|
+
*/
|
|
22
|
+
readonly attachmentSignedUrlTtlSeconds?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Storage provider id recorded on attachment metadata.
|
|
25
|
+
*/
|
|
26
|
+
readonly attachmentStorageProviderId?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface BPMResolvedAttachmentOptions {
|
|
29
|
+
readonly publicBaseUrl: string;
|
|
30
|
+
readonly routePrefix: string;
|
|
31
|
+
readonly signedUrlSecret: string;
|
|
32
|
+
readonly signedUrlTtlSeconds: number;
|
|
33
|
+
readonly storageProviderId: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const BPM_ATTACHMENT_OPTIONS: InjectionToken<BPMResolvedAttachmentOptions>;
|
|
36
|
+
export declare const DEFAULT_BPM_ATTACHMENT_OPTIONS: BPMResolvedAttachmentOptions;
|
|
37
|
+
export declare function resolveBPMAttachmentOptions(options?: BPMRootAttachmentOptions): BPMResolvedAttachmentOptions;
|
|
38
|
+
/**
|
|
39
|
+
* Normalizes an attachment route prefix into the form Nest expects on a
|
|
40
|
+
* controller decorator (no leading slash, no trailing slash).
|
|
41
|
+
*
|
|
42
|
+
* Returns the BPM default `attachments` path when no value is provided.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveAttachmentControllerPath(value: string | null | undefined): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_BPM_ATTACHMENT_OPTIONS = exports.BPM_ATTACHMENT_OPTIONS = void 0;
|
|
4
|
+
exports.resolveBPMAttachmentOptions = resolveBPMAttachmentOptions;
|
|
5
|
+
exports.resolveAttachmentControllerPath = resolveAttachmentControllerPath;
|
|
6
|
+
exports.BPM_ATTACHMENT_OPTIONS = Symbol('BPM_ATTACHMENT_OPTIONS');
|
|
7
|
+
exports.DEFAULT_BPM_ATTACHMENT_OPTIONS = {
|
|
8
|
+
publicBaseUrl: 'http://localhost:17603',
|
|
9
|
+
routePrefix: '/attachments',
|
|
10
|
+
signedUrlSecret: 'bpm-core-local-attachment-url-key-v1',
|
|
11
|
+
signedUrlTtlSeconds: 300,
|
|
12
|
+
storageProviderId: 'local',
|
|
13
|
+
};
|
|
14
|
+
function resolveBPMAttachmentOptions(options = {}) {
|
|
15
|
+
const resolvedSignedUrlSecret = normalizeText(options.attachmentSignedUrlSecret) ??
|
|
16
|
+
exports.DEFAULT_BPM_ATTACHMENT_OPTIONS.signedUrlSecret;
|
|
17
|
+
if (resolvedSignedUrlSecret === exports.DEFAULT_BPM_ATTACHMENT_OPTIONS.signedUrlSecret &&
|
|
18
|
+
process.env.NODE_ENV === 'production') {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.warn('[@rytass/bpm-core-nestjs-module] attachmentSignedUrlSecret is using the built-in local development value. Set BPMRootModuleOptions.attachmentSignedUrlSecret to a strong secret before serving production traffic — signed attachment URLs would otherwise be forgeable.');
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
publicBaseUrl: normalizePublicBaseUrl(options.attachmentPublicBaseUrl),
|
|
24
|
+
routePrefix: normalizeRoutePrefix(options.attachmentRoutePrefix),
|
|
25
|
+
signedUrlSecret: resolvedSignedUrlSecret,
|
|
26
|
+
signedUrlTtlSeconds: normalizePositiveInteger(options.attachmentSignedUrlTtlSeconds, exports.DEFAULT_BPM_ATTACHMENT_OPTIONS.signedUrlTtlSeconds),
|
|
27
|
+
storageProviderId: normalizeText(options.attachmentStorageProviderId) ??
|
|
28
|
+
exports.DEFAULT_BPM_ATTACHMENT_OPTIONS.storageProviderId,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Normalizes an attachment route prefix into the form Nest expects on a
|
|
33
|
+
* controller decorator (no leading slash, no trailing slash).
|
|
34
|
+
*
|
|
35
|
+
* Returns the BPM default `attachments` path when no value is provided.
|
|
36
|
+
*/
|
|
37
|
+
function resolveAttachmentControllerPath(value) {
|
|
38
|
+
const normalizedPrefix = normalizeRoutePrefix(value);
|
|
39
|
+
return normalizedPrefix.replace(/^\//, '');
|
|
40
|
+
}
|
|
41
|
+
function normalizePublicBaseUrl(value) {
|
|
42
|
+
const normalizedValue = normalizeText(value) ?? exports.DEFAULT_BPM_ATTACHMENT_OPTIONS.publicBaseUrl;
|
|
43
|
+
return normalizedValue.replace(/\/+$/, '');
|
|
44
|
+
}
|
|
45
|
+
function normalizeRoutePrefix(value) {
|
|
46
|
+
const normalizedValue = normalizeText(value) ?? exports.DEFAULT_BPM_ATTACHMENT_OPTIONS.routePrefix;
|
|
47
|
+
const withLeadingSlash = normalizedValue.startsWith('/')
|
|
48
|
+
? normalizedValue
|
|
49
|
+
: `/${normalizedValue}`;
|
|
50
|
+
return withLeadingSlash.replace(/\/+$/, '');
|
|
51
|
+
}
|
|
52
|
+
function normalizeText(value) {
|
|
53
|
+
const trimmedValue = value?.trim() ?? '';
|
|
54
|
+
return trimmedValue || null;
|
|
55
|
+
}
|
|
56
|
+
function normalizePositiveInteger(value, fallback) {
|
|
57
|
+
if (typeof value !== 'number' || !Number.isInteger(value) || value <= 0) {
|
|
58
|
+
return fallback;
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=attachment-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-options.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/attachment/attachment-options.ts"],"names":[],"mappings":";;;AAoDA,kEA6BC;AAQD,0EAMC;AAtDY,QAAA,sBAAsB,GACjC,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEtB,QAAA,8BAA8B,GAAiC;IAC1E,aAAa,EAAE,wBAAwB;IACvC,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,sCAAsC;IACvD,mBAAmB,EAAE,GAAG;IACxB,iBAAiB,EAAE,OAAO;CAC3B,CAAC;AAEF,SAAgB,2BAA2B,CACzC,UAAoC,EAAE;IAEtC,MAAM,uBAAuB,GAC3B,aAAa,CAAC,OAAO,CAAC,yBAAyB,CAAC;QAChD,sCAA8B,CAAC,eAAe,CAAC;IAEjD,IACE,uBAAuB,KAAK,sCAA8B,CAAC,eAAe;QAC1E,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EACrC,CAAC;QACD,sCAAsC;QACtC,OAAO,CAAC,IAAI,CACV,0QAA0Q,CAC3Q,CAAC;IACJ,CAAC;IAED,OAAO;QACL,aAAa,EAAE,sBAAsB,CAAC,OAAO,CAAC,uBAAuB,CAAC;QACtE,WAAW,EAAE,oBAAoB,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAChE,eAAe,EAAE,uBAAuB;QACxC,mBAAmB,EAAE,wBAAwB,CAC3C,OAAO,CAAC,6BAA6B,EACrC,sCAA8B,CAAC,mBAAmB,CACnD;QACD,iBAAiB,EACf,aAAa,CAAC,OAAO,CAAC,2BAA2B,CAAC;YAClD,sCAA8B,CAAC,iBAAiB;KACnD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,+BAA+B,CAC7C,KAAgC;IAEhC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAErD,OAAO,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAgC;IAC9D,MAAM,eAAe,GACnB,aAAa,CAAC,KAAK,CAAC,IAAI,sCAA8B,CAAC,aAAa,CAAC;IAEvE,OAAO,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAgC;IAC5D,MAAM,eAAe,GACnB,aAAa,CAAC,KAAK,CAAC,IAAI,sCAA8B,CAAC,WAAW,CAAC;IACrE,MAAM,gBAAgB,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC;QACtD,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC;IAE1B,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,aAAa,CAAC,KAAgC;IACrD,MAAM,YAAY,GAAG,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAEzC,OAAO,YAAY,IAAI,IAAI,CAAC;AAC9B,CAAC;AAED,SAAS,wBAAwB,CAC/B,KAAyB,EACzB,QAAgB;IAEhB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QACxE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Provider } from '@nestjs/common';
|
|
2
|
+
import { AttachmentStorage } from './attachment-storage.token';
|
|
3
|
+
export declare const attachmentStorageProvider: Provider<AttachmentStorage>;
|
|
4
|
+
export declare function createLocalAttachmentStorage(directory: string): AttachmentStorage;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.attachmentStorageProvider = void 0;
|
|
4
|
+
exports.createLocalAttachmentStorage = createLocalAttachmentStorage;
|
|
5
|
+
const promises_1 = require("fs/promises");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const attachment_storage_token_1 = require("./attachment-storage.token");
|
|
8
|
+
exports.attachmentStorageProvider = {
|
|
9
|
+
provide: attachment_storage_token_1.ATTACHMENT_STORAGE,
|
|
10
|
+
useFactory: () => createLocalAttachmentStorage((0, path_1.resolve)(process.cwd(), '.storage', 'attachments')),
|
|
11
|
+
};
|
|
12
|
+
function createLocalAttachmentStorage(directory) {
|
|
13
|
+
const storageDirectory = (0, path_1.resolve)(directory);
|
|
14
|
+
const LocalStorage = readLocalStorageConstructor();
|
|
15
|
+
const localStorage = new LocalStorage({
|
|
16
|
+
autoMkdir: true,
|
|
17
|
+
directory: storageDirectory,
|
|
18
|
+
});
|
|
19
|
+
const write = async (file, options) => {
|
|
20
|
+
if (options?.filename) {
|
|
21
|
+
await (0, promises_1.mkdir)((0, path_1.dirname)((0, path_1.resolve)(storageDirectory, options.filename)), {
|
|
22
|
+
recursive: true,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return localStorage.write(file, options);
|
|
26
|
+
};
|
|
27
|
+
return new Proxy(localStorage, {
|
|
28
|
+
get: (target, property, receiver) => property === 'write' ? write : Reflect.get(target, property, receiver),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function readLocalStorageConstructor() {
|
|
32
|
+
const adapter = require('@rytass/storages-adapter-local');
|
|
33
|
+
return adapter.LocalStorage;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=attachment-storage.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-storage.provider.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/attachment/attachment-storage.provider.ts"],"names":[],"mappings":";;;AA2BA,oEA0BC;AApDD,0CAAoC;AACpC,+BAAwC;AACxC,yEAGoC;AAavB,QAAA,yBAAyB,GAAgC;IACpE,OAAO,EAAE,6CAAkB;IAC3B,UAAU,EAAE,GAAsB,EAAE,CAClC,4BAA4B,CAC1B,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,aAAa,CAAC,CAClD;CACJ,CAAC;AAEF,SAAgB,4BAA4B,CAC1C,SAAiB;IAEjB,MAAM,gBAAgB,GAAG,IAAA,cAAO,EAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,2BAA2B,EAAE,CAAC;IACnD,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;QACpC,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,gBAAgB;KAC5B,CAAC,CAAC;IACH,MAAM,KAAK,GAA+B,KAAK,EAC7C,IAAI,EACJ,OAAO,EACiC,EAAE;QAC1C,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;YACtB,MAAM,IAAA,gBAAK,EAAC,IAAA,cAAO,EAAC,IAAA,cAAO,EAAC,gBAAgB,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;gBAChE,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,OAAO,IAAI,KAAK,CAAC,YAAY,EAAE;QAC7B,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAW,EAAE,CAC3C,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;KACzE,CAAsB,CAAC;AAC1B,CAAC;AAED,SAAS,2BAA2B;IAClC,MAAM,OAAO,GAAG,OAAO,CAAC,gCAAgC,CAAuB,CAAC;IAEhF,OAAO,OAAO,CAAC,YAAY,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-storage.token.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/attachment/attachment-storage.token.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StreamableFile } from '@nestjs/common';
|
|
2
|
+
import type { Response } from 'express';
|
|
3
|
+
import { AttachmentService } from './attachment.service';
|
|
4
|
+
export declare class AttachmentController {
|
|
5
|
+
private readonly attachmentService;
|
|
6
|
+
constructor(attachmentService: AttachmentService);
|
|
7
|
+
downloadAttachment(id: string, token: string, disposition: "attachment" | "inline" | undefined, response: Response): Promise<StreamableFile>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttachmentController = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const attachment_service_1 = require("./attachment.service");
|
|
7
|
+
let AttachmentController = class AttachmentController {
|
|
8
|
+
constructor(attachmentService) {
|
|
9
|
+
this.attachmentService = attachmentService;
|
|
10
|
+
}
|
|
11
|
+
async downloadAttachment(id, token, disposition = 'attachment', response) {
|
|
12
|
+
const { attachment, buffer } = await this.attachmentService.readSignedAttachment({
|
|
13
|
+
disposition,
|
|
14
|
+
id,
|
|
15
|
+
token,
|
|
16
|
+
});
|
|
17
|
+
response.setHeader('Content-Type', attachment.mimeType);
|
|
18
|
+
response.setHeader('Content-Disposition', `${disposition}; filename="${encodeURIComponent(attachment.filename)}"`);
|
|
19
|
+
response.setHeader('Content-Length', String(buffer.length));
|
|
20
|
+
return new common_1.StreamableFile(buffer);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.AttachmentController = AttachmentController;
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, common_1.Get)(':id/download'),
|
|
26
|
+
tslib_1.__param(0, (0, common_1.Param)('id')),
|
|
27
|
+
tslib_1.__param(1, (0, common_1.Query)('token')),
|
|
28
|
+
tslib_1.__param(2, (0, common_1.Query)('disposition')),
|
|
29
|
+
tslib_1.__param(3, (0, common_1.Res)({ passthrough: true })),
|
|
30
|
+
tslib_1.__metadata("design:type", Function),
|
|
31
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, Object]),
|
|
32
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
33
|
+
], AttachmentController.prototype, "downloadAttachment", null);
|
|
34
|
+
exports.AttachmentController = AttachmentController = tslib_1.__decorate([
|
|
35
|
+
(0, common_1.Controller)('attachments'),
|
|
36
|
+
tslib_1.__metadata("design:paramtypes", [attachment_service_1.AttachmentService])
|
|
37
|
+
], AttachmentController);
|
|
38
|
+
//# sourceMappingURL=attachment.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.controller.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/attachment/attachment.controller.ts"],"names":[],"mappings":";;;;AAAA,2CAOwB;AAExB,6DAAyD;AAGlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAG/D,AAAN,KAAK,CAAC,kBAAkB,CACT,EAAU,EACP,KAAa,EACP,cAAuC,YAAY,EAC7C,QAAkB;QAE9C,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAC1B,MAAM,IAAI,CAAC,iBAAiB,CAAC,oBAAoB,CAAC;YAChD,WAAW;YACX,EAAE;YACF,KAAK;SACN,CAAC,CAAC;QAEL,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;QACxD,QAAQ,CAAC,SAAS,CAChB,qBAAqB,EACrB,GAAG,WAAW,eAAe,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CACxE,CAAC;QACF,QAAQ,CAAC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAE5D,OAAO,IAAI,uBAAc,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AA1BY,oDAAoB;AAIzB;IADL,IAAA,YAAG,EAAC,cAAc,CAAC;IAEjB,mBAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,mBAAA,IAAA,cAAK,EAAC,OAAO,CAAC,CAAA;IACd,mBAAA,IAAA,cAAK,EAAC,aAAa,CAAC,CAAA;IACpB,mBAAA,IAAA,YAAG,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;;;;8DAiB5B;+BAzBU,oBAAoB;IADhC,IAAA,mBAAU,EAAC,aAAa,CAAC;6CAEwB,sCAAiB;GADtD,oBAAoB,CA0BhC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class AttachmentEntity {
|
|
2
|
+
id: string;
|
|
3
|
+
instanceId: string | null;
|
|
4
|
+
taskId: string | null;
|
|
5
|
+
formFieldPath: string | null;
|
|
6
|
+
uploaderMemberId: string;
|
|
7
|
+
filename: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
sizeBytes: string;
|
|
10
|
+
storageProvider: string;
|
|
11
|
+
storageKey: string;
|
|
12
|
+
checksumSha256: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttachmentEntity = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
let AttachmentEntity = class AttachmentEntity {
|
|
8
|
+
};
|
|
9
|
+
exports.AttachmentEntity = AttachmentEntity;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
12
|
+
(0, graphql_1.Field)(() => graphql_1.ID),
|
|
13
|
+
tslib_1.__metadata("design:type", String)
|
|
14
|
+
], AttachmentEntity.prototype, "id", void 0);
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, typeorm_1.Column)('uuid', { name: 'instance_id', nullable: true }),
|
|
17
|
+
(0, graphql_1.Field)(() => graphql_1.ID, { nullable: true }),
|
|
18
|
+
tslib_1.__metadata("design:type", Object)
|
|
19
|
+
], AttachmentEntity.prototype, "instanceId", void 0);
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.Column)('uuid', { name: 'task_id', nullable: true }),
|
|
22
|
+
(0, graphql_1.Field)(() => graphql_1.ID, { nullable: true }),
|
|
23
|
+
tslib_1.__metadata("design:type", Object)
|
|
24
|
+
], AttachmentEntity.prototype, "taskId", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.Column)('text', { name: 'form_field_path', nullable: true }),
|
|
27
|
+
(0, graphql_1.Field)(() => String, { nullable: true }),
|
|
28
|
+
tslib_1.__metadata("design:type", Object)
|
|
29
|
+
], AttachmentEntity.prototype, "formFieldPath", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)('text', { name: 'uploader_member_id' }),
|
|
32
|
+
(0, graphql_1.Field)(),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], AttachmentEntity.prototype, "uploaderMemberId", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, typeorm_1.Column)('text'),
|
|
37
|
+
(0, graphql_1.Field)(),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], AttachmentEntity.prototype, "filename", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.Column)('text', { name: 'mime_type' }),
|
|
42
|
+
(0, graphql_1.Field)(),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
|
+
], AttachmentEntity.prototype, "mimeType", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, typeorm_1.Column)('bigint', { name: 'size_bytes' }),
|
|
47
|
+
(0, graphql_1.Field)(),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], AttachmentEntity.prototype, "sizeBytes", void 0);
|
|
50
|
+
tslib_1.__decorate([
|
|
51
|
+
(0, typeorm_1.Column)('text', { name: 'storage_provider' }),
|
|
52
|
+
(0, graphql_1.Field)(),
|
|
53
|
+
tslib_1.__metadata("design:type", String)
|
|
54
|
+
], AttachmentEntity.prototype, "storageProvider", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, typeorm_1.Column)('text', { name: 'storage_key' }),
|
|
57
|
+
(0, graphql_1.Field)(),
|
|
58
|
+
tslib_1.__metadata("design:type", String)
|
|
59
|
+
], AttachmentEntity.prototype, "storageKey", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, typeorm_1.Column)('text', { name: 'checksum_sha256' }),
|
|
62
|
+
(0, graphql_1.Field)(),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], AttachmentEntity.prototype, "checksumSha256", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
|
|
67
|
+
(0, graphql_1.Field)(),
|
|
68
|
+
tslib_1.__metadata("design:type", Date)
|
|
69
|
+
], AttachmentEntity.prototype, "createdAt", void 0);
|
|
70
|
+
exports.AttachmentEntity = AttachmentEntity = tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.Entity)('attachments'),
|
|
72
|
+
(0, graphql_1.ObjectType)('Attachment')
|
|
73
|
+
], AttachmentEntity);
|
|
74
|
+
//# sourceMappingURL=attachment.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.entity.js","sourceRoot":"","sources":["../../../../../../libs/bpm-core/src/lib/attachment/attachment.entity.ts"],"names":[],"mappings":";;;;AAAA,6CAAwD;AACxD,qCAKiB;AAIV,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAgD5B,CAAA;AAhDY,4CAAgB;AAG3B;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,YAAE,CAAC;;4CACJ;AAIZ;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACvD,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,YAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACT;AAI3B;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnD,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,YAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACb;AAIvB;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3D,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACV;AAI9B;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAC9C,IAAA,eAAK,GAAE;;0DACkB;AAI1B;IAFC,IAAA,gBAAM,EAAC,MAAM,CAAC;IACd,IAAA,eAAK,GAAE;;kDACU;AAIlB;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IACrC,IAAA,eAAK,GAAE;;kDACU;AAIlB;IAFC,IAAA,gBAAM,EAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IACxC,IAAA,eAAK,GAAE;;mDACW;AAInB;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC5C,IAAA,eAAK,GAAE;;yDACiB;AAIzB;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACvC,IAAA,eAAK,GAAE;;oDACY;AAIpB;IAFC,IAAA,gBAAM,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;IAC3C,IAAA,eAAK,GAAE;;wDACgB;AAIxB;IAFC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAC7D,IAAA,eAAK,GAAE;sCACI,IAAI;mDAAC;2BA/CN,gBAAgB;IAF5B,IAAA,gBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,oBAAU,EAAC,YAAY,CAAC;GACZ,gBAAgB,CAgD5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DynamicModule, InjectionToken, Provider } from '@nestjs/common';
|
|
2
|
+
import { ModuleMetadata } from '@nestjs/common/interfaces';
|
|
3
|
+
import { AttachmentStorage } from './attachment-storage.token';
|
|
4
|
+
import { BPMRootAttachmentOptions } from './attachment-options';
|
|
5
|
+
export interface AttachmentModuleOptions extends BPMRootAttachmentOptions {
|
|
6
|
+
readonly imports?: ModuleMetadata['imports'];
|
|
7
|
+
readonly storageProvider?: Provider<AttachmentStorage>;
|
|
8
|
+
}
|
|
9
|
+
export interface AttachmentModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
10
|
+
/**
|
|
11
|
+
* Controller mount path used by the BPM attachment endpoints.
|
|
12
|
+
*
|
|
13
|
+
* Set at module wiring time because Nest reads the controller path metadata
|
|
14
|
+
* synchronously when the application starts. Async secrets cannot drive this
|
|
15
|
+
* value; only static URL routing decisions should set it.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to `/attachments`.
|
|
18
|
+
*/
|
|
19
|
+
readonly attachmentRoutePrefix?: string | null;
|
|
20
|
+
readonly inject?: readonly InjectionToken[];
|
|
21
|
+
readonly storageProvider?: Provider<AttachmentStorage>;
|
|
22
|
+
readonly useFactory: (...args: readonly unknown[]) => BPMRootAttachmentOptions | Promise<BPMRootAttachmentOptions>;
|
|
23
|
+
}
|
|
24
|
+
export declare class AttachmentModule {
|
|
25
|
+
static forRoot(options?: AttachmentModuleOptions): DynamicModule;
|
|
26
|
+
static forRootAsync(options: AttachmentModuleAsyncOptions): DynamicModule;
|
|
27
|
+
}
|