@wildo-ai/saas-backend-lib 1.1.1 → 1.1.3
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/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
- package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js +19 -1
- package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +4 -0
- package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts +35 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js +111 -0
- package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts +50 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +199 -0
- package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts +111 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js +140 -0
- package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts +14 -3
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +138 -24
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js +8 -3
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js +11 -2
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts +124 -13
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +207 -21
- package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts +60 -8
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +174 -26
- package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +48 -4
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +102 -30
- package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts +55 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js +114 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts +89 -14
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js +84 -11
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js +16 -0
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts +20 -6
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +96 -32
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts +3 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js +32 -7
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts +8 -5
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +80 -0
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +298 -23
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts +71 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +85 -5
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +21 -0
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +146 -4
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +22 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts +3 -26
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js +3 -68
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js +4 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts +11 -0
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js +39 -5
- package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +181 -2
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +533 -43
- package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts +36 -3
- package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/system-access.backend.service.js +70 -8
- package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts +28 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js +90 -0
- package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts +44 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js +99 -0
- package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts +91 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js +152 -0
- package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +186 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +474 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +100 -0
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +209 -6
- package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +200 -4
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +593 -64
- package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts +36 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.js +83 -0
- package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -0
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts +9 -0
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js +11 -1
- package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +54 -13
- package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +38 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +67 -2
- package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +30 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +43 -1
- package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +11 -3
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +30 -16
- package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +104 -25
- package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +18 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +106 -2
- package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts +52 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js +74 -0
- package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -0
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +104 -11
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +260 -26
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts +30 -1
- package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
- package/dist/esm/billing/testing/mock-billing-provider.js +25 -0
- package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js +11 -4
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +263 -13
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +376 -58
- package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +264 -7
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +414 -5
- package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js +7 -1
- package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +16 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +140 -0
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +42 -0
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +65 -6
- package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts +110 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js +192 -0
- package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +45 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts +5 -0
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js +6 -0
- package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js +7 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.js.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +146 -46
- package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.js +121 -12
- package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts +38 -15
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js +17 -2
- package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +0 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration-loader.backend.service.js +68 -76
- package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.service.js +23 -1
- package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts +43 -1
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.js +52 -3
- package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +25 -0
- package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js +41 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js +2 -2
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.js.map +1 -1
- package/dist/esm/databases/models/filter.backend.schemas.js +2 -2
- package/dist/esm/databases/models/filter.backend.schemas.js.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js +20 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.js.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js +48 -0
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
- package/dist/esm/databases/services/redis.service.d.ts +27 -0
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/redis.service.js +29 -0
- package/dist/esm/databases/services/redis.service.js.map +1 -1
- package/dist/esm/errors/services/error-builder.backend.service.d.ts +13 -1
- package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-builder.backend.service.js +13 -1
- package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.d.ts +70 -7
- package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/error-handler.backend.service.js +134 -8
- package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts +66 -0
- package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
- package/dist/esm/errors/services/rate-limit.backend.service.js +102 -25
- package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts +5 -0
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js +25 -0
- package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts +33 -0
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js +40 -0
- package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts +41 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js +40 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.js.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts +64 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js +193 -0
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.js.map +1 -0
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +72 -4
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +60 -19
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-transform.backend.js +7 -1
- package/dist/esm/external-data/external-data-transform.backend.js.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts +2 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js +13 -0
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.js.map +1 -1
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts +4 -2
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
- package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +256 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +333 -0
- package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts +56 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js +211 -0
- package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts +45 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js +216 -0
- package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts +56 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js +78 -0
- package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -0
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +1 -1
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +2 -2
- package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts +89 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js +164 -0
- package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -0
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts +26 -27
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js +50 -64
- package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/document-extraction.backend.service.js +3 -3
- package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/embeddings.backend.service.js +4 -4
- package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +306 -7
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +539 -45
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +25 -2
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
- package/dist/esm/files/controllers/file.controller.d.ts +24 -1
- package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
- package/dist/esm/files/controllers/file.controller.js +83 -11
- package/dist/esm/files/controllers/file.controller.js.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts +17 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js +1 -0
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -0
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +5 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +76 -13
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts +18 -0
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.js +36 -28
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.d.ts +94 -9
- package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-scanning.backend.service.js +197 -17
- package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +60 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-text-extraction.backend.service.js +167 -8
- package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +214 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js +566 -0
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -0
- package/dist/esm/files/services/files.backend.service.d.ts +87 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +252 -19
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts +109 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.js +123 -0
- package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -0
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +16 -10
- package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +67 -8
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +101 -28
- package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +8 -55
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +20 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.js +12 -0
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts +86 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js +288 -0
- package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts +15 -0
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js +76 -5
- package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js +6 -1
- package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts +60 -0
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js +63 -0
- package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts +74 -0
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +200 -44
- package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts +7 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js +53 -1
- package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts +18 -0
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js +18 -0
- package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts +12 -7
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +0 -13
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +14 -22
- package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +8 -3
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +25 -15
- package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +13 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +88 -8
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +333 -31
- package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js +4 -2
- package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts +113 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js +62 -0
- package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -0
- package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/actors-system.backend.service.js +0 -2
- package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +107 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +519 -56
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +5 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +79 -16
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +34 -5
- package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js +154 -20
- package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
- package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/flows.backend.services.js +27 -23
- package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js +7 -1
- package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts +90 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js +368 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +9 -5
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +12 -17
- package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts +151 -41
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +308 -143
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts +0 -207
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js +8 -243
- package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +9 -14
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +18 -89
- package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
- package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts +86 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.js +155 -0
- package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +10 -0
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +55 -5
- package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
- package/dist/esm/index.d.ts +15 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +45 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +82 -10
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +20 -3
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +21 -3
- package/dist/esm/inject/models/service-types.js.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
- package/dist/esm/mcp/controllers/mcp.controller.js +32 -4
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts +34 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js +42 -0
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +84 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.js +235 -11
- package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts +64 -2
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +152 -6
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +49 -4
- package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts +66 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js +199 -0
- package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -0
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +149 -13
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +411 -19
- package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +11 -2
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +28 -9
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +30 -10
- package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
- package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.js +52 -11
- package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts +62 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js +78 -0
- package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +309 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +385 -0
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +1 -0
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts +21 -0
- package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/metrics.service.js +38 -0
- package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -80
- package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -1
- package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -25
- package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -1
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -49
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -141
- package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -37
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -121
- package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +66 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +105 -10
- package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -58
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -1
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -223
- package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +10 -1
- package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.d.ts +60 -4
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.js +145 -43
- package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +0 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
- package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +142 -21
- package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notification-badge.backend.service.js +283 -58
- package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +108 -13
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +432 -101
- package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +2 -2
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.js +5 -5
- package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +117 -5
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +164 -6
- package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts +0 -6
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +54 -7
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts +5 -5
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js +14 -13
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts +2 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +18 -8
- package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +20 -18
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +16 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +18 -0
- package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts +2 -2
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js +2 -2
- package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +63 -2
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js +4 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts +66 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js +257 -0
- package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts +12 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js +47 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts +87 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts +31 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js +13 -0
- package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +19 -25
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +33 -0
- package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +2 -2
- package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/domain-queue-consumer.backend.service.js +1 -4
- package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.d.ts +2 -2
- package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-consumer.backend.service.js +1 -4
- package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.d.ts +2 -2
- package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-executor.backend.service.js +1 -4
- package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts +8 -4
- package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-monitoring.backend.service.js +25 -17
- package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +16 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.js +16 -1
- package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
- package/dist/esm/queue/queue.backend.service.d.ts +3 -3
- package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/queue.backend.service.js +26 -4
- package/dist/esm/queue/queue.backend.service.js.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +2 -2
- package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js +18 -3
- package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts +50 -25
- package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunking.backend.utils.js +147 -39
- package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts +12 -3
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js +12 -3
- package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
- package/dist/esm/requests/service/websocket.service.d.ts +9 -0
- package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
- package/dist/esm/requests/service/websocket.service.js +88 -15
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +16 -2
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-operations.backend.definitions.js +2 -0
- package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
- package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js +14 -0
- package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +2 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
- package/dist/esm/resources/models/resources-types.backend.schemas.js +8 -0
- package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
- package/dist/esm/resources/services/resource-id.backend.service.js +3 -3
- package/dist/esm/resources/services/resource-id.backend.service.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +60 -5
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.js +91 -7
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +36 -3
- package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/controllers/health-controller.backend.service.js +32 -10
- package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts +24 -0
- package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
- package/dist/esm/runtime/domain-module.backend.definitions.js +24 -0
- package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js +13 -7
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +51 -0
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
- package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.d.ts +26 -0
- package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/http-server.backend.service.js +181 -1
- package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts +47 -1
- package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/start-application.backend.service.js +343 -77
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts +15 -0
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js +28 -0
- package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +5 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +24 -4
- package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +29 -4
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts +114 -0
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js +354 -3
- package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts +1 -0
- package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js +22 -0
- package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts +3 -23
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js +20 -45
- package/dist/esm/security/authentications/models/jwt.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +0 -2
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +23 -14
- package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +0 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +15 -12
- package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +113 -3
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +207 -30
- package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +95 -2
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +153 -9
- package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +190 -0
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +377 -53
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts +9 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +77 -2
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js +5 -3
- package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +41 -0
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +202 -23
- package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +42 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +34 -4
- package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +29 -5
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +77 -5
- package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +41 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +87 -4
- package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +43 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +277 -97
- package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts +28 -5
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js +72 -12
- package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +3 -0
- package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts +28 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +283 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +4 -3
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +4 -3
- package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts +35 -0
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js +111 -21
- package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts +14 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js +49 -8
- package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js +4 -0
- package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +6 -0
- package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts +37 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js +51 -0
- package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts +41 -0
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js +45 -0
- package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts +116 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js +162 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -0
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js +24 -1
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts +20 -20
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js +27 -28
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +77 -3
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts +117 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js +104 -0
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts +4 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js +4 -0
- package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +93 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js +95 -0
- package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -0
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +124 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +142 -5
- package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +175 -14
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +385 -49
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts +6 -14
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js +13 -22
- package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts +60 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js +79 -0
- package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +161 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +512 -0
- package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +59 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js +22 -0
- package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts +44 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js +20 -0
- package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +191 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +385 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts +41 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js +358 -0
- package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts +160 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +266 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +111 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +107 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts +54 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +153 -0
- package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +195 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +387 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts +45 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js +291 -0
- package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +62 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js +29 -0
- package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts +127 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js +277 -0
- package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts +66 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js +75 -0
- package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts +18 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js +110 -74
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.js.map +1 -1
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js +22 -0
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.js.map +1 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts +17 -3
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js +12 -0
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.js.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +41 -3
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +83 -20
- package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts +9 -4
- package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/credential-rotation-grace.backend.utils.js +9 -4
- package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.js +1 -18
- package/dist/esm/security/jwt/services/jwt.backend.service.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts +26 -0
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js +43 -0
- package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts +8 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js +49 -0
- package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
- package/dist/esm/security/scim/controllers/scim.backend.controller.js +17 -5
- package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +67 -29
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +47 -25
- package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts +10 -2
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js +10 -2
- package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts +143 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js +258 -0
- package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts +39 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js +159 -0
- package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +17 -9
- package/dist/esm/.builder.pid +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anonymous-session.backend.service.js","sourceRoot":"","sources":["../../../../../../src/security/authentications/services/anonymous-session.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;;;;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,E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AAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAChE,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IASlD,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;yDAb8B,uBAAuB;GAP3F,8BAA8B,CA4vB1C","sourcesContent":["/**\n * AnonymousSessionBackendService (W7.3a)\n *\n * Manages anonymous session lifecycle: user creation (upsert),\n * JWT signing/verification, and ownership transposition on registration.\n */\n\nimport crypto from 'crypto';\nimport { inject, injectable } from 'inversify';\nimport jwt from 'jsonwebtoken';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport {\n ANONYMOUS_SESSION_JWT_EXPIRY_STRING,\n ANONYMOUS_SESSION_JWT_FORMAT,\n AnonymousSessionJwtPayloadSchema,\n AnonymousUserMarketingMetadataSchema,\n AnonymousUserTranspositionStatus,\n CoreResourceOperation,\n CoreResourceType,\n CORE_APP_ROLES,\n ErrorCustomMessageReference,\n ErrorType,\n ResourcePrimaryScope,\n ResourceTranspositionPolicy,\n WildoHeaderKeys,\n type AnonymousUserMarketingMetadata,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport type { RateLimitBackendService } from '~wildo-backend-lib/errors/services/rate-limit.backend.service';\nimport { getClientIpFromRequest } from '~wildo-backend-lib/runtime/utils/request-client-ip.utils';\nimport { AuthControllerUtils } from '~wildo-backend-lib/security/authentications/services/utils/auth-controller.utils';\nimport type { Request, Response } from 'express';\n\nexport interface TranspositionResult {\n transposedTypes: ResourceType[];\n failedTypes: { resourceType: ResourceType; error: string }[];\n status: AnonymousUserTranspositionStatus;\n}\n\n@injectable()\nexport class AnonymousSessionBackendService {\n\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly configService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService) private readonly servicesRegistryHandler: ServicesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n @inject(SAAS_SERVICE_TYPES.RateLimitBackendService) private readonly rateLimitService: RateLimitBackendService,\n // Appended LAST (positional-DI stability). The in-process session-init +\n // ownership-transposition writes carry `.isBackendOnly()` material\n // (`marketingMetadata`) and context-auto-populated FK names\n // (`userId` / `anonymousUserId`) that a plain `servicesRegistryHandler` write\n // strict-parses OUT — silent attribution loss on create, silent no-op `$set`\n // on the transposition. The trusted `createAsSystem` / `updateAsSystem` /\n // `updateManyAsSystem` primitives re-attach exactly those fields after the\n // strict parse, fail-closed behind each resource's `systemAccessPolicy`.\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccessService: SystemAccessBackendService,\n ) {\n this.logDebug = this.logger.debugByType('AnonymousSessionBackendService');\n }\n\n /**\n * Upsert an AnonymousUser record. Catches duplicate key errors to handle\n * concurrent session init from multiple tabs sending the same UUID.\n *\n * Rate-limit policy (PR 4 of the rate-limit unification, Step 5 — first\n * imperative-to-declarative migration wave):\n * - 10 requests/minute/IP and 100 requests/hour/IP, AND-ed.\n * - Enforced via `RateLimitBackendService.checkPolicy` (System 3) instead\n * of the previous twin `checkRateLimit` calls (System 2). The policy\n * semantics are identical; only the surface and Redis key shape change\n * (`auth:anon-session:init:<ip>:minute|hour` instead of two custom\n * prefixes). Standard `X-RateLimit-*` and `Retry-After` headers are\n * now written on the 429 path — previously absent at this seam.\n * - Identifier is the client IP (no organization context at session\n * init by definition; C-2).\n *\n * Concurrent-tabs accounting note (F-11): the rate-limit check runs\n * BEFORE the duplicate-key fast path below, so N tabs racing the same\n * UUID will each consume a slot from the per-minute / per-hour budget\n * even though only one performs the actual MongoDB insert. This is\n * intentional — moving the check past the duplicate-key catch would\n * make the limiter trivially defeatable by spamming the same UUID. The\n * 10/min budget absorbs realistic browser tab counts comfortably.\n */\n async createAnonymousUser(anonymousUserId: string, req: Request, res: Response): Promise<void> {\n // Canonical IP extraction (F-5 of the rate-limit unification audit).\n // Still needed locally for `hashIp` (privacy-preserving audit trail);\n // `checkPolicy` re-derives the same IP internally via the same helper,\n // so the rate-limit bucket and the stored hash always agree.\n const clientIp = getClientIpFromRequest(req);\n\n await this.rateLimitService.checkPolicy(\n req,\n res,\n { requestsPerMinute: 10, requestsPerHour: 100 },\n 'auth:anon-session:init',\n );\n\n const ipHash = this.hashIp(clientIp);\n\n try {\n // Phase 0.5 (Q-D=β): first-touch marketing attribution. Captured\n // ONCE here at session-init and never overwritten by subsequent\n // requests — this is the anchor write site. Subsequent requests\n // hit the same anonymous user via JWT and carry no attribution.\n const marketingMetadata = this.extractFirstTouchMarketingMetadata(req);\n\n // The client-generated session UUID is persisted as `uuidRef` (the anonymous\n // user's relational identity), NOT `_id`: `_id` is a normal server-minted\n // ObjectId. So this is an ordinary create — `_id` is server-generated and never\n // in the payload, which is exactly why it no longer crashes the strict-DTO parse\n // (a client `_id` used to be a required-but-discarded field).\n //\n // `createAsSystem` (not a plain `servicesRegistryHandler.create`) is required\n // because `marketingMetadata` is `.isBackendOnly()` and would otherwise be\n // strict-parsed OUT against the client-shaped request DTO (first-touch\n // attribution silently lost); the primitive re-attaches the schema-derived\n // backend-only allowlist after the parse and synthesises its own super-admin\n // context — ANONYMOUS_USERS CREATE is INTERNAL_CALL (no HTTP surface) — fail-closed\n // behind `systemAccessPolicy.create`. `uuidRef` is an ordinary (non-backend-only)\n // field and rides the normal create payload.\n //\n // Concurrent tabs / cross-origin re-init send the SAME `uuidRef`; the unique\n // index on `uuidRef` makes the second insert an E11000 duplicate-key, caught\n // below and treated as success (the AnonymousUser already exists).\n await this.systemAccessService.createAsSystem(CoreResourceType.ANONYMOUS_USERS, {\n uuidRef: anonymousUserId,\n privacy: { consentTimestamp: new Date(), ipRetentionDays: 30 },\n userAgent: req.headers[WildoHeaderKeys.USER_AGENT]?.substring(0, 256),\n ipHash,\n ...(marketingMetadata ? { marketingMetadata } : {}),\n });\n this.logDebug('AnonymousUser created', {\n anonymousUserId,\n hasMarketingMetadata: marketingMetadata !== undefined,\n });\n } catch (error: any) {\n if (error?.code === 11000 || error?.message?.includes('duplicate key') || error?.message?.includes('E11000')) {\n this.logDebug('AnonymousUser already exists (concurrent init), treating as success', { anonymousUserId });\n return;\n }\n this.logger.error('Failed to create AnonymousUser', { anonymousUserId, error });\n throw error;\n }\n }\n\n /**\n * Sign a session JWT using the platform session HMAC secret.\n *\n * Algorithm + expiry are pinned by the shared contract in\n * `@wildo-ai/saas-models` so any future client (e.g. the\n * marketing-site `WebsiteAnonymousSessionContext`) that wants to\n * peek at the JWT for diagnostic UI agrees on the bit-level shape.\n */\n signSessionToken(anonymousUserId: string): string {\n const secret = this.configService.secrets.security.session.secret;\n return jwt.sign(\n { anonymousUserId },\n secret,\n { algorithm: ANONYMOUS_SESSION_JWT_FORMAT.algorithm, expiresIn: ANONYMOUS_SESSION_JWT_EXPIRY_STRING }\n );\n }\n\n /**\n * Verify a session JWT. Returns the anonymousUserId or throws.\n *\n * The decoded payload is validated against the shared\n * `AnonymousSessionJwtPayloadSchema` (Zod) — a defensive check that\n * guards against any future drift between signer and verifier and\n * gives a structured error if a malformed payload ever reaches us.\n */\n verifySessionToken(token: string): { anonymousUserId: string } {\n const secret = this.configService.secrets.security.session.secret;\n try {\n const decoded = jwt.verify(token, secret, {\n algorithms: [ANONYMOUS_SESSION_JWT_FORMAT.algorithm],\n clockTolerance: 30,\n });\n\n const payload = AnonymousSessionJwtPayloadSchema.parse(decoded);\n\n return { anonymousUserId: payload.anonymousUserId };\n } catch (error) {\n if (error instanceof jwt.TokenExpiredError) {\n throw this.errorBuilder.buildError(\n ErrorType.AUTHENTICATION,\n undefined,\n { customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_EXPIRED }\n );\n }\n throw this.errorBuilder.buildError(\n ErrorType.AUTHENTICATION,\n undefined,\n { customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID }\n );\n }\n }\n\n /**\n * Assert the anonymous subject behind an already-cryptographically-verified session token is STILL a\n * live, un-converted anonymous identity — the server-side revocation handle the stateless anon JWT\n * otherwise lacks entirely.\n *\n * {@link verifySessionToken} proves only that WE signed the token and it has not expired; it says\n * NOTHING about the subject. This re-reads the `ANONYMOUS_USERS` row by its unique `uuidRef` and\n * rejects — as `AUTHENTICATION_SESSION_INVALID`, deliberately indistinguishable from a bad token so a\n * caller cannot probe whether a given `uuidRef` was converted vs. never existed — when either:\n * - the row is ABSENT: the identity was hard-deleted, swept by the cleanup batch, or erased, so a\n * retained token must die with the identity it names; or\n * - `convertedToUserId` is set: the subject upgraded to an authenticated user. A retained anon token\n * must NOT keep acting under the old pseudonymous `uuidRef` — otherwise it could mint fresh anon\n * rows that re-establish the very identity linkage conversion is meant to sever. Post-conversion\n * the client holds a real JWT and no longer needs this one (`handleAnonymousTransposition` clears\n * the anon cookie on COMPLETE/PARTIAL), so a request still bearing it is a stale/hostile replay.\n *\n * This is the anon-plane analogue of the USERS auth front's row re-read + version/status checks\n * (`execution-context-creator._fetchUserAndBuildRoles`). The anon token carries NO `userId` — so the\n * `TOKEN_INVALID_BEFORE:<userId>` fence structurally cannot reach it — and has NO refresh, so a\n * per-request row liveness check is the ONE place a revocation can land. Deliberately NOT\n * `readAsSystem`/`listAsSystem`: those emit a `SYSTEM_CONTEXT_READ` audit per call, which on this\n * per-request path would drown that signal — this is a routine liveness check, not a privileged data\n * access. It is one indexed lookup on the `uuidRef` unique index; the anon path is lower-QPS than the\n * authenticated USERS path, which already performs a per-request row read.\n */\n async assertAnonymousSubjectStillLive(anonymousUserId: string): Promise<void> {\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n const ec = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n // Target by `{ uuidRef }` (the client session handle), NOT a bare id — the row's `_id` is a server\n // ObjectId, so an id arg would resolve to `{ _id: <uuidRef> }` and match nothing (cf. transposeOwnership).\n const listResult = await this.servicesRegistryHandler.list<{ convertedToUserId?: string | null }>(\n CoreResourceType.ANONYMOUS_USERS, ec, { uuidRef: anonymousUserId }, { page: 1, limit: 1 }\n );\n const rows = Array.isArray(listResult) ? listResult : listResult.data;\n const row = rows?.[0];\n\n if (!row) {\n this.logDebug('Anonymous session rejected — subject row absent (hard-deleted / swept / erased)', { anonymousUserId });\n throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID,\n });\n }\n if (row.convertedToUserId) {\n this.logDebug('Anonymous session rejected — subject already converted to an authenticated user', { anonymousUserId });\n throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID,\n });\n }\n }\n\n /**\n * Set the parent-domain anonymous-session continuity cookie\n * (`__wildo_anon_session`) on the response, alongside the\n * `x-anonymous-session-token` header, when a session is minted.\n *\n * The cookie is what carries the anonymous session across the\n * marketing-site apex → app → API origins so a website-captured lead\n * / draft transposes on app signup with NO frontend handoff — the\n * app's login reads it as a fallback to the `x-anonymous-session`\n * header. Cookie attributes (`SameSite=Lax`, parent `Domain`,\n * `Path=/api/v1`, 24h `Max-Age`) live on\n * `AuthControllerUtils.setAnonymousSessionCookie` /\n * `ANONYMOUS_SESSION_COOKIE_NAME`.\n *\n * `Domain` comes from `auth.anonymousSessionCookieDomain` (unset ⇒\n * host-only, correct for localhost dev where the port-agnostic host\n * cookie already spans the dev ports); `Max-Age` matches the anon\n * JWT's `expirySeconds`.\n */\n setSessionCookie(res: Response, token: string): void {\n AuthControllerUtils.setAnonymousSessionCookie(\n res,\n token,\n this.configService.config.auth.anonymousSessionCookieDomain,\n this.configService.applicationEnv,\n ANONYMOUS_SESSION_JWT_FORMAT.expirySeconds,\n );\n }\n\n /**\n * Clear the anonymous-session continuity cookie. Called after a\n * successful transposition (the anonymous rows now belong to the\n * authenticated user, so the session has served its purpose) and on\n * session clear. Delegates to `AuthControllerUtils` with the SAME\n * config-resolved `Domain` the cookie was set with, so the browser\n * actually honours the deletion.\n */\n clearSessionCookie(res: Response): void {\n AuthControllerUtils.clearAnonymousSessionCookie(\n res,\n this.configService.config.auth.anonymousSessionCookieDomain,\n this.configService.applicationEnv,\n );\n }\n\n /**\n * Transpose ownership of all isAnonymizable resources from an anonymous user\n * to an authenticated user. Called during registration/login when the user\n * had prior anonymous activity.\n *\n * Checks that the target userType has anonymousSessionsEnabled before proceeding.\n * If the userType does not support anonymous sessions, returns an empty result.\n */\n async transposeOwnership(\n anonymousUserId: string,\n authenticatedUserId: string,\n userType: string\n ): Promise<TranspositionResult> {\n const userTypePolicy = this.configService.getUserTypeAuthPolicy(userType);\n if (!userTypePolicy?.anonymousSessionsEnabled) {\n this.logDebug('Skipping transposition — anonymousSessionsEnabled is false for user type', { userType, anonymousUserId });\n return { transposedTypes: [], failedTypes: [], status: AnonymousUserTranspositionStatus.PENDING };\n }\n\n const transposedTypes: ResourceType[] = [];\n const failedTypes: { resourceType: ResourceType; error: string }[] = [];\n\n const anonymizableTypes = this.getAnonymizableResourceTypes();\n\n for (const resourceType of anonymizableTypes) {\n const resourceConfig = this.resourcesRegistry.getResourceConfiguration(resourceType);\n const policy = resourceConfig?.transpositionPolicy ?? ResourceTranspositionPolicy.ADD;\n\n if (policy === ResourceTranspositionPolicy.DISCARD) {\n this.logDebug('Skipping transposition (DISCARD policy)', { resourceType });\n continue;\n }\n\n try {\n const records = await this.listAnonymousRecords(resourceType, anonymousUserId);\n\n if (!records || records.length === 0) continue;\n\n if (policy === ResourceTranspositionPolicy.REPLACE) {\n await this.deleteExistingUserRecords(resourceType, authenticatedUserId);\n }\n\n if (policy === ResourceTranspositionPolicy.MERGE) {\n this.logger.warn(\n 'MERGE transposition policy is not yet implemented — falling back to ADD',\n { resourceType, anonymousUserId, authenticatedUserId }\n );\n }\n\n const ids = records.map((r: any) => r._id);\n await this.reassignOwnership(resourceType, ids, authenticatedUserId);\n\n transposedTypes.push(resourceType);\n this.logDebug('Transposed ownership', {\n resourceType, policy, count: ids.length, anonymousUserId, authenticatedUserId,\n });\n } catch (error) {\n const errorMsg = describeCaughtError(error);\n failedTypes.push({ resourceType, error: errorMsg });\n this.logger.error('Transposition failed for resource type', {\n resourceType, policy, anonymousUserId, authenticatedUserId, error: errorMsg,\n });\n }\n }\n\n // ── Manual transposition for INBOUND_CONTACTS (Phase 0.5, Q-E=B) ──\n //\n // INBOUND_CONTACTS is APPLICATION-scoped (not USER_SELF) and therefore\n // does NOT carry `isAnonymizable: true` — the generic transposition\n // loop above (which gates on isAnonymizable) does not see it.\n //\n // The lead-capture FK chain is `{ anonymousUserId } → { userId,\n // anonymousUserId: null }`: when the anonymous user converts, all\n // leads they submitted are reassigned to their authenticated user\n // identity, and the anonymous link is cleared so the upcoming\n // anonymous-session cleanup batch does not look at them.\n //\n // We invoke the dedicated helper after the generic loop so its\n // result rolls into the same transposedTypes/failedTypes report\n // and the AnonymousUser.transpositionStatus update below reflects\n // the full conversion outcome.\n try {\n const inboundContactsTransposedCount = await this.transposeInboundContactsOwnership(\n anonymousUserId,\n authenticatedUserId,\n );\n if (inboundContactsTransposedCount > 0) {\n transposedTypes.push(CoreResourceType.INBOUND_CONTACTS);\n this.logDebug('Transposed inbound contacts', {\n anonymousUserId, authenticatedUserId, count: inboundContactsTransposedCount,\n });\n }\n } catch (error) {\n const errorMsg = describeCaughtError(error);\n failedTypes.push({ resourceType: CoreResourceType.INBOUND_CONTACTS, error: errorMsg });\n this.logger.error('InboundContacts transposition failed', {\n anonymousUserId, authenticatedUserId, error: errorMsg,\n });\n }\n\n const status = failedTypes.length === 0\n ? AnonymousUserTranspositionStatus.COMPLETE\n : transposedTypes.length > 0\n ? AnonymousUserTranspositionStatus.PARTIAL\n : AnonymousUserTranspositionStatus.PENDING;\n\n try {\n // Deliberately NOT routed through `updateAsSystem` (unlike the ownership\n // transposition writes). `convertedToUserId` and `transpositionStatus` are\n // ordinary fields — neither `.isBackendOnly()` nor context-auto-populated FK\n // names — so they survive the strict-DTO parse; there is nothing for the\n // primitive to re-attach. Migrating would only add a fail-closed opt-in and\n // an audit row for no correctness gain, so the plain internal-EC handler\n // stays. (ANONYMOUS_USERS opts into `systemAccessPolicy.create` only.)\n const updateOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.UPDATE);\n const anonymousUserEc = await this.executionContextCreator.createForInternalOperation({\n operation: updateOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n // Target the row by `{ uuidRef }`, NOT the session id directly: the session id\n // (from the JWT) is the client `uuidRef`, while the row's `_id` is a server\n // ObjectId — a bare id arg would resolve to `{ _id: <uuidRef> }` and match nothing.\n await this.servicesRegistryHandler.update(\n CoreResourceType.ANONYMOUS_USERS, anonymousUserEc, { uuidRef: anonymousUserId },\n { convertedToUserId: authenticatedUserId, transpositionStatus: status }\n );\n } catch (error) {\n this.logger.error('Failed to update AnonymousUser transposition status', { anonymousUserId, error });\n }\n\n return { transposedTypes, failedTypes, status };\n }\n\n /**\n * Transpose ownership of `INBOUND_CONTACTS` rows owned by the given\n * anonymous user to the now-authenticated user (Phase 0.5, Q-E=B).\n *\n * Why this lives outside the generic isAnonymizable loop:\n * `INBOUND_CONTACTS` is APPLICATION-scoped (org-owned admin\n * resource), not USER_SELF-scoped, and therefore cannot carry\n * `isAnonymizable: true` (the factory enforces USER_SELF for that\n * flag). The conversion semantics are the same — flip\n * `{ anonymousUserId } → { userId, anonymousUserId: null }` — but\n * they are wired manually here.\n *\n * Implementation notes:\n * - Lists by FK `anonymousUserId` (matches the registry edge\n * `ANONYMOUS_USERS → INBOUND_CONTACTS` declared in\n * `resources-registry.shared.core.definitions.ts`).\n * - Uses INTERNAL_CALL UPDATE (declared in\n * `inbound-contacts.shared.resources-config.schemas.ts`) — no\n * public admin-edit surface in Phase 0.5.\n * - Per-row UPDATE (not UPDATE_MANY) because conversion volume is\n * low (one anonymous session typically submits 0–1 leads) and\n * this avoids surfacing UPDATE_MANY just for transposition.\n *\n * @returns the number of leads transposed (0 if none).\n */\n private async transposeInboundContactsOwnership(\n anonymousUserId: string,\n authenticatedUserId: string,\n ): Promise<number> {\n const records = await this.listAnonymousRecords(\n CoreResourceType.INBOUND_CONTACTS,\n anonymousUserId,\n );\n\n if (!records || records.length === 0) return 0;\n\n let transposedCount = 0;\n for (const record of records) {\n // `{ userId, anonymousUserId }` are context-auto-populated FK names the\n // client-shaped request DTO strips, so a plain `servicesRegistryHandler\n // .update` was a silent no-op `$set` (the lead's ownership never moved).\n // `updateAsSystem` re-attaches both FKs after the strict parse and\n // synthesises its own super-admin context, fail-closed behind\n // INBOUND_CONTACTS' `systemAccessPolicy.update`. Per-row (not UPDATE_MANY)\n // by design — see the method doc above.\n await this.systemAccessService.updateAsSystem(\n CoreResourceType.INBOUND_CONTACTS,\n record._id as string,\n { userId: authenticatedUserId, anonymousUserId: null },\n );\n transposedCount++;\n }\n return transposedCount;\n }\n\n /**\n * List the not-yet-converted rows an anonymous user owns, across BOTH the\n * generic `isAnonymizable` resources (USER_SELF-scoped, e.g. `draftNotes`) and\n * the manually-wired APPLICATION-scoped ones (`inboundContacts`).\n *\n * Scope by `anonymousUserId` as a DIRECT field filter — NOT via the EC\n * `contextResourcesFieldIdentifier` map. Putting the FK on the context map is\n * FATAL at EC-CREATION time for an APPLICATION-scoped resource: because\n * `INBOUND_CONTACTS`' LIST is APPLICATION-scoped, `createExecutionContext` runs\n * `populateApplicationIdIfNeeded`, which reads the singleton `applications`\n * record with THIS same EC. `applications` does not model `anonymousUserId`, so\n * its `buildContextualFilter` iterates the context map, hits the unknown field\n * and fails closed — `configuration` / `reason: 'context_filter'` /\n * resource `'applications'`. The throw happens INSIDE the creator (before\n * `list()` runs), so `excludeContextualFilter` on the `list()` call alone cannot\n * suppress it; the FK must stay off the context map.\n *\n * With the FK supplied explicitly, the caller owns the authoritative scope, so\n * the ambient contextual filter is skipped (`excludeContextualFilter: true`) —\n * the canonical explicit-scope repository-options pattern (cf. the\n * milestone/lifecycle evaluators and `NotificationBadgeBackendService`).\n * USER_SELF-scoped anonymizable resources never triggered the crash but are\n * filtered identically (`userId: null` keeps it to still-anonymous rows).\n */\n private async listAnonymousRecords(resourceType: ResourceType, anonymousUserId: string): Promise<any[]> {\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.LIST);\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n return await this.servicesRegistryHandler.list<any>(\n resourceType,\n listEc,\n { anonymousUserId, userId: null },\n undefined,\n { paginated: false, excludeContextualFilter: true },\n ) as any[];\n }\n\n private async reassignOwnership(resourceType: ResourceType, ids: string[], authenticatedUserId: string): Promise<void> {\n // THE transposition write. The patch `{ userId, anonymousUserId }` is two\n // context-auto-populated FK names the client-shaped request DTO strips, so a\n // plain `servicesRegistryHandler.updateMany` was a silent no-op `$set` — the\n // anon→user ownership move never landed, and the rows were later deleted by the\n // expired-session cleanup batch (user-visible data loss on conversion).\n // `updateManyAsSystem` re-attaches both FKs after the strict parse and\n // synthesises its own super-admin context, fail-closed behind\n // `systemAccessPolicy.updateMany` — auto-granted by the factory to every\n // `isAnonymizable` resource (the only resources this dynamic loop iterates),\n // so no per-resource opt-in is required here.\n await this.systemAccessService.updateManyAsSystem(resourceType, ids, { userId: authenticatedUserId, anonymousUserId: null });\n }\n\n private async deleteExistingUserRecords(resourceType: ResourceType, userId: string): Promise<void> {\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.LIST);\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map([['userId', userId]]),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n const existing = await this.servicesRegistryHandler.list<any>(resourceType, listEc, undefined, undefined, { paginated: false }) as any[];\n if (existing && existing.length > 0) {\n const deleteOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.DELETE_MANY);\n const deleteEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n const ids = existing.map((r: any) => r._id);\n await this.servicesRegistryHandler.deleteMany(resourceType, deleteEc, ids);\n this.logDebug('Deleted existing user records (REPLACE policy)', { resourceType, userId, count: ids.length });\n }\n }\n\n /**\n * Cleanup expired, unconverted anonymous sessions and their owned resources.\n * Called by the anonymous-session-cleanup batch job.\n */\n async cleanupExpiredSessions(options?: {\n sessionTtlMs?: number;\n batchSize?: number;\n maxIterations?: number;\n convertedRetentionMs?: number;\n }): Promise<{ expiredUsersFound: number; resourcesDeleted: number; usersArchived: number; convertedUsersCleaned: number; errors: number }> {\n const FORTY_EIGHT_HOURS_MS = 48 * 60 * 60 * 1000;\n const NINETY_DAYS_MS = 90 * 24 * 60 * 60 * 1000;\n const sessionTtlMs = options?.sessionTtlMs ?? FORTY_EIGHT_HOURS_MS;\n const batchSize = options?.batchSize ?? 100;\n const maxIterations = options?.maxIterations ?? 100;\n const convertedRetentionMs = options?.convertedRetentionMs ?? NINETY_DAYS_MS;\n const cutoff = new Date(Date.now() - sessionTtlMs);\n\n if (!this.configService.anonymousSessionsEnabled) {\n this.logDebug('Anonymous sessions not enabled — skipping cleanup');\n return { expiredUsersFound: 0, resourcesDeleted: 0, usersArchived: 0, convertedUsersCleaned: 0, errors: 0 };\n }\n\n const anonymizableTypes = this.getAnonymizableResourceTypes();\n let totalExpiredUsersFound = 0;\n let resourcesDeleted = 0;\n let usersArchived = 0;\n let errors = 0;\n let iteration = 0;\n\n // Phase 1: Clean up expired unconverted sessions (pagination loop)\n let hasMore = true;\n while (hasMore && iteration < maxIterations) {\n iteration++;\n\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n const listResult = await this.servicesRegistryHandler.list<any>(\n CoreResourceType.ANONYMOUS_USERS,\n listEc,\n { convertedToUserId: null, createdAt: { $lt: cutoff } },\n { page: 1, limit: batchSize }\n );\n const expiredUsers: any[] = Array.isArray(listResult) ? listResult : listResult.data;\n totalExpiredUsersFound += expiredUsers.length;\n\n if (expiredUsers.length === 0) { hasMore = false; break; }\n\n for (const anonUser of expiredUsers) {\n // `_id` (server ObjectId) deletes the AnonymousUser row itself; `uuidRef`\n // (the client session handle) is what children carry in their `anonymousUserId`\n // FK, so it is what lists/deletes the owned records. Filtering children by `_id`\n // would match nothing and silently orphan them.\n const anonymousUserId = anonUser._id as string;\n const anonymousUserRef = anonUser.uuidRef as string;\n\n try {\n for (const resourceType of anonymizableTypes) {\n const records = await this.listAnonymousRecords(resourceType, anonymousUserRef);\n if (records && records.length > 0) {\n const ids = records.map((r: any) => r._id);\n const deleteOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.DELETE_MANY);\n const deleteEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n await this.servicesRegistryHandler.deleteMany(resourceType, deleteEc, ids);\n resourcesDeleted += ids.length;\n }\n }\n\n const deleteAnonOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.DELETE);\n const deleteAnonEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteAnonOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n await this.servicesRegistryHandler.delete(CoreResourceType.ANONYMOUS_USERS, deleteAnonEc, anonymousUserId);\n usersArchived++;\n } catch (error) {\n errors++;\n this.logger.warn('Failed to clean up expired anonymous session', {\n anonymousUserId,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n hasMore = expiredUsers.length >= batchSize;\n }\n\n // Phase 2: Clean up converted AnonymousUser records past retention period (audit trail)\n let convertedUsersCleaned = 0;\n const convertedCutoff = new Date(Date.now() - convertedRetentionMs);\n try {\n const convertedListOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n const convertedListEc = await this.executionContextCreator.createForInternalOperation({\n operation: convertedListOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n const convertedResult = await this.servicesRegistryHandler.list<any>(\n CoreResourceType.ANONYMOUS_USERS,\n convertedListEc,\n { convertedToUserId: { $ne: null }, createdAt: { $lt: convertedCutoff } },\n { page: 1, limit: batchSize }\n );\n const convertedUsers: any[] = Array.isArray(convertedResult) ? convertedResult : convertedResult.data;\n\n for (const convertedUser of convertedUsers) {\n try {\n const deleteOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.DELETE);\n const deleteEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n await this.servicesRegistryHandler.delete(CoreResourceType.ANONYMOUS_USERS, deleteEc, convertedUser._id);\n convertedUsersCleaned++;\n } catch (error) {\n errors++;\n }\n }\n } catch (error) {\n this.logger.warn('Failed to clean up converted anonymous users', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n\n this.logDebug('Cleanup completed', {\n expiredUsersFound: totalExpiredUsersFound, resourcesDeleted, usersArchived,\n convertedUsersCleaned, errors, iterations: iteration,\n anonymizableTypes: anonymizableTypes.length,\n });\n\n return { expiredUsersFound: totalExpiredUsersFound, resourcesDeleted, usersArchived, convertedUsersCleaned, errors };\n }\n\n private getAnonymizableResourceTypes(): ResourceType[] {\n const allTypes = this.resourcesRegistry.getResourceTypes();\n const result: ResourceType[] = [];\n for (const resourceType of allTypes) {\n const config = this.resourcesRegistry.getResourceConfiguration(resourceType);\n if (config?.isAnonymizable === true) {\n result.push(resourceType);\n }\n }\n return result;\n }\n\n private hashIp(ip: string): string {\n return crypto.createHash('sha256').update(ip).digest('hex').substring(0, 16);\n }\n\n /**\n * Extract first-touch marketing attribution from the inbound request\n * (Phase 0.5, Q-D=β). Returns `undefined` if no signal is present so\n * the caller can omit the field entirely from the create payload.\n *\n * Sources:\n * - `utm_*` query string parameters → `utm.{source,medium,campaign,term,content}`\n * - `Referer` HTTP header → `referrer`\n * - `x-landing-path` HTTP header → `landingPath`\n * (framework header registered in `WildoHeaderKeys.LANDING_PATH`, sent by\n * the marketing-site bootstrap ON the session-init request; carried in the\n * engine CORS `allowedHeaders` floor alongside `x-anonymous-session-init`\n * — see `engineAllowedHeaders` in `http-server.backend.service.ts`).\n * - `Accept-Language` HTTP header → `acceptLanguage`\n *\n * The result is parsed against `AnonymousUserMarketingMetadataSchema`\n * to apply the field-level length caps (256 / 2048) and to strip\n * unknown keys defensively. If parsing fails (e.g. malformed\n * over-length values from a hostile client), we log and return\n * `undefined` rather than fail session-init — attribution is a\n * best-effort marketing signal, not a security-critical field.\n */\n private extractFirstTouchMarketingMetadata(req: Request): AnonymousUserMarketingMetadata | undefined {\n const headerString = (key: string): string | undefined => {\n const raw = req.headers[key];\n if (typeof raw === 'string' && raw.length > 0) return raw;\n if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === 'string') return raw[0];\n return undefined;\n };\n const queryString = (key: string): string | undefined => {\n const raw = (req.query as Record<string, unknown> | undefined)?.[key];\n if (typeof raw === 'string' && raw.length > 0) return raw;\n if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === 'string') return raw[0];\n return undefined;\n };\n\n const utmCandidate = {\n source : queryString('utm_source'),\n medium : queryString('utm_medium'),\n campaign : queryString('utm_campaign'),\n term : queryString('utm_term'),\n content : queryString('utm_content'),\n };\n const utmHasAnyValue = Object.values(utmCandidate).some((v) => v !== undefined);\n\n const candidate: Record<string, unknown> = {};\n if (utmHasAnyValue) candidate.utm = utmCandidate;\n const referrer = headerString('referer');\n const landingPath = headerString(WildoHeaderKeys.LANDING_PATH);\n const acceptLanguage = headerString('accept-language');\n if (referrer !== undefined) candidate.referrer = referrer;\n if (landingPath !== undefined) candidate.landingPath = landingPath;\n if (acceptLanguage !== undefined) candidate.acceptLanguage = acceptLanguage;\n\n if (Object.keys(candidate).length === 0) return undefined;\n\n const parsed = AnonymousUserMarketingMetadataSchema.safeParse(candidate);\n if (!parsed.success) {\n this.logger.warn('Discarding malformed first-touch marketing metadata', {\n issues: parsed.error.issues.map((i) => ({ path: i.path.join('.'), code: i.code })),\n });\n return undefined;\n }\n return parsed.data;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"anonymous-session.backend.service.js","sourceRoot":"","sources":["../../../../../../src/security/authentications/services/anonymous-session.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;;;;;;;;;;;;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAE/G,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAMhJ,OAAO,EACL,mCAAmC,EACnC,4BAA4B,EAC5B,gCAAgC,EAChC,oCAAoC,EACpC,gCAAgC,EAChC,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,2BAA2B,EAC3B,SAAS,EACT,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EACf,mCAAmC,GAGpC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,kFAAkF,CAAC;AAuChH,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAKa;IACa;IACH;IACc;IACP;IACc;IACd;IASJ;IAlBlD,QAAQ,CAA+D;IAExF,YACsD,MAAqB,EACR,YAAwC,EAC3C,aAAsC,EACxB,uBAA8D,EACrE,iBAAkD,EACpC,uBAA8D,EAC5E,gBAAyC,EAS7C,mBAA+C;QAf5D,WAAM,GAAN,MAAM,CAAe;QACR,iBAAY,GAAZ,YAAY,CAA4B;QAC3C,kBAAa,GAAb,aAAa,CAAyB;QACxB,4BAAuB,GAAvB,uBAAuB,CAAuC;QACrE,sBAAiB,GAAjB,iBAAiB,CAAiC;QACpC,4BAAuB,GAAvB,uBAAuB,CAAuC;QAC5E,qBAAgB,GAAhB,gBAAgB,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AM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;aACnF,CAAC,CAAC;YACH,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC;IACrB,CAAC;CACF,CAAA;AA/mCY,8BAA8B;IAD1C,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,8BAA8B,CAAC,CAAA;IACzD,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAChE,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IASlD,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;yDAb8B,uBAAuB;GAP3F,8BAA8B,CA+mC1C","sourcesContent":["/**\n * AnonymousSessionBackendService (W7.3a)\n *\n * Manages anonymous session lifecycle: user creation (upsert),\n * JWT signing/verification, and ownership transposition on registration.\n */\n\nimport crypto from 'crypto';\nimport { inject, injectable } from 'inversify';\nimport jwt from 'jsonwebtoken';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { ServicesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/services/services-registry-handler.backend.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport {\n ANONYMOUS_SESSION_JWT_EXPIRY_STRING,\n ANONYMOUS_SESSION_JWT_FORMAT,\n AnonymousSessionJwtPayloadSchema,\n AnonymousUserMarketingMetadataSchema,\n AnonymousUserTranspositionStatus,\n CoreResourceOperation,\n CoreResourceType,\n CORE_APP_ROLES,\n ErrorCustomMessageReference,\n ErrorType,\n ResourcePrimaryScope,\n ResourceTranspositionPolicy,\n WildoHeaderKeys,\n isServiceResolvableDefaultOperation,\n type AnonymousUserMarketingMetadata,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport type { RateLimitBackendService } from '~wildo-backend-lib/errors/services/rate-limit.backend.service';\nimport { getClientIpFromRequest } from '~wildo-backend-lib/runtime/utils/request-client-ip.utils';\nimport { AuthControllerUtils } from '~wildo-backend-lib/security/authentications/services/utils/auth-controller.utils';\nimport type { Request, Response } from 'express';\n\nexport interface TranspositionResult {\n transposedTypes: ResourceType[];\n /**\n * Resource types whose anonymous rows were DELETED because the resource declares\n * `ResourceTranspositionPolicy.DISCARD` — the conversion's other terminal outcome.\n *\n * A separate bucket rather than a second meaning for `transposedTypes`: \"the account now owns\n * these rows\" and \"these rows no longer exist\" are opposite facts about the visitor's data, and a\n * log line or a support answer built from the merged list would be wrong for half its members.\n * Both nonetheless count as PROGRESS for the status arithmetic — see {@link\n * AnonymousSessionBackendService.transposeOwnership}.\n */\n discardedTypes: ResourceType[];\n failedTypes: { resourceType: ResourceType; error: string }[];\n status: AnonymousUserTranspositionStatus;\n}\n\n/**\n * What one pass of {@link AnonymousSessionBackendService.reconcileIncompleteTranspositions} did.\n *\n * `sessionsRepaired` counts sessions this pass MOVED something for OR whose stamp it corrected;\n * `sessionsStillIncomplete` counts sessions that still have rows the account cannot see after the\n * pass — the population a human should look at, because a repeatedly-failing type is a defect, not\n * a transient.\n */\nexport interface TranspositionReconciliationResult {\n candidatesExamined: number;\n sessionsRepaired: number;\n sessionsStillIncomplete: number;\n resourceTypesTransposed: number;\n /** Resource types whose leftover anonymous rows this pass DELETED under a `DISCARD` policy. */\n resourceTypesDiscarded: number;\n errors: number;\n}\n\n@injectable()\nexport class AnonymousSessionBackendService {\n\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly configService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.ServicesRegistryHandlerService) private readonly servicesRegistryHandler: ServicesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n @inject(SAAS_SERVICE_TYPES.RateLimitBackendService) private readonly rateLimitService: RateLimitBackendService,\n // Appended LAST (positional-DI stability). The in-process session-init +\n // ownership-transposition writes carry `.isBackendOnly()` material\n // (`marketingMetadata`) and context-auto-populated FK names\n // (`userId` / `anonymousUserId`) that a plain `servicesRegistryHandler` write\n // strict-parses OUT — silent attribution loss on create, silent no-op `$set`\n // on the transposition. The trusted `createAsSystem` / `updateAsSystem` /\n // `updateManyAsSystem` primitives re-attach exactly those fields after the\n // strict parse, fail-closed behind each resource's `systemAccessPolicy`.\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccessService: SystemAccessBackendService,\n ) {\n this.logDebug = this.logger.debugByType('AnonymousSessionBackendService');\n }\n\n /**\n * Upsert an AnonymousUser record. Catches duplicate key errors to handle\n * concurrent session init from multiple tabs sending the same UUID.\n *\n * Rate-limit policy (PR 4 of the rate-limit unification, Step 5 — first\n * imperative-to-declarative migration wave):\n * - 10 requests/minute/IP and 100 requests/hour/IP, AND-ed.\n * - Enforced via `RateLimitBackendService.checkPolicy` (System 3) instead\n * of the previous twin `checkRateLimit` calls (System 2). The policy\n * semantics are identical; only the surface and Redis key shape change\n * (`auth:anon-session:init:<ip>:minute|hour` instead of two custom\n * prefixes). Standard `X-RateLimit-*` and `Retry-After` headers are\n * now written on the 429 path — previously absent at this seam.\n * - Identifier is the client IP (no organization context at session\n * init by definition; C-2).\n *\n * Concurrent-tabs accounting note (F-11): the rate-limit check runs\n * BEFORE the duplicate-key fast path below, so N tabs racing the same\n * UUID will each consume a slot from the per-minute / per-hour budget\n * even though only one performs the actual MongoDB insert. This is\n * intentional — moving the check past the duplicate-key catch would\n * make the limiter trivially defeatable by spamming the same UUID. The\n * 10/min budget absorbs realistic browser tab counts comfortably.\n */\n async createAnonymousUser(anonymousUserId: string, req: Request, res: Response): Promise<void> {\n // Canonical IP extraction (F-5 of the rate-limit unification audit).\n // Still needed locally for `hashIp` (privacy-preserving audit trail);\n // `checkPolicy` re-derives the same IP internally via the same helper,\n // so the rate-limit bucket and the stored hash always agree.\n const clientIp = getClientIpFromRequest(req);\n\n await this.rateLimitService.checkPolicy(\n req,\n res,\n { requestsPerMinute: 10, requestsPerHour: 100 },\n 'auth:anon-session:init',\n );\n\n const ipHash = this.hashIp(clientIp);\n\n try {\n // Phase 0.5 (Q-D=β): first-touch marketing attribution. Captured\n // ONCE here at session-init and never overwritten by subsequent\n // requests — this is the anchor write site. Subsequent requests\n // hit the same anonymous user via JWT and carry no attribution.\n const marketingMetadata = this.extractFirstTouchMarketingMetadata(req);\n\n // The client-generated session UUID is persisted as `uuidRef` (the anonymous\n // user's relational identity), NOT `_id`: `_id` is a normal server-minted\n // ObjectId. So this is an ordinary create — `_id` is server-generated and never\n // in the payload, which is exactly why it no longer crashes the strict-DTO parse\n // (a client `_id` used to be a required-but-discarded field).\n //\n // `createAsSystem` (not a plain `servicesRegistryHandler.create`) is required\n // because `marketingMetadata` is `.isBackendOnly()` and would otherwise be\n // strict-parsed OUT against the client-shaped request DTO (first-touch\n // attribution silently lost); the primitive re-attaches the schema-derived\n // backend-only allowlist after the parse and synthesises its own super-admin\n // context — ANONYMOUS_USERS CREATE is INTERNAL_CALL (no HTTP surface) — fail-closed\n // behind `systemAccessPolicy.create`. `uuidRef` is an ordinary (non-backend-only)\n // field and rides the normal create payload.\n //\n // Concurrent tabs / cross-origin re-init send the SAME `uuidRef`; the unique\n // index on `uuidRef` makes the second insert an E11000 duplicate-key, caught\n // below and treated as success (the AnonymousUser already exists).\n await this.systemAccessService.createAsSystem(CoreResourceType.ANONYMOUS_USERS, {\n uuidRef: anonymousUserId,\n privacy: { consentTimestamp: new Date(), ipRetentionDays: 30 },\n userAgent: req.headers[WildoHeaderKeys.USER_AGENT]?.substring(0, 256),\n ipHash,\n ...(marketingMetadata ? { marketingMetadata } : {}),\n });\n this.logDebug('AnonymousUser created', {\n anonymousUserId,\n hasMarketingMetadata: marketingMetadata !== undefined,\n });\n } catch (error: any) {\n if (error?.code === 11000 || error?.message?.includes('duplicate key') || error?.message?.includes('E11000')) {\n this.logDebug('AnonymousUser already exists (concurrent init), treating as success', { anonymousUserId });\n return;\n }\n this.logger.error('Failed to create AnonymousUser', { anonymousUserId, error });\n throw error;\n }\n }\n\n /**\n * Sign a session JWT using the platform session HMAC secret.\n *\n * Algorithm + expiry are pinned by the shared contract in\n * `@wildo-ai/saas-models` so any future client (e.g. the\n * marketing-site `WebsiteAnonymousSessionContext`) that wants to\n * peek at the JWT for diagnostic UI agrees on the bit-level shape.\n */\n signSessionToken(anonymousUserId: string): string {\n const secret = this.configService.secrets.security.session.secret;\n return jwt.sign(\n { anonymousUserId },\n secret,\n { algorithm: ANONYMOUS_SESSION_JWT_FORMAT.algorithm, expiresIn: ANONYMOUS_SESSION_JWT_EXPIRY_STRING }\n );\n }\n\n /**\n * Verify a session JWT. Returns the anonymousUserId or throws.\n *\n * The decoded payload is validated against the shared\n * `AnonymousSessionJwtPayloadSchema` (Zod) — a defensive check that\n * guards against any future drift between signer and verifier and\n * gives a structured error if a malformed payload ever reaches us.\n */\n verifySessionToken(token: string): { anonymousUserId: string } {\n const secret = this.configService.secrets.security.session.secret;\n try {\n const decoded = jwt.verify(token, secret, {\n algorithms: [ANONYMOUS_SESSION_JWT_FORMAT.algorithm],\n clockTolerance: 30,\n });\n\n const payload = AnonymousSessionJwtPayloadSchema.parse(decoded);\n\n return { anonymousUserId: payload.anonymousUserId };\n } catch (error) {\n if (error instanceof jwt.TokenExpiredError) {\n throw this.errorBuilder.buildError(\n ErrorType.AUTHENTICATION,\n undefined,\n { customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_EXPIRED }\n );\n }\n throw this.errorBuilder.buildError(\n ErrorType.AUTHENTICATION,\n undefined,\n { customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID }\n );\n }\n }\n\n /**\n * Assert the anonymous subject behind an already-cryptographically-verified session token is STILL a\n * live, un-converted anonymous identity — the server-side revocation handle the stateless anon JWT\n * otherwise lacks entirely.\n *\n * {@link verifySessionToken} proves only that WE signed the token and it has not expired; it says\n * NOTHING about the subject. This re-reads the `ANONYMOUS_USERS` row by its unique `uuidRef` and\n * rejects — as `AUTHENTICATION_SESSION_INVALID`, deliberately indistinguishable from a bad token so a\n * caller cannot probe whether a given `uuidRef` was converted vs. never existed — when either:\n * - the row is ABSENT: the identity was hard-deleted, swept by the cleanup batch, or erased, so a\n * retained token must die with the identity it names; or\n * - `convertedToUserId` is set: the subject upgraded to an authenticated user. A retained anon token\n * must NOT keep acting under the old pseudonymous `uuidRef` — otherwise it could mint fresh anon\n * rows that re-establish the very identity linkage conversion is meant to sever. Post-conversion\n * the client holds a real JWT and no longer needs this one (`handleAnonymousTransposition` clears\n * the anon cookie on COMPLETE/PARTIAL), so a request still bearing it is a stale/hostile replay.\n *\n * This is the anon-plane analogue of the USERS auth front's row re-read + version/status checks\n * (`execution-context-creator._fetchUserAndBuildRoles`). The anon token carries NO `userId` — so the\n * `TOKEN_INVALID_BEFORE:<userId>` fence structurally cannot reach it — and has NO refresh, so a\n * per-request row liveness check is the ONE place a revocation can land. Deliberately NOT\n * `readAsSystem`/`listAsSystem`: those emit a `SYSTEM_CONTEXT_READ` audit per call, which on this\n * per-request path would drown that signal — this is a routine liveness check, not a privileged data\n * access. It is one indexed lookup on the `uuidRef` unique index; the anon path is lower-QPS than the\n * authenticated USERS path, which already performs a per-request row read.\n */\n async assertAnonymousSubjectStillLive(anonymousUserId: string): Promise<void> {\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n const ec = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n // Target by `{ uuidRef }` (the client session handle), NOT a bare id — the row's `_id` is a server\n // ObjectId, so an id arg would resolve to `{ _id: <uuidRef> }` and match nothing (cf. transposeOwnership).\n const listResult = await this.servicesRegistryHandler.list<{ convertedToUserId?: string | null }>(\n CoreResourceType.ANONYMOUS_USERS, ec, { uuidRef: anonymousUserId }, { page: 1, limit: 1 }\n );\n const rows = Array.isArray(listResult) ? listResult : listResult.data;\n const row = rows?.[0];\n\n if (!row) {\n this.logDebug('Anonymous session rejected — subject row absent (hard-deleted / swept / erased)', { anonymousUserId });\n throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID,\n });\n }\n if (row.convertedToUserId) {\n this.logDebug('Anonymous session rejected — subject already converted to an authenticated user', { anonymousUserId });\n throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.AUTHENTICATION_SESSION_INVALID,\n });\n }\n }\n\n /**\n * Set the parent-domain anonymous-session continuity cookie\n * (`__wildo_anon_session`) on the response, alongside the\n * `x-anonymous-session-token` header, when a session is minted.\n *\n * The cookie is what carries the anonymous session across the\n * marketing-site apex → app → API origins so a website-captured lead\n * / draft transposes on app signup with NO frontend handoff — the\n * app's login reads it as a fallback to the `x-anonymous-session`\n * header. Cookie attributes (`SameSite=Lax`, parent `Domain`,\n * `Path=/api/v1`, 24h `Max-Age`) live on\n * `AuthControllerUtils.setAnonymousSessionCookie` /\n * `ANONYMOUS_SESSION_COOKIE_NAME`.\n *\n * `Domain` comes from `auth.anonymousSessionCookieDomain` (unset ⇒\n * host-only, correct for localhost dev where the port-agnostic host\n * cookie already spans the dev ports); `Max-Age` matches the anon\n * JWT's `expirySeconds`.\n */\n setSessionCookie(res: Response, token: string): void {\n AuthControllerUtils.setAnonymousSessionCookie(\n res,\n token,\n this.configService.config.auth.anonymousSessionCookieDomain,\n this.configService.applicationEnv,\n ANONYMOUS_SESSION_JWT_FORMAT.expirySeconds,\n );\n }\n\n /**\n * Clear the anonymous-session continuity cookie. Called after a\n * successful transposition (the anonymous rows now belong to the\n * authenticated user, so the session has served its purpose) and on\n * session clear. Delegates to `AuthControllerUtils` with the SAME\n * config-resolved `Domain` the cookie was set with, so the browser\n * actually honours the deletion.\n */\n clearSessionCookie(res: Response): void {\n AuthControllerUtils.clearAnonymousSessionCookie(\n res,\n this.configService.config.auth.anonymousSessionCookieDomain,\n this.configService.applicationEnv,\n );\n }\n\n /**\n * Transpose ownership of all isAnonymizable resources from an anonymous user\n * to an authenticated user. Called during registration/login when the user\n * had prior anonymous activity.\n *\n * Checks that the target userType has anonymousSessionsEnabled before proceeding.\n * If the userType does not support anonymous sessions, returns an empty result.\n */\n async transposeOwnership(\n anonymousUserId: string,\n authenticatedUserId: string,\n userType: string\n ): Promise<TranspositionResult> {\n const userTypePolicy = this.configService.getUserTypeAuthPolicy(userType);\n if (!userTypePolicy?.anonymousSessionsEnabled) {\n this.logDebug('Skipping transposition — anonymousSessionsEnabled is false for user type', { userType, anonymousUserId });\n return { transposedTypes: [], discardedTypes: [], failedTypes: [], status: AnonymousUserTranspositionStatus.PENDING };\n }\n\n const { transposedTypes, discardedTypes, failedTypes } = await this.applyOwnershipTransposition(\n anonymousUserId,\n authenticatedUserId,\n // The CONVERSION pass is the one moment a declared REPLACE policy may be honoured — see the\n // long note on `applyOwnershipTransposition`'s `applyReplacePolicy` for why a later\n // reconciliation pass must NOT re-apply it.\n { applyReplacePolicy: true },\n );\n\n // PARTIAL means \"some of the work landed\", and a DISCARD sweep is work: those rows are gone and\n // no later pass will find them. Counting only `transposedTypes` here would stamp PENDING on a\n // session whose only successful type was a DISCARD — a status that says nothing happened about a\n // session whose data was deleted.\n const status = failedTypes.length === 0\n ? AnonymousUserTranspositionStatus.COMPLETE\n : transposedTypes.length + discardedTypes.length > 0\n ? AnonymousUserTranspositionStatus.PARTIAL\n : AnonymousUserTranspositionStatus.PENDING;\n\n await this.recordTranspositionOutcome(anonymousUserId, authenticatedUserId, status);\n\n return { transposedTypes, discardedTypes, failedTypes, status };\n }\n\n /**\n * Move every still-anonymous row this session owns onto the authenticated user, one resource type\n * at a time. Shared by the CONVERSION pass ({@link transposeOwnership}) and the RECONCILIATION\n * pass ({@link reconcileIncompleteTranspositions}) so the two can never drift into two different\n * notions of what a transposition is.\n *\n * ### The idempotency contract, and why it is STRUCTURAL rather than a flag\n * Every read goes through {@link listAnonymousRecords}, which filters `{ anonymousUserId, userId:\n * null }`. The write flips a row to `{ userId: <account>, anonymousUserId: null }`. So a row that\n * has already moved is invisible to every subsequent pass, per resource type, with no bookkeeping\n * anywhere: re-running this method can only ever act on rows that genuinely have not moved yet.\n *\n * That is deliberate. A \"which types have I already done?\" marker on the AnonymousUser row would\n * be a second ledger next to the data it describes, and it would be written by exactly the\n * best-effort write whose failure created the split in the first place. The data answers the\n * question; nothing else needs to.\n *\n * ### Why a per-type failure is still SWALLOWED here\n * One resource type failing must not lose the others — a visitor whose draft notes move but whose\n * lead capture does not is strictly better off than one where neither moved because the first\n * throw aborted the loop. That reasoning was always sound. What was missing is what happens\n * NEXT, and that is now {@link reconcileIncompleteTranspositions} rather than a status stamp\n * nobody reads.\n *\n * @param applyReplacePolicy honour `ResourceTranspositionPolicy.REPLACE` (delete the account's\n * existing rows of that type before moving the anonymous ones). TRUE only on the conversion\n * pass. On a reconciliation pass it MUST be false: REPLACE expresses \"the anonymous draft wins\n * over whatever the account had AT THE MOMENT OF CONVERSION\", and re-applying it hours or days\n * later would delete rows the user authored *after* converting — turning a repair into data\n * loss, which is far worse than the residual it would fix.\n *\n * The residual, stated plainly: if the REPLACE delete itself failed at conversion time, the\n * reconciliation moves the anonymous rows in ADD fashion, so the account ends up holding both\n * sets. That is visible, non-destructive and recoverable by the user; the alternative is not.\n * Rejected alternative: record \"REPLACE was applied for type T\" durably and let the reconcile\n * consult it — that is precisely the second ledger this design refuses, and it would be written\n * by the same fallible pass.\n *\n * ### DISCARD DELETES, and it deletes on BOTH passes — unlike REPLACE\n * `DISCARD` used to `continue` past the type entirely, which left its rows carrying\n * `{ anonymousUserId, userId: null }` FOREVER: the conversion had already set `convertedToUserId`,\n * so the cleanup batch's phase 1 (`{ convertedToUserId: null }`) could no longer see the session,\n * and phase 2 deletes only the `ANONYMOUS_USERS` anchor row. After the retention window the anchor\n * was gone and the rows remained, pointing at an identity that no longer exists — an orphan with a\n * dangling foreign key, and no population definition by which any later sweep could find it.\n *\n * So the delete happens HERE, at conversion time, where the anchor still exists and the population\n * is exactly \"the rows this list just returned\". The rejected alternative was a later sweep, which\n * would have to recognise the same rows AFTER phase 2 removed the only thing that names them —\n * a recognition problem that deleting at conversion makes unnecessary.\n *\n * It is deliberately NOT gated on `applyReplacePolicy`, and the asymmetry with REPLACE is the\n * whole reason that flag exists in the first place. REPLACE deletes the ACCOUNT's rows, so\n * re-applying it later destroys work the user did after converting. DISCARD deletes the ANONYMOUS\n * rows — rows the account has never been able to see and that the resource declared it never wants\n * carried over. Deleting them a day late is the same act, not a destructive one, so a\n * reconciliation pass may and must finish a DISCARD the conversion could not.\n *\n * A DISCARD failure is recorded in `failedTypes` and the loop continues — the same treatment as\n * every other per-type failure, and for the stronger reason: this runs inside a live conversion,\n * and a conversion that half-runs (the user cannot complete sign-in) is worse than a row that\n * survives until the next reconciliation pass, which will retry it before phase 2 can retire the\n * anchor.\n */\n private async applyOwnershipTransposition(\n anonymousUserId: string,\n authenticatedUserId: string,\n { applyReplacePolicy }: { applyReplacePolicy: boolean },\n ): Promise<{\n transposedTypes: ResourceType[];\n discardedTypes: ResourceType[];\n failedTypes: { resourceType: ResourceType; error: string }[];\n }> {\n const transposedTypes: ResourceType[] = [];\n const discardedTypes: ResourceType[] = [];\n const failedTypes: { resourceType: ResourceType; error: string }[] = [];\n\n const anonymizableTypes = this.getAnonymizableResourceTypes();\n\n for (const resourceType of anonymizableTypes) {\n const resourceConfig = this.resourcesRegistry.getResourceConfiguration(resourceType);\n const policy = resourceConfig?.transpositionPolicy ?? ResourceTranspositionPolicy.ADD;\n\n try {\n const records = await this.listAnonymousRecords(resourceType, anonymousUserId);\n\n if (!records || records.length === 0) continue;\n\n const ids = records.map((r: any) => r._id);\n\n if (policy === ResourceTranspositionPolicy.DISCARD) {\n // Same structural idempotency as the reassignment below: the read filters\n // `{ anonymousUserId, userId: null }`, and a deleted row matches nothing, so a re-run can\n // only ever act on rows that are genuinely still there.\n await this.deleteOwnedRecords(resourceType, ids);\n discardedTypes.push(resourceType);\n this.logDebug('Discarded anonymous records (DISCARD policy)', {\n resourceType, count: ids.length, anonymousUserId, authenticatedUserId,\n });\n continue;\n }\n\n if (policy === ResourceTranspositionPolicy.REPLACE && applyReplacePolicy) {\n await this.deleteExistingUserRecords(resourceType, authenticatedUserId);\n }\n\n /*\n * No MERGE arm: the member was removed from `ResourceTranspositionPolicy` on 2026-09-08.\n * It used to warn here and fall through to the reassignment below, which meant a resource\n * declaring MERGE silently got ADD. With the member gone this branch is unreachable, and\n * the warning would have been a claim about a state no config can author.\n */\n await this.reassignOwnership(resourceType, ids, authenticatedUserId);\n\n transposedTypes.push(resourceType);\n this.logDebug('Transposed ownership', {\n resourceType, policy, count: ids.length, anonymousUserId, authenticatedUserId,\n });\n } catch (error) {\n const errorMsg = describeCaughtError(error);\n failedTypes.push({ resourceType, error: errorMsg });\n this.logger.error('Transposition failed for resource type', {\n resourceType, policy, anonymousUserId, authenticatedUserId, error: errorMsg,\n });\n }\n }\n\n // ── Manual transposition for INBOUND_CONTACTS (Phase 0.5, Q-E=B) ──\n //\n // INBOUND_CONTACTS is APPLICATION-scoped (not USER_SELF) and therefore\n // does NOT carry `isAnonymizable: true` — the generic transposition\n // loop above (which gates on isAnonymizable) does not see it.\n //\n // The lead-capture FK chain is `{ anonymousUserId } → { userId,\n // anonymousUserId: null }`: when the anonymous user converts, all\n // leads they submitted are reassigned to their authenticated user\n // identity, and the anonymous link is cleared so the upcoming\n // anonymous-session cleanup batch does not look at them.\n //\n // We invoke the dedicated helper after the generic loop so its\n // result rolls into the same transposedTypes/failedTypes report\n // and the AnonymousUser.transpositionStatus update below reflects\n // the full conversion outcome.\n //\n // It has no DISCARD arm and needs none: `transpositionPolicy` is normalized to `undefined` for\n // any resource that is not `isAnonymizable` (`resources-config.shared.factory.ts`), and\n // `INBOUND_CONTACTS` cannot be — the flag requires USER_SELF scope. So no configuration can\n // declare DISCARD for this type; there is no silently-ADD'ed policy here, which is the failure\n // shape the removed MERGE member had.\n try {\n const inboundContactsTransposedCount = await this.transposeInboundContactsOwnership(\n anonymousUserId,\n authenticatedUserId,\n );\n if (inboundContactsTransposedCount > 0) {\n transposedTypes.push(CoreResourceType.INBOUND_CONTACTS);\n this.logDebug('Transposed inbound contacts', {\n anonymousUserId, authenticatedUserId, count: inboundContactsTransposedCount,\n });\n }\n } catch (error) {\n const errorMsg = describeCaughtError(error);\n failedTypes.push({ resourceType: CoreResourceType.INBOUND_CONTACTS, error: errorMsg });\n this.logger.error('InboundContacts transposition failed', {\n anonymousUserId, authenticatedUserId, error: errorMsg,\n });\n }\n\n return { transposedTypes, discardedTypes, failedTypes };\n }\n\n /**\n * Write the conversion outcome onto the AnonymousUser row: `convertedToUserId` (WHICH account the\n * session became) and `transpositionStatus` (how far the move got).\n *\n * ### This write REFUSES. It is the one step here that may not be best effort.\n * Every other failure in a transposition is survivable because the DATA still says what happened:\n * a row that moved carries the account's `userId`, a row that did not still carries the\n * `anonymousUserId`. `convertedToUserId` is different — it is the ONLY place the anon→account\n * mapping is ever recorded. Lose it and no later pass can know which account the leftover rows\n * were supposed to reach, so a recoverable partial becomes permanent.\n *\n * It is not merely unrecoverable, it is actively destructive: `cleanupExpiredSessions` selects\n * `{ convertedToUserId: null, createdAt < 48h }` and DELETES that session's remaining anonymous\n * rows. So a swallowed failure here schedules the visitor's un-moved rows for deletion two days\n * later, silently — the exact \"record that it stopped and never revisit it\" shape this method now\n * refuses to produce.\n *\n * Throwing costs the caller nothing it was relying on. Both triggers\n * (`handleAnonymousTransposition` / `...ForTokenExchange` in the authentication controller) already\n * wrap the call in a non-blocking catch, so the authentication response is unaffected — and\n * because their `clearSessionCookie` sits AFTER the call, a throw also KEEPS the continuity cookie,\n * which is precisely the retry channel: the next login presents the same session handle and the\n * whole transposition runs again, idempotently (see `applyOwnershipTransposition`).\n *\n * Deliberately NOT routed through `updateAsSystem` (unlike the ownership transposition writes).\n * `convertedToUserId` and `transpositionStatus` are ordinary fields — neither `.isBackendOnly()`\n * nor context-auto-populated FK names — so they survive the strict-DTO parse; there is nothing for\n * the primitive to re-attach. Migrating would only add a fail-closed opt-in and an audit row for\n * no correctness gain, so the plain internal-EC handler stays. (ANONYMOUS_USERS opts into\n * `systemAccessPolicy.create` only.)\n */\n private async recordTranspositionOutcome(\n anonymousUserId: string,\n authenticatedUserId: string,\n status: AnonymousUserTranspositionStatus,\n ): Promise<void> {\n const updateOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.UPDATE);\n const anonymousUserEc = await this.executionContextCreator.createForInternalOperation({\n operation: updateOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n // Target the row by `{ uuidRef }`, NOT the session id directly: the session id\n // (from the JWT) is the client `uuidRef`, while the row's `_id` is a server\n // ObjectId — a bare id arg would resolve to `{ _id: <uuidRef> }` and match nothing.\n await this.servicesRegistryHandler.update(\n CoreResourceType.ANONYMOUS_USERS, anonymousUserEc, { uuidRef: anonymousUserId },\n { convertedToUserId: authenticatedUserId, transpositionStatus: status }\n );\n }\n\n /**\n * Finish the transpositions that stopped part-way, instead of leaving the stamp that says they\n * did. Runs as phase 0 of the anonymous-session cleanup batch — before the deletion phases, which\n * is the whole point: the batch that would otherwise walk past these rows repairs them first.\n *\n * ### What it is looking for\n * A converted session whose data is still SPLIT: some rows on the account, some still carrying\n * `{ anonymousUserId, userId: null }` because a resource type threw during the conversion pass.\n * The account cannot see those rows, and nothing was ever going to come back for them.\n *\n * ### Why the candidate query keys on the stamp but the REPAIR keys on the data\n * The stamp is a cheap INDEX into the population, not the authority. `{ convertedToUserId != null,\n * transpositionStatus != COMPLETE }` is a superset of the genuinely-split sessions: after the\n * conversion pass, `convertedToUserId` and `transpositionStatus` are written by ONE update, so a\n * row that names an account always carries a stamp, and a stamp that is not COMPLETE means at\n * least one type failed at that time. What the stamp cannot tell us is whether the split is\n * STILL there — a transient repository error may since have cleared, and (before this method\n * existed) a fully-successful move could be left stamped PENDING by a status write that failed on\n * its own. So the stamp only selects who to LOOK at; `applyOwnershipTransposition` reads the rows\n * and decides. A session that turns out to be whole gets its stamp corrected to COMPLETE, which\n * is how the stamp-only split heals and how the candidate set stays small.\n *\n * ### The population this can NEVER repair, stated so nobody looks for it\n * A session whose conversion-time status write failed BEFORE this change has `convertedToUserId:\n * null`, and the account it converted into was never written down anywhere. It is indistinguishable\n * from a visitor who never signed up, and its leftover rows were deleted by the 48h cleanup. There\n * is no backfill for those; {@link recordTranspositionOutcome} refusing is what stops new ones.\n */\n async reconcileIncompleteTranspositions(options?: {\n batchSize?: number;\n maxIterations?: number;\n }): Promise<TranspositionReconciliationResult> {\n const result: TranspositionReconciliationResult = {\n candidatesExamined: 0, sessionsRepaired: 0, sessionsStillIncomplete: 0,\n resourceTypesTransposed: 0, resourceTypesDiscarded: 0, errors: 0,\n };\n\n if (!this.configService.anonymousSessionsEnabled) {\n this.logDebug('Anonymous sessions not enabled — skipping transposition reconciliation');\n return result;\n }\n\n const batchSize = options?.batchSize ?? 100;\n const maxIterations = options?.maxIterations ?? 100;\n\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n\n // Pagination over a set the pass itself SHRINKS. A repaired session leaves the candidate filter\n // (its stamp becomes COMPLETE), so re-reading page 1 keeps yielding fresh work and no cursor is\n // needed for the common case. A session that stays incomplete does NOT leave the filter, so it\n // reappears on every read; `stuck` remembers those by handle so they are (a) attempted once per\n // pass and (b) skipped past by the page offset once they fill a whole batch.\n //\n // The offset MUST be derived from a SET, not a counter. A counter incremented on every sighting\n // grows each iteration for the same handful of stuck sessions, and once it crossed `batchSize`\n // the page would jump forward and silently skip a batch of genuinely repairable sessions —\n // a reconciliation that reports success while walking past the work.\n const stuck = new Set<string>();\n let iteration = 0;\n while (iteration < maxIterations) {\n iteration++;\n const page = Math.floor(stuck.size / batchSize) + 1;\n\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n const listResult = await this.servicesRegistryHandler.list<any>(\n CoreResourceType.ANONYMOUS_USERS,\n listEc,\n { convertedToUserId: { $ne: null }, transpositionStatus: { $ne: AnonymousUserTranspositionStatus.COMPLETE } },\n { page, limit: batchSize },\n );\n const candidates: any[] = Array.isArray(listResult) ? listResult : listResult.data;\n if (candidates.length === 0) break;\n\n for (const candidate of candidates) {\n // A session already attempted this pass is re-read but not re-attempted: retrying it inside\n // one pass would just fail again, and counting it twice is what corrupts the page offset.\n if (typeof candidate.uuidRef === 'string' && stuck.has(candidate.uuidRef)) continue;\n result.candidatesExamined++;\n // `uuidRef` is the relational handle children carry in `anonymousUserId`; `_id` is a pure\n // internal storage id that matches no child. Using `_id` here would find nothing to move and\n // report every split session as already whole — a green reconciliation over an empty search.\n const anonymousUserRef = candidate.uuidRef as string;\n const authenticatedUserId = candidate.convertedToUserId as string;\n if (!anonymousUserRef || !authenticatedUserId) {\n // Cannot happen through the candidate filter, but a hand-edited row would land here and a\n // silent `continue` is how it would stay invisible.\n result.errors++;\n this.logger.warn('Skipping transposition reconciliation candidate with no session handle or target user', {\n anonymousUserRowId: candidate._id, hasUuidRef: !!anonymousUserRef, hasConvertedToUserId: !!authenticatedUserId,\n });\n continue;\n }\n\n try {\n const { transposedTypes, discardedTypes, failedTypes } = await this.applyOwnershipTransposition(\n anonymousUserRef,\n authenticatedUserId,\n // NEVER re-apply REPLACE outside the conversion moment — see `applyOwnershipTransposition`.\n // DISCARD is NOT subject to that restriction and runs here too: it deletes the ANONYMOUS\n // rows, never the account's, so finishing it late is the same act rather than a\n // destructive one. This is the only channel that can still reach a DISCARD row whose\n // conversion-time delete failed.\n { applyReplacePolicy: false },\n );\n result.resourceTypesTransposed += transposedTypes.length;\n result.resourceTypesDiscarded += discardedTypes.length;\n\n if (failedTypes.length > 0) {\n stuck.add(anonymousUserRef);\n // ERROR, not WARN: a type that failed at conversion AND fails again on a later pass is a\n // defect in that resource's write path, not a transient. Warn level is where this kind of\n // finding goes to die (a level-60 FATAL gate never sees it), so the repeated failure is\n // the thing that must be loud.\n this.logger.error('Anonymous transposition still incomplete after reconciliation', {\n anonymousUserRef, authenticatedUserId,\n failedTypes: failedTypes.map((f) => ({ resourceType: f.resourceType, error: f.error })),\n });\n continue;\n }\n\n // Nothing left un-moved for this session. Re-stamp COMPLETE — this both records the repair\n // and removes the row from the candidate set, so a converged session is never re-examined.\n await this.recordTranspositionOutcome(anonymousUserRef, authenticatedUserId, AnonymousUserTranspositionStatus.COMPLETE);\n result.sessionsRepaired++;\n this.logDebug('Reconciled anonymous transposition', {\n anonymousUserRef, authenticatedUserId, transposedTypes, discardedTypes,\n priorStatus: candidate.transpositionStatus ?? null,\n });\n } catch (error) {\n // The stamp write refused (see `recordTranspositionOutcome`), or the EC could not be built.\n // The session stays in the candidate set and is retried on the next batch run — which is\n // safe precisely because the move itself is idempotent.\n result.errors++;\n stuck.add(anonymousUserRef);\n this.logger.error('Anonymous transposition reconciliation failed for a session', {\n anonymousUserRef, authenticatedUserId, ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n if (candidates.length < batchSize) break;\n }\n\n result.sessionsStillIncomplete = stuck.size;\n return result;\n }\n\n /**\n * Transpose ownership of `INBOUND_CONTACTS` rows owned by the given\n * anonymous user to the now-authenticated user (Phase 0.5, Q-E=B).\n *\n * Why this lives outside the generic isAnonymizable loop:\n * `INBOUND_CONTACTS` is APPLICATION-scoped (org-owned admin\n * resource), not USER_SELF-scoped, and therefore cannot carry\n * `isAnonymizable: true` (the factory enforces USER_SELF for that\n * flag). The conversion semantics are the same — flip\n * `{ anonymousUserId } → { userId, anonymousUserId: null }` — but\n * they are wired manually here.\n *\n * Implementation notes:\n * - Lists by FK `anonymousUserId` (matches the registry edge\n * `ANONYMOUS_USERS → INBOUND_CONTACTS` declared in\n * `resources-registry.shared.core.definitions.ts`).\n * - Uses INTERNAL_CALL UPDATE (declared in\n * `inbound-contacts.shared.resources-config.schemas.ts`) — no\n * public admin-edit surface in Phase 0.5.\n * - Per-row UPDATE (not UPDATE_MANY) because conversion volume is\n * low (one anonymous session typically submits 0–1 leads) and\n * this avoids surfacing UPDATE_MANY just for transposition.\n *\n * @returns the number of leads transposed (0 if none).\n */\n private async transposeInboundContactsOwnership(\n anonymousUserId: string,\n authenticatedUserId: string,\n ): Promise<number> {\n const records = await this.listAnonymousRecords(\n CoreResourceType.INBOUND_CONTACTS,\n anonymousUserId,\n );\n\n if (!records || records.length === 0) return 0;\n\n let transposedCount = 0;\n for (const record of records) {\n // `{ userId, anonymousUserId }` are context-auto-populated FK names the\n // client-shaped request DTO strips, so a plain `servicesRegistryHandler\n // .update` was a silent no-op `$set` (the lead's ownership never moved).\n // `updateAsSystem` re-attaches both FKs after the strict parse and\n // synthesises its own super-admin context, fail-closed behind\n // INBOUND_CONTACTS' `systemAccessPolicy.update`. Per-row (not UPDATE_MANY)\n // by design — see the method doc above.\n await this.systemAccessService.updateAsSystem(\n CoreResourceType.INBOUND_CONTACTS,\n record._id as string,\n { userId: authenticatedUserId, anonymousUserId: null },\n );\n transposedCount++;\n }\n return transposedCount;\n }\n\n /**\n * List the not-yet-converted rows an anonymous user owns, across BOTH the\n * generic `isAnonymizable` resources (USER_SELF-scoped, e.g. `draftNotes`) and\n * the manually-wired APPLICATION-scoped ones (`inboundContacts`).\n *\n * Scope by `anonymousUserId` as a DIRECT field filter — NOT via the EC\n * `contextResourcesFieldIdentifier` map. Putting the FK on the context map is\n * FATAL at EC-CREATION time for an APPLICATION-scoped resource: because\n * `INBOUND_CONTACTS`' LIST is APPLICATION-scoped, `createExecutionContext` runs\n * `populateApplicationIdIfNeeded`, which reads the singleton `applications`\n * record with THIS same EC. `applications` does not model `anonymousUserId`, so\n * its `buildContextualFilter` iterates the context map, hits the unknown field\n * and fails closed — `configuration` / `reason: 'context_filter'` /\n * resource `'applications'`. The throw happens INSIDE the creator (before\n * `list()` runs), so `excludeContextualFilter` on the `list()` call alone cannot\n * suppress it; the FK must stay off the context map.\n *\n * With the FK supplied explicitly, the caller owns the authoritative scope, so\n * the ambient contextual filter is skipped (`excludeContextualFilter: true`) —\n * the canonical explicit-scope repository-options pattern (cf. the\n * milestone/lifecycle evaluators and `NotificationBadgeBackendService`).\n * USER_SELF-scoped anonymizable resources never triggered the crash but are\n * filtered identically (`userId: null` keeps it to still-anonymous rows).\n */\n private async listAnonymousRecords(resourceType: ResourceType, anonymousUserId: string): Promise<any[]> {\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.LIST);\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n return await this.servicesRegistryHandler.list<any>(\n resourceType,\n listEc,\n { anonymousUserId, userId: null },\n undefined,\n { paginated: false, excludeContextualFilter: true },\n ) as any[];\n }\n\n private async reassignOwnership(resourceType: ResourceType, ids: string[], authenticatedUserId: string): Promise<void> {\n // THE transposition write. The patch `{ userId, anonymousUserId }` is two\n // context-auto-populated FK names the client-shaped request DTO strips, so a\n // plain `servicesRegistryHandler.updateMany` was a silent no-op `$set` — the\n // anon→user ownership move never landed, and the rows were later deleted by the\n // expired-session cleanup batch (user-visible data loss on conversion).\n // `updateManyAsSystem` re-attaches both FKs after the strict parse and\n // synthesises its own super-admin context, fail-closed behind\n // `systemAccessPolicy.updateMany` — auto-granted by the factory to every\n // `isAnonymizable` resource (the only resources this dynamic loop iterates),\n // so no per-resource opt-in is required here.\n await this.systemAccessService.updateManyAsSystem(resourceType, ids, { userId: authenticatedUserId, anonymousUserId: null });\n }\n\n /**\n * Delete a known id set of a resource's rows, as the internal super-admin.\n *\n * THE single delete primitive of this service: the `DISCARD` transposition arm, the `REPLACE`\n * pre-delete and the expired-session cleanup all route through it, so \"how does this service\n * delete rows it owns\" has one answer and one place to fix.\n *\n * ### It resolves the operation it can actually serve, and that is not decoration\n * `isAnonymizable` is validated at config time to require LIST and UPDATE_MANY — the two ADD needs\n * — and says NOTHING about DELETE_MANY. Measured 2026-09-09: `draftNotes`, the only\n * `isAnonymizable` resource in this repository, declares `DELETE` and not `DELETE_MANY`. So the\n * previous unconditional `getServiceOperationPathDefault(resourceType, DELETE_MANY)` threw\n * `RESOURCES_REGISTRY_OPERATION_PATH_NOT_FOUND` for it — which means the cleanup batch's phase 1\n * has never been able to delete an expired anonymous draft note: the per-session catch counted an\n * error, the `ANONYMOUS_USERS` row was never removed, and the same session was retried on every\n * run forever. A DISCARD sweep built on the same unconditional call would have shipped equally\n * dead.\n *\n * So: prefer `DELETE_MANY` when the resource declares a SERVICE-RESOLVABLE default for it, and\n * fall back to per-row `DELETE` otherwise. The probe is\n * {@link isServiceResolvableDefaultOperation} — the very predicate\n * `getServiceOperationPathDefault` admits on — so the probe and the resolver cannot disagree\n * (`try/catch` around the throwing resolver would also have \"worked\" and would have swallowed a\n * genuine registry corruption as a fallback). If NEITHER resolves, the `DELETE` lookup throws and\n * names the resource and the operation, which is the right outcome: a resource that can be\n * created anonymously and can never be deleted is a configuration defect, not a case to swallow.\n *\n * Per-row DELETE is the same trade `transposeInboundContactsOwnership` already documents: one\n * anonymous session owns a handful of rows, so the round trips are cheap, and requiring an\n * application to publish a bulk-delete surface it does not want is the worse price.\n */\n private async deleteOwnedRecords(resourceType: ResourceType, ids: string[]): Promise<void> {\n if (ids.length === 0) return;\n\n const operations = this.resourcesRegistry.getResourceConfiguration(resourceType)?.operations ?? [];\n const supportsDeleteMany = operations.some((operation: any) =>\n isServiceResolvableDefaultOperation(operation, CoreResourceOperation.DELETE_MANY));\n\n const operationIdentifier = supportsDeleteMany ? CoreResourceOperation.DELETE_MANY : CoreResourceOperation.DELETE;\n const deleteOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, operationIdentifier);\n const deleteEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n if (supportsDeleteMany) {\n await this.servicesRegistryHandler.deleteMany(resourceType, deleteEc, ids);\n return;\n }\n for (const id of ids) {\n await this.servicesRegistryHandler.delete(resourceType, deleteEc, id);\n }\n }\n\n private async deleteExistingUserRecords(resourceType: ResourceType, userId: string): Promise<void> {\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(resourceType, CoreResourceOperation.LIST);\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map([['userId', userId]]),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n const existing = await this.servicesRegistryHandler.list<any>(resourceType, listEc, undefined, undefined, { paginated: false }) as any[];\n if (existing && existing.length > 0) {\n const ids = existing.map((r: any) => r._id);\n await this.deleteOwnedRecords(resourceType, ids);\n this.logDebug('Deleted existing user records (REPLACE policy)', { resourceType, userId, count: ids.length });\n }\n }\n\n /**\n * Cleanup expired, unconverted anonymous sessions and their owned resources.\n * Called by the anonymous-session-cleanup batch job.\n */\n async cleanupExpiredSessions(options?: {\n sessionTtlMs?: number;\n batchSize?: number;\n maxIterations?: number;\n convertedRetentionMs?: number;\n }): Promise<{\n expiredUsersFound: number;\n resourcesDeleted: number;\n usersArchived: number;\n convertedUsersCleaned: number;\n errors: number;\n transpositionsReconciled: TranspositionReconciliationResult;\n }> {\n const FORTY_EIGHT_HOURS_MS = 48 * 60 * 60 * 1000;\n const NINETY_DAYS_MS = 90 * 24 * 60 * 60 * 1000;\n const sessionTtlMs = options?.sessionTtlMs ?? FORTY_EIGHT_HOURS_MS;\n const batchSize = options?.batchSize ?? 100;\n const maxIterations = options?.maxIterations ?? 100;\n const convertedRetentionMs = options?.convertedRetentionMs ?? NINETY_DAYS_MS;\n const cutoff = new Date(Date.now() - sessionTtlMs);\n\n const emptyReconciliation: TranspositionReconciliationResult = {\n candidatesExamined: 0, sessionsRepaired: 0, sessionsStillIncomplete: 0,\n resourceTypesTransposed: 0, resourceTypesDiscarded: 0, errors: 0,\n };\n\n if (!this.configService.anonymousSessionsEnabled) {\n this.logDebug('Anonymous sessions not enabled — skipping cleanup');\n return {\n expiredUsersFound: 0, resourcesDeleted: 0, usersArchived: 0, convertedUsersCleaned: 0, errors: 0,\n transpositionsReconciled: emptyReconciliation,\n };\n }\n\n // ── Phase 0: finish the transpositions that stopped part-way ──\n //\n // BEFORE the two deletion phases, deliberately. This batch is the only recurring pass over the\n // anonymous-session population, so it is where a half-finished conversion is either repaired or\n // walked past forever — and phase 2 removes the converted AnonymousUser row (the sole record of\n // which account the leftovers belong to) once retention expires. Repairing first means the row\n // is only ever retired after its data has been asked about.\n //\n // Not gated on the deletion options: a reconciliation is a repair, not a cleanup, and an\n // operator narrowing the TTL for a cleanup run has said nothing about repairs.\n let transpositionsReconciled = emptyReconciliation;\n try {\n transpositionsReconciled = await this.reconcileIncompleteTranspositions({\n batchSize: options?.batchSize,\n maxIterations: options?.maxIterations,\n });\n } catch (error) {\n // Best effort ONLY at this seam, and for one reason: the deletion phases below must still run\n // if the repair pass cannot. A repair that did not happen is retried tomorrow; a cleanup that\n // never runs grows unbounded. Per-session failures are already surfaced at ERROR inside the\n // reconciliation, so nothing is being hidden here — this catch only sees a failure of the pass\n // as a whole (a LIST that could not be issued).\n this.logger.error('Anonymous transposition reconciliation pass failed — continuing with cleanup', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n\n const anonymizableTypes = this.getAnonymizableResourceTypes();\n let totalExpiredUsersFound = 0;\n let resourcesDeleted = 0;\n let usersArchived = 0;\n let errors = 0;\n let iteration = 0;\n\n // Phase 1: Clean up expired unconverted sessions (pagination loop)\n let hasMore = true;\n while (hasMore && iteration < maxIterations) {\n iteration++;\n\n const listOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n const listEc = await this.executionContextCreator.createForInternalOperation({\n operation: listOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n\n const listResult = await this.servicesRegistryHandler.list<any>(\n CoreResourceType.ANONYMOUS_USERS,\n listEc,\n { convertedToUserId: null, createdAt: { $lt: cutoff } },\n { page: 1, limit: batchSize }\n );\n const expiredUsers: any[] = Array.isArray(listResult) ? listResult : listResult.data;\n totalExpiredUsersFound += expiredUsers.length;\n\n if (expiredUsers.length === 0) { hasMore = false; break; }\n\n for (const anonUser of expiredUsers) {\n // `_id` (server ObjectId) deletes the AnonymousUser row itself; `uuidRef`\n // (the client session handle) is what children carry in their `anonymousUserId`\n // FK, so it is what lists/deletes the owned records. Filtering children by `_id`\n // would match nothing and silently orphan them.\n const anonymousUserId = anonUser._id as string;\n const anonymousUserRef = anonUser.uuidRef as string;\n\n try {\n for (const resourceType of anonymizableTypes) {\n const records = await this.listAnonymousRecords(resourceType, anonymousUserRef);\n if (records && records.length > 0) {\n const ids = records.map((r: any) => r._id);\n await this.deleteOwnedRecords(resourceType, ids);\n resourcesDeleted += ids.length;\n }\n }\n\n const deleteAnonOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.DELETE);\n const deleteAnonEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteAnonOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n await this.servicesRegistryHandler.delete(CoreResourceType.ANONYMOUS_USERS, deleteAnonEc, anonymousUserId);\n usersArchived++;\n } catch (error) {\n errors++;\n this.logger.warn('Failed to clean up expired anonymous session', {\n anonymousUserId,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n hasMore = expiredUsers.length >= batchSize;\n }\n\n // Phase 2: Clean up converted AnonymousUser records past retention period (audit trail)\n let convertedUsersCleaned = 0;\n const convertedCutoff = new Date(Date.now() - convertedRetentionMs);\n try {\n const convertedListOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.LIST);\n const convertedListEc = await this.executionContextCreator.createForInternalOperation({\n operation: convertedListOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n const convertedResult = await this.servicesRegistryHandler.list<any>(\n CoreResourceType.ANONYMOUS_USERS,\n convertedListEc,\n { convertedToUserId: { $ne: null }, createdAt: { $lt: convertedCutoff } },\n { page: 1, limit: batchSize }\n );\n const convertedUsers: any[] = Array.isArray(convertedResult) ? convertedResult : convertedResult.data;\n\n for (const convertedUser of convertedUsers) {\n try {\n const deleteOpPath = this.resourcesRegistry.getServiceOperationPathDefault(CoreResourceType.ANONYMOUS_USERS, CoreResourceOperation.DELETE);\n const deleteEc = await this.executionContextCreator.createForInternalOperation({\n operation: deleteOpPath,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [{ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION }],\n });\n await this.servicesRegistryHandler.delete(CoreResourceType.ANONYMOUS_USERS, deleteEc, convertedUser._id);\n convertedUsersCleaned++;\n } catch (error) {\n errors++;\n }\n }\n } catch (error) {\n this.logger.warn('Failed to clean up converted anonymous users', {\n ...projectCaughtErrorLogFields(error),\n });\n }\n\n this.logDebug('Cleanup completed', {\n expiredUsersFound: totalExpiredUsersFound, resourcesDeleted, usersArchived,\n convertedUsersCleaned, errors, iterations: iteration,\n anonymizableTypes: anonymizableTypes.length,\n transpositionsReconciled,\n });\n\n return {\n expiredUsersFound: totalExpiredUsersFound, resourcesDeleted, usersArchived, convertedUsersCleaned, errors,\n transpositionsReconciled,\n };\n }\n\n private getAnonymizableResourceTypes(): ResourceType[] {\n const allTypes = this.resourcesRegistry.getResourceTypes();\n const result: ResourceType[] = [];\n for (const resourceType of allTypes) {\n const config = this.resourcesRegistry.getResourceConfiguration(resourceType);\n if (config?.isAnonymizable === true) {\n result.push(resourceType);\n }\n }\n return result;\n }\n\n private hashIp(ip: string): string {\n return crypto.createHash('sha256').update(ip).digest('hex').substring(0, 16);\n }\n\n /**\n * Extract first-touch marketing attribution from the inbound request\n * (Phase 0.5, Q-D=β). Returns `undefined` if no signal is present so\n * the caller can omit the field entirely from the create payload.\n *\n * Sources:\n * - `utm_*` query string parameters → `utm.{source,medium,campaign,term,content}`\n * - `Referer` HTTP header → `referrer`\n * - `x-landing-path` HTTP header → `landingPath`\n * (framework header registered in `WildoHeaderKeys.LANDING_PATH`, sent by\n * the marketing-site bootstrap ON the session-init request; carried in the\n * engine CORS `allowedHeaders` floor alongside `x-anonymous-session-init`\n * — see `engineAllowedHeaders` in `http-server.backend.service.ts`).\n * - `Accept-Language` HTTP header → `acceptLanguage`\n *\n * The result is parsed against `AnonymousUserMarketingMetadataSchema`\n * to apply the field-level length caps (256 / 2048) and to strip\n * unknown keys defensively. If parsing fails (e.g. malformed\n * over-length values from a hostile client), we log and return\n * `undefined` rather than fail session-init — attribution is a\n * best-effort marketing signal, not a security-critical field.\n */\n private extractFirstTouchMarketingMetadata(req: Request): AnonymousUserMarketingMetadata | undefined {\n const headerString = (key: string): string | undefined => {\n const raw = req.headers[key];\n if (typeof raw === 'string' && raw.length > 0) return raw;\n if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === 'string') return raw[0];\n return undefined;\n };\n const queryString = (key: string): string | undefined => {\n const raw = (req.query as Record<string, unknown> | undefined)?.[key];\n if (typeof raw === 'string' && raw.length > 0) return raw;\n if (Array.isArray(raw) && raw.length > 0 && typeof raw[0] === 'string') return raw[0];\n return undefined;\n };\n\n const utmCandidate = {\n source : queryString('utm_source'),\n medium : queryString('utm_medium'),\n campaign : queryString('utm_campaign'),\n term : queryString('utm_term'),\n content : queryString('utm_content'),\n };\n const utmHasAnyValue = Object.values(utmCandidate).some((v) => v !== undefined);\n\n const candidate: Record<string, unknown> = {};\n if (utmHasAnyValue) candidate.utm = utmCandidate;\n const referrer = headerString('referer');\n const landingPath = headerString(WildoHeaderKeys.LANDING_PATH);\n const acceptLanguage = headerString('accept-language');\n if (referrer !== undefined) candidate.referrer = referrer;\n if (landingPath !== undefined) candidate.landingPath = landingPath;\n if (acceptLanguage !== undefined) candidate.acceptLanguage = acceptLanguage;\n\n if (Object.keys(candidate).length === 0) return undefined;\n\n const parsed = AnonymousUserMarketingMetadataSchema.safeParse(candidate);\n if (!parsed.success) {\n this.logger.warn('Discarding malformed first-touch marketing metadata', {\n issues: parsed.error.issues.map((i) => ({ path: i.path.join('.'), code: i.code })),\n });\n return undefined;\n }\n return parsed.data;\n }\n}\n"]}
|
|
@@ -86,7 +86,15 @@ export declare class AuthMethodManagementBackendService {
|
|
|
86
86
|
* observed during login would still be valid moments later, and step-up would authorize a
|
|
87
87
|
* destructive operation on a credential the caller never freshly proved.
|
|
88
88
|
*
|
|
89
|
-
* `PASSKEY`
|
|
89
|
+
* `PASSKEY` is SUPPORTED, through a dedicated two-legged ceremony rather than the one call
|
|
90
|
+
* password and TOTP take: `POST /auth/reauth/passkey/options` then `POST /auth/reauth` with the
|
|
91
|
+
* assertion, because WebAuthn is challenge-response. It is a re-proof rather than a possession
|
|
92
|
+
* check — the branch below verifies under `PasskeyAuthenticationCeremony.STEP_UP`, which reads a
|
|
93
|
+
* SEPARATE challenge (so an assertion minted for a login cannot be redeemed here) and demands
|
|
94
|
+
* user verification even where the app policy is `preferred`.
|
|
95
|
+
*
|
|
96
|
+
* Any other `AuthMethod` is refused explicitly by the trailing `else`, rather than silently
|
|
97
|
+
* unsupported.
|
|
90
98
|
*
|
|
91
99
|
* assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-proof of identity before a
|
|
92
100
|
* high-impact action, over any factor the principal actually holds.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-method-management.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/security/authentications/services/auth-methods/auth-method-management.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AACzJ,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAClI,OAAO,EAAE,oCAAoC,EAAE,MAAM,+FAA+F,CAAC;AACrJ,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAC/G,OAAO,EAAE,uBAAuB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yFAAyF,CAAC;AACxI,OAAO,EAAE,6BAA6B,EAAE,MAAM,wFAAwF,CAAC;AACvI,OAAO,EAAE,4BAA4B,EAAE,MAAM,6FAA6F,CAAC;AAC3I,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAKL,UAAU,EAGV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4FAA4F,CAAC;AACnI,OAAO,EAA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AC7B,EAAE,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAmDhB
|
|
1
|
+
{"version":3,"file":"auth-method-management.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/security/authentications/services/auth-methods/auth-method-management.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6FAA6F,CAAC;AACzJ,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAClI,OAAO,EAAE,oCAAoC,EAAE,MAAM,+FAA+F,CAAC;AACrJ,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAC/G,OAAO,EAAE,uBAAuB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yFAAyF,CAAC;AACxI,OAAO,EAAE,6BAA6B,EAAE,MAAM,wFAAwF,CAAC;AACvI,OAAO,EAAE,4BAA4B,EAAE,MAAM,6FAA6F,CAAC;AAC3I,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAKL,UAAU,EAGV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4FAA4F,CAAC;AACnI,OAAO,EAAiC,sBAAsB,EAAE,MAAM,4FAA4F,CAAC;AAEnK,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAE5G,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,iBAAiB,CAAC;IAClC,MAAM,EAAE,sBAAsB,C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;;;;;;;;;OAuCG;IACU,cAAc,CACzB,EAAE,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACzB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,QAAQ,CAAC,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,OAAO,EACzB,SAAS,CAAC,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IA0KtB,gBAAgB,CAC3B,EAAE,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAsBtG"}
|
|
@@ -409,7 +409,15 @@ let AuthMethodManagementBackendService = class AuthMethodManagementBackendServic
|
|
|
409
409
|
* observed during login would still be valid moments later, and step-up would authorize a
|
|
410
410
|
* destructive operation on a credential the caller never freshly proved.
|
|
411
411
|
*
|
|
412
|
-
* `PASSKEY`
|
|
412
|
+
* `PASSKEY` is SUPPORTED, through a dedicated two-legged ceremony rather than the one call
|
|
413
|
+
* password and TOTP take: `POST /auth/reauth/passkey/options` then `POST /auth/reauth` with the
|
|
414
|
+
* assertion, because WebAuthn is challenge-response. It is a re-proof rather than a possession
|
|
415
|
+
* check — the branch below verifies under `PasskeyAuthenticationCeremony.STEP_UP`, which reads a
|
|
416
|
+
* SEPARATE challenge (so an assertion minted for a login cannot be redeemed here) and demands
|
|
417
|
+
* user verification even where the app policy is `preferred`.
|
|
418
|
+
*
|
|
419
|
+
* Any other `AuthMethod` is refused explicitly by the trailing `else`, rather than silently
|
|
420
|
+
* unsupported.
|
|
413
421
|
*
|
|
414
422
|
* assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-proof of identity before a
|
|
415
423
|
* high-impact action, over any factor the principal actually holds.
|
|
@@ -421,6 +429,45 @@ let AuthMethodManagementBackendService = class AuthMethodManagementBackendServic
|
|
|
421
429
|
*/
|
|
422
430
|
totpCode) {
|
|
423
431
|
try {
|
|
432
|
+
/*
|
|
433
|
+
* The user type's step-up policy decides WHICH FACTORS may satisfy a step-up (#422).
|
|
434
|
+
*
|
|
435
|
+
* `stepUpAuth.methods` was read only by a startup warning: the gate in
|
|
436
|
+
* `services-registry-handler.backend.service.ts` consumed any `REAUTH` token whose `userId`
|
|
437
|
+
* matched, whatever produced it. So a policy naming WebAuthn was satisfied by a password
|
|
438
|
+
* re-authentication, and an operator who configured a phishing-resistant factor got a
|
|
439
|
+
* password prompt and NO error — the same shape as an OIDC `acrValues` that is never sent.
|
|
440
|
+
*
|
|
441
|
+
* Enforced at MINT rather than at the gate, deliberately:
|
|
442
|
+
* - the factor is known here and is NOT recorded on the token, so gate-time enforcement
|
|
443
|
+
* would need a token-payload change and a migration for tokens already in flight;
|
|
444
|
+
* - a refusal here names the allowed factors while the person is still choosing one,
|
|
445
|
+
* instead of accepting their proof and refusing the operation afterwards;
|
|
446
|
+
* - it makes the wrong token UNMINTABLE rather than merely rejected, so the gate keeps its
|
|
447
|
+
* single question ("is there a valid REAUTH token for this user?") and cannot drift from
|
|
448
|
+
* the policy.
|
|
449
|
+
*
|
|
450
|
+
* NO ENROLMENT FALLBACK, and that is the decision rather than an oversight. A user whose only
|
|
451
|
+
* enrolled factor is outside the policy cannot mint a token and is told to enrol. Falling back
|
|
452
|
+
* to an unnamed factor would reopen exactly the hole this closes — a policy that names a
|
|
453
|
+
* factor and accepts a weaker one is what the defect was.
|
|
454
|
+
*
|
|
455
|
+
* The residual, stated: a token minted under one policy and redeemed after the policy narrows
|
|
456
|
+
* is still accepted. REAUTH tokens live five minutes and are single-use, so the window is that
|
|
457
|
+
* long; closing it entirely is the token-payload change rejected above.
|
|
458
|
+
*/
|
|
459
|
+
const stepUpAuth = ec.activeUserType
|
|
460
|
+
? this.appConfigService.getUserTypeAuthPolicy(ec.activeUserType)?.stepUpAuth
|
|
461
|
+
: undefined;
|
|
462
|
+
if (stepUpAuth?.enabled && !stepUpAuth.methods.includes(method)) {
|
|
463
|
+
throw this.errorBuilder.buildError(ErrorType.AUTHENTICATION, ec, {
|
|
464
|
+
context: {
|
|
465
|
+
reason: 'This factor is not accepted for step-up re-authentication by this account type',
|
|
466
|
+
requestedMethod: method,
|
|
467
|
+
acceptedMethods: stepUpAuth.methods,
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
}
|
|
424
471
|
if (method === AuthMethod.TOTP) {
|
|
425
472
|
if (!totpCode) {
|
|
426
473
|
throw this.errorBuilder.buildError(ErrorType.VALIDATION, undefined, {
|
|
@@ -469,7 +516,35 @@ let AuthMethodManagementBackendService = class AuthMethodManagementBackendServic
|
|
|
469
516
|
// STEP_UP ceremony, NOT login: it reads a separate challenge (so an assertion produced for a
|
|
470
517
|
// login cannot be redeemed here) and demands user verification even where the app policy is
|
|
471
518
|
// `preferred`. See `PasskeyAuthenticationCeremony`.
|
|
472
|
-
const { verified } = await this.webAuthnService.verifyAuthenticationResponse(ec, userId, passkeyResponse, PasskeyAuthenticationCeremony.STEP_UP);
|
|
519
|
+
const { verified, cloneSuspicion } = await this.webAuthnService.verifyAuthenticationResponse(ec, userId, passkeyResponse, PasskeyAuthenticationCeremony.STEP_UP);
|
|
520
|
+
/*
|
|
521
|
+
* A verified assertion whose signature counter did not advance is the cloned-authenticator
|
|
522
|
+
* signal, and it gets the same CRITICAL row here as at the login door — a regression met
|
|
523
|
+
* while re-proving identity for a privileged action is if anything the more interesting of
|
|
524
|
+
* the two. It is reachable only after signature verification, so it cannot be forged by
|
|
525
|
+
* someone who merely knows a credential id.
|
|
526
|
+
*
|
|
527
|
+
* It does NOT change the refusal below: this branch already produces the deliberately
|
|
528
|
+
* uniform `Passkey re-authentication failed`. Until 2026-09-08 a counter regression escaped
|
|
529
|
+
* that uniformity — the library threw before the verifier returned, and the catch at the
|
|
530
|
+
* end of this method wrapped it through `buildFromStandardError` as a generic error rather
|
|
531
|
+
* than an AUTHENTICATION refusal. Returning `verified: false` instead of throwing is what
|
|
532
|
+
* put it back on this path.
|
|
533
|
+
*/
|
|
534
|
+
if (cloneSuspicion) {
|
|
535
|
+
await this.auditLogsService.logUserPasskeyCloneSuspected({
|
|
536
|
+
userId,
|
|
537
|
+
credentialId: cloneSuspicion.credentialId,
|
|
538
|
+
storedCounter: cloneSuspicion.storedCounter,
|
|
539
|
+
receivedCounter: cloneSuspicion.receivedCounter,
|
|
540
|
+
credentialDeviceType: cloneSuspicion.credentialDeviceType,
|
|
541
|
+
credentialBackedUp: cloneSuspicion.credentialBackedUp,
|
|
542
|
+
...(cloneSuspicion.aaguid ? { aaguid: cloneSuspicion.aaguid } : {}),
|
|
543
|
+
ceremony: cloneSuspicion.ceremony,
|
|
544
|
+
ipAddress: ipAddress || 'unknown',
|
|
545
|
+
userAgent: userAgent || 'unknown',
|
|
546
|
+
}, ec);
|
|
547
|
+
}
|
|
473
548
|
if (!verified) {
|
|
474
549
|
// Deliberately ONE refusal for every failure mode below the verifier — no challenge
|
|
475
550
|
// outstanding, wrong credential, absent user verification, bad signature. Distinguishing
|