@wildo-ai/saas-backend-lib 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/__tests__/fixture-deep-partial.d.ts.map +1 -1
- package/dist/esm/__tests__/integration/redis-integration-gate.d.ts.map +1 -1
- package/dist/esm/__tests__/setup.d.ts.map +1 -1
- package/dist/esm/__tests__/test-container.d.ts.map +1 -1
- package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -1
- package/dist/esm/applications/seeds/application-metadata-defaults.seeds.d.ts.map +1 -1
- 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/models/repositories.backend.schemas.d.ts.map +1 -1
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +1 -1
- package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.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 +210 -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/batches/resource-retention-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.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/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/controllers/utils/audit-access-fields.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/utils/operation-response-serializer.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-filter-translation.backend.d.ts.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 +220 -25
- 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-query.backend.d.ts.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 +191 -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-row-projection.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-subject-erasure-effect.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts +89 -14
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js +84 -11
- package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/odoo-jsonrpc-compiler.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/http-api/rest-json-query-compiler.backend.d.ts.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/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +106 -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 +266 -20
- 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-guarded-mutation.backend.types.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +5 -2
- 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 +34 -3
- package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/repositories/repository-version-metadata.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/resource-write-integrity.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts +72 -0
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts.map +1 -0
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js +88 -0
- package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js.map +1 -0
- package/dist/esm/base-classes/services/repositories/unique-constraint-conflict-reference.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/__tests__/mock-system-access.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/read-only-field-change.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-audit-emission.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +22 -0
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-server-injected-fields.backend.utils.d.ts.map +1 -1
- package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts.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 +571 -45
- 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/base-classes/utils/backend-type-utils.d.ts.map +1 -1
- package/dist/esm/base-classes/utils/single-subject-addressing.backend.utils.d.ts.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/abstract-billing.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -1
- 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 +475 -0
- package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -0
- package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js +11 -1
- package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -1
- package/dist/esm/billing/services/back-office/billing-subject-erasure-effect.backend.d.ts.map +1 -1
- 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/billing.utils.d.ts.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 +70 -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 +98 -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/credit-pool.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.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 +21 -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 +109 -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-adapter.backend.service.d.ts.map +1 -1
- package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -1
- 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 +310 -29
- package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
- package/dist/esm/billing/testing/billing-test-fixtures.d.ts.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/charts/controllers/chart.backend.controller.d.ts.map +1 -1
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts +80 -7
- package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/charts/services/chart-registry.backend.service.js +115 -8
- package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.d.ts.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/batches/immudb-audit-reconcile.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.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 +350 -10
- 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 +562 -10
- 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 +52 -0
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/ocsf-class-mapping.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/siem-dictionary.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/siem-ocsf-projection.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/services/utils/siem-projection-contract.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/utils/audit-actor.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils.d.ts.map +1 -1
- package/dist/esm/compliance/index.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/retention-hide-predicate.backend.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/services/subject-erasure-external-effects.backend.service.d.ts.map +1 -1
- package/dist/esm/compliance/privacy/services/subject-session-revocation.backend.service.d.ts.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/bootstrap/minion-initialization-projection.backend.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.d.ts.map +1 -1
- package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js +3 -0
- package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js.map +1 -1
- package/dist/esm/config/bootstrap/runtime-principal.backend.service.d.ts.map +1 -1
- package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -1
- package/dist/esm/config/models/app-config.backend.schemas.d.ts +145 -49
- 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/app-env-config.backend.schemas.d.ts.map +1 -1
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts +36 -0
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts.map +1 -0
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.js +36 -0
- package/dist/esm/config/models/apps-manager-transport.backend.definitions.js.map +1 -0
- package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -1
- package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.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/models/runtime-topology.backend.contracts.d.ts.map +1 -1
- package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.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 +71 -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 +37 -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 +69 -1
- package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
- package/dist/esm/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.contracts.d.ts.map +1 -1
- package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.controller.d.ts.map +1 -1
- package/dist/esm/data-seeding/data-seeding-models.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/business-key-resolver.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-execution-context.shared.types.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-migrator-runner.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-reconciler.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-run.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-run.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed-trigger-mode-matrix.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/data-seed-scope-resolver-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/additive-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/lazy-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/manual-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/sync-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/engines/upgrade-seed-engine.backend.service.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-business-key.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-error.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-run-counters.shared.types.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-run-ledger.backend.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-anchor.shared.types.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts.map +1 -1
- package/dist/esm/data-seeding/services/shared/data-seed-scope-resolution.backend.d.ts.map +1 -1
- package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/resolve-persistence-adapter.backend.utils.d.ts.map +1 -1
- package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -1
- package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/db-utils.d.ts.map +1 -1
- package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-development-provisioning.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-ddl.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-migration-sql.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js +48 -0
- package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
- package/dist/esm/databases/services/postgresql-schema-plan-lockfile.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
- package/dist/esm/databases/services/resource-persistence-unit-of-work.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/schema-planning-standalone.backend.d.ts.map +1 -1
- package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -1
- package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -1
- package/dist/esm/databases/utils/postgresql-identifier.backend.utils.d.ts.map +1 -1
- package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.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/batches/external-data-pipeline-scheduled-run.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -1
- package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-extraction-source.backend.d.ts.map +1 -1
- package/dist/esm/external-data/external-data-models.exports.d.ts.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-data/external-data-transform.backend.d.ts.map +1 -1
- package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
- package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.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 +306 -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 +379 -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 +235 -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 +81 -34
- 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 +181 -100
- 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-api-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +413 -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 +684 -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 +15 -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 +84 -5
- package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
- package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -1
- package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -1
- package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -1
- package/dist/esm/features/services/application-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/organization-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/features/services/scope-feature-ledger-relationship.backend.utils.d.ts.map +1 -1
- package/dist/esm/features/services/scope-features-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -1
- package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -1
- package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -1
- package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.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/file-upload-route-locals.backend.types.d.ts.map +1 -1
- package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -1
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +37 -0
- 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 +260 -36
- package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
- package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -1
- package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -1
- package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -1
- package/dist/esm/files/scanning/yara-scanner.backend.service.js +20 -2
- package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -1
- package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -1
- package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -1
- package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
- package/dist/esm/files/services/file-population.backend.service.d.ts.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 +202 -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 +175 -13
- 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 +177 -5
- package/dist/esm/files/services/files.backend.service.js.map +1 -1
- package/dist/esm/files/services/rag-source-field-detection.backend.service.d.ts.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-path-resolver.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-provider.types.d.ts +52 -11
- 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/file-storage-router.backend.service.d.ts +21 -3
- package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/file-storage-router.backend.service.js +38 -5
- package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -1
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts +87 -0
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts.map +1 -0
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js +340 -0
- package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js.map +1 -0
- 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/storage-credential-provider.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/storage-platform-sts-credential-resolver.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js +10 -3
- package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +8 -55
- package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +20 -0
- package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
- package/dist/esm/files/utils/file-upload.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
- package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/image-derivation.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/image-thumbnail.backend.utils.d.ts.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/files/utils/rag-source-field-schema-path.backend.utils.d.ts.map +1 -1
- package/dist/esm/files/utils/storage-application-identity.backend.utils.d.ts.map +1 -1
- 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/batches/a2a-push-delivery.batch.backend.service.d.ts.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-dialect.backend.schemas.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a-push-notification-delivery.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/models/a2a-push-notification.backend.schemas.d.ts.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-push-delivery-log.repository.d.ts.map +1 -1
- package/dist/esm/flows-actors/a2a/services/a2a-push-dispatcher.backend.service.d.ts.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/controllers/flows-actors.controller.d.ts.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/agent-facets.backend.definitions.d.ts.map +1 -1
- package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.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.definitions.d.ts.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 +179 -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 +436 -34
- 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/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts.map +1 -1
- 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/agent-call-trace-sink.backend.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts +132 -6
- package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/agents.backend.service.js +467 -49
- package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
- package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +50 -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 +270 -20
- 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 +371 -0
- package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts +99 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts.map +1 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js +155 -0
- package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js.map +1 -0
- package/dist/esm/flows-actors/services/meta-workflow-evaluation-treatment-compiler.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/meta-workflow-standard-action-contracts.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/meta-workflow-standard-evaluation-contracts.backend.service.d.ts.map +1 -1
- package/dist/esm/flows-actors/services/meta-workflow-structured-artifact-action-compiler.backend.service.d.ts.map +1 -1
- 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 +17 -4
- package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
- package/dist/esm/flows-actors/utils/bounded-subprocess.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.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/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -1
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts +77 -0
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js +164 -0
- package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js.map +1 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts +48 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts.map +1 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js +101 -0
- package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js.map +1 -0
- package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/lifecycle-scope-id.backend.utils.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.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/guidance/services/scoped-state-read-custom-implementations.backend.d.ts.map +1 -1
- 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/i18n/services/i18n.backend.service.d.ts.map +1 -1
- package/dist/esm/index.d.ts +11 -5
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +31 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject/models/container.d.ts +10 -0
- package/dist/esm/inject/models/container.d.ts.map +1 -1
- package/dist/esm/inject/models/container.js +126 -10
- package/dist/esm/inject/models/container.js.map +1 -1
- package/dist/esm/inject/models/service-types.d.ts +20 -3
- package/dist/esm/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/inject/models/service-types.js +22 -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 +70 -3
- package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
- package/dist/esm/mcp/models/mcp-protocol.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
- package/dist/esm/mcp/models/mcp-tool.backend.schemas.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/mcp/services/resource-server-instances-registry.backend.service.d.ts.map +1 -1
- package/dist/esm/mcp/utils/zod-to-mcp-json-schema.backend.utils.d.ts.map +1 -1
- package/dist/esm/meta-workflow-runtime.exports.d.ts.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/__tests__/mock-logger.service.d.ts.map +1 -1
- package/dist/esm/monitoring/logger/services/logger.service.d.ts +24 -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/logger/utils/log-value-normalization.backend.utils.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +313 -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 +389 -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/otel-preload.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/otel-sdk-global-handle.d.ts.map +1 -1
- package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts.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/monitoring/observability/services/observability.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -1
- package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -1
- package/dist/esm/notifications/email/models/email-transport.backend.definitions.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -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-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 +102 -5
- package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/email/services/email.backend.service.js +222 -70
- 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/email/utils/interpolate-email-label.utils.d.ts.map +1 -1
- package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.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/models/sms-transport.backend.definitions.d.ts +32 -0
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts.map +1 -0
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js +32 -0
- package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js.map +1 -0
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +64 -10
- package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/sms/services/sms.backend.service.js +277 -82
- 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/batches/m2m-webhook-delivery.batch.utils.d.ts.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/m2m-webhook-delivery-log.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.repository.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/outbound/services/webhook-config-public-key.custom-impl.backend.service.d.ts.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/outbound/services/webhook-config.backend.service.d.ts.map +1 -1
- package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.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-member-invitation-sweep.batch.backend.service.d.ts.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.d.ts.map +1 -1
- 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/authority-change-audit.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/invitation-acceptance.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +63 -2
- package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/organizations/services/organization-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-onboarding-operation.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/organization-unit-member-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -1
- package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -1
- package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts.map +1 -1
- package/dist/esm/pdf-templates/models/pdf-template-binding.d.ts.map +1 -1
- package/dist/esm/pdf-templates/models/pdf-template-definition.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-generated-file-writer.backend.service.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-generation-orchestrator.backend.service.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-renderer.backend.service.d.ts.map +1 -1
- package/dist/esm/pdf-templates/services/pdf-template-binding.backend.service.d.ts.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/apps-crontabs-manager.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/cron-job-sync.backend.service.d.ts.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-completion-registry.backend.service.d.ts.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/job-payload-storage.backend.service.d.ts.map +1 -1
- package/dist/esm/queue/job-status-tracking.backend.service.d.ts.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/scheduled-message-verifier.backend.service.d.ts.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/batches/rag-embedding-drain.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/batches/rag-reconciliation-sweep.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/models/rag-chunk-store.backend.types.d.ts.map +1 -1
- package/dist/esm/rag/models/rag-retrieval.backend.types.d.ts.map +1 -1
- package/dist/esm/rag/services/mongodb-rag-chunk-store.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/postgresql-rag-chunk-store.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-collection.mongodb-ddl.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-retrieval.mongodb-query.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-retrieval.postgresql-query.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-store.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-chunk-table.postgresql-ddl.backend.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-ingestion.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/services/rag-retrieval.backend.service.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunk-fusion.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunk-removal.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-chunk-row-shaping.backend.utils.d.ts.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/rag/utils/rag-ingestion-trigger.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-retrieval-scope.backend.utils.d.ts.map +1 -1
- package/dist/esm/rag/utils/rag-source-field-value.backend.utils.d.ts.map +1 -1
- package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -1
- package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -1
- package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -1
- package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -1
- package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -1
- package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.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 +81 -9
- package/dist/esm/requests/service/websocket.service.js.map +1 -1
- package/dist/esm/resources/backend-resource-registry.exports.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +16 -2
- package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
- package/dist/esm/resources/models/index.d.ts.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/models/resources.backend.schemas.d.ts.map +1 -1
- package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -1
- package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-population.backend.service.d.ts +17 -2
- package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/services/resource-population.backend.service.js +74 -18
- package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -1
- package/dist/esm/resources/services/resources-registry.backend.service.d.ts +83 -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 +121 -6
- package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
- package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -1
- package/dist/esm/resources/utils/resource-retention.backend.utils.d.ts.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/models/execution-context.backend.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/models/request-context.als.backend.d.ts.map +1 -1
- package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
- package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.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 +191 -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 +287 -89
- package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
- package/dist/esm/runtime/services/utils/oauth-body-cap.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -1
- package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -1
- package/dist/esm/runtime/utils/application-startup-config-access.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/utils/feature-gated-core-resource-exclusions.backend.utils.d.ts.map +1 -1
- package/dist/esm/runtime/utils/request-client-ip.utils.d.ts.map +1 -1
- package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/api-keys/api-key-generation.backend.utils.d.ts.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/auth-method-management-controller.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +22 -0
- 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 +113 -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/auth-constants.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/authorization-client.backend.schemas.d.ts.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/federated-auth-transport.backend.definitions.d.ts +37 -0
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts.map +1 -0
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js +37 -0
- package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js.map +1 -0
- package/dist/esm/security/authentications/models/identity-persistence-boundaries.backend.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +30 -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/models/saml-authentication.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -1
- package/dist/esm/security/authentications/models/user-authorization-version.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/seeds/enterprise-config-defaults.seeds.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.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/admin-config/oidc-discovery.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +2 -1
- package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +197 -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 +384 -53
- package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.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-mfa.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.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 +97 -0
- 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 +260 -27
- 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 +14 -0
- 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 +70 -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/saml-assertion-validator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.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-session-store.backend.service.d.ts.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/scim-tokens.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.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 +339 -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/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +11 -1
- package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -1
- package/dist/esm/security/authentications/services/email-verification-initiator.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/machine-token-issuer.backend.service.d.ts.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/oidc-user-claims.backend.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/resolve-active-member-orgs.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.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-response-helper.backend.service.d.ts.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/concurrent-session-eviction.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/ensure-user-profile.backend.utils.d.ts.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/services/utils/machine-auth-rate-limit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/pkce.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/application-auth-policy-audit.backend.utils.d.ts.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/authentications/utils/one-off-session-lifetime.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authentications/utils/social-oauth2-purpose.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts +59 -0
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js +111 -0
- package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js.map +1 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts +57 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js +133 -0
- package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js.map +1 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts +41 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js +157 -0
- package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js.map +1 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts +84 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.js +99 -0
- package/dist/esm/security/authorizations/application-wide-read-admission.backend.js.map +1 -0
- package/dist/esm/security/authorizations/authorization-denial-audit.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts +116 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js +162 -0
- package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -0
- package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/junction-scope-resolution.backend.d.ts.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts +20 -20
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js +27 -28
- package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
- package/dist/esm/security/authorizations/organization-unit-narrowing-enforcement.backend.d.ts.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 +37 -124
- package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
- package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/authorizations/relationship-foreign-key-filter.backend.d.ts.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 +133 -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 +137 -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 +134 -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 +152 -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 +146 -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 +328 -29
- 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 +299 -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 +953 -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 +99 -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 +210 -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 +423 -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 +282 -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 +125 -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 +123 -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 +214 -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 +430 -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 +98 -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/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts +34 -0
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js +39 -0
- package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js.map +1 -0
- package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -1
- package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -1
- 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/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts +13 -0
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts.map +1 -1
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js +14 -0
- package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js.map +1 -1
- package/dist/esm/security/jwt/utils/jwt-verification-error-classification.backend.utils.d.ts.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/outbound/outbound-request-deadline.backend.utils.d.ts +39 -0
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js +60 -0
- package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js.map +1 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts +66 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts.map +1 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js +75 -0
- package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js.map +1 -0
- 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/scim/utils/scim-attribute-path-resolver.backend.utils.d.ts.map +1 -1
- package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -1
- package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -1
- package/dist/esm/security/session-invalidation-fence.backend.utils.d.ts.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/security/token-invalidation-fence.backend.utils.d.ts.map +1 -1
- package/dist/esm/testing.d.ts.map +1 -1
- package/dist/esm/users/services/inbound-contact-custom-implementation.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts.map +1 -1
- 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/esm/users/services/user-role-administration.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -1
- package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.d.ts.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +11 -9
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts +0 -45
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts.map +0 -1
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.js +0 -22
- package/dist/esm/external-providers/services/flow-actor-design.backend.service.js.map +0 -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-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/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js
CHANGED
|
@@ -559,12 +559,19 @@ export const auditLogsArchiveBatchService = createCustomBatchExecutionService({
|
|
|
559
559
|
* - wildo-managed: `upload` builds `effectiveFileId = folderPath/fileName` and calls
|
|
560
560
|
* `resolveApplicationObjectKey(effectiveFileId, ctx)`; `getMetadata` calls that identical
|
|
561
561
|
* resolver with `file.fileId`.
|
|
562
|
-
* - local-directory: `upload`
|
|
563
|
-
* `
|
|
562
|
+
* - local-directory: `upload` calls `composeStorageKey(fileId, ctx, options)`; `getMetadata` with
|
|
563
|
+
* no `storageRef` calls that same method with `file.fileId` and no options.
|
|
564
564
|
*
|
|
565
|
-
* Both therefore land on the byte-identical key
|
|
565
|
+
* Both therefore land on the byte-identical key — and since 2026-09-09 on the SAME key as each
|
|
566
|
+
* other, because both route through `application-storage-key.backend.utils`. The one coupling is
|
|
566
567
|
* `includeApplicationId: true` on the upload — flip that and the probe would address a different
|
|
567
|
-
* blob, so the two must move together
|
|
568
|
+
* blob, so the two must move together.
|
|
569
|
+
*
|
|
570
|
+
* Parity is pinned in each provider's OWN suite (upload, then `getMetadata` with no ref, against a
|
|
571
|
+
* real store). It is NOT pinned here: this batch's tests drive a fake provider that stores and
|
|
572
|
+
* probes `<folderPath>/<fileName>` by construction, so it agrees with itself whatever the real
|
|
573
|
+
* providers do. An earlier revision of this comment claimed "pinned by the key-parity test"; no
|
|
574
|
+
* such test existed.
|
|
568
575
|
*
|
|
569
576
|
* FAIL-SAFE DIRECTION: any failure — genuinely absent, or a transient storage fault — answers
|
|
570
577
|
* `false`, i.e. "archive it". Re-archiving is harmless by construction (the artifact key is
|
package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-logs-archive.batch.backend.service.js","sourceRoot":"","sources":["../../../../../../src/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,mBAAmB,EACnB,2BAA2B,GAC5B,MAAM,8EAA8E,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,iCAAiC,GAElC,MAAM,4FAA4F,CAAC;AACpG,OAAO,EAAE,wCAAwC,EAAE,MAAM,gFAAgF,CAAC;AAC1I,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAMpF,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEvC,2EAA2E;AAC3E,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAE7C;;;;GAIG;AACH,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB;;;;;GAKG;AACH,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmD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oB,CAAC,IASnC;IACC,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC1H,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAEhC,MAAM,OAAO,GAAG;QACd,aAAa,EAAE,CAAU;QACzB,IAAI,EAAE,mBAA4B;QAClC,wEAAwE;QACxE,6EAA6E;QAC7E,mEAAmE;QACnE,aAAa,EAAE,aAAa,IAAI,IAAI;QACpC,YAAY,EAAE,GAAG;QACjB,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE;QACtC,SAAS,EAAE,SAAS,CAAC,WAAW,EAAE;QAClC,UAAU;QACV,WAAW,EAAE,OAAO,CAAC,MAAM;QAC3B,SAAS;QACT,OAAO;KACR,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAE7D,MAAM,eAAe,CAAC,MAAM,CAC1B,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;IACvB,6EAA6E;IAC7E,2EAA2E;IAC3E,iEAAiE;IACjE,UAAU,EAAE,EACZ,kBAAkB,EAClB,MAAM,CAAC,UAAU,EACjB,gBAAgB,EAChB;QACE,UAAU,EAAE,oBAAoB;QAChC,QAAQ,EAAE,iBAAiB,GAAG,OAAO;QACrC,oBAAoB,EAAE,IAAI;KAC3B,CACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Audit-Log Archival Batch (audit Phase 5 / F1)\n *\n * Periodic CRON custom batch that EXPORTS aged audit records to durable off-DB\n * archival artifacts in file storage. It is the operator-tunable retention /\n * archival mechanism for the compliance audit trail.\n *\n * --------------------------------------------------------------------------\n * Archival, NOT deletion — audit logs are immutable\n * --------------------------------------------------------------------------\n * `AUDIT_LOGS` is immutable by invariant (G5): its `coreOperations` are\n * `READ | LIST | SEARCH | CREATE` — no `UPDATE`, no `DELETE`. This batch\n * therefore NEVER removes audit records. It COPIES records older than the\n * operator-configured horizon (`AppConfiguration.auditTrail.archiveAfterDays`)\n * into durable JSON artifacts in file storage, one artifact per UTC day-window,\n * while the original rows remain in the always-on `AUDIT_LOGS` store (and, when\n * configured, in the append-only immudb tamper-proof ledger). The archive is an\n * additional off-DB compliance/DR copy — a portable artifact an auditor can be\n * handed — not a prune. (The value trade-off is explicit: it does NOT bound DB\n * growth. A future delete-after-archive step, if compliance demands\n * data-minimisation, would build on top of this — but that requires relaxing\n * G5 and is out of scope here.)\n *\n * --------------------------------------------------------------------------\n * OPT-IN\n * --------------------------------------------------------------------------\n * Setting `auditTrail.archiveAfterDays` IS the opt-in. When it is `undefined`\n * (the compliance-safe default) the batch no-ops: nothing is archived and every\n * record is retained in the primary store indefinitely. The batch is registered\n * unconditionally (like the reconcile / delivery drains) so a mis-set flag can\n * never orphan the schedule; the no-op is decided at TICK time from live config.\n *\n * --------------------------------------------------------------------------\n * Idempotency — stateless deterministic overwrite (no checkpoint store)\n * --------------------------------------------------------------------------\n * The archive is keyed by UTC day. Each day-window writes to a DETERMINISTIC\n * storage key (`audit-archive/[applicationId/]audit-archive-YYYY-MM-DD.json`)\n * via the `fileName` upload option, which the storage providers use as the blob\n * leaf — so re-uploading a window OVERWRITES it. A fully-past day's audit rows\n * are stable (audit events are created at operation time; nothing back-dates\n * into a closed day), so a re-write produces identical content. This makes the\n * batch idempotent WITHOUT any high-water-mark / checkpoint state: unlike the\n * reconcile batch (which stores its mark in immudb), archival must work even\n * when immudb is not configured, so it deliberately keeps ZERO cross-run state.\n *\n * Each tick (re)writes only the trailing {@link DEFAULT_LOOKBACK_DAYS} archivable\n * day-windows. On the daily cron exactly one new day crosses the horizon per\n * tick; the small look-back re-writes the last couple of crossed days so a\n * single missed tick self-heals on the next run. The (bounded) cost of the\n * re-write is re-reading a day or two of audit rows — cheap for a nightly sweep.\n *\n * Missed windows self-heal WITHOUT cross-run state: beyond the look-back, each tick sweeps a\n * bounded trailing span ({@link DEFAULT_BACKFILL_PROBE_DAYS}) and asks storage whether each day's\n * deterministic artifact already exists, archiving only the days that are missing. Progress is\n * therefore DERIVED FROM THE ARTIFACTS — the one durable record that always exists and that does\n * not require immudb, so the \"zero cross-run state\" property above is preserved rather than traded\n * away. A day repaired this way is logged as a warning and counted in `windowsBackfilled`: the\n * sweep fixes the gap, but a recurring count means ticks are being missed and an operator should\n * know. Previously such a day stayed missing forever, because nothing recorded that it was skipped.\n *\n * Cold-start backlog beyond the probe span: still an explicit operator gesture — trigger the batch\n * once with a `lookbackDaysOverride` wide enough to cover the history (e.g. the full\n * `archiveAfterDays` span). That remains the way to seed archives for an app that enabled archival\n * after it already had aged data.\n *\n * --------------------------------------------------------------------------\n * Cross-org, anchoring, failure containment\n * --------------------------------------------------------------------------\n * Scope-anchored @ APPLICATION: the batch archives EVERY org's aged rows into a\n * single per-day artifact (each record carries its own `organizationId`), so the\n * read bypasses the contextual org filter (`excludeContextualFilter: true`) —\n * mirroring the reconcile batch. Per-org artifact partitioning is a deliberate\n * future enhancement, not a v1 requirement — see the scaling note on\n * {@link MAX_RECORDS_PER_WINDOW} for WHY (cross-org amplifies the per-artifact\n * size) and HOW to lift the limitation (stream the upload + per-org partitioning).\n *\n * Never-throws contract: archival must not crash the batch runner (F7 — audit\n * side-channels are independent + non-blocking). A failure (storage outage, DB\n * read error) is LOGGED and yields a partial summary with `error` set; the next\n * scheduled tick retries the same trailing windows (idempotent overwrite makes\n * the retry safe).\n *\n * @see base-classes/services/batches/engine-custom-batch-manifests.ts\n * (`ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST` — the ref + cron single source).\n * @see compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.ts\n * (the sibling audit cron this mirrors for context creation + cross-org scan).\n */\n\nimport { Readable } from 'stream';\nimport { randomUUID } from 'crypto';\n\nimport { z } from 'zod';\nimport {\n CoreResourceType,\n CoreResourceOperation,\n ResourcePrimaryScope,\n CORE_APP_ROLES,\n} from '@wildo-ai/saas-models';\nimport type {\n AuditableEvent,\n} from '@wildo-ai/saas-models';\nimport {\n describeCaughtError,\n projectCaughtErrorLogFields,\n} from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { FileStorageAccepted } from '@wildo-ai/zod-decorators';\nimport {\n createCustomBatchExecutionService,\n type BatchesCronjobsCustomExecution_Service,\n} from '~wildo-backend-lib/base-classes/services/batches/batches-cronjobs-custom-execution.service';\nimport { ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST } from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport type { FileStorageRouterBackendService } from '~wildo-backend-lib/files/storage/file-storage-router.backend.service';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Tuning constants\n// ═══════════════════════════════════════════════════════════════════════════\n\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/** Folder namespace for archival artifacts within the storage provider. */\nconst AUDIT_ARCHIVE_FOLDER = 'audit-archive';\n\n/**\n * Per-page limit for the day-window AUDIT_LOGS scan. Hard-capped at 100 by the\n * repository (`_doList` clamps with `Math.min(100, …)`), so a larger value is\n * silently clamped. Paging stops when a page returns fewer than this.\n */\nconst PAGE_SIZE = 100;\n\n/**\n * Defensive per-window page ceiling — guards against an unbounded loop if a\n * window's row count somehow never decreases. At {@link PAGE_SIZE} = 100 and\n * {@link MAX_RECORDS_PER_WINDOW} = 100_000 the record cap is hit first; this is\n * the belt-and-braces backstop.\n */\nconst MAX_PAGES_PER_WINDOW = 2_000;\n\n/**\n * Hard cap on records accumulated into a SINGLE day-window artifact.\n *\n * WHAT IT PROTECTS: the batch holds a whole window's rows in memory (`records[]`)\n * to serialise ONE JSON artifact per day, so without a cap a huge day would OOM\n * the batch process. On the cap being hit we archive the first\n * {@link MAX_RECORDS_PER_WINDOW}, flag the window `truncated`, and emit a\n * `logger.warn` — the day's artifact is then INCOMPLETE, but NO audit data is\n * lost: the authoritative rows always remain in `AUDIT_LOGS` (+ immudb).\n *\n * ─────────────────────────────────────────────────────────────────────────────\n * KNOWN LIMITATION + HOW TO REMOVE IT (deferred 2026-07-04 — revisit only when a\n * real deployment's volume actually triggers it; do NOT pre-build speculatively)\n * ─────────────────────────────────────────────────────────────────────────────\n * The cross-org design (ONE artifact per day for ALL orgs — see the file header)\n * multiplies what lands in the buffer, so a high-volume multi-tenant deployment\n * can exceed this cap and CHRONICALLY truncate. The cap is a SYMPTOM; the ROOT\n * CAUSE is buffering the whole artifact in memory before a single sized upload.\n * Two orthogonal, COMPOSABLE fixes (do both to eliminate it, not just soften it):\n *\n * (1) STREAM THE UPLOAD — the true root fix. Replace `records[]` +\n * `Buffer.from(JSON.stringify(...))` + sized `provider.upload(...)` with a\n * `Readable` that pages the repo and emits NDJSON row-by-row into a\n * size-OPTIONAL streaming upload. Memory then stays bounded to one page\n * (~{@link PAGE_SIZE} rows) regardless of window size, and this cap is\n * DROPPED entirely. Enabler: `IFileStorageProvider.upload()` currently\n * requires `size: number`; add a size-optional streaming path —\n * MinIO/S3 `putObject` multiparts automatically when size is unknown, and\n * the local-directory provider just pipes `stream → writeStream` (relax the\n * `validateSize` policy gate for internal system artifacts). This touches\n * shared engine surface (the provider interface + both providers + tests).\n * Cheaper no-interface-change variant: spool the window to a temp file,\n * `stat` its size, then stream-upload from the file (bounded memory via\n * disk instead of RAM, at the cost of a temp-file lifecycle + writable disk).\n *\n * (2) PER-ORG PARTITIONING — removes the cross-org amplification AND is the\n * compliance-correct shape. Emit one artifact per `(org, day)` (+ an\n * APPLICATION-scoped artifact for no-org / app-level events) instead of one\n * cross-org artifact; enumerate the distinct `organizationId`s in the window\n * via a `distinct`/aggregation, then archive per org. Each artifact becomes\n * one org's day (smaller), and each tenant's trail is an independently\n * retrievable/erasable artifact — what GDPR right-to-erasure + data\n * residency actually want. Cost: more artifacts (org-count × days).\n *\n * REJECTED as weakest: per-HOUR windowing — only makes cap-hits rarer (24× more\n * files) without addressing the root cause; a pathological hour still truncates.\n *\n * DONE (2026-08-05), no longer a rider: {@link collectWindowRecords} now uses KEYSET\n * paging on the `(createdAt, eventId)` tuple, closing the boundary-tie SKIP that offset\n * paging over the non-unique `createdAt` could not. The sibling\n * `immudb.audit-reconcile` batch pages the same way. Only the cap below remains.\n */\nconst MAX_RECORDS_PER_WINDOW = 100_000;\n\n/**\n * Trailing day-windows (re)written each steady-state tick. On a daily cron one\n * new day crosses the horizon per tick; re-writing the last two crossed days\n * self-heals a single missed tick via idempotent overwrite. Overridable per-run\n * (`lookbackDaysOverride`) for cold-start backfills.\n */\nconst DEFAULT_LOOKBACK_DAYS = 2;\n\n/**\n * Absolute ceiling on day-windows processed in one run — bounds a backfill\n * invocation. Matches the max `archiveAfterDays` (2555 ≈ 7y) so a full-history\n * backfill fits one run; most historical days are empty and skipped cheaply.\n */\nconst MAX_LOOKBACK_DAYS = 2555;\n\n/**\n * How far BEYOND the look-back the tick probes for MISSING artifacts (the gap-healing sweep).\n *\n * The look-back above unconditionally re-writes the newest few archivable days. Anything older\n * that a tick missed used to stay missing forever: the batch keeps zero cross-run state, so\n * nothing recorded that a day was skipped, and an operator had to notice and run an explicit\n * `lookbackDaysOverride` backfill.\n *\n * Progress is instead DERIVED FROM THE ARTIFACTS THEMSELVES — the only durable record that is\n * already guaranteed to exist, and the one that keeps working when immudb is not configured (the\n * reason this batch has no checkpoint store; see the header). For each day in this trailing span\n * the tick asks storage whether the day's deterministic artifact key exists, and archives only the\n * days that are missing.\n *\n * Bounded on purpose: a probe is one cheap metadata lookup, but an unbounded sweep would grow with\n * the app's whole history on every nightly tick. Gaps older than this span remain an explicit\n * `lookbackDaysOverride` operation, exactly as before.\n */\nconst DEFAULT_BACKFILL_PROBE_DAYS = 90;\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Input / Output schemas\n// ═══════════════════════════════════════════════════════════════════════════\n\n/**\n * Optional per-tick overrides for manual `runOnce` triggers. Both narrow the\n * batch for one-shot operator gestures without touching app config.\n */\nexport const AuditLogsArchiveBatchInputSchema = z.object({\n /** One-shot archival horizon override (days). Falls back to app config. */\n archiveAfterDaysOverride: z.number().int().min(1).max(2555).optional(),\n /** One-shot look-back width override (days) — for cold-start backfills. */\n lookbackDaysOverride: z.number().int().min(1).max(MAX_LOOKBACK_DAYS).optional(),\n /**\n * One-shot width override (days) for the missing-artifact probe sweep that runs BEYOND the\n * look-back. `0` disables the sweep for this run (pure look-back behaviour).\n */\n backfillProbeDaysOverride: z.number().int().min(0).max(MAX_LOOKBACK_DAYS).optional(),\n}).strict();\nexport type AuditLogsArchiveBatchInput = z.infer<typeof AuditLogsArchiveBatchInputSchema>;\n\n/**\n * Run summary covering the happy path, the two no-op paths (disabled / no\n * storage), and the failure path.\n */\nexport const AuditLogsArchiveBatchOutputSchema = z.object({\n /** Wall-clock ISO timestamp when the body started. */\n tickAt: z.string().datetime(),\n /** Whether an archival horizon was configured/overridden (opt-in resolved). */\n enabled: z.boolean(),\n /** Effective archival horizon applied this tick (days), or null when disabled. */\n archiveAfterDays: z.number().int().nullable(),\n /** ISO cutoff — records with `createdAt < horizonAt` were archival-eligible. */\n horizonAt: z.string().datetime().nullable(),\n /** Whether a storage provider was configured (false ⇒ no-op). */\n storageConfigured: z.boolean(),\n /** Trailing day-windows considered this run. */\n lookbackDays: z.number().int().min(0),\n /** Width (days) of the missing-artifact probe sweep beyond the look-back. */\n backfillProbeDays: z.number().int().min(0),\n /**\n * Days in the probe span whose artifact was ABSENT and were therefore archived by the sweep.\n * A persistently non-zero value means ticks are being missed — surfaced rather than silent.\n */\n windowsBackfilled: z.number().int().min(0),\n /** Day-windows scanned (some may have had zero rows and produced no artifact). */\n windowsScanned: z.number().int().min(0),\n /** Day-windows that produced (overwrote) an archival artifact. */\n windowsArchived: z.number().int().min(0),\n /** Total audit records written across all artifacts this run. */\n recordsArchived: z.number().int().min(0),\n /** Windows that hit {@link MAX_RECORDS_PER_WINDOW} and were archived partial. */\n truncatedWindows: z.number().int().min(0),\n /** Tick-level failure message — non-null only when a scan/upload threw. */\n error: z.string().nullable(),\n durationMs: z.number().int().min(0),\n});\nexport type AuditLogsArchiveBatchOutput = z.infer<typeof AuditLogsArchiveBatchOutputSchema>;\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Internals\n// ═══════════════════════════════════════════════════════════════════════════\n\n/** Shape the paginated AUDIT_LOGS `list` resolves to. */\ninterface AuditLogsListPage {\n data: AuditableEvent[];\n pagination?: { totalPages?: number };\n}\n\n/**\n * Human-readable one-line message for the batch OUTPUT's `error` field (the\n * output schema types it as a plain `string`).\n *\n * Delegates to the shared {@link describeCaughtError} rather than an inline\n * `instanceof Error` ternary, which would persist every structured\n * `WildoError_Backend` as the literal `'[object Object]'`. The log line pairs\n * this with {@link projectCaughtErrorLogFields} for the full queryable detail.\n */\nfunction formatError(err: unknown): string {\n return describeCaughtError(err);\n}\n\n/** Midnight-UTC start of the day containing `d`. */\nfunction startOfUtcDay(d: Date): Date {\n return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));\n}\n\nfunction addDays(d: Date, n: number): Date {\n return new Date(d.getTime() + n * MS_PER_DAY);\n}\n\n/** `YYYY-MM-DD` key for a midnight-UTC day-start. */\nfunction dayKey(dayStart: Date): string {\n return dayStart.toISOString().slice(0, 10);\n}\n\n/**\n * Resolve the effective archival horizon (days). First non-undefined wins:\n * per-tick override → `AppConfiguration.auditTrail.archiveAfterDays` → none\n * (undefined ⇒ archival disabled). Read at TICK time so an in-place config\n * change takes effect on the next run without a redeploy.\n */\nfunction resolveArchiveAfterDays(\n override: number | undefined,\n appConfigService: AppConfigurationService,\n): number | undefined {\n if (typeof override === 'number') return override;\n const fromConfig = appConfigService.config?.auditTrail?.archiveAfterDays;\n return typeof fromConfig === 'number' ? fromConfig : undefined;\n}\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Batch Service\n// ═══════════════════════════════════════════════════════════════════════════\n\nexport const auditLogsArchiveBatchService: BatchesCronjobsCustomExecution_Service<\n typeof AuditLogsArchiveBatchInputSchema,\n typeof AuditLogsArchiveBatchOutputSchema\n> = createCustomBatchExecutionService({\n input: AuditLogsArchiveBatchInputSchema,\n output: AuditLogsArchiveBatchOutputSchema,\n batchCronjob_Context: {\n // Scope-anchored @ APPLICATION: cross-org archival, no honest single target\n // resource (mirrors the reconcile / SIEM anchoring). `cronJobExpression` is\n // what actually SCHEDULES the run (sourced from the manifest so schedule +\n // spec cross-validation share ONE literal); omitting it would register the\n // batch but never fire it.\n kind: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.kind,\n operationIdentifier: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.operationIdentifier,\n primaryScope: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.primaryScope,\n cronJobExpression: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.cronExpression,\n },\n resolveDependencies: ({ get }) => ({\n appConfigService: get<AppConfigurationService>(SAAS_SERVICE_TYPES.AppConfigService),\n fileStorageRouter: get<FileStorageRouterBackendService>(SAAS_SERVICE_TYPES.FileStorageRouter),\n }),\n doHandle: async (\n input,\n {\n logger,\n repositoriesRegistry,\n executionContextCreator,\n dependencies,\n },\n ) => {\n const startTime = Date.now();\n const tickAt = new Date(startTime).toISOString();\n const logDebug = logger.debugByType('AuditLogsArchiveBatch');\n const { appConfigService, fileStorageRouter } = dependencies;\n\n // Mutable run state, hoisted OUT of the try so the never-throws catch reports\n // HONEST partial progress: artifacts uploaded before a mid-loop failure are\n // real (persisted, idempotent), so the failure summary must reflect them —\n // not reset to zero. Mirrors the reconcile batch's \"return what was\n // accumulated\" contract.\n let enabled = false;\n let archiveAfterDays: number | null = null;\n let horizonAt: string | null = null;\n let storageConfigured = false;\n let lookbackDays = 0;\n let backfillProbeDays = 0;\n let windowsScanned = 0;\n let windowsArchived = 0;\n let windowsBackfilled = 0;\n let recordsArchived = 0;\n let truncatedWindows = 0;\n\n const summary = (error: string | null = null): AuditLogsArchiveBatchOutput => ({\n tickAt,\n enabled,\n archiveAfterDays,\n horizonAt,\n storageConfigured,\n lookbackDays,\n backfillProbeDays,\n windowsScanned,\n windowsArchived,\n windowsBackfilled,\n recordsArchived,\n truncatedWindows,\n error,\n durationMs: Date.now() - startTime,\n });\n\n try {\n // 1. Opt-in gate. Undefined horizon ⇒ archival disabled (retain in DB\n // indefinitely). Emit a tick log so the cron's liveness is observable.\n const resolvedArchiveAfterDays = resolveArchiveAfterDays(input.archiveAfterDaysOverride, appConfigService);\n if (resolvedArchiveAfterDays === undefined) {\n logger.info('[audit] archive tick complete (archival disabled — auditTrail.archiveAfterDays unset)', { tickAt });\n return summary();\n }\n enabled = true;\n archiveAfterDays = resolvedArchiveAfterDays;\n\n // 2. Storage gate. Without a configured storage provider there is nowhere\n // to write; warn + no-op (never throw).\n if (!fileStorageRouter.isConfigured()) {\n logger.warn('[audit] archival is enabled but no file-storage provider is configured — skipping archival tick', {\n tickAt,\n archiveAfterDays,\n });\n return summary();\n }\n storageConfigured = true;\n // Prefer Wildo-managed, fall back to local-directory — the first\n // configured of the two the router knows about.\n const storageProvider = fileStorageRouter.resolveProvider([\n FileStorageAccepted.WILDO_MANAGED,\n FileStorageAccepted.LOCAL_DIRECTORY,\n ]);\n\n // 3. Compute the archivable day-window range. `horizon` is the age\n // cutoff; the most-recent FULLY-archivable day is the one ending at\n // the start of the horizon's day (the horizon's own day is only\n // partially older than the cutoff, so it is not archived yet).\n const horizon = new Date(startTime - resolvedArchiveAfterDays * MS_PER_DAY);\n horizonAt = horizon.toISOString();\n const dmaxStart = addDays(startOfUtcDay(horizon), -1);\n lookbackDays = Math.min(\n Math.max(input.lookbackDaysOverride ?? DEFAULT_LOOKBACK_DAYS, 1),\n MAX_LOOKBACK_DAYS,\n );\n // The probe sweep sits BEYOND the look-back, and the pair is capped together so a wide\n // `lookbackDaysOverride` backfill cannot also drag a full probe span along behind it.\n backfillProbeDays = Math.min(\n Math.max(input.backfillProbeDaysOverride ?? DEFAULT_BACKFILL_PROBE_DAYS, 0),\n Math.max(MAX_LOOKBACK_DAYS - lookbackDays, 0),\n );\n\n // Internal APP_ADMIN_SUPER_ADMIN @ APPLICATION context for the AUDIT_LOGS\n // read — mirrors the reconcile batch. No org id + `excludeContextualFilter`\n // on the read ⇒ the scan spans EVERY org's rows.\n //\n // Resolved through the canonical repository seam, NOT a hand-rolled\n // `ResourceConfiguration_OperationPath`. Operation defaults are\n // variant-type-LOCAL and AUDIT_LOGS declares its LIST `REPOSITORY_ONLY`\n // variant `isDefault: false`, so a literal\n // `{ variantType: REPOSITORY_ONLY, isOperationDefault: true }` path matches\n // NOTHING and throws. That literal used to sit here and was latent only\n // because the archival opt-in gate above returns before reaching it whenever\n // `auditTrail.archiveAfterDays` is unset — enabling archival would have\n // surfaced it immediately. The sibling reconcile batch (no such gate) threw on\n // every run. See `immudb-audit-reconcile.batch.backend.service.ts`.\n const executionContext = await executionContextCreator.createForInternalRepositoryOperation({\n resourceType: CoreResourceType.AUDIT_LOGS,\n operationIdentifier: CoreResourceOperation.LIST,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [\n { roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION },\n ],\n });\n const auditRepo = repositoriesRegistry.getRepositoryOrThrow(CoreResourceType.AUDIT_LOGS, executionContext);\n\n const applicationId = executionContext.applicationId || appConfigService.applicationId;\n\n // The day offsets processed this tick, oldest → newest so partial-run progress covers the\n // oldest un-archived days first.\n //\n // Two bands with DIFFERENT semantics:\n // - look-back band (offsets 0…lookbackDays-1): ALWAYS re-scanned and re-written. Recent\n // days are cheap and this is what self-heals a single missed tick.\n // - probe band (older): re-scanned ONLY when the day's artifact is missing. This is the\n // gap-healing sweep — it derives progress from the artifacts instead of cross-run state,\n // so a tick missed weeks ago is repaired automatically instead of silently persisting.\n const probeBandStart = lookbackDays;\n const probeBandEnd = lookbackDays + backfillProbeDays; // exclusive\n const offsets: number[] = [];\n for (let i = probeBandEnd - 1; i >= probeBandStart; i -= 1) offsets.push(i);\n for (let i = lookbackDays - 1; i >= 0; i -= 1) offsets.push(i);\n\n for (const i of offsets) {\n const windowStart = addDays(dmaxStart, -i);\n const windowEnd = addDays(windowStart, 1);\n const isProbeBand = i >= probeBandStart;\n\n if (isProbeBand) {\n // One cheap metadata lookup decides whether this old day needs any work at all. An\n // already-archived non-empty day costs exactly this probe and nothing more.\n const exists = await archiveArtifactExists({\n storageProvider,\n executionContext,\n day: dayKey(windowStart),\n });\n if (exists) continue;\n }\n\n windowsScanned += 1;\n\n const { records, truncated } = await collectWindowRecords(auditRepo, executionContext, windowStart, windowEnd);\n if (records.length === 0) {\n // Empty day ⇒ no artifact (keeps historical backfill cheap). NOTE this is why the probe\n // cannot distinguish \"never archived\" from \"archived nothing\": an empty day is re-scanned\n // by every sweep. That scan is a single zero-row query, deliberately preferred over\n // writing empty marker artifacts just to satisfy the probe.\n continue;\n }\n if (truncated) {\n truncatedWindows += 1;\n // No silent caps: dropping records from an archive artifact must be\n // loud. The source rows are NOT lost (they stay in AUDIT_LOGS + immudb)\n // — the day's artifact is merely incomplete. An operator seeing this\n // should narrow to per-hour windows (future enhancement).\n logger.warn(\n '[audit] archive day-window hit the per-window record cap — artifact is INCOMPLETE for this day '\n + '(source rows retained in AUDIT_LOGS; the newest rows past the cap are omitted from the artifact)',\n { day: dayKey(windowStart), cap: MAX_RECORDS_PER_WINDOW, archived: records.length },\n );\n }\n\n await uploadWindowArtifact({\n storageProvider,\n executionContext,\n applicationId,\n windowStart,\n windowEnd,\n archivedAt: tickAt,\n records,\n truncated,\n });\n\n windowsArchived += 1;\n recordsArchived += records.length;\n if (isProbeBand) {\n windowsBackfilled += 1;\n // A gap the steady-state look-back could never have reached. Report it: a recurring\n // count here means ticks are being missed, which is worth an operator's attention even\n // though the sweep repaired it.\n logger.warn('[audit] archived a MISSING historical day-window (gap-healing sweep) — ticks may be being missed', {\n day: dayKey(windowStart),\n recordCount: records.length,\n });\n }\n logDebug('Archived audit day-window', {\n day: dayKey(windowStart),\n recordCount: records.length,\n truncated,\n backfilled: isProbeBand,\n });\n }\n\n logger.info('[audit] archive tick complete', {\n tickAt,\n archiveAfterDays,\n horizonAt,\n lookbackDays,\n backfillProbeDays,\n windowsScanned,\n windowsArchived,\n windowsBackfilled,\n recordsArchived,\n truncatedWindows,\n });\n\n return summary();\n } catch (error) {\n // Top-level guard: never throw onto the batch runner. Return the summary\n // with progress accumulated so far (artifacts already uploaded are real);\n // the next tick retries the same trailing windows (idempotent overwrite).\n const message = formatError(error);\n logger.error?.('[audit] audit-logs archive batch failed (non-fatal, returning partial summary)', {\n ...projectCaughtErrorLogFields(error),\n tickAt,\n });\n return summary(message);\n }\n },\n});\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Helpers\n// ═══════════════════════════════════════════════════════════════════════════\n\n/**\n * Page through one day-window `[windowStart, windowEnd)` of AUDIT_LOGS and\n * accumulate its rows (cross-org, `createdAt` ASC for deterministic artifact\n * content). Stops at {@link MAX_RECORDS_PER_WINDOW} (flagging `truncated`) so a\n * pathological day can't OOM the batch. Throws on repository failure — the\n * caller's top-level guard records it on `outputData.error`.\n *\n * **Paging is KEYSET on `(createdAt, eventId)`** (2026-08-05), not offset-based.\n *\n * It used to be `skip = (page-1)*limit` over the NON-unique `createdAt`. When more rows\n * than the page size share one millisecond across a page boundary, the store may order\n * those ties differently between the two page queries — so a boundary row could be\n * served on BOTH pages (duplicated) or on NEITHER (silently dropped from the artifact).\n * Dedupe by `eventId` covered the duplicate half; the dropped half was unrecoverable.\n *\n * This was previously written off as \"negligible in practice (needs 100+ events in one\n * millisecond)\". That condition is real: an application boot burst wrote 404 audit rows\n * in a single millisecond, which permanently stranded 305 records in the sibling\n * `immudb.audit-reconcile` batch before it was converted to the same keyset scan. Boot,\n * seeding and migration paths emit audit rows in tight loops — that is exactly when a\n * day-window archive matters most.\n *\n * The `(createdAt, eventId)` tuple is unique and totally ordered, so no row can now fall\n * between two pages in either direction. The `eventId` half depends on it being present\n * in the AUDIT_LOGS LIST `sortFields` (pinned by the resource-config test); a non-empty\n * whitelist makes the repository DROP unlisted sort keys silently, so removing it would\n * restore the defect without any error. The `seen` dedupe and the no-progress guard\n * remain as backstops for exactly that degradation.\n *\n * Residual (unchanged): a window exceeding {@link MAX_RECORDS_PER_WINDOW} is still\n * truncated, and the source rows always remain in AUDIT_LOGS regardless.\n */\n/**\n * Does the archival artifact for `day` already exist in storage?\n *\n * This is how the batch derives progress WITHOUT any cross-run state: the artifacts are the\n * record. It must address the blob exactly as {@link uploadWindowArtifact} wrote it, and it does\n * so WITHOUT re-implementing any provider path logic — the composite\n * `<folderPath>/<fileName>` is handed over as the `fileId` and each provider applies its OWN\n * composition, the same one its `upload` used:\n *\n * - wildo-managed: `upload` builds `effectiveFileId = folderPath/fileName` and calls\n * `resolveApplicationObjectKey(effectiveFileId, ctx)`; `getMetadata` calls that identical\n * resolver with `file.fileId`.\n * - local-directory: `upload` composes segments `[applicationId, folderPath, leaf]`;\n * `getMetadata` with no `storageRef` resolves `${applicationId}/${file.fileId}`.\n *\n * Both therefore land on the byte-identical key. The one coupling is\n * `includeApplicationId: true` on the upload — flip that and the probe would address a different\n * blob, so the two must move together (pinned by the key-parity test).\n *\n * FAIL-SAFE DIRECTION: any failure — genuinely absent, or a transient storage fault — answers\n * `false`, i.e. \"archive it\". Re-archiving is harmless by construction (the artifact key is\n * deterministic and the write overwrites), whereas a false `true` would silently skip a day and\n * recreate the very gap this sweep exists to close.\n */\nasync function archiveArtifactExists(args: {\n storageProvider: ReturnType<FileStorageRouterBackendService['resolveProvider']>;\n executionContext: Awaited<ReturnType<ExecutionContextCreatorBackendService['createForInternalRepositoryOperation']>>;\n day: string;\n}): Promise<boolean> {\n const { storageProvider, executionContext, day } = args;\n try {\n await storageProvider.getMetadata(\n {\n fileId: `${AUDIT_ARCHIVE_FOLDER}/audit-archive-${day}.json`,\n storageProvider: undefined,\n storageRef: undefined,\n } as unknown as Parameters<typeof storageProvider.getMetadata>[0],\n executionContext,\n );\n return true;\n } catch {\n return false;\n }\n}\n\nasync function collectWindowRecords(\n auditRepo: ReturnType<RepositoriesRegistryHandlerBackendService['getRepositoryOrThrow']>,\n executionContext: Awaited<ReturnType<ExecutionContextCreatorBackendService['createForInternalRepositoryOperation']>>,\n windowStart: Date,\n windowEnd: Date,\n): Promise<{ records: AuditableEvent[]; truncated: boolean }> {\n const windowBound = { createdAt: { $gte: windowStart, $lt: windowEnd } };\n const records: AuditableEvent[] = [];\n const seen = new Set<string>();\n let truncated = false;\n /** Keyset position: the `(createdAt, eventId)` of the last row consumed. */\n let cursor: { createdAt: Date; eventId: string } | null = null;\n\n for (let page = 1; page <= MAX_PAGES_PER_WINDOW; page += 1) {\n // KEYSET lower bound, ANDed with the day window. `$and`/`$or` are both translated by the\n // Mongo and PostgreSQL adapters, so the predicate is portable.\n const filter: Record<string, unknown> = cursor === null\n ? windowBound\n : {\n $and: [\n windowBound,\n {\n $or: [\n { createdAt: { $gt: cursor.createdAt } },\n { createdAt: cursor.createdAt, eventId: { $gt: cursor.eventId } },\n ],\n },\n ],\n };\n\n // Page is pinned to 1: the cursor — not an offset — is what advances. Offset paging over a\n // NON-unique sort key was the defect (see the boundary-tie note above); with `skip`, ties\n // straddling a page boundary could be served on both pages (deduped below) or on NEITHER\n // (unrecoverable). `sort` is honored because AUDIT_LOGS' LIST whitelists BOTH `createdAt`\n // and `eventId` in its sortFields — drop `eventId` there and the tie-break silently\n // disappears, restoring the skip. Typed to the `_doList` contract, structurally compatible\n // with the public overload.\n const listOptions: { page: number; limit: number; sort: Record<string, 1 | -1> } = {\n page: 1,\n limit: PAGE_SIZE,\n sort: { createdAt: 1, eventId: 1 },\n };\n const result = (await auditRepo.list(executionContext, filter, {\n paginated: true,\n // Cross-org archival: bypass the contextual org filter so EVERY org's rows\n // for this day are captured, not just a caller's org.\n excludeContextualFilter: true,\n listOptions,\n })) as unknown as AuditLogsListPage;\n\n const rows = result.data ?? [];\n if (rows.length === 0) break;\n\n const cursorBeforePage = cursor;\n\n for (const row of rows) {\n // Dedupe by stable identity. Keyset paging makes a cross-page duplicate unreachable in\n // normal operation, so this is now a defensive backstop against a degraded sort rather\n // than the primary protection it used to be. A row with no identity at all (never\n // expected — persisted rows carry `_id`) is treated as distinct rather than silently\n // collapsed.\n const key = String((row as { eventId?: string; _id?: string }).eventId\n ?? (row as { _id?: string })._id ?? '');\n if (key && seen.has(key)) continue;\n if (records.length >= MAX_RECORDS_PER_WINDOW) {\n truncated = true;\n break;\n }\n if (key) seen.add(key);\n records.push(row);\n\n // Advance only on a COMPLETE tuple: a row missing either half cannot express a keyset\n // position, and inventing a partial one would step over its neighbours. Leaving the cursor\n // put means the no-progress guard below ends the scan instead.\n const rowCreatedAt = row.createdAt instanceof Date ? row.createdAt : new Date(String(row.createdAt));\n const rowEventId = (row as { eventId?: unknown }).eventId;\n if (!Number.isNaN(rowCreatedAt.getTime()) && typeof rowEventId === 'string') {\n cursor = { createdAt: rowCreatedAt, eventId: rowEventId };\n }\n }\n if (truncated) break;\n\n // Defensive no-progress guard: with a valid `(createdAt, eventId)` sort every page strictly\n // advances the cursor. Failing to advance means the ordering was degraded or the page held\n // no usable tuple — stop rather than re-issue an identical query forever.\n if (\n cursor !== null &&\n cursorBeforePage !== null &&\n cursor.createdAt.getTime() === cursorBeforePage.createdAt.getTime() &&\n cursor.eventId === cursorBeforePage.eventId\n ) {\n break;\n }\n\n if (rows.length < PAGE_SIZE) break;\n }\n\n return { records, truncated };\n}\n\n/**\n * Serialise a day-window's records to a self-describing JSON artifact and upload\n * it to the DETERMINISTIC key `audit-archive/[applicationId/]audit-archive-<day>.json`\n * (overwrite = idempotent). JSON (not CSV) is used deliberately: audit events\n * carry nested metadata that CSV would flatten lossily.\n */\nasync function uploadWindowArtifact(args: {\n storageProvider: ReturnType<FileStorageRouterBackendService['resolveProvider']>;\n executionContext: Awaited<ReturnType<ExecutionContextCreatorBackendService['createForInternalRepositoryOperation']>>;\n applicationId: string | undefined;\n windowStart: Date;\n windowEnd: Date;\n archivedAt: string;\n records: AuditableEvent[];\n truncated: boolean;\n}): Promise<void> {\n const { storageProvider, executionContext, applicationId, windowStart, windowEnd, archivedAt, records, truncated } = args;\n const day = dayKey(windowStart);\n\n const payload = {\n schemaVersion: 1 as const,\n kind: 'audit-log-archive' as const,\n // Self-describing provenance: the artifact is also namespaced under the\n // applicationId in its storage path (includeApplicationId), but embedding it\n // keeps a portable artifact identifiable without parsing the path.\n applicationId: applicationId ?? null,\n dayWindowUtc: day,\n windowStart: windowStart.toISOString(),\n windowEnd: windowEnd.toISOString(),\n archivedAt,\n recordCount: records.length,\n truncated,\n records,\n };\n const buffer = Buffer.from(JSON.stringify(payload), 'utf-8');\n\n await storageProvider.upload(\n Readable.from([buffer]),\n // Random valid resource id satisfies `validateFileId`; the DETERMINISTIC key\n // comes from `fileName` (the providers use it as the blob leaf), so the id\n // never affects the storage location or the overwrite semantics.\n randomUUID(),\n 'application/json',\n buffer.byteLength,\n executionContext,\n {\n folderPath: AUDIT_ARCHIVE_FOLDER,\n fileName: `audit-archive-${day}.json`,\n includeApplicationId: true,\n },\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"audit-logs-archive.batch.backend.service.js","sourceRoot":"","sources":["../../../../../src/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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xE,6EAA6E;QAC7E,mEAAmE;QACnE,aAAa,EAAE,aAAa,IAAI,IAAI;QACpC,YAAY,EAAE,GAAG;QACjB,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE;QACtC,SAAS,EAAE,SAAS,CAAC,WAAW,EAAE;QAClC,UAAU;QACV,WAAW,EAAE,OAAO,CAAC,MAAM;QAC3B,SAAS;QACT,OAAO;KACR,CAAC;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;IAE7D,MAAM,eAAe,CAAC,MAAM,CAC1B,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;IACvB,6EAA6E;IAC7E,2EAA2E;IAC3E,iEAAiE;IACjE,UAAU,EAAE,EACZ,kBAAkB,EAClB,MAAM,CAAC,UAAU,EACjB,gBAAgB,EAChB;QACE,UAAU,EAAE,oBAAoB;QAChC,QAAQ,EAAE,iBAAiB,GAAG,OAAO;QACrC,oBAAoB,EAAE,IAAI;KAC3B,CACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Audit-Log Archival Batch (audit Phase 5 / F1)\n *\n * Periodic CRON custom batch that EXPORTS aged audit records to durable off-DB\n * archival artifacts in file storage. It is the operator-tunable retention /\n * archival mechanism for the compliance audit trail.\n *\n * --------------------------------------------------------------------------\n * Archival, NOT deletion — audit logs are immutable\n * --------------------------------------------------------------------------\n * `AUDIT_LOGS` is immutable by invariant (G5): its `coreOperations` are\n * `READ | LIST | SEARCH | CREATE` — no `UPDATE`, no `DELETE`. This batch\n * therefore NEVER removes audit records. It COPIES records older than the\n * operator-configured horizon (`AppConfiguration.auditTrail.archiveAfterDays`)\n * into durable JSON artifacts in file storage, one artifact per UTC day-window,\n * while the original rows remain in the always-on `AUDIT_LOGS` store (and, when\n * configured, in the append-only immudb tamper-proof ledger). The archive is an\n * additional off-DB compliance/DR copy — a portable artifact an auditor can be\n * handed — not a prune. (The value trade-off is explicit: it does NOT bound DB\n * growth. A future delete-after-archive step, if compliance demands\n * data-minimisation, would build on top of this — but that requires relaxing\n * G5 and is out of scope here.)\n *\n * --------------------------------------------------------------------------\n * OPT-IN\n * --------------------------------------------------------------------------\n * Setting `auditTrail.archiveAfterDays` IS the opt-in. When it is `undefined`\n * (the compliance-safe default) the batch no-ops: nothing is archived and every\n * record is retained in the primary store indefinitely. The batch is registered\n * unconditionally (like the reconcile / delivery drains) so a mis-set flag can\n * never orphan the schedule; the no-op is decided at TICK time from live config.\n *\n * --------------------------------------------------------------------------\n * Idempotency — stateless deterministic overwrite (no checkpoint store)\n * --------------------------------------------------------------------------\n * The archive is keyed by UTC day. Each day-window writes to a DETERMINISTIC\n * storage key (`audit-archive/[applicationId/]audit-archive-YYYY-MM-DD.json`)\n * via the `fileName` upload option, which the storage providers use as the blob\n * leaf — so re-uploading a window OVERWRITES it. A fully-past day's audit rows\n * are stable (audit events are created at operation time; nothing back-dates\n * into a closed day), so a re-write produces identical content. This makes the\n * batch idempotent WITHOUT any high-water-mark / checkpoint state: unlike the\n * reconcile batch (which stores its mark in immudb), archival must work even\n * when immudb is not configured, so it deliberately keeps ZERO cross-run state.\n *\n * Each tick (re)writes only the trailing {@link DEFAULT_LOOKBACK_DAYS} archivable\n * day-windows. On the daily cron exactly one new day crosses the horizon per\n * tick; the small look-back re-writes the last couple of crossed days so a\n * single missed tick self-heals on the next run. The (bounded) cost of the\n * re-write is re-reading a day or two of audit rows — cheap for a nightly sweep.\n *\n * Missed windows self-heal WITHOUT cross-run state: beyond the look-back, each tick sweeps a\n * bounded trailing span ({@link DEFAULT_BACKFILL_PROBE_DAYS}) and asks storage whether each day's\n * deterministic artifact already exists, archiving only the days that are missing. Progress is\n * therefore DERIVED FROM THE ARTIFACTS — the one durable record that always exists and that does\n * not require immudb, so the \"zero cross-run state\" property above is preserved rather than traded\n * away. A day repaired this way is logged as a warning and counted in `windowsBackfilled`: the\n * sweep fixes the gap, but a recurring count means ticks are being missed and an operator should\n * know. Previously such a day stayed missing forever, because nothing recorded that it was skipped.\n *\n * Cold-start backlog beyond the probe span: still an explicit operator gesture — trigger the batch\n * once with a `lookbackDaysOverride` wide enough to cover the history (e.g. the full\n * `archiveAfterDays` span). That remains the way to seed archives for an app that enabled archival\n * after it already had aged data.\n *\n * --------------------------------------------------------------------------\n * Cross-org, anchoring, failure containment\n * --------------------------------------------------------------------------\n * Scope-anchored @ APPLICATION: the batch archives EVERY org's aged rows into a\n * single per-day artifact (each record carries its own `organizationId`), so the\n * read bypasses the contextual org filter (`excludeContextualFilter: true`) —\n * mirroring the reconcile batch. Per-org artifact partitioning is a deliberate\n * future enhancement, not a v1 requirement — see the scaling note on\n * {@link MAX_RECORDS_PER_WINDOW} for WHY (cross-org amplifies the per-artifact\n * size) and HOW to lift the limitation (stream the upload + per-org partitioning).\n *\n * Never-throws contract: archival must not crash the batch runner (F7 — audit\n * side-channels are independent + non-blocking). A failure (storage outage, DB\n * read error) is LOGGED and yields a partial summary with `error` set; the next\n * scheduled tick retries the same trailing windows (idempotent overwrite makes\n * the retry safe).\n *\n * @see base-classes/services/batches/engine-custom-batch-manifests.ts\n * (`ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST` — the ref + cron single source).\n * @see compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.ts\n * (the sibling audit cron this mirrors for context creation + cross-org scan).\n */\n\nimport { Readable } from 'stream';\nimport { randomUUID } from 'crypto';\n\nimport { z } from 'zod';\nimport {\n CoreResourceType,\n CoreResourceOperation,\n ResourcePrimaryScope,\n CORE_APP_ROLES,\n} from '@wildo-ai/saas-models';\nimport type {\n AuditableEvent,\n} from '@wildo-ai/saas-models';\nimport {\n describeCaughtError,\n projectCaughtErrorLogFields,\n} from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { FileStorageAccepted } from '@wildo-ai/zod-decorators';\nimport {\n createCustomBatchExecutionService,\n type BatchesCronjobsCustomExecution_Service,\n} from '~wildo-backend-lib/base-classes/services/batches/batches-cronjobs-custom-execution.service';\nimport { ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST } from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport type { FileStorageRouterBackendService } from '~wildo-backend-lib/files/storage/file-storage-router.backend.service';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Tuning constants\n// ═══════════════════════════════════════════════════════════════════════════\n\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/** Folder namespace for archival artifacts within the storage provider. */\nconst AUDIT_ARCHIVE_FOLDER = 'audit-archive';\n\n/**\n * Per-page limit for the day-window AUDIT_LOGS scan. Hard-capped at 100 by the\n * repository (`_doList` clamps with `Math.min(100, …)`), so a larger value is\n * silently clamped. Paging stops when a page returns fewer than this.\n */\nconst PAGE_SIZE = 100;\n\n/**\n * Defensive per-window page ceiling — guards against an unbounded loop if a\n * window's row count somehow never decreases. At {@link PAGE_SIZE} = 100 and\n * {@link MAX_RECORDS_PER_WINDOW} = 100_000 the record cap is hit first; this is\n * the belt-and-braces backstop.\n */\nconst MAX_PAGES_PER_WINDOW = 2_000;\n\n/**\n * Hard cap on records accumulated into a SINGLE day-window artifact.\n *\n * WHAT IT PROTECTS: the batch holds a whole window's rows in memory (`records[]`)\n * to serialise ONE JSON artifact per day, so without a cap a huge day would OOM\n * the batch process. On the cap being hit we archive the first\n * {@link MAX_RECORDS_PER_WINDOW}, flag the window `truncated`, and emit a\n * `logger.warn` — the day's artifact is then INCOMPLETE, but NO audit data is\n * lost: the authoritative rows always remain in `AUDIT_LOGS` (+ immudb).\n *\n * ─────────────────────────────────────────────────────────────────────────────\n * KNOWN LIMITATION + HOW TO REMOVE IT (deferred 2026-07-04 — revisit only when a\n * real deployment's volume actually triggers it; do NOT pre-build speculatively)\n * ─────────────────────────────────────────────────────────────────────────────\n * The cross-org design (ONE artifact per day for ALL orgs — see the file header)\n * multiplies what lands in the buffer, so a high-volume multi-tenant deployment\n * can exceed this cap and CHRONICALLY truncate. The cap is a SYMPTOM; the ROOT\n * CAUSE is buffering the whole artifact in memory before a single sized upload.\n * Two orthogonal, COMPOSABLE fixes (do both to eliminate it, not just soften it):\n *\n * (1) STREAM THE UPLOAD — the true root fix. Replace `records[]` +\n * `Buffer.from(JSON.stringify(...))` + sized `provider.upload(...)` with a\n * `Readable` that pages the repo and emits NDJSON row-by-row into a\n * size-OPTIONAL streaming upload. Memory then stays bounded to one page\n * (~{@link PAGE_SIZE} rows) regardless of window size, and this cap is\n * DROPPED entirely. Enabler: `IFileStorageProvider.upload()` currently\n * requires `size: number`; add a size-optional streaming path —\n * MinIO/S3 `putObject` multiparts automatically when size is unknown, and\n * the local-directory provider just pipes `stream → writeStream` (relax the\n * `validateSize` policy gate for internal system artifacts). This touches\n * shared engine surface (the provider interface + both providers + tests).\n * Cheaper no-interface-change variant: spool the window to a temp file,\n * `stat` its size, then stream-upload from the file (bounded memory via\n * disk instead of RAM, at the cost of a temp-file lifecycle + writable disk).\n *\n * (2) PER-ORG PARTITIONING — removes the cross-org amplification AND is the\n * compliance-correct shape. Emit one artifact per `(org, day)` (+ an\n * APPLICATION-scoped artifact for no-org / app-level events) instead of one\n * cross-org artifact; enumerate the distinct `organizationId`s in the window\n * via a `distinct`/aggregation, then archive per org. Each artifact becomes\n * one org's day (smaller), and each tenant's trail is an independently\n * retrievable/erasable artifact — what GDPR right-to-erasure + data\n * residency actually want. Cost: more artifacts (org-count × days).\n *\n * REJECTED as weakest: per-HOUR windowing — only makes cap-hits rarer (24× more\n * files) without addressing the root cause; a pathological hour still truncates.\n *\n * DONE (2026-08-05), no longer a rider: {@link collectWindowRecords} now uses KEYSET\n * paging on the `(createdAt, eventId)` tuple, closing the boundary-tie SKIP that offset\n * paging over the non-unique `createdAt` could not. The sibling\n * `immudb.audit-reconcile` batch pages the same way. Only the cap below remains.\n */\nconst MAX_RECORDS_PER_WINDOW = 100_000;\n\n/**\n * Trailing day-windows (re)written each steady-state tick. On a daily cron one\n * new day crosses the horizon per tick; re-writing the last two crossed days\n * self-heals a single missed tick via idempotent overwrite. Overridable per-run\n * (`lookbackDaysOverride`) for cold-start backfills.\n */\nconst DEFAULT_LOOKBACK_DAYS = 2;\n\n/**\n * Absolute ceiling on day-windows processed in one run — bounds a backfill\n * invocation. Matches the max `archiveAfterDays` (2555 ≈ 7y) so a full-history\n * backfill fits one run; most historical days are empty and skipped cheaply.\n */\nconst MAX_LOOKBACK_DAYS = 2555;\n\n/**\n * How far BEYOND the look-back the tick probes for MISSING artifacts (the gap-healing sweep).\n *\n * The look-back above unconditionally re-writes the newest few archivable days. Anything older\n * that a tick missed used to stay missing forever: the batch keeps zero cross-run state, so\n * nothing recorded that a day was skipped, and an operator had to notice and run an explicit\n * `lookbackDaysOverride` backfill.\n *\n * Progress is instead DERIVED FROM THE ARTIFACTS THEMSELVES — the only durable record that is\n * already guaranteed to exist, and the one that keeps working when immudb is not configured (the\n * reason this batch has no checkpoint store; see the header). For each day in this trailing span\n * the tick asks storage whether the day's deterministic artifact key exists, and archives only the\n * days that are missing.\n *\n * Bounded on purpose: a probe is one cheap metadata lookup, but an unbounded sweep would grow with\n * the app's whole history on every nightly tick. Gaps older than this span remain an explicit\n * `lookbackDaysOverride` operation, exactly as before.\n */\nconst DEFAULT_BACKFILL_PROBE_DAYS = 90;\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Input / Output schemas\n// ═══════════════════════════════════════════════════════════════════════════\n\n/**\n * Optional per-tick overrides for manual `runOnce` triggers. Both narrow the\n * batch for one-shot operator gestures without touching app config.\n */\nexport const AuditLogsArchiveBatchInputSchema = z.object({\n /** One-shot archival horizon override (days). Falls back to app config. */\n archiveAfterDaysOverride: z.number().int().min(1).max(2555).optional(),\n /** One-shot look-back width override (days) — for cold-start backfills. */\n lookbackDaysOverride: z.number().int().min(1).max(MAX_LOOKBACK_DAYS).optional(),\n /**\n * One-shot width override (days) for the missing-artifact probe sweep that runs BEYOND the\n * look-back. `0` disables the sweep for this run (pure look-back behaviour).\n */\n backfillProbeDaysOverride: z.number().int().min(0).max(MAX_LOOKBACK_DAYS).optional(),\n}).strict();\nexport type AuditLogsArchiveBatchInput = z.infer<typeof AuditLogsArchiveBatchInputSchema>;\n\n/**\n * Run summary covering the happy path, the two no-op paths (disabled / no\n * storage), and the failure path.\n */\nexport const AuditLogsArchiveBatchOutputSchema = z.object({\n /** Wall-clock ISO timestamp when the body started. */\n tickAt: z.string().datetime(),\n /** Whether an archival horizon was configured/overridden (opt-in resolved). */\n enabled: z.boolean(),\n /** Effective archival horizon applied this tick (days), or null when disabled. */\n archiveAfterDays: z.number().int().nullable(),\n /** ISO cutoff — records with `createdAt < horizonAt` were archival-eligible. */\n horizonAt: z.string().datetime().nullable(),\n /** Whether a storage provider was configured (false ⇒ no-op). */\n storageConfigured: z.boolean(),\n /** Trailing day-windows considered this run. */\n lookbackDays: z.number().int().min(0),\n /** Width (days) of the missing-artifact probe sweep beyond the look-back. */\n backfillProbeDays: z.number().int().min(0),\n /**\n * Days in the probe span whose artifact was ABSENT and were therefore archived by the sweep.\n * A persistently non-zero value means ticks are being missed — surfaced rather than silent.\n */\n windowsBackfilled: z.number().int().min(0),\n /** Day-windows scanned (some may have had zero rows and produced no artifact). */\n windowsScanned: z.number().int().min(0),\n /** Day-windows that produced (overwrote) an archival artifact. */\n windowsArchived: z.number().int().min(0),\n /** Total audit records written across all artifacts this run. */\n recordsArchived: z.number().int().min(0),\n /** Windows that hit {@link MAX_RECORDS_PER_WINDOW} and were archived partial. */\n truncatedWindows: z.number().int().min(0),\n /** Tick-level failure message — non-null only when a scan/upload threw. */\n error: z.string().nullable(),\n durationMs: z.number().int().min(0),\n});\nexport type AuditLogsArchiveBatchOutput = z.infer<typeof AuditLogsArchiveBatchOutputSchema>;\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Internals\n// ═══════════════════════════════════════════════════════════════════════════\n\n/** Shape the paginated AUDIT_LOGS `list` resolves to. */\ninterface AuditLogsListPage {\n data: AuditableEvent[];\n pagination?: { totalPages?: number };\n}\n\n/**\n * Human-readable one-line message for the batch OUTPUT's `error` field (the\n * output schema types it as a plain `string`).\n *\n * Delegates to the shared {@link describeCaughtError} rather than an inline\n * `instanceof Error` ternary, which would persist every structured\n * `WildoError_Backend` as the literal `'[object Object]'`. The log line pairs\n * this with {@link projectCaughtErrorLogFields} for the full queryable detail.\n */\nfunction formatError(err: unknown): string {\n return describeCaughtError(err);\n}\n\n/** Midnight-UTC start of the day containing `d`. */\nfunction startOfUtcDay(d: Date): Date {\n return new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));\n}\n\nfunction addDays(d: Date, n: number): Date {\n return new Date(d.getTime() + n * MS_PER_DAY);\n}\n\n/** `YYYY-MM-DD` key for a midnight-UTC day-start. */\nfunction dayKey(dayStart: Date): string {\n return dayStart.toISOString().slice(0, 10);\n}\n\n/**\n * Resolve the effective archival horizon (days). First non-undefined wins:\n * per-tick override → `AppConfiguration.auditTrail.archiveAfterDays` → none\n * (undefined ⇒ archival disabled). Read at TICK time so an in-place config\n * change takes effect on the next run without a redeploy.\n */\nfunction resolveArchiveAfterDays(\n override: number | undefined,\n appConfigService: AppConfigurationService,\n): number | undefined {\n if (typeof override === 'number') return override;\n const fromConfig = appConfigService.config?.auditTrail?.archiveAfterDays;\n return typeof fromConfig === 'number' ? fromConfig : undefined;\n}\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Batch Service\n// ═══════════════════════════════════════════════════════════════════════════\n\nexport const auditLogsArchiveBatchService: BatchesCronjobsCustomExecution_Service<\n typeof AuditLogsArchiveBatchInputSchema,\n typeof AuditLogsArchiveBatchOutputSchema\n> = createCustomBatchExecutionService({\n input: AuditLogsArchiveBatchInputSchema,\n output: AuditLogsArchiveBatchOutputSchema,\n batchCronjob_Context: {\n // Scope-anchored @ APPLICATION: cross-org archival, no honest single target\n // resource (mirrors the reconcile / SIEM anchoring). `cronJobExpression` is\n // what actually SCHEDULES the run (sourced from the manifest so schedule +\n // spec cross-validation share ONE literal); omitting it would register the\n // batch but never fire it.\n kind: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.kind,\n operationIdentifier: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.operationIdentifier,\n primaryScope: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.primaryScope,\n cronJobExpression: ENGINE_AUDIT_LOGS_ARCHIVE_BATCH_MANIFEST.cronExpression,\n },\n resolveDependencies: ({ get }) => ({\n appConfigService: get<AppConfigurationService>(SAAS_SERVICE_TYPES.AppConfigService),\n fileStorageRouter: get<FileStorageRouterBackendService>(SAAS_SERVICE_TYPES.FileStorageRouter),\n }),\n doHandle: async (\n input,\n {\n logger,\n repositoriesRegistry,\n executionContextCreator,\n dependencies,\n },\n ) => {\n const startTime = Date.now();\n const tickAt = new Date(startTime).toISOString();\n const logDebug = logger.debugByType('AuditLogsArchiveBatch');\n const { appConfigService, fileStorageRouter } = dependencies;\n\n // Mutable run state, hoisted OUT of the try so the never-throws catch reports\n // HONEST partial progress: artifacts uploaded before a mid-loop failure are\n // real (persisted, idempotent), so the failure summary must reflect them —\n // not reset to zero. Mirrors the reconcile batch's \"return what was\n // accumulated\" contract.\n let enabled = false;\n let archiveAfterDays: number | null = null;\n let horizonAt: string | null = null;\n let storageConfigured = false;\n let lookbackDays = 0;\n let backfillProbeDays = 0;\n let windowsScanned = 0;\n let windowsArchived = 0;\n let windowsBackfilled = 0;\n let recordsArchived = 0;\n let truncatedWindows = 0;\n\n const summary = (error: string | null = null): AuditLogsArchiveBatchOutput => ({\n tickAt,\n enabled,\n archiveAfterDays,\n horizonAt,\n storageConfigured,\n lookbackDays,\n backfillProbeDays,\n windowsScanned,\n windowsArchived,\n windowsBackfilled,\n recordsArchived,\n truncatedWindows,\n error,\n durationMs: Date.now() - startTime,\n });\n\n try {\n // 1. Opt-in gate. Undefined horizon ⇒ archival disabled (retain in DB\n // indefinitely). Emit a tick log so the cron's liveness is observable.\n const resolvedArchiveAfterDays = resolveArchiveAfterDays(input.archiveAfterDaysOverride, appConfigService);\n if (resolvedArchiveAfterDays === undefined) {\n logger.info('[audit] archive tick complete (archival disabled — auditTrail.archiveAfterDays unset)', { tickAt });\n return summary();\n }\n enabled = true;\n archiveAfterDays = resolvedArchiveAfterDays;\n\n // 2. Storage gate. Without a configured storage provider there is nowhere\n // to write; warn + no-op (never throw).\n if (!fileStorageRouter.isConfigured()) {\n logger.warn('[audit] archival is enabled but no file-storage provider is configured — skipping archival tick', {\n tickAt,\n archiveAfterDays,\n });\n return summary();\n }\n storageConfigured = true;\n // Prefer Wildo-managed, fall back to local-directory — the first\n // configured of the two the router knows about.\n const storageProvider = fileStorageRouter.resolveProvider([\n FileStorageAccepted.WILDO_MANAGED,\n FileStorageAccepted.LOCAL_DIRECTORY,\n ]);\n\n // 3. Compute the archivable day-window range. `horizon` is the age\n // cutoff; the most-recent FULLY-archivable day is the one ending at\n // the start of the horizon's day (the horizon's own day is only\n // partially older than the cutoff, so it is not archived yet).\n const horizon = new Date(startTime - resolvedArchiveAfterDays * MS_PER_DAY);\n horizonAt = horizon.toISOString();\n const dmaxStart = addDays(startOfUtcDay(horizon), -1);\n lookbackDays = Math.min(\n Math.max(input.lookbackDaysOverride ?? DEFAULT_LOOKBACK_DAYS, 1),\n MAX_LOOKBACK_DAYS,\n );\n // The probe sweep sits BEYOND the look-back, and the pair is capped together so a wide\n // `lookbackDaysOverride` backfill cannot also drag a full probe span along behind it.\n backfillProbeDays = Math.min(\n Math.max(input.backfillProbeDaysOverride ?? DEFAULT_BACKFILL_PROBE_DAYS, 0),\n Math.max(MAX_LOOKBACK_DAYS - lookbackDays, 0),\n );\n\n // Internal APP_ADMIN_SUPER_ADMIN @ APPLICATION context for the AUDIT_LOGS\n // read — mirrors the reconcile batch. No org id + `excludeContextualFilter`\n // on the read ⇒ the scan spans EVERY org's rows.\n //\n // Resolved through the canonical repository seam, NOT a hand-rolled\n // `ResourceConfiguration_OperationPath`. Operation defaults are\n // variant-type-LOCAL and AUDIT_LOGS declares its LIST `REPOSITORY_ONLY`\n // variant `isDefault: false`, so a literal\n // `{ variantType: REPOSITORY_ONLY, isOperationDefault: true }` path matches\n // NOTHING and throws. That literal used to sit here and was latent only\n // because the archival opt-in gate above returns before reaching it whenever\n // `auditTrail.archiveAfterDays` is unset — enabling archival would have\n // surfaced it immediately. The sibling reconcile batch (no such gate) threw on\n // every run. See `immudb-audit-reconcile.batch.backend.service.ts`.\n const executionContext = await executionContextCreator.createForInternalRepositoryOperation({\n resourceType: CoreResourceType.AUDIT_LOGS,\n operationIdentifier: CoreResourceOperation.LIST,\n contextResourcesFieldIdentifier: new Map(),\n initiatorIds: null,\n initiatorRoles: [\n { roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], relatedPrimaryScope: ResourcePrimaryScope.APPLICATION },\n ],\n });\n const auditRepo = repositoriesRegistry.getRepositoryOrThrow(CoreResourceType.AUDIT_LOGS, executionContext);\n\n const applicationId = executionContext.applicationId || appConfigService.applicationId;\n\n // The day offsets processed this tick, oldest → newest so partial-run progress covers the\n // oldest un-archived days first.\n //\n // Two bands with DIFFERENT semantics:\n // - look-back band (offsets 0…lookbackDays-1): ALWAYS re-scanned and re-written. Recent\n // days are cheap and this is what self-heals a single missed tick.\n // - probe band (older): re-scanned ONLY when the day's artifact is missing. This is the\n // gap-healing sweep — it derives progress from the artifacts instead of cross-run state,\n // so a tick missed weeks ago is repaired automatically instead of silently persisting.\n const probeBandStart = lookbackDays;\n const probeBandEnd = lookbackDays + backfillProbeDays; // exclusive\n const offsets: number[] = [];\n for (let i = probeBandEnd - 1; i >= probeBandStart; i -= 1) offsets.push(i);\n for (let i = lookbackDays - 1; i >= 0; i -= 1) offsets.push(i);\n\n for (const i of offsets) {\n const windowStart = addDays(dmaxStart, -i);\n const windowEnd = addDays(windowStart, 1);\n const isProbeBand = i >= probeBandStart;\n\n if (isProbeBand) {\n // One cheap metadata lookup decides whether this old day needs any work at all. An\n // already-archived non-empty day costs exactly this probe and nothing more.\n const exists = await archiveArtifactExists({\n storageProvider,\n executionContext,\n day: dayKey(windowStart),\n });\n if (exists) continue;\n }\n\n windowsScanned += 1;\n\n const { records, truncated } = await collectWindowRecords(auditRepo, executionContext, windowStart, windowEnd);\n if (records.length === 0) {\n // Empty day ⇒ no artifact (keeps historical backfill cheap). NOTE this is why the probe\n // cannot distinguish \"never archived\" from \"archived nothing\": an empty day is re-scanned\n // by every sweep. That scan is a single zero-row query, deliberately preferred over\n // writing empty marker artifacts just to satisfy the probe.\n continue;\n }\n if (truncated) {\n truncatedWindows += 1;\n // No silent caps: dropping records from an archive artifact must be\n // loud. The source rows are NOT lost (they stay in AUDIT_LOGS + immudb)\n // — the day's artifact is merely incomplete. An operator seeing this\n // should narrow to per-hour windows (future enhancement).\n logger.warn(\n '[audit] archive day-window hit the per-window record cap — artifact is INCOMPLETE for this day '\n + '(source rows retained in AUDIT_LOGS; the newest rows past the cap are omitted from the artifact)',\n { day: dayKey(windowStart), cap: MAX_RECORDS_PER_WINDOW, archived: records.length },\n );\n }\n\n await uploadWindowArtifact({\n storageProvider,\n executionContext,\n applicationId,\n windowStart,\n windowEnd,\n archivedAt: tickAt,\n records,\n truncated,\n });\n\n windowsArchived += 1;\n recordsArchived += records.length;\n if (isProbeBand) {\n windowsBackfilled += 1;\n // A gap the steady-state look-back could never have reached. Report it: a recurring\n // count here means ticks are being missed, which is worth an operator's attention even\n // though the sweep repaired it.\n logger.warn('[audit] archived a MISSING historical day-window (gap-healing sweep) — ticks may be being missed', {\n day: dayKey(windowStart),\n recordCount: records.length,\n });\n }\n logDebug('Archived audit day-window', {\n day: dayKey(windowStart),\n recordCount: records.length,\n truncated,\n backfilled: isProbeBand,\n });\n }\n\n logger.info('[audit] archive tick complete', {\n tickAt,\n archiveAfterDays,\n horizonAt,\n lookbackDays,\n backfillProbeDays,\n windowsScanned,\n windowsArchived,\n windowsBackfilled,\n recordsArchived,\n truncatedWindows,\n });\n\n return summary();\n } catch (error) {\n // Top-level guard: never throw onto the batch runner. Return the summary\n // with progress accumulated so far (artifacts already uploaded are real);\n // the next tick retries the same trailing windows (idempotent overwrite).\n const message = formatError(error);\n logger.error?.('[audit] audit-logs archive batch failed (non-fatal, returning partial summary)', {\n ...projectCaughtErrorLogFields(error),\n tickAt,\n });\n return summary(message);\n }\n },\n});\n\n// ═══════════════════════════════════════════════════════════════════════════\n// Helpers\n// ═══════════════════════════════════════════════════════════════════════════\n\n/**\n * Page through one day-window `[windowStart, windowEnd)` of AUDIT_LOGS and\n * accumulate its rows (cross-org, `createdAt` ASC for deterministic artifact\n * content). Stops at {@link MAX_RECORDS_PER_WINDOW} (flagging `truncated`) so a\n * pathological day can't OOM the batch. Throws on repository failure — the\n * caller's top-level guard records it on `outputData.error`.\n *\n * **Paging is KEYSET on `(createdAt, eventId)`** (2026-08-05), not offset-based.\n *\n * It used to be `skip = (page-1)*limit` over the NON-unique `createdAt`. When more rows\n * than the page size share one millisecond across a page boundary, the store may order\n * those ties differently between the two page queries — so a boundary row could be\n * served on BOTH pages (duplicated) or on NEITHER (silently dropped from the artifact).\n * Dedupe by `eventId` covered the duplicate half; the dropped half was unrecoverable.\n *\n * This was previously written off as \"negligible in practice (needs 100+ events in one\n * millisecond)\". That condition is real: an application boot burst wrote 404 audit rows\n * in a single millisecond, which permanently stranded 305 records in the sibling\n * `immudb.audit-reconcile` batch before it was converted to the same keyset scan. Boot,\n * seeding and migration paths emit audit rows in tight loops — that is exactly when a\n * day-window archive matters most.\n *\n * The `(createdAt, eventId)` tuple is unique and totally ordered, so no row can now fall\n * between two pages in either direction. The `eventId` half depends on it being present\n * in the AUDIT_LOGS LIST `sortFields` (pinned by the resource-config test); a non-empty\n * whitelist makes the repository DROP unlisted sort keys silently, so removing it would\n * restore the defect without any error. The `seen` dedupe and the no-progress guard\n * remain as backstops for exactly that degradation.\n *\n * Residual (unchanged): a window exceeding {@link MAX_RECORDS_PER_WINDOW} is still\n * truncated, and the source rows always remain in AUDIT_LOGS regardless.\n */\n/**\n * Does the archival artifact for `day` already exist in storage?\n *\n * This is how the batch derives progress WITHOUT any cross-run state: the artifacts are the\n * record. It must address the blob exactly as {@link uploadWindowArtifact} wrote it, and it does\n * so WITHOUT re-implementing any provider path logic — the composite\n * `<folderPath>/<fileName>` is handed over as the `fileId` and each provider applies its OWN\n * composition, the same one its `upload` used:\n *\n * - wildo-managed: `upload` builds `effectiveFileId = folderPath/fileName` and calls\n * `resolveApplicationObjectKey(effectiveFileId, ctx)`; `getMetadata` calls that identical\n * resolver with `file.fileId`.\n * - local-directory: `upload` calls `composeStorageKey(fileId, ctx, options)`; `getMetadata` with\n * no `storageRef` calls that same method with `file.fileId` and no options.\n *\n * Both therefore land on the byte-identical key — and since 2026-09-09 on the SAME key as each\n * other, because both route through `application-storage-key.backend.utils`. The one coupling is\n * `includeApplicationId: true` on the upload — flip that and the probe would address a different\n * blob, so the two must move together.\n *\n * Parity is pinned in each provider's OWN suite (upload, then `getMetadata` with no ref, against a\n * real store). It is NOT pinned here: this batch's tests drive a fake provider that stores and\n * probes `<folderPath>/<fileName>` by construction, so it agrees with itself whatever the real\n * providers do. An earlier revision of this comment claimed \"pinned by the key-parity test\"; no\n * such test existed.\n *\n * FAIL-SAFE DIRECTION: any failure — genuinely absent, or a transient storage fault — answers\n * `false`, i.e. \"archive it\". Re-archiving is harmless by construction (the artifact key is\n * deterministic and the write overwrites), whereas a false `true` would silently skip a day and\n * recreate the very gap this sweep exists to close.\n */\nasync function archiveArtifactExists(args: {\n storageProvider: ReturnType<FileStorageRouterBackendService['resolveProvider']>;\n executionContext: Awaited<ReturnType<ExecutionContextCreatorBackendService['createForInternalRepositoryOperation']>>;\n day: string;\n}): Promise<boolean> {\n const { storageProvider, executionContext, day } = args;\n try {\n await storageProvider.getMetadata(\n {\n fileId: `${AUDIT_ARCHIVE_FOLDER}/audit-archive-${day}.json`,\n storageProvider: undefined,\n storageRef: undefined,\n } as unknown as Parameters<typeof storageProvider.getMetadata>[0],\n executionContext,\n );\n return true;\n } catch {\n return false;\n }\n}\n\nasync function collectWindowRecords(\n auditRepo: ReturnType<RepositoriesRegistryHandlerBackendService['getRepositoryOrThrow']>,\n executionContext: Awaited<ReturnType<ExecutionContextCreatorBackendService['createForInternalRepositoryOperation']>>,\n windowStart: Date,\n windowEnd: Date,\n): Promise<{ records: AuditableEvent[]; truncated: boolean }> {\n const windowBound = { createdAt: { $gte: windowStart, $lt: windowEnd } };\n const records: AuditableEvent[] = [];\n const seen = new Set<string>();\n let truncated = false;\n /** Keyset position: the `(createdAt, eventId)` of the last row consumed. */\n let cursor: { createdAt: Date; eventId: string } | null = null;\n\n for (let page = 1; page <= MAX_PAGES_PER_WINDOW; page += 1) {\n // KEYSET lower bound, ANDed with the day window. `$and`/`$or` are both translated by the\n // Mongo and PostgreSQL adapters, so the predicate is portable.\n const filter: Record<string, unknown> = cursor === null\n ? windowBound\n : {\n $and: [\n windowBound,\n {\n $or: [\n { createdAt: { $gt: cursor.createdAt } },\n { createdAt: cursor.createdAt, eventId: { $gt: cursor.eventId } },\n ],\n },\n ],\n };\n\n // Page is pinned to 1: the cursor — not an offset — is what advances. Offset paging over a\n // NON-unique sort key was the defect (see the boundary-tie note above); with `skip`, ties\n // straddling a page boundary could be served on both pages (deduped below) or on NEITHER\n // (unrecoverable). `sort` is honored because AUDIT_LOGS' LIST whitelists BOTH `createdAt`\n // and `eventId` in its sortFields — drop `eventId` there and the tie-break silently\n // disappears, restoring the skip. Typed to the `_doList` contract, structurally compatible\n // with the public overload.\n const listOptions: { page: number; limit: number; sort: Record<string, 1 | -1> } = {\n page: 1,\n limit: PAGE_SIZE,\n sort: { createdAt: 1, eventId: 1 },\n };\n const result = (await auditRepo.list(executionContext, filter, {\n paginated: true,\n // Cross-org archival: bypass the contextual org filter so EVERY org's rows\n // for this day are captured, not just a caller's org.\n excludeContextualFilter: true,\n listOptions,\n })) as unknown as AuditLogsListPage;\n\n const rows = result.data ?? [];\n if (rows.length === 0) break;\n\n const cursorBeforePage = cursor;\n\n for (const row of rows) {\n // Dedupe by stable identity. Keyset paging makes a cross-page duplicate unreachable in\n // normal operation, so this is now a defensive backstop against a degraded sort rather\n // than the primary protection it used to be. A row with no identity at all (never\n // expected — persisted rows carry `_id`) is treated as distinct rather than silently\n // collapsed.\n const key = String((row as { eventId?: string; _id?: string }).eventId\n ?? (row as { _id?: string })._id ?? '');\n if (key && seen.has(key)) continue;\n if (records.length >= MAX_RECORDS_PER_WINDOW) {\n truncated = true;\n break;\n }\n if (key) seen.add(key);\n records.push(row);\n\n // Advance only on a COMPLETE tuple: a row missing either half cannot express a keyset\n // position, and inventing a partial one would step over its neighbours. Leaving the cursor\n // put means the no-progress guard below ends the scan instead.\n const rowCreatedAt = row.createdAt instanceof Date ? row.createdAt : new Date(String(row.createdAt));\n const rowEventId = (row as { eventId?: unknown }).eventId;\n if (!Number.isNaN(rowCreatedAt.getTime()) && typeof rowEventId === 'string') {\n cursor = { createdAt: rowCreatedAt, eventId: rowEventId };\n }\n }\n if (truncated) break;\n\n // Defensive no-progress guard: with a valid `(createdAt, eventId)` sort every page strictly\n // advances the cursor. Failing to advance means the ordering was degraded or the page held\n // no usable tuple — stop rather than re-issue an identical query forever.\n if (\n cursor !== null &&\n cursorBeforePage !== null &&\n cursor.createdAt.getTime() === cursorBeforePage.createdAt.getTime() &&\n cursor.eventId === cursorBeforePage.eventId\n ) {\n break;\n }\n\n if (rows.length < PAGE_SIZE) break;\n }\n\n return { records, truncated };\n}\n\n/**\n * Serialise a day-window's records to a self-describing JSON artifact and upload\n * it to the DETERMINISTIC key `audit-archive/[applicationId/]audit-archive-<day>.json`\n * (overwrite = idempotent). JSON (not CSV) is used deliberately: audit events\n * carry nested metadata that CSV would flatten lossily.\n */\nasync function uploadWindowArtifact(args: {\n storageProvider: ReturnType<FileStorageRouterBackendService['resolveProvider']>;\n executionContext: Awaited<ReturnType<ExecutionContextCreatorBackendService['createForInternalRepositoryOperation']>>;\n applicationId: string | undefined;\n windowStart: Date;\n windowEnd: Date;\n archivedAt: string;\n records: AuditableEvent[];\n truncated: boolean;\n}): Promise<void> {\n const { storageProvider, executionContext, applicationId, windowStart, windowEnd, archivedAt, records, truncated } = args;\n const day = dayKey(windowStart);\n\n const payload = {\n schemaVersion: 1 as const,\n kind: 'audit-log-archive' as const,\n // Self-describing provenance: the artifact is also namespaced under the\n // applicationId in its storage path (includeApplicationId), but embedding it\n // keeps a portable artifact identifiable without parsing the path.\n applicationId: applicationId ?? null,\n dayWindowUtc: day,\n windowStart: windowStart.toISOString(),\n windowEnd: windowEnd.toISOString(),\n archivedAt,\n recordCount: records.length,\n truncated,\n records,\n };\n const buffer = Buffer.from(JSON.stringify(payload), 'utf-8');\n\n await storageProvider.upload(\n Readable.from([buffer]),\n // Random valid resource id satisfies `validateFileId`; the DETERMINISTIC key\n // comes from `fileName` (the providers use it as the blob leaf), so the id\n // never affects the storage location or the overwrite semantics.\n randomUUID(),\n 'application/json',\n buffer.byteLength,\n executionContext,\n {\n folderPath: AUDIT_ARCHIVE_FOLDER,\n fileName: `audit-archive-${day}.json`,\n includeApplicationId: true,\n },\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"immudb-audit-reconcile.batch.backend.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"immudb-audit-reconcile.batch.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,EAEL,KAAK,sCAAsC,EAC5C,MAAM,4FAA4F,CAAC;AA4CpG;;;;GAIG;AACH,eAAO,MAAM,oCAAoC,gCAAe,CAAC;AACjE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC;;;iBAGhD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAiIpG,eAAO,MAAM,gCAAgC,EAAE,sCAAsC,CACnF,OAAO,oCAAoC,EAC3C,OAAO,qCAAqC,CAwH5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"siem-webhook-delivery.batch.backend.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"siem-webhook-delivery.batch.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,sCAAsC,EAC5C,MAAM,4FAA4F,CAAC;AAYpG;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuB9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;;;;;iBAM/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAqBlG,eAAO,MAAM,+BAA+B,EAAE,sCAAsC,CAClF,OAAO,mCAAmC,EAC1C,OAAO,oCAAoC,CAsD3C,CAAC"}
|
package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-audit-logs.service.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"mock-audit-logs.service.d.ts","sourceRoot":"","sources":["../../../../../../src/compliance/audit-trails/services/__tests__/mock-audit-logs.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,kBAAkB,CAAC;AAI1B,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,CAAC;AAEF,qBACa,oBAAoB;IAC/B,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,CAAM;IAEzC,OAAO,CAAC,UAAU;IAIlB,YAAY,kDAET;IAEH,eAAe,kDAEZ;IAEH,qBAAqB,kDAElB;IAEH,YAAY,kDAET;IAEH,wBAAwB,kDAErB;IAEH,sBAAsB,kDAEnB;IAEH,KAAK,IAAI,IAAI;CASd"}
|
package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts
CHANGED
|
@@ -16,6 +16,55 @@ import { RepositoriesRegistryHandlerBackendService } from '../../../base-classes
|
|
|
16
16
|
import { QueueBackendService } from '../../../queue/queue.backend.service';
|
|
17
17
|
import { type SecurityAuditEventEnvelope, type AuditableEvent, type SiemExportConfigBase, AuthScopeType } from '@wildo-ai/saas-models';
|
|
18
18
|
import type { ExecutionContext } from '../../../runtime/models/execution-context.backend.schemas';
|
|
19
|
+
import type { RedisService } from '../../../databases/services/redis.service';
|
|
20
|
+
/**
|
|
21
|
+
* **A SIEM export configuration change takes effect on EVERY replica within 60 seconds — and within
|
|
22
|
+
* milliseconds when the change goes through the engine.**
|
|
23
|
+
*
|
|
24
|
+
* That sentence is the guarantee this subsystem makes, and the two halves come from two different
|
|
25
|
+
* mechanisms, so read both before changing either.
|
|
26
|
+
*
|
|
27
|
+
* ## Why the number is 60 seconds, and why it used to be 300
|
|
28
|
+
*
|
|
29
|
+
* The lease is the ONLY thing that covers a write no hook can see — a repository-tier write, or a
|
|
30
|
+
* direct database write. There is a live one: `examples/wonder-todos/e2e/adapter.ts` (`case 'siem'`)
|
|
31
|
+
* repoints an organization's export config with `upsertOrganizationSingleton(...)`, straight at the
|
|
32
|
+
* store, bypassing the engine entirely. Its own comment records what the old 300 s cost — *"A freshly
|
|
33
|
+
* provisioned org has a cold 5-min config cache, so the first login cold-reads this"* — i.e. the lane
|
|
34
|
+
* is correct only because it is ORDERED to run before the organization's first audited action. A
|
|
35
|
+
* five-minute convergence bound is not something a scenario, or an operator doing surgery, can wait
|
|
36
|
+
* for; it is something they have to design around. Sixty seconds is something they can wait for.
|
|
37
|
+
*
|
|
38
|
+
* The old 300 s was never chosen for that job — it was chosen to bound READ AMPLIFICATION, because a
|
|
39
|
+
* miss costs more than a repository read: `AuthOrganizationConfigurationService.loadSiemExportConfig`
|
|
40
|
+
* reads through `readAsSystem`, which emits its own `system_context_read` audit row to the database
|
|
41
|
+
* AND to immudb. So shortening the lease multiplies audit-trail plumbing noise, not just queries.
|
|
42
|
+
* Two properties make 60 s affordable anyway:
|
|
43
|
+
*
|
|
44
|
+
* - **Refreshes are LAZY and STALE-WHILE-REVALIDATE** ({@link LeasedValueCache}). A quiet organization
|
|
45
|
+
* costs one read per event, not one per minute; only a continuously busy one reaches the ceiling of
|
|
46
|
+
* one read per lease per replica. At 60 s that ceiling is 60 reads/hour/replica per ACTIVE
|
|
47
|
+
* organization — for an organization emitting 1000 audit events an hour, under 5 % amplification of
|
|
48
|
+
* its own audit volume, against 12/hour before.
|
|
49
|
+
* - **Nothing blocks on it.** Past the lease the cached value is served immediately and the re-read
|
|
50
|
+
* runs off the emission path, so shortening it costs read volume and never latency.
|
|
51
|
+
*
|
|
52
|
+
* ## The other half: the engine-routed write converges in milliseconds
|
|
53
|
+
*
|
|
54
|
+
* {@link AuditEventDispatcherBackendService.invalidateSiemConfig} drops the local entry AND publishes
|
|
55
|
+
* the organization id on {@link SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX}, which every replica
|
|
56
|
+
* subscribes to. Before that broadcast the invalidation reached exactly ONE process — the one that
|
|
57
|
+
* happened to handle the write — and every other replica served the stale value for the rest of the
|
|
58
|
+
* lease, which is the defect this constant's neighbours document.
|
|
59
|
+
*
|
|
60
|
+
* **Do not raise this back toward the read-amplification number.** If the amplification ever needs to
|
|
61
|
+
* come down, the right lever is the `system_context_read` row on the config read itself:
|
|
62
|
+
* `SystemAccessBackendService.readAsSystem` already takes `suppressSystemAudit`, and its own JSDoc
|
|
63
|
+
* names this exact read — *"the audit pipeline resolving … an org's SIEM config to ROUTE an audit
|
|
64
|
+
* event"* — as the case it exists for. `loadSiemExportConfig` is the one such reader that does not
|
|
65
|
+
* pass it. Fixing that makes a miss cost a single indexed read and removes the constraint entirely.
|
|
66
|
+
*/
|
|
67
|
+
export declare const SIEM_CONFIG_REFRESH_AFTER_MS: number;
|
|
19
68
|
/**
|
|
20
69
|
* The per-org audit sink TYPES an organization can route its authenticated audit
|
|
21
70
|
* events to. Today the only type is the SIEM webhook. Adding a per-org destination
|
|
@@ -33,12 +82,48 @@ export declare class AuditEventDispatcherBackendService {
|
|
|
33
82
|
private readonly orgConfigService;
|
|
34
83
|
private readonly queueService;
|
|
35
84
|
private readonly repositoriesRegistry;
|
|
85
|
+
/**
|
|
86
|
+
* `@optional()` and APPENDED LAST — the constructor-parameter discipline.
|
|
87
|
+
*
|
|
88
|
+
* Optional because the cross-replica broadcast is an OPTIMISATION over the lease, never a
|
|
89
|
+
* precondition for routing: a container with no Redis binding (several partial test containers, and
|
|
90
|
+
* any single-replica deployment) must still dispatch audit events, converging on the lease alone.
|
|
91
|
+
* Appended last so the five existing construction sites keep compiling unchanged.
|
|
92
|
+
*/
|
|
93
|
+
private readonly redisService?;
|
|
36
94
|
private readonly logDebug;
|
|
37
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* F3: org NAME cache — a display label on the envelope. See {@link ORG_NAME_REFRESH_AFTER_MS}.
|
|
97
|
+
*
|
|
98
|
+
* No `onRefreshFailure`, and it would be dead code if there were one: {@link _resolveOrgName}'s loader
|
|
99
|
+
* swallows its own error and yields `undefined`, so nothing this cache runs can ever reject. That
|
|
100
|
+
* swallow is what makes the negative result CACHEABLE, which is the amplification fix described there;
|
|
101
|
+
* the price is that a persistently unreadable organization row is silent, which is the right trade for
|
|
102
|
+
* an optional label whose authoritative sibling (`organizationId`) is on the envelope regardless.
|
|
103
|
+
*/
|
|
38
104
|
private readonly _orgNameCache;
|
|
39
|
-
/** R2: per-org SIEM-config cache —
|
|
105
|
+
/** R2: per-org SIEM-config cache — the value that decides ROUTING. See {@link SIEM_CONFIG_REFRESH_AFTER_MS}. */
|
|
40
106
|
private readonly _siemConfigCache;
|
|
41
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Latch so {@link _ensureInvalidationSubscriber} is idempotent; cleared on `end` so a dropped
|
|
109
|
+
* subscriber re-arms.
|
|
110
|
+
*
|
|
111
|
+
* Deliberately the ONLY subscriber state kept. `A2ATaskCancellationBackendService` also holds the
|
|
112
|
+
* client itself, because it has a shutdown path that closes it; this service has none, and a field
|
|
113
|
+
* nothing reads is a field the next reader has to reason about for nothing. The socket keeps the
|
|
114
|
+
* subscriber alive on its own, and a connection that emitted `end` is already closed.
|
|
115
|
+
*/
|
|
116
|
+
private _invalidationSubscribeStarted;
|
|
117
|
+
constructor(logger: LoggerService, appConfigService: AppConfigurationService, orgConfigService: AuthOrganizationConfigurationService, queueService: QueueBackendService, repositoriesRegistry: RepositoriesRegistryHandlerBackendService,
|
|
118
|
+
/**
|
|
119
|
+
* `@optional()` and APPENDED LAST — the constructor-parameter discipline.
|
|
120
|
+
*
|
|
121
|
+
* Optional because the cross-replica broadcast is an OPTIMISATION over the lease, never a
|
|
122
|
+
* precondition for routing: a container with no Redis binding (several partial test containers, and
|
|
123
|
+
* any single-replica deployment) must still dispatch audit events, converging on the lease alone.
|
|
124
|
+
* Appended last so the five existing construction sites keep compiling unchanged.
|
|
125
|
+
*/
|
|
126
|
+
redisService?: RedisService);
|
|
42
127
|
/**
|
|
43
128
|
* Dispatch an audit event to the organization's configured per-org audit SINKS.
|
|
44
129
|
*
|
|
@@ -104,13 +189,23 @@ export declare class AuditEventDispatcherBackendService {
|
|
|
104
189
|
*/
|
|
105
190
|
private _resolveOrgAuditSinks;
|
|
106
191
|
/**
|
|
107
|
-
* R2: load the org's SIEM config through
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* the
|
|
112
|
-
*
|
|
113
|
-
*
|
|
192
|
+
* R2: load the org's SIEM config through the leased cache.
|
|
193
|
+
*
|
|
194
|
+
* Without a cache, {@link _resolveOrgAuditSinks} reads the config via a self-elevating `readAsSystem`
|
|
195
|
+
* PER EVENT PER ORG — and `readAsSystem` ALSO emits a `SYSTEM_CONTEXT_READ` audit — so every routed
|
|
196
|
+
* audit event (× N orgs on the multi-org fan-out) doubled the audit-write volume to the DB + immudb.
|
|
197
|
+
* `null` is cached too (an org whose config load failed) so a non-configured org is not re-read every
|
|
198
|
+
* event.
|
|
199
|
+
*
|
|
200
|
+
* The cache is STALE-WHILE-REVALIDATE ({@link LeasedValueCache}), so only the very first event for an
|
|
201
|
+
* organization waits on a read; every later one is served from memory while the refresh runs off this
|
|
202
|
+
* path. That is what lets {@link SIEM_CONFIG_REFRESH_AFTER_MS} be sixty seconds rather than five
|
|
203
|
+
* minutes — read the guarantee stated there before changing it.
|
|
204
|
+
*
|
|
205
|
+
* The loader closes over `ec`, which is the audit service's synthesised super-admin APPLICATION-scoped
|
|
206
|
+
* temp context (`audit-logs.backend.service.ts:284`, handed here at `:349`) and is therefore equally
|
|
207
|
+
* privileged on every call — the precondition {@link LeasedValueCache} states for joining an in-flight
|
|
208
|
+
* load. `loadSiemExportConfig` in fact ignores `ec` entirely (`void ec`) and reads system-context.
|
|
114
209
|
*/
|
|
115
210
|
private _loadSiemConfigCached;
|
|
116
211
|
/**
|
|
@@ -149,8 +244,55 @@ export declare class AuditEventDispatcherBackendService {
|
|
|
149
244
|
* organization with no entry — which is the common case, since only organizations that have
|
|
150
245
|
* raised an audit event since the last eviction are in the map at all. Synchronous and
|
|
151
246
|
* infallible on purpose, so the caller needs no error handling.
|
|
247
|
+
*
|
|
248
|
+
* ## It reaches EVERY replica, which it did not before
|
|
249
|
+
*
|
|
250
|
+
* The local drop above is only ever correct for ONE process — the one that happened to handle the
|
|
251
|
+
* write. With N replicas behind a load balancer, the other N-1 went on serving the pre-write config
|
|
252
|
+
* for the rest of the lease, so "the invalidation covers engine-routed writes" was true of a single
|
|
253
|
+
* instance and false of every real deployment. The broadcast closes that: the organization id goes
|
|
254
|
+
* out on {@link SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX} and every replica's subscriber drops its own
|
|
255
|
+
* entry within milliseconds.
|
|
256
|
+
*
|
|
257
|
+
* The publish is fire-and-forget and cannot fail this call: a broadcast that does not go out degrades
|
|
258
|
+
* the OTHER replicas to the lease, which is exactly where they were before, and refusing a
|
|
259
|
+
* configuration write to protect a cache would invert the priority. This method's synchronous,
|
|
260
|
+
* infallible contract therefore still holds for its caller.
|
|
261
|
+
*
|
|
262
|
+
* **What it still does NOT cover, and cannot.** A write that never reaches the service tier — a
|
|
263
|
+
* repository-tier write, or a direct database write like `examples/wonder-todos/e2e/adapter.ts`'s
|
|
264
|
+
* `upsertOrganizationSingleton('organizationSiemExportConfig', …)` — raises no postfix hook, so
|
|
265
|
+
* nothing calls this and nothing is broadcast. For those the lease is the entire guarantee; that is
|
|
266
|
+
* why it is chosen and argued at {@link SIEM_CONFIG_REFRESH_AFTER_MS} rather than left incidental.
|
|
152
267
|
*/
|
|
153
268
|
invalidateSiemConfig(organizationId: string): void;
|
|
269
|
+
/**
|
|
270
|
+
* Tell the rest of the fleet to drop this organization's cached SIEM config.
|
|
271
|
+
*
|
|
272
|
+
* Returns nothing and awaits nothing — the caller is a postfix write hook whose contract is that it
|
|
273
|
+
* cannot fail the write it follows.
|
|
274
|
+
*/
|
|
275
|
+
private _publishSiemConfigInvalidation;
|
|
276
|
+
/** App-prefixed so two applications sharing one Redis never invalidate each other's caches. */
|
|
277
|
+
private _invalidationChannel;
|
|
278
|
+
/**
|
|
279
|
+
* Arm this replica's single subscriber to the invalidation channel. Idempotent.
|
|
280
|
+
*
|
|
281
|
+
* Called (never awaited) from {@link dispatchToOrganizationAuditSinks}, so no startup ordering is
|
|
282
|
+
* required and nothing has to be wired in `start-application` — the same lazy-arm pattern
|
|
283
|
+
* `A2ATaskCancellationBackendService.ensureSubscriber` uses, for the same reason.
|
|
284
|
+
*
|
|
285
|
+
* Fails OPEN by design: a replica that cannot subscribe still routes audit events, converging on the
|
|
286
|
+
* lease instead of on the broadcast. The failure is logged at ERROR because a persistent one silently
|
|
287
|
+
* returns that replica to the per-process behaviour this mechanism exists to remove.
|
|
288
|
+
*
|
|
289
|
+
* Two details are copied deliberately rather than reinvented, because each was a recorded defect in
|
|
290
|
+
* the A2A original: the `end` handler RE-ARMS (a subscriber that connected and then dropped — a Redis
|
|
291
|
+
* restart, a failover, an idle reap — otherwise stayed dead for the life of the process while every
|
|
292
|
+
* other signal looked healthy), and the catch DESTROYS a half-built connection (`connect()` can
|
|
293
|
+
* succeed while `subscribe()` throws, and retrying without destroying leaks one socket per attempt).
|
|
294
|
+
*/
|
|
295
|
+
private _ensureInvalidationSubscriber;
|
|
154
296
|
/**
|
|
155
297
|
* Deliver one event to an org's SIEM webhook sink: apply the sink's per-event filter,
|
|
156
298
|
* build + HMAC the envelope, and enqueue for async delivery via the SIEM webhook
|
|
@@ -206,14 +348,84 @@ export declare class AuditEventDispatcherBackendService {
|
|
|
206
348
|
* Build a SecurityAuditEventEnvelope from an audit event.
|
|
207
349
|
*/
|
|
208
350
|
private _buildEnvelope;
|
|
351
|
+
/**
|
|
352
|
+
* The id the DELIVERED envelope carries — the audit row's OWN `eventId`, never a freshly minted one.
|
|
353
|
+
*
|
|
354
|
+
* ## Why it must be the audit event's id
|
|
355
|
+
*
|
|
356
|
+
* `SecurityAuditEventEnvelope.eventId` is the only identifier that leaves the application on a SIEM
|
|
357
|
+
* delivery, and it is doing two jobs at once:
|
|
358
|
+
*
|
|
359
|
+
* 1. it is what a RECEIVER deduplicates on — the delivery service's own header says "Idempotency via
|
|
360
|
+
* eventId", and every wire format carries this one field through to the receiver's dedup key
|
|
361
|
+
* (CEF `externalId`, LEEF `eventId`, OCSF `metadata.uid`, and the verbatim `json_structured` body's
|
|
362
|
+
* top-level `eventId`); and
|
|
363
|
+
* 2. it is the only handle an analyst has for joining a record in the customer's SIEM back to the
|
|
364
|
+
* audit row it was projected from.
|
|
365
|
+
*
|
|
366
|
+
* Minting a fresh uuid here satisfied (1) and silently destroyed (2). The id was ALREADY on the value
|
|
367
|
+
* being projected: `AuditableEvent.eventId` is minted in `AuditLogsBackendService._createAuditLog`
|
|
368
|
+
* BEFORE the DB write, is documented on the schema as the "store-agnostic, server-minted correlation
|
|
369
|
+
* key", and already joins the DB row to its immudb record and to `verifyAuditEvent(eventId)`. It
|
|
370
|
+
* survives the `Omit` on this method's parameter type, so it was in hand and thrown away — the
|
|
371
|
+
* envelope replaced it with an id that exists nowhere else in the system, making a delivered SIEM
|
|
372
|
+
* event deduplicable but unexplainable.
|
|
373
|
+
*
|
|
374
|
+
* ## Why the cutover is safe — the risk this looks like it carries, it does not
|
|
375
|
+
*
|
|
376
|
+
* Changing what a receiver deduplicates on normally risks re-accepting events at the switch. Not here:
|
|
377
|
+
* the OLD value was a per-delivery random uuid, never reused and not re-derivable from anything, so
|
|
378
|
+
* every id crossing the cutover is still one no receiver has ever seen. Nothing is re-delivered and
|
|
379
|
+
* nothing is newly deduped away.
|
|
380
|
+
*
|
|
381
|
+
* What genuinely changes is the FAN-OUT. `AuditLogsBackendService` dispatches one audit event to each
|
|
382
|
+
* of the user's verified member orgs, so those N deliveries now carry ONE id instead of N. They go to
|
|
383
|
+
* N different tenants' sinks, so there is no cross-receiver dedup interaction — and one id is the
|
|
384
|
+
* truthful statement, because it is one event. (The DLQ row records this id too, so a dead letter is
|
|
385
|
+
* now joinable to its audit row as well; `SiemDeliveryDlqBaseSchema.eventId` carries no unique index,
|
|
386
|
+
* so the shared id cannot collide there.)
|
|
387
|
+
*
|
|
388
|
+
* Per-attempt idempotency is untouched: the envelope is built ONCE, and both the in-process retry loop
|
|
389
|
+
* in `SIEMWebhookDeliveryBackendService.processDelivery` and the DLQ drain re-send that same stored
|
|
390
|
+
* object — so one delivery keeps one id across every attempt, which is exactly what a receiver's dedup
|
|
391
|
+
* needs.
|
|
392
|
+
*
|
|
393
|
+
* ## The fallback, and why it is not a hedge
|
|
394
|
+
*
|
|
395
|
+
* `eventId` is required on `AuditableEvent` and the sole production caller always sets it, so this
|
|
396
|
+
* branch should be unreachable. It exists because the two failures are ASYMMETRIC: an absent id is not
|
|
397
|
+
* merely an unjoinable delivery, it is a delivery with NO dedup key at all — every projection renders
|
|
398
|
+
* the field only `if (e.eventId)`, so the receiver stores `dedupKey: null` and answers `deduped: false`
|
|
399
|
+
* forever against a service that retries and drains a DLQ. Losing the join degrades an investigation;
|
|
400
|
+
* losing idempotency duplicates events inside a customer's SIEM. So an absent id still gets a minted
|
|
401
|
+
* one, and is logged loudly rather than shipping a blank.
|
|
402
|
+
*/
|
|
403
|
+
private _resolveEnvelopeEventId;
|
|
209
404
|
/**
|
|
210
405
|
* Infer success/failure outcome from event type.
|
|
211
406
|
*/
|
|
212
407
|
private _inferOutcome;
|
|
213
408
|
/**
|
|
214
|
-
* F3:
|
|
215
|
-
*
|
|
216
|
-
*
|
|
409
|
+
* F3: resolve an organization NAME for SIEM-analyst readability, through the leased cache.
|
|
410
|
+
*
|
|
411
|
+
* Renames are picked up within {@link ORG_NAME_REFRESH_AFTER_MS} — read that constant for why this
|
|
412
|
+
* lease is five minutes while the routing config's is sixty seconds. There is no invalidation hook on
|
|
413
|
+
* this one, deliberately: a stale label costs a reader nothing (the `organizationId` beside it in the
|
|
414
|
+
* envelope is authoritative and always current), so the lease alone is a proportionate answer.
|
|
415
|
+
*
|
|
416
|
+
* Never throws — a missing name is optional in the envelope, and this runs on a fire-and-forget path.
|
|
417
|
+
* The loader therefore swallows its own failure and yields `undefined`, which means the COLD path of
|
|
418
|
+
* {@link LeasedValueCache} can never reject here.
|
|
419
|
+
*
|
|
420
|
+
* **`undefined` IS cached, and that is a fix rather than an oversight.** Before this, a lookup that
|
|
421
|
+
* failed or returned a nameless row cached nothing, so an organization whose read kept failing was
|
|
422
|
+
* re-read on EVERY exported event — the read amplification a cache exists to prevent, arriving
|
|
423
|
+
* precisely when the repository is already unhealthy. Caching the negative bounds it to one read per
|
|
424
|
+
* lease, and a rename or a repaired read still lands within that lease.
|
|
425
|
+
*
|
|
426
|
+
* The loader closes over `ec` — the audit service's synthesised super-admin APPLICATION-scoped temp
|
|
427
|
+
* context (`audit-logs.backend.service.ts:284` → `:349`), identical in privilege on every dispatch —
|
|
428
|
+
* which is the precondition {@link LeasedValueCache} states for joining an in-flight load.
|
|
217
429
|
*/
|
|
218
430
|
private _resolveOrgName;
|
|
219
431
|
/**
|