@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
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The user-provider-credential STORE — the port implementation the registry consults for a PERSON's
|
|
3
|
+
* own credential.
|
|
4
|
+
*
|
|
5
|
+
* ## What makes the isolation structural rather than a filter
|
|
6
|
+
*
|
|
7
|
+
* The same three independent mechanisms as the organization store, and none of them is a predicate
|
|
8
|
+
* somebody has to remember to write at each call site:
|
|
9
|
+
*
|
|
10
|
+
* 1. **The owner FK is injected by the context machinery.** The read goes through `readAsSystem`
|
|
11
|
+
* with the user in the system scope map, so `buildContextualFilter` adds the clause itself. A
|
|
12
|
+
* caller cannot omit it, because the caller never writes it.
|
|
13
|
+
* 2. **The filter names the user explicitly as well.** Belt and braces, deliberately: the contextual
|
|
14
|
+
* filter is injected by a mechanism that exists TWICE (a Mongo implementation and a PostgreSQL
|
|
15
|
+
* one), so a regression in one adapter is a bypass in that adapter alone. The explicit clause is
|
|
16
|
+
* adapter-independent and would still scope the read.
|
|
17
|
+
* 3. **The envelope is BOUND to the row identity, under a key derived for the USER scope.** Even a
|
|
18
|
+
* read that returned another person's row — or a tenant's — would fail to OPEN it. This is the
|
|
19
|
+
* one that holds when the other two are wrong, which is why it exists.
|
|
20
|
+
*
|
|
21
|
+
* ## Why this is a separate service rather than the organization store with an owner parameter
|
|
22
|
+
*
|
|
23
|
+
* The read is the same shape and everything around it differs. There is no fallback (a person who
|
|
24
|
+
* has connected nothing gets a refusal, never the deployment's shared principal). There is no
|
|
25
|
+
* administrative variant, so the actor and the subject are always the same identity and the audit
|
|
26
|
+
* events say so. And the resource is a composition under `USERS` rather than under `ORGANIZATIONS`,
|
|
27
|
+
* so the scope map, the cascade and the erasure semantics are a different set throughout.
|
|
28
|
+
*
|
|
29
|
+
* A single service parameterised by owner would carry every one of those as a branch, and the
|
|
30
|
+
* branch a reader most needs to trust — "is a fallback reachable from here?" — would be the one
|
|
31
|
+
* spelled as an `if`.
|
|
32
|
+
*
|
|
33
|
+
* assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — a user's delegated authority toward a
|
|
34
|
+
* third party is read only for that user.
|
|
35
|
+
*/
|
|
36
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
37
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
38
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
39
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
40
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
41
|
+
};
|
|
42
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
43
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
44
|
+
};
|
|
45
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
46
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
47
|
+
};
|
|
48
|
+
import { inject, injectable, optional } from 'inversify';
|
|
49
|
+
import { CoreResourceType, ProviderCredentialResolutionSource, ProviderCredentialValidationState, serializeProviderOAuth2Grant, } from '@wildo-ai/saas-models';
|
|
50
|
+
import { ExternalProvider_Connection_DelegationMode, ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';
|
|
51
|
+
import { SAAS_SERVICE_TYPES } from '../../../inject/models/service-types.js';
|
|
52
|
+
import { describeCaughtError } from '../../../errors/utils/error-log-level-classification.backend.utils.js';
|
|
53
|
+
import { ProviderCredentialEnvelopeError, openProviderCredential, } from '../utils/provider-credential-envelope.backend.utils.js';
|
|
54
|
+
import { resolveStoredCredentialValue } from '../utils/stored-credential-value.backend.utils.js';
|
|
55
|
+
import { providerOAuth2GrantWasPermanentlyRejected } from './provider-oauth2-exchange.backend.js';
|
|
56
|
+
let UserProviderCredentialStoreBackendService = class UserProviderCredentialStoreBackendService {
|
|
57
|
+
logger;
|
|
58
|
+
appConfigService;
|
|
59
|
+
systemAccess;
|
|
60
|
+
auditLogs;
|
|
61
|
+
refresher;
|
|
62
|
+
constructor(logger, appConfigService, systemAccess, auditLogs, refresher) {
|
|
63
|
+
this.logger = logger;
|
|
64
|
+
this.appConfigService = appConfigService;
|
|
65
|
+
this.systemAccess = systemAccess;
|
|
66
|
+
this.auditLogs = auditLogs;
|
|
67
|
+
this.refresher = refresher;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The person's own credential, opened, or `undefined` when they have not connected this provider.
|
|
71
|
+
*
|
|
72
|
+
* See the port's JSDoc for why "absent" returns and "present but unopenable" throws.
|
|
73
|
+
*/
|
|
74
|
+
async resolveUserCredential(query) {
|
|
75
|
+
const row = await this.readCredentialRow(query);
|
|
76
|
+
if (!row) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
// A disabled credential is treated as absent — which here means the call REFUSES, because there
|
|
80
|
+
// is nothing to fall through to. That is the intended shape: someone who switches their own
|
|
81
|
+
// connection off is asking the application to stop acting as them, and the honest outcome is an
|
|
82
|
+
// integration that stops rather than one that quietly continues under another identity.
|
|
83
|
+
if (row.enabled === false) {
|
|
84
|
+
this.logger.debug?.('[user-provider-credential] credential is disabled; treating as absent', { userId: query.userId, providerRef: query.providerRef, secretSlug: query.secretSlug });
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const plaintext = openProviderCredential(row.secretValue, this.appConfigService.secrets.security.session.encryptionKey, {
|
|
88
|
+
ownerScope: ExternalProvider_Connection_OwnerScope.USER,
|
|
89
|
+
ownerId: query.userId,
|
|
90
|
+
providerRef: query.providerRef,
|
|
91
|
+
secretSlug: query.secretSlug,
|
|
92
|
+
});
|
|
93
|
+
// What is STORED is not always what goes on the wire: an OAuth2 grant is a JSON document whose
|
|
94
|
+
// access token is one field. Returning the plaintext directly would put that document on the
|
|
95
|
+
// wire as a bearer token, and the vendor's 401 would name a credential problem rather than a
|
|
96
|
+
// serialization one. One shared resolver, because both stores hold both shapes.
|
|
97
|
+
const describeRow = `user '${query.userId}', provider '${query.providerRef}', slug '${query.secretSlug}'`;
|
|
98
|
+
const resolved = resolveStoredCredentialValue(plaintext, describeRow, this.refresher !== undefined);
|
|
99
|
+
if (resolved.needsRefresh) {
|
|
100
|
+
// The renewal round trip and the write-back, in that order. The exchange belongs to the
|
|
101
|
+
// refresher (it needs the contract and the application's registration); persisting belongs
|
|
102
|
+
// here (it needs the table, the envelope key and the scope map). Neither half is where the
|
|
103
|
+
// other's inputs are, which is why this is two components rather than one.
|
|
104
|
+
const renewed = await this.renewOrRetire(row._id, query, {
|
|
105
|
+
providerRef: query.providerRef,
|
|
106
|
+
secretSlug: query.secretSlug,
|
|
107
|
+
target: {
|
|
108
|
+
ownerScope: ExternalProvider_Connection_OwnerScope.USER,
|
|
109
|
+
ownerId: query.userId,
|
|
110
|
+
delegation: ExternalProvider_Connection_DelegationMode.SERVICE,
|
|
111
|
+
},
|
|
112
|
+
grant: resolved.grant,
|
|
113
|
+
// From the ROW. The authorization record that first held these expired ten minutes after
|
|
114
|
+
// the connect; a templated token URL is still templated an hour later, so without this a
|
|
115
|
+
// Microsoft or regional connection renews into `needs a value for 'cloud'`.
|
|
116
|
+
connectionParameters: row.connectionParameters,
|
|
117
|
+
});
|
|
118
|
+
await this.persistRenewedGrant(query, row._id, renewed);
|
|
119
|
+
return { value: renewed.accessToken, credentialId: row._id };
|
|
120
|
+
}
|
|
121
|
+
return { value: resolved.wireValue, credentialId: row._id };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The scoped read.
|
|
125
|
+
*
|
|
126
|
+
* `readAsSystem` rather than an ordinary repository read, for the reason the organization sibling
|
|
127
|
+
* documents: a provider call legitimately happens on a batch, a queue consumer or a webhook return
|
|
128
|
+
* leg, none of which carries the person's own session, and all of which must still resolve their
|
|
129
|
+
* credential. The user travels in the system scope map, which is the channel the contextual filter
|
|
130
|
+
* actually consumes.
|
|
131
|
+
*/
|
|
132
|
+
async readCredentialRow(query) {
|
|
133
|
+
return this.systemAccess.readAsSystem(CoreResourceType.USER_PROVIDER_CREDENTIALS, {
|
|
134
|
+
userId: query.userId,
|
|
135
|
+
providerRef: query.providerRef,
|
|
136
|
+
secretSlug: query.secretSlug,
|
|
137
|
+
}, { scopeContext: { userId: query.userId } });
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Record that a credential was spent, and what the provider thought of it.
|
|
141
|
+
*
|
|
142
|
+
* Best-effort in both halves and deliberately so: the outbound provider call has already happened
|
|
143
|
+
* by the time this runs, and failing the caller because a bookkeeping write did not land would
|
|
144
|
+
* turn a successful integration into an error. Every failure is logged with the row named.
|
|
145
|
+
*/
|
|
146
|
+
async recordCredentialUse(use) {
|
|
147
|
+
await this.emitUseAudit(use);
|
|
148
|
+
const now = new Date();
|
|
149
|
+
const patch = { lastUsedAt: now };
|
|
150
|
+
if (use.outcome) {
|
|
151
|
+
patch.validationState = use.outcome.accepted
|
|
152
|
+
? ProviderCredentialValidationState.VALID
|
|
153
|
+
: ProviderCredentialValidationState.INVALID;
|
|
154
|
+
patch.lastValidatedAt = now;
|
|
155
|
+
// Truncated to the schema's own bound. The provider's message describes the CREDENTIAL's
|
|
156
|
+
// status and must never be derived from the credential itself — a caller passing the secret
|
|
157
|
+
// here would publish it to a client-readable field, which is why this is documented at the
|
|
158
|
+
// one place a provider string enters the row.
|
|
159
|
+
patch.validationError = use.outcome.accepted
|
|
160
|
+
? undefined
|
|
161
|
+
: (use.outcome.providerMessage ?? '').slice(0, 500) || undefined;
|
|
162
|
+
}
|
|
163
|
+
try {
|
|
164
|
+
await this.systemAccess.updateAsSystem(CoreResourceType.USER_PROVIDER_CREDENTIALS, use.credentialId, patch, {
|
|
165
|
+
scopeContext: { userId: use.userId },
|
|
166
|
+
/*
|
|
167
|
+
* `lastUsedAt`, `lastValidatedAt` and `validationError` are all
|
|
168
|
+
* `.excludeFromCreate().excludeFromUpdate()`, so the repository's strict `requestDto.parse`
|
|
169
|
+
* drops them before persistence unless they are allow-listed here.
|
|
170
|
+
*
|
|
171
|
+
* The automatic diff that populates this list covers fields a custom-impl PREFIX hook
|
|
172
|
+
* injected — which is how `secretSetAt` reaches the row on a write. Nothing populates it
|
|
173
|
+
* for a payload a caller passes directly, which is what this is, so the omission was
|
|
174
|
+
* silent in the worst way: `validationState` is NOT excluded and moved correctly, so the
|
|
175
|
+
* row went INVALID while the timestamp and the provider's explanation of WHY vanished.
|
|
176
|
+
* A person looking at a credential marked invalid with no reason and no last-use time is
|
|
177
|
+
* being told less than the code believes it recorded.
|
|
178
|
+
*/
|
|
179
|
+
preserveServerInjectedFields: ['lastUsedAt', 'lastValidatedAt', 'validationError'],
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
this.logger.warn?.('[user-provider-credential] failed to record credential use', {
|
|
184
|
+
userId: use.userId,
|
|
185
|
+
providerRef: use.providerRef,
|
|
186
|
+
secretSlug: use.secretSlug,
|
|
187
|
+
credentialId: use.credentialId,
|
|
188
|
+
error: describeCaughtError(error),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async emitUseAudit(use) {
|
|
193
|
+
if (!this.auditLogs) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
await this.auditLogs.logUserProviderCredentialUsed({
|
|
198
|
+
userId: use.userId,
|
|
199
|
+
providerRef: use.providerRef,
|
|
200
|
+
secretSlug: use.secretSlug,
|
|
201
|
+
// Constant rather than a parameter: there is exactly one place a person's credential can come
|
|
202
|
+
// from. Threading it through the caller would invite a future one to pass something else.
|
|
203
|
+
resolvedFrom: ProviderCredentialResolutionSource.USER_CREDENTIAL,
|
|
204
|
+
credentialId: use.credentialId,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
this.logger.warn?.('[user-provider-credential] failed to emit credential-use audit event', {
|
|
209
|
+
userId: use.userId,
|
|
210
|
+
providerRef: use.providerRef,
|
|
211
|
+
error: describeCaughtError(error),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Record a grant the authorization exchange just minted, replacing one already stored.
|
|
217
|
+
*
|
|
218
|
+
* The plaintext goes in and the resource's own WRITE DOOR seals it — the same hook that seals a
|
|
219
|
+
* credential a person types, and the same reason `persistRenewedGrant` hands over plaintext:
|
|
220
|
+
* `createAsSystem` / `updateAsSystem` reach the SERVICE tier, so a pre-sealed value arrives at
|
|
221
|
+
* that hook and the envelope refuses to double-seal.
|
|
222
|
+
*
|
|
223
|
+
* ## Reconnecting REPLACES rather than adding a second row
|
|
224
|
+
*
|
|
225
|
+
* The business key is (userId, providerRef, secretSlug) and it is UNIQUE, so a second connect would
|
|
226
|
+
* violate the index. Read-then-write is a race, and the honest statement is that the index is what
|
|
227
|
+
* decides it: two simultaneous connects mean one of them loses, which is the correct outcome —
|
|
228
|
+
* a person who authorized twice gets one connection, not two half-connections.
|
|
229
|
+
*
|
|
230
|
+
* @returns the credential row's id, so the caller can name it in an audit event.
|
|
231
|
+
*/
|
|
232
|
+
async storeGrant(query, grant, connectionParameters) {
|
|
233
|
+
const existing = await this.readCredentialRow(query);
|
|
234
|
+
const secretValue = serializeProviderOAuth2Grant(grant);
|
|
235
|
+
const scopeContext = { userId: query.userId };
|
|
236
|
+
if (existing) {
|
|
237
|
+
// `connectionParameters` is `.excludeFromUpdate()` — it describes the ACCOUNT the grant is
|
|
238
|
+
// for, and re-authorizing against a different directory is a different connection. A
|
|
239
|
+
// reconnect that changed them would point the refresh somewhere the token was not issued.
|
|
240
|
+
await this.systemAccess.updateAsSystem(CoreResourceType.USER_PROVIDER_CREDENTIALS, existing._id, {
|
|
241
|
+
secretValue,
|
|
242
|
+
enabled: true,
|
|
243
|
+
// Clearing the mark is part of reconnecting, not a separate concern. A row retired by
|
|
244
|
+
// `renewOrRetire` would otherwise keep `validationState: INVALID` forever — so somebody
|
|
245
|
+
// who did exactly what the screen told them to do would reconnect successfully and still
|
|
246
|
+
// be shown a broken connection.
|
|
247
|
+
validationState: ProviderCredentialValidationState.UNVALIDATED,
|
|
248
|
+
validationError: undefined,
|
|
249
|
+
}, { scopeContext, preserveServerInjectedFields: ['validationError'] });
|
|
250
|
+
await this.emitConnectionGranted(query, grant, existing._id, true);
|
|
251
|
+
return existing._id;
|
|
252
|
+
}
|
|
253
|
+
const created = await this.systemAccess.createAsSystem(CoreResourceType.USER_PROVIDER_CREDENTIALS, {
|
|
254
|
+
userId: query.userId,
|
|
255
|
+
providerRef: query.providerRef,
|
|
256
|
+
secretSlug: query.secretSlug,
|
|
257
|
+
secretValue,
|
|
258
|
+
...(connectionParameters === undefined ? {} : { connectionParameters }),
|
|
259
|
+
}, { scopeContext });
|
|
260
|
+
await this.emitConnectionGranted(query, grant, created._id, false);
|
|
261
|
+
return created._id;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Renew the grant, and RETIRE the connection when the vendor says it is finished.
|
|
265
|
+
*
|
|
266
|
+
* Without this the refresh call was unguarded, and the failure was slow and silent in the worst
|
|
267
|
+
* direction. A vendor that permanently rejects a refresh token — the person removed the app at the
|
|
268
|
+
* vendor, an administrator revoked it, the token aged past its absolute lifetime — throws, the
|
|
269
|
+
* error propagates out of the resolve, and NOTHING touches the row. `validationState` stays where
|
|
270
|
+
* it was, so the connected-accounts screen goes on showing the account as connected, every call
|
|
271
|
+
* fails identically forever, and the person is never told the one thing they could act on.
|
|
272
|
+
*
|
|
273
|
+
* Only `invalid_grant` retires a connection, and the exclusions are the substantive part. A
|
|
274
|
+
* transport failure, a bare 500 or an unparseable body means the vendor said NOTHING about the
|
|
275
|
+
* grant, and retiring a working connection because we could not reach a vendor for thirty seconds
|
|
276
|
+
* would be a self-inflicted outage. `invalid_client` is excluded for a different reason: it is the
|
|
277
|
+
* APPLICATION's own registration being rejected, one operator's misconfiguration affecting every
|
|
278
|
+
* connection at once — marking each person's account invalid would blame all of them for something
|
|
279
|
+
* none of them can fix.
|
|
280
|
+
*
|
|
281
|
+
* The mark is best-effort and the ORIGINAL error is always re-thrown: the caller needs the real
|
|
282
|
+
* cause, and a bookkeeping write that failed must not replace it with a different story.
|
|
283
|
+
*/
|
|
284
|
+
async renewOrRetire(credentialId, query, request) {
|
|
285
|
+
try {
|
|
286
|
+
return await this.refresher.refreshGrant(request);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
if (providerOAuth2GrantWasPermanentlyRejected(error)) {
|
|
290
|
+
try {
|
|
291
|
+
await this.systemAccess.updateAsSystem(CoreResourceType.USER_PROVIDER_CREDENTIALS, credentialId, {
|
|
292
|
+
validationState: ProviderCredentialValidationState.INVALID,
|
|
293
|
+
lastValidatedAt: new Date(),
|
|
294
|
+
// The vendor's own code, and nothing derived from the credential. This field is
|
|
295
|
+
// CLIENT-READABLE, so anything token-shaped reaching it would publish a secret onto
|
|
296
|
+
// the screen that displays it.
|
|
297
|
+
validationError: 'The provider rejected the stored authorization (invalid_grant). Reconnect the account.',
|
|
298
|
+
}, {
|
|
299
|
+
scopeContext: { userId: query.userId },
|
|
300
|
+
// Both of these are `.excludeFromUpdate()`; without the allow-list the row would go
|
|
301
|
+
// INVALID carrying no reason and no timestamp — see `recordCredentialUse`.
|
|
302
|
+
preserveServerInjectedFields: ['lastValidatedAt', 'validationError'],
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
catch (markError) {
|
|
306
|
+
this.logger.warn?.('[user-provider-credential] a grant was permanently rejected and the row could not be marked', { providerRef: query.providerRef, secretSlug: query.secretSlug, credentialId, error: describeCaughtError(markError) });
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
throw error;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Record that a delegated authorization was GRANTED, distinct from the row's own `_SET` event.
|
|
314
|
+
*
|
|
315
|
+
* Emitted HERE and nowhere else, because this is the only place that holds the three facts an
|
|
316
|
+
* auditor wants and the row does not: the scopes the vendor actually issued, which account they
|
|
317
|
+
* were issued for, and whether this replaced a connection that already existed. By the time the
|
|
318
|
+
* resource's own write hook sees the row, the value is sealed and none of it is recoverable.
|
|
319
|
+
*
|
|
320
|
+
* Best-effort, like every other emission on this path. The grant is already stored and the person
|
|
321
|
+
* has already authorized it; failing their connection because a trail write did not land would
|
|
322
|
+
* turn a completed authorization into an error and invite them to grant it a second time.
|
|
323
|
+
*/
|
|
324
|
+
async emitConnectionGranted(query, grant, credentialId, replacedExistingConnection) {
|
|
325
|
+
if (!this.auditLogs) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
await this.auditLogs.logUserProviderConnectionGranted({
|
|
330
|
+
userId: query.userId,
|
|
331
|
+
providerRef: query.providerRef,
|
|
332
|
+
secretSlug: query.secretSlug,
|
|
333
|
+
credentialId,
|
|
334
|
+
grantedScopes: grant.grantedScopes,
|
|
335
|
+
accountRef: grant.accountRef,
|
|
336
|
+
replacedExistingConnection,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
this.logger.warn?.('[user-provider-credential] a connection was granted and the audit event could not be emitted', { providerRef: query.providerRef, secretSlug: query.secretSlug, credentialId, error: describeCaughtError(error) });
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Persist a renewed grant through the resource's own WRITE door.
|
|
345
|
+
*
|
|
346
|
+
* The plaintext goes in and the CUSTOM IMPLEMENTATION seals it — the same hook that seals a
|
|
347
|
+
* credential a person types. Sealing here instead would be a second sealing site for one
|
|
348
|
+
* invariant, and it does not merely duplicate: `updateAsSystem` reaches the service tier, so a
|
|
349
|
+
* pre-sealed value arrives at that hook and the envelope REFUSES it ("double-sealing would hand
|
|
350
|
+
* the envelope itself to the provider"). Every refresh would have thrown at the write-back.
|
|
351
|
+
*
|
|
352
|
+
* `secretSetAt` therefore moves, and that is correct rather than tolerated: the field is defined
|
|
353
|
+
* as "when the stored VALUE last changed", and a renewal changes it. An earlier version of this
|
|
354
|
+
* method held it still on the theory that it should mean "when a HUMAN last supplied a value" —
|
|
355
|
+
* that is a different field, and inventing the behaviour without the field was the error.
|
|
356
|
+
*
|
|
357
|
+
* NOT best-effort. A refresh that is not persisted happens again on every call, and against a
|
|
358
|
+
* vendor that rotates the refresh token each one invalidates the last — so the connection breaks
|
|
359
|
+
* while every individual exchange succeeds.
|
|
360
|
+
*/
|
|
361
|
+
async persistRenewedGrant(query, credentialId, renewed) {
|
|
362
|
+
await this.systemAccess.updateAsSystem(CoreResourceType.USER_PROVIDER_CREDENTIALS, credentialId, { secretValue: serializeProviderOAuth2Grant(renewed) }, { scopeContext: { userId: query.userId } });
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Turn an envelope failure into the operator-facing statement.
|
|
366
|
+
*
|
|
367
|
+
* Exposed so the registry can distinguish "this person has no credential" from "they HAVE one and
|
|
368
|
+
* it is broken" without importing the envelope's error type and re-deriving the distinction. One
|
|
369
|
+
* definition, one meaning.
|
|
370
|
+
*/
|
|
371
|
+
static isUnopenableCredential(error) {
|
|
372
|
+
return error instanceof ProviderCredentialEnvelopeError;
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
UserProviderCredentialStoreBackendService = __decorate([
|
|
376
|
+
injectable(),
|
|
377
|
+
__param(0, inject(SAAS_SERVICE_TYPES.Logger)),
|
|
378
|
+
__param(1, inject(SAAS_SERVICE_TYPES.AppConfigService)),
|
|
379
|
+
__param(2, inject(SAAS_SERVICE_TYPES.SystemAccessService)),
|
|
380
|
+
__param(3, inject(SAAS_SERVICE_TYPES.AuditLogsService)),
|
|
381
|
+
__param(3, optional()),
|
|
382
|
+
__param(4, inject(SAAS_SERVICE_TYPES.ProviderOAuth2Refresher)),
|
|
383
|
+
__param(4, optional()),
|
|
384
|
+
__metadata("design:paramtypes", [Function, Function, Function, Function, Object])
|
|
385
|
+
], UserProviderCredentialStoreBackendService);
|
|
386
|
+
export { UserProviderCredentialStoreBackendService };
|
|
387
|
+
//# sourceMappingURL=user-provider-credential-store.backend.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-provider-credential-store.backend.service.js","sourceRoot":"","sources":["../../../../../../src/security/connected-accounts/services/user-provider-credential-store.backend.service.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * The user-provider-credential STORE — the port implementation the registry consults for a PERSON's\n * own credential.\n *\n * ## What makes the isolation structural rather than a filter\n *\n * The same three independent mechanisms as the organization store, and none of them is a predicate\n * somebody has to remember to write at each call site:\n *\n * 1. **The owner FK is injected by the context machinery.** The read goes through `readAsSystem`\n * with the user in the system scope map, so `buildContextualFilter` adds the clause itself. A\n * caller cannot omit it, because the caller never writes it.\n * 2. **The filter names the user explicitly as well.** Belt and braces, deliberately: the contextual\n * filter is injected by a mechanism that exists TWICE (a Mongo implementation and a PostgreSQL\n * one), so a regression in one adapter is a bypass in that adapter alone. The explicit clause is\n * adapter-independent and would still scope the read.\n * 3. **The envelope is BOUND to the row identity, under a key derived for the USER scope.** Even a\n * read that returned another person's row — or a tenant's — would fail to OPEN it. This is the\n * one that holds when the other two are wrong, which is why it exists.\n *\n * ## Why this is a separate service rather than the organization store with an owner parameter\n *\n * The read is the same shape and everything around it differs. There is no fallback (a person who\n * has connected nothing gets a refusal, never the deployment's shared principal). There is no\n * administrative variant, so the actor and the subject are always the same identity and the audit\n * events say so. And the resource is a composition under `USERS` rather than under `ORGANIZATIONS`,\n * so the scope map, the cascade and the erasure semantics are a different set throughout.\n *\n * A single service parameterised by owner would carry every one of those as a branch, and the\n * branch a reader most needs to trust — \"is a fallback reachable from here?\" — would be the one\n * spelled as an `if`.\n *\n * assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — a user's delegated authority toward a\n * third party is read only for that user.\n */\n\nimport { inject, injectable, optional } from 'inversify';\nimport {\n CoreResourceType,\n ProviderCredentialResolutionSource,\n ProviderCredentialValidationState,\n serializeProviderOAuth2Grant,\n type ProviderOAuth2Grant,\n type UserProviderCredential,\n} from '@wildo-ai/saas-models';\n\nimport { ExternalProvider_Connection_DelegationMode, ExternalProvider_Connection_OwnerScope } from '@wildo-ai/external-connectors-models';\n\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport { describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\n\nimport {\n ProviderCredentialEnvelopeError,\n openProviderCredential,\n} from '../utils/provider-credential-envelope.backend.utils';\nimport { resolveStoredCredentialValue } from '../utils/stored-credential-value.backend.utils';\nimport { providerOAuth2GrantWasPermanentlyRejected } from './provider-oauth2-exchange.backend';\nimport type { ProviderOAuth2RefresherPort } from '../provider-oauth2-refresher.port';\nimport type {\n UserProviderCredentialQuery,\n UserProviderCredentialResolution,\n UserProviderCredentialResolverPort,\n} from '../user-provider-credential-resolver.port';\n\n@injectable()\nexport class UserProviderCredentialStoreBackendService implements UserProviderCredentialResolverPort {\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.SystemAccessService) private readonly systemAccess: SystemAccessBackendService,\n /**\n * OPTIONAL and lazily used, mirroring `SystemAccessBackendService`'s own treatment of it: audit\n * emission must never be the reason a provider call fails, and a minimal test container must\n * still be able to construct this service.\n */\n @inject(SAAS_SERVICE_TYPES.AuditLogsService) @optional() private readonly auditLogs?: AuditLogsBackendService,\n /**\n * Appended LAST, deliberately: a parameter inserted mid-signature silently reassigns every\n * positional argument after it, and this constructor is called positionally by several harnesses.\n *\n * OPTIONAL, and its absence is not a degradation — a store without one resolves every pasted\n * credential and every non-expiring token exactly as before. Only an EXPIRING grant needs it, and\n * that case refuses by name rather than sending a stale token.\n */\n @inject(SAAS_SERVICE_TYPES.ProviderOAuth2Refresher) @optional() private readonly refresher?: ProviderOAuth2RefresherPort,\n ) {}\n\n /**\n * The person's own credential, opened, or `undefined` when they have not connected this provider.\n *\n * See the port's JSDoc for why \"absent\" returns and \"present but unopenable\" throws.\n */\n public async resolveUserCredential(\n query: UserProviderCredentialQuery,\n ): Promise<UserProviderCredentialResolution | undefined> {\n const row = await this.readCredentialRow(query);\n if (!row) {\n return undefined;\n }\n\n // A disabled credential is treated as absent — which here means the call REFUSES, because there\n // is nothing to fall through to. That is the intended shape: someone who switches their own\n // connection off is asking the application to stop acting as them, and the honest outcome is an\n // integration that stops rather than one that quietly continues under another identity.\n if (row.enabled === false) {\n this.logger.debug?.(\n '[user-provider-credential] credential is disabled; treating as absent',\n { userId: query.userId, providerRef: query.providerRef, secretSlug: query.secretSlug },\n );\n return undefined;\n }\n\n const plaintext = openProviderCredential(\n row.secretValue,\n this.appConfigService.secrets.security.session.encryptionKey,\n {\n ownerScope: ExternalProvider_Connection_OwnerScope.USER,\n ownerId: query.userId,\n providerRef: query.providerRef,\n secretSlug: query.secretSlug,\n },\n );\n\n // What is STORED is not always what goes on the wire: an OAuth2 grant is a JSON document whose\n // access token is one field. Returning the plaintext directly would put that document on the\n // wire as a bearer token, and the vendor's 401 would name a credential problem rather than a\n // serialization one. One shared resolver, because both stores hold both shapes.\n const describeRow = `user '${query.userId}', provider '${query.providerRef}', slug '${query.secretSlug}'`;\n const resolved = resolveStoredCredentialValue(plaintext, describeRow, this.refresher !== undefined);\n if (resolved.needsRefresh) {\n // The renewal round trip and the write-back, in that order. The exchange belongs to the\n // refresher (it needs the contract and the application's registration); persisting belongs\n // here (it needs the table, the envelope key and the scope map). Neither half is where the\n // other's inputs are, which is why this is two components rather than one.\n const renewed = await this.renewOrRetire(row._id, query, {\n providerRef: query.providerRef,\n secretSlug: query.secretSlug,\n target: {\n ownerScope: ExternalProvider_Connection_OwnerScope.USER,\n ownerId: query.userId,\n delegation: ExternalProvider_Connection_DelegationMode.SERVICE,\n },\n grant: resolved.grant!,\n // From the ROW. The authorization record that first held these expired ten minutes after\n // the connect; a templated token URL is still templated an hour later, so without this a\n // Microsoft or regional connection renews into `needs a value for 'cloud'`.\n connectionParameters: row.connectionParameters,\n });\n await this.persistRenewedGrant(query, row._id, renewed);\n return { value: renewed.accessToken, credentialId: row._id };\n }\n\n return { value: resolved.wireValue, credentialId: row._id };\n }\n\n /**\n * The scoped read.\n *\n * `readAsSystem` rather than an ordinary repository read, for the reason the organization sibling\n * documents: a provider call legitimately happens on a batch, a queue consumer or a webhook return\n * leg, none of which carries the person's own session, and all of which must still resolve their\n * credential. The user travels in the system scope map, which is the channel the contextual filter\n * actually consumes.\n */\n private async readCredentialRow(\n query: UserProviderCredentialQuery,\n ): Promise<UserProviderCredential | null> {\n return this.systemAccess.readAsSystem<UserProviderCredential>(\n CoreResourceType.USER_PROVIDER_CREDENTIALS,\n {\n userId: query.userId,\n providerRef: query.providerRef,\n secretSlug: query.secretSlug,\n },\n { scopeContext: { userId: query.userId } },\n );\n }\n\n /**\n * Record that a credential was spent, and what the provider thought of it.\n *\n * Best-effort in both halves and deliberately so: the outbound provider call has already happened\n * by the time this runs, and failing the caller because a bookkeeping write did not land would\n * turn a successful integration into an error. Every failure is logged with the row named.\n */\n public async recordCredentialUse(use: {\n userId: string;\n providerRef: string;\n secretSlug: string;\n credentialId: string;\n /** What the provider said. Absent means the outcome is not yet known to the caller. */\n outcome?: { accepted: boolean; providerMessage?: string };\n }): Promise<void> {\n await this.emitUseAudit(use);\n\n const now = new Date();\n const patch: Record<string, unknown> = { lastUsedAt: now };\n if (use.outcome) {\n patch.validationState = use.outcome.accepted\n ? ProviderCredentialValidationState.VALID\n : ProviderCredentialValidationState.INVALID;\n patch.lastValidatedAt = now;\n // Truncated to the schema's own bound. The provider's message describes the CREDENTIAL's\n // status and must never be derived from the credential itself — a caller passing the secret\n // here would publish it to a client-readable field, which is why this is documented at the\n // one place a provider string enters the row.\n patch.validationError = use.outcome.accepted\n ? undefined\n : (use.outcome.providerMessage ?? '').slice(0, 500) || undefined;\n }\n\n try {\n await this.systemAccess.updateAsSystem(\n CoreResourceType.USER_PROVIDER_CREDENTIALS,\n use.credentialId,\n patch,\n {\n scopeContext: { userId: use.userId },\n /*\n * `lastUsedAt`, `lastValidatedAt` and `validationError` are all\n * `.excludeFromCreate().excludeFromUpdate()`, so the repository's strict `requestDto.parse`\n * drops them before persistence unless they are allow-listed here.\n *\n * The automatic diff that populates this list covers fields a custom-impl PREFIX hook\n * injected — which is how `secretSetAt` reaches the row on a write. Nothing populates it\n * for a payload a caller passes directly, which is what this is, so the omission was\n * silent in the worst way: `validationState` is NOT excluded and moved correctly, so the\n * row went INVALID while the timestamp and the provider's explanation of WHY vanished.\n * A person looking at a credential marked invalid with no reason and no last-use time is\n * being told less than the code believes it recorded.\n */\n preserveServerInjectedFields: ['lastUsedAt', 'lastValidatedAt', 'validationError'],\n },\n );\n } catch (error) {\n this.logger.warn?.(\n '[user-provider-credential] failed to record credential use',\n {\n userId: use.userId,\n providerRef: use.providerRef,\n secretSlug: use.secretSlug,\n credentialId: use.credentialId,\n error: describeCaughtError(error),\n },\n );\n }\n }\n\n private async emitUseAudit(use: {\n userId: string;\n providerRef: string;\n secretSlug: string;\n credentialId: string;\n }): Promise<void> {\n if (!this.auditLogs) {\n return;\n }\n try {\n await this.auditLogs.logUserProviderCredentialUsed({\n userId: use.userId,\n providerRef: use.providerRef,\n secretSlug: use.secretSlug,\n // Constant rather than a parameter: there is exactly one place a person's credential can come\n // from. Threading it through the caller would invite a future one to pass something else.\n resolvedFrom: ProviderCredentialResolutionSource.USER_CREDENTIAL,\n credentialId: use.credentialId,\n });\n } catch (error) {\n this.logger.warn?.(\n '[user-provider-credential] failed to emit credential-use audit event',\n {\n userId: use.userId,\n providerRef: use.providerRef,\n error: describeCaughtError(error),\n },\n );\n }\n }\n\n\n /**\n * Record a grant the authorization exchange just minted, replacing one already stored.\n *\n * The plaintext goes in and the resource's own WRITE DOOR seals it — the same hook that seals a\n * credential a person types, and the same reason `persistRenewedGrant` hands over plaintext:\n * `createAsSystem` / `updateAsSystem` reach the SERVICE tier, so a pre-sealed value arrives at\n * that hook and the envelope refuses to double-seal.\n *\n * ## Reconnecting REPLACES rather than adding a second row\n *\n * The business key is (userId, providerRef, secretSlug) and it is UNIQUE, so a second connect would\n * violate the index. Read-then-write is a race, and the honest statement is that the index is what\n * decides it: two simultaneous connects mean one of them loses, which is the correct outcome —\n * a person who authorized twice gets one connection, not two half-connections.\n *\n * @returns the credential row's id, so the caller can name it in an audit event.\n */\n public async storeGrant(\n query: UserProviderCredentialQuery,\n grant: ProviderOAuth2Grant,\n connectionParameters?: Readonly<Record<string, string>>,\n ): Promise<string> {\n const existing = await this.readCredentialRow(query);\n const secretValue = serializeProviderOAuth2Grant(grant);\n const scopeContext = { userId: query.userId };\n\n if (existing) {\n // `connectionParameters` is `.excludeFromUpdate()` — it describes the ACCOUNT the grant is\n // for, and re-authorizing against a different directory is a different connection. A\n // reconnect that changed them would point the refresh somewhere the token was not issued.\n await this.systemAccess.updateAsSystem(\n CoreResourceType.USER_PROVIDER_CREDENTIALS,\n existing._id,\n {\n secretValue,\n enabled: true,\n // Clearing the mark is part of reconnecting, not a separate concern. A row retired by\n // `renewOrRetire` would otherwise keep `validationState: INVALID` forever — so somebody\n // who did exactly what the screen told them to do would reconnect successfully and still\n // be shown a broken connection.\n validationState: ProviderCredentialValidationState.UNVALIDATED,\n validationError: undefined,\n },\n { scopeContext, preserveServerInjectedFields: ['validationError'] },\n );\n await this.emitConnectionGranted(query, grant, existing._id, true);\n return existing._id;\n }\n\n const created = await this.systemAccess.createAsSystem<UserProviderCredential>(\n CoreResourceType.USER_PROVIDER_CREDENTIALS,\n {\n userId: query.userId,\n providerRef: query.providerRef,\n secretSlug: query.secretSlug,\n secretValue,\n ...(connectionParameters === undefined ? {} : { connectionParameters }),\n },\n { scopeContext },\n );\n await this.emitConnectionGranted(query, grant, created._id, false);\n return created._id;\n }\n\n /**\n * Renew the grant, and RETIRE the connection when the vendor says it is finished.\n *\n * Without this the refresh call was unguarded, and the failure was slow and silent in the worst\n * direction. A vendor that permanently rejects a refresh token — the person removed the app at the\n * vendor, an administrator revoked it, the token aged past its absolute lifetime — throws, the\n * error propagates out of the resolve, and NOTHING touches the row. `validationState` stays where\n * it was, so the connected-accounts screen goes on showing the account as connected, every call\n * fails identically forever, and the person is never told the one thing they could act on.\n *\n * Only `invalid_grant` retires a connection, and the exclusions are the substantive part. A\n * transport failure, a bare 500 or an unparseable body means the vendor said NOTHING about the\n * grant, and retiring a working connection because we could not reach a vendor for thirty seconds\n * would be a self-inflicted outage. `invalid_client` is excluded for a different reason: it is the\n * APPLICATION's own registration being rejected, one operator's misconfiguration affecting every\n * connection at once — marking each person's account invalid would blame all of them for something\n * none of them can fix.\n *\n * The mark is best-effort and the ORIGINAL error is always re-thrown: the caller needs the real\n * cause, and a bookkeeping write that failed must not replace it with a different story.\n */\n private async renewOrRetire(\n credentialId: string,\n query: UserProviderCredentialQuery,\n request: Parameters<ProviderOAuth2RefresherPort['refreshGrant']>[0],\n ): Promise<ProviderOAuth2Grant> {\n try {\n return await this.refresher!.refreshGrant(request);\n } catch (error) {\n if (providerOAuth2GrantWasPermanentlyRejected(error)) {\n try {\n await this.systemAccess.updateAsSystem(\n CoreResourceType.USER_PROVIDER_CREDENTIALS,\n credentialId,\n {\n validationState: ProviderCredentialValidationState.INVALID,\n lastValidatedAt: new Date(),\n // The vendor's own code, and nothing derived from the credential. This field is\n // CLIENT-READABLE, so anything token-shaped reaching it would publish a secret onto\n // the screen that displays it.\n validationError: 'The provider rejected the stored authorization (invalid_grant). Reconnect the account.',\n },\n {\n scopeContext: { userId: query.userId },\n // Both of these are `.excludeFromUpdate()`; without the allow-list the row would go\n // INVALID carrying no reason and no timestamp — see `recordCredentialUse`.\n preserveServerInjectedFields: ['lastValidatedAt', 'validationError'],\n },\n );\n } catch (markError) {\n this.logger.warn?.(\n '[user-provider-credential] a grant was permanently rejected and the row could not be marked',\n { providerRef: query.providerRef, secretSlug: query.secretSlug, credentialId, error: describeCaughtError(markError) },\n );\n }\n }\n throw error;\n }\n }\n\n /**\n * Record that a delegated authorization was GRANTED, distinct from the row's own `_SET` event.\n *\n * Emitted HERE and nowhere else, because this is the only place that holds the three facts an\n * auditor wants and the row does not: the scopes the vendor actually issued, which account they\n * were issued for, and whether this replaced a connection that already existed. By the time the\n * resource's own write hook sees the row, the value is sealed and none of it is recoverable.\n *\n * Best-effort, like every other emission on this path. The grant is already stored and the person\n * has already authorized it; failing their connection because a trail write did not land would\n * turn a completed authorization into an error and invite them to grant it a second time.\n */\n private async emitConnectionGranted(\n query: UserProviderCredentialQuery,\n grant: ProviderOAuth2Grant,\n credentialId: string,\n replacedExistingConnection: boolean,\n ): Promise<void> {\n if (!this.auditLogs) {\n return;\n }\n try {\n await this.auditLogs.logUserProviderConnectionGranted({\n userId: query.userId,\n providerRef: query.providerRef,\n secretSlug: query.secretSlug,\n credentialId,\n grantedScopes: grant.grantedScopes,\n accountRef: grant.accountRef,\n replacedExistingConnection,\n });\n } catch (error) {\n this.logger.warn?.(\n '[user-provider-credential] a connection was granted and the audit event could not be emitted',\n { providerRef: query.providerRef, secretSlug: query.secretSlug, credentialId, error: describeCaughtError(error) },\n );\n }\n }\n\n /**\n * Persist a renewed grant through the resource's own WRITE door.\n *\n * The plaintext goes in and the CUSTOM IMPLEMENTATION seals it — the same hook that seals a\n * credential a person types. Sealing here instead would be a second sealing site for one\n * invariant, and it does not merely duplicate: `updateAsSystem` reaches the service tier, so a\n * pre-sealed value arrives at that hook and the envelope REFUSES it (\"double-sealing would hand\n * the envelope itself to the provider\"). Every refresh would have thrown at the write-back.\n *\n * `secretSetAt` therefore moves, and that is correct rather than tolerated: the field is defined\n * as \"when the stored VALUE last changed\", and a renewal changes it. An earlier version of this\n * method held it still on the theory that it should mean \"when a HUMAN last supplied a value\" —\n * that is a different field, and inventing the behaviour without the field was the error.\n *\n * NOT best-effort. A refresh that is not persisted happens again on every call, and against a\n * vendor that rotates the refresh token each one invalidates the last — so the connection breaks\n * while every individual exchange succeeds.\n */\n private async persistRenewedGrant(\n query: UserProviderCredentialQuery,\n credentialId: string,\n renewed: ProviderOAuth2Grant,\n ): Promise<void> {\n await this.systemAccess.updateAsSystem(\n CoreResourceType.USER_PROVIDER_CREDENTIALS,\n credentialId,\n { secretValue: serializeProviderOAuth2Grant(renewed) },\n { scopeContext: { userId: query.userId } },\n );\n }\n\n /**\n * Turn an envelope failure into the operator-facing statement.\n *\n * Exposed so the registry can distinguish \"this person has no credential\" from \"they HAVE one and\n * it is broken\" without importing the envelope's error type and re-deriving the distinction. One\n * definition, one meaning.\n */\n public static isUnopenableCredential(error: unknown): error is ProviderCredentialEnvelopeError {\n return error instanceof ProviderCredentialEnvelopeError;\n }\n}\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The WRITE path for a PERSON's own provider credential: seal on the way in, audit on the way out.
|
|
3
|
+
*
|
|
4
|
+
* ## Without this file the resource stores plaintext
|
|
5
|
+
*
|
|
6
|
+
* The schema declares `secretValue` as `.isWriteOnlySecret()`, which governs how the value is
|
|
7
|
+
* PRESENTED (redacted at the client boundary, and a round-tripped mask means "keep the stored
|
|
8
|
+
* secret"). It says nothing about how the value is STORED — a write-only-secret field lands in the
|
|
9
|
+
* database exactly as the client typed it. Sealing it is this hook's job, and it is the only place
|
|
10
|
+
* that job is done, so a credential reaching persistence unsealed means this registration did not
|
|
11
|
+
* resolve.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ A custom implementation resolves by an EXACT operation-path key embedding the resource, the
|
|
14
|
+
* operation, the variant TYPE and the default/variant-key slot. A registration naming a combination
|
|
15
|
+
* the resource configuration does not declare resolves nothing and silently never runs, while the
|
|
16
|
+
* route still answers 200 — here that would mean every person's third-party key persisted in
|
|
17
|
+
* plaintext behind a green suite. The pins assert these registrations against the REAL resource
|
|
18
|
+
* configuration for that reason.
|
|
19
|
+
*
|
|
20
|
+
* ## What differs from the organization sibling, and why each difference is substantive
|
|
21
|
+
*
|
|
22
|
+
* - **No `setByUserId`.** The organization's row records WHICH administrator wrote it, because
|
|
23
|
+
* several can. This resource declares no administrative variant at all, so the author is always
|
|
24
|
+
* the owner and a separate field could only ever repeat `userId` — while inviting a future reader
|
|
25
|
+
* to believe the two can differ.
|
|
26
|
+
* - **The DELETE reason is `OWNER_REVOKED`, not `ADMINISTRATOR_REVOKED`.** Same door, different
|
|
27
|
+
* meaning: nobody but the holder can reach it.
|
|
28
|
+
* - **The cascade door destroys evidence that matters more.** When a subject is erased, the
|
|
29
|
+
* `USERS → USER_PROVIDER_CREDENTIALS` composition removes these rows through the RAW repository,
|
|
30
|
+
* bypassing the service tier exactly as the organization purge does. The consequence is sharper
|
|
31
|
+
* here: the deletion event is what an operator produces when asked whether an erasure reached the
|
|
32
|
+
* person's third-party credentials, and the cascade cannot emit one. `USER_DELETED` records that
|
|
33
|
+
* the subject was erased; what is missing is the enumeration of WHICH vendors they had connected.
|
|
34
|
+
* This is the SAME defect as the organization purge's, at a second site — one cascade-tier audit
|
|
35
|
+
* hook fixes both — and it is recorded on issue #365 rather than left for a reader to discover
|
|
36
|
+
* from an absence. `ProviderCredentialDeletionReason.USER_ERASED` exists for the event that hook
|
|
37
|
+
* will emit; nothing can emit it today.
|
|
38
|
+
*
|
|
39
|
+
* assurance-control: WILDO.IDENTITY.DELEGATED_AUTHORIZATION — a user authorizes, rotates and
|
|
40
|
+
* withdraws delegated access to a named third party.
|
|
41
|
+
*/
|
|
42
|
+
import { type ResourceCustomServiceImplementationFactory } from '../../../base-classes/services/services/resource-operation-custom-implementation.factory.backend';
|
|
43
|
+
/** Every write door of the user-provider-credential resource. */
|
|
44
|
+
export declare function createUserProviderCredentialFactories(): ResourceCustomServiceImplementationFactory[];
|
|
45
|
+
//# sourceMappingURL=user-provider-credentials.custom-impl.backend.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-provider-credentials.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAkBH,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AAwUpH,iEAAiE;AACjE,wBAAgB,qCAAqC,IAAI,0CAA0C,EAAE,CAMpG"}
|