@wildo-ai/saas-backend-lib 1.1.2 → 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.map +1 -1
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +27 -6
- package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.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 +47 -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 +96 -29
- 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/infrastructure-tier-contract.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +9 -1
- package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +49 -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 +171 -18
- 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.map +1 -1
- package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +23 -3
- 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.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +20 -0
- 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-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 +529 -41
- 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 +48 -7
- 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 +225 -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 +340 -62
- 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 +244 -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 +386 -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 +6 -2
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +31 -9
- package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
- 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 +57 -1
- 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 +31 -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/models/app-config.backend.schemas.d.ts +142 -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 +33 -0
- package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
- package/dist/esm/config/services/app-configuration.backend.utils.js +39 -1
- 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/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/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 +129 -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/external-data-pipeline-run.backend.service.d.ts +59 -2
- 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 +52 -17
- package/dist/esm/external-data/external-data-pipeline-run.backend.service.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 +292 -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 +533 -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.map +1 -1
- package/dist/esm/files/controllers/file.controller.js +21 -13
- package/dist/esm/files/controllers/file.controller.js.map +1 -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 +39 -15
- package/dist/esm/files/handlers/resource-file-upload-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 +53 -2
- package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-upload-grant.backend.service.js +127 -3
- package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
- package/dist/esm/files/services/files.backend.service.d.ts +68 -0
- package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/files.backend.service.js +175 -5
- 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/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 +196 -40
- 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 +28 -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 +204 -18
- 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.map +1 -1
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +8 -4
- 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 +11 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +31 -4
- 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 +78 -10
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +17 -3
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +19 -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 +20 -0
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +56 -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 +107 -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.map +1 -1
- package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +22 -0
- 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 +99 -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 +422 -66
- 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 +46 -1
- package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -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 +16 -6
- 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 +12 -12
- 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/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 +32 -8
- 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 +14 -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/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 +90 -6
- 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/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 +19 -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 +261 -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/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.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +68 -1
- 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-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 +17 -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 +49 -17
- 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/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/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 +74 -8
- package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authorizations/services/authorizations.backend.service.js +175 -19
- 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/services/consumable-token.backend.service.d.ts +21 -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 +26 -16
- 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/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 +11 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgresql-schema-plan-diff.backend.d.ts","sourceRoot":"","sources":["../../../../../src/databases/services/postgresql-schema-plan-diff.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAA6C,MAAM,+EAA+E,CAAC;AAEnK;;;;GAIG;AACH,oBAAY,oBAAoB;IAC9B,SAAS,cAAc;IACvB,8FAA8F;IAC9F,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,qGAAqG;IACrG,WAAW,gBAAgB;IAC3B;;;OAGG;IACH,kBAAkB,uBAAuB;IACzC;;;;OAIG;IACH,kBAAkB,uBAAuB;IACzC;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,oBAAoB;IACnC;;;OAGG;IACH,+BAA+B,oCAAoC;IACnE,8EAA8E;IAC9E,iCAAiC,sCAAsC;IACvE,wGAAwG;IACxG,gBAAgB,qBAAqB;IACrC,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB;;;;;;;;OAQG;IACH,qBAAqB,0BAA0B;IAC/C,+FAA+F;IAC/F,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;CACxC;AAED;;;;;;;;;;;GAWG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,uBAAuB,4BAA4B;CACpD;AACD;;;;;;;;;GASG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,oBAAoB,CAAC;IACjC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"postgresql-schema-plan-diff.backend.d.ts","sourceRoot":"","sources":["../../../../../src/databases/services/postgresql-schema-plan-diff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215
|
detail: `new column "${name}" ${after.sqlType}.`,
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
+
/*
|
|
219
|
+
* A column ARRIVES with the properties it was declared with (#505).
|
|
220
|
+
*
|
|
221
|
+
* Everything below this point compares `before` against `after`, so it is reachable only for a
|
|
222
|
+
* column that already existed — and a NEW column `continue`s past all of it. That silently made
|
|
223
|
+
* `.isDBIndexed()` a no-op on any field added to an EXISTING table: the differ emitted
|
|
224
|
+
* `ADD_COLUMN` alone, so the database permanently lacked an index the schema declared.
|
|
225
|
+
*
|
|
226
|
+
* The initial-schema path was never affected, which is why this survived: `CREATE TABLE`
|
|
227
|
+
* renders every declared index, so the planner plainly knows how. What it did not do was carry
|
|
228
|
+
* the declaration through the DELTA path.
|
|
229
|
+
*
|
|
230
|
+
* Worse than the missing index was the silence around it. `db diff --check` compares the plan
|
|
231
|
+
* to the lockfile, and BOTH record `hasIndex: true` — the lockfile is written from the same
|
|
232
|
+
* plan — so the check was wrong in the same direction as the thing it checks and reported IN
|
|
233
|
+
* SYNC over a database missing the index. Measured 2026-09-08 on two `oauthClients` tables: the
|
|
234
|
+
* application generator emitted 4 statements, the platform generator 8, from one schema.
|
|
235
|
+
*
|
|
236
|
+
* The primary-key case is included on the same reasoning rather than on symmetry: a new column
|
|
237
|
+
* declared `isPrimaryKey` on a table that has none is additive and renderable, and skipping it
|
|
238
|
+
* left exactly the same gap one property over.
|
|
239
|
+
*/
|
|
240
|
+
if (after.hasIndex === true) {
|
|
241
|
+
changes.push({
|
|
242
|
+
changeType: SchemaPlanChangeType.ADD_INDEX,
|
|
243
|
+
risk: SchemaPlanChangeRisk.SAFE,
|
|
244
|
+
tableName,
|
|
245
|
+
subject: name,
|
|
246
|
+
detail: `plain index on the new column "${name}".`,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
if (after.isPrimaryKey === true) {
|
|
250
|
+
changes.push(previousHadPrimaryKey
|
|
251
|
+
? {
|
|
252
|
+
changeType: SchemaPlanChangeType.CHANGE_PRIMARY_KEY,
|
|
253
|
+
risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,
|
|
254
|
+
tableName,
|
|
255
|
+
subject: name,
|
|
256
|
+
detail: `the new column "${name}" is declared the primary key of a table that already has one — a constraint rebuild that touches every reference to this table; hand-author the plan.`,
|
|
257
|
+
}
|
|
258
|
+
: {
|
|
259
|
+
changeType: SchemaPlanChangeType.ADD_PRIMARY_KEY,
|
|
260
|
+
risk: SchemaPlanChangeRisk.SAFE,
|
|
261
|
+
tableName,
|
|
262
|
+
subject: name,
|
|
263
|
+
detail: `the new column "${name}" becomes the primary key of a table that had none. Additive, so nothing references the constraint being built — but it WILL fail on any existing row, since a column that has just arrived holds NULL in every one of them.`,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
218
266
|
continue;
|
|
219
267
|
}
|
|
220
268
|
if (!before || !after)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgresql-schema-plan-diff.backend.js","sourceRoot":"","sources":["../../../../../src/databases/services/postgresql-schema-plan-diff.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH;;;;GAIG;AACH,MAAM,CAAN,IAAY,oBA8DX;AA9DD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,8FAA8F;IAC9F,iDAAyB,CAAA;IACzB,iDAAyB,CAAA;IACzB,qGAAqG;IACrG,mDAA2B,CAAA;IAC3B;;;OAGG;IACH,iEAAyC,CAAA;IACzC;;;;OAIG;IACH,iEAAyC,CAAA;IACzC;;;;;;;;;;;;;;;;OAgBG;IACH,2DAAmC,CAAA;IACnC;;;OAGG;IACH,2FAAmE,CAAA;IACnE,8EAA8E;IAC9E,+FAAuE,CAAA;IACvE,wGAAwG;IACxG,6DAAqC,CAAA;IACrC,+DAAuC,CAAA;IACvC,+CAAuB,CAAA;IACvB,iDAAyB,CAAA;IACzB;;;;;;;;OAQG;IACH,uEAA+C,C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AAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC;gBACX,UAAU,EAAE,oBAAoB,CAAC,UAAU;gBAC3C,IAAI,EAAE,oBAAoB,CAAC,WAAW;gBACtC,SAAS;gBACT,OAAO,EAAE,SAAS;gBAClB,MAAM,EAAE,UAAU,SAAS,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,iEAAiE;aACrI,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC;gBACX,UAAU,EAAE,oBAAoB,CAAC,SAAS;gBAC1C,IAAI,EAAE,oBAAoB,CAAC,IAAI;gBAC/B,SAAS;gBACT,OAAO,EAAE,SAAS;gBAClB,MAAM,EAAE,cAAc,SAAS,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,YAAY;aACnF,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,MAAM,IAAI,KAAK;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * The schema-plan DIFFER — pure comparison of two lockfile states into a typed change set.\n *\n * ## What this is and is not\n *\n * `diffSchemaPlanLockfiles(previous, next)` answers ONE question: what physical changes separate\n * the accepted schema from the current one. It renders no SQL, touches no database, and decides no\n * policy beyond the RISK classification each change carries. Generation (Phase 2) consumes its\n * output; `wildo db diff` prints it; `--check` fails CI when it is non-empty.\n *\n * ## Why index changes are DROP+ADD pairs rather than a \"changed\" member\n *\n * Physically, every index-semantics change (nulls distinctness, a `skipRowsMissing` predicate, the\n * retention scope) IS a drop and a recreate — PostgreSQL cannot alter an index's predicate in\n * place. Modelling them as pairs keeps the vocabulary honest to what a migration must actually do,\n * and it falls out of identity: an index's IDENTITY here includes its semantics, so a semantics\n * change makes the old identity disappear and a new one appear. (This deviates from the plan's\n * first-draft vocabulary, which sketched a `CHANGE_UNIQUE_SEMANTICS` member — recorded in the plan's\n * decision log.)\n *\n * `CHANGE_COLUMN_TYPE` stays a single member because it is the one change that is genuinely an\n * in-place `ALTER … USING` with data flowing through the cast — a pair would misrepresent it as\n * data loss.\n *\n * ## The variantConfig moves\n *\n * A column that disappears while joining the variant-swept set has NOT been deleted — its values\n * move INTO the `variantConfig` jsonb blob (and mirrored for the way out). The bare physical diff\n * reads as ADD/DROP_COLUMN, and acting on that read silently loses the data inside the blob. The\n * swept set travels in the lockfile precisely so this classification is a set lookup here rather\n * than an unanswerable question at generation time.\n */\n\nimport type { SchemaPlanLockfile, SerializedColumnPlan, SerializedTablePlan } from '~wildo-backend-lib/databases/services/postgresql-schema-plan-lockfile.backend';\n\n/**\n * The closed change vocabulary. Every member is a physical statement about the schema; the enum is\n * where per-member meaning lives (repo rule: closed semantic vocabularies get one named runtime\n * source).\n */\nexport enum SchemaPlanChangeType {\n ADD_TABLE = 'ADD_TABLE',\n /** The whole table, and everything in it. Always {@link SchemaPlanChangeRisk.DESTRUCTIVE}. */\n DROP_TABLE = 'DROP_TABLE',\n ADD_COLUMN = 'ADD_COLUMN',\n /** A column with (potential) data. Always DESTRUCTIVE — the differ cannot see whether rows exist. */\n DROP_COLUMN = 'DROP_COLUMN',\n /**\n * In-place `ALTER … TYPE … USING`. REQUIRES_DATA_MIGRATION: the `USING` expression is where\n * truncation and coercion live, and no diff can author it — a human writes it in the draft.\n */\n CHANGE_COLUMN_TYPE = 'CHANGE_COLUMN_TYPE',\n /**\n * The column's PRIMARY-KEY role changed. Physically enormous (constraint rebuild, every FK that\n * references it); practically forbidden without a hand-authored plan, hence\n * REQUIRES_DATA_MIGRATION rather than a bare pair of index changes.\n */\n CHANGE_PRIMARY_KEY = 'CHANGE_PRIMARY_KEY',\n /**\n * The table had NO primary key at all, and a column now becomes it.\n *\n * Deliberately NOT {@link CHANGE_PRIMARY_KEY}: nothing can reference a constraint that does not\n * exist, so there is no rebuild, no dependent foreign key, and no other column losing the role.\n * The statement is fully derivable from the plan, so the generator RENDERS it.\n *\n * The distinction was measured on 2026-08-28. Three tables (`consumabletokens`, `jobexecutions`,\n * `jobpayloadstorage`) shipped with a bare `\"_id\" text` — the adapter-parity hole since fixed in\n * `zod-to-sql-hybrid-schema.planner.ts` — and the blanket refusal meant a whole migration had to\n * be hand-authored, including the unrelated `ADD_TABLE` travelling with it, for SQL the renderer\n * could have written. A refusal calibrated for the dangerous case was paid for by the safe one.\n *\n * SAFE by the vocabulary above: it loses nothing. It may still FAIL loudly on a table already\n * holding NULL or duplicate values in that column — the same trade {@link ADD_UNIQUE_INDEX}\n * makes, and precisely the state the missing constraint had been permitting.\n */\n ADD_PRIMARY_KEY = 'ADD_PRIMARY_KEY',\n /**\n * NOT a drop: the field's values move INTO the `variantConfig` jsonb blob. The generated draft\n * must inject each row's column value into the blob BEFORE the column goes away.\n */\n FIELD_MOVED_INTO_VARIANT_CONFIG = 'FIELD_MOVED_INTO_VARIANT_CONFIG',\n /** The mirror: values must be extracted from the blob into the new column. */\n FIELD_MOVED_OUT_OF_VARIANT_CONFIG = 'FIELD_MOVED_OUT_OF_VARIANT_CONFIG',\n /** May FAIL on existing duplicates — stated in the detail; still SAFE (fails loudly, loses nothing). */\n ADD_UNIQUE_INDEX = 'ADD_UNIQUE_INDEX',\n DROP_UNIQUE_INDEX = 'DROP_UNIQUE_INDEX',\n ADD_INDEX = 'ADD_INDEX',\n DROP_INDEX = 'DROP_INDEX',\n /**\n * The column's `DEFAULT` was added, removed, or changed.\n *\n * SAFE: `ALTER COLUMN … SET/DROP DEFAULT` is a catalog-only change that rewrites no rows and\n * cannot fail on existing data. It is deliberately NOT retro-active — existing rows keep whatever\n * they already hold, including the NULLs written before the default existed. A migration that\n * also wants to backfill those rows must say so itself; inferring an `UPDATE` from a default\n * change would silently rewrite data the differ cannot see.\n */\n CHANGE_COLUMN_DEFAULT = 'CHANGE_COLUMN_DEFAULT',\n /** Renders as a column comment + drives the retention sweep; physical enough to be tracked. */\n ADD_TTL_POLICY = 'ADD_TTL_POLICY',\n DROP_TTL_POLICY = 'DROP_TTL_POLICY',\n CHANGE_TTL_POLICY = 'CHANGE_TTL_POLICY',\n}\n\n/**\n * @wildo_source:part:start application.database.migration-change-risk facet:layer:backend facet:family:database facet:audience:app-developer\n *\n * What a change can COST, not how likely it is to fail.\n *\n * - SAFE: loses no data. May still fail loudly at apply time (a unique index over duplicates) —\n * loud failure is acceptable, silent loss is not, and the vocabulary encodes exactly that line.\n * - DESTRUCTIVE: removes data. The runner refuses these without the file-level acknowledgement\n * (`-- wildo:acknowledge-destructive`), per K5/Phase 3′.\n * - REQUIRES_DATA_MIGRATION: correct only if data MOVES — a human must author the movement in the\n * generated draft before first apply.\n */\nexport enum SchemaPlanChangeRisk {\n SAFE = 'SAFE',\n DESTRUCTIVE = 'DESTRUCTIVE',\n REQUIRES_DATA_MIGRATION = 'REQUIRES_DATA_MIGRATION',\n}\n/**\n * @wildo_source:part:end application.database.migration-change-risk\n *\n * These three words are what `wildo db diff` prints beside every change and what the generated\n * `migration.sql` writes above every statement, so an application developer reads them constantly.\n * They also decide what tooling will do UNATTENDED: `wildo local dev` reconciles an all-SAFE change\n * set on its own, and stops for anything else — because a DESTRUCTIVE statement removes rows and a\n * REQUIRES_DATA_MIGRATION statement is a generated SKELETON whose correctness is a judgement about\n * data no differ can see.\n */\n\nexport interface SchemaPlanChange {\n changeType: SchemaPlanChangeType;\n risk: SchemaPlanChangeRisk;\n tableName: string;\n /** The column, the index's column list, or the TTL field — what the change is ABOUT. */\n subject: string;\n /** One human sentence with the before→after facts a reviewer needs. */\n detail: string;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Index identity\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface UniqueIndexIdentity {\n columns: readonly string[];\n nullsAreDistinct: boolean;\n skipRowsMissing: readonly string[];\n retentionScoped: boolean;\n}\n\n/**\n * Everything that changes what the index MEANS is part of its identity — which is what turns a\n * semantics change into a drop+add pair (see the header). The retention scope is table-level in the\n * plan but per-index in the physical schema (every unique index carries the predicate), so it joins\n * each identity here and a table-level flip correctly fans out into one pair per unique index.\n */\nfunction uniqueIndexIdentityKey(identity: UniqueIndexIdentity): string {\n return [\n identity.columns.join(','),\n `nullsDistinct:${identity.nullsAreDistinct}`,\n `skip:${[...identity.skipRowsMissing].sort().join(',')}`,\n `retentionScoped:${identity.retentionScoped}`,\n ].join('|');\n}\n\nfunction collectUniqueIndexIdentities(table: SerializedTablePlan): Map<string, UniqueIndexIdentity> {\n const retentionScoped = table.uniquenessExcludesErasureRetainedRows === true;\n const identities = new Map<string, UniqueIndexIdentity>();\n for (const [name, column] of Object.entries(table.columns)) {\n if (!column.unique) continue;\n const identity: UniqueIndexIdentity = {\n columns: [name],\n nullsAreDistinct: column.unique.nullsAreDistinct,\n skipRowsMissing: [],\n retentionScoped,\n };\n identities.set(uniqueIndexIdentityKey(identity), identity);\n }\n for (const constraint of table.compositeUniqueConstraints ?? []) {\n const identity: UniqueIndexIdentity = {\n columns: constraint.fields,\n // Composite constraints always render NULLS NOT DISTINCT (the ORGANIZATION_UNITS lesson).\n nullsAreDistinct: false,\n skipRowsMissing: constraint.skipRowsMissing ?? [],\n retentionScoped,\n };\n identities.set(uniqueIndexIdentityKey(identity), identity);\n }\n return identities;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// The diff\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction diffTable(tableName: string, previous: SerializedTablePlan, next: SerializedTablePlan): SchemaPlanChange[] {\n const changes: SchemaPlanChange[] = [];\n const previousSwept = new Set(previous.variantSweptFields ?? []);\n /**\n * Asked of the WHOLE table, not of the column, because that is what separates an ADD from a MOVE.\n * A column gaining the role while some other column held it is a rebuild every reference leans\n * on; a column gaining it while the table had none is additive, and the two must not share a\n * change type — see {@link SchemaPlanChangeType.ADD_PRIMARY_KEY}.\n */\n const previousHadPrimaryKey = Object.values(previous.columns).some((column) => column.isPrimaryKey === true);\n const nextSwept = new Set(next.variantSweptFields ?? []);\n const columnNames = [...new Set([...Object.keys(previous.columns), ...Object.keys(next.columns)])].sort();\n\n for (const name of columnNames) {\n const before: SerializedColumnPlan | undefined = previous.columns[name];\n const after: SerializedColumnPlan | undefined = next.columns[name];\n\n if (before && !after) {\n if (nextSwept.has(name)) {\n changes.push({\n changeType: SchemaPlanChangeType.FIELD_MOVED_INTO_VARIANT_CONFIG,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" is now variant-only: its values must be INJECTED into the \"variantConfig\" jsonb blob before the column is dropped — a bare drop silently loses them.`,\n });\n } else {\n changes.push({\n changeType: SchemaPlanChangeType.DROP_COLUMN,\n risk: SchemaPlanChangeRisk.DESTRUCTIVE,\n tableName,\n subject: name,\n detail: `column \"${name}\" (${before.sqlType}) is no longer planned; dropping it destroys whatever rows hold there.`,\n });\n }\n continue;\n }\n if (!before && after) {\n if (previousSwept.has(name)) {\n changes.push({\n changeType: SchemaPlanChangeType.FIELD_MOVED_OUT_OF_VARIANT_CONFIG,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" was variant-only: existing values live inside the \"variantConfig\" jsonb blob and must be EXTRACTED into the new \"${after.sqlType}\" column, or every pre-existing row reads NULL.`,\n });\n } else {\n changes.push({\n changeType: SchemaPlanChangeType.ADD_COLUMN,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail: `new column \"${name}\" ${after.sqlType}.`,\n });\n }\n continue;\n }\n if (!before || !after) continue;\n\n if (before.sqlType !== after.sqlType) {\n changes.push({\n changeType: SchemaPlanChangeType.CHANGE_COLUMN_TYPE,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" ${before.sqlType} → ${after.sqlType}; the USING expression decides what existing values become, and only a human can decide it.`,\n });\n }\n if ((before.defaultClause ?? '') !== (after.defaultClause ?? '')) {\n const describe = (clause: string | undefined): string =>\n clause ? clause.replace(/^ default /, '') : 'none';\n changes.push({\n changeType: SchemaPlanChangeType.CHANGE_COLUMN_DEFAULT,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail:\n `\"${name}\" default ${describe(before.defaultClause)} → ${describe(after.defaultClause)}; `\n + 'applies to NEW rows only — existing rows keep the values they already hold.',\n });\n }\n if ((before.isPrimaryKey === true) !== (after.isPrimaryKey === true)) {\n changes.push(after.isPrimaryKey === true && !previousHadPrimaryKey\n ? {\n changeType: SchemaPlanChangeType.ADD_PRIMARY_KEY,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail: `\"${name}\" becomes the primary key of a table that had none — additive, so nothing references the constraint being built. May FAIL on rows already holding a NULL or duplicate \"${name}\", which is the state its absence permitted.`,\n }\n : {\n changeType: SchemaPlanChangeType.CHANGE_PRIMARY_KEY,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" ${after.isPrimaryKey ? 'becomes' : 'stops being'} the primary key — a constraint rebuild that touches every reference to this table; hand-author the plan.`,\n });\n }\n if ((before.hasIndex === true) !== (after.hasIndex === true)) {\n changes.push(after.hasIndex\n ? { changeType: SchemaPlanChangeType.ADD_INDEX, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: name, detail: `plain index on \"${name}\".` }\n : { changeType: SchemaPlanChangeType.DROP_INDEX, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: name, detail: `plain index on \"${name}\" is no longer planned.` });\n }\n }\n\n // Unique indexes — identity-keyed, so a semantics change appears as its own drop+add pair.\n const previousUnique = collectUniqueIndexIdentities(previous);\n const nextUnique = collectUniqueIndexIdentities(next);\n for (const [key, identity] of [...previousUnique].sort(([a], [b]) => a.localeCompare(b))) {\n if (nextUnique.has(key)) continue;\n changes.push({\n changeType: SchemaPlanChangeType.DROP_UNIQUE_INDEX,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: identity.columns.join(', '),\n detail: `unique index on (${identity.columns.join(', ')}) [nullsDistinct=${identity.nullsAreDistinct}, skip=[${identity.skipRowsMissing.join(', ')}], retentionScoped=${identity.retentionScoped}] is gone or changed semantics.`,\n });\n }\n for (const [key, identity] of [...nextUnique].sort(([a], [b]) => a.localeCompare(b))) {\n if (previousUnique.has(key)) continue;\n changes.push({\n changeType: SchemaPlanChangeType.ADD_UNIQUE_INDEX,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: identity.columns.join(', '),\n detail: `unique index on (${identity.columns.join(', ')}) [nullsDistinct=${identity.nullsAreDistinct}, skip=[${identity.skipRowsMissing.join(', ')}], retentionScoped=${identity.retentionScoped}]; applying FAILS LOUDLY if existing rows already violate it — resolve duplicates first.`,\n });\n }\n\n // TTL policies, keyed by field.\n const previousTtl = new Map((previous.ttlPolicies ?? []).map((policy) => [policy.fieldName, policy.expireAfterSeconds]));\n const nextTtl = new Map((next.ttlPolicies ?? []).map((policy) => [policy.fieldName, policy.expireAfterSeconds]));\n for (const [fieldName, seconds] of [...previousTtl].sort(([a], [b]) => a.localeCompare(b))) {\n if (!nextTtl.has(fieldName)) {\n changes.push({ changeType: SchemaPlanChangeType.DROP_TTL_POLICY, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: fieldName, detail: `rows no longer expire via \"${fieldName}\" (${seconds}s).` });\n } else if (nextTtl.get(fieldName) !== seconds) {\n changes.push({ changeType: SchemaPlanChangeType.CHANGE_TTL_POLICY, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: fieldName, detail: `retention window on \"${fieldName}\": ${seconds}s → ${nextTtl.get(fieldName)}s.` });\n }\n }\n for (const [fieldName, seconds] of [...nextTtl].sort(([a], [b]) => a.localeCompare(b))) {\n if (!previousTtl.has(fieldName)) {\n changes.push({ changeType: SchemaPlanChangeType.ADD_TTL_POLICY, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: fieldName, detail: `rows expire ${seconds === 0 ? `when \"${fieldName}\" passes` : `${seconds}s after \"${fieldName}\"`} (enforced by the framework sweep).` });\n }\n }\n\n return changes;\n}\n\n/**\n * Compare two lockfiles. Pure and deterministic: same inputs, same output, in a stable order\n * (tables sorted, columns sorted, index identities sorted) — determinism is what makes the output\n * reviewable and the `--check` comparison meaningful.\n *\n * The planner-contract version is deliberately NOT compared here: a mismatch is not a schema\n * change, it is a different STATE with its own workflow (Phase 4). Callers check it before diffing.\n */\nexport function diffSchemaPlanLockfiles(previous: SchemaPlanLockfile, next: SchemaPlanLockfile): SchemaPlanChange[] {\n const changes: SchemaPlanChange[] = [];\n const tableNames = [...new Set([...Object.keys(previous.tables), ...Object.keys(next.tables)])].sort();\n\n for (const tableName of tableNames) {\n const before = previous.tables[tableName];\n const after = next.tables[tableName];\n if (before && !after) {\n changes.push({\n changeType: SchemaPlanChangeType.DROP_TABLE,\n risk: SchemaPlanChangeRisk.DESTRUCTIVE,\n tableName,\n subject: tableName,\n detail: `table \"${tableName}\" (${Object.keys(before.columns).length} columns) is no longer planned; dropping it destroys every row.`,\n });\n continue;\n }\n if (!before && after) {\n changes.push({\n changeType: SchemaPlanChangeType.ADD_TABLE,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: tableName,\n detail: `new table \"${tableName}\" (${Object.keys(after.columns).length} columns).`,\n });\n continue;\n }\n if (before && after) changes.push(...diffTable(tableName, before, after));\n }\n\n return changes;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"postgresql-schema-plan-diff.backend.js","sourceRoot":"","sources":["../../../../../src/databases/services/postgresql-schema-plan-diff.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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I,UAAU,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC;gBACX,UAAU,EAAE,oBAAoB,CAAC,UAAU;gBAC3C,IAAI,EAAE,oBAAoB,CAAC,WAAW;gBACtC,SAAS;gBACT,OAAO,EAAE,SAAS;gBAClB,MAAM,EAAE,UAAU,SAAS,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,iEAAiE;aACrI,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC;gBACX,UAAU,EAAE,oBAAoB,CAAC,SAAS;gBAC1C,IAAI,EAAE,oBAAoB,CAAC,IAAI;gBAC/B,SAAS;gBACT,OAAO,EAAE,SAAS;gBAClB,MAAM,EAAE,cAAc,SAAS,MAAM,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,YAAY;aACnF,CAAC,CAAC;YACH,SAAS;QACX,CAAC;QACD,IAAI,MAAM,IAAI,KAAK;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n * The schema-plan DIFFER — pure comparison of two lockfile states into a typed change set.\n *\n * ## What this is and is not\n *\n * `diffSchemaPlanLockfiles(previous, next)` answers ONE question: what physical changes separate\n * the accepted schema from the current one. It renders no SQL, touches no database, and decides no\n * policy beyond the RISK classification each change carries. Generation (Phase 2) consumes its\n * output; `wildo db diff` prints it; `--check` fails CI when it is non-empty.\n *\n * ## Why index changes are DROP+ADD pairs rather than a \"changed\" member\n *\n * Physically, every index-semantics change (nulls distinctness, a `skipRowsMissing` predicate, the\n * retention scope) IS a drop and a recreate — PostgreSQL cannot alter an index's predicate in\n * place. Modelling them as pairs keeps the vocabulary honest to what a migration must actually do,\n * and it falls out of identity: an index's IDENTITY here includes its semantics, so a semantics\n * change makes the old identity disappear and a new one appear. (This deviates from the plan's\n * first-draft vocabulary, which sketched a `CHANGE_UNIQUE_SEMANTICS` member — recorded in the plan's\n * decision log.)\n *\n * `CHANGE_COLUMN_TYPE` stays a single member because it is the one change that is genuinely an\n * in-place `ALTER … USING` with data flowing through the cast — a pair would misrepresent it as\n * data loss.\n *\n * ## The variantConfig moves\n *\n * A column that disappears while joining the variant-swept set has NOT been deleted — its values\n * move INTO the `variantConfig` jsonb blob (and mirrored for the way out). The bare physical diff\n * reads as ADD/DROP_COLUMN, and acting on that read silently loses the data inside the blob. The\n * swept set travels in the lockfile precisely so this classification is a set lookup here rather\n * than an unanswerable question at generation time.\n */\n\nimport type { SchemaPlanLockfile, SerializedColumnPlan, SerializedTablePlan } from '~wildo-backend-lib/databases/services/postgresql-schema-plan-lockfile.backend';\n\n/**\n * The closed change vocabulary. Every member is a physical statement about the schema; the enum is\n * where per-member meaning lives (repo rule: closed semantic vocabularies get one named runtime\n * source).\n */\nexport enum SchemaPlanChangeType {\n ADD_TABLE = 'ADD_TABLE',\n /** The whole table, and everything in it. Always {@link SchemaPlanChangeRisk.DESTRUCTIVE}. */\n DROP_TABLE = 'DROP_TABLE',\n ADD_COLUMN = 'ADD_COLUMN',\n /** A column with (potential) data. Always DESTRUCTIVE — the differ cannot see whether rows exist. */\n DROP_COLUMN = 'DROP_COLUMN',\n /**\n * In-place `ALTER … TYPE … USING`. REQUIRES_DATA_MIGRATION: the `USING` expression is where\n * truncation and coercion live, and no diff can author it — a human writes it in the draft.\n */\n CHANGE_COLUMN_TYPE = 'CHANGE_COLUMN_TYPE',\n /**\n * The column's PRIMARY-KEY role changed. Physically enormous (constraint rebuild, every FK that\n * references it); practically forbidden without a hand-authored plan, hence\n * REQUIRES_DATA_MIGRATION rather than a bare pair of index changes.\n */\n CHANGE_PRIMARY_KEY = 'CHANGE_PRIMARY_KEY',\n /**\n * The table had NO primary key at all, and a column now becomes it.\n *\n * Deliberately NOT {@link CHANGE_PRIMARY_KEY}: nothing can reference a constraint that does not\n * exist, so there is no rebuild, no dependent foreign key, and no other column losing the role.\n * The statement is fully derivable from the plan, so the generator RENDERS it.\n *\n * The distinction was measured on 2026-08-28. Three tables (`consumabletokens`, `jobexecutions`,\n * `jobpayloadstorage`) shipped with a bare `\"_id\" text` — the adapter-parity hole since fixed in\n * `zod-to-sql-hybrid-schema.planner.ts` — and the blanket refusal meant a whole migration had to\n * be hand-authored, including the unrelated `ADD_TABLE` travelling with it, for SQL the renderer\n * could have written. A refusal calibrated for the dangerous case was paid for by the safe one.\n *\n * SAFE by the vocabulary above: it loses nothing. It may still FAIL loudly on a table already\n * holding NULL or duplicate values in that column — the same trade {@link ADD_UNIQUE_INDEX}\n * makes, and precisely the state the missing constraint had been permitting.\n */\n ADD_PRIMARY_KEY = 'ADD_PRIMARY_KEY',\n /**\n * NOT a drop: the field's values move INTO the `variantConfig` jsonb blob. The generated draft\n * must inject each row's column value into the blob BEFORE the column goes away.\n */\n FIELD_MOVED_INTO_VARIANT_CONFIG = 'FIELD_MOVED_INTO_VARIANT_CONFIG',\n /** The mirror: values must be extracted from the blob into the new column. */\n FIELD_MOVED_OUT_OF_VARIANT_CONFIG = 'FIELD_MOVED_OUT_OF_VARIANT_CONFIG',\n /** May FAIL on existing duplicates — stated in the detail; still SAFE (fails loudly, loses nothing). */\n ADD_UNIQUE_INDEX = 'ADD_UNIQUE_INDEX',\n DROP_UNIQUE_INDEX = 'DROP_UNIQUE_INDEX',\n ADD_INDEX = 'ADD_INDEX',\n DROP_INDEX = 'DROP_INDEX',\n /**\n * The column's `DEFAULT` was added, removed, or changed.\n *\n * SAFE: `ALTER COLUMN … SET/DROP DEFAULT` is a catalog-only change that rewrites no rows and\n * cannot fail on existing data. It is deliberately NOT retro-active — existing rows keep whatever\n * they already hold, including the NULLs written before the default existed. A migration that\n * also wants to backfill those rows must say so itself; inferring an `UPDATE` from a default\n * change would silently rewrite data the differ cannot see.\n */\n CHANGE_COLUMN_DEFAULT = 'CHANGE_COLUMN_DEFAULT',\n /** Renders as a column comment + drives the retention sweep; physical enough to be tracked. */\n ADD_TTL_POLICY = 'ADD_TTL_POLICY',\n DROP_TTL_POLICY = 'DROP_TTL_POLICY',\n CHANGE_TTL_POLICY = 'CHANGE_TTL_POLICY',\n}\n\n/**\n * @wildo_source:part:start application.database.migration-change-risk facet:layer:backend facet:family:database facet:audience:app-developer\n *\n * What a change can COST, not how likely it is to fail.\n *\n * - SAFE: loses no data. May still fail loudly at apply time (a unique index over duplicates) —\n * loud failure is acceptable, silent loss is not, and the vocabulary encodes exactly that line.\n * - DESTRUCTIVE: removes data. The runner refuses these without the file-level acknowledgement\n * (`-- wildo:acknowledge-destructive`), per K5/Phase 3′.\n * - REQUIRES_DATA_MIGRATION: correct only if data MOVES — a human must author the movement in the\n * generated draft before first apply.\n */\nexport enum SchemaPlanChangeRisk {\n SAFE = 'SAFE',\n DESTRUCTIVE = 'DESTRUCTIVE',\n REQUIRES_DATA_MIGRATION = 'REQUIRES_DATA_MIGRATION',\n}\n/**\n * @wildo_source:part:end application.database.migration-change-risk\n *\n * These three words are what `wildo db diff` prints beside every change and what the generated\n * `migration.sql` writes above every statement, so an application developer reads them constantly.\n * They also decide what tooling will do UNATTENDED: `wildo local dev` reconciles an all-SAFE change\n * set on its own, and stops for anything else — because a DESTRUCTIVE statement removes rows and a\n * REQUIRES_DATA_MIGRATION statement is a generated SKELETON whose correctness is a judgement about\n * data no differ can see.\n */\n\nexport interface SchemaPlanChange {\n changeType: SchemaPlanChangeType;\n risk: SchemaPlanChangeRisk;\n tableName: string;\n /** The column, the index's column list, or the TTL field — what the change is ABOUT. */\n subject: string;\n /** One human sentence with the before→after facts a reviewer needs. */\n detail: string;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Index identity\n// ─────────────────────────────────────────────────────────────────────────────\n\ninterface UniqueIndexIdentity {\n columns: readonly string[];\n nullsAreDistinct: boolean;\n skipRowsMissing: readonly string[];\n retentionScoped: boolean;\n}\n\n/**\n * Everything that changes what the index MEANS is part of its identity — which is what turns a\n * semantics change into a drop+add pair (see the header). The retention scope is table-level in the\n * plan but per-index in the physical schema (every unique index carries the predicate), so it joins\n * each identity here and a table-level flip correctly fans out into one pair per unique index.\n */\nfunction uniqueIndexIdentityKey(identity: UniqueIndexIdentity): string {\n return [\n identity.columns.join(','),\n `nullsDistinct:${identity.nullsAreDistinct}`,\n `skip:${[...identity.skipRowsMissing].sort().join(',')}`,\n `retentionScoped:${identity.retentionScoped}`,\n ].join('|');\n}\n\nfunction collectUniqueIndexIdentities(table: SerializedTablePlan): Map<string, UniqueIndexIdentity> {\n const retentionScoped = table.uniquenessExcludesErasureRetainedRows === true;\n const identities = new Map<string, UniqueIndexIdentity>();\n for (const [name, column] of Object.entries(table.columns)) {\n if (!column.unique) continue;\n const identity: UniqueIndexIdentity = {\n columns: [name],\n nullsAreDistinct: column.unique.nullsAreDistinct,\n skipRowsMissing: [],\n retentionScoped,\n };\n identities.set(uniqueIndexIdentityKey(identity), identity);\n }\n for (const constraint of table.compositeUniqueConstraints ?? []) {\n const identity: UniqueIndexIdentity = {\n columns: constraint.fields,\n // Composite constraints always render NULLS NOT DISTINCT (the ORGANIZATION_UNITS lesson).\n nullsAreDistinct: false,\n skipRowsMissing: constraint.skipRowsMissing ?? [],\n retentionScoped,\n };\n identities.set(uniqueIndexIdentityKey(identity), identity);\n }\n return identities;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// The diff\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction diffTable(tableName: string, previous: SerializedTablePlan, next: SerializedTablePlan): SchemaPlanChange[] {\n const changes: SchemaPlanChange[] = [];\n const previousSwept = new Set(previous.variantSweptFields ?? []);\n /**\n * Asked of the WHOLE table, not of the column, because that is what separates an ADD from a MOVE.\n * A column gaining the role while some other column held it is a rebuild every reference leans\n * on; a column gaining it while the table had none is additive, and the two must not share a\n * change type — see {@link SchemaPlanChangeType.ADD_PRIMARY_KEY}.\n */\n const previousHadPrimaryKey = Object.values(previous.columns).some((column) => column.isPrimaryKey === true);\n const nextSwept = new Set(next.variantSweptFields ?? []);\n const columnNames = [...new Set([...Object.keys(previous.columns), ...Object.keys(next.columns)])].sort();\n\n for (const name of columnNames) {\n const before: SerializedColumnPlan | undefined = previous.columns[name];\n const after: SerializedColumnPlan | undefined = next.columns[name];\n\n if (before && !after) {\n if (nextSwept.has(name)) {\n changes.push({\n changeType: SchemaPlanChangeType.FIELD_MOVED_INTO_VARIANT_CONFIG,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" is now variant-only: its values must be INJECTED into the \"variantConfig\" jsonb blob before the column is dropped — a bare drop silently loses them.`,\n });\n } else {\n changes.push({\n changeType: SchemaPlanChangeType.DROP_COLUMN,\n risk: SchemaPlanChangeRisk.DESTRUCTIVE,\n tableName,\n subject: name,\n detail: `column \"${name}\" (${before.sqlType}) is no longer planned; dropping it destroys whatever rows hold there.`,\n });\n }\n continue;\n }\n if (!before && after) {\n if (previousSwept.has(name)) {\n changes.push({\n changeType: SchemaPlanChangeType.FIELD_MOVED_OUT_OF_VARIANT_CONFIG,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" was variant-only: existing values live inside the \"variantConfig\" jsonb blob and must be EXTRACTED into the new \"${after.sqlType}\" column, or every pre-existing row reads NULL.`,\n });\n } else {\n changes.push({\n changeType: SchemaPlanChangeType.ADD_COLUMN,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail: `new column \"${name}\" ${after.sqlType}.`,\n });\n }\n /*\n * A column ARRIVES with the properties it was declared with (#505).\n *\n * Everything below this point compares `before` against `after`, so it is reachable only for a\n * column that already existed — and a NEW column `continue`s past all of it. That silently made\n * `.isDBIndexed()` a no-op on any field added to an EXISTING table: the differ emitted\n * `ADD_COLUMN` alone, so the database permanently lacked an index the schema declared.\n *\n * The initial-schema path was never affected, which is why this survived: `CREATE TABLE`\n * renders every declared index, so the planner plainly knows how. What it did not do was carry\n * the declaration through the DELTA path.\n *\n * Worse than the missing index was the silence around it. `db diff --check` compares the plan\n * to the lockfile, and BOTH record `hasIndex: true` — the lockfile is written from the same\n * plan — so the check was wrong in the same direction as the thing it checks and reported IN\n * SYNC over a database missing the index. Measured 2026-09-08 on two `oauthClients` tables: the\n * application generator emitted 4 statements, the platform generator 8, from one schema.\n *\n * The primary-key case is included on the same reasoning rather than on symmetry: a new column\n * declared `isPrimaryKey` on a table that has none is additive and renderable, and skipping it\n * left exactly the same gap one property over.\n */\n if (after.hasIndex === true) {\n changes.push({\n changeType: SchemaPlanChangeType.ADD_INDEX,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail: `plain index on the new column \"${name}\".`,\n });\n }\n if (after.isPrimaryKey === true) {\n changes.push(previousHadPrimaryKey\n ? {\n changeType: SchemaPlanChangeType.CHANGE_PRIMARY_KEY,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `the new column \"${name}\" is declared the primary key of a table that already has one — a constraint rebuild that touches every reference to this table; hand-author the plan.`,\n }\n : {\n changeType: SchemaPlanChangeType.ADD_PRIMARY_KEY,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail: `the new column \"${name}\" becomes the primary key of a table that had none. Additive, so nothing references the constraint being built — but it WILL fail on any existing row, since a column that has just arrived holds NULL in every one of them.`,\n });\n }\n continue;\n }\n if (!before || !after) continue;\n\n if (before.sqlType !== after.sqlType) {\n changes.push({\n changeType: SchemaPlanChangeType.CHANGE_COLUMN_TYPE,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" ${before.sqlType} → ${after.sqlType}; the USING expression decides what existing values become, and only a human can decide it.`,\n });\n }\n if ((before.defaultClause ?? '') !== (after.defaultClause ?? '')) {\n const describe = (clause: string | undefined): string =>\n clause ? clause.replace(/^ default /, '') : 'none';\n changes.push({\n changeType: SchemaPlanChangeType.CHANGE_COLUMN_DEFAULT,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail:\n `\"${name}\" default ${describe(before.defaultClause)} → ${describe(after.defaultClause)}; `\n + 'applies to NEW rows only — existing rows keep the values they already hold.',\n });\n }\n if ((before.isPrimaryKey === true) !== (after.isPrimaryKey === true)) {\n changes.push(after.isPrimaryKey === true && !previousHadPrimaryKey\n ? {\n changeType: SchemaPlanChangeType.ADD_PRIMARY_KEY,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: name,\n detail: `\"${name}\" becomes the primary key of a table that had none — additive, so nothing references the constraint being built. May FAIL on rows already holding a NULL or duplicate \"${name}\", which is the state its absence permitted.`,\n }\n : {\n changeType: SchemaPlanChangeType.CHANGE_PRIMARY_KEY,\n risk: SchemaPlanChangeRisk.REQUIRES_DATA_MIGRATION,\n tableName,\n subject: name,\n detail: `\"${name}\" ${after.isPrimaryKey ? 'becomes' : 'stops being'} the primary key — a constraint rebuild that touches every reference to this table; hand-author the plan.`,\n });\n }\n if ((before.hasIndex === true) !== (after.hasIndex === true)) {\n changes.push(after.hasIndex\n ? { changeType: SchemaPlanChangeType.ADD_INDEX, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: name, detail: `plain index on \"${name}\".` }\n : { changeType: SchemaPlanChangeType.DROP_INDEX, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: name, detail: `plain index on \"${name}\" is no longer planned.` });\n }\n }\n\n // Unique indexes — identity-keyed, so a semantics change appears as its own drop+add pair.\n const previousUnique = collectUniqueIndexIdentities(previous);\n const nextUnique = collectUniqueIndexIdentities(next);\n for (const [key, identity] of [...previousUnique].sort(([a], [b]) => a.localeCompare(b))) {\n if (nextUnique.has(key)) continue;\n changes.push({\n changeType: SchemaPlanChangeType.DROP_UNIQUE_INDEX,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: identity.columns.join(', '),\n detail: `unique index on (${identity.columns.join(', ')}) [nullsDistinct=${identity.nullsAreDistinct}, skip=[${identity.skipRowsMissing.join(', ')}], retentionScoped=${identity.retentionScoped}] is gone or changed semantics.`,\n });\n }\n for (const [key, identity] of [...nextUnique].sort(([a], [b]) => a.localeCompare(b))) {\n if (previousUnique.has(key)) continue;\n changes.push({\n changeType: SchemaPlanChangeType.ADD_UNIQUE_INDEX,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: identity.columns.join(', '),\n detail: `unique index on (${identity.columns.join(', ')}) [nullsDistinct=${identity.nullsAreDistinct}, skip=[${identity.skipRowsMissing.join(', ')}], retentionScoped=${identity.retentionScoped}]; applying FAILS LOUDLY if existing rows already violate it — resolve duplicates first.`,\n });\n }\n\n // TTL policies, keyed by field.\n const previousTtl = new Map((previous.ttlPolicies ?? []).map((policy) => [policy.fieldName, policy.expireAfterSeconds]));\n const nextTtl = new Map((next.ttlPolicies ?? []).map((policy) => [policy.fieldName, policy.expireAfterSeconds]));\n for (const [fieldName, seconds] of [...previousTtl].sort(([a], [b]) => a.localeCompare(b))) {\n if (!nextTtl.has(fieldName)) {\n changes.push({ changeType: SchemaPlanChangeType.DROP_TTL_POLICY, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: fieldName, detail: `rows no longer expire via \"${fieldName}\" (${seconds}s).` });\n } else if (nextTtl.get(fieldName) !== seconds) {\n changes.push({ changeType: SchemaPlanChangeType.CHANGE_TTL_POLICY, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: fieldName, detail: `retention window on \"${fieldName}\": ${seconds}s → ${nextTtl.get(fieldName)}s.` });\n }\n }\n for (const [fieldName, seconds] of [...nextTtl].sort(([a], [b]) => a.localeCompare(b))) {\n if (!previousTtl.has(fieldName)) {\n changes.push({ changeType: SchemaPlanChangeType.ADD_TTL_POLICY, risk: SchemaPlanChangeRisk.SAFE, tableName, subject: fieldName, detail: `rows expire ${seconds === 0 ? `when \"${fieldName}\" passes` : `${seconds}s after \"${fieldName}\"`} (enforced by the framework sweep).` });\n }\n }\n\n return changes;\n}\n\n/**\n * Compare two lockfiles. Pure and deterministic: same inputs, same output, in a stable order\n * (tables sorted, columns sorted, index identities sorted) — determinism is what makes the output\n * reviewable and the `--check` comparison meaningful.\n *\n * The planner-contract version is deliberately NOT compared here: a mismatch is not a schema\n * change, it is a different STATE with its own workflow (Phase 4). Callers check it before diffing.\n */\nexport function diffSchemaPlanLockfiles(previous: SchemaPlanLockfile, next: SchemaPlanLockfile): SchemaPlanChange[] {\n const changes: SchemaPlanChange[] = [];\n const tableNames = [...new Set([...Object.keys(previous.tables), ...Object.keys(next.tables)])].sort();\n\n for (const tableName of tableNames) {\n const before = previous.tables[tableName];\n const after = next.tables[tableName];\n if (before && !after) {\n changes.push({\n changeType: SchemaPlanChangeType.DROP_TABLE,\n risk: SchemaPlanChangeRisk.DESTRUCTIVE,\n tableName,\n subject: tableName,\n detail: `table \"${tableName}\" (${Object.keys(before.columns).length} columns) is no longer planned; dropping it destroys every row.`,\n });\n continue;\n }\n if (!before && after) {\n changes.push({\n changeType: SchemaPlanChangeType.ADD_TABLE,\n risk: SchemaPlanChangeRisk.SAFE,\n tableName,\n subject: tableName,\n detail: `new table \"${tableName}\" (${Object.keys(after.columns).length} columns).`,\n });\n continue;\n }\n if (before && after) changes.push(...diffTable(tableName, before, after));\n }\n\n return changes;\n}\n"]}
|
|
@@ -46,7 +46,18 @@ export declare class ErrorBuilderBackendService {
|
|
|
46
46
|
*/
|
|
47
47
|
private extractFieldLevelValidationDetail;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* @wildo_source:part:start saas.backend.error-builder.user-guidance facet:layer:backend facet:audience:app-developer
|
|
50
|
+
*
|
|
51
|
+
* Build an error with contextual user guidance.
|
|
52
|
+
*
|
|
53
|
+
* Reach for this instead of a bare `buildError` whenever the person who hits the failure could DO
|
|
54
|
+
* something about it. A typed error tells a caller what went wrong; guidance tells a human what to
|
|
55
|
+
* do next, and the frontend renders it from `ErrorResponse.error.userGuidance`.
|
|
56
|
+
*
|
|
57
|
+
* ⚠️ **Prefer `buildErrorWithGuidanceKey`.** The strings you pass here are rendered verbatim, so a
|
|
58
|
+
* guidance written this way is English forever — the key variant resolves labels under
|
|
59
|
+
* `errors_guidance.{guidanceKey}.{field}` and is translated like every other user-facing string.
|
|
60
|
+
* Use the raw form only for a failure no user will read, or as the fallback beneath a key.
|
|
50
61
|
*
|
|
51
62
|
* The guidance is attached to the error and will be included in the
|
|
52
63
|
* `ErrorResponse.error.userGuidance` field for the frontend to render.
|
|
@@ -88,6 +99,7 @@ export declare class ErrorBuilderBackendService {
|
|
|
88
99
|
context?: Record<string, any>;
|
|
89
100
|
stack?: string;
|
|
90
101
|
}): WildoError_Backend;
|
|
102
|
+
/** @wildo_source:part:end saas.backend.error-builder.user-guidance */
|
|
91
103
|
wildoErrorToSimpleString(wildoError: any): string;
|
|
92
104
|
/**
|
|
93
105
|
* Sanitize an error for client-facing HTTP responses.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-builder.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/errors/services/error-builder.backend.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,kBAAkB,EAElB,kBAAkB,EAClB,2BAA2B,EAM3B,iBAAiB,EAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAGvG,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAI7F;;;GAGG;AACH,qBACa,0BAA0B;IAKA,OAAO,CAAC,MAAM;IAJnD,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAIpC,MAAM,EAAE,aAAa;IAMlE;;OAEG;IACI,UAAU,CACf,SAAS,EAAE,SAAS,EACpB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACxC,OAAO,GAAE;QACP,sBAAsB,CAAC,EAAE,2BAA2B,CAAC;QACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,sBAAsB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;KACnD,GACL,kBAAkB;IAkDd,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,OAAO,GAAE;QAC/F,sBAAsB,CAAC,EAAE,2BAA2B,CAAC;QACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,sBAAsB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;KACnD,GAAG,kBAAkB;IAsE3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,iCAAiC;IA6CzC
|
|
1
|
+
{"version":3,"file":"error-builder.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/errors/services/error-builder.backend.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,kBAAkB,EAElB,kBAAkB,EAClB,2BAA2B,EAM3B,iBAAiB,EAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAGvG,OAA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AAsB,CAAC,EAAE,2BAA2B,CAAC;QACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GACL,kBAAkB;IAMrB;;;;;;;;;;;OAWG;IACI,yBAAyB,CAC9B,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,SAAS,EACnD,WAAW,EAAE,MAAM,EACnB,QAAQ,GAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAM,EACrD,OAAO,GAAE;QACP,sBAAsB,CAAC,EAAE,2BAA2B,CAAC;QACrD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;KACX,GACL,kBAAkB;IAGrB,sEAAsE;IAE/D,wBAAwB,CAAC,UAAU,EAAE,GAAG,GAAG,MAAM;IAcxD;;;;;;;;OAQG;IACI,sBAAsB,CAAC,UAAU,EAAE,kBAAkB,GAAG,kBAAkB;YA2FnE,qBAAqB;IA4CnC;;OAEG;IACH,OAAO,CAAC,SAAS;IAIjB;;;OAGG;IACI,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS;CA+EnD"}
|
|
@@ -190,7 +190,18 @@ let ErrorBuilderBackendService = class ErrorBuilderBackendService {
|
|
|
190
190
|
return undefined;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
|
-
*
|
|
193
|
+
* @wildo_source:part:start saas.backend.error-builder.user-guidance facet:layer:backend facet:audience:app-developer
|
|
194
|
+
*
|
|
195
|
+
* Build an error with contextual user guidance.
|
|
196
|
+
*
|
|
197
|
+
* Reach for this instead of a bare `buildError` whenever the person who hits the failure could DO
|
|
198
|
+
* something about it. A typed error tells a caller what went wrong; guidance tells a human what to
|
|
199
|
+
* do next, and the frontend renders it from `ErrorResponse.error.userGuidance`.
|
|
200
|
+
*
|
|
201
|
+
* ⚠️ **Prefer `buildErrorWithGuidanceKey`.** The strings you pass here are rendered verbatim, so a
|
|
202
|
+
* guidance written this way is English forever — the key variant resolves labels under
|
|
203
|
+
* `errors_guidance.{guidanceKey}.{field}` and is translated like every other user-facing string.
|
|
204
|
+
* Use the raw form only for a failure no user will read, or as the fallback beneath a key.
|
|
194
205
|
*
|
|
195
206
|
* The guidance is attached to the error and will be included in the
|
|
196
207
|
* `ErrorResponse.error.userGuidance` field for the frontend to render.
|
|
@@ -230,6 +241,7 @@ let ErrorBuilderBackendService = class ErrorBuilderBackendService {
|
|
|
230
241
|
buildErrorWithGuidanceKey(errorType, executionContext, guidanceKey, guidance = {}, options = {}) {
|
|
231
242
|
return this.buildErrorWithGuidance(errorType, executionContext, { ...guidance, guidanceKey }, options);
|
|
232
243
|
}
|
|
244
|
+
/** @wildo_source:part:end saas.backend.error-builder.user-guidance */
|
|
233
245
|
wildoErrorToSimpleString(wildoError) {
|
|
234
246
|
const isWildoError = wildoError && typeof wildoError === 'object' && 'statusCode' in wildoError && 'backendActions' in wildoError;
|
|
235
247
|
if (!isWildoError) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-builder.backend.service.js","sourceRoot":"","sources":["../../../../../src/errors/services/error-builder.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,SAAS,EACT,kBAAkB,EAGlB,2BAA2B,EAC3B,iBAAiB,EACjB,kCAAkC,EAElC,sBAAsB,EACtB,uBAAuB,EAEvB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,M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CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YAC5E,OAAO,SAAS,CAAC,UAAU,CAAC;QAC9B,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACxE,OAAO,SAAS,CAAC,aAAa,CAAC;QACjC,CAAC;QAED,8CAA8C;QAC9C,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;CACF,CAAA;AA3gBY,0BAA0B;IADtC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;qCAAiB,aAAa;GALvD,0BAA0B,CA2gBtC","sourcesContent":["import { injectable, inject } from 'inversify';\nimport {\n ErrorType,\n ErrorActionBackend,\n WildoError_Backend_Definition,\n WildoError_Backend,\n ErrorCustomMessageReference,\n ERROR_DEFINITIONS,\n ResourcesConfig_OperationPathUtils,\n ResourceConfiguration_Operation,\n ErrorHandling_Strategy,\n RetryPolicy_BackoffType,\n ErrorUserGuidance,\n isWildoBackendError,\n} from '@wildo-ai/saas-models';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { getCurrentCorrelationId } from '~wildo-backend-lib/runtime/models/request-context.als.backend';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\n\n\n/**\n * Backend Error Builder Service\n * Creates unified WildoError_Backend instances with ExecutionContext integration\n */\n@injectable()\nexport class ErrorBuilderBackendService {\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n\n @inject(SAAS_SERVICE_TYPES.Logger) private logger: LoggerService\n ) {\n this.logDebug = this.logger.debugByType('ErrorBuilderBackendService');\n this.logger.setDebugTypeLogging('ErrorBuilderBackendService', false);\n }\n\n /**\n * Build a WildoError_Backend with ExecutionContext integration\n */\n public buildError(\n errorType: ErrorType,\n executionContext?: ExecutionContext<any>,\n options: {\n customMessageReference?: ErrorCustomMessageReference,\n context?: Record<string, any>\n stack?: string;\n skipBackendActions?: boolean;\n skipBackendActionTypes?: readonly ErrorActionBackend[];\n } = {}\n ): WildoError_Backend {\n const errorDefinition = ERROR_DEFINITIONS[errorType];\n const statusCode = errorDefinition.statusCode;\n const effectiveBackendActions = options.skipBackendActions\n ? []\n : errorDefinition.backendActions.filter(\n action => !options.skipBackendActionTypes?.includes(action)\n );\n\n // Extract operation path from execution context\n const operationPathKey = (executionContext)\n ? ResourcesConfig_OperationPathUtils.buildOperationPathKeyFromOperation(executionContext.operation as ResourceConfiguration_Operation<any, any, any>)\n : undefined;\n\n\n // Build the WildoError_Backend (context preserved for backend logging;\n // sanitization happens at the HTTP serialization boundary in ErrorHandlerService)\n const wildoError: WildoError_Backend = {\n type: errorType,\n severity: errorDefinition.severity,\n operationPathKey,\n timestamp: new Date(),\n backendActions: effectiveBackendActions,\n customMessageReference: options.customMessageReference ?? errorDefinition.defaultCustomMessageReference,\n statusCode,\n errorHandlingStrategy: errorDefinition.errorHandlingStrategy ?? ErrorHandling_Strategy.STOP,\n retryPolicy: errorDefinition.retryPolicy ?? RetryPolicy_BackoffType.EXPONENTIAL,\n maxRetries: errorDefinition.maxRetries ?? 3,\n initialDelay: errorDefinition.initialDelay ?? 1000,\n baseDelay: errorDefinition.baseDelay ?? 1000,\n initiatorIds: executionContext?.initiatorIds ?? undefined,\n executionType: executionContext?.executionType ?? undefined,\n // Phase 3 — closes gap 3: prefer the threaded EC's id, but fall back to the ambient request-context\n // ALS frame when no EC was passed (the ~67% of buildError calls that pass `undefined`). This is what\n // makes an error built deep in a service — with no EC in hand — still attributable to its request.\n correlationId: executionContext?.correlationId ?? getCurrentCorrelationId(),\n stack: options.stack ?? undefined,\n context: options.context ?? undefined,\n };\n\n // Some callers (for example websocket handshake auth) need to reclassify an\n // expected failure locally instead of emitting the default backend warning.\n if (effectiveBackendActions.length > 0) {\n // Execute backend actions. do not await\n this.executeBackendActions(wildoError);\n }\n\n return wildoError;\n }\n\n public buildFromStandardError(error: unknown, executionContext?: ExecutionContext<any>, options: {\n customMessageReference?: ErrorCustomMessageReference,\n context?: Record<string, any>\n skipBackendActions?: boolean;\n skipBackendActionTypes?: readonly ErrorActionBackend[];\n } = {}): WildoError_Backend {\n // An ALREADY-CLASSIFIED backend error must never be re-derived from scratch here.\n //\n // `WildoError_Backend` is a Zod-INFERRED PLAIN OBJECT, not an `Error` subclass, so a\n // re-wrap fell into the `new Error('Unknown error')` branch below: the caught error's\n // `type`, its `context` (which is where every builder puts the real explanation — the\n // enumerated validation failures, the adapter name, the failing boundary) and its stack\n // were all discarded, and the wrapper was re-classified INTERNAL from a synthetic Error\n // whose only message was the literal string `Unknown error`.\n //\n // That is not a cosmetic loss. It is exactly how a boot failure reaches the log as\n // `{\"errorType\":\"INTERNAL\",\"msg\":\"Application initialization failed\"}` with a stack whose\n // top frame is this method — naming the wrapper and nothing about the cause. Measured\n // 2026-08-14 on `platform-apps-manager`, where a post-registry configuration validation\n // threw with its failing contracts enumerated in `context.message` and the operator saw\n // none of them.\n //\n // The caught error's classification wins: it was chosen deliberately by whoever built it,\n // and this seam's callers pass attribution (`service`, `operation`), not a reclassification.\n // Caller context still wins on key collision, matching the merge below.\n if (isWildoBackendError(error)) {\n return this.buildError(error.type, executionContext, {\n ...options,\n customMessageReference: options.customMessageReference ?? error.customMessageReference,\n context: { ...error.context, ...options.context },\n stack: error.stack,\n });\n }\n\n const err = error instanceof Error\n ? error\n : new Error(typeof error === 'string' ? error : 'Unknown error');\n\n const errorType = this.determineErrorType(err);\n\n // A RAW ZodError / Mongoose ValidationError can reach this global seam\n // (e.g. an express error boundary) WITHOUT having gone through the explicit\n // controller/service validation path, which is the only place that attaches\n // `context.zodIssues` itself. Such an error is still classified VALIDATION\n // by `determineErrorType` (via the name/message heuristics), but it arrives\n // here with no field-level detail — so the client would otherwise receive an\n // opaque `{ type: VALIDATION }` with the real message living only in the\n // (often inaccessible) backend log. Project the error's per-field issues into\n // the same `zodIssues` shape that `sendErrorResponse` surfaces as\n // `validationErrors`, so raw validation failures are debuggable from the API\n // response like the explicit-path ones are.\n //\n // Scoped strictly to VALIDATION-classified errors: no field detail is ever\n // attached to AUTHZ/INTERNAL/DATABASE/etc. errors, preserving the\n // `sanitizeErrorForClient` boundary that strips their context. Only the field\n // path + per-field message are lifted — both already client-safe (they ride\n // the `zodIssues` allowlist, and VALIDATION is a \"safe\" type). The internal\n // `err.message` / stack are deliberately NOT surfaced here.\n const fieldLevelDetail = errorType === ErrorType.VALIDATION\n ? this.extractFieldLevelValidationDetail(err)\n : undefined;\n\n // Caller-supplied context wins on key collision (an explicit path that set\n // `zodIssues` should not be overwritten by the duck-typed extraction).\n const mergedContext = fieldLevelDetail\n ? { ...fieldLevelDetail, ...options.context }\n : options.context;\n\n return this.buildError(errorType, executionContext, {\n ...options,\n context: mergedContext,\n stack: err.stack\n });\n }\n\n /**\n * Extract client-safe field-level detail from a RAW validation error — a plain\n * `ZodError` or a Mongoose `ValidationError` — that reached the global error\n * boundary without going through the explicit controller/service validation\n * path (which attaches `context.zodIssues` itself).\n *\n * Returns the detail in the `{ zodIssues }` shape that\n * `ErrorHandlerService.sendErrorResponse` reduces into the response\n * `validationErrors` map (`{ [fieldPath]: message }`). Only the field `path`\n * and per-field `message` are extracted — both already deemed client-safe (they\n * ride the `zodIssues` allowlist in `sanitizeErrorForClient`, and VALIDATION is\n * a \"safe\" error type). The error's own `message` / stack are NOT included, so\n * internal implementation detail never leaks to the client.\n *\n * Returns `undefined` when the error is not a recognisable field-level\n * validation error (e.g. a generic `Error` whose message merely contains the\n * substring \"invalid\", which `determineErrorType` still classifies VALIDATION)\n * — in that case no `zodIssues` are attached.\n */\n private extractFieldLevelValidationDetail(\n error: Error,\n ): { zodIssues: Array<{ path: (string | number)[]; message: string }> } | undefined {\n // Zod (any instance): duck-type on the `issues` array rather than\n // `instanceof z.ZodError`. Multiple Zod module instances can coexist in the\n // dependency graph, so a nominal `instanceof` check is unreliable at this\n // shared boundary — the shape check is the robust classifier.\n const zodIssues = (error as { issues?: unknown }).issues;\n if (error.name === 'ZodError' && Array.isArray(zodIssues)) {\n const mapped = zodIssues\n .filter(\n (issue): issue is { path: (string | number)[]; message: string } =>\n !!issue\n && typeof issue === 'object'\n && Array.isArray((issue as { path?: unknown }).path)\n && typeof (issue as { message?: unknown }).message === 'string',\n )\n .map(issue => ({ path: issue.path, message: issue.message }));\n return mapped.length > 0 ? { zodIssues: mapped } : undefined;\n }\n\n // Mongoose ValidationError: `errors` is a record keyed by field path, each\n // value a per-path sub-error carrying its own `message`.\n const mongooseErrors = (error as { errors?: unknown }).errors;\n if (\n error.name === 'ValidationError'\n && mongooseErrors\n && typeof mongooseErrors === 'object'\n && !Array.isArray(mongooseErrors)\n ) {\n const mapped = Object.entries(mongooseErrors as Record<string, unknown>).map(\n ([field, subError]) => {\n const message = (subError as { message?: unknown } | null)?.message;\n return {\n path: [field] as (string | number)[],\n message: typeof message === 'string' ? message : 'Invalid value',\n };\n },\n );\n return mapped.length > 0 ? { zodIssues: mapped } : undefined;\n }\n\n return undefined;\n }\n\n /**\n * Build an error with contextual user guidance (Phase 1b).\n *\n * The guidance is attached to the error and will be included in the\n * `ErrorResponse.error.userGuidance` field for the frontend to render.\n *\n * @example\n * ```\n * throw this.errorBuilder.buildErrorWithGuidance(\n * ErrorType.CONFIGURATION,\n * executionContext,\n * {\n * explanation: 'SMTP is not configured for this organization.',\n * resolution: 'Go to Settings → Email and configure your SMTP provider.',\n * nextAction: { label: 'Go to Settings', ref: '/settings/email', type: 'url' },\n * missingConfiguration: ['smtp_host', 'smtp_port'],\n * },\n * { customMessageReference: ErrorCustomMessageReference.GENERIC_DETAIL }\n * );\n * ```\n */\n public buildErrorWithGuidance(\n errorType: ErrorType,\n executionContext: ExecutionContext<any> | undefined,\n guidance: ErrorUserGuidance,\n options: {\n customMessageReference?: ErrorCustomMessageReference;\n context?: Record<string, any>;\n stack?: string;\n } = {}\n ): WildoError_Backend {\n const error = this.buildError(errorType, executionContext, options);\n error.userGuidance = guidance;\n return error;\n }\n\n /**\n * Build an error with a guidance key (i18n reference).\n *\n * Shorthand for `buildErrorWithGuidance` that sets the `guidanceKey` on the guidance object,\n * enabling i18n label resolution under `errors_guidance.{guidanceKey}.{field}`.\n *\n * @param errorType - The error type\n * @param executionContext - Current execution context\n * @param guidanceKey - i18n lookup key (resolves labels under `errors_guidance.{guidanceKey}.*`)\n * @param guidance - Guidance fields (explanation, resolution, etc.) — used as raw fallbacks\n * @param options - Additional error options\n */\n public buildErrorWithGuidanceKey(\n errorType: ErrorType,\n executionContext: ExecutionContext<any> | undefined,\n guidanceKey: string,\n guidance: Omit<ErrorUserGuidance, 'guidanceKey'> = {},\n options: {\n customMessageReference?: ErrorCustomMessageReference;\n context?: Record<string, any>;\n stack?: string;\n } = {}\n ): WildoError_Backend {\n return this.buildErrorWithGuidance(errorType, executionContext, { ...guidance, guidanceKey }, options);\n }\n\n public wildoErrorToSimpleString(wildoError: any): string {\n\n const isWildoError = wildoError && typeof wildoError === 'object' && 'statusCode' in wildoError && 'backendActions' in wildoError;\n if(!isWildoError) {\n return wildoError instanceof Error ? wildoError.message : \"Unknown error\";\n }\n\n let errorMessage = `${wildoError.customMessageReference as string} - ${wildoError.type} - ${wildoError.severity}`;\n if(wildoError.context) {\n errorMessage += `: ${JSON.stringify(wildoError.context)}`;\n }\n return errorMessage;\n }\n\n /**\n * Sanitize an error for client-facing HTTP responses.\n * Called at the serialization boundary (ErrorHandlerService), NOT at build time,\n * so backend logging retains full context for diagnostics.\n *\n * - VALIDATION, CONFLICT, RATE_LIMIT: allowlist of frontend-useful context keys\n * - AUTHENTICATION: allows `authResponse` through (retry/lockout UI data)\n * - Everything else (AUTHZ, INTERNAL, DATABASE, etc.): strips context entirely\n */\n public sanitizeErrorForClient(wildoError: WildoError_Backend): WildoError_Backend {\n // Error types whose context is safe to expose to clients (field-level info needed by frontend)\n const safeTypes = new Set<ErrorType>([ErrorType.VALIDATION, ErrorType.CONFLICT, ErrorType.RATE_LIMIT]);\n\n if (safeTypes.has(wildoError.type)) {\n // For safe types: keep only frontend-relevant keys from context\n if (wildoError.context) {\n const allowedKeys = new Set([\n 'fieldName', 'duplicateValue', 'zodIssues', 'customErrorMessage',\n 'retryAfterSeconds', 'message', 'violations',\n 'versionConflict',\n // Stable, client-branchable error codes (e.g. CrossFrontendHandoffErrorCode).\n // These are non-PII enum values defined in shared schemas (`saas-models`)\n // and consumed by both first-party clients (saas-frontend-lib) and\n // out-of-tree clients (saas-technical-doc/docsAuthClient.ts) for switch-on-code\n // branching. Stripping them at the wire would force callers to regex-parse\n // the human-readable `message`, defeating the purpose of having a stable code\n // enum. See cross-app-jwt-propagation.md C-4 for the contract decision that\n // motivated promoting these keys (the docs-chat client must `import {\n // CrossFrontendHandoffErrorCode } from '@wildo-ai/saas-models'` and branch on\n // `error.details.code === CrossFrontendHandoffErrorCode.UNKNOWN_TARGET_FRONTEND`).\n 'code',\n // Identity selectors that scope a code to a specific resource/service. Already\n // present in the request the client made (so disclosure is a no-op), but echoing\n // them back lets the client emit useful diagnostics (\"target frontend `docs` is\n // not configured…\") without re-parsing its own request body. PII-safe by\n // construction: these are SaaS-config service keys, never user data.\n 'targetServiceKey',\n // ─────────────────────────────────────────────────────────────────────────\n // GENERAL RULE for future endpoints emitting stable client-branchable codes:\n // 1. Define the enum in `@wildo-ai/saas-models` (so frontend + backend share\n // the same source of truth) and reuse the `code` key above to carry it.\n // Do NOT invent a new \"errorKind\" / \"reason\" / \"type\" field — the docs-chat\n // and saas-frontend clients all switch on `error.details.code`.\n // 2. New per-endpoint identity selectors (analogous to `targetServiceKey`)\n // MAY be added to this allowlist when they are PII-safe enum values OR\n // direct echoes of caller-supplied input (i.e. zero net disclosure).\n // 3. NEVER add user-typed strings (emails, names, free-text) to this allowlist\n // — they belong in `customErrorMessage` / `message` and are already covered.\n // 4. NEVER promote an internal cause (`stackTrace`, `dbErrorCode`, `mongoMessage`)\n // — those go through the AUTHZ/INTERNAL/DATABASE branches below which strip\n // context entirely. Surface a stable Wildo enum from the issuing service if\n // the caller needs to branch.\n // ─────────────────────────────────────────────────────────────────────────\n ]);\n const sanitized: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(wildoError.context)) {\n if (allowedKeys.has(key)) {\n sanitized[key] = value;\n }\n }\n return {\n ...wildoError,\n context: Object.keys(sanitized).length > 0 ? sanitized : undefined,\n };\n }\n return wildoError;\n }\n\n // AUTHENTICATION errors: allow the minimum safe retry/lockout UI\n // payload through. `authResponse` is the common case; for the\n // specific `AUTHENTICATION_ACCOUNT_LOCKED` envelope, the global\n // lockout bridge also needs `lockoutDurationMinutes`,\n // `retryAfterSeconds`, and its lockout-specific `message`.\n if (wildoError.type === ErrorType.AUTHENTICATION && wildoError.context) {\n const authAllowedKeys = new Set(['authResponse']);\n if (wildoError.customMessageReference === ErrorCustomMessageReference.AUTHENTICATION_ACCOUNT_LOCKED) {\n authAllowedKeys.add('lockoutDurationMinutes');\n authAllowedKeys.add('retryAfterSeconds');\n authAllowedKeys.add('message');\n }\n const sanitized: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(wildoError.context)) {\n if (authAllowedKeys.has(key)) {\n sanitized[key] = value;\n }\n }\n return {\n ...wildoError,\n context: Object.keys(sanitized).length > 0 ? sanitized : undefined,\n };\n }\n\n // All other types (AUTHZ, INTERNAL, DATABASE, etc.): strip context entirely\n const { context, ...rest } = wildoError;\n return rest as WildoError_Backend;\n }\n\n\n\n\n private async executeBackendActions(wildoError: WildoError_Backend): Promise<void> {\n wildoError.backendActions.forEach(action => {\n try {\n switch (action) {\n case ErrorActionBackend.LOG:\n // Intentionally NOT logged at construction. Error logging is a\n // *handling-boundary* concern, not a *construction* concern: the\n // boundary (HTTP `expressErrorHandler`, batch/cron, websocket auth,\n // queue job-failure, response-DTO direct-send) is the only place\n // where the operational severity can be classified, the request\n // context (method/path/socketId/jobId) is available, and exactly\n // one line per error is guaranteed. Logging here as well produced a\n // double-log (and, historically, an unstructured multi-line blob).\n // Boundaries emit the line via\n // `logWildoBackendErrorAtClassifiedSeverity` /\n // `projectWildoBackendErrorLogFields`.\n break;\n case ErrorActionBackend.RECORD_METRICS:\n // Metrics recording would be handled by telemetry middleware\n break;\n case ErrorActionBackend.TRACE:\n // Tracing would be handled by telemetry middleware\n break;\n case ErrorActionBackend.ALERT:\n this.sendAlert(wildoError);\n break;\n case ErrorActionBackend.CIRCUIT_BREAK:\n // Circuit breaker logic would be implemented in specific services\n break;\n case ErrorActionBackend.GRACEFUL_DEGRADATION:\n // Graceful degradation would be handled by specific services\n break;\n }\n } catch (actionError) {\n // Don't let action execution errors break the main error flow\n this.logger.warn('Failed to execute error action', {\n action,\n originalError: wildoError,\n actionError: describeCaughtError(actionError)\n });\n }\n });\n }\n\n /**\n * Send alert for critical errors\n */\n private sendAlert(wildoError: WildoError_Backend): void {\n // todo implement it;\n }\n\n /**\n * Centralized error type determination based on error characteristics\n * This method provides consistent error type classification across all services\n */\n public determineErrorType(error: Error): ErrorType {\n const message = (error && typeof error.message === 'string') ? error.message.toLowerCase() : '';\n const errorName = (error && typeof error.name === 'string') ? error.name : '';\n\n // Check error name first for more specific classification\n if (errorName === 'ValidationError' || errorName === 'ZodError') {\n return ErrorType.VALIDATION;\n }\n\n if (errorName === 'MulterError') {\n return ErrorType.VALIDATION;\n }\n\n // Body-parser (express.json / urlencoded / raw-body) rejections — an oversized or malformed request\n // body — are CLIENT input problems, exactly like the MulterError case above (both are request-body\n // libraries). They surface as `http-errors` carrying a string `type` (`entity.too.large`,\n // `entity.parse.failed`, `charset.unsupported`, …) plus a well-known 4xx `status`/`statusCode`. Classify\n // VALIDATION so a benign bad body returns a clean 4xx instead of masquerading as an INTERNAL 500 — which\n // additionally mis-fires `severity:critical` alerting/SIEM on an ordinary bad request. Keyed on the\n // body-parser `type`+4xx-`status` signature (NOT a bare `SyntaxError`/`Error` name), so a generic\n // application error is never swept in, and the 5xx body-parser faults (`stream.not.readable`, …)\n // correctly fall through to INTERNAL. (The `/oauth` mount additionally has a dedicated translator that\n // preserves the exact status — see `applyOAuthBodyCap`. Framework-wide, an oversized body (413) classifies\n // as PAYLOAD_TOO_LARGE so EVERY route returns the precise 413; the other body-parser client errors\n // (malformed 400, unsupported-charset/encoding 415) fold into VALIDATION's 400 bucket.)\n const bodyParserType = (error as { type?: unknown }).type;\n const bodyParserStatus = (error as { status?: unknown }).status ?? (error as { statusCode?: unknown }).statusCode;\n if (typeof bodyParserType === 'string' && typeof bodyParserStatus === 'number' && bodyParserStatus >= 400 && bodyParserStatus < 500) {\n return bodyParserStatus === 413 ? ErrorType.PAYLOAD_TOO_LARGE : ErrorType.VALIDATION;\n }\n\n if (errorName === 'JsonWebTokenError' || errorName === 'TokenExpiredError') {\n return ErrorType.AUTHENTICATION;\n }\n\n if (errorName === 'MongoError' || errorName === 'MongooseError') {\n return ErrorType.DATABASE;\n }\n\n // Check message content for additional classification\n if (message.includes('validation') || message.includes('invalid')) {\n return ErrorType.VALIDATION;\n }\n\n if (message.includes('limit_file_size') || message.includes('file too large')) {\n return ErrorType.VALIDATION;\n }\n\n if (message.includes('not found')) {\n return ErrorType.NOT_FOUND;\n }\n\n if (message.includes('unauthorized')) {\n return ErrorType.AUTHENTICATION;\n }\n\n if (message.includes('forbidden') || message.includes('permission')) {\n return ErrorType.AUTHORIZATION;\n }\n\n if (message.includes('conflict') || message.includes('already exists')) {\n return ErrorType.CONFLICT;\n }\n\n if (message.includes('network')) {\n return ErrorType.NETWORK;\n }\n\n if (message.includes('rate limit') || message.includes('too many requests')) {\n return ErrorType.RATE_LIMIT;\n }\n\n if (message.includes('business rule') || message.includes('constraint')) {\n return ErrorType.BUSINESS_RULE;\n }\n\n // Default to INTERNAL for unclassified errors\n return ErrorType.INTERNAL;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"error-builder.backend.service.js","sourceRoot":"","sources":["../../../../../src/errors/services/error-builder.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EACL,SAAS,EACT,kBAAkB,EAGlB,2BAA2B,EAC3B,iBAAiB,EACjB,kCAAkC,EAElC,sBAAsB,EACtB,uBAAuB,EAEvB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8EAA8E,CAAC;AAGnH;;;GAGG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IAKQ;IAJnC,QAAQ,CAA+D;IAEjF,YAE6C,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QAEhE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,UAAU,CACf,SAAoB,EACpB,gBAAwC,EACxC,UAMI,EAAE;QAEN,MAAM,eAAe,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACrD,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC;QAC9C,MAAM,uBAAuB,GAAG,OAAO,CAAC,kBAAkB;YACxD,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,eAAe,CAAC,cAAc,CAAC,MAAM,CACrC,MAAM,CAAC,EAAE,CAAC,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,CAAC,WAAW,CAAC,EAAE,CAAC;YAClC,OAAO,SAAS,CAAC,SAAS,CAAC;QAC7B,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YACrC,OAAO,SAAS,CAAC,cAAc,CAAC;QAClC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACpE,OAAO,SAAS,CAAC,aAAa,CAAC;QACjC,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACvE,OAAO,SAAS,CAAC,QAAQ,CAAC;QAC5B,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAChC,OAAO,SAAS,CAAC,OAAO,CAAC;QAC3B,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC;YAC5E,OAAO,SAAS,CAAC,UAAU,CAAC;QAC9B,CAAC;QAED,IAAI,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACxE,OAAO,SAAS,CAAC,aAAa,CAAC;QACjC,CAAC;QAED,8CAA8C;QAC9C,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;CACF,CAAA;AAvhBY,0BAA0B;IADtC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;qCAAiB,aAAa;GALvD,0BAA0B,CAuhBtC","sourcesContent":["import { injectable, inject } from 'inversify';\nimport {\n ErrorType,\n ErrorActionBackend,\n WildoError_Backend_Definition,\n WildoError_Backend,\n ErrorCustomMessageReference,\n ERROR_DEFINITIONS,\n ResourcesConfig_OperationPathUtils,\n ResourceConfiguration_Operation,\n ErrorHandling_Strategy,\n RetryPolicy_BackoffType,\n ErrorUserGuidance,\n isWildoBackendError,\n} from '@wildo-ai/saas-models';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { getCurrentCorrelationId } from '~wildo-backend-lib/runtime/models/request-context.als.backend';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\n\n\n/**\n * Backend Error Builder Service\n * Creates unified WildoError_Backend instances with ExecutionContext integration\n */\n@injectable()\nexport class ErrorBuilderBackendService {\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n\n @inject(SAAS_SERVICE_TYPES.Logger) private logger: LoggerService\n ) {\n this.logDebug = this.logger.debugByType('ErrorBuilderBackendService');\n this.logger.setDebugTypeLogging('ErrorBuilderBackendService', false);\n }\n\n /**\n * Build a WildoError_Backend with ExecutionContext integration\n */\n public buildError(\n errorType: ErrorType,\n executionContext?: ExecutionContext<any>,\n options: {\n customMessageReference?: ErrorCustomMessageReference,\n context?: Record<string, any>\n stack?: string;\n skipBackendActions?: boolean;\n skipBackendActionTypes?: readonly ErrorActionBackend[];\n } = {}\n ): WildoError_Backend {\n const errorDefinition = ERROR_DEFINITIONS[errorType];\n const statusCode = errorDefinition.statusCode;\n const effectiveBackendActions = options.skipBackendActions\n ? []\n : errorDefinition.backendActions.filter(\n action => !options.skipBackendActionTypes?.includes(action)\n );\n\n // Extract operation path from execution context\n const operationPathKey = (executionContext)\n ? ResourcesConfig_OperationPathUtils.buildOperationPathKeyFromOperation(executionContext.operation as ResourceConfiguration_Operation<any, any, any>)\n : undefined;\n\n\n // Build the WildoError_Backend (context preserved for backend logging;\n // sanitization happens at the HTTP serialization boundary in ErrorHandlerService)\n const wildoError: WildoError_Backend = {\n type: errorType,\n severity: errorDefinition.severity,\n operationPathKey,\n timestamp: new Date(),\n backendActions: effectiveBackendActions,\n customMessageReference: options.customMessageReference ?? errorDefinition.defaultCustomMessageReference,\n statusCode,\n errorHandlingStrategy: errorDefinition.errorHandlingStrategy ?? ErrorHandling_Strategy.STOP,\n retryPolicy: errorDefinition.retryPolicy ?? RetryPolicy_BackoffType.EXPONENTIAL,\n maxRetries: errorDefinition.maxRetries ?? 3,\n initialDelay: errorDefinition.initialDelay ?? 1000,\n baseDelay: errorDefinition.baseDelay ?? 1000,\n initiatorIds: executionContext?.initiatorIds ?? undefined,\n executionType: executionContext?.executionType ?? undefined,\n // Phase 3 — closes gap 3: prefer the threaded EC's id, but fall back to the ambient request-context\n // ALS frame when no EC was passed (the ~67% of buildError calls that pass `undefined`). This is what\n // makes an error built deep in a service — with no EC in hand — still attributable to its request.\n correlationId: executionContext?.correlationId ?? getCurrentCorrelationId(),\n stack: options.stack ?? undefined,\n context: options.context ?? undefined,\n };\n\n // Some callers (for example websocket handshake auth) need to reclassify an\n // expected failure locally instead of emitting the default backend warning.\n if (effectiveBackendActions.length > 0) {\n // Execute backend actions. do not await\n this.executeBackendActions(wildoError);\n }\n\n return wildoError;\n }\n\n public buildFromStandardError(error: unknown, executionContext?: ExecutionContext<any>, options: {\n customMessageReference?: ErrorCustomMessageReference,\n context?: Record<string, any>\n skipBackendActions?: boolean;\n skipBackendActionTypes?: readonly ErrorActionBackend[];\n } = {}): WildoError_Backend {\n // An ALREADY-CLASSIFIED backend error must never be re-derived from scratch here.\n //\n // `WildoError_Backend` is a Zod-INFERRED PLAIN OBJECT, not an `Error` subclass, so a\n // re-wrap fell into the `new Error('Unknown error')` branch below: the caught error's\n // `type`, its `context` (which is where every builder puts the real explanation — the\n // enumerated validation failures, the adapter name, the failing boundary) and its stack\n // were all discarded, and the wrapper was re-classified INTERNAL from a synthetic Error\n // whose only message was the literal string `Unknown error`.\n //\n // That is not a cosmetic loss. It is exactly how a boot failure reaches the log as\n // `{\"errorType\":\"INTERNAL\",\"msg\":\"Application initialization failed\"}` with a stack whose\n // top frame is this method — naming the wrapper and nothing about the cause. Measured\n // 2026-08-14 on `platform-apps-manager`, where a post-registry configuration validation\n // threw with its failing contracts enumerated in `context.message` and the operator saw\n // none of them.\n //\n // The caught error's classification wins: it was chosen deliberately by whoever built it,\n // and this seam's callers pass attribution (`service`, `operation`), not a reclassification.\n // Caller context still wins on key collision, matching the merge below.\n if (isWildoBackendError(error)) {\n return this.buildError(error.type, executionContext, {\n ...options,\n customMessageReference: options.customMessageReference ?? error.customMessageReference,\n context: { ...error.context, ...options.context },\n stack: error.stack,\n });\n }\n\n const err = error instanceof Error\n ? error\n : new Error(typeof error === 'string' ? error : 'Unknown error');\n\n const errorType = this.determineErrorType(err);\n\n // A RAW ZodError / Mongoose ValidationError can reach this global seam\n // (e.g. an express error boundary) WITHOUT having gone through the explicit\n // controller/service validation path, which is the only place that attaches\n // `context.zodIssues` itself. Such an error is still classified VALIDATION\n // by `determineErrorType` (via the name/message heuristics), but it arrives\n // here with no field-level detail — so the client would otherwise receive an\n // opaque `{ type: VALIDATION }` with the real message living only in the\n // (often inaccessible) backend log. Project the error's per-field issues into\n // the same `zodIssues` shape that `sendErrorResponse` surfaces as\n // `validationErrors`, so raw validation failures are debuggable from the API\n // response like the explicit-path ones are.\n //\n // Scoped strictly to VALIDATION-classified errors: no field detail is ever\n // attached to AUTHZ/INTERNAL/DATABASE/etc. errors, preserving the\n // `sanitizeErrorForClient` boundary that strips their context. Only the field\n // path + per-field message are lifted — both already client-safe (they ride\n // the `zodIssues` allowlist, and VALIDATION is a \"safe\" type). The internal\n // `err.message` / stack are deliberately NOT surfaced here.\n const fieldLevelDetail = errorType === ErrorType.VALIDATION\n ? this.extractFieldLevelValidationDetail(err)\n : undefined;\n\n // Caller-supplied context wins on key collision (an explicit path that set\n // `zodIssues` should not be overwritten by the duck-typed extraction).\n const mergedContext = fieldLevelDetail\n ? { ...fieldLevelDetail, ...options.context }\n : options.context;\n\n return this.buildError(errorType, executionContext, {\n ...options,\n context: mergedContext,\n stack: err.stack\n });\n }\n\n /**\n * Extract client-safe field-level detail from a RAW validation error — a plain\n * `ZodError` or a Mongoose `ValidationError` — that reached the global error\n * boundary without going through the explicit controller/service validation\n * path (which attaches `context.zodIssues` itself).\n *\n * Returns the detail in the `{ zodIssues }` shape that\n * `ErrorHandlerService.sendErrorResponse` reduces into the response\n * `validationErrors` map (`{ [fieldPath]: message }`). Only the field `path`\n * and per-field `message` are extracted — both already deemed client-safe (they\n * ride the `zodIssues` allowlist in `sanitizeErrorForClient`, and VALIDATION is\n * a \"safe\" error type). The error's own `message` / stack are NOT included, so\n * internal implementation detail never leaks to the client.\n *\n * Returns `undefined` when the error is not a recognisable field-level\n * validation error (e.g. a generic `Error` whose message merely contains the\n * substring \"invalid\", which `determineErrorType` still classifies VALIDATION)\n * — in that case no `zodIssues` are attached.\n */\n private extractFieldLevelValidationDetail(\n error: Error,\n ): { zodIssues: Array<{ path: (string | number)[]; message: string }> } | undefined {\n // Zod (any instance): duck-type on the `issues` array rather than\n // `instanceof z.ZodError`. Multiple Zod module instances can coexist in the\n // dependency graph, so a nominal `instanceof` check is unreliable at this\n // shared boundary — the shape check is the robust classifier.\n const zodIssues = (error as { issues?: unknown }).issues;\n if (error.name === 'ZodError' && Array.isArray(zodIssues)) {\n const mapped = zodIssues\n .filter(\n (issue): issue is { path: (string | number)[]; message: string } =>\n !!issue\n && typeof issue === 'object'\n && Array.isArray((issue as { path?: unknown }).path)\n && typeof (issue as { message?: unknown }).message === 'string',\n )\n .map(issue => ({ path: issue.path, message: issue.message }));\n return mapped.length > 0 ? { zodIssues: mapped } : undefined;\n }\n\n // Mongoose ValidationError: `errors` is a record keyed by field path, each\n // value a per-path sub-error carrying its own `message`.\n const mongooseErrors = (error as { errors?: unknown }).errors;\n if (\n error.name === 'ValidationError'\n && mongooseErrors\n && typeof mongooseErrors === 'object'\n && !Array.isArray(mongooseErrors)\n ) {\n const mapped = Object.entries(mongooseErrors as Record<string, unknown>).map(\n ([field, subError]) => {\n const message = (subError as { message?: unknown } | null)?.message;\n return {\n path: [field] as (string | number)[],\n message: typeof message === 'string' ? message : 'Invalid value',\n };\n },\n );\n return mapped.length > 0 ? { zodIssues: mapped } : undefined;\n }\n\n return undefined;\n }\n\n /**\n * @wildo_source:part:start saas.backend.error-builder.user-guidance facet:layer:backend facet:audience:app-developer\n *\n * Build an error with contextual user guidance.\n *\n * Reach for this instead of a bare `buildError` whenever the person who hits the failure could DO\n * something about it. A typed error tells a caller what went wrong; guidance tells a human what to\n * do next, and the frontend renders it from `ErrorResponse.error.userGuidance`.\n *\n * ⚠️ **Prefer `buildErrorWithGuidanceKey`.** The strings you pass here are rendered verbatim, so a\n * guidance written this way is English forever — the key variant resolves labels under\n * `errors_guidance.{guidanceKey}.{field}` and is translated like every other user-facing string.\n * Use the raw form only for a failure no user will read, or as the fallback beneath a key.\n *\n * The guidance is attached to the error and will be included in the\n * `ErrorResponse.error.userGuidance` field for the frontend to render.\n *\n * @example\n * ```\n * throw this.errorBuilder.buildErrorWithGuidance(\n * ErrorType.CONFIGURATION,\n * executionContext,\n * {\n * explanation: 'SMTP is not configured for this organization.',\n * resolution: 'Go to Settings → Email and configure your SMTP provider.',\n * nextAction: { label: 'Go to Settings', ref: '/settings/email', type: 'url' },\n * missingConfiguration: ['smtp_host', 'smtp_port'],\n * },\n * { customMessageReference: ErrorCustomMessageReference.GENERIC_DETAIL }\n * );\n * ```\n */\n public buildErrorWithGuidance(\n errorType: ErrorType,\n executionContext: ExecutionContext<any> | undefined,\n guidance: ErrorUserGuidance,\n options: {\n customMessageReference?: ErrorCustomMessageReference;\n context?: Record<string, any>;\n stack?: string;\n } = {}\n ): WildoError_Backend {\n const error = this.buildError(errorType, executionContext, options);\n error.userGuidance = guidance;\n return error;\n }\n\n /**\n * Build an error with a guidance key (i18n reference).\n *\n * Shorthand for `buildErrorWithGuidance` that sets the `guidanceKey` on the guidance object,\n * enabling i18n label resolution under `errors_guidance.{guidanceKey}.{field}`.\n *\n * @param errorType - The error type\n * @param executionContext - Current execution context\n * @param guidanceKey - i18n lookup key (resolves labels under `errors_guidance.{guidanceKey}.*`)\n * @param guidance - Guidance fields (explanation, resolution, etc.) — used as raw fallbacks\n * @param options - Additional error options\n */\n public buildErrorWithGuidanceKey(\n errorType: ErrorType,\n executionContext: ExecutionContext<any> | undefined,\n guidanceKey: string,\n guidance: Omit<ErrorUserGuidance, 'guidanceKey'> = {},\n options: {\n customMessageReference?: ErrorCustomMessageReference;\n context?: Record<string, any>;\n stack?: string;\n } = {}\n ): WildoError_Backend {\n return this.buildErrorWithGuidance(errorType, executionContext, { ...guidance, guidanceKey }, options);\n }\n /** @wildo_source:part:end saas.backend.error-builder.user-guidance */\n\n public wildoErrorToSimpleString(wildoError: any): string {\n\n const isWildoError = wildoError && typeof wildoError === 'object' && 'statusCode' in wildoError && 'backendActions' in wildoError;\n if(!isWildoError) {\n return wildoError instanceof Error ? wildoError.message : \"Unknown error\";\n }\n\n let errorMessage = `${wildoError.customMessageReference as string} - ${wildoError.type} - ${wildoError.severity}`;\n if(wildoError.context) {\n errorMessage += `: ${JSON.stringify(wildoError.context)}`;\n }\n return errorMessage;\n }\n\n /**\n * Sanitize an error for client-facing HTTP responses.\n * Called at the serialization boundary (ErrorHandlerService), NOT at build time,\n * so backend logging retains full context for diagnostics.\n *\n * - VALIDATION, CONFLICT, RATE_LIMIT: allowlist of frontend-useful context keys\n * - AUTHENTICATION: allows `authResponse` through (retry/lockout UI data)\n * - Everything else (AUTHZ, INTERNAL, DATABASE, etc.): strips context entirely\n */\n public sanitizeErrorForClient(wildoError: WildoError_Backend): WildoError_Backend {\n // Error types whose context is safe to expose to clients (field-level info needed by frontend)\n const safeTypes = new Set<ErrorType>([ErrorType.VALIDATION, ErrorType.CONFLICT, ErrorType.RATE_LIMIT]);\n\n if (safeTypes.has(wildoError.type)) {\n // For safe types: keep only frontend-relevant keys from context\n if (wildoError.context) {\n const allowedKeys = new Set([\n 'fieldName', 'duplicateValue', 'zodIssues', 'customErrorMessage',\n 'retryAfterSeconds', 'message', 'violations',\n 'versionConflict',\n // Stable, client-branchable error codes (e.g. CrossFrontendHandoffErrorCode).\n // These are non-PII enum values defined in shared schemas (`saas-models`)\n // and consumed by both first-party clients (saas-frontend-lib) and\n // out-of-tree clients (saas-technical-doc/docsAuthClient.ts) for switch-on-code\n // branching. Stripping them at the wire would force callers to regex-parse\n // the human-readable `message`, defeating the purpose of having a stable code\n // enum. See cross-app-jwt-propagation.md C-4 for the contract decision that\n // motivated promoting these keys (the docs-chat client must `import {\n // CrossFrontendHandoffErrorCode } from '@wildo-ai/saas-models'` and branch on\n // `error.details.code === CrossFrontendHandoffErrorCode.UNKNOWN_TARGET_FRONTEND`).\n 'code',\n // Identity selectors that scope a code to a specific resource/service. Already\n // present in the request the client made (so disclosure is a no-op), but echoing\n // them back lets the client emit useful diagnostics (\"target frontend `docs` is\n // not configured…\") without re-parsing its own request body. PII-safe by\n // construction: these are SaaS-config service keys, never user data.\n 'targetServiceKey',\n // ─────────────────────────────────────────────────────────────────────────\n // GENERAL RULE for future endpoints emitting stable client-branchable codes:\n // 1. Define the enum in `@wildo-ai/saas-models` (so frontend + backend share\n // the same source of truth) and reuse the `code` key above to carry it.\n // Do NOT invent a new \"errorKind\" / \"reason\" / \"type\" field — the docs-chat\n // and saas-frontend clients all switch on `error.details.code`.\n // 2. New per-endpoint identity selectors (analogous to `targetServiceKey`)\n // MAY be added to this allowlist when they are PII-safe enum values OR\n // direct echoes of caller-supplied input (i.e. zero net disclosure).\n // 3. NEVER add user-typed strings (emails, names, free-text) to this allowlist\n // — they belong in `customErrorMessage` / `message` and are already covered.\n // 4. NEVER promote an internal cause (`stackTrace`, `dbErrorCode`, `mongoMessage`)\n // — those go through the AUTHZ/INTERNAL/DATABASE branches below which strip\n // context entirely. Surface a stable Wildo enum from the issuing service if\n // the caller needs to branch.\n // ─────────────────────────────────────────────────────────────────────────\n ]);\n const sanitized: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(wildoError.context)) {\n if (allowedKeys.has(key)) {\n sanitized[key] = value;\n }\n }\n return {\n ...wildoError,\n context: Object.keys(sanitized).length > 0 ? sanitized : undefined,\n };\n }\n return wildoError;\n }\n\n // AUTHENTICATION errors: allow the minimum safe retry/lockout UI\n // payload through. `authResponse` is the common case; for the\n // specific `AUTHENTICATION_ACCOUNT_LOCKED` envelope, the global\n // lockout bridge also needs `lockoutDurationMinutes`,\n // `retryAfterSeconds`, and its lockout-specific `message`.\n if (wildoError.type === ErrorType.AUTHENTICATION && wildoError.context) {\n const authAllowedKeys = new Set(['authResponse']);\n if (wildoError.customMessageReference === ErrorCustomMessageReference.AUTHENTICATION_ACCOUNT_LOCKED) {\n authAllowedKeys.add('lockoutDurationMinutes');\n authAllowedKeys.add('retryAfterSeconds');\n authAllowedKeys.add('message');\n }\n const sanitized: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(wildoError.context)) {\n if (authAllowedKeys.has(key)) {\n sanitized[key] = value;\n }\n }\n return {\n ...wildoError,\n context: Object.keys(sanitized).length > 0 ? sanitized : undefined,\n };\n }\n\n // All other types (AUTHZ, INTERNAL, DATABASE, etc.): strip context entirely\n const { context, ...rest } = wildoError;\n return rest as WildoError_Backend;\n }\n\n\n\n\n private async executeBackendActions(wildoError: WildoError_Backend): Promise<void> {\n wildoError.backendActions.forEach(action => {\n try {\n switch (action) {\n case ErrorActionBackend.LOG:\n // Intentionally NOT logged at construction. Error logging is a\n // *handling-boundary* concern, not a *construction* concern: the\n // boundary (HTTP `expressErrorHandler`, batch/cron, websocket auth,\n // queue job-failure, response-DTO direct-send) is the only place\n // where the operational severity can be classified, the request\n // context (method/path/socketId/jobId) is available, and exactly\n // one line per error is guaranteed. Logging here as well produced a\n // double-log (and, historically, an unstructured multi-line blob).\n // Boundaries emit the line via\n // `logWildoBackendErrorAtClassifiedSeverity` /\n // `projectWildoBackendErrorLogFields`.\n break;\n case ErrorActionBackend.RECORD_METRICS:\n // Metrics recording would be handled by telemetry middleware\n break;\n case ErrorActionBackend.TRACE:\n // Tracing would be handled by telemetry middleware\n break;\n case ErrorActionBackend.ALERT:\n this.sendAlert(wildoError);\n break;\n case ErrorActionBackend.CIRCUIT_BREAK:\n // Circuit breaker logic would be implemented in specific services\n break;\n case ErrorActionBackend.GRACEFUL_DEGRADATION:\n // Graceful degradation would be handled by specific services\n break;\n }\n } catch (actionError) {\n // Don't let action execution errors break the main error flow\n this.logger.warn('Failed to execute error action', {\n action,\n originalError: wildoError,\n actionError: describeCaughtError(actionError)\n });\n }\n });\n }\n\n /**\n * Send alert for critical errors\n */\n private sendAlert(wildoError: WildoError_Backend): void {\n // todo implement it;\n }\n\n /**\n * Centralized error type determination based on error characteristics\n * This method provides consistent error type classification across all services\n */\n public determineErrorType(error: Error): ErrorType {\n const message = (error && typeof error.message === 'string') ? error.message.toLowerCase() : '';\n const errorName = (error && typeof error.name === 'string') ? error.name : '';\n\n // Check error name first for more specific classification\n if (errorName === 'ValidationError' || errorName === 'ZodError') {\n return ErrorType.VALIDATION;\n }\n\n if (errorName === 'MulterError') {\n return ErrorType.VALIDATION;\n }\n\n // Body-parser (express.json / urlencoded / raw-body) rejections — an oversized or malformed request\n // body — are CLIENT input problems, exactly like the MulterError case above (both are request-body\n // libraries). They surface as `http-errors` carrying a string `type` (`entity.too.large`,\n // `entity.parse.failed`, `charset.unsupported`, …) plus a well-known 4xx `status`/`statusCode`. Classify\n // VALIDATION so a benign bad body returns a clean 4xx instead of masquerading as an INTERNAL 500 — which\n // additionally mis-fires `severity:critical` alerting/SIEM on an ordinary bad request. Keyed on the\n // body-parser `type`+4xx-`status` signature (NOT a bare `SyntaxError`/`Error` name), so a generic\n // application error is never swept in, and the 5xx body-parser faults (`stream.not.readable`, …)\n // correctly fall through to INTERNAL. (The `/oauth` mount additionally has a dedicated translator that\n // preserves the exact status — see `applyOAuthBodyCap`. Framework-wide, an oversized body (413) classifies\n // as PAYLOAD_TOO_LARGE so EVERY route returns the precise 413; the other body-parser client errors\n // (malformed 400, unsupported-charset/encoding 415) fold into VALIDATION's 400 bucket.)\n const bodyParserType = (error as { type?: unknown }).type;\n const bodyParserStatus = (error as { status?: unknown }).status ?? (error as { statusCode?: unknown }).statusCode;\n if (typeof bodyParserType === 'string' && typeof bodyParserStatus === 'number' && bodyParserStatus >= 400 && bodyParserStatus < 500) {\n return bodyParserStatus === 413 ? ErrorType.PAYLOAD_TOO_LARGE : ErrorType.VALIDATION;\n }\n\n if (errorName === 'JsonWebTokenError' || errorName === 'TokenExpiredError') {\n return ErrorType.AUTHENTICATION;\n }\n\n if (errorName === 'MongoError' || errorName === 'MongooseError') {\n return ErrorType.DATABASE;\n }\n\n // Check message content for additional classification\n if (message.includes('validation') || message.includes('invalid')) {\n return ErrorType.VALIDATION;\n }\n\n if (message.includes('limit_file_size') || message.includes('file too large')) {\n return ErrorType.VALIDATION;\n }\n\n if (message.includes('not found')) {\n return ErrorType.NOT_FOUND;\n }\n\n if (message.includes('unauthorized')) {\n return ErrorType.AUTHENTICATION;\n }\n\n if (message.includes('forbidden') || message.includes('permission')) {\n return ErrorType.AUTHORIZATION;\n }\n\n if (message.includes('conflict') || message.includes('already exists')) {\n return ErrorType.CONFLICT;\n }\n\n if (message.includes('network')) {\n return ErrorType.NETWORK;\n }\n\n if (message.includes('rate limit') || message.includes('too many requests')) {\n return ErrorType.RATE_LIMIT;\n }\n\n if (message.includes('business rule') || message.includes('constraint')) {\n return ErrorType.BUSINESS_RULE;\n }\n\n // Default to INTERNAL for unclassified errors\n return ErrorType.INTERNAL;\n }\n}\n"]}
|
|
@@ -4,12 +4,66 @@ import { ErrorBuilderBackendService } from './error-builder.backend.service';
|
|
|
4
4
|
import { WildoError_Backend } from '@wildo-ai/saas-models';
|
|
5
5
|
import { ExecutionContext } from '../../runtime/models/execution-context.backend.schemas';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* The package-path segments that identify Wildo's OTLP **export pipeline** in a
|
|
8
|
+
* stack trace: the signal processors that own the background flush timers, the
|
|
9
|
+
* exporters they hand batches to, and the shared OTLP serialize/send layer
|
|
10
|
+
* every exporter delegates into.
|
|
11
|
+
*
|
|
12
|
+
* The membership criterion is NOT "is this an OpenTelemetry package" — it is
|
|
13
|
+
* **"can a frame from this package ever appear in the stack of a HOST error?"**
|
|
14
|
+
* Every package listed here answers no: nothing in it invokes a caller-supplied
|
|
15
|
+
* callback, so it is reached only from a telemetry export tick (or from
|
|
16
|
+
* `sdk.shutdown()`). That is what makes a plain "does the stack mention it"
|
|
17
|
+
* substring test sound: a frame from one of these packages cannot be
|
|
18
|
+
* *routed through*, only *raised in*.
|
|
19
|
+
*
|
|
20
|
+
* `@opentelemetry/exporter-` is a PREFIX on purpose — it covers the three
|
|
21
|
+
* exporters `otel-preload.ts` wires today (`exporter-trace-otlp-http`,
|
|
22
|
+
* `exporter-metrics-otlp-http`, `exporter-logs-otlp-http`) and every transport
|
|
23
|
+
* sibling (`-proto`, `-grpc`, zipkin, prometheus) a future provider selection
|
|
24
|
+
* could swap in, without this list having to be revisited. Each is export-only
|
|
25
|
+
* by construction.
|
|
26
|
+
*
|
|
27
|
+
* Kept in step with the package's real OpenTelemetry dependency set by the
|
|
28
|
+
* totality pin in `__tests__/error-handler.backend.service.test.ts`, which
|
|
29
|
+
* enumerates every `@opentelemetry/*` entry in this package's own
|
|
30
|
+
* `package.json` and fails unless each one is either matched here or named in
|
|
31
|
+
* {@link TELEMETRY_PACKAGES_DELIBERATELY_NOT_ISOLATED}. A name list with no
|
|
32
|
+
* link to whatever owns those names is the drift this carve-out already had
|
|
33
|
+
* once; the pin is that link. It is test-time rather than compile-time because
|
|
34
|
+
* the owning vocabulary is a JSON manifest, not a TypeScript symbol.
|
|
35
|
+
*/
|
|
36
|
+
export declare const TELEMETRY_EXPORT_PIPELINE_STACK_MARKERS: readonly string[];
|
|
37
|
+
/**
|
|
38
|
+
* The OpenTelemetry packages this carve-out deliberately does NOT isolate, each
|
|
39
|
+
* with the reason. This is not a leftover list: it is the other half of the
|
|
40
|
+
* totality pin, so that adding an OTel dependency forces a decision instead of
|
|
41
|
+
* silently landing outside both sets.
|
|
42
|
+
*
|
|
43
|
+
* The reason is the same for the whole first group and it is the one that
|
|
44
|
+
* matters: **these packages invoke host code**, so their frames appear in the
|
|
45
|
+
* stack of ordinary host crashes. Matching them would not widen a telemetry
|
|
46
|
+
* carve-out — it would suppress genuine host faults.
|
|
47
|
+
*/
|
|
48
|
+
export declare const TELEMETRY_PACKAGES_DELIBERATELY_NOT_ISOLATED: readonly string[];
|
|
49
|
+
/**
|
|
50
|
+
* Isolates an uncaught exception RAISED INSIDE the OTLP export pipeline —
|
|
51
|
+
* the background machinery that flushes logs, metrics and spans to the
|
|
52
|
+
* collector on a timer, independent of any request — from every other uncaught
|
|
53
|
+
* exception, which still hard-exits via the default path.
|
|
54
|
+
*
|
|
55
|
+
* WHAT THIS SUPPRESSES: a failure whose stack mentions one of
|
|
56
|
+
* {@link TELEMETRY_EXPORT_PIPELINE_STACK_MARKERS}. Those packages never call
|
|
57
|
+
* host code (see that constant's note), so a stack that mentions one of them
|
|
58
|
+
* is a stack that was raised in one of them.
|
|
59
|
+
*
|
|
60
|
+
* WHAT IT MUST NOT SUPPRESS, and does not: anything raised in the host's own
|
|
61
|
+
* request/business logic, anything raised in OTel INSTRUMENTATION (which wraps
|
|
62
|
+
* host code), and anything in the trace/context tier a host stack routes
|
|
63
|
+
* through — see {@link TELEMETRY_PACKAGES_DELIBERATELY_NOT_ISOLATED}. A
|
|
64
|
+
* carve-out that swallowed a genuine fault into a silently degraded process
|
|
65
|
+
* would be strictly worse than the crash it prevents, which is why the
|
|
66
|
+
* criterion is "cannot be on a host stack" rather than "is telemetry".
|
|
13
67
|
*
|
|
14
68
|
* Root cause (2026-08-06): the timer callback in
|
|
15
69
|
* `BatchLogRecordProcessorBase` does `this._flushOneBatch().then(...).catch(...)`
|
|
@@ -19,6 +73,14 @@ import { ExecutionContext } from '../../runtime/models/execution-context.backend
|
|
|
19
73
|
* `globalErrorHandler` safety net could catch it, so the failure escaped as a
|
|
20
74
|
* process-level uncaught exception — killing an otherwise-healthy host over a
|
|
21
75
|
* background telemetry-export housekeeping tick.
|
|
76
|
+
*
|
|
77
|
+
* WIDENED 2026-09-09. The original predicate matched the single literal
|
|
78
|
+
* `@opentelemetry/sdk-logs`, which is where that one incident happened to be
|
|
79
|
+
* raised — so the identical promise-chain/transport failure arriving from the
|
|
80
|
+
* METRIC reader or from ANY of the three OTLP exporters was not isolated and
|
|
81
|
+
* hard-exited the host. Keying a carve-out on one package NAME makes its reach
|
|
82
|
+
* an accident of which pipeline failed first; the property that actually
|
|
83
|
+
* distinguishes the case is the export pipeline itself.
|
|
22
84
|
*/
|
|
23
85
|
export declare function isNonFatalTelemetryPipelineException(error: Error): boolean;
|
|
24
86
|
/**
|
|
@@ -56,7 +118,8 @@ export declare class ErrorHandlerService {
|
|
|
56
118
|
* isolated by {@link isNonFatalTelemetryPipelineException}. Node's own
|
|
57
119
|
* guidance ("uncaught exception means unknown state, exit") assumes the
|
|
58
120
|
* failure came from the host's own request/business logic. A background
|
|
59
|
-
* telemetry
|
|
121
|
+
* telemetry export tick (OTel's `BatchLogRecordProcessor` or
|
|
122
|
+
* `PeriodicExportingMetricReader`, and the OTLP exporters they feed, ticking
|
|
60
123
|
* every few seconds independently of any request) is a different failure
|
|
61
124
|
* domain: its own state corruption says nothing about whether the host's
|
|
62
125
|
* actual work is safe to continue, and `otel-preload.ts` already commits to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/errors/services/error-handler.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAE7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAK7E,OAAO,EAIL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAG,MAAM,qEAAqE,CAAC;AAExG
|
|
1
|
+
{"version":3,"file":"error-handler.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/errors/services/error-handler.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAE7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAK7E,OAAO,EAIL,kBAAkB,EAInB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAG,MAAM,qEAAqE,CAAC;AAExG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,uCAAuC,EAAE,SAAS,MAAM,EAmBpE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4CAA4C,EAAE,SAAS,MAAM,EAoCzE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAI1E;AAED;;;GAGG;AACH,qBACa,mBAAmB;IAIO,OAAO,CAAC,MAAM;IACD,OAAO,CAAC,YAAY;IAJtE,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAGpC,MAAM,EAAE,aAAa,EACR,YAAY,EAAE,0BAA0B;IAMlG;;;OAGG;IACH,mBAAmB,IA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