@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-observation-emission.backend.js","sourceRoot":"","sources":["../../../../../src/monitoring/observability/audit-observation-emission.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AAIH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAN,IAAY,oBA4FX;AA5FD,WAAY,oBAAoB;IAC9B;;;;;;;;;;;;;OAaG;IACH,iGAAyE,CAAA;IAEzE;;;OAGG;IACH,qEAA6C,CAAA;IAE7C;;;OAGG;IACH,2FAAmE,CAAA;IAEnE;;;;;;;OAOG;IACH,+EAAuD,CAAA;IAEvD;;;;;;;;OAQG;IACH,qEAA6C,CAAA;IAE7C;;;;;;;OAOG;IACH,2EAAmD,CAAA;IAEnD;;;;;;;;;;;;;;;OAeG;IACH,2EAAmD,CA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AAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,iBAAiB,CAAC,KAAc;IACvC,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;IAChF,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACxE,CAAC","sourcesContent":["/**\n * # The seam every FIRE-AND-FORGET audit observation goes through — and the loss signal behind it\n *\n * assurance-control: WILDO.AUDIT.SECURITY_EVENT — a lost security observation is DETECTABLE, so a\n * period with no recorded operator crossings is distinguishable from a period with a broken sink.\n *\n * ## The gap this closes, stated precisely\n *\n * A handful of security observations — an operator crossing a tenant boundary, an authorization\n * refusal, a platform-access grant transition, a directory read — are emitted WITHOUT `await`, with\n * the audit service FEATURE-DETECTED and the returned promise's rejection SWALLOWED. Every one of\n * those three properties is deliberate and must survive: **an observation must never be able to fail\n * the request it observes.** A fail-closed variant would hand anyone a way to disable operator\n * support, or to convert a correct 403 into a 500, by breaking the audit sink.\n *\n * What was missing is not a refusal — it is a COUNT. With nothing recording the drops, an operator\n * reading the trail cannot tell \"no operator crossed a tenant boundary this week\" from \"the audit\n * service has been unbound since Tuesday\". Those two readings of the same empty result are what make\n * the evidence worthless, and it is the same shape as\n * `.claude/rules/negative-results-require-a-positive-probe.md`: an empty result is evidence about the\n * pipeline, never about the world.\n *\n * ## What the existing control does NOT cover — measured 2026-09-09\n *\n * Three call sites carried the claim that *\"detection of a lost row is the audit pipeline's own\n * control (`audit_store_failure_total`), not this gate's\"*. That claim is **true for one loss shape\n * and false for the three that matter here.** `AuditLogsBackendService._createAuditLog` catches its\n * Layer-1 store write and increments `audit_store_failure_total` — so a store that is DOWN while the\n * service is bound and reachable is already counted. But that counter is inside a method the\n * observer may never reach:\n *\n * | Loss shape | Reaches `_createAuditLog`? | Counted before this seam |\n * |---|---|---|\n * | {@link AuditObservationLossReason.SERVICE_UNAVAILABLE} — the audit service is unbound, or the `log*` method is absent (a partial DI binding, a host binding an older audit service) | no | **nothing at all** |\n * | {@link AuditObservationLossReason.EMISSION_THREW} — the call threw synchronously | no | **nothing at all** |\n * | {@link AuditObservationLossReason.EMISSION_REJECTED} — the returned promise rejected | partially | **nothing at all** at the observer |\n * | the Layer-1 store write itself failed | yes | `audit_store_failure_total` (unchanged, and still the right control for that shape) |\n *\n * So this seam counts the OBSERVER-side drop — the case where the audit pipeline never learned there\n * was anything to record — and leaves the pipeline's own control alone. The two are complementary,\n * not duplicates, and a reviewer needs both: one says \"we tried and the store refused\", the other\n * says \"we never got as far as trying\".\n *\n * ## Why a METRIC and a LOG, and not an audit row\n *\n * The loss signal must survive the audit store being down, so it cannot BE the audit store —\n * recording \"the audit store was unreachable\" in the audit store is the circularity that makes the\n * whole thing worthless. Two channels, deliberately, because neither alone is sufficient:\n *\n * - **`audit_observation_dropped_total`** (via {@link MetricsService.recordAuditObservationDropped})\n * is the RATE signal, and it is the durable one: the OTLP reader exports it periodically to the\n * metrics backend, so its value outlives the process and aggregates across instances. Without the\n * OTLP preload wired the global meter is a no-op and this channel is silently inert — which is\n * precisely why it is not the only channel.\n * - **One rate-limited `error` log line** is the always-available channel and the WAKE-UP. It fires\n * at most once per {@link LOSS_LOG_INTERVAL_MS} per `(observation, reason)` pair, so a service\n * that has been unbound since boot produces one line rather than one per request. Unthrottled it\n * would flood, and a channel that floods is a channel operators filter out — which would leave the\n * signal technically present and practically absent.\n *\n * ## The process-local accumulator, argued rather than assumed\n *\n * {@link readAuditObservationLossTotals} is per-process and is **lost on restart**. That is stated\n * here rather than glossed, because a reader could otherwise take it for durable evidence:\n *\n * - It is **not** the evidence. It is a test seam and a door for a future health surface. The\n * durable record is the exported counter (metrics backend) plus the log line (log store).\n * - Per-instance is the correct granularity for the LOG channel anyway — \"which replica lost\n * evidence\" is part of the answer — and the metrics backend does the cross-instance aggregation\n * that a process-local number never could.\n * - Rejected: a durable row for each loss. It is I/O on the observation path, it can fail the\n * request the whole design forbids failing, and it introduces a second store that can itself be\n * down. Rejected: a dedicated health endpoint. Still per-instance, adds a surface, and gives an\n * operator nothing the counter does not already give them.\n *\n * ## Why this is a SEAM and not a helper each site copies\n *\n * `.claude/rules/invariant-call-site-enumeration.md` — the invariant here (\"a dropped observation is\n * counted\") holds at every fire-and-forget security observation in the package, spread across six\n * subtrees, and the recurring defect in this repository is exactly the invariant applied at one of\n * them. Routing every site through one function makes the counting structural rather than\n * remembered: a new fire-and-forget observation that uses this seam is counted the day it lands,\n * with no author having to know this mechanism exists.\n *\n * **Do not quote a call-site count from this file.** An earlier revision named one (\"EIGHT call\n * sites\"), and the very next adoption pass made it wrong — a number in prose is one a reader has to\n * re-measure before believing, which is worse than no number. Measure it:\n *\n * ```bash\n * command grep -rn \"emitAuditObservation(\\|recordAuditObservationLoss(\" engine/saas-backend-lib/src \\\n * | grep -v __tests__ | grep -v audit-observation-emission.backend.ts\n * ```\n */\n\nimport type { MetricsService } from '~wildo-backend-lib/monitoring/observability/services/metrics.service';\n\n/**\n * WHICH security observation was lost.\n *\n * A closed vocabulary with one named runtime source, per `CLAUDE.md` — the member is what a reviewer\n * reads off the alert, so it has to carry its own explanation rather than being a bare string at\n * every call site. It is also the metric's `observation` label: bounded, low cardinality, and stable\n * across renames of the emitting method.\n *\n * ## A member names the EVIDENCE, never the emitter\n *\n * Two members of this enum are emitted from more than one place, and that is the design rather than\n * an omission. `CROSS_TENANT_ADMINISTRATIVE_ACCESS` is raised by the per-instance tenant gate AND by\n * the APPLICATION-scoped collection read; `HTTP_API_READ_THROUGH_ACCESS` by the per-read adapter AND\n * by the per-run ETL pipeline. Splitting either by emitter would make the one question an operator\n * actually asks — *how much cross-tenant evidence did we lose?* — a sum over labels, and a sum\n * somebody has to remember to widen is a sum that goes quietly wrong the day a third emitter lands.\n * WHICH door dropped it is carried by the log line's `context`, which is the channel with room for\n * it; the metric carries the rate, which is the thing that has to aggregate.\n *\n * The corollary: when you add an emitter for an event a member already names, REUSE the member and\n * extend its JSDoc to name the new emitter. A member whose prose still names one of two emitters is\n * a stale claim in the place a reviewer trusts most.\n */\nexport enum AuditObservationKind {\n /**\n * `CROSS_TENANT_ADMINISTRATIVE_ACCESS`, from BOTH doors that can produce one.\n *\n * The most consequential member: this is the operator-crossing trail\n * `.claude/rules/administrative-continuity-floors.md` requires, and the one whose silence is\n * indistinguishable from \"no operator crossed anything\".\n *\n * - `authorizeOrganizations` — the per-instance tenant gate, deciding on ONE fetched row.\n * - `ServiceResourceBackendService.recordCrossTenantReadAccess` — the APPLICATION-scoped\n * collection read, one observation per TENANT reached. The authorizer never sees this half: it\n * runs only for ORGANIZATIONS-scoped resources, and an application-scoped door returns a SET\n * whose rows belong to many tenants. Losing it silently is the larger of the two exposures,\n * because it is the door that can enumerate every tenant at once.\n */\n CROSS_TENANT_ADMINISTRATIVE_ACCESS = 'cross_tenant_administrative_access',\n\n /**\n * `RESOURCE_OPERATION_DENIED` from the authorizer funnel. A lost refusal is a lost negative access\n * decision — the record half of \"record access decisions\".\n */\n AUTHORIZATION_DENIAL = 'authorization_denial',\n\n /**\n * `PLATFORM_ACCESS_GRANT_LIFECYCLE` from the grant custom implementation. A lost transition means\n * an elevation exists whose request/approval is not in the trail.\n */\n PLATFORM_ACCESS_GRANT_LIFECYCLE = 'platform_access_grant_lifecycle',\n\n /**\n * `PLATFORM_DIRECTORY_ACCESS` from `ServiceResourceBackendService.recordPlatformDirectoryAccess` —\n * an APPLICATION-WIDE directory enumeration that no scope confined.\n *\n * `returnedCount` is why the row exists at all: it is the only thing separating \"an operator\n * opened the directory\" from \"an operator exported it\". A lost observation does not merely lose an\n * access record, it loses the SIZE, which is the half a reviewer reads first.\n */\n PLATFORM_DIRECTORY_ACCESS = 'platform_directory_access',\n\n /**\n * `USER_SESSION_EVICTED` from the token issuer's concurrent-session cap.\n *\n * One observation per RETIRED refresh chain, not per enforcement: the cap bounds the blast radius\n * of undetected token theft, so a burst of evictions for one principal is among the more\n * interesting things the trail can carry — and a burst is exactly the case where losing some of\n * the rows understates it. Counting per chain is what keeps the loss signal proportional to the\n * evidence actually lost rather than to the number of times the cap ran.\n */\n USER_SESSION_EVICTED = 'user_session_evicted',\n\n /**\n * `PROVIDER_OPERATION_CALL` from the provider operation executor — one row per OUTBOUND call to a\n * third party, on both the success and the failure path.\n *\n * This is the application's record of what it sent to whom on whose behalf. Its silence is\n * peculiarly misleading: an empty outbound trail reads as \"this deployment integrates with\n * nothing\", which is a sentence somebody will believe.\n */\n PROVIDER_OPERATION_CALL = 'provider_operation_call',\n\n /**\n * The post-call credential-use stamp from the provider operation executor.\n *\n * ## Why this is on THIS counter even though its sink is not the audit service\n *\n * It writes to the tenant's own credential row rather than to `AuditLogsBackendService`, and it is\n * still the identical observer-side loss shape: fire-and-forget, sink feature-detected, rejection\n * swallowed, nothing counting the drops. The counter's subject is the LOSS OF A SECURITY\n * OBSERVATION, not the identity of the store that was supposed to receive it — so a second counter\n * for one site would fragment the alert without telling an operator anything the `observation`\n * label does not already say.\n *\n * What it evidences is narrow and worth stating: whether a stored credential was ACCEPTED by the\n * provider on last use. Losing it leaves a credential whose health is unknown, which surfaces\n * later as an integration that fails with no record of when it started failing.\n */\n PROVIDER_CREDENTIAL_USE = 'provider_credential_use',\n\n /**\n * `HTTP_API_READ_THROUGH_ACCESS`, from BOTH emitters — see the enum's naming principle above.\n *\n * - `HttpApiResourceRepositoryBackendService.recordReadThroughAccess` — one observation per remote\n * round-trip, and the only tier that witnesses every one of them (repository-direct probes never\n * reach the services tier at all).\n * - `ExternalDataPipelineRunBackendService.recordRunReadThroughAccess` — one observation per ETL\n * run.\n *\n * The evidence at stake is ATTRIBUTION: an HTTP_API read reaches a third party through a SHARED\n * service principal, so this row is what carries the real initiating user through it. Without it\n * the external system's own logs show one principal and nothing anywhere resolves it to a person.\n */\n HTTP_API_READ_THROUGH_ACCESS = 'http_api_read_through_access',\n}\n\n/**\n * WHY the observation never reached the audit pipeline.\n *\n * Three members, and they are genuinely different diagnoses rather than shades of one — see the\n * table in this module's header. `SERVICE_UNAVAILABLE` is a WIRING fault and is usually total and\n * permanent for the life of the process; the other two are runtime faults and are usually partial.\n * Merging them would leave an operator unable to tell \"this deployment audits nothing\" from \"the\n * audit store hiccupped twice\".\n */\nexport enum AuditObservationLossReason {\n /** The audit service is unbound, or the specific `log*` method is absent on the bound instance. */\n SERVICE_UNAVAILABLE = 'service_unavailable',\n /** The emitting call threw synchronously — before any `.catch()` could make it fire-and-forget. */\n EMISSION_THREW = 'emission_threw',\n /** The emitting call returned a promise that rejected. */\n EMISSION_REJECTED = 'emission_rejected',\n}\n\n/**\n * How often ONE `(observation, reason)` pair may produce a log line.\n *\n * Fifteen minutes: long enough that a permanently broken binding costs four lines an hour rather\n * than one per request, short enough that a NEW outage hours after an earlier one still announces\n * itself instead of being swallowed by a latch that never resets. A permanent latch was rejected for\n * exactly that reason — it makes the second incident invisible.\n */\nexport const LOSS_LOG_INTERVAL_MS = 15 * 60 * 1000;\n\n/** The narrow slice of {@link MetricsService} this seam needs. Structural, so a double is trivial. */\nexport interface AuditObservationLossMetricsRecorder {\n recordAuditObservationDropped(params: { observation: string; reason: string }): void;\n}\n\n/**\n * A LAZY door to the recorder, for a site that does not hold one.\n *\n * Most emitters here are plain classes built with `new` (repository adapters, the provider executor)\n * or reach the container only through thunks their builder closes over. Each could resolve the\n * recorder itself — and each would then need its own `try`/`catch`, because a container resolving a\n * binding may throw and an observability failure must never reach the request. Five copies of that\n * guard is precisely the shape `.claude/rules/invariant-call-site-enumeration.md` says will be\n * applied at four of them, so the seam takes the thunk and does the wrapping once.\n *\n * Resolution happens ONLY when there is a loss to record. A site on the happy path never touches its\n * container, which is what makes handing this in unconditionally cheap.\n */\nexport type AuditObservationLossMetricsResolver = () => AuditObservationLossMetricsRecorder | undefined;\n\n/** The narrow slice of the logger this seam needs. Optional everywhere — see {@link emitAuditObservation}. */\nexport interface AuditObservationLossLogger {\n error?: (message: string, context?: Record<string, unknown>) => void;\n}\n\n/** Process-local totals, keyed `<observation>:<reason>`. Not evidence — see the module header. */\nconst lossTotals = new Map<string, number>();\n/** Last log timestamp per `<observation>:<reason>`. Bounded by the enum cross-product (9 entries). */\nconst lastLoggedAt = new Map<string, number>();\n\n/**\n * Every loss recorded since this process started, as `<observation>:<reason>` → count.\n *\n * A COPY, so a caller cannot mutate the accumulator. Exists so the counting can be pinned without an\n * OTLP backend, and so a future health surface has a door that does not require one either. Read the\n * module header before treating the numbers as durable evidence: they are not.\n */\nexport function readAuditObservationLossTotals(): Record<string, number> {\n return Object.fromEntries(lossTotals);\n}\n\n/** Test isolation only. Never called from production code. */\nexport function resetAuditObservationLossTotals(): void {\n lossTotals.clear();\n lastLoggedAt.clear();\n}\n\n/**\n * Record one lost observation. Never throws, under any circumstance.\n *\n * Exported so a site whose emission does not fit {@link emitAuditObservation}'s shape can still\n * contribute to the same counter rather than inventing a second one. Prefer the seam.\n */\nexport function recordAuditObservationLoss(params: {\n observation: AuditObservationKind;\n reason: AuditObservationLossReason;\n /** The recorder itself, when the site already holds one (a container-injected service). */\n metricsService?: AuditObservationLossMetricsRecorder;\n /**\n * A thunk to the recorder, when the site does not. Consulted only if `metricsService` is absent,\n * and only on a loss — see {@link AuditObservationLossMetricsResolver}. Two fields rather than one\n * union: a caller reading `metricsService: X | (() => X)` has to work out which one it holds, and\n * the answer is a property of the CLASS, so it is better spelled at the field.\n */\n metricsResolver?: AuditObservationLossMetricsResolver;\n logger?: AuditObservationLossLogger;\n error?: unknown;\n context?: Record<string, unknown>;\n}): void {\n // The recorder is the LAST thing that may fail the request it observes: a metric backend that\n // throws, or a logger that throws, would defeat the entire purpose of the fire-and-forget contract\n // this seam exists to preserve. Everything below is inside one boundary for that reason.\n try {\n const key = `${params.observation}:${params.reason}`;\n lossTotals.set(key, (lossTotals.get(key) ?? 0) + 1);\n\n // Metrics FIRST. It is the durable, rate-carrying channel, and it must be incremented even for\n // the drops the throttle below decides not to log — otherwise the throttle would silently\n // suppress the count as well as the line, which is the defect one layer up.\n //\n // Feature-DETECTED rather than optional-chained on the object, and for the reason this whole\n // module exists: a container that answers every symbol with a stub (the shape several partial\n // test containers in this package genuinely have) yields a truthy `metricsService` whose method\n // is absent, so `?.` on the OBJECT still calls `undefined(...)` and throws. The outer catch\n // would contain it, but a swallowed TypeError looks exactly like a swallowed real defect — and\n // it would take the log line down with it, leaving the loss silent again.\n const metricsService = params.metricsService ?? resolveLossMetricsRecorder(params.metricsResolver);\n if (typeof metricsService?.recordAuditObservationDropped === 'function') {\n metricsService.recordAuditObservationDropped({\n observation: params.observation,\n reason: params.reason,\n });\n }\n\n const now = Date.now();\n const previous = lastLoggedAt.get(key);\n if (previous !== undefined && now - previous < LOSS_LOG_INTERVAL_MS) return;\n lastLoggedAt.set(key, now);\n\n params.logger?.error?.('A security audit observation was DROPPED before it reached the audit pipeline', {\n // `reason` is the slug an alert rule and a log query both key on; keep it first and stable.\n reason: 'audit_observation_dropped',\n observation: params.observation,\n lossReason: params.reason,\n // The running total makes ONE throttled line carry the volume the suppressed lines would have.\n occurrencesSinceProcessStart: lossTotals.get(key),\n logIntervalMs: LOSS_LOG_INTERVAL_MS,\n ...(params.error === undefined ? {} : { error: describeLossError(params.error) }),\n ...(params.context ?? {}),\n });\n } catch {\n /* An observability failure must never be able to fail the request it observes. */\n }\n}\n\n/**\n * Emit one fire-and-forget audit observation, counting it if it is lost.\n *\n * ## The contract, which is the whole point\n *\n * **This function never throws and never returns a promise.** Not on an absent service, not on a\n * synchronous throw, not on a rejection, and not on a metrics or logger failure. Callers rely on it\n * to preserve the property their own JSDoc promises: the observation cannot fail the request.\n *\n * @param params.emit The emitting call, or `undefined` when the audit service or its method is\n * absent. Passing `undefined` is how a site reports {@link AuditObservationLossReason.SERVICE_UNAVAILABLE}\n * — the feature detection stays at the site because the method name differs per observation, and a\n * generic reflective lookup here would trade a compile-time error for a runtime one.\n */\nexport function emitAuditObservation(params: {\n observation: AuditObservationKind;\n emit: (() => unknown) | undefined;\n metricsService?: AuditObservationLossMetricsRecorder;\n /** See {@link recordAuditObservationLoss}. Never called unless there IS a loss. */\n metricsResolver?: AuditObservationLossMetricsResolver;\n logger?: AuditObservationLossLogger;\n context?: Record<string, unknown>;\n}): void {\n const loss = (reason: AuditObservationLossReason, error?: unknown): void =>\n recordAuditObservationLoss({\n observation: params.observation,\n reason,\n metricsService: params.metricsService,\n metricsResolver: params.metricsResolver,\n logger: params.logger,\n error,\n context: params.context,\n });\n\n try {\n if (!params.emit) {\n loss(AuditObservationLossReason.SERVICE_UNAVAILABLE);\n return;\n }\n\n let result: unknown;\n try {\n result = params.emit();\n } catch (error) {\n // A `log*` method that is absent on a partially-mocked double throws a TypeError HERE —\n // synchronously, before any `.catch()` could attach. That is the shape the feature detection at\n // each site exists to pre-empt; this catch is what keeps a site that forgets it from crashing.\n loss(AuditObservationLossReason.EMISSION_THREW, error);\n return;\n }\n\n // Optional-chained, because an audit method is free to be synchronous (and every test double\n // returning `undefined` is). A non-thenable result is a successful emission, not a loss.\n const thenable = result as { catch?: (handler: (error: unknown) => void) => unknown } | null | undefined;\n if (typeof thenable?.catch !== 'function') return;\n thenable.catch((error) => loss(AuditObservationLossReason.EMISSION_REJECTED, error));\n } catch {\n /* Belt and braces: nothing in this seam may reach the caller. */\n }\n}\n\n/**\n * Ask a site's thunk for the recorder, and treat any refusal as \"no recorder\".\n *\n * Its own `try`, INSIDE the caller's: a container that throws while resolving a binding must not be\n * able to take the LOG channel down with it. Degrading a loss to its log-only form is the correct\n * direction — the whole point of this module is that an observability gap is never a reason to\n * refuse — whereas letting the throw escape to the outer `catch` would silence both channels for the\n * one event that most needs saying.\n */\nfunction resolveLossMetricsRecorder(\n resolver: AuditObservationLossMetricsResolver | undefined,\n): AuditObservationLossMetricsRecorder | undefined {\n if (typeof resolver !== 'function') return undefined;\n try {\n return resolver();\n } catch {\n return undefined;\n }\n}\n\n/**\n * A log-safe description of whatever was thrown.\n *\n * Deliberately local rather than routed through `describeCaughtError`: this module sits UNDER the\n * error subsystem in the dependency order (the error builder's own failures are observations this\n * seam records), and importing upward would make an observability module depend on the layer it\n * observes. The shape is a strict subset of what `describeCaughtError` produces, so a log query\n * reading `error.message` works against both.\n */\nfunction describeLossError(error: unknown): { message: string; name?: string } {\n if (error instanceof Error) return { message: error.message, name: error.name };\n return { message: typeof error === 'string' ? error : String(error) };\n}\n"]}
1
+ {"version":3,"file":"audit-observation-emission.backend.js","sourceRoot":"","sources":["../../../../src/monitoring/observability/audit-observation-emission.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4FG;AAIH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAN,IAAY,oBAgGX;AAhGD,WAAY,oBAAoB;IAC9B;;;;;;;;;;;;;OAaG;IACH,iGAAyE,CAAA;IAEzE;;;OAGG;IACH,qEAA6C,CAAA;IAE7C;;;OAGG;IACH,2FAAmE,CAAA;IAEnE;;;;;;;OAOG;IACH,+EAAuD,CAAA;IAEvD;;;;;;;;OAQG;IACH,qEAA6C,CAAA;IAE7C;;;;;;;OAOG;IACH,2EAAmD,CAAA;IAEnD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,2EAAmD,CAAA;IAEnD;;;;;;;;;;;;OAYG;IACH,qFAA6D,CAAA;AAC/D,CAAC,EAhGW,oBAAoB,KAApB,oBAAoB,QAgG/B;AAED;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IACpC,mGAAmG;IACnG,yEAA2C,CAAA;IAC3C,mGAAmG;IACnG,+DAAiC,CAAA;IACjC,0DAA0D;IAC1D,qEAAuC,CAAA;AACzC,CAAC,EAPW,0BAA0B,KAA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CAAC,KAAK,CAAC,EAAE,CAAC;AACxE,CAAC","sourcesContent":["/**\n * # The seam every FIRE-AND-FORGET audit observation goes through — and the loss signal behind it\n *\n * assurance-control: WILDO.AUDIT.SECURITY_EVENT — a lost security observation is DETECTABLE, so a\n * period with no recorded operator crossings is distinguishable from a period with a broken sink.\n *\n * ## The gap this closes, stated precisely\n *\n * A handful of security observations — an operator crossing a tenant boundary, an authorization\n * refusal, a platform-access grant transition, a directory read — are emitted WITHOUT `await`, with\n * the audit service FEATURE-DETECTED and the returned promise's rejection SWALLOWED. Every one of\n * those three properties is deliberate and must survive: **an observation must never be able to fail\n * the request it observes.** A fail-closed variant would hand anyone a way to disable operator\n * support, or to convert a correct 403 into a 500, by breaking the audit sink.\n *\n * What was missing is not a refusal — it is a COUNT. With nothing recording the drops, an operator\n * reading the trail cannot tell \"no operator crossed a tenant boundary this week\" from \"the audit\n * service has been unbound since Tuesday\". Those two readings of the same empty result are what make\n * the evidence worthless, and it is the same shape as\n * `.claude/rules/negative-results-require-a-positive-probe.md`: an empty result is evidence about the\n * pipeline, never about the world.\n *\n * ## What the existing control does NOT cover — measured 2026-09-09\n *\n * Three call sites carried the claim that *\"detection of a lost row is the audit pipeline's own\n * control (`audit_store_failure_total`), not this gate's\"*. That claim is **true for one loss shape\n * and false for the three that matter here.** `AuditLogsBackendService._createAuditLog` catches its\n * Layer-1 store write and increments `audit_store_failure_total` — so a store that is DOWN while the\n * service is bound and reachable is already counted. But that counter is inside a method the\n * observer may never reach:\n *\n * | Loss shape | Reaches `_createAuditLog`? | Counted before this seam |\n * |---|---|---|\n * | {@link AuditObservationLossReason.SERVICE_UNAVAILABLE} — the audit service is unbound, or the `log*` method is absent (a partial DI binding, a host binding an older audit service) | no | **nothing at all** |\n * | {@link AuditObservationLossReason.EMISSION_THREW} — the call threw synchronously | no | **nothing at all** |\n * | {@link AuditObservationLossReason.EMISSION_REJECTED} — the returned promise rejected | partially | **nothing at all** at the observer |\n * | the Layer-1 store write itself failed | yes | `audit_store_failure_total` (unchanged, and still the right control for that shape) |\n *\n * So this seam counts the OBSERVER-side drop — the case where the audit pipeline never learned there\n * was anything to record — and leaves the pipeline's own control alone. The two are complementary,\n * not duplicates, and a reviewer needs both: one says \"we tried and the store refused\", the other\n * says \"we never got as far as trying\".\n *\n * ## Why a METRIC and a LOG, and not an audit row\n *\n * The loss signal must survive the audit store being down, so it cannot BE the audit store —\n * recording \"the audit store was unreachable\" in the audit store is the circularity that makes the\n * whole thing worthless. Two channels, deliberately, because neither alone is sufficient:\n *\n * - **`audit_observation_dropped_total`** (via {@link MetricsService.recordAuditObservationDropped})\n * is the RATE signal, and it is the durable one: the OTLP reader exports it periodically to the\n * metrics backend, so its value outlives the process and aggregates across instances. Without the\n * OTLP preload wired the global meter is a no-op and this channel is silently inert — which is\n * precisely why it is not the only channel.\n * - **One rate-limited `error` log line** is the always-available channel and the WAKE-UP. It fires\n * at most once per {@link LOSS_LOG_INTERVAL_MS} per `(observation, reason)` pair, so a service\n * that has been unbound since boot produces one line rather than one per request. Unthrottled it\n * would flood, and a channel that floods is a channel operators filter out — which would leave the\n * signal technically present and practically absent.\n *\n * ## The process-local accumulator, argued rather than assumed\n *\n * {@link readAuditObservationLossTotals} is per-process and is **lost on restart**. That is stated\n * here rather than glossed, because a reader could otherwise take it for durable evidence:\n *\n * - It is **not** the evidence. It is a test seam and a door for a future health surface. The\n * durable record is the exported counter (metrics backend) plus the log line (log store).\n * - Per-instance is the correct granularity for the LOG channel anyway — \"which replica lost\n * evidence\" is part of the answer — and the metrics backend does the cross-instance aggregation\n * that a process-local number never could.\n * - Rejected: a durable row for each loss. It is I/O on the observation path, it can fail the\n * request the whole design forbids failing, and it introduces a second store that can itself be\n * down. Rejected: a dedicated health endpoint. Still per-instance, adds a surface, and gives an\n * operator nothing the counter does not already give them.\n *\n * ## Why this is a SEAM and not a helper each site copies\n *\n * `.claude/rules/invariant-call-site-enumeration.md` — the invariant here (\"a dropped observation is\n * counted\") holds at every fire-and-forget security observation in the package, spread across six\n * subtrees, and the recurring defect in this repository is exactly the invariant applied at one of\n * them. Routing every site through one function makes the counting structural rather than\n * remembered: a new fire-and-forget observation that uses this seam is counted the day it lands,\n * with no author having to know this mechanism exists.\n *\n * **Do not quote a call-site count from this file.** An earlier revision named one (\"EIGHT call\n * sites\"), and the very next adoption pass made it wrong — a number in prose is one a reader has to\n * re-measure before believing, which is worse than no number. Measure it:\n *\n * ```bash\n * command grep -rn \"emitAuditObservation(\\|recordAuditObservationLoss(\" engine/saas-backend-lib/src \\\n * | grep -v __tests__ | grep -v audit-observation-emission.backend.ts\n * ```\n */\n\nimport type { MetricsService } from '~wildo-backend-lib/monitoring/observability/services/metrics.service';\n\n/**\n * WHICH security observation was lost.\n *\n * A closed vocabulary with one named runtime source, per `CLAUDE.md` — the member is what a reviewer\n * reads off the alert, so it has to carry its own explanation rather than being a bare string at\n * every call site. It is also the metric's `observation` label: bounded, low cardinality, and stable\n * across renames of the emitting method.\n *\n * ## A member names the EVIDENCE, never the emitter\n *\n * Two members of this enum are emitted from more than one place, and that is the design rather than\n * an omission. `CROSS_TENANT_ADMINISTRATIVE_ACCESS` is raised by the per-instance tenant gate AND by\n * the APPLICATION-scoped collection read; `HTTP_API_READ_THROUGH_ACCESS` by the per-read adapter AND\n * by the per-run ETL pipeline. Splitting either by emitter would make the one question an operator\n * actually asks — *how much cross-tenant evidence did we lose?* — a sum over labels, and a sum\n * somebody has to remember to widen is a sum that goes quietly wrong the day a third emitter lands.\n * WHICH door dropped it is carried by the log line's `context`, which is the channel with room for\n * it; the metric carries the rate, which is the thing that has to aggregate.\n *\n * The corollary: when you add an emitter for an event a member already names, REUSE the member and\n * extend its JSDoc to name the new emitter. A member whose prose still names one of two emitters is\n * a stale claim in the place a reviewer trusts most.\n */\nexport enum AuditObservationKind {\n /**\n * `CROSS_TENANT_ADMINISTRATIVE_ACCESS`, from BOTH doors that can produce one.\n *\n * The most consequential member: this is the operator-crossing trail\n * `.claude/rules/administrative-continuity-floors.md` requires, and the one whose silence is\n * indistinguishable from \"no operator crossed anything\".\n *\n * - `authorizeOrganizations` — the per-instance tenant gate, deciding on ONE fetched row.\n * - `ServiceResourceBackendService.recordCrossTenantReadAccess` — the APPLICATION-scoped\n * collection read, one observation per TENANT reached. The authorizer never sees this half: it\n * runs only for ORGANIZATIONS-scoped resources, and an application-scoped door returns a SET\n * whose rows belong to many tenants. Losing it silently is the larger of the two exposures,\n * because it is the door that can enumerate every tenant at once.\n */\n CROSS_TENANT_ADMINISTRATIVE_ACCESS = 'cross_tenant_administrative_access',\n\n /**\n * `RESOURCE_OPERATION_DENIED` from the authorizer funnel. A lost refusal is a lost negative access\n * decision — the record half of \"record access decisions\".\n */\n AUTHORIZATION_DENIAL = 'authorization_denial',\n\n /**\n * `PLATFORM_ACCESS_GRANT_LIFECYCLE` from the grant custom implementation. A lost transition means\n * an elevation exists whose request/approval is not in the trail.\n */\n PLATFORM_ACCESS_GRANT_LIFECYCLE = 'platform_access_grant_lifecycle',\n\n /**\n * `PLATFORM_DIRECTORY_ACCESS` from `ServiceResourceBackendService.recordPlatformDirectoryAccess` —\n * an APPLICATION-WIDE directory enumeration that no scope confined.\n *\n * `returnedCount` is why the row exists at all: it is the only thing separating \"an operator\n * opened the directory\" from \"an operator exported it\". A lost observation does not merely lose an\n * access record, it loses the SIZE, which is the half a reviewer reads first.\n */\n PLATFORM_DIRECTORY_ACCESS = 'platform_directory_access',\n\n /**\n * `USER_SESSION_EVICTED` from the token issuer's concurrent-session cap.\n *\n * One observation per RETIRED refresh chain, not per enforcement: the cap bounds the blast radius\n * of undetected token theft, so a burst of evictions for one principal is among the more\n * interesting things the trail can carry — and a burst is exactly the case where losing some of\n * the rows understates it. Counting per chain is what keeps the loss signal proportional to the\n * evidence actually lost rather than to the number of times the cap ran.\n */\n USER_SESSION_EVICTED = 'user_session_evicted',\n\n /**\n * `PROVIDER_OPERATION_CALL` from the provider operation executor — one row per OUTBOUND call to a\n * third party, on both the success and the failure path.\n *\n * This is the application's record of what it sent to whom on whose behalf. Its silence is\n * peculiarly misleading: an empty outbound trail reads as \"this deployment integrates with\n * nothing\", which is a sentence somebody will believe.\n */\n PROVIDER_OPERATION_CALL = 'provider_operation_call',\n\n /**\n * The post-call credential-use stamp from the provider operation executor, raised through\n * `ExternalProvidersRegistryBackendService.recordProviderSecretUseForTarget`.\n *\n * ## Why this is on THIS counter even though its PRIMARY sink is not the audit service\n *\n * Its main effect is a write to the spent credential's own row — a tenant's or a person's,\n * whichever the resolution came from — and only its secondary effect is an audit event\n * (`ORGANIZATION_PROVIDER_CREDENTIAL_USED` / `USER_PROVIDER_CREDENTIAL_USED`, emitted by the store).\n * The loss shape is identical either way: fire-and-forget, sink feature-detected, rejection\n * swallowed, nothing counting the drops. The counter's subject is the LOSS OF A SECURITY\n * OBSERVATION, not the identity of the store that was supposed to receive it — so a second counter\n * for one site would fragment the alert without telling an operator anything the `observation`\n * label does not already say.\n *\n * What it evidences is narrow and worth stating: whether a stored credential was ACCEPTED by the\n * provider on last use. Losing it leaves a credential whose health is unknown, which surfaces later\n * as an integration that fails with no record of when it started failing — which is exactly what\n * this deployment had, for the whole life of the seam, while nothing was wired behind it.\n */\n PROVIDER_CREDENTIAL_USE = 'provider_credential_use',\n\n /**\n * `HTTP_API_READ_THROUGH_ACCESS`, from BOTH emitters — see the enum's naming principle above.\n *\n * - `HttpApiResourceRepositoryBackendService.recordReadThroughAccess` — one observation per remote\n * round-trip, and the only tier that witnesses every one of them (repository-direct probes never\n * reach the services tier at all).\n * - `ExternalDataPipelineRunBackendService.recordRunReadThroughAccess` — one observation per ETL\n * run.\n *\n * The evidence at stake is ATTRIBUTION: an HTTP_API read reaches a third party through a SHARED\n * service principal, so this row is what carries the real initiating user through it. Without it\n * the external system's own logs show one principal and nothing anywhere resolves it to a person.\n */\n HTTP_API_READ_THROUGH_ACCESS = 'http_api_read_through_access',\n}\n\n/**\n * WHY the observation never reached the audit pipeline.\n *\n * Three members, and they are genuinely different diagnoses rather than shades of one — see the\n * table in this module's header. `SERVICE_UNAVAILABLE` is a WIRING fault and is usually total and\n * permanent for the life of the process; the other two are runtime faults and are usually partial.\n * Merging them would leave an operator unable to tell \"this deployment audits nothing\" from \"the\n * audit store hiccupped twice\".\n */\nexport enum AuditObservationLossReason {\n /** The audit service is unbound, or the specific `log*` method is absent on the bound instance. */\n SERVICE_UNAVAILABLE = 'service_unavailable',\n /** The emitting call threw synchronously — before any `.catch()` could make it fire-and-forget. */\n EMISSION_THREW = 'emission_threw',\n /** The emitting call returned a promise that rejected. */\n EMISSION_REJECTED = 'emission_rejected',\n}\n\n/**\n * How often ONE `(observation, reason)` pair may produce a log line.\n *\n * Fifteen minutes: long enough that a permanently broken binding costs four lines an hour rather\n * than one per request, short enough that a NEW outage hours after an earlier one still announces\n * itself instead of being swallowed by a latch that never resets. A permanent latch was rejected for\n * exactly that reason — it makes the second incident invisible.\n */\nexport const LOSS_LOG_INTERVAL_MS = 15 * 60 * 1000;\n\n/** The narrow slice of {@link MetricsService} this seam needs. Structural, so a double is trivial. */\nexport interface AuditObservationLossMetricsRecorder {\n recordAuditObservationDropped(params: { observation: string; reason: string }): void;\n}\n\n/**\n * A LAZY door to the recorder, for a site that does not hold one.\n *\n * Most emitters here are plain classes built with `new` (repository adapters, the provider executor)\n * or reach the container only through thunks their builder closes over. Each could resolve the\n * recorder itself — and each would then need its own `try`/`catch`, because a container resolving a\n * binding may throw and an observability failure must never reach the request. Five copies of that\n * guard is precisely the shape `.claude/rules/invariant-call-site-enumeration.md` says will be\n * applied at four of them, so the seam takes the thunk and does the wrapping once.\n *\n * Resolution happens ONLY when there is a loss to record. A site on the happy path never touches its\n * container, which is what makes handing this in unconditionally cheap.\n */\nexport type AuditObservationLossMetricsResolver = () => AuditObservationLossMetricsRecorder | undefined;\n\n/** The narrow slice of the logger this seam needs. Optional everywhere — see {@link emitAuditObservation}. */\nexport interface AuditObservationLossLogger {\n error?: (message: string, context?: Record<string, unknown>) => void;\n}\n\n/** Process-local totals, keyed `<observation>:<reason>`. Not evidence — see the module header. */\nconst lossTotals = new Map<string, number>();\n/** Last log timestamp per `<observation>:<reason>`. Bounded by the enum cross-product (9 entries). */\nconst lastLoggedAt = new Map<string, number>();\n\n/**\n * Every loss recorded since this process started, as `<observation>:<reason>` → count.\n *\n * A COPY, so a caller cannot mutate the accumulator. Exists so the counting can be pinned without an\n * OTLP backend, and so a future health surface has a door that does not require one either. Read the\n * module header before treating the numbers as durable evidence: they are not.\n */\nexport function readAuditObservationLossTotals(): Record<string, number> {\n return Object.fromEntries(lossTotals);\n}\n\n/** Test isolation only. Never called from production code. */\nexport function resetAuditObservationLossTotals(): void {\n lossTotals.clear();\n lastLoggedAt.clear();\n}\n\n/**\n * Record one lost observation. Never throws, under any circumstance.\n *\n * Exported so a site whose emission does not fit {@link emitAuditObservation}'s shape can still\n * contribute to the same counter rather than inventing a second one. Prefer the seam.\n */\nexport function recordAuditObservationLoss(params: {\n observation: AuditObservationKind;\n reason: AuditObservationLossReason;\n /** The recorder itself, when the site already holds one (a container-injected service). */\n metricsService?: AuditObservationLossMetricsRecorder;\n /**\n * A thunk to the recorder, when the site does not. Consulted only if `metricsService` is absent,\n * and only on a loss — see {@link AuditObservationLossMetricsResolver}. Two fields rather than one\n * union: a caller reading `metricsService: X | (() => X)` has to work out which one it holds, and\n * the answer is a property of the CLASS, so it is better spelled at the field.\n */\n metricsResolver?: AuditObservationLossMetricsResolver;\n logger?: AuditObservationLossLogger;\n error?: unknown;\n context?: Record<string, unknown>;\n}): void {\n // The recorder is the LAST thing that may fail the request it observes: a metric backend that\n // throws, or a logger that throws, would defeat the entire purpose of the fire-and-forget contract\n // this seam exists to preserve. Everything below is inside one boundary for that reason.\n try {\n const key = `${params.observation}:${params.reason}`;\n lossTotals.set(key, (lossTotals.get(key) ?? 0) + 1);\n\n // Metrics FIRST. It is the durable, rate-carrying channel, and it must be incremented even for\n // the drops the throttle below decides not to log — otherwise the throttle would silently\n // suppress the count as well as the line, which is the defect one layer up.\n //\n // Feature-DETECTED rather than optional-chained on the object, and for the reason this whole\n // module exists: a container that answers every symbol with a stub (the shape several partial\n // test containers in this package genuinely have) yields a truthy `metricsService` whose method\n // is absent, so `?.` on the OBJECT still calls `undefined(...)` and throws. The outer catch\n // would contain it, but a swallowed TypeError looks exactly like a swallowed real defect — and\n // it would take the log line down with it, leaving the loss silent again.\n const metricsService = params.metricsService ?? resolveLossMetricsRecorder(params.metricsResolver);\n if (typeof metricsService?.recordAuditObservationDropped === 'function') {\n metricsService.recordAuditObservationDropped({\n observation: params.observation,\n reason: params.reason,\n });\n }\n\n const now = Date.now();\n const previous = lastLoggedAt.get(key);\n if (previous !== undefined && now - previous < LOSS_LOG_INTERVAL_MS) return;\n lastLoggedAt.set(key, now);\n\n params.logger?.error?.('A security audit observation was DROPPED before it reached the audit pipeline', {\n // `reason` is the slug an alert rule and a log query both key on; keep it first and stable.\n reason: 'audit_observation_dropped',\n observation: params.observation,\n lossReason: params.reason,\n // The running total makes ONE throttled line carry the volume the suppressed lines would have.\n occurrencesSinceProcessStart: lossTotals.get(key),\n logIntervalMs: LOSS_LOG_INTERVAL_MS,\n ...(params.error === undefined ? {} : { error: describeLossError(params.error) }),\n ...(params.context ?? {}),\n });\n } catch {\n /* An observability failure must never be able to fail the request it observes. */\n }\n}\n\n/**\n * Emit one fire-and-forget audit observation, counting it if it is lost.\n *\n * ## The contract, which is the whole point\n *\n * **This function never throws and never returns a promise.** Not on an absent service, not on a\n * synchronous throw, not on a rejection, and not on a metrics or logger failure. Callers rely on it\n * to preserve the property their own JSDoc promises: the observation cannot fail the request.\n *\n * @param params.emit The emitting call, or `undefined` when the audit service or its method is\n * absent. Passing `undefined` is how a site reports {@link AuditObservationLossReason.SERVICE_UNAVAILABLE}\n * — the feature detection stays at the site because the method name differs per observation, and a\n * generic reflective lookup here would trade a compile-time error for a runtime one.\n */\nexport function emitAuditObservation(params: {\n observation: AuditObservationKind;\n emit: (() => unknown) | undefined;\n metricsService?: AuditObservationLossMetricsRecorder;\n /** See {@link recordAuditObservationLoss}. Never called unless there IS a loss. */\n metricsResolver?: AuditObservationLossMetricsResolver;\n logger?: AuditObservationLossLogger;\n context?: Record<string, unknown>;\n}): void {\n const loss = (reason: AuditObservationLossReason, error?: unknown): void =>\n recordAuditObservationLoss({\n observation: params.observation,\n reason,\n metricsService: params.metricsService,\n metricsResolver: params.metricsResolver,\n logger: params.logger,\n error,\n context: params.context,\n });\n\n try {\n if (!params.emit) {\n loss(AuditObservationLossReason.SERVICE_UNAVAILABLE);\n return;\n }\n\n let result: unknown;\n try {\n result = params.emit();\n } catch (error) {\n // A `log*` method that is absent on a partially-mocked double throws a TypeError HERE —\n // synchronously, before any `.catch()` could attach. That is the shape the feature detection at\n // each site exists to pre-empt; this catch is what keeps a site that forgets it from crashing.\n loss(AuditObservationLossReason.EMISSION_THREW, error);\n return;\n }\n\n // Optional-chained, because an audit method is free to be synchronous (and every test double\n // returning `undefined` is). A non-thenable result is a successful emission, not a loss.\n const thenable = result as { catch?: (handler: (error: unknown) => void) => unknown } | null | undefined;\n if (typeof thenable?.catch !== 'function') return;\n thenable.catch((error) => loss(AuditObservationLossReason.EMISSION_REJECTED, error));\n } catch {\n /* Belt and braces: nothing in this seam may reach the caller. */\n }\n}\n\n/**\n * Ask a site's thunk for the recorder, and treat any refusal as \"no recorder\".\n *\n * Its own `try`, INSIDE the caller's: a container that throws while resolving a binding must not be\n * able to take the LOG channel down with it. Degrading a loss to its log-only form is the correct\n * direction — the whole point of this module is that an observability gap is never a reason to\n * refuse — whereas letting the throw escape to the outer `catch` would silence both channels for the\n * one event that most needs saying.\n */\nfunction resolveLossMetricsRecorder(\n resolver: AuditObservationLossMetricsResolver | undefined,\n): AuditObservationLossMetricsRecorder | undefined {\n if (typeof resolver !== 'function') return undefined;\n try {\n return resolver();\n } catch {\n return undefined;\n }\n}\n\n/**\n * A log-safe description of whatever was thrown.\n *\n * Deliberately local rather than routed through `describeCaughtError`: this module sits UNDER the\n * error subsystem in the dependency order (the error builder's own failures are observations this\n * seam records), and importing upward would make an observability module depend on the layer it\n * observes. The shape is a strict subset of what `describeCaughtError` produces, so a log query\n * reading `error.message` works against both.\n */\nfunction describeLossError(error: unknown): { message: string; name?: string } {\n if (error instanceof Error) return { message: error.message, name: error.name };\n return { message: typeof error === 'string' ? error : String(error) };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"observability.backend.schemas.d.ts","sourceRoot":"","sources":["../../../../../../src/monitoring/observability/models/observability.backend.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAiB;IAGhC,0BAA0B,EAAE,GAAG,CAAC;IAChC,4BAA4B,EAAE,GAAG,CAAC;IAClC,6BAA6B,EAAE,GAAG,CAAC;IACnC,mBAAmB,EAAE,GAAG,CAAC;IACzB,iCAAiC,EAAE,GAAG,CAAC;IAMvC,uBAAuB,EAAE,GAAG,CAAC;IAS7B,qBAAqB,EAAE,GAAG,CAAC;IAU3B,wBAAwB,EAAE,GAAG,CAAC;IAU9B,oCAAoC,EAAE,GAAG,CAAC;IAU1C,sBAAsB,EAAE,GAAG,CAAC;IAW5B,4BAA4B,EAAE,GAAG,CAAC;CACnC"}
1
+ {"version":3,"file":"observability.backend.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/monitoring/observability/models/observability.backend.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAiB;IAGhC,0BAA0B,EAAE,GAAG,CAAC;IAChC,4BAA4B,EAAE,GAAG,CAAC;IAClC,6BAA6B,EAAE,GAAG,CAAC;IACnC,mBAAmB,EAAE,GAAG,CAAC;IACzB,iCAAiC,EAAE,GAAG,CAAC;IAMvC,uBAAuB,EAAE,GAAG,CAAC;IAS7B,qBAAqB,EAAE,GAAG,CAAC;IAU3B,wBAAwB,EAAE,GAAG,CAAC;IAU9B,oCAAoC,EAAE,GAAG,CAAC;IAU1C,sBAAsB,EAAE,GAAG,CAAC;IAW5B,4BAA4B,EAAE,GAAG,CAAC;CACnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"observability.backend.schemas.js","sourceRoot":"","sources":["../../../../../../src/monitoring/observability/models/observability.backend.schemas.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Observability metric definitions consumed by `metrics.service.ts`.\n *\n * Only the metrics with LIVE producers remain: the data-seeding counters\n * (fired by the data-seed dispatcher engines + shared ledger writers) and the\n * M2M outbound-webhook counter (fired by the delivery batch worker). The former\n * HTTP / DB / auth / cache / session / quota / websocket / error definitions\n * were removed in Slice 2 Phase 3 along with the dead, never-registered\n * observability middleware that was their only caller: HTTP traces +\n * `http.server.duration` metrics now come from the OTLP preload's\n * auto-instrumentation (bounded, semconv attributes) rather than a hand-rolled\n * middleware that tagged every series with unbounded `organization_id` /\n * `user_id` labels (edge case E13).\n *\n * History: the self-hosted Jaeger/Prometheus `TelemetryService`,\n * `ObservabilityConfig`, and `TelemetryProviders` were deleted in Phase 1;\n * the Prometheus-era middleware + the dead `TracerService` in Phase 3.\n */\nexport interface MetricDefinitions {\n // Data Seeding (Phase 6.D / F-17 — Prom-style operator metrics).\n // See `metrics.service.ts` for descriptions.\n dataSeedingLazyC1CacheHits: any;\n dataSeedingLazyC1CacheMisses: any;\n dataSeedingThunderHerdBowouts: any;\n dataSeedingRunTotal: any;\n dataSeedingAdminListSeedsDuration: any;\n\n // M2M Outbound Webhook Delivery (Phase 5 / Step 17 — Prom-style\n // operator metrics). Single counter covering every worker outcome\n // at terminal or intermediate return; see `metrics.service.ts`\n // (`recordM2MWebhookDeliveryOutcome`) for labels + semantics.\n m2mWebhookDeliveryTotal: any;\n\n // Compliance Audit-Log Sink failures (Phase 5 / F6 — Prom-style operator\n // metric). One counter incremented whenever a Layer-2 provider audit sink\n // throws while recording an event; the composite (`CompositeAuditLogSink`)\n // isolates the failure so the business op is unaffected, but this makes the\n // otherwise-swallowed failure OBSERVABLE. Labelled by `provider` (the provider\n // ref — immudb, a SIEM, …); bounded, low cardinality. See `metrics.service.ts`\n // (`recordAuditSinkFailure`).\n auditSinkFailureTotal: any;\n\n // Compliance Audit-Log TAMPER detections (Prom-style operator metric). One\n // counter incremented when a tamper-evident audit provider (immudb) PROVES its\n // store was rolled back / tampered between restarts (a durable-state consistency\n // proof failure). DISTINCT from `auditSinkFailureTotal` on purpose: a transient\n // write miss is backfilled by the reconciler, whereas a proven rollback of the\n // audit ledger is a compliance incident that must page a human. Labelled by\n // `provider`; bounded, low cardinality. See `metrics.service.ts`\n // (`recordAuditTamperDetected`).\n auditTamperDetectedTotal: any;\n\n // Compliance Audit-Log assurance DEGRADATIONS. Incremented when a tamper-evident\n // audit provider drops from full cross-restart tamper-evidence to a weaker level\n // (ephemeral mode / corrupt anchor / un-pinned identity change / per-op proof\n // failure). DISTINCT from a PROVEN tamper (`auditTamperDetectedTotal` → page) and a\n // write hiccup (`auditSinkFailureTotal`): a degradation means a FUTURE tamper may go\n // undetected, so it is alertable but non-latching. Labelled by `provider` + `reason`\n // (a small fixed slug set). See `metrics.service.ts`\n // (`recordAuditIntegrityAssuranceDegraded`).\n auditIntegrityAssuranceDegradedTotal: any;\n\n // Compliance Audit-Log LAYER-1 (authoritative DB store) write failures (A-12). One counter\n // incremented when `AuditLogsBackendService._createAuditLog` throws while persisting the authoritative\n // audit row. DISTINCT from `auditSinkFailureTotal` (a Layer-2 provider-sink hiccup the reconciler\n // backfills): a Layer-1 failure means the PRIMARY audit record itself was not persisted — the most\n // severe \"we think we're auditing but we aren't\" state, otherwise invisible on the fire-and-forget\n // path. Label-free (the authoritative store has no provider dimension); bounded, single series. See\n // `metrics.service.ts` (`recordAuditStoreFailure`); the alert rule is specified in\n // `.claude/plans/alerting-system-design-analysis.md` Appendix D.\n auditStoreFailureTotal: any;\n\n // Security audit observations DROPPED before the audit pipeline ever saw them. Incremented by the\n // shared fire-and-forget seam (`audit-observation-emission.backend.ts`) whenever an observation is\n // lost because the audit service is unbound / its `log*` method is absent, the call threw\n // synchronously, or the returned promise rejected. DISTINCT from `auditStoreFailureTotal`, which\n // counts the Layer-1 STORE refusing a write it did receive: this counts the emission never getting\n // that far, which is the shape no existing control could see. Without it a period with no recorded\n // operator crossings is indistinguishable from a period with a broken sink. Labelled by\n // `observation` (which security event was lost) × `reason` (which of the three loss shapes);\n // bounded — 3 × 3 series today. See `metrics.service.ts` (`recordAuditObservationDropped`).\n auditObservationDroppedTotal: any;\n}\n"]}
1
+ {"version":3,"file":"observability.backend.schemas.js","sourceRoot":"","sources":["../../../../../src/monitoring/observability/models/observability.backend.schemas.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Observability metric definitions consumed by `metrics.service.ts`.\n *\n * Only the metrics with LIVE producers remain: the data-seeding counters\n * (fired by the data-seed dispatcher engines + shared ledger writers) and the\n * M2M outbound-webhook counter (fired by the delivery batch worker). The former\n * HTTP / DB / auth / cache / session / quota / websocket / error definitions\n * were removed in Slice 2 Phase 3 along with the dead, never-registered\n * observability middleware that was their only caller: HTTP traces +\n * `http.server.duration` metrics now come from the OTLP preload's\n * auto-instrumentation (bounded, semconv attributes) rather than a hand-rolled\n * middleware that tagged every series with unbounded `organization_id` /\n * `user_id` labels (edge case E13).\n *\n * History: the self-hosted Jaeger/Prometheus `TelemetryService`,\n * `ObservabilityConfig`, and `TelemetryProviders` were deleted in Phase 1;\n * the Prometheus-era middleware + the dead `TracerService` in Phase 3.\n */\nexport interface MetricDefinitions {\n // Data Seeding (Phase 6.D / F-17 — Prom-style operator metrics).\n // See `metrics.service.ts` for descriptions.\n dataSeedingLazyC1CacheHits: any;\n dataSeedingLazyC1CacheMisses: any;\n dataSeedingThunderHerdBowouts: any;\n dataSeedingRunTotal: any;\n dataSeedingAdminListSeedsDuration: any;\n\n // M2M Outbound Webhook Delivery (Phase 5 / Step 17 — Prom-style\n // operator metrics). Single counter covering every worker outcome\n // at terminal or intermediate return; see `metrics.service.ts`\n // (`recordM2MWebhookDeliveryOutcome`) for labels + semantics.\n m2mWebhookDeliveryTotal: any;\n\n // Compliance Audit-Log Sink failures (Phase 5 / F6 — Prom-style operator\n // metric). One counter incremented whenever a Layer-2 provider audit sink\n // throws while recording an event; the composite (`CompositeAuditLogSink`)\n // isolates the failure so the business op is unaffected, but this makes the\n // otherwise-swallowed failure OBSERVABLE. Labelled by `provider` (the provider\n // ref — immudb, a SIEM, …); bounded, low cardinality. See `metrics.service.ts`\n // (`recordAuditSinkFailure`).\n auditSinkFailureTotal: any;\n\n // Compliance Audit-Log TAMPER detections (Prom-style operator metric). One\n // counter incremented when a tamper-evident audit provider (immudb) PROVES its\n // store was rolled back / tampered between restarts (a durable-state consistency\n // proof failure). DISTINCT from `auditSinkFailureTotal` on purpose: a transient\n // write miss is backfilled by the reconciler, whereas a proven rollback of the\n // audit ledger is a compliance incident that must page a human. Labelled by\n // `provider`; bounded, low cardinality. See `metrics.service.ts`\n // (`recordAuditTamperDetected`).\n auditTamperDetectedTotal: any;\n\n // Compliance Audit-Log assurance DEGRADATIONS. Incremented when a tamper-evident\n // audit provider drops from full cross-restart tamper-evidence to a weaker level\n // (ephemeral mode / corrupt anchor / un-pinned identity change / per-op proof\n // failure). DISTINCT from a PROVEN tamper (`auditTamperDetectedTotal` → page) and a\n // write hiccup (`auditSinkFailureTotal`): a degradation means a FUTURE tamper may go\n // undetected, so it is alertable but non-latching. Labelled by `provider` + `reason`\n // (a small fixed slug set). See `metrics.service.ts`\n // (`recordAuditIntegrityAssuranceDegraded`).\n auditIntegrityAssuranceDegradedTotal: any;\n\n // Compliance Audit-Log LAYER-1 (authoritative DB store) write failures (A-12). One counter\n // incremented when `AuditLogsBackendService._createAuditLog` throws while persisting the authoritative\n // audit row. DISTINCT from `auditSinkFailureTotal` (a Layer-2 provider-sink hiccup the reconciler\n // backfills): a Layer-1 failure means the PRIMARY audit record itself was not persisted — the most\n // severe \"we think we're auditing but we aren't\" state, otherwise invisible on the fire-and-forget\n // path. Label-free (the authoritative store has no provider dimension); bounded, single series. See\n // `metrics.service.ts` (`recordAuditStoreFailure`); the alert rule is specified in\n // `.claude/plans/alerting-system-design-analysis.md` Appendix D.\n auditStoreFailureTotal: any;\n\n // Security audit observations DROPPED before the audit pipeline ever saw them. Incremented by the\n // shared fire-and-forget seam (`audit-observation-emission.backend.ts`) whenever an observation is\n // lost because the audit service is unbound / its `log*` method is absent, the call threw\n // synchronously, or the returned promise rejected. DISTINCT from `auditStoreFailureTotal`, which\n // counts the Layer-1 STORE refusing a write it did receive: this counts the emission never getting\n // that far, which is the shape no existing control could see. Without it a period with no recorded\n // operator crossings is indistinguishable from a period with a broken sink. Labelled by\n // `observation` (which security event was lost) × `reason` (which of the three loss shapes);\n // bounded — 3 × 3 series today. See `metrics.service.ts` (`recordAuditObservationDropped`).\n auditObservationDroppedTotal: any;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"otel-preload.d.ts","sourceRoot":"","sources":["../../../../../src/monitoring/observability/otel-preload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,eAAe,CAAC"}
1
+ {"version":3,"file":"otel-preload.d.ts","sourceRoot":"","sources":["../../../../src/monitoring/observability/otel-preload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"otel-sdk-global-handle.d.ts","sourceRoot":"","sources":["../../../../../src/monitoring/observability/otel-sdk-global-handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAID,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAI5D;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
1
+ {"version":3,"file":"otel-sdk-global-handle.d.ts","sourceRoot":"","sources":["../../../../src/monitoring/observability/otel-sdk-global-handle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAID,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAI5D;AAED,+DAA+D;AAC/D,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mock-metrics.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/monitoring/observability/services/__tests__/mock-metrics.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,kBAAkB,CAAC;AAI1B,qBACa,kBAAkB;IAM7B,6BAA6B;iBACN,MAAM;mBAAa,MAAM;cAC9C;IACF,8BAA8B;iBACP,MAAM;mBAAa,MAAM;cAC9C;IACF,kCAAkC;iBAErB,MAAM;mBACJ,MAAM;gBACT,sBAAsB,GAAG,oBAAoB;cAEvD;IACF,oBAAoB;iBAEP,MAAM;cACT,MAAM;gBACJ,MAAM;uBACC,MAAM;mBAKV,MAAM;cAEnB;IAEF,uCAAuC;oBACb,MAAM;mBAAa,MAAM;cACjD;IAEF;;;;OAIG;IACH,KAAK;CAON"}
1
+ {"version":3,"file":"mock-metrics.service.d.ts","sourceRoot":"","sources":["../../../../../../src/monitoring/observability/services/__tests__/mock-metrics.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,kBAAkB,CAAC;AAI1B,qBACa,kBAAkB;IAM7B,6BAA6B;iBACN,MAAM;mBAAa,MAAM;cAC9C;IACF,8BAA8B;iBACP,MAAM;mBAAa,MAAM;cAC9C;IACF,kCAAkC;iBAErB,MAAM;mBACJ,MAAM;gBACT,sBAAsB,GAAG,oBAAoB;cAEvD;IACF,oBAAoB;iBAEP,MAAM;cACT,MAAM;gBACJ,MAAM;uBACC,MAAM;mBAKV,MAAM;cAEnB;IAEF,uCAAuC;oBACb,MAAM;mBAAa,MAAM;cACjD;IAEF;;;;OAIG;IACH,KAAK;CAON"}
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.service.d.ts","sourceRoot":"","sources":["../../../../../../src/monitoring/observability/services/metrics.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;;;;;;;;;GAUG;AACH,qBACa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,kBAAkB,CAAoB;;IAO9C,OAAO,CAAC,iBAAiB;IAsIzB;;;;OAIG;IACI,6BAA6B,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAO1F;;;;OAIG;IACI,8BAA8B,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAO3F;;;;;;;;OAQG;IACI,kCAAkC,CAAC,MAAM,EAAE;QAChD,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,sBAAsB,GAAG,oBAAoB,CAAC;KACvD,GAAG,IAAI;IAQR;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,oBAAoB,CAAC,MAAM,EAAE;QAClC,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAUR;;;;;;;;;;;;;;;OAeG;IACI,uCAAuC,CAAC,MAAM,EAAE;QACrD,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAmCR;;;;;;;;;;;;;;OAcG;IACI,+BAA+B,CAAC,MAAM,EAAE;QAC7C,KAAK,EAAE,aAAa,CAAC;QACrB,OAAO,EACH,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,CAAC;KAC9B,GAAG,IAAI;IAWR;;;;;;;;OAQG;IACI,sBAAsB,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAMpE;;;;;;;;;OASG;IACI,yBAAyB,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAMvE;;;;;;;;;;OAUG;IACI,qCAAqC,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAOnG;;;;;;;;OAQG;IACI,uBAAuB,IAAI,IAAI;IAItC;;;;;;;;;;;;;;;;OAgBG;IACI,6BAA6B,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAM5F"}
1
+ {"version":3,"file":"metrics.service.d.ts","sourceRoot":"","sources":["../../../../../src/monitoring/observability/services/metrics.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D;;;;;;;;;;GAUG;AACH,qBACa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,kBAAkB,CAAoB;;IAO9C,OAAO,CAAC,iBAAiB;IAsIzB;;;;OAIG;IACI,6BAA6B,CAAC,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AW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAOnG;;;;;;;;OAQG;IACI,uBAAuB,IAAI,IAAI;IAItC;;;;;;;;;;;;;;;;OAgBG;IACI,6BAA6B,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAM5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.service.js","sourceRoot":"","sources":["../../../../../../src/monitoring/observability/services/metrics.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC;;;;;;;;;;GAUG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAc;IACjB,KAAK,CAAQ;IACb,kBAAkB,CAAoB;IAE9C;QACE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,kBAAkB,GAAG;YACxB,wEAAwE;YACxE,gEAAgE;YAChE,wEAAwE;YACxE,gEAAgE;YAChE,mEAAmE;YACnE,sCAAsC;YACtC,gEAAgE;YAChE,kEAAkE;YAClE,2CAA2C;YAC3C,sEAAsE;YACtE,gEAAgE;YAChE,mEAAmE;YACnE,gDAAgD;YAChD,sEAAsE;YACtE,qEAAqE;YACrE,mEAAmE;YACnE,oCAAoC;YACpC,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,uCAAuC,EAAE;gBAC5F,WAAW,EAAE,yGAAyG;aACvH,CAAC;YAEF,4BAA4B,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,yCAAyC,EAAE;gBAChG,WAAW,EAAE,2FAA2F;aACz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;;;;;;;;;;;;;;;OAgBG;IACI,6BAA6B,CAAC,MAA+C;QAClF,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC,EAAE;YAC1D,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlZY,cAAc;IAD1B,UAAU,EAAE;;GACA,cAAc,CAkZ1B","sourcesContent":["import { metrics, Meter } from '@opentelemetry/api';\nimport { injectable } from 'inversify';\nimport type { AuthScopeType } from '@wildo-ai/saas-models';\nimport { MetricDefinitions } from '~wildo-backend-lib/monitoring/observability/models/observability.backend.schemas';\n\n/**\n * Records the operator-facing metrics that have LIVE producers — the\n * data-seeding counters (dispatcher engines + shared ledger writers) and the\n * M2M outbound-webhook counter (delivery batch worker). All instruments are\n * created on the global meter, which the OTLP preload (`otel-preload.ts`) wires\n * to the OTLP metric exporter; with no preload the global meter is a no-op, so\n * recording is silently inert (never throws). The former HTTP/DB/auth/etc.\n * `record*` helpers were removed in Slice 2 Phase 3 — their only caller was the\n * dead observability middleware, and HTTP metrics now come from the preload's\n * auto-instrumentation (bounded, semconv) instead of unbounded org/user labels.\n */\n@injectable()\nexport class MetricsService {\n private meter: Meter;\n private metricsDefinitions: MetricDefinitions;\n\n constructor() {\n this.meter = metrics.getMeter('wildo-saas-metrics', '1.0.0');\n this.initializeMetrics();\n }\n\n private initializeMetrics(): void {\n this.metricsDefinitions = {\n // ---------------------------------------------------------------------\n // Data Seeding (Phase 6.D / F-17 — Prom-style operator metrics)\n // ---------------------------------------------------------------------\n // The data-seeding dispatcher exposes four observable concerns:\n // - LAZY C1 cache hit-rate (first-access bootstrap short-circuit\n // effectiveness on the hot path),\n // - LAZY thunder-herd bow-outs (concurrent first-access races\n // resolved silently, distinguishing the \"winner already done\"\n // vs \"winner still running\" branches),\n // - DataSeedRun terminal totals (every COMPLETED / PARTIAL / FAILED\n // ledger transition, per seed × mode × trigger origin — the\n // metric covers ALL engines, current and future, because it is\n // fired from the shared lifecycle writers).\n // Counter names follow the Prometheus convention `_total` suffix; the\n // OpenTelemetry meter is the existing `wildo-saas-metrics` meter, so\n // the counters export via the OTLP metric reader configured in the\n // preload without any extra wiring.\n dataSeedingLazyC1CacheHits: this.meter.createCounter('data_seeding_lazy_c1_cache_hits_total', {\n description: 'LAZY engine C1 idempotency-probe cache hits (already-completed scope, skipped without entry resolution)',\n }),\n\n dataSeedingLazyC1CacheMisses: this.meter.createCounter('data_seeding_lazy_c1_cache_misses_total', {\n description: 'LAZY engine C1 idempotency-probe cache misses (cold-start, run-slot acquisition proceeds)',\n }),\n\n dataSeedingThunderHerdBowouts: this.meter.createCounter('data_seeding_thunder_herd_bowouts_total', {\n description: 'LAZY engine concurrent-first-access races where the slot acquisition lost and the caller bowed out silently',\n }),\n\n dataSeedingRunTotal: this.meter.createCounter('data_seeding_run_total', {\n description: 'DataSeedRun terminal-state writes (COMPLETED / PARTIAL / FAILED) across all dispatcher engines',\n }),\n\n dataSeedingAdminListSeedsDuration: this.meter.createHistogram('data_seeding_admin_list_seeds_duration_ms', {\n description: 'Wall-clock duration of GET /internal/admin/data-seeding/seeds (N+1 lastRun lookup) in milliseconds',\n }),\n\n // ─── M2M Outbound Webhook Delivery (Phase 5 / Step 17) ────\n // One counter covering every worker `doHandle` return — the\n // outcome enum maps 1:1 to the five `M2MWebhookDeliveryBatchOutput.outcome`\n // values (`delivered`, `retry_scheduled`, `failed_terminal`,\n // `skipped_missing_row`, `skipped_already_leased`). Operators\n // answer \"is webhook delivery healthy?\" with\n // rate(m2m_webhook_delivery_total{outcome=\"delivered\"}[5m])\n // / rate(m2m_webhook_delivery_total[5m])\n // Cardinality: 2 `scope` × 5 `outcome` = 10 active series.\n m2mWebhookDeliveryTotal: this.meter.createCounter('m2m_webhook_delivery_total', {\n description: 'M2M outbound webhook delivery terminal / intermediate outcomes (one per worker run)',\n }),\n\n // ─── Compliance Audit-Log Sink Failures (Phase 5 / F6) ────\n // A Layer-2 provider audit sink threw while recording an event. The\n // composite (`CompositeAuditLogSink`) isolates the failure so the business\n // op is unaffected, but a silently-failing audit sink (\"we think we're\n // auditing but we aren't\") must not go unnoticed — this counter makes it\n // observable. Operators alert on\n // rate(audit_sink_failure_total[5m]) > 0\n // Cardinality: one series per declared audit `provider` (immudb, SIEM, …).\n auditSinkFailureTotal: this.meter.createCounter('audit_sink_failure_total', {\n description: 'Compliance audit-log provider sink failures (one per sink throw during event fan-out)',\n }),\n\n // ─── Compliance Audit-Log TAMPER detections ────\n // A tamper-evident audit provider (immudb) PROVED, via its cryptographic\n // durable-state consistency proof, that its store was rolled back / tampered\n // between restarts. DISTINCT from `audit_sink_failure_total`: a transient\n // write miss is backfilled by the reconciler and needs no human, whereas a\n // proven rollback of the audit ledger is a compliance incident. Operators\n // page on\n // increase(audit_tamper_detected_total[1h]) > 0\n // Cardinality: one series per declared audit `provider`.\n auditTamperDetectedTotal: this.meter.createCounter('audit_tamper_detected_total', {\n description: 'Compliance audit-log store tamper/rollback detections (durable-state consistency-proof failures)',\n }),\n\n // ─── Compliance Audit-Log assurance DEGRADATIONS ────\n // A tamper-evident audit provider dropped from FULL cross-restart tamper-evidence to a WEAKER\n // assurance level — ephemeral mode (no durable anchor), a corrupt/unreadable anchor, an un-pinned\n // server-identity change, or a per-op proof failure. DISTINCT from `audit_tamper_detected_total`\n // (a PROVEN rollback → page) and `audit_sink_failure_total` (a write hiccup): a degradation means\n // \"we may not detect a future tamper\" — it should be alerted so the guarantee never lapses silently.\n // Operators alert on\n // increase(audit_integrity_assurance_degraded_total{reason=\"ephemeral\"}[1h]) > 0\n // Cardinality: one series per (provider, reason) — `reason` is a small fixed slug set.\n auditIntegrityAssuranceDegradedTotal: this.meter.createCounter('audit_integrity_assurance_degraded_total', {\n description:\n 'Compliance audit-log assurance degradations (ephemeral / corrupt-anchor / identity-change / per-op proof failure)',\n }),\n\n // ─── Compliance Audit-Log LAYER-1 (authoritative DB store) write failures ────\n // The always-on Layer-1 database audit store (`AuditLogsBackendService._createAuditLog`) threw\n // while writing the authoritative row. DISTINCT from `audit_sink_failure_total` (a Layer-2\n // provider sink — immudb/SIEM — hiccup, backfilled by the reconciler): a Layer-1 failure means\n // the PRIMARY, authoritative audit record itself was NOT persisted — the most severe \"we think\n // we're auditing but we aren't\" state. Emission is fire-and-forget (audit must never break the\n // business op), so without this counter the outage is invisible past a swallowed warn line.\n // Operators alert on\n // rate(audit_store_failure_total[5m]) > 0\n // Cardinality: ONE label-free series (the authoritative store has no provider dimension). The\n // alert rule is specified in `.claude/plans/alerting-system-design-analysis.md` Appendix D.\n auditStoreFailureTotal: this.meter.createCounter('audit_store_failure_total', {\n description: 'Compliance audit-log Layer-1 authoritative DB store write failures (one per _createAuditLog persist throw)',\n }),\n\n // ─── Security audit observations DROPPED before the pipeline saw them ────\n // A fire-and-forget security observation (an operator tenant crossing, an authorization\n // refusal, a platform-access grant transition) never reached `AuditLogsBackendService` at all:\n // the service was unbound or its `log*` method absent, the call threw synchronously, or the\n // returned promise rejected. DISTINCT from `audit_store_failure_total`, which fires INSIDE\n // `_createAuditLog` and therefore only sees emissions that got that far — the drops counted\n // here are exactly the ones it structurally cannot see. Fire-and-forget is deliberate and\n // stays (an observation must never fail the request it observes), so without this counter the\n // loss is completely silent and \"no operator crossings this week\" is indistinguishable from\n // \"the audit service has been unbound since Tuesday\". Operators alert on\n // increase(audit_observation_dropped_total[15m]) > 0\n // Cardinality: 3 `observation` × 3 `reason` = 9 series today, both label sets closed enums.\n auditObservationDroppedTotal: this.meter.createCounter('audit_observation_dropped_total', {\n description:\n 'Security audit observations dropped before reaching the audit pipeline (service unavailable / emission threw / emission rejected)',\n }),\n };\n }\n\n // ---------------------------------------------------------------------------\n // Data Seeding metrics (Phase 6.D / F-17)\n // ---------------------------------------------------------------------------\n // Typed wrappers around the four data-seeding counters so the dispatcher\n // never reaches into the raw OpenTelemetry meter and so all label keys\n // stay consistent (snake_case to match Prometheus convention; the\n // dispatcher passes already-stringified enum values).\n // ---------------------------------------------------------------------------\n\n /**\n * LAZY engine — C1 idempotency-probe cache hit. Fired once per\n * (seed × scope) when `runLazy` short-circuits because a prior\n * COMPLETED `DataSeedRun` row already covers the scope.\n */\n public recordDataSeedingLazyCacheHit(params: { seedKey: string; scopeKind: string }): void {\n this.metricsDefinitions.dataSeedingLazyC1CacheHits.add(1, {\n seed_key: params.seedKey,\n scope_kind: params.scopeKind,\n });\n }\n\n /**\n * LAZY engine — C1 idempotency-probe cache miss. Fired once per\n * (seed × scope) when `runLazy` proceeds past the C1 probe and\n * attempts to acquire a run-slot.\n */\n public recordDataSeedingLazyCacheMiss(params: { seedKey: string; scopeKind: string }): void {\n this.metricsDefinitions.dataSeedingLazyC1CacheMisses.add(1, {\n seed_key: params.seedKey,\n scope_kind: params.scopeKind,\n });\n }\n\n /**\n * LAZY engine — concurrent first-access race resolved by silent\n * bow-out. `reason` mirrors the dispatcher's\n * `acquireLazyRunSlotWithRaceGuard` outcome:\n * - `concurrent-completed` — a winning concurrent caller already\n * wrote a COMPLETED row (data is there);\n * - `concurrent-running` — a winning concurrent caller currently\n * owns the RUNNING slot (data is being written).\n */\n public recordDataSeedingThunderHerdBowout(params: {\n seedKey: string;\n scopeKind: string;\n reason: 'concurrent-completed' | 'concurrent-running';\n }): void {\n this.metricsDefinitions.dataSeedingThunderHerdBowouts.add(1, {\n seed_key: params.seedKey,\n scope_kind: params.scopeKind,\n reason: params.reason,\n });\n }\n\n /**\n * Terminal `DataSeedRun` write — fired exactly once per row\n * transition into COMPLETED / PARTIAL / FAILED. The metric is\n * emitted from the shared lifecycle writers\n * (`completeDataSeedRun` / `failDataSeedRun` /\n * `writeFreshFailedDataSeedRun`) so every dispatcher engine —\n * Level-A application lifecycle, Level-B resource lifecycle, LAZY\n * first-access, MANUAL re-runs, and the deferred Phase-7 cron —\n * contributes uniformly without per-engine wiring.\n *\n * `mode`, `status`, `triggerOrigin`, and `scopeKind` are passed as\n * raw enum string values (the dispatcher does the `.toString()`) so\n * this service stays decoupled from the data-seeding domain enums.\n *\n * Phase 5/6 audit H-2 — `scope_kind` was added to align with the\n * sibling LAZY-engine counters (hit / miss / bow-out) which all\n * carry it. Without `scope_kind`, operators cannot answer\n * \"are my org-scoped seeds healthier than my user-scoped seeds?\",\n * and the deferred Phase-7 cron-scheduler dashboard cannot slice\n * terminal-run health by scope at all (terminal counts are the\n * only signal SYNC / ADDITIVE / UPGRADE seeds emit). Cardinality\n * stays bounded: 5 `DataSeedScopeKind` values × ~200 seeds × 4\n * modes × 4 statuses × ~6 trigger origins ≈ 96K series upper\n * bound; in practice <1K active series.\n */\n public recordDataSeedingRun(params: {\n seedKey: string;\n mode: string;\n status: string;\n triggerOrigin: string;\n scopeKind: string;\n }): void {\n this.metricsDefinitions.dataSeedingRunTotal.add(1, {\n seed_key: params.seedKey,\n mode: params.mode,\n status: params.status,\n trigger_origin: params.triggerOrigin,\n scope_kind: params.scopeKind,\n });\n }\n\n /**\n * Wall-clock duration of the admin `GET /internal/admin/data-seeding/seeds`\n * endpoint in milliseconds. Recorded in the controller around the full\n * registry walk (which fans out N `lastRun` lookups, one per seed).\n *\n * Phase 5/6 audit L-4 — needed because the endpoint is N+1 by design\n * (single registry-wide aggregate would couple the surface to the\n * adapter's grammar; see the controller's `lookupLastRunSummary` JSDoc).\n * The histogram lets operators spot when the seed registry crosses the\n * \"switch to bulk aggregation\" threshold and surface it as a Phase-7\n * dashboard SLO alert.\n *\n * `seedCount` is bucketed coarsely (0, 1-10, 11-50, 51-200, 201+) so\n * label cardinality stays bounded across deployments with widely\n * different seed counts.\n */\n public recordDataSeedingAdminListSeedsDuration(params: {\n durationMs: number;\n seedCount: number;\n }): void {\n const bucket = (() => {\n if (params.seedCount <= 0) return '0';\n if (params.seedCount <= 10) return '1-10';\n if (params.seedCount <= 50) return '11-50';\n if (params.seedCount <= 200) return '51-200';\n return '201+';\n })();\n this.metricsDefinitions.dataSeedingAdminListSeedsDuration.record(params.durationMs, {\n seed_count_bucket: bucket,\n });\n }\n\n // ---------------------------------------------------------------------------\n // M2M Outbound Webhook Delivery metrics (Phase 5 / Step 17)\n // ---------------------------------------------------------------------------\n // Typed wrapper around the single `m2m_webhook_delivery_total` counter so\n // worker call sites never reach into the raw OpenTelemetry meter and so\n // label keys (`scope` / `outcome`) stay consistent. The `scope` parameter\n // is locked to the `AuthScopeType` enum (`'organization' | 'application'`)\n // — passing a typo or a stale string fails type-check rather than silently\n // creating a parallel time series — and `outcome` maps 1:1 to\n // `M2MWebhookDeliveryBatchOutput.outcome`.\n //\n // Firing contract:\n // - Exactly ONCE per worker invocation, at each terminal / intermediate\n // return-point in `m2mWebhookDeliveryBatchService.doHandle`.\n // - NOT fired from the dispatcher's skip paths (feature off / config\n // off / no endpoints) — those never create a delivery row and never\n // emit outbound HTTP, so they are not webhook deliveries by\n // definition.\n //\n // See `.cursor/plans/m2m-webhook-organization-delivery-phase5.md` §D4.\n // ---------------------------------------------------------------------------\n\n /**\n * M2M Outbound Webhook Delivery outcome counter.\n *\n * @param params.scope - `AuthScopeType.ORGANIZATION` (`'organization'`)\n * or `AuthScopeType.APPLICATION` (`'application'`). Locked to the\n * shared `AuthScopeType` enum so a typo or stale literal fails\n * type-check rather than silently creating a parallel time series\n * under a divergent label.\n * @param params.outcome - One of the five\n * `M2MWebhookDeliveryBatchOutput.outcome` values. `delivered` and\n * `failed_terminal` are terminal; `retry_scheduled` is the\n * intermediate retry branch; `skipped_missing_row` /\n * `skipped_already_leased` cover the two skip branches that still\n * consumed a worker slot.\n */\n public recordM2MWebhookDeliveryOutcome(params: {\n scope: AuthScopeType;\n outcome:\n | 'delivered'\n | 'retry_scheduled'\n | 'failed_terminal'\n | 'skipped_missing_row'\n | 'skipped_already_leased';\n }): void {\n this.metricsDefinitions.m2mWebhookDeliveryTotal.add(1, {\n scope: params.scope,\n outcome: params.outcome,\n });\n }\n\n // ---------------------------------------------------------------------------\n // Compliance Audit-Log Sink failures (Phase 5 / F6)\n // ---------------------------------------------------------------------------\n\n /**\n * F6 (audit Phase 5) — a Layer-2 provider audit sink threw while recording an\n * event. Fired by `CompositeAuditLogSink` in its per-sink catch, so an\n * otherwise-swallowed sink failure is OBSERVABLE (→ alert). Synchronous, never\n * throws (the global meter is a no-op without the OTLP preload).\n *\n * @param params.providerRef - The declared audit provider whose sink failed\n * (immudb, a SIEM webhook, …) — the stable, low-cardinality series label.\n */\n public recordAuditSinkFailure(params: { providerRef: string }): void {\n this.metricsDefinitions.auditSinkFailureTotal.add(1, {\n provider: params.providerRef,\n });\n }\n\n /**\n * A tamper-evident audit provider PROVED its store was rolled back / tampered between restarts\n * (its durable-state cryptographic consistency proof failed). Fired by `CompositeAuditLogSink`\n * via the `onIntegrityViolation` hook it threads into the provider sink factory (the sink cannot\n * import this service across the dependency wall). DISTINCT from {@link recordAuditSinkFailure}:\n * this is a compliance incident (page a human), not a backfillable transient miss. Synchronous,\n * never throws (the global meter is a no-op without the OTLP preload).\n *\n * @param params.providerRef - The audit provider whose store proved tampered (immudb, …).\n */\n public recordAuditTamperDetected(params: { providerRef: string }): void {\n this.metricsDefinitions.auditTamperDetectedTotal.add(1, {\n provider: params.providerRef,\n });\n }\n\n /**\n * A tamper-evident audit provider DEGRADED from full cross-restart tamper-evidence to a weaker\n * assurance level (ephemeral mode, a corrupt anchor, an un-pinned server-identity change, or a per-op\n * proof failure). Fired by `CompositeAuditLogSink` via the `onAssuranceDegraded` hook it threads into\n * the provider sink factory. DISTINCT from {@link recordAuditTamperDetected}: a degradation is not a\n * proven tamper, but it means a future tamper may go UNDETECTED — alertable so the guarantee never\n * lapses silently. Non-latching. Synchronous, never throws.\n *\n * @param params.providerRef - The audit provider that degraded (immudb, …).\n * @param params.reason - Stable snake_case slug (`ephemeral`, `anchor_corrupt`, `anchor_identity_change`, `proof_failure_transient`).\n */\n public recordAuditIntegrityAssuranceDegraded(params: { providerRef: string; reason: string }): void {\n this.metricsDefinitions.auditIntegrityAssuranceDegradedTotal.add(1, {\n provider: params.providerRef,\n reason: params.reason,\n });\n }\n\n /**\n * A-12 — the Layer-1 authoritative DB audit store threw while persisting an event. Fired by\n * `AuditLogsBackendService._createAuditLog` in its Layer-1 catch, so the \"the primary audit record\n * itself did not persist\" outage is OBSERVABLE (→ alert) rather than a swallowed warn line on a\n * fire-and-forget path. DISTINCT from {@link recordAuditSinkFailure}: that is a Layer-2 provider sink\n * (immudb/SIEM) hiccup the reconciler backfills; THIS is the authoritative store failing. Synchronous,\n * never throws (the global meter is a no-op without the OTLP preload). Label-free — the authoritative\n * store has no provider dimension. Alert rule: `alerting-system-design-analysis.md` Appendix D.\n */\n public recordAuditStoreFailure(): void {\n this.metricsDefinitions.auditStoreFailureTotal.add(1);\n }\n\n /**\n * A fire-and-forget security audit observation was DROPPED before it reached the audit pipeline.\n * Fired by the shared emission seam (`audit-observation-emission.backend.ts`), which every such\n * observation routes through, so a new observation is counted the day it lands.\n *\n * DISTINCT from {@link recordAuditStoreFailure}, and the distinction is the reason this counter\n * exists: that one fires INSIDE `_createAuditLog`, so it only ever sees an emission that reached\n * the audit service. The three shapes counted here — an unbound service or absent `log*` method, a\n * synchronous throw, a rejected promise — never get that far, and were previously invisible.\n * Merging them into one counter would let a total wiring outage hide behind a store hiccup.\n *\n * Synchronous, never throws (the global meter is a no-op without the OTLP preload — which is why\n * the seam ALSO logs, at a throttled `error`).\n *\n * @param params.observation - `AuditObservationKind` member — WHICH security event was lost.\n * @param params.reason - `AuditObservationLossReason` member — WHICH of the three loss shapes.\n */\n public recordAuditObservationDropped(params: { observation: string; reason: string }): void {\n this.metricsDefinitions.auditObservationDroppedTotal.add(1, {\n observation: params.observation,\n reason: params.reason,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"metrics.service.js","sourceRoot":"","sources":["../../../../../src/monitoring/observability/services/metrics.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU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;IACL,CAAC;IAED,8EAA8E;IAC9E,oDAAoD;IACpD,8EAA8E;IAE9E;;;;;;;;OAQG;IACI,sBAAsB,CAAC,MAA+B;QAC3D,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAAE;YACnD,QAAQ,EAAE,MAAM,CAAC,WAAW;SAC7B,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACI,yBAAyB,CAAC,MAA+B;QAC9D,IAAI,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,EAAE;YACtD,QAAQ,EAAE,MAAM,CAAC,WAAW;SAC7B,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACI,qCAAqC,CAAC,MAA+C;QAC1F,IAAI,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,GAAG,CAAC,CAAC,EAAE;YAClE,QAAQ,EAAE,MAAM,CAAC,WAAW;YAC5B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACI,uBAAuB;QAC5B,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,6BAA6B,CAAC,MAA+C;QAClF,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC,EAAE;YAC1D,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAlZY,cAAc;IAD1B,UAAU,EAAE;;GACA,cAAc,CAkZ1B","sourcesContent":["import { metrics, Meter } from '@opentelemetry/api';\nimport { injectable } from 'inversify';\nimport type { AuthScopeType } from '@wildo-ai/saas-models';\nimport { MetricDefinitions } from '~wildo-backend-lib/monitoring/observability/models/observability.backend.schemas';\n\n/**\n * Records the operator-facing metrics that have LIVE producers — the\n * data-seeding counters (dispatcher engines + shared ledger writers) and the\n * M2M outbound-webhook counter (delivery batch worker). All instruments are\n * created on the global meter, which the OTLP preload (`otel-preload.ts`) wires\n * to the OTLP metric exporter; with no preload the global meter is a no-op, so\n * recording is silently inert (never throws). The former HTTP/DB/auth/etc.\n * `record*` helpers were removed in Slice 2 Phase 3 — their only caller was the\n * dead observability middleware, and HTTP metrics now come from the preload's\n * auto-instrumentation (bounded, semconv) instead of unbounded org/user labels.\n */\n@injectable()\nexport class MetricsService {\n private meter: Meter;\n private metricsDefinitions: MetricDefinitions;\n\n constructor() {\n this.meter = metrics.getMeter('wildo-saas-metrics', '1.0.0');\n this.initializeMetrics();\n }\n\n private initializeMetrics(): void {\n this.metricsDefinitions = {\n // ---------------------------------------------------------------------\n // Data Seeding (Phase 6.D / F-17 — Prom-style operator metrics)\n // ---------------------------------------------------------------------\n // The data-seeding dispatcher exposes four observable concerns:\n // - LAZY C1 cache hit-rate (first-access bootstrap short-circuit\n // effectiveness on the hot path),\n // - LAZY thunder-herd bow-outs (concurrent first-access races\n // resolved silently, distinguishing the \"winner already done\"\n // vs \"winner still running\" branches),\n // - DataSeedRun terminal totals (every COMPLETED / PARTIAL / FAILED\n // ledger transition, per seed × mode × trigger origin — the\n // metric covers ALL engines, current and future, because it is\n // fired from the shared lifecycle writers).\n // Counter names follow the Prometheus convention `_total` suffix; the\n // OpenTelemetry meter is the existing `wildo-saas-metrics` meter, so\n // the counters export via the OTLP metric reader configured in the\n // preload without any extra wiring.\n dataSeedingLazyC1CacheHits: this.meter.createCounter('data_seeding_lazy_c1_cache_hits_total', {\n description: 'LAZY engine C1 idempotency-probe cache hits (already-completed scope, skipped without entry resolution)',\n }),\n\n dataSeedingLazyC1CacheMisses: this.meter.createCounter('data_seeding_lazy_c1_cache_misses_total', {\n description: 'LAZY engine C1 idempotency-probe cache misses (cold-start, run-slot acquisition proceeds)',\n }),\n\n dataSeedingThunderHerdBowouts: this.meter.createCounter('data_seeding_thunder_herd_bowouts_total', {\n description: 'LAZY engine concurrent-first-access races where the slot acquisition lost and the caller bowed out silently',\n }),\n\n dataSeedingRunTotal: this.meter.createCounter('data_seeding_run_total', {\n description: 'DataSeedRun terminal-state writes (COMPLETED / PARTIAL / FAILED) across all dispatcher engines',\n }),\n\n dataSeedingAdminListSeedsDuration: this.meter.createHistogram('data_seeding_admin_list_seeds_duration_ms', {\n description: 'Wall-clock duration of GET /internal/admin/data-seeding/seeds (N+1 lastRun lookup) in milliseconds',\n }),\n\n // ─── M2M Outbound Webhook Delivery (Phase 5 / Step 17) ────\n // One counter covering every worker `doHandle` return — the\n // outcome enum maps 1:1 to the five `M2MWebhookDeliveryBatchOutput.outcome`\n // values (`delivered`, `retry_scheduled`, `failed_terminal`,\n // `skipped_missing_row`, `skipped_already_leased`). Operators\n // answer \"is webhook delivery healthy?\" with\n // rate(m2m_webhook_delivery_total{outcome=\"delivered\"}[5m])\n // / rate(m2m_webhook_delivery_total[5m])\n // Cardinality: 2 `scope` × 5 `outcome` = 10 active series.\n m2mWebhookDeliveryTotal: this.meter.createCounter('m2m_webhook_delivery_total', {\n description: 'M2M outbound webhook delivery terminal / intermediate outcomes (one per worker run)',\n }),\n\n // ─── Compliance Audit-Log Sink Failures (Phase 5 / F6) ────\n // A Layer-2 provider audit sink threw while recording an event. The\n // composite (`CompositeAuditLogSink`) isolates the failure so the business\n // op is unaffected, but a silently-failing audit sink (\"we think we're\n // auditing but we aren't\") must not go unnoticed — this counter makes it\n // observable. Operators alert on\n // rate(audit_sink_failure_total[5m]) > 0\n // Cardinality: one series per declared audit `provider` (immudb, SIEM, …).\n auditSinkFailureTotal: this.meter.createCounter('audit_sink_failure_total', {\n description: 'Compliance audit-log provider sink failures (one per sink throw during event fan-out)',\n }),\n\n // ─── Compliance Audit-Log TAMPER detections ────\n // A tamper-evident audit provider (immudb) PROVED, via its cryptographic\n // durable-state consistency proof, that its store was rolled back / tampered\n // between restarts. DISTINCT from `audit_sink_failure_total`: a transient\n // write miss is backfilled by the reconciler and needs no human, whereas a\n // proven rollback of the audit ledger is a compliance incident. Operators\n // page on\n // increase(audit_tamper_detected_total[1h]) > 0\n // Cardinality: one series per declared audit `provider`.\n auditTamperDetectedTotal: this.meter.createCounter('audit_tamper_detected_total', {\n description: 'Compliance audit-log store tamper/rollback detections (durable-state consistency-proof failures)',\n }),\n\n // ─── Compliance Audit-Log assurance DEGRADATIONS ────\n // A tamper-evident audit provider dropped from FULL cross-restart tamper-evidence to a WEAKER\n // assurance level — ephemeral mode (no durable anchor), a corrupt/unreadable anchor, an un-pinned\n // server-identity change, or a per-op proof failure. DISTINCT from `audit_tamper_detected_total`\n // (a PROVEN rollback → page) and `audit_sink_failure_total` (a write hiccup): a degradation means\n // \"we may not detect a future tamper\" — it should be alerted so the guarantee never lapses silently.\n // Operators alert on\n // increase(audit_integrity_assurance_degraded_total{reason=\"ephemeral\"}[1h]) > 0\n // Cardinality: one series per (provider, reason) — `reason` is a small fixed slug set.\n auditIntegrityAssuranceDegradedTotal: this.meter.createCounter('audit_integrity_assurance_degraded_total', {\n description:\n 'Compliance audit-log assurance degradations (ephemeral / corrupt-anchor / identity-change / per-op proof failure)',\n }),\n\n // ─── Compliance Audit-Log LAYER-1 (authoritative DB store) write failures ────\n // The always-on Layer-1 database audit store (`AuditLogsBackendService._createAuditLog`) threw\n // while writing the authoritative row. DISTINCT from `audit_sink_failure_total` (a Layer-2\n // provider sink — immudb/SIEM — hiccup, backfilled by the reconciler): a Layer-1 failure means\n // the PRIMARY, authoritative audit record itself was NOT persisted — the most severe \"we think\n // we're auditing but we aren't\" state. Emission is fire-and-forget (audit must never break the\n // business op), so without this counter the outage is invisible past a swallowed warn line.\n // Operators alert on\n // rate(audit_store_failure_total[5m]) > 0\n // Cardinality: ONE label-free series (the authoritative store has no provider dimension). The\n // alert rule is specified in `.claude/plans/alerting-system-design-analysis.md` Appendix D.\n auditStoreFailureTotal: this.meter.createCounter('audit_store_failure_total', {\n description: 'Compliance audit-log Layer-1 authoritative DB store write failures (one per _createAuditLog persist throw)',\n }),\n\n // ─── Security audit observations DROPPED before the pipeline saw them ────\n // A fire-and-forget security observation (an operator tenant crossing, an authorization\n // refusal, a platform-access grant transition) never reached `AuditLogsBackendService` at all:\n // the service was unbound or its `log*` method absent, the call threw synchronously, or the\n // returned promise rejected. DISTINCT from `audit_store_failure_total`, which fires INSIDE\n // `_createAuditLog` and therefore only sees emissions that got that far — the drops counted\n // here are exactly the ones it structurally cannot see. Fire-and-forget is deliberate and\n // stays (an observation must never fail the request it observes), so without this counter the\n // loss is completely silent and \"no operator crossings this week\" is indistinguishable from\n // \"the audit service has been unbound since Tuesday\". Operators alert on\n // increase(audit_observation_dropped_total[15m]) > 0\n // Cardinality: 3 `observation` × 3 `reason` = 9 series today, both label sets closed enums.\n auditObservationDroppedTotal: this.meter.createCounter('audit_observation_dropped_total', {\n description:\n 'Security audit observations dropped before reaching the audit pipeline (service unavailable / emission threw / emission rejected)',\n }),\n };\n }\n\n // ---------------------------------------------------------------------------\n // Data Seeding metrics (Phase 6.D / F-17)\n // ---------------------------------------------------------------------------\n // Typed wrappers around the four data-seeding counters so the dispatcher\n // never reaches into the raw OpenTelemetry meter and so all label keys\n // stay consistent (snake_case to match Prometheus convention; the\n // dispatcher passes already-stringified enum values).\n // ---------------------------------------------------------------------------\n\n /**\n * LAZY engine — C1 idempotency-probe cache hit. Fired once per\n * (seed × scope) when `runLazy` short-circuits because a prior\n * COMPLETED `DataSeedRun` row already covers the scope.\n */\n public recordDataSeedingLazyCacheHit(params: { seedKey: string; scopeKind: string }): void {\n this.metricsDefinitions.dataSeedingLazyC1CacheHits.add(1, {\n seed_key: params.seedKey,\n scope_kind: params.scopeKind,\n });\n }\n\n /**\n * LAZY engine — C1 idempotency-probe cache miss. Fired once per\n * (seed × scope) when `runLazy` proceeds past the C1 probe and\n * attempts to acquire a run-slot.\n */\n public recordDataSeedingLazyCacheMiss(params: { seedKey: string; scopeKind: string }): void {\n this.metricsDefinitions.dataSeedingLazyC1CacheMisses.add(1, {\n seed_key: params.seedKey,\n scope_kind: params.scopeKind,\n });\n }\n\n /**\n * LAZY engine — concurrent first-access race resolved by silent\n * bow-out. `reason` mirrors the dispatcher's\n * `acquireLazyRunSlotWithRaceGuard` outcome:\n * - `concurrent-completed` — a winning concurrent caller already\n * wrote a COMPLETED row (data is there);\n * - `concurrent-running` — a winning concurrent caller currently\n * owns the RUNNING slot (data is being written).\n */\n public recordDataSeedingThunderHerdBowout(params: {\n seedKey: string;\n scopeKind: string;\n reason: 'concurrent-completed' | 'concurrent-running';\n }): void {\n this.metricsDefinitions.dataSeedingThunderHerdBowouts.add(1, {\n seed_key: params.seedKey,\n scope_kind: params.scopeKind,\n reason: params.reason,\n });\n }\n\n /**\n * Terminal `DataSeedRun` write — fired exactly once per row\n * transition into COMPLETED / PARTIAL / FAILED. The metric is\n * emitted from the shared lifecycle writers\n * (`completeDataSeedRun` / `failDataSeedRun` /\n * `writeFreshFailedDataSeedRun`) so every dispatcher engine —\n * Level-A application lifecycle, Level-B resource lifecycle, LAZY\n * first-access, MANUAL re-runs, and the deferred Phase-7 cron —\n * contributes uniformly without per-engine wiring.\n *\n * `mode`, `status`, `triggerOrigin`, and `scopeKind` are passed as\n * raw enum string values (the dispatcher does the `.toString()`) so\n * this service stays decoupled from the data-seeding domain enums.\n *\n * Phase 5/6 audit H-2 — `scope_kind` was added to align with the\n * sibling LAZY-engine counters (hit / miss / bow-out) which all\n * carry it. Without `scope_kind`, operators cannot answer\n * \"are my org-scoped seeds healthier than my user-scoped seeds?\",\n * and the deferred Phase-7 cron-scheduler dashboard cannot slice\n * terminal-run health by scope at all (terminal counts are the\n * only signal SYNC / ADDITIVE / UPGRADE seeds emit). Cardinality\n * stays bounded: 5 `DataSeedScopeKind` values × ~200 seeds × 4\n * modes × 4 statuses × ~6 trigger origins ≈ 96K series upper\n * bound; in practice <1K active series.\n */\n public recordDataSeedingRun(params: {\n seedKey: string;\n mode: string;\n status: string;\n triggerOrigin: string;\n scopeKind: string;\n }): void {\n this.metricsDefinitions.dataSeedingRunTotal.add(1, {\n seed_key: params.seedKey,\n mode: params.mode,\n status: params.status,\n trigger_origin: params.triggerOrigin,\n scope_kind: params.scopeKind,\n });\n }\n\n /**\n * Wall-clock duration of the admin `GET /internal/admin/data-seeding/seeds`\n * endpoint in milliseconds. Recorded in the controller around the full\n * registry walk (which fans out N `lastRun` lookups, one per seed).\n *\n * Phase 5/6 audit L-4 — needed because the endpoint is N+1 by design\n * (single registry-wide aggregate would couple the surface to the\n * adapter's grammar; see the controller's `lookupLastRunSummary` JSDoc).\n * The histogram lets operators spot when the seed registry crosses the\n * \"switch to bulk aggregation\" threshold and surface it as a Phase-7\n * dashboard SLO alert.\n *\n * `seedCount` is bucketed coarsely (0, 1-10, 11-50, 51-200, 201+) so\n * label cardinality stays bounded across deployments with widely\n * different seed counts.\n */\n public recordDataSeedingAdminListSeedsDuration(params: {\n durationMs: number;\n seedCount: number;\n }): void {\n const bucket = (() => {\n if (params.seedCount <= 0) return '0';\n if (params.seedCount <= 10) return '1-10';\n if (params.seedCount <= 50) return '11-50';\n if (params.seedCount <= 200) return '51-200';\n return '201+';\n })();\n this.metricsDefinitions.dataSeedingAdminListSeedsDuration.record(params.durationMs, {\n seed_count_bucket: bucket,\n });\n }\n\n // ---------------------------------------------------------------------------\n // M2M Outbound Webhook Delivery metrics (Phase 5 / Step 17)\n // ---------------------------------------------------------------------------\n // Typed wrapper around the single `m2m_webhook_delivery_total` counter so\n // worker call sites never reach into the raw OpenTelemetry meter and so\n // label keys (`scope` / `outcome`) stay consistent. The `scope` parameter\n // is locked to the `AuthScopeType` enum (`'organization' | 'application'`)\n // — passing a typo or a stale string fails type-check rather than silently\n // creating a parallel time series — and `outcome` maps 1:1 to\n // `M2MWebhookDeliveryBatchOutput.outcome`.\n //\n // Firing contract:\n // - Exactly ONCE per worker invocation, at each terminal / intermediate\n // return-point in `m2mWebhookDeliveryBatchService.doHandle`.\n // - NOT fired from the dispatcher's skip paths (feature off / config\n // off / no endpoints) — those never create a delivery row and never\n // emit outbound HTTP, so they are not webhook deliveries by\n // definition.\n //\n // See `.cursor/plans/m2m-webhook-organization-delivery-phase5.md` §D4.\n // ---------------------------------------------------------------------------\n\n /**\n * M2M Outbound Webhook Delivery outcome counter.\n *\n * @param params.scope - `AuthScopeType.ORGANIZATION` (`'organization'`)\n * or `AuthScopeType.APPLICATION` (`'application'`). Locked to the\n * shared `AuthScopeType` enum so a typo or stale literal fails\n * type-check rather than silently creating a parallel time series\n * under a divergent label.\n * @param params.outcome - One of the five\n * `M2MWebhookDeliveryBatchOutput.outcome` values. `delivered` and\n * `failed_terminal` are terminal; `retry_scheduled` is the\n * intermediate retry branch; `skipped_missing_row` /\n * `skipped_already_leased` cover the two skip branches that still\n * consumed a worker slot.\n */\n public recordM2MWebhookDeliveryOutcome(params: {\n scope: AuthScopeType;\n outcome:\n | 'delivered'\n | 'retry_scheduled'\n | 'failed_terminal'\n | 'skipped_missing_row'\n | 'skipped_already_leased';\n }): void {\n this.metricsDefinitions.m2mWebhookDeliveryTotal.add(1, {\n scope: params.scope,\n outcome: params.outcome,\n });\n }\n\n // ---------------------------------------------------------------------------\n // Compliance Audit-Log Sink failures (Phase 5 / F6)\n // ---------------------------------------------------------------------------\n\n /**\n * F6 (audit Phase 5) — a Layer-2 provider audit sink threw while recording an\n * event. Fired by `CompositeAuditLogSink` in its per-sink catch, so an\n * otherwise-swallowed sink failure is OBSERVABLE (→ alert). Synchronous, never\n * throws (the global meter is a no-op without the OTLP preload).\n *\n * @param params.providerRef - The declared audit provider whose sink failed\n * (immudb, a SIEM webhook, …) — the stable, low-cardinality series label.\n */\n public recordAuditSinkFailure(params: { providerRef: string }): void {\n this.metricsDefinitions.auditSinkFailureTotal.add(1, {\n provider: params.providerRef,\n });\n }\n\n /**\n * A tamper-evident audit provider PROVED its store was rolled back / tampered between restarts\n * (its durable-state cryptographic consistency proof failed). Fired by `CompositeAuditLogSink`\n * via the `onIntegrityViolation` hook it threads into the provider sink factory (the sink cannot\n * import this service across the dependency wall). DISTINCT from {@link recordAuditSinkFailure}:\n * this is a compliance incident (page a human), not a backfillable transient miss. Synchronous,\n * never throws (the global meter is a no-op without the OTLP preload).\n *\n * @param params.providerRef - The audit provider whose store proved tampered (immudb, …).\n */\n public recordAuditTamperDetected(params: { providerRef: string }): void {\n this.metricsDefinitions.auditTamperDetectedTotal.add(1, {\n provider: params.providerRef,\n });\n }\n\n /**\n * A tamper-evident audit provider DEGRADED from full cross-restart tamper-evidence to a weaker\n * assurance level (ephemeral mode, a corrupt anchor, an un-pinned server-identity change, or a per-op\n * proof failure). Fired by `CompositeAuditLogSink` via the `onAssuranceDegraded` hook it threads into\n * the provider sink factory. DISTINCT from {@link recordAuditTamperDetected}: a degradation is not a\n * proven tamper, but it means a future tamper may go UNDETECTED — alertable so the guarantee never\n * lapses silently. Non-latching. Synchronous, never throws.\n *\n * @param params.providerRef - The audit provider that degraded (immudb, …).\n * @param params.reason - Stable snake_case slug (`ephemeral`, `anchor_corrupt`, `anchor_identity_change`, `proof_failure_transient`).\n */\n public recordAuditIntegrityAssuranceDegraded(params: { providerRef: string; reason: string }): void {\n this.metricsDefinitions.auditIntegrityAssuranceDegradedTotal.add(1, {\n provider: params.providerRef,\n reason: params.reason,\n });\n }\n\n /**\n * A-12 — the Layer-1 authoritative DB audit store threw while persisting an event. Fired by\n * `AuditLogsBackendService._createAuditLog` in its Layer-1 catch, so the \"the primary audit record\n * itself did not persist\" outage is OBSERVABLE (→ alert) rather than a swallowed warn line on a\n * fire-and-forget path. DISTINCT from {@link recordAuditSinkFailure}: that is a Layer-2 provider sink\n * (immudb/SIEM) hiccup the reconciler backfills; THIS is the authoritative store failing. Synchronous,\n * never throws (the global meter is a no-op without the OTLP preload). Label-free — the authoritative\n * store has no provider dimension. Alert rule: `alerting-system-design-analysis.md` Appendix D.\n */\n public recordAuditStoreFailure(): void {\n this.metricsDefinitions.auditStoreFailureTotal.add(1);\n }\n\n /**\n * A fire-and-forget security audit observation was DROPPED before it reached the audit pipeline.\n * Fired by the shared emission seam (`audit-observation-emission.backend.ts`), which every such\n * observation routes through, so a new observation is counted the day it lands.\n *\n * DISTINCT from {@link recordAuditStoreFailure}, and the distinction is the reason this counter\n * exists: that one fires INSIDE `_createAuditLog`, so it only ever sees an emission that reached\n * the audit service. The three shapes counted here — an unbound service or absent `log*` method, a\n * synchronous throw, a rejected promise — never get that far, and were previously invisible.\n * Merging them into one counter would let a total wiring outage hide behind a store hiccup.\n *\n * Synchronous, never throws (the global meter is a no-op without the OTLP preload — which is why\n * the seam ALSO logs, at a throttled `error`).\n *\n * @param params.observation - `AuditObservationKind` member — WHICH security event was lost.\n * @param params.reason - `AuditObservationLossReason` member — WHICH of the three loss shapes.\n */\n public recordAuditObservationDropped(params: { observation: string; reason: string }): void {\n this.metricsDefinitions.auditObservationDroppedTotal.add(1, {\n observation: params.observation,\n reason: params.reason,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"observability.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/monitoring/observability/services/observability.backend.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,uCAAuC,EAAE,MAAM,4FAA4F,CAAC;AACrJ,OAAO,EAAE,mCAAmC,EAAE,MAAM,kEAAkE,CAAC;AAGvH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBACa,2BAA2B;IAKpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAE1C,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAftC,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAI9D,MAAM,EAAE,aAAa,EAErB,yBAAyB,EAAE,uCAAuC,EAElE,qBAAqB,EAAE,mCAAmC;IAC3E;;;;OAIG;IAEc,kBAAkB,CAAC,EAAE,kBAAkB;IAM1D;;;OAGG;IACI,UAAU,IAAI,IAAI;IAiBzB,yEAAyE;IACzE,OAAO,CAAC,SAAS;IAkCjB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA4BzB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,yBAAyB;CAuBlC"}
1
+ {"version":3,"file":"observability.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/monitoring/observability/services/observability.backend.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,uCAAuC,EAAE,MAAM,4FAA4F,CAAC;AACrJ,OAAO,EAAE,mCAAmC,EAAE,MAAM,kEAAkE,CAAC;AAGvH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBACa,2BAA2B;IAKpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,yBAAyB;IAE1C,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC;;;;OAIG;IAEH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAftC,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAI9D,MAAM,EAAE,aAAa,EAErB,yBAAyB,EAAE,uCAAuC,EAElE,qBAAqB,EAAE,mCAAmC;IAC3E;;;;OAIG;IAEc,kBAAkB,CAAC,EAAE,kBAAkB;IAM1D;;;OAGG;IACI,UAAU,IAAI,IAAI;IAiBzB,yEAAyE;IACzE,OAAO,CAAC,SAAS;IAkCjB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA4BzB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,yBAAyB;CAuBlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-components.d.ts","sourceRoot":"","sources":["../../../../../../src/notifications/email/components/email-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAG5G,YAAY,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAM5G,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+BlD,CAAC;AAMF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoB/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqBjD,CAAC;AAMF,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAA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,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgB5C,CAAC;AAOF,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,EACH,MAAM,EACN,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,EAAE,EACF,OAAO,EACP,OAAO,GACR,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"email-components.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/email/components/email-components.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmB/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAG5G,YAAY,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAM5G,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+BlD,CAAC;AAMF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,a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G,CAAC,GAAG,CAAC,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwBlD,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAgB5C,CAAC;AAOF,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,EACH,MAAM,EACN,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,GAAG,EACH,EAAE,EACF,OAAO,EACP,OAAO,GACR,MAAM,yBAAyB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-definition.d.ts","sourceRoot":"","sources":["../../../../../../src/notifications/email/models/email-template-definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC5D,OAAO,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,gEAAgE;IAChE,MAAM,EAAE,CAAC,CAAC;CACX;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACjE,+CAA+C;IAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IAClD,mDAAmD;IACnD,IAAI,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC;IACrD,+DAA+D;IAC/D,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACvC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC7E,oEAAoE"}
1
+ {"version":3,"file":"email-template-definition.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/email/models/email-template-definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC5D,OAAO,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,gEAAgE;IAChE,MAAM,EAAE,CAAC,CAAC;CACX;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACjE,+CAA+C;IAC/C,OAAO,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;IAClD,mDAAmD;IACnD,IAAI,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC;IACrD,+DAA+D;IAC/D,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACvC,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAC7E,oEAAoE"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-transport.backend.definitions.d.ts","sourceRoot":"","sources":["../../../../../../src/notifications/email/models/email-transport.backend.definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,QAAS,CAAC"}
1
+ {"version":3,"file":"email-transport.backend.definitions.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/email/models/email-transport.backend.definitions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,QAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-batch-send.batch.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/notifications/email/services/email-batch-send.batch.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,sCAAsC,EAC5C,MAAM,4FAA4F,CAAC;AAKpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AA0CjE;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAwB5E;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;iBASrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,sCAAsC,CACxE,OAAO,yBAAyB,EAChC,OAAO,0BAA0B,CAmKjC,CAAC"}
1
+ {"version":3,"file":"email-batch-send.batch.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/email/services/email-batch-send.batch.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,sCAAsC,EAC5C,MAAM,4FAA4F,CAAC;AAKpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AA0CjE;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAwB5E;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;iBASrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,sCAAsC,CACxE,OAAO,yBAAyB,EAChC,OAAO,0BAA0B,CAmKjC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-registry.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/notifications/email/services/email-template-registry.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACnH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAOpH,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,yEAAyE,CAAC;AAEjF,qFAAqF;AACrF,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB;AAOD,qBACa,mCAAmC;IAMT,OAAO,CAAC,QAAQ,CAAC,MAAM;IACV,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7E,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IARnC,OAAO,CAAC,OAAO,CAAuD;IAEtE,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAG3B,MAAM,EAAE,aAAa,EACR,YAAY,EAAE,0BAA0B,EAExF,gBAAgB,EAAE,uBAAuB;IAM5D;;;;;OAKG;IACH,UAAU,CAAC,WAAW,EAAE,2BAA2B,GAAG,IAAI;IAgB1D;;;;;;;;OAQG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,qBAAqB;IAiCnH;;;;;OAKG;IACH,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB;IAatE,4EAA4E;IAC5E,iBAAiB,IAAI,MAAM,EAAE;IAY7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,OAAO,CAAC,8BAA8B;IAyCtC;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,0BAA0B;IAIlC;;;;;OAKG;IACH,OAAO,CAAC,2BAA2B;CAGpC"}
1
+ {"version":3,"file":"email-template-registry.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/email/services/email-template-registry.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACnH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAOpH,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC5B,MAAM,yEAAyE,CAAC;AAEjF,qFAAqF;AACrF,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB;AAOD,qBACa,mCAAmC;IAMT,OAAO,CAAC,QAAQ,CAAC,MAAM;IACV,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7E,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IARnC,OAAO,CAAC,OAAO,CAAuD;IAEtE,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAG3B,MAAM,EAAE,aAAa,EACR,YAAY,EAAE,0BAA0B,EAExF,gBAAgB,EAAE,uBAAuB;IAM5D;;;;;OAKG;IACH,UAAU,CAAC,WAAW,EAAE,2BAA2B,GAAG,IAAI;IAgB1D;;;;;;;;OAQG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,qBAAqB;IAiCnH;;;;;OAKG;IACH,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB;IAatE,4EAA4E;IAC5E,iBAAiB,IAAI,MAAM,EAAE;IAY7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,OAAO,CAAC,8BAA8B;IAyCtC;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,0BAA0B;IAIlC;;;;;OAKG;IACH,OAAO,CAAC,2BAA2B;CAGpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-registry.backend.service.js","sourceRoot":"","sources":["../../../../../../src/notifications/email/services/email-template-registry.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;;;;;;;;;;;;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAIpF,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EAAE,SAAS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AAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IACpC,CAAC;IAEO,kBAAkB,CAAC,WAAmB,EAAE,YAAsB;QACpE,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CACjC,SAAS,CAAC,aAAa,EACvB,SAAS,EACT;YACE,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB,WAAW,+BAA+B,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBAChG,WAAW;gBACX,YAAY;aACb;SACF,CACF,CAAC;IACJ,CAAC;IAEO,0BAA0B;QAChC,OAAO,4BAA4B,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAED;;;;;OAKG;IACK,2BAA2B;QACjC,OAAO,6BAA6B,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrE,CAAC;CACF,CAAA;AAtQY,mCAAmC;IAD/C,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;;GARnC,mCAAmC,CAsQ/C","sourcesContent":["/**\n * Email Template Registry Backend Service\n *\n * In-memory registry for file-based email template definitions.\n * Templates are injected at startup from app-custom via initialize().\n * Resolution uses exact templateRef match with i18n locale fallback.\n *\n * Each template is a locale-agnostic definition (`template.tsx`) paired\n * with co-located per-locale label files (`labels.{locale}.ts`).\n */\n\nimport { injectable, inject } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport {\n getConfiguredEnabledLanguages,\n getConfiguredFallbackLanguage,\n getConfiguredPrimaryLanguage,\n} from '~wildo-backend-lib/config/services/app-configuration.backend.utils';\nimport { ErrorType, getAllSystemTemplateRefs, type WildoError_Backend } from '@wildo-ai/saas-models';\nimport type {\n EmailTemplateDefinition,\n EmailTemplateDefinitionsMap,\n} from '~wildo-backend-lib/notifications/email/models/email-template-definition';\n\n/** Resolved template returned by `resolve()`: definition + locale-matched labels. */\nexport interface ResolvedEmailTemplate {\n definition: EmailTemplateDefinition<any>;\n labels: Record<string, string>;\n resolvedLocale: string;\n}\n\ninterface RegistryLocaleEntry {\n definition: EmailTemplateDefinition<any>;\n labels: Record<string, string>;\n}\n\n@injectable()\nexport class EmailTemplateRegistryBackendService {\n private entries = new Map<string, Map<string, RegistryLocaleEntry>>();\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService)\n private readonly appConfigService: AppConfigurationService,\n ) {\n this.logDebug = this.logger.debugByType('EmailTemplateRegistry');\n this.logger.setDebugTypeLogging('EmailTemplateRegistry', false);\n }\n\n /**\n * Populate the registry from the app-custom template map.\n *\n * Keys are bare `templateRef` values. Each entry has a locale-agnostic\n * template definition + per-locale label objects.\n */\n initialize(definitions: EmailTemplateDefinitionsMap): void {\n this.entries.clear();\n\n for (const [templateRef, entry] of Object.entries(definitions)) {\n const localeMap = new Map<string, RegistryLocaleEntry>();\n for (const [locale, labels] of Object.entries(entry.labels)) {\n localeMap.set(locale, { definition: entry.template, labels });\n }\n this.entries.set(templateRef, localeMap);\n }\n\n const { templateCount, locales } = this.computeStats();\n this.logger.info(`✅ Email template registry: ${templateCount} template(s) across ${locales.size} locale(s)`);\n this.validateTemplateLocaleCoverage(locales);\n }\n\n /**\n * Resolve a template by ref with i18n locale fallback.\n *\n * 1. Exact locale match (e.g. fr-CA)\n * 2. Base language fallback (e.g. fr)\n * 3. Configured fallback locale\n * 4. Configured primary locale\n * 5. Throw if none found\n */\n resolve(templateRef: string, locale: string, primaryLocale: string, fallbackLocale?: string): ResolvedEmailTemplate {\n const localeMap = this.entries.get(templateRef);\n if (!localeMap) {\n throw this.buildNotFoundError(templateRef, [locale, fallbackLocale, primaryLocale].filter((value): value is string => !!value));\n }\n\n const candidates = [locale];\n const baseLanguage = locale.includes('-') ? locale.split('-')[0] : null;\n if (baseLanguage && baseLanguage !== locale) {\n candidates.push(baseLanguage);\n }\n if (fallbackLocale && !candidates.includes(fallbackLocale)) {\n candidates.push(fallbackLocale);\n }\n if (!candidates.includes(primaryLocale)) {\n candidates.push(primaryLocale);\n }\n\n for (const candidateLocale of candidates) {\n const entry = localeMap.get(candidateLocale);\n if (entry) {\n this.logDebug('Template resolved', { templateRef, resolvedLocale: candidateLocale });\n return {\n definition: entry.definition,\n labels: entry.labels,\n resolvedLocale: candidateLocale,\n };\n }\n }\n\n throw this.buildNotFoundError(templateRef, candidates);\n }\n\n /**\n * Resolve exactly as runtime email delivery does for the application's\n * configured primary/fallback locales. Startup contract validation uses this\n * seam so template existence is proven against the same locale semantics as\n * a later send.\n */\n resolveForConfiguredLocale(templateRef: string): ResolvedEmailTemplate {\n const primaryLocale =\n getConfiguredPrimaryLanguage(this.appConfigService.config);\n const fallbackLocale =\n getConfiguredFallbackLanguage(this.appConfigService.config);\n return this.resolve(\n templateRef,\n primaryLocale,\n primaryLocale,\n fallbackLocale,\n );\n }\n\n /** Return all registered keys as `{templateRef}/{locale}` (diagnostics). */\n getRegisteredKeys(): string[] {\n const keys: string[] = [];\n for (const [templateRef, localeMap] of this.entries) {\n for (const locale of localeMap.keys()) {\n keys.push(`${templateRef}/${locale}`);\n }\n }\n return keys;\n }\n\n // ── Validation ─────────────────────────────────────────────────\n\n /**\n * Report email-template coverage against EVERY locale the application enables, not only the one\n * it authors natively.\n *\n * ## What was wrong\n *\n * This check resolved the configured primary locale once and tested only that. An application\n * that declares `enabledLanguages: [en, fr]` and ships ninety-five `labels.en.ts` files and zero\n * `labels.fr.ts` files started with a clean log — Wonder Todos, measured 2026-09-08. Every French\n * recipient then silently received English, because {@link resolve} falls back through the\n * configured chain and lands on the primary. Nothing anywhere said so: the frontend reads\n * `enabledLanguages` and the dev companion reads it, but no backend surface did, so \"the locale\n * this application owns\" was standing in for \"the locales this application serves\".\n *\n * ## Loudness — a WARNING, deliberately, and not an ERROR\n *\n * Enabling a language and authoring its email copy are separate acts that happen in that order:\n * the copy is produced afterwards by the label/translate pipeline. Refusing to boot on the gap\n * would mean an application cannot start between the two, which is the exact trade the operation\n * email-template validator already settled in the other direction — \"refusing to START an\n * application because a notice is unauthored trades a missing email for a total outage, which is\n * the worse failure\" (`collectOperationEmailTemplateIssues`). A missing SECONDARY locale is\n * strictly milder than the case that reasoning was written about: the notice is still delivered,\n * in the wrong language.\n *\n * That is also why this stays inside the registry rather than being handed to the startup config\n * validator, whose token-backed path is an ERROR that crash-loops a boot. Widening\n * {@link resolveForConfiguredLocale} — the seam that validator resolves through — to demand every\n * enabled locale would have converted \"ninety-five emails arrive in English\" into \"this\n * application cannot start\", for the one application the finding came from.\n *\n * The warning is not a shrug: it is emitted per non-covered locale, separates the two severities\n * below, and names the exact `labels.<locale>.ts` file an author has to create — so it is\n * actionable from the log line alone rather than after an audit.\n *\n * ## The two severities it separates\n *\n * - **Primary locale** — nothing to fall back TO. A system ref absent here cannot be rendered at\n * all, and the send raises `CONFIGURATION`. This is the pre-existing check, unchanged in\n * meaning.\n * - **Any other enabled locale** — the template resolves, in the wrong language. Reported for\n * every registered ref rather than only the twelve system ones, because the population that\n * goes untranslated is the whole catalog (83 of Wonder Todos' 95 are resource/operation\n * templates, which the system-ref loop cannot see).\n *\n * Coverage honours the SAME base-language fallback a runtime send uses, so an application that\n * ships `fr` and enables `fr-CA` is covered rather than reported. It deliberately does NOT accept\n * a fallback to the primary locale — landing there is the failure being reported.\n */\n private validateTemplateLocaleCoverage(registeredLocales: Set<string>): void {\n const systemRefs = getAllSystemTemplateRefs();\n // The primary is asked for by name rather than taken off the front of the enabled set: the\n // helper does put it first, but the two locales carry DIFFERENT severities below, and a\n // severity split that depends on array order is one refactor away from being silently wrong.\n const configuredPrimaryLocale = this.getConfiguredPrimaryLocale();\n const secondaryLocales = this.getConfiguredEnabledLocales().filter((locale) => locale !== configuredPrimaryLocale);\n const registeredRefs = [...this.entries.keys()];\n\n if (!registeredLocales.has(configuredPrimaryLocale)) {\n this.logger.warn(`⚠️ No email templates registered for configured primary locale \"${configuredPrimaryLocale}\".`);\n }\n\n const missingSystemRefs = systemRefs.filter((ref) => !this.hasTemplateForLocale(ref, configuredPrimaryLocale));\n if (missingSystemRefs.length > 0) {\n this.logger.warn(`⚠️ Missing email templates for ${missingSystemRefs.length} system ref(s) in configured primary locale \"${configuredPrimaryLocale}\": ${missingSystemRefs.join(', ')}`);\n }\n\n for (const locale of secondaryLocales) {\n const uncovered = registeredRefs.filter((ref) => !this.hasTemplateForLocale(ref, locale));\n if (uncovered.length === 0) {\n continue;\n }\n\n // Two shapes, because \"none of them\" and \"some of them\" have different remedies. When the\n // whole catalog is uncovered, enumerating it is noise — Wonder Todos would print ninety-five\n // refs to say \"translate everything\" — so the headline states the total instead. When only\n // some are, the names ARE the remedy and are printed.\n //\n // Note the totality is measured against `uncovered.length`, not against `registeredLocales`:\n // that set is exact-match only, so an app shipping `fr` while enabling `fr-CA` would read as\n // having nothing in `fr-CA` when every one of its templates in fact covers it.\n if (uncovered.length === registeredRefs.length) {\n this.logger.warn(`⚠️ No email templates registered for enabled locale \"${locale}\" — all ${registeredRefs.length} of them fall back to \"${configuredPrimaryLocale}\", so every email to a \"${locale}\" recipient is sent in the wrong language. Author labels.${locale}.ts beside each template.`);\n continue;\n }\n\n this.logger.warn(`⚠️ Missing email templates for ${uncovered.length} ref(s) in enabled locale \"${locale}\" — these fall back to \"${configuredPrimaryLocale}\", so a \"${locale}\" recipient receives them in the wrong language. Create labels.${locale}.ts beside each: ${uncovered.join(', ')}`);\n }\n }\n\n /**\n * Does this ref have labels a recipient in `locale` would actually receive?\n *\n * Mirrors the first two candidates of {@link resolve} — exact locale, then base language — and\n * stops there on purpose. The remaining candidates (configured fallback, configured primary) are\n * what make an uncovered locale silent at runtime, so accepting them here would make the check\n * agree with the defect instead of reporting it.\n */\n private hasTemplateForLocale(templateRef: string, locale: string): boolean {\n const localeMap = this.entries.get(templateRef);\n if (!localeMap) {\n return false;\n }\n if (localeMap.has(locale)) {\n return true;\n }\n const baseLanguage = locale.includes('-') ? locale.split('-')[0] : null;\n return Boolean(baseLanguage && baseLanguage !== locale && localeMap.has(baseLanguage));\n }\n\n // ── Helpers ────────────────────────────────────────────────────\n\n private computeStats(): { templateCount: number; locales: Set<string> } {\n const locales = new Set<string>();\n let templateCount = 0;\n for (const localeMap of this.entries.values()) {\n templateCount += localeMap.size;\n for (const locale of localeMap.keys()) {\n locales.add(locale);\n }\n }\n return { templateCount, locales };\n }\n\n private buildNotFoundError(templateRef: string, triedLocales: string[]): WildoError_Backend {\n return this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {\n context: {\n message: `Email template \"${templateRef}\" not found for any locale [${triedLocales.join(', ')}]`,\n templateRef,\n triedLocales,\n },\n },\n );\n }\n\n private getConfiguredPrimaryLocale(): string {\n return getConfiguredPrimaryLanguage(this.appConfigService.config);\n }\n\n /**\n * Every locale this application enables, primary first. Delegates to the named config helper so\n * the registry does not re-derive the enabled set — it is the same question the frontend's\n * language switcher and the companion's translate pass answer, and three private derivations of\n * one set is how they come to disagree.\n */\n private getConfiguredEnabledLocales(): string[] {\n return getConfiguredEnabledLanguages(this.appConfigService.config);\n }\n}\n"]}
1
+ {"version":3,"file":"email-template-registry.backend.service.js","sourceRoot":"","sources":["../../../../../src/notifications/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1D,YAAY;QAClB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAC9C,aAAa,IAAI,SAAS,CAAC,IAAI,CAAC;YAChC,KAAK,MAAM,MAAM,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;gBACtC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;IACpC,CAAC;IAEO,kBAAkB,CAAC,WAAmB,EAAE,YAAsB;QACpE,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CACjC,SAAS,CAAC,aAAa,EACvB,SAAS,EACT;YACE,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB,WAAW,+BAA+B,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBAChG,WAAW;gBACX,YAAY;aACb;SACF,CACF,CAAC;IACJ,CAAC;IAEO,0BAA0B;QAChC,OAAO,4BAA4B,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAED;;;;;OAKG;IACK,2BAA2B;QACjC,OAAO,6BAA6B,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrE,CAAC;CACF,CAAA;AAtQY,mCAAmC;IAD/C,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;;GARnC,mCAAmC,CAsQ/C","sourcesContent":["/**\n * Email Template Registry Backend Service\n *\n * In-memory registry for file-based email template definitions.\n * Templates are injected at startup from app-custom via initialize().\n * Resolution uses exact templateRef match with i18n locale fallback.\n *\n * Each template is a locale-agnostic definition (`template.tsx`) paired\n * with co-located per-locale label files (`labels.{locale}.ts`).\n */\n\nimport { injectable, inject } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport {\n getConfiguredEnabledLanguages,\n getConfiguredFallbackLanguage,\n getConfiguredPrimaryLanguage,\n} from '~wildo-backend-lib/config/services/app-configuration.backend.utils';\nimport { ErrorType, getAllSystemTemplateRefs, type WildoError_Backend } from '@wildo-ai/saas-models';\nimport type {\n EmailTemplateDefinition,\n EmailTemplateDefinitionsMap,\n} from '~wildo-backend-lib/notifications/email/models/email-template-definition';\n\n/** Resolved template returned by `resolve()`: definition + locale-matched labels. */\nexport interface ResolvedEmailTemplate {\n definition: EmailTemplateDefinition<any>;\n labels: Record<string, string>;\n resolvedLocale: string;\n}\n\ninterface RegistryLocaleEntry {\n definition: EmailTemplateDefinition<any>;\n labels: Record<string, string>;\n}\n\n@injectable()\nexport class EmailTemplateRegistryBackendService {\n private entries = new Map<string, Map<string, RegistryLocaleEntry>>();\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService)\n private readonly appConfigService: AppConfigurationService,\n ) {\n this.logDebug = this.logger.debugByType('EmailTemplateRegistry');\n this.logger.setDebugTypeLogging('EmailTemplateRegistry', false);\n }\n\n /**\n * Populate the registry from the app-custom template map.\n *\n * Keys are bare `templateRef` values. Each entry has a locale-agnostic\n * template definition + per-locale label objects.\n */\n initialize(definitions: EmailTemplateDefinitionsMap): void {\n this.entries.clear();\n\n for (const [templateRef, entry] of Object.entries(definitions)) {\n const localeMap = new Map<string, RegistryLocaleEntry>();\n for (const [locale, labels] of Object.entries(entry.labels)) {\n localeMap.set(locale, { definition: entry.template, labels });\n }\n this.entries.set(templateRef, localeMap);\n }\n\n const { templateCount, locales } = this.computeStats();\n this.logger.info(`✅ Email template registry: ${templateCount} template(s) across ${locales.size} locale(s)`);\n this.validateTemplateLocaleCoverage(locales);\n }\n\n /**\n * Resolve a template by ref with i18n locale fallback.\n *\n * 1. Exact locale match (e.g. fr-CA)\n * 2. Base language fallback (e.g. fr)\n * 3. Configured fallback locale\n * 4. Configured primary locale\n * 5. Throw if none found\n */\n resolve(templateRef: string, locale: string, primaryLocale: string, fallbackLocale?: string): ResolvedEmailTemplate {\n const localeMap = this.entries.get(templateRef);\n if (!localeMap) {\n throw this.buildNotFoundError(templateRef, [locale, fallbackLocale, primaryLocale].filter((value): value is string => !!value));\n }\n\n const candidates = [locale];\n const baseLanguage = locale.includes('-') ? locale.split('-')[0] : null;\n if (baseLanguage && baseLanguage !== locale) {\n candidates.push(baseLanguage);\n }\n if (fallbackLocale && !candidates.includes(fallbackLocale)) {\n candidates.push(fallbackLocale);\n }\n if (!candidates.includes(primaryLocale)) {\n candidates.push(primaryLocale);\n }\n\n for (const candidateLocale of candidates) {\n const entry = localeMap.get(candidateLocale);\n if (entry) {\n this.logDebug('Template resolved', { templateRef, resolvedLocale: candidateLocale });\n return {\n definition: entry.definition,\n labels: entry.labels,\n resolvedLocale: candidateLocale,\n };\n }\n }\n\n throw this.buildNotFoundError(templateRef, candidates);\n }\n\n /**\n * Resolve exactly as runtime email delivery does for the application's\n * configured primary/fallback locales. Startup contract validation uses this\n * seam so template existence is proven against the same locale semantics as\n * a later send.\n */\n resolveForConfiguredLocale(templateRef: string): ResolvedEmailTemplate {\n const primaryLocale =\n getConfiguredPrimaryLanguage(this.appConfigService.config);\n const fallbackLocale =\n getConfiguredFallbackLanguage(this.appConfigService.config);\n return this.resolve(\n templateRef,\n primaryLocale,\n primaryLocale,\n fallbackLocale,\n );\n }\n\n /** Return all registered keys as `{templateRef}/{locale}` (diagnostics). */\n getRegisteredKeys(): string[] {\n const keys: string[] = [];\n for (const [templateRef, localeMap] of this.entries) {\n for (const locale of localeMap.keys()) {\n keys.push(`${templateRef}/${locale}`);\n }\n }\n return keys;\n }\n\n // ── Validation ─────────────────────────────────────────────────\n\n /**\n * Report email-template coverage against EVERY locale the application enables, not only the one\n * it authors natively.\n *\n * ## What was wrong\n *\n * This check resolved the configured primary locale once and tested only that. An application\n * that declares `enabledLanguages: [en, fr]` and ships ninety-five `labels.en.ts` files and zero\n * `labels.fr.ts` files started with a clean log — Wonder Todos, measured 2026-09-08. Every French\n * recipient then silently received English, because {@link resolve} falls back through the\n * configured chain and lands on the primary. Nothing anywhere said so: the frontend reads\n * `enabledLanguages` and the dev companion reads it, but no backend surface did, so \"the locale\n * this application owns\" was standing in for \"the locales this application serves\".\n *\n * ## Loudness — a WARNING, deliberately, and not an ERROR\n *\n * Enabling a language and authoring its email copy are separate acts that happen in that order:\n * the copy is produced afterwards by the label/translate pipeline. Refusing to boot on the gap\n * would mean an application cannot start between the two, which is the exact trade the operation\n * email-template validator already settled in the other direction — \"refusing to START an\n * application because a notice is unauthored trades a missing email for a total outage, which is\n * the worse failure\" (`collectOperationEmailTemplateIssues`). A missing SECONDARY locale is\n * strictly milder than the case that reasoning was written about: the notice is still delivered,\n * in the wrong language.\n *\n * That is also why this stays inside the registry rather than being handed to the startup config\n * validator, whose token-backed path is an ERROR that crash-loops a boot. Widening\n * {@link resolveForConfiguredLocale} — the seam that validator resolves through — to demand every\n * enabled locale would have converted \"ninety-five emails arrive in English\" into \"this\n * application cannot start\", for the one application the finding came from.\n *\n * The warning is not a shrug: it is emitted per non-covered locale, separates the two severities\n * below, and names the exact `labels.<locale>.ts` file an author has to create — so it is\n * actionable from the log line alone rather than after an audit.\n *\n * ## The two severities it separates\n *\n * - **Primary locale** — nothing to fall back TO. A system ref absent here cannot be rendered at\n * all, and the send raises `CONFIGURATION`. This is the pre-existing check, unchanged in\n * meaning.\n * - **Any other enabled locale** — the template resolves, in the wrong language. Reported for\n * every registered ref rather than only the twelve system ones, because the population that\n * goes untranslated is the whole catalog (83 of Wonder Todos' 95 are resource/operation\n * templates, which the system-ref loop cannot see).\n *\n * Coverage honours the SAME base-language fallback a runtime send uses, so an application that\n * ships `fr` and enables `fr-CA` is covered rather than reported. It deliberately does NOT accept\n * a fallback to the primary locale — landing there is the failure being reported.\n */\n private validateTemplateLocaleCoverage(registeredLocales: Set<string>): void {\n const systemRefs = getAllSystemTemplateRefs();\n // The primary is asked for by name rather than taken off the front of the enabled set: the\n // helper does put it first, but the two locales carry DIFFERENT severities below, and a\n // severity split that depends on array order is one refactor away from being silently wrong.\n const configuredPrimaryLocale = this.getConfiguredPrimaryLocale();\n const secondaryLocales = this.getConfiguredEnabledLocales().filter((locale) => locale !== configuredPrimaryLocale);\n const registeredRefs = [...this.entries.keys()];\n\n if (!registeredLocales.has(configuredPrimaryLocale)) {\n this.logger.warn(`⚠️ No email templates registered for configured primary locale \"${configuredPrimaryLocale}\".`);\n }\n\n const missingSystemRefs = systemRefs.filter((ref) => !this.hasTemplateForLocale(ref, configuredPrimaryLocale));\n if (missingSystemRefs.length > 0) {\n this.logger.warn(`⚠️ Missing email templates for ${missingSystemRefs.length} system ref(s) in configured primary locale \"${configuredPrimaryLocale}\": ${missingSystemRefs.join(', ')}`);\n }\n\n for (const locale of secondaryLocales) {\n const uncovered = registeredRefs.filter((ref) => !this.hasTemplateForLocale(ref, locale));\n if (uncovered.length === 0) {\n continue;\n }\n\n // Two shapes, because \"none of them\" and \"some of them\" have different remedies. When the\n // whole catalog is uncovered, enumerating it is noise — Wonder Todos would print ninety-five\n // refs to say \"translate everything\" — so the headline states the total instead. When only\n // some are, the names ARE the remedy and are printed.\n //\n // Note the totality is measured against `uncovered.length`, not against `registeredLocales`:\n // that set is exact-match only, so an app shipping `fr` while enabling `fr-CA` would read as\n // having nothing in `fr-CA` when every one of its templates in fact covers it.\n if (uncovered.length === registeredRefs.length) {\n this.logger.warn(`⚠️ No email templates registered for enabled locale \"${locale}\" — all ${registeredRefs.length} of them fall back to \"${configuredPrimaryLocale}\", so every email to a \"${locale}\" recipient is sent in the wrong language. Author labels.${locale}.ts beside each template.`);\n continue;\n }\n\n this.logger.warn(`⚠️ Missing email templates for ${uncovered.length} ref(s) in enabled locale \"${locale}\" — these fall back to \"${configuredPrimaryLocale}\", so a \"${locale}\" recipient receives them in the wrong language. Create labels.${locale}.ts beside each: ${uncovered.join(', ')}`);\n }\n }\n\n /**\n * Does this ref have labels a recipient in `locale` would actually receive?\n *\n * Mirrors the first two candidates of {@link resolve} — exact locale, then base language — and\n * stops there on purpose. The remaining candidates (configured fallback, configured primary) are\n * what make an uncovered locale silent at runtime, so accepting them here would make the check\n * agree with the defect instead of reporting it.\n */\n private hasTemplateForLocale(templateRef: string, locale: string): boolean {\n const localeMap = this.entries.get(templateRef);\n if (!localeMap) {\n return false;\n }\n if (localeMap.has(locale)) {\n return true;\n }\n const baseLanguage = locale.includes('-') ? locale.split('-')[0] : null;\n return Boolean(baseLanguage && baseLanguage !== locale && localeMap.has(baseLanguage));\n }\n\n // ── Helpers ────────────────────────────────────────────────────\n\n private computeStats(): { templateCount: number; locales: Set<string> } {\n const locales = new Set<string>();\n let templateCount = 0;\n for (const localeMap of this.entries.values()) {\n templateCount += localeMap.size;\n for (const locale of localeMap.keys()) {\n locales.add(locale);\n }\n }\n return { templateCount, locales };\n }\n\n private buildNotFoundError(templateRef: string, triedLocales: string[]): WildoError_Backend {\n return this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {\n context: {\n message: `Email template \"${templateRef}\" not found for any locale [${triedLocales.join(', ')}]`,\n templateRef,\n triedLocales,\n },\n },\n );\n }\n\n private getConfiguredPrimaryLocale(): string {\n return getConfiguredPrimaryLanguage(this.appConfigService.config);\n }\n\n /**\n * Every locale this application enables, primary first. Delegates to the named config helper so\n * the registry does not re-derive the enabled set — it is the same question the frontend's\n * language switcher and the companion's translate pass answer, and three private derivations of\n * one set is how they come to disagree.\n */\n private getConfiguredEnabledLocales(): string[] {\n return getConfiguredEnabledLanguages(this.appConfigService.config);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"email-template-validator.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/notifications/email/services/email-template-validator.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAMlG,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAMD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,EAqBlD,CAAC;AA0CF,qBACa,oCAAoC;IAIV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAH5D,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAG3B,MAAM,EAAE,aAAa;IAM3E;;;;;OAKG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyC/D;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAc9B;;OAEG;IACH,OAAO,CAAC,eAAe;IA2BvB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAsBhC;;OAEG;YACW,WAAW;IAwCzB;;OAEG;IACH,iBAAiB,IAAI,MAAM,EAAE;CAG9B"}
1
+ {"version":3,"file":"email-template-validator.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/email/services/email-template-validator.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAMlG,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAMD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,EAqBlD,CAAC;AA0CF,qBACa,oCAAoC;IAIV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAH5D,SAAS,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;gBAG3B,MAAM,EAAE,aAAa;IAM3E;;;;;OAKG;IACG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyC/D;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAc9B;;OAEG;IACH,OAAO,CAAC,eAAe;IA2BvB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAsBhC;;OAEG;YACW,WAAW;IAwCzB;;OAEG;IACH,iBAAiB,IAAI,MAAM,EAAE;CAG9B"}