@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
package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (partial-resource paper, PR-29): provider-access resolution, transport execution (timeout /
|
|
4
4
|
* bounded retry / rate budget), the per-dialect wire framing (OData GET, REST_JSON GET/POST +
|
|
5
5
|
* JSON-RPC envelope semantics, Odoo `execute_kw` with the `common.authenticate` handshake and
|
|
6
|
-
* the
|
|
6
|
+
* the credential-keyed cached uid), and the 404-as-null read tolerance.
|
|
7
7
|
*
|
|
8
8
|
* TWO consumers, by design: the VIRTUAL repository (`http-api-resource-repository`) and the
|
|
9
9
|
* pipeline extraction source (P-2). The declaration layer is split on purpose — a pipeline is
|
|
@@ -32,15 +32,58 @@ export declare class HttpApiReadClient {
|
|
|
32
32
|
private readonly fetchImpl;
|
|
33
33
|
private readonly rateBudget;
|
|
34
34
|
/**
|
|
35
|
-
* The authenticated uid
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* The authenticated uid, KEYED ON the credential it was minted under rather than merely
|
|
36
|
+
* remembered against this instance.
|
|
37
|
+
*
|
|
38
|
+
* The uid comes from the documented `common.authenticate(db, login, api_key, {})` handshake and
|
|
39
|
+
* is worth caching: the virtual repository builds ONE client per binding and keeps it for the
|
|
40
|
+
* process lifetime (`http-api-resource-repository.backend.service.ts:163`), so re-authenticating
|
|
41
|
+
* per call would double every read's round trips.
|
|
42
|
+
*
|
|
43
|
+
* What it must never do is outlive the credential. `resolveAccess` runs on EVERY call and reads
|
|
44
|
+
* the secret afresh (environment, provider registry, or a tenant credential row), so a rotation
|
|
45
|
+
* genuinely reaches this class — and a uid remembered against the instance would then be an
|
|
46
|
+
* identity minted under the retired credential, presented on every subsequent `execute_kw`.
|
|
47
|
+
*
|
|
48
|
+
* Keying the cache on the credential is what makes that unrepresentable, and it is deliberately
|
|
49
|
+
* preferred over an `invalidate()` some rotation path has to remember to call: there is no
|
|
50
|
+
* enumeration of rotation sites to get wrong, because a changed credential simply misses. Note
|
|
51
|
+
* the key includes `baseUrl` — a uid is a `res.users` row id on ONE database on ONE instance, so
|
|
52
|
+
* repointing the binding at another host must not reuse it either.
|
|
53
|
+
*
|
|
54
|
+
* The key is a SHA-256 of the tuple rather than the tuple itself, so the API key is not held
|
|
55
|
+
* alive on a long-lived field beyond the call that resolved it. The hash is per `execute_kw`
|
|
56
|
+
* call and costs microseconds against a network round trip.
|
|
57
|
+
*
|
|
58
|
+
* ONE slot, not a map. A map would save a handshake when a credential the client has already
|
|
59
|
+
* seen comes back, at the cost of accumulating one secret-derived entry per retired credential
|
|
60
|
+
* for the lifetime of the process — an unbounded set, to avoid a round trip nobody has measured.
|
|
61
|
+
* A binding names one credential at a time, so the slot is single and a rollback re-authenticates.
|
|
62
|
+
*
|
|
63
|
+
* The single slot stays SAFE now that an Odoo binding MAY name a tenant-owned target (#333, which
|
|
64
|
+
* widened `connectionTargetForBinding` from the `APPLICATION` pin it used to hold). Alternating
|
|
65
|
+
* tenants each miss the key and pay a handshake — slower, and never one tenant acting under
|
|
66
|
+
* another tenant's uid, which is what an instance-remembered uid would have become the moment the
|
|
67
|
+
* scope widened. The key is the credential, so the widening cost a round trip and no correctness.
|
|
68
|
+
*
|
|
69
|
+
* This replaces the slice-1 note that said a rotation needs a process restart, and with it the
|
|
70
|
+
* owed work to "measure against real session-expiry behavior". That measurement was owed for an
|
|
71
|
+
* invalidation TRIGGER, and this design needs no trigger. It also has nothing to expire against:
|
|
72
|
+
* `execute_kw` below re-presents `db` + `uid` + `apiKey` in the args of every single call, so
|
|
73
|
+
* there is no server-side session here whose lifetime we could be racing — the only thing that
|
|
74
|
+
* can retire the uid is the credential (or the instance) it names, which is exactly the key.
|
|
40
75
|
*/
|
|
41
|
-
private
|
|
76
|
+
private odooAuthenticatedIdentity?;
|
|
42
77
|
constructor(binding: HttpApiResourceBinding, providerAccessResolver: HttpApiProviderAccessResolver, fetchImpl?: HttpApiFetchLike);
|
|
43
|
-
|
|
78
|
+
/**
|
|
79
|
+
* `async`, so a target this execution cannot satisfy REJECTS rather than throwing synchronously.
|
|
80
|
+
*
|
|
81
|
+
* `connectionTargetForBinding` refuses before the port is reached, and a synchronous throw out of
|
|
82
|
+
* a `Promise`-returning method escapes every `.catch()` a caller attaches — the failure would land
|
|
83
|
+
* as an unhandled exception in whichever frame happened to call it without `await`. The keyword is
|
|
84
|
+
* the whole fix.
|
|
85
|
+
*/
|
|
86
|
+
resolveAccess(executionContext: ExecutionContext<any>): Promise<HttpApiProviderAccess>;
|
|
44
87
|
odataGet(executionContext: ExecutionContext<any>, compiled: ODataCompiledRequest): Promise<unknown>;
|
|
45
88
|
odataGetOrNull(executionContext: ExecutionContext<any>, compiled: ODataCompiledRequest): Promise<unknown | null>;
|
|
46
89
|
/**
|
|
@@ -69,6 +112,15 @@ export declare class HttpApiReadClient {
|
|
|
69
112
|
restJsonReadOrNull(executionContext: ExecutionContext<any>, compiled: RestJsonCompiledRequest): Promise<unknown | null>;
|
|
70
113
|
private buildRestJsonRequest;
|
|
71
114
|
odooExecuteKw(executionContext: ExecutionContext<any>, call: OdooCompiledCall): Promise<unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* The identity a cached uid belongs to: the instance it was minted on, and the exact credential
|
|
117
|
+
* it was minted with.
|
|
118
|
+
*
|
|
119
|
+
* `JSON.stringify` over the tuple rather than a joined string because JSON escapes each member,
|
|
120
|
+
* so no combination of separators inside a db name, a login or a key can make two different
|
|
121
|
+
* tuples produce one key.
|
|
122
|
+
*/
|
|
123
|
+
private static odooCredentialKey;
|
|
72
124
|
private executeOdooRpc;
|
|
73
125
|
/** OData's canonical `DELETE /EntitySet(key)`; a 404 is the row already gone (idempotent). */
|
|
74
126
|
odataDeleteByPath(executionContext: ExecutionContext<any>, path: string): Promise<void>;
|
package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-api-read-client.backend.d.ts","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/http-api/http-api-read-client.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"http-api-read-client.backend.d.ts","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/http-api/http-api-read-client.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH,OAAO,KAAK,EACV,sBAAsB,EACvB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAE5G,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKxE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EACnC,MAAM,oCAAoC,CAAC;AAE5C,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC;AAoEF,qBAAa,iBAAiB;IAgD1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAjD5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,OAAO,CAAC,yBAAyB,CAAC,CAAyC;gBAGxD,OAAO,EAAE,sBAAsB,EAC/B,sBAAsB,EAAE,6BAA6B,EACrD,SAAS,GAAE,gBAAsC;IAKpE;;;;;;;OAOG;IACU,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAAG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AE,gBAAgB,CAAC,GAAG,CAAC,EACvC,QAAQ,EAAE,8BAA8B,GACvC,OAAO,CAAC,IAAI,CAAC;IA0BhB,sEAAsE;IACzD,OAAO,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;IAOxE,0FAA0F;IAC7E,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC;CAQtF"}
|
package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (partial-resource paper, PR-29): provider-access resolution, transport execution (timeout /
|
|
4
4
|
* bounded retry / rate budget), the per-dialect wire framing (OData GET, REST_JSON GET/POST +
|
|
5
5
|
* JSON-RPC envelope semantics, Odoo `execute_kw` with the `common.authenticate` handshake and
|
|
6
|
-
* the
|
|
6
|
+
* the credential-keyed cached uid), and the 404-as-null read tolerance.
|
|
7
7
|
*
|
|
8
8
|
* TWO consumers, by design: the VIRTUAL repository (`http-api-resource-repository`) and the
|
|
9
9
|
* pipeline extraction source (P-2). The declaration layer is split on purpose — a pipeline is
|
|
@@ -17,7 +17,10 @@
|
|
|
17
17
|
* narrows a query and never interprets a ROW — it moves compiled requests and returns parsed
|
|
18
18
|
* bodies.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { createHash } from 'node:crypto';
|
|
21
|
+
import { ExternalProvider_Connection_DelegationMode, ExternalProvider_Connection_OwnerScope, } from '@wildo-ai/external-connectors-models';
|
|
22
|
+
import { ExternalProvider_ConnectionTargetSchema, } from '@wildo-ai/external-connectors-models';
|
|
23
|
+
import { HttpApiRateBudget, HttpApiTransportBodyEncoding, HttpApiTransportError, HttpApiTransportFailureKind, executeHttpApiTransportCall, } from './http-api-transport.backend.js';
|
|
21
24
|
import { HttpApiRemoteContractError, resolveHttpApiResultPath, } from './http-api-row-projection.backend.js';
|
|
22
25
|
import { HttpApiProviderAccessError, } from './http-api-provider-access.backend.js';
|
|
23
26
|
/** Default fetch over the platform global (Node ≥18); injectable for tests. */
|
|
@@ -25,31 +28,131 @@ export const defaultHttpApiFetch = async (url, init) => {
|
|
|
25
28
|
const response = await fetch(url, init);
|
|
26
29
|
return { status: response.status, ok: response.ok, text: () => response.text() };
|
|
27
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* The binding's declared connection SHAPE, plus the instance ids this execution supplies — ONE
|
|
33
|
+
* place, deliberately.
|
|
34
|
+
*
|
|
35
|
+
* ## What changed, and why the refusal that used to live here is gone
|
|
36
|
+
*
|
|
37
|
+
* This function used to refuse every delegated binding, naming a missing subsystem: "the engine has
|
|
38
|
+
* no outbound per-user token store". That was true when it was written and is not any more — the
|
|
39
|
+
* store exists, is bound, and serves the connection controller (#333). What actually blocked the
|
|
40
|
+
* lift was narrower: the binding carried a two-valued `identityMode`, and `USER_DELEGATED` cannot
|
|
41
|
+
* say WHOSE ACCOUNT is spent. A user's own grant (`USER × SERVICE`) and a tenant's registration
|
|
42
|
+
* acting for one of its members (`ORGANIZATION × USER`) are both "per-user OAuth" and resolve
|
|
43
|
+
* different credentials, so mapping the one field would have silently picked a lane. The binding
|
|
44
|
+
* now carries the shape itself, and this function only has to source the instances.
|
|
45
|
+
*
|
|
46
|
+
* ## The ids come from the EXECUTION, and that is not the resolver reading ambient context
|
|
47
|
+
*
|
|
48
|
+
* `ExternalProvider_ConnectionTarget`'s own contract says a target is supplied BY THE CALL and never
|
|
49
|
+
* invented by the resolver, because "the resolver cannot verify a target it also invented". This is
|
|
50
|
+
* the call side of that split: an httpApiBinding read is triggered by a resource operation, so the
|
|
51
|
+
* organization and the user it runs for ARE the execution's, and naming them here is what leaves the
|
|
52
|
+
* resolver free to authorize them. It refuses rather than falling back — an absent organization on a
|
|
53
|
+
* tenant-owned binding must not quietly become the application's account, which is the exact
|
|
54
|
+
* mis-attribution `resolveProviderSecretForConnection` exists to prevent.
|
|
55
|
+
*
|
|
56
|
+
* ## The rules are the SCHEMA's
|
|
57
|
+
*
|
|
58
|
+
* Every refusal below comes from `ExternalProvider_ConnectionTargetSchema`'s own refinements, which
|
|
59
|
+
* already say — better than a re-statement here would — that an instance-owned connection names
|
|
60
|
+
* which instance, that an application-owned one has no id to name, and that a delegated call must
|
|
61
|
+
* name the user it acts for. Re-deriving them here would be a second copy that drifts.
|
|
62
|
+
*/
|
|
63
|
+
function connectionTargetForBinding(binding, executionContext) {
|
|
64
|
+
const { ownerScope, delegation } = binding.connection;
|
|
65
|
+
const initiator = executionContext.initiatorIds;
|
|
66
|
+
const ownerId = ownerScope === ExternalProvider_Connection_OwnerScope.ORGANIZATION
|
|
67
|
+
? initiator?.organizationId
|
|
68
|
+
: ownerScope === ExternalProvider_Connection_OwnerScope.USER
|
|
69
|
+
? initiator?.userId
|
|
70
|
+
: undefined;
|
|
71
|
+
const candidate = {
|
|
72
|
+
ownerScope,
|
|
73
|
+
delegation,
|
|
74
|
+
...(ownerId === undefined ? {} : { ownerId }),
|
|
75
|
+
...(delegation === ExternalProvider_Connection_DelegationMode.USER && initiator?.userId !== undefined
|
|
76
|
+
? { actingForUserId: initiator.userId }
|
|
77
|
+
: {}),
|
|
78
|
+
};
|
|
79
|
+
const parsed = ExternalProvider_ConnectionTargetSchema.safeParse(candidate);
|
|
80
|
+
if (!parsed.success) {
|
|
81
|
+
throw new HttpApiProviderAccessError(`The binding toward provider '${binding.providerRef}' declares a ${ownerScope} × ${delegation} connection, `
|
|
82
|
+
+ 'and this execution cannot supply what that names: '
|
|
83
|
+
+ parsed.error.issues.map((issue) => issue.message).join(' ')
|
|
84
|
+
+ ' Either trigger the read from an execution that carries them, or declare a connection the application can satisfy alone.');
|
|
85
|
+
}
|
|
86
|
+
return parsed.data;
|
|
87
|
+
}
|
|
28
88
|
export class HttpApiReadClient {
|
|
29
89
|
binding;
|
|
30
90
|
providerAccessResolver;
|
|
31
91
|
fetchImpl;
|
|
32
92
|
rateBudget;
|
|
33
93
|
/**
|
|
34
|
-
* The authenticated uid
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
94
|
+
* The authenticated uid, KEYED ON the credential it was minted under rather than merely
|
|
95
|
+
* remembered against this instance.
|
|
96
|
+
*
|
|
97
|
+
* The uid comes from the documented `common.authenticate(db, login, api_key, {})` handshake and
|
|
98
|
+
* is worth caching: the virtual repository builds ONE client per binding and keeps it for the
|
|
99
|
+
* process lifetime (`http-api-resource-repository.backend.service.ts:163`), so re-authenticating
|
|
100
|
+
* per call would double every read's round trips.
|
|
101
|
+
*
|
|
102
|
+
* What it must never do is outlive the credential. `resolveAccess` runs on EVERY call and reads
|
|
103
|
+
* the secret afresh (environment, provider registry, or a tenant credential row), so a rotation
|
|
104
|
+
* genuinely reaches this class — and a uid remembered against the instance would then be an
|
|
105
|
+
* identity minted under the retired credential, presented on every subsequent `execute_kw`.
|
|
106
|
+
*
|
|
107
|
+
* Keying the cache on the credential is what makes that unrepresentable, and it is deliberately
|
|
108
|
+
* preferred over an `invalidate()` some rotation path has to remember to call: there is no
|
|
109
|
+
* enumeration of rotation sites to get wrong, because a changed credential simply misses. Note
|
|
110
|
+
* the key includes `baseUrl` — a uid is a `res.users` row id on ONE database on ONE instance, so
|
|
111
|
+
* repointing the binding at another host must not reuse it either.
|
|
112
|
+
*
|
|
113
|
+
* The key is a SHA-256 of the tuple rather than the tuple itself, so the API key is not held
|
|
114
|
+
* alive on a long-lived field beyond the call that resolved it. The hash is per `execute_kw`
|
|
115
|
+
* call and costs microseconds against a network round trip.
|
|
116
|
+
*
|
|
117
|
+
* ONE slot, not a map. A map would save a handshake when a credential the client has already
|
|
118
|
+
* seen comes back, at the cost of accumulating one secret-derived entry per retired credential
|
|
119
|
+
* for the lifetime of the process — an unbounded set, to avoid a round trip nobody has measured.
|
|
120
|
+
* A binding names one credential at a time, so the slot is single and a rollback re-authenticates.
|
|
121
|
+
*
|
|
122
|
+
* The single slot stays SAFE now that an Odoo binding MAY name a tenant-owned target (#333, which
|
|
123
|
+
* widened `connectionTargetForBinding` from the `APPLICATION` pin it used to hold). Alternating
|
|
124
|
+
* tenants each miss the key and pay a handshake — slower, and never one tenant acting under
|
|
125
|
+
* another tenant's uid, which is what an instance-remembered uid would have become the moment the
|
|
126
|
+
* scope widened. The key is the credential, so the widening cost a round trip and no correctness.
|
|
127
|
+
*
|
|
128
|
+
* This replaces the slice-1 note that said a rotation needs a process restart, and with it the
|
|
129
|
+
* owed work to "measure against real session-expiry behavior". That measurement was owed for an
|
|
130
|
+
* invalidation TRIGGER, and this design needs no trigger. It also has nothing to expire against:
|
|
131
|
+
* `execute_kw` below re-presents `db` + `uid` + `apiKey` in the args of every single call, so
|
|
132
|
+
* there is no server-side session here whose lifetime we could be racing — the only thing that
|
|
133
|
+
* can retire the uid is the credential (or the instance) it names, which is exactly the key.
|
|
39
134
|
*/
|
|
40
|
-
|
|
135
|
+
odooAuthenticatedIdentity;
|
|
41
136
|
constructor(binding, providerAccessResolver, fetchImpl = defaultHttpApiFetch) {
|
|
42
137
|
this.binding = binding;
|
|
43
138
|
this.providerAccessResolver = providerAccessResolver;
|
|
44
139
|
this.fetchImpl = fetchImpl;
|
|
45
140
|
this.rateBudget = new HttpApiRateBudget(binding.remoteCallSemantics.maxRequestsPerMinute);
|
|
46
141
|
}
|
|
47
|
-
|
|
48
|
-
|
|
142
|
+
/**
|
|
143
|
+
* `async`, so a target this execution cannot satisfy REJECTS rather than throwing synchronously.
|
|
144
|
+
*
|
|
145
|
+
* `connectionTargetForBinding` refuses before the port is reached, and a synchronous throw out of
|
|
146
|
+
* a `Promise`-returning method escapes every `.catch()` a caller attaches — the failure would land
|
|
147
|
+
* as an unhandled exception in whichever frame happened to call it without `await`. The keyword is
|
|
148
|
+
* the whole fix.
|
|
149
|
+
*/
|
|
150
|
+
async resolveAccess(executionContext) {
|
|
151
|
+
return this.providerAccessResolver.resolveAccess(this.binding.providerRef, connectionTargetForBinding(this.binding, executionContext), executionContext);
|
|
49
152
|
}
|
|
50
153
|
// ── OData ────────────────────────────────────────────────────────────────────
|
|
51
154
|
async odataGet(executionContext, compiled) {
|
|
52
|
-
const access = this.resolveAccess(executionContext);
|
|
155
|
+
const access = await this.resolveAccess(executionContext);
|
|
53
156
|
const response = await executeHttpApiTransportCall(this.buildODataRequest(access, compiled), this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget);
|
|
54
157
|
return response.json;
|
|
55
158
|
}
|
|
@@ -69,9 +172,11 @@ export class HttpApiReadClient {
|
|
|
69
172
|
* service-relative) continuation URL; nothing is compiled locally.
|
|
70
173
|
*/
|
|
71
174
|
async odataGetByUrl(executionContext, url) {
|
|
72
|
-
const access = this.resolveAccess(executionContext);
|
|
175
|
+
const access = await this.resolveAccess(executionContext);
|
|
73
176
|
const absoluteUrl = url.startsWith('http') ? url : `${access.baseUrl}${url.startsWith('/') ? '' : '/'}${url}`;
|
|
74
|
-
const response = await executeHttpApiTransportCall(
|
|
177
|
+
const response = await executeHttpApiTransportCall(
|
|
178
|
+
// A paging continuation is a read: safe to re-send after a timeout.
|
|
179
|
+
{ method: 'GET', url: absoluteUrl, headers: { Accept: 'application/json', ...access.headers }, retrySafe: true }, this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget);
|
|
75
180
|
return response.json;
|
|
76
181
|
}
|
|
77
182
|
/**
|
|
@@ -85,7 +190,7 @@ export class HttpApiReadClient {
|
|
|
85
190
|
*/
|
|
86
191
|
async odataMetadataText(executionContext) {
|
|
87
192
|
try {
|
|
88
|
-
const access = this.resolveAccess(executionContext);
|
|
193
|
+
const access = await this.resolveAccess(executionContext);
|
|
89
194
|
const response = await this.fetchImpl(`${access.baseUrl}/$metadata`, {
|
|
90
195
|
method: 'GET',
|
|
91
196
|
headers: { Accept: 'application/xml', ...access.headers },
|
|
@@ -106,11 +211,12 @@ export class HttpApiReadClient {
|
|
|
106
211
|
method: 'GET',
|
|
107
212
|
url: `${access.baseUrl}${compiled.path}${search.length > 0 ? `?${search}` : ''}`,
|
|
108
213
|
headers: { Accept: 'application/json', ...access.headers },
|
|
214
|
+
retrySafe: true,
|
|
109
215
|
};
|
|
110
216
|
}
|
|
111
217
|
// ── REST_JSON ────────────────────────────────────────────────────────────────
|
|
112
218
|
async restJson(executionContext, compiled) {
|
|
113
|
-
const access = this.resolveAccess(executionContext);
|
|
219
|
+
const access = await this.resolveAccess(executionContext);
|
|
114
220
|
const response = await executeHttpApiTransportCall(this.buildRestJsonRequest(access, compiled), this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget);
|
|
115
221
|
if (compiled.jsonRpc) {
|
|
116
222
|
const envelope = response.json;
|
|
@@ -149,7 +255,10 @@ export class HttpApiReadClient {
|
|
|
149
255
|
method: 'POST',
|
|
150
256
|
url: `${access.baseUrl}${compiled.path}`,
|
|
151
257
|
headers: { Accept: 'application/json', ...access.headers },
|
|
152
|
-
|
|
258
|
+
body: { encoding: HttpApiTransportBodyEncoding.JSON, value: { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: compiled.params, id: 1 } },
|
|
259
|
+
// POST-shaped, read by construction: the read compilers are the only producers of this
|
|
260
|
+
// request and they compile nothing but reads, so re-sending it cannot duplicate a write.
|
|
261
|
+
retrySafe: true,
|
|
153
262
|
};
|
|
154
263
|
}
|
|
155
264
|
if (compiled.method === 'POST') {
|
|
@@ -157,7 +266,9 @@ export class HttpApiReadClient {
|
|
|
157
266
|
method: 'POST',
|
|
158
267
|
url: `${access.baseUrl}${compiled.path}`,
|
|
159
268
|
headers: { Accept: 'application/json', ...access.headers },
|
|
160
|
-
|
|
269
|
+
body: { encoding: HttpApiTransportBodyEncoding.JSON, value: compiled.params },
|
|
270
|
+
// Same argument as the JSON-RPC branch above: a POST-shaped SEARCH is still a read.
|
|
271
|
+
retrySafe: true,
|
|
161
272
|
};
|
|
162
273
|
}
|
|
163
274
|
const search = Object.entries(compiled.params)
|
|
@@ -167,11 +278,12 @@ export class HttpApiReadClient {
|
|
|
167
278
|
method: 'GET',
|
|
168
279
|
url: `${access.baseUrl}${compiled.path}${search.length > 0 ? `?${search}` : ''}`,
|
|
169
280
|
headers: { Accept: 'application/json', ...access.headers },
|
|
281
|
+
retrySafe: true,
|
|
170
282
|
};
|
|
171
283
|
}
|
|
172
284
|
// ── Odoo execute_kw ──────────────────────────────────────────────────────────
|
|
173
285
|
async odooExecuteKw(executionContext, call) {
|
|
174
|
-
const access = this.resolveAccess(executionContext);
|
|
286
|
+
const access = await this.resolveAccess(executionContext);
|
|
175
287
|
const credentials = access.jsonRpcInArgsCredentials;
|
|
176
288
|
if (!credentials) {
|
|
177
289
|
// An ODOO_JSONRPC binding on a provider whose contract declares no in-args auth cannot
|
|
@@ -179,20 +291,33 @@ export class HttpApiReadClient {
|
|
|
179
291
|
throw new HttpApiProviderAccessError(`Provider '${this.binding.providerRef}' declares no jsonRpcInArgsAuth on its rest contract, but this binding speaks ODOO_JSONRPC — `
|
|
180
292
|
+ 'the target authenticates INSIDE the RPC args; declare jsonRpcInArgsAuth (dbEnvVarName, loginEnvVarName) on the provider module.');
|
|
181
293
|
}
|
|
182
|
-
|
|
294
|
+
// Resolved from THIS call's access, so a rotated credential produces a different key and the
|
|
295
|
+
// cached identity below simply does not match — no invalidation call, and therefore no
|
|
296
|
+
// rotation path that can forget to make one.
|
|
297
|
+
const credentialKey = HttpApiReadClient.odooCredentialKey(access.baseUrl, credentials);
|
|
298
|
+
let authenticatedUid = this.odooAuthenticatedIdentity?.credentialKey === credentialKey
|
|
299
|
+
? this.odooAuthenticatedIdentity.uid
|
|
300
|
+
: undefined;
|
|
301
|
+
if (authenticatedUid === undefined) {
|
|
183
302
|
const uid = await this.executeOdooRpc(access, 'common', 'authenticate', [
|
|
184
303
|
credentials.db, credentials.login, credentials.apiKey, {},
|
|
185
304
|
]);
|
|
186
305
|
if (typeof uid !== 'number' || !Number.isInteger(uid) || uid <= 0) {
|
|
187
306
|
// Odoo answers `false` for rejected credentials — a terminal answer, spelled loudly.
|
|
307
|
+
//
|
|
308
|
+
// The previously cached identity is left alone rather than dropped: it belongs to a
|
|
309
|
+
// DIFFERENT key (that is why we are here), so it can never be served for these
|
|
310
|
+
// credentials, and keeping it means a rotation that is rolled back does not pay a second
|
|
311
|
+
// handshake. Only a successful authenticate writes the field.
|
|
188
312
|
throw new HttpApiProviderAccessError(`Odoo rejected the credentials for provider '${this.binding.providerRef}' (db '${credentials.db}', login '${credentials.login}'): `
|
|
189
313
|
+ `authenticate answered ${JSON.stringify(uid)} instead of a uid.`);
|
|
190
314
|
}
|
|
191
|
-
|
|
315
|
+
authenticatedUid = uid;
|
|
316
|
+
this.odooAuthenticatedIdentity = { credentialKey, uid };
|
|
192
317
|
}
|
|
193
318
|
return this.executeOdooRpc(access, 'object', 'execute_kw', [
|
|
194
319
|
credentials.db,
|
|
195
|
-
|
|
320
|
+
authenticatedUid,
|
|
196
321
|
credentials.apiKey,
|
|
197
322
|
this.binding.entityRef,
|
|
198
323
|
call.method,
|
|
@@ -200,12 +325,29 @@ export class HttpApiReadClient {
|
|
|
200
325
|
call.kwargs,
|
|
201
326
|
]);
|
|
202
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* The identity a cached uid belongs to: the instance it was minted on, and the exact credential
|
|
330
|
+
* it was minted with.
|
|
331
|
+
*
|
|
332
|
+
* `JSON.stringify` over the tuple rather than a joined string because JSON escapes each member,
|
|
333
|
+
* so no combination of separators inside a db name, a login or a key can make two different
|
|
334
|
+
* tuples produce one key.
|
|
335
|
+
*/
|
|
336
|
+
static odooCredentialKey(baseUrl, credentials) {
|
|
337
|
+
return createHash('sha256')
|
|
338
|
+
.update(JSON.stringify([baseUrl, credentials.db, credentials.login, credentials.apiKey]))
|
|
339
|
+
.digest('hex');
|
|
340
|
+
}
|
|
203
341
|
async executeOdooRpc(access, service, method, args) {
|
|
204
342
|
const response = await executeHttpApiTransportCall({
|
|
205
343
|
method: 'POST',
|
|
206
344
|
url: `${access.baseUrl}/jsonrpc`,
|
|
207
345
|
headers: { Accept: 'application/json', ...access.headers },
|
|
208
|
-
|
|
346
|
+
body: { encoding: HttpApiTransportBodyEncoding.JSON, value: { jsonrpc: '2.0', method: 'call', params: { service, method, args }, id: 1 } },
|
|
347
|
+
// Two callers, both safe to repeat: `common.authenticate` (a pure question) and
|
|
348
|
+
// `object.execute_kw` with a read method — the Odoo compiler emits `search_read`/
|
|
349
|
+
// `search_count` and nothing that writes.
|
|
350
|
+
retrySafe: true,
|
|
209
351
|
}, this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget);
|
|
210
352
|
const envelope = response.json;
|
|
211
353
|
if (envelope && typeof envelope === 'object' && envelope.error) {
|
|
@@ -216,11 +358,14 @@ export class HttpApiReadClient {
|
|
|
216
358
|
// ── Erasure-family calls (stance 6b — the door ORCHESTRATES, the client frames) ──
|
|
217
359
|
/** OData's canonical `DELETE /EntitySet(key)`; a 404 is the row already gone (idempotent). */
|
|
218
360
|
async odataDeleteByPath(executionContext, path) {
|
|
219
|
-
const access = this.resolveAccess(executionContext);
|
|
361
|
+
const access = await this.resolveAccess(executionContext);
|
|
220
362
|
await this.rawCallTolerating404({
|
|
221
363
|
method: 'DELETE',
|
|
222
364
|
url: `${access.baseUrl}${path}`,
|
|
223
365
|
headers: { Accept: 'application/json', ...access.headers },
|
|
366
|
+
// Idempotent by key: the second DELETE of a gone row answers 404, which this door reads as
|
|
367
|
+
// already-gone. That is what makes a retried timeout safe here and unsafe on a create.
|
|
368
|
+
retrySafe: true,
|
|
224
369
|
});
|
|
225
370
|
}
|
|
226
371
|
/**
|
|
@@ -229,14 +374,17 @@ export class HttpApiReadClient {
|
|
|
229
374
|
* transport error.
|
|
230
375
|
*/
|
|
231
376
|
async restDeclaredErasureCall(executionContext, compiled) {
|
|
232
|
-
const access = this.resolveAccess(executionContext);
|
|
377
|
+
const access = await this.resolveAccess(executionContext);
|
|
233
378
|
const response = await this.rawCallTolerating404({
|
|
234
379
|
method: compiled.method,
|
|
235
380
|
url: `${access.baseUrl}${compiled.path}`,
|
|
236
381
|
headers: { Accept: 'application/json', ...access.headers },
|
|
237
|
-
|
|
238
|
-
? { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: {}, id: 1 }
|
|
382
|
+
body: compiled.jsonRpc
|
|
383
|
+
? { encoding: HttpApiTransportBodyEncoding.JSON, value: { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: {}, id: 1 } }
|
|
239
384
|
: undefined,
|
|
385
|
+
// A declared erasure addresses ONE row by key and is idempotent for the same reason the
|
|
386
|
+
// OData delete above is; the repository's own remediation for a partial failure is a re-run.
|
|
387
|
+
retrySafe: true,
|
|
240
388
|
});
|
|
241
389
|
if (compiled.jsonRpc && response !== undefined) {
|
|
242
390
|
const envelope = response;
|
package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-api-read-client.backend.js","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/http-api/http-api-read-client.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,GAG5B,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,0BAA0B,GAG3B,MAAM,oCAAoC,CAAC;AAE5C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,mBAAmB,GAAqB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACvE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAmB,CAAC,CAAC;IACvD,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;AACnF,CAAC,CAAC;AAEF,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AAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,2BAA2B,CAAC,YAAY,EAAE,CAC7G,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,gFAAgF;IAEhF,sEAAsE;IAC/D,KAAK,CAAC,OAAO,CAAC,OAAgC;QACnD,MAAM,QAAQ,GAAG,MAAM,2BAA2B,CAChD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAC3E,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,0FAA0F;IACnF,KAAK,CAAC,oBAAoB,CAAC,OAAgC;QAChE,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,qBAAqB,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,GAAG;gBAAE,OAAO,SAAS,CAAC;YAC5F,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * `HttpApiReadClient` — THE one implementation of the HTTP-API dialect mechanics\n * (partial-resource paper, PR-29): provider-access resolution, transport execution (timeout /\n * bounded retry / rate budget), the per-dialect wire framing (OData GET, REST_JSON GET/POST +\n * JSON-RPC envelope semantics, Odoo `execute_kw` with the `common.authenticate` handshake and\n * the instance-cached uid), and the 404-as-null read tolerance.\n *\n * TWO consumers, by design: the VIRTUAL repository (`http-api-resource-repository`) and the\n * pipeline extraction source (P-2). The declaration layer is split on purpose — a pipeline is\n * not a persistence adapter — but the runtime middle must be structurally un-duplicable: this\n * class is where \"same mechanism\" stops being a discipline and becomes a fact. The drift pin\n * (`http-api-read-client.single-authority.test.ts`) refuses a second `authenticate` handshake\n * anywhere in the directory.\n *\n * Everything above the wire stays with the consumer: T-set translation, projection, scope\n * checks, audit emission, erasure orchestration, mapping/loading. This class never widens or\n * narrows a query and never interprets a ROW — it moves compiled requests and returns parsed\n * bodies.\n */\n\nimport type {\n HttpApiResourceBinding,\n} from '@wildo-ai/saas-models/external-data';\n\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\nimport {\n HttpApiRateBudget,\n HttpApiTransportError,\n HttpApiTransportFailureKind,\n executeHttpApiTransportCall,\n type HttpApiFetchLike,\n type HttpApiTransportRequest,\n} from './http-api-transport.backend';\nimport type { ODataCompiledRequest } from './odata-query-compiler.backend';\nimport type { RestJsonCompiledErasureRequest, RestJsonCompiledRequest } from './rest-json-query-compiler.backend';\nimport type { OdooCompiledCall } from './odoo-jsonrpc-compiler.backend';\nimport {\n HttpApiRemoteContractError,\n resolveHttpApiResultPath,\n} from './http-api-row-projection.backend';\nimport {\n HttpApiProviderAccessError,\n type HttpApiProviderAccess,\n type HttpApiProviderAccessResolver,\n} from './http-api-provider-access.backend';\n\n/** Default fetch over the platform global (Node ≥18); injectable for tests. */\nexport const defaultHttpApiFetch: HttpApiFetchLike = async (url, init) => {\n const response = await fetch(url, init as RequestInit);\n return { status: response.status, ok: response.ok, text: () => response.text() };\n};\n\nexport class HttpApiReadClient {\n private readonly rateBudget: HttpApiRateBudget;\n\n /**\n * The authenticated uid for this binding's credentials, resolved once per client instance\n * through the documented `common.authenticate(db, login, api_key, {})` handshake and cached —\n * clients are constructed once per consumer and the credential set is instance-stable. A\n * credential rotation therefore needs a process restart in slice 1 (recorded; an invalidation\n * hook belongs with the runtime-proof work, measured against real session-expiry behavior).\n */\n private odooAuthenticatedUid?: number;\n\n constructor(\n private readonly binding: HttpApiResourceBinding,\n private readonly providerAccessResolver: HttpApiProviderAccessResolver,\n private readonly fetchImpl: HttpApiFetchLike = defaultHttpApiFetch,\n ) {\n this.rateBudget = new HttpApiRateBudget(binding.remoteCallSemantics.maxRequestsPerMinute);\n }\n\n public resolveAccess(executionContext: ExecutionContext<any>): HttpApiProviderAccess {\n return this.providerAccessResolver.resolveAccess(this.binding, executionContext);\n }\n\n // ── OData ────────────────────────────────────────────────────────────────────\n\n public async odataGet(executionContext: ExecutionContext<any>, compiled: ODataCompiledRequest): Promise<unknown> {\n const access = this.resolveAccess(executionContext);\n const response = await executeHttpApiTransportCall(\n this.buildODataRequest(access, compiled), this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n return response.json;\n }\n\n public async odataGetOrNull(executionContext: ExecutionContext<any>, compiled: ODataCompiledRequest): Promise<unknown | null> {\n try {\n return await this.odataGet(executionContext, compiled);\n } catch (error) {\n if (error instanceof HttpApiTransportError && error.detail.status === 404) return null;\n throw error;\n }\n }\n\n /**\n * Follow an OData server-driven paging link (`@odata.nextLink`) — the drift-safe extraction\n * paging the v3.1 discipline mandates. The link is the server's own absolute (or\n * service-relative) continuation URL; nothing is compiled locally.\n */\n public async odataGetByUrl(executionContext: ExecutionContext<any>, url: string): Promise<unknown> {\n const access = this.resolveAccess(executionContext);\n const absoluteUrl = url.startsWith('http') ? url : `${access.baseUrl}${url.startsWith('/') ? '' : '/'}${url}`;\n const response = await executeHttpApiTransportCall(\n { method: 'GET', url: absoluteUrl, headers: { Accept: 'application/json', ...access.headers } },\n this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n return response.json;\n }\n\n /**\n * `GET /$metadata` as raw XML text — the WARN-only schema-drift probe's input (partial-resource\n * paper, PR-21). Deliberately OUTSIDE the JSON transport: the EDMX document is XML, and the\n * transport treats a 2xx non-JSON body as a contract failure — correct for every data read,\n * wrong for this one diagnostic document. One plain fetch, no retry, no rate-budget draw\n * (a diagnostic must never spend the data path's budget), and EVERY failure — non-200, network\n * error, a server that does not serve `$metadata` at all — answers `null`: the probe's caller\n * treats null as \"nothing to compare\", never as drift.\n */\n public async odataMetadataText(executionContext: ExecutionContext<any>): Promise<string | null> {\n try {\n const access = this.resolveAccess(executionContext);\n const response = await this.fetchImpl(`${access.baseUrl}/$metadata`, {\n method: 'GET',\n headers: { Accept: 'application/xml', ...access.headers },\n });\n if (response.status !== 200) return null;\n return await response.text();\n } catch {\n return null;\n }\n }\n\n private buildODataRequest(access: { baseUrl: string; headers: Record<string, string> }, compiled: ODataCompiledRequest): HttpApiTransportRequest {\n const search = Object.entries(compiled.params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n return {\n method: 'GET',\n url: `${access.baseUrl}${compiled.path}${search.length > 0 ? `?${search}` : ''}`,\n headers: { Accept: 'application/json', ...access.headers },\n };\n }\n\n // ── REST_JSON ────────────────────────────────────────────────────────────────\n\n public async restJson(executionContext: ExecutionContext<any>, compiled: RestJsonCompiledRequest): Promise<unknown> {\n const access = this.resolveAccess(executionContext);\n const response = await executeHttpApiTransportCall(\n this.buildRestJsonRequest(access, compiled), this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n if (compiled.jsonRpc) {\n const envelope = response.json as { result?: unknown; error?: { code?: number; message?: string } };\n if (envelope && typeof envelope === 'object' && envelope.error) {\n throw new HttpApiTransportError(\n `JSON-RPC error from the target: ${envelope.error.message ?? 'unknown'} (code ${envelope.error.code ?? '?'})`,\n { url: compiled.path, method: 'POST', attempts: 1, kind: HttpApiTransportFailureKind.REMOTE_ERROR },\n );\n }\n return envelope?.result;\n }\n return response.json;\n }\n\n /**\n * Single-row REST read with the dialect's no-row semantics: a remote 404, and a `null`/`false`\n * payload at the declared resultPath, are the target's honest \"no row\"; an ABSENT leaf is a\n * contract breach, never a silent not-found.\n */\n public async restJsonReadOrNull(executionContext: ExecutionContext<any>, compiled: RestJsonCompiledRequest): Promise<unknown | null> {\n try {\n const body = await this.restJson(executionContext, compiled);\n const payload = resolveHttpApiResultPath(body, compiled.resultPath);\n if (payload === null || payload === false) return null;\n if (payload === undefined) {\n throw new HttpApiRemoteContractError(\n `The remote read answered 200 but the declared resultPath '${compiled.resultPath ?? '(body)'}' resolves to nothing.`,\n );\n }\n return payload;\n } catch (error) {\n if (error instanceof HttpApiTransportError && error.detail.status === 404) return null;\n throw error;\n }\n }\n\n private buildRestJsonRequest(access: { baseUrl: string; headers: Record<string, string> }, compiled: RestJsonCompiledRequest): HttpApiTransportRequest {\n if (compiled.jsonRpc) {\n return {\n method: 'POST',\n url: `${access.baseUrl}${compiled.path}`,\n headers: { Accept: 'application/json', ...access.headers },\n jsonBody: { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: compiled.params, id: 1 },\n };\n }\n if (compiled.method === 'POST') {\n return {\n method: 'POST',\n url: `${access.baseUrl}${compiled.path}`,\n headers: { Accept: 'application/json', ...access.headers },\n jsonBody: compiled.params,\n };\n }\n const search = Object.entries(compiled.params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)\n .join('&');\n return {\n method: 'GET',\n url: `${access.baseUrl}${compiled.path}${search.length > 0 ? `?${search}` : ''}`,\n headers: { Accept: 'application/json', ...access.headers },\n };\n }\n\n // ── Odoo execute_kw ──────────────────────────────────────────────────────────\n\n public async odooExecuteKw(executionContext: ExecutionContext<any>, call: OdooCompiledCall): Promise<unknown> {\n const access = this.resolveAccess(executionContext);\n const credentials = access.jsonRpcInArgsCredentials;\n if (!credentials) {\n // An ODOO_JSONRPC binding on a provider whose contract declares no in-args auth cannot\n // authenticate at all — the header credential is unread by `/jsonrpc`.\n throw new HttpApiProviderAccessError(\n `Provider '${this.binding.providerRef}' declares no jsonRpcInArgsAuth on its rest contract, but this binding speaks ODOO_JSONRPC — `\n + 'the target authenticates INSIDE the RPC args; declare jsonRpcInArgsAuth (dbEnvVarName, loginEnvVarName) on the provider module.',\n );\n }\n\n if (this.odooAuthenticatedUid === undefined) {\n const uid = await this.executeOdooRpc(access, 'common', 'authenticate', [\n credentials.db, credentials.login, credentials.apiKey, {},\n ]);\n if (typeof uid !== 'number' || !Number.isInteger(uid) || uid <= 0) {\n // Odoo answers `false` for rejected credentials — a terminal answer, spelled loudly.\n throw new HttpApiProviderAccessError(\n `Odoo rejected the credentials for provider '${this.binding.providerRef}' (db '${credentials.db}', login '${credentials.login}'): `\n + `authenticate answered ${JSON.stringify(uid)} instead of a uid.`,\n );\n }\n this.odooAuthenticatedUid = uid;\n }\n\n return this.executeOdooRpc(access, 'object', 'execute_kw', [\n credentials.db,\n this.odooAuthenticatedUid,\n credentials.apiKey,\n this.binding.entityRef,\n call.method,\n call.positionalArgs,\n call.kwargs,\n ]);\n }\n\n private async executeOdooRpc(\n access: { baseUrl: string; headers: Record<string, string> },\n service: string,\n method: string,\n args: unknown[],\n ): Promise<unknown> {\n const response = await executeHttpApiTransportCall(\n {\n method: 'POST',\n url: `${access.baseUrl}/jsonrpc`,\n headers: { Accept: 'application/json', ...access.headers },\n jsonBody: { jsonrpc: '2.0', method: 'call', params: { service, method, args }, id: 1 },\n },\n this.binding.remoteCallSemantics,\n this.fetchImpl,\n this.rateBudget,\n );\n const envelope = response.json as { result?: unknown; error?: { code?: number; message?: string; data?: { message?: string } } };\n if (envelope && typeof envelope === 'object' && envelope.error) {\n throw new HttpApiTransportError(\n `Odoo JSON-RPC error: ${envelope.error.data?.message ?? envelope.error.message ?? 'unknown'} (code ${envelope.error.code ?? '?'})`,\n { url: '/jsonrpc', method: 'POST', attempts: 1, kind: HttpApiTransportFailureKind.REMOTE_ERROR },\n );\n }\n return envelope?.result;\n }\n\n // ── Erasure-family calls (stance 6b — the door ORCHESTRATES, the client frames) ──\n\n /** OData's canonical `DELETE /EntitySet(key)`; a 404 is the row already gone (idempotent). */\n public async odataDeleteByPath(executionContext: ExecutionContext<any>, path: string): Promise<void> {\n const access = this.resolveAccess(executionContext);\n await this.rawCallTolerating404({\n method: 'DELETE',\n url: `${access.baseUrl}${path}`,\n headers: { Accept: 'application/json', ...access.headers },\n });\n }\n\n /**\n * One declared REST_JSON erasure call (stance 6b explicit spec): frames method/path/RPC\n * envelope, tolerates 404 as already-gone, and surfaces a JSON-RPC error envelope as a\n * transport error.\n */\n public async restDeclaredErasureCall(\n executionContext: ExecutionContext<any>,\n compiled: RestJsonCompiledErasureRequest,\n ): Promise<void> {\n const access = this.resolveAccess(executionContext);\n const response = await this.rawCallTolerating404({\n method: compiled.method,\n url: `${access.baseUrl}${compiled.path}`,\n headers: { Accept: 'application/json', ...access.headers },\n jsonBody: compiled.jsonRpc\n ? { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: {}, id: 1 }\n : undefined,\n });\n if (compiled.jsonRpc && response !== undefined) {\n const envelope = response as { error?: { code?: number; message?: string } };\n if (envelope && typeof envelope === 'object' && envelope.error) {\n throw new HttpApiTransportError(\n `JSON-RPC error from the declared erasure operation: ${envelope.error.message ?? 'unknown'} (code ${envelope.error.code ?? '?'})`,\n { url: compiled.path, method: compiled.method, attempts: 1, kind: HttpApiTransportFailureKind.REMOTE_ERROR },\n );\n }\n }\n }\n\n // ── Generic transport ────────────────────────────────────────────────────────\n\n /** One transport call, body parsed; the caller frames the request. */\n public async rawCall(request: HttpApiTransportRequest): Promise<unknown> {\n const response = await executeHttpApiTransportCall(\n request, this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n return response.json;\n }\n\n /** As {@link rawCall}, tolerating a remote 404 as \"already gone\" (idempotent deletes). */\n public async rawCallTolerating404(request: HttpApiTransportRequest): Promise<unknown> {\n try {\n return await this.rawCall(request);\n } catch (error) {\n if (error instanceof HttpApiTransportError && error.detail.status === 404) return undefined;\n throw error;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"http-api-read-client.backend.js","sourceRoot":"","sources":["../../../../../../../src/base-classes/services/repositories/http-api/http-api-read-client.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,0CAA0C,EAC1C,sCAAsC,GACvC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,uCAAuC,GAExC,MAAM,sCAAsC,CAAC;AAO9C,OAAO,EACL,iBAAiB,EACj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,KAAK,CAAC,oBAAoB,CAAC,OAAgC;QAChE,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,qBAAqB,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,GAAG;gBAAE,OAAO,SAAS,CAAC;YAC5F,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * `HttpApiReadClient` — THE one implementation of the HTTP-API dialect mechanics\n * (partial-resource paper, PR-29): provider-access resolution, transport execution (timeout /\n * bounded retry / rate budget), the per-dialect wire framing (OData GET, REST_JSON GET/POST +\n * JSON-RPC envelope semantics, Odoo `execute_kw` with the `common.authenticate` handshake and\n * the credential-keyed cached uid), and the 404-as-null read tolerance.\n *\n * TWO consumers, by design: the VIRTUAL repository (`http-api-resource-repository`) and the\n * pipeline extraction source (P-2). The declaration layer is split on purpose — a pipeline is\n * not a persistence adapter — but the runtime middle must be structurally un-duplicable: this\n * class is where \"same mechanism\" stops being a discipline and becomes a fact. The drift pin\n * (`http-api-read-client.single-authority.test.ts`) refuses a second `authenticate` handshake\n * anywhere in the directory.\n *\n * Everything above the wire stays with the consumer: T-set translation, projection, scope\n * checks, audit emission, erasure orchestration, mapping/loading. This class never widens or\n * narrows a query and never interprets a ROW — it moves compiled requests and returns parsed\n * bodies.\n */\n\nimport { createHash } from 'node:crypto';\n\nimport {\n ExternalProvider_Connection_DelegationMode,\n ExternalProvider_Connection_OwnerScope,\n} from '@wildo-ai/external-connectors-models';\nimport {\n ExternalProvider_ConnectionTargetSchema,\n type ExternalProvider_ConnectionTarget,\n} from '@wildo-ai/external-connectors-models';\nimport type {\n HttpApiResourceBinding,\n} from '@wildo-ai/saas-models/external-data';\n\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\n\nimport {\n HttpApiRateBudget,\n HttpApiTransportBodyEncoding,\n HttpApiTransportError,\n HttpApiTransportFailureKind,\n executeHttpApiTransportCall,\n type HttpApiFetchLike,\n type HttpApiTransportRequest,\n} from './http-api-transport.backend';\nimport type { ODataCompiledRequest } from './odata-query-compiler.backend';\nimport type { RestJsonCompiledErasureRequest, RestJsonCompiledRequest } from './rest-json-query-compiler.backend';\nimport type { OdooCompiledCall } from './odoo-jsonrpc-compiler.backend';\nimport {\n HttpApiRemoteContractError,\n resolveHttpApiResultPath,\n} from './http-api-row-projection.backend';\nimport {\n HttpApiProviderAccessError,\n type HttpApiProviderAccess,\n type HttpApiProviderAccessResolver,\n} from './http-api-provider-access.backend';\n\n/** Default fetch over the platform global (Node ≥18); injectable for tests. */\nexport const defaultHttpApiFetch: HttpApiFetchLike = async (url, init) => {\n const response = await fetch(url, init as RequestInit);\n return { status: response.status, ok: response.ok, text: () => response.text() };\n};\n\n/**\n * The binding's declared connection SHAPE, plus the instance ids this execution supplies — ONE\n * place, deliberately.\n *\n * ## What changed, and why the refusal that used to live here is gone\n *\n * This function used to refuse every delegated binding, naming a missing subsystem: \"the engine has\n * no outbound per-user token store\". That was true when it was written and is not any more — the\n * store exists, is bound, and serves the connection controller (#333). What actually blocked the\n * lift was narrower: the binding carried a two-valued `identityMode`, and `USER_DELEGATED` cannot\n * say WHOSE ACCOUNT is spent. A user's own grant (`USER × SERVICE`) and a tenant's registration\n * acting for one of its members (`ORGANIZATION × USER`) are both \"per-user OAuth\" and resolve\n * different credentials, so mapping the one field would have silently picked a lane. The binding\n * now carries the shape itself, and this function only has to source the instances.\n *\n * ## The ids come from the EXECUTION, and that is not the resolver reading ambient context\n *\n * `ExternalProvider_ConnectionTarget`'s own contract says a target is supplied BY THE CALL and never\n * invented by the resolver, because \"the resolver cannot verify a target it also invented\". This is\n * the call side of that split: an httpApiBinding read is triggered by a resource operation, so the\n * organization and the user it runs for ARE the execution's, and naming them here is what leaves the\n * resolver free to authorize them. It refuses rather than falling back — an absent organization on a\n * tenant-owned binding must not quietly become the application's account, which is the exact\n * mis-attribution `resolveProviderSecretForConnection` exists to prevent.\n *\n * ## The rules are the SCHEMA's\n *\n * Every refusal below comes from `ExternalProvider_ConnectionTargetSchema`'s own refinements, which\n * already say — better than a re-statement here would — that an instance-owned connection names\n * which instance, that an application-owned one has no id to name, and that a delegated call must\n * name the user it acts for. Re-deriving them here would be a second copy that drifts.\n */\nfunction connectionTargetForBinding(\n binding: Pick<HttpApiResourceBinding, 'providerRef' | 'connection'>,\n executionContext: ExecutionContext<any>,\n): ExternalProvider_ConnectionTarget {\n const { ownerScope, delegation } = binding.connection;\n const initiator = executionContext.initiatorIds;\n\n const ownerId = ownerScope === ExternalProvider_Connection_OwnerScope.ORGANIZATION\n ? initiator?.organizationId\n : ownerScope === ExternalProvider_Connection_OwnerScope.USER\n ? initiator?.userId\n : undefined;\n\n const candidate = {\n ownerScope,\n delegation,\n ...(ownerId === undefined ? {} : { ownerId }),\n ...(delegation === ExternalProvider_Connection_DelegationMode.USER && initiator?.userId !== undefined\n ? { actingForUserId: initiator.userId }\n : {}),\n };\n\n const parsed = ExternalProvider_ConnectionTargetSchema.safeParse(candidate);\n if (!parsed.success) {\n throw new HttpApiProviderAccessError(\n `The binding toward provider '${binding.providerRef}' declares a ${ownerScope} × ${delegation} connection, `\n + 'and this execution cannot supply what that names: '\n + parsed.error.issues.map((issue) => issue.message).join(' ')\n + ' Either trigger the read from an execution that carries them, or declare a connection the application can satisfy alone.',\n );\n }\n return parsed.data;\n}\n\nexport class HttpApiReadClient {\n private readonly rateBudget: HttpApiRateBudget;\n\n /**\n * The authenticated uid, KEYED ON the credential it was minted under rather than merely\n * remembered against this instance.\n *\n * The uid comes from the documented `common.authenticate(db, login, api_key, {})` handshake and\n * is worth caching: the virtual repository builds ONE client per binding and keeps it for the\n * process lifetime (`http-api-resource-repository.backend.service.ts:163`), so re-authenticating\n * per call would double every read's round trips.\n *\n * What it must never do is outlive the credential. `resolveAccess` runs on EVERY call and reads\n * the secret afresh (environment, provider registry, or a tenant credential row), so a rotation\n * genuinely reaches this class — and a uid remembered against the instance would then be an\n * identity minted under the retired credential, presented on every subsequent `execute_kw`.\n *\n * Keying the cache on the credential is what makes that unrepresentable, and it is deliberately\n * preferred over an `invalidate()` some rotation path has to remember to call: there is no\n * enumeration of rotation sites to get wrong, because a changed credential simply misses. Note\n * the key includes `baseUrl` — a uid is a `res.users` row id on ONE database on ONE instance, so\n * repointing the binding at another host must not reuse it either.\n *\n * The key is a SHA-256 of the tuple rather than the tuple itself, so the API key is not held\n * alive on a long-lived field beyond the call that resolved it. The hash is per `execute_kw`\n * call and costs microseconds against a network round trip.\n *\n * ONE slot, not a map. A map would save a handshake when a credential the client has already\n * seen comes back, at the cost of accumulating one secret-derived entry per retired credential\n * for the lifetime of the process — an unbounded set, to avoid a round trip nobody has measured.\n * A binding names one credential at a time, so the slot is single and a rollback re-authenticates.\n *\n * The single slot stays SAFE now that an Odoo binding MAY name a tenant-owned target (#333, which\n * widened `connectionTargetForBinding` from the `APPLICATION` pin it used to hold). Alternating\n * tenants each miss the key and pay a handshake — slower, and never one tenant acting under\n * another tenant's uid, which is what an instance-remembered uid would have become the moment the\n * scope widened. The key is the credential, so the widening cost a round trip and no correctness.\n *\n * This replaces the slice-1 note that said a rotation needs a process restart, and with it the\n * owed work to \"measure against real session-expiry behavior\". That measurement was owed for an\n * invalidation TRIGGER, and this design needs no trigger. It also has nothing to expire against:\n * `execute_kw` below re-presents `db` + `uid` + `apiKey` in the args of every single call, so\n * there is no server-side session here whose lifetime we could be racing — the only thing that\n * can retire the uid is the credential (or the instance) it names, which is exactly the key.\n */\n private odooAuthenticatedIdentity?: { credentialKey: string; uid: number };\n\n constructor(\n private readonly binding: HttpApiResourceBinding,\n private readonly providerAccessResolver: HttpApiProviderAccessResolver,\n private readonly fetchImpl: HttpApiFetchLike = defaultHttpApiFetch,\n ) {\n this.rateBudget = new HttpApiRateBudget(binding.remoteCallSemantics.maxRequestsPerMinute);\n }\n\n /**\n * `async`, so a target this execution cannot satisfy REJECTS rather than throwing synchronously.\n *\n * `connectionTargetForBinding` refuses before the port is reached, and a synchronous throw out of\n * a `Promise`-returning method escapes every `.catch()` a caller attaches — the failure would land\n * as an unhandled exception in whichever frame happened to call it without `await`. The keyword is\n * the whole fix.\n */\n public async resolveAccess(executionContext: ExecutionContext<any>): Promise<HttpApiProviderAccess> {\n return this.providerAccessResolver.resolveAccess(\n this.binding.providerRef,\n connectionTargetForBinding(this.binding, executionContext),\n executionContext,\n );\n }\n\n // ── OData ────────────────────────────────────────────────────────────────────\n\n public async odataGet(executionContext: ExecutionContext<any>, compiled: ODataCompiledRequest): Promise<unknown> {\n const access = await this.resolveAccess(executionContext);\n const response = await executeHttpApiTransportCall(\n this.buildODataRequest(access, compiled), this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n return response.json;\n }\n\n public async odataGetOrNull(executionContext: ExecutionContext<any>, compiled: ODataCompiledRequest): Promise<unknown | null> {\n try {\n return await this.odataGet(executionContext, compiled);\n } catch (error) {\n if (error instanceof HttpApiTransportError && error.detail.status === 404) return null;\n throw error;\n }\n }\n\n /**\n * Follow an OData server-driven paging link (`@odata.nextLink`) — the drift-safe extraction\n * paging the v3.1 discipline mandates. The link is the server's own absolute (or\n * service-relative) continuation URL; nothing is compiled locally.\n */\n public async odataGetByUrl(executionContext: ExecutionContext<any>, url: string): Promise<unknown> {\n const access = await this.resolveAccess(executionContext);\n const absoluteUrl = url.startsWith('http') ? url : `${access.baseUrl}${url.startsWith('/') ? '' : '/'}${url}`;\n const response = await executeHttpApiTransportCall(\n // A paging continuation is a read: safe to re-send after a timeout.\n { method: 'GET', url: absoluteUrl, headers: { Accept: 'application/json', ...access.headers }, retrySafe: true },\n this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n return response.json;\n }\n\n /**\n * `GET /$metadata` as raw XML text — the WARN-only schema-drift probe's input (partial-resource\n * paper, PR-21). Deliberately OUTSIDE the JSON transport: the EDMX document is XML, and the\n * transport treats a 2xx non-JSON body as a contract failure — correct for every data read,\n * wrong for this one diagnostic document. One plain fetch, no retry, no rate-budget draw\n * (a diagnostic must never spend the data path's budget), and EVERY failure — non-200, network\n * error, a server that does not serve `$metadata` at all — answers `null`: the probe's caller\n * treats null as \"nothing to compare\", never as drift.\n */\n public async odataMetadataText(executionContext: ExecutionContext<any>): Promise<string | null> {\n try {\n const access = await this.resolveAccess(executionContext);\n const response = await this.fetchImpl(`${access.baseUrl}/$metadata`, {\n method: 'GET',\n headers: { Accept: 'application/xml', ...access.headers },\n });\n if (response.status !== 200) return null;\n return await response.text();\n } catch {\n return null;\n }\n }\n\n private buildODataRequest(access: { baseUrl: string; headers: Record<string, string> }, compiled: ODataCompiledRequest): HttpApiTransportRequest {\n const search = Object.entries(compiled.params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n return {\n method: 'GET',\n url: `${access.baseUrl}${compiled.path}${search.length > 0 ? `?${search}` : ''}`,\n headers: { Accept: 'application/json', ...access.headers },\n retrySafe: true,\n };\n }\n\n // ── REST_JSON ────────────────────────────────────────────────────────────────\n\n public async restJson(executionContext: ExecutionContext<any>, compiled: RestJsonCompiledRequest): Promise<unknown> {\n const access = await this.resolveAccess(executionContext);\n const response = await executeHttpApiTransportCall(\n this.buildRestJsonRequest(access, compiled), this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n if (compiled.jsonRpc) {\n const envelope = response.json as { result?: unknown; error?: { code?: number; message?: string } };\n if (envelope && typeof envelope === 'object' && envelope.error) {\n throw new HttpApiTransportError(\n `JSON-RPC error from the target: ${envelope.error.message ?? 'unknown'} (code ${envelope.error.code ?? '?'})`,\n { url: compiled.path, method: 'POST', attempts: 1, kind: HttpApiTransportFailureKind.REMOTE_ERROR },\n );\n }\n return envelope?.result;\n }\n return response.json;\n }\n\n /**\n * Single-row REST read with the dialect's no-row semantics: a remote 404, and a `null`/`false`\n * payload at the declared resultPath, are the target's honest \"no row\"; an ABSENT leaf is a\n * contract breach, never a silent not-found.\n */\n public async restJsonReadOrNull(executionContext: ExecutionContext<any>, compiled: RestJsonCompiledRequest): Promise<unknown | null> {\n try {\n const body = await this.restJson(executionContext, compiled);\n const payload = resolveHttpApiResultPath(body, compiled.resultPath);\n if (payload === null || payload === false) return null;\n if (payload === undefined) {\n throw new HttpApiRemoteContractError(\n `The remote read answered 200 but the declared resultPath '${compiled.resultPath ?? '(body)'}' resolves to nothing.`,\n );\n }\n return payload;\n } catch (error) {\n if (error instanceof HttpApiTransportError && error.detail.status === 404) return null;\n throw error;\n }\n }\n\n private buildRestJsonRequest(access: { baseUrl: string; headers: Record<string, string> }, compiled: RestJsonCompiledRequest): HttpApiTransportRequest {\n if (compiled.jsonRpc) {\n return {\n method: 'POST',\n url: `${access.baseUrl}${compiled.path}`,\n headers: { Accept: 'application/json', ...access.headers },\n body: { encoding: HttpApiTransportBodyEncoding.JSON, value: { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: compiled.params, id: 1 } },\n // POST-shaped, read by construction: the read compilers are the only producers of this\n // request and they compile nothing but reads, so re-sending it cannot duplicate a write.\n retrySafe: true,\n };\n }\n if (compiled.method === 'POST') {\n return {\n method: 'POST',\n url: `${access.baseUrl}${compiled.path}`,\n headers: { Accept: 'application/json', ...access.headers },\n body: { encoding: HttpApiTransportBodyEncoding.JSON, value: compiled.params },\n // Same argument as the JSON-RPC branch above: a POST-shaped SEARCH is still a read.\n retrySafe: true,\n };\n }\n const search = Object.entries(compiled.params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)\n .join('&');\n return {\n method: 'GET',\n url: `${access.baseUrl}${compiled.path}${search.length > 0 ? `?${search}` : ''}`,\n headers: { Accept: 'application/json', ...access.headers },\n retrySafe: true,\n };\n }\n\n // ── Odoo execute_kw ──────────────────────────────────────────────────────────\n\n public async odooExecuteKw(executionContext: ExecutionContext<any>, call: OdooCompiledCall): Promise<unknown> {\n const access = await this.resolveAccess(executionContext);\n const credentials = access.jsonRpcInArgsCredentials;\n if (!credentials) {\n // An ODOO_JSONRPC binding on a provider whose contract declares no in-args auth cannot\n // authenticate at all — the header credential is unread by `/jsonrpc`.\n throw new HttpApiProviderAccessError(\n `Provider '${this.binding.providerRef}' declares no jsonRpcInArgsAuth on its rest contract, but this binding speaks ODOO_JSONRPC — `\n + 'the target authenticates INSIDE the RPC args; declare jsonRpcInArgsAuth (dbEnvVarName, loginEnvVarName) on the provider module.',\n );\n }\n\n // Resolved from THIS call's access, so a rotated credential produces a different key and the\n // cached identity below simply does not match — no invalidation call, and therefore no\n // rotation path that can forget to make one.\n const credentialKey = HttpApiReadClient.odooCredentialKey(access.baseUrl, credentials);\n let authenticatedUid = this.odooAuthenticatedIdentity?.credentialKey === credentialKey\n ? this.odooAuthenticatedIdentity.uid\n : undefined;\n\n if (authenticatedUid === undefined) {\n const uid = await this.executeOdooRpc(access, 'common', 'authenticate', [\n credentials.db, credentials.login, credentials.apiKey, {},\n ]);\n if (typeof uid !== 'number' || !Number.isInteger(uid) || uid <= 0) {\n // Odoo answers `false` for rejected credentials — a terminal answer, spelled loudly.\n //\n // The previously cached identity is left alone rather than dropped: it belongs to a\n // DIFFERENT key (that is why we are here), so it can never be served for these\n // credentials, and keeping it means a rotation that is rolled back does not pay a second\n // handshake. Only a successful authenticate writes the field.\n throw new HttpApiProviderAccessError(\n `Odoo rejected the credentials for provider '${this.binding.providerRef}' (db '${credentials.db}', login '${credentials.login}'): `\n + `authenticate answered ${JSON.stringify(uid)} instead of a uid.`,\n );\n }\n authenticatedUid = uid;\n this.odooAuthenticatedIdentity = { credentialKey, uid };\n }\n\n return this.executeOdooRpc(access, 'object', 'execute_kw', [\n credentials.db,\n authenticatedUid,\n credentials.apiKey,\n this.binding.entityRef,\n call.method,\n call.positionalArgs,\n call.kwargs,\n ]);\n }\n\n /**\n * The identity a cached uid belongs to: the instance it was minted on, and the exact credential\n * it was minted with.\n *\n * `JSON.stringify` over the tuple rather than a joined string because JSON escapes each member,\n * so no combination of separators inside a db name, a login or a key can make two different\n * tuples produce one key.\n */\n private static odooCredentialKey(\n baseUrl: string,\n credentials: { db: string; login: string; apiKey: string },\n ): string {\n return createHash('sha256')\n .update(JSON.stringify([baseUrl, credentials.db, credentials.login, credentials.apiKey]))\n .digest('hex');\n }\n\n private async executeOdooRpc(\n access: { baseUrl: string; headers: Record<string, string> },\n service: string,\n method: string,\n args: unknown[],\n ): Promise<unknown> {\n const response = await executeHttpApiTransportCall(\n {\n method: 'POST',\n url: `${access.baseUrl}/jsonrpc`,\n headers: { Accept: 'application/json', ...access.headers },\n body: { encoding: HttpApiTransportBodyEncoding.JSON, value: { jsonrpc: '2.0', method: 'call', params: { service, method, args }, id: 1 } },\n // Two callers, both safe to repeat: `common.authenticate` (a pure question) and\n // `object.execute_kw` with a read method — the Odoo compiler emits `search_read`/\n // `search_count` and nothing that writes.\n retrySafe: true,\n },\n this.binding.remoteCallSemantics,\n this.fetchImpl,\n this.rateBudget,\n );\n const envelope = response.json as { result?: unknown; error?: { code?: number; message?: string; data?: { message?: string } } };\n if (envelope && typeof envelope === 'object' && envelope.error) {\n throw new HttpApiTransportError(\n `Odoo JSON-RPC error: ${envelope.error.data?.message ?? envelope.error.message ?? 'unknown'} (code ${envelope.error.code ?? '?'})`,\n { url: '/jsonrpc', method: 'POST', attempts: 1, kind: HttpApiTransportFailureKind.REMOTE_ERROR },\n );\n }\n return envelope?.result;\n }\n\n // ── Erasure-family calls (stance 6b — the door ORCHESTRATES, the client frames) ──\n\n /** OData's canonical `DELETE /EntitySet(key)`; a 404 is the row already gone (idempotent). */\n public async odataDeleteByPath(executionContext: ExecutionContext<any>, path: string): Promise<void> {\n const access = await this.resolveAccess(executionContext);\n await this.rawCallTolerating404({\n method: 'DELETE',\n url: `${access.baseUrl}${path}`,\n headers: { Accept: 'application/json', ...access.headers },\n // Idempotent by key: the second DELETE of a gone row answers 404, which this door reads as\n // already-gone. That is what makes a retried timeout safe here and unsafe on a create.\n retrySafe: true,\n });\n }\n\n /**\n * One declared REST_JSON erasure call (stance 6b explicit spec): frames method/path/RPC\n * envelope, tolerates 404 as already-gone, and surfaces a JSON-RPC error envelope as a\n * transport error.\n */\n public async restDeclaredErasureCall(\n executionContext: ExecutionContext<any>,\n compiled: RestJsonCompiledErasureRequest,\n ): Promise<void> {\n const access = await this.resolveAccess(executionContext);\n const response = await this.rawCallTolerating404({\n method: compiled.method,\n url: `${access.baseUrl}${compiled.path}`,\n headers: { Accept: 'application/json', ...access.headers },\n body: compiled.jsonRpc\n ? { encoding: HttpApiTransportBodyEncoding.JSON, value: { jsonrpc: '2.0', method: compiled.jsonRpc.rpcMethod, params: {}, id: 1 } }\n : undefined,\n // A declared erasure addresses ONE row by key and is idempotent for the same reason the\n // OData delete above is; the repository's own remediation for a partial failure is a re-run.\n retrySafe: true,\n });\n if (compiled.jsonRpc && response !== undefined) {\n const envelope = response as { error?: { code?: number; message?: string } };\n if (envelope && typeof envelope === 'object' && envelope.error) {\n throw new HttpApiTransportError(\n `JSON-RPC error from the declared erasure operation: ${envelope.error.message ?? 'unknown'} (code ${envelope.error.code ?? '?'})`,\n { url: compiled.path, method: compiled.method, attempts: 1, kind: HttpApiTransportFailureKind.REMOTE_ERROR },\n );\n }\n }\n }\n\n // ── Generic transport ────────────────────────────────────────────────────────\n\n /** One transport call, body parsed; the caller frames the request. */\n public async rawCall(request: HttpApiTransportRequest): Promise<unknown> {\n const response = await executeHttpApiTransportCall(\n request, this.binding.remoteCallSemantics, this.fetchImpl, this.rateBudget,\n );\n return response.json;\n }\n\n /** As {@link rawCall}, tolerating a remote 404 as \"already gone\" (idempotent deletes). */\n public async rawCallTolerating404(request: HttpApiTransportRequest): Promise<unknown> {\n try {\n return await this.rawCall(request);\n } catch (error) {\n if (error instanceof HttpApiTransportError && error.detail.status === 404) return undefined;\n throw error;\n }\n }\n}\n"]}
|