@wildo-ai/saas-backend-lib 1.1.3 → 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.
Files changed (1056) hide show
  1. package/dist/esm/__tests__/fixture-deep-partial.d.ts.map +1 -1
  2. package/dist/esm/__tests__/integration/redis-integration-gate.d.ts.map +1 -1
  3. package/dist/esm/__tests__/setup.d.ts.map +1 -1
  4. package/dist/esm/__tests__/test-container.d.ts.map +1 -1
  5. package/dist/esm/applications/models/applications.backend.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/seeds/application-metadata-defaults.seeds.d.ts.map +1 -1
  7. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
  8. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
  9. package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
  10. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
  11. package/dist/esm/base-classes/models/repositories.backend.schemas.d.ts.map +1 -1
  12. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts +1 -1
  13. package/dist/esm/base-classes/services/__tests__/mock-resource-operation-helper.service.d.ts.map +1 -1
  14. package/dist/esm/base-classes/services/batches/batches-cronjobs-custom-execution.service.d.ts.map +1 -1
  15. package/dist/esm/base-classes/services/batches/batches-cronjobs-executor.backend.service.d.ts.map +1 -1
  16. package/dist/esm/base-classes/services/batches/batches-cronjobs-resource-execution.backend.service.d.ts.map +1 -1
  17. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -1
  18. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -1
  19. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -1
  20. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +12 -1
  21. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -1
  22. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
  23. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
  24. package/dist/esm/base-classes/services/batches/resource-retention-sweep.batch.backend.service.d.ts.map +1 -1
  25. package/dist/esm/base-classes/services/batches/suspension-reactivation-sweep.batch.backend.service.d.ts.map +1 -1
  26. package/dist/esm/base-classes/services/controllers/abstract-controller.backend.service.d.ts.map +1 -1
  27. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  28. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  29. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.d.ts.map +1 -1
  30. package/dist/esm/base-classes/services/controllers/controllers-registry-handler.backend.service.js.map +1 -1
  31. package/dist/esm/base-classes/services/controllers/utils/audit-access-fields.backend.utils.d.ts.map +1 -1
  32. package/dist/esm/base-classes/services/controllers/utils/operation-response-serializer.backend.utils.d.ts.map +1 -1
  33. package/dist/esm/base-classes/services/controllers/validate-field-handler.backend.service.d.ts.map +1 -1
  34. package/dist/esm/base-classes/services/repositories/__tests__/method-span-scan.guard-helpers.d.ts.map +1 -1
  35. package/dist/esm/base-classes/services/repositories/__tests__/mock-repositories-registry-handler.service.d.ts.map +1 -1
  36. package/dist/esm/base-classes/services/repositories/field-clearing-partition.backend.d.ts.map +1 -1
  37. package/dist/esm/base-classes/services/repositories/http-api/http-api-filter-translation.backend.d.ts.map +1 -1
  38. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
  39. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +13 -4
  40. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
  41. package/dist/esm/base-classes/services/repositories/http-api/http-api-query.backend.d.ts.map +1 -1
  42. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
  43. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +17 -0
  44. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
  45. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  46. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  47. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -1
  48. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -1
  49. package/dist/esm/base-classes/services/repositories/http-api/http-api-row-projection.backend.d.ts.map +1 -1
  50. package/dist/esm/base-classes/services/repositories/http-api/http-api-subject-erasure-effect.backend.d.ts.map +1 -1
  51. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
  52. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
  53. package/dist/esm/base-classes/services/repositories/http-api/odata-query-compiler.backend.d.ts.map +1 -1
  54. package/dist/esm/base-classes/services/repositories/http-api/odoo-jsonrpc-compiler.backend.d.ts.map +1 -1
  55. package/dist/esm/base-classes/services/repositories/http-api/rest-json-query-compiler.backend.d.ts.map +1 -1
  56. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  57. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  58. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-repository.backend.service.d.ts.map +1 -1
  59. package/dist/esm/base-classes/services/repositories/introspection/introspection-resource-source.backend.port.d.ts.map +1 -1
  60. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +57 -0
  61. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  62. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +95 -2
  63. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  64. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  65. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  66. package/dist/esm/base-classes/services/repositories/repository-guarded-mutation.backend.types.d.ts.map +1 -1
  67. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts +5 -2
  68. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  69. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +14 -3
  70. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  71. package/dist/esm/base-classes/services/repositories/repository-version-metadata.backend.utils.d.ts.map +1 -1
  72. package/dist/esm/base-classes/services/repositories/resource-write-integrity.backend.d.ts.map +1 -1
  73. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts +72 -0
  74. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.d.ts.map +1 -0
  75. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js +88 -0
  76. package/dist/esm/base-classes/services/repositories/seed-row-default-materialization.backend.js.map +1 -0
  77. package/dist/esm/base-classes/services/repositories/unique-constraint-conflict-reference.backend.d.ts.map +1 -1
  78. package/dist/esm/base-classes/services/resource-operations-helper.backend.service.d.ts.map +1 -1
  79. package/dist/esm/base-classes/services/services/__tests__/mock-services-registry-handler.service.d.ts.map +1 -1
  80. package/dist/esm/base-classes/services/services/__tests__/mock-system-access.service.d.ts.map +1 -1
  81. package/dist/esm/base-classes/services/services/read-only-field-change.backend.utils.d.ts.map +1 -1
  82. package/dist/esm/base-classes/services/services/resource-operation-audit-emission.backend.utils.d.ts.map +1 -1
  83. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
  84. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
  85. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-registry.backend.service.d.ts.map +1 -1
  86. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation.factory.backend.d.ts.map +1 -1
  87. package/dist/esm/base-classes/services/services/resource-operation-implementation-coverage.backend.utils.d.ts.map +1 -1
  88. package/dist/esm/base-classes/services/services/resource-operation-server-injected-fields.backend.utils.d.ts.map +1 -1
  89. package/dist/esm/base-classes/services/services/resource-operation-transaction-persistence.backend.utils.d.ts.map +1 -1
  90. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
  91. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
  92. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
  93. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
  94. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  95. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +44 -6
  96. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  97. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
  98. package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
  99. package/dist/esm/base-classes/utils/backend-type-utils.d.ts.map +1 -1
  100. package/dist/esm/base-classes/utils/single-subject-addressing.backend.utils.d.ts.map +1 -1
  101. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -1
  102. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -1
  103. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -1
  104. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -1
  105. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -1
  106. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -1
  107. package/dist/esm/billing/services/back-office/abstract-billing.backend.service.d.ts.map +1 -1
  108. package/dist/esm/billing/services/back-office/billing-feature-sync.backend.service.d.ts.map +1 -1
  109. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +1 -1
  110. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -1
  111. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +5 -4
  112. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -1
  113. package/dist/esm/billing/services/back-office/billing-state.backend.service.d.ts.map +1 -1
  114. package/dist/esm/billing/services/back-office/billing-state.backend.service.js +11 -1
  115. package/dist/esm/billing/services/back-office/billing-state.backend.service.js.map +1 -1
  116. package/dist/esm/billing/services/back-office/billing-subject-erasure-effect.backend.d.ts.map +1 -1
  117. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
  118. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
  119. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
  120. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
  121. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -1
  122. package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -1
  123. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
  124. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
  125. package/dist/esm/billing/services/billing.utils.d.ts.map +1 -1
  126. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
  127. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  128. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +32 -0
  129. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
  130. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +32 -1
  131. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
  132. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
  133. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
  134. package/dist/esm/billing/services/custom-impl/credit-pool.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  135. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  136. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
  137. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
  138. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
  139. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +9 -6
  140. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
  141. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +9 -6
  142. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
  143. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -1
  144. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -1
  145. package/dist/esm/billing/services/webhooks/billing-webhook-adapter.backend.service.d.ts.map +1 -1
  146. package/dist/esm/billing/services/webhooks/billing-webhook-capability-handler.backend.service.d.ts.map +1 -1
  147. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
  148. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +50 -3
  149. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
  150. package/dist/esm/billing/testing/billing-test-fixtures.d.ts.map +1 -1
  151. package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
  152. package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
  153. package/dist/esm/charts/controllers/chart.backend.controller.d.ts.map +1 -1
  154. package/dist/esm/charts/services/chart-registry.backend.service.d.ts +80 -7
  155. package/dist/esm/charts/services/chart-registry.backend.service.d.ts.map +1 -1
  156. package/dist/esm/charts/services/chart-registry.backend.service.js +115 -8
  157. package/dist/esm/charts/services/chart-registry.backend.service.js.map +1 -1
  158. package/dist/esm/companion-exports.d.ts.map +1 -1
  159. package/dist/esm/compliance/audit-trails/audit-logs.custom-impl.backend.service.d.ts.map +1 -1
  160. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.d.ts.map +1 -1
  161. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
  162. package/dist/esm/compliance/audit-trails/batches/immudb-audit-reconcile.batch.backend.service.d.ts.map +1 -1
  163. package/dist/esm/compliance/audit-trails/batches/siem-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  164. package/dist/esm/compliance/audit-trails/services/__tests__/mock-audit-logs.service.d.ts.map +1 -1
  165. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  166. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  167. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +107 -4
  168. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  169. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +176 -5
  170. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  171. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
  172. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
  173. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  174. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
  175. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  176. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  177. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -1
  178. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -1
  179. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  180. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +21 -0
  181. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  182. package/dist/esm/compliance/audit-trails/services/utils/ocsf-class-mapping.backend.utils.d.ts.map +1 -1
  183. package/dist/esm/compliance/audit-trails/services/utils/siem-dictionary.backend.utils.d.ts.map +1 -1
  184. package/dist/esm/compliance/audit-trails/services/utils/siem-ocsf-projection.backend.utils.d.ts.map +1 -1
  185. package/dist/esm/compliance/audit-trails/services/utils/siem-projection-contract.backend.utils.d.ts.map +1 -1
  186. package/dist/esm/compliance/audit-trails/utils/audit-actor.backend.utils.d.ts.map +1 -1
  187. package/dist/esm/compliance/audit-trails/utils/layer2-audit-provider-boot-diagnostic.backend.utils.d.ts.map +1 -1
  188. package/dist/esm/compliance/index.d.ts.map +1 -1
  189. package/dist/esm/compliance/privacy/retention-hide-predicate.backend.d.ts.map +1 -1
  190. package/dist/esm/compliance/privacy/services/subject-erasure-external-effects.backend.service.d.ts.map +1 -1
  191. package/dist/esm/compliance/privacy/services/subject-session-revocation.backend.service.d.ts.map +1 -1
  192. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
  193. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
  194. package/dist/esm/config/bootstrap/minion-initialization-projection.backend.d.ts.map +1 -1
  195. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.d.ts.map +1 -1
  196. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js +3 -0
  197. package/dist/esm/config/bootstrap/runtime-principal-attestation.backend.service.js.map +1 -1
  198. package/dist/esm/config/bootstrap/runtime-principal.backend.service.d.ts.map +1 -1
  199. package/dist/esm/config/custom/application-config-controller.backend.service.d.ts.map +1 -1
  200. package/dist/esm/config/models/app-config-secrets.backend.schemas.d.ts.map +1 -1
  201. package/dist/esm/config/models/app-config.backend-authored.definitions.d.ts.map +1 -1
  202. package/dist/esm/config/models/app-config.backend.schemas.d.ts +4 -4
  203. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  204. package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
  205. package/dist/esm/config/models/app-env-config.backend.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts +36 -0
  207. package/dist/esm/config/models/apps-manager-transport.backend.definitions.d.ts.map +1 -0
  208. package/dist/esm/config/models/apps-manager-transport.backend.definitions.js +36 -0
  209. package/dist/esm/config/models/apps-manager-transport.backend.definitions.js.map +1 -0
  210. package/dist/esm/config/models/config-mutation-boundary.utils.d.ts.map +1 -1
  211. package/dist/esm/config/models/postgresql-env-config.backend.schemas.d.ts.map +1 -1
  212. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
  213. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
  214. package/dist/esm/config/models/runtime-topology.backend.contracts.d.ts.map +1 -1
  215. package/dist/esm/config/services/__tests__/mock-app-configuration.service.d.ts.map +1 -1
  216. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
  217. package/dist/esm/config/services/app-configuration-loader.backend.service.js +3 -0
  218. package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
  219. package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
  220. package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
  221. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  222. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  223. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +12 -0
  224. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
  225. package/dist/esm/config/services/application-startup-config-validator.backend.service.js +28 -0
  226. package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
  227. package/dist/esm/data-seeding/batches/data-seeding-run-cleanup.batch.backend.service.d.ts.map +1 -1
  228. package/dist/esm/data-seeding/batches/data-seeding-scheduled-rerun.batch.backend.service.d.ts.map +1 -1
  229. package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.contracts.d.ts.map +1 -1
  230. package/dist/esm/data-seeding/controllers/data-seeding-admin.backend.controller.d.ts.map +1 -1
  231. package/dist/esm/data-seeding/data-seeding-models.d.ts.map +1 -1
  232. package/dist/esm/data-seeding/models/business-key-resolver.shared.utils.d.ts.map +1 -1
  233. package/dist/esm/data-seeding/models/data-seed-execution-context.shared.types.d.ts.map +1 -1
  234. package/dist/esm/data-seeding/models/data-seed-migrator-runner.shared.utils.d.ts.map +1 -1
  235. package/dist/esm/data-seeding/models/data-seed-reconciler.shared.utils.d.ts.map +1 -1
  236. package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.schemas.d.ts.map +1 -1
  237. package/dist/esm/data-seeding/models/data-seed-row-metadata.shared.utils.d.ts.map +1 -1
  238. package/dist/esm/data-seeding/models/data-seed-run.shared.resources-config.schemas.d.ts.map +1 -1
  239. package/dist/esm/data-seeding/models/data-seed-run.shared.schemas.d.ts.map +1 -1
  240. package/dist/esm/data-seeding/models/data-seed-trigger-mode-matrix.shared.utils.d.ts.map +1 -1
  241. package/dist/esm/data-seeding/models/data-seed.shared.schemas.d.ts.map +1 -1
  242. package/dist/esm/data-seeding/services/data-seed-application-bootstrap.backend.d.ts.map +1 -1
  243. package/dist/esm/data-seeding/services/data-seed-dispatcher.backend.service.d.ts.map +1 -1
  244. package/dist/esm/data-seeding/services/data-seed-registry.backend.service.d.ts.map +1 -1
  245. package/dist/esm/data-seeding/services/data-seed-scope-resolver-registry.backend.service.d.ts.map +1 -1
  246. package/dist/esm/data-seeding/services/engines/additive-seed-engine.backend.service.d.ts.map +1 -1
  247. package/dist/esm/data-seeding/services/engines/lazy-seed-engine.backend.service.d.ts.map +1 -1
  248. package/dist/esm/data-seeding/services/engines/manual-seed-engine.backend.service.d.ts.map +1 -1
  249. package/dist/esm/data-seeding/services/engines/sync-seed-engine.backend.service.d.ts.map +1 -1
  250. package/dist/esm/data-seeding/services/engines/upgrade-seed-engine.backend.service.d.ts.map +1 -1
  251. package/dist/esm/data-seeding/services/shared/data-seed-business-key.shared.utils.d.ts.map +1 -1
  252. package/dist/esm/data-seeding/services/shared/data-seed-error.shared.utils.d.ts.map +1 -1
  253. package/dist/esm/data-seeding/services/shared/data-seed-run-counters.shared.types.d.ts.map +1 -1
  254. package/dist/esm/data-seeding/services/shared/data-seed-run-ledger.backend.d.ts.map +1 -1
  255. package/dist/esm/data-seeding/services/shared/data-seed-scope-anchor.shared.types.d.ts.map +1 -1
  256. package/dist/esm/data-seeding/services/shared/data-seed-scope-iteration.shared.utils.d.ts.map +1 -1
  257. package/dist/esm/data-seeding/services/shared/data-seed-scope-resolution.backend.d.ts.map +1 -1
  258. package/dist/esm/databases/models/aggregation.backend.schemas.d.ts.map +1 -1
  259. package/dist/esm/databases/models/databases.backend.schemas.d.ts.map +1 -1
  260. package/dist/esm/databases/models/filter.backend.schemas.d.ts.map +1 -1
  261. package/dist/esm/databases/models/resolve-persistence-adapter.backend.utils.d.ts.map +1 -1
  262. package/dist/esm/databases/models/sql.backend.schemas.d.ts.map +1 -1
  263. package/dist/esm/databases/models/transaction.shared.schemas.d.ts.map +1 -1
  264. package/dist/esm/databases/services/__tests__/mock-mongo-transaction-registry.service.d.ts.map +1 -1
  265. package/dist/esm/databases/services/__tests__/mock-mongodb.service.d.ts.map +1 -1
  266. package/dist/esm/databases/services/__tests__/mock-mongoose-model.service.d.ts.map +1 -1
  267. package/dist/esm/databases/services/__tests__/mock-redis.service.d.ts.map +1 -1
  268. package/dist/esm/databases/services/__tests__/mock-zod-mongoose-schema-convertor.service.d.ts.map +1 -1
  269. package/dist/esm/databases/services/aggregation/aggregation-authorization.backend.service.d.ts.map +1 -1
  270. package/dist/esm/databases/services/aggregation/aggregation-query.backend.service.d.ts.map +1 -1
  271. package/dist/esm/databases/services/aggregation/computed-measure-evaluator.backend.service.d.ts.map +1 -1
  272. package/dist/esm/databases/services/aggregation/field-access-validator.backend.service.d.ts.map +1 -1
  273. package/dist/esm/databases/services/aggregation/time-series-densifier.backend.service.d.ts.map +1 -1
  274. package/dist/esm/databases/services/aggregation/topn-processor.backend.service.d.ts.map +1 -1
  275. package/dist/esm/databases/services/aggregation/window-function-processor.backend.service.d.ts.map +1 -1
  276. package/dist/esm/databases/services/db-utils.d.ts.map +1 -1
  277. package/dist/esm/databases/services/mongo-aggregation.backend.service.d.ts.map +1 -1
  278. package/dist/esm/databases/services/mongodb.service.d.ts.map +1 -1
  279. package/dist/esm/databases/services/postgresql-aggregation.backend.service.d.ts.map +1 -1
  280. package/dist/esm/databases/services/postgresql-database.backend.service.d.ts.map +1 -1
  281. package/dist/esm/databases/services/postgresql-development-provisioning.backend.d.ts.map +1 -1
  282. package/dist/esm/databases/services/postgresql-filter.backend.service.d.ts.map +1 -1
  283. package/dist/esm/databases/services/postgresql-migration-runner.backend.d.ts.map +1 -1
  284. package/dist/esm/databases/services/postgresql-schema-ddl.backend.d.ts.map +1 -1
  285. package/dist/esm/databases/services/postgresql-schema-migration-sql.backend.d.ts.map +1 -1
  286. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
  287. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
  288. package/dist/esm/databases/services/postgresql-schema-plan-lockfile.backend.d.ts.map +1 -1
  289. package/dist/esm/databases/services/redis.service.d.ts.map +1 -1
  290. package/dist/esm/databases/services/resource-persistence-unit-of-work.backend.service.d.ts.map +1 -1
  291. package/dist/esm/databases/services/schema-planning-standalone.backend.d.ts.map +1 -1
  292. package/dist/esm/databases/services/zod-to-mongoose-schema-convertor.backend.service.d.ts.map +1 -1
  293. package/dist/esm/databases/services/zod-to-sql-hybrid-schema.planner.d.ts.map +1 -1
  294. package/dist/esm/databases/utils/postgresql-identifier.backend.utils.d.ts.map +1 -1
  295. package/dist/esm/errors/services/__tests__/mock-error-builder.service.d.ts.map +1 -1
  296. package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
  297. package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
  298. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  299. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  300. package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
  301. package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
  302. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
  303. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
  304. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
  305. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
  306. package/dist/esm/external-data/batches/external-data-pipeline-scheduled-run.batch.backend.service.d.ts.map +1 -1
  307. package/dist/esm/external-data/controllers/external-data-admin.backend.contracts.d.ts.map +1 -1
  308. package/dist/esm/external-data/controllers/external-data-admin.backend.controller.d.ts.map +1 -1
  309. package/dist/esm/external-data/external-data-extraction-source.backend.d.ts.map +1 -1
  310. package/dist/esm/external-data/external-data-models.exports.d.ts.map +1 -1
  311. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  312. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  313. package/dist/esm/external-data/external-data-transform.backend.d.ts.map +1 -1
  314. package/dist/esm/external-data/models/external-data-pipeline-state.backend.schemas.d.ts.map +1 -1
  315. package/dist/esm/external-providers/models/external-providers.backend.schemas.d.ts.map +1 -1
  316. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
  317. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
  318. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +102 -52
  319. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -1
  320. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +117 -71
  321. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -1
  322. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -1
  323. package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -1
  324. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -1
  325. package/dist/esm/external-providers/operations/provider-request-signing.backend.js +26 -7
  326. package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -1
  327. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -1
  328. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -1
  329. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
  330. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
  331. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -1
  332. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -1
  333. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
  334. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
  335. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts +81 -34
  336. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
  337. package/dist/esm/external-providers/services/document-extraction.backend.service.js +179 -98
  338. package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
  339. package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
  340. package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
  341. package/dist/esm/external-providers/services/external-api-handler.backend.service.d.ts.map +1 -1
  342. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +121 -0
  343. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  344. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +151 -0
  345. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  346. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts +15 -1
  347. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
  348. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +60 -4
  349. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
  350. package/dist/esm/features/controllers/features.backend.controller.d.ts.map +1 -1
  351. package/dist/esm/features/services/__tests__/mock-feature-definition-registry.service.d.ts.map +1 -1
  352. package/dist/esm/features/services/__tests__/mock-feature-resolution.service.d.ts.map +1 -1
  353. package/dist/esm/features/services/application-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
  354. package/dist/esm/features/services/feature-definition-registry.backend.service.d.ts.map +1 -1
  355. package/dist/esm/features/services/feature-gate.backend.service.d.ts.map +1 -1
  356. package/dist/esm/features/services/feature-resolution.backend.service.d.ts.map +1 -1
  357. package/dist/esm/features/services/organization-features-admin-write-path.custom-impl.backend.service.d.ts.map +1 -1
  358. package/dist/esm/features/services/scope-feature-ledger-relationship.backend.utils.d.ts.map +1 -1
  359. package/dist/esm/features/services/scope-features-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  360. package/dist/esm/features/testing/feature-test-utils.d.ts.map +1 -1
  361. package/dist/esm/files/batches/files-cleanup.batch.backend.service.d.ts.map +1 -1
  362. package/dist/esm/files/constraints/file-analyzers.types.d.ts.map +1 -1
  363. package/dist/esm/files/constraints/file-constraint-resolver-chain.backend.service.d.ts.map +1 -1
  364. package/dist/esm/files/constraints/file-constraint.types.d.ts.map +1 -1
  365. package/dist/esm/files/constraints/file-validation.backend.service.d.ts.map +1 -1
  366. package/dist/esm/files/constraints/resource-field-constraint-resolver.backend.service.d.ts.map +1 -1
  367. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  368. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  369. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.d.ts.map +1 -1
  370. package/dist/esm/files/handlers/file-upload-route-locals.backend.types.js.map +1 -1
  371. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts +37 -0
  372. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  373. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +221 -21
  374. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  375. package/dist/esm/files/scanning/clamav-scanner.backend.service.d.ts.map +1 -1
  376. package/dist/esm/files/scanning/file-scan.types.d.ts.map +1 -1
  377. package/dist/esm/files/scanning/yara-scanner.backend.service.d.ts.map +1 -1
  378. package/dist/esm/files/scanning/yara-scanner.backend.service.js +20 -2
  379. package/dist/esm/files/scanning/yara-scanner.backend.service.js.map +1 -1
  380. package/dist/esm/files/services/__tests__/mock-file-field-detection.service.d.ts.map +1 -1
  381. package/dist/esm/files/services/__tests__/mock-file-operation-handler.service.d.ts.map +1 -1
  382. package/dist/esm/files/services/__tests__/mock-file-repository.service.d.ts.map +1 -1
  383. package/dist/esm/files/services/file-field-detection.backend.service.d.ts.map +1 -1
  384. package/dist/esm/files/services/file-operation-handler.backend.service.d.ts.map +1 -1
  385. package/dist/esm/files/services/file-operation-handler.backend.service.js.map +1 -1
  386. package/dist/esm/files/services/file-population.backend.service.d.ts.map +1 -1
  387. package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
  388. package/dist/esm/files/services/file-scanning.backend.service.js +5 -0
  389. package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
  390. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
  391. package/dist/esm/files/services/file-text-extraction.backend.service.js +8 -5
  392. package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
  393. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -1
  394. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
  395. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  396. package/dist/esm/files/services/files.backend.service.js +3 -1
  397. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  398. package/dist/esm/files/services/rag-source-field-detection.backend.service.d.ts.map +1 -1
  399. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -1
  400. package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -1
  401. package/dist/esm/files/storage/file-storage-path-resolver.backend.service.d.ts.map +1 -1
  402. package/dist/esm/files/storage/file-storage-provider.types.d.ts +36 -1
  403. package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
  404. package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
  405. package/dist/esm/files/storage/file-storage-router.backend.service.d.ts +21 -3
  406. package/dist/esm/files/storage/file-storage-router.backend.service.d.ts.map +1 -1
  407. package/dist/esm/files/storage/file-storage-router.backend.service.js +38 -5
  408. package/dist/esm/files/storage/file-storage-router.backend.service.js.map +1 -1
  409. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts +87 -0
  410. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.d.ts.map +1 -0
  411. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js +340 -0
  412. package/dist/esm/files/storage/google-drive-storage-provider.backend.service.js.map +1 -0
  413. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
  414. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
  415. package/dist/esm/files/storage/storage-credential-provider.backend.utils.d.ts.map +1 -1
  416. package/dist/esm/files/storage/storage-platform-sts-credential-resolver.backend.utils.d.ts.map +1 -1
  417. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.d.ts.map +1 -1
  418. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js +10 -3
  419. package/dist/esm/files/storage/storage-sts-credential-resolver.backend.utils.js.map +1 -1
  420. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
  421. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
  422. package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
  423. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
  424. package/dist/esm/files/utils/file-upload.utils.d.ts.map +1 -1
  425. package/dist/esm/files/utils/file-uploader.utils.d.ts.map +1 -1
  426. package/dist/esm/files/utils/file-uploader.utils.js.map +1 -1
  427. package/dist/esm/files/utils/file-validation.utils.d.ts.map +1 -1
  428. package/dist/esm/files/utils/image-derivation.backend.utils.d.ts.map +1 -1
  429. package/dist/esm/files/utils/image-thumbnail.backend.utils.d.ts.map +1 -1
  430. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -1
  431. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -1
  432. package/dist/esm/files/utils/rag-source-field-schema-path.backend.utils.d.ts.map +1 -1
  433. package/dist/esm/files/utils/storage-application-identity.backend.utils.d.ts.map +1 -1
  434. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
  435. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
  436. package/dist/esm/flows-actors/a2a/batches/a2a-push-delivery.batch.backend.service.d.ts.map +1 -1
  437. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
  438. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
  439. package/dist/esm/flows-actors/a2a/models/a2a-dialect.backend.schemas.d.ts.map +1 -1
  440. package/dist/esm/flows-actors/a2a/models/a2a-push-notification-delivery.backend.utils.d.ts.map +1 -1
  441. package/dist/esm/flows-actors/a2a/models/a2a-push-notification.backend.schemas.d.ts.map +1 -1
  442. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
  443. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
  444. package/dist/esm/flows-actors/a2a/services/a2a-push-delivery-log.repository.d.ts.map +1 -1
  445. package/dist/esm/flows-actors/a2a/services/a2a-push-dispatcher.backend.service.d.ts.map +1 -1
  446. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
  447. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  448. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
  449. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
  450. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
  451. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
  452. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
  453. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
  454. package/dist/esm/flows-actors/controllers/flows-actors.controller.d.ts.map +1 -1
  455. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
  456. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
  457. package/dist/esm/flows-actors/models/agent-facets.backend.definitions.d.ts.map +1 -1
  458. package/dist/esm/flows-actors/models/agents.backend.definitions.d.ts.map +1 -1
  459. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
  460. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
  461. package/dist/esm/flows-actors/models/flows-actors.backend.definitions.d.ts.map +1 -1
  462. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
  463. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
  464. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +107 -16
  465. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
  466. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +118 -18
  467. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
  468. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
  469. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
  470. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -1
  471. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -1
  472. package/dist/esm/flows-actors/services/__tests__/fixtures/meta-workflow-evaluation-treatment.test-fixture.d.ts.map +1 -1
  473. package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
  474. package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
  475. package/dist/esm/flows-actors/services/agent-call-trace-sink.backend.d.ts.map +1 -1
  476. package/dist/esm/flows-actors/services/agent-facets.backend.service.d.ts.map +1 -1
  477. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +104 -5
  478. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  479. package/dist/esm/flows-actors/services/agents.backend.service.js +263 -31
  480. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  481. package/dist/esm/flows-actors/services/context-curation.backend.service.d.ts.map +1 -1
  482. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +46 -1
  483. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
  484. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +193 -6
  485. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
  486. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
  487. package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
  488. package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
  489. package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
  490. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
  491. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
  492. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -1
  493. package/dist/esm/flows-actors/services/mcp-client.backend.service.js +3 -0
  494. package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -1
  495. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts +99 -0
  496. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.d.ts.map +1 -0
  497. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js +155 -0
  498. package/dist/esm/flows-actors/services/mcp-credential-resolver.backend.service.js.map +1 -0
  499. package/dist/esm/flows-actors/services/meta-workflow-evaluation-treatment-compiler.backend.service.d.ts.map +1 -1
  500. package/dist/esm/flows-actors/services/meta-workflow-standard-action-contracts.backend.service.d.ts.map +1 -1
  501. package/dist/esm/flows-actors/services/meta-workflow-standard-evaluation-contracts.backend.service.d.ts.map +1 -1
  502. package/dist/esm/flows-actors/services/meta-workflow-structured-artifact-action-compiler.backend.service.d.ts.map +1 -1
  503. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
  504. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
  505. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  506. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +9 -0
  507. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  508. package/dist/esm/flows-actors/utils/bounded-subprocess.backend.utils.d.ts.map +1 -1
  509. package/dist/esm/flows-actors/utils/flows-actors-frontend-extractor.utils.d.ts.map +1 -1
  510. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
  511. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
  512. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
  513. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
  514. package/dist/esm/flows-actors/utils/prompt-ir-adapters.backend.utils.d.ts.map +1 -1
  515. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts +77 -0
  516. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.d.ts.map +1 -0
  517. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js +164 -0
  518. package/dist/esm/flows-actors/utils/tool-approval-modification.backend.utils.js.map +1 -0
  519. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts +48 -0
  520. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.d.ts.map +1 -0
  521. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js +101 -0
  522. package/dist/esm/flows-actors/utils/tool-approval-signing.backend.utils.js.map +1 -0
  523. package/dist/esm/guidance/batches/dormancy-detection.batch.backend.service.d.ts.map +1 -1
  524. package/dist/esm/guidance/services/guidance-trigger-evaluator.backend.service.d.ts.map +1 -1
  525. package/dist/esm/guidance/services/lifecycle-custom-implementations.backend.d.ts.map +1 -1
  526. package/dist/esm/guidance/services/lifecycle-evaluator.backend.service.d.ts.map +1 -1
  527. package/dist/esm/guidance/services/lifecycle-scope-id.backend.utils.d.ts.map +1 -1
  528. package/dist/esm/guidance/services/milestone-condition-registry.backend.service.d.ts.map +1 -1
  529. package/dist/esm/guidance/services/milestone-definition-registry.backend.service.d.ts.map +1 -1
  530. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
  531. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
  532. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -1
  533. package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -1
  534. package/dist/esm/guidance/services/scoped-state-read-custom-implementations.backend.d.ts.map +1 -1
  535. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
  536. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
  537. package/dist/esm/i18n/services/i18n.backend.service.d.ts.map +1 -1
  538. package/dist/esm/index.d.ts +0 -1
  539. package/dist/esm/index.d.ts.map +1 -1
  540. package/dist/esm/index.js +0 -1
  541. package/dist/esm/index.js.map +1 -1
  542. package/dist/esm/inject/models/container.d.ts +10 -0
  543. package/dist/esm/inject/models/container.d.ts.map +1 -1
  544. package/dist/esm/inject/models/container.js +49 -1
  545. package/dist/esm/inject/models/container.js.map +1 -1
  546. package/dist/esm/inject/models/service-types.d.ts +3 -0
  547. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  548. package/dist/esm/inject/models/service-types.js +3 -0
  549. package/dist/esm/inject/models/service-types.js.map +1 -1
  550. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  551. package/dist/esm/mcp/controllers/mcp.controller.js +50 -3
  552. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  553. package/dist/esm/mcp/models/mcp-protocol.backend.schemas.d.ts.map +1 -1
  554. package/dist/esm/mcp/models/mcp-tool.backend.schemas.d.ts.map +1 -1
  555. package/dist/esm/mcp/models/mcp-tool.backend.schemas.js.map +1 -1
  556. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  557. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  558. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  559. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  560. package/dist/esm/mcp/services/resource-server-instances-registry.backend.service.d.ts.map +1 -1
  561. package/dist/esm/mcp/utils/zod-to-mcp-json-schema.backend.utils.d.ts.map +1 -1
  562. package/dist/esm/meta-workflow-runtime.exports.d.ts.map +1 -1
  563. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
  564. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
  565. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -1
  566. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -1
  567. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
  568. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
  569. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
  570. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
  571. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
  572. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
  573. package/dist/esm/monitoring/logger/services/__tests__/mock-logger.service.d.ts.map +1 -1
  574. package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
  575. package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
  576. package/dist/esm/monitoring/logger/services/logger.service.js +3 -3
  577. package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
  578. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -1
  579. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -1
  580. package/dist/esm/monitoring/logger/utils/log-value-normalization.backend.utils.d.ts.map +1 -1
  581. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +10 -6
  582. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -1
  583. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +10 -6
  584. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -1
  585. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
  586. package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
  587. package/dist/esm/monitoring/observability/otel-preload.d.ts.map +1 -1
  588. package/dist/esm/monitoring/observability/otel-sdk-global-handle.d.ts.map +1 -1
  589. package/dist/esm/monitoring/observability/services/__tests__/mock-metrics.service.d.ts.map +1 -1
  590. package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
  591. package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
  592. package/dist/esm/monitoring/observability/services/observability.backend.service.d.ts.map +1 -1
  593. package/dist/esm/notifications/email/components/email-components.d.ts.map +1 -1
  594. package/dist/esm/notifications/email/models/email-template-definition.d.ts.map +1 -1
  595. package/dist/esm/notifications/email/models/email-transport.backend.definitions.d.ts.map +1 -1
  596. package/dist/esm/notifications/email/services/email-batch-send.batch.backend.service.d.ts.map +1 -1
  597. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
  598. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
  599. package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
  600. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
  601. package/dist/esm/notifications/email/services/email.backend.service.d.ts +47 -6
  602. package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
  603. package/dist/esm/notifications/email/services/email.backend.service.js +86 -36
  604. package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
  605. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
  606. package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
  607. package/dist/esm/notifications/email/utils/interpolate-email-label.utils.d.ts.map +1 -1
  608. package/dist/esm/notifications/email/utils/zod-to-typescript.utils.d.ts.map +1 -1
  609. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
  610. package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
  611. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  612. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  613. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts +32 -0
  614. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.d.ts.map +1 -0
  615. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js +32 -0
  616. package/dist/esm/notifications/sms/models/sms-transport.backend.definitions.js.map +1 -0
  617. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +64 -10
  618. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
  619. package/dist/esm/notifications/sms/services/sms.backend.service.js +277 -82
  620. package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
  621. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
  622. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
  623. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  624. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  625. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.utils.d.ts.map +1 -1
  626. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  627. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  628. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.custom-impl.backend.service.d.ts.map +1 -1
  629. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-delivery-log.repository.d.ts.map +1 -1
  630. package/dist/esm/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service.d.ts.map +1 -1
  631. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-public-key.custom-impl.backend.service.d.ts.map +1 -1
  632. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  633. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  634. package/dist/esm/notifications/webhooks/outbound/services/webhook-config.backend.service.d.ts.map +1 -1
  635. package/dist/esm/notifications/webhooks/services/polymorphic-lookup.backend.service.d.ts.map +1 -1
  636. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
  637. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
  638. package/dist/esm/organizations/batches/organization-member-invitation-sweep.batch.backend.service.d.ts.map +1 -1
  639. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts.map +1 -1
  640. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
  641. package/dist/esm/organizations/services/authority-change-audit.backend.utils.d.ts.map +1 -1
  642. package/dist/esm/organizations/services/invitation-acceptance.backend.utils.d.ts.map +1 -1
  643. package/dist/esm/organizations/services/org-creation-on-registration.backend.utils.d.ts.map +1 -1
  644. package/dist/esm/organizations/services/org-member-roles-validation.backend.utils.d.ts.map +1 -1
  645. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
  646. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
  647. package/dist/esm/organizations/services/organization-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
  648. package/dist/esm/organizations/services/organization-member-custom-implementation.backend.service.d.ts.map +1 -1
  649. package/dist/esm/organizations/services/organization-onboarding-operation.backend.utils.d.ts.map +1 -1
  650. package/dist/esm/organizations/services/organization-unit-custom-implementation.backend.service.d.ts.map +1 -1
  651. package/dist/esm/organizations/services/organization-unit-member-custom-implementation.backend.service.d.ts.map +1 -1
  652. package/dist/esm/organizations/services/scim-provisioning-gate.backend.utils.d.ts.map +1 -1
  653. package/dist/esm/organizations/services/user-org-type-grant.backend.utils.d.ts.map +1 -1
  654. package/dist/esm/organizations/services/user-type-revocation-on-org-leave.backend.utils.d.ts.map +1 -1
  655. package/dist/esm/pdf-templates/__tests__/fixtures/tiny-pdf-template.fixture.d.ts.map +1 -1
  656. package/dist/esm/pdf-templates/models/pdf-template-binding.d.ts.map +1 -1
  657. package/dist/esm/pdf-templates/models/pdf-template-definition.d.ts.map +1 -1
  658. package/dist/esm/pdf-templates/services/pdf-generated-file-writer.backend.service.d.ts.map +1 -1
  659. package/dist/esm/pdf-templates/services/pdf-generation-orchestrator.backend.service.d.ts.map +1 -1
  660. package/dist/esm/pdf-templates/services/pdf-renderer.backend.service.d.ts.map +1 -1
  661. package/dist/esm/pdf-templates/services/pdf-template-binding.backend.service.d.ts.map +1 -1
  662. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -1
  663. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -1
  664. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -1
  665. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -1
  666. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -1
  667. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -1
  668. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -1
  669. package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -1
  670. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
  671. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
  672. package/dist/esm/queue/apps-crontabs-manager.backend.service.d.ts.map +1 -1
  673. package/dist/esm/queue/cron-job-sync.backend.service.d.ts.map +1 -1
  674. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
  675. package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
  676. package/dist/esm/queue/job-completion-registry.backend.service.d.ts.map +1 -1
  677. package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
  678. package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
  679. package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
  680. package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
  681. package/dist/esm/queue/job-payload-storage.backend.service.d.ts.map +1 -1
  682. package/dist/esm/queue/job-status-tracking.backend.service.d.ts.map +1 -1
  683. package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
  684. package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
  685. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
  686. package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
  687. package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
  688. package/dist/esm/queue/queue.backend.service.js.map +1 -1
  689. package/dist/esm/queue/scheduled-message-verifier.backend.service.d.ts.map +1 -1
  690. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
  691. package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
  692. package/dist/esm/rag/batches/rag-embedding-drain.batch.backend.service.d.ts.map +1 -1
  693. package/dist/esm/rag/batches/rag-reconciliation-sweep.batch.backend.service.d.ts.map +1 -1
  694. package/dist/esm/rag/models/rag-chunk-store.backend.types.d.ts.map +1 -1
  695. package/dist/esm/rag/models/rag-retrieval.backend.types.d.ts.map +1 -1
  696. package/dist/esm/rag/services/mongodb-rag-chunk-store.backend.service.d.ts.map +1 -1
  697. package/dist/esm/rag/services/postgresql-rag-chunk-store.backend.service.d.ts.map +1 -1
  698. package/dist/esm/rag/services/rag-chunk-collection.mongodb-ddl.backend.d.ts.map +1 -1
  699. package/dist/esm/rag/services/rag-chunk-retrieval.mongodb-query.backend.d.ts.map +1 -1
  700. package/dist/esm/rag/services/rag-chunk-retrieval.postgresql-query.backend.d.ts.map +1 -1
  701. package/dist/esm/rag/services/rag-chunk-store.backend.service.d.ts.map +1 -1
  702. package/dist/esm/rag/services/rag-chunk-table.postgresql-ddl.backend.d.ts.map +1 -1
  703. package/dist/esm/rag/services/rag-ingestion.backend.service.d.ts.map +1 -1
  704. package/dist/esm/rag/services/rag-retrieval.backend.service.d.ts.map +1 -1
  705. package/dist/esm/rag/utils/rag-chunk-fusion.backend.utils.d.ts.map +1 -1
  706. package/dist/esm/rag/utils/rag-chunk-removal.backend.utils.d.ts.map +1 -1
  707. package/dist/esm/rag/utils/rag-chunk-row-shaping.backend.utils.d.ts.map +1 -1
  708. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
  709. package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
  710. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
  711. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
  712. package/dist/esm/rag/utils/rag-ingestion-trigger.backend.utils.d.ts.map +1 -1
  713. package/dist/esm/rag/utils/rag-retrieval-scope.backend.utils.d.ts.map +1 -1
  714. package/dist/esm/rag/utils/rag-source-field-value.backend.utils.d.ts.map +1 -1
  715. package/dist/esm/requests/models/api-routes.backend.defintions.d.ts.map +1 -1
  716. package/dist/esm/requests/models/requests.backend.schemas.d.ts.map +1 -1
  717. package/dist/esm/requests/service/platform-mutualized-handler.backend.service.d.ts.map +1 -1
  718. package/dist/esm/requests/service/platform-requests.backend.utils.d.ts.map +1 -1
  719. package/dist/esm/requests/service/remote-client-base.backend.service.d.ts.map +1 -1
  720. package/dist/esm/requests/service/serverless-services-handler.backend.service.d.ts.map +1 -1
  721. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  722. package/dist/esm/requests/service/websocket.service.js +49 -1
  723. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  724. package/dist/esm/resources/backend-resource-registry.exports.d.ts.map +1 -1
  725. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  726. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +2 -0
  727. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  728. package/dist/esm/resources/models/index.d.ts.map +1 -1
  729. package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
  730. package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
  731. package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
  732. package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
  733. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
  734. package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
  735. package/dist/esm/resources/models/resources.backend.schemas.d.ts.map +1 -1
  736. package/dist/esm/resources/models/virtual-fields.backend.types.d.ts.map +1 -1
  737. package/dist/esm/resources/services/__tests__/mock-resources-registry.service.d.ts.map +1 -1
  738. package/dist/esm/resources/services/resource-context.backend.service.d.ts.map +1 -1
  739. package/dist/esm/resources/services/resource-id.backend.service.d.ts.map +1 -1
  740. package/dist/esm/resources/services/resource-population.backend.service.d.ts +17 -2
  741. package/dist/esm/resources/services/resource-population.backend.service.d.ts.map +1 -1
  742. package/dist/esm/resources/services/resource-population.backend.service.js +74 -18
  743. package/dist/esm/resources/services/resource-population.backend.service.js.map +1 -1
  744. package/dist/esm/resources/services/resources-registry.backend.service.d.ts +23 -0
  745. package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
  746. package/dist/esm/resources/services/resources-registry.backend.service.js +31 -0
  747. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  748. package/dist/esm/resources/services/virtual-fields.backend.service.d.ts.map +1 -1
  749. package/dist/esm/resources/utils/resource-retention.backend.utils.d.ts.map +1 -1
  750. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
  751. package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
  752. package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
  753. package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
  754. package/dist/esm/runtime/models/execution-context.backend.schemas.d.ts.map +1 -1
  755. package/dist/esm/runtime/models/request-context.als.backend.d.ts.map +1 -1
  756. package/dist/esm/runtime/models/runtime.backend.schemas.d.ts.map +1 -1
  757. package/dist/esm/runtime/services/execution-context-creator.backend.service.d.ts.map +1 -1
  758. package/dist/esm/runtime/services/execution-context-creator.backend.service.js.map +1 -1
  759. package/dist/esm/runtime/services/execution-context-handler.backend.service.d.ts.map +1 -1
  760. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
  761. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
  762. package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
  763. package/dist/esm/runtime/services/http-server.backend.service.js +10 -0
  764. package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
  765. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  766. package/dist/esm/runtime/services/start-application.backend.service.js +26 -12
  767. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  768. package/dist/esm/runtime/services/utils/oauth-body-cap.backend.utils.d.ts.map +1 -1
  769. package/dist/esm/runtime/testing/execution-context-test-fixtures.d.ts.map +1 -1
  770. package/dist/esm/runtime/testing/mock-execution-context-creator.service.d.ts.map +1 -1
  771. package/dist/esm/runtime/utils/application-startup-config-access.backend.utils.d.ts.map +1 -1
  772. package/dist/esm/runtime/utils/feature-gated-core-resource-exclusions.backend.utils.d.ts.map +1 -1
  773. package/dist/esm/runtime/utils/request-client-ip.utils.d.ts.map +1 -1
  774. package/dist/esm/runtime/utils/scan-default-exports.backend.utils.d.ts.map +1 -1
  775. package/dist/esm/security/api-keys/api-key-generation.backend.utils.d.ts.map +1 -1
  776. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
  777. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
  778. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
  779. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
  780. package/dist/esm/security/authentications/controllers/auth-method-management-controller.backend.service.d.ts.map +1 -1
  781. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts +22 -0
  782. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
  783. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +84 -0
  784. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
  785. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
  786. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
  787. package/dist/esm/security/authentications/models/auth-constants.backend.d.ts.map +1 -1
  788. package/dist/esm/security/authentications/models/authentications.backend.schemas.d.ts.map +1 -1
  789. package/dist/esm/security/authentications/models/authorization-client.backend.schemas.d.ts.map +1 -1
  790. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
  791. package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
  792. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts +37 -0
  793. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.d.ts.map +1 -0
  794. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js +37 -0
  795. package/dist/esm/security/authentications/models/federated-auth-transport.backend.definitions.js.map +1 -0
  796. package/dist/esm/security/authentications/models/identity-persistence-boundaries.backend.d.ts.map +1 -1
  797. package/dist/esm/security/authentications/models/jwt.backend.schemas.d.ts.map +1 -1
  798. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
  799. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
  800. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
  801. package/dist/esm/security/authentications/models/saml-authentication.backend.schemas.d.ts.map +1 -1
  802. package/dist/esm/security/authentications/models/sso-connection.backend.schemas.d.ts.map +1 -1
  803. package/dist/esm/security/authentications/models/user-authorization-version.backend.utils.d.ts.map +1 -1
  804. package/dist/esm/security/authentications/seeds/enterprise-config-defaults.seeds.d.ts.map +1 -1
  805. package/dist/esm/security/authentications/services/__tests__/mock-auth-execution-context-factory.service.d.ts.map +1 -1
  806. package/dist/esm/security/authentications/services/__tests__/mock-auth-token-issuer.service.d.ts.map +1 -1
  807. package/dist/esm/security/authentications/services/__tests__/oauth-provider-audit-spies.mock.d.ts.map +1 -1
  808. package/dist/esm/security/authentications/services/admin-config/__tests__/mock-domain-to-org-lookup.service.d.ts.map +1 -1
  809. package/dist/esm/security/authentications/services/admin-config/__tests__/mock-enterprise-user-provisioning.service.d.ts.map +1 -1
  810. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
  811. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
  812. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
  813. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
  814. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
  815. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
  816. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
  817. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
  818. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.d.ts.map +1 -1
  819. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js +2 -1
  820. package/dist/esm/security/authentications/services/admin-config/oidc-discovery.backend.service.js.map +1 -1
  821. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +9 -2
  822. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
  823. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +9 -2
  824. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
  825. package/dist/esm/security/authentications/services/auth-credential-verifier.backend.service.d.ts.map +1 -1
  826. package/dist/esm/security/authentications/services/auth-execution-context-factory.backend.service.d.ts.map +1 -1
  827. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  828. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  829. package/dist/esm/security/authentications/services/auth-methods/auth-mfa.backend.service.d.ts.map +1 -1
  830. package/dist/esm/security/authentications/services/auth-methods/auth-password-reset.backend.service.d.ts.map +1 -1
  831. package/dist/esm/security/authentications/services/auth-methods/auth-phone-verification.backend.service.d.ts.map +1 -1
  832. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
  833. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
  834. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts +97 -0
  835. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
  836. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +218 -26
  837. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
  838. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts +14 -0
  839. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
  840. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +36 -0
  841. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
  842. package/dist/esm/security/authentications/services/auth-methods/saml-assertion-validator.backend.service.d.ts.map +1 -1
  843. package/dist/esm/security/authentications/services/auth-methods/saml-authentication.backend.service.d.ts.map +1 -1
  844. package/dist/esm/security/authentications/services/auth-methods/saml-metadata.backend.service.d.ts.map +1 -1
  845. package/dist/esm/security/authentications/services/auth-methods/saml-replay-guard.backend.service.d.ts.map +1 -1
  846. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
  847. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
  848. package/dist/esm/security/authentications/services/auth-session-store.backend.service.d.ts.map +1 -1
  849. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  850. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  851. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
  852. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
  853. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
  854. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
  855. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
  856. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
  857. package/dist/esm/security/authentications/services/custom-impls/scim-tokens.custom-impl.backend.service.d.ts.map +1 -1
  858. package/dist/esm/security/authentications/services/custom-impls/siem-delivery-dlq.custom-impl.backend.service.d.ts.map +1 -1
  859. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -1
  860. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +57 -1
  861. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -1
  862. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
  863. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
  864. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.d.ts.map +1 -1
  865. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js +11 -1
  866. package/dist/esm/security/authentications/services/custom-impls/sso-connection.custom-impl.backend.service.js.map +1 -1
  867. package/dist/esm/security/authentications/services/email-verification-initiator.backend.service.d.ts.map +1 -1
  868. package/dist/esm/security/authentications/services/machine-token-issuer.backend.service.d.ts.map +1 -1
  869. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
  870. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
  871. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
  872. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
  873. package/dist/esm/security/authentications/services/oidc-user-claims.backend.service.d.ts.map +1 -1
  874. package/dist/esm/security/authentications/services/resolve-active-member-orgs.backend.utils.d.ts.map +1 -1
  875. package/dist/esm/security/authentications/services/utils/__tests__/mock-auth-user-lookup.service.d.ts.map +1 -1
  876. package/dist/esm/security/authentications/services/utils/auth-controller.utils.d.ts.map +1 -1
  877. package/dist/esm/security/authentications/services/utils/auth-credential-ops.backend.service.d.ts.map +1 -1
  878. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
  879. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
  880. package/dist/esm/security/authentications/services/utils/auth-response-helper.backend.service.d.ts.map +1 -1
  881. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
  882. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
  883. package/dist/esm/security/authentications/services/utils/concurrent-session-eviction.backend.utils.d.ts.map +1 -1
  884. package/dist/esm/security/authentications/services/utils/ensure-user-profile.backend.utils.d.ts.map +1 -1
  885. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
  886. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
  887. package/dist/esm/security/authentications/services/utils/machine-auth-rate-limit.backend.utils.d.ts.map +1 -1
  888. package/dist/esm/security/authentications/services/utils/pkce.backend.utils.d.ts.map +1 -1
  889. package/dist/esm/security/authentications/services/utils/saml-java-availability.d.ts.map +1 -1
  890. package/dist/esm/security/authentications/utils/application-auth-policy-audit.backend.utils.d.ts.map +1 -1
  891. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
  892. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
  893. package/dist/esm/security/authentications/utils/one-off-session-lifetime.backend.utils.d.ts.map +1 -1
  894. package/dist/esm/security/authentications/utils/social-oauth2-purpose.backend.utils.d.ts.map +1 -1
  895. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts +59 -0
  896. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.d.ts.map +1 -0
  897. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js +111 -0
  898. package/dist/esm/security/authorizations/access-grant-decision.factory.backend.js.map +1 -0
  899. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts +57 -0
  900. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.d.ts.map +1 -0
  901. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js +133 -0
  902. package/dist/esm/security/authorizations/access-grant-lifecycle-audit.backend.js.map +1 -0
  903. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts +41 -0
  904. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.d.ts.map +1 -0
  905. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js +157 -0
  906. package/dist/esm/security/authorizations/application-access-grant-custom-implementation.backend.service.js.map +1 -0
  907. package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts +84 -0
  908. package/dist/esm/security/authorizations/application-wide-read-admission.backend.d.ts.map +1 -0
  909. package/dist/esm/security/authorizations/application-wide-read-admission.backend.js +99 -0
  910. package/dist/esm/security/authorizations/application-wide-read-admission.backend.js.map +1 -0
  911. package/dist/esm/security/authorizations/authorization-denial-audit.backend.utils.d.ts.map +1 -1
  912. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -1
  913. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -1
  914. package/dist/esm/security/authorizations/initiator-organization-confinement.backend.d.ts.map +1 -1
  915. package/dist/esm/security/authorizations/junction-scope-resolution.backend.d.ts.map +1 -1
  916. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
  917. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
  918. package/dist/esm/security/authorizations/organization-unit-narrowing-enforcement.backend.d.ts.map +1 -1
  919. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
  920. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +20 -181
  921. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
  922. package/dist/esm/security/authorizations/privileged-access-review.backend.utils.d.ts.map +1 -1
  923. package/dist/esm/security/authorizations/relationship-foreign-key-filter.backend.d.ts.map +1 -1
  924. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
  925. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
  926. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +40 -0
  927. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -1
  928. package/dist/esm/security/authorizations/role-conferral.backend.utils.js +43 -1
  929. package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -1
  930. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +27 -17
  931. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
  932. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +27 -17
  933. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
  934. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +72 -0
  935. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  936. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +153 -10
  937. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  938. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
  939. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
  940. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -1
  941. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -1
  942. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +139 -1
  943. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -1
  944. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +474 -33
  945. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -1
  946. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +40 -0
  947. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -1
  948. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -1
  949. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -1
  950. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -1
  951. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +19 -0
  952. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -1
  953. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +38 -0
  954. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -1
  955. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
  956. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -1
  957. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -1
  958. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +17 -1
  959. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -1
  960. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +14 -0
  961. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -1
  962. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +16 -0
  963. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -1
  964. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -1
  965. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +1 -1
  966. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -1
  967. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +19 -0
  968. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -1
  969. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +45 -2
  970. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -1
  971. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -1
  972. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -1
  973. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +37 -1
  974. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -1
  975. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -1
  976. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -1
  977. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -1
  978. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -1
  979. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -1
  980. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts +34 -0
  981. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.d.ts.map +1 -0
  982. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js +39 -0
  983. package/dist/esm/security/connected-accounts/utils/user-delegated-access-token-slot.backend.utils.js.map +1 -0
  984. package/dist/esm/security/consumable-tokens/batches/consumable-tokens-cleanup.batch.backend.service.d.ts.map +1 -1
  985. package/dist/esm/security/consumable-tokens/consumable-token-models.exports.d.ts.map +1 -1
  986. package/dist/esm/security/consumable-tokens/models/consumable-tokens.backend.resources-config.schemas.d.ts.map +1 -1
  987. package/dist/esm/security/consumable-tokens/models/consumable-tokens.shared.schemas.d.ts.map +1 -1
  988. package/dist/esm/security/consumable-tokens/models/index.d.ts.map +1 -1
  989. package/dist/esm/security/consumable-tokens/services/__tests__/mock-consumable-token.service.d.ts.map +1 -1
  990. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  991. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  992. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
  993. package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
  994. package/dist/esm/security/jwt/services/auth-jwt-guard.backend.service.d.ts.map +1 -1
  995. package/dist/esm/security/jwt/services/jwt.backend.service.d.ts.map +1 -1
  996. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts +13 -0
  997. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.d.ts.map +1 -1
  998. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js +14 -0
  999. package/dist/esm/security/jwt/services/wildo-worker-bootstrap-client.backend.service.js.map +1 -1
  1000. package/dist/esm/security/jwt/utils/jwt-verification-error-classification.backend.utils.d.ts.map +1 -1
  1001. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
  1002. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
  1003. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
  1004. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
  1005. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts +39 -0
  1006. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.d.ts.map +1 -0
  1007. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js +60 -0
  1008. package/dist/esm/security/outbound/outbound-request-deadline.backend.utils.js.map +1 -0
  1009. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts +66 -0
  1010. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.d.ts.map +1 -0
  1011. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js +75 -0
  1012. package/dist/esm/security/outbound/outbound-request-headers.backend.utils.js.map +1 -0
  1013. package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
  1014. package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
  1015. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
  1016. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
  1017. package/dist/esm/security/scim/utils/scim-attribute-path-resolver.backend.utils.d.ts.map +1 -1
  1018. package/dist/esm/security/scim/utils/scim-filter-parser.d.ts.map +1 -1
  1019. package/dist/esm/security/scim/utils/scim-response-formatter.d.ts.map +1 -1
  1020. package/dist/esm/security/session-invalidation-fence.backend.utils.d.ts.map +1 -1
  1021. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
  1022. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
  1023. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -1
  1024. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -1
  1025. package/dist/esm/security/token-invalidation-fence.backend.utils.d.ts.map +1 -1
  1026. package/dist/esm/testing.d.ts.map +1 -1
  1027. package/dist/esm/users/services/inbound-contact-custom-implementation.backend.service.d.ts.map +1 -1
  1028. package/dist/esm/users/services/user-deletion-audit.custom-impl.backend.service.d.ts.map +1 -1
  1029. package/dist/esm/users/services/user-force-password-reset.custom-impl.backend.service.d.ts.map +1 -1
  1030. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -1
  1031. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -1
  1032. package/dist/esm/users/services/user-role-administration.custom-impl.backend.service.d.ts.map +1 -1
  1033. package/dist/esm/users/services/user-self-custom-implementations.backend.d.ts.map +1 -1
  1034. package/dist/esm/users/services/user-super-admin-floor.custom-impl.backend.service.d.ts.map +1 -1
  1035. package/dist/tsconfig.build.tsbuildinfo +1 -1
  1036. package/package.json +9 -9
  1037. package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts +0 -45
  1038. package/dist/esm/external-providers/services/flow-actor-design.backend.service.d.ts.map +0 -1
  1039. package/dist/esm/external-providers/services/flow-actor-design.backend.service.js +0 -22
  1040. package/dist/esm/external-providers/services/flow-actor-design.backend.service.js.map +0 -1
  1041. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -0
  1042. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -0
  1043. package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -0
  1044. package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -0
  1045. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -0
  1046. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -0
  1047. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -0
  1048. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -0
  1049. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -0
  1050. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -0
  1051. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -0
  1052. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -0
  1053. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -0
  1054. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -0
  1055. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -0
  1056. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"audit-event-dispatcher.backend.service.js","sourceRoot":"","sources":["../../../../../../src/compliance/audit-trails/services/audit-event-dispatcher.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;;;;;;;;;;;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAC/G,OAAO,EAAE,oCAAoC,EAAE,MAAM,2GAA2G,CAAC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AC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAS7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;qCAbQ,aAAa;QACO,uBAAuB;QACH,oCAAoC;QACzD,mBAAmB;QACI,yCAAyC;GAjDtI,kCAAkC,CAmuB9C","sourcesContent":["/**\n * Audit Event Dispatcher Backend Service\n *\n * Layer 2 of the three-layer audit event pipeline (Step 18).\n * Receives audit events after MongoDB write and dispatches them\n * to the organization's SIEM endpoint if configured.\n *\n * This is fire-and-forget — if dispatch fails, the audit log\n * in MongoDB remains authoritative.\n */\n\nimport 'reflect-metadata';\nimport { inject, injectable, optional } from 'inversify';\nimport type { RedisClientType } from 'redis';\nimport { v4 as uuidv4 } from 'uuid';\nimport { createHmac, createHash, timingSafeEqual } from 'crypto';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { AuthOrganizationConfigurationService } from '~wildo-backend-lib/security/authentications/services/admin-config/auth-organization-configuration.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { QueueBackendService } from '~wildo-backend-lib/queue/queue.backend.service';\nimport { LeasedValueCache } from '~wildo-backend-lib/compliance/audit-trails/services/utils/leased-value-cache.backend.utils';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { SIEM_WEBHOOK_DELIVERY_BATCH_REF } from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport {\n AuditEventOutcome,\n CoreAuditableEventType,\n CoreResourceType,\n getAuditEventClassification,\n type SecurityAuditEventEnvelope,\n type AuditEventCategory,\n type AuditEventSeverity,\n type AuditableEvent,\n type SiemExportConfigBase,\n AuthScopeType,\n} from '@wildo-ai/saas-models';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport type { RedisService } from '~wildo-backend-lib/databases/services/redis.service';\n\n/** F6: HMAC domain separator for event integrity */\nconst SIEM_HMAC_DOMAIN = 'wildo:siem:event-integrity:v1';\n\n/**\n * **A SIEM export configuration change takes effect on EVERY replica within 60 seconds — and within\n * milliseconds when the change goes through the engine.**\n *\n * That sentence is the guarantee this subsystem makes, and the two halves come from two different\n * mechanisms, so read both before changing either.\n *\n * ## Why the number is 60 seconds, and why it used to be 300\n *\n * The lease is the ONLY thing that covers a write no hook can see — a repository-tier write, or a\n * direct database write. There is a live one: `examples/wonder-todos/e2e/adapter.ts` (`case 'siem'`)\n * repoints an organization's export config with `upsertOrganizationSingleton(...)`, straight at the\n * store, bypassing the engine entirely. Its own comment records what the old 300 s cost — *\"A freshly\n * provisioned org has a cold 5-min config cache, so the first login cold-reads this\"* — i.e. the lane\n * is correct only because it is ORDERED to run before the organization's first audited action. A\n * five-minute convergence bound is not something a scenario, or an operator doing surgery, can wait\n * for; it is something they have to design around. Sixty seconds is something they can wait for.\n *\n * The old 300 s was never chosen for that job — it was chosen to bound READ AMPLIFICATION, because a\n * miss costs more than a repository read: `AuthOrganizationConfigurationService.loadSiemExportConfig`\n * reads through `readAsSystem`, which emits its own `system_context_read` audit row to the database\n * AND to immudb. So shortening the lease multiplies audit-trail plumbing noise, not just queries.\n * Two properties make 60 s affordable anyway:\n *\n * - **Refreshes are LAZY and STALE-WHILE-REVALIDATE** ({@link LeasedValueCache}). A quiet organization\n * costs one read per event, not one per minute; only a continuously busy one reaches the ceiling of\n * one read per lease per replica. At 60 s that ceiling is 60 reads/hour/replica per ACTIVE\n * organization — for an organization emitting 1000 audit events an hour, under 5 % amplification of\n * its own audit volume, against 12/hour before.\n * - **Nothing blocks on it.** Past the lease the cached value is served immediately and the re-read\n * runs off the emission path, so shortening it costs read volume and never latency.\n *\n * ## The other half: the engine-routed write converges in milliseconds\n *\n * {@link AuditEventDispatcherBackendService.invalidateSiemConfig} drops the local entry AND publishes\n * the organization id on {@link SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX}, which every replica\n * subscribes to. Before that broadcast the invalidation reached exactly ONE process — the one that\n * happened to handle the write — and every other replica served the stale value for the rest of the\n * lease, which is the defect this constant's neighbours document.\n *\n * **Do not raise this back toward the read-amplification number.** If the amplification ever needs to\n * come down, the right lever is the `system_context_read` row on the config read itself:\n * `SystemAccessBackendService.readAsSystem` already takes `suppressSystemAudit`, and its own JSDoc\n * names this exact read — *\"the audit pipeline resolving … an org's SIEM config to ROUTE an audit\n * event\"* — as the case it exists for. `loadSiemExportConfig` is the one such reader that does not\n * pass it. Fixing that makes a miss cost a single indexed read and removes the constraint entirely.\n */\nexport const SIEM_CONFIG_REFRESH_AFTER_MS = 60 * 1000;\n/** R2: Max entries in the SIEM-config cache to prevent unbounded growth. Least-recently-used is evicted. */\nconst SIEM_CONFIG_CACHE_MAX_SIZE = 1000;\n\n/**\n * F3: how long a cached organization NAME is served before a background re-read.\n *\n * Deliberately NOT the same constant as {@link SIEM_CONFIG_REFRESH_AFTER_MS}, though the mechanism is\n * now shared. A stale name is a stale LABEL on an exported envelope — the `organizationId` beside it\n * is authoritative and unaffected, so a rename showing up late is cosmetic. A stale export config\n * decides whether the event is routed AT ALL. Same defect shape, different consequence class, so they\n * get the same machinery and their own numbers: five minutes buys back the read volume that the\n * config's sixty seconds spends, and nothing depends on a rename propagating faster.\n */\nconst ORG_NAME_REFRESH_AFTER_MS = 5 * 60 * 1000;\n/** B4: Max entries in org name cache to prevent unbounded growth. Least-recently-used is evicted. */\nconst ORG_NAME_CACHE_MAX_SIZE = 1000;\n\n/**\n * The Redis channel carrying cross-replica SIEM-config invalidations. App-prefixed at use, so tenants\n * of one Redis never cross — the convention {@link RedisService.getAppPrefix} exists for.\n *\n * Broadcast rather than a shared cache, and the distinction is the whole design: the emission path\n * never touches Redis, so a Redis outage degrades convergence to the lease instead of degrading\n * ROUTING. A shared-store cache would have put a network round trip on the path an audit event takes\n * and made delivery depend on a store that can be down.\n */\nconst SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX = 'audit:siem-export-config:invalidate';\n\n/** Severity ordering for minimum severity filtering */\nconst SEVERITY_ORDER: Record<string, number> = {\n 'info': 0,\n 'warning': 1,\n 'critical': 2,\n};\n\n/**\n * The per-org audit sink TYPES an organization can route its authenticated audit\n * events to. Today the only type is the SIEM webhook. Adding a per-org destination\n * later (e.g. per-org immudb, per observability §11) is a new member HERE + a branch\n * in `_resolveOrgAuditSinks` + a `case` in `dispatchToOrganizationAuditSinks` — the F4\n * routing (org from the authenticated EC) and the envelope/HMAC contracts do not change.\n */\nexport const PerOrgAuditSinkType = {\n SIEM_WEBHOOK: 'siem_webhook',\n} as const;\nexport type PerOrgAuditSinkType = (typeof PerOrgAuditSinkType)[keyof typeof PerOrgAuditSinkType];\n\n/**\n * A per-org audit sink RESOLVED for a specific org, carrying exactly the config needed\n * to deliver one event to it. A discriminated union (one member today) — the dispatcher\n * fans out by `type`, so a new sink type extends this union rather than reshaping callers.\n */\ntype ResolvedOrgAuditSink = {\n type: typeof PerOrgAuditSinkType.SIEM_WEBHOOK;\n siemConfig: SiemExportConfigBase;\n};\n\n@injectable()\nexport class AuditEventDispatcherBackendService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n /**\n * F3: org NAME cache — a display label on the envelope. See {@link ORG_NAME_REFRESH_AFTER_MS}.\n *\n * No `onRefreshFailure`, and it would be dead code if there were one: {@link _resolveOrgName}'s loader\n * swallows its own error and yields `undefined`, so nothing this cache runs can ever reject. That\n * swallow is what makes the negative result CACHEABLE, which is the amplification fix described there;\n * the price is that a persistently unreadable organization row is silent, which is the right trade for\n * an optional label whose authoritative sibling (`organizationId`) is on the envelope regardless.\n */\n private readonly _orgNameCache = new LeasedValueCache<string | undefined>({\n refreshAfterMs: ORG_NAME_REFRESH_AFTER_MS,\n maxEntries: ORG_NAME_CACHE_MAX_SIZE,\n });\n\n /** R2: per-org SIEM-config cache — the value that decides ROUTING. See {@link SIEM_CONFIG_REFRESH_AFTER_MS}. */\n private readonly _siemConfigCache = new LeasedValueCache<SiemExportConfigBase | null>({\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n maxEntries: SIEM_CONFIG_CACHE_MAX_SIZE,\n onRefreshFailure: (organizationId, error) =>\n // ERROR, not WARN, and the asymmetry with the org-name cache above is the point: while this keeps\n // failing the replica is routing on a configuration nobody can confirm, so the guarantee stated on\n // `SIEM_CONFIG_REFRESH_AFTER_MS` is suspended for this organization. Backed off one lease by the\n // cache, so a persistently unreadable config produces one line a minute, not one an event.\n this.logger.error?.('Background refresh of an organization SIEM export config failed — routing continues on the LAST KNOWN config for this replica', {\n organizationId,\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n ...projectCaughtErrorLogFields(error),\n }),\n });\n\n /**\n * Latch so {@link _ensureInvalidationSubscriber} is idempotent; cleared on `end` so a dropped\n * subscriber re-arms.\n *\n * Deliberately the ONLY subscriber state kept. `A2ATaskCancellationBackendService` also holds the\n * client itself, because it has a shutdown path that closes it; this service has none, and a field\n * nothing reads is a field the next reader has to reason about for nothing. The socket keeps the\n * subscriber alive on its own, and a connection that emitted `end` is already closed.\n */\n private _invalidationSubscribeStarted = false;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.AuthOrganizationConfigurationService) private readonly orgConfigService: AuthOrganizationConfigurationService,\n @inject(SAAS_SERVICE_TYPES.QueueBackendService) private readonly queueService: QueueBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n /**\n * `@optional()` and APPENDED LAST — the constructor-parameter discipline.\n *\n * Optional because the cross-replica broadcast is an OPTIMISATION over the lease, never a\n * precondition for routing: a container with no Redis binding (several partial test containers, and\n * any single-replica deployment) must still dispatch audit events, converging on the lease alone.\n * Appended last so the five existing construction sites keep compiling unchanged.\n */\n @inject(SAAS_SERVICE_TYPES.RedisService) @optional() private readonly redisService?: RedisService,\n ) {\n this.logDebug = this.logger.debugByType('AuditEventDispatcherBackendService');\n this.logger.setDebugTypeLogging('AuditEventDispatcherBackendService', false);\n }\n\n /**\n * Dispatch an audit event to the organization's configured per-org audit SINKS.\n *\n * F4 (tenant segregation): the caller (`AuditLogsBackendService`) passes the\n * AUTHENTICATED org (resolved from the request `ExecutionContext`), NEVER the\n * caller-supplied `auditEvent.organizationId`. Sink config is loaded for THIS org\n * only (`_resolveOrgAuditSinks`), so an event can only reach the sinks of the tenant\n * it is authenticated for.\n *\n * Layer 2 of the pipeline: called after the MongoDB write (Layer 1), wired directly\n * into `AuditLogsBackendService` (NOT a resource pipeline post-hook). Fire-and-forget\n * — a resolution or per-sink delivery failure is logged but NEVER thrown onto the\n * business op, and per-sink failures are ISOLATED (F7) so one destination never\n * suppresses another.\n *\n * The seam: `_resolveOrgAuditSinks` returns the 0..N sinks the org has configured\n * (today only a SIEM webhook); this method fans each out by its `type`. Adding a\n * per-org destination later = a new {@link PerOrgAuditSinkType} + a resolver branch +\n * a `case` here.\n *\n * ── APPLICATION scope is RESERVED / DORMANT — there is NO app-scoped producer ──────\n * This producer is ORGANIZATION-scoped ONLY, on purpose. The F4 model routes on a\n * TRUSTED authenticated *tenant* (org), and the sole caller (`AuditLogsBackendService`)\n * fans out over the event's verified member orgs. There is deliberately no\n * `dispatchToApplicationAuditSinks` / `_resolveAppAuditSinks`.\n *\n * The SIEM export-config and delivery-DLQ resources DO each carry an `APPLICATION`\n * polymorphic variant (uniform with SSO/SCIM over `AUTH_SCOPE_VARIANTS`), and every\n * downstream seam is already scope-generic: `loadSiemExportConfig(ec, APPLICATION, appId)`,\n * {@link enqueueSiemWebhookDelivery} (`scopeType`/`scopeId`), the delivery worker's\n * circuit-breaker key, and `_enqueueToDLQ`'s `APPLICATION_SIEM_DELIVERY_DLQ` branch all\n * accept the app scope. But NOTHING emits a first-time app-scoped delivery. The only\n * caller that passes `scopeType: APPLICATION` today is the SIEM-DLQ *retry* custom-impl,\n * which is itself unreachable in production: an `APPLICATION_SIEM_DELIVERY_DLQ` row can\n * only be born from a FAILED app-scoped delivery — and none is ever produced — so the\n * app config-read, app DLQ, and app retry are mutually reachable only through each other.\n * NOTE the operator-visible trap this leaves: an app super-admin CAN enable\n * `APPLICATION_SIEM_EXPORT_CONFIG` (its own custom-impl + APP_ADMIN_SUPER_ADMIN roles)\n * and it will silently deliver NOTHING until a producer exists.\n *\n * To make it real — a SCOPED feature, NOT a mechanical mirror; settle the design fork\n * FIRST (which events an app SIEM receives, whether spanning all tenants, and how it\n * composes with per-org delivery so an event is not double-sent) — add a sibling\n * `_resolveAppAuditSinks(ec, appId)` loading the APP config, a\n * `dispatchToApplicationAuditSinks` fanning out identically, and a producer that calls it\n * with an app context, reusing the SAME envelope/HMAC/scope contract via\n * `enqueueSiemWebhookDelivery({ scopeType: AuthScopeType.APPLICATION, scopeId })`. Until\n * then, treat the APP variant as reserved plumbing, not a wired path.\n */\n public async dispatchToOrganizationAuditSinks(\n ec: ExecutionContext<any>,\n auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>,\n organizationId: string,\n ): Promise<void> {\n // No authenticated org → no per-org dispatch (fail-closed, F4).\n if (!organizationId) return;\n\n // Arm the fleet invalidation subscriber on first use, so nothing has to order it at startup. Never\n // awaited: it performs a Redis duplicate + connect + subscribe on the first dispatch, and this\n // event must not wait for it. The window it leaves — one connect — is bounded by the lease, which\n // is what covers every un-broadcast change anyway.\n void this._ensureInvalidationSubscriber();\n\n let sinks: ResolvedOrgAuditSink[];\n try {\n sinks = await this._resolveOrgAuditSinks(ec, organizationId);\n } catch (error) {\n // Fire-and-forget: a config-resolution failure must never throw onto the business op.\n this.logger.error?.('Failed to resolve org audit sinks', {\n error,\n eventType: auditEvent.eventType,\n organizationId,\n });\n return;\n }\n\n for (const sink of sinks) {\n try {\n switch (sink.type) {\n case PerOrgAuditSinkType.SIEM_WEBHOOK:\n await this._dispatchToSiemWebhook(ec, auditEvent, organizationId, sink.siemConfig);\n break;\n default:\n // F-1 safety net: a future `PerOrgAuditSinkType` member with no `case` above is\n // LOGGED, never silently dropped (the original finding was a silent no-op). A\n // single-member discriminated union does NOT narrow this `default` to `never`, so\n // a compile-time `assertNever(sink)` guard only becomes possible once a 2nd sink\n // type exists — convert this branch to it then. Until then the resolver's +\n // switch's JSDoc pointers (\"add a case here\") + this warn are the guard.\n this.logger.warn?.(\n 'Unhandled per-org audit sink type — event NOT delivered to this sink; add a `case` in dispatchToOrganizationAuditSinks',\n { sinkType: sink.type, eventType: auditEvent.eventType, organizationId },\n );\n break;\n }\n } catch (error) {\n // Per-sink isolation (F7): one org sink failing never affects the others.\n this.logger.error?.('Failed to dispatch audit event to an org audit sink', {\n error,\n sinkType: sink.type,\n eventType: auditEvent.eventType,\n organizationId,\n });\n }\n }\n }\n\n /**\n * Resolve the per-org audit SINKS an org has configured — the 0..N destinations\n * {@link dispatchToOrganizationAuditSinks} fans an event out to. Keyed on the org the\n * caller already validated as authenticated (F4). Today the only per-org sink type is\n * the SIEM webhook; a future per-org destination appends its own descriptor HERE.\n *\n * Two-level feature gate for `CoreFeature.SECURITY_EVENT_EXPORT`:\n * Level 1 (here): `siemConfig.enabled` — the runtime gate.\n * Level 2 (admin API): `FeatureGateService` checks the org's subscription tier has\n * `SECURITY_EVENT_EXPORT` before allowing `enabled = true`. We cannot use\n * `FeatureResolutionService` here (fire-and-forget context; internal ECs bypass\n * feature resolution), so the pre-validated `enabled` flag IS the per-org gate.\n */\n private async _resolveOrgAuditSinks(\n ec: ExecutionContext<any>,\n organizationId: string,\n ): Promise<ResolvedOrgAuditSink[]> {\n const sinks: ResolvedOrgAuditSink[] = [];\n\n const siemConfig = await this._loadSiemConfigCached(ec, organizationId);\n if (siemConfig?.enabled) {\n sinks.push({ type: PerOrgAuditSinkType.SIEM_WEBHOOK, siemConfig });\n }\n\n // Future per-org sink types (e.g. per-org immudb) resolve here — each appends its\n // own descriptor; the dispatcher switch fans out by `type`.\n return sinks;\n }\n\n /**\n * R2: load the org's SIEM config through the leased cache.\n *\n * Without a cache, {@link _resolveOrgAuditSinks} reads the config via a self-elevating `readAsSystem`\n * PER EVENT PER ORG — and `readAsSystem` ALSO emits a `SYSTEM_CONTEXT_READ` audit — so every routed\n * audit event (× N orgs on the multi-org fan-out) doubled the audit-write volume to the DB + immudb.\n * `null` is cached too (an org whose config load failed) so a non-configured org is not re-read every\n * event.\n *\n * The cache is STALE-WHILE-REVALIDATE ({@link LeasedValueCache}), so only the very first event for an\n * organization waits on a read; every later one is served from memory while the refresh runs off this\n * path. That is what lets {@link SIEM_CONFIG_REFRESH_AFTER_MS} be sixty seconds rather than five\n * minutes — read the guarantee stated there before changing it.\n *\n * The loader closes over `ec`, which is the audit service's synthesised super-admin APPLICATION-scoped\n * temp context (`audit-logs.backend.service.ts:284`, handed here at `:349`) and is therefore equally\n * privileged on every call — the precondition {@link LeasedValueCache} states for joining an in-flight\n * load. `loadSiemExportConfig` in fact ignores `ec` entirely (`void ec`) and reads system-context.\n */\n private async _loadSiemConfigCached(\n ec: ExecutionContext<any>,\n organizationId: string,\n ): Promise<SiemExportConfigBase | null> {\n return this._siemConfigCache.get(organizationId, () =>\n this.orgConfigService.loadSiemExportConfig(ec, AuthScopeType.ORGANIZATION, organizationId),\n );\n }\n\n /**\n * Drop one organization's cached SIEM config so the NEXT event re-reads it.\n *\n * ## Why this exists\n *\n * Without it the cache had no invalidation at all — only the 5-minute TTL and the size-1000\n * FIFO — so enabling a sink left the organization's events unrouted for up to that window, and\n * audit events are not replayed. The ENABLE direction is the sharp one: `null` is cached\n * deliberately (see {@link _loadSiemConfigCached}) and `null` is exactly the state an\n * organization is in the moment before it first configures a sink, so the first five minutes of\n * a newly-pointed SIEM were silently empty.\n *\n * ## Where it is called from, and why not from the config service\n *\n * From a postfix hook on the SIEM-export-config RESOURCE\n * (`siem-export-config-cache-invalidation.custom-impl.backend.service.ts`), not from\n * `AuthOrganizationConfigurationService.saveSiemExportConfig`.\n *\n * That service was the obvious call site and it is the WRONG one: it is only one of the writers.\n * The config is an ordinary resource, so an update also lands through\n * `ServicesRegistryHandler.update` on `organizationSiemExportConfig` directly. Hooking the\n * service would have applied the invariant at one of two call sites, which is the defect shape\n * `.claude/rules/invariant-call-site-enumeration.md` exists to stop. The resource operation is\n * the chokepoint BOTH writers pass through — `saveSiemExportConfig` itself dispatches its write\n * via `ServicesRegistryHandler`, so covering the resource covers it for free.\n *\n * Note `saveSiemExportConfig` separately refreshes its OWN `siemExportConfigs` map. That is a\n * different cache in a different service and was never the one deciding routing.\n *\n * ## Semantics\n *\n * Deleting the entry rather than overwriting it: the next read goes to the repository, so this\n * cannot install a wrong value, only force a re-read. Idempotent, and a no-op for an\n * organization with no entry — which is the common case, since only organizations that have\n * raised an audit event since the last eviction are in the map at all. Synchronous and\n * infallible on purpose, so the caller needs no error handling.\n *\n * ## It reaches EVERY replica, which it did not before\n *\n * The local drop above is only ever correct for ONE process — the one that happened to handle the\n * write. With N replicas behind a load balancer, the other N-1 went on serving the pre-write config\n * for the rest of the lease, so \"the invalidation covers engine-routed writes\" was true of a single\n * instance and false of every real deployment. The broadcast closes that: the organization id goes\n * out on {@link SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX} and every replica's subscriber drops its own\n * entry within milliseconds.\n *\n * The publish is fire-and-forget and cannot fail this call: a broadcast that does not go out degrades\n * the OTHER replicas to the lease, which is exactly where they were before, and refusing a\n * configuration write to protect a cache would invert the priority. This method's synchronous,\n * infallible contract therefore still holds for its caller.\n *\n * **What it still does NOT cover, and cannot.** A write that never reaches the service tier — a\n * repository-tier write, or a direct database write like `examples/wonder-todos/e2e/adapter.ts`'s\n * `upsertOrganizationSingleton('organizationSiemExportConfig', …)` — raises no postfix hook, so\n * nothing calls this and nothing is broadcast. For those the lease is the entire guarantee; that is\n * why it is chosen and argued at {@link SIEM_CONFIG_REFRESH_AFTER_MS} rather than left incidental.\n */\n public invalidateSiemConfig(organizationId: string): void {\n this._siemConfigCache.invalidate(organizationId);\n this._publishSiemConfigInvalidation(organizationId);\n }\n\n /**\n * Tell the rest of the fleet to drop this organization's cached SIEM config.\n *\n * Returns nothing and awaits nothing — the caller is a postfix write hook whose contract is that it\n * cannot fail the write it follows.\n */\n private _publishSiemConfigInvalidation(organizationId: string): void {\n const client = this.redisService?.getReadyClient();\n // A not-ready client is the normal state wherever Redis is unconfigured (single-replica, local dev,\n // several test containers). It is not an error: the local drop already happened, and there is no\n // other replica to tell.\n if (!client) return;\n\n void client\n .publish(this._invalidationChannel(), organizationId)\n .catch((error: unknown) =>\n this.logger.error?.('Failed to broadcast a SIEM export config invalidation — other replicas converge on the lease instead', {\n organizationId,\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n ...projectCaughtErrorLogFields(error),\n }),\n );\n }\n\n /** App-prefixed so two applications sharing one Redis never invalidate each other's caches. */\n private _invalidationChannel(): string {\n return `${this.redisService?.getAppPrefix() ?? ''}${SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX}`;\n }\n\n /**\n * Arm this replica's single subscriber to the invalidation channel. Idempotent.\n *\n * Called (never awaited) from {@link dispatchToOrganizationAuditSinks}, so no startup ordering is\n * required and nothing has to be wired in `start-application` — the same lazy-arm pattern\n * `A2ATaskCancellationBackendService.ensureSubscriber` uses, for the same reason.\n *\n * Fails OPEN by design: a replica that cannot subscribe still routes audit events, converging on the\n * lease instead of on the broadcast. The failure is logged at ERROR because a persistent one silently\n * returns that replica to the per-process behaviour this mechanism exists to remove.\n *\n * Two details are copied deliberately rather than reinvented, because each was a recorded defect in\n * the A2A original: the `end` handler RE-ARMS (a subscriber that connected and then dropped — a Redis\n * restart, a failover, an idle reap — otherwise stayed dead for the life of the process while every\n * other signal looked healthy), and the catch DESTROYS a half-built connection (`connect()` can\n * succeed while `subscribe()` throws, and retrying without destroying leaks one socket per attempt).\n */\n private async _ensureInvalidationSubscriber(): Promise<void> {\n if (this._invalidationSubscribeStarted) return;\n this._invalidationSubscribeStarted = true;\n\n const client = this.redisService?.getReadyClient();\n if (!client) {\n // Not an error: no Redis means no other replica to hear from. Latched so this is decided once.\n this.logDebug('Redis unavailable — cross-replica SIEM-config invalidation is disabled for this replica');\n return;\n }\n\n let subscriber: RedisClientType | undefined;\n try {\n // `node-redis` forbids ordinary commands on a subscribed connection, so this MUST be a duplicate\n // rather than the shared client.\n subscriber = client.duplicate() as RedisClientType;\n subscriber.on('error', (error: unknown) =>\n this.logger.error?.('SIEM-config invalidation subscriber error', { ...projectCaughtErrorLogFields(error) }),\n );\n subscriber.on('end', () => {\n this.logger.warn?.('SIEM-config invalidation subscriber closed; re-arming so the next dispatch rebuilds it');\n this._invalidationSubscribeStarted = false;\n });\n await subscriber.connect();\n await subscriber.subscribe(this._invalidationChannel(), (organizationId: string) => {\n // Local drop only — never a re-publish, or one write would loop the fleet forever.\n this._siemConfigCache.invalidate(organizationId);\n this.logDebug('Dropped a cached SIEM export config on a fleet invalidation', { organizationId });\n });\n } catch (error) {\n if (subscriber) {\n try {\n await subscriber.destroy();\n } catch {\n /* already dead — nothing to reclaim */\n }\n }\n this._invalidationSubscribeStarted = false; // allow a later dispatch to retry\n this.logger.error?.('Failed to subscribe to the SIEM-config invalidation channel — this replica converges on the lease only', {\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n /**\n * Deliver one event to an org's SIEM webhook sink: apply the sink's per-event filter,\n * build + HMAC the envelope, and enqueue for async delivery via the SIEM webhook\n * delivery worker (`siemWebhookDeliveryBatchService`, registered under\n * `SIEM_WEBHOOK_DELIVERY_BATCH_REF` in `start-application`). May throw; the caller\n * isolates per-sink failures.\n */\n private async _dispatchToSiemWebhook(\n ec: ExecutionContext<any>,\n auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>,\n organizationId: string,\n siemConfig: SiemExportConfigBase,\n ): Promise<void> {\n // Classify the event (always returns a value; defaults to data_access/info for unknown types)\n const classification = getAuditEventClassification(auditEvent.eventType);\n\n // Apply the sink's per-event filter\n if (!this._passesEventFilter(auditEvent.eventType, classification, siemConfig)) {\n this.logDebug('Event filtered out by SIEM config', {\n eventType: auditEvent.eventType,\n organizationId,\n });\n return;\n }\n\n // F3: Resolve org name for SIEM analyst readability\n const orgName = await this._resolveOrgName(ec, organizationId);\n\n // Extract application context from eventData if available\n const appId = (auditEvent.eventData as Record<string, unknown>)?.applicationId as string | undefined;\n const appName = (auditEvent.eventData as Record<string, unknown>)?.applicationName as string | undefined;\n\n // Build the envelope (F3: includes orgName, Task 3.12c: includes app context)\n const envelope = this._buildEnvelope(auditEvent, organizationId, classification, orgName, appId, appName);\n\n // Enqueue for async delivery through the single job-contract seam\n // (payload shape + F6 envelope HMAC + batch ref). This dispatch path is\n // org-scoped; {@link enqueueSiemWebhookDelivery} defaults scopeType/scopeId to\n // the organization, so behaviour is unchanged.\n await this.enqueueSiemWebhookDelivery({ envelope, organizationId, siemConfig });\n\n this.logDebug('Audit event enqueued for SIEM delivery', {\n eventId: envelope.eventId,\n eventType: auditEvent.eventType,\n organizationId,\n });\n }\n\n /**\n * Enqueue ONE already-built envelope for async SIEM webhook delivery.\n *\n * The SINGLE authority for the SIEM delivery-job contract — the\n * {@link SIEMDeliveryJobPayload} shape, the F6 envelope HMAC, and the\n * `SIEM_WEBHOOK_DELIVERY_BATCH_REF` batch ref — shared by two producers:\n * 1. first-time dispatch ({@link _dispatchToSiemWebhook}, org scope), and\n * 2. manual DLQ drain (the `siem-delivery-dlq` RETRY_SINGLE / RETRY_ALL\n * custom impls), which re-enqueue a dead-lettered row's STORED envelope\n * for either the ORG or APP scope.\n *\n * Keeping this in one place is not cosmetic: the delivery worker has no\n * back-reference to a DLQ row, so a retry that fails is re-captured as a\n * brand-new DLQ row. If the retry path built a subtly different payload (a\n * dropped `siemConfig` field, a stale HMAC domain), the mismatch would surface\n * only as a silently looping dead-letter — never a compile error. One seam\n * makes that class of drift impossible.\n *\n * @param params.scopeType Defaults to {@link AuthScopeType.ORGANIZATION} (the\n * first-time dispatch path is org-only). The DLQ APP variant passes\n * {@link AuthScopeType.APPLICATION} so the worker's circuit-breaker key and\n * any re-DLQ capture resolve to the application scope, not the org. NOTE: the\n * SIEM-DLQ retry custom-impl is the ONLY caller that passes `APPLICATION` today —\n * there is NO first-time app-scoped producer (the APPLICATION variant is reserved /\n * dormant; see {@link dispatchToOrganizationAuditSinks} for the full rationale and\n * the wiring a future app producer would add).\n * @param params.scopeId Defaults to `organizationId`.\n *\n * May throw on enqueue failure — the CALLER decides isolation: the dispatch\n * path swallows it per-sink (fire-and-forget, F7); the DLQ retry surfaces it to\n * the operator so the row is left intact for another attempt.\n */\n public async enqueueSiemWebhookDelivery(params: {\n envelope: SecurityAuditEventEnvelope;\n organizationId: string;\n siemConfig: SiemExportConfigBase;\n scopeType?: AuthScopeType;\n scopeId?: string;\n }): Promise<void> {\n const { envelope, organizationId, siemConfig } = params;\n const scopeType = params.scopeType ?? AuthScopeType.ORGANIZATION;\n\n // F6: HMAC integrity signature over the envelope payload — computed HERE so the\n // key/domain never diverges between the dispatch and retry producers.\n const envelopeHmac = this._computeEnvelopeHmac(envelope);\n\n // Using the shared constant keeps enqueue ↔ registration ↔ spec cross-validation\n // on one literal. The `siemConfig` projection strips the config to the transport\n // fields the worker needs (no eventFilter — filtering already happened upstream).\n await this.queueService.enqueueCustomBatch(\n SIEM_WEBHOOK_DELIVERY_BATCH_REF,\n {\n envelope,\n envelopeHmac,\n organizationId,\n scopeType,\n scopeId: params.scopeId ?? organizationId,\n siemConfig: {\n webhookUrl: siemConfig.webhookUrl,\n authMethod: siemConfig.authMethod,\n authCredential: siemConfig.authCredential,\n authHeaderName: siemConfig.authHeaderName,\n eventFormat: siemConfig.eventFormat,\n customHeaders: siemConfig.customHeaders,\n delivery: siemConfig.delivery,\n },\n },\n );\n }\n\n /**\n * Check if an event passes the org's SIEM event filter.\n */\n private _passesEventFilter(\n eventType: string,\n classification: { category: AuditEventCategory; severity: AuditEventSeverity },\n config: SiemExportConfigBase,\n ): boolean {\n const filter = config.eventFilter;\n\n // Check category filter\n if (!filter.categories.includes(classification.category)) {\n return false;\n }\n\n // Check severity minimum\n const eventSeverityOrder = SEVERITY_ORDER[classification.severity] ?? 0;\n const minimumSeverityOrder = SEVERITY_ORDER[filter.severityMinimum] ?? 0;\n if (eventSeverityOrder < minimumSeverityOrder) {\n return false;\n }\n\n // Check specific event type filter (if configured)\n if (filter.specificEventTypes && filter.specificEventTypes.length > 0) {\n if (!filter.specificEventTypes.includes(eventType)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Build a SecurityAuditEventEnvelope from an audit event.\n */\n private _buildEnvelope(\n auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>,\n organizationId: string,\n classification: { category: AuditEventCategory; severity: AuditEventSeverity },\n organizationName?: string,\n applicationId?: string,\n applicationName?: string,\n ): SecurityAuditEventEnvelope {\n const eventData = auditEvent.eventData as Record<string, unknown>;\n\n return {\n eventId: this._resolveEnvelopeEventId(auditEvent),\n eventType: auditEvent.eventType,\n eventCategory: classification.category,\n severity: classification.severity,\n timestamp: new Date().toISOString(),\n correlationId: auditEvent.correlationId,\n // Undefined unless the application opted in — the row itself is only ever populated under the policy.\n clientInstanceId: auditEvent.clientInstanceId,\n frontendServiceName: auditEvent.frontendServiceName,\n\n organizationId,\n organizationName, // F3: Populated via org name cache\n applicationId,\n applicationName,\n userId: auditEvent.userId,\n userEmail: (eventData.email as string) || undefined,\n\n sourceService: this.appConfigService.applicationId,\n sourceVersion: process.env.APP_VERSION || '0.0.0',\n sourceEnvironment: this.appConfigService.applicationEnv,\n\n // Auth-specific context from eventData (when applicable)\n authMethod: (eventData.authMethod as string) || undefined,\n authSource: (eventData.authSource as string) || undefined,\n providerRef: (eventData.providerRef as string) || undefined,\n connectionType: (eventData.connectionType as string) || undefined,\n ipAddress: (eventData.ipAddress as string) || undefined,\n userAgent: (eventData.userAgent as string) || undefined,\n\n eventData: eventData as Record<string, any>,\n\n outcome: this._inferOutcome(auditEvent.eventType),\n outcomeReason: (eventData.failureReason as string) || (eventData.reason as string) || undefined,\n };\n }\n\n /**\n * The id the DELIVERED envelope carries — the audit row's OWN `eventId`, never a freshly minted one.\n *\n * ## Why it must be the audit event's id\n *\n * `SecurityAuditEventEnvelope.eventId` is the only identifier that leaves the application on a SIEM\n * delivery, and it is doing two jobs at once:\n *\n * 1. it is what a RECEIVER deduplicates on — the delivery service's own header says \"Idempotency via\n * eventId\", and every wire format carries this one field through to the receiver's dedup key\n * (CEF `externalId`, LEEF `eventId`, OCSF `metadata.uid`, and the verbatim `json_structured` body's\n * top-level `eventId`); and\n * 2. it is the only handle an analyst has for joining a record in the customer's SIEM back to the\n * audit row it was projected from.\n *\n * Minting a fresh uuid here satisfied (1) and silently destroyed (2). The id was ALREADY on the value\n * being projected: `AuditableEvent.eventId` is minted in `AuditLogsBackendService._createAuditLog`\n * BEFORE the DB write, is documented on the schema as the \"store-agnostic, server-minted correlation\n * key\", and already joins the DB row to its immudb record and to `verifyAuditEvent(eventId)`. It\n * survives the `Omit` on this method's parameter type, so it was in hand and thrown away — the\n * envelope replaced it with an id that exists nowhere else in the system, making a delivered SIEM\n * event deduplicable but unexplainable.\n *\n * ## Why the cutover is safe — the risk this looks like it carries, it does not\n *\n * Changing what a receiver deduplicates on normally risks re-accepting events at the switch. Not here:\n * the OLD value was a per-delivery random uuid, never reused and not re-derivable from anything, so\n * every id crossing the cutover is still one no receiver has ever seen. Nothing is re-delivered and\n * nothing is newly deduped away.\n *\n * What genuinely changes is the FAN-OUT. `AuditLogsBackendService` dispatches one audit event to each\n * of the user's verified member orgs, so those N deliveries now carry ONE id instead of N. They go to\n * N different tenants' sinks, so there is no cross-receiver dedup interaction — and one id is the\n * truthful statement, because it is one event. (The DLQ row records this id too, so a dead letter is\n * now joinable to its audit row as well; `SiemDeliveryDlqBaseSchema.eventId` carries no unique index,\n * so the shared id cannot collide there.)\n *\n * Per-attempt idempotency is untouched: the envelope is built ONCE, and both the in-process retry loop\n * in `SIEMWebhookDeliveryBackendService.processDelivery` and the DLQ drain re-send that same stored\n * object — so one delivery keeps one id across every attempt, which is exactly what a receiver's dedup\n * needs.\n *\n * ## The fallback, and why it is not a hedge\n *\n * `eventId` is required on `AuditableEvent` and the sole production caller always sets it, so this\n * branch should be unreachable. It exists because the two failures are ASYMMETRIC: an absent id is not\n * merely an unjoinable delivery, it is a delivery with NO dedup key at all — every projection renders\n * the field only `if (e.eventId)`, so the receiver stores `dedupKey: null` and answers `deduped: false`\n * forever against a service that retries and drains a DLQ. Losing the join degrades an investigation;\n * losing idempotency duplicates events inside a customer's SIEM. So an absent id still gets a minted\n * one, and is logged loudly rather than shipping a blank.\n */\n private _resolveEnvelopeEventId(auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>): string {\n if (auditEvent.eventId) {\n return auditEvent.eventId;\n }\n\n const mintedEventId = uuidv4();\n this.logger.warn?.(\n 'Audit event reached SIEM dispatch with no eventId — the delivered envelope cannot be joined back to its audit row; minting a delivery-local id so receiver idempotency survives',\n { eventType: auditEvent.eventType, mintedEventId },\n );\n return mintedEventId;\n }\n\n /**\n * Infer success/failure outcome from event type.\n */\n private _inferOutcome(eventType: string): AuditEventOutcome {\n const failureEventTypes = [\n CoreAuditableEventType.USER_LOGIN_FAILED,\n CoreAuditableEventType.USER_ACCOUNT_LOCKED,\n CoreAuditableEventType.USER_SSO_LOGIN_FAILED,\n CoreAuditableEventType.USER_SSO_ENFORCEMENT_BLOCKED,\n CoreAuditableEventType.SAML_LOGIN_FAILED,\n CoreAuditableEventType.SAML_ASSERTION_REPLAY_DETECTED,\n CoreAuditableEventType.MACHINE_AUTH_FAILED,\n ];\n\n return failureEventTypes.includes(eventType as CoreAuditableEventType) ? AuditEventOutcome.FAILURE : AuditEventOutcome.SUCCESS;\n }\n\n // ─────────────────────────────────────────────────────────────\n // F3: Organization Name Cache\n // ─────────────────────────────────────────────────────────────\n\n /**\n * F3: resolve an organization NAME for SIEM-analyst readability, through the leased cache.\n *\n * Renames are picked up within {@link ORG_NAME_REFRESH_AFTER_MS} — read that constant for why this\n * lease is five minutes while the routing config's is sixty seconds. There is no invalidation hook on\n * this one, deliberately: a stale label costs a reader nothing (the `organizationId` beside it in the\n * envelope is authoritative and always current), so the lease alone is a proportionate answer.\n *\n * Never throws — a missing name is optional in the envelope, and this runs on a fire-and-forget path.\n * The loader therefore swallows its own failure and yields `undefined`, which means the COLD path of\n * {@link LeasedValueCache} can never reject here.\n *\n * **`undefined` IS cached, and that is a fix rather than an oversight.** Before this, a lookup that\n * failed or returned a nameless row cached nothing, so an organization whose read kept failing was\n * re-read on EVERY exported event — the read amplification a cache exists to prevent, arriving\n * precisely when the repository is already unhealthy. Caching the negative bounds it to one read per\n * lease, and a rename or a repaired read still lands within that lease.\n *\n * The loader closes over `ec` — the audit service's synthesised super-admin APPLICATION-scoped temp\n * context (`audit-logs.backend.service.ts:284` → `:349`), identical in privilege on every dispatch —\n * which is the precondition {@link LeasedValueCache} states for joining an in-flight load.\n */\n private async _resolveOrgName(ec: ExecutionContext<any>, organizationId: string): Promise<string | undefined> {\n return this._orgNameCache.get(organizationId, async () => {\n try {\n const orgsRepo = this.repositoriesRegistry.getRepositoryOrThrow(CoreResourceType.ORGANIZATIONS);\n const org = await orgsRepo.read<{ _id: string; name: string }>(ec, organizationId);\n return org?.name || undefined;\n } catch {\n // Fire-and-forget — org name is optional in the envelope.\n return undefined;\n }\n });\n }\n\n // ─────────────────────────────────────────────────────────────\n // F6: Event Integrity (HMAC)\n // ─────────────────────────────────────────────────────────────\n\n /**\n * F6: Compute HMAC-SHA256 over the serialized envelope for integrity protection.\n * The delivery service verifies this HMAC before processing, detecting queue tampering.\n */\n private _computeEnvelopeHmac(envelope: SecurityAuditEventEnvelope): string {\n const hmacKey = this._getHmacKey();\n return createHmac('sha256', hmacKey)\n .update(JSON.stringify(envelope))\n .digest('hex');\n }\n\n /**\n * Derive a 256-bit HMAC key from the app's session encryption key\n * using SHA-256 with a domain separator (consistent with SIEM encryption key derivation).\n */\n private _getHmacKey(): Buffer {\n return createHash('sha256')\n .update(`${SIEM_HMAC_DOMAIN}:${this.appConfigService.secrets.security.session.encryptionKey}`)\n .digest();\n }\n\n /**\n * F6: Public static-like method to verify envelope HMAC on the delivery side.\n * Returns true if the HMAC matches, false otherwise.\n */\n public verifyEnvelopeHmac(envelope: SecurityAuditEventEnvelope, expectedHmac: string): boolean {\n const computedHmac = this._computeEnvelopeHmac(envelope);\n // Use crypto.timingSafeEqual for constant-time comparison (prevents timing attacks)\n const computedBuf = Buffer.from(computedHmac, 'utf-8');\n const expectedBuf = Buffer.from(expectedHmac, 'utf-8');\n if (computedBuf.length !== expectedBuf.length) return false;\n return timingSafeEqual(computedBuf, expectedBuf);\n }\n}\n"]}
1
+ {"version":3,"file":"audit-event-dispatcher.backend.service.js","sourceRoot":"","sources":["../../../../../src/compliance/audit-trails/services/audit-event-dispatcher.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;;;;;;;;;;;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,uBAA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,oCAAoC,CAAC,CAAA;IAC/D,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAS7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;qCAbQ,aAAa;QACO,uBAAuB;QACH,oCAAoC;QACzD,mBAAmB;QACI,yCAAyC;GAjDtI,kCAAkC,CAmuB9C","sourcesContent":["/**\n * Audit Event Dispatcher Backend Service\n *\n * Layer 2 of the three-layer audit event pipeline (Step 18).\n * Receives audit events after MongoDB write and dispatches them\n * to the organization's SIEM endpoint if configured.\n *\n * This is fire-and-forget — if dispatch fails, the audit log\n * in MongoDB remains authoritative.\n */\n\nimport 'reflect-metadata';\nimport { inject, injectable, optional } from 'inversify';\nimport type { RedisClientType } from 'redis';\nimport { v4 as uuidv4 } from 'uuid';\nimport { createHmac, createHash, timingSafeEqual } from 'crypto';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { AuthOrganizationConfigurationService } from '~wildo-backend-lib/security/authentications/services/admin-config/auth-organization-configuration.service';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { QueueBackendService } from '~wildo-backend-lib/queue/queue.backend.service';\nimport { LeasedValueCache } from '~wildo-backend-lib/compliance/audit-trails/services/utils/leased-value-cache.backend.utils';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { SIEM_WEBHOOK_DELIVERY_BATCH_REF } from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport {\n AuditEventOutcome,\n CoreAuditableEventType,\n CoreResourceType,\n getAuditEventClassification,\n type SecurityAuditEventEnvelope,\n type AuditEventCategory,\n type AuditEventSeverity,\n type AuditableEvent,\n type SiemExportConfigBase,\n AuthScopeType,\n} from '@wildo-ai/saas-models';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport type { RedisService } from '~wildo-backend-lib/databases/services/redis.service';\n\n/** F6: HMAC domain separator for event integrity */\nconst SIEM_HMAC_DOMAIN = 'wildo:siem:event-integrity:v1';\n\n/**\n * **A SIEM export configuration change takes effect on EVERY replica within 60 seconds — and within\n * milliseconds when the change goes through the engine.**\n *\n * That sentence is the guarantee this subsystem makes, and the two halves come from two different\n * mechanisms, so read both before changing either.\n *\n * ## Why the number is 60 seconds, and why it used to be 300\n *\n * The lease is the ONLY thing that covers a write no hook can see — a repository-tier write, or a\n * direct database write. There is a live one: `examples/wonder-todos/e2e/adapter.ts` (`case 'siem'`)\n * repoints an organization's export config with `upsertOrganizationSingleton(...)`, straight at the\n * store, bypassing the engine entirely. Its own comment records what the old 300 s cost — *\"A freshly\n * provisioned org has a cold 5-min config cache, so the first login cold-reads this\"* — i.e. the lane\n * is correct only because it is ORDERED to run before the organization's first audited action. A\n * five-minute convergence bound is not something a scenario, or an operator doing surgery, can wait\n * for; it is something they have to design around. Sixty seconds is something they can wait for.\n *\n * The old 300 s was never chosen for that job — it was chosen to bound READ AMPLIFICATION, because a\n * miss costs more than a repository read: `AuthOrganizationConfigurationService.loadSiemExportConfig`\n * reads through `readAsSystem`, which emits its own `system_context_read` audit row to the database\n * AND to immudb. So shortening the lease multiplies audit-trail plumbing noise, not just queries.\n * Two properties make 60 s affordable anyway:\n *\n * - **Refreshes are LAZY and STALE-WHILE-REVALIDATE** ({@link LeasedValueCache}). A quiet organization\n * costs one read per event, not one per minute; only a continuously busy one reaches the ceiling of\n * one read per lease per replica. At 60 s that ceiling is 60 reads/hour/replica per ACTIVE\n * organization — for an organization emitting 1000 audit events an hour, under 5 % amplification of\n * its own audit volume, against 12/hour before.\n * - **Nothing blocks on it.** Past the lease the cached value is served immediately and the re-read\n * runs off the emission path, so shortening it costs read volume and never latency.\n *\n * ## The other half: the engine-routed write converges in milliseconds\n *\n * {@link AuditEventDispatcherBackendService.invalidateSiemConfig} drops the local entry AND publishes\n * the organization id on {@link SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX}, which every replica\n * subscribes to. Before that broadcast the invalidation reached exactly ONE process — the one that\n * happened to handle the write — and every other replica served the stale value for the rest of the\n * lease, which is the defect this constant's neighbours document.\n *\n * **Do not raise this back toward the read-amplification number.** If the amplification ever needs to\n * come down, the right lever is the `system_context_read` row on the config read itself:\n * `SystemAccessBackendService.readAsSystem` already takes `suppressSystemAudit`, and its own JSDoc\n * names this exact read — *\"the audit pipeline resolving … an org's SIEM config to ROUTE an audit\n * event\"* — as the case it exists for. `loadSiemExportConfig` is the one such reader that does not\n * pass it. Fixing that makes a miss cost a single indexed read and removes the constraint entirely.\n */\nexport const SIEM_CONFIG_REFRESH_AFTER_MS = 60 * 1000;\n/** R2: Max entries in the SIEM-config cache to prevent unbounded growth. Least-recently-used is evicted. */\nconst SIEM_CONFIG_CACHE_MAX_SIZE = 1000;\n\n/**\n * F3: how long a cached organization NAME is served before a background re-read.\n *\n * Deliberately NOT the same constant as {@link SIEM_CONFIG_REFRESH_AFTER_MS}, though the mechanism is\n * now shared. A stale name is a stale LABEL on an exported envelope — the `organizationId` beside it\n * is authoritative and unaffected, so a rename showing up late is cosmetic. A stale export config\n * decides whether the event is routed AT ALL. Same defect shape, different consequence class, so they\n * get the same machinery and their own numbers: five minutes buys back the read volume that the\n * config's sixty seconds spends, and nothing depends on a rename propagating faster.\n */\nconst ORG_NAME_REFRESH_AFTER_MS = 5 * 60 * 1000;\n/** B4: Max entries in org name cache to prevent unbounded growth. Least-recently-used is evicted. */\nconst ORG_NAME_CACHE_MAX_SIZE = 1000;\n\n/**\n * The Redis channel carrying cross-replica SIEM-config invalidations. App-prefixed at use, so tenants\n * of one Redis never cross — the convention {@link RedisService.getAppPrefix} exists for.\n *\n * Broadcast rather than a shared cache, and the distinction is the whole design: the emission path\n * never touches Redis, so a Redis outage degrades convergence to the lease instead of degrading\n * ROUTING. A shared-store cache would have put a network round trip on the path an audit event takes\n * and made delivery depend on a store that can be down.\n */\nconst SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX = 'audit:siem-export-config:invalidate';\n\n/** Severity ordering for minimum severity filtering */\nconst SEVERITY_ORDER: Record<string, number> = {\n 'info': 0,\n 'warning': 1,\n 'critical': 2,\n};\n\n/**\n * The per-org audit sink TYPES an organization can route its authenticated audit\n * events to. Today the only type is the SIEM webhook. Adding a per-org destination\n * later (e.g. per-org immudb, per observability §11) is a new member HERE + a branch\n * in `_resolveOrgAuditSinks` + a `case` in `dispatchToOrganizationAuditSinks` — the F4\n * routing (org from the authenticated EC) and the envelope/HMAC contracts do not change.\n */\nexport const PerOrgAuditSinkType = {\n SIEM_WEBHOOK: 'siem_webhook',\n} as const;\nexport type PerOrgAuditSinkType = (typeof PerOrgAuditSinkType)[keyof typeof PerOrgAuditSinkType];\n\n/**\n * A per-org audit sink RESOLVED for a specific org, carrying exactly the config needed\n * to deliver one event to it. A discriminated union (one member today) — the dispatcher\n * fans out by `type`, so a new sink type extends this union rather than reshaping callers.\n */\ntype ResolvedOrgAuditSink = {\n type: typeof PerOrgAuditSinkType.SIEM_WEBHOOK;\n siemConfig: SiemExportConfigBase;\n};\n\n@injectable()\nexport class AuditEventDispatcherBackendService {\n private readonly logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n /**\n * F3: org NAME cache — a display label on the envelope. See {@link ORG_NAME_REFRESH_AFTER_MS}.\n *\n * No `onRefreshFailure`, and it would be dead code if there were one: {@link _resolveOrgName}'s loader\n * swallows its own error and yields `undefined`, so nothing this cache runs can ever reject. That\n * swallow is what makes the negative result CACHEABLE, which is the amplification fix described there;\n * the price is that a persistently unreadable organization row is silent, which is the right trade for\n * an optional label whose authoritative sibling (`organizationId`) is on the envelope regardless.\n */\n private readonly _orgNameCache = new LeasedValueCache<string | undefined>({\n refreshAfterMs: ORG_NAME_REFRESH_AFTER_MS,\n maxEntries: ORG_NAME_CACHE_MAX_SIZE,\n });\n\n /** R2: per-org SIEM-config cache — the value that decides ROUTING. See {@link SIEM_CONFIG_REFRESH_AFTER_MS}. */\n private readonly _siemConfigCache = new LeasedValueCache<SiemExportConfigBase | null>({\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n maxEntries: SIEM_CONFIG_CACHE_MAX_SIZE,\n onRefreshFailure: (organizationId, error) =>\n // ERROR, not WARN, and the asymmetry with the org-name cache above is the point: while this keeps\n // failing the replica is routing on a configuration nobody can confirm, so the guarantee stated on\n // `SIEM_CONFIG_REFRESH_AFTER_MS` is suspended for this organization. Backed off one lease by the\n // cache, so a persistently unreadable config produces one line a minute, not one an event.\n this.logger.error?.('Background refresh of an organization SIEM export config failed — routing continues on the LAST KNOWN config for this replica', {\n organizationId,\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n ...projectCaughtErrorLogFields(error),\n }),\n });\n\n /**\n * Latch so {@link _ensureInvalidationSubscriber} is idempotent; cleared on `end` so a dropped\n * subscriber re-arms.\n *\n * Deliberately the ONLY subscriber state kept. `A2ATaskCancellationBackendService` also holds the\n * client itself, because it has a shutdown path that closes it; this service has none, and a field\n * nothing reads is a field the next reader has to reason about for nothing. The socket keeps the\n * subscriber alive on its own, and a connection that emitted `end` is already closed.\n */\n private _invalidationSubscribeStarted = false;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private readonly appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.AuthOrganizationConfigurationService) private readonly orgConfigService: AuthOrganizationConfigurationService,\n @inject(SAAS_SERVICE_TYPES.QueueBackendService) private readonly queueService: QueueBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n /**\n * `@optional()` and APPENDED LAST — the constructor-parameter discipline.\n *\n * Optional because the cross-replica broadcast is an OPTIMISATION over the lease, never a\n * precondition for routing: a container with no Redis binding (several partial test containers, and\n * any single-replica deployment) must still dispatch audit events, converging on the lease alone.\n * Appended last so the five existing construction sites keep compiling unchanged.\n */\n @inject(SAAS_SERVICE_TYPES.RedisService) @optional() private readonly redisService?: RedisService,\n ) {\n this.logDebug = this.logger.debugByType('AuditEventDispatcherBackendService');\n this.logger.setDebugTypeLogging('AuditEventDispatcherBackendService', false);\n }\n\n /**\n * Dispatch an audit event to the organization's configured per-org audit SINKS.\n *\n * F4 (tenant segregation): the caller (`AuditLogsBackendService`) passes the\n * AUTHENTICATED org (resolved from the request `ExecutionContext`), NEVER the\n * caller-supplied `auditEvent.organizationId`. Sink config is loaded for THIS org\n * only (`_resolveOrgAuditSinks`), so an event can only reach the sinks of the tenant\n * it is authenticated for.\n *\n * Layer 2 of the pipeline: called after the MongoDB write (Layer 1), wired directly\n * into `AuditLogsBackendService` (NOT a resource pipeline post-hook). Fire-and-forget\n * — a resolution or per-sink delivery failure is logged but NEVER thrown onto the\n * business op, and per-sink failures are ISOLATED (F7) so one destination never\n * suppresses another.\n *\n * The seam: `_resolveOrgAuditSinks` returns the 0..N sinks the org has configured\n * (today only a SIEM webhook); this method fans each out by its `type`. Adding a\n * per-org destination later = a new {@link PerOrgAuditSinkType} + a resolver branch +\n * a `case` here.\n *\n * ── APPLICATION scope is RESERVED / DORMANT — there is NO app-scoped producer ──────\n * This producer is ORGANIZATION-scoped ONLY, on purpose. The F4 model routes on a\n * TRUSTED authenticated *tenant* (org), and the sole caller (`AuditLogsBackendService`)\n * fans out over the event's verified member orgs. There is deliberately no\n * `dispatchToApplicationAuditSinks` / `_resolveAppAuditSinks`.\n *\n * The SIEM export-config and delivery-DLQ resources DO each carry an `APPLICATION`\n * polymorphic variant (uniform with SSO/SCIM over `AUTH_SCOPE_VARIANTS`), and every\n * downstream seam is already scope-generic: `loadSiemExportConfig(ec, APPLICATION, appId)`,\n * {@link enqueueSiemWebhookDelivery} (`scopeType`/`scopeId`), the delivery worker's\n * circuit-breaker key, and `_enqueueToDLQ`'s `APPLICATION_SIEM_DELIVERY_DLQ` branch all\n * accept the app scope. But NOTHING emits a first-time app-scoped delivery. The only\n * caller that passes `scopeType: APPLICATION` today is the SIEM-DLQ *retry* custom-impl,\n * which is itself unreachable in production: an `APPLICATION_SIEM_DELIVERY_DLQ` row can\n * only be born from a FAILED app-scoped delivery — and none is ever produced — so the\n * app config-read, app DLQ, and app retry are mutually reachable only through each other.\n * NOTE the operator-visible trap this leaves: an app super-admin CAN enable\n * `APPLICATION_SIEM_EXPORT_CONFIG` (its own custom-impl + APP_ADMIN_SUPER_ADMIN roles)\n * and it will silently deliver NOTHING until a producer exists.\n *\n * To make it real — a SCOPED feature, NOT a mechanical mirror; settle the design fork\n * FIRST (which events an app SIEM receives, whether spanning all tenants, and how it\n * composes with per-org delivery so an event is not double-sent) — add a sibling\n * `_resolveAppAuditSinks(ec, appId)` loading the APP config, a\n * `dispatchToApplicationAuditSinks` fanning out identically, and a producer that calls it\n * with an app context, reusing the SAME envelope/HMAC/scope contract via\n * `enqueueSiemWebhookDelivery({ scopeType: AuthScopeType.APPLICATION, scopeId })`. Until\n * then, treat the APP variant as reserved plumbing, not a wired path.\n */\n public async dispatchToOrganizationAuditSinks(\n ec: ExecutionContext<any>,\n auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>,\n organizationId: string,\n ): Promise<void> {\n // No authenticated org → no per-org dispatch (fail-closed, F4).\n if (!organizationId) return;\n\n // Arm the fleet invalidation subscriber on first use, so nothing has to order it at startup. Never\n // awaited: it performs a Redis duplicate + connect + subscribe on the first dispatch, and this\n // event must not wait for it. The window it leaves — one connect — is bounded by the lease, which\n // is what covers every un-broadcast change anyway.\n void this._ensureInvalidationSubscriber();\n\n let sinks: ResolvedOrgAuditSink[];\n try {\n sinks = await this._resolveOrgAuditSinks(ec, organizationId);\n } catch (error) {\n // Fire-and-forget: a config-resolution failure must never throw onto the business op.\n this.logger.error?.('Failed to resolve org audit sinks', {\n error,\n eventType: auditEvent.eventType,\n organizationId,\n });\n return;\n }\n\n for (const sink of sinks) {\n try {\n switch (sink.type) {\n case PerOrgAuditSinkType.SIEM_WEBHOOK:\n await this._dispatchToSiemWebhook(ec, auditEvent, organizationId, sink.siemConfig);\n break;\n default:\n // F-1 safety net: a future `PerOrgAuditSinkType` member with no `case` above is\n // LOGGED, never silently dropped (the original finding was a silent no-op). A\n // single-member discriminated union does NOT narrow this `default` to `never`, so\n // a compile-time `assertNever(sink)` guard only becomes possible once a 2nd sink\n // type exists — convert this branch to it then. Until then the resolver's +\n // switch's JSDoc pointers (\"add a case here\") + this warn are the guard.\n this.logger.warn?.(\n 'Unhandled per-org audit sink type — event NOT delivered to this sink; add a `case` in dispatchToOrganizationAuditSinks',\n { sinkType: sink.type, eventType: auditEvent.eventType, organizationId },\n );\n break;\n }\n } catch (error) {\n // Per-sink isolation (F7): one org sink failing never affects the others.\n this.logger.error?.('Failed to dispatch audit event to an org audit sink', {\n error,\n sinkType: sink.type,\n eventType: auditEvent.eventType,\n organizationId,\n });\n }\n }\n }\n\n /**\n * Resolve the per-org audit SINKS an org has configured — the 0..N destinations\n * {@link dispatchToOrganizationAuditSinks} fans an event out to. Keyed on the org the\n * caller already validated as authenticated (F4). Today the only per-org sink type is\n * the SIEM webhook; a future per-org destination appends its own descriptor HERE.\n *\n * Two-level feature gate for `CoreFeature.SECURITY_EVENT_EXPORT`:\n * Level 1 (here): `siemConfig.enabled` — the runtime gate.\n * Level 2 (admin API): `FeatureGateService` checks the org's subscription tier has\n * `SECURITY_EVENT_EXPORT` before allowing `enabled = true`. We cannot use\n * `FeatureResolutionService` here (fire-and-forget context; internal ECs bypass\n * feature resolution), so the pre-validated `enabled` flag IS the per-org gate.\n */\n private async _resolveOrgAuditSinks(\n ec: ExecutionContext<any>,\n organizationId: string,\n ): Promise<ResolvedOrgAuditSink[]> {\n const sinks: ResolvedOrgAuditSink[] = [];\n\n const siemConfig = await this._loadSiemConfigCached(ec, organizationId);\n if (siemConfig?.enabled) {\n sinks.push({ type: PerOrgAuditSinkType.SIEM_WEBHOOK, siemConfig });\n }\n\n // Future per-org sink types (e.g. per-org immudb) resolve here — each appends its\n // own descriptor; the dispatcher switch fans out by `type`.\n return sinks;\n }\n\n /**\n * R2: load the org's SIEM config through the leased cache.\n *\n * Without a cache, {@link _resolveOrgAuditSinks} reads the config via a self-elevating `readAsSystem`\n * PER EVENT PER ORG — and `readAsSystem` ALSO emits a `SYSTEM_CONTEXT_READ` audit — so every routed\n * audit event (× N orgs on the multi-org fan-out) doubled the audit-write volume to the DB + immudb.\n * `null` is cached too (an org whose config load failed) so a non-configured org is not re-read every\n * event.\n *\n * The cache is STALE-WHILE-REVALIDATE ({@link LeasedValueCache}), so only the very first event for an\n * organization waits on a read; every later one is served from memory while the refresh runs off this\n * path. That is what lets {@link SIEM_CONFIG_REFRESH_AFTER_MS} be sixty seconds rather than five\n * minutes — read the guarantee stated there before changing it.\n *\n * The loader closes over `ec`, which is the audit service's synthesised super-admin APPLICATION-scoped\n * temp context (`audit-logs.backend.service.ts:284`, handed here at `:349`) and is therefore equally\n * privileged on every call — the precondition {@link LeasedValueCache} states for joining an in-flight\n * load. `loadSiemExportConfig` in fact ignores `ec` entirely (`void ec`) and reads system-context.\n */\n private async _loadSiemConfigCached(\n ec: ExecutionContext<any>,\n organizationId: string,\n ): Promise<SiemExportConfigBase | null> {\n return this._siemConfigCache.get(organizationId, () =>\n this.orgConfigService.loadSiemExportConfig(ec, AuthScopeType.ORGANIZATION, organizationId),\n );\n }\n\n /**\n * Drop one organization's cached SIEM config so the NEXT event re-reads it.\n *\n * ## Why this exists\n *\n * Without it the cache had no invalidation at all — only the 5-minute TTL and the size-1000\n * FIFO — so enabling a sink left the organization's events unrouted for up to that window, and\n * audit events are not replayed. The ENABLE direction is the sharp one: `null` is cached\n * deliberately (see {@link _loadSiemConfigCached}) and `null` is exactly the state an\n * organization is in the moment before it first configures a sink, so the first five minutes of\n * a newly-pointed SIEM were silently empty.\n *\n * ## Where it is called from, and why not from the config service\n *\n * From a postfix hook on the SIEM-export-config RESOURCE\n * (`siem-export-config-cache-invalidation.custom-impl.backend.service.ts`), not from\n * `AuthOrganizationConfigurationService.saveSiemExportConfig`.\n *\n * That service was the obvious call site and it is the WRONG one: it is only one of the writers.\n * The config is an ordinary resource, so an update also lands through\n * `ServicesRegistryHandler.update` on `organizationSiemExportConfig` directly. Hooking the\n * service would have applied the invariant at one of two call sites, which is the defect shape\n * `.claude/rules/invariant-call-site-enumeration.md` exists to stop. The resource operation is\n * the chokepoint BOTH writers pass through — `saveSiemExportConfig` itself dispatches its write\n * via `ServicesRegistryHandler`, so covering the resource covers it for free.\n *\n * Note `saveSiemExportConfig` separately refreshes its OWN `siemExportConfigs` map. That is a\n * different cache in a different service and was never the one deciding routing.\n *\n * ## Semantics\n *\n * Deleting the entry rather than overwriting it: the next read goes to the repository, so this\n * cannot install a wrong value, only force a re-read. Idempotent, and a no-op for an\n * organization with no entry — which is the common case, since only organizations that have\n * raised an audit event since the last eviction are in the map at all. Synchronous and\n * infallible on purpose, so the caller needs no error handling.\n *\n * ## It reaches EVERY replica, which it did not before\n *\n * The local drop above is only ever correct for ONE process — the one that happened to handle the\n * write. With N replicas behind a load balancer, the other N-1 went on serving the pre-write config\n * for the rest of the lease, so \"the invalidation covers engine-routed writes\" was true of a single\n * instance and false of every real deployment. The broadcast closes that: the organization id goes\n * out on {@link SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX} and every replica's subscriber drops its own\n * entry within milliseconds.\n *\n * The publish is fire-and-forget and cannot fail this call: a broadcast that does not go out degrades\n * the OTHER replicas to the lease, which is exactly where they were before, and refusing a\n * configuration write to protect a cache would invert the priority. This method's synchronous,\n * infallible contract therefore still holds for its caller.\n *\n * **What it still does NOT cover, and cannot.** A write that never reaches the service tier — a\n * repository-tier write, or a direct database write like `examples/wonder-todos/e2e/adapter.ts`'s\n * `upsertOrganizationSingleton('organizationSiemExportConfig', …)` — raises no postfix hook, so\n * nothing calls this and nothing is broadcast. For those the lease is the entire guarantee; that is\n * why it is chosen and argued at {@link SIEM_CONFIG_REFRESH_AFTER_MS} rather than left incidental.\n */\n public invalidateSiemConfig(organizationId: string): void {\n this._siemConfigCache.invalidate(organizationId);\n this._publishSiemConfigInvalidation(organizationId);\n }\n\n /**\n * Tell the rest of the fleet to drop this organization's cached SIEM config.\n *\n * Returns nothing and awaits nothing — the caller is a postfix write hook whose contract is that it\n * cannot fail the write it follows.\n */\n private _publishSiemConfigInvalidation(organizationId: string): void {\n const client = this.redisService?.getReadyClient();\n // A not-ready client is the normal state wherever Redis is unconfigured (single-replica, local dev,\n // several test containers). It is not an error: the local drop already happened, and there is no\n // other replica to tell.\n if (!client) return;\n\n void client\n .publish(this._invalidationChannel(), organizationId)\n .catch((error: unknown) =>\n this.logger.error?.('Failed to broadcast a SIEM export config invalidation — other replicas converge on the lease instead', {\n organizationId,\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n ...projectCaughtErrorLogFields(error),\n }),\n );\n }\n\n /** App-prefixed so two applications sharing one Redis never invalidate each other's caches. */\n private _invalidationChannel(): string {\n return `${this.redisService?.getAppPrefix() ?? ''}${SIEM_CONFIG_INVALIDATION_CHANNEL_SUFFIX}`;\n }\n\n /**\n * Arm this replica's single subscriber to the invalidation channel. Idempotent.\n *\n * Called (never awaited) from {@link dispatchToOrganizationAuditSinks}, so no startup ordering is\n * required and nothing has to be wired in `start-application` — the same lazy-arm pattern\n * `A2ATaskCancellationBackendService.ensureSubscriber` uses, for the same reason.\n *\n * Fails OPEN by design: a replica that cannot subscribe still routes audit events, converging on the\n * lease instead of on the broadcast. The failure is logged at ERROR because a persistent one silently\n * returns that replica to the per-process behaviour this mechanism exists to remove.\n *\n * Two details are copied deliberately rather than reinvented, because each was a recorded defect in\n * the A2A original: the `end` handler RE-ARMS (a subscriber that connected and then dropped — a Redis\n * restart, a failover, an idle reap — otherwise stayed dead for the life of the process while every\n * other signal looked healthy), and the catch DESTROYS a half-built connection (`connect()` can\n * succeed while `subscribe()` throws, and retrying without destroying leaks one socket per attempt).\n */\n private async _ensureInvalidationSubscriber(): Promise<void> {\n if (this._invalidationSubscribeStarted) return;\n this._invalidationSubscribeStarted = true;\n\n const client = this.redisService?.getReadyClient();\n if (!client) {\n // Not an error: no Redis means no other replica to hear from. Latched so this is decided once.\n this.logDebug('Redis unavailable — cross-replica SIEM-config invalidation is disabled for this replica');\n return;\n }\n\n let subscriber: RedisClientType | undefined;\n try {\n // `node-redis` forbids ordinary commands on a subscribed connection, so this MUST be a duplicate\n // rather than the shared client.\n subscriber = client.duplicate() as RedisClientType;\n subscriber.on('error', (error: unknown) =>\n this.logger.error?.('SIEM-config invalidation subscriber error', { ...projectCaughtErrorLogFields(error) }),\n );\n subscriber.on('end', () => {\n this.logger.warn?.('SIEM-config invalidation subscriber closed; re-arming so the next dispatch rebuilds it');\n this._invalidationSubscribeStarted = false;\n });\n await subscriber.connect();\n await subscriber.subscribe(this._invalidationChannel(), (organizationId: string) => {\n // Local drop only — never a re-publish, or one write would loop the fleet forever.\n this._siemConfigCache.invalidate(organizationId);\n this.logDebug('Dropped a cached SIEM export config on a fleet invalidation', { organizationId });\n });\n } catch (error) {\n if (subscriber) {\n try {\n await subscriber.destroy();\n } catch {\n /* already dead — nothing to reclaim */\n }\n }\n this._invalidationSubscribeStarted = false; // allow a later dispatch to retry\n this.logger.error?.('Failed to subscribe to the SIEM-config invalidation channel — this replica converges on the lease only', {\n refreshAfterMs: SIEM_CONFIG_REFRESH_AFTER_MS,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n /**\n * Deliver one event to an org's SIEM webhook sink: apply the sink's per-event filter,\n * build + HMAC the envelope, and enqueue for async delivery via the SIEM webhook\n * delivery worker (`siemWebhookDeliveryBatchService`, registered under\n * `SIEM_WEBHOOK_DELIVERY_BATCH_REF` in `start-application`). May throw; the caller\n * isolates per-sink failures.\n */\n private async _dispatchToSiemWebhook(\n ec: ExecutionContext<any>,\n auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>,\n organizationId: string,\n siemConfig: SiemExportConfigBase,\n ): Promise<void> {\n // Classify the event (always returns a value; defaults to data_access/info for unknown types)\n const classification = getAuditEventClassification(auditEvent.eventType);\n\n // Apply the sink's per-event filter\n if (!this._passesEventFilter(auditEvent.eventType, classification, siemConfig)) {\n this.logDebug('Event filtered out by SIEM config', {\n eventType: auditEvent.eventType,\n organizationId,\n });\n return;\n }\n\n // F3: Resolve org name for SIEM analyst readability\n const orgName = await this._resolveOrgName(ec, organizationId);\n\n // Extract application context from eventData if available\n const appId = (auditEvent.eventData as Record<string, unknown>)?.applicationId as string | undefined;\n const appName = (auditEvent.eventData as Record<string, unknown>)?.applicationName as string | undefined;\n\n // Build the envelope (F3: includes orgName, Task 3.12c: includes app context)\n const envelope = this._buildEnvelope(auditEvent, organizationId, classification, orgName, appId, appName);\n\n // Enqueue for async delivery through the single job-contract seam\n // (payload shape + F6 envelope HMAC + batch ref). This dispatch path is\n // org-scoped; {@link enqueueSiemWebhookDelivery} defaults scopeType/scopeId to\n // the organization, so behaviour is unchanged.\n await this.enqueueSiemWebhookDelivery({ envelope, organizationId, siemConfig });\n\n this.logDebug('Audit event enqueued for SIEM delivery', {\n eventId: envelope.eventId,\n eventType: auditEvent.eventType,\n organizationId,\n });\n }\n\n /**\n * Enqueue ONE already-built envelope for async SIEM webhook delivery.\n *\n * The SINGLE authority for the SIEM delivery-job contract — the\n * {@link SIEMDeliveryJobPayload} shape, the F6 envelope HMAC, and the\n * `SIEM_WEBHOOK_DELIVERY_BATCH_REF` batch ref — shared by two producers:\n * 1. first-time dispatch ({@link _dispatchToSiemWebhook}, org scope), and\n * 2. manual DLQ drain (the `siem-delivery-dlq` RETRY_SINGLE / RETRY_ALL\n * custom impls), which re-enqueue a dead-lettered row's STORED envelope\n * for either the ORG or APP scope.\n *\n * Keeping this in one place is not cosmetic: the delivery worker has no\n * back-reference to a DLQ row, so a retry that fails is re-captured as a\n * brand-new DLQ row. If the retry path built a subtly different payload (a\n * dropped `siemConfig` field, a stale HMAC domain), the mismatch would surface\n * only as a silently looping dead-letter — never a compile error. One seam\n * makes that class of drift impossible.\n *\n * @param params.scopeType Defaults to {@link AuthScopeType.ORGANIZATION} (the\n * first-time dispatch path is org-only). The DLQ APP variant passes\n * {@link AuthScopeType.APPLICATION} so the worker's circuit-breaker key and\n * any re-DLQ capture resolve to the application scope, not the org. NOTE: the\n * SIEM-DLQ retry custom-impl is the ONLY caller that passes `APPLICATION` today —\n * there is NO first-time app-scoped producer (the APPLICATION variant is reserved /\n * dormant; see {@link dispatchToOrganizationAuditSinks} for the full rationale and\n * the wiring a future app producer would add).\n * @param params.scopeId Defaults to `organizationId`.\n *\n * May throw on enqueue failure — the CALLER decides isolation: the dispatch\n * path swallows it per-sink (fire-and-forget, F7); the DLQ retry surfaces it to\n * the operator so the row is left intact for another attempt.\n */\n public async enqueueSiemWebhookDelivery(params: {\n envelope: SecurityAuditEventEnvelope;\n organizationId: string;\n siemConfig: SiemExportConfigBase;\n scopeType?: AuthScopeType;\n scopeId?: string;\n }): Promise<void> {\n const { envelope, organizationId, siemConfig } = params;\n const scopeType = params.scopeType ?? AuthScopeType.ORGANIZATION;\n\n // F6: HMAC integrity signature over the envelope payload — computed HERE so the\n // key/domain never diverges between the dispatch and retry producers.\n const envelopeHmac = this._computeEnvelopeHmac(envelope);\n\n // Using the shared constant keeps enqueue ↔ registration ↔ spec cross-validation\n // on one literal. The `siemConfig` projection strips the config to the transport\n // fields the worker needs (no eventFilter — filtering already happened upstream).\n await this.queueService.enqueueCustomBatch(\n SIEM_WEBHOOK_DELIVERY_BATCH_REF,\n {\n envelope,\n envelopeHmac,\n organizationId,\n scopeType,\n scopeId: params.scopeId ?? organizationId,\n siemConfig: {\n webhookUrl: siemConfig.webhookUrl,\n authMethod: siemConfig.authMethod,\n authCredential: siemConfig.authCredential,\n authHeaderName: siemConfig.authHeaderName,\n eventFormat: siemConfig.eventFormat,\n customHeaders: siemConfig.customHeaders,\n delivery: siemConfig.delivery,\n },\n },\n );\n }\n\n /**\n * Check if an event passes the org's SIEM event filter.\n */\n private _passesEventFilter(\n eventType: string,\n classification: { category: AuditEventCategory; severity: AuditEventSeverity },\n config: SiemExportConfigBase,\n ): boolean {\n const filter = config.eventFilter;\n\n // Check category filter\n if (!filter.categories.includes(classification.category)) {\n return false;\n }\n\n // Check severity minimum\n const eventSeverityOrder = SEVERITY_ORDER[classification.severity] ?? 0;\n const minimumSeverityOrder = SEVERITY_ORDER[filter.severityMinimum] ?? 0;\n if (eventSeverityOrder < minimumSeverityOrder) {\n return false;\n }\n\n // Check specific event type filter (if configured)\n if (filter.specificEventTypes && filter.specificEventTypes.length > 0) {\n if (!filter.specificEventTypes.includes(eventType)) {\n return false;\n }\n }\n\n return true;\n }\n\n /**\n * Build a SecurityAuditEventEnvelope from an audit event.\n */\n private _buildEnvelope(\n auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>,\n organizationId: string,\n classification: { category: AuditEventCategory; severity: AuditEventSeverity },\n organizationName?: string,\n applicationId?: string,\n applicationName?: string,\n ): SecurityAuditEventEnvelope {\n const eventData = auditEvent.eventData as Record<string, unknown>;\n\n return {\n eventId: this._resolveEnvelopeEventId(auditEvent),\n eventType: auditEvent.eventType,\n eventCategory: classification.category,\n severity: classification.severity,\n timestamp: new Date().toISOString(),\n correlationId: auditEvent.correlationId,\n // Undefined unless the application opted in — the row itself is only ever populated under the policy.\n clientInstanceId: auditEvent.clientInstanceId,\n frontendServiceName: auditEvent.frontendServiceName,\n\n organizationId,\n organizationName, // F3: Populated via org name cache\n applicationId,\n applicationName,\n userId: auditEvent.userId,\n userEmail: (eventData.email as string) || undefined,\n\n sourceService: this.appConfigService.applicationId,\n sourceVersion: process.env.APP_VERSION || '0.0.0',\n sourceEnvironment: this.appConfigService.applicationEnv,\n\n // Auth-specific context from eventData (when applicable)\n authMethod: (eventData.authMethod as string) || undefined,\n authSource: (eventData.authSource as string) || undefined,\n providerRef: (eventData.providerRef as string) || undefined,\n connectionType: (eventData.connectionType as string) || undefined,\n ipAddress: (eventData.ipAddress as string) || undefined,\n userAgent: (eventData.userAgent as string) || undefined,\n\n eventData: eventData as Record<string, any>,\n\n outcome: this._inferOutcome(auditEvent.eventType),\n outcomeReason: (eventData.failureReason as string) || (eventData.reason as string) || undefined,\n };\n }\n\n /**\n * The id the DELIVERED envelope carries — the audit row's OWN `eventId`, never a freshly minted one.\n *\n * ## Why it must be the audit event's id\n *\n * `SecurityAuditEventEnvelope.eventId` is the only identifier that leaves the application on a SIEM\n * delivery, and it is doing two jobs at once:\n *\n * 1. it is what a RECEIVER deduplicates on — the delivery service's own header says \"Idempotency via\n * eventId\", and every wire format carries this one field through to the receiver's dedup key\n * (CEF `externalId`, LEEF `eventId`, OCSF `metadata.uid`, and the verbatim `json_structured` body's\n * top-level `eventId`); and\n * 2. it is the only handle an analyst has for joining a record in the customer's SIEM back to the\n * audit row it was projected from.\n *\n * Minting a fresh uuid here satisfied (1) and silently destroyed (2). The id was ALREADY on the value\n * being projected: `AuditableEvent.eventId` is minted in `AuditLogsBackendService._createAuditLog`\n * BEFORE the DB write, is documented on the schema as the \"store-agnostic, server-minted correlation\n * key\", and already joins the DB row to its immudb record and to `verifyAuditEvent(eventId)`. It\n * survives the `Omit` on this method's parameter type, so it was in hand and thrown away — the\n * envelope replaced it with an id that exists nowhere else in the system, making a delivered SIEM\n * event deduplicable but unexplainable.\n *\n * ## Why the cutover is safe — the risk this looks like it carries, it does not\n *\n * Changing what a receiver deduplicates on normally risks re-accepting events at the switch. Not here:\n * the OLD value was a per-delivery random uuid, never reused and not re-derivable from anything, so\n * every id crossing the cutover is still one no receiver has ever seen. Nothing is re-delivered and\n * nothing is newly deduped away.\n *\n * What genuinely changes is the FAN-OUT. `AuditLogsBackendService` dispatches one audit event to each\n * of the user's verified member orgs, so those N deliveries now carry ONE id instead of N. They go to\n * N different tenants' sinks, so there is no cross-receiver dedup interaction — and one id is the\n * truthful statement, because it is one event. (The DLQ row records this id too, so a dead letter is\n * now joinable to its audit row as well; `SiemDeliveryDlqBaseSchema.eventId` carries no unique index,\n * so the shared id cannot collide there.)\n *\n * Per-attempt idempotency is untouched: the envelope is built ONCE, and both the in-process retry loop\n * in `SIEMWebhookDeliveryBackendService.processDelivery` and the DLQ drain re-send that same stored\n * object — so one delivery keeps one id across every attempt, which is exactly what a receiver's dedup\n * needs.\n *\n * ## The fallback, and why it is not a hedge\n *\n * `eventId` is required on `AuditableEvent` and the sole production caller always sets it, so this\n * branch should be unreachable. It exists because the two failures are ASYMMETRIC: an absent id is not\n * merely an unjoinable delivery, it is a delivery with NO dedup key at all — every projection renders\n * the field only `if (e.eventId)`, so the receiver stores `dedupKey: null` and answers `deduped: false`\n * forever against a service that retries and drains a DLQ. Losing the join degrades an investigation;\n * losing idempotency duplicates events inside a customer's SIEM. So an absent id still gets a minted\n * one, and is logged loudly rather than shipping a blank.\n */\n private _resolveEnvelopeEventId(auditEvent: Omit<AuditableEvent, '_id' | 'createdAt' | 'updatedAt'>): string {\n if (auditEvent.eventId) {\n return auditEvent.eventId;\n }\n\n const mintedEventId = uuidv4();\n this.logger.warn?.(\n 'Audit event reached SIEM dispatch with no eventId — the delivered envelope cannot be joined back to its audit row; minting a delivery-local id so receiver idempotency survives',\n { eventType: auditEvent.eventType, mintedEventId },\n );\n return mintedEventId;\n }\n\n /**\n * Infer success/failure outcome from event type.\n */\n private _inferOutcome(eventType: string): AuditEventOutcome {\n const failureEventTypes = [\n CoreAuditableEventType.USER_LOGIN_FAILED,\n CoreAuditableEventType.USER_ACCOUNT_LOCKED,\n CoreAuditableEventType.USER_SSO_LOGIN_FAILED,\n CoreAuditableEventType.USER_SSO_ENFORCEMENT_BLOCKED,\n CoreAuditableEventType.SAML_LOGIN_FAILED,\n CoreAuditableEventType.SAML_ASSERTION_REPLAY_DETECTED,\n CoreAuditableEventType.MACHINE_AUTH_FAILED,\n ];\n\n return failureEventTypes.includes(eventType as CoreAuditableEventType) ? AuditEventOutcome.FAILURE : AuditEventOutcome.SUCCESS;\n }\n\n // ─────────────────────────────────────────────────────────────\n // F3: Organization Name Cache\n // ─────────────────────────────────────────────────────────────\n\n /**\n * F3: resolve an organization NAME for SIEM-analyst readability, through the leased cache.\n *\n * Renames are picked up within {@link ORG_NAME_REFRESH_AFTER_MS} — read that constant for why this\n * lease is five minutes while the routing config's is sixty seconds. There is no invalidation hook on\n * this one, deliberately: a stale label costs a reader nothing (the `organizationId` beside it in the\n * envelope is authoritative and always current), so the lease alone is a proportionate answer.\n *\n * Never throws — a missing name is optional in the envelope, and this runs on a fire-and-forget path.\n * The loader therefore swallows its own failure and yields `undefined`, which means the COLD path of\n * {@link LeasedValueCache} can never reject here.\n *\n * **`undefined` IS cached, and that is a fix rather than an oversight.** Before this, a lookup that\n * failed or returned a nameless row cached nothing, so an organization whose read kept failing was\n * re-read on EVERY exported event — the read amplification a cache exists to prevent, arriving\n * precisely when the repository is already unhealthy. Caching the negative bounds it to one read per\n * lease, and a rename or a repaired read still lands within that lease.\n *\n * The loader closes over `ec` — the audit service's synthesised super-admin APPLICATION-scoped temp\n * context (`audit-logs.backend.service.ts:284` → `:349`), identical in privilege on every dispatch —\n * which is the precondition {@link LeasedValueCache} states for joining an in-flight load.\n */\n private async _resolveOrgName(ec: ExecutionContext<any>, organizationId: string): Promise<string | undefined> {\n return this._orgNameCache.get(organizationId, async () => {\n try {\n const orgsRepo = this.repositoriesRegistry.getRepositoryOrThrow(CoreResourceType.ORGANIZATIONS);\n const org = await orgsRepo.read<{ _id: string; name: string }>(ec, organizationId);\n return org?.name || undefined;\n } catch {\n // Fire-and-forget — org name is optional in the envelope.\n return undefined;\n }\n });\n }\n\n // ─────────────────────────────────────────────────────────────\n // F6: Event Integrity (HMAC)\n // ─────────────────────────────────────────────────────────────\n\n /**\n * F6: Compute HMAC-SHA256 over the serialized envelope for integrity protection.\n * The delivery service verifies this HMAC before processing, detecting queue tampering.\n */\n private _computeEnvelopeHmac(envelope: SecurityAuditEventEnvelope): string {\n const hmacKey = this._getHmacKey();\n return createHmac('sha256', hmacKey)\n .update(JSON.stringify(envelope))\n .digest('hex');\n }\n\n /**\n * Derive a 256-bit HMAC key from the app's session encryption key\n * using SHA-256 with a domain separator (consistent with SIEM encryption key derivation).\n */\n private _getHmacKey(): Buffer {\n return createHash('sha256')\n .update(`${SIEM_HMAC_DOMAIN}:${this.appConfigService.secrets.security.session.encryptionKey}`)\n .digest();\n }\n\n /**\n * F6: Public static-like method to verify envelope HMAC on the delivery side.\n * Returns true if the HMAC matches, false otherwise.\n */\n public verifyEnvelopeHmac(envelope: SecurityAuditEventEnvelope, expectedHmac: string): boolean {\n const computedHmac = this._computeEnvelopeHmac(envelope);\n // Use crypto.timingSafeEqual for constant-time comparison (prevents timing attacks)\n const computedBuf = Buffer.from(computedHmac, 'utf-8');\n const expectedBuf = Buffer.from(expectedHmac, 'utf-8');\n if (computedBuf.length !== expectedBuf.length) return false;\n return timingSafeEqual(computedBuf, expectedBuf);\n }\n}\n"]}
@@ -5,7 +5,7 @@ import { RepositoriesRegistryHandlerBackendService } from '../../../base-classes
5
5
  import { AuditEventDispatcherBackendService } from './audit-event-dispatcher.backend.service';
6
6
  import type { MetricsService } from '../../../monitoring/observability/services/metrics.service';
7
7
  import type { AuditLogSink, UserTypesConfig } from '@wildo-ai/saas-models';
8
- import { SiemExportChangeType, SsoConfigChangeType, SsoConnectionType, AuditableEvent, AccountLockoutReason, AdministrativeContinuityBreachDetection, ApplicationAuthPolicySnapshot, AuditableEvent_ResourceOperationPerformed_EventData, AuditableEvent_HttpApiReadThroughAccess_EventData, AuditableEvent_HttpApiExternalErasure_EventData, AuditableEvent_HttpApiNonErasureAcknowledged_EventData, AuditableEvent_PlatformDirectoryAccess_EventData, AuditableEvent_ResourceOperationDenied_EventData, ProviderCredentialDeletionReason, ProviderCredentialResolutionSource, OAuthCodeExchangeFailureReason, CoreAuditableEventType, ExecutionContext_ExecutionType, MachineAccessOperation, ResourceServerKind, ResourceOperationRiskLevel, ResourceOperationVariantType, ResourceType, AuthScopeType, PlatformAccessGrantAutoApprovalReason, PlatformAccessGrantLifecycleTransition, PlatformAccessGrantStatus } from '@wildo-ai/saas-models';
8
+ import { SiemExportChangeType, SsoConfigChangeType, SsoConnectionType, AuditableEvent, AccountLockoutReason, AdministrativeContinuityBreachDetection, ApplicationAuthPolicySnapshot, AuditableEvent_ResourceOperationPerformed_EventData, AuditableEvent_HttpApiReadThroughAccess_EventData, AuditableEvent_McpToolCall_EventData, AuditableEvent_AgentToolApprovalModified_EventData, AuditableEvent_ProviderOperationCall_EventData, AuditableEvent_HttpApiExternalErasure_EventData, AuditableEvent_HttpApiNonErasureAcknowledged_EventData, AuditableEvent_PlatformDirectoryAccess_EventData, AuditableEvent_ResourceOperationDenied_EventData, ProviderCredentialDeletionReason, ProviderCredentialResolutionSource, OAuthCodeExchangeFailureReason, CoreAuditableEventType, ExecutionContext_ExecutionType, MachineAccessOperation, ResourceServerKind, ResourceOperationRiskLevel, ResourceOperationVariantType, ResourceType, AuthScopeType, PlatformAccessGrantAutoApprovalReason, PlatformAccessGrantScope, PlatformAccessGrantLifecycleTransition, PlatformAccessGrantStatus } from '@wildo-ai/saas-models';
9
9
  import type { VerifiedOrgId } from '@wildo-ai/saas-models';
10
10
  import { CoreResourceOperation } from '@wildo-ai/saas-models';
11
11
  import { ExecutionContext, type SocketAuthResult } from '../../../runtime/models/execution-context.backend.schemas';
@@ -231,10 +231,27 @@ export declare class AuditLogsBackendService {
231
231
  *
232
232
  * assurance-control: WILDO.ACCESS.PRIVILEGE_EVIDENCE
233
233
  */
234
+ /**
235
+ * Record one access-grant transition — TENANT or APPLICATION-WIDE, on the same event.
236
+ *
237
+ * ONE method for both scopes, deliberately. The lifecycle really is the same lifecycle (requested,
238
+ * decided, revoked, expired), and a reviewer's question is *"what elevated access was granted, to
239
+ * whom, by whom?"* — a question that must be answerable with one query, not by remembering to union
240
+ * two event types. `grantScope` is what separates them within the answer, and it is a field rather
241
+ * than an inference from `targetOrganizationId`'s absence: a scrubbed or lost tenant id would
242
+ * otherwise read as an application-wide elevation, which is the more alarming of the two.
243
+ *
244
+ * The application-wide row is HIGH by default. It is not an exception path like
245
+ * `TENANT_CANNOT_APPROVE`; it is the ordinary shape of the widest elevation the system issues, and
246
+ * a reviewer who filters to HIGH should see every one of them.
247
+ */
234
248
  logPlatformAccessGrantLifecycle(data: {
235
249
  transition: PlatformAccessGrantLifecycleTransition;
236
250
  grantId: string;
237
- targetOrganizationId: string;
251
+ /** Absent exactly when `grantScope` is APPLICATION_WIDE — that elevation names no tenant. */
252
+ targetOrganizationId?: string;
253
+ /** Defaults to TENANT so an existing caller keeps its meaning without restating it. */
254
+ grantScope?: PlatformAccessGrantScope;
238
255
  operatorUserId: string;
239
256
  justification?: string;
240
257
  resultingStatus: PlatformAccessGrantStatus;
@@ -252,6 +269,8 @@ export declare class AuditLogsBackendService {
252
269
  variantKey?: string;
253
270
  targetResourceIds?: string[];
254
271
  authorizingGrantId?: string;
272
+ /** WHICH collection `authorizingGrantId` names — the two grant resources are two collections. */
273
+ authorizingGrantScope?: PlatformAccessGrantScope;
255
274
  admissionDeclared: boolean;
256
275
  initiatorRoles: string[];
257
276
  executionType: ExecutionContext_ExecutionType;
@@ -686,6 +705,72 @@ export declare class AuditLogsBackendService {
686
705
  * real initiating user carried through the shared service principal.
687
706
  */
688
707
  logHttpApiReadThroughAccess(data: Omit<AuditableEvent_HttpApiReadThroughAccess_EventData, 'eventType'>, requestExecutionContext?: ExecutionContext<any>): Promise<void>;
708
+ /**
709
+ * Record ONE outbound call to a third-party provider — the trail behind
710
+ * {@link CoreAuditableEventType.PROVIDER_OPERATION_CALL}, emitted by the provider-operation
711
+ * executor on both the success and the failure path.
712
+ *
713
+ * The top-level `userId` is the REAL initiating user, and `organizationId` is the tenant the
714
+ * REQUEST was scoped to — NOT the tenant whose account was spent. Those two differ exactly where
715
+ * it matters: one user action fanning out to every organization that user belongs to spends N
716
+ * accounts under one initiating scope, and the account actually spent rides
717
+ * `eventData.connectionOwnerScope` / `connectionOwnerId`. Writing the connection owner into the
718
+ * row's `organizationId` would make the fan-out's calls read as if each had been requested by the
719
+ * tenant it reached.
720
+ *
721
+ * `riskLevel` is per-emission because the static severity cannot be: an outbound WRITE to a third
722
+ * party is a materially different act from a read, and the operation catalogue's own
723
+ * classification vocabulary says so ("a caller decides retry-safety, an audit decides severity").
724
+ * MEDIUM for a WRITE, LOW for a READ — the same shape `COLLECTION_DATA_EXPORT` uses to separate a
725
+ * page download from a whole-table dump without splitting the event type.
726
+ *
727
+ * assurance-control: WILDO.AUDIT.ATTRIBUTION — an outbound provider call made on a user's behalf
728
+ * is recorded with the real initiating user beside the account it spent.
729
+ */
730
+ logProviderOperationCall(data: Omit<AuditableEvent_ProviderOperationCall_EventData, 'eventType'>, requestExecutionContext?: ExecutionContext<any>): Promise<void>;
731
+ /**
732
+ * Record that an AGENT reached an MCP server on somebody's behalf (#491) — the outbound trail for
733
+ * a tool call that leaves the trust boundary.
734
+ *
735
+ * One row per ATTEMPT, whatever the outcome. Recording only what worked would hide precisely what
736
+ * a reviewer looks for first: the refused targets, the calls that timed out, and the tools that
737
+ * answered with their own error. `outcome` carries the client's own vocabulary so the trail and
738
+ * the logs use the same words for the same thing.
739
+ *
740
+ * The top-level `userId` is the REAL initiating user and `organizationId` the tenant the TURN was
741
+ * scoped to — never the tenant whose credential was spent, which rides
742
+ * `eventData.connectionOwnerScope`. Same separation as the provider-call sibling above, for the
743
+ * same reason.
744
+ *
745
+ * `riskLevel` is per-emission and keys on the OUTCOME rather than on a declared verb, because an
746
+ * MCP tool has no declared verb: the tool list is discovered from the server at turn start and
747
+ * nothing says whether a tool reads or writes. MEDIUM for a refused target — an attempted egress a
748
+ * guard blocked is the row a reviewer wants raised — and LOW for everything else, including
749
+ * ordinary failures, which are noise until somebody is looking for them.
750
+ *
751
+ * assurance-control: WILDO.AUDIT.ATTRIBUTION — an agent's outbound tool call is recorded with the
752
+ * real initiating user beside the account it spent.
753
+ */
754
+ logMcpToolCall(data: Omit<AuditableEvent_McpToolCall_EventData, 'eventType'>, requestExecutionContext?: ExecutionContext<any>): Promise<void>;
755
+ /**
756
+ * Record that a human approver AUTHORED the arguments an approval-gated tool then ran with (#566).
757
+ *
758
+ * One row per MODIFIED approval. An approval that ran the call as proposed writes nothing here —
759
+ * this event answers "who wrote the arguments", and an approval that changed none did not.
760
+ *
761
+ * The top-level `userId` is the APPROVER, which on this plane is the only identity that can exist:
762
+ * a turn whose principal cannot answer a decision is denied rather than suspended, so nobody but a
763
+ * present, accountable human ever reaches this method.
764
+ *
765
+ * `riskLevel` is HIGH and does not vary. Every other per-emission risk level in this service keys
766
+ * on something the act might or might not have been; there is no such axis here, because the act
767
+ * itself is the whole finding — a person substituted their own arguments for the model's on a tool
768
+ * an author gated precisely because it was dangerous enough to need a human.
769
+ *
770
+ * assurance-control: WILDO.ACCESS.AUTHORIZATION_DECISION_AUDIT — an authorization decision that
771
+ * REWROTE the act it authorized is recorded with the person who wrote it.
772
+ */
773
+ logAgentToolApprovalModified(data: Omit<AuditableEvent_AgentToolApprovalModified_EventData, 'eventType'>, requestExecutionContext?: ExecutionContext<any>): Promise<void>;
689
774
  /**
690
775
  * Record that a subject erasure invoked an HTTP_API binding's DECLARED external-erasure
691
776
  * operation (ETL D6 stance 6b) — remote rows linked to the erased subject were deleted in a
@@ -1178,7 +1263,6 @@ export declare class AuditLogsBackendService {
1178
1263
  * policy is recorded as an attributable, durable audit event.
1179
1264
  */
1180
1265
  logApplicationAuthPolicyChanged(data: {
1181
- applicationId: string;
1182
1266
  changedUserTypes: string[];
1183
1267
  snapshotDigest: string;
1184
1268
  before: Record<string, ApplicationAuthPolicySnapshot> | null;
@@ -1205,7 +1289,6 @@ export declare class AuditLogsBackendService {
1205
1289
  * detected at startup and evidenced in the audit trail, once per genuine change.
1206
1290
  */
1207
1291
  emitApplicationAuthPolicyChangeIfChanged(data: {
1208
- applicationId: string;
1209
1292
  userTypes: UserTypesConfig;
1210
1293
  }): Promise<void>;
1211
1294
  /**
@@ -1620,6 +1703,26 @@ export declare class AuditLogsBackendService {
1620
1703
  ipAddress: string;
1621
1704
  userAgent: string;
1622
1705
  }): Promise<void>;
1706
+ /**
1707
+ * An enterprise OIDC login refused because the provider did not report the demanded authentication
1708
+ * context (issue #444).
1709
+ *
1710
+ * NO tenant scope on the payload, and that is deliberate rather than an omission: the refusal
1711
+ * happens during the callback, before the claimant is provisioned or linked, so there is no
1712
+ * verified organization to attribute it to. Inventing one from an unverified email domain would
1713
+ * put an attacker-chosen tenant id on a security event.
1714
+ *
1715
+ * HIGH risk, unlike its `OAUTH2_PROVIDER_BLOCKED` neighbour at MEDIUM. That one records a policy
1716
+ * that worked; this one records a step-up demand the identity provider did NOT satisfy, which is
1717
+ * either a misconfiguration leaving an operator's strongest control inert or a provider behaving
1718
+ * differently from what was agreed. Both want a reader.
1719
+ */
1720
+ logOidcAcrDemandUnsatisfied(data: {
1721
+ providerRef: string;
1722
+ demandedAcrValues: string[];
1723
+ receivedAcr?: string;
1724
+ failureReason?: string;
1725
+ }): Promise<void>;
1623
1726
  logUserPasswordChanged(data: {
1624
1727
  userId: string;
1625
1728
  ipAddress: string;