@open-mercato/core 0.8.1-develop.7296.1.2111d779db → 0.8.1-develop.7441.1.b42958b98c
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/.turbo/turbo-build.log +2 -2
- package/AGENTS.md +4 -5
- package/dist/generated/entities/availability_policy/index.js +41 -0
- package/dist/generated/entities/availability_policy/index.js.map +7 -0
- package/dist/generated/entities/communication_channel/index.js +3 -1
- package/dist/generated/entities/communication_channel/index.js.map +2 -2
- package/dist/generated/entities/customer_email_conversation_share/index.js +21 -0
- package/dist/generated/entities/customer_email_conversation_share/index.js.map +7 -0
- package/dist/generated/entities/customer_group/index.js +33 -0
- package/dist/generated/entities/customer_group/index.js.map +7 -0
- package/dist/generated/entities/customer_group_membership/index.js +29 -0
- package/dist/generated/entities/customer_group_membership/index.js.map +7 -0
- package/dist/generated/entities/customer_group_terms/index.js +33 -0
- package/dist/generated/entities/customer_group_terms/index.js.map +7 -0
- package/dist/generated/entities/customer_interaction/index.js +2 -0
- package/dist/generated/entities/customer_interaction/index.js.map +2 -2
- package/dist/generated/entities/form/index.js +35 -0
- package/dist/generated/entities/form/index.js.map +7 -0
- package/dist/generated/entities/form_access_audit/index.js +21 -0
- package/dist/generated/entities/form_access_audit/index.js.map +7 -0
- package/dist/generated/entities/form_attachment/index.js +29 -0
- package/dist/generated/entities/form_attachment/index.js.map +7 -0
- package/dist/generated/entities/form_consent_record/index.js +37 -0
- package/dist/generated/entities/form_consent_record/index.js.map +7 -0
- package/dist/generated/entities/form_distribution/index.js +47 -0
- package/dist/generated/entities/form_distribution/index.js.map +7 -0
- package/dist/generated/entities/form_invitation/index.js +49 -0
- package/dist/generated/entities/form_invitation/index.js.map +7 -0
- package/dist/generated/entities/form_submission/index.js +39 -0
- package/dist/generated/entities/form_submission/index.js.map +7 -0
- package/dist/generated/entities/form_submission_actor/index.js +23 -0
- package/dist/generated/entities/form_submission_actor/index.js.map +7 -0
- package/dist/generated/entities/form_submission_revision/index.js +29 -0
- package/dist/generated/entities/form_submission_revision/index.js.map +7 -0
- package/dist/generated/entities/form_version/index.js +37 -0
- package/dist/generated/entities/form_version/index.js.map +7 -0
- package/dist/generated/entities/forms_encryption_key/index.js +15 -0
- package/dist/generated/entities/forms_encryption_key/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +27 -2
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +269 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/communicationChannelsFixtures.js +16 -0
- package/dist/helpers/integration/communicationChannelsFixtures.js.map +2 -2
- package/dist/helpers/integration/customerGroupsFixtures.js +88 -0
- package/dist/helpers/integration/customerGroupsFixtures.js.map +7 -0
- package/dist/helpers/integration/formsFixtures.js +448 -0
- package/dist/helpers/integration/formsFixtures.js.map +7 -0
- package/dist/modules/api_docs/api/get/version.js +19 -7
- package/dist/modules/api_docs/api/get/version.js.map +2 -2
- package/dist/modules/api_keys/api/keys/route.js +74 -169
- package/dist/modules/api_keys/api/keys/route.js.map +2 -2
- package/dist/modules/api_keys/backend/api-keys/create/page.js +1 -1
- package/dist/modules/api_keys/backend/api-keys/create/page.js.map +2 -2
- package/dist/modules/api_keys/commands/keys.js +140 -0
- package/dist/modules/api_keys/commands/keys.js.map +7 -0
- package/dist/modules/api_keys/services/apiKeyService.js +72 -43
- package/dist/modules/api_keys/services/apiKeyService.js.map +2 -2
- package/dist/modules/attachments/api/file/[id]/route.js +9 -2
- package/dist/modules/attachments/api/file/[id]/route.js.map +2 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js +6 -2
- package/dist/modules/attachments/api/image/[id]/[[...slug]]/route.js.map +2 -2
- package/dist/modules/attachments/api/route.js +10 -4
- package/dist/modules/attachments/api/route.js.map +2 -2
- package/dist/modules/attachments/components/AttachmentLibrary.js +16 -6
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/lib/access.js +1 -3
- package/dist/modules/attachments/lib/access.js.map +2 -2
- package/dist/modules/attachments/lib/requestScope.js +13 -4
- package/dist/modules/attachments/lib/requestScope.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js +6 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/export/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js +36 -6
- package/dist/modules/audit_logs/api/audit-logs/actions/redo/route.js.map +3 -3
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js +6 -1
- package/dist/modules/audit_logs/api/audit-logs/actions/route.js.map +2 -2
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js +34 -4
- package/dist/modules/audit_logs/api/audit-logs/actions/undo/route.js.map +2 -2
- package/dist/modules/audit_logs/data/validators.js +1 -0
- package/dist/modules/audit_logs/data/validators.js.map +2 -2
- package/dist/modules/audit_logs/lib/actorSubject.js +65 -0
- package/dist/modules/audit_logs/lib/actorSubject.js.map +7 -0
- package/dist/modules/audit_logs/lib/replayAuthorization.js +41 -0
- package/dist/modules/audit_logs/lib/replayAuthorization.js.map +7 -0
- package/dist/modules/audit_logs/services/actionLogService.js +162 -39
- package/dist/modules/audit_logs/services/actionLogService.js.map +3 -3
- package/dist/modules/auth/api/features.js +1 -1
- package/dist/modules/auth/api/features.js.map +2 -2
- package/dist/modules/auth/cli.js +29 -17
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/commands/acl.js +25 -36
- package/dist/modules/auth/commands/acl.js.map +2 -2
- package/dist/modules/auth/commands/interceptors.js +22 -0
- package/dist/modules/auth/commands/interceptors.js.map +7 -0
- package/dist/modules/auth/commands/roles.js +421 -147
- package/dist/modules/auth/commands/roles.js.map +2 -2
- package/dist/modules/auth/commands/users.js +543 -69
- package/dist/modules/auth/commands/users.js.map +2 -2
- package/dist/modules/auth/lib/authorizationStateLocks.js +249 -0
- package/dist/modules/auth/lib/authorizationStateLocks.js.map +7 -0
- package/dist/modules/auth/lib/commandReplay.js +144 -0
- package/dist/modules/auth/lib/commandReplay.js.map +7 -0
- package/dist/modules/auth/lib/executionPrincipal.js +32 -25
- package/dist/modules/auth/lib/executionPrincipal.js.map +2 -2
- package/dist/modules/auth/lib/grantChecks.js +7 -2
- package/dist/modules/auth/lib/grantChecks.js.map +2 -2
- package/dist/modules/auth/lib/setup-app.js +85 -49
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/lib/tokenHash.js +13 -1
- package/dist/modules/auth/lib/tokenHash.js.map +2 -2
- package/dist/modules/auth/services/rbacService.js +386 -5
- package/dist/modules/auth/services/rbacService.js.map +3 -3
- package/dist/modules/availability/acl.js +16 -0
- package/dist/modules/availability/acl.js.map +7 -0
- package/dist/modules/availability/api/check/route.js +115 -0
- package/dist/modules/availability/api/check/route.js.map +7 -0
- package/dist/modules/availability/api/openapi.js +27 -0
- package/dist/modules/availability/api/openapi.js.map +7 -0
- package/dist/modules/availability/api/policies/resolve-preview/route.js +72 -0
- package/dist/modules/availability/api/policies/resolve-preview/route.js.map +7 -0
- package/dist/modules/availability/api/policies/route.js +203 -0
- package/dist/modules/availability/api/policies/route.js.map +7 -0
- package/dist/modules/availability/backend/availability/check/page.js +185 -0
- package/dist/modules/availability/backend/availability/check/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/check/page.meta.js +16 -0
- package/dist/modules/availability/backend/availability/check/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/ResolutionPreviewPanel.js +83 -0
- package/dist/modules/availability/backend/availability/policies/ResolutionPreviewPanel.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/ScopeFields.js +53 -0
- package/dist/modules/availability/backend/availability/policies/ScopeFields.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/StockManagedField.js +32 -0
- package/dist/modules/availability/backend/availability/policies/StockManagedField.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.js +168 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.meta.js +12 -0
- package/dist/modules/availability/backend/availability/policies/[id]/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/create/page.js +119 -0
- package/dist/modules/availability/backend/availability/policies/create/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/create/page.meta.js +12 -0
- package/dist/modules/availability/backend/availability/policies/create/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/formGroups.js +77 -0
- package/dist/modules/availability/backend/availability/policies/formGroups.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/page.js +207 -0
- package/dist/modules/availability/backend/availability/policies/page.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/page.meta.js +16 -0
- package/dist/modules/availability/backend/availability/policies/page.meta.js.map +7 -0
- package/dist/modules/availability/backend/availability/policies/policyPayload.js +28 -0
- package/dist/modules/availability/backend/availability/policies/policyPayload.js.map +7 -0
- package/dist/modules/availability/commands/policies.js +364 -0
- package/dist/modules/availability/commands/policies.js.map +7 -0
- package/dist/modules/availability/commands/scope.js +19 -0
- package/dist/modules/availability/commands/scope.js.map +7 -0
- package/dist/modules/availability/data/entities.js +94 -0
- package/dist/modules/availability/data/entities.js.map +7 -0
- package/dist/modules/availability/data/validators.js +59 -0
- package/dist/modules/availability/data/validators.js.map +7 -0
- package/dist/modules/availability/di.js +50 -0
- package/dist/modules/availability/di.js.map +7 -0
- package/dist/modules/availability/events.js +18 -0
- package/dist/modules/availability/events.js.map +7 -0
- package/dist/modules/availability/index.js +15 -0
- package/dist/modules/availability/index.js.map +7 -0
- package/dist/modules/availability/lib/catalogTarget.js +42 -0
- package/dist/modules/availability/lib/catalogTarget.js.map +7 -0
- package/dist/modules/availability/lib/organizationScope.js +10 -0
- package/dist/modules/availability/lib/organizationScope.js.map +7 -0
- package/dist/modules/availability/lib/policyResolution.js +150 -0
- package/dist/modules/availability/lib/policyResolution.js.map +7 -0
- package/dist/modules/availability/lib/tryResolve.js +11 -0
- package/dist/modules/availability/lib/tryResolve.js.map +7 -0
- package/dist/modules/availability/migrations/Migration20260922095844_availability.js +16 -0
- package/dist/modules/availability/migrations/Migration20260922095844_availability.js.map +7 -0
- package/dist/modules/availability/migrations/Migration20260930120000_availability.js +20 -0
- package/dist/modules/availability/migrations/Migration20260930120000_availability.js.map +7 -0
- package/dist/modules/availability/setup.js +12 -0
- package/dist/modules/availability/setup.js.map +7 -0
- package/dist/modules/catalog/api/categories/bulk-create/route.js +110 -0
- package/dist/modules/catalog/api/categories/bulk-create/route.js.map +7 -0
- package/dist/modules/catalog/api/categories/route.js +56 -8
- package/dist/modules/catalog/api/categories/route.js.map +2 -2
- package/dist/modules/catalog/api/products/bulk-create/route.js +110 -0
- package/dist/modules/catalog/api/products/bulk-create/route.js.map +7 -0
- package/dist/modules/catalog/api/products/route.js +55 -31
- package/dist/modules/catalog/api/products/route.js.map +3 -3
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -6
- package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +2 -2
- package/dist/modules/catalog/backend/catalog/products/create/page.js +12 -4
- package/dist/modules/catalog/backend/catalog/products/create/page.js.map +2 -2
- package/dist/modules/catalog/commands/categories.js +1 -0
- package/dist/modules/catalog/commands/categories.js.map +2 -2
- package/dist/modules/catalog/commands/productDeleteChildren.js +389 -0
- package/dist/modules/catalog/commands/productDeleteChildren.js.map +7 -0
- package/dist/modules/catalog/commands/products.js +57 -19
- package/dist/modules/catalog/commands/products.js.map +2 -2
- package/dist/modules/catalog/components/PriceKindSettings.js +5 -19
- package/dist/modules/catalog/components/PriceKindSettings.js.map +2 -2
- package/dist/modules/catalog/components/products/ProductUomSection.js +26 -29
- package/dist/modules/catalog/components/products/ProductUomSection.js.map +2 -2
- package/dist/modules/catalog/components/products/productForm.js +3 -2
- package/dist/modules/catalog/components/products/productForm.js.map +2 -2
- package/dist/modules/catalog/data/validators.js +15 -0
- package/dist/modules/catalog/data/validators.js.map +2 -2
- package/dist/modules/catalog/di.js +3 -2
- package/dist/modules/catalog/di.js.map +2 -2
- package/dist/modules/catalog/events.js +9 -3
- package/dist/modules/catalog/events.js.map +2 -2
- package/dist/modules/catalog/lib/bulkCreateCategories.js +237 -0
- package/dist/modules/catalog/lib/bulkCreateCategories.js.map +7 -0
- package/dist/modules/catalog/lib/bulkCreateCheckpoint.js +82 -0
- package/dist/modules/catalog/lib/bulkCreateCheckpoint.js.map +7 -0
- package/dist/modules/catalog/lib/bulkCreateMutationGuards.js +39 -0
- package/dist/modules/catalog/lib/bulkCreateMutationGuards.js.map +7 -0
- package/dist/modules/catalog/lib/bulkCreateProducts.js +241 -0
- package/dist/modules/catalog/lib/bulkCreateProducts.js.map +7 -0
- package/dist/modules/catalog/lib/bulkDelete.js +10 -11
- package/dist/modules/catalog/lib/bulkDelete.js.map +2 -2
- package/dist/modules/catalog/lib/catalogQueue.js +14 -0
- package/dist/modules/catalog/lib/catalogQueue.js.map +7 -0
- package/dist/modules/catalog/lib/currencyOptions.js +25 -0
- package/dist/modules/catalog/lib/currencyOptions.js.map +7 -0
- package/dist/modules/catalog/lib/productSearch.js +8 -0
- package/dist/modules/catalog/lib/productSearch.js.map +7 -0
- package/dist/modules/catalog/lib/seeds.js +2 -42
- package/dist/modules/catalog/lib/seeds.js.map +2 -2
- package/dist/modules/catalog/lib/unitLabels.js +53 -0
- package/dist/modules/catalog/lib/unitLabels.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20260914120000.js +29 -0
- package/dist/modules/catalog/migrations/Migration20260914120000.js.map +7 -0
- package/dist/modules/catalog/migrations/Migration20260914120100.js +28 -0
- package/dist/modules/catalog/migrations/Migration20260914120100.js.map +7 -0
- package/dist/modules/catalog/workers/catalog-category-bulk-create.js +40 -0
- package/dist/modules/catalog/workers/catalog-category-bulk-create.js.map +7 -0
- package/dist/modules/catalog/workers/catalog-product-bulk-create.js +40 -0
- package/dist/modules/catalog/workers/catalog-product-bulk-create.js.map +7 -0
- package/dist/modules/communication_channels/acl.js +8 -0
- package/dist/modules/communication_channels/acl.js.map +2 -2
- package/dist/modules/communication_channels/api/get/me/channels/route.js +4 -0
- package/dist/modules/communication_channels/api/get/me/channels/route.js.map +2 -2
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js +22 -0
- package/dist/modules/communication_channels/api/get/oauth/[provider]/callback/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/import-history/route.js +4 -4
- package/dist/modules/communication_channels/api/post/channels/[id]/import-history/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js +2 -1
- package/dist/modules/communication_channels/api/post/channels/[id]/test-send/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/connect/credentials/route.js +4 -6
- package/dist/modules/communication_channels/api/post/channels/connect/credentials/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.js +4 -6
- package/dist/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.js.map +2 -2
- package/dist/modules/communication_channels/api/post/test-seed/route.js +90 -20
- package/dist/modules/communication_channels/api/post/test-seed/route.js.map +3 -3
- package/dist/modules/communication_channels/api/put/channels/[id]/visibility/route.js +137 -0
- package/dist/modules/communication_channels/api/put/channels/[id]/visibility/route.js.map +7 -0
- package/dist/modules/communication_channels/backend/profile/communication-channels/page.js +175 -107
- package/dist/modules/communication_channels/backend/profile/communication-channels/page.js.map +2 -2
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js +2 -1
- package/dist/modules/communication_channels/commands/ingest-inbound-message.js.map +2 -2
- package/dist/modules/communication_channels/commands/set-channel-visibility.js +88 -0
- package/dist/modules/communication_channels/commands/set-channel-visibility.js.map +7 -0
- package/dist/modules/communication_channels/data/enrichers.js +18 -9
- package/dist/modules/communication_channels/data/enrichers.js.map +2 -2
- package/dist/modules/communication_channels/data/entities.js +4 -0
- package/dist/modules/communication_channels/data/entities.js.map +2 -2
- package/dist/modules/communication_channels/di.js +9 -1
- package/dist/modules/communication_channels/di.js.map +2 -2
- package/dist/modules/communication_channels/events.js +7 -0
- package/dist/modules/communication_channels/events.js.map +2 -2
- package/dist/modules/communication_channels/index.js +1 -1
- package/dist/modules/communication_channels/index.js.map +1 -1
- package/dist/modules/communication_channels/lib/access-control.js +2 -1
- package/dist/modules/communication_channels/lib/access-control.js.map +2 -2
- package/dist/modules/communication_channels/lib/channel-thread-access.js +60 -0
- package/dist/modules/communication_channels/lib/channel-thread-access.js.map +7 -0
- package/dist/modules/communication_channels/lib/credential-refresh.js +11 -2
- package/dist/modules/communication_channels/lib/credential-refresh.js.map +2 -2
- package/dist/modules/communication_channels/lib/inbound-message-origin.js +18 -0
- package/dist/modules/communication_channels/lib/inbound-message-origin.js.map +7 -0
- package/dist/modules/communication_channels/lib/oauth-state.js +37 -0
- package/dist/modules/communication_channels/lib/oauth-state.js.map +2 -2
- package/dist/modules/communication_channels/lib/outbound-delivery-intent.js +12 -0
- package/dist/modules/communication_channels/lib/outbound-delivery-intent.js.map +7 -0
- package/dist/modules/communication_channels/lib/send-as-user.js +1 -1
- package/dist/modules/communication_channels/lib/send-as-user.js.map +2 -2
- package/dist/modules/communication_channels/migrations/Migration20260825141000_communication_channels.js +14 -0
- package/dist/modules/communication_channels/migrations/Migration20260825141000_communication_channels.js.map +7 -0
- package/dist/modules/communication_channels/setup.js +6 -2
- package/dist/modules/communication_channels/setup.js.map +2 -2
- package/dist/modules/communication_channels/subscribers/outbound-bridge.js +8 -2
- package/dist/modules/communication_channels/subscribers/outbound-bridge.js.map +2 -2
- package/dist/modules/communication_channels/workers/gmail-history-sync.js +1 -1
- package/dist/modules/communication_channels/workers/gmail-history-sync.js.map +2 -2
- package/dist/modules/communication_channels/workers/poll-channel.js +1 -1
- package/dist/modules/communication_channels/workers/poll-channel.js.map +2 -2
- package/dist/modules/communication_channels/workers/reaction-processor.js +2 -2
- package/dist/modules/communication_channels/workers/reaction-processor.js.map +2 -2
- package/dist/modules/configs/api/upgrade-actions/route.js +2 -1
- package/dist/modules/configs/api/upgrade-actions/route.js.map +2 -2
- package/dist/modules/configs/cli.js +2 -2
- package/dist/modules/configs/cli.js.map +2 -2
- package/dist/modules/configs/lib/upgrade-actions.js +28 -6
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/configs/services/upgradeActionsService.js +44 -30
- package/dist/modules/configs/services/upgradeActionsService.js.map +2 -2
- package/dist/modules/currencies/api/currencies/route.js +11 -5
- package/dist/modules/currencies/api/currencies/route.js.map +2 -2
- package/dist/modules/currencies/api/exchange-rates/route.js +11 -5
- package/dist/modules/currencies/api/exchange-rates/route.js.map +2 -2
- package/dist/modules/customer_groups/acl.js +14 -0
- package/dist/modules/customer_groups/acl.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/[id]/terms/route.js +266 -0
- package/dist/modules/customer_groups/api/customer-groups/[id]/terms/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/crud.js +473 -0
- package/dist/modules/customer_groups/api/customer-groups/crud.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/explain-terms/route.js +143 -0
- package/dist/modules/customer_groups/api/customer-groups/explain-terms/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/crud.js +383 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/crud.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/route.js +66 -0
- package/dist/modules/customer_groups/api/customer-groups/memberships/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/adopt/route.js +133 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/adopt/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/route.js +80 -0
- package/dist/modules/customer_groups/api/customer-groups/reconcile/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/reorder/route.js +127 -0
- package/dist/modules/customer_groups/api/customer-groups/reorder/route.js.map +7 -0
- package/dist/modules/customer_groups/api/customer-groups/route.js +62 -0
- package/dist/modules/customer_groups/api/customer-groups/route.js.map +7 -0
- package/dist/modules/customer_groups/api/openapi.js +27 -0
- package/dist/modules/customer_groups/api/openapi.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.js +328 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.meta.js +16 -0
- package/dist/modules/customer_groups/backend/customer-groups/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.js +249 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.meta.js +27 -0
- package/dist/modules/customer_groups/backend/customer-groups/create/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.js +139 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.meta.js +16 -0
- package/dist/modules/customer_groups/backend/customer-groups/orphans/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.js +364 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.js.map +7 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.meta.js +15 -0
- package/dist/modules/customer_groups/backend/customer-groups/page.meta.js.map +7 -0
- package/dist/modules/customer_groups/cli.js +72 -0
- package/dist/modules/customer_groups/cli.js.map +7 -0
- package/dist/modules/customer_groups/commands/reorderGroups.js +96 -0
- package/dist/modules/customer_groups/commands/reorderGroups.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupDefaultField.js +41 -0
- package/dist/modules/customer_groups/components/CustomerGroupDefaultField.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupParentField.js +156 -0
- package/dist/modules/customer_groups/components/CustomerGroupParentField.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsPriceKindField.js +94 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsPriceKindField.js.map +7 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsSection.js +197 -0
- package/dist/modules/customer_groups/components/CustomerGroupTermsSection.js.map +7 -0
- package/dist/modules/customer_groups/components/GroupPickerField.js +116 -0
- package/dist/modules/customer_groups/components/GroupPickerField.js.map +7 -0
- package/dist/modules/customer_groups/components/OrphanBanner.js +75 -0
- package/dist/modules/customer_groups/components/OrphanBanner.js.map +7 -0
- package/dist/modules/customer_groups/components/customerGroupTree.js +57 -0
- package/dist/modules/customer_groups/components/customerGroupTree.js.map +7 -0
- package/dist/modules/customer_groups/data/entities.js +226 -0
- package/dist/modules/customer_groups/data/entities.js.map +7 -0
- package/dist/modules/customer_groups/data/validators.js +153 -0
- package/dist/modules/customer_groups/data/validators.js.map +7 -0
- package/dist/modules/customer_groups/di.js +20 -0
- package/dist/modules/customer_groups/di.js.map +7 -0
- package/dist/modules/customer_groups/events.js +22 -0
- package/dist/modules/customer_groups/events.js.map +7 -0
- package/dist/modules/customer_groups/index.js +15 -0
- package/dist/modules/customer_groups/index.js.map +7 -0
- package/dist/modules/customer_groups/lib/createConflictRecheck.js +29 -0
- package/dist/modules/customer_groups/lib/createConflictRecheck.js.map +7 -0
- package/dist/modules/customer_groups/lib/customerScope.js +81 -0
- package/dist/modules/customer_groups/lib/customerScope.js.map +7 -0
- package/dist/modules/customer_groups/lib/groupEvents.js +31 -0
- package/dist/modules/customer_groups/lib/groupEvents.js.map +7 -0
- package/dist/modules/customer_groups/lib/priceKindScope.js +16 -0
- package/dist/modules/customer_groups/lib/priceKindScope.js.map +7 -0
- package/dist/modules/customer_groups/lib/reconcile.js +161 -0
- package/dist/modules/customer_groups/lib/reconcile.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260922095316_customer_groups.js +27 -0
- package/dist/modules/customer_groups/migrations/Migration20260922095316_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260922103033_customer_groups.js +19 -0
- package/dist/modules/customer_groups/migrations/Migration20260922103033_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260922105444_customer_groups.js +19 -0
- package/dist/modules/customer_groups/migrations/Migration20260922105444_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260923193330_customer_groups.js +19 -0
- package/dist/modules/customer_groups/migrations/Migration20260923193330_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/migrations/Migration20260929083000_customer_groups.js +20 -0
- package/dist/modules/customer_groups/migrations/Migration20260929083000_customer_groups.js.map +7 -0
- package/dist/modules/customer_groups/services/customerGroupsService.js +190 -0
- package/dist/modules/customer_groups/services/customerGroupsService.js.map +7 -0
- package/dist/modules/customer_groups/setup.js +13 -0
- package/dist/modules/customer_groups/setup.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/group-picker-field/widget.js +31 -0
- package/dist/modules/customer_groups/widgets/injection/group-picker-field/widget.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-explain-terms.js +166 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-explain-terms.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab/widget.js +17 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab/widget.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab.js +457 -0
- package/dist/modules/customer_groups/widgets/injection/person-groups-tab.js.map +7 -0
- package/dist/modules/customer_groups/widgets/injection-table.js +33 -0
- package/dist/modules/customer_groups/widgets/injection-table.js.map +7 -0
- package/dist/modules/customers/acl.js +13 -0
- package/dist/modules/customers/acl.js.map +2 -2
- package/dist/modules/customers/api/activities/route.js +9 -1
- package/dist/modules/customers/api/activities/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/people/route.js +2 -1
- package/dist/modules/customers/api/companies/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/companies/[id]/route.js +19 -7
- package/dist/modules/customers/api/companies/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/companies/route.js +2 -1
- package/dist/modules/customers/api/deals/[id]/companies/route.js.map +2 -2
- package/dist/modules/customers/api/deals/[id]/people/route.js +60 -6
- package/dist/modules/customers/api/deals/[id]/people/route.js.map +2 -2
- package/dist/modules/customers/api/deals/map/route.js +7 -2
- package/dist/modules/customers/api/deals/map/route.js.map +2 -2
- package/dist/modules/customers/api/dictionaries/context.js +2 -1
- package/dist/modules/customers/api/dictionaries/context.js.map +2 -2
- package/dist/modules/customers/api/entity-roles-factory.js +3 -2
- package/dist/modules/customers/api/entity-roles-factory.js.map +2 -2
- package/dist/modules/customers/api/interactions/[id]/visibility/route.js +2 -1
- package/dist/modules/customers/api/interactions/[id]/visibility/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/cancel/route.js +2 -1
- package/dist/modules/customers/api/interactions/cancel/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/complete/route.js +2 -1
- package/dist/modules/customers/api/interactions/complete/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/conflicts/route.js +10 -6
- package/dist/modules/customers/api/interactions/conflicts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/counts/route.js +24 -4
- package/dist/modules/customers/api/interactions/counts/route.js.map +2 -2
- package/dist/modules/customers/api/interactions/route.js +31 -8
- package/dist/modules/customers/api/interactions/route.js.map +2 -2
- package/dist/modules/customers/api/labels/assign/route.js +2 -1
- package/dist/modules/customers/api/labels/assign/route.js.map +2 -2
- package/dist/modules/customers/api/labels/route.js +3 -2
- package/dist/modules/customers/api/labels/route.js.map +2 -2
- package/dist/modules/customers/api/labels/unassign/route.js +2 -1
- package/dist/modules/customers/api/labels/unassign/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js +7 -2
- package/dist/modules/customers/api/people/[id]/companies/context.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/email-share/route.js +218 -0
- package/dist/modules/customers/api/people/[id]/email-share/route.js.map +7 -0
- package/dist/modules/customers/api/people/[id]/email-threads/route.js +11 -2
- package/dist/modules/customers/api/people/[id]/email-threads/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/emails/route.js +2 -1
- package/dist/modules/customers/api/people/[id]/emails/route.js.map +2 -2
- package/dist/modules/customers/api/people/[id]/route.js +20 -19
- package/dist/modules/customers/api/people/[id]/route.js.map +2 -2
- package/dist/modules/customers/api/people/check-phone/route.js +2 -1
- package/dist/modules/customers/api/people/check-phone/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js +3 -2
- package/dist/modules/customers/api/pipeline-stages/reorder/route.js.map +2 -2
- package/dist/modules/customers/api/pipeline-stages/route.js +3 -3
- package/dist/modules/customers/api/pipeline-stages/route.js.map +2 -2
- package/dist/modules/customers/api/pipelines/route.js +3 -3
- package/dist/modules/customers/api/pipelines/route.js.map +2 -2
- package/dist/modules/customers/api/settings/address-format/route.js +2 -1
- package/dist/modules/customers/api/settings/address-format/route.js.map +2 -2
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js +2 -1
- package/dist/modules/customers/api/settings/dictionary-sort-modes/route.js.map +2 -2
- package/dist/modules/customers/api/settings/stuck-threshold/route.js +2 -1
- package/dist/modules/customers/api/settings/stuck-threshold/route.js.map +2 -2
- package/dist/modules/customers/api/tags/assign/route.js +2 -1
- package/dist/modules/customers/api/tags/assign/route.js.map +2 -2
- package/dist/modules/customers/api/tags/unassign/route.js +2 -1
- package/dist/modules/customers/api/tags/unassign/route.js.map +2 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js +4 -2
- package/dist/modules/customers/backend/customers/companies/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js +6 -25
- package/dist/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/[id]/page.js +21 -18
- package/dist/modules/customers/backend/customers/deals/[id]/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/deals/components/ReassignOwnerDialog.js +93 -0
- package/dist/modules/customers/backend/customers/deals/components/ReassignOwnerDialog.js.map +7 -0
- package/dist/modules/customers/backend/customers/deals/page.js +111 -1
- package/dist/modules/customers/backend/customers/deals/page.js.map +2 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js +4 -2
- package/dist/modules/customers/backend/customers/people/[id]/page.js.map +2 -2
- package/dist/modules/customers/commands/addresses.js +83 -15
- package/dist/modules/customers/commands/addresses.js.map +2 -2
- package/dist/modules/customers/commands/companies.js +10 -4
- package/dist/modules/customers/commands/companies.js.map +2 -2
- package/dist/modules/customers/commands/emailConversationShares.js +177 -0
- package/dist/modules/customers/commands/emailConversationShares.js.map +7 -0
- package/dist/modules/customers/commands/index.js +1 -0
- package/dist/modules/customers/commands/index.js.map +2 -2
- package/dist/modules/customers/commands/interactions.js +48 -23
- package/dist/modules/customers/commands/interactions.js.map +3 -3
- package/dist/modules/customers/commands/people.js +3 -2
- package/dist/modules/customers/commands/people.js.map +2 -2
- package/dist/modules/customers/commands/shared.js +4 -0
- package/dist/modules/customers/commands/shared.js.map +2 -2
- package/dist/modules/customers/components/calendar/types.js.map +1 -1
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js +81 -354
- package/dist/modules/customers/components/detail/CompanyPeopleSection.js.map +2 -2
- package/dist/modules/customers/components/detail/CreatePersonDialog.js +12 -11
- package/dist/modules/customers/components/detail/CreatePersonDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/DealForm.js +73 -5
- package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/DealOwnerSelect.js +96 -0
- package/dist/modules/customers/components/detail/DealOwnerSelect.js.map +7 -0
- package/dist/modules/customers/components/detail/DealPeopleSection.js +206 -0
- package/dist/modules/customers/components/detail/DealPeopleSection.js.map +7 -0
- package/dist/modules/customers/components/detail/DealsSection.js +8 -14
- package/dist/modules/customers/components/detail/DealsSection.js.map +2 -2
- package/dist/modules/customers/components/detail/LinkedPeopleSection.js +342 -0
- package/dist/modules/customers/components/detail/LinkedPeopleSection.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonCard.js +5 -2
- package/dist/modules/customers/components/detail/PersonCard.js.map +2 -2
- package/dist/modules/customers/components/detail/PersonEmailShareControl.js +190 -0
- package/dist/modules/customers/components/detail/PersonEmailShareControl.js.map +7 -0
- package/dist/modules/customers/components/detail/PersonEmailThreadsTab.js +17 -0
- package/dist/modules/customers/components/detail/PersonEmailThreadsTab.js.map +2 -2
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js +5 -2
- package/dist/modules/customers/components/detail/ScheduleActivityDialog.js.map +2 -2
- package/dist/modules/customers/components/detail/create/CreateDealForm.js +19 -0
- package/dist/modules/customers/components/detail/create/CreateDealForm.js.map +2 -2
- package/dist/modules/customers/components/detail/create/DealDetailsFields.js +11 -0
- package/dist/modules/customers/components/detail/create/DealDetailsFields.js.map +2 -2
- package/dist/modules/customers/components/detail/create/DealSectionCard.js +2 -2
- package/dist/modules/customers/components/detail/create/DealSectionCard.js.map +2 -2
- package/dist/modules/customers/components/detail/create/dealFormTypes.js +1 -0
- package/dist/modules/customers/components/detail/create/dealFormTypes.js.map +2 -2
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js +1 -1
- package/dist/modules/customers/components/detail/schedule/useScheduleFormState.js.map +2 -2
- package/dist/modules/customers/components/formConfig.js +2 -0
- package/dist/modules/customers/components/formConfig.js.map +2 -2
- package/dist/modules/customers/components/linking/LinkEntityDialog.js +8 -0
- package/dist/modules/customers/components/linking/LinkEntityDialog.js.map +2 -2
- package/dist/modules/customers/components/linking/adapters/personAdapter.js +3 -0
- package/dist/modules/customers/components/linking/adapters/personAdapter.js.map +2 -2
- package/dist/modules/customers/data/enrichers.js +40 -2
- package/dist/modules/customers/data/enrichers.js.map +2 -2
- package/dist/modules/customers/data/entities.js +56 -0
- package/dist/modules/customers/data/entities.js.map +2 -2
- package/dist/modules/customers/data/validators.js +11 -0
- package/dist/modules/customers/data/validators.js.map +2 -2
- package/dist/modules/customers/events.js +6 -1
- package/dist/modules/customers/events.js.map +2 -2
- package/dist/modules/customers/lib/assignableStaff.js +14 -0
- package/dist/modules/customers/lib/assignableStaff.js.map +2 -2
- package/dist/modules/customers/lib/calendar/editorPayload.js +17 -13
- package/dist/modules/customers/lib/calendar/editorPayload.js.map +2 -2
- package/dist/modules/customers/lib/calendar/mapItem.js +1 -0
- package/dist/modules/customers/lib/calendar/mapItem.js.map +2 -2
- package/dist/modules/customers/lib/conversationShares.js +126 -0
- package/dist/modules/customers/lib/conversationShares.js.map +7 -0
- package/dist/modules/customers/lib/dealsOrganizationScope.js +5 -3
- package/dist/modules/customers/lib/dealsOrganizationScope.js.map +2 -2
- package/dist/modules/customers/lib/interactionRequestContext.js +2 -1
- package/dist/modules/customers/lib/interactionRequestContext.js.map +2 -2
- package/dist/modules/customers/lib/link-channel-message-handler.js +19 -9
- package/dist/modules/customers/lib/link-channel-message-handler.js.map +2 -2
- package/dist/modules/customers/lib/personDetailCacheTags.js +32 -0
- package/dist/modules/customers/lib/personDetailCacheTags.js.map +7 -0
- package/dist/modules/customers/lib/personEmailThreads.js +26 -5
- package/dist/modules/customers/lib/personEmailThreads.js.map +2 -2
- package/dist/modules/customers/lib/reassignDealOwner.js +25 -0
- package/dist/modules/customers/lib/reassignDealOwner.js.map +7 -0
- package/dist/modules/customers/lib/userNames.js +26 -0
- package/dist/modules/customers/lib/userNames.js.map +7 -0
- package/dist/modules/customers/lib/visibilityFilter.js +70 -2
- package/dist/modules/customers/lib/visibilityFilter.js.map +2 -2
- package/dist/modules/customers/migrations/Migration20260825120000_customers.js +18 -0
- package/dist/modules/customers/migrations/Migration20260825120000_customers.js.map +7 -0
- package/dist/modules/customers/migrations/Migration20260825140000_customers.js +27 -0
- package/dist/modules/customers/migrations/Migration20260825140000_customers.js.map +7 -0
- package/dist/modules/customers/setup.js +1 -0
- package/dist/modules/customers/setup.js.map +2 -2
- package/dist/modules/customers/subscribers/channel-visibility-changed.js +16 -0
- package/dist/modules/customers/subscribers/channel-visibility-changed.js.map +7 -0
- package/dist/modules/dashboards/api/widgets/data/batch/route.js +3 -8
- package/dist/modules/dashboards/api/widgets/data/batch/route.js.map +2 -2
- package/dist/modules/dashboards/api/widgets/data/route.js +10 -15
- package/dist/modules/dashboards/api/widgets/data/route.js.map +2 -2
- package/dist/modules/dashboards/lib/aggregations.js +1 -1
- package/dist/modules/dashboards/lib/aggregations.js.map +2 -2
- package/dist/modules/dashboards/lib/widgetScope.js +2 -7
- package/dist/modules/dashboards/lib/widgetScope.js.map +2 -2
- package/dist/modules/data_sync/api/runs/[id]/cancel.js +4 -1
- package/dist/modules/data_sync/api/runs/[id]/cancel.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +497 -329
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +248 -113
- package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +3 -3
- package/dist/modules/data_sync/components/useDataSyncRunAccess.js +17 -0
- package/dist/modules/data_sync/components/useDataSyncRunAccess.js.map +7 -0
- package/dist/modules/data_sync/lib/resume-point.js +21 -0
- package/dist/modules/data_sync/lib/resume-point.js.map +7 -0
- package/dist/modules/data_sync/lib/start-run.js +52 -2
- package/dist/modules/data_sync/lib/start-run.js.map +2 -2
- package/dist/modules/data_sync/lib/sync-run-service.js +22 -33
- package/dist/modules/data_sync/lib/sync-run-service.js.map +3 -3
- package/dist/modules/devices/api/[id]/route.js +3 -2
- package/dist/modules/devices/api/[id]/route.js.map +2 -2
- package/dist/modules/devices/api/admin/devices/route.js +2 -1
- package/dist/modules/devices/api/admin/devices/route.js.map +2 -2
- package/dist/modules/devices/api/route.js +2 -1
- package/dist/modules/devices/api/route.js.map +2 -2
- package/dist/modules/dictionaries/api/[dictionaryId]/route.js.map +2 -2
- package/dist/modules/dictionaries/api/context.js +2 -1
- package/dist/modules/dictionaries/api/context.js.map +2 -2
- package/dist/modules/dictionaries/api/route.js +4 -0
- package/dist/modules/dictionaries/api/route.js.map +2 -2
- package/dist/modules/dictionaries/components/DictionariesManager.js +4 -3
- package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
- package/dist/modules/dictionaries/data/validators.js +3 -1
- package/dist/modules/dictionaries/data/validators.js.map +2 -2
- package/dist/modules/directory/api/organization-branding/route.js +10 -1
- package/dist/modules/directory/api/organization-branding/route.js.map +2 -2
- package/dist/modules/directory/api/organizations/route.js +1 -1
- package/dist/modules/directory/api/organizations/route.js.map +1 -1
- package/dist/modules/directory/backend/directory/branding/page.js +17 -4
- package/dist/modules/directory/backend/directory/branding/page.js.map +3 -3
- package/dist/modules/directory/commands/organizations.js +136 -74
- package/dist/modules/directory/commands/organizations.js.map +2 -2
- package/dist/modules/directory/lib/hierarchy.js +19 -1
- package/dist/modules/directory/lib/hierarchy.js.map +2 -2
- package/dist/modules/directory/utils/organizationScope.js +66 -12
- package/dist/modules/directory/utils/organizationScope.js.map +2 -2
- package/dist/modules/directory/utils/organizationScopeFilter.js +7 -4
- package/dist/modules/directory/utils/organizationScopeFilter.js.map +2 -2
- package/dist/modules/directory/utils/organizationScopeGuard.js +6 -2
- package/dist/modules/directory/utils/organizationScopeGuard.js.map +2 -2
- package/dist/modules/entities/api/encryption.js +68 -25
- package/dist/modules/entities/api/encryption.js.map +2 -2
- package/dist/modules/entities/api/records.js +9 -8
- package/dist/modules/entities/api/records.js.map +2 -2
- package/dist/modules/entities/cli.js +33 -22
- package/dist/modules/entities/cli.js.map +2 -2
- package/dist/modules/entities/data/entities.js +8 -0
- package/dist/modules/entities/data/entities.js.map +2 -2
- package/dist/modules/entities/lib/definition-scope.js +3 -1
- package/dist/modules/entities/lib/definition-scope.js.map +2 -2
- package/dist/modules/entities/lib/encryption-maps.js +117 -0
- package/dist/modules/entities/lib/encryption-maps.js.map +7 -0
- package/dist/modules/entities/lib/helpers.js +30 -6
- package/dist/modules/entities/lib/helpers.js.map +2 -2
- package/dist/modules/entities/migrations/Migration20260910120000.js +17 -0
- package/dist/modules/entities/migrations/Migration20260910120000.js.map +7 -0
- package/dist/modules/entities/migrations/Migration20261004120000_encryption_map_scope_uniqueness.js +130 -0
- package/dist/modules/entities/migrations/Migration20261004120000_encryption_map_scope_uniqueness.js.map +7 -0
- package/dist/modules/eudr/api/dashboard/widgets/compliance-overview/route.js +2 -1
- package/dist/modules/eudr/api/dashboard/widgets/compliance-overview/route.js.map +2 -2
- package/dist/modules/eudr/api/plots/import/route.js +2 -1
- package/dist/modules/eudr/api/plots/import/route.js.map +2 -2
- package/dist/modules/eudr/api/product-mappings/suggestions/apply/route.js +2 -1
- package/dist/modules/eudr/api/product-mappings/suggestions/apply/route.js.map +2 -2
- package/dist/modules/eudr/api/product-mappings/suggestions/route.js +2 -1
- package/dist/modules/eudr/api/product-mappings/suggestions/route.js.map +2 -2
- package/dist/modules/eudr/api/reports/annual/route.js +2 -1
- package/dist/modules/eudr/api/reports/annual/route.js.map +2 -2
- package/dist/modules/eudr/api/statements/[id]/export/route.js +2 -1
- package/dist/modules/eudr/api/statements/[id]/export/route.js.map +2 -2
- package/dist/modules/eudr/api/statements/[id]/readiness/route.js +2 -1
- package/dist/modules/eudr/api/statements/[id]/readiness/route.js.map +2 -2
- package/dist/modules/eudr/api/suppliers/compliance/route.js +2 -1
- package/dist/modules/eudr/api/suppliers/compliance/route.js.map +2 -2
- package/dist/modules/feature_toggles/commands/global.js +13 -13
- package/dist/modules/feature_toggles/commands/global.js.map +2 -2
- package/dist/modules/feature_toggles/lib/feature-flag-check.js +8 -2
- package/dist/modules/feature_toggles/lib/feature-flag-check.js.map +2 -2
- package/dist/modules/forms/acl.js +14 -0
- package/dist/modules/forms/acl.js.map +7 -0
- package/dist/modules/forms/api/[id]/analytics/route.js +113 -0
- package/dist/modules/forms/api/[id]/analytics/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/distributions/route.js +176 -0
- package/dist/modules/forms/api/[id]/distributions/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/route.js +225 -0
- package/dist/modules/forms/api/[id]/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/run/context/route.js +115 -0
- package/dist/modules/forms/api/[id]/run/context/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/run/submissions/route.js +109 -0
- package/dist/modules/forms/api/[id]/run/submissions/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/submissions/route.js +83 -0
- package/dist/modules/forms/api/[id]/submissions/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/theme-logo/route.js +117 -0
- package/dist/modules/forms/api/[id]/theme-logo/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/diff/route.js +125 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/diff/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/publish/route.js +99 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/publish/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/route.js +176 -0
- package/dist/modules/forms/api/[id]/versions/[versionId]/route.js.map +7 -0
- package/dist/modules/forms/api/[id]/versions/fork/route.js +92 -0
- package/dist/modules/forms/api/[id]/versions/fork/route.js.map +7 -0
- package/dist/modules/forms/api/attachment-helpers.js +111 -0
- package/dist/modules/forms/api/attachment-helpers.js.map +7 -0
- package/dist/modules/forms/api/by-key/[key]/active/route.js +140 -0
- package/dist/modules/forms/api/by-key/[key]/active/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/route.js +84 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/send/route.js +88 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/send/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/route.js +183 -0
- package/dist/modules/forms/api/distributions/[distributionId]/invitations/route.js.map +7 -0
- package/dist/modules/forms/api/distributions/[distributionId]/route.js +191 -0
- package/dist/modules/forms/api/distributions/[distributionId]/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/attachments/route.js +91 -0
- package/dist/modules/forms/api/form-submissions/[id]/attachments/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/resume-token/route.js +110 -0
- package/dist/modules/forms/api/form-submissions/[id]/resume-token/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/route.js +146 -0
- package/dist/modules/forms/api/form-submissions/[id]/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/[id]/submit/route.js +74 -0
- package/dist/modules/forms/api/form-submissions/[id]/submit/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/by-subject/[subject_type]/[subject_id]/route.js +76 -0
- package/dist/modules/forms/api/form-submissions/by-subject/[subject_type]/[subject_id]/route.js.map +7 -0
- package/dist/modules/forms/api/form-submissions/route.js +113 -0
- package/dist/modules/forms/api/form-submissions/route.js.map +7 -0
- package/dist/modules/forms/api/helpers.js +124 -0
- package/dist/modules/forms/api/helpers.js.map +7 -0
- package/dist/modules/forms/api/public/distributions/[slug]/embed-policy/route.js +47 -0
- package/dist/modules/forms/api/public/distributions/[slug]/embed-policy/route.js.map +7 -0
- package/dist/modules/forms/api/public/distributions/[slug]/route.js +81 -0
- package/dist/modules/forms/api/public/distributions/[slug]/route.js.map +7 -0
- package/dist/modules/forms/api/public/embed-loader/route.js +116 -0
- package/dist/modules/forms/api/public/embed-loader/route.js.map +7 -0
- package/dist/modules/forms/api/public/invitations/[token]/route.js +87 -0
- package/dist/modules/forms/api/public/invitations/[token]/route.js.map +7 -0
- package/dist/modules/forms/api/public/rate-limit.js +54 -0
- package/dist/modules/forms/api/public/rate-limit.js.map +7 -0
- package/dist/modules/forms/api/public/start/route.js +142 -0
- package/dist/modules/forms/api/public/start/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/[attachmentId]/route.js +67 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/[attachmentId]/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/route.js +85 -0
- package/dist/modules/forms/api/public/submissions/[id]/attachments/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/pdf/route.js +72 -0
- package/dist/modules/forms/api/public/submissions/[id]/pdf/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/route.js +154 -0
- package/dist/modules/forms/api/public/submissions/[id]/route.js.map +7 -0
- package/dist/modules/forms/api/public/submissions/[id]/submit/route.js +127 -0
- package/dist/modules/forms/api/public/submissions/[id]/submit/route.js.map +7 -0
- package/dist/modules/forms/api/route.js +216 -0
- package/dist/modules/forms/api/route.js.map +7 -0
- package/dist/modules/forms/api/runtime-helpers.js +149 -0
- package/dist/modules/forms/api/runtime-helpers.js.map +7 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/consents/route.js +137 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/consents/route.js.map +7 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/export/route.js +101 -0
- package/dist/modules/forms/api/subjects/[subjectType]/[subjectId]/export/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/access-audit/route.js +76 -0
- package/dist/modules/forms/api/submissions/[submissionId]/access-audit/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/[actorId]/route.js +56 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/[actorId]/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/route.js +76 -0
- package/dist/modules/forms/api/submissions/[submissionId]/actors/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/anonymize/route.js +107 -0
- package/dist/modules/forms/api/submissions/[submissionId]/anonymize/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/attachments/[attachmentId]/route.js +73 -0
- package/dist/modules/forms/api/submissions/[submissionId]/attachments/[attachmentId]/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/export/route.js +90 -0
- package/dist/modules/forms/api/submissions/[submissionId]/export/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/pdf/route.js +91 -0
- package/dist/modules/forms/api/submissions/[submissionId]/pdf/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/reopen/route.js +55 -0
- package/dist/modules/forms/api/submissions/[submissionId]/reopen/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/revisions/route.js +61 -0
- package/dist/modules/forms/api/submissions/[submissionId]/revisions/route.js.map +7 -0
- package/dist/modules/forms/api/submissions/[submissionId]/route.js +75 -0
- package/dist/modules/forms/api/submissions/[submissionId]/route.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/FormStudio.js +2811 -0
- package/dist/modules/forms/backend/forms/[id]/FormStudio.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.js +214 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.meta.js +19 -0
- package/dist/modules/forms/backend/forms/[id]/analytics/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.js +12 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.meta.js +19 -0
- package/dist/modules/forms/backend/forms/[id]/distributions/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.js +152 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.meta.js +15 -0
- package/dist/modules/forms/backend/forms/[id]/history/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/page.js +13 -0
- package/dist/modules/forms/backend/forms/[id]/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/page.meta.js +15 -0
- package/dist/modules/forms/backend/forms/[id]/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/YesNoRow.js +51 -0
- package/dist/modules/forms/backend/forms/[id]/studio/YesNoRow.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/autosave-guard.js +21 -0
- package/dist/modules/forms/backend/forms/[id]/studio/autosave-guard.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DragOverlayCard.js +18 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DragOverlayCard.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DropIndicator.js +41 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/DropIndicator.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FieldRow.js +277 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FieldRow.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FormCanvas.js +196 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/FormCanvas.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/GridSlot.js +151 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/GridSlot.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/SectionContainer.js +340 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/SectionContainer.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/grid-collision.js +24 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/grid-collision.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/keyboard-coordinates.js +91 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/keyboard-coordinates.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/overlay-size.js +11 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/overlay-size.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/resize-math.js +27 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/resize-math.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/row-layout.js +80 -0
- package/dist/modules/forms/backend/forms/[id]/studio/canvas/row-layout.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/ConditionBuilder.js +210 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/ConditionBuilder.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/HiddenFieldsPanel.js +91 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/HiddenFieldsPanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/JumpsEditor.js +201 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/JumpsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/RecallTokenPicker.js +66 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/RecallTokenPicker.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/VariablesPanel.js +223 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/VariablesPanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/condition-model.js +151 -0
- package/dist/modules/forms/backend/forms/[id]/studio/logic/condition-model.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/lucide-icons.js +88 -0
- package/dist/modules/forms/backend/forms/[id]/studio/lucide-icons.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormAppearancePanel.js +493 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormAppearancePanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormPalettePanel.js +44 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/FormPalettePanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/InputParametersTab.js +350 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/InputParametersTab.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/PaletteCard.js +40 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/PaletteCard.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/RolesEditor.js +202 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/RolesEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/entries.js +66 -0
- package/dist/modules/forms/backend/forms/[id]/studio/palette/entries.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/PreviewSurface.js +1200 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/PreviewSurface.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/ViewportFrame.js +34 -0
- package/dist/modules/forms/backend/forms/[id]/studio/preview/ViewportFrame.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/recall.js +76 -0
- package/dist/modules/forms/backend/forms/[id]/studio/recall.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/schema-helpers.js +1693 -0
- package/dist/modules/forms/backend/forms/[id]/studio/schema-helpers.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/BackgroundControl.js +127 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/BackgroundControl.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/ColorControl.js +181 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/ColorControl.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/contrast.js +75 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/contrast.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/presets.js +91 -0
- package/dist/modules/forms/backend/forms/[id]/studio/style/presets.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/type-label.js +11 -0
- package/dist/modules/forms/backend/forms/[id]/studio/type-label.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/types.js +1 -0
- package/dist/modules/forms/backend/forms/[id]/studio/types.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/undo-controller.js +43 -0
- package/dist/modules/forms/backend/forms/[id]/studio/undo-controller.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/FileConstraintsEditor.js +74 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/FileConstraintsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/GroupConfigEditor.js +134 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/GroupConfigEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/LengthRangeEditor.js +61 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/LengthRangeEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixColumnsEditor.js +149 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixColumnsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixRowsEditor.js +168 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MatrixRowsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MessageOverridesEditor.js +64 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/MessageOverridesEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NpsAnchorsEditor.js +52 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NpsAnchorsEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NumberRangeEditor.js +59 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/NumberRangeEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/OpinionIconSelect.js +31 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/OpinionIconSelect.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/PatternEditor.js +105 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/PatternEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/RankingExhaustiveSwitch.js +15 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/RankingExhaustiveSwitch.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/SignatureConfigEditor.js +75 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/SignatureConfigEditor.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/ValidationPanel.js +293 -0
- package/dist/modules/forms/backend/forms/[id]/studio/validation/ValidationPanel.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/RowBadges.js +42 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/RowBadges.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/SubmissionDrawer.js +473 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/components/SubmissionDrawer.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.js +208 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.meta.js +12 -0
- package/dist/modules/forms/backend/forms/[id]/submissions/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/create/page.js +101 -0
- package/dist/modules/forms/backend/forms/create/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/create/page.meta.js +15 -0
- package/dist/modules/forms/backend/forms/create/page.meta.js.map +7 -0
- package/dist/modules/forms/backend/forms/page.js +227 -0
- package/dist/modules/forms/backend/forms/page.js.map +7 -0
- package/dist/modules/forms/backend/forms/page.meta.js +33 -0
- package/dist/modules/forms/backend/forms/page.meta.js.map +7 -0
- package/dist/modules/forms/commands/distribution.js +417 -0
- package/dist/modules/forms/commands/distribution.js.map +7 -0
- package/dist/modules/forms/commands/form-version.js +640 -0
- package/dist/modules/forms/commands/form-version.js.map +7 -0
- package/dist/modules/forms/commands/form.js +406 -0
- package/dist/modules/forms/commands/form.js.map +7 -0
- package/dist/modules/forms/commands/index.js +11 -0
- package/dist/modules/forms/commands/index.js.map +7 -0
- package/dist/modules/forms/commands/invitation.js +329 -0
- package/dist/modules/forms/commands/invitation.js.map +7 -0
- package/dist/modules/forms/commands/shared.js +151 -0
- package/dist/modules/forms/commands/shared.js.map +7 -0
- package/dist/modules/forms/commands/submission.js +132 -0
- package/dist/modules/forms/commands/submission.js.map +7 -0
- package/dist/modules/forms/data/entities.js +654 -0
- package/dist/modules/forms/data/entities.js.map +7 -0
- package/dist/modules/forms/data/validators.js +254 -0
- package/dist/modules/forms/data/validators.js.map +7 -0
- package/dist/modules/forms/di.js +199 -0
- package/dist/modules/forms/di.js.map +7 -0
- package/dist/modules/forms/encryption.js +15 -0
- package/dist/modules/forms/encryption.js.map +7 -0
- package/dist/modules/forms/events-payloads.js +81 -0
- package/dist/modules/forms/events-payloads.js.map +7 -0
- package/dist/modules/forms/events.js +33 -0
- package/dist/modules/forms/events.js.map +7 -0
- package/dist/modules/forms/extension-points.js +36 -0
- package/dist/modules/forms/extension-points.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.js +33 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.js +41 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.js.map +7 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.meta.js +11 -0
- package/dist/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.js +105 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.js.map +7 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/embed/[slug]/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/f/[slug]/page.js +12 -0
- package/dist/modules/forms/frontend/f/[slug]/page.js.map +7 -0
- package/dist/modules/forms/frontend/f/[slug]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/f/[slug]/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.js +62 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.js.map +7 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.meta.js +11 -0
- package/dist/modules/forms/frontend/forms/[id]/run/page.meta.js.map +7 -0
- package/dist/modules/forms/frontend/i/[token]/page.js +12 -0
- package/dist/modules/forms/frontend/i/[token]/page.js.map +7 -0
- package/dist/modules/forms/frontend/i/[token]/page.meta.js +11 -0
- package/dist/modules/forms/frontend/i/[token]/page.meta.js.map +7 -0
- package/dist/modules/forms/index.js +20 -0
- package/dist/modules/forms/index.js.map +7 -0
- package/dist/modules/forms/lib/embed-frame-policy.js +68 -0
- package/dist/modules/forms/lib/embed-frame-policy.js.map +7 -0
- package/dist/modules/forms/lib/form-definition-slicing.js +38 -0
- package/dist/modules/forms/lib/form-definition-slicing.js.map +7 -0
- package/dist/modules/forms/lib/log-redaction.js +38 -0
- package/dist/modules/forms/lib/log-redaction.js.map +7 -0
- package/dist/modules/forms/lib/navigable-url.js +24 -0
- package/dist/modules/forms/lib/navigable-url.js.map +7 -0
- package/dist/modules/forms/lib/retention.js +20 -0
- package/dist/modules/forms/lib/retention.js.map +7 -0
- package/dist/modules/forms/lib/runtime-principal.js +59 -0
- package/dist/modules/forms/lib/runtime-principal.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260508135459_forms.js +17 -0
- package/dist/modules/forms/migrations/Migration20260508135459_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260508140932_forms.js +23 -0
- package/dist/modules/forms/migrations/Migration20260508140932_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260508155737_forms.js +15 -0
- package/dist/modules/forms/migrations/Migration20260508155737_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260520120000_forms.js +23 -0
- package/dist/modules/forms/migrations/Migration20260520120000_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260521090000_forms.js +13 -0
- package/dist/modules/forms/migrations/Migration20260521090000_forms.js.map +7 -0
- package/dist/modules/forms/migrations/Migration20260521120000_forms.js +17 -0
- package/dist/modules/forms/migrations/Migration20260521120000_forms.js.map +7 -0
- package/dist/modules/forms/runner/FormRunner.js +786 -0
- package/dist/modules/forms/runner/FormRunner.js.map +7 -0
- package/dist/modules/forms/runner/MatrixField.js +150 -0
- package/dist/modules/forms/runner/MatrixField.js.map +7 -0
- package/dist/modules/forms/runner/RankingField.js +131 -0
- package/dist/modules/forms/runner/RankingField.js.map +7 -0
- package/dist/modules/forms/runner/ScaleField.js +78 -0
- package/dist/modules/forms/runner/ScaleField.js.map +7 -0
- package/dist/modules/forms/runner/SignatureField.js +132 -0
- package/dist/modules/forms/runner/SignatureField.js.map +7 -0
- package/dist/modules/forms/runner/tamper-check.js +85 -0
- package/dist/modules/forms/runner/tamper-check.js.map +7 -0
- package/dist/modules/forms/schema/address-countries.js +43 -0
- package/dist/modules/forms/schema/address-countries.js.map +7 -0
- package/dist/modules/forms/schema/field-type-patterns.js +15 -0
- package/dist/modules/forms/schema/field-type-patterns.js.map +7 -0
- package/dist/modules/forms/schema/field-type-registry-advanced.js +32 -0
- package/dist/modules/forms/schema/field-type-registry-advanced.js.map +7 -0
- package/dist/modules/forms/schema/field-type-registry.js +625 -0
- package/dist/modules/forms/schema/field-type-registry.js.map +7 -0
- package/dist/modules/forms/schema/file-field.js +64 -0
- package/dist/modules/forms/schema/file-field.js.map +7 -0
- package/dist/modules/forms/schema/group-field.js +143 -0
- package/dist/modules/forms/schema/group-field.js.map +7 -0
- package/dist/modules/forms/schema/jsonlogic-grammar.js +66 -0
- package/dist/modules/forms/schema/jsonlogic-grammar.js.map +7 -0
- package/dist/modules/forms/schema/jsonschema-extensions.js +739 -0
- package/dist/modules/forms/schema/jsonschema-extensions.js.map +7 -0
- package/dist/modules/forms/schema/layout-catalog.js +38 -0
- package/dist/modules/forms/schema/layout-catalog.js.map +7 -0
- package/dist/modules/forms/schema/signature-field.js +67 -0
- package/dist/modules/forms/schema/signature-field.js.map +7 -0
- package/dist/modules/forms/schema/style-extensions.js +77 -0
- package/dist/modules/forms/schema/style-extensions.js.map +7 -0
- package/dist/modules/forms/schema/style-validators.js +181 -0
- package/dist/modules/forms/schema/style-validators.js.map +7 -0
- package/dist/modules/forms/services/access-audit-logger.js +179 -0
- package/dist/modules/forms/services/access-audit-logger.js.map +7 -0
- package/dist/modules/forms/services/analytics-service.js +306 -0
- package/dist/modules/forms/services/analytics-service.js.map +7 -0
- package/dist/modules/forms/services/anonymize-service.js +123 -0
- package/dist/modules/forms/services/anonymize-service.js.map +7 -0
- package/dist/modules/forms/services/attachment-service.js +123 -0
- package/dist/modules/forms/services/attachment-service.js.map +7 -0
- package/dist/modules/forms/services/captcha-verifier.js +76 -0
- package/dist/modules/forms/services/captcha-verifier.js.map +7 -0
- package/dist/modules/forms/services/consent-record-service.js +96 -0
- package/dist/modules/forms/services/consent-record-service.js.map +7 -0
- package/dist/modules/forms/services/distribution-service.js +366 -0
- package/dist/modules/forms/services/distribution-service.js.map +7 -0
- package/dist/modules/forms/services/distribution-token.js +93 -0
- package/dist/modules/forms/services/distribution-token.js.map +7 -0
- package/dist/modules/forms/services/encryption-service.js +328 -0
- package/dist/modules/forms/services/encryption-service.js.map +7 -0
- package/dist/modules/forms/services/export-service.js +210 -0
- package/dist/modules/forms/services/export-service.js.map +7 -0
- package/dist/modules/forms/services/field-validation-service.js +168 -0
- package/dist/modules/forms/services/field-validation-service.js.map +7 -0
- package/dist/modules/forms/services/form-logic-evaluator.js +517 -0
- package/dist/modules/forms/services/form-logic-evaluator.js.map +7 -0
- package/dist/modules/forms/services/form-version-compiler.js +518 -0
- package/dist/modules/forms/services/form-version-compiler.js.map +7 -0
- package/dist/modules/forms/services/form-version-differ.js +89 -0
- package/dist/modules/forms/services/form-version-differ.js.map +7 -0
- package/dist/modules/forms/services/jsonlogic-evaluator.js +171 -0
- package/dist/modules/forms/services/jsonlogic-evaluator.js.map +7 -0
- package/dist/modules/forms/services/pdf-snapshot-service.js +526 -0
- package/dist/modules/forms/services/pdf-snapshot-service.js.map +7 -0
- package/dist/modules/forms/services/prefill-resolver.js +53 -0
- package/dist/modules/forms/services/prefill-resolver.js.map +7 -0
- package/dist/modules/forms/services/role-policy-service.js +55 -0
- package/dist/modules/forms/services/role-policy-service.js.map +7 -0
- package/dist/modules/forms/services/style-compiler.js +234 -0
- package/dist/modules/forms/services/style-compiler.js.map +7 -0
- package/dist/modules/forms/services/submission-service.js +858 -0
- package/dist/modules/forms/services/submission-service.js.map +7 -0
- package/dist/modules/forms/services/upload-scanner.js +9 -0
- package/dist/modules/forms/services/upload-scanner.js.map +7 -0
- package/dist/modules/forms/services/upload-validation.js +54 -0
- package/dist/modules/forms/services/upload-validation.js.map +7 -0
- package/dist/modules/forms/services/visibility-resolver.js +30 -0
- package/dist/modules/forms/services/visibility-resolver.js.map +7 -0
- package/dist/modules/forms/setup.js +18 -0
- package/dist/modules/forms/setup.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-consent-projector.js +58 -0
- package/dist/modules/forms/subscribers/forms-consent-projector.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-pdf-snapshot.js +68 -0
- package/dist/modules/forms/subscribers/forms-pdf-snapshot.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge-anonymized.js +29 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge-anonymized.js.map +7 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge.js +35 -0
- package/dist/modules/forms/subscribers/forms-webhook-bridge.js.map +7 -0
- package/dist/modules/forms/subscribers/invitation-email.js +100 -0
- package/dist/modules/forms/subscribers/invitation-email.js.map +7 -0
- package/dist/modules/forms/translations.js +10 -0
- package/dist/modules/forms/translations.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/CreateDistributionDialog.js +376 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/CreateDistributionDialog.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/DistributionsPanel.js +313 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/DistributionsPanel.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/EmbedSettingsDialog.js +263 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/EmbedSettingsDialog.js.map +7 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/RecipientsTable.js +373 -0
- package/dist/modules/forms/ui/admin/forms/[id]/distributions/RecipientsTable.js.map +7 -0
- package/dist/modules/forms/ui/public/EmbeddedForm.js +166 -0
- package/dist/modules/forms/ui/public/EmbeddedForm.js.map +7 -0
- package/dist/modules/forms/ui/public/FormRunner.js +359 -0
- package/dist/modules/forms/ui/public/FormRunner.js.map +7 -0
- package/dist/modules/forms/ui/public/FormTrigger.js +45 -0
- package/dist/modules/forms/ui/public/FormTrigger.js.map +7 -0
- package/dist/modules/forms/ui/public/PublicFormRunnerPage.js +14 -0
- package/dist/modules/forms/ui/public/PublicFormRunnerPage.js.map +7 -0
- package/dist/modules/forms/ui/public/components/CompletionScreen.js +55 -0
- package/dist/modules/forms/ui/public/components/CompletionScreen.js.map +7 -0
- package/dist/modules/forms/ui/public/components/LocaleSwitch.js +28 -0
- package/dist/modules/forms/ui/public/components/LocaleSwitch.js.map +7 -0
- package/dist/modules/forms/ui/public/components/ResumeGate.js +52 -0
- package/dist/modules/forms/ui/public/components/ResumeGate.js.map +7 -0
- package/dist/modules/forms/ui/public/components/ReviewStep.js +90 -0
- package/dist/modules/forms/ui/public/components/ReviewStep.js.map +7 -0
- package/dist/modules/forms/ui/public/components/SaveIndicator.js +65 -0
- package/dist/modules/forms/ui/public/components/SaveIndicator.js.map +7 -0
- package/dist/modules/forms/ui/public/components/SectionStepper.js +52 -0
- package/dist/modules/forms/ui/public/components/SectionStepper.js.map +7 -0
- package/dist/modules/forms/ui/public/index.js +38 -0
- package/dist/modules/forms/ui/public/index.js.map +7 -0
- package/dist/modules/forms/ui/public/renderers/index.js +737 -0
- package/dist/modules/forms/ui/public/renderers/index.js.map +7 -0
- package/dist/modules/forms/ui/public/state/logic-derivation.js +42 -0
- package/dist/modules/forms/ui/public/state/logic-derivation.js.map +7 -0
- package/dist/modules/forms/ui/public/state/runtime-client.js +306 -0
- package/dist/modules/forms/ui/public/state/runtime-client.js.map +7 -0
- package/dist/modules/forms/ui/public/state/useAutosave.js +64 -0
- package/dist/modules/forms/ui/public/state/useAutosave.js.map +7 -0
- package/dist/modules/forms/ui/public/state/useFormRunner.js +394 -0
- package/dist/modules/forms/ui/public/state/useFormRunner.js.map +7 -0
- package/dist/modules/forms/ui/public/style/LogoHeader.js +33 -0
- package/dist/modules/forms/ui/public/style/LogoHeader.js.map +7 -0
- package/dist/modules/forms/ui/public/style/applyStyle.js +12 -0
- package/dist/modules/forms/ui/public/style/applyStyle.js.map +7 -0
- package/dist/modules/forms/ui/public/types.js +18 -0
- package/dist/modules/forms/ui/public/types.js.map +7 -0
- package/dist/modules/forms/widgets/injection/access-audit-panel/widget.js +100 -0
- package/dist/modules/forms/widgets/injection/access-audit-panel/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/anonymize-button/widget.js +148 -0
- package/dist/modules/forms/widgets/injection/anonymize-button/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/audit-format.js +33 -0
- package/dist/modules/forms/widgets/injection/audit-format.js.map +7 -0
- package/dist/modules/forms/widgets/injection/context.js +5 -0
- package/dist/modules/forms/widgets/injection/context.js.map +7 -0
- package/dist/modules/forms/widgets/injection/embedded-form/widget.js +52 -0
- package/dist/modules/forms/widgets/injection/embedded-form/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/pdf-download-button/widget.js +83 -0
- package/dist/modules/forms/widgets/injection/pdf-download-button/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection/self-audit-footer/widget.js +38 -0
- package/dist/modules/forms/widgets/injection/self-audit-footer/widget.js.map +7 -0
- package/dist/modules/forms/widgets/injection-table.js +32 -0
- package/dist/modules/forms/widgets/injection-table.js.map +7 -0
- package/dist/modules/forms/workers/pdf-snapshot.js +60 -0
- package/dist/modules/forms/workers/pdf-snapshot.js.map +7 -0
- package/dist/modules/forms/workers/retention-purge.js +112 -0
- package/dist/modules/forms/workers/retention-purge.js.map +7 -0
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js +7 -1
- package/dist/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.js.map +2 -2
- package/dist/modules/inbox_ops/data/validators.js +2 -2
- package/dist/modules/inbox_ops/data/validators.js.map +2 -2
- package/dist/modules/inbox_ops/lib/llmProvider.js +5 -1
- package/dist/modules/inbox_ops/lib/llmProvider.js.map +2 -2
- package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js +2 -2
- package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js.map +2 -2
- package/dist/modules/integrations/di.js +3 -1
- package/dist/modules/integrations/di.js.map +2 -2
- package/dist/modules/integrations/lib/credentials-service.js +29 -36
- package/dist/modules/integrations/lib/credentials-service.js.map +2 -2
- package/dist/modules/messages/api/[id]/attachments/route.js +7 -3
- package/dist/modules/messages/api/[id]/attachments/route.js.map +2 -2
- package/dist/modules/messages/api/[id]/forward-preview/route.js +4 -3
- package/dist/modules/messages/api/[id]/forward-preview/route.js.map +2 -2
- package/dist/modules/messages/api/[id]/route.js +29 -3
- package/dist/modules/messages/api/[id]/route.js.map +2 -2
- package/dist/modules/messages/api/route.js +91 -2
- package/dist/modules/messages/api/route.js.map +2 -2
- package/dist/modules/messages/commands/messages.js +40 -6
- package/dist/modules/messages/commands/messages.js.map +2 -2
- package/dist/modules/messages/components/ComposeMessagePageClient.js +24 -1
- package/dist/modules/messages/components/ComposeMessagePageClient.js.map +2 -2
- package/dist/modules/messages/data/validators.js +11 -1
- package/dist/modules/messages/data/validators.js.map +2 -2
- package/dist/modules/messages/lib/channelThreadAccess.js +30 -0
- package/dist/modules/messages/lib/channelThreadAccess.js.map +7 -0
- package/dist/modules/messages/lib/composeSenderDelegation.js +87 -0
- package/dist/modules/messages/lib/composeSenderDelegation.js.map +7 -0
- package/dist/modules/messages/lib/composeSenderOptions.js +24 -0
- package/dist/modules/messages/lib/composeSenderOptions.js.map +7 -0
- package/dist/modules/messages/lib/email-sender.js +1 -11
- package/dist/modules/messages/lib/email-sender.js.map +2 -2
- package/dist/modules/messages/lib/forwarding.js +4 -4
- package/dist/modules/messages/lib/forwarding.js.map +2 -2
- package/dist/modules/messages/lib/markdownEmailBody.js +15 -0
- package/dist/modules/messages/lib/markdownEmailBody.js.map +7 -0
- package/dist/modules/messages/lib/messageSourceEntityTypes.js +7 -0
- package/dist/modules/messages/lib/messageSourceEntityTypes.js.map +7 -0
- package/dist/modules/messages/lib/routeHelpers.js +43 -0
- package/dist/modules/messages/lib/routeHelpers.js.map +2 -2
- package/dist/modules/messages/subscribers/message-notification.js +30 -1
- package/dist/modules/messages/subscribers/message-notification.js.map +2 -2
- package/dist/modules/notifications/api/[id]/action/route.js +2 -1
- package/dist/modules/notifications/api/[id]/action/route.js.map +2 -2
- package/dist/modules/notifications/api/openapi.js +2 -1
- package/dist/modules/notifications/api/openapi.js.map +2 -2
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js +47 -28
- package/dist/modules/notifications/frontend/NotificationSettingsPageClient.js.map +2 -2
- package/dist/modules/notifications/lib/deliveryConfig.js +27 -2
- package/dist/modules/notifications/lib/deliveryConfig.js.map +2 -2
- package/dist/modules/notifications/lib/notificationMapper.js +3 -1
- package/dist/modules/notifications/lib/notificationMapper.js.map +2 -2
- package/dist/modules/notifications/lib/safeHref.js +4 -0
- package/dist/modules/notifications/lib/safeHref.js.map +2 -2
- package/dist/modules/planner/api/availability-date-specific.js +2 -1
- package/dist/modules/planner/api/availability-date-specific.js.map +2 -2
- package/dist/modules/planner/api/availability-weekly.js +2 -1
- package/dist/modules/planner/api/availability-weekly.js.map +2 -2
- package/dist/modules/progress/api/active/route.js +14 -2
- package/dist/modules/progress/api/active/route.js.map +2 -2
- package/dist/modules/progress/api/jobs/[id]/route.js +38 -22
- package/dist/modules/progress/api/jobs/[id]/route.js.map +2 -2
- package/dist/modules/progress/api/jobs/route.js +20 -6
- package/dist/modules/progress/api/jobs/route.js.map +2 -2
- package/dist/modules/progress/api/requestScope.js +32 -0
- package/dist/modules/progress/api/requestScope.js.map +7 -0
- package/dist/modules/progress/lib/organizationScope.js +10 -0
- package/dist/modules/progress/lib/organizationScope.js.map +7 -0
- package/dist/modules/progress/lib/progressService.js.map +2 -2
- package/dist/modules/progress/lib/progressServiceImpl.js +48 -15
- package/dist/modules/progress/lib/progressServiceImpl.js.map +2 -2
- package/dist/modules/push_notifications/api/custom-send/route.js +4 -1
- package/dist/modules/push_notifications/api/custom-send/route.js.map +2 -2
- package/dist/modules/query_index/api/status.js +5 -3
- package/dist/modules/query_index/api/status.js.map +2 -2
- package/dist/modules/query_index/di.js +2 -1
- package/dist/modules/query_index/di.js.map +2 -2
- package/dist/modules/query_index/lib/engine.js +2 -1
- package/dist/modules/query_index/lib/engine.js.map +2 -2
- package/dist/modules/query_index/lib/request-encryption.js +16 -0
- package/dist/modules/query_index/lib/request-encryption.js.map +7 -0
- package/dist/modules/query_index/lib/search-tokens.js +31 -1
- package/dist/modules/query_index/lib/search-tokens.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/assign/route.js +2 -1
- package/dist/modules/resources/api/resources/tags/assign/route.js.map +2 -2
- package/dist/modules/resources/api/resources/tags/unassign/route.js +2 -1
- package/dist/modules/resources/api/resources/tags/unassign/route.js.map +2 -2
- package/dist/modules/resources/commands/activities.js +2 -2
- package/dist/modules/resources/commands/activities.js.map +2 -2
- package/dist/modules/sales/api/document-history/route.js +5 -1
- package/dist/modules/sales/api/document-history/route.js.map +2 -2
- package/dist/modules/sales/api/document-numbers/route.js +2 -1
- package/dist/modules/sales/api/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/convert/route.js +2 -1
- package/dist/modules/sales/api/quotes/convert/route.js.map +2 -2
- package/dist/modules/sales/api/quotes/send/route.js +2 -1
- package/dist/modules/sales/api/quotes/send/route.js.map +2 -2
- package/dist/modules/sales/api/settings/document-numbers/route.js +7 -1
- package/dist/modules/sales/api/settings/document-numbers/route.js.map +2 -2
- package/dist/modules/sales/api/settings/order-editing/route.js +7 -1
- package/dist/modules/sales/api/settings/order-editing/route.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +354 -138
- package/dist/modules/sales/commands/documents.js.map +3 -3
- package/dist/modules/sales/commands/payments.js +2 -1
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/commands/settings.js +25 -5
- package/dist/modules/sales/commands/settings.js.map +2 -2
- package/dist/modules/sales/commands/shipments.js +2 -1
- package/dist/modules/sales/commands/shipments.js.map +2 -2
- package/dist/modules/sales/components/DocumentNumberSettings.js +32 -21
- package/dist/modules/sales/components/DocumentNumberSettings.js.map +2 -2
- package/dist/modules/sales/components/documents/ItemsSection.js +49 -11
- package/dist/modules/sales/components/documents/ItemsSection.js.map +2 -2
- package/dist/modules/sales/components/documents/LineItemDialog.js +159 -81
- package/dist/modules/sales/components/documents/LineItemDialog.js.map +2 -2
- package/dist/modules/sales/components/documents/lineItemUtils.js +7 -0
- package/dist/modules/sales/components/documents/lineItemUtils.js.map +2 -2
- package/dist/modules/sales/lib/lineSnapshots.js +19 -0
- package/dist/modules/sales/lib/lineSnapshots.js.map +2 -2
- package/dist/modules/sales/setup.js +4 -4
- package/dist/modules/sales/setup.js.map +2 -2
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js +2 -2
- package/dist/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.js.map +2 -2
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js +2 -2
- package/dist/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +2 -1
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +2 -1
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests.js +2 -1
- package/dist/modules/staff/api/leave-requests.js.map +2 -2
- package/dist/modules/staff/api/team-members/self/route.js +2 -1
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +2 -1
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +2 -1
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js +12 -11
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +2 -1
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +2 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-work/route.js +2 -1
- package/dist/modules/staff/api/timesheets/my-work/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +2 -1
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js +2 -1
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js +3 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js +3 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js +3 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/preview/route.js +2 -1
- package/dist/modules/staff/api/timesheets/reports/preview/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/shared.js +2 -1
- package/dist/modules/staff/api/timesheets/reports/shared.js.map +2 -2
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js +2 -1
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js +2 -1
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js +3 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/route.js +2 -1
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +2 -2
- package/dist/modules/staff/commands/activities.js +2 -2
- package/dist/modules/staff/commands/activities.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-reports.js +55 -14
- package/dist/modules/staff/commands/timesheets-reports.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js +2 -1
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js +32 -3
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-reports/reportPeriod.js +16 -0
- package/dist/modules/staff/lib/timesheets-reports/reportPeriod.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CalendarPicker.js +15 -10
- package/dist/modules/staff/lib/timesheets-ui/CalendarPicker.js.map +2 -2
- package/dist/modules/sync_excel/api/import/route.js +35 -12
- package/dist/modules/sync_excel/api/import/route.js.map +2 -2
- package/dist/modules/sync_excel/api/upload/route.js +29 -4
- package/dist/modules/sync_excel/api/upload/route.js.map +2 -2
- package/dist/modules/translations/api/context.js +2 -1
- package/dist/modules/translations/api/context.js.map +2 -2
- package/dist/modules/warranty_claims/api/ai/assess/route.js +2 -1
- package/dist/modules/warranty_claims/api/ai/assess/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/ai/draft-reply/route.js +2 -1
- package/dist/modules/warranty_claims/api/ai/draft-reply/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/ai/suggest/route.js +2 -1
- package/dist/modules/warranty_claims/api/ai/suggest/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/assign/route.js +2 -1
- package/dist/modules/warranty_claims/api/assign/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/credit-memo/route.js +2 -1
- package/dist/modules/warranty_claims/api/credit-memo/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/entitlement/route.js +2 -1
- package/dist/modules/warranty_claims/api/entitlement/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/events/route.js +2 -1
- package/dist/modules/warranty_claims/api/events/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/external/claims/route.js +2 -1
- package/dist/modules/warranty_claims/api/external/claims/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/receiving/route.js +2 -1
- package/dist/modules/warranty_claims/api/receiving/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/replacement-order/route.js +2 -1
- package/dist/modules/warranty_claims/api/replacement-order/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/return-label/route.js +2 -1
- package/dist/modules/warranty_claims/api/return-label/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/risk/route.js +2 -1
- package/dist/modules/warranty_claims/api/risk/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/sales-return/route.js +2 -1
- package/dist/modules/warranty_claims/api/sales-return/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/settings-general/route.js +2 -1
- package/dist/modules/warranty_claims/api/settings-general/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/stats/route.js +9 -5
- package/dist/modules/warranty_claims/api/stats/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/submit/route.js +2 -1
- package/dist/modules/warranty_claims/api/submit/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/transition/route.js +2 -1
- package/dist/modules/warranty_claims/api/transition/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/vendor-recovery/route.js +2 -1
- package/dist/modules/warranty_claims/api/vendor-recovery/route.js.map +2 -2
- package/dist/modules/warranty_claims/api/vendor-recovery-suggestions/route.js +2 -1
- package/dist/modules/warranty_claims/api/vendor-recovery-suggestions/route.js.map +2 -2
- package/dist/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.js +1 -1
- package/dist/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.js.map +2 -2
- package/dist/modules/wms/api/dashboard/operational/route.js +2 -1
- package/dist/modules/wms/api/dashboard/operational/route.js.map +2 -2
- package/dist/modules/wms/api/inventory/cycle-count/route.js +1 -0
- package/dist/modules/wms/api/inventory/cycle-count/route.js.map +2 -2
- package/dist/modules/wms/api/inventory/helpers.js +2 -1
- package/dist/modules/wms/api/inventory/helpers.js.map +2 -2
- package/dist/modules/wms/api/inventory/import/helpers.js +2 -1
- package/dist/modules/wms/api/inventory/import/helpers.js.map +2 -2
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.js +2 -1
- package/dist/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.js.map +2 -2
- package/dist/modules/wms/commands/inventory-actions.js +39 -1
- package/dist/modules/wms/commands/inventory-actions.js.map +2 -2
- package/dist/modules/wms/components/backend/CycleCountWizardDialog.js +14 -1
- package/dist/modules/wms/components/backend/CycleCountWizardDialog.js.map +2 -2
- package/dist/modules/wms/di.js +5 -0
- package/dist/modules/wms/di.js.map +2 -2
- package/dist/modules/wms/lib/availabilityCache.js +86 -0
- package/dist/modules/wms/lib/availabilityCache.js.map +7 -0
- package/dist/modules/wms/lib/availabilityCalculation.js +212 -0
- package/dist/modules/wms/lib/availabilityCalculation.js.map +7 -0
- package/dist/modules/wms/lib/availabilityProvider.js +24 -0
- package/dist/modules/wms/lib/availabilityProvider.js.map +7 -0
- package/dist/modules/wms/lib/loadOperationalDashboard.js +42 -5
- package/dist/modules/wms/lib/loadOperationalDashboard.js.map +2 -2
- package/dist/modules/wms/lib/lowStockBalanceFilter.js +23 -10
- package/dist/modules/wms/lib/lowStockBalanceFilter.js.map +2 -2
- package/dist/modules/wms/lib/sqlInClause.js +9 -0
- package/dist/modules/wms/lib/sqlInClause.js.map +7 -0
- package/dist/modules/wms/lib/tryResolve.js +11 -0
- package/dist/modules/wms/lib/tryResolve.js.map +7 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-policy.js +14 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-policy.js.map +7 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-profile.js +14 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache-profile.js.map +7 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache.js +16 -0
- package/dist/modules/wms/subscribers/invalidate-availability-cache.js.map +7 -0
- package/dist/modules/wms/widgets/notifications/WmsLowStockRenderer.js +2 -2
- package/dist/modules/wms/widgets/notifications/WmsLowStockRenderer.js.map +2 -2
- package/dist/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.js +4 -3
- package/dist/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.js.map +2 -2
- package/dist/modules/workflows/api/commands/route.js +4 -1
- package/dist/modules/workflows/api/commands/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/callers/route.js +4 -1
- package/dist/modules/workflows/api/definitions/[id]/callers/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/context-schema/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/context-schema/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js +4 -1
- package/dist/modules/workflows/api/definitions/[id]/customize/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/draft/route.js +6 -1
- package/dist/modules/workflows/api/definitions/[id]/draft/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/publish/route.js +6 -1
- package/dist/modules/workflows/api/definitions/[id]/publish/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js +4 -1
- package/dist/modules/workflows/api/definitions/[id]/reset-to-code/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/route.js +5 -3
- package/dist/modules/workflows/api/definitions/[id]/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/[id]/test-step/route.js +4 -2
- package/dist/modules/workflows/api/definitions/[id]/test-step/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/generate/route.js +4 -1
- package/dist/modules/workflows/api/definitions/generate/route.js.map +2 -2
- package/dist/modules/workflows/api/definitions/route.js +4 -2
- package/dist/modules/workflows/api/definitions/route.js.map +2 -2
- package/dist/modules/workflows/api/endpoints/route.js +4 -1
- package/dist/modules/workflows/api/endpoints/route.js.map +2 -2
- package/dist/modules/workflows/api/functions/route.js +4 -1
- package/dist/modules/workflows/api/functions/route.js.map +2 -2
- package/dist/modules/workflows/api/grantable-features/route.js +2 -1
- package/dist/modules/workflows/api/grantable-features/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/advance/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/advance/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/cancel/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/context/route.js +2 -1
- package/dist/modules/workflows/api/instances/[id]/context/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/rerun-step/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/rerun-step/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/retry/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/retry/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/signal/route.js +4 -1
- package/dist/modules/workflows/api/instances/[id]/signal/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/[id]/step-through/route.js +4 -2
- package/dist/modules/workflows/api/instances/[id]/step-through/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/route.js +4 -2
- package/dist/modules/workflows/api/instances/route.js.map +2 -2
- package/dist/modules/workflows/api/instances/validate-start/route.js +4 -1
- package/dist/modules/workflows/api/instances/validate-start/route.js.map +2 -2
- package/dist/modules/workflows/api/rule-usage/route.js +4 -1
- package/dist/modules/workflows/api/rule-usage/route.js.map +2 -2
- package/dist/modules/workflows/api/signals/route.js +4 -1
- package/dist/modules/workflows/api/signals/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js +4 -1
- package/dist/modules/workflows/api/tasks/[id]/claim/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js +4 -1
- package/dist/modules/workflows/api/tasks/[id]/complete/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/reassign/route.js +2 -1
- package/dist/modules/workflows/api/tasks/[id]/reassign/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/[id]/unclaim/route.js +4 -1
- package/dist/modules/workflows/api/tasks/[id]/unclaim/route.js.map +2 -2
- package/dist/modules/workflows/api/templates/route.js +4 -1
- package/dist/modules/workflows/api/templates/route.js.map +2 -2
- package/dist/modules/workflows/api/work-inbox/next/route.js +4 -1
- package/dist/modules/workflows/api/work-inbox/next/route.js.map +2 -2
- package/dist/modules/workflows/lib/activity-executor.js +87 -20
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/dist/modules/workflows/lib/activity-types.js +4 -4
- package/dist/modules/workflows/lib/activity-types.js.map +2 -2
- package/dist/modules/workflows/lib/activity-worker-handler.js +16 -11
- package/dist/modules/workflows/lib/activity-worker-handler.js.map +2 -2
- package/dist/modules/workflows/lib/event-trigger-service.js +8 -1
- package/dist/modules/workflows/lib/event-trigger-service.js.map +2 -2
- package/dist/modules/workflows/lib/step-handler.js +4 -4
- package/dist/modules/workflows/lib/step-handler.js.map +2 -2
- package/dist/test-utils/transactionalEntityManagerDouble.js +37 -0
- package/dist/test-utils/transactionalEntityManagerDouble.js.map +7 -0
- package/generated/entities/availability_policy/index.ts +19 -0
- package/generated/entities/communication_channel/index.ts +1 -0
- package/generated/entities/customer_email_conversation_share/index.ts +9 -0
- package/generated/entities/customer_group/index.ts +15 -0
- package/generated/entities/customer_group_membership/index.ts +13 -0
- package/generated/entities/customer_group_terms/index.ts +15 -0
- package/generated/entities/customer_interaction/index.ts +1 -0
- package/generated/entities/form/index.ts +16 -0
- package/generated/entities/form_access_audit/index.ts +9 -0
- package/generated/entities/form_attachment/index.ts +13 -0
- package/generated/entities/form_consent_record/index.ts +17 -0
- package/generated/entities/form_distribution/index.ts +22 -0
- package/generated/entities/form_invitation/index.ts +23 -0
- package/generated/entities/form_submission/index.ts +18 -0
- package/generated/entities/form_submission_actor/index.ts +10 -0
- package/generated/entities/form_submission_revision/index.ts +13 -0
- package/generated/entities/form_version/index.ts +17 -0
- package/generated/entities/forms_encryption_key/index.ts +6 -0
- package/generated/entities.ids.generated.ts +27 -2
- package/generated/entity-fields-registry.ts +269 -0
- package/package.json +18 -7
- package/src/helpers/integration/communicationChannelsFixtures.ts +43 -0
- package/src/helpers/integration/customerGroupsFixtures.ts +171 -0
- package/src/helpers/integration/formsFixtures.ts +757 -0
- package/src/modules/api_docs/api/get/version.ts +28 -11
- package/src/modules/api_keys/api/keys/route.ts +89 -199
- package/src/modules/api_keys/backend/api-keys/create/page.tsx +2 -2
- package/src/modules/api_keys/commands/keys.ts +172 -0
- package/src/modules/api_keys/i18n/de.json +1 -0
- package/src/modules/api_keys/i18n/en.json +1 -0
- package/src/modules/api_keys/i18n/es.json +1 -0
- package/src/modules/api_keys/i18n/ko.json +1 -0
- package/src/modules/api_keys/i18n/pl.json +1 -0
- package/src/modules/api_keys/services/apiKeyService.ts +82 -49
- package/src/modules/attachments/api/file/[id]/route.ts +9 -4
- package/src/modules/attachments/api/image/[id]/[[...slug]]/route.ts +6 -4
- package/src/modules/attachments/api/route.ts +10 -4
- package/src/modules/attachments/components/AttachmentLibrary.tsx +16 -5
- package/src/modules/attachments/lib/access.ts +1 -3
- package/src/modules/attachments/lib/requestScope.ts +35 -3
- package/src/modules/audit_logs/api/audit-logs/actions/export/route.ts +6 -1
- package/src/modules/audit_logs/api/audit-logs/actions/redo/route.ts +41 -6
- package/src/modules/audit_logs/api/audit-logs/actions/route.ts +6 -1
- package/src/modules/audit_logs/api/audit-logs/actions/undo/route.ts +39 -4
- package/src/modules/audit_logs/data/validators.ts +1 -0
- package/src/modules/audit_logs/lib/actorSubject.ts +82 -0
- package/src/modules/audit_logs/lib/replayAuthorization.ts +61 -0
- package/src/modules/audit_logs/services/actionLogService.ts +191 -47
- package/src/modules/auth/api/features.ts +1 -1
- package/src/modules/auth/cli.ts +31 -17
- package/src/modules/auth/commands/acl.ts +26 -36
- package/src/modules/auth/commands/interceptors.ts +23 -0
- package/src/modules/auth/commands/roles.ts +475 -148
- package/src/modules/auth/commands/users.ts +693 -81
- package/src/modules/auth/i18n/de.json +22 -0
- package/src/modules/auth/i18n/en.json +22 -0
- package/src/modules/auth/i18n/es.json +22 -0
- package/src/modules/auth/i18n/ko.json +22 -0
- package/src/modules/auth/i18n/pl.json +22 -0
- package/src/modules/auth/lib/authorizationStateLocks.ts +340 -0
- package/src/modules/auth/lib/commandReplay.ts +194 -0
- package/src/modules/auth/lib/executionPrincipal.ts +36 -28
- package/src/modules/auth/lib/grantChecks.ts +10 -2
- package/src/modules/auth/lib/setup-app.ts +97 -50
- package/src/modules/auth/lib/tokenHash.ts +16 -1
- package/src/modules/auth/services/rbacService.ts +578 -6
- package/src/modules/availability/acl.ts +12 -0
- package/src/modules/availability/api/check/route.ts +136 -0
- package/src/modules/availability/api/openapi.ts +28 -0
- package/src/modules/availability/api/policies/resolve-preview/route.ts +83 -0
- package/src/modules/availability/api/policies/route.ts +244 -0
- package/src/modules/availability/backend/availability/check/page.meta.ts +12 -0
- package/src/modules/availability/backend/availability/check/page.tsx +223 -0
- package/src/modules/availability/backend/availability/policies/ResolutionPreviewPanel.tsx +112 -0
- package/src/modules/availability/backend/availability/policies/ScopeFields.tsx +55 -0
- package/src/modules/availability/backend/availability/policies/StockManagedField.tsx +37 -0
- package/src/modules/availability/backend/availability/policies/[id]/page.meta.ts +8 -0
- package/src/modules/availability/backend/availability/policies/[id]/page.tsx +202 -0
- package/src/modules/availability/backend/availability/policies/create/page.meta.ts +8 -0
- package/src/modules/availability/backend/availability/policies/create/page.tsx +131 -0
- package/src/modules/availability/backend/availability/policies/formGroups.ts +83 -0
- package/src/modules/availability/backend/availability/policies/page.meta.ts +12 -0
- package/src/modules/availability/backend/availability/policies/page.tsx +232 -0
- package/src/modules/availability/backend/availability/policies/policyPayload.ts +29 -0
- package/src/modules/availability/commands/policies.ts +430 -0
- package/src/modules/availability/commands/scope.ts +26 -0
- package/src/modules/availability/data/entities.ts +93 -0
- package/src/modules/availability/data/validators.ts +87 -0
- package/src/modules/availability/di.ts +68 -0
- package/src/modules/availability/events.ts +17 -0
- package/src/modules/availability/i18n/de.json +92 -0
- package/src/modules/availability/i18n/en.json +92 -0
- package/src/modules/availability/i18n/es.json +92 -0
- package/src/modules/availability/i18n/ko.json +92 -0
- package/src/modules/availability/i18n/pl.json +92 -0
- package/src/modules/availability/index.ts +13 -0
- package/src/modules/availability/lib/catalogTarget.ts +72 -0
- package/src/modules/availability/lib/organizationScope.ts +18 -0
- package/src/modules/availability/lib/policyResolution.ts +289 -0
- package/src/modules/availability/lib/tryResolve.ts +8 -0
- package/src/modules/availability/migrations/.snapshot-open-mercato.json +375 -0
- package/src/modules/availability/migrations/Migration20260922095844_availability.ts +13 -0
- package/src/modules/availability/migrations/Migration20260930120000_availability.ts +22 -0
- package/src/modules/availability/setup.ts +10 -0
- package/src/modules/catalog/api/categories/bulk-create/route.ts +119 -0
- package/src/modules/catalog/api/categories/route.ts +70 -8
- package/src/modules/catalog/api/products/bulk-create/route.ts +119 -0
- package/src/modules/catalog/api/products/route.ts +55 -24
- package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +8 -16
- package/src/modules/catalog/backend/catalog/products/create/page.tsx +16 -10
- package/src/modules/catalog/commands/categories.ts +1 -0
- package/src/modules/catalog/commands/productDeleteChildren.ts +557 -0
- package/src/modules/catalog/commands/products.ts +69 -24
- package/src/modules/catalog/components/PriceKindSettings.tsx +6 -20
- package/src/modules/catalog/components/products/ProductUomSection.tsx +26 -37
- package/src/modules/catalog/components/products/productForm.ts +6 -4
- package/src/modules/catalog/data/validators.ts +22 -0
- package/src/modules/catalog/di.ts +2 -1
- package/src/modules/catalog/events.ts +9 -3
- package/src/modules/catalog/i18n/de.json +40 -0
- package/src/modules/catalog/i18n/en.json +40 -0
- package/src/modules/catalog/i18n/es.json +40 -0
- package/src/modules/catalog/i18n/ko.json +40 -0
- package/src/modules/catalog/i18n/pl.json +40 -0
- package/src/modules/catalog/lib/bulkCreateCategories.ts +349 -0
- package/src/modules/catalog/lib/bulkCreateCheckpoint.ts +176 -0
- package/src/modules/catalog/lib/bulkCreateMutationGuards.ts +62 -0
- package/src/modules/catalog/lib/bulkCreateProducts.ts +340 -0
- package/src/modules/catalog/lib/bulkDelete.ts +10 -14
- package/src/modules/catalog/lib/catalogQueue.ts +14 -0
- package/src/modules/catalog/lib/currencyOptions.ts +28 -0
- package/src/modules/catalog/lib/productSearch.ts +16 -0
- package/src/modules/catalog/lib/seeds.ts +2 -43
- package/src/modules/catalog/lib/unitLabels.ts +52 -0
- package/src/modules/catalog/migrations/Migration20260914120000.ts +51 -0
- package/src/modules/catalog/migrations/Migration20260914120100.ts +50 -0
- package/src/modules/catalog/workers/catalog-category-bulk-create.ts +48 -0
- package/src/modules/catalog/workers/catalog-product-bulk-create.ts +48 -0
- package/src/modules/communication_channels/acl.ts +8 -0
- package/src/modules/communication_channels/api/get/me/channels/route.ts +4 -0
- package/src/modules/communication_channels/api/get/oauth/[provider]/callback/route.ts +23 -0
- package/src/modules/communication_channels/api/post/channels/[id]/import-history/route.ts +3 -4
- package/src/modules/communication_channels/api/post/channels/[id]/test-send/route.ts +9 -1
- package/src/modules/communication_channels/api/post/channels/connect/credentials/route.ts +4 -6
- package/src/modules/communication_channels/api/post/channels/connect/tenant-credentials/route.ts +4 -6
- package/src/modules/communication_channels/api/post/test-seed/route.ts +109 -24
- package/src/modules/communication_channels/api/put/channels/[id]/visibility/route.ts +165 -0
- package/src/modules/communication_channels/backend/profile/communication-channels/page.tsx +247 -129
- package/src/modules/communication_channels/commands/ingest-inbound-message.ts +2 -1
- package/src/modules/communication_channels/commands/set-channel-visibility.ts +138 -0
- package/src/modules/communication_channels/data/enrichers.ts +42 -19
- package/src/modules/communication_channels/data/entities.ts +21 -0
- package/src/modules/communication_channels/di.ts +9 -0
- package/src/modules/communication_channels/events.ts +7 -0
- package/src/modules/communication_channels/i18n/de.json +16 -3
- package/src/modules/communication_channels/i18n/en.json +16 -3
- package/src/modules/communication_channels/i18n/es.json +16 -3
- package/src/modules/communication_channels/i18n/ko.json +16 -3
- package/src/modules/communication_channels/i18n/pl.json +16 -3
- package/src/modules/communication_channels/index.ts +1 -1
- package/src/modules/communication_channels/lib/access-control.ts +4 -1
- package/src/modules/communication_channels/lib/adapter.ts +16 -6
- package/src/modules/communication_channels/lib/channel-thread-access.ts +133 -0
- package/src/modules/communication_channels/lib/credential-refresh.ts +27 -5
- package/src/modules/communication_channels/lib/inbound-message-origin.ts +62 -0
- package/src/modules/communication_channels/lib/oauth-state.ts +96 -1
- package/src/modules/communication_channels/lib/outbound-delivery-intent.ts +57 -0
- package/src/modules/communication_channels/lib/send-as-user.ts +2 -2
- package/src/modules/communication_channels/migrations/.snapshot-open-mercato.json +18 -1
- package/src/modules/communication_channels/migrations/Migration20260825141000_communication_channels.ts +22 -0
- package/src/modules/communication_channels/setup.ts +4 -0
- package/src/modules/communication_channels/subscribers/outbound-bridge.ts +34 -9
- package/src/modules/communication_channels/workers/gmail-history-sync.ts +1 -1
- package/src/modules/communication_channels/workers/poll-channel.ts +1 -1
- package/src/modules/communication_channels/workers/reaction-processor.ts +2 -2
- package/src/modules/configs/api/upgrade-actions/route.ts +2 -1
- package/src/modules/configs/cli.ts +2 -2
- package/src/modules/configs/i18n/de.json +2 -0
- package/src/modules/configs/i18n/en.json +2 -0
- package/src/modules/configs/i18n/es.json +2 -0
- package/src/modules/configs/i18n/ko.json +2 -0
- package/src/modules/configs/i18n/pl.json +2 -0
- package/src/modules/configs/lib/upgrade-actions.ts +29 -6
- package/src/modules/configs/services/upgradeActionsService.ts +45 -30
- package/src/modules/currencies/api/currencies/route.ts +11 -5
- package/src/modules/currencies/api/exchange-rates/route.ts +11 -5
- package/src/modules/customer_groups/acl.ts +10 -0
- package/src/modules/customer_groups/api/customer-groups/[id]/terms/route.ts +355 -0
- package/src/modules/customer_groups/api/customer-groups/crud.ts +627 -0
- package/src/modules/customer_groups/api/customer-groups/explain-terms/route.ts +195 -0
- package/src/modules/customer_groups/api/customer-groups/memberships/crud.ts +525 -0
- package/src/modules/customer_groups/api/customer-groups/memberships/route.ts +65 -0
- package/src/modules/customer_groups/api/customer-groups/reconcile/adopt/route.ts +150 -0
- package/src/modules/customer_groups/api/customer-groups/reconcile/route.ts +90 -0
- package/src/modules/customer_groups/api/customer-groups/reorder/route.ts +147 -0
- package/src/modules/customer_groups/api/customer-groups/route.ts +65 -0
- package/src/modules/customer_groups/api/openapi.ts +28 -0
- package/src/modules/customer_groups/backend/customer-groups/[id]/edit/page.meta.ts +12 -0
- package/src/modules/customer_groups/backend/customer-groups/[id]/edit/page.tsx +392 -0
- package/src/modules/customer_groups/backend/customer-groups/create/page.meta.ts +25 -0
- package/src/modules/customer_groups/backend/customer-groups/create/page.tsx +279 -0
- package/src/modules/customer_groups/backend/customer-groups/orphans/page.meta.ts +12 -0
- package/src/modules/customer_groups/backend/customer-groups/orphans/page.tsx +216 -0
- package/src/modules/customer_groups/backend/customer-groups/page.meta.ts +11 -0
- package/src/modules/customer_groups/backend/customer-groups/page.tsx +478 -0
- package/src/modules/customer_groups/cli.ts +87 -0
- package/src/modules/customer_groups/commands/reorderGroups.ts +163 -0
- package/src/modules/customer_groups/components/CustomerGroupDefaultField.tsx +55 -0
- package/src/modules/customer_groups/components/CustomerGroupParentField.tsx +194 -0
- package/src/modules/customer_groups/components/CustomerGroupTermsPriceKindField.tsx +111 -0
- package/src/modules/customer_groups/components/CustomerGroupTermsSection.tsx +273 -0
- package/src/modules/customer_groups/components/GroupPickerField.tsx +142 -0
- package/src/modules/customer_groups/components/OrphanBanner.tsx +92 -0
- package/src/modules/customer_groups/components/customerGroupTree.ts +84 -0
- package/src/modules/customer_groups/data/entities.ts +244 -0
- package/src/modules/customer_groups/data/validators.ts +232 -0
- package/src/modules/customer_groups/di.ts +25 -0
- package/src/modules/customer_groups/events.ts +22 -0
- package/src/modules/customer_groups/i18n/de.json +199 -0
- package/src/modules/customer_groups/i18n/en.json +199 -0
- package/src/modules/customer_groups/i18n/es.json +199 -0
- package/src/modules/customer_groups/i18n/ko.json +199 -0
- package/src/modules/customer_groups/i18n/pl.json +199 -0
- package/src/modules/customer_groups/index.ts +13 -0
- package/src/modules/customer_groups/lib/createConflictRecheck.ts +39 -0
- package/src/modules/customer_groups/lib/customerScope.ts +145 -0
- package/src/modules/customer_groups/lib/groupEvents.ts +50 -0
- package/src/modules/customer_groups/lib/priceKindScope.ts +22 -0
- package/src/modules/customer_groups/lib/reconcile.ts +299 -0
- package/src/modules/customer_groups/migrations/.snapshot-open-mercato.json +905 -0
- package/src/modules/customer_groups/migrations/Migration20260922095316_customer_groups.ts +26 -0
- package/src/modules/customer_groups/migrations/Migration20260922103033_customer_groups.ts +22 -0
- package/src/modules/customer_groups/migrations/Migration20260922105444_customer_groups.ts +17 -0
- package/src/modules/customer_groups/migrations/Migration20260923193330_customer_groups.ts +20 -0
- package/src/modules/customer_groups/migrations/Migration20260929083000_customer_groups.ts +21 -0
- package/src/modules/customer_groups/services/customerGroupsService.ts +358 -0
- package/src/modules/customer_groups/setup.ts +11 -0
- package/src/modules/customer_groups/widgets/injection/group-picker-field/widget.ts +41 -0
- package/src/modules/customer_groups/widgets/injection/person-groups-explain-terms.tsx +227 -0
- package/src/modules/customer_groups/widgets/injection/person-groups-tab/widget.ts +21 -0
- package/src/modules/customer_groups/widgets/injection/person-groups-tab.tsx +573 -0
- package/src/modules/customer_groups/widgets/injection-table.ts +35 -0
- package/src/modules/customers/acl.ts +13 -0
- package/src/modules/customers/api/activities/route.ts +10 -0
- package/src/modules/customers/api/companies/[id]/people/route.ts +2 -1
- package/src/modules/customers/api/companies/[id]/route.ts +20 -6
- package/src/modules/customers/api/deals/[id]/companies/route.ts +2 -1
- package/src/modules/customers/api/deals/[id]/people/route.ts +84 -4
- package/src/modules/customers/api/deals/map/route.ts +11 -10
- package/src/modules/customers/api/dictionaries/context.ts +2 -1
- package/src/modules/customers/api/entity-roles-factory.ts +3 -2
- package/src/modules/customers/api/interactions/[id]/visibility/route.ts +2 -1
- package/src/modules/customers/api/interactions/cancel/route.ts +2 -1
- package/src/modules/customers/api/interactions/complete/route.ts +2 -1
- package/src/modules/customers/api/interactions/conflicts/route.ts +10 -10
- package/src/modules/customers/api/interactions/counts/route.ts +25 -7
- package/src/modules/customers/api/interactions/route.ts +34 -10
- package/src/modules/customers/api/labels/assign/route.ts +2 -1
- package/src/modules/customers/api/labels/route.ts +3 -2
- package/src/modules/customers/api/labels/unassign/route.ts +2 -1
- package/src/modules/customers/api/people/[id]/companies/context.ts +11 -2
- package/src/modules/customers/api/people/[id]/email-share/route.ts +276 -0
- package/src/modules/customers/api/people/[id]/email-threads/route.ts +14 -1
- package/src/modules/customers/api/people/[id]/emails/route.ts +2 -1
- package/src/modules/customers/api/people/[id]/route.ts +31 -22
- package/src/modules/customers/api/people/check-phone/route.ts +2 -1
- package/src/modules/customers/api/pipeline-stages/reorder/route.ts +3 -2
- package/src/modules/customers/api/pipeline-stages/route.ts +3 -3
- package/src/modules/customers/api/pipelines/route.ts +3 -3
- package/src/modules/customers/api/settings/address-format/route.ts +2 -1
- package/src/modules/customers/api/settings/dictionary-sort-modes/route.ts +2 -1
- package/src/modules/customers/api/settings/stuck-threshold/route.ts +2 -1
- package/src/modules/customers/api/tags/assign/route.ts +2 -1
- package/src/modules/customers/api/tags/unassign/route.ts +2 -1
- package/src/modules/customers/backend/customers/companies/[id]/page.tsx +4 -2
- package/src/modules/customers/backend/customers/deals/[id]/hooks/useDealAssociations.ts +10 -35
- package/src/modules/customers/backend/customers/deals/[id]/page.tsx +21 -18
- package/src/modules/customers/backend/customers/deals/components/ReassignOwnerDialog.tsx +115 -0
- package/src/modules/customers/backend/customers/deals/page.tsx +121 -1
- package/src/modules/customers/backend/customers/people/[id]/page.tsx +4 -2
- package/src/modules/customers/commands/addresses.ts +117 -15
- package/src/modules/customers/commands/companies.ts +10 -4
- package/src/modules/customers/commands/emailConversationShares.ts +261 -0
- package/src/modules/customers/commands/index.ts +1 -0
- package/src/modules/customers/commands/interactions.ts +61 -21
- package/src/modules/customers/commands/people.ts +3 -2
- package/src/modules/customers/commands/shared.ts +4 -0
- package/src/modules/customers/components/calendar/types.ts +1 -1
- package/src/modules/customers/components/detail/CompanyPeopleSection.tsx +97 -399
- package/src/modules/customers/components/detail/CreatePersonDialog.tsx +39 -19
- package/src/modules/customers/components/detail/DealForm.tsx +118 -5
- package/src/modules/customers/components/detail/DealOwnerSelect.tsx +161 -0
- package/src/modules/customers/components/detail/DealPeopleSection.tsx +256 -0
- package/src/modules/customers/components/detail/DealsSection.tsx +8 -14
- package/src/modules/customers/components/detail/LinkedPeopleSection.tsx +474 -0
- package/src/modules/customers/components/detail/PersonCard.tsx +12 -4
- package/src/modules/customers/components/detail/PersonEmailShareControl.tsx +273 -0
- package/src/modules/customers/components/detail/PersonEmailThreadsTab.tsx +26 -0
- package/src/modules/customers/components/detail/ScheduleActivityDialog.tsx +10 -2
- package/src/modules/customers/components/detail/create/CreateDealForm.tsx +30 -0
- package/src/modules/customers/components/detail/create/DealDetailsFields.tsx +12 -0
- package/src/modules/customers/components/detail/create/DealSectionCard.tsx +7 -2
- package/src/modules/customers/components/detail/create/dealFormTypes.ts +3 -0
- package/src/modules/customers/components/detail/schedule/useScheduleFormState.ts +16 -4
- package/src/modules/customers/components/formConfig.tsx +3 -0
- package/src/modules/customers/components/linking/LinkEntityDialog.tsx +8 -0
- package/src/modules/customers/components/linking/adapters/personAdapter.tsx +4 -0
- package/src/modules/customers/data/enrichers.ts +64 -5
- package/src/modules/customers/data/entities.ts +105 -1
- package/src/modules/customers/data/validators.ts +22 -0
- package/src/modules/customers/events.ts +5 -0
- package/src/modules/customers/i18n/de.json +49 -13
- package/src/modules/customers/i18n/en.json +44 -8
- package/src/modules/customers/i18n/es.json +44 -8
- package/src/modules/customers/i18n/ko.json +44 -8
- package/src/modules/customers/i18n/pl.json +44 -8
- package/src/modules/customers/lib/assignableStaff.ts +17 -0
- package/src/modules/customers/lib/calendar/editorPayload.ts +20 -13
- package/src/modules/customers/lib/calendar/mapItem.ts +1 -0
- package/src/modules/customers/lib/conversationShares.ts +250 -0
- package/src/modules/customers/lib/dealsOrganizationScope.ts +5 -3
- package/src/modules/customers/lib/interactionRequestContext.ts +2 -1
- package/src/modules/customers/lib/link-channel-message-handler.ts +27 -4
- package/src/modules/customers/lib/personDetailCacheTags.ts +68 -0
- package/src/modules/customers/lib/personEmailThreads.ts +61 -6
- package/src/modules/customers/lib/reassignDealOwner.ts +51 -0
- package/src/modules/customers/lib/userNames.ts +39 -0
- package/src/modules/customers/lib/visibilityFilter.ts +170 -3
- package/src/modules/customers/migrations/.snapshot-open-mercato.json +240 -0
- package/src/modules/customers/migrations/Migration20260825120000_customers.ts +19 -0
- package/src/modules/customers/migrations/Migration20260825140000_customers.ts +41 -0
- package/src/modules/customers/setup.ts +1 -0
- package/src/modules/customers/subscribers/channel-visibility-changed.ts +50 -0
- package/src/modules/dashboards/api/widgets/data/batch/route.ts +3 -8
- package/src/modules/dashboards/api/widgets/data/route.ts +12 -18
- package/src/modules/dashboards/lib/aggregations.ts +1 -1
- package/src/modules/dashboards/lib/widgetScope.ts +2 -7
- package/src/modules/data_sync/AGENTS.md +35 -1
- package/src/modules/data_sync/api/runs/[id]/cancel.ts +5 -1
- package/src/modules/data_sync/backend/data-sync/page.tsx +292 -19
- package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +205 -21
- package/src/modules/data_sync/components/useDataSyncRunAccess.ts +27 -0
- package/src/modules/data_sync/i18n/de.json +24 -0
- package/src/modules/data_sync/i18n/en.json +24 -0
- package/src/modules/data_sync/i18n/es.json +24 -0
- package/src/modules/data_sync/i18n/ko.json +24 -0
- package/src/modules/data_sync/i18n/pl.json +24 -0
- package/src/modules/data_sync/lib/adapter.ts +37 -0
- package/src/modules/data_sync/lib/resume-point.ts +63 -0
- package/src/modules/data_sync/lib/start-run.ts +61 -2
- package/src/modules/data_sync/lib/sync-run-service.ts +27 -34
- package/src/modules/devices/api/[id]/route.ts +3 -2
- package/src/modules/devices/api/admin/devices/route.ts +2 -1
- package/src/modules/devices/api/route.ts +2 -1
- package/src/modules/dictionaries/api/[dictionaryId]/route.ts +3 -5
- package/src/modules/dictionaries/api/context.ts +2 -1
- package/src/modules/dictionaries/api/route.ts +4 -0
- package/src/modules/dictionaries/components/DictionariesManager.tsx +4 -3
- package/src/modules/dictionaries/data/validators.ts +9 -1
- package/src/modules/dictionaries/i18n/de.json +3 -3
- package/src/modules/dictionaries/i18n/en.json +3 -3
- package/src/modules/dictionaries/i18n/es.json +3 -3
- package/src/modules/dictionaries/i18n/ko.json +3 -3
- package/src/modules/dictionaries/i18n/pl.json +3 -3
- package/src/modules/directory/api/organization-branding/route.ts +10 -1
- package/src/modules/directory/api/organizations/route.ts +1 -1
- package/src/modules/directory/backend/directory/branding/page.tsx +24 -2
- package/src/modules/directory/commands/organizations.ts +173 -80
- package/src/modules/directory/i18n/de.json +1 -0
- package/src/modules/directory/i18n/en.json +1 -0
- package/src/modules/directory/i18n/es.json +1 -0
- package/src/modules/directory/i18n/ko.json +1 -0
- package/src/modules/directory/i18n/pl.json +1 -0
- package/src/modules/directory/lib/hierarchy.ts +22 -1
- package/src/modules/directory/utils/organizationScope.ts +102 -15
- package/src/modules/directory/utils/organizationScopeFilter.ts +6 -3
- package/src/modules/directory/utils/organizationScopeGuard.ts +9 -5
- package/src/modules/entities/api/encryption.ts +73 -27
- package/src/modules/entities/api/records.ts +9 -8
- package/src/modules/entities/cli.ts +46 -24
- package/src/modules/entities/data/entities.ts +15 -0
- package/src/modules/entities/lib/definition-scope.ts +5 -1
- package/src/modules/entities/lib/encryption-maps.ts +164 -0
- package/src/modules/entities/lib/helpers.ts +95 -8
- package/src/modules/entities/migrations/.snapshot-open-mercato.json +21 -0
- package/src/modules/entities/migrations/.snapshot-openmercato.json +12 -0
- package/src/modules/entities/migrations/Migration20260910120000.ts +42 -0
- package/src/modules/entities/migrations/Migration20261004120000_encryption_map_scope_uniqueness.ts +130 -0
- package/src/modules/eudr/api/dashboard/widgets/compliance-overview/route.ts +2 -1
- package/src/modules/eudr/api/plots/import/route.ts +2 -1
- package/src/modules/eudr/api/product-mappings/suggestions/apply/route.ts +2 -1
- package/src/modules/eudr/api/product-mappings/suggestions/route.ts +2 -1
- package/src/modules/eudr/api/reports/annual/route.ts +2 -1
- package/src/modules/eudr/api/statements/[id]/export/route.ts +2 -1
- package/src/modules/eudr/api/statements/[id]/readiness/route.ts +2 -1
- package/src/modules/eudr/api/suppliers/compliance/route.ts +2 -1
- package/src/modules/feature_toggles/commands/global.ts +18 -15
- package/src/modules/feature_toggles/lib/feature-flag-check.ts +8 -3
- package/src/modules/forms/acl.ts +10 -0
- package/src/modules/forms/api/[id]/analytics/route.ts +137 -0
- package/src/modules/forms/api/[id]/distributions/route.ts +192 -0
- package/src/modules/forms/api/[id]/route.ts +245 -0
- package/src/modules/forms/api/[id]/run/context/route.ts +142 -0
- package/src/modules/forms/api/[id]/run/submissions/route.ts +147 -0
- package/src/modules/forms/api/[id]/submissions/route.ts +100 -0
- package/src/modules/forms/api/[id]/theme-logo/route.ts +147 -0
- package/src/modules/forms/api/[id]/versions/[versionId]/diff/route.ts +137 -0
- package/src/modules/forms/api/[id]/versions/[versionId]/publish/route.ts +108 -0
- package/src/modules/forms/api/[id]/versions/[versionId]/route.ts +200 -0
- package/src/modules/forms/api/[id]/versions/fork/route.ts +98 -0
- package/src/modules/forms/api/attachment-helpers.ts +160 -0
- package/src/modules/forms/api/by-key/[key]/active/route.ts +165 -0
- package/src/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/route.ts +92 -0
- package/src/modules/forms/api/distributions/[distributionId]/invitations/[invitationId]/send/route.ts +96 -0
- package/src/modules/forms/api/distributions/[distributionId]/invitations/route.ts +207 -0
- package/src/modules/forms/api/distributions/[distributionId]/route.ts +213 -0
- package/src/modules/forms/api/form-submissions/[id]/attachments/route.ts +114 -0
- package/src/modules/forms/api/form-submissions/[id]/resume-token/route.ts +140 -0
- package/src/modules/forms/api/form-submissions/[id]/route.ts +176 -0
- package/src/modules/forms/api/form-submissions/[id]/submit/route.ts +91 -0
- package/src/modules/forms/api/form-submissions/by-subject/[subject_type]/[subject_id]/route.ts +93 -0
- package/src/modules/forms/api/form-submissions/route.ts +133 -0
- package/src/modules/forms/api/helpers.ts +175 -0
- package/src/modules/forms/api/public/distributions/[slug]/embed-policy/route.ts +74 -0
- package/src/modules/forms/api/public/distributions/[slug]/route.ts +101 -0
- package/src/modules/forms/api/public/embed-loader/route.ts +136 -0
- package/src/modules/forms/api/public/invitations/[token]/route.ts +107 -0
- package/src/modules/forms/api/public/rate-limit.ts +69 -0
- package/src/modules/forms/api/public/start/route.ts +195 -0
- package/src/modules/forms/api/public/submissions/[id]/attachments/[attachmentId]/route.ts +86 -0
- package/src/modules/forms/api/public/submissions/[id]/attachments/route.ts +108 -0
- package/src/modules/forms/api/public/submissions/[id]/pdf/route.ts +96 -0
- package/src/modules/forms/api/public/submissions/[id]/route.ts +189 -0
- package/src/modules/forms/api/public/submissions/[id]/submit/route.ts +159 -0
- package/src/modules/forms/api/route.ts +240 -0
- package/src/modules/forms/api/runtime-helpers.ts +208 -0
- package/src/modules/forms/api/subjects/[subjectType]/[subjectId]/consents/route.ts +178 -0
- package/src/modules/forms/api/subjects/[subjectType]/[subjectId]/export/route.ts +135 -0
- package/src/modules/forms/api/submissions/[submissionId]/access-audit/route.ts +100 -0
- package/src/modules/forms/api/submissions/[submissionId]/actors/[actorId]/route.ts +70 -0
- package/src/modules/forms/api/submissions/[submissionId]/actors/route.ts +92 -0
- package/src/modules/forms/api/submissions/[submissionId]/anonymize/route.ts +134 -0
- package/src/modules/forms/api/submissions/[submissionId]/attachments/[attachmentId]/route.ts +90 -0
- package/src/modules/forms/api/submissions/[submissionId]/export/route.ts +111 -0
- package/src/modules/forms/api/submissions/[submissionId]/pdf/route.ts +118 -0
- package/src/modules/forms/api/submissions/[submissionId]/reopen/route.ts +69 -0
- package/src/modules/forms/api/submissions/[submissionId]/revisions/route.ts +75 -0
- package/src/modules/forms/api/submissions/[submissionId]/route.ts +90 -0
- package/src/modules/forms/backend/forms/[id]/FormStudio.tsx +3269 -0
- package/src/modules/forms/backend/forms/[id]/analytics/page.meta.ts +15 -0
- package/src/modules/forms/backend/forms/[id]/analytics/page.tsx +289 -0
- package/src/modules/forms/backend/forms/[id]/distributions/page.meta.ts +15 -0
- package/src/modules/forms/backend/forms/[id]/distributions/page.tsx +16 -0
- package/src/modules/forms/backend/forms/[id]/history/page.meta.ts +11 -0
- package/src/modules/forms/backend/forms/[id]/history/page.tsx +229 -0
- package/src/modules/forms/backend/forms/[id]/page.meta.ts +11 -0
- package/src/modules/forms/backend/forms/[id]/page.tsx +17 -0
- package/src/modules/forms/backend/forms/[id]/studio/YesNoRow.tsx +65 -0
- package/src/modules/forms/backend/forms/[id]/studio/autosave-guard.ts +25 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/DragOverlayCard.tsx +24 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/DropIndicator.tsx +36 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/FieldRow.tsx +308 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/FormCanvas.tsx +265 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/GridSlot.tsx +176 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/SectionContainer.tsx +473 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/grid-collision.ts +25 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/keyboard-coordinates.ts +128 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/overlay-size.ts +15 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/resize-math.ts +36 -0
- package/src/modules/forms/backend/forms/[id]/studio/canvas/row-layout.ts +110 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/ConditionBuilder.tsx +264 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/HiddenFieldsPanel.tsx +121 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/JumpsEditor.tsx +237 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/RecallTokenPicker.tsx +87 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/VariablesPanel.tsx +260 -0
- package/src/modules/forms/backend/forms/[id]/studio/logic/condition-model.ts +207 -0
- package/src/modules/forms/backend/forms/[id]/studio/lucide-icons.ts +87 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/FormAppearancePanel.tsx +561 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/FormPalettePanel.tsx +52 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/InputParametersTab.tsx +378 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/PaletteCard.tsx +40 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/RolesEditor.tsx +225 -0
- package/src/modules/forms/backend/forms/[id]/studio/palette/entries.ts +102 -0
- package/src/modules/forms/backend/forms/[id]/studio/preview/PreviewSurface.tsx +1459 -0
- package/src/modules/forms/backend/forms/[id]/studio/preview/ViewportFrame.tsx +49 -0
- package/src/modules/forms/backend/forms/[id]/studio/recall.ts +0 -0
- package/src/modules/forms/backend/forms/[id]/studio/schema-helpers.ts +2525 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/BackgroundControl.tsx +137 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/ColorControl.tsx +257 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/contrast.ts +114 -0
- package/src/modules/forms/backend/forms/[id]/studio/style/presets.ts +104 -0
- package/src/modules/forms/backend/forms/[id]/studio/type-label.ts +13 -0
- package/src/modules/forms/backend/forms/[id]/studio/types.ts +31 -0
- package/src/modules/forms/backend/forms/[id]/studio/undo-controller.ts +52 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/FileConstraintsEditor.tsx +89 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/GroupConfigEditor.tsx +167 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/LengthRangeEditor.tsx +67 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/MatrixColumnsEditor.tsx +166 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/MatrixRowsEditor.tsx +184 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/MessageOverridesEditor.tsx +83 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/NpsAnchorsEditor.tsx +60 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/NumberRangeEditor.tsx +65 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/OpinionIconSelect.tsx +46 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/PatternEditor.tsx +122 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/RankingExhaustiveSwitch.tsx +28 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/SignatureConfigEditor.tsx +84 -0
- package/src/modules/forms/backend/forms/[id]/studio/validation/ValidationPanel.tsx +369 -0
- package/src/modules/forms/backend/forms/[id]/submissions/components/RowBadges.ts +56 -0
- package/src/modules/forms/backend/forms/[id]/submissions/components/SubmissionDrawer.tsx +604 -0
- package/src/modules/forms/backend/forms/[id]/submissions/page.meta.ts +10 -0
- package/src/modules/forms/backend/forms/[id]/submissions/page.tsx +264 -0
- package/src/modules/forms/backend/forms/create/page.meta.ts +11 -0
- package/src/modules/forms/backend/forms/create/page.tsx +113 -0
- package/src/modules/forms/backend/forms/page.meta.ts +31 -0
- package/src/modules/forms/backend/forms/page.tsx +269 -0
- package/src/modules/forms/commands/distribution.ts +502 -0
- package/src/modules/forms/commands/form-version.ts +806 -0
- package/src/modules/forms/commands/form.ts +472 -0
- package/src/modules/forms/commands/index.ts +18 -0
- package/src/modules/forms/commands/invitation.ts +424 -0
- package/src/modules/forms/commands/shared.ts +261 -0
- package/src/modules/forms/commands/submission.ts +209 -0
- package/src/modules/forms/data/entities.ts +686 -0
- package/src/modules/forms/data/validators.ts +483 -0
- package/src/modules/forms/di.ts +246 -0
- package/src/modules/forms/encryption.ts +31 -0
- package/src/modules/forms/events-payloads.ts +103 -0
- package/src/modules/forms/events.ts +50 -0
- package/src/modules/forms/extension-points.ts +41 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.meta.ts +9 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/forms/[key]/page.tsx +45 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.meta.ts +9 -0
- package/src/modules/forms/frontend/[orgSlug]/portal/submissions/[id]/continue/page.tsx +56 -0
- package/src/modules/forms/frontend/embed/[slug]/page.meta.ts +42 -0
- package/src/modules/forms/frontend/embed/[slug]/page.tsx +171 -0
- package/src/modules/forms/frontend/f/[slug]/page.meta.ts +9 -0
- package/src/modules/forms/frontend/f/[slug]/page.tsx +10 -0
- package/src/modules/forms/frontend/forms/[id]/run/page.meta.ts +17 -0
- package/src/modules/forms/frontend/forms/[id]/run/page.tsx +83 -0
- package/src/modules/forms/frontend/i/[token]/page.meta.ts +9 -0
- package/src/modules/forms/frontend/i/[token]/page.tsx +10 -0
- package/src/modules/forms/i18n/de.json +800 -0
- package/src/modules/forms/i18n/en.json +800 -0
- package/src/modules/forms/i18n/es.json +800 -0
- package/src/modules/forms/i18n/ko.json +800 -0
- package/src/modules/forms/i18n/pl.json +800 -0
- package/src/modules/forms/index.ts +18 -0
- package/src/modules/forms/lib/embed-frame-policy.ts +144 -0
- package/src/modules/forms/lib/form-definition-slicing.ts +54 -0
- package/src/modules/forms/lib/log-redaction.ts +91 -0
- package/src/modules/forms/lib/navigable-url.ts +57 -0
- package/src/modules/forms/lib/retention.ts +73 -0
- package/src/modules/forms/lib/runtime-principal.ts +101 -0
- package/src/modules/forms/migrations/.snapshot-open-mercato.json +3185 -0
- package/src/modules/forms/migrations/Migration20260508135459_forms.ts +17 -0
- package/src/modules/forms/migrations/Migration20260508140932_forms.ts +26 -0
- package/src/modules/forms/migrations/Migration20260508155737_forms.ts +15 -0
- package/src/modules/forms/migrations/Migration20260520120000_forms.ts +26 -0
- package/src/modules/forms/migrations/Migration20260521090000_forms.ts +15 -0
- package/src/modules/forms/migrations/Migration20260521120000_forms.ts +21 -0
- package/src/modules/forms/runner/FormRunner.tsx +924 -0
- package/src/modules/forms/runner/MatrixField.tsx +210 -0
- package/src/modules/forms/runner/RankingField.tsx +207 -0
- package/src/modules/forms/runner/ScaleField.tsx +102 -0
- package/src/modules/forms/runner/SignatureField.tsx +158 -0
- package/src/modules/forms/runner/tamper-check.ts +131 -0
- package/src/modules/forms/schema/address-countries.ts +60 -0
- package/src/modules/forms/schema/field-type-patterns.ts +21 -0
- package/src/modules/forms/schema/field-type-registry-advanced.ts +58 -0
- package/src/modules/forms/schema/field-type-registry.ts +819 -0
- package/src/modules/forms/schema/file-field.ts +102 -0
- package/src/modules/forms/schema/group-field.ts +235 -0
- package/src/modules/forms/schema/jsonlogic-grammar.ts +95 -0
- package/src/modules/forms/schema/jsonschema-extensions.ts +1060 -0
- package/src/modules/forms/schema/layout-catalog.ts +68 -0
- package/src/modules/forms/schema/signature-field.ts +120 -0
- package/src/modules/forms/schema/style-extensions.ts +194 -0
- package/src/modules/forms/schema/style-validators.ts +252 -0
- package/src/modules/forms/services/access-audit-logger.ts +275 -0
- package/src/modules/forms/services/analytics-service.ts +498 -0
- package/src/modules/forms/services/anonymize-service.ts +177 -0
- package/src/modules/forms/services/attachment-service.ts +223 -0
- package/src/modules/forms/services/captcha-verifier.ts +156 -0
- package/src/modules/forms/services/consent-record-service.ts +162 -0
- package/src/modules/forms/services/distribution-service.ts +509 -0
- package/src/modules/forms/services/distribution-token.ts +153 -0
- package/src/modules/forms/services/encryption-service.ts +500 -0
- package/src/modules/forms/services/export-service.ts +360 -0
- package/src/modules/forms/services/field-validation-service.ts +300 -0
- package/src/modules/forms/services/form-logic-evaluator.ts +718 -0
- package/src/modules/forms/services/form-version-compiler.ts +829 -0
- package/src/modules/forms/services/form-version-differ.ts +143 -0
- package/src/modules/forms/services/jsonlogic-evaluator.ts +228 -0
- package/src/modules/forms/services/pdf-snapshot-service.ts +782 -0
- package/src/modules/forms/services/prefill-resolver.ts +125 -0
- package/src/modules/forms/services/role-policy-service.ts +90 -0
- package/src/modules/forms/services/style-compiler.ts +378 -0
- package/src/modules/forms/services/submission-service.ts +1259 -0
- package/src/modules/forms/services/upload-scanner.ts +36 -0
- package/src/modules/forms/services/upload-validation.ts +94 -0
- package/src/modules/forms/services/visibility-resolver.ts +63 -0
- package/src/modules/forms/setup.ts +16 -0
- package/src/modules/forms/subscribers/forms-consent-projector.ts +100 -0
- package/src/modules/forms/subscribers/forms-pdf-snapshot.ts +112 -0
- package/src/modules/forms/subscribers/forms-webhook-bridge-anonymized.ts +36 -0
- package/src/modules/forms/subscribers/forms-webhook-bridge.ts +56 -0
- package/src/modules/forms/subscribers/invitation-email.ts +180 -0
- package/src/modules/forms/translations.ts +14 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/CreateDistributionDialog.tsx +401 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/DistributionsPanel.tsx +381 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/EmbedSettingsDialog.tsx +332 -0
- package/src/modules/forms/ui/admin/forms/[id]/distributions/RecipientsTable.tsx +460 -0
- package/src/modules/forms/ui/public/EmbeddedForm.tsx +248 -0
- package/src/modules/forms/ui/public/FormRunner.tsx +491 -0
- package/src/modules/forms/ui/public/FormTrigger.tsx +80 -0
- package/src/modules/forms/ui/public/PublicFormRunnerPage.tsx +34 -0
- package/src/modules/forms/ui/public/components/CompletionScreen.tsx +97 -0
- package/src/modules/forms/ui/public/components/LocaleSwitch.tsx +42 -0
- package/src/modules/forms/ui/public/components/ResumeGate.tsx +61 -0
- package/src/modules/forms/ui/public/components/ReviewStep.tsx +153 -0
- package/src/modules/forms/ui/public/components/SaveIndicator.tsx +69 -0
- package/src/modules/forms/ui/public/components/SectionStepper.tsx +60 -0
- package/src/modules/forms/ui/public/index.ts +48 -0
- package/src/modules/forms/ui/public/renderers/index.tsx +889 -0
- package/src/modules/forms/ui/public/state/logic-derivation.ts +91 -0
- package/src/modules/forms/ui/public/state/runtime-client.ts +495 -0
- package/src/modules/forms/ui/public/state/useAutosave.ts +97 -0
- package/src/modules/forms/ui/public/state/useFormRunner.ts +547 -0
- package/src/modules/forms/ui/public/style/LogoHeader.tsx +43 -0
- package/src/modules/forms/ui/public/style/applyStyle.ts +26 -0
- package/src/modules/forms/ui/public/types.ts +228 -0
- package/src/modules/forms/widgets/injection/access-audit-panel/widget.tsx +144 -0
- package/src/modules/forms/widgets/injection/anonymize-button/widget.tsx +177 -0
- package/src/modules/forms/widgets/injection/audit-format.ts +60 -0
- package/src/modules/forms/widgets/injection/context.ts +24 -0
- package/src/modules/forms/widgets/injection/embedded-form/widget.tsx +102 -0
- package/src/modules/forms/widgets/injection/pdf-download-button/widget.tsx +111 -0
- package/src/modules/forms/widgets/injection/self-audit-footer/widget.tsx +56 -0
- package/src/modules/forms/widgets/injection-table.ts +54 -0
- package/src/modules/forms/workers/pdf-snapshot.ts +110 -0
- package/src/modules/forms/workers/retention-purge.ts +169 -0
- package/src/modules/inbox_ops/api/proposals/[id]/actions/[actionId]/route.ts +7 -1
- package/src/modules/inbox_ops/data/validators.ts +2 -1
- package/src/modules/inbox_ops/lib/llmProvider.ts +11 -0
- package/src/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.tsx +2 -2
- package/src/modules/integrations/di.ts +5 -1
- package/src/modules/integrations/lib/credentials-service.ts +45 -36
- package/src/modules/messages/api/[id]/attachments/route.ts +12 -3
- package/src/modules/messages/api/[id]/forward-preview/route.ts +9 -3
- package/src/modules/messages/api/[id]/route.ts +83 -4
- package/src/modules/messages/api/route.ts +123 -2
- package/src/modules/messages/commands/messages.ts +81 -7
- package/src/modules/messages/components/ComposeMessagePageClient.tsx +29 -1
- package/src/modules/messages/data/validators.ts +10 -0
- package/src/modules/messages/i18n/de.json +8 -0
- package/src/modules/messages/i18n/en.json +8 -0
- package/src/modules/messages/i18n/es.json +8 -0
- package/src/modules/messages/i18n/ko.json +8 -0
- package/src/modules/messages/i18n/pl.json +8 -0
- package/src/modules/messages/lib/channelThreadAccess.ts +101 -0
- package/src/modules/messages/lib/composeSenderDelegation.ts +182 -0
- package/src/modules/messages/lib/composeSenderOptions.ts +56 -0
- package/src/modules/messages/lib/email-sender.ts +1 -17
- package/src/modules/messages/lib/forwarding.ts +17 -2
- package/src/modules/messages/lib/markdownEmailBody.ts +25 -0
- package/src/modules/messages/lib/messageSourceEntityTypes.ts +12 -0
- package/src/modules/messages/lib/routeHelpers.ts +92 -0
- package/src/modules/messages/subscribers/message-notification.ts +47 -1
- package/src/modules/notifications/api/[id]/action/route.ts +2 -1
- package/src/modules/notifications/api/openapi.ts +1 -0
- package/src/modules/notifications/frontend/NotificationSettingsPageClient.tsx +77 -48
- package/src/modules/notifications/i18n/de.json +1 -0
- package/src/modules/notifications/i18n/en.json +1 -0
- package/src/modules/notifications/i18n/es.json +1 -0
- package/src/modules/notifications/i18n/ko.json +1 -0
- package/src/modules/notifications/i18n/pl.json +1 -0
- package/src/modules/notifications/lib/deliveryConfig.ts +31 -2
- package/src/modules/notifications/lib/notificationMapper.ts +2 -0
- package/src/modules/notifications/lib/safeHref.ts +7 -0
- package/src/modules/planner/api/availability-date-specific.ts +2 -1
- package/src/modules/planner/api/availability-weekly.ts +2 -1
- package/src/modules/progress/AGENTS.md +2 -0
- package/src/modules/progress/api/active/route.ts +14 -2
- package/src/modules/progress/api/jobs/[id]/route.ts +44 -27
- package/src/modules/progress/api/jobs/route.ts +22 -8
- package/src/modules/progress/api/requestScope.ts +43 -0
- package/src/modules/progress/lib/organizationScope.ts +17 -0
- package/src/modules/progress/lib/progressService.ts +3 -2
- package/src/modules/progress/lib/progressServiceImpl.ts +63 -14
- package/src/modules/push_notifications/api/custom-send/route.ts +4 -1
- package/src/modules/query_index/api/status.ts +4 -9
- package/src/modules/query_index/di.ts +2 -1
- package/src/modules/query_index/lib/engine.ts +2 -0
- package/src/modules/query_index/lib/request-encryption.ts +31 -0
- package/src/modules/query_index/lib/search-tokens.ts +42 -1
- package/src/modules/resources/api/resources/tags/assign/route.ts +2 -1
- package/src/modules/resources/api/resources/tags/unassign/route.ts +2 -1
- package/src/modules/resources/commands/activities.ts +2 -2
- package/src/modules/sales/api/document-history/route.ts +5 -1
- package/src/modules/sales/api/document-numbers/route.ts +2 -1
- package/src/modules/sales/api/quotes/convert/route.ts +2 -1
- package/src/modules/sales/api/quotes/send/route.ts +2 -1
- package/src/modules/sales/api/settings/document-numbers/route.ts +7 -1
- package/src/modules/sales/api/settings/order-editing/route.ts +7 -1
- package/src/modules/sales/commands/documents.ts +451 -131
- package/src/modules/sales/commands/payments.ts +2 -1
- package/src/modules/sales/commands/settings.ts +34 -6
- package/src/modules/sales/commands/shipments.ts +2 -1
- package/src/modules/sales/components/DocumentNumberSettings.tsx +41 -28
- package/src/modules/sales/components/documents/ItemsSection.tsx +58 -13
- package/src/modules/sales/components/documents/LineItemDialog.tsx +194 -111
- package/src/modules/sales/components/documents/lineItemUtils.ts +18 -0
- package/src/modules/sales/i18n/de.json +2 -0
- package/src/modules/sales/i18n/en.json +2 -0
- package/src/modules/sales/i18n/es.json +2 -0
- package/src/modules/sales/i18n/ko.json +2 -0
- package/src/modules/sales/i18n/pl.json +2 -0
- package/src/modules/sales/lib/lineSnapshots.ts +36 -0
- package/src/modules/sales/setup.ts +4 -4
- package/src/modules/sales/widgets/notifications/SalesOrderCreatedRenderer.tsx +2 -2
- package/src/modules/sales/widgets/notifications/SalesQuoteCreatedRenderer.tsx +2 -2
- package/src/modules/staff/api/leave-requests/accept/route.ts +2 -1
- package/src/modules/staff/api/leave-requests/reject/route.ts +2 -1
- package/src/modules/staff/api/leave-requests.ts +2 -1
- package/src/modules/staff/api/team-members/self/route.ts +2 -1
- package/src/modules/staff/api/team-members/tags/assign/route.ts +2 -1
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +2 -1
- package/src/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.ts +16 -16
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +2 -1
- package/src/modules/staff/api/timesheets/my-projects/route.ts +2 -1
- package/src/modules/staff/api/timesheets/my-work/route.ts +2 -1
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +2 -1
- package/src/modules/staff/api/timesheets/reports/[id]/close/route.ts +2 -1
- package/src/modules/staff/api/timesheets/reports/[id]/export/route.ts +3 -2
- package/src/modules/staff/api/timesheets/reports/[id]/sheet/route.ts +3 -2
- package/src/modules/staff/api/timesheets/reports/[id]/unlock/route.ts +3 -2
- package/src/modules/staff/api/timesheets/reports/preview/route.ts +2 -1
- package/src/modules/staff/api/timesheets/reports/shared.ts +2 -1
- package/src/modules/staff/api/timesheets/settings/reapply-rounding/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tags/entry-assignments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tags/task-assignments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tasks/[id]/comments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/tasks/[id]/status/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/copy-day/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-entries/overlaps/route.ts +2 -1
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.ts +3 -2
- package/src/modules/staff/api/timesheets/time-projects/route.ts +2 -1
- package/src/modules/staff/commands/activities.ts +2 -2
- package/src/modules/staff/commands/timesheets-entries.ts +3 -2
- package/src/modules/staff/commands/timesheets-reports.ts +88 -15
- package/src/modules/staff/lib/timesheets-reports/buildReportSheet.ts +1 -0
- package/src/modules/staff/lib/timesheets-reports/loadReportData.ts +69 -8
- package/src/modules/staff/lib/timesheets-reports/reportPeriod.ts +18 -0
- package/src/modules/staff/lib/timesheets-ui/CalendarPicker.tsx +21 -10
- package/src/modules/sync_excel/api/import/route.ts +40 -12
- package/src/modules/sync_excel/api/upload/route.ts +34 -4
- package/src/modules/translations/api/context.ts +2 -1
- package/src/modules/warranty_claims/api/ai/assess/route.ts +2 -1
- package/src/modules/warranty_claims/api/ai/draft-reply/route.ts +2 -1
- package/src/modules/warranty_claims/api/ai/suggest/route.ts +2 -1
- package/src/modules/warranty_claims/api/assign/route.ts +2 -1
- package/src/modules/warranty_claims/api/credit-memo/route.ts +2 -1
- package/src/modules/warranty_claims/api/entitlement/route.ts +2 -1
- package/src/modules/warranty_claims/api/events/route.ts +2 -1
- package/src/modules/warranty_claims/api/external/claims/route.ts +2 -1
- package/src/modules/warranty_claims/api/receiving/route.ts +2 -1
- package/src/modules/warranty_claims/api/replacement-order/route.ts +2 -1
- package/src/modules/warranty_claims/api/return-label/route.ts +2 -1
- package/src/modules/warranty_claims/api/risk/route.ts +2 -1
- package/src/modules/warranty_claims/api/sales-return/route.ts +2 -1
- package/src/modules/warranty_claims/api/settings-general/route.ts +2 -1
- package/src/modules/warranty_claims/api/stats/route.ts +11 -11
- package/src/modules/warranty_claims/api/submit/route.ts +2 -1
- package/src/modules/warranty_claims/api/transition/route.ts +2 -1
- package/src/modules/warranty_claims/api/vendor-recovery/route.ts +2 -1
- package/src/modules/warranty_claims/api/vendor-recovery-suggestions/route.ts +2 -1
- package/src/modules/warranty_claims/widgets/notifications/WarrantyClaimNotificationRenderer.tsx +1 -1
- package/src/modules/wms/api/dashboard/operational/route.ts +2 -1
- package/src/modules/wms/api/inventory/cycle-count/route.ts +1 -0
- package/src/modules/wms/api/inventory/helpers.ts +2 -1
- package/src/modules/wms/api/inventory/import/helpers.ts +2 -1
- package/src/modules/wms/api/sales-orders/[salesOrderId]/warehouse-assignment/route.ts +2 -1
- package/src/modules/wms/commands/inventory-actions.ts +45 -1
- package/src/modules/wms/components/backend/CycleCountWizardDialog.tsx +14 -1
- package/src/modules/wms/di.ts +6 -0
- package/src/modules/wms/i18n/de.json +1 -0
- package/src/modules/wms/i18n/en.json +1 -0
- package/src/modules/wms/i18n/es.json +1 -0
- package/src/modules/wms/i18n/ko.json +1 -0
- package/src/modules/wms/i18n/pl.json +1 -0
- package/src/modules/wms/lib/availabilityCache.ts +137 -0
- package/src/modules/wms/lib/availabilityCalculation.ts +351 -0
- package/src/modules/wms/lib/availabilityProvider.ts +47 -0
- package/src/modules/wms/lib/loadOperationalDashboard.ts +51 -3
- package/src/modules/wms/lib/lowStockBalanceFilter.ts +23 -10
- package/src/modules/wms/lib/sqlInClause.ts +21 -0
- package/src/modules/wms/lib/tryResolve.ts +8 -0
- package/src/modules/wms/subscribers/invalidate-availability-cache-policy.ts +18 -0
- package/src/modules/wms/subscribers/invalidate-availability-cache-profile.ts +18 -0
- package/src/modules/wms/subscribers/invalidate-availability-cache.ts +30 -0
- package/src/modules/wms/widgets/notifications/WmsLowStockRenderer.tsx +2 -2
- package/src/modules/wms/widgets/notifications/WmsReservationShortfallRenderer.tsx +4 -3
- package/src/modules/workflows/AGENTS.md +7 -5
- package/src/modules/workflows/api/commands/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/callers/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/context-schema/route.ts +4 -2
- package/src/modules/workflows/api/definitions/[id]/customize/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/draft/route.ts +6 -1
- package/src/modules/workflows/api/definitions/[id]/publish/route.ts +10 -1
- package/src/modules/workflows/api/definitions/[id]/reset-to-code/route.ts +4 -1
- package/src/modules/workflows/api/definitions/[id]/route.ts +5 -3
- package/src/modules/workflows/api/definitions/[id]/test-step/route.ts +4 -2
- package/src/modules/workflows/api/definitions/generate/route.ts +4 -1
- package/src/modules/workflows/api/definitions/route.ts +4 -2
- package/src/modules/workflows/api/endpoints/route.ts +4 -1
- package/src/modules/workflows/api/functions/route.ts +4 -1
- package/src/modules/workflows/api/grantable-features/route.ts +2 -1
- package/src/modules/workflows/api/instances/[id]/advance/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/cancel/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/context/route.ts +2 -1
- package/src/modules/workflows/api/instances/[id]/rerun-step/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/retry/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/signal/route.ts +4 -1
- package/src/modules/workflows/api/instances/[id]/step-through/route.ts +4 -2
- package/src/modules/workflows/api/instances/route.ts +4 -2
- package/src/modules/workflows/api/instances/validate-start/route.ts +4 -1
- package/src/modules/workflows/api/rule-usage/route.ts +4 -1
- package/src/modules/workflows/api/signals/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/claim/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/complete/route.ts +4 -1
- package/src/modules/workflows/api/tasks/[id]/reassign/route.ts +2 -1
- package/src/modules/workflows/api/tasks/[id]/unclaim/route.ts +4 -1
- package/src/modules/workflows/api/templates/route.ts +4 -1
- package/src/modules/workflows/api/work-inbox/next/route.ts +4 -1
- package/src/modules/workflows/lib/activity-executor.ts +125 -28
- package/src/modules/workflows/lib/activity-types.ts +8 -4
- package/src/modules/workflows/lib/activity-worker-handler.ts +16 -12
- package/src/modules/workflows/lib/event-trigger-service.ts +18 -2
- package/src/modules/workflows/lib/step-handler.ts +13 -8
- package/src/test-utils/transactionalEntityManagerDouble.ts +51 -0
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import {
|
|
3
|
+
PDFDocument,
|
|
4
|
+
StandardFonts,
|
|
5
|
+
rgb
|
|
6
|
+
} from "pdf-lib";
|
|
7
|
+
import {
|
|
8
|
+
Form,
|
|
9
|
+
FormAttachment,
|
|
10
|
+
FormSubmission,
|
|
11
|
+
FormSubmissionRevision,
|
|
12
|
+
FormVersion
|
|
13
|
+
} from "../data/entities.js";
|
|
14
|
+
import {
|
|
15
|
+
defaultFieldTypeRegistry
|
|
16
|
+
} from "../schema/field-type-registry.js";
|
|
17
|
+
import { SIGNATURE_TYPE_KEY } from "../schema/signature-field.js";
|
|
18
|
+
class PdfSnapshotServiceError extends Error {
|
|
19
|
+
constructor(code, message, httpStatus) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.name = "PdfSnapshotServiceError";
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.httpStatus = httpStatus;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const SNAPSHOT_FIELD_KEY = "__snapshot__";
|
|
27
|
+
const SNAPSHOT_CONTENT_TYPE = "application/pdf";
|
|
28
|
+
class PdfSnapshotService {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
this.emFactory = options.emFactory;
|
|
31
|
+
this.encryption = options.encryptionService;
|
|
32
|
+
this.registry = options.registry ?? defaultFieldTypeRegistry;
|
|
33
|
+
this.emitEvent = options.emitEvent;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Ensures a snapshot exists for the submission and returns the decrypted
|
|
37
|
+
* bytes. Idempotent: if `pdfSnapshotAttachmentId` is already set, the stored
|
|
38
|
+
* snapshot is returned verbatim (never re-rendered). Otherwise the snapshot
|
|
39
|
+
* is built, encrypted, persisted, linked, and `forms.attachment.uploaded` is
|
|
40
|
+
* emitted.
|
|
41
|
+
*/
|
|
42
|
+
async ensureSnapshot(args) {
|
|
43
|
+
const em = this.emFactory();
|
|
44
|
+
const submission = await em.findOne(FormSubmission, {
|
|
45
|
+
id: args.submissionId,
|
|
46
|
+
organizationId: args.organizationId,
|
|
47
|
+
tenantId: args.tenantId,
|
|
48
|
+
deletedAt: null
|
|
49
|
+
});
|
|
50
|
+
if (!submission) {
|
|
51
|
+
throw new PdfSnapshotServiceError("NOT_FOUND", "Submission not found.", 404);
|
|
52
|
+
}
|
|
53
|
+
if (submission.status !== "submitted") {
|
|
54
|
+
throw new PdfSnapshotServiceError("NOT_SUBMITTED", "Submission is not submitted.", 409);
|
|
55
|
+
}
|
|
56
|
+
if (submission.pdfSnapshotAttachmentId) {
|
|
57
|
+
const existing = await this.readStored(em, args, submission.pdfSnapshotAttachmentId);
|
|
58
|
+
if (existing) return existing;
|
|
59
|
+
}
|
|
60
|
+
const built = await this.buildAndStore(em, args, submission);
|
|
61
|
+
return built;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Reads + decrypts an already-generated snapshot. Returns null when no
|
|
65
|
+
* snapshot exists (caller decides whether to generate). Cross-tenant ids and
|
|
66
|
+
* removed rows resolve to null (no enumeration signal).
|
|
67
|
+
*/
|
|
68
|
+
async readSnapshot(args) {
|
|
69
|
+
const em = this.emFactory();
|
|
70
|
+
const submission = await em.findOne(FormSubmission, {
|
|
71
|
+
id: args.submissionId,
|
|
72
|
+
organizationId: args.organizationId,
|
|
73
|
+
tenantId: args.tenantId,
|
|
74
|
+
deletedAt: null
|
|
75
|
+
});
|
|
76
|
+
if (!submission || !submission.pdfSnapshotAttachmentId) return null;
|
|
77
|
+
return this.readStored(em, args, submission.pdfSnapshotAttachmentId);
|
|
78
|
+
}
|
|
79
|
+
async readStored(em, args, attachmentId) {
|
|
80
|
+
const attachment = await em.findOne(FormAttachment, {
|
|
81
|
+
id: attachmentId,
|
|
82
|
+
organizationId: args.organizationId,
|
|
83
|
+
kind: "snapshot",
|
|
84
|
+
removedAt: null
|
|
85
|
+
});
|
|
86
|
+
if (!attachment || !attachment.payloadInline) return null;
|
|
87
|
+
const ciphertext = Buffer.isBuffer(attachment.payloadInline) ? attachment.payloadInline : Buffer.from(attachment.payloadInline);
|
|
88
|
+
const bytes = await this.encryption.decrypt(args.organizationId, ciphertext);
|
|
89
|
+
return {
|
|
90
|
+
attachmentId: attachment.id,
|
|
91
|
+
filename: attachment.filename ?? `submission-${attachment.submissionId}.pdf`,
|
|
92
|
+
contentType: attachment.contentType ?? SNAPSHOT_CONTENT_TYPE,
|
|
93
|
+
sizeBytes: attachment.sizeBytes ?? bytes.length,
|
|
94
|
+
bytes
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
async buildAndStore(em, args, submission) {
|
|
98
|
+
const formVersion = await em.findOne(FormVersion, {
|
|
99
|
+
id: submission.formVersionId,
|
|
100
|
+
organizationId: args.organizationId,
|
|
101
|
+
tenantId: args.tenantId
|
|
102
|
+
});
|
|
103
|
+
if (!formVersion) {
|
|
104
|
+
throw new PdfSnapshotServiceError("NOT_FOUND", "Form version not found.", 404);
|
|
105
|
+
}
|
|
106
|
+
const form = await em.findOne(Form, {
|
|
107
|
+
id: formVersion.formId,
|
|
108
|
+
organizationId: args.organizationId,
|
|
109
|
+
tenantId: args.tenantId
|
|
110
|
+
});
|
|
111
|
+
const revision = submission.currentRevisionId ? await em.findOne(FormSubmissionRevision, {
|
|
112
|
+
id: submission.currentRevisionId,
|
|
113
|
+
submissionId: submission.id,
|
|
114
|
+
organizationId: args.organizationId
|
|
115
|
+
}) : null;
|
|
116
|
+
if (!revision) {
|
|
117
|
+
throw new PdfSnapshotServiceError("NOT_FOUND", "Current revision not found.", 404);
|
|
118
|
+
}
|
|
119
|
+
const answers = await this.decodeRevision(args.organizationId, revision);
|
|
120
|
+
const document = buildSnapshotDocument({
|
|
121
|
+
form,
|
|
122
|
+
formVersion,
|
|
123
|
+
submission,
|
|
124
|
+
answers,
|
|
125
|
+
registry: this.registry
|
|
126
|
+
});
|
|
127
|
+
const bytes = await renderDocumentToPdf(document);
|
|
128
|
+
const filename = `submission-${submission.id}-v${formVersion.versionNumber}.pdf`;
|
|
129
|
+
const ciphertext = await this.encryption.encrypt(args.organizationId, bytes);
|
|
130
|
+
const attachmentId = randomUUID();
|
|
131
|
+
const attachment = em.create(FormAttachment, {
|
|
132
|
+
id: attachmentId,
|
|
133
|
+
submissionId: submission.id,
|
|
134
|
+
organizationId: args.organizationId,
|
|
135
|
+
fieldKey: SNAPSHOT_FIELD_KEY,
|
|
136
|
+
kind: "snapshot",
|
|
137
|
+
payloadInline: ciphertext,
|
|
138
|
+
contentType: SNAPSHOT_CONTENT_TYPE,
|
|
139
|
+
filename,
|
|
140
|
+
sizeBytes: bytes.length,
|
|
141
|
+
uploadedBy: submission.submittedBy ?? null,
|
|
142
|
+
uploadedAt: /* @__PURE__ */ new Date()
|
|
143
|
+
});
|
|
144
|
+
em.persist(attachment);
|
|
145
|
+
submission.pdfSnapshotAttachmentId = attachmentId;
|
|
146
|
+
await em.flush();
|
|
147
|
+
if (this.emitEvent) {
|
|
148
|
+
await this.emitEvent("forms.attachment.uploaded", {
|
|
149
|
+
attachmentId,
|
|
150
|
+
submissionId: submission.id
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
attachmentId,
|
|
155
|
+
filename,
|
|
156
|
+
contentType: SNAPSHOT_CONTENT_TYPE,
|
|
157
|
+
sizeBytes: bytes.length,
|
|
158
|
+
bytes
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async decodeRevision(organizationId, revision) {
|
|
162
|
+
const ciphertext = Buffer.isBuffer(revision.data) ? revision.data : Buffer.from(revision.data);
|
|
163
|
+
if (ciphertext.length === 0) return {};
|
|
164
|
+
const plain = await this.encryption.decrypt(organizationId, ciphertext);
|
|
165
|
+
if (plain.length === 0) return {};
|
|
166
|
+
try {
|
|
167
|
+
const parsed = JSON.parse(plain.toString("utf8"));
|
|
168
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
169
|
+
} catch {
|
|
170
|
+
return {};
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function buildSnapshotDocument(args) {
|
|
175
|
+
const { formVersion, submission, answers } = args;
|
|
176
|
+
const registry = args.registry ?? defaultFieldTypeRegistry;
|
|
177
|
+
const schema = formVersion.schema ?? {};
|
|
178
|
+
const locale = resolveDefaultLocale(args.form, schema);
|
|
179
|
+
const properties = isRecord(schema.properties) ? schema.properties : {};
|
|
180
|
+
const sections = readSchemaSections(schema);
|
|
181
|
+
const seen = /* @__PURE__ */ new Set();
|
|
182
|
+
const renderedSections = [];
|
|
183
|
+
for (const section of sections) {
|
|
184
|
+
const fields = [];
|
|
185
|
+
for (const fieldKey of section.fieldKeys) {
|
|
186
|
+
seen.add(fieldKey);
|
|
187
|
+
const node = isRecord(properties[fieldKey]) ? properties[fieldKey] : null;
|
|
188
|
+
if (!node) continue;
|
|
189
|
+
const field = buildSnapshotField(fieldKey, node, answers[fieldKey], locale, registry);
|
|
190
|
+
if (field) fields.push(field);
|
|
191
|
+
}
|
|
192
|
+
if (fields.length > 0) {
|
|
193
|
+
renderedSections.push({
|
|
194
|
+
key: section.key,
|
|
195
|
+
title: resolveLocalized(section.title, locale) || section.key,
|
|
196
|
+
fields
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const leftover = [];
|
|
201
|
+
for (const fieldKey of Object.keys(properties)) {
|
|
202
|
+
if (seen.has(fieldKey)) continue;
|
|
203
|
+
const node = isRecord(properties[fieldKey]) ? properties[fieldKey] : null;
|
|
204
|
+
if (!node) continue;
|
|
205
|
+
const field = buildSnapshotField(fieldKey, node, answers[fieldKey], locale, registry);
|
|
206
|
+
if (field) leftover.push(field);
|
|
207
|
+
}
|
|
208
|
+
if (leftover.length > 0) {
|
|
209
|
+
renderedSections.push({ key: "__fields__", title: "", fields: leftover });
|
|
210
|
+
}
|
|
211
|
+
return {
|
|
212
|
+
formName: args.form?.name ?? schemaTitle(schema) ?? "Form",
|
|
213
|
+
versionNumber: formVersion.versionNumber,
|
|
214
|
+
locale,
|
|
215
|
+
sections: renderedSections,
|
|
216
|
+
audit: buildAuditBlock(submission, formVersion)
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function buildSnapshotField(fieldKey, node, rawValue, locale, registry) {
|
|
220
|
+
const type = typeof node["x-om-type"] === "string" ? node["x-om-type"] : "text";
|
|
221
|
+
const spec = registry.get(type);
|
|
222
|
+
if (spec?.category === "layout") return null;
|
|
223
|
+
const label = resolveLocalized(node["x-om-label"], locale) || fieldKey;
|
|
224
|
+
if (type === SIGNATURE_TYPE_KEY) {
|
|
225
|
+
return {
|
|
226
|
+
key: fieldKey,
|
|
227
|
+
label,
|
|
228
|
+
type,
|
|
229
|
+
answer: spec ? spec.exportAdapter(rawValue, node) : "",
|
|
230
|
+
signature: buildSignatureEvidence(node, rawValue, locale)
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
const answer = spec ? spec.exportAdapter(rawValue, node) : stringifyFallback(rawValue);
|
|
234
|
+
return { key: fieldKey, label, type, answer };
|
|
235
|
+
}
|
|
236
|
+
function buildSignatureEvidence(node, rawValue, locale) {
|
|
237
|
+
if (!isRecord(rawValue)) return void 0;
|
|
238
|
+
const value = rawValue;
|
|
239
|
+
if (value.mode !== "drawn" && value.mode !== "typed") return void 0;
|
|
240
|
+
const clause = resolveLocalized(
|
|
241
|
+
node["x-om-consent-clause"],
|
|
242
|
+
locale
|
|
243
|
+
);
|
|
244
|
+
return {
|
|
245
|
+
mode: value.mode,
|
|
246
|
+
typedName: typeof value.typedName === "string" ? value.typedName : null,
|
|
247
|
+
imageDataUrl: typeof value.image === "string" && value.image.length > 0 ? value.image : null,
|
|
248
|
+
clauseText: clause.length > 0 ? clause : null,
|
|
249
|
+
clauseSha256: typeof value.clauseSha256 === "string" ? value.clauseSha256 : "",
|
|
250
|
+
signedAt: typeof value.signedAt === "string" ? value.signedAt : ""
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function buildAuditBlock(submission, formVersion) {
|
|
254
|
+
const metadata = isRecord(submission.submitMetadata) ? submission.submitMetadata : {};
|
|
255
|
+
const submittedAtUtc = submission.submittedAt ? submission.submittedAt.toISOString() : readString(metadata.serverSubmittedAt);
|
|
256
|
+
return {
|
|
257
|
+
submissionId: submission.id,
|
|
258
|
+
submittedBy: submission.submittedBy ?? null,
|
|
259
|
+
submittedAtUtc: submittedAtUtc ?? null,
|
|
260
|
+
ip: readString(metadata.ip),
|
|
261
|
+
userAgent: readString(metadata.userAgent),
|
|
262
|
+
formVersionId: formVersion.id,
|
|
263
|
+
schemaHash: formVersion.schemaHash,
|
|
264
|
+
organizationId: submission.organizationId
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
const PAGE_WIDTH = 595.28;
|
|
268
|
+
const PAGE_HEIGHT = 841.89;
|
|
269
|
+
const MARGIN = 50;
|
|
270
|
+
const CONTENT_WIDTH = PAGE_WIDTH - MARGIN * 2;
|
|
271
|
+
async function renderDocumentToPdf(document) {
|
|
272
|
+
const doc = await PDFDocument.create();
|
|
273
|
+
const font = await doc.embedFont(StandardFonts.Helvetica);
|
|
274
|
+
const bold = await doc.embedFont(StandardFonts.HelveticaBold);
|
|
275
|
+
const images = await embedSignatureImages(doc, document);
|
|
276
|
+
const cursor = { doc, page: addPage(doc), y: PAGE_HEIGHT - MARGIN, font, bold, images };
|
|
277
|
+
drawText(cursor, document.formName, { size: 18, font: bold });
|
|
278
|
+
drawText(cursor, `Version ${document.versionNumber}`, { size: 10, color: rgb(0.4, 0.4, 0.4) });
|
|
279
|
+
drawText(cursor, `Organization ${document.audit.organizationId}`, {
|
|
280
|
+
size: 9,
|
|
281
|
+
color: rgb(0.4, 0.4, 0.4)
|
|
282
|
+
});
|
|
283
|
+
advance(cursor, 8);
|
|
284
|
+
for (const section of document.sections) {
|
|
285
|
+
ensureSpace(cursor, 60);
|
|
286
|
+
if (section.title) {
|
|
287
|
+
drawDivider(cursor);
|
|
288
|
+
drawText(cursor, section.title, { size: 13, font: bold });
|
|
289
|
+
advance(cursor, 2);
|
|
290
|
+
}
|
|
291
|
+
for (const field of section.fields) {
|
|
292
|
+
renderField(cursor, field);
|
|
293
|
+
}
|
|
294
|
+
advance(cursor, 6);
|
|
295
|
+
}
|
|
296
|
+
drawDivider(cursor);
|
|
297
|
+
drawText(cursor, "Audit", { size: 13, font: bold });
|
|
298
|
+
advance(cursor, 2);
|
|
299
|
+
renderAuditLine(cursor, "Submission ID", document.audit.submissionId);
|
|
300
|
+
renderAuditLine(cursor, "Submitted by", document.audit.submittedBy ?? "\u2014");
|
|
301
|
+
renderAuditLine(cursor, "Submitted at (UTC)", document.audit.submittedAtUtc ?? "\u2014");
|
|
302
|
+
renderAuditLine(cursor, "IP address", document.audit.ip ?? "\u2014");
|
|
303
|
+
renderAuditLine(cursor, "User agent", document.audit.userAgent ?? "\u2014");
|
|
304
|
+
renderAuditLine(cursor, "Form version ID", document.audit.formVersionId);
|
|
305
|
+
renderAuditLine(cursor, "Schema hash", document.audit.schemaHash);
|
|
306
|
+
const saved = await doc.save();
|
|
307
|
+
return Buffer.from(saved);
|
|
308
|
+
}
|
|
309
|
+
function renderField(cursor, field) {
|
|
310
|
+
ensureSpace(cursor, 40);
|
|
311
|
+
drawText(cursor, field.label, { size: 10, font: cursor.bold });
|
|
312
|
+
if (field.signature) {
|
|
313
|
+
renderSignature(cursor, field.signature);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const answer = field.answer.trim().length > 0 ? field.answer : "\u2014";
|
|
317
|
+
drawText(cursor, answer, { size: 10 });
|
|
318
|
+
advance(cursor, 4);
|
|
319
|
+
}
|
|
320
|
+
function renderSignature(cursor, signature) {
|
|
321
|
+
if (signature.clauseText) {
|
|
322
|
+
drawText(cursor, signature.clauseText, { size: 9, color: rgb(0.3, 0.3, 0.3) });
|
|
323
|
+
}
|
|
324
|
+
if (signature.mode === "drawn" && signature.imageDataUrl) {
|
|
325
|
+
const embedded = cursor.images.get(signature.imageDataUrl);
|
|
326
|
+
if (embedded) {
|
|
327
|
+
const maxWidth = 220;
|
|
328
|
+
const scaled = embedded.scaleToFit(maxWidth, 90);
|
|
329
|
+
ensureSpace(cursor, scaled.height + 8);
|
|
330
|
+
cursor.page.drawImage(embedded, {
|
|
331
|
+
x: MARGIN,
|
|
332
|
+
y: cursor.y - scaled.height,
|
|
333
|
+
width: scaled.width,
|
|
334
|
+
height: scaled.height
|
|
335
|
+
});
|
|
336
|
+
cursor.y -= scaled.height + 4;
|
|
337
|
+
} else {
|
|
338
|
+
drawText(cursor, "[signature image]", { size: 9, color: rgb(0.4, 0.4, 0.4) });
|
|
339
|
+
}
|
|
340
|
+
} else {
|
|
341
|
+
drawText(cursor, `Signed (typed): ${signature.typedName ?? ""}`, { size: 10 });
|
|
342
|
+
}
|
|
343
|
+
drawText(cursor, `Signed at: ${signature.signedAt || "\u2014"}`, {
|
|
344
|
+
size: 8,
|
|
345
|
+
color: rgb(0.4, 0.4, 0.4)
|
|
346
|
+
});
|
|
347
|
+
drawText(cursor, `Clause SHA-256: ${signature.clauseSha256 || "\u2014"}`, {
|
|
348
|
+
size: 8,
|
|
349
|
+
color: rgb(0.4, 0.4, 0.4)
|
|
350
|
+
});
|
|
351
|
+
advance(cursor, 6);
|
|
352
|
+
}
|
|
353
|
+
async function embedSignatureImages(doc, document) {
|
|
354
|
+
const images = /* @__PURE__ */ new Map();
|
|
355
|
+
for (const section of document.sections) {
|
|
356
|
+
for (const field of section.fields) {
|
|
357
|
+
const dataUrl = field.signature?.imageDataUrl;
|
|
358
|
+
if (!dataUrl || images.has(dataUrl)) continue;
|
|
359
|
+
const embedded = await embedSignatureImage(doc, dataUrl);
|
|
360
|
+
if (embedded) images.set(dataUrl, embedded);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return images;
|
|
364
|
+
}
|
|
365
|
+
async function embedSignatureImage(doc, dataUrl) {
|
|
366
|
+
const match = /^data:image\/(png|jpeg|jpg);base64,(.+)$/i.exec(dataUrl.trim());
|
|
367
|
+
if (!match) return null;
|
|
368
|
+
const kind = match[1].toLowerCase();
|
|
369
|
+
let bytes;
|
|
370
|
+
try {
|
|
371
|
+
bytes = Buffer.from(match[2], "base64");
|
|
372
|
+
} catch {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
try {
|
|
376
|
+
return kind === "png" ? await doc.embedPng(bytes) : await doc.embedJpg(bytes);
|
|
377
|
+
} catch {
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function renderAuditLine(cursor, label, value) {
|
|
382
|
+
ensureSpace(cursor, 16);
|
|
383
|
+
drawText(cursor, `${label}: ${value}`, { size: 9, color: rgb(0.25, 0.25, 0.25) });
|
|
384
|
+
}
|
|
385
|
+
function drawText(cursor, text, options) {
|
|
386
|
+
const font = options.font ?? cursor.font;
|
|
387
|
+
const lines = wrapText(text, font, options.size, CONTENT_WIDTH);
|
|
388
|
+
const lineHeight = options.size + 4;
|
|
389
|
+
for (const line of lines) {
|
|
390
|
+
ensureSpace(cursor, lineHeight);
|
|
391
|
+
cursor.page.drawText(line, {
|
|
392
|
+
x: MARGIN,
|
|
393
|
+
y: cursor.y - options.size,
|
|
394
|
+
size: options.size,
|
|
395
|
+
font,
|
|
396
|
+
color: options.color ?? rgb(0.1, 0.1, 0.1)
|
|
397
|
+
});
|
|
398
|
+
cursor.y -= lineHeight;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function drawDivider(cursor) {
|
|
402
|
+
ensureSpace(cursor, 12);
|
|
403
|
+
cursor.page.drawLine({
|
|
404
|
+
start: { x: MARGIN, y: cursor.y },
|
|
405
|
+
end: { x: PAGE_WIDTH - MARGIN, y: cursor.y },
|
|
406
|
+
thickness: 0.5,
|
|
407
|
+
color: rgb(0.8, 0.8, 0.8)
|
|
408
|
+
});
|
|
409
|
+
cursor.y -= 10;
|
|
410
|
+
}
|
|
411
|
+
function advance(cursor, amount) {
|
|
412
|
+
cursor.y -= amount;
|
|
413
|
+
}
|
|
414
|
+
function ensureSpace(cursor, needed) {
|
|
415
|
+
if (cursor.y - needed < MARGIN) {
|
|
416
|
+
cursor.page = addPage(cursor.doc);
|
|
417
|
+
cursor.y = PAGE_HEIGHT - MARGIN;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function addPage(doc) {
|
|
421
|
+
return doc.addPage([PAGE_WIDTH, PAGE_HEIGHT]);
|
|
422
|
+
}
|
|
423
|
+
function wrapText(text, font, size, maxWidth) {
|
|
424
|
+
const sanitized = sanitizeForWinAnsi(text);
|
|
425
|
+
const result = [];
|
|
426
|
+
for (const rawLine of sanitized.split("\n")) {
|
|
427
|
+
const words = rawLine.split(/\s+/).filter((entry) => entry.length > 0);
|
|
428
|
+
if (words.length === 0) {
|
|
429
|
+
result.push("");
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
let current = "";
|
|
433
|
+
for (const word of words) {
|
|
434
|
+
const candidate = current.length === 0 ? word : `${current} ${word}`;
|
|
435
|
+
if (font.widthOfTextAtSize(candidate, size) <= maxWidth) {
|
|
436
|
+
current = candidate;
|
|
437
|
+
continue;
|
|
438
|
+
}
|
|
439
|
+
if (current.length > 0) result.push(current);
|
|
440
|
+
if (font.widthOfTextAtSize(word, size) <= maxWidth) {
|
|
441
|
+
current = word;
|
|
442
|
+
} else {
|
|
443
|
+
for (const chunk of splitWideToken(word, font, size, maxWidth)) result.push(chunk);
|
|
444
|
+
current = "";
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
if (current.length > 0) result.push(current);
|
|
448
|
+
}
|
|
449
|
+
return result.length > 0 ? result : [""];
|
|
450
|
+
}
|
|
451
|
+
function splitWideToken(token, font, size, maxWidth) {
|
|
452
|
+
const chunks = [];
|
|
453
|
+
let current = "";
|
|
454
|
+
for (const char of token) {
|
|
455
|
+
const candidate = current + char;
|
|
456
|
+
if (font.widthOfTextAtSize(candidate, size) > maxWidth && current.length > 0) {
|
|
457
|
+
chunks.push(current);
|
|
458
|
+
current = char;
|
|
459
|
+
} else {
|
|
460
|
+
current = candidate;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (current.length > 0) chunks.push(current);
|
|
464
|
+
return chunks;
|
|
465
|
+
}
|
|
466
|
+
function sanitizeForWinAnsi(text) {
|
|
467
|
+
return text.replace(/[^-ÿ]/g, "?");
|
|
468
|
+
}
|
|
469
|
+
function isRecord(value) {
|
|
470
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
471
|
+
}
|
|
472
|
+
function readString(value) {
|
|
473
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
474
|
+
}
|
|
475
|
+
function stringifyFallback(value) {
|
|
476
|
+
if (value === null || value === void 0) return "";
|
|
477
|
+
if (typeof value === "string") return value;
|
|
478
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
479
|
+
try {
|
|
480
|
+
return JSON.stringify(value);
|
|
481
|
+
} catch {
|
|
482
|
+
return "";
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
function resolveLocalized(map, locale) {
|
|
486
|
+
if (!isRecord(map)) return "";
|
|
487
|
+
const exact = map[locale];
|
|
488
|
+
if (typeof exact === "string" && exact.length > 0) return exact;
|
|
489
|
+
const en = map.en;
|
|
490
|
+
if (typeof en === "string" && en.length > 0) return en;
|
|
491
|
+
for (const value of Object.values(map)) {
|
|
492
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
493
|
+
}
|
|
494
|
+
return "";
|
|
495
|
+
}
|
|
496
|
+
function resolveDefaultLocale(form, schema) {
|
|
497
|
+
if (form?.defaultLocale) return form.defaultLocale;
|
|
498
|
+
const fromSchema = schema["x-om-default-locale"];
|
|
499
|
+
if (typeof fromSchema === "string" && fromSchema.length > 0) return fromSchema;
|
|
500
|
+
return "en";
|
|
501
|
+
}
|
|
502
|
+
function schemaTitle(schema) {
|
|
503
|
+
return readString(schema.title);
|
|
504
|
+
}
|
|
505
|
+
function readSchemaSections(schema) {
|
|
506
|
+
const raw = schema["x-om-sections"];
|
|
507
|
+
if (!Array.isArray(raw)) return [];
|
|
508
|
+
const result = [];
|
|
509
|
+
for (const entry of raw) {
|
|
510
|
+
if (!isRecord(entry)) continue;
|
|
511
|
+
if (typeof entry.key !== "string") continue;
|
|
512
|
+
result.push({
|
|
513
|
+
key: entry.key,
|
|
514
|
+
title: isRecord(entry.title) ? entry.title : void 0,
|
|
515
|
+
fieldKeys: Array.isArray(entry.fieldKeys) ? entry.fieldKeys.filter((value) => typeof value === "string") : []
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
return result;
|
|
519
|
+
}
|
|
520
|
+
export {
|
|
521
|
+
PdfSnapshotService,
|
|
522
|
+
PdfSnapshotServiceError,
|
|
523
|
+
buildSnapshotDocument,
|
|
524
|
+
renderDocumentToPdf
|
|
525
|
+
};
|
|
526
|
+
//# sourceMappingURL=pdf-snapshot-service.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/forms/services/pdf-snapshot-service.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * PDF snapshot service \u2014 W3 (CN-5 / CN-6 / DP-11; revives deferred phase 2b).\n *\n * Produces an immutable, exportable PDF that reproduces exactly what the\n * participant saw and signed, suitable for legal retention. The snapshot is\n * built ONCE \u2014 at submit time (via the `forms.submission.submitted` subscriber)\n * or lazily on first download \u2014 and stored as an encrypted `FormAttachment`\n * (`kind = 'snapshot'`). `FormSubmission.pdfSnapshotAttachmentId` links it.\n *\n * Idempotency: when `pdfSnapshotAttachmentId` is already set, the existing\n * attachment is returned and NO regeneration occurs (submissions are immutable\n * post-submit).\n *\n * Encryption-at-rest: snapshot bytes are wrapped with the per-tenant\n * `EncryptionService` \u2014 identical posture to user uploads (DP-1). The stored\n * `content_type` / `filename` / `size_bytes` are recorded verbatim.\n *\n * The renderer is split in two:\n * - `buildSnapshotDocument(...)` \u2014 a PURE function that produces the\n * rendering-engine-agnostic document model (form name, version, sections,\n * field labels + human-readable answers, signature evidence, audit block).\n * This is what the unit tests assert against.\n * - `renderDocumentToPdf(...)` \u2014 lays the model out with `pdf-lib`\n * (pure-JS, no native deps) and embeds any drawn signature PNG.\n */\n\nimport { randomUUID } from 'node:crypto'\nimport type { EntityManager } from '@mikro-orm/postgresql'\nimport {\n PDFDocument,\n StandardFonts,\n rgb,\n type PDFFont,\n type PDFImage,\n type PDFPage,\n} from 'pdf-lib'\nimport {\n Form,\n FormAttachment,\n FormSubmission,\n FormSubmissionRevision,\n FormVersion,\n} from '../data/entities'\nimport type { EncryptionService } from './encryption-service'\nimport {\n defaultFieldTypeRegistry,\n type FieldTypeRegistry,\n type FieldNode,\n} from '../schema/field-type-registry'\nimport { SIGNATURE_TYPE_KEY, type SignatureValue } from '../schema/signature-field'\n\ntype Scope = {\n organizationId: string\n tenantId: string\n}\n\nexport type PdfSnapshotServiceErrorCode = 'NOT_FOUND' | 'NOT_SUBMITTED'\n\nexport class PdfSnapshotServiceError extends Error {\n readonly code: PdfSnapshotServiceErrorCode\n readonly httpStatus: number\n\n constructor(code: PdfSnapshotServiceErrorCode, message: string, httpStatus: number) {\n super(message)\n this.name = 'PdfSnapshotServiceError'\n this.code = code\n this.httpStatus = httpStatus\n }\n}\n\n/** One rendered question/answer pair inside a section. */\nexport type SnapshotField = {\n key: string\n label: string\n type: string\n answer: string\n /** Signature evidence \u2014 present only for `signature`-typed fields. */\n signature?: SnapshotSignature\n}\n\nexport type SnapshotSignature = {\n mode: 'drawn' | 'typed'\n typedName: string | null\n /** PNG data URL for drawn mode (decoded + embedded by the renderer). */\n imageDataUrl: string | null\n clauseText: string | null\n clauseSha256: string\n signedAt: string\n}\n\nexport type SnapshotSection = {\n key: string\n title: string\n fields: SnapshotField[]\n}\n\nexport type SnapshotAuditBlock = {\n submissionId: string\n submittedBy: string | null\n submittedAtUtc: string | null\n ip: string | null\n userAgent: string | null\n formVersionId: string\n schemaHash: string\n organizationId: string\n}\n\n/** Rendering-engine-agnostic snapshot model \u2014 the unit-tested contract. */\nexport type SnapshotDocument = {\n formName: string\n versionNumber: number\n locale: string\n sections: SnapshotSection[]\n audit: SnapshotAuditBlock\n}\n\nexport type StoredSnapshot = {\n attachmentId: string\n filename: string\n contentType: string\n sizeBytes: number\n bytes: Buffer\n}\n\nexport type PdfSnapshotServiceOptions = {\n emFactory: () => EntityManager\n encryptionService: EncryptionService\n registry?: FieldTypeRegistry\n emitEvent?: (\n eventId: 'forms.attachment.uploaded',\n payload: { attachmentId: string; submissionId: string },\n ) => Promise<void> | void\n}\n\nconst SNAPSHOT_FIELD_KEY = '__snapshot__'\nconst SNAPSHOT_CONTENT_TYPE = 'application/pdf'\n\nexport class PdfSnapshotService {\n private readonly emFactory: () => EntityManager\n private readonly encryption: EncryptionService\n private readonly registry: FieldTypeRegistry\n private readonly emitEvent?: PdfSnapshotServiceOptions['emitEvent']\n\n constructor(options: PdfSnapshotServiceOptions) {\n this.emFactory = options.emFactory\n this.encryption = options.encryptionService\n this.registry = options.registry ?? defaultFieldTypeRegistry\n this.emitEvent = options.emitEvent\n }\n\n /**\n * Ensures a snapshot exists for the submission and returns the decrypted\n * bytes. Idempotent: if `pdfSnapshotAttachmentId` is already set, the stored\n * snapshot is returned verbatim (never re-rendered). Otherwise the snapshot\n * is built, encrypted, persisted, linked, and `forms.attachment.uploaded` is\n * emitted.\n */\n async ensureSnapshot(args: Scope & { submissionId: string }): Promise<StoredSnapshot> {\n const em = this.emFactory()\n const submission = await em.findOne(FormSubmission, {\n id: args.submissionId,\n organizationId: args.organizationId,\n tenantId: args.tenantId,\n deletedAt: null,\n })\n if (!submission) {\n throw new PdfSnapshotServiceError('NOT_FOUND', 'Submission not found.', 404)\n }\n if (submission.status !== 'submitted') {\n throw new PdfSnapshotServiceError('NOT_SUBMITTED', 'Submission is not submitted.', 409)\n }\n\n if (submission.pdfSnapshotAttachmentId) {\n const existing = await this.readStored(em, args, submission.pdfSnapshotAttachmentId)\n if (existing) return existing\n // Linked attachment row vanished \u2014 treat as unset and regenerate.\n }\n\n const built = await this.buildAndStore(em, args, submission)\n return built\n }\n\n /**\n * Reads + decrypts an already-generated snapshot. Returns null when no\n * snapshot exists (caller decides whether to generate). Cross-tenant ids and\n * removed rows resolve to null (no enumeration signal).\n */\n async readSnapshot(args: Scope & { submissionId: string }): Promise<StoredSnapshot | null> {\n const em = this.emFactory()\n const submission = await em.findOne(FormSubmission, {\n id: args.submissionId,\n organizationId: args.organizationId,\n tenantId: args.tenantId,\n deletedAt: null,\n })\n if (!submission || !submission.pdfSnapshotAttachmentId) return null\n return this.readStored(em, args, submission.pdfSnapshotAttachmentId)\n }\n\n private async readStored(\n em: EntityManager,\n args: Scope,\n attachmentId: string,\n ): Promise<StoredSnapshot | null> {\n const attachment = await em.findOne(FormAttachment, {\n id: attachmentId,\n organizationId: args.organizationId,\n kind: 'snapshot',\n removedAt: null,\n })\n if (!attachment || !attachment.payloadInline) return null\n const ciphertext = Buffer.isBuffer(attachment.payloadInline)\n ? attachment.payloadInline\n : Buffer.from(attachment.payloadInline as Uint8Array)\n const bytes = await this.encryption.decrypt(args.organizationId, ciphertext)\n return {\n attachmentId: attachment.id,\n filename: attachment.filename ?? `submission-${attachment.submissionId}.pdf`,\n contentType: attachment.contentType ?? SNAPSHOT_CONTENT_TYPE,\n sizeBytes: attachment.sizeBytes ?? bytes.length,\n bytes,\n }\n }\n\n private async buildAndStore(\n em: EntityManager,\n args: Scope & { submissionId: string },\n submission: FormSubmission,\n ): Promise<StoredSnapshot> {\n const formVersion = await em.findOne(FormVersion, {\n id: submission.formVersionId,\n organizationId: args.organizationId,\n tenantId: args.tenantId,\n })\n if (!formVersion) {\n throw new PdfSnapshotServiceError('NOT_FOUND', 'Form version not found.', 404)\n }\n const form = await em.findOne(Form, {\n id: formVersion.formId,\n organizationId: args.organizationId,\n tenantId: args.tenantId,\n })\n const revision = submission.currentRevisionId\n ? await em.findOne(FormSubmissionRevision, {\n id: submission.currentRevisionId,\n submissionId: submission.id,\n organizationId: args.organizationId,\n })\n : null\n if (!revision) {\n throw new PdfSnapshotServiceError('NOT_FOUND', 'Current revision not found.', 404)\n }\n const answers = await this.decodeRevision(args.organizationId, revision)\n\n const document = buildSnapshotDocument({\n form,\n formVersion,\n submission,\n answers,\n registry: this.registry,\n })\n const bytes = await renderDocumentToPdf(document)\n\n const filename = `submission-${submission.id}-v${formVersion.versionNumber}.pdf`\n const ciphertext = await this.encryption.encrypt(args.organizationId, bytes)\n const attachmentId = randomUUID()\n const attachment = em.create(FormAttachment, {\n id: attachmentId,\n submissionId: submission.id,\n organizationId: args.organizationId,\n fieldKey: SNAPSHOT_FIELD_KEY,\n kind: 'snapshot',\n payloadInline: ciphertext,\n contentType: SNAPSHOT_CONTENT_TYPE,\n filename,\n sizeBytes: bytes.length,\n uploadedBy: submission.submittedBy ?? null,\n uploadedAt: new Date(),\n })\n em.persist(attachment)\n submission.pdfSnapshotAttachmentId = attachmentId\n await em.flush()\n\n if (this.emitEvent) {\n await this.emitEvent('forms.attachment.uploaded', {\n attachmentId,\n submissionId: submission.id,\n })\n }\n\n return {\n attachmentId,\n filename,\n contentType: SNAPSHOT_CONTENT_TYPE,\n sizeBytes: bytes.length,\n bytes,\n }\n }\n\n private async decodeRevision(\n organizationId: string,\n revision: FormSubmissionRevision,\n ): Promise<Record<string, unknown>> {\n const ciphertext = Buffer.isBuffer(revision.data)\n ? revision.data\n : Buffer.from(revision.data as unknown as Uint8Array)\n if (ciphertext.length === 0) return {}\n const plain = await this.encryption.decrypt(organizationId, ciphertext)\n if (plain.length === 0) return {}\n try {\n const parsed: unknown = JSON.parse(plain.toString('utf8'))\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {}\n } catch {\n return {}\n }\n }\n}\n\n// ============================================================================\n// Document model builder (pure \u2014 unit-tested)\n// ============================================================================\n\nexport type BuildSnapshotDocumentArgs = {\n form: Form | null\n formVersion: FormVersion\n submission: FormSubmission\n answers: Record<string, unknown>\n registry?: FieldTypeRegistry\n}\n\ntype SchemaSection = {\n key: string\n title: Record<string, string> | undefined\n fieldKeys: string[]\n}\n\n/**\n * Builds the rendering-engine-agnostic snapshot model from the version-pinned\n * schema + decrypted answers + submit metadata. Field order follows the form's\n * `x-om-sections` declaration order; un-sectioned properties are appended in\n * `properties` order under a synthetic section so nothing is dropped.\n */\nexport function buildSnapshotDocument(args: BuildSnapshotDocumentArgs): SnapshotDocument {\n const { formVersion, submission, answers } = args\n const registry = args.registry ?? defaultFieldTypeRegistry\n const schema = (formVersion.schema ?? {}) as Record<string, unknown>\n const locale = resolveDefaultLocale(args.form, schema)\n const properties = isRecord(schema.properties) ? schema.properties : {}\n const sections = readSchemaSections(schema)\n\n const seen = new Set<string>()\n const renderedSections: SnapshotSection[] = []\n\n for (const section of sections) {\n const fields: SnapshotField[] = []\n for (const fieldKey of section.fieldKeys) {\n seen.add(fieldKey)\n const node = isRecord(properties[fieldKey]) ? (properties[fieldKey] as FieldNode) : null\n if (!node) continue\n const field = buildSnapshotField(fieldKey, node, answers[fieldKey], locale, registry)\n if (field) fields.push(field)\n }\n if (fields.length > 0) {\n renderedSections.push({\n key: section.key,\n title: resolveLocalized(section.title, locale) || section.key,\n fields,\n })\n }\n }\n\n const leftover: SnapshotField[] = []\n for (const fieldKey of Object.keys(properties)) {\n if (seen.has(fieldKey)) continue\n const node = isRecord(properties[fieldKey]) ? (properties[fieldKey] as FieldNode) : null\n if (!node) continue\n const field = buildSnapshotField(fieldKey, node, answers[fieldKey], locale, registry)\n if (field) leftover.push(field)\n }\n if (leftover.length > 0) {\n renderedSections.push({ key: '__fields__', title: '', fields: leftover })\n }\n\n return {\n formName: args.form?.name ?? schemaTitle(schema) ?? 'Form',\n versionNumber: formVersion.versionNumber,\n locale,\n sections: renderedSections,\n audit: buildAuditBlock(submission, formVersion),\n }\n}\n\nfunction buildSnapshotField(\n fieldKey: string,\n node: FieldNode,\n rawValue: unknown,\n locale: string,\n registry: FieldTypeRegistry,\n): SnapshotField | null {\n const type = typeof node['x-om-type'] === 'string' ? (node['x-om-type'] as string) : 'text'\n const spec = registry.get(type)\n if (spec?.category === 'layout') return null\n const label = resolveLocalized(node['x-om-label'] as Record<string, string> | undefined, locale) || fieldKey\n\n if (type === SIGNATURE_TYPE_KEY) {\n return {\n key: fieldKey,\n label,\n type,\n answer: spec ? spec.exportAdapter(rawValue, node) : '',\n signature: buildSignatureEvidence(node, rawValue, locale),\n }\n }\n\n const answer = spec ? spec.exportAdapter(rawValue, node) : stringifyFallback(rawValue)\n return { key: fieldKey, label, type, answer }\n}\n\nfunction buildSignatureEvidence(\n node: FieldNode,\n rawValue: unknown,\n locale: string,\n): SnapshotSignature | undefined {\n if (!isRecord(rawValue)) return undefined\n const value = rawValue as Partial<SignatureValue>\n if (value.mode !== 'drawn' && value.mode !== 'typed') return undefined\n const clause = resolveLocalized(\n node['x-om-consent-clause'] as Record<string, string> | undefined,\n locale,\n )\n return {\n mode: value.mode,\n typedName: typeof value.typedName === 'string' ? value.typedName : null,\n imageDataUrl: typeof value.image === 'string' && value.image.length > 0 ? value.image : null,\n clauseText: clause.length > 0 ? clause : null,\n clauseSha256: typeof value.clauseSha256 === 'string' ? value.clauseSha256 : '',\n signedAt: typeof value.signedAt === 'string' ? value.signedAt : '',\n }\n}\n\nfunction buildAuditBlock(submission: FormSubmission, formVersion: FormVersion): SnapshotAuditBlock {\n const metadata = isRecord(submission.submitMetadata) ? submission.submitMetadata : {}\n const submittedAtUtc = submission.submittedAt\n ? submission.submittedAt.toISOString()\n : readString(metadata.serverSubmittedAt)\n return {\n submissionId: submission.id,\n submittedBy: submission.submittedBy ?? null,\n submittedAtUtc: submittedAtUtc ?? null,\n ip: readString(metadata.ip),\n userAgent: readString(metadata.userAgent),\n formVersionId: formVersion.id,\n schemaHash: formVersion.schemaHash,\n organizationId: submission.organizationId,\n }\n}\n\n// ============================================================================\n// pdf-lib renderer\n// ============================================================================\n\nconst PAGE_WIDTH = 595.28 // A4 portrait\nconst PAGE_HEIGHT = 841.89\nconst MARGIN = 50\nconst CONTENT_WIDTH = PAGE_WIDTH - MARGIN * 2\n\ntype RenderCursor = {\n doc: PDFDocument\n page: PDFPage\n y: number\n font: PDFFont\n bold: PDFFont\n /** Pre-embedded drawn-signature images keyed by their data URL. */\n images: Map<string, PDFImage>\n}\n\nexport async function renderDocumentToPdf(document: SnapshotDocument): Promise<Buffer> {\n const doc = await PDFDocument.create()\n const font = await doc.embedFont(StandardFonts.Helvetica)\n const bold = await doc.embedFont(StandardFonts.HelveticaBold)\n const images = await embedSignatureImages(doc, document)\n const cursor: RenderCursor = { doc, page: addPage(doc), y: PAGE_HEIGHT - MARGIN, font, bold, images }\n\n drawText(cursor, document.formName, { size: 18, font: bold })\n drawText(cursor, `Version ${document.versionNumber}`, { size: 10, color: rgb(0.4, 0.4, 0.4) })\n drawText(cursor, `Organization ${document.audit.organizationId}`, {\n size: 9,\n color: rgb(0.4, 0.4, 0.4),\n })\n advance(cursor, 8)\n\n for (const section of document.sections) {\n ensureSpace(cursor, 60)\n if (section.title) {\n drawDivider(cursor)\n drawText(cursor, section.title, { size: 13, font: bold })\n advance(cursor, 2)\n }\n for (const field of section.fields) {\n renderField(cursor, field)\n }\n advance(cursor, 6)\n }\n\n drawDivider(cursor)\n drawText(cursor, 'Audit', { size: 13, font: bold })\n advance(cursor, 2)\n renderAuditLine(cursor, 'Submission ID', document.audit.submissionId)\n renderAuditLine(cursor, 'Submitted by', document.audit.submittedBy ?? '\u2014')\n renderAuditLine(cursor, 'Submitted at (UTC)', document.audit.submittedAtUtc ?? '\u2014')\n renderAuditLine(cursor, 'IP address', document.audit.ip ?? '\u2014')\n renderAuditLine(cursor, 'User agent', document.audit.userAgent ?? '\u2014')\n renderAuditLine(cursor, 'Form version ID', document.audit.formVersionId)\n renderAuditLine(cursor, 'Schema hash', document.audit.schemaHash)\n\n const saved = await doc.save()\n return Buffer.from(saved)\n}\n\nfunction renderField(cursor: RenderCursor, field: SnapshotField): void {\n ensureSpace(cursor, 40)\n drawText(cursor, field.label, { size: 10, font: cursor.bold })\n if (field.signature) {\n renderSignature(cursor, field.signature)\n return\n }\n const answer = field.answer.trim().length > 0 ? field.answer : '\u2014'\n drawText(cursor, answer, { size: 10 })\n advance(cursor, 4)\n}\n\nfunction renderSignature(cursor: RenderCursor, signature: SnapshotSignature): void {\n if (signature.clauseText) {\n drawText(cursor, signature.clauseText, { size: 9, color: rgb(0.3, 0.3, 0.3) })\n }\n if (signature.mode === 'drawn' && signature.imageDataUrl) {\n const embedded = cursor.images.get(signature.imageDataUrl)\n if (embedded) {\n const maxWidth = 220\n const scaled = embedded.scaleToFit(maxWidth, 90)\n ensureSpace(cursor, scaled.height + 8)\n cursor.page.drawImage(embedded, {\n x: MARGIN,\n y: cursor.y - scaled.height,\n width: scaled.width,\n height: scaled.height,\n })\n cursor.y -= scaled.height + 4\n } else {\n drawText(cursor, '[signature image]', { size: 9, color: rgb(0.4, 0.4, 0.4) })\n }\n } else {\n drawText(cursor, `Signed (typed): ${signature.typedName ?? ''}`, { size: 10 })\n }\n drawText(cursor, `Signed at: ${signature.signedAt || '\u2014'}`, {\n size: 8,\n color: rgb(0.4, 0.4, 0.4),\n })\n drawText(cursor, `Clause SHA-256: ${signature.clauseSha256 || '\u2014'}`, {\n size: 8,\n color: rgb(0.4, 0.4, 0.4),\n })\n advance(cursor, 6)\n}\n\n/**\n * Pre-embeds every drawn-signature image so the synchronous layout pass can\n * place them by data-URL lookup. Undecodable / unsupported images are skipped\n * (the renderer falls back to a `[signature image]` placeholder) so a malformed\n * data URL can never fail the whole snapshot.\n */\nasync function embedSignatureImages(\n doc: PDFDocument,\n document: SnapshotDocument,\n): Promise<Map<string, PDFImage>> {\n const images = new Map<string, PDFImage>()\n for (const section of document.sections) {\n for (const field of section.fields) {\n const dataUrl = field.signature?.imageDataUrl\n if (!dataUrl || images.has(dataUrl)) continue\n const embedded = await embedSignatureImage(doc, dataUrl)\n if (embedded) images.set(dataUrl, embedded)\n }\n }\n return images\n}\n\nasync function embedSignatureImage(doc: PDFDocument, dataUrl: string): Promise<PDFImage | null> {\n const match = /^data:image\\/(png|jpeg|jpg);base64,(.+)$/i.exec(dataUrl.trim())\n if (!match) return null\n const kind = match[1].toLowerCase()\n let bytes: Buffer\n try {\n bytes = Buffer.from(match[2], 'base64')\n } catch {\n return null\n }\n try {\n return kind === 'png' ? await doc.embedPng(bytes) : await doc.embedJpg(bytes)\n } catch {\n return null\n }\n}\n\nfunction renderAuditLine(cursor: RenderCursor, label: string, value: string): void {\n ensureSpace(cursor, 16)\n drawText(cursor, `${label}: ${value}`, { size: 9, color: rgb(0.25, 0.25, 0.25) })\n}\n\ntype DrawOptions = {\n size: number\n font?: PDFFont\n color?: ReturnType<typeof rgb>\n}\n\nfunction drawText(cursor: RenderCursor, text: string, options: DrawOptions): void {\n const font = options.font ?? cursor.font\n const lines = wrapText(text, font, options.size, CONTENT_WIDTH)\n const lineHeight = options.size + 4\n for (const line of lines) {\n ensureSpace(cursor, lineHeight)\n cursor.page.drawText(line, {\n x: MARGIN,\n y: cursor.y - options.size,\n size: options.size,\n font,\n color: options.color ?? rgb(0.1, 0.1, 0.1),\n })\n cursor.y -= lineHeight\n }\n}\n\nfunction drawDivider(cursor: RenderCursor): void {\n ensureSpace(cursor, 12)\n cursor.page.drawLine({\n start: { x: MARGIN, y: cursor.y },\n end: { x: PAGE_WIDTH - MARGIN, y: cursor.y },\n thickness: 0.5,\n color: rgb(0.8, 0.8, 0.8),\n })\n cursor.y -= 10\n}\n\nfunction advance(cursor: RenderCursor, amount: number): void {\n cursor.y -= amount\n}\n\nfunction ensureSpace(cursor: RenderCursor, needed: number): void {\n if (cursor.y - needed < MARGIN) {\n cursor.page = addPage(cursor.doc)\n cursor.y = PAGE_HEIGHT - MARGIN\n }\n}\n\nfunction addPage(doc: PDFDocument): PDFPage {\n return doc.addPage([PAGE_WIDTH, PAGE_HEIGHT])\n}\n\n/**\n * Greedy word-wrap. Falls back to hard character splitting for tokens wider\n * than the content width (e.g. long hashes / user agents) so nothing overflows.\n */\nfunction wrapText(text: string, font: PDFFont, size: number, maxWidth: number): string[] {\n const sanitized = sanitizeForWinAnsi(text)\n const result: string[] = []\n for (const rawLine of sanitized.split('\\n')) {\n const words = rawLine.split(/\\s+/).filter((entry) => entry.length > 0)\n if (words.length === 0) {\n result.push('')\n continue\n }\n let current = ''\n for (const word of words) {\n const candidate = current.length === 0 ? word : `${current} ${word}`\n if (font.widthOfTextAtSize(candidate, size) <= maxWidth) {\n current = candidate\n continue\n }\n if (current.length > 0) result.push(current)\n if (font.widthOfTextAtSize(word, size) <= maxWidth) {\n current = word\n } else {\n for (const chunk of splitWideToken(word, font, size, maxWidth)) result.push(chunk)\n current = ''\n }\n }\n if (current.length > 0) result.push(current)\n }\n return result.length > 0 ? result : ['']\n}\n\nfunction splitWideToken(token: string, font: PDFFont, size: number, maxWidth: number): string[] {\n const chunks: string[] = []\n let current = ''\n for (const char of token) {\n const candidate = current + char\n if (font.widthOfTextAtSize(candidate, size) > maxWidth && current.length > 0) {\n chunks.push(current)\n current = char\n } else {\n current = candidate\n }\n }\n if (current.length > 0) chunks.push(current)\n return chunks\n}\n\n/**\n * The Helvetica standard font is WinAnsi-encoded; characters outside that set\n * (emoji, CJK, etc.) would throw at draw time. Replace anything non-encodable\n * with `?` so a snapshot can never fail to render on exotic answer text.\n */\nfunction sanitizeForWinAnsi(text: string): string {\n // eslint-disable-next-line no-control-regex\n return text.replace(/[^\u0000-\u00FF]/g, '?')\n}\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction readString(value: unknown): string | null {\n return typeof value === 'string' && value.length > 0 ? value : null\n}\n\nfunction stringifyFallback(value: unknown): string {\n if (value === null || value === undefined) return ''\n if (typeof value === 'string') return value\n if (typeof value === 'number' || typeof value === 'boolean') return String(value)\n try {\n return JSON.stringify(value)\n } catch {\n return ''\n }\n}\n\nfunction resolveLocalized(map: Record<string, string> | undefined, locale: string): string {\n if (!isRecord(map)) return ''\n const exact = map[locale]\n if (typeof exact === 'string' && exact.length > 0) return exact\n const en = map.en\n if (typeof en === 'string' && en.length > 0) return en\n for (const value of Object.values(map)) {\n if (typeof value === 'string' && value.length > 0) return value\n }\n return ''\n}\n\nfunction resolveDefaultLocale(form: Form | null, schema: Record<string, unknown>): string {\n if (form?.defaultLocale) return form.defaultLocale\n const fromSchema = schema['x-om-default-locale']\n if (typeof fromSchema === 'string' && fromSchema.length > 0) return fromSchema\n return 'en'\n}\n\nfunction schemaTitle(schema: Record<string, unknown>): string | null {\n return readString(schema.title)\n}\n\nfunction readSchemaSections(schema: Record<string, unknown>): SchemaSection[] {\n const raw = schema['x-om-sections']\n if (!Array.isArray(raw)) return []\n const result: SchemaSection[] = []\n for (const entry of raw) {\n if (!isRecord(entry)) continue\n if (typeof entry.key !== 'string') continue\n result.push({\n key: entry.key,\n title: isRecord(entry.title) ? (entry.title as Record<string, string>) : undefined,\n fieldKeys: Array.isArray(entry.fieldKeys)\n ? entry.fieldKeys.filter((value): value is string => typeof value === 'string')\n : [],\n })\n }\n return result\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
class DefaultPrefillResolver {
|
|
2
|
+
resolve(request) {
|
|
3
|
+
const { principal, attributeKeys } = request;
|
|
4
|
+
if (!principal) return {};
|
|
5
|
+
const out = {};
|
|
6
|
+
for (const attributeKey of attributeKeys) {
|
|
7
|
+
switch (attributeKey) {
|
|
8
|
+
case "name": {
|
|
9
|
+
const value = principal.displayName;
|
|
10
|
+
if (typeof value === "string" && value.length > 0) out[attributeKey] = value;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
case "email": {
|
|
14
|
+
const value = principal.email;
|
|
15
|
+
if (typeof value === "string" && value.length > 0) out[attributeKey] = value;
|
|
16
|
+
break;
|
|
17
|
+
}
|
|
18
|
+
default:
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async function resolvePrefillSeed(args) {
|
|
26
|
+
const { compiled, resolver, principal } = args;
|
|
27
|
+
const attributeByField = /* @__PURE__ */ new Map();
|
|
28
|
+
const attributeKeys = /* @__PURE__ */ new Set();
|
|
29
|
+
for (const descriptor of Object.values(compiled.fieldIndex)) {
|
|
30
|
+
const attribute = descriptor.prefillAttribute;
|
|
31
|
+
if (!attribute) continue;
|
|
32
|
+
attributeByField.set(descriptor.key, attribute);
|
|
33
|
+
attributeKeys.add(attribute);
|
|
34
|
+
}
|
|
35
|
+
if (attributeKeys.size === 0) return {};
|
|
36
|
+
const resolved = await resolver.resolve({
|
|
37
|
+
principal,
|
|
38
|
+
attributeKeys: Array.from(attributeKeys)
|
|
39
|
+
});
|
|
40
|
+
const seed = {};
|
|
41
|
+
for (const [fieldKey, attribute] of attributeByField) {
|
|
42
|
+
if (!Object.prototype.hasOwnProperty.call(resolved, attribute)) continue;
|
|
43
|
+
const value = resolved[attribute];
|
|
44
|
+
if (value === null || value === void 0) continue;
|
|
45
|
+
seed[fieldKey] = value;
|
|
46
|
+
}
|
|
47
|
+
return seed;
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
DefaultPrefillResolver,
|
|
51
|
+
resolvePrefillSeed
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=prefill-resolver.js.map
|