@wildo-ai/saas-backend-lib 1.0.1
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/dist/esm/__tests__/setup.d.ts +7 -0
- package/dist/esm/__tests__/setup.d.ts.map +1 -0
- package/dist/esm/__tests__/setup.js +14 -0
- package/dist/esm/__tests__/setup.js.map +1 -0
- package/dist/esm/__tests__/test-container.d.ts +39 -0
- package/dist/esm/__tests__/test-container.d.ts.map +1 -0
- package/dist/esm/__tests__/test-container.js +94 -0
- package/dist/esm/__tests__/test-container.js.map +1 -0
- package/dist/esm/applications/models/applications.backend.schemas.d.ts +11 -0
- package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -0
- package/dist/esm/applications/models/applications.backend.schemas.js +15 -0
- package/dist/esm/applications/models/applications.backend.schemas.js.map +1 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts +12 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +30 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts +98 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts.map +1 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.js +11 -0
- package/dist/esm/base-classes/models/repositories.backend.schemas.js.map +1 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +31 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.js +52 -0
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts +56 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.js +52 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts +33 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.js +125 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts +20 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.js +45 -0
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts +133 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.js +280 -0
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +147 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +1320 -0
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +107 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +369 -0
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts +194 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.js +417 -0
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts +9 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.js +35 -0
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +107 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +800 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +181 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +529 -0
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +245 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +1509 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts +134 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.js +388 -0
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts +9 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.js +26 -0
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +144 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js +49 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts +84 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.js +156 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts +42 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.js +94 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.js.map +1 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +593 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +4015 -0
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -0
- package/dist/esm/base-classes/utils/backend-type-utils.d.ts +43 -0
- package/dist/esm/base-classes/utils/backend-type-utils.d.ts.map +1 -0
- package/dist/esm/base-classes/utils/backend-type-utils.js +10 -0
- package/dist/esm/base-classes/utils/backend-type-utils.js.map +1 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts +44 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.js +94 -0
- package/dist/esm/billing/services/back-office/abstract-billing.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts +102 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.js +405 -0
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts +55 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js +268 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +83 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +371 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +80 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +255 -0
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -0
- package/dist/esm/billing/services/billing.utils.d.ts +17 -0
- package/dist/esm/billing/services/billing.utils.d.ts.map +1 -0
- package/dist/esm/billing/services/billing.utils.js +25 -0
- package/dist/esm/billing/services/billing.utils.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts +50 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +290 -0
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +92 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +193 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +66 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +180 -0
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts +31 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.js +100 -0
- package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +33 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +200 -0
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts +58 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +362 -0
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts +19 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.js +50 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts +21 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.js +32 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +114 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +569 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -0
- package/dist/esm/billing/testing/billing-test-fixtures.d.ts +109 -0
- package/dist/esm/billing/testing/billing-test-fixtures.d.ts.map +1 -0
- package/dist/esm/billing/testing/billing-test-fixtures.js +200 -0
- package/dist/esm/billing/testing/billing-test-fixtures.js.map +1 -0
- package/dist/esm/billing/testing/mock-billing-provider.d.ts +152 -0
- package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -0
- package/dist/esm/billing/testing/mock-billing-provider.js +394 -0
- package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -0
- package/dist/esm/charts/controllers/chart.backend.controller.d.ts +46 -0
- package/dist/esm/charts/controllers/chart.backend.controller.d.ts.map +1 -0
- package/dist/esm/charts/controllers/chart.backend.controller.js +214 -0
- package/dist/esm/charts/controllers/chart.backend.controller.js.map +1 -0
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts +55 -0
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/charts/services/chart-registry.backend.service.js +102 -0
- package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts +9 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.js +80 -0
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts +23 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.js +46 -0
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +73 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +291 -0
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +447 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +898 -0
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +127 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +462 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -0
- package/dist/esm/compliance/index.d.ts +2 -0
- package/dist/esm/compliance/index.d.ts.map +1 -0
- package/dist/esm/compliance/index.js +1 -0
- package/dist/esm/compliance/index.js.map +1 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts +31 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.js +112 -0
- package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.d.ts +29 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.d.ts.map +1 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.js +143 -0
- package/dist/esm/config/models/app-config-overrides.backend.definitions.js.map +1 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts +56 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.js +121 -0
- package/dist/esm/config/models/app-config-secrets.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts +35 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.js +89 -0
- package/dist/esm/config/models/app-config.backend-authored.definitions.js.map +1 -0
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +1651 -0
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/app-config.backend.schemas.js +478 -0
- package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.d.ts +74 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.js +115 -0
- package/dist/esm/config/models/app-env-config.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.d.ts +11 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.js +50 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.js.map +1 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts +48 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.map +1 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.js +106 -0
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.js.map +1 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts +12 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts.map +1 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.js +23 -0
- package/dist/esm/config/models/runtime-topology.backend.contracts.js.map +1 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts +39 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +1 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.js +124 -0
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.js.map +1 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +76 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.js +375 -0
- package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.service.d.ts +148 -0
- package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.service.js +494 -0
- package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +17 -0
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -0
- package/dist/esm/config/services/app-configuration.backend.utils.js +61 -0
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +70 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js +470 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.d.ts +136 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.js +9 -0
- package/dist/esm/databases/models/aggregation.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/databases.backend.schemas.d.ts +32 -0
- package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/databases.backend.schemas.js +60 -0
- package/dist/esm/databases/models/databases.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/filter.backend.schemas.d.ts +83 -0
- package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/filter.backend.schemas.js +27 -0
- package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/sql.backend.schemas.d.ts +75 -0
- package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/sql.backend.schemas.js +31 -0
- package/dist/esm/databases/models/sql.backend.schemas.js.map +1 -0
- package/dist/esm/databases/models/transaction.shared.schemas.d.ts +120 -0
- package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -0
- package/dist/esm/databases/models/transaction.shared.schemas.js +30 -0
- package/dist/esm/databases/models/transaction.shared.schemas.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts +15 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.js +60 -0
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts +19 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.js +69 -0
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts +11 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.js +315 -0
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts +29 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.js +65 -0
- package/dist/esm/databases/services/__tests__/mock-redis.service.js.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts +19 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +1 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.js +44 -0
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts +74 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +369 -0
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts +110 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.js +444 -0
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts +38 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.js +180 -0
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts +42 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.js +183 -0
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts +48 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.js +320 -0
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts +47 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.js +187 -0
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.js.map +1 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts +47 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.js +250 -0
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.js.map +1 -0
- package/dist/esm/databases/services/db-utils.d.ts +56 -0
- package/dist/esm/databases/services/db-utils.d.ts.map +1 -0
- package/dist/esm/databases/services/db-utils.js +66 -0
- package/dist/esm/databases/services/db-utils.js.map +1 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts +91 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.js +652 -0
- package/dist/esm/databases/services/mongo-aggregation.backend.service.js.map +1 -0
- package/dist/esm/databases/services/mongodb.service.d.ts +132 -0
- package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -0
- package/dist/esm/databases/services/mongodb.service.js +630 -0
- package/dist/esm/databases/services/mongodb.service.js.map +1 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts +113 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.js +635 -0
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.js.map +1 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.d.ts +75 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.js +255 -0
- package/dist/esm/databases/services/postgresql-database.backend.service.js.map +1 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts +116 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.js +624 -0
- package/dist/esm/databases/services/postgresql-filter.backend.service.js.map +1 -0
- package/dist/esm/databases/services/redis.service.d.ts +143 -0
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -0
- package/dist/esm/databases/services/redis.service.js +429 -0
- package/dist/esm/databases/services/redis.service.js.map +1 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts +302 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.js +1787 -0
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.js.map +1 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts +65 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.js +237 -0
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.js.map +1 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts +339 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.map +1 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.js +209 -0
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.js.map +1 -0
- package/dist/esm/errors/services/error-builder.backend.service.d.ts +95 -0
- package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -0
- package/dist/esm/errors/services/error-builder.backend.service.js +334 -0
- package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -0
- package/dist/esm/errors/services/error-handler.backend.service.d.ts +43 -0
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/errors/services/error-handler.backend.service.js +219 -0
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts +23 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -0
- package/dist/esm/errors/services/rate-limit.backend.service.js +59 -0
- package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts +135 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.map +1 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.js +129 -0
- package/dist/esm/external-providers/models/external-providers.backend.schemas.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +18 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +38 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.d.ts +20 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.js +44 -0
- package/dist/esm/external-providers/services/__tests__/mock-lazy-provider-registry.service.js.map +1 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts +9 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.js +36 -0
- package/dist/esm/external-providers/services/external-api-handler.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +83 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +422 -0
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.d.ts +102 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.js +352 -0
- package/dist/esm/external-providers/services/feature-bindings.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.d.ts +141 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.js +391 -0
- package/dist/esm/external-providers/services/lazy-provider-registry.backend.service.js.map +1 -0
- package/dist/esm/features/controllers/features.backend.controller.d.ts +35 -0
- package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -0
- package/dist/esm/features/controllers/features.backend.controller.js +179 -0
- package/dist/esm/features/controllers/features.backend.controller.js.map +1 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.d.ts +8 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.d.ts.map +1 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.js +31 -0
- package/dist/esm/features/services/__tests__/mock-capability-bindings.service.js.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts +22 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.js +52 -0
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.js.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts +13 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.js +36 -0
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.js.map +1 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts +111 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.js +437 -0
- package/dist/esm/features/services/feature-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/features/services/feature-gate.backend.service.d.ts +110 -0
- package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -0
- package/dist/esm/features/services/feature-gate.backend.service.js +414 -0
- package/dist/esm/features/services/feature-gate.backend.service.js.map +1 -0
- package/dist/esm/features/services/feature-resolution.backend.service.d.ts +163 -0
- package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -0
- package/dist/esm/features/services/feature-resolution.backend.service.js +550 -0
- package/dist/esm/features/services/feature-resolution.backend.service.js.map +1 -0
- package/dist/esm/features/testing/feature-test-utils.d.ts +85 -0
- package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -0
- package/dist/esm/features/testing/feature-test-utils.js +127 -0
- package/dist/esm/features/testing/feature-test-utils.js.map +1 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts +34 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.js +226 -0
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.js.map +1 -0
- package/dist/esm/files/constraints/file-analyzers.types.d.ts +76 -0
- package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-analyzers.types.js +16 -0
- package/dist/esm/files/constraints/file-analyzers.types.js.map +1 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts +38 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.js +99 -0
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.js.map +1 -0
- package/dist/esm/files/constraints/file-constraint.types.d.ts +77 -0
- package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-constraint.types.js +16 -0
- package/dist/esm/files/constraints/file-constraint.types.js.map +1 -0
- package/dist/esm/files/constraints/file-validation.backend.service.d.ts +63 -0
- package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -0
- package/dist/esm/files/constraints/file-validation.backend.service.js +317 -0
- package/dist/esm/files/constraints/file-validation.backend.service.js.map +1 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts +33 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.js +126 -0
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.js.map +1 -0
- package/dist/esm/files/controllers/file.controller.d.ts +145 -0
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -0
- package/dist/esm/files/controllers/file.controller.js +806 -0
- package/dist/esm/files/controllers/file.controller.js.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +85 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +512 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.d.ts +84 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.d.ts.map +1 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.js +224 -0
- package/dist/esm/files/rag/weaviate-vector-store.backend.service.js.map +1 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts +55 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.js +202 -0
- package/dist/esm/files/scanning/clamav-scanner.backend.service.js.map +1 -0
- package/dist/esm/files/scanning/file-scan.types.d.ts +17 -0
- package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -0
- package/dist/esm/files/scanning/file-scan.types.js +7 -0
- package/dist/esm/files/scanning/file-scan.types.js.map +1 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts +73 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.js +184 -0
- package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts +12 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.js +41 -0
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.js.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts +33 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.js +71 -0
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.js.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts +16 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.js +95 -0
- package/dist/esm/files/services/__tests__/mock-file-repository.service.js.map +1 -0
- package/dist/esm/files/services/file-field-detection.backend.service.d.ts +57 -0
- package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-field-detection.backend.service.js +145 -0
- package/dist/esm/files/services/file-field-detection.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +103 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.js +604 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-population.backend.service.d.ts +73 -0
- package/dist/esm/files/services/file-population.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-population.backend.service.js +367 -0
- package/dist/esm/files/services/file-population.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.d.ts +64 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.js +188 -0
- package/dist/esm/files/services/file-rag-indexing.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-scanning.backend.service.d.ts +97 -0
- package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-scanning.backend.service.js +323 -0
- package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +52 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.js +168 -0
- package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -0
- package/dist/esm/files/services/files.backend.service.d.ts +235 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/files.backend.service.js +987 -0
- package/dist/esm/files/services/files.backend.service.js.map +1 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts +50 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.js +253 -0
- package/dist/esm/files/storage/file-storage-path-resolver.backend.service.js.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +156 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.js +10 -0
- package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.d.ts +68 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.js +168 -0
- package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +57 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +307 -0
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts +41 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +397 -0
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts +30 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +251 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -0
- package/dist/esm/files/utils/file-upload.utils.d.ts +74 -0
- package/dist/esm/files/utils/file-upload.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-upload.utils.js +116 -0
- package/dist/esm/files/utils/file-upload.utils.js.map +1 -0
- package/dist/esm/files/utils/file-uploader.utils.d.ts +15 -0
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-uploader.utils.js +47 -0
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -0
- package/dist/esm/files/utils/file-validation.utils.d.ts +111 -0
- package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/file-validation.utils.js +516 -0
- package/dist/esm/files/utils/file-validation.utils.js.map +1 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.d.ts +222 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.d.ts.map +1 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.js +320 -0
- package/dist/esm/flows-actors/agent-catalogs.backend.js.map +1 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts +33 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts.map +1 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.js +96 -0
- package/dist/esm/flows-actors/controllers/flows-actors.controller.js.map +1 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +225 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +323 -0
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts +77 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.js +28 -0
- package/dist/esm/flows-actors/models/agent-facets.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.js +1 -0
- package/dist/esm/flows-actors/models/agents.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +52 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +307 -0
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts +7 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.js +8 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +30 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js +7 -0
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts +72 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.js +229 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts +95 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.js +276 -0
- package/dist/esm/flows-actors/services/agent-facets.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +183 -0
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/agents.backend.service.js +2095 -0
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts +64 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.js +180 -0
- package/dist/esm/flows-actors/services/context-curation.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +101 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js +313 -0
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -0
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts +64 -0
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/flows.backend.services.js +203 -0
- package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +91 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +629 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.d.ts +15 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.js +55 -0
- package/dist/esm/flows-actors/utils/cli-runtime-operation-support.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.d.ts +22 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.js +131 -0
- package/dist/esm/flows-actors/utils/cli-runtime-runner.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts +15 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.js +43 -0
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts +66 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.js +219 -0
- package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.js.map +1 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts +17 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.js +110 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts +41 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.js +135 -0
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts +33 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.js +105 -0
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.js.map +1 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts +103 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.js +685 -0
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts +23 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.js +57 -0
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts +49 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.js +248 -0
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +64 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +487 -0
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +55 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +208 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -0
- package/dist/esm/i18n/services/i18n.backend.service.d.ts +43 -0
- package/dist/esm/i18n/services/i18n.backend.service.d.ts.map +1 -0
- package/dist/esm/i18n/services/i18n.backend.service.js +83 -0
- package/dist/esm/i18n/services/i18n.backend.service.js.map +1 -0
- package/dist/esm/index.d.ts +203 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +239 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/inject/models/container.d.ts +44 -0
- package/dist/esm/inject/models/container.d.ts.map +1 -0
- package/dist/esm/inject/models/container.js +489 -0
- package/dist/esm/inject/models/container.js.map +1 -0
- package/dist/esm/inject/models/service-types.d.ts +198 -0
- package/dist/esm/inject/models/service-types.d.ts.map +1 -0
- package/dist/esm/inject/models/service-types.js +226 -0
- package/dist/esm/inject/models/service-types.js.map +1 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts +34 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +122 -0
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +41 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +62 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +18 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js +43 -0
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.d.ts +12 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.js +25 -0
- package/dist/esm/monitoring/logger/middleware/logging.middleware.js.map +1 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +41 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +29 -0
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts +22 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.js +53 -0
- package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.js.map +1 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts +37 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/services/logger.service.js +189 -0
- package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.d.ts +38 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.js +147 -0
- package/dist/esm/monitoring/observability/middleware/metrics.middleware.js.map +1 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.d.ts +26 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.js +117 -0
- package/dist/esm/monitoring/observability/middleware/telemetry.middleware.js.map +1 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.d.ts +28 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.js +182 -0
- package/dist/esm/monitoring/observability/middleware/tracing.middleware.js.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +86 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.d.ts +57 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.js +77 -0
- package/dist/esm/monitoring/observability/services/instrumentations/custom.instrumentations.js.map +1 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts +27 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js +236 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.d.ts +28 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.js +144 -0
- package/dist/esm/monitoring/observability/services/telemetry.service.js.map +1 -0
- package/dist/esm/monitoring/observability/services/tracer.service.d.ts +24 -0
- package/dist/esm/monitoring/observability/services/tracer.service.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/services/tracer.service.js +287 -0
- package/dist/esm/monitoring/observability/services/tracer.service.js.map +1 -0
- package/dist/esm/notifications/email/components/email-components.d.ts +90 -0
- package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -0
- package/dist/esm/notifications/email/components/email-components.js +171 -0
- package/dist/esm/notifications/email/components/email-components.js.map +1 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +80 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.js +25 -0
- package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +1 -0
- package/dist/esm/notifications/email/models/email-template-definition.d.ts +68 -0
- package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email-template-definition.js +12 -0
- package/dist/esm/notifications/email/models/email-template-definition.js.map +1 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.d.ts +19 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.js +66 -0
- package/dist/esm/notifications/email/models/email-template.actors-system.backend.definitions.js.map +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.d.ts +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.d.ts.map +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.js +1 -0
- package/dist/esm/notifications/email/models/email.backend.scheamas.js.map +1 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts +74 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.js +196 -0
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +49 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +141 -0
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.d.ts +74 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.js +215 -0
- package/dist/esm/notifications/email/services/email-renderer.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +37 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +121 -0
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.d.ts +115 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.js +634 -0
- package/dist/esm/notifications/email/services/email-template-generation.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +48 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +146 -0
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +58 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +223 -0
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts +49 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +204 -0
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/services/email.backend.service.d.ts +76 -0
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/email/services/email.backend.service.js +294 -0
- package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +56 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.js +108 -0
- package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts +8 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts.map +1 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.js +15 -0
- package/dist/esm/notifications/email/utils/interpolate-email-label.utils.js.map +1 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts +50 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.map +1 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.js +281 -0
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.js.map +1 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +94 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.js +292 -0
- package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +202 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +1290 -0
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +50 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.js +209 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +58 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +184 -0
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts +56 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.js +109 -0
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.js.map +1 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +96 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +396 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts +39 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.js +73 -0
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts +22 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.js +35 -0
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts +10 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +77 -0
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts +10 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.js +131 -0
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.js.map +1 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts +22 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.js +21 -0
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts +25 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.js +34 -0
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.js.map +1 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts +32 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.js +66 -0
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.js.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +126 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +370 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts +86 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.js +176 -0
- package/dist/esm/queue/apps-crontabs-manager.backend.service.js.map +1 -0
- package/dist/esm/queue/cron-job-sync.backend.service.d.ts +42 -0
- package/dist/esm/queue/cron-job-sync.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/cron-job-sync.backend.service.js +181 -0
- package/dist/esm/queue/cron-job-sync.backend.service.js.map +1 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +84 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.js +275 -0
- package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -0
- package/dist/esm/queue/job-completion-registry.backend.service.d.ts +111 -0
- package/dist/esm/queue/job-completion-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-completion-registry.backend.service.js +237 -0
- package/dist/esm/queue/job-completion-registry.backend.service.js.map +1 -0
- package/dist/esm/queue/job-consumer.backend.service.d.ts +109 -0
- package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-consumer.backend.service.js +515 -0
- package/dist/esm/queue/job-consumer.backend.service.js.map +1 -0
- package/dist/esm/queue/job-executor.backend.service.d.ts +53 -0
- package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-executor.backend.service.js +278 -0
- package/dist/esm/queue/job-executor.backend.service.js.map +1 -0
- package/dist/esm/queue/job-payload-storage.backend.service.d.ts +86 -0
- package/dist/esm/queue/job-payload-storage.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-payload-storage.backend.service.js +250 -0
- package/dist/esm/queue/job-payload-storage.backend.service.js.map +1 -0
- package/dist/esm/queue/job-status-tracking.backend.service.d.ts +97 -0
- package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/job-status-tracking.backend.service.js +281 -0
- package/dist/esm/queue/job-status-tracking.backend.service.js.map +1 -0
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts +71 -0
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/queue-monitoring.backend.service.js +297 -0
- package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +63 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.js +171 -0
- package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -0
- package/dist/esm/queue/queue.backend.service.d.ts +108 -0
- package/dist/esm/queue/queue.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/queue.backend.service.js +419 -0
- package/dist/esm/queue/queue.backend.service.js.map +1 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts +74 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.js +189 -0
- package/dist/esm/queue/scheduled-message-verifier.backend.service.js.map +1 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +124 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js +250 -0
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.d.ts +34 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.js +42 -0
- package/dist/esm/requests/models/api-routes.backend.defintions.js.map +1 -0
- package/dist/esm/requests/models/requests.backend.schemas.d.ts +48 -0
- package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -0
- package/dist/esm/requests/models/requests.backend.schemas.js +7 -0
- package/dist/esm/requests/models/requests.backend.schemas.js.map +1 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.d.ts +6 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.d.ts.map +1 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.js +20 -0
- package/dist/esm/requests/service/__tests__/mock-apps-shared-resources-gateway.service.js.map +1 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.d.ts +84 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.js +462 -0
- package/dist/esm/requests/service/apps-shared-resources-gateway.backend.service.js.map +1 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts +9 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.js +36 -0
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.js.map +1 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.d.ts +6 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.js +47 -0
- package/dist/esm/requests/service/platform-requests.backend.utils.js.map +1 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.d.ts +111 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.js +354 -0
- package/dist/esm/requests/service/remote-client-base.backend.service.js.map +1 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts +9 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.js +36 -0
- package/dist/esm/requests/service/serverless-services-handler.backend.service.js.map +1 -0
- package/dist/esm/requests/service/websocket.service.d.ts +507 -0
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -0
- package/dist/esm/requests/service/websocket.service.js +2222 -0
- package/dist/esm/requests/service/websocket.service.js.map +1 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts +3 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +17 -0
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -0
- package/dist/esm/resources/models/index.d.ts +7 -0
- package/dist/esm/resources/models/index.d.ts.map +1 -0
- package/dist/esm/resources/models/index.js +7 -0
- package/dist/esm/resources/models/index.js.map +1 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts +4 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js +7 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts +3 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js +19 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +13 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js +14 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -0
- package/dist/esm/resources/models/resources.backend.schemas.d.ts +7 -0
- package/dist/esm/resources/models/resources.backend.schemas.d.ts.map +1 -0
- package/dist/esm/resources/models/resources.backend.schemas.js +8 -0
- package/dist/esm/resources/models/resources.backend.schemas.js.map +1 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.d.ts +121 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.js +10 -0
- package/dist/esm/resources/models/virtual-fields.backend.types.js.map +1 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts +25 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.js +59 -0
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.js.map +1 -0
- package/dist/esm/resources/services/resource-context.backend.service.d.ts +321 -0
- package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resource-context.backend.service.js +723 -0
- package/dist/esm/resources/services/resource-context.backend.service.js.map +1 -0
- package/dist/esm/resources/services/resource-id.backend.service.d.ts +110 -0
- package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resource-id.backend.service.js +267 -0
- package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -0
- package/dist/esm/resources/services/resource-population.backend.service.d.ts +149 -0
- package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resource-population.backend.service.js +543 -0
- package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -0
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +151 -0
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/resources-registry.backend.service.js +867 -0
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.d.ts +72 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.js +254 -0
- package/dist/esm/resources/services/virtual-fields.backend.service.js.map +1 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +73 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.js +275 -0
- package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts +43 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js +70 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts +253 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts.map +1 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.js +329 -0
- package/dist/esm/runtime/models/execution-context.backend.schemas.js.map +1 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.d.ts +45 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.map +1 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.js +73 -0
- package/dist/esm/runtime/models/runtime.backend.schemas.js.map +1 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts +315 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js +1525 -0
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts +60 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.js +150 -0
- package/dist/esm/runtime/services/execution-context-handler.backend.service.js.map +1 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +11 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js +1 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts +188 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/http-server.backend.service.js +755 -0
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -0
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +240 -0
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -0
- package/dist/esm/runtime/services/start-application.backend.service.js +977 -0
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts +10 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.js +13 -0
- package/dist/esm/runtime/testing/execution-context-test-fixtures.js.map +1 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts +15 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.js +42 -0
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.js.map +1 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts +85 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.js +171 -0
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.js.map +1 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +19 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +59 -0
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts +31 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.js +215 -0
- package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +493 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +2371 -0
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.d.ts +83 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.js +113 -0
- package/dist/esm/security/authentications/models/auth-constants.backend.js.map +1 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts +98 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.js +59 -0
- package/dist/esm/security/authentications/models/authentications.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +42 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js +98 -0
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +163 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js +12 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts +102 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.js +7 -0
- package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts +88 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.js +17 -0
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.js.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts +27 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.js +66 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.js.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts +30 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.js +44 -0
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts +19 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.js +43 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts +37 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.js +58 -0
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +85 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +379 -0
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +79 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +205 -0
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +59 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +179 -0
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +116 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +436 -0
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts +67 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +222 -0
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +80 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +368 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts +75 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.js +139 -0
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts +72 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.js +127 -0
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +57 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +459 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts +44 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +131 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts +58 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.js +209 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts +46 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.js +124 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +165 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +816 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts +218 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +1026 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts +150 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +737 -0
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts +224 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.js +593 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts +267 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.js +1376 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts +93 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.js +396 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts +40 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.js +92 -0
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +82 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +325 -0
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts +66 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.js +198 -0
- package/dist/esm/security/authentications/services/auth-session-store.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +108 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +406 -0
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +366 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +2631 -0
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts +13 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +53 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.d.ts +12 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.js +41 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.d.ts +18 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.js +140 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts +16 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.js +112 -0
- package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts +16 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.js +101 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.d.ts +18 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.js +136 -0
- package/dist/esm/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +19 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +154 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts +26 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +657 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts +27 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.js +60 -0
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts +23 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.js +44 -0
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts +89 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.js +192 -0
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts +20 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.js +55 -0
- package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts +50 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +135 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts +26 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.js +59 -0
- package/dist/esm/security/authentications/services/utils/saml-java-availability.js.map +1 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +137 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +723 -0
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +28 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +156 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +4 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +72 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts +125 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.js +69 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/index.d.ts +3 -0
- package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/models/index.js +3 -0
- package/dist/esm/security/consumable-tokens/models/index.js.map +1 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts +26 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.js +55 -0
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.js.map +1 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +142 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +446 -0
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts +46 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.js +147 -0
- package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.js.map +1 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts +75 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.js +368 -0
- package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts +71 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.js +863 -0
- package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +275 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +139 -0
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.d.ts +35 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.js +232 -0
- package/dist/esm/security/scim/utils/scim-filter-parser.js.map +1 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.d.ts +42 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.js +89 -0
- package/dist/esm/security/scim/utils/scim-response-formatter.js.map +1 -0
- package/dist/esm/testing.d.ts +31 -0
- package/dist/esm/testing.d.ts.map +1 -0
- package/dist/esm/testing.js +31 -0
- package/dist/esm/testing.js.map +1 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts +9 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.js +48 -0
- package/dist/esm/users/services/user-self-custom-implementations.backend.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +163 -0
- package/src/__tests__/integration/bulk-repository-write-contract.integration.test.ts +373 -0
- package/src/__tests__/integration/custom-batch-job-execution.integration.test.ts +147 -0
- package/src/__tests__/integration/delete-file-rollback-persistence.integration.test.ts +551 -0
- package/src/__tests__/integration/file-management-nested-persistence.integration.test.ts +487 -0
- package/src/__tests__/integration/file-management-postgresql-persistence.integration.test.ts +466 -0
- package/src/__tests__/integration/files-cleanup-persistence.integration.test.ts +335 -0
- package/src/__tests__/integration/generated-bulk-relationship-runtime.integration.test.ts +545 -0
- package/src/__tests__/integration/lifecycle-delete-rollback-persistence.integration.test.ts +537 -0
- package/src/__tests__/integration/postgresql-contextual-filter-enforcement.integration.test.ts +170 -0
- package/src/__tests__/integration/postgresql-delete-best-effort-boundary.integration.test.ts +604 -0
- package/src/__tests__/integration/prompt-compiler.integration.test.ts +723 -0
- package/src/__tests__/integration/relationship-service-semantics.integration.test.ts +2086 -0
- package/src/__tests__/integration/repositories-registry.integration.test.ts +296 -0
- package/src/__tests__/integration/resource-factory-pipeline.integration.test.ts +556 -0
- package/src/__tests__/integration/resource-services.integration.test.ts +265 -0
- package/src/__tests__/integration/resources-registry.integration.test.ts +327 -0
- package/src/__tests__/integration/services-registry.integration.test.ts +231 -0
- package/src/__tests__/integration/update-many-runtime-guards.integration.test.ts +290 -0
- package/src/__tests__/setup.ts +15 -0
- package/src/__tests__/test-container.ts +120 -0
- package/src/applications/models/applications.backend.schemas.ts +18 -0
- package/src/base-classes/__tests__/batches-cronjobs-executor.test.ts +63 -0
- package/src/base-classes/__tests__/bulk-delete-child-file-guard.test.ts +152 -0
- package/src/base-classes/__tests__/bulk-nested-file-update-coordination.test.ts +171 -0
- package/src/base-classes/__tests__/delete-file-coordination.test.ts +185 -0
- package/src/base-classes/__tests__/postgresql-file-transaction-coordination.test.ts +424 -0
- package/src/base-classes/__tests__/postgresql-repository-contextual-filter-enforcement.test.ts +88 -0
- package/src/base-classes/__tests__/repository-contextual-filter-enforcement.test.ts +87 -0
- package/src/base-classes/__tests__/resource-operation-helper-context-enforcement.test.ts +74 -0
- package/src/base-classes/__tests__/transaction-boundaries.test.ts +153 -0
- package/src/base-classes/models/manual-controllers.backend.definition.ts +56 -0
- package/src/base-classes/models/repositories.backend.schemas.ts +105 -0
- package/src/base-classes/services/__tests__/mock-resource-operation-helper.service.ts +61 -0
- package/src/base-classes/services/batches/batches-cronjobs-custom-execution.service.ts +148 -0
- package/src/base-classes/services/batches/batches-cronjobs-executor.backend.service.ts +115 -0
- package/src/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.ts +58 -0
- package/src/base-classes/services/controllers/__tests__/controller-request-validation.utils.test.ts +292 -0
- package/src/base-classes/services/controllers/__tests__/controller-resource-file-upload-routes.test.ts +1335 -0
- package/src/base-classes/services/controllers/__tests__/controller-resource.version-conflict.test.ts +372 -0
- package/src/base-classes/services/controllers/abstract-controller.backend.service.ts +302 -0
- package/src/base-classes/services/controllers/controller-resource.backend.service.ts +1833 -0
- package/src/base-classes/services/controllers/controllers-registry-handler.backend.service.ts +494 -0
- package/src/base-classes/services/controllers/validate-field-handler.backend.service.ts +613 -0
- package/src/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.ts +31 -0
- package/src/base-classes/services/repositories/__tests__/repository-resource.singleton-read.test.ts +50 -0
- package/src/base-classes/services/repositories/postgresql-resource-repository.backend.service.ts +1207 -0
- package/src/base-classes/services/repositories/repositories-registry-handler.backend.service.ts +804 -0
- package/src/base-classes/services/repositories/repository-resource.backend.service.ts +2186 -0
- package/src/base-classes/services/resource-operations-helper.backend.service.ts +468 -0
- package/src/base-classes/services/services/__tests__/mock-services-registry-handler.service.ts +21 -0
- package/src/base-classes/services/services/__tests__/services-registry-handler.notifications.test.ts +65 -0
- package/src/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.ts +305 -0
- package/src/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.ts +224 -0
- package/src/base-classes/services/services/resource-operation-custom-implementation.factory.backend.ts +331 -0
- package/src/base-classes/services/services/services-registry-handler.backend.service.ts +6288 -0
- package/src/base-classes/utils/backend-type-utils.ts +64 -0
- package/src/billing/services/back-office/__tests__/billing-feature-sync.backend.service.test.ts +132 -0
- package/src/billing/services/back-office/__tests__/billing-state.backend.service.test.ts +245 -0
- package/src/billing/services/back-office/__tests__/product-catalog-sync.backend.service.test.ts +238 -0
- package/src/billing/services/back-office/abstract-billing.backend.service.ts +89 -0
- package/src/billing/services/back-office/billing-feature-sync.backend.service.ts +473 -0
- package/src/billing/services/back-office/billing-state.backend.service.ts +348 -0
- package/src/billing/services/back-office/product-catalog-sync.backend.service.ts +415 -0
- package/src/billing/services/back-office/usage-metering.backend.service.ts +326 -0
- package/src/billing/services/billing.utils.ts +26 -0
- package/src/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.ts +342 -0
- package/src/billing/services/custom-impl/billing-custom-impl-utils.backend.ts +274 -0
- package/src/billing/services/custom-impl/billing-custom-implementations.backend.ts +236 -0
- package/src/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.ts +133 -0
- package/src/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.ts +242 -0
- package/src/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.ts +434 -0
- package/src/billing/services/webhooks/billing-webhook-adapter.backend.service.ts +70 -0
- package/src/billing/services/webhooks/billing-webhook-capability-handler.backend.service.ts +46 -0
- package/src/billing/services/webhooks/billing-webhook-event-router.backend.service.ts +727 -0
- package/src/billing/testing/billing-test-fixtures.ts +296 -0
- package/src/billing/testing/mock-billing-provider.ts +548 -0
- package/src/charts/controllers/__tests__/chart.backend.controller.test.ts +403 -0
- package/src/charts/controllers/chart.backend.controller.ts +238 -0
- package/src/charts/services/__tests__/chart-registry.backend.service.test.ts +120 -0
- package/src/charts/services/chart-registry.backend.service.ts +109 -0
- package/src/compliance/audit-trails/audit-logs.custom-impl.backend.service.ts +104 -0
- package/src/compliance/audit-trails/services/__tests__/mock-audit-logs.service.ts +48 -0
- package/src/compliance/audit-trails/services/audit-event-dispatcher.backend.service.ts +325 -0
- package/src/compliance/audit-trails/services/audit-logs.backend.service.ts +1313 -0
- package/src/compliance/audit-trails/services/siem-webhook-delivery.backend.service.ts +542 -0
- package/src/compliance/index.ts +1 -0
- package/src/config/custom/application-config-controller.backend.service.ts +119 -0
- package/src/config/models/__tests__/app-config-secrets.boundaries.test.ts +56 -0
- package/src/config/models/__tests__/app-config.backend-authored.definitions.test.ts +286 -0
- package/src/config/models/app-config-secrets.backend.schemas.ts +154 -0
- package/src/config/models/app-config.backend-authored.definitions.ts +165 -0
- package/src/config/models/app-config.backend.schemas.ts +614 -0
- package/src/config/models/app-env-config.backend.schemas.ts +135 -0
- package/src/config/models/config-mutation-boundary.utils.ts +76 -0
- package/src/config/models/postgresql-env-config.backend.schemas.ts +126 -0
- package/src/config/models/runtime-topology.backend.contracts.ts +42 -0
- package/src/config/services/__tests__/app-configuration-loader.backend.service.test.ts +118 -0
- package/src/config/services/__tests__/app-configuration.backend.service.test.ts +40 -0
- package/src/config/services/__tests__/app-configuration.backend.utils.test.ts +72 -0
- package/src/config/services/__tests__/application-startup-config-validator.backend.service.test.ts +404 -0
- package/src/config/services/__tests__/mock-app-configuration.service.ts +131 -0
- package/src/config/services/app-configuration-loader.backend.service.ts +443 -0
- package/src/config/services/app-configuration.backend.service.ts +570 -0
- package/src/config/services/app-configuration.backend.utils.ts +94 -0
- package/src/config/services/application-startup-config-validator.backend.service.ts +611 -0
- package/src/databases/models/aggregation.backend.schemas.ts +174 -0
- package/src/databases/models/databases.backend.schemas.ts +70 -0
- package/src/databases/models/filter.backend.schemas.ts +101 -0
- package/src/databases/models/sql.backend.schemas.ts +111 -0
- package/src/databases/models/transaction.shared.schemas.ts +172 -0
- package/src/databases/services/__tests__/mock-mongo-transaction-registry.service.ts +90 -0
- package/src/databases/services/__tests__/mock-mongodb.service.ts +86 -0
- package/src/databases/services/__tests__/mock-mongoose-model.service.ts +411 -0
- package/src/databases/services/__tests__/mock-redis.service.ts +72 -0
- package/src/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.ts +41 -0
- package/src/databases/services/__tests__/mongo-aggregation-compiler.test.ts +918 -0
- package/src/databases/services/__tests__/postgresql-filter.backend.service.test.ts +180 -0
- package/src/databases/services/__tests__/sql-hybrid-transform.test.ts +73 -0
- package/src/databases/services/aggregation/__tests__/aggregation-authorization.backend.service.test.ts +444 -0
- package/src/databases/services/aggregation/__tests__/aggregation-query.backend.service.test.ts +150 -0
- package/src/databases/services/aggregation/__tests__/computed-measure-evaluator.test.ts +525 -0
- package/src/databases/services/aggregation/__tests__/field-access-validator.test.ts +458 -0
- package/src/databases/services/aggregation/__tests__/time-series-densifier.test.ts +631 -0
- package/src/databases/services/aggregation/__tests__/window-function-processor.test.ts +598 -0
- package/src/databases/services/aggregation/aggregation-authorization.backend.service.ts +516 -0
- package/src/databases/services/aggregation/aggregation-query.backend.service.ts +514 -0
- package/src/databases/services/aggregation/computed-measure-evaluator.backend.service.ts +196 -0
- package/src/databases/services/aggregation/field-access-validator.backend.service.ts +225 -0
- package/src/databases/services/aggregation/time-series-densifier.backend.service.ts +389 -0
- package/src/databases/services/aggregation/topn-processor.backend.service.ts +221 -0
- package/src/databases/services/aggregation/window-function-processor.backend.service.ts +301 -0
- package/src/databases/services/db-utils.ts +96 -0
- package/src/databases/services/mongo-aggregation.backend.service.ts +762 -0
- package/src/databases/services/mongodb.service.ts +736 -0
- package/src/databases/services/postgresql-aggregation.backend.service.ts +794 -0
- package/src/databases/services/postgresql-database.backend.service.ts +288 -0
- package/src/databases/services/postgresql-filter.backend.service.ts +673 -0
- package/src/databases/services/redis.service.ts +531 -0
- package/src/databases/services/zod-to-mongoose-schema-convertor.backend.service.ts +2486 -0
- package/src/databases/services/zod-to-sql-hybrid-schema.planner.ts +312 -0
- package/src/errors/services/__tests__/error-builder.backend.service.test.ts +31 -0
- package/src/errors/services/__tests__/error-handler.backend.service.test.ts +82 -0
- package/src/errors/services/__tests__/mock-error-builder.service.ts +288 -0
- package/src/errors/services/error-builder.backend.service.ts +403 -0
- package/src/errors/services/error-handler.backend.service.ts +236 -0
- package/src/errors/services/rate-limit.backend.service.ts +45 -0
- package/src/external-providers/models/external-providers.backend.schemas.ts +243 -0
- package/src/external-providers/services/__tests__/external-providers-registry.backend.service.test.ts +136 -0
- package/src/external-providers/services/__tests__/feature-bindings.backend.service.test.ts +40 -0
- package/src/external-providers/services/__tests__/mock-external-providers-registry.service.ts +33 -0
- package/src/external-providers/services/__tests__/mock-lazy-provider-registry.service.ts +45 -0
- package/src/external-providers/services/external-api-handler.backend.service.ts +19 -0
- package/src/external-providers/services/external-providers-registry.backend.service.ts +534 -0
- package/src/external-providers/services/feature-bindings.backend.service.ts +422 -0
- package/src/external-providers/services/lazy-provider-registry.backend.service.ts +486 -0
- package/src/features/__tests__/feature-builders.test.ts +152 -0
- package/src/features/controllers/__tests__/features.backend.controller.test.ts +173 -0
- package/src/features/controllers/features.backend.controller.ts +200 -0
- package/src/features/services/__tests__/feature-definition-registry.backend.service.test.ts +152 -0
- package/src/features/services/__tests__/feature-gate.test.ts +484 -0
- package/src/features/services/__tests__/feature-resolution.backend.service.test.ts +203 -0
- package/src/features/services/__tests__/mock-capability-bindings.service.ts +26 -0
- package/src/features/services/__tests__/mock-feature-definition-registry.service.ts +56 -0
- package/src/features/services/__tests__/mock-feature-resolution.service.ts +36 -0
- package/src/features/services/feature-definition-registry.backend.service.ts +537 -0
- package/src/features/services/feature-gate.backend.service.ts +522 -0
- package/src/features/services/feature-resolution.backend.service.ts +652 -0
- package/src/features/testing/feature-test-utils.ts +200 -0
- package/src/files/batches/__tests__/files-cleanup.batch.backend.service.test.ts +186 -0
- package/src/files/batches/files-cleanup.batch.backend.service.ts +259 -0
- package/src/files/constraints/file-analyzers.types.ts +85 -0
- package/src/files/constraints/file-constraint-resolver-chain.backend.service.ts +99 -0
- package/src/files/constraints/file-constraint.types.ts +104 -0
- package/src/files/constraints/file-validation.backend.service.ts +359 -0
- package/src/files/constraints/resource-field-constraint-resolver.backend.service.ts +138 -0
- package/src/files/controllers/__tests__/file.controller.behavior.test.ts +655 -0
- package/src/files/controllers/file.controller.ts +1030 -0
- package/src/files/handlers/__tests__/resource-file-upload-handler.backend.service.test.ts +392 -0
- package/src/files/handlers/resource-file-upload-handler.backend.service.ts +605 -0
- package/src/files/rag/weaviate-vector-store.backend.service.ts +271 -0
- package/src/files/scanning/clamav-scanner.backend.service.ts +214 -0
- package/src/files/scanning/file-scan.types.ts +17 -0
- package/src/files/scanning/yara-scanner.backend.service.ts +212 -0
- package/src/files/services/__tests__/file-field-detection.backend.service.test.ts +91 -0
- package/src/files/services/__tests__/file-operation-handler.backend.service.test.ts +272 -0
- package/src/files/services/__tests__/file-population.backend.service.test.ts +120 -0
- package/src/files/services/__tests__/file-scanning.backend.service.test.ts +163 -0
- package/src/files/services/__tests__/files.backend.service.test.ts +885 -0
- package/src/files/services/__tests__/mock-file-field-detection.service.ts +43 -0
- package/src/files/services/__tests__/mock-file-operation-handler.service.ts +113 -0
- package/src/files/services/__tests__/mock-file-repository.service.ts +104 -0
- package/src/files/services/file-field-detection.backend.service.ts +156 -0
- package/src/files/services/file-operation-handler.backend.service.ts +861 -0
- package/src/files/services/file-population.backend.service.ts +485 -0
- package/src/files/services/file-rag-indexing.backend.service.ts +229 -0
- package/src/files/services/file-scanning.backend.service.ts +373 -0
- package/src/files/services/file-text-extraction.backend.service.ts +193 -0
- package/src/files/services/files.backend.service.ts +1356 -0
- package/src/files/storage/file-storage-path-resolver.backend.service.ts +289 -0
- package/src/files/storage/file-storage-provider.types.ts +188 -0
- package/src/files/storage/file-storage-router.backend.service.ts +172 -0
- package/src/files/storage/local-directory-storage-provider.backend.service.ts +417 -0
- package/src/files/storage/wildo-managed-storage-provider.backend.service.ts +530 -0
- package/src/files/utils/__tests__/file-field-schema-path.backend.utils.test.ts +44 -0
- package/src/files/utils/__tests__/file-uploader.utils.test.ts +57 -0
- package/src/files/utils/__tests__/file-validation.utils.test.ts +559 -0
- package/src/files/utils/file-field-schema-path.backend.utils.ts +385 -0
- package/src/files/utils/file-upload.utils.ts +146 -0
- package/src/files/utils/file-uploader.utils.ts +65 -0
- package/src/files/utils/file-validation.utils.ts +753 -0
- package/src/flows-actors/agent-catalogs.backend.ts +427 -0
- package/src/flows-actors/controllers/flows-actors.controller.ts +91 -0
- package/src/flows-actors/models/agent-catalogs.backend.definitions.ts +430 -0
- package/src/flows-actors/models/agent-facets.backend.definitions.ts +120 -0
- package/src/flows-actors/models/agents.backend.definitions.ts +4 -0
- package/src/flows-actors/models/core-facets.backend.definitions.ts +348 -0
- package/src/flows-actors/models/flows-actors.backend.definitions.ts +13 -0
- package/src/flows-actors/models/flows-actors.backend.schemas.ts +44 -0
- package/src/flows-actors/services/__tests__/agent-facets-catalogs.test.ts +544 -0
- package/src/flows-actors/services/__tests__/agents.backend.service.cli-runtime.test.ts +234 -0
- package/src/flows-actors/services/actors-system.backend.service.ts +270 -0
- package/src/flows-actors/services/agent-facets.backend.service.ts +350 -0
- package/src/flows-actors/services/agents.backend.service.ts +2730 -0
- package/src/flows-actors/services/context-curation.backend.service.ts +203 -0
- package/src/flows-actors/services/flows-actors-registry.service.ts +374 -0
- package/src/flows-actors/services/flows.backend.services.ts +237 -0
- package/src/flows-actors/services/prompt-compiler.backend.service.ts +734 -0
- package/src/flows-actors/utils/__tests__/cli-runtime-operation-support.backend.utils.test.ts +95 -0
- package/src/flows-actors/utils/cli-runtime-operation-support.backend.utils.ts +87 -0
- package/src/flows-actors/utils/cli-runtime-runner.backend.utils.ts +171 -0
- package/src/flows-actors/utils/flows-actors-frontend-extractor.utils.ts +63 -0
- package/src/flows-actors/utils/prompt-ir-adapters.backend.utils.ts +257 -0
- package/src/guidance/batches/dormancy-detection.batch.backend.service.ts +126 -0
- package/src/guidance/services/__tests__/guidance-trigger-evaluator.backend.service.test.ts +49 -0
- package/src/guidance/services/__tests__/lifecycle-evaluator.backend.service.test.ts +85 -0
- package/src/guidance/services/__tests__/milestone-definition-registry.backend.service.test.ts +211 -0
- package/src/guidance/services/__tests__/milestone-evaluator.backend.service.test.ts +561 -0
- package/src/guidance/services/guidance-trigger-evaluator.backend.service.ts +151 -0
- package/src/guidance/services/lifecycle-custom-implementations.backend.ts +139 -0
- package/src/guidance/services/lifecycle-evaluator.backend.service.ts +908 -0
- package/src/guidance/services/milestone-condition-registry.backend.service.ts +57 -0
- package/src/guidance/services/milestone-definition-registry.backend.service.ts +265 -0
- package/src/guidance/services/milestone-evaluator.backend.service.ts +611 -0
- package/src/i18n/controllers/i18n-controller.backend.service.ts +227 -0
- package/src/i18n/services/i18n.backend.service.ts +88 -0
- package/src/index.ts +286 -0
- package/src/inject/models/container.ts +586 -0
- package/src/inject/models/service-types.ts +488 -0
- package/src/monitoring/analytics/controllers/analytics.backend.controller.ts +114 -0
- package/src/monitoring/analytics/services/value-moment-engine.backend.service.ts +53 -0
- package/src/monitoring/analytics/services/value-moment-handler-registry.backend.service.ts +38 -0
- package/src/monitoring/logger/middleware/logging.middleware.ts +40 -0
- package/src/monitoring/logger/models/logger.backend.schemas.ts +56 -0
- package/src/monitoring/logger/services/__tests__/mock-logger.service.ts +49 -0
- package/src/monitoring/logger/services/logger.service.ts +214 -0
- package/src/monitoring/observability/middleware/metrics.middleware.ts +205 -0
- package/src/monitoring/observability/middleware/telemetry.middleware.ts +188 -0
- package/src/monitoring/observability/middleware/tracing.middleware.ts +265 -0
- package/src/monitoring/observability/models/observability.backend.schemas.ts +96 -0
- package/src/monitoring/observability/services/instrumentations/custom.instrumentations.ts +132 -0
- package/src/monitoring/observability/services/metrics.service.ts +266 -0
- package/src/monitoring/observability/services/telemetry.service.ts +157 -0
- package/src/monitoring/observability/services/tracer.service.ts +334 -0
- package/src/notifications/email/components/email-components.ts +341 -0
- package/src/notifications/email/models/email-context-provider.interface.ts +107 -0
- package/src/notifications/email/models/email-template-definition.ts +74 -0
- package/src/notifications/email/models/email-template.actors-system.backend.definitions.ts +80 -0
- package/src/notifications/email/models/email.backend.scheamas.ts +0 -0
- package/src/notifications/email/services/email-batch-send.batch.backend.service.ts +236 -0
- package/src/notifications/email/services/email-context-provider-registry.backend.service.ts +157 -0
- package/src/notifications/email/services/email-renderer.backend.service.ts +274 -0
- package/src/notifications/email/services/email-template-compiler.backend.service.ts +136 -0
- package/src/notifications/email/services/email-template-generation.backend.service.ts +811 -0
- package/src/notifications/email/services/email-template-registry.backend.service.ts +166 -0
- package/src/notifications/email/services/email-template-sandbox.backend.service.ts +255 -0
- package/src/notifications/email/services/email-template-validator.backend.service.ts +229 -0
- package/src/notifications/email/services/email.backend.service.ts +429 -0
- package/src/notifications/email/utils/color-conversion.utils.ts +142 -0
- package/src/notifications/email/utils/interpolate-email-label.utils.ts +16 -0
- package/src/notifications/email/utils/zod-to-typescript.utils.ts +352 -0
- package/src/notifications/services/__tests__/notifications-dispatcher.operation-semantics.test.ts +773 -0
- package/src/notifications/services/__tests__/notifications-dispatcher.websocket-integration.test.ts +173 -0
- package/src/notifications/services/notification-badge.backend.service.ts +412 -0
- package/src/notifications/services/notifications-dispatcher.backend.service.ts +1696 -0
- package/src/notifications/sms/services/sms.backend.service.ts +283 -0
- package/src/notifications/webhooks/controllers/webhook-auto-controller.backend.service.ts +220 -0
- package/src/notifications/webhooks/services/polymorphic-lookup.backend.service.ts +131 -0
- package/src/notifications/webhooks/services/webhook-handler.backend.service.ts +481 -0
- package/src/organizations/services/__tests__/org-creation-on-registration.backend.utils.test.ts +193 -0
- package/src/organizations/services/__tests__/org-member-roles-validation.backend.utils.test.ts +101 -0
- package/src/organizations/services/__tests__/organization-custom-implementation.backend.service.test.ts +113 -0
- package/src/organizations/services/__tests__/scim-provisioning-gate.backend.utils.test.ts +94 -0
- package/src/organizations/services/__tests__/user-org-type-grant.backend.utils.test.ts +164 -0
- package/src/organizations/services/__tests__/user-type-revocation-on-org-leave.backend.utils.test.ts +161 -0
- package/src/organizations/services/org-creation-on-registration.backend.utils.ts +119 -0
- package/src/organizations/services/org-member-roles-validation.backend.utils.ts +51 -0
- package/src/organizations/services/organization-custom-implementation.backend.service.ts +106 -0
- package/src/organizations/services/organization-member-custom-implementation.backend.service.ts +150 -0
- package/src/organizations/services/scim-provisioning-gate.backend.utils.ts +34 -0
- package/src/organizations/services/user-org-type-grant.backend.utils.ts +49 -0
- package/src/organizations/services/user-type-revocation-on-org-leave.backend.utils.ts +102 -0
- package/src/queue/adapters/rabbitmq-adapter.backend.service.ts +494 -0
- package/src/queue/apps-crontabs-manager.backend.service.ts +258 -0
- package/src/queue/cron-job-sync.backend.service.ts +184 -0
- package/src/queue/domain-queue-consumer.backend.service.ts +333 -0
- package/src/queue/job-completion-registry.backend.service.ts +342 -0
- package/src/queue/job-consumer.backend.service.ts +646 -0
- package/src/queue/job-executor.backend.service.ts +315 -0
- package/src/queue/job-payload-storage.backend.service.ts +297 -0
- package/src/queue/job-status-tracking.backend.service.ts +376 -0
- package/src/queue/queue-monitoring.backend.service.ts +333 -0
- package/src/queue/queue-worker-initializer.backend.service.ts +179 -0
- package/src/queue/queue.backend.service.ts +530 -0
- package/src/queue/scheduled-message-verifier.backend.service.ts +228 -0
- package/src/queue/worker-shutdown-manager.backend.service.ts +298 -0
- package/src/requests/models/api-routes.backend.defintions.ts +45 -0
- package/src/requests/models/requests.backend.schemas.ts +73 -0
- package/src/requests/service/__tests__/websocket.service.auth-refresh.test.ts +361 -0
- package/src/requests/service/__tests__/websocket.service.resource-room-validation.test.ts +234 -0
- package/src/requests/service/__tests__/websocket.service.variant-authorization.test.ts +94 -0
- package/src/requests/service/platform-mutualized-handler.backend.service.ts +19 -0
- package/src/requests/service/platform-requests.backend.utils.ts +54 -0
- package/src/requests/service/remote-client-base.backend.service.ts +485 -0
- package/src/requests/service/serverless-services-handler.backend.service.ts +19 -0
- package/src/requests/service/websocket.service.ts +2844 -0
- package/src/resources/models/custom-service-implementations.backend.definition.ts +22 -0
- package/src/resources/models/index.ts +7 -0
- package/src/resources/models/resources-operations.backend.definitions.ts +9 -0
- package/src/resources/models/resources-relationships.backend.definitions.ts +30 -0
- package/src/resources/models/resources-types.backend.schemas.ts +14 -0
- package/src/resources/models/resources.backend.schemas.ts +6 -0
- package/src/resources/models/virtual-fields.backend.types.ts +132 -0
- package/src/resources/services/__tests__/mock-resources-registry.service.ts +69 -0
- package/src/resources/services/__tests__/resource-id.backend.service.test.ts +69 -0
- package/src/resources/services/resource-context.backend.service.ts +1107 -0
- package/src/resources/services/resource-id.backend.service.ts +280 -0
- package/src/resources/services/resource-population.backend.service.ts +761 -0
- package/src/resources/services/resources-registry.backend.service.ts +1126 -0
- package/src/resources/services/virtual-fields.backend.service.ts +303 -0
- package/src/runtime/__tests__/execution-context-creator.backend.service.test.ts +469 -0
- package/src/runtime/controllers/health-controller.backend.service.ts +297 -0
- package/src/runtime/domain-module.backend.definitions.test.ts +83 -0
- package/src/runtime/domain-module.backend.definitions.ts +161 -0
- package/src/runtime/models/execution-context.backend.schemas.ts +456 -0
- package/src/runtime/models/runtime.backend.schemas.ts +82 -0
- package/src/runtime/services/execution-context-creator.backend.service.ts +2102 -0
- package/src/runtime/services/execution-context-handler.backend.service.ts +224 -0
- package/src/runtime/services/health-readiness-contributor.backend.interface.ts +11 -0
- package/src/runtime/services/http-server.backend.service.ts +870 -0
- package/src/runtime/services/start-application.backend.service.ts +1109 -0
- package/src/runtime/testing/execution-context-test-fixtures.ts +14 -0
- package/src/runtime/testing/mock-execution-context-creator.service.ts +46 -0
- package/src/runtime/utils/scan-default-exports.backend.utils.ts +247 -0
- package/src/security/authentications/__tests__/auth-registration.test.ts +338 -0
- package/src/security/authentications/__tests__/authentication-controller.test.ts +31 -0
- package/src/security/authentications/__tests__/authentication-orchestrator.test.ts +27 -0
- package/src/security/authentications/__tests__/saml-assertion-validator.test.ts +631 -0
- package/src/security/authentications/__tests__/saml-authentication.test.ts +126 -0
- package/src/security/authentications/__tests__/saml-integration-test-helpers.test.ts +234 -0
- package/src/security/authentications/__tests__/saml-metadata.test.ts +185 -0
- package/src/security/authentications/__tests__/saml-replay-guard.test.ts +99 -0
- package/src/security/authentications/__tests__/saml-sso-flow.integration.test.ts +355 -0
- package/src/security/authentications/__tests__/saml-test-fixtures.test.ts +433 -0
- package/src/security/authentications/__tests__/saml-test-parser.test.ts +117 -0
- package/src/security/authentications/__tests__/sso-connection-custom-ops.integration.test.ts +236 -0
- package/src/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.ts +71 -0
- package/src/security/authentications/controllers/auth-method-management-controller.backend.service.ts +205 -0
- package/src/security/authentications/controllers/authentication-controller.backend.service.ts +2712 -0
- package/src/security/authentications/models/auth-constants.backend.ts +141 -0
- package/src/security/authentications/models/authentications.backend.schemas.ts +106 -0
- package/src/security/authentications/models/jwt.backend.schemas.ts +107 -0
- package/src/security/authentications/models/oauth2-connection.backend.schemas.ts +196 -0
- package/src/security/authentications/models/saml-authentication.backend.schemas.ts +124 -0
- package/src/security/authentications/models/sso-connection.backend.schemas.ts +104 -0
- package/src/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.ts +73 -0
- package/src/security/authentications/services/__tests__/mock-auth-token-issuer.service.ts +46 -0
- package/src/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.ts +40 -0
- package/src/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.ts +67 -0
- package/src/security/authentications/services/admin-config/auth-organization-configuration.service.ts +424 -0
- package/src/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.ts +244 -0
- package/src/security/authentications/services/admin-config/domain-verification.backend.service.ts +215 -0
- package/src/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.ts +509 -0
- package/src/security/authentications/services/admin-config/oidc-discovery.backend.service.ts +250 -0
- package/src/security/authentications/services/anonymous-session.backend.service.ts +442 -0
- package/src/security/authentications/services/auth-credential-verifier.backend.service.ts +147 -0
- package/src/security/authentications/services/auth-execution-context-factory.backend.service.ts +132 -0
- package/src/security/authentications/services/auth-methods/auth-method-management.backend.service.ts +532 -0
- package/src/security/authentications/services/auth-methods/auth-mfa.backend.service.ts +141 -0
- package/src/security/authentications/services/auth-methods/auth-password-reset.backend.service.ts +215 -0
- package/src/security/authentications/services/auth-methods/auth-phone-verification.backend.service.ts +136 -0
- package/src/security/authentications/services/auth-methods/auth-registration.backend.service.ts +994 -0
- package/src/security/authentications/services/auth-methods/oauth2-authentication.backend.service.ts +1210 -0
- package/src/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.ts +903 -0
- package/src/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.ts +791 -0
- package/src/security/authentications/services/auth-methods/saml-authentication.backend.service.ts +1727 -0
- package/src/security/authentications/services/auth-methods/saml-metadata.backend.service.ts +432 -0
- package/src/security/authentications/services/auth-methods/saml-replay-guard.backend.service.ts +90 -0
- package/src/security/authentications/services/auth-methods/webauthn.backend.service.ts +393 -0
- package/src/security/authentications/services/auth-session-store.backend.service.ts +211 -0
- package/src/security/authentications/services/auth-token-issuer.backend.service.ts +496 -0
- package/src/security/authentications/services/authentication-orchestrator.backend.service.ts +3156 -0
- package/src/security/authentications/services/custom-impls/auth-custom-implementations.backend.ts +88 -0
- package/src/security/authentications/services/custom-impls/auth-policy.custom-impl.backend.service.ts +54 -0
- package/src/security/authentications/services/custom-impls/scim-provisioning-config.custom-impl.backend.service.ts +167 -0
- package/src/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.ts +136 -0
- package/src/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.ts +123 -0
- package/src/security/authentications/services/custom-impls/siem-export-config.custom-impl.backend.service.ts +161 -0
- package/src/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.ts +185 -0
- package/src/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.ts +792 -0
- package/src/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.ts +62 -0
- package/src/security/authentications/services/utils/auth-controller.utils.ts +51 -0
- package/src/security/authentications/services/utils/auth-credential-ops.backend.service.ts +202 -0
- package/src/security/authentications/services/utils/auth-response-helper.backend.service.ts +38 -0
- package/src/security/authentications/services/utils/auth-user-lookup.backend.service.ts +128 -0
- package/src/security/authentications/services/utils/saml-java-availability.ts +64 -0
- package/src/security/authorizations/__tests__/authorizations.backend.service.test.ts +82 -0
- package/src/security/authorizations/services/authorizations.backend.service.ts +934 -0
- package/src/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.ts +168 -0
- package/src/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.ts +92 -0
- package/src/security/consumable-tokens/models/consumable-tokens.shared.schemas.ts +86 -0
- package/src/security/consumable-tokens/models/index.ts +3 -0
- package/src/security/consumable-tokens/services/__tests__/mock-consumable-token.service.ts +63 -0
- package/src/security/consumable-tokens/services/consumable-token.backend.service.ts +568 -0
- package/src/security/jwt/services/auth-jwt-guard.backend.service.ts +137 -0
- package/src/security/jwt/services/jwt.backend.service.ts +397 -0
- package/src/security/scim/__tests__/scim-filter-parser.test.ts +121 -0
- package/src/security/scim/controllers/scim.backend.controller.ts +1066 -0
- package/src/security/scim/models/scim-protocol.backend.schemas.ts +258 -0
- package/src/security/scim/utils/scim-filter-parser.ts +289 -0
- package/src/security/scim/utils/scim-response-formatter.ts +122 -0
- package/src/testing.ts +30 -0
- package/src/types/xmldom.d.ts +9 -0
- package/src/users/services/user-self-custom-implementations.backend.ts +62 -0
|
@@ -0,0 +1,2186 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ResourceConfiguration,
|
|
5
|
+
ResourceConfiguration_Operation,
|
|
6
|
+
ResourceConfiguration_OperationRepositoryPath,
|
|
7
|
+
CollectionView_SearchOptions,
|
|
8
|
+
Resources_PaginationRequest
|
|
9
|
+
} from '@wildo-ai/saas-models';
|
|
10
|
+
import {
|
|
11
|
+
CoreResourceOperation,
|
|
12
|
+
ErrorCustomMessageReference,
|
|
13
|
+
ErrorType,
|
|
14
|
+
ResourceOperationsUtils,
|
|
15
|
+
Resources_PaginatedResult,
|
|
16
|
+
ResourcesConfig_OperationPathUtils,
|
|
17
|
+
ResourceType,
|
|
18
|
+
WildoError_Backend
|
|
19
|
+
} from '@wildo-ai/saas-models';
|
|
20
|
+
import { EnumLikeType } from '@wildo-ai/zod-decorators';
|
|
21
|
+
import type { FieldMetaEntry } from '@wildo-ai/saas-models';
|
|
22
|
+
import {
|
|
23
|
+
lwwFieldWinner,
|
|
24
|
+
CrdtResolutionWinner,
|
|
25
|
+
nextMonotonicTimestamp,
|
|
26
|
+
isCrdtOnlyUpdate,
|
|
27
|
+
sanitizeFieldMeta,
|
|
28
|
+
extractCrdtFieldNames,
|
|
29
|
+
} from '@wildo-ai/saas-models';
|
|
30
|
+
import { Connection, Document, FilterQuery, Model, Types } from 'mongoose';
|
|
31
|
+
|
|
32
|
+
import { z } from 'zod';
|
|
33
|
+
import type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';
|
|
34
|
+
import type { ZodToMongooseSchemaConvertorBackendService } from '~wildo-backend-lib/databases/services/zod-to-mongoose-schema-convertor.backend.service';
|
|
35
|
+
import { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';
|
|
36
|
+
import { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';
|
|
37
|
+
import { ResourceIdBackendService } from '~wildo-backend-lib/resources/services/resource-id.backend.service';
|
|
38
|
+
import { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';
|
|
39
|
+
import { IdOrFilterType, IdOrIdsOrFilterType, IdsOrFilterType, RepositoryOptions } from '~wildo-backend-lib/base-classes/models/repositories.backend.schemas';
|
|
40
|
+
import { ResourceOperationHelperBackendService } from '~wildo-backend-lib/base-classes/services/resource-operations-helper.backend.service';
|
|
41
|
+
import {
|
|
42
|
+
MainSchemaType,
|
|
43
|
+
PartialMainSchemaType,
|
|
44
|
+
MainSchemaArrayType,
|
|
45
|
+
ConditionalReturnType,
|
|
46
|
+
ConditionalArrayReturnType,
|
|
47
|
+
ConditionalNullableReturnType
|
|
48
|
+
} from '~wildo-backend-lib/base-classes/utils/backend-type-utils';
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
const DEBUG_ACTIVATED = false;
|
|
52
|
+
|
|
53
|
+
// Forward declaration to avoid circular dependency
|
|
54
|
+
type RepositoriesRegistryHandlerBackendService = any;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Factory interface for creating repository resource instances
|
|
58
|
+
*
|
|
59
|
+
* NOTE: TDatabaseSchema has been removed. Backend-only fields are now marked with
|
|
60
|
+
* the `isBackendOnly` decorator on mainSchema and handled at the service layer.
|
|
61
|
+
*/
|
|
62
|
+
export interface RepositoryResourceFactory {
|
|
63
|
+
create<
|
|
64
|
+
TCustomOperationEnum extends EnumLikeType | undefined = undefined,
|
|
65
|
+
TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,
|
|
66
|
+
TMainSchema extends z.ZodTypeAny = z.ZodTypeAny
|
|
67
|
+
>(
|
|
68
|
+
resourceConfiguration: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>
|
|
69
|
+
): RepositoryResourceBackendService<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* MongoDB Repository Implementation
|
|
74
|
+
*
|
|
75
|
+
* This class provides the MongoDB/Mongoose implementation of the resource repository.
|
|
76
|
+
* It conforms to the `BackendResourceRepository` interface contract through TypeScript's
|
|
77
|
+
* structural typing.
|
|
78
|
+
*
|
|
79
|
+
* ## Transaction Support
|
|
80
|
+
*
|
|
81
|
+
* Uses the `getNativeSession()` helper to extract the Mongoose ClientSession from
|
|
82
|
+
* the database-agnostic `options.transaction.nativeSession` (TransactionContext).
|
|
83
|
+
*
|
|
84
|
+
* @see BackendResourceRepository in repositories-registry-handler.backend.service.ts
|
|
85
|
+
* @see PostgreSQLResourceRepositoryBackendService for PostgreSQL implementation
|
|
86
|
+
*/
|
|
87
|
+
export class RepositoryResourceBackendService<
|
|
88
|
+
TCustomOperationEnum extends EnumLikeType | undefined = undefined,
|
|
89
|
+
TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,
|
|
90
|
+
TMainSchema extends z.ZodTypeAny = z.ZodTypeAny
|
|
91
|
+
> {
|
|
92
|
+
|
|
93
|
+
private readonly resourceConfiguration: ResourceConfiguration<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>;
|
|
94
|
+
private readonly mongooseModel: Model<any & Document>;
|
|
95
|
+
private readonly inheritanceModels: Map<string, Model<any & Document>>;
|
|
96
|
+
private readonly operationsMap: Map<string, ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>;
|
|
97
|
+
|
|
98
|
+
protected logDebug: (message: string, context?: Record<string, unknown>) => void;
|
|
99
|
+
|
|
100
|
+
constructor(
|
|
101
|
+
resourceType: ResourceType,
|
|
102
|
+
private readonly zodToMongooseConverter: ZodToMongooseSchemaConvertorBackendService,
|
|
103
|
+
private readonly logger: LoggerService,
|
|
104
|
+
private readonly errorBuilder: ErrorBuilderBackendService,
|
|
105
|
+
private readonly resourceRegistry: ResourcesRegistryBackendService,
|
|
106
|
+
private readonly resourceOperationHelper: ResourceOperationHelperBackendService,
|
|
107
|
+
private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,
|
|
108
|
+
private readonly connection: Connection | undefined = undefined,
|
|
109
|
+
private readonly resourceIdService?: ResourceIdBackendService,
|
|
110
|
+
) {
|
|
111
|
+
this.resourceConfiguration = this.resourceRegistry.getResourceConfiguration(resourceType);
|
|
112
|
+
this.zodToMongooseConverter = zodToMongooseConverter;
|
|
113
|
+
|
|
114
|
+
this.inheritanceModels = new Map();
|
|
115
|
+
this.operationsMap = new Map();
|
|
116
|
+
|
|
117
|
+
this.logDebug = this.logger.debugByType(`RepositoryResource_${resourceType}`);
|
|
118
|
+
this.logger.setDebugTypeLogging(`RepositoryResource_${resourceType}`, DEBUG_ACTIVATED);
|
|
119
|
+
|
|
120
|
+
// Initialize mongoose model and operations
|
|
121
|
+
this.mongooseModel = this.initializeMongooseModel();
|
|
122
|
+
this.initializeOperationsMap();
|
|
123
|
+
|
|
124
|
+
this.logDebug('Repository resource service created', { resourceType: this.resourceConfiguration.resourceIdentifier, operationsCount: this.operationsMap.size, hasInheritance: this.inheritanceModels.size > 0 });
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ================================
|
|
128
|
+
// Transaction Session Helper
|
|
129
|
+
// ================================
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get the native Mongoose session from repository options.
|
|
133
|
+
*
|
|
134
|
+
* Extracts the Mongoose ClientSession from the database-agnostic TransactionContext.
|
|
135
|
+
* Includes runtime safety check to ensure MongoDB repository doesn't receive
|
|
136
|
+
* a PostgreSQL transaction context.
|
|
137
|
+
*
|
|
138
|
+
* @param options - Repository options that may contain transaction
|
|
139
|
+
* @returns The Mongoose ClientSession or undefined
|
|
140
|
+
* @throws Error if a non-MongoDB transaction is provided
|
|
141
|
+
*/
|
|
142
|
+
protected getNativeSession(options?: RepositoryOptions): import('mongoose').ClientSession | undefined {
|
|
143
|
+
if (!options?.transaction) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Runtime safety check: ensure this is a MongoDB transaction
|
|
148
|
+
if (options.transaction.databaseType !== 'mongodb') {
|
|
149
|
+
throw new Error(
|
|
150
|
+
`MongoDB repository received non-MongoDB transaction. ` +
|
|
151
|
+
`Expected databaseType='mongodb', got '${options.transaction.databaseType}'. ` +
|
|
152
|
+
`This indicates a configuration error where a resource is using the wrong persistence adapter.`
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
return options.transaction.nativeSession as import('mongoose').ClientSession | undefined;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// ================================
|
|
159
|
+
// Initialization
|
|
160
|
+
// ================================
|
|
161
|
+
|
|
162
|
+
static createInstance<
|
|
163
|
+
TCustomOperationEnum extends EnumLikeType | undefined = undefined,
|
|
164
|
+
TCoreOperationEnum extends Partial<CoreResourceOperation> | undefined = undefined,
|
|
165
|
+
TMainSchema extends z.ZodTypeAny = z.ZodTypeAny
|
|
166
|
+
>(
|
|
167
|
+
resourceType: ResourceType,
|
|
168
|
+
zodToMongooseConverter: ZodToMongooseSchemaConvertorBackendService,
|
|
169
|
+
logger: LoggerService,
|
|
170
|
+
errorBuilder: ErrorBuilderBackendService,
|
|
171
|
+
resourceRegistry: ResourcesRegistryBackendService,
|
|
172
|
+
resourceOperationHelper: ResourceOperationHelperBackendService,
|
|
173
|
+
repositoriesRegistry: RepositoriesRegistryHandlerBackendService,
|
|
174
|
+
connection: Connection | undefined = undefined,
|
|
175
|
+
resourceIdService?: ResourceIdBackendService,
|
|
176
|
+
): RepositoryResourceBackendService<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> {
|
|
177
|
+
return new RepositoryResourceBackendService(
|
|
178
|
+
resourceType,
|
|
179
|
+
zodToMongooseConverter,
|
|
180
|
+
logger,
|
|
181
|
+
errorBuilder,
|
|
182
|
+
resourceRegistry,
|
|
183
|
+
resourceOperationHelper,
|
|
184
|
+
repositoriesRegistry,
|
|
185
|
+
connection,
|
|
186
|
+
resourceIdService,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
private initializeOperationsMap(): void {
|
|
191
|
+
if (!this.resourceConfiguration.operations) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
this.resourceConfiguration.operations.forEach(operation => {
|
|
196
|
+
const operationKey = ResourcesConfig_OperationPathUtils.createOperationRepositoryPathKeyFromOperation(operation as any);
|
|
197
|
+
this.operationsMap.set(operationKey, operation);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
this.logDebug('Operations map initialized', {
|
|
201
|
+
operationsCount: this.operationsMap.size,
|
|
202
|
+
operationKeys: Array.from(this.operationsMap.keys())
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
private initializeMongooseModel(): Model<any & Document> {
|
|
207
|
+
try {
|
|
208
|
+
const modelResult = this.zodToMongooseConverter.convertResourceConfigurationToModel(
|
|
209
|
+
this.resourceConfiguration,
|
|
210
|
+
{
|
|
211
|
+
includeIndexes: true,
|
|
212
|
+
applyDefaults: true,
|
|
213
|
+
connection: this.connection
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
// Store inheritance models if any
|
|
218
|
+
// Use a Set to track created discriminator values to avoid duplicates
|
|
219
|
+
const createdDiscriminatorValues = new Set<string>();
|
|
220
|
+
modelResult.inheritanceSchemas.forEach(inheritance => {
|
|
221
|
+
// Skip if discriminator with this value already exists
|
|
222
|
+
if (createdDiscriminatorValues.has(inheritance.discriminatorValue)) {
|
|
223
|
+
this.logDebug(`Skipping duplicate discriminator value: ${inheritance.discriminatorValue}`, {
|
|
224
|
+
discriminatorKey: inheritance.discriminatorKey,
|
|
225
|
+
discriminatorValue: inheritance.discriminatorValue
|
|
226
|
+
});
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
try {
|
|
231
|
+
// Check if discriminator already exists on the model
|
|
232
|
+
const existingDiscriminator = (modelResult.mainModel as any).discriminators?.[inheritance.discriminatorValue];
|
|
233
|
+
if (existingDiscriminator) {
|
|
234
|
+
this.logDebug(`Discriminator already exists, reusing: ${inheritance.discriminatorValue}`, {
|
|
235
|
+
discriminatorKey: inheritance.discriminatorKey,
|
|
236
|
+
discriminatorValue: inheritance.discriminatorValue
|
|
237
|
+
});
|
|
238
|
+
this.inheritanceModels.set(inheritance.discriminatorValue, existingDiscriminator);
|
|
239
|
+
createdDiscriminatorValues.add(inheritance.discriminatorValue);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Create inheritance model from schema
|
|
244
|
+
const inheritanceModel = modelResult.mainModel.discriminator(
|
|
245
|
+
inheritance.discriminatorValue,
|
|
246
|
+
inheritance.schema
|
|
247
|
+
);
|
|
248
|
+
this.inheritanceModels.set(inheritance.discriminatorValue, inheritanceModel);
|
|
249
|
+
createdDiscriminatorValues.add(inheritance.discriminatorValue);
|
|
250
|
+
} catch (error: any) {
|
|
251
|
+
// If discriminator already exists, try to get it
|
|
252
|
+
if (error?.message?.includes('already exists')) {
|
|
253
|
+
this.logDebug(`Discriminator already exists, attempting to retrieve: ${inheritance.discriminatorValue}`, {
|
|
254
|
+
discriminatorKey: inheritance.discriminatorKey,
|
|
255
|
+
discriminatorValue: inheritance.discriminatorValue
|
|
256
|
+
});
|
|
257
|
+
const existingDiscriminator = (modelResult.mainModel as any).discriminators?.[inheritance.discriminatorValue];
|
|
258
|
+
if (existingDiscriminator) {
|
|
259
|
+
this.inheritanceModels.set(inheritance.discriminatorValue, existingDiscriminator);
|
|
260
|
+
createdDiscriminatorValues.add(inheritance.discriminatorValue);
|
|
261
|
+
} else {
|
|
262
|
+
this.logger.warn(`Failed to create or retrieve discriminator: ${inheritance.discriminatorValue}`, {
|
|
263
|
+
error: error.message,
|
|
264
|
+
discriminatorKey: inheritance.discriminatorKey
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
} else {
|
|
268
|
+
throw error;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
this.logDebug('Mongoose model initialized', {
|
|
274
|
+
modelName: modelResult.mainModel.modelName,
|
|
275
|
+
inheritanceCount: this.inheritanceModels.size
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
return modelResult.mainModel;
|
|
279
|
+
} catch (error) {
|
|
280
|
+
this.logger.error('Failed to initialize mongoose model', {
|
|
281
|
+
resourceType: this.resourceConfiguration.resourceIdentifier,
|
|
282
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
283
|
+
});
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
// ================================
|
|
290
|
+
// Getters
|
|
291
|
+
// ================================
|
|
292
|
+
|
|
293
|
+
public getInheritanceModel(discriminatorValue: string): Model<any & Document> | undefined {
|
|
294
|
+
return this.inheritanceModels.get(discriminatorValue);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// ================================
|
|
298
|
+
// Execution
|
|
299
|
+
// ================================
|
|
300
|
+
|
|
301
|
+
public async doByPath<T = any, U = any>(
|
|
302
|
+
operationRepositoryPath: ResourceConfiguration_OperationRepositoryPath,
|
|
303
|
+
executionContext: ExecutionContext<any>,
|
|
304
|
+
id_or_ids_or_filter?: IdOrIdsOrFilterType,
|
|
305
|
+
data?: U,
|
|
306
|
+
options?: RepositoryOptions
|
|
307
|
+
): Promise<T> {
|
|
308
|
+
const operationRepositoryPathKey = ResourcesConfig_OperationPathUtils.createOperationRepositoryPathKey(operationRepositoryPath);
|
|
309
|
+
|
|
310
|
+
this.logDebug('Executing operation by repository path', { operationRepositoryPath, operationRepositoryPathKey, hasData: !!data, id_or_ids_or_filter });
|
|
311
|
+
|
|
312
|
+
return this.doByKey( operationRepositoryPathKey, executionContext, id_or_ids_or_filter, data, options );
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Execute operation by operation repository path key (string)
|
|
317
|
+
*/
|
|
318
|
+
public async doByKey<T = any, U = any>(
|
|
319
|
+
operationRepositoryPathKey: string,
|
|
320
|
+
executionContext: ExecutionContext<any>,
|
|
321
|
+
id_or_ids_or_filter?: IdOrIdsOrFilterType,
|
|
322
|
+
data?: U,
|
|
323
|
+
options?: RepositoryOptions
|
|
324
|
+
): Promise<T> {
|
|
325
|
+
|
|
326
|
+
ResourcesConfig_OperationPathUtils.validateOperationRepositoryPathKey(operationRepositoryPathKey);
|
|
327
|
+
|
|
328
|
+
const operation = this.operationsMap.get(operationRepositoryPathKey);
|
|
329
|
+
|
|
330
|
+
if (!operation) {
|
|
331
|
+
throw this.errorBuilder.buildError( ErrorType.NOT_FOUND, executionContext,
|
|
332
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationRepositoryPathKey } } );
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
this.logDebug('Executing operation by repository path key', { operationRepositoryPathKey, hasData: !!data, id_or_ids_or_filter });
|
|
336
|
+
|
|
337
|
+
return this.doOperation(operation, executionContext, id_or_ids_or_filter, data, options);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
public async doByExecutionContext<T = any>(
|
|
341
|
+
executionContext: ExecutionContext<ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>>,
|
|
342
|
+
data?: any,
|
|
343
|
+
options?: RepositoryOptions
|
|
344
|
+
): Promise<T> {
|
|
345
|
+
const operation = executionContext.operation;
|
|
346
|
+
|
|
347
|
+
// Extract IDs based on resourceFieldIdentifier from execution context
|
|
348
|
+
const id_or_ids_or_filter = this.resourceOperationHelper.extractIdsFromExecutionContext(executionContext, this.resourceConfiguration.resourceFieldIdentifier);
|
|
349
|
+
|
|
350
|
+
this.logDebug('Executing operation by execution context', {
|
|
351
|
+
operationIdentifier: operation.operationIdentifier,
|
|
352
|
+
resourceIdentifier: operation.resourceIdentifier,
|
|
353
|
+
hasData: !!data,
|
|
354
|
+
extractedIds: id_or_ids_or_filter,
|
|
355
|
+
resourceFieldIdentifier: this.resourceConfiguration.resourceFieldIdentifier
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
return this.doOperation(operation, executionContext, id_or_ids_or_filter, data, options);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
private async _prefixOperation(
|
|
362
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
363
|
+
executionContext: ExecutionContext<any>,
|
|
364
|
+
id_or_ids_or_filter?: IdOrIdsOrFilterType,
|
|
365
|
+
data?: any,
|
|
366
|
+
options?: RepositoryOptions
|
|
367
|
+
): Promise<void> {
|
|
368
|
+
// Authorization is handled at the controller/middleware layer before reaching the repository.
|
|
369
|
+
// Repository-level prefix operations are reserved for data-level pre-processing (e.g., input normalization).
|
|
370
|
+
// Operation-level authorization is enforced by the ResourceOperationService via role + variant checks.
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
private async _postfixOperation(
|
|
374
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
375
|
+
executionContext: ExecutionContext<any>,
|
|
376
|
+
id_or_ids_or_filter?: IdOrIdsOrFilterType,
|
|
377
|
+
data?: any,
|
|
378
|
+
options?: RepositoryOptions
|
|
379
|
+
): Promise<void> {
|
|
380
|
+
// Post-operation hook reserved for data-level post-processing (e.g., cache invalidation).
|
|
381
|
+
// Currently no-op by design — business logic runs at the service layer.
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Execute a specific operation
|
|
386
|
+
*/
|
|
387
|
+
private async doOperation(
|
|
388
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
389
|
+
executionContext: ExecutionContext<any>,
|
|
390
|
+
id_or_ids_or_filter?: IdOrIdsOrFilterType,
|
|
391
|
+
data?: any,
|
|
392
|
+
options?: RepositoryOptions
|
|
393
|
+
): Promise<any> {
|
|
394
|
+
const operationRepositoryPathKey = ResourcesConfig_OperationPathUtils.createOperationRepositoryPathKeyFromOperation(operation);
|
|
395
|
+
|
|
396
|
+
if(operation.resourceIdentifier !== this.resourceConfiguration.resourceIdentifier) {
|
|
397
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
398
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationRepositoryPathKey, resourceIdentifier: this.resourceConfiguration.resourceIdentifier } } );
|
|
399
|
+
}
|
|
400
|
+
const operationIdentifier = ResourceOperationsUtils.getCoreResourceOperationFromOperation(operation);
|
|
401
|
+
|
|
402
|
+
if (!operationIdentifier) {
|
|
403
|
+
|
|
404
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
405
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationRepositoryPathKey } } );
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
await this._prefixOperation(operation, executionContext, id_or_ids_or_filter, data, options);
|
|
409
|
+
|
|
410
|
+
let operationResult: any;
|
|
411
|
+
// Handle core operations
|
|
412
|
+
switch (operationIdentifier) {
|
|
413
|
+
case CoreResourceOperation.CREATE:
|
|
414
|
+
operationResult = await this._doCreate(operation, executionContext, data, options);
|
|
415
|
+
break;
|
|
416
|
+
|
|
417
|
+
case CoreResourceOperation.CREATE_MANY:
|
|
418
|
+
operationResult = await this._doCreateMany(operation, executionContext, data, options);
|
|
419
|
+
break;
|
|
420
|
+
|
|
421
|
+
case CoreResourceOperation.READ:
|
|
422
|
+
if(Array.isArray(id_or_ids_or_filter)) {
|
|
423
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
424
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED,
|
|
425
|
+
context: { operationRepositoryPathKey, resourceIdentifier: this.resourceConfiguration.resourceIdentifier, id_or_ids_or_filter } } );
|
|
426
|
+
}
|
|
427
|
+
operationResult = await this._doRead(operation, executionContext, id_or_ids_or_filter as IdOrFilterType, options);
|
|
428
|
+
break;
|
|
429
|
+
|
|
430
|
+
case CoreResourceOperation.UPDATE:
|
|
431
|
+
if(Array.isArray(id_or_ids_or_filter)) {
|
|
432
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
433
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED,
|
|
434
|
+
context: { operationRepositoryPathKey, resourceIdentifier: this.resourceConfiguration.resourceIdentifier, id_or_ids_or_filter } } );
|
|
435
|
+
}
|
|
436
|
+
operationResult = await this._doUpdate(operation, executionContext, id_or_ids_or_filter as IdOrFilterType, data, options);
|
|
437
|
+
break;
|
|
438
|
+
|
|
439
|
+
case CoreResourceOperation.UPDATE_MANY:
|
|
440
|
+
operationResult = await this._doUpdateMany(operation, executionContext, id_or_ids_or_filter as IdsOrFilterType, data, options);
|
|
441
|
+
break;
|
|
442
|
+
|
|
443
|
+
case CoreResourceOperation.DELETE:
|
|
444
|
+
if(Array.isArray(id_or_ids_or_filter)) {
|
|
445
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
446
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED,
|
|
447
|
+
context: { operationRepositoryPathKey, resourceIdentifier: this.resourceConfiguration.resourceIdentifier, id_or_ids_or_filter } } );
|
|
448
|
+
}
|
|
449
|
+
operationResult = await this._doDelete(operation, executionContext, id_or_ids_or_filter as IdOrIdsOrFilterType, options);
|
|
450
|
+
break;
|
|
451
|
+
|
|
452
|
+
case CoreResourceOperation.DELETE_MANY:
|
|
453
|
+
const idToDelete = typeof id_or_ids_or_filter === 'string' ? [id_or_ids_or_filter] : id_or_ids_or_filter;
|
|
454
|
+
operationResult = await this._doDeleteMany(operation, executionContext, idToDelete as IdsOrFilterType, options);
|
|
455
|
+
break;
|
|
456
|
+
|
|
457
|
+
case CoreResourceOperation.LIST:
|
|
458
|
+
// For LIST operation, return paginated format
|
|
459
|
+
const idsToList = typeof id_or_ids_or_filter === 'string' ? [id_or_ids_or_filter] : id_or_ids_or_filter;
|
|
460
|
+
const listResult = await this._doList(operation, executionContext, idsToList as IdsOrFilterType, options);
|
|
461
|
+
operationResult = listResult;
|
|
462
|
+
break;
|
|
463
|
+
|
|
464
|
+
case CoreResourceOperation.COUNT:
|
|
465
|
+
operationResult = await this._doCount(
|
|
466
|
+
operation,
|
|
467
|
+
executionContext,
|
|
468
|
+
(data?.filter as FilterQuery<any>) ?? {},
|
|
469
|
+
options,
|
|
470
|
+
);
|
|
471
|
+
break;
|
|
472
|
+
|
|
473
|
+
case CoreResourceOperation.SEARCH:
|
|
474
|
+
operationResult = await this._doSearch(
|
|
475
|
+
operation,
|
|
476
|
+
executionContext,
|
|
477
|
+
data?.query || '',
|
|
478
|
+
(data?.filter as FilterQuery<any>) ?? {},
|
|
479
|
+
{
|
|
480
|
+
...options,
|
|
481
|
+
searchOptions: (options as { searchOptions?: { fieldsToSearch?: string[]; page?: number; limit?: number; sort?: any; } } | undefined)?.searchOptions ?? {},
|
|
482
|
+
} as RepositoryOptions & { searchOptions: { fieldsToSearch?: string[]; page?: number; limit?: number; sort?: any; } },
|
|
483
|
+
);
|
|
484
|
+
break;
|
|
485
|
+
|
|
486
|
+
default:
|
|
487
|
+
// Handle custom operations
|
|
488
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
489
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { resourceIdentifier: this.resourceConfiguration.resourceIdentifier, operationIdentifier } });
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
await this._postfixOperation(operation, executionContext, id_or_ids_or_filter, data, options);
|
|
493
|
+
|
|
494
|
+
return operationResult;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
// ================================
|
|
500
|
+
// Core Public Operations
|
|
501
|
+
// ================================
|
|
502
|
+
|
|
503
|
+
public async create<T = undefined>(
|
|
504
|
+
executionContext: ExecutionContext<any>,
|
|
505
|
+
data: MainSchemaType<TMainSchema>,
|
|
506
|
+
options?: RepositoryOptions
|
|
507
|
+
): Promise<ConditionalReturnType<T, TMainSchema>> {
|
|
508
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.CREATE && op.isDefault);
|
|
509
|
+
if (!operation) {
|
|
510
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
511
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.CREATE } } );
|
|
512
|
+
}
|
|
513
|
+
await this._prefixOperation(operation, executionContext, undefined, data, options);
|
|
514
|
+
const result = await this._doCreate(operation, executionContext, data, options);
|
|
515
|
+
await this._postfixOperation(operation, executionContext, undefined, data, options);
|
|
516
|
+
return result as ConditionalReturnType<T, TMainSchema>;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
public async createMany<T = undefined>(
|
|
520
|
+
executionContext: ExecutionContext<any>,
|
|
521
|
+
data: MainSchemaArrayType<TMainSchema>,
|
|
522
|
+
options?: RepositoryOptions
|
|
523
|
+
): Promise<ConditionalArrayReturnType<T, TMainSchema>> {
|
|
524
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.CREATE_MANY && op.isDefault);
|
|
525
|
+
if (!operation) {
|
|
526
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
527
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.CREATE_MANY } } );
|
|
528
|
+
}
|
|
529
|
+
await this._prefixOperation(operation, executionContext, undefined, data, options);
|
|
530
|
+
const result = await this._doCreateMany(operation, executionContext, data, options);
|
|
531
|
+
await this._postfixOperation(operation, executionContext, undefined, data, options);
|
|
532
|
+
return result as ConditionalArrayReturnType<T, TMainSchema>;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
public async read<T = undefined>(
|
|
536
|
+
executionContext: ExecutionContext<any>,
|
|
537
|
+
id_or_filter: IdOrFilterType,
|
|
538
|
+
options?: RepositoryOptions
|
|
539
|
+
): Promise<ConditionalNullableReturnType<T, TMainSchema>> {
|
|
540
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.READ && op.isDefault);
|
|
541
|
+
if (!operation) {
|
|
542
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
543
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.READ } } );
|
|
544
|
+
}
|
|
545
|
+
await this._prefixOperation(operation, executionContext, id_or_filter, undefined, options);
|
|
546
|
+
const result = await this._doRead(operation, executionContext, id_or_filter, options);
|
|
547
|
+
await this._postfixOperation(operation, executionContext, id_or_filter, undefined, options);
|
|
548
|
+
return result as ConditionalNullableReturnType<T, TMainSchema>;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
public async update<T = undefined>(
|
|
552
|
+
executionContext: ExecutionContext<any>,
|
|
553
|
+
id_or_filter: IdOrFilterType,
|
|
554
|
+
data: PartialMainSchemaType<TMainSchema>,
|
|
555
|
+
options?: RepositoryOptions
|
|
556
|
+
): Promise<ConditionalNullableReturnType<T, TMainSchema>> {
|
|
557
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.UPDATE && op.isDefault);
|
|
558
|
+
if (!operation) {
|
|
559
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
560
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.UPDATE } } );
|
|
561
|
+
}
|
|
562
|
+
await this._prefixOperation(operation, executionContext, id_or_filter, data, options);
|
|
563
|
+
const result = await this._doUpdate(operation, executionContext, id_or_filter, data, options);
|
|
564
|
+
await this._postfixOperation(operation, executionContext, id_or_filter, data, options);
|
|
565
|
+
return result as ConditionalNullableReturnType<T, TMainSchema>;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
public async updateMany<T = undefined>(
|
|
569
|
+
executionContext: ExecutionContext<any>,
|
|
570
|
+
data: PartialMainSchemaType<TMainSchema>,
|
|
571
|
+
options?: RepositoryOptions
|
|
572
|
+
): Promise<ConditionalArrayReturnType<T, TMainSchema>> {
|
|
573
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.UPDATE_MANY && op.isDefault);
|
|
574
|
+
if (!operation) {
|
|
575
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
576
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.UPDATE_MANY } } );
|
|
577
|
+
}
|
|
578
|
+
await this._prefixOperation(operation, executionContext, undefined, data, options);
|
|
579
|
+
const result = await this._doUpdateMany(operation, executionContext, undefined, data, options);
|
|
580
|
+
await this._postfixOperation(operation, executionContext, undefined, data, options);
|
|
581
|
+
return result as ConditionalArrayReturnType<T, TMainSchema>;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
public async delete(
|
|
585
|
+
executionContext: ExecutionContext<any>,
|
|
586
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
587
|
+
options?: RepositoryOptions
|
|
588
|
+
): Promise<string> {
|
|
589
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.DELETE && op.isDefault);
|
|
590
|
+
if (!operation) {
|
|
591
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
592
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.DELETE } } );
|
|
593
|
+
}
|
|
594
|
+
await this._prefixOperation(operation, executionContext, id_or_ids_or_filter, undefined, options);
|
|
595
|
+
const result = await this._doDelete(operation, executionContext, id_or_ids_or_filter, options);
|
|
596
|
+
await this._postfixOperation(operation, executionContext, id_or_ids_or_filter, undefined, options);
|
|
597
|
+
return result;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
public async deleteMany(
|
|
601
|
+
executionContext: ExecutionContext<any>,
|
|
602
|
+
ids_or_filter: IdsOrFilterType,
|
|
603
|
+
options?: RepositoryOptions
|
|
604
|
+
): Promise<string[]> {
|
|
605
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.DELETE_MANY && op.isDefault);
|
|
606
|
+
if (!operation) {
|
|
607
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
608
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.DELETE_MANY } } );
|
|
609
|
+
}
|
|
610
|
+
await this._prefixOperation(operation, executionContext, ids_or_filter, undefined, options);
|
|
611
|
+
const result = await this._doDeleteMany(operation, executionContext, ids_or_filter, options);
|
|
612
|
+
await this._postfixOperation(operation, executionContext, ids_or_filter, undefined, options);
|
|
613
|
+
return result;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
public async list<T = undefined>(
|
|
617
|
+
executionContext: ExecutionContext<any>,
|
|
618
|
+
ids_or_filter: IdsOrFilterType,
|
|
619
|
+
options?: RepositoryOptions
|
|
620
|
+
): Promise<ConditionalArrayReturnType<T, TMainSchema>> {
|
|
621
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.LIST && op.isDefault);
|
|
622
|
+
if (!operation) {
|
|
623
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
624
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.LIST } } );
|
|
625
|
+
}
|
|
626
|
+
await this._prefixOperation(operation, executionContext, ids_or_filter, undefined, options);
|
|
627
|
+
const result = await this._doList(operation, executionContext, ids_or_filter, options);
|
|
628
|
+
await this._postfixOperation(operation, executionContext, ids_or_filter, undefined, options);
|
|
629
|
+
return result as ConditionalArrayReturnType<T, TMainSchema>;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
public async search<T = any>(
|
|
633
|
+
executionContext: ExecutionContext<any>,
|
|
634
|
+
searchQuery: string,
|
|
635
|
+
filter: FilterQuery<any> = {},
|
|
636
|
+
searchOptions: { fieldsToSearch?: string[]; page?: number; limit?: number; sort?: any} = {},
|
|
637
|
+
options?: RepositoryOptions
|
|
638
|
+
): Promise<Resources_PaginatedResult<T>> {
|
|
639
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.SEARCH && op.isDefault);
|
|
640
|
+
if (!operation) {
|
|
641
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
642
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.SEARCH } } );
|
|
643
|
+
}
|
|
644
|
+
const searchOptionsWithDefaults = { searchOptions, ...options };
|
|
645
|
+
await this._prefixOperation(operation, executionContext, undefined, { query: searchQuery }, searchOptionsWithDefaults);
|
|
646
|
+
const result = await this._doSearch(operation, executionContext, searchQuery, filter, searchOptionsWithDefaults);
|
|
647
|
+
await this._postfixOperation(operation, executionContext, undefined, { query: searchQuery }, searchOptionsWithDefaults);
|
|
648
|
+
return result;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
public supportsOperation(operationIdentifier: string): boolean {
|
|
652
|
+
return this.resourceConfiguration.operations.some(
|
|
653
|
+
op => op.operationIdentifier === operationIdentifier && op.isDefault
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
public async count(
|
|
658
|
+
executionContext: ExecutionContext<any>,
|
|
659
|
+
filter: FilterQuery<any> = {},
|
|
660
|
+
options?: RepositoryOptions
|
|
661
|
+
): Promise<{ count: number }> {
|
|
662
|
+
const operation = this.resourceConfiguration.operations.find(op => op.operationIdentifier === CoreResourceOperation.COUNT && op.isDefault);
|
|
663
|
+
if (!operation) {
|
|
664
|
+
throw this.errorBuilder.buildError( ErrorType.INTERNAL, executionContext,
|
|
665
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { operationIdentifier: CoreResourceOperation.COUNT } } );
|
|
666
|
+
}
|
|
667
|
+
await this._prefixOperation(operation, executionContext, undefined, filter, options);
|
|
668
|
+
const result = await this._doCount(operation, executionContext, filter, options);
|
|
669
|
+
await this._postfixOperation(operation, executionContext, undefined, filter, options);
|
|
670
|
+
return result;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Aggregate a numeric field across documents matching the filter.
|
|
675
|
+
* Framework infrastructure method for feature limit enforcement.
|
|
676
|
+
*
|
|
677
|
+
* Uses MongoDB aggregation pipeline: $match (with buildContextualFilter) + $group.
|
|
678
|
+
* Handles null/undefined field values via $ifNull.
|
|
679
|
+
* Does NOT require a COUNT operation to be configured (not API-facing).
|
|
680
|
+
*
|
|
681
|
+
* @param executionContext - Current execution context (used for scope filtering)
|
|
682
|
+
* @param filter - Additional filter criteria (scope is added automatically by buildContextualFilter)
|
|
683
|
+
* @param field - The document field to aggregate
|
|
684
|
+
* @param operation - The aggregation operation (SUM, AVG, MAX)
|
|
685
|
+
* @returns The aggregated numeric result (0 if no matching documents)
|
|
686
|
+
*/
|
|
687
|
+
public async aggregateField(
|
|
688
|
+
executionContext: ExecutionContext<any>,
|
|
689
|
+
filter: FilterQuery<any>,
|
|
690
|
+
field: string,
|
|
691
|
+
operation: string,
|
|
692
|
+
): Promise<number> {
|
|
693
|
+
const contextualFilter = this.buildContextualFilter(executionContext, filter);
|
|
694
|
+
|
|
695
|
+
// Map operation string to MongoDB aggregation operator
|
|
696
|
+
let mongoOp: string;
|
|
697
|
+
switch (operation) {
|
|
698
|
+
case 'SUM':
|
|
699
|
+
mongoOp = '$sum';
|
|
700
|
+
break;
|
|
701
|
+
case 'AVG':
|
|
702
|
+
mongoOp = '$avg';
|
|
703
|
+
break;
|
|
704
|
+
case 'MAX':
|
|
705
|
+
mongoOp = '$max';
|
|
706
|
+
break;
|
|
707
|
+
default:
|
|
708
|
+
mongoOp = '$sum';
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
const pipeline = [
|
|
712
|
+
{ $match: contextualFilter },
|
|
713
|
+
{
|
|
714
|
+
$group: {
|
|
715
|
+
_id: null,
|
|
716
|
+
result: { [mongoOp]: { $ifNull: [`$${field}`, 0] } },
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
];
|
|
720
|
+
|
|
721
|
+
this.logDebug('Aggregating field', { field, operation, filter: contextualFilter });
|
|
722
|
+
|
|
723
|
+
const results = await this.mongooseModel.aggregate(pipeline).exec();
|
|
724
|
+
const value = results.length > 0 ? (results[0].result ?? 0) : 0;
|
|
725
|
+
|
|
726
|
+
this.logDebug('Aggregation result', { field, operation, value });
|
|
727
|
+
return value;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// ================================
|
|
731
|
+
// Core Private Operations
|
|
732
|
+
// ================================
|
|
733
|
+
|
|
734
|
+
private async _doCreate<T = undefined>(
|
|
735
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
736
|
+
executionContext: ExecutionContext<any>,
|
|
737
|
+
data: MainSchemaType<TMainSchema>,
|
|
738
|
+
options?: RepositoryOptions
|
|
739
|
+
): Promise<ConditionalReturnType<T, TMainSchema>> {
|
|
740
|
+
this.logDebug('Creating resource', { hasData: !!data, dataKeys: typeof data === 'object' ? Object.keys(data) : 'not-object' });
|
|
741
|
+
|
|
742
|
+
// Clean input data FIRST (remove mandatory discard fields)
|
|
743
|
+
const cleanedData = this.resourceOperationHelper.cleanInputData(data, CoreResourceOperation.CREATE);
|
|
744
|
+
this.logDebug('Data cleaned', { cleanedKeys: typeof cleanedData === 'object' ? Object.keys(cleanedData) : 'not-object' });
|
|
745
|
+
|
|
746
|
+
// Validate against request DTO (after cleaning)
|
|
747
|
+
const validatedData = this.repositoriesRegistry.validateRequestData(cleanedData, this.resourceConfiguration.resourceIdentifier as ResourceType, CoreResourceOperation.CREATE);
|
|
748
|
+
this.logDebug('Data validated against requestDto', { validatedKeys: typeof validatedData === 'object' ? Object.keys(validatedData) : 'not-object' });
|
|
749
|
+
|
|
750
|
+
// THEN apply execution context data enrichment to the validated data
|
|
751
|
+
const enrichedData = this.resourceOperationHelper.enrichDataWithContext(validatedData, executionContext, this.resourceConfiguration.mainSchema, this.resourceConfiguration.resourceFieldIdentifier, CoreResourceOperation.CREATE, options);
|
|
752
|
+
this.logDebug('Data enriched with context', { enrichedKeys: typeof enrichedData === 'object' ? Object.keys(enrichedData) : 'not-object' });
|
|
753
|
+
|
|
754
|
+
// Defense-in-depth: anonymous creation on isAnonymizable resources must have userId = null
|
|
755
|
+
if (executionContext.isAnonymousExecution() && this.resourceConfiguration.isAnonymizable) {
|
|
756
|
+
enrichedData.userId = null;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// Inject non-discriminator literal values from schema (e.g., scope: 'ORGANIZATION')
|
|
760
|
+
// These are fixed values excluded from CREATE DTOs but must be persisted
|
|
761
|
+
const dataWithLiterals = this.resourceOperationHelper.injectNonDiscriminatorLiteralValues(enrichedData, this.resourceConfiguration.mainSchema);
|
|
762
|
+
this.logDebug('Non-discriminator literals injected', { dataWithLiteralsKeys: typeof dataWithLiterals === 'object' ? Object.keys(dataWithLiterals) : 'not-object' });
|
|
763
|
+
|
|
764
|
+
// Add user tracking to enriched data
|
|
765
|
+
const dataWithUserTracking = this.addUserTracking(dataWithLiterals, executionContext, CoreResourceOperation.CREATE);
|
|
766
|
+
this.logDebug('User tracking added', { finalKeys: typeof dataWithUserTracking === 'object' ? Object.keys(dataWithUserTracking) : 'not-object' });
|
|
767
|
+
|
|
768
|
+
try {
|
|
769
|
+
const nativeSession = this.getNativeSession(options);
|
|
770
|
+
this.logDebug('Creating document with Model.create()...', {
|
|
771
|
+
hasTransaction: !!nativeSession
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
// Use transaction session if provided
|
|
775
|
+
const createOptions: any = nativeSession ? { session: nativeSession } : {};
|
|
776
|
+
|
|
777
|
+
// DEBUG: Log the exact data being passed to mongoose
|
|
778
|
+
this.logDebug('\n=== DEBUG: About to call mongoose create ===');
|
|
779
|
+
this.logDebug('dataWithUserTracking:', { dataWithUserTracking: JSON.stringify(dataWithUserTracking, null, 2) });
|
|
780
|
+
this.logDebug('keys:', { keys: Object.keys(dataWithUserTracking || {}) });
|
|
781
|
+
this.logDebug('dataType:', { dataType: typeof dataWithUserTracking });
|
|
782
|
+
this.logDebug('hasName:', { hasName: !!(dataWithUserTracking as any)?.name });
|
|
783
|
+
this.logDebug('hasSlug:', { hasSlug: !!(dataWithUserTracking as any)?.slug });
|
|
784
|
+
this.logDebug('nameValue:', (dataWithUserTracking as any)?.name);
|
|
785
|
+
this.logDebug('slugValue:', { slugValue: (dataWithUserTracking as any)?.slug });
|
|
786
|
+
|
|
787
|
+
// DEBUG: Log mongoose schema info
|
|
788
|
+
this.logDebug('Mongoose model name:', { mongooseModelName: this.mongooseModel.modelName });
|
|
789
|
+
this.logDebug('Mongoose schema paths:', { mongooseSchemaPaths: Object.keys(this.mongooseModel.schema.paths) });
|
|
790
|
+
this.logDebug('Required paths:', { requiredPaths: Object.keys(this.mongooseModel.schema.paths).filter(path => {
|
|
791
|
+
const schemaType = this.mongooseModel.schema.paths[path];
|
|
792
|
+
return schemaType.isRequired;
|
|
793
|
+
}) });
|
|
794
|
+
|
|
795
|
+
this.logDebug('Name field config:', { nameFieldConfig: this.mongooseModel.schema.paths['name']?.isRequired, nameFieldInstance: this.mongooseModel.schema.paths['name']?.instance });
|
|
796
|
+
this.logDebug('Slug field config:', { slugFieldConfig: this.mongooseModel.schema.paths['slug']?.isRequired, slugFieldInstance: this.mongooseModel.schema.paths['slug']?.instance });
|
|
797
|
+
this.logDebug('Status field config:', { statusFieldConfig: this.mongooseModel.schema.paths['status']?.isRequired, statusFieldInstance: this.mongooseModel.schema.paths['status']?.instance });
|
|
798
|
+
this.logDebug('=======================================\n');
|
|
799
|
+
|
|
800
|
+
// Use Model.create() instead of new Model().save() to allow MongoDB to auto-generate _id
|
|
801
|
+
const savedDocument = await this.mongooseModel.create(dataWithUserTracking);
|
|
802
|
+
this.logDebug('Document created successfully');
|
|
803
|
+
|
|
804
|
+
return this.transformDocumentToResponse(savedDocument, CoreResourceOperation.CREATE);
|
|
805
|
+
} catch (error) {
|
|
806
|
+
this.logDebug('Mongoose create failed', {
|
|
807
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
808
|
+
enrichedData: enrichedData,
|
|
809
|
+
hasTransaction: !!this.getNativeSession(options)
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
// Handle MongoDB unique constraint violations (E11000 duplicate key error)
|
|
813
|
+
throw this.handleMongoDBError(error, executionContext);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
private async _doCreateMany<T = undefined>(
|
|
819
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
820
|
+
executionContext: ExecutionContext<any>,
|
|
821
|
+
dataArray: MainSchemaArrayType<TMainSchema>,
|
|
822
|
+
options?: RepositoryOptions
|
|
823
|
+
): Promise<ConditionalArrayReturnType<T, TMainSchema>> {
|
|
824
|
+
this.logDebug('Creating multiple resources', { count: dataArray.length });
|
|
825
|
+
|
|
826
|
+
// Clean input data FIRST (remove mandatory discard fields)
|
|
827
|
+
const cleanedDataArray = this.resourceOperationHelper.cleanInputDataArray(dataArray, CoreResourceOperation.CREATE_MANY);
|
|
828
|
+
this.logDebug('Data array cleaned', { count: cleanedDataArray.length });
|
|
829
|
+
|
|
830
|
+
// CreateMany always processes multiple items
|
|
831
|
+
|
|
832
|
+
// Validate and enrich each item
|
|
833
|
+
const isAnonymousCreate = executionContext.isAnonymousExecution() && this.resourceConfiguration.isAnonymizable;
|
|
834
|
+
const isBulkOperation = 'isBulkOperation' in operation && operation.isBulkOperation === true;
|
|
835
|
+
const processedDataArray = cleanedDataArray.map(data => {
|
|
836
|
+
const validatedData = this.repositoriesRegistry.validateRepositoryWriteData(
|
|
837
|
+
data,
|
|
838
|
+
this.resourceConfiguration.resourceIdentifier as ResourceType,
|
|
839
|
+
String(operation.operationIdentifier),
|
|
840
|
+
isBulkOperation
|
|
841
|
+
);
|
|
842
|
+
const enrichedData = this.resourceOperationHelper.enrichDataWithContext(validatedData, executionContext, this.resourceConfiguration.mainSchema, this.resourceConfiguration.resourceFieldIdentifier, CoreResourceOperation.CREATE_MANY, options);
|
|
843
|
+
if (isAnonymousCreate) { enrichedData.userId = null; }
|
|
844
|
+
// Inject non-discriminator literal values from schema
|
|
845
|
+
const dataWithLiterals = this.resourceOperationHelper.injectNonDiscriminatorLiteralValues(enrichedData, this.resourceConfiguration.mainSchema);
|
|
846
|
+
return this.addUserTracking(dataWithLiterals, executionContext, CoreResourceOperation.CREATE_MANY);
|
|
847
|
+
});
|
|
848
|
+
|
|
849
|
+
// Prepare mongoose options with transaction session if provided
|
|
850
|
+
const session = this.getNativeSession(options);
|
|
851
|
+
const mongooseOpts: any = session ? { session } : {};
|
|
852
|
+
|
|
853
|
+
this.logDebug('Creating multiple documents', {
|
|
854
|
+
count: processedDataArray.length,
|
|
855
|
+
hasTransaction: !!session
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
// insertMany returns an array of documents by default (not InsertManyResult unless rawResult: true)
|
|
859
|
+
// TypeScript infers the wrong type, so we cast through unknown
|
|
860
|
+
const documents = await this.mongooseModel.insertMany(processedDataArray, mongooseOpts) as unknown as any[];
|
|
861
|
+
|
|
862
|
+
return documents.map(doc => this.transformDocumentToResponse(doc, CoreResourceOperation.CREATE_MANY)) as ConditionalArrayReturnType<T, TMainSchema>;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
private async _doRead<T = undefined>(
|
|
867
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
868
|
+
executionContext: ExecutionContext<any>,
|
|
869
|
+
id_or_filter?: IdOrFilterType,
|
|
870
|
+
options?: RepositoryOptions
|
|
871
|
+
): Promise<ConditionalNullableReturnType<T, TMainSchema>> {
|
|
872
|
+
const session = this.getNativeSession(options);
|
|
873
|
+
this.logDebug('Reading resource', { id_or_filter, hasOptions: !!options, hasTransaction: !!session });
|
|
874
|
+
|
|
875
|
+
// Validate required parameter
|
|
876
|
+
this.validateIdOrIdsOrFilterRequired(
|
|
877
|
+
id_or_filter,
|
|
878
|
+
executionContext,
|
|
879
|
+
CoreResourceOperation.READ,
|
|
880
|
+
this.canReadViaContextWithoutExplicitId(operation, executionContext),
|
|
881
|
+
);
|
|
882
|
+
|
|
883
|
+
// Build base filter - read operation is always unitary (single entity)
|
|
884
|
+
const { baseFilter } = this.buildBaseFilterFromIdOrIdsOrFilter(id_or_filter, executionContext);
|
|
885
|
+
|
|
886
|
+
const filter = this.buildContextualFilter(executionContext, baseFilter, options);
|
|
887
|
+
|
|
888
|
+
// Prepare mongoose options with transaction session if provided
|
|
889
|
+
const mongooseOpts: any = session ? { session } : {};
|
|
890
|
+
|
|
891
|
+
// Read operation always returns single entity or null
|
|
892
|
+
const document = await this.mongooseModel.findOne(filter, null, mongooseOpts);
|
|
893
|
+
this.logDebug('Read single result', {
|
|
894
|
+
filter,
|
|
895
|
+
found: !!document,
|
|
896
|
+
preview: this.previewDocument(document),
|
|
897
|
+
hasTransaction: !!session
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
if (!document) {
|
|
901
|
+
return null;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
return this.transformDocumentToResponse<T>(document, CoreResourceOperation.READ);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
private async _doUpdate<T = undefined>(
|
|
909
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
910
|
+
executionContext: ExecutionContext<any>,
|
|
911
|
+
id_or_filter?: IdOrFilterType,
|
|
912
|
+
data?: PartialMainSchemaType<TMainSchema>,
|
|
913
|
+
options?: RepositoryOptions
|
|
914
|
+
): Promise<ConditionalNullableReturnType<T, TMainSchema>> {
|
|
915
|
+
this.logDebug('Updating resource', { id_or_filter, hasData: !!data, hasOptions: !!options });
|
|
916
|
+
|
|
917
|
+
// Validate required parameter
|
|
918
|
+
this.validateIdOrIdsOrFilterRequired(id_or_filter, executionContext, CoreResourceOperation.UPDATE);
|
|
919
|
+
|
|
920
|
+
if (!data) {
|
|
921
|
+
throw this.errorBuilder.buildError(
|
|
922
|
+
ErrorType.VALIDATION,
|
|
923
|
+
executionContext,
|
|
924
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { message: 'UPDATE requires data' } }
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
// Clean input data FIRST (remove mandatory discard fields)
|
|
929
|
+
const cleanedData = this.resourceOperationHelper.cleanInputData(data, CoreResourceOperation.UPDATE);
|
|
930
|
+
this.logDebug('Data cleaned for update', { cleanedKeys: typeof cleanedData === 'object' ? Object.keys(cleanedData) : 'not-object' });
|
|
931
|
+
|
|
932
|
+
// Validate against request DTO (after cleaning)
|
|
933
|
+
const validatedData = this.repositoriesRegistry.validateRequestData(cleanedData, this.resourceConfiguration.resourceIdentifier as ResourceType, CoreResourceOperation.UPDATE);
|
|
934
|
+
this.logDebug('Data validated against requestDto', { validatedKeys: typeof validatedData === 'object' ? Object.keys(validatedData) : 'not-object' });
|
|
935
|
+
|
|
936
|
+
// THEN apply execution context data enrichment to the validated data
|
|
937
|
+
const enrichedData = this.resourceOperationHelper.enrichDataWithContext(validatedData, executionContext, this.resourceConfiguration.mainSchema, this.resourceConfiguration.resourceFieldIdentifier, CoreResourceOperation.UPDATE, options);
|
|
938
|
+
this.logDebug('Data enriched with context', { enrichedKeys: typeof enrichedData === 'object' ? Object.keys(enrichedData) : 'not-object' });
|
|
939
|
+
|
|
940
|
+
// Add user tracking to enriched data
|
|
941
|
+
const dataWithUserTracking = this.addUserTracking(enrichedData, executionContext, CoreResourceOperation.UPDATE);
|
|
942
|
+
this.logDebug('User tracking added', { finalKeys: typeof dataWithUserTracking === 'object' ? Object.keys(dataWithUserTracking) : 'not-object' });
|
|
943
|
+
|
|
944
|
+
// Build base filter - update operation is always unitary (single entity)
|
|
945
|
+
const { baseFilter } = this.buildBaseFilterFromIdOrIdsOrFilter(id_or_filter, executionContext);
|
|
946
|
+
|
|
947
|
+
// Ensure we have some filter criteria
|
|
948
|
+
if (Object.keys(baseFilter).length === 0) {
|
|
949
|
+
throw this.errorBuilder.buildError(ErrorType.VALIDATION, executionContext,
|
|
950
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { message: 'UPDATE requires valid id_or_ids_or_filter parameter' } }
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
// Apply contextual filtering
|
|
955
|
+
const filter = this.buildContextualFilter(executionContext, baseFilter, options);
|
|
956
|
+
|
|
957
|
+
if (options?.ifMatchVersion !== undefined) {
|
|
958
|
+
filter._version_db_doc = options.ifMatchVersion;
|
|
959
|
+
this.logDebug('Optimistic locking: added version filter', { ifMatchVersion: options.ifMatchVersion });
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
// Prepare mongoose options with transaction session if provided
|
|
963
|
+
const session = this.getNativeSession(options);
|
|
964
|
+
const mongooseOpts: any = { runValidators: true, new: true };
|
|
965
|
+
if (session) {
|
|
966
|
+
mongooseOpts.session = session;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
// Defense-in-depth: strip version fields from update data to prevent
|
|
970
|
+
// $set/$inc conflict on _version_db_doc
|
|
971
|
+
delete dataWithUserTracking._version_db_doc;
|
|
972
|
+
delete dataWithUserTracking._version;
|
|
973
|
+
|
|
974
|
+
// CRDT: userId needed by both the LWW merge and the version-conflict retry
|
|
975
|
+
const userId = options?.fieldTimestamps ? (executionContext.initiatorIds?.userId ?? 'unknown') : undefined;
|
|
976
|
+
const FIELD_META_CAP = 200;
|
|
977
|
+
|
|
978
|
+
// CRDT field-level LWW merge
|
|
979
|
+
// P1: The extra findOne (projection: _field_meta only) is an intentional round-trip —
|
|
980
|
+
// LWW needs the latest per-field server timestamps before findOneAndUpdate; a blind
|
|
981
|
+
// CAS without pre-read cannot compare client vs server field clocks.
|
|
982
|
+
if (options?.fieldTimestamps && Object.keys(options.fieldTimestamps).length > 0) {
|
|
983
|
+
const currentDoc = await this.mongooseModel.findOne(
|
|
984
|
+
{ _id: baseFilter._id },
|
|
985
|
+
{ _field_meta: 1 },
|
|
986
|
+
session ? { session } : undefined,
|
|
987
|
+
);
|
|
988
|
+
|
|
989
|
+
const currentFieldMeta: Record<string, FieldMetaEntry> = sanitizeFieldMeta(currentDoc?._field_meta);
|
|
990
|
+
const mergedFieldMeta: Record<string, FieldMetaEntry> = { ...currentFieldMeta };
|
|
991
|
+
const fieldsToRemoveFromUpdate: string[] = [];
|
|
992
|
+
|
|
993
|
+
for (const [field, clientTs] of Object.entries(options.fieldTimestamps)) {
|
|
994
|
+
const serverTs = currentFieldMeta[field]?.ts ?? 0;
|
|
995
|
+
|
|
996
|
+
if (lwwFieldWinner(clientTs, serverTs) === CrdtResolutionWinner.INCOMING) {
|
|
997
|
+
mergedFieldMeta[field] = { ts: nextMonotonicTimestamp(Date.now(), serverTs), by: userId! };
|
|
998
|
+
} else {
|
|
999
|
+
fieldsToRemoveFromUpdate.push(field);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
for (const field of fieldsToRemoveFromUpdate) {
|
|
1004
|
+
delete dataWithUserTracking[field];
|
|
1005
|
+
this.logDebug('CRDT LWW: server wins for field', { field });
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
// D1: Schema-aware prune — remove _field_meta keys for fields no longer in the schema.
|
|
1009
|
+
// Prevents unbounded growth after schema renames.
|
|
1010
|
+
const validCrdtKeys = extractCrdtFieldNames(this.resourceConfiguration.mainSchema, false);
|
|
1011
|
+
if (validCrdtKeys.size > 0) {
|
|
1012
|
+
const staleKeys: string[] = [];
|
|
1013
|
+
for (const key of Object.keys(mergedFieldMeta)) {
|
|
1014
|
+
if (!validCrdtKeys.has(key)) staleKeys.push(key);
|
|
1015
|
+
}
|
|
1016
|
+
for (const key of staleKeys) {
|
|
1017
|
+
delete mergedFieldMeta[key];
|
|
1018
|
+
}
|
|
1019
|
+
if (staleKeys.length > 0) {
|
|
1020
|
+
this.logDebug('CRDT D1: pruned stale _field_meta keys', { staleKeys });
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
// S3: Cap _field_meta size — evict oldest entries beyond the cap.
|
|
1025
|
+
// Runs after D1 semantic prune as a second line of defense.
|
|
1026
|
+
const metaKeys = Object.keys(mergedFieldMeta);
|
|
1027
|
+
if (metaKeys.length > FIELD_META_CAP) {
|
|
1028
|
+
const sorted = metaKeys.sort((a, b) => (mergedFieldMeta[a].ts ?? 0) - (mergedFieldMeta[b].ts ?? 0));
|
|
1029
|
+
const toEvict = sorted.slice(0, metaKeys.length - FIELD_META_CAP);
|
|
1030
|
+
for (const key of toEvict) {
|
|
1031
|
+
delete mergedFieldMeta[key];
|
|
1032
|
+
}
|
|
1033
|
+
this.logDebug('CRDT S3: capped _field_meta', { evicted: toEvict.length, remaining: FIELD_META_CAP });
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
dataWithUserTracking._field_meta = mergedFieldMeta;
|
|
1037
|
+
|
|
1038
|
+
this.logDebug('CRDT LWW merge', {
|
|
1039
|
+
clientFields: Object.keys(options.fieldTimestamps),
|
|
1040
|
+
removedFields: fieldsToRemoveFromUpdate,
|
|
1041
|
+
survivingFields: Object.keys(options.fieldTimestamps).filter(f => !fieldsToRemoveFromUpdate.includes(f)),
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// Update operation always updates single entity
|
|
1046
|
+
let document;
|
|
1047
|
+
try {
|
|
1048
|
+
document = await this.mongooseModel.findOneAndUpdate(
|
|
1049
|
+
filter,
|
|
1050
|
+
{ $set: dataWithUserTracking, $inc: { _version_db_doc: 1 } },
|
|
1051
|
+
mongooseOpts
|
|
1052
|
+
);
|
|
1053
|
+
} catch (error) {
|
|
1054
|
+
this.logDebug('Mongoose update failed', {
|
|
1055
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
1056
|
+
filter,
|
|
1057
|
+
hasTransaction: !!session
|
|
1058
|
+
});
|
|
1059
|
+
throw this.handleMongoDBError(error, executionContext);
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
this.logDebug('Single update completed', {
|
|
1063
|
+
filter,
|
|
1064
|
+
found: !!document,
|
|
1065
|
+
hasTransaction: !!session
|
|
1066
|
+
});
|
|
1067
|
+
|
|
1068
|
+
if (!document) {
|
|
1069
|
+
if (options?.ifMatchVersion !== undefined) {
|
|
1070
|
+
// Disambiguate: version conflict vs resource deleted.
|
|
1071
|
+
// Query by _id only (no version filter, no contextual filter) to check existence.
|
|
1072
|
+
const existsDoc = await this.mongooseModel.findOne(
|
|
1073
|
+
baseFilter,
|
|
1074
|
+
{ _id: 1 },
|
|
1075
|
+
session ? { session } : undefined
|
|
1076
|
+
);
|
|
1077
|
+
|
|
1078
|
+
// CRDT-only update retry: when two clients save different CRDT fields simultaneously,
|
|
1079
|
+
// the second client's findOneAndUpdate fails because the first already incremented
|
|
1080
|
+
// the version. Retry with the current version instead of returning 409.
|
|
1081
|
+
const crdtFieldSet = options?.fieldTimestamps ? new Set(Object.keys(options.fieldTimestamps)) : null;
|
|
1082
|
+
const userDataKeys = Object.keys(dataWithUserTracking).filter(
|
|
1083
|
+
k => !k.startsWith('_')
|
|
1084
|
+
);
|
|
1085
|
+
const isCrdtOnly = crdtFieldSet !== null && isCrdtOnlyUpdate(userDataKeys, crdtFieldSet);
|
|
1086
|
+
|
|
1087
|
+
if (existsDoc && options?.fieldTimestamps && isCrdtOnly) {
|
|
1088
|
+
const freshDoc = await this.mongooseModel.findOne(
|
|
1089
|
+
baseFilter,
|
|
1090
|
+
{ _field_meta: 1, _version_db_doc: 1 },
|
|
1091
|
+
session ? { session } : undefined,
|
|
1092
|
+
);
|
|
1093
|
+
if (freshDoc) {
|
|
1094
|
+
filter._version_db_doc = freshDoc._version_db_doc;
|
|
1095
|
+
|
|
1096
|
+
const freshFieldMeta: Record<string, FieldMetaEntry> = sanitizeFieldMeta(freshDoc._field_meta);
|
|
1097
|
+
const freshMerged: Record<string, FieldMetaEntry> = { ...freshFieldMeta };
|
|
1098
|
+
for (const [field, clientTs] of Object.entries(options.fieldTimestamps)) {
|
|
1099
|
+
const serverTs = freshFieldMeta[field]?.ts ?? 0;
|
|
1100
|
+
if (lwwFieldWinner(clientTs, serverTs) === CrdtResolutionWinner.INCOMING) {
|
|
1101
|
+
freshMerged[field] = { ts: nextMonotonicTimestamp(Date.now(), serverTs), by: userId! };
|
|
1102
|
+
} else {
|
|
1103
|
+
delete dataWithUserTracking[field];
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
// D1: Schema-aware prune on retry path
|
|
1107
|
+
const validCrdtKeysRetry = extractCrdtFieldNames(this.resourceConfiguration.mainSchema, false);
|
|
1108
|
+
if (validCrdtKeysRetry.size > 0) {
|
|
1109
|
+
for (const key of Object.keys(freshMerged)) {
|
|
1110
|
+
if (!validCrdtKeysRetry.has(key)) delete freshMerged[key];
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
// S3: Cap _field_meta size on retry path
|
|
1115
|
+
const retryMetaKeys = Object.keys(freshMerged);
|
|
1116
|
+
if (retryMetaKeys.length > FIELD_META_CAP) {
|
|
1117
|
+
const sorted = retryMetaKeys.sort((a, b) => (freshMerged[a].ts ?? 0) - (freshMerged[b].ts ?? 0));
|
|
1118
|
+
const toEvict = sorted.slice(0, retryMetaKeys.length - FIELD_META_CAP);
|
|
1119
|
+
for (const key of toEvict) delete freshMerged[key];
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
dataWithUserTracking._field_meta = freshMerged;
|
|
1123
|
+
|
|
1124
|
+
document = await this.mongooseModel.findOneAndUpdate(
|
|
1125
|
+
filter,
|
|
1126
|
+
{ $set: dataWithUserTracking, $inc: { _version_db_doc: 1 } },
|
|
1127
|
+
mongooseOpts,
|
|
1128
|
+
);
|
|
1129
|
+
if (document) {
|
|
1130
|
+
this.logDebug('CRDT LWW: retry succeeded after version conflict');
|
|
1131
|
+
return this.transformDocumentToResponse<T>(document, CoreResourceOperation.UPDATE);
|
|
1132
|
+
}
|
|
1133
|
+
// O1: retry was attempted (freshDoc found) but second findOneAndUpdate still lost the race
|
|
1134
|
+
this.logger.warn('CRDT LWW retry exhausted — falling through to VERSION_CONFLICT', {
|
|
1135
|
+
resourceId: String(baseFilter._id),
|
|
1136
|
+
clientFields: options?.fieldTimestamps ? Object.keys(options.fieldTimestamps) : [],
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
// If freshDoc was null, fall through to 409 without O1 (could not refresh version / meta)
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
if (existsDoc) {
|
|
1143
|
+
this.logDebug('Version conflict detected', {
|
|
1144
|
+
ifMatchVersion: options.ifMatchVersion,
|
|
1145
|
+
resourceId: baseFilter._id
|
|
1146
|
+
});
|
|
1147
|
+
throw this.errorBuilder.buildError(
|
|
1148
|
+
ErrorType.CONFLICT,
|
|
1149
|
+
executionContext,
|
|
1150
|
+
{
|
|
1151
|
+
customMessageReference: ErrorCustomMessageReference.VERSION_CONFLICT,
|
|
1152
|
+
context: {
|
|
1153
|
+
resourceType: this.resourceConfiguration.resourceIdentifier,
|
|
1154
|
+
ifMatchVersion: options.ifMatchVersion,
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
);
|
|
1158
|
+
}
|
|
1159
|
+
// Document truly doesn't exist — fall through to return null
|
|
1160
|
+
// (service layer will throw NOT_FOUND)
|
|
1161
|
+
}
|
|
1162
|
+
return null;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
return this.transformDocumentToResponse<T>(document, CoreResourceOperation.UPDATE);
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
private async _doUpdateMany<T = undefined>(
|
|
1169
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1170
|
+
executionContext: ExecutionContext<any>,
|
|
1171
|
+
ids_or_filter: IdsOrFilterType | undefined,
|
|
1172
|
+
data: PartialMainSchemaType<TMainSchema>,
|
|
1173
|
+
options?: RepositoryOptions
|
|
1174
|
+
): Promise<ConditionalArrayReturnType<T, TMainSchema>> {
|
|
1175
|
+
const { baseFilter } = this.buildBaseFilterFromIdOrIdsOrFilter(ids_or_filter, executionContext);
|
|
1176
|
+
const session = this.getNativeSession(options);
|
|
1177
|
+
this.logDebug('Updating multiple resources', { ids_or_filter, hasData: !!data, hasTransaction: !!session });
|
|
1178
|
+
|
|
1179
|
+
// Clean input data FIRST (remove mandatory discard fields)
|
|
1180
|
+
const cleanedData = this.resourceOperationHelper.cleanInputData(data, CoreResourceOperation.UPDATE_MANY);
|
|
1181
|
+
this.logDebug('Data cleaned for updateMany', { cleanedKeys: typeof cleanedData === 'object' ? Object.keys(cleanedData) : 'not-object' });
|
|
1182
|
+
|
|
1183
|
+
// Validate against request DTO (after cleaning)
|
|
1184
|
+
const isBulkOperation = 'isBulkOperation' in operation && operation.isBulkOperation === true;
|
|
1185
|
+
const validatedData = this.repositoriesRegistry.validateRepositoryWriteData(
|
|
1186
|
+
cleanedData,
|
|
1187
|
+
this.resourceConfiguration.resourceIdentifier as ResourceType,
|
|
1188
|
+
String(operation.operationIdentifier),
|
|
1189
|
+
isBulkOperation
|
|
1190
|
+
);
|
|
1191
|
+
this.logDebug('Data validated against requestDto', { validatedKeys: typeof validatedData === 'object' ? Object.keys(validatedData) : 'not-object' });
|
|
1192
|
+
|
|
1193
|
+
// THEN apply execution context data enrichment to the validated data
|
|
1194
|
+
const enrichedData = this.resourceOperationHelper.enrichDataWithContext(validatedData, executionContext, this.resourceConfiguration.mainSchema, this.resourceConfiguration.resourceFieldIdentifier, CoreResourceOperation.UPDATE_MANY, options);
|
|
1195
|
+
this.logDebug('Data enriched with context', { enrichedKeys: typeof enrichedData === 'object' ? Object.keys(enrichedData) : 'not-object' });
|
|
1196
|
+
|
|
1197
|
+
// Add user tracking to enriched data
|
|
1198
|
+
const dataWithUserTracking = this.addUserTracking(enrichedData, executionContext, CoreResourceOperation.UPDATE_MANY);
|
|
1199
|
+
this.logDebug('User tracking added', { finalKeys: typeof dataWithUserTracking === 'object' ? Object.keys(dataWithUserTracking) : 'not-object' });
|
|
1200
|
+
|
|
1201
|
+
// Defense-in-depth: strip version fields from update data to prevent
|
|
1202
|
+
// $set/$inc conflict on _version_db_doc in bulk updates too.
|
|
1203
|
+
delete dataWithUserTracking._version_db_doc;
|
|
1204
|
+
delete dataWithUserTracking._version;
|
|
1205
|
+
|
|
1206
|
+
const contextualFilter = this.buildContextualFilter(executionContext, baseFilter, options);
|
|
1207
|
+
|
|
1208
|
+
// Prepare mongoose options with transaction session if provided
|
|
1209
|
+
const mongooseOpts: any = { runValidators: true };
|
|
1210
|
+
if (session) {
|
|
1211
|
+
mongooseOpts.session = session;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
const findOpts: any = session ? { session } : {};
|
|
1215
|
+
const matchedDocuments = await this.mongooseModel.find(contextualFilter, { _id: 1 }, findOpts);
|
|
1216
|
+
const matchedIds = matchedDocuments
|
|
1217
|
+
.map((doc: any) => doc?._id?.toString?.() ?? doc?._id)
|
|
1218
|
+
.filter((id: unknown): id is string => typeof id === 'string' && id.length > 0);
|
|
1219
|
+
|
|
1220
|
+
if (matchedIds.length === 0) {
|
|
1221
|
+
return [] as ConditionalArrayReturnType<T, TMainSchema>;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
const updateResult = await this.mongooseModel.updateMany(
|
|
1225
|
+
contextualFilter,
|
|
1226
|
+
{ $set: dataWithUserTracking, $inc: { _version_db_doc: 1 } },
|
|
1227
|
+
mongooseOpts
|
|
1228
|
+
);
|
|
1229
|
+
|
|
1230
|
+
this.logDebug('UpdateMany completed', {
|
|
1231
|
+
filter: contextualFilter,
|
|
1232
|
+
matchedCount: updateResult.matchedCount,
|
|
1233
|
+
modifiedCount: updateResult.modifiedCount,
|
|
1234
|
+
hasTransaction: !!session
|
|
1235
|
+
});
|
|
1236
|
+
|
|
1237
|
+
if (updateResult.matchedCount === 0) {
|
|
1238
|
+
return [] as ConditionalArrayReturnType<T, TMainSchema>;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// Re-read by stable ids rather than the original filter.
|
|
1242
|
+
// Otherwise a patch that changes a matched filter field can make the follow-up
|
|
1243
|
+
// find() return an empty set even though Mongo actually updated documents.
|
|
1244
|
+
const updatedDocuments = await this.mongooseModel.find(
|
|
1245
|
+
{ _id: { $in: matchedIds } } as FilterQuery<any>,
|
|
1246
|
+
null,
|
|
1247
|
+
findOpts
|
|
1248
|
+
);
|
|
1249
|
+
const updatedDocumentsById = new Map(
|
|
1250
|
+
updatedDocuments.map((doc: any) => [
|
|
1251
|
+
doc?._id?.toString?.() ?? doc?._id,
|
|
1252
|
+
doc,
|
|
1253
|
+
] as const)
|
|
1254
|
+
);
|
|
1255
|
+
const orderedUpdatedDocuments = matchedIds
|
|
1256
|
+
.map((id) => updatedDocumentsById.get(id))
|
|
1257
|
+
.filter((doc): doc is any => !!doc);
|
|
1258
|
+
|
|
1259
|
+
return orderedUpdatedDocuments.map(doc => this.transformDocumentToResponse<T>(doc, CoreResourceOperation.UPDATE_MANY)) as ConditionalArrayReturnType<T, TMainSchema>;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
private async _doDelete(
|
|
1264
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1265
|
+
executionContext: ExecutionContext<any>,
|
|
1266
|
+
id_or_filter?: IdOrFilterType,
|
|
1267
|
+
options?: RepositoryOptions
|
|
1268
|
+
): Promise<string> {
|
|
1269
|
+
// Prepare mongoose options with transaction session if provided
|
|
1270
|
+
const session = this.getNativeSession(options);
|
|
1271
|
+
const mongooseOpts: any = session ? { session } : {};
|
|
1272
|
+
|
|
1273
|
+
this.logDebug('Deleting resource', { id_or_filter, hasTransaction: !!session });
|
|
1274
|
+
|
|
1275
|
+
// Validate required parameter
|
|
1276
|
+
this.validateIdOrIdsOrFilterRequired(id_or_filter, executionContext, CoreResourceOperation.DELETE);
|
|
1277
|
+
|
|
1278
|
+
// Build base filter - delete operation is always unitary (single entity)
|
|
1279
|
+
const { baseFilter: deleteFilter } = this.buildBaseFilterFromIdOrIdsOrFilter(id_or_filter, executionContext);
|
|
1280
|
+
|
|
1281
|
+
const filter = this.buildContextualFilter(executionContext, deleteFilter, options);
|
|
1282
|
+
|
|
1283
|
+
// First, fetch the document to get its ID before deletion
|
|
1284
|
+
const documentToDelete = await this.mongooseModel.findOne(filter, { _id: 1 }, mongooseOpts);
|
|
1285
|
+
|
|
1286
|
+
if (!documentToDelete) {
|
|
1287
|
+
this.logDebug('No document found to delete', { filter });
|
|
1288
|
+
return '';
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
const deletedId = (documentToDelete as any)._id.toString();
|
|
1292
|
+
|
|
1293
|
+
// Delete operation always deletes single entity
|
|
1294
|
+
const result = await this.mongooseModel.deleteOne(filter, mongooseOpts);
|
|
1295
|
+
|
|
1296
|
+
this.logDebug('Single delete completed', {
|
|
1297
|
+
filter,
|
|
1298
|
+
deletedCount: result.deletedCount,
|
|
1299
|
+
deletedId: deletedId,
|
|
1300
|
+
hasTransaction: !!session
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
return deletedId;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
private async _doDeleteMany(
|
|
1308
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1309
|
+
executionContext: ExecutionContext<any>,
|
|
1310
|
+
ids_or_filter?: IdsOrFilterType,
|
|
1311
|
+
options?: RepositoryOptions
|
|
1312
|
+
): Promise<string[]> {
|
|
1313
|
+
// Prepare mongoose options with transaction session if provided
|
|
1314
|
+
const session = this.getNativeSession(options);
|
|
1315
|
+
const mongooseOpts: any = session ? { session } : {};
|
|
1316
|
+
|
|
1317
|
+
this.logDebug('Deleting multiple resources', { ids_or_filter, hasTransaction: !!session });
|
|
1318
|
+
|
|
1319
|
+
// Validate required parameter for deleteMany operation
|
|
1320
|
+
this.validateIdOrIdsOrFilterRequired(ids_or_filter, executionContext, CoreResourceOperation.DELETE_MANY);
|
|
1321
|
+
|
|
1322
|
+
// Build base filter for multiple deletions - this handles IdsOrFilterType
|
|
1323
|
+
const { baseFilter } = this.buildBaseFilterFromIdOrIdsOrFilter(ids_or_filter, executionContext);
|
|
1324
|
+
|
|
1325
|
+
// Apply contextual filtering
|
|
1326
|
+
const contextualFilter = this.buildContextualFilter(executionContext, baseFilter, options);
|
|
1327
|
+
|
|
1328
|
+
// First, fetch all documents that match the filter to get their IDs before deletion
|
|
1329
|
+
const documentsToDelete = await this.mongooseModel.find(contextualFilter, { _id: 1 }, mongooseOpts);
|
|
1330
|
+
|
|
1331
|
+
if (!documentsToDelete || documentsToDelete.length === 0) {
|
|
1332
|
+
this.logDebug('No documents found to delete', { contextualFilter });
|
|
1333
|
+
return [];
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
const deletedIds = documentsToDelete.map(doc => (doc as any)._id.toString());
|
|
1337
|
+
|
|
1338
|
+
// Perform multiple deletions using deleteMany
|
|
1339
|
+
const result = await this.mongooseModel.deleteMany(contextualFilter, mongooseOpts);
|
|
1340
|
+
|
|
1341
|
+
this.logDebug('Multiple delete completed', {
|
|
1342
|
+
contextualFilter,
|
|
1343
|
+
deletedCount: result.deletedCount,
|
|
1344
|
+
deletedIds: deletedIds,
|
|
1345
|
+
hasTransaction: !!session
|
|
1346
|
+
});
|
|
1347
|
+
|
|
1348
|
+
return deletedIds;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
private async _doList<T = undefined>(
|
|
1352
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1353
|
+
executionContext: ExecutionContext<any>,
|
|
1354
|
+
ids_or_filter?: IdsOrFilterType,
|
|
1355
|
+
options?: RepositoryOptions & { listOptions?: Partial<Resources_PaginationRequest> }
|
|
1356
|
+
): Promise<(T extends undefined ? any : T)[] | Resources_PaginatedResult<T extends undefined ? any : T>> {
|
|
1357
|
+
|
|
1358
|
+
// Validate required parameter
|
|
1359
|
+
this.validateIdOrIdsOrFilterRequired(ids_or_filter, executionContext, CoreResourceOperation.LIST);
|
|
1360
|
+
|
|
1361
|
+
// Build base filter
|
|
1362
|
+
const { baseFilter } = this.buildBaseFilterFromIdOrIdsOrFilter(ids_or_filter, executionContext);
|
|
1363
|
+
|
|
1364
|
+
const contextualFilter = this.buildContextualFilter(executionContext, baseFilter, options);
|
|
1365
|
+
|
|
1366
|
+
// Build projection from operation's responseDto
|
|
1367
|
+
const projection = this.buildMongoProjectionFromResponseDto(operation);
|
|
1368
|
+
|
|
1369
|
+
// Check if pagination wrapper is requested
|
|
1370
|
+
const paginated = options?.paginated ?? false;
|
|
1371
|
+
const listOptions = options?.listOptions;
|
|
1372
|
+
const hasPagination = listOptions?.page !== undefined || listOptions?.limit !== undefined;
|
|
1373
|
+
|
|
1374
|
+
// Only count documents if we need pagination metadata
|
|
1375
|
+
let total = 0;
|
|
1376
|
+
let page = 1;
|
|
1377
|
+
let limit = 0;
|
|
1378
|
+
let skip = 0;
|
|
1379
|
+
let totalPages = 1;
|
|
1380
|
+
|
|
1381
|
+
if (paginated || hasPagination) {
|
|
1382
|
+
total = await this.mongooseModel.countDocuments(contextualFilter).exec();
|
|
1383
|
+
page = hasPagination ? Math.max(1, listOptions?.page || 1) : 1;
|
|
1384
|
+
limit = hasPagination ? Math.min(100, Math.max(1, listOptions?.limit || 20)) : total || 1;
|
|
1385
|
+
skip = (page - 1) * limit;
|
|
1386
|
+
totalPages = limit > 0 ? Math.ceil(total / limit) : 1;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// Get session for transaction support
|
|
1390
|
+
const session = this.getNativeSession(options);
|
|
1391
|
+
|
|
1392
|
+
this.logDebug('Listing resources', {
|
|
1393
|
+
ids_or_filter,
|
|
1394
|
+
paginated,
|
|
1395
|
+
hasPagination,
|
|
1396
|
+
page,
|
|
1397
|
+
limit,
|
|
1398
|
+
skip,
|
|
1399
|
+
total,
|
|
1400
|
+
hasTransaction: !!session
|
|
1401
|
+
});
|
|
1402
|
+
|
|
1403
|
+
// Prepare query with projection and transaction session
|
|
1404
|
+
let query = this.mongooseModel
|
|
1405
|
+
.find(contextualFilter, projection)
|
|
1406
|
+
.sort({ createdAt: -1 });
|
|
1407
|
+
|
|
1408
|
+
// Apply pagination only if requested
|
|
1409
|
+
if (hasPagination) {
|
|
1410
|
+
query = query.skip(skip).limit(limit);
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
if (session) {
|
|
1414
|
+
query = query.session(session);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
const documents = await query.exec();
|
|
1418
|
+
|
|
1419
|
+
const data = documents.map(doc => this.transformDocumentToResponse<T>(doc, CoreResourceOperation.LIST)) as (T extends undefined ? any : T)[];
|
|
1420
|
+
|
|
1421
|
+
this.logDebug('List result', {
|
|
1422
|
+
filter: contextualFilter,
|
|
1423
|
+
count: data.length,
|
|
1424
|
+
paginated,
|
|
1425
|
+
pagination: paginated ? { page, limit, total, totalPages } : undefined,
|
|
1426
|
+
sample: this.previewDocument(documents[0]),
|
|
1427
|
+
hasTransaction: !!session
|
|
1428
|
+
});
|
|
1429
|
+
|
|
1430
|
+
// Return raw array by default, or with pagination wrapper if requested
|
|
1431
|
+
if (paginated) {
|
|
1432
|
+
return {
|
|
1433
|
+
data,
|
|
1434
|
+
pagination: { page, limit: limit || data.length, total: total || data.length, totalPages }
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
return data;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
private async _doSearch<T = any>(
|
|
1442
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1443
|
+
executionContext: ExecutionContext<any>,
|
|
1444
|
+
searchQuery: string,
|
|
1445
|
+
filter: FilterQuery<any> = {},
|
|
1446
|
+
options: RepositoryOptions & { searchOptions: { fieldsToSearch?: string[]; page?: number; limit?: number; sort?: any} }
|
|
1447
|
+
): Promise<Resources_PaginatedResult<T>> {
|
|
1448
|
+
// Get session for transaction support
|
|
1449
|
+
const session = this.getNativeSession(options);
|
|
1450
|
+
|
|
1451
|
+
// Find the search operation configuration
|
|
1452
|
+
const searchConfig = this.findSearchOperationConfiguration();
|
|
1453
|
+
|
|
1454
|
+
if (!searchConfig) {
|
|
1455
|
+
const error = this.errorBuilder.buildError(
|
|
1456
|
+
ErrorType.NOT_FOUND,
|
|
1457
|
+
executionContext,
|
|
1458
|
+
{
|
|
1459
|
+
customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_SEARCH_NOT_CONFIGURED,
|
|
1460
|
+
}
|
|
1461
|
+
);
|
|
1462
|
+
throw error;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
const op = searchConfig as unknown as {
|
|
1466
|
+
isSearchable?: boolean;
|
|
1467
|
+
searchableFields?: string[];
|
|
1468
|
+
maxPaginatedResultPerPageLimit?: number;
|
|
1469
|
+
};
|
|
1470
|
+
|
|
1471
|
+
if (!op.isSearchable) {
|
|
1472
|
+
const error = this.errorBuilder.buildError( ErrorType.BUSINESS_RULE, executionContext,
|
|
1473
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_SEARCH_NOT_ENABLED }
|
|
1474
|
+
);
|
|
1475
|
+
throw error;
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
const page = Math.max(1, options.searchOptions.page || 1);
|
|
1479
|
+
const maxLimit = op.maxPaginatedResultPerPageLimit || 50;
|
|
1480
|
+
const limit = Math.min(maxLimit, Math.max(1, options.searchOptions.limit || 20));
|
|
1481
|
+
const skip = (page - 1) * limit;
|
|
1482
|
+
|
|
1483
|
+
this.logDebug('Searching resources with configuration', {
|
|
1484
|
+
searchQuery, filter, page, limit, maxLimit,
|
|
1485
|
+
searchableFields: op.searchableFields,
|
|
1486
|
+
isSearchable: op.isSearchable,
|
|
1487
|
+
hasTransaction: !!session
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
// Build advanced search filter using configuration
|
|
1491
|
+
const searchFilter = this.constructSearchQuery(searchQuery, searchConfig);
|
|
1492
|
+
const validatedFilter = this.sanitizeRequestFilter(filter, searchConfig);
|
|
1493
|
+
const combinedFilter = { ...validatedFilter, ...searchFilter };
|
|
1494
|
+
const contextualFilter = this.buildContextualFilter(executionContext, combinedFilter, options);
|
|
1495
|
+
|
|
1496
|
+
// Build sort options using configuration
|
|
1497
|
+
const sortOptions = this.constructValidatedSortOptions(options.searchOptions.sort, searchConfig);
|
|
1498
|
+
|
|
1499
|
+
// Build projection from operation's responseDto
|
|
1500
|
+
const projection = this.buildMongoProjectionFromResponseDto(operation);
|
|
1501
|
+
|
|
1502
|
+
// Prepare mongoose queries with projection and transaction session if provided
|
|
1503
|
+
let findQuery = this.mongooseModel
|
|
1504
|
+
.find(contextualFilter, projection)
|
|
1505
|
+
.sort(sortOptions)
|
|
1506
|
+
.skip(skip)
|
|
1507
|
+
.limit(limit);
|
|
1508
|
+
|
|
1509
|
+
let countQuery = this.mongooseModel.countDocuments(contextualFilter);
|
|
1510
|
+
|
|
1511
|
+
if (session) {
|
|
1512
|
+
findQuery = findQuery.session(session);
|
|
1513
|
+
countQuery = countQuery.session(session);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
const [documents, total] = await Promise.all([
|
|
1517
|
+
findQuery.exec(),
|
|
1518
|
+
countQuery.exec()
|
|
1519
|
+
]);
|
|
1520
|
+
|
|
1521
|
+
const data = documents.map(doc => this.transformDocumentToResponse(doc, CoreResourceOperation.SEARCH));
|
|
1522
|
+
|
|
1523
|
+
return {
|
|
1524
|
+
data,
|
|
1525
|
+
pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }
|
|
1526
|
+
};
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
private async _doCount(
|
|
1530
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1531
|
+
executionContext: ExecutionContext<any>,
|
|
1532
|
+
filter: FilterQuery<any> = {},
|
|
1533
|
+
options?: RepositoryOptions
|
|
1534
|
+
): Promise<{ count: number }> {
|
|
1535
|
+
const session = this.getNativeSession(options);
|
|
1536
|
+
this.logDebug('Counting resources', { filter, hasTransaction: !!session });
|
|
1537
|
+
|
|
1538
|
+
const contextualFilter = this.buildContextualFilter(executionContext, filter, options);
|
|
1539
|
+
|
|
1540
|
+
// Prepare count query with transaction session if provided
|
|
1541
|
+
let countQuery = this.mongooseModel.countDocuments(contextualFilter);
|
|
1542
|
+
|
|
1543
|
+
if (session) {
|
|
1544
|
+
countQuery = countQuery.session(session);
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
const count = await countQuery.exec();
|
|
1548
|
+
|
|
1549
|
+
this.logDebug('Count result', {
|
|
1550
|
+
filter: contextualFilter,
|
|
1551
|
+
count,
|
|
1552
|
+
hasTransaction: !!session
|
|
1553
|
+
});
|
|
1554
|
+
|
|
1555
|
+
return { count };
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
// ================================
|
|
1559
|
+
// Helper Methods
|
|
1560
|
+
// ================================
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Format a string ID for MongoDB queries.
|
|
1564
|
+
* Uses ResourceIdBackendService if available, falls back to direct ObjectId creation.
|
|
1565
|
+
*
|
|
1566
|
+
* @param id - The string ID to format
|
|
1567
|
+
* @returns The formatted ID (Types.ObjectId for MongoDB)
|
|
1568
|
+
*/
|
|
1569
|
+
private formatIdForQuery(id: string): Types.ObjectId {
|
|
1570
|
+
if (this.resourceIdService) {
|
|
1571
|
+
return this.resourceIdService.formatForQuery(id) as Types.ObjectId;
|
|
1572
|
+
}
|
|
1573
|
+
// Fallback for backward compatibility when service not available
|
|
1574
|
+
return new Types.ObjectId(id);
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Utility function to build a base filter from IdOrIdsOrFilterType
|
|
1579
|
+
* @param id_or_ids_or_filter - The input parameter to process
|
|
1580
|
+
* @param executionContext - Execution context for error handling
|
|
1581
|
+
* @returns Object containing the base filter and whether it represents multiple items
|
|
1582
|
+
*/
|
|
1583
|
+
private buildBaseFilterFromIdOrIdsOrFilter(
|
|
1584
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
1585
|
+
executionContext: ExecutionContext<any>
|
|
1586
|
+
): { baseFilter: FilterQuery<any>; isMultiple: boolean } {
|
|
1587
|
+
let baseFilter: FilterQuery<any> = {};
|
|
1588
|
+
let isMultiple = false;
|
|
1589
|
+
|
|
1590
|
+
if (!id_or_ids_or_filter) {
|
|
1591
|
+
return { baseFilter, isMultiple };
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
if (typeof id_or_ids_or_filter === 'string') {
|
|
1595
|
+
// Single ID
|
|
1596
|
+
baseFilter = { _id: this.formatIdForQuery(id_or_ids_or_filter) } as FilterQuery<any>;
|
|
1597
|
+
isMultiple = false;
|
|
1598
|
+
} else if (Array.isArray(id_or_ids_or_filter)) {
|
|
1599
|
+
// Multiple IDs
|
|
1600
|
+
if (id_or_ids_or_filter.length > 0) {
|
|
1601
|
+
const objectIds = id_or_ids_or_filter.map(singleId => this.formatIdForQuery(singleId));
|
|
1602
|
+
baseFilter = { _id: { $in: objectIds } } as FilterQuery<any>;
|
|
1603
|
+
}
|
|
1604
|
+
isMultiple = true;
|
|
1605
|
+
} else if (typeof id_or_ids_or_filter === 'object' && !Array.isArray(id_or_ids_or_filter)) {
|
|
1606
|
+
// Handle different object types
|
|
1607
|
+
if ('id_or_ids' in id_or_ids_or_filter) {
|
|
1608
|
+
// Combined object with id_or_ids and optional filter
|
|
1609
|
+
const { id_or_ids: ids, filter } = id_or_ids_or_filter;
|
|
1610
|
+
if (typeof ids === 'string') {
|
|
1611
|
+
baseFilter = { _id: this.formatIdForQuery(ids) } as FilterQuery<any>;
|
|
1612
|
+
isMultiple = false;
|
|
1613
|
+
} else if (Array.isArray(ids) && ids.length > 0) {
|
|
1614
|
+
const objectIds = ids.map(singleId => this.formatIdForQuery(singleId));
|
|
1615
|
+
baseFilter = { _id: { $in: objectIds } } as FilterQuery<any>;
|
|
1616
|
+
isMultiple = true;
|
|
1617
|
+
}
|
|
1618
|
+
// Merge additional filter if present
|
|
1619
|
+
if (filter && Object.keys(filter).length > 0) {
|
|
1620
|
+
baseFilter = { ...baseFilter, ...filter };
|
|
1621
|
+
isMultiple = true; // Combined filters usually imply multiple results
|
|
1622
|
+
}
|
|
1623
|
+
} else {
|
|
1624
|
+
// Direct FilterQuery object
|
|
1625
|
+
baseFilter = id_or_ids_or_filter as FilterQuery<any>;
|
|
1626
|
+
isMultiple = true; // Filter queries usually imply multiple results
|
|
1627
|
+
}
|
|
1628
|
+
} else {
|
|
1629
|
+
throw this.errorBuilder.buildError(
|
|
1630
|
+
ErrorType.VALIDATION,
|
|
1631
|
+
executionContext,
|
|
1632
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { message: 'Invalid id_or_ids_or_filter format' } }
|
|
1633
|
+
);
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
return { baseFilter, isMultiple };
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
private canReadViaContextWithoutExplicitId(
|
|
1640
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>,
|
|
1641
|
+
executionContext: ExecutionContext<any>,
|
|
1642
|
+
): boolean {
|
|
1643
|
+
const contextResourceIds = executionContext.getContextResourceIds();
|
|
1644
|
+
if (contextResourceIds.size === 0) {
|
|
1645
|
+
return false;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
const initiatorInfos = 'initiatorInfos' in operation ? operation.initiatorInfos : undefined;
|
|
1649
|
+
if (!initiatorInfos || initiatorInfos.length === 0) {
|
|
1650
|
+
return false;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
return initiatorInfos.some((initiatorInfo) => {
|
|
1654
|
+
const parameters = initiatorInfo.parameters ?? [];
|
|
1655
|
+
return (
|
|
1656
|
+
parameters.length > 0
|
|
1657
|
+
&& !parameters.some((parameter) => parameter.fieldIdentifier === operation.resourceFieldIdentifier)
|
|
1658
|
+
&& parameters.every((parameter) => contextResourceIds.has(parameter.fieldIdentifier))
|
|
1659
|
+
);
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
/**
|
|
1664
|
+
* Utility function to validate that id_or_ids_or_filter parameter is provided
|
|
1665
|
+
* @param id_or_ids_or_filter - The parameter to validate
|
|
1666
|
+
* @param executionContext - Execution context for error handling
|
|
1667
|
+
* @param operationName - Name of the operation for error messages
|
|
1668
|
+
*/
|
|
1669
|
+
private validateIdOrIdsOrFilterRequired(
|
|
1670
|
+
id_or_ids_or_filter: IdOrIdsOrFilterType,
|
|
1671
|
+
executionContext: ExecutionContext<any>,
|
|
1672
|
+
operationName: string,
|
|
1673
|
+
allowContextOnlyRead: boolean = false,
|
|
1674
|
+
): void {
|
|
1675
|
+
if (!id_or_ids_or_filter) {
|
|
1676
|
+
if (operationName === CoreResourceOperation.READ && allowContextOnlyRead) {
|
|
1677
|
+
return;
|
|
1678
|
+
}
|
|
1679
|
+
throw this.errorBuilder.buildError(
|
|
1680
|
+
ErrorType.VALIDATION,
|
|
1681
|
+
executionContext,
|
|
1682
|
+
{ customMessageReference: ErrorCustomMessageReference.REPOSITORY_RESOURCE_OPERATION_FAILED, context: { message: `${operationName} requires id_or_ids_or_filter parameter` } }
|
|
1683
|
+
);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Escapes special regex characters in search query to prevent regex injection
|
|
1691
|
+
* @param text - The text to escape
|
|
1692
|
+
* @returns Escaped text safe for regex
|
|
1693
|
+
*/
|
|
1694
|
+
private escapeRegex(text: string): string {
|
|
1695
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1696
|
+
}
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
|
|
1700
|
+
/**
|
|
1701
|
+
* Extract projection fields from operation's responseDto for MongoDB field selection
|
|
1702
|
+
* @param operation - The operation to extract responseDto fields from
|
|
1703
|
+
* @returns MongoDB projection object or null if no responseDto is defined
|
|
1704
|
+
*/
|
|
1705
|
+
private buildMongoProjectionFromResponseDto(
|
|
1706
|
+
operation: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>
|
|
1707
|
+
): Record<string, 1> | null {
|
|
1708
|
+
// Prefer repositoryDto over responseDto
|
|
1709
|
+
// repositoryDto excludes virtual fields and populated placeholders,
|
|
1710
|
+
// but includes virtual field dependencies
|
|
1711
|
+
const dtoToUse = operation.repositoryDto ?? operation.responseDto;
|
|
1712
|
+
|
|
1713
|
+
if (!dtoToUse) {
|
|
1714
|
+
this.logDebug('No responseDto/repositoryDto found in operation, using full document projection');
|
|
1715
|
+
return null;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
try {
|
|
1719
|
+
// Parse the DTO to extract field names
|
|
1720
|
+
const responseSchema = dtoToUse;
|
|
1721
|
+
|
|
1722
|
+
// For Zod schemas, we can use the shape property to get field names
|
|
1723
|
+
if (responseSchema && typeof responseSchema === 'object' && 'shape' in responseSchema) {
|
|
1724
|
+
const shape = (responseSchema as any).shape;
|
|
1725
|
+
const projection: Record<string, 1> = {};
|
|
1726
|
+
|
|
1727
|
+
Object.keys(shape).forEach(fieldName => {
|
|
1728
|
+
projection[fieldName] = 1;
|
|
1729
|
+
});
|
|
1730
|
+
|
|
1731
|
+
this.logDebug('Built projection from responseDto', {
|
|
1732
|
+
operationIdentifier: operation.operationIdentifier,
|
|
1733
|
+
projectionFields: Object.keys(projection)
|
|
1734
|
+
});
|
|
1735
|
+
|
|
1736
|
+
return projection;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
// If we can't extract fields from the schema, fall back to full document
|
|
1740
|
+
this.logDebug('Unable to extract fields from responseDto, using full document projection', {
|
|
1741
|
+
operationIdentifier: operation.operationIdentifier,
|
|
1742
|
+
responseDtoType: typeof responseSchema
|
|
1743
|
+
});
|
|
1744
|
+
|
|
1745
|
+
return null;
|
|
1746
|
+
} catch (error) {
|
|
1747
|
+
this.logDebug('Error extracting projection from responseDto, using full document', {
|
|
1748
|
+
operationIdentifier: operation.operationIdentifier,
|
|
1749
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
1750
|
+
});
|
|
1751
|
+
|
|
1752
|
+
return null;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* Build contextual filter based on execution context with schema validation and blacklist support
|
|
1758
|
+
* @param executionContext - The execution context containing resource IDs
|
|
1759
|
+
* @param baseFilter - The base filter to enhance with context
|
|
1760
|
+
* @param options - Repository options containing exclusion rules
|
|
1761
|
+
* @returns Enhanced filter with context information
|
|
1762
|
+
*/
|
|
1763
|
+
private buildContextualFilter(executionContext: ExecutionContext<any>, baseFilter: FilterQuery<any>, options?: RepositoryOptions): FilterQuery<any> {
|
|
1764
|
+
const contextualFilter = { ...baseFilter };
|
|
1765
|
+
|
|
1766
|
+
// Check if contextual filtering should be excluded
|
|
1767
|
+
if (options?.excludeContextualFilter === true) {
|
|
1768
|
+
// Skip all contextual filtering if explicitly disabled
|
|
1769
|
+
this.logDebug('Contextual filtering disabled, returning base filter only');
|
|
1770
|
+
return contextualFilter;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
// Determine blacklisted fields
|
|
1774
|
+
const blacklistedFields = new Set<string>();
|
|
1775
|
+
|
|
1776
|
+
// Always exclude the resource's own resourceFieldIdentifier to avoid self-reference in filtering
|
|
1777
|
+
blacklistedFields.add(this.resourceConfiguration.resourceFieldIdentifier);
|
|
1778
|
+
|
|
1779
|
+
// Add custom blacklisted fields if provided
|
|
1780
|
+
if (Array.isArray(options?.excludeContextualFilter)) {
|
|
1781
|
+
options.excludeContextualFilter.forEach(field => blacklistedFields.add(field));
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
// Add context resource filters (with nested path support, schema validation and blacklist filtering)
|
|
1785
|
+
const contextResourceIds = executionContext.getContextResourceIds();
|
|
1786
|
+
contextResourceIds.forEach((resourceId, fieldIdentifier) => {
|
|
1787
|
+
// Skip if field is blacklisted
|
|
1788
|
+
if (blacklistedFields.has(fieldIdentifier)) {
|
|
1789
|
+
this.logDebug('Skipping blacklisted field in contextual filter', { fieldIdentifier });
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
// Find all schema paths that end with this field identifier (including nested paths)
|
|
1794
|
+
const matchingPaths = this.resourceOperationHelper.findRequiredNestedFieldPathsFromZodSchema(
|
|
1795
|
+
this.resourceConfiguration.mainSchema,
|
|
1796
|
+
fieldIdentifier,
|
|
1797
|
+
executionContext,
|
|
1798
|
+
{
|
|
1799
|
+
reason: 'context_filter',
|
|
1800
|
+
resourceIdentifier: this.resourceConfiguration.resourceIdentifier,
|
|
1801
|
+
message: `Execution context field '${fieldIdentifier}' is missing from schema for resource '${this.resourceConfiguration.resourceIdentifier}' during contextual filtering`,
|
|
1802
|
+
}
|
|
1803
|
+
);
|
|
1804
|
+
|
|
1805
|
+
// Process each matching path
|
|
1806
|
+
matchingPaths.forEach(fullPath => {
|
|
1807
|
+
// Only add if not already present in filter (check nested path)
|
|
1808
|
+
if (!this.resourceOperationHelper.hasNestedPath(contextualFilter, fullPath)) {
|
|
1809
|
+
this.resourceOperationHelper.setNestedValue(contextualFilter, fullPath, resourceId);
|
|
1810
|
+
this.logDebug('Added contextual filter to nested path', { fieldIdentifier, fullPath, resourceId });
|
|
1811
|
+
} else {
|
|
1812
|
+
this.logDebug('Skipping contextual filter - already present in filter', { fieldIdentifier, fullPath });
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
|
|
1817
|
+
// Defense-in-depth: enforce userId = null for ANONYMOUS scope on isAnonymizable resources.
|
|
1818
|
+
// Prevents any anonymous query from seeing authenticated users' data even if scoping is bypassed.
|
|
1819
|
+
if (executionContext.isAnonymousExecution() && this.resourceConfiguration.isAnonymizable) {
|
|
1820
|
+
const userPaths = this.resourceOperationHelper.findNestedFieldPathsFromZodSchema(
|
|
1821
|
+
this.resourceConfiguration.mainSchema, 'userId'
|
|
1822
|
+
);
|
|
1823
|
+
userPaths.forEach(fullPath => {
|
|
1824
|
+
this.resourceOperationHelper.setNestedValue(contextualFilter, fullPath, null);
|
|
1825
|
+
});
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
// Apply FK relationship filters from relationship contexts
|
|
1829
|
+
// This handles cases like /assigned-to-users/{userId}/todos where we need to filter by assignedToUserId
|
|
1830
|
+
this.applyFKRelationshipFilters(executionContext, contextualFilter, blacklistedFields);
|
|
1831
|
+
|
|
1832
|
+
return contextualFilter;
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* Apply FK relationship filters from ExecutionContext.relationshipContexts
|
|
1837
|
+
*
|
|
1838
|
+
* When a resource is accessed via a FK relationship path (e.g., /assigned-to-users/{userId}/todos),
|
|
1839
|
+
* this method adds the appropriate filter to ensure only resources matching the FK field are returned.
|
|
1840
|
+
*
|
|
1841
|
+
* For example:
|
|
1842
|
+
* - URL: /assigned-to-users/{userId}/todos
|
|
1843
|
+
* - relationshipContext: { resourceType: 'USERS', relationshipField: 'assignedToUserId', resourceId: '123' }
|
|
1844
|
+
* - Filter added: { assignedToUserId: '123' }
|
|
1845
|
+
*/
|
|
1846
|
+
private applyFKRelationshipFilters(
|
|
1847
|
+
executionContext: ExecutionContext<any>,
|
|
1848
|
+
filter: FilterQuery<any>,
|
|
1849
|
+
blacklistedFields: Set<string>
|
|
1850
|
+
): void {
|
|
1851
|
+
const relationshipContexts = executionContext.relationshipContexts;
|
|
1852
|
+
|
|
1853
|
+
if (!relationshipContexts || relationshipContexts.length === 0) {
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
for (const relationshipContext of relationshipContexts) {
|
|
1858
|
+
const { relationshipField, resourceId } = relationshipContext;
|
|
1859
|
+
|
|
1860
|
+
// Only apply for FK relationships (those with a relationshipField defined)
|
|
1861
|
+
// Standard parent relationships are handled by the contextResourceIds loop above
|
|
1862
|
+
if (!relationshipField) {
|
|
1863
|
+
continue;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
// Skip if field is blacklisted
|
|
1867
|
+
if (blacklistedFields.has(relationshipField)) {
|
|
1868
|
+
this.logDebug('Skipping blacklisted FK relationship field in filter', { relationshipField });
|
|
1869
|
+
continue;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
// Find all schema paths that match this FK field
|
|
1873
|
+
const matchingPaths = this.resourceOperationHelper.findRequiredNestedFieldPathsFromZodSchema(
|
|
1874
|
+
this.resourceConfiguration.mainSchema,
|
|
1875
|
+
relationshipField,
|
|
1876
|
+
executionContext,
|
|
1877
|
+
{
|
|
1878
|
+
reason: 'fk_filter',
|
|
1879
|
+
resourceIdentifier: this.resourceConfiguration.resourceIdentifier,
|
|
1880
|
+
message: `Relationship field '${relationshipField}' is missing from schema for resource '${this.resourceConfiguration.resourceIdentifier}' during FK-path filtering`,
|
|
1881
|
+
}
|
|
1882
|
+
);
|
|
1883
|
+
|
|
1884
|
+
// Apply filter for each matching path
|
|
1885
|
+
matchingPaths.forEach(fullPath => {
|
|
1886
|
+
if (!this.resourceOperationHelper.hasNestedPath(filter, fullPath)) {
|
|
1887
|
+
this.resourceOperationHelper.setNestedValue(filter, fullPath, resourceId);
|
|
1888
|
+
this.logDebug('Added FK relationship filter', { relationshipField, fullPath, resourceId });
|
|
1889
|
+
} else {
|
|
1890
|
+
this.logDebug('Skipping FK relationship filter - already present', { relationshipField, fullPath });
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* Check if a field exists in the mongoose model schema
|
|
1900
|
+
*/
|
|
1901
|
+
private hasSchemaField(fieldName: string): boolean {
|
|
1902
|
+
if (!this.mongooseModel?.schema?.paths) {
|
|
1903
|
+
return false;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
return this.mongooseModel.schema.paths[fieldName] !== undefined;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* Handle MongoDB errors and convert them to application-specific errors.
|
|
1911
|
+
* Specifically handles unique constraint violations (E11000 duplicate key error).
|
|
1912
|
+
*
|
|
1913
|
+
* @param error - The error caught from MongoDB operation
|
|
1914
|
+
* @param executionContext - The execution context for error building
|
|
1915
|
+
* @returns The original error or a transformed application error
|
|
1916
|
+
*/
|
|
1917
|
+
private handleMongoDBError(error: unknown, executionContext?: ExecutionContext<any>): Error | WildoError_Backend {
|
|
1918
|
+
// Check for MongoDB duplicate key error (E11000)
|
|
1919
|
+
const isMongoError = error && typeof error === 'object' && 'code' in error;
|
|
1920
|
+
|
|
1921
|
+
if (isMongoError && (error as any).code === 11000) {
|
|
1922
|
+
// Extract field name from the error message
|
|
1923
|
+
// MongoDB error message format: "E11000 duplicate key error collection: db.collection index: fieldName_1 dup key: { fieldName: "value" }"
|
|
1924
|
+
const errorMessage = (error as any).message || '';
|
|
1925
|
+
const keyValueMatch = errorMessage.match(/dup key: \{ ([^:]+):/);
|
|
1926
|
+
const fieldName = keyValueMatch ? keyValueMatch[1].trim() : 'unknown';
|
|
1927
|
+
|
|
1928
|
+
// Extract the duplicate value if present
|
|
1929
|
+
const valueMatch = errorMessage.match(/dup key: \{ [^:]+: "([^"]+)" \}/);
|
|
1930
|
+
const duplicateValue = valueMatch ? valueMatch[1] : undefined;
|
|
1931
|
+
|
|
1932
|
+
return this.errorBuilder.buildError(
|
|
1933
|
+
ErrorType.CONFLICT,
|
|
1934
|
+
executionContext,
|
|
1935
|
+
{
|
|
1936
|
+
customMessageReference: ErrorCustomMessageReference.UNIQUE_CONSTRAINT_VIOLATION,
|
|
1937
|
+
context: {
|
|
1938
|
+
resourceType: this.resourceConfiguration.resourceIdentifier,
|
|
1939
|
+
fieldName,
|
|
1940
|
+
duplicateValue,
|
|
1941
|
+
originalError: errorMessage
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
);
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
// Return the original error if not a unique constraint violation
|
|
1948
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* Add user tracking to enriched data (timestamps are handled automatically by MongoDB)
|
|
1954
|
+
* @param enrichedData - The data to add user tracking to
|
|
1955
|
+
* @param executionContext - The execution context containing user info
|
|
1956
|
+
* @param operation - The operation being performed
|
|
1957
|
+
* @returns Data with user tracking added
|
|
1958
|
+
*/
|
|
1959
|
+
private addUserTracking(enrichedData: any, executionContext: ExecutionContext<any>, operation?: CoreResourceOperation): any {
|
|
1960
|
+
// Note: createdAt and updatedAt timestamps are handled automatically by MongoDB, so we don't add them here
|
|
1961
|
+
|
|
1962
|
+
// Add operation-specific user tracking if userId is available in execution context
|
|
1963
|
+
const userId = executionContext.initiatorIds?.userId;
|
|
1964
|
+
if (userId) {
|
|
1965
|
+
|
|
1966
|
+
// For CREATE operations: populate createdByUserId if field exists in database schema
|
|
1967
|
+
if (operation === CoreResourceOperation.CREATE || operation === CoreResourceOperation.CREATE_MANY) {
|
|
1968
|
+
if (this.hasSchemaField('createdByUserId') && !enrichedData.createdByUserId) {
|
|
1969
|
+
enrichedData.createdByUserId = userId;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
// For UPDATE operations: populate updatedByUserId or lastUpdatedByUserId if field exists in database schema
|
|
1974
|
+
if (operation === CoreResourceOperation.UPDATE || operation === CoreResourceOperation.UPDATE_MANY) {
|
|
1975
|
+
// Try updatedByUserId first, then lastUpdatedByUserId as fallback
|
|
1976
|
+
if (this.hasSchemaField('updatedByUserId') && !enrichedData.updatedByUserId) {
|
|
1977
|
+
enrichedData.updatedByUserId = userId;
|
|
1978
|
+
} else if (this.hasSchemaField('lastUpdatedByUserId') && !enrichedData.lastUpdatedByUserId) {
|
|
1979
|
+
enrichedData.lastUpdatedByUserId = userId;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
return enrichedData;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1987
|
+
/**
|
|
1988
|
+
* Transform mongoose document to response format using operation DTO
|
|
1989
|
+
*/
|
|
1990
|
+
private transformDocumentToResponse<T = undefined>(document: any, operationIdentifier: string): T extends undefined ? any : T {
|
|
1991
|
+
if (!document) {
|
|
1992
|
+
return null;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
// Convert mongoose document to plain object with error handling
|
|
1996
|
+
let plainObject: any;
|
|
1997
|
+
try {
|
|
1998
|
+
plainObject = document.toObject ? document.toObject() : document;
|
|
1999
|
+
} catch (error) {
|
|
2000
|
+
this.logDebug('Document toObject() failed, using document as-is', {
|
|
2001
|
+
operationIdentifier,
|
|
2002
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
2003
|
+
});
|
|
2004
|
+
plainObject = document;
|
|
2005
|
+
}
|
|
2006
|
+
|
|
2007
|
+
// Map _version_db_doc to _version for API responses, then remove internal field name
|
|
2008
|
+
if (plainObject && typeof plainObject === 'object') {
|
|
2009
|
+
if (plainObject._version_db_doc !== undefined) {
|
|
2010
|
+
plainObject._version = plainObject._version_db_doc;
|
|
2011
|
+
}
|
|
2012
|
+
delete plainObject._version_db_doc;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
// Transforming to response DTO is the role of the service layer
|
|
2016
|
+
return plainObject;
|
|
2017
|
+
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
private previewDocument(document: any): any {
|
|
2021
|
+
if (!document) return null;
|
|
2022
|
+
const obj = document.toObject ? document.toObject() : document;
|
|
2023
|
+
// Limit preview size and hide potentially large fields
|
|
2024
|
+
const clone: any = { ...obj };
|
|
2025
|
+
Object.keys(clone).forEach((k) => {
|
|
2026
|
+
const v = clone[k];
|
|
2027
|
+
if (v && typeof v === 'object') {
|
|
2028
|
+
if (Array.isArray(v)) {
|
|
2029
|
+
clone[k] = `[Array(${v.length})]`;
|
|
2030
|
+
} else {
|
|
2031
|
+
clone[k] = '[Object]';
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
return clone;
|
|
2036
|
+
}
|
|
2037
|
+
// ================================
|
|
2038
|
+
// Search Configuration Methods
|
|
2039
|
+
// ================================
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* Retrieves the search operation configuration for this resource.
|
|
2043
|
+
* Uses structural narrowing — SEARCH operations are API_CALL operations
|
|
2044
|
+
* with collection-view fields (filterFields, sortFields, etc.) flattened by the factory.
|
|
2045
|
+
*/
|
|
2046
|
+
private findSearchOperationConfiguration(): ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema> | null {
|
|
2047
|
+
return Array.from(this.operationsMap.values()).find(
|
|
2048
|
+
operation => operation.operationIdentifier === CoreResourceOperation.SEARCH
|
|
2049
|
+
) ?? null;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
/**
|
|
2053
|
+
* Constructs MongoDB search filter based on query string and searchable field configuration
|
|
2054
|
+
* @param searchQuery - The search query string
|
|
2055
|
+
* @param searchConfig - The search operation configuration
|
|
2056
|
+
* @returns MongoDB filter query for search
|
|
2057
|
+
*/
|
|
2058
|
+
private constructSearchQuery(
|
|
2059
|
+
searchQuery: string,
|
|
2060
|
+
searchConfig: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>
|
|
2061
|
+
): FilterQuery<any> {
|
|
2062
|
+
if (!searchQuery?.trim()) {
|
|
2063
|
+
return {};
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
const op = searchConfig as unknown as { searchableFields?: string[]; searchableOptions?: CollectionView_SearchOptions };
|
|
2067
|
+
const searchableFields = op.searchableFields;
|
|
2068
|
+
const searchableOptions = op.searchableOptions;
|
|
2069
|
+
|
|
2070
|
+
if (!searchableFields?.length) {
|
|
2071
|
+
return { $text: { $search: searchQuery } };
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
const searchConditions = this.buildFieldSearchConditions(
|
|
2075
|
+
searchQuery,
|
|
2076
|
+
searchableFields,
|
|
2077
|
+
searchableOptions
|
|
2078
|
+
);
|
|
2079
|
+
|
|
2080
|
+
return searchConditions.length > 1
|
|
2081
|
+
? { $or: searchConditions }
|
|
2082
|
+
: searchConditions[0] || {};
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
/**
|
|
2086
|
+
* Builds individual field search conditions based on searchable options
|
|
2087
|
+
* @param searchQuery - The search query string
|
|
2088
|
+
* @param searchableFields - Array of fields that can be searched
|
|
2089
|
+
* @param searchableOptions - Search behavior options
|
|
2090
|
+
* @returns Array of MongoDB field conditions
|
|
2091
|
+
*/
|
|
2092
|
+
private buildFieldSearchConditions(
|
|
2093
|
+
searchQuery: string,
|
|
2094
|
+
searchableFields: string[],
|
|
2095
|
+
searchableOptions?: CollectionView_SearchOptions
|
|
2096
|
+
): FilterQuery<any>[] {
|
|
2097
|
+
const caseSensitive = searchableOptions?.caseSensitive || false;
|
|
2098
|
+
const fullMatchOnly = searchableOptions?.fullMatchOnly || false;
|
|
2099
|
+
|
|
2100
|
+
return searchableFields.map((field: string) => {
|
|
2101
|
+
if (fullMatchOnly) {
|
|
2102
|
+
return caseSensitive
|
|
2103
|
+
? { [field]: searchQuery }
|
|
2104
|
+
: { [field]: { $regex: `^${this.escapeRegex(searchQuery)}$`, $options: 'i' } };
|
|
2105
|
+
} else {
|
|
2106
|
+
return caseSensitive
|
|
2107
|
+
? { [field]: { $regex: this.escapeRegex(searchQuery) } }
|
|
2108
|
+
: { [field]: { $regex: this.escapeRegex(searchQuery), $options: 'i' } };
|
|
2109
|
+
}
|
|
2110
|
+
});
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
* Validates and filters the provided filter object against allowed filter fields configuration
|
|
2115
|
+
* @param requestedFilter - The filter object from the request
|
|
2116
|
+
* @param searchConfig - The search operation configuration
|
|
2117
|
+
* @returns Validated and sanitized filter object
|
|
2118
|
+
*/
|
|
2119
|
+
private sanitizeRequestFilter(
|
|
2120
|
+
requestedFilter: FilterQuery<any>,
|
|
2121
|
+
searchConfig: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>
|
|
2122
|
+
): FilterQuery<any> {
|
|
2123
|
+
if (!requestedFilter || Object.keys(requestedFilter).length === 0) {
|
|
2124
|
+
return {};
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
const { filterFields } = searchConfig as unknown as { filterFields?: Record<string, unknown> };
|
|
2128
|
+
|
|
2129
|
+
// If no filter fields configured, return filter as-is (fallback behavior)
|
|
2130
|
+
if (!filterFields || Object.keys(filterFields).length === 0) {
|
|
2131
|
+
return requestedFilter;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
// Only include fields that are explicitly allowed in the configuration
|
|
2135
|
+
const sanitizedFilter: FilterQuery<any> = {};
|
|
2136
|
+
|
|
2137
|
+
Object.entries(requestedFilter).forEach(([fieldName, fieldValue]) => {
|
|
2138
|
+
if (filterFields[fieldName]) {
|
|
2139
|
+
sanitizedFilter[fieldName] = fieldValue;
|
|
2140
|
+
}
|
|
2141
|
+
// Note: Invalid fields are silently ignored for security
|
|
2142
|
+
});
|
|
2143
|
+
|
|
2144
|
+
return sanitizedFilter;
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
/**
|
|
2148
|
+
* Constructs validated sort options based on allowed sort fields configuration
|
|
2149
|
+
* @param requestedSort - The sort object from the request
|
|
2150
|
+
* @param searchConfig - The search operation configuration
|
|
2151
|
+
* @returns Validated MongoDB sort object
|
|
2152
|
+
*/
|
|
2153
|
+
private constructValidatedSortOptions(
|
|
2154
|
+
requestedSort: Record<string, 1 | -1> | undefined,
|
|
2155
|
+
searchConfig: ResourceConfiguration_Operation<TCustomOperationEnum, TCoreOperationEnum, TMainSchema>
|
|
2156
|
+
): Record<string, 1 | -1> {
|
|
2157
|
+
const { sortFields } = searchConfig as unknown as { sortFields?: readonly string[] };
|
|
2158
|
+
const defaultSort: Record<string, 1 | -1> = { createdAt: -1 };
|
|
2159
|
+
|
|
2160
|
+
// If no sort fields configured, use requested sort or default
|
|
2161
|
+
if (!sortFields?.length) {
|
|
2162
|
+
return requestedSort || defaultSort;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
// If no sort requested, use first configured sort field
|
|
2166
|
+
if (!requestedSort) {
|
|
2167
|
+
const firstSortField = sortFields[0];
|
|
2168
|
+
return { [firstSortField]: -1 };
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
// Validate requested sort fields against configuration
|
|
2172
|
+
const validatedSort: Record<string, 1 | -1> = {};
|
|
2173
|
+
|
|
2174
|
+
Object.entries(requestedSort).forEach(([fieldName, sortDirection]) => {
|
|
2175
|
+
if (sortFields.includes(fieldName) && (sortDirection === 1 || sortDirection === -1)) {
|
|
2176
|
+
validatedSort[fieldName] = sortDirection;
|
|
2177
|
+
}
|
|
2178
|
+
});
|
|
2179
|
+
|
|
2180
|
+
// Return validated sort or fallback to default
|
|
2181
|
+
return Object.keys(validatedSort).length > 0 ? validatedSort : defaultSort;
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2184
|
+
|
|
2185
|
+
|
|
2186
|
+
}
|