@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":"notifications-dispatcher.backend.service.js","sourceRoot":"","sources":["../../../../../src/notifications/services/notifications-dispatcher.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAEL,oBAAoB,EACpB,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAG1B,yDAAyD,EAKzD,2BAA2B,EAC3B,qCAAqC,EAErC,qBAAqB,EACrB,kBAAkB,EAOlB,iBAAiB,EACjB,cAAc,EAEd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,wBAAwB,EACxB,UAAU,EACV,yCAAyC,EACzC,kCAAkC,EAClC,4BAA4B,EAC5B,+BAA+B,EAC/B,SAAS,EACT,2BAA2B,GAC5B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CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;IACnD,WAAA,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACvC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAC7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,CAAA;IAKtD,YAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAAE,YAAA,QAAQ,EAAE,CAAA;qCAd1B,aAAa;QACM,0BAA0B;QACzB,gBAAgB;QACZ,+BAA+B,sBAGnC,uBAAuB;QACD,yCAAyC;QACvD,+BAA+B;QAEhF,kCAAkC;GAjBvD,6BAA6B,CAq3EzC","sourcesContent":["import { inject, injectable, optional } from 'inversify';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { createHash, randomUUID } from 'node:crypto';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport {\n ResourceConfiguration_Operation,\n ResourcePrimaryScope,\n deriveResourceScopeRoomQualifiers,\n CoreM2MNotificationChannel,\n CoreUserNotificationChannel,\n CoreUserNotificationTarget,\n UserNotificationDefinition,\n UserNotificationDefinition_EmailSchema,\n userNotificationTargetIsSuppressibleByRecipientPreference,\n type OrganizationEmailNotifications,\n type UserPreferences_Notifications,\n UserNotificationDefinition_FrontEndSuccessSchema,\n M2MNotificationDefinition,\n NotificationBadgeSourceKind,\n buildNotificationBadgeDefinitionIndex,\n type NotificationScope,\n CoreResourceOperation,\n CoreWebSocketEvent,\n WS_ResourceNotificationPayload,\n WS_ResourceUpdatedPayload,\n WS_ResourceDeletedPayload,\n WS_ResourceSyncUpdatedPayload,\n WS_ResourceUpdateNotificationPayload,\n ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n EmailTemplateType,\n ResourceAction,\n NotificationLevel,\n CORE_APP_ROLES,\n CORE_ORG_ROLES,\n CoreResourceType,\n OrganizationMemberStatus,\n UserStatus,\n ResourcesConfigOperationsUrlsBuilderUtils,\n ResourcesConfig_OperationPathUtils,\n ResourceOperationVariantType,\n WebSocketResourceDeliveryTarget,\n ErrorType,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport { BrandAssetComposition, BrandAssetPurpose } from '@wildo-ai/saas-models';\nimport type { FieldMetaEntry, OrganizationMember, UserPreferences, UserProfile } from '@wildo-ai/saas-models';\nimport type { z } from 'zod';\nimport { AvailableLanguage } from '@wildo-ai/presets-components-models';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { WebSocketService, WebSocketMessage } from '~wildo-backend-lib/requests/service/websocket.service';\nimport { NotificationBadgeBackendService } from './notification-badge.backend.service';\nimport {\n type EmailBackendService,\n type EmailSendResult,\n} from '~wildo-backend-lib/notifications/email/services/email.backend.service';\n// Internal callers go through the path alias (`@wildo-ai/saas-backend-lib/custom-batch-manifests`\n// is the public spec-layer subpath; self-imports through the public package name are not\n// wired in this workspace's tsconfig path map).\nimport { EMAIL_BATCH_SEND_BATCH_REF } from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport type { QueueBackendService } from '~wildo-backend-lib/queue/queue.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { getConfiguredPrimaryLanguage } from '~wildo-backend-lib/config/services/app-configuration.backend.utils';\nimport { AuthControllerUtils } from '~wildo-backend-lib/security/authentications/services/utils/auth-controller.utils';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport { M2MWebhookDispatcherBackendService } from '~wildo-backend-lib/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service';\n\n/**\n * Notification Dispatcher Service\n *\n * Handles dispatching of all notification types based on resource operation configurations:\n * - Notification badge operations (incrementing/decrementing/resetting badge counts)\n * - User notifications (email, SMS, push, WebSocket, frontend success)\n * - M2M (Machine-to-Machine) notifications (webhooks)\n * - Resource room notifications (path-independent collaboration)\n */\n/** Batch threshold for email sending - above this, use queue */\nconst EMAIL_BATCH_THRESHOLD = 10;\n\n/**\n * Canonical template identity for operation-authored email notifications.\n *\n * Startup validation and runtime dispatch must use the same derivation;\n * otherwise an application can boot against one template reference and fail\n * only after a mutation commits because delivery derived another.\n */\nexport function buildUserNotificationEmailTemplateRef(\n operation: {\n resourceIdentifier: string;\n operationIdentifier: string;\n variantKey?: string;\n },\n notification: {\n identifier: string;\n target?: string;\n customNotificationRef?: string;\n },\n): string {\n const targetKebab =\n (notification.target || notification.identifier)\n .toLowerCase()\n .replace(/_/g, '-');\n const refParts = [\n 'email',\n operation.resourceIdentifier,\n operation.operationIdentifier,\n ];\n if (operation.variantKey) {\n refParts.push(operation.variantKey);\n }\n refParts.push(targetKebab);\n const baseRef = refParts.join('.');\n return notification.customNotificationRef\n ? `${baseRef}_${notification.customNotificationRef}`\n : baseRef;\n}\n\n/**\n * Optional identity source for post-commit email submissions.\n *\n * Token-backed operation dispatch passes the committed token ID. The\n * dispatcher derives one deterministic provider identity per concrete\n * notification and recipient, so a fan-out cannot accidentally deduplicate\n * distinct emails while a repeated logical send remains provider-idempotent\n * where the selected adapter supports it.\n */\nexport interface NotificationDispatchOptions {\n emailSubmissionSourceId?: string;\n}\n\n/**\n * Derive a fixed-size provider submission identity without exposing recipient\n * data in transport headers. A new token ID produces a new identity, so an\n * explicit RESEND is intentionally a new logical email.\n */\nexport function deriveEmailNotificationSubmissionId(\n sourceId: string,\n notificationIdentifier: string,\n templateRef: string,\n recipientIdentity: { email?: string; userId?: string },\n): string {\n return createHash('sha256')\n .update(JSON.stringify({\n sourceId,\n notificationIdentifier,\n templateRef,\n recipientIdentity,\n }))\n .digest('hex');\n}\n\ntype CachedRoutePaths = { url: string; parameters: { fieldIdentifier: string; resourceType: string }[] }[];\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * Normalise a mutated-object slot (`currentObject` / `previousObject`) to the list of plain rows a\n * derived-badge recompute must read its `scopeField` from.\n *\n * A single write yields one object; a bulk write yields an array; `undefined` (CREATE has no\n * pre-image; a slot may be absent) yields nothing. Non-record array entries and bulk-result blobs\n * (`{ updatedIds: [...] }`) are dropped — they carry no per-row field truth.\n */\nfunction toDerivedBadgeRowArray(value: unknown): Record<string, unknown>[] {\n if (Array.isArray(value)) {\n return value.filter(isPlainRecord);\n }\n return isPlainRecord(value) ? [value] : [];\n}\n\nfunction normalizeResourceId(value: unknown): string | undefined {\n if (typeof value === 'string' && value.length > 0) {\n return value;\n }\n\n if (\n typeof value === 'object'\n && value !== null\n && typeof (value as { toString?: () => string }).toString === 'function'\n ) {\n const normalized = value.toString();\n if (normalized.length > 0 && normalized !== '[object Object]') {\n return normalized;\n }\n }\n\n return undefined;\n}\n\nfunction resolveResourceObjectForSync(\n currentObject: unknown,\n resourceId: string,\n affectedIds: string[],\n): Record<string, unknown> | undefined {\n if (Array.isArray(currentObject)) {\n return currentObject.find((candidate): candidate is Record<string, unknown> => (\n // `_id` ONLY — `id` is Mongoose's built-in virtual (surrogate-PK resources only) and does not\n // exist on PostgreSQL. The arm was dead, since `_id` is always present and evaluated first.\n isPlainRecord(candidate) && normalizeResourceId(candidate._id) === resourceId\n ));\n }\n\n if (!isPlainRecord(currentObject)) {\n return undefined;\n }\n\n if (typeof currentObject._id === 'string' && currentObject._id !== resourceId) {\n return undefined;\n }\n\n // A shared bulk result blob (e.g. { updatedIds: [...] }) is not authoritative\n // per-resource replay truth for sync-grade room payloads.\n if (affectedIds.length > 1 && typeof currentObject._id !== 'string') {\n return undefined;\n }\n\n return currentObject;\n}\n\nfunction splitResourceObjectForWebSocket(resourceObject: Record<string, unknown>): {\n cleanedResourceData: Record<string, unknown>;\n fieldMeta?: Record<string, FieldMetaEntry>;\n version?: number;\n} {\n const { _field_meta, ...rest } = resourceObject;\n return {\n cleanedResourceData: rest,\n fieldMeta: _field_meta as Record<string, FieldMetaEntry> | undefined,\n version: resourceObject._version as number | undefined,\n };\n}\n\nexport function shouldOmitResourceUrlForOperation(\n effectiveOperation: CoreResourceOperation | undefined,\n): boolean {\n return effectiveOperation === CoreResourceOperation.DELETE\n || effectiveOperation === CoreResourceOperation.DELETE_MANY;\n}\n\nexport function buildResourceRoomSyncPayload(params: {\n resourceType: string;\n resourceId: string;\n contextResourceIdentifiers: Record<string, string>;\n action: ResourceAction;\n affectedIds: string[];\n operationIdentifier: string;\n operationPathKey?: string;\n variantType?: ResourceOperationVariantType;\n isOperationDefault?: boolean;\n isBulkOperation?: boolean;\n variantKey?: string;\n initiatorUserId?: string;\n currentObject: unknown;\n timestamp?: Date;\n}): WS_ResourceSyncUpdatedPayload | WS_ResourceDeletedPayload | null {\n const timestamp = params.timestamp ?? new Date();\n\n if (params.action === ResourceAction.DELETED) {\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: ResourceAction.DELETED,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n };\n }\n\n const resourceObject = resolveResourceObjectForSync(\n params.currentObject,\n params.resourceId,\n params.affectedIds,\n );\n if (!resourceObject) {\n return null;\n }\n\n const {\n cleanedResourceData,\n fieldMeta,\n version,\n } = splitResourceObjectForWebSocket(resourceObject);\n\n if (version == null) {\n return null;\n }\n\n // Sync-grade resource-room events are the only websocket payloads allowed to\n // carry authoritative replay data for a specific resource. If we cannot prove\n // both the per-resource object body and its authoritative version, callers\n // must fall back to a notification-grade stale hint instead.\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: params.action,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n version,\n resourceData: cleanedResourceData,\n fieldMeta,\n };\n}\n\nexport function buildScopeRoomNotificationPayload(params: {\n resourceType: string;\n resourceId: string;\n contextResourceIdentifiers: Record<string, string>;\n action: ResourceAction;\n affectedIds: string[];\n operationIdentifier: string;\n operationPathKey?: string;\n variantType?: ResourceOperationVariantType;\n isOperationDefault?: boolean;\n isBulkOperation?: boolean;\n variantKey?: string;\n initiatorUserId?: string;\n currentObject: unknown;\n timestamp?: Date;\n}): WS_ResourceUpdateNotificationPayload {\n const timestamp = params.timestamp ?? new Date();\n // Scope rooms are collection/list invalidation surfaces. For multi-id writes\n // they must not overstate single-resource replay truth, so replay-like fields\n // are only included when the payload still represents one authoritative row.\n const shouldIncludeReplayLikeFields = params.affectedIds.length <= 1;\n const resourceObject = resolveResourceObjectForSync(\n params.currentObject,\n params.resourceId,\n params.affectedIds,\n );\n const splitResourceObject = shouldIncludeReplayLikeFields && resourceObject\n ? splitResourceObjectForWebSocket(resourceObject)\n : null;\n\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.SCOPE_ROOM_NOTIFICATION,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: params.action,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n version: splitResourceObject?.version,\n resourceData: splitResourceObject?.cleanedResourceData,\n fieldMeta: splitResourceObject?.fieldMeta,\n };\n}\n\nexport function buildResourceRoomStaleHintPayload(params: {\n resourceType: string;\n resourceId: string;\n contextResourceIdentifiers: Record<string, string>;\n action: ResourceAction;\n affectedIds: string[];\n operationIdentifier: string;\n operationPathKey?: string;\n variantType?: ResourceOperationVariantType;\n isOperationDefault?: boolean;\n isBulkOperation?: boolean;\n variantKey?: string;\n initiatorUserId?: string;\n timestamp?: Date;\n}): WS_ResourceUpdateNotificationPayload {\n const timestamp = params.timestamp ?? new Date();\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.RESOURCE_ROOM_NOTIFICATION,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: params.action,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n };\n}\n\n@injectable()\nexport class NotificationDispatcherService {\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n private readRoutePathsCache = new Map<string, CachedRoutePaths | null>();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.WebSocketService) private webSocketService: WebSocketService,\n @inject(SAAS_SERVICE_TYPES.NotificationBadgeService) private badgeService: NotificationBadgeBackendService,\n @inject(SAAS_SERVICE_TYPES.EmailService) private emailService: EmailBackendService,\n @inject(SAAS_SERVICE_TYPES.QueueBackendService) private queueService: QueueBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.M2MWebhookDispatcherService)\n private m2mWebhookDispatcher: M2MWebhookDispatcherBackendService,\n // Appended LAST so positional construction in tests keeps working, and `@optional()` so a\n // minimal container still builds: the only consumer degrades to the caller's context, which is\n // the pre-existing behaviour.\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) @optional()\n private readonly executionContextCreator?: ExecutionContextCreatorBackendService,\n ) {\n this.logDebug = this.logger.debugByType('NotificationDispatcherService');\n this.logger.setDebugTypeLogging('NotificationDispatcherService', false);\n }\n\n /**\n * Dispatch notifications based on operation configuration\n *\n * @param executionContext - The execution context containing operation details and user information\n * @param functionParameters - Parameters containing input data, current object, and context\n */\n async dispatchNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n options?: NotificationDispatchOptions,\n ): Promise<void> {\n const operation = executionContext.operation;\n\n try {\n const results = await Promise.allSettled([\n this.dispatchConfiguredNotifications(\n executionContext,\n functionParameters,\n options,\n ),\n this.dispatchResourceRoomNotifications(executionContext, functionParameters),\n ]);\n\n for (const result of results) {\n if (result.status === 'rejected') {\n this.logger.error('Error dispatching notifications', {\n ...projectCaughtErrorLogFields(result.reason),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n } catch (error) {\n this.logger.error('Failed to dispatch notifications', {\n ...projectCaughtErrorLogFields(error),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n\n async dispatchConfiguredNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n options?: NotificationDispatchOptions,\n ): Promise<void> {\n const operation = executionContext.operation;\n\n try {\n // Dispatch authored notification types in parallel. Resource-room\n // synchronization can be invoked independently from this path when the\n // caller only has post-write object truth and not a full computation context.\n const results = await Promise.allSettled([\n // 1. Notification badge operations (EVENT_COUNTER: authored per-op increments)\n this.dispatchNotificationBadgeOperations(executionContext, functionParameters),\n\n // 2. User notifications (email, SMS, push, WebSocket, frontend success)\n this.dispatchUserNotifications(\n executionContext,\n functionParameters,\n options?.emailSubmissionSourceId,\n ),\n\n // 3. M2M notifications (webhooks)\n this.dispatchM2MNotifications(executionContext, functionParameters),\n\n // 4. DERIVED_QUERY badge recomputes: any badge whose source resource was\n // just mutated is re-counted from the source collection (never drifts).\n this.dispatchDerivedBadgeRecomputes(executionContext, functionParameters),\n ]);\n\n for (const result of results) {\n if (result.status === 'rejected') {\n this.logger.error('Error dispatching notifications', {\n ...projectCaughtErrorLogFields(result.reason),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n\n this.logDebug('All notifications dispatched successfully', {\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n userNotificationCount: (operation.userNotifications || []).length,\n badgeOperationsCount: (operation.notificationBadgeOperations || []).length,\n m2mNotificationsCount: (operation.m2mNotifications || []).length,\n });\n\n } catch (error) {\n // Log but don't throw - notifications should not break the main operation\n this.logger.error('Error dispatching notifications', {\n ...projectCaughtErrorLogFields(error),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n\n /**\n * Dispatch notification badge operations\n *\n * @param executionContext - The execution context\n * @param functionParameters - Function parameters with data context\n * @private\n */\n private async dispatchNotificationBadgeOperations<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters\n ): Promise<void> {\n const operation = executionContext.operation;\n const badgeOperations = operation.notificationBadgeOperations || [];\n\n if (badgeOperations.length === 0) {\n return;\n }\n\n const definitionsByKey = buildNotificationBadgeDefinitionIndex(\n this.resourcesRegistry.getResourcesRegistry().notificationBadgeDefinitions ?? [],\n );\n\n for (const badgeOp of badgeOperations) {\n /**\n * The DEFINITION decides the badge, including its SCOPE.\n *\n * This used to take the scope from `determineBadgeScope(executionContext)` — the operation's\n * own `resourcePrimaryScope`, with an initiator-shaped fallback — and pass the authored\n * identifier straight through with no lookup at all. Two things followed. An operation on a\n * user-scoped resource wrote a USER counter even when the definition it named lived at\n * organization scope, so the row it created belonged to no definition. And an identifier that\n * matched no definition wrote a counter nothing could ever render, reported nowhere.\n *\n * Resolving the ref first fixes both at once: the scope is read off the definition, and an\n * unresolvable ref cannot reach the write. Only the scopeId — WHOSE badge — remains a runtime\n * question, and it is answered from the initiator at the definition's own scope.\n */\n const definition = definitionsByKey.get(badgeOp.badgeRef);\n if (!definition) {\n /**\n * Unreachable on an application that started: `validateNotificationBadgeDeclarations`\n * refuses this at configuration time. Kept as defence in depth for a host that assembles a\n * registry by another route, and loud because a silent skip here is the original defect.\n */\n this.logger.warn('Badge operation names no registered badge definition — skipping', {\n badgeRef: badgeOp.badgeRef,\n operation: badgeOp.operation,\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n continue;\n }\n\n const scopeId = this.resolveBadgeScopeId(executionContext, definition.scope);\n if (!scopeId) {\n this.logDebug('No scope id for the badge definition\\'s scope, skipping badge operation', {\n badgeRef: badgeOp.badgeRef,\n scope: definition.scope,\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n continue;\n }\n\n try {\n await this.badgeService.executeBadgeOperation(\n executionContext,\n definition.scope,\n scopeId,\n definition.identifier,\n badgeOp.operation,\n 1 // Default value (can be extended to support custom values)\n );\n\n this.logDebug('Badge operation executed', {\n badgeRef: badgeOp.badgeRef,\n operation: badgeOp.operation,\n scope: definition.scope,\n scopeId,\n });\n } catch (error) {\n this.logger.warn('Failed to execute badge operation', {\n badgeRef: badgeOp.badgeRef,\n operation: badgeOp.operation,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n }\n\n /**\n * Recompute every DERIVED_QUERY badge whose source resource is the one just\n * mutated (R5). Reads the registered `notificationBadgeDefinitions`, filters to\n * derived badges pointing at `operation.resourceIdentifier`, resolves the badge's\n * scopeId from the initiator, and asks the badge service to re-count + emit.\n *\n * Runs on the same write-time dispatch as event badges. Read operations don't\n * reach here (notifications dispatch is post-write), and the recompute is\n * idempotent regardless. Per-badge failures are logged and never abort siblings.\n */\n private async dispatchDerivedBadgeRecomputes<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n ): Promise<void> {\n const operation = executionContext.operation;\n const definitions = this.resourcesRegistry.getResourcesRegistry().notificationBadgeDefinitions ?? [];\n\n const derivedForThisResource = definitions.filter(\n (definition) =>\n definition.source.kind === NotificationBadgeSourceKind.DERIVED_QUERY &&\n definition.source.resourceType === operation.resourceIdentifier,\n );\n if (derivedForThisResource.length === 0) {\n return;\n }\n\n // The scopeId of a derived badge is the VALUE of its `scopeField` on the MUTATED ROW — never\n // the actor. A derived \"incomplete todos assigned to me\" badge is scoped by the todo's\n // `assignedToUserId`; when an admin assigns/reassigns/completes a todo on a member's behalf,\n // it is the MEMBER's badge that changed, and the admin never had a stake in it. Resolving the\n // scope from `executionContext.initiatorIds` (the previous behaviour) silently skipped EVERY\n // cross-user mutation — the affected user's count stayed stale until a reconnect reseeded it.\n //\n // Both the post-write row (`currentObject`) and, when the framework captured one, the pre-image\n // (`previousObject`) are consulted: a reassignment moves TWO scopes — the row leaves the prior\n // holder's set (pre-image) and joins the new holder's (post-image). A completion or a same-scope\n // edit moves ONE, which the post-image alone covers. `recomputeDerivedBadge` SETs the\n // authoritative count for each scope from the source collection, so recomputing a scope that did\n // not actually change is harmless (it re-derives the same number) — the correctness requirement\n // is only that no affected scope is MISSED.\n const affectedRows = [\n ...toDerivedBadgeRowArray(functionParameters.currentObject),\n ...toDerivedBadgeRowArray(functionParameters.previousObject),\n ];\n\n for (const definition of derivedForThisResource) {\n const source = definition.source;\n if (source.kind !== NotificationBadgeSourceKind.DERIVED_QUERY) {\n continue; // narrowed by the filter above; re-checked for the type guard on `scopeField`.\n }\n\n const scopeIds = new Set<string>();\n for (const row of affectedRows) {\n const value = row[source.scopeField];\n if (typeof value === 'string' && value.length > 0) {\n scopeIds.add(value);\n }\n }\n\n if (scopeIds.size === 0) {\n // No affected scope carries the badge's scopeField (e.g. a todo with no assignee) — nothing\n // to recompute. This is normal, not an error: no user's count could have changed.\n this.logDebug('No affected scopeId for derived badge, skipping', {\n identifier: definition.identifier,\n scopeField: source.scopeField,\n });\n continue;\n }\n\n for (const scopeId of scopeIds) {\n try {\n await this.badgeService.recomputeDerivedBadge(executionContext, definition, scopeId);\n } catch (error) {\n this.logger.warn('Failed to recompute derived badge', {\n identifier: definition.identifier,\n resourceType: operation.resourceIdentifier,\n scopeId,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n }\n }\n\n /**\n * Resolve WHOSE badge this is — the scopeId — for a scope the DEFINITION already fixed.\n *\n * ## Why this no longer decides the scope\n *\n * Its predecessor (`determineBadgeScope`) answered both halves from the execution context: it\n * read `operation.resourcePrimaryScope`, mapped `USER_SELF` → `initiatorIds.userId` and\n * `ORGANIZATIONS` → `initiatorIds.organizationId`, and for anything else — `APPLICATION`,\n * `ANONYMOUS`, or an unscoped operation — guessed, preferring the organization when the request\n * happened to carry one and falling back to the user. That guess decided which COLLECTION a\n * counter was written to, from a property of the operation that has nothing to say about which\n * badge the author meant. An operation on a user-scoped resource could only ever move a\n * user-scoped counter, whatever badge its `badgeRef` named.\n *\n * The definition names the scope, so only the id is left, and the id is genuinely a runtime fact:\n * which user, which organization. `null` means the request carries no identity at that scope\n * (an anonymous or purely application-scoped call reaching an org-scoped badge), which is a skip\n * rather than an error — no principal's count could have changed.\n */\n private resolveBadgeScopeId<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n ): string | null {\n const initiatorIds = executionContext.initiatorIds;\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n return initiatorIds?.userId || null;\n case ResourcePrimaryScope.ORGANIZATIONS:\n return initiatorIds?.organizationId || null;\n default:\n return null;\n }\n }\n\n /**\n * Dispatch user notifications\n *\n * @param executionContext - The execution context\n * @param functionParameters - Function parameters with data context\n * @private\n */\n private async dispatchUserNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const operation = executionContext.operation;\n const userNotifications = operation.userNotifications || [];\n\n if (userNotifications.length === 0) {\n return [];\n }\n\n const emailResults: EmailSendResult[] = [];\n for (const notification of userNotifications) {\n try {\n // Config-declared side-effect gate: skip a notification whose `condition` evaluates falsy\n // against the post-operation context. Evaluated before channel resolution and the\n // email-by-address path, so it gates every channel uniformly. Canonical use: the org-member\n // invite email fires only for INVITED rows, never for an ACTIVE direct-add (founder /\n // SSO-JIT / SCIM), whose denormalized `userEmail` is the member's OWN address. Absent =\n // always dispatch.\n //\n // It sits INSIDE the try deliberately. The predicate is application-authored code running\n // in the dispatcher's loop, so one that throws is a single notification's failure and not\n // the operation's. Evaluated outside, one bad predicate ended the loop and silently dropped\n // every notification declared after it, which is exactly what the catch below exists to\n // prevent.\n if (notification.condition && !notification.condition(functionParameters)) {\n this.logDebug('Skipping user notification: condition not met', {\n identifier: notification.identifier,\n channel: notification.channel,\n target: notification.target,\n });\n continue;\n }\n\n const notificationEmailResults = await this.dispatchSingleUserNotification(\n executionContext,\n functionParameters,\n notification,\n emailSubmissionSourceId,\n );\n emailResults.push(...notificationEmailResults);\n } catch (error) {\n this.logger.warn('Failed to dispatch user notification', {\n identifier: notification.identifier,\n channel: notification.channel,\n target: notification.target,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n return emailResults;\n }\n\n /**\n * Dispatch a single user notification based on its channel\n */\n private async dispatchSingleUserNotification<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const channel = notification.channel;\n\n switch (channel) {\n case CoreUserNotificationChannel.WEBSOCKET:\n await this.dispatchWebSocketUserNotification(executionContext, functionParameters, notification);\n return [];\n\n case CoreUserNotificationChannel.EMAIL:\n case CoreUserNotificationChannel.SMS:\n case CoreUserNotificationChannel.PUSH:\n // Email/SMS/Push notifications require recipient userContext fetching\n return this.dispatchEmailSmsPushUserNotification(\n executionContext,\n functionParameters,\n notification,\n emailSubmissionSourceId,\n );\n\n case CoreUserNotificationChannel.FRONT_END_SUCCESS:\n // Frontend success notifications are handled client-side\n // We can optionally send them via WebSocket for SPAs\n await this.dispatchWebSocketUserNotification(executionContext, functionParameters, notification);\n return [];\n\n default:\n this.logDebug('Unknown notification channel', {\n channel,\n identifier: notification.identifier,\n });\n return [];\n }\n }\n\n /**\n * Dispatch Email/SMS/Push user notifications\n * These channels require recipient userContext fetching for template rendering\n */\n private async dispatchEmailSmsPushUserNotification<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const target = notification.target;\n const channel = notification.channel;\n\n /*\n * The recipient channel switches (#409) do NOT apply on the email-by-address path below. The\n * address comes from a field on the operation's own object and identifies no user, so there is\n * no preferences row to consult — the canonical case is an invitation sent to somebody who does\n * not have an account yet. Suppression is a property of a KNOWN recipient, and this path has\n * none by construction.\n */\n // Email-by-address: when an EMAIL notification declares `recipientEmailField`, the\n // recipient is a raw address read from the current object — a party who is NOT a\n // platform user (an organization-invitation invitee, an inbound lead). There is no\n // `userId` to resolve, so this bypasses `getUserIdsForTarget` entirely.\n const recipientEmailField = channel === CoreUserNotificationChannel.EMAIL\n ? (notification as z.infer<typeof UserNotificationDefinition_EmailSchema>).recipientEmailField\n : undefined;\n if (recipientEmailField) {\n return this.dispatchEmailToRecipientAddress(\n executionContext,\n functionParameters,\n notification,\n recipientEmailField,\n emailSubmissionSourceId,\n );\n }\n\n /*\n * Organization notification ROUTING (#410, decided 2026-09-08).\n *\n * A tenant's `organizationNotifications` record carries four category addresses and four\n * category switches. It is seeded by apps-manager at provisioning, rendered and edited through\n * the organizations preset, audited — and until now read by NOTHING: organization-targeted\n * notifications resolved to member user ids by role and went to each member's own address, so a\n * tenant that filled the settings screen in changed nothing at all.\n *\n * The category is DERIVED from the notification's target, not declared. The target vocabulary\n * and the record's categories line up one-for-one — `ORGANIZATION_BILLING` ↔ `billing`,\n * `ORGANIZATION_SECURITY` ↔ `security`, and so on — so a second authoring surface would only be\n * a place for the two to disagree.\n *\n * A configured address REPLACES the member fan-out rather than adding to it. A tenant that\n * routes security mail to a SOC address is saying where that mail goes, not asking for a copy;\n * sending both would make the setting an amplifier instead of a router.\n */\n const organizationRouting = channel === CoreUserNotificationChannel.EMAIL\n ? await this.resolveOrganizationNotificationRouting(executionContext, notification, target)\n : undefined;\n\n if (organizationRouting?.suppressed) {\n this.logDebug('Skipping organization notification: the tenant switched this category off', {\n identifier: notification.identifier,\n target,\n category: organizationRouting.category,\n });\n return [];\n }\n\n if (organizationRouting?.address) {\n return this.dispatchEmailToOrganizationAddress(\n executionContext,\n functionParameters,\n notification,\n organizationRouting.address,\n organizationRouting.category,\n emailSubmissionSourceId,\n );\n }\n\n // Get user IDs based on target\n const userIds = await this.getUserIdsForTarget(\n executionContext,\n functionParameters,\n notification,\n target,\n );\n\n if (userIds.length === 0) {\n this.logDebug('No user IDs found for notification', {\n identifier: notification.identifier,\n target,\n channel,\n });\n return [];\n }\n\n // Handle by channel type\n switch (channel) {\n case CoreUserNotificationChannel.EMAIL:\n return this.dispatchEmailNotifications(\n executionContext,\n functionParameters,\n notification,\n userIds,\n emailSubmissionSourceId,\n );\n\n case CoreUserNotificationChannel.SMS:\n case CoreUserNotificationChannel.PUSH:\n // SMS and Push not yet implemented\n this.logDebug('SMS/Push notifications not yet implemented', {\n identifier: notification.identifier,\n channel,\n userCount: userIds.length,\n });\n return [];\n }\n }\n\n /**\n * Build the shared email-dispatch context for a user notification: the resolved\n * `templateRef`, the app default `locale`, and the `baseContext` (object + additional\n * context, including the token `acceptUrl` enricher). These are computed ONCE per\n * notification (recipient-independent), so both the user-id recipient path\n * (`dispatchEmailNotifications`) and the email-by-address path\n * (`dispatchEmailToRecipientAddress`) render from identical context.\n */\n private async buildEmailNotificationContext<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n ) {\n const operation = executionContext.operation;\n\n // Build template reference from executionContext.operation (guaranteed correct after doOperation corrections)\n const templateRef = buildUserNotificationEmailTemplateRef(\n {\n resourceIdentifier: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n ...(operation.variantKey && {\n variantKey: String(operation.variantKey),\n }),\n },\n notification,\n );\n\n // Determine the app primary locale from backend configuration.\n const locale = this.getDefaultLocale();\n\n // Get app identity and ID from config.\n // Slice 3.7 (F-53) terminology pin: `appIdentity.appName` is the\n // canonical id (from `WildoSaasConfig.name`), `appIdentity.displayName`\n // is the UI label. Notifications want the UI label, so we resolve a\n // local `appDisplayLabel` from `displayName ?? appName ?? 'Application'`\n // and pass it under the template prop name `appName` (existing\n // template contract — renaming the prop would ripple to every email\n // template, tracked separately).\n const appConfig = this.appConfigService.config as Record<string, unknown>;\n const appIdentity = appConfig.appIdentity as { appName?: string; displayName?: string } | undefined;\n const applicationId = this.appConfigService.applicationId || 'unknown';\n const appDisplayLabel = appIdentity?.displayName || appIdentity?.appName || 'Application';\n\n // Resolve dashboard URL — scope/target-aware (admin targets → APP_ADMIN, else MAIN_APP)\n const dashboardUrl = this.resolveDashboardUrlForNotification(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>, notification\n );\n\n // Fetch initiator name when user-initiated (for \"X added you\" style personalization)\n const initiatorUserId = executionContext.initiatorIds?.userId;\n const initiatorContext = initiatorUserId ? await this.fetchUserContext(initiatorUserId) : undefined;\n const initiatorName = initiatorContext?.firstName ?? initiatorContext?.name ?? undefined;\n\n // Resolve organization name from executionContext (org-scoped resources only)\n const organizationName = await this.resolveOrganizationName(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>, executionContext\n );\n\n // Resolve direct resource URL (e.g. /organizations/:orgId/todos/:todoId → full link)\n const resourceUrl = this.resolveResourceUrl(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>,\n functionParameters.currentObject as Record<string, unknown> | undefined,\n executionContext,\n dashboardUrl\n );\n\n // Build base context from function parameters\n const baseContext = {\n currentObject: functionParameters.currentObject,\n objectContext: {\n primaryScopeContext: {\n appName: appDisplayLabel,\n applicationId,\n organizationName: organizationName ?? undefined,\n // App brand logo for the email header. Resolve the email-optimised\n // lockup from config brandAssets; `resolveBrandAsset` falls back\n // (EMAIL → DEFAULT theme → PRIMARY), and the resolver returns\n // undefined when no brand asset was generated yet. ABSOLUTE variant:\n // email clients can't fetch a same-origin `/brand/<ref>.png`, so a\n // relative brand-asset path is prefixed with the app public base URL.\n logoUrl: this.appConfigService.resolveBrandLogoAbsoluteUrl({\n composition: BrandAssetComposition.LOCKUP,\n purpose: BrandAssetPurpose.EMAIL,\n }) ?? undefined,\n },\n },\n additionalContext: {\n operationType: String(operation.operationIdentifier),\n resourceType: String(operation.resourceIdentifier),\n dashboardUrl: dashboardUrl ?? undefined,\n initiatorName: initiatorName ?? undefined,\n resourceUrl: resourceUrl ?? undefined,\n // Token-consume link for token-bearing emails (e.g. invitation accept):\n // <frontendBase><emailLinkPath>?token=<tokenValue> when the op generated a\n // token and declares `tokenGeneration.emailLinkPath`. Undefined otherwise.\n acceptUrl: this.resolveTokenAcceptUrl(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>,\n functionParameters,\n dashboardUrl,\n ) ?? undefined,\n },\n };\n\n return { templateRef, locale, baseContext };\n }\n\n /**\n * Dispatch email notifications to a list of users.\n * Uses direct sending for small lists, batch queue for larger lists.\n */\n private async dispatchEmailNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n userIds: string[],\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const { templateRef, locale, baseContext } = await this.buildEmailNotificationContext(\n executionContext,\n functionParameters,\n notification,\n );\n\n if (userIds.length > EMAIL_BATCH_THRESHOLD) {\n await this.enqueueEmailBatch(\n templateRef,\n locale,\n userIds,\n baseContext,\n notification,\n emailSubmissionSourceId,\n );\n return [];\n }\n\n // Direct sending for smaller lists\n const results: EmailSendResult[] = [];\n for (const userId of userIds) {\n try {\n const recipientUserContext = await this.fetchUserContext(userId);\n\n if (!recipientUserContext?.email) {\n this.logger.warn('No email address for user, skipping notification', {\n userId,\n identifier: notification.identifier,\n });\n continue;\n }\n\n if (!this.recipientAcceptsNotificationChannel(notification, recipientUserContext)) {\n this.logDebug('Skipping user notification: recipient switched this channel off', {\n userId,\n identifier: notification.identifier,\n channel: notification.channel,\n });\n continue;\n }\n\n const recipientLocale = this.resolveRecipientLocale(recipientUserContext, locale);\n const result = await this.emailService.send({\n ...(emailSubmissionSourceId && {\n submissionId: deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { userId },\n ),\n }),\n templateRef,\n locale: recipientLocale,\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientUserContext.email,\n context: {\n ...baseContext,\n userContext: {\n userId,\n email: recipientUserContext.email,\n name: recipientUserContext.name,\n firstName: recipientUserContext.firstName,\n },\n },\n });\n results.push(result);\n\n this.logDebug('Email notification sent', {\n identifier: notification.identifier,\n userId,\n success: result.success,\n submissionId: result.submissionId,\n outcome: result.outcome,\n providerMessageIds: result.providerMessageIds,\n });\n } catch (error) {\n this.logger.warn('Failed to send email notification', {\n userId,\n identifier: notification.identifier,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n return results;\n }\n\n /**\n * Deliver a single email to a raw address read from the current object — the\n * email-by-address path selected when an EMAIL notification declares\n * `recipientEmailField` (see `dispatchEmailSmsPushUserNotification`).\n *\n * The recipient is `currentObject[recipientEmailField]` (a top-level string field,\n * e.g. `email`) — a party who is NOT a platform user (an invitation invitee, an\n * inbound lead), so there is no `userId` and no user preferences. The app default\n * locale is used, and the shared notification context is reused verbatim, so\n * token-bearing emails still carry their `acceptUrl`. Best-effort: a missing address\n * or a send failure is logged and swallowed, never thrown into the operation pipeline.\n */\n /**\n * Which of the tenant's four notification categories an organization-targeted notification\n * belongs to, or `undefined` when the target names no category.\n *\n * DERIVED from the target rather than declared per notification (#410). The two vocabularies were\n * built to line up and a mapping table is the only place they can drift; the entries that are\n * absent are absent for a reason:\n *\n * - `ORGANIZATION_USERS` fans out to every member BY DESIGN. Routing it to one address would\n * change who the message is for, not merely where it lands.\n * - `ORGANIZATION` is the tenant itself with no category, so it falls to `defaultEmailAddress`\n * below without belonging to a switch.\n */\n private static readonly ORGANIZATION_NOTIFICATION_CATEGORY_BY_TARGET: Readonly<Record<string, 'billing' | 'security' | 'administrative' | 'usersManagement'>> = Object.freeze({\n [CoreUserNotificationTarget.ORGANIZATION_BILLING]: 'billing',\n [CoreUserNotificationTarget.ORGANIZATION_SECURITY]: 'security',\n [CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE]: 'administrative',\n [CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT]: 'usersManagement',\n });\n\n /**\n * Resolve where an organization-targeted email should go, and whether it should go at all.\n *\n * Returns `undefined` for a target this record does not govern, so the caller falls through to\n * the ordinary member fan-out. Reading the record is best-effort: a tenant with no\n * `organizationNotifications` row, or a read that fails, must fall through to the behaviour that\n * existed before this feature rather than silently dropping the notification.\n */\n private async resolveOrganizationNotificationRouting<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n notification: UserNotificationDefinition,\n target: string,\n ): Promise<{ address?: string; suppressed: boolean; category?: string } | undefined> {\n const category = NotificationDispatcherService.ORGANIZATION_NOTIFICATION_CATEGORY_BY_TARGET[target];\n const isTenantWide = target === CoreUserNotificationTarget.ORGANIZATION;\n if (!category && !isTenantWide) return undefined;\n\n const organizationId = (executionContext as any)?.initiatorIds?.organizationId as string | undefined;\n if (!organizationId) return undefined;\n\n let settings: OrganizationEmailNotifications | undefined;\n try {\n const repository = this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_NOTIFICATIONS);\n if (!repository) return undefined;\n const record = await repository.read<{ emailNotifications?: OrganizationEmailNotifications }>(\n { operation: { resourceIdentifier: CoreResourceType.ORGANIZATION_NOTIFICATIONS, operationIdentifier: 'read' } } as any,\n { organizationId },\n { excludeContextualFilter: true },\n );\n settings = record?.emailNotifications;\n } catch {\n this.logDebug('Failed to read organization notification settings; falling back to member fan-out', {\n identifier: notification.identifier,\n organizationId,\n });\n return undefined;\n }\n\n if (!settings) return undefined;\n\n // The switch is a suppression and applies whether or not an address is configured: a tenant\n // that turns billing notifications off means it for the members too, not only for the address.\n if (category && settings[category] === false) {\n return { suppressed: true, category };\n }\n\n const categoryAddress = category\n ? settings[`${category}Address` as keyof OrganizationEmailNotifications]\n : undefined;\n const address = (typeof categoryAddress === 'string' && categoryAddress.trim())\n || (typeof settings.defaultEmailAddress === 'string' && settings.defaultEmailAddress.trim())\n || undefined;\n\n return { address: address || undefined, suppressed: false, category };\n }\n\n /**\n * Send one organization-routed email to the tenant's configured address (#410).\n *\n * Deliberately NOT reusing `dispatchEmailToRecipientAddress`: that path exists for an address\n * read off the operation's own object — an invitee who has no account — and its logging and its\n * `userId: ''` sentinel both say so. This recipient is a tenant's own routing address, a\n * different thing with a different reason for having no user, and collapsing them would make the\n * logs unable to answer which kind of send happened.\n */\n private async dispatchEmailToOrganizationAddress<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n recipientEmail: string,\n category: string | undefined,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const { templateRef, locale, baseContext } = await this.buildEmailNotificationContext(\n executionContext,\n functionParameters,\n notification,\n );\n\n try {\n const result = await this.emailService.send({\n ...(emailSubmissionSourceId && {\n submissionId: deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { email: recipientEmail },\n ),\n }),\n templateRef,\n locale,\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientEmail,\n context: {\n ...baseContext,\n // A routing address belongs to the TENANT, not to a person: `userId: ''` is the same\n // \"no platform user\" sentinel the by-address path uses, for a different reason.\n userContext: { userId: '', email: recipientEmail },\n },\n });\n\n this.logDebug('Organization-routed notification sent', {\n identifier: notification.identifier,\n category,\n success: result.success,\n submissionId: result.submissionId,\n outcome: result.outcome,\n });\n return [result];\n } catch (error) {\n this.logger.warn('Failed to send organization-routed notification', {\n identifier: notification.identifier,\n category,\n ...projectCaughtErrorLogFields(error),\n });\n return [];\n }\n }\n\n private async dispatchEmailToRecipientAddress<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n recipientEmailField: string,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const operation = executionContext.operation;\n const currentObject = functionParameters.currentObject as Record<string, unknown> | undefined;\n const rawAddress = currentObject?.[recipientEmailField];\n const recipientEmail = typeof rawAddress === 'string' ? rawAddress.trim() : '';\n\n if (!recipientEmail) {\n this.logger.warn('Email-by-address notification has no recipient address on the current object; skipping', {\n identifier: notification.identifier,\n recipientEmailField,\n resourceType: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n });\n return [];\n }\n\n const { templateRef, locale, baseContext } = await this.buildEmailNotificationContext(\n executionContext,\n functionParameters,\n notification,\n );\n\n try {\n const result = await this.emailService.send({\n ...(emailSubmissionSourceId && {\n submissionId: deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { email: recipientEmail },\n ),\n }),\n templateRef,\n locale,\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientEmail,\n context: {\n ...baseContext,\n // Non-user recipient: only the address is known. `userId: ''` is the explicit\n // \"no platform user\" sentinel for the required `EmailUserContext.userId` field.\n userContext: {\n userId: '',\n email: recipientEmail,\n },\n },\n });\n\n this.logDebug('Email-by-address notification sent', {\n identifier: notification.identifier,\n recipientEmailField,\n success: result.success,\n submissionId: result.submissionId,\n outcome: result.outcome,\n providerMessageIds: result.providerMessageIds,\n });\n return [result];\n } catch (error) {\n this.logger.warn('Failed to send email-by-address notification', {\n identifier: notification.identifier,\n recipientEmailField,\n ...projectCaughtErrorLogFields(error),\n });\n return [];\n }\n }\n\n /**\n * Enqueue a batch of emails for asynchronous sending.\n * Used for large recipient lists (above EMAIL_BATCH_THRESHOLD).\n */\n private async enqueueEmailBatch(\n templateRef: string,\n locale: AvailableLanguage,\n userIds: string[],\n baseContext: Record<string, unknown>,\n notification: UserNotificationDefinition,\n emailSubmissionSourceId?: string,\n ): Promise<void> {\n // Fetch all user contexts first\n const emailItems: Array<{\n submissionId: string;\n templateRef: string;\n locale: string;\n type: string;\n to: string;\n context: Record<string, unknown>;\n }> = [];\n\n for (const userId of userIds) {\n try {\n const recipientUserContext = await this.fetchUserContext(userId);\n\n if (!recipientUserContext?.email) {\n continue;\n }\n\n // Same gate as the direct loop above. Both exist because the dispatcher splits on list size,\n // and a suppression applied to only one of them would depend on how many recipients an\n // operation happened to have.\n if (!this.recipientAcceptsNotificationChannel(notification, recipientUserContext)) {\n this.logDebug('Skipping user notification in batch: recipient switched this channel off', {\n userId,\n identifier: notification.identifier,\n channel: notification.channel,\n });\n continue;\n }\n\n emailItems.push({\n submissionId: emailSubmissionSourceId\n ? deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { userId },\n )\n : randomUUID(),\n templateRef,\n locale: this.resolveRecipientLocale(recipientUserContext, locale),\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientUserContext.email,\n context: {\n ...baseContext,\n userContext: {\n userId,\n email: recipientUserContext.email,\n name: recipientUserContext.name,\n firstName: recipientUserContext.firstName,\n },\n },\n });\n } catch (error) {\n this.logger.warn('Failed to fetch user context for batch', {\n userId,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n if (emailItems.length === 0) {\n this.logDebug('No valid email recipients for batch', {\n identifier: notification.identifier,\n });\n return;\n }\n\n // Enqueue the batch\n const { jobId } = await this.queueService.enqueueCustomBatch(\n EMAIL_BATCH_SEND_BATCH_REF,\n {\n batchId: `${notification.identifier}-${randomUUID()}`,\n emails: emailItems,\n retryOnFailure: true,\n maxRetries: 3,\n }\n );\n\n this.logDebug('Email batch enqueued', {\n identifier: notification.identifier,\n jobId,\n emailCount: emailItems.length,\n });\n }\n\n /**\n * Get default locale from app config\n */\n private getDefaultLocale(): AvailableLanguage {\n return getConfiguredPrimaryLanguage(this.appConfigService.config);\n }\n\n private resolveRecipientLocale(\n recipientUserContext: { preferredLanguage?: AvailableLanguage } | undefined,\n fallbackLocale: AvailableLanguage,\n ): AvailableLanguage {\n return recipientUserContext?.preferredLanguage || fallbackLocale;\n }\n\n private normalizeAvailableLanguage(value: unknown): AvailableLanguage | undefined {\n return Object.values(AvailableLanguage).includes(value as AvailableLanguage)\n ? value as AvailableLanguage\n : undefined;\n }\n\n private async fetchUserPreferences(userId: string): Promise<UserPreferences | undefined> {\n try {\n const userPreferencesRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USER_PREFERENCES);\n if (!userPreferencesRepository) {\n this.logDebug('No user preferences repository available for recipient locale resolution', { userId });\n return undefined;\n }\n\n return await userPreferencesRepository.read<UserPreferences>(\n { operation: { resourceIdentifier: CoreResourceType.USER_PREFERENCES, operationIdentifier: 'read' } } as any,\n { userId },\n { excludeContextualFilter: true },\n ) ?? undefined;\n } catch {\n this.logDebug('Failed to fetch user preferences for recipient locale resolution', { userId });\n return undefined;\n }\n }\n\n /**\n * Resolve the recipient's profile (`USER_PROFILES`, 1:1 with `USERS` via a\n * unique `userId` FK — read context-addressed by `{ userId }`, exactly like\n * {@link fetchUserPreferences}). This is where the human name fields live\n * (`firstName` / `lastName` / `displayName`); the `USERS` row carries none of\n * them. Best-effort: a missing repository or read failure degrades to\n * `undefined` so the caller can fall back to the email address.\n */\n private async fetchUserProfile(userId: string): Promise<UserProfile | undefined> {\n try {\n const userProfilesRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USER_PROFILES);\n if (!userProfilesRepository) {\n this.logDebug('No user profiles repository available for recipient name resolution', { userId });\n return undefined;\n }\n\n return await userProfilesRepository.read<UserProfile>(\n { operation: { resourceIdentifier: CoreResourceType.USER_PROFILES, operationIdentifier: 'read' } } as any,\n { userId },\n { excludeContextualFilter: true },\n ) ?? undefined;\n } catch {\n this.logDebug('Failed to fetch user profile for recipient name resolution', { userId });\n return undefined;\n }\n }\n\n /**\n * Get user IDs for a notification target\n * Handles both fixed targets and custom userIdsSelector\n */\n private async getUserIdsForTarget<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n target: string\n ): Promise<string[]> {\n // Custom user targeting via userIdsSelector\n if (target === CoreUserNotificationTarget.USERS_CUSTOM && notification.userIdsSelector) {\n // Ensure objectContext has the expected structure (parents/children)\n const objectContext = functionParameters.objectContext || {};\n const normalizedObjectContext = {\n parents: (objectContext as any)?.parents || {},\n children: (objectContext as any)?.children || {}\n };\n\n return Array.from(new Set(notification.userIdsSelector({\n currentObject: functionParameters.currentObject,\n inputDto: functionParameters.inputDto,\n objectContext: normalizedObjectContext,\n initiatorIds: functionParameters.initiatorIds\n })));\n }\n\n // Fixed targets - extract from executionContext.initiatorIds\n const initiatorIds = executionContext.initiatorIds;\n\n switch (target) {\n case CoreUserNotificationTarget.USER_SELF:\n return initiatorIds?.userId ? [initiatorIds.userId] : [];\n\n case CoreUserNotificationTarget.ORGANIZATION:\n case CoreUserNotificationTarget.ORGANIZATION_USERS:\n return this.getOrganizationRecipientUserIds(executionContext, initiatorIds?.organizationId);\n\n case CoreUserNotificationTarget.ORGANIZATION_BILLING:\n case CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE:\n case CoreUserNotificationTarget.ORGANIZATION_SECURITY:\n return this.getOrganizationRecipientUserIds(\n executionContext,\n initiatorIds?.organizationId,\n this.mapOrganizationTargetToRoles(target as CoreUserNotificationTarget, notification),\n );\n\n case CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR:\n case CoreUserNotificationTarget.APPLICATION_BILLING:\n case CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.APPLICATION_SECURITY:\n case CoreUserNotificationTarget.APPLICATION_SUPPORT:\n case CoreUserNotificationTarget.APPLICATION_OTHER:\n case CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER:\n /*\n * Resolved since #507. Seventeen shipped engine notifications target APPLICATION_ADMINISTRATOR\n * on the EMAIL channel — application API-key lifecycle, OAuth-client lifecycle and user events —\n * and every one of them used to fall into `default:`, resolve nobody, and send nothing. None\n * declares `recipientEmailField`, so none escaped through the by-address path.\n *\n * It went unnoticed because the WEBSOCKET branch for these same targets always worked\n * (`mapApplicationTargetToRoles` + `sendToAppRole`), so an administrator watching a dashboard\n * saw the events live and the feature appeared to work. Only the email half was dead.\n */\n return this.getApplicationRecipientUserIds(\n executionContext,\n this.mapApplicationTargetToRoles(target as CoreUserNotificationTarget, notification),\n );\n\n case CoreUserNotificationTarget.INBOUND_CONTACT:\n /*\n * Resolves NO user, deliberately and not by omission. An inbound contact is a person who is not\n * a user of this application — the notification reaches them through `recipientEmailField`, the\n * by-address path, which never calls this method. Returning `[]` here is the correct answer and\n * is stated as its own case so it is not mistaken for the defect above.\n */\n return [];\n\n default:\n /*\n * Every member of the vocabulary now has an explicit answer, so reaching here means a target was\n * ADDED and nobody decided what it resolves to.\n *\n * This is a WARN and not a debug line, which is the second half of #507's fix. The defect above\n * survived because a `default:` arm silently returned no recipients for seven enum members while\n * logging at debug — a channel `AbstractControllerBackendService` disables — so the dispatcher\n * reported success and delivered nothing. A target the dispatcher cannot serve has to say so\n * where somebody reads it.\n */\n this.logger.warn('Notification target resolves no recipients: the dispatcher has no rule for it', {\n target,\n identifier: notification.identifier,\n channel: notification.channel,\n });\n return [];\n }\n }\n\n /**\n * The users an APPLICATION-level notification is addressed to: holders of the target's app roles.\n *\n * The app-level counterpart of {@link getOrganizationRecipientUserIds}, and it mirrors that method\n * deliberately — same sub-call context, same initiator exclusion, same \"no repository means no\n * recipients\" posture — so the two halves of one feature cannot drift into behaving differently.\n *\n * ## Tenancy: there is no tenant to cross\n *\n * These recipients are application-level administrators rather than members of the tenant whose row\n * triggered the event, so the question \"does this leak one tenant's data to another\" has to be\n * answered rather than assumed. It is answered by the population: all 17 notifications sit on\n * APPLICATION-scoped resources (`users`, application API keys, application OAuth clients), and\n * `resolveOrganizationName` — the only place a tenant's name enters an email context — returns\n * `undefined` unless the operation's `resourcePrimaryScope` is `ORGANIZATIONS`. So no tenant name\n * reaches these bodies, by construction rather than by care.\n *\n * That is a property of the CURRENT population, not a guarantee about future ones. An\n * ORGANIZATIONS-scoped operation that adds an `APPLICATION_*` notification would put a tenant's data\n * in front of a non-member, and this is the comment that should stop it.\n *\n * ## Why the query filters rather than listing everyone\n *\n * `appRoles` is `.isDBIndexed()`, and the same `$in` shape is what the super-administrator floor uses\n * to count administrators. The organization path can afford to filter roles in memory because its\n * population is one tenant's roster; the application population is every user of the application.\n */\n private async getApplicationRecipientUserIds(\n executionContext: ExecutionContext<any>,\n appRoles: string[],\n ): Promise<string[]> {\n if (appRoles.length === 0) {\n return [];\n }\n\n const usersRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USERS);\n if (!usersRepository) {\n // WARN rather than debug: this is the shape that hid #507 for the life of the target.\n this.logger.warn('No users repository available for application-level notification targeting', {\n appRoles,\n });\n return [];\n }\n\n // Same reasoning as the organization roster read: this runs during dispatch for a notification\n // attached to ANY resource operation, so the caller's context is keyed to that resource and its\n // contextual filter is fail-closed on a field USERS does not model.\n const recipientReadContext = this.executionContextCreator\n ? await this.executionContextCreator.createForSubCall(\n executionContext as any,\n CoreResourceType.USERS,\n CoreResourceOperation.LIST,\n )\n : executionContext;\n\n const candidates = await usersRepository.list<{ _id?: string; appRoles?: string[]; status?: string }>(\n recipientReadContext as any,\n {\n appRoles: { $in: [...appRoles] },\n // ACTIVE only. A suspended or pending administrator is not someone to notify, and the\n // retention hide at the repository chokepoint already keeps erased-but-retained rows out —\n // which matters here because `appRoles` is `.isAuditEvidence()` and survives the scrub, so a\n // retained row would otherwise still match a role filter.\n status: UserStatus.ACTIVE,\n },\n );\n\n const initiatorUserId = executionContext.initiatorIds?.userId;\n return Array.from(new Set(\n (Array.isArray(candidates) ? candidates : [])\n .map((candidate) => candidate?._id)\n .filter((userId): userId is string => typeof userId === 'string' && userId.length > 0)\n // Mirrors the organization path: the administrator who rotated the key does not need an email\n // telling them they rotated it.\n .filter((userId) => userId !== initiatorUserId),\n ));\n }\n\n /**\n * Resolve the per-recipient context consumed by every greeting surface (email\n * subject/body, the `initiatorName` personalization, batch/direct sends).\n *\n * The human name fields (`firstName` / `lastName` / `displayName`) live on\n * `USER_PROFILES`, NOT on the `USERS` row — `UserSchema` carries only the email\n * identity anchor, status, roles and timestamps. Reading `firstName`/`name`\n * off the `USERS` row (as this method historically did) therefore resolved to\n * `undefined` for EVERY user, so greetings rendered blank and any\n * `{firstName}`-style label placeholder leaked its literal token to the\n * recipient — `interpolateLabelParams` returns the raw `{token}` verbatim when\n * the param is absent.\n *\n * Names are now read from the user's profile and degrade to `email` when a\n * user has no profile yet (SSO-JIT / anonymous edge cases, or a not-yet-seeded\n * profile). This mirrors the SCIM formatter's `displayName || fullName ||\n * email` degradation so every surface renders *something* human — never a\n * blank, never a raw placeholder token. `name` carries the same greeting label\n * as `displayName`; `firstName` is the informal variant with the same email\n * floor.\n */\n /**\n * Whether this notification may be sent to THIS recipient on THIS channel, given the recipient's\n * own channel switches (#409).\n *\n * Until 2026-09-08 `UserPreferences.notifications` was stored, editable on the self-preferences\n * screen, classified as personal data, subject-exported and reset on erasure — and read by\n * nothing. A person who turned email off still received email.\n *\n * ONE predicate rather than a check at each of the three send loops, because that is the shape\n * this repository's own rule asks for: an invariant applied at some of its call sites is the\n * defect it keeps recording. The loops call this; nothing else decides.\n *\n * Three ways a message is delivered regardless, each for a different reason:\n * - the target is ROLE-addressed (see `userNotificationTargetIsSuppressibleByRecipientPreference`)\n * — the recipient did not choose to receive it as a person;\n * - the notification declares `alwaysDeliver` — a security notice a compromised account's owner\n * must still receive;\n * - the channel has no switch, or the recipient has no preferences row at all. A missing record\n * must never read as \"everything off\": preferences are created lazily, so a user who has never\n * opened the settings screen would otherwise silently stop receiving everything.\n */\n private recipientAcceptsNotificationChannel(\n notification: UserNotificationDefinition,\n recipientUserContext: { notificationChannelPreferences?: UserPreferences_Notifications } | undefined,\n ): boolean {\n if (notification.alwaysDeliver === true) return true;\n if (!userNotificationTargetIsSuppressibleByRecipientPreference(notification.target)) return true;\n\n const preferences = recipientUserContext?.notificationChannelPreferences;\n if (!preferences) return true;\n\n switch (notification.channel) {\n case CoreUserNotificationChannel.EMAIL:\n return preferences.email !== false;\n case CoreUserNotificationChannel.SMS:\n return preferences.sms !== false;\n case CoreUserNotificationChannel.PUSH:\n return preferences.push !== false;\n default:\n // WEBSOCKET and FRONT_END_SUCCESS carry no switch of their own. The `inApp` preference\n // governs the notification CENTRE, which is a frontend surface — `NotificationContext`\n // honours it there, because suppressing the socket frame would also suppress the live\n // UI updates that ride the same channel.\n return true;\n }\n }\n\n private async fetchUserContext(userId: string): Promise<any | undefined> {\n try {\n const userRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USERS);\n if (!userRepository) {\n this.logDebug('No user repository available for fetchUserContext', { userId });\n return undefined;\n }\n const user = await userRepository.read(\n { operation: { resourceIdentifier: CoreResourceType.USERS, operationIdentifier: 'read' } } as any,\n userId,\n { excludeContextualFilter: true },\n );\n if (!user) return undefined;\n\n const email = (user as any).email as string | undefined;\n\n // Profile (name fields) and preferences (locale) are independent lookups\n // keyed only by `userId`, so resolve them concurrently — adding the profile\n // read must not serialize an extra round-trip per recipient on batch sends.\n // Both helpers are best-effort (own try/catch → undefined), so `Promise.all`\n // never rejects here.\n const [profile, preferences] = await Promise.all([\n this.fetchUserProfile(userId),\n this.fetchUserPreferences(userId),\n ]);\n\n // Names come from USER_PROFILES (1:1 with USERS). Fall back to `email` so a\n // profile-less recipient still gets a sensible greeting and never a blank\n // or a leaked `{firstName}` token. `filter(Boolean)` drops a missing half of\n // the name; `|| undefined` collapses the empty-string join so the `??`\n // chain reaches the email floor.\n const fullName = [profile?.firstName, profile?.lastName].filter(Boolean).join(' ') || undefined;\n const displayName = profile?.displayName ?? fullName ?? email;\n const firstName = profile?.firstName ?? email;\n\n const preferredLanguage = this.normalizeAvailableLanguage(preferences?.languagePreferences?.primaryLanguage)\n ?? this.normalizeAvailableLanguage(preferences?.regional?.locale);\n return {\n email,\n displayName,\n name: displayName,\n firstName,\n preferredLanguage,\n // The recipient's own channel switches (#409). Costs NOTHING extra: the preferences record\n // is already read above for the locale, and only its language fields were being consumed —\n // which is precisely why a user who turned email off kept receiving email.\n notificationChannelPreferences: preferences?.notifications,\n userId,\n };\n } catch {\n this.logDebug('Failed to fetch user context', { userId });\n return undefined;\n }\n }\n\n private async getOrganizationRecipientUserIds(\n executionContext: ExecutionContext<any>,\n organizationId: string | undefined,\n allowedRoles?: string[],\n ): Promise<string[]> {\n if (!organizationId) {\n return [];\n }\n\n const organizationMembersRepository = this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_MEMBERS);\n if (!organizationMembersRepository) {\n this.logDebug('No organization members repository available for notification targeting', {\n organizationId,\n });\n return [];\n }\n\n // Read the roster on a SUB-CALL context, not the caller's. This runs during dispatch for a\n // notification attached to ANY resource operation, so the caller's context is keyed to that\n // resource — a nested route contributes its own FK (`todoId`, …), and the repository's contextual\n // filter is fail-closed on a field ORGANIZATION_MEMBERS does not model: it THROWS rather than\n // ignoring it. Narrowing keeps `organizationId`/`userId` (both real columns) and drops the rest.\n // Falls back to the caller's context only when the creator is unavailable (minimal containers).\n const rosterReadContext = this.executionContextCreator\n ? await this.executionContextCreator.createForSubCall(\n executionContext as any,\n CoreResourceType.ORGANIZATION_MEMBERS,\n CoreResourceOperation.LIST,\n )\n : executionContext;\n\n const membershipSummaries = await organizationMembersRepository.list<OrganizationMember>(\n rosterReadContext as any,\n {\n organizationId,\n status: OrganizationMemberStatus.ACTIVE,\n },\n );\n const memberships = await Promise.all(\n membershipSummaries.map(async (membership) => {\n if (membership?.userId && Array.isArray(membership.roles)) {\n return membership;\n }\n if (membership?._id) {\n try {\n return await organizationMembersRepository.read(\n executionContext as any,\n membership._id,\n ) as OrganizationMember | null;\n } catch {\n return membership;\n }\n }\n return membership;\n }),\n );\n\n const allowedRoleSet = allowedRoles && allowedRoles.length > 0\n ? new Set(allowedRoles)\n : null;\n const initiatorUserId = executionContext.initiatorIds?.userId;\n const userIds = memberships\n .filter((membership): membership is OrganizationMember => Boolean(membership))\n .filter((membership) => membership.status === OrganizationMemberStatus.ACTIVE)\n .filter((membership) => typeof membership.userId === 'string' && membership.userId.length > 0)\n .filter((membership) => membership.userId !== initiatorUserId)\n .filter((membership) => {\n if (!allowedRoleSet) {\n return true;\n }\n return membership.roles.some((role) => allowedRoleSet.has(role));\n })\n .map((membership) => membership.userId);\n\n return Array.from(new Set(userIds));\n }\n\n /**\n * Build the public token-consume URL for a token-bearing notification email.\n *\n * When the operation generated a consumable token — its `tokenValue` was injected\n * into `functionParameters.additionalContext` by the services-registry-handler\n * before dispatch — AND the operation declares `tokenGeneration.emailLinkPath`,\n * this returns `<frontendBaseUrl><emailLinkPath>?token=<tokenValue>` (e.g. the\n * `/invitation?token=…` acceptance link). Returns undefined otherwise, so the\n * email template falls back to its generic CTA. Generic across token types — the\n * consume path comes from the operation's declarative config, not hard-coded here.\n */\n private resolveTokenAcceptUrl(\n operation: ResourceConfiguration_Operation<any, any, any>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n frontendBaseUrl: string | undefined,\n ): string | undefined {\n const emailLinkPath = 'tokenGeneration' in operation ? operation.tokenGeneration?.emailLinkPath : undefined;\n // `additionalContext` is injected dynamically by the services-registry-handler\n // (it carries the freshly-minted `tokenValue`); it is not on the static\n // FunctionParameters type, so read it through a narrow cast.\n const tokenValue = (functionParameters as { additionalContext?: Record<string, unknown> })\n .additionalContext?.tokenValue;\n if (!emailLinkPath || typeof tokenValue !== 'string' || tokenValue.length === 0 || !frontendBaseUrl) {\n return undefined;\n }\n const base = frontendBaseUrl.endsWith('/') ? frontendBaseUrl.slice(0, -1) : frontendBaseUrl;\n const path = emailLinkPath.startsWith('/') ? emailLinkPath : `/${emailLinkPath}`;\n return `${base}${path}?token=${encodeURIComponent(tokenValue)}`;\n }\n\n /**\n * Resolve the correct frontend app URL based on notification target.\n * Uses the config-driven reverse lookup: notification target → user type (via defaultAppRoles) → app type.\n * Admin-targeted notifications route to the app type that serves admin user types.\n * All other notifications route to the default frontend app type.\n */\n private resolveDashboardUrlForNotification(\n _operation: ResourceConfiguration_Operation<any, any, any>,\n notification: UserNotificationDefinition\n ): string | undefined {\n const target = notification.target;\n const config = this.appConfigService.config;\n\n const isAdminTarget =\n target === CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR ||\n target === CoreUserNotificationTarget.APPLICATION_BILLING ||\n target === CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT ||\n target === CoreUserNotificationTarget.APPLICATION_SECURITY ||\n target === CoreUserNotificationTarget.APPLICATION_SUPPORT ||\n target === CoreUserNotificationTarget.APPLICATION_OTHER ||\n target === CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER;\n\n let appType: string | null = null;\n\n if (isAdminTarget) {\n const adminUserType = Object.entries(config.userTypes)\n .find(([, def]) => def.defaultAppRoles?.includes(CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN))?.[0];\n appType = adminUserType\n ? this.appConfigService.resolveFrontendServiceNameFromUserType(adminUserType)\n : null;\n }\n\n if (!appType) {\n appType = this.appConfigService.resolveDefaultFrontendServiceName();\n }\n\n if (!appType) return undefined;\n return AuthControllerUtils.lookupFrontendPublicUrl(config, appType) ?? undefined;\n }\n\n /**\n * Resolve organization name for email context.\n * Only fetches for org-scoped resources (ORGANIZATIONS scope) using the org ID\n * from executionContext. Returns undefined for USER_SELF, APPLICATION scopes.\n */\n private async resolveOrganizationName(\n operation: ResourceConfiguration_Operation<any, any, any>,\n executionContext: ExecutionContext<any>\n ): Promise<string | undefined> {\n if (operation.resourcePrimaryScope !== ResourcePrimaryScope.ORGANIZATIONS) {\n return undefined;\n }\n\n const organizationId = executionContext.initiatorIds?.organizationId;\n if (!organizationId) {\n return undefined;\n }\n\n try {\n const orgRepository = this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATIONS);\n if (!orgRepository) {\n return undefined;\n }\n const org = await orgRepository.read(\n { operation: { resourceIdentifier: CoreResourceType.ORGANIZATIONS, operationIdentifier: 'read' } } as any,\n organizationId,\n { excludeContextualFilter: true },\n );\n if (!org) return undefined;\n return (org as any).displayName ?? (org as any).name ?? undefined;\n } catch {\n this.logDebug('Failed to resolve organization name', { organizationId });\n return undefined;\n }\n }\n\n /**\n * Resolve a direct resource URL for the entity that triggered the notification.\n * Builds the READ operation's frontend route and replaces `:param` placeholders\n * with actual IDs from the currentObject and executionContext.\n * Returns undefined for destructive operations (DELETE) or when resolution fails.\n */\n private resolveResourceUrl(\n operation: ResourceConfiguration_Operation<any, any, any>,\n currentObject: Record<string, unknown> | undefined,\n executionContext: ExecutionContext<any>,\n dashboardUrl: string | undefined\n ): string | undefined {\n if (!dashboardUrl || !currentObject) return undefined;\n\n const effectiveOperation = this.resolveEffectiveCoreOperation(\n operation.operationIdentifier,\n operation.resourceOperationLike,\n );\n if (shouldOmitResourceUrlForOperation(effectiveOperation)) {\n return undefined;\n }\n\n try {\n const resourceType = String(operation.resourceIdentifier);\n const routePaths = this.getReadRoutePaths(resourceType);\n if (!routePaths) return undefined;\n\n const resourceConfig = this.resourcesRegistry.tryGetResourceConfiguration(resourceType as any);\n\n const idSources: Record<string, unknown> = {\n ...(executionContext.initiatorIds ?? {}),\n ...(currentObject as Record<string, unknown>),\n };\n\n const entityId = (currentObject as any).id ?? (currentObject as any)._id;\n const selfFieldId = resourceConfig?.resourceFieldIdentifier;\n if (selfFieldId && entityId) {\n idSources[selfFieldId] = entityId;\n }\n\n const base = dashboardUrl.endsWith('/') ? dashboardUrl.slice(0, -1) : dashboardUrl;\n\n for (const { url: routeTemplate, parameters } of routePaths) {\n let resolved = routeTemplate;\n let allResolved = true;\n for (const param of parameters) {\n const value = idSources[param.fieldIdentifier];\n if (!value) { allResolved = false; break; }\n resolved = resolved.replace(`:${param.fieldIdentifier}`, String(value));\n }\n if (allResolved && !resolved.includes(':')) {\n return `${base}${resolved}`;\n }\n }\n\n return undefined;\n } catch {\n this.logDebug('Failed to resolve resource URL', {\n resourceIdentifier: String(operation.resourceIdentifier),\n });\n return undefined;\n }\n }\n\n /**\n * Get cached READ operation route paths for a resource type.\n * Computed once per resource type since configs are immutable after initialization.\n * Returns null (cached miss) when the resource has no routable READ operation.\n */\n private getReadRoutePaths(resourceType: string): CachedRoutePaths | null {\n if (this.readRoutePathsCache.has(resourceType)) {\n return this.readRoutePathsCache.get(resourceType)!;\n }\n\n const resourceConfig = this.resourcesRegistry.tryGetResourceConfiguration(resourceType as any);\n if (!resourceConfig) {\n this.readRoutePathsCache.set(resourceType, null);\n return null;\n }\n\n const readCandidates = resourceConfig.operations.filter(\n (op: ResourceConfiguration_Operation<any, any, any>) =>\n op.operationIdentifier === CoreResourceOperation.READ\n && op.isOperationDefault === true\n && !('isBulkOperation' in op && op.isBulkOperation === true)\n && (\n op.variantType === ResourceOperationVariantType.API_CALL\n || op.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n )\n );\n if (readCandidates.length > 1) {\n const candidateVariants = readCandidates.map((op) => ({\n variantType: op.variantType,\n variantKey: op.variantKey,\n }));\n this.logDebug('Ambiguous notification READ route candidates', {\n resourceType,\n candidateVariants,\n });\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Notification deep-link routing requires exactly one default non-bulk URL-bearing READ operation',\n resourceType,\n candidateVariants,\n },\n },\n );\n }\n const readOp = readCandidates[0];\n if (!readOp) {\n this.readRoutePathsCache.set(resourceType, null);\n return null;\n }\n\n const allFieldIds = this.resourcesRegistry.getAllResourceFieldIdentifiers();\n const paths = ResourcesConfigOperationsUrlsBuilderUtils.buildOperationFrontendRoutePaths(\n resourceConfig, readOp as any, allFieldIds\n );\n\n const result = paths.length > 0 ? paths : null;\n this.readRoutePathsCache.set(resourceType, result);\n return result;\n }\n\n /**\n * Dispatch WebSocket-based user notification\n * Routes to appropriate rooms based on target\n */\n private async dispatchWebSocketUserNotification<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition\n ): Promise<void> {\n const operation = executionContext.operation;\n const target = notification.target;\n const operationPathKey = (() => {\n try {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n } catch (error) {\n this.logDebug('Unable to serialize resource notification operation path key', {\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n error: describeCaughtError(error),\n });\n return undefined;\n }\n })();\n\n // Build the notification payload\n const payload: WS_ResourceNotificationPayload = {\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation: 'isBulkOperation' in operation && operation.isBulkOperation === true,\n variantKey: operation.variantKey,\n action: this.mapOperationToAction(\n operation.operationIdentifier,\n operation.resourceOperationLike,\n ),\n // Pass configured notification level (if provided) - frontend will use this over action-based default\n // UserNotificationLevel and NotificationLevel are identical enums - cast through unknown\n notificationLevel: notification.level as unknown as NotificationLevel | undefined,\n affectedIds: this.extractAffectedIds(functionParameters.currentObject),\n contextResourceIdentifiers: this.convertContextResourceIdsToRecord(executionContext),\n notificationIdentifier: notification.identifier,\n initiatorUserId: executionContext.initiatorIds?.userId,\n timestamp: new Date(),\n };\n\n // Copy FRONT_END_SUCCESS-specific display hints into the WS payload.\n // The backend does NOT interpret these — it passes them through for the frontend.\n if (notification.channel === CoreUserNotificationChannel.FRONT_END_SUCCESS) {\n const feNotification = notification as z.infer<typeof UserNotificationDefinition_FrontEndSuccessSchema>;\n if (feNotification.celebration || feNotification.nextStep) {\n payload.frontendDisplayHints = {\n celebration: feNotification.celebration,\n nextStep: feNotification.nextStep,\n };\n }\n }\n\n const message: WebSocketMessage = {\n type: CoreWebSocketEvent.RESOURCE_NOTIFICATION,\n payload,\n timestamp: new Date(),\n userId: executionContext.initiatorIds?.userId,\n organizationId: executionContext.initiatorIds?.organizationId,\n };\n\n // Route based on target\n switch (target) {\n case CoreUserNotificationTarget.USER_SELF:\n if (executionContext.initiatorIds?.userId) {\n await this.webSocketService.sendToUser(executionContext.initiatorIds.userId, message);\n }\n break;\n\n case CoreUserNotificationTarget.ORGANIZATION:\n case CoreUserNotificationTarget.ORGANIZATION_USERS:\n if (executionContext.initiatorIds?.organizationId) {\n await this.webSocketService.sendToOrganization(\n executionContext.initiatorIds.organizationId,\n message,\n // Optionally exclude the initiator\n executionContext.initiatorIds?.userId ? [executionContext.initiatorIds.userId] : undefined\n );\n }\n break;\n\n case CoreUserNotificationTarget.ORGANIZATION_BILLING:\n case CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE:\n case CoreUserNotificationTarget.ORGANIZATION_SECURITY:\n // Send to specific role rooms within the organization\n if (executionContext.initiatorIds?.organizationId && notification.userRoles) {\n for (const role of notification.userRoles) {\n await this.webSocketService.sendToRole(\n executionContext.initiatorIds.organizationId,\n role,\n message\n );\n }\n }\n break;\n\n case CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR:\n case CoreUserNotificationTarget.APPLICATION_BILLING:\n case CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.APPLICATION_SECURITY:\n case CoreUserNotificationTarget.APPLICATION_SUPPORT:\n case CoreUserNotificationTarget.APPLICATION_OTHER:\n case CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER:\n // Application-level notifications go to admin dashboard users\n // Map target to app-level role name for WebSocket room targeting\n const appRoles = this.mapApplicationTargetToRoles(target, notification);\n for (const appRole of appRoles) {\n await this.webSocketService.sendToAppRole(appRole, message);\n }\n this.logDebug('Application-level notification sent', {\n target,\n identifier: notification.identifier,\n roles: appRoles,\n });\n break;\n\n case CoreUserNotificationTarget.USERS_CUSTOM:\n // Custom user targeting via userIdsSelector\n if (notification.userIdsSelector) {\n // Ensure objectContext has the expected structure (parents/children)\n const objectContext = functionParameters.objectContext || {};\n const normalizedObjectContext = {\n parents: (objectContext as any)?.parents || {},\n children: (objectContext as any)?.children || {}\n };\n\n const userIds = notification.userIdsSelector({\n currentObject: functionParameters.currentObject,\n inputDto: functionParameters.inputDto,\n objectContext: normalizedObjectContext,\n initiatorIds: functionParameters.initiatorIds\n });\n\n // For WebSocket, we only need userIds (no need to fetch userContext)\n for (const userId of userIds) {\n await this.webSocketService.sendToUser(userId, message);\n }\n }\n break;\n\n case CoreUserNotificationTarget.INBOUND_CONTACT:\n // Inbound contact notifications (e.g., contact form submissions)\n // Route to support and admin roles by default\n const inboundContactRoles = notification.userRoles?.length\n ? notification.userRoles\n : [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n for (const role of inboundContactRoles) {\n await this.webSocketService.sendToAppRole(role, message);\n }\n this.logDebug('Inbound contact notification sent', {\n identifier: notification.identifier,\n roles: inboundContactRoles,\n });\n break;\n\n default:\n this.logDebug('Unknown notification target', {\n target,\n identifier: notification.identifier,\n });\n }\n }\n\n /**\n * Dispatch M2M notifications (webhooks)\n *\n * @param executionContext - The execution context\n * @param functionParameters - Function parameters with data context\n * @private\n */\n private async dispatchM2MNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters\n ): Promise<void> {\n const operation = executionContext.operation;\n const m2mNotifications = operation.m2mNotifications || [];\n\n if (m2mNotifications.length === 0) {\n return;\n }\n\n for (const m2mNotification of m2mNotifications) {\n const channel = m2mNotification.channel as CoreM2MNotificationChannel | string;\n\n if (\n channel === CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION\n || channel === CoreM2MNotificationChannel.WEBHOOK_APPLICATION\n ) {\n // Delegate to the dispatcher; it owns scope resolution, feature\n // gating, config loading, payload serialization, log creation\n // and queue enqueue. Failures inside `enqueueDelivery` are logged\n // here and never bubble back to the caller — webhook delivery\n // is best-effort and must not block the primary operation.\n try {\n await this.m2mWebhookDispatcher.enqueueDelivery(\n operation as ResourceConfiguration_Operation<any, any, any>,\n m2mNotification as M2MNotificationDefinition,\n executionContext as ExecutionContext<ResourceConfiguration_Operation<any, any, any>>,\n functionParameters,\n );\n } catch (error) {\n this.logger.error('Failed to dispatch M2M webhook delivery', {\n channel,\n resourceIdentifier: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n ...projectCaughtErrorLogFields(error),\n });\n }\n continue;\n }\n\n throw new Error(`M2M notification channel '${channel}' is not implemented.`);\n }\n }\n\n /**\n * Dispatch resource-room notifications (path-independent collaboration).\n *\n * This stays separately callable because some post-write orchestration paths\n * only have authoritative object truth and initiator ids, not the full\n * computation context required for authored notification delivery.\n */\n async dispatchResourceRoomNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters\n ): Promise<void> {\n const operation = executionContext.operation;\n const resourceType = operation.resourceIdentifier;\n const currentObject = functionParameters.currentObject;\n\n // Only dispatch for write operations\n const operationIdentifier = operation.operationIdentifier;\n if (!this.isWriteOperation(operationIdentifier, operation.resourceOperationLike)) {\n return;\n }\n\n const affectedIds = this.extractAffectedIds(currentObject);\n if (affectedIds.length === 0) {\n return;\n }\n\n const action = this.mapOperationToAction(\n operationIdentifier,\n operation.resourceOperationLike,\n );\n const contextResourceIdentifiers = this.convertContextResourceIdsToRecord(executionContext);\n const initiatorUserId = executionContext.initiatorIds?.userId;\n\n const timestamp = new Date();\n const operationIdentifierString = String(operationIdentifier);\n const operationPathKey = (() => {\n try {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n } catch (error) {\n this.logDebug('Unable to serialize resource-room operation path key', {\n resourceType,\n operationIdentifier: operationIdentifierString,\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n error: describeCaughtError(error),\n });\n return undefined;\n }\n })();\n const isBulkOperation = 'isBulkOperation' in operation && operation.isBulkOperation === true;\n const scopePayload = buildScopeRoomNotificationPayload({\n resourceType,\n resourceId: affectedIds[0],\n contextResourceIdentifiers,\n action,\n affectedIds,\n operationIdentifier: operationIdentifierString,\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation,\n variantKey: operation.variantKey,\n initiatorUserId,\n currentObject,\n timestamp,\n });\n\n // Emit to individual resource rooms\n for (const resourceId of affectedIds) {\n const resourcePayload = buildResourceRoomSyncPayload({\n resourceType,\n resourceId,\n contextResourceIdentifiers,\n action,\n affectedIds,\n operationIdentifier: operationIdentifierString,\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation,\n variantKey: operation.variantKey,\n initiatorUserId,\n currentObject,\n timestamp,\n });\n\n const resourceNotificationFallback = buildResourceRoomStaleHintPayload({\n resourceType,\n resourceId,\n contextResourceIdentifiers,\n action,\n affectedIds,\n operationIdentifier: operationIdentifierString,\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation,\n variantKey: operation.variantKey,\n initiatorUserId,\n timestamp,\n });\n\n // Resource rooms get the strongest contract first: try authoritative sync\n // replay for that exact id, and degrade to a notification-grade stale hint\n // only when the backend cannot prove replay truth or the websocket layer\n // rejects the replay payload during canonical validation.\n if (!resourcePayload) {\n this.logDebug('Skipped resource-room sync payload due to missing authoritative replay data', {\n resourceType,\n resourceId,\n action,\n affectedCount: affectedIds.length,\n });\n this.webSocketService.emitToResourceRoom(\n resourceType,\n resourceId,\n CoreWebSocketEvent.RESOURCE_UPDATED,\n resourceNotificationFallback,\n );\n continue;\n }\n\n const event = action === ResourceAction.DELETED\n ? CoreWebSocketEvent.RESOURCE_DELETED\n : CoreWebSocketEvent.RESOURCE_UPDATED;\n\n const emitted = this.webSocketService.emitToResourceRoom(resourceType, resourceId, event, resourcePayload);\n if (!emitted) {\n this.logDebug('Skipped resource-room sync emit after canonical replay validation failure', {\n resourceType,\n resourceId,\n action,\n affectedCount: affectedIds.length,\n });\n this.webSocketService.emitToResourceRoom(\n resourceType,\n resourceId,\n CoreWebSocketEvent.RESOURCE_UPDATED,\n resourceNotificationFallback,\n );\n }\n }\n\n // Scope rooms are emitted separately from per-resource rooms because they\n // serve list/cache refresh semantics rather than authoritative per-resource\n // replay semantics.\n const scopes = this.extractScopesFromContext(contextResourceIdentifiers, operation.resourcePrimaryScope);\n if (scopes.length > 0) {\n this.webSocketService.emitToScopeRooms(\n resourceType,\n scopes,\n CoreWebSocketEvent.RESOURCE_UPDATED,\n scopePayload,\n );\n }\n\n this.logDebug('Resource room notifications dispatched', {\n resourceType,\n action,\n affectedCount: affectedIds.length,\n scopeCount: scopes.length,\n });\n }\n\n // ================================\n // Helper Methods\n // ================================\n\n /**\n * Map APPLICATION_* notification targets to app-level role names for WebSocket targeting.\n *\n * These roles correspond to the `app:role:${role}` rooms that users join when they have\n * application-level permissions (e.g., super admins, support staff).\n *\n * @param target - The CoreUserNotificationTarget\n * @param notification - The notification definition (may contain userRoles override)\n * @returns Array of role names to target\n */\n private mapApplicationTargetToRoles(\n target: CoreUserNotificationTarget,\n notification: UserNotificationDefinition\n ): string[] {\n // If userRoles is explicitly provided, use those\n if (notification.userRoles && notification.userRoles.length > 0) {\n return notification.userRoles;\n }\n\n // Map target to default app-level roles using CORE_APP_ROLES enum\n // These should match the roles that users with app-level permissions have\n switch (target) {\n case CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_BILLING:\n return [CORE_APP_ROLES.APP_ADMIN_BILLING_MANAGER, CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_SECURITY:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_SUPPORT:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER:\n return [CORE_APP_ROLES.APP_ADMIN_VIEWER, CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_OTHER:\n default:\n // Default to admin roles for generic application notifications\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n }\n }\n\n private mapOrganizationTargetToRoles(\n target: CoreUserNotificationTarget,\n notification: UserNotificationDefinition,\n ): string[] {\n /*\n * The override is consulted ONLY for a target that reads it (#495).\n *\n * This short-circuit used to run FIRST, before the switch — so `userRoles` on `ORGANIZATION` or\n * `ORGANIZATION_USERS` narrowed the recipients resolved here, while the websocket branch for those\n * same two targets calls `sendToOrganization` and never reads it. One declaration, two behaviours,\n * decided by which channel the notification happened to use, with no diagnostic either way.\n *\n * Those two targets mean EVERYONE in the tenant by definition, so the empty list below is the\n * answer on both channels and the override has no business changing it. `userNotificationTargetReadsUserRoles`\n * is the same predicate the schema refuses on, so a declaration that reaches here can only be one\n * the vocabulary admits.\n */\n switch (target) {\n case CoreUserNotificationTarget.ORGANIZATION_BILLING:\n case CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE:\n case CoreUserNotificationTarget.ORGANIZATION_SECURITY:\n return notification.userRoles && notification.userRoles.length > 0\n ? notification.userRoles\n : [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN];\n case CoreUserNotificationTarget.ORGANIZATION:\n case CoreUserNotificationTarget.ORGANIZATION_USERS:\n default:\n return [];\n }\n }\n\n /**\n * Map operation identifier to action type\n */\n private mapOperationToAction(\n operationIdentifier: any,\n resourceOperationLike?: CoreResourceOperation,\n ): ResourceAction {\n const effectiveOperation = this.resolveEffectiveCoreOperation(operationIdentifier, resourceOperationLike);\n\n switch (effectiveOperation) {\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.CREATE_MANY:\n return ResourceAction.CREATED;\n case CoreResourceOperation.DELETE:\n case CoreResourceOperation.DELETE_MANY:\n return ResourceAction.DELETED;\n case CoreResourceOperation.UPDATE:\n case CoreResourceOperation.UPDATE_MANY:\n default:\n return ResourceAction.UPDATED;\n }\n }\n\n /**\n * Check if operation is a write operation (CREATE, UPDATE, DELETE)\n */\n private isWriteOperation(\n operationIdentifier: any,\n resourceOperationLike?: CoreResourceOperation,\n ): boolean {\n const effectiveOperation = this.resolveEffectiveCoreOperation(operationIdentifier, resourceOperationLike);\n return (\n effectiveOperation === CoreResourceOperation.CREATE ||\n effectiveOperation === CoreResourceOperation.CREATE_MANY ||\n effectiveOperation === CoreResourceOperation.UPDATE ||\n effectiveOperation === CoreResourceOperation.UPDATE_MANY ||\n effectiveOperation === CoreResourceOperation.DELETE ||\n effectiveOperation === CoreResourceOperation.DELETE_MANY\n );\n }\n\n private resolveEffectiveCoreOperation(\n operationIdentifier: any,\n resourceOperationLike?: CoreResourceOperation,\n ): CoreResourceOperation | undefined {\n if (resourceOperationLike) {\n return resourceOperationLike;\n }\n\n const candidate = String(operationIdentifier) as CoreResourceOperation;\n return Object.values(CoreResourceOperation).includes(candidate)\n ? candidate\n : undefined;\n }\n\n /**\n * Extract affected IDs from the current object (result)\n */\n private extractAffectedIds(currentObject: any): string[] {\n if (!currentObject) {\n return [];\n }\n\n // Handle a BARE ID STRING (single DELETE). A single `delete` returns the deleted `_id` as a plain\n // string (services-registry-handler `delete(): Promise<string | string[]>`), so `currentObject` is\n // that string — NOT `{ _id }`. Without this branch the id fell through to `return []` and the whole\n // resource-room broadcast early-returned, so a single delete emitted NEITHER `resource:deleted`\n // (resource room) NOR `resource:updated` action=deleted (scope room). DELETE_MANY already worked via\n // the array branch below (bare-string items). The not-found case returns `''`, excluded by the\n // `!currentObject`/length guard. Placed FIRST because a string has no `_id`/`id` for the object branch.\n if (typeof currentObject === 'string') {\n return currentObject.length > 0 ? [currentObject] : [];\n }\n\n // Handle array of objects (bulk operations)\n if (Array.isArray(currentObject)) {\n return currentObject\n .flatMap((item) => {\n if (typeof item === 'string' && item.length > 0) {\n return [item];\n }\n\n if (item && (item._id || item.id)) {\n return [String(item._id || item.id)];\n }\n\n return [];\n });\n }\n\n // Handle single object\n if (currentObject._id || currentObject.id) {\n return [String(currentObject._id || currentObject.id)];\n }\n\n // Handle delete responses\n if (currentObject.deletedIds) {\n return currentObject.deletedIds.map((id: any) => String(id));\n }\n if (currentObject.deletedId) {\n return [String(currentObject.deletedId)];\n }\n\n // Handle update responses\n if (currentObject.updatedIds) {\n return currentObject.updatedIds.map((id: any) => String(id));\n }\n\n return [];\n }\n\n /**\n * Convert ExecutionContext context resource IDs Map to Record<string, string>\n * Handles string, string[], and undefined values appropriately\n */\n private convertContextResourceIdsToRecord<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>\n ): Record<string, string> {\n const contextResourceIds = executionContext.getContextResourceIds();\n const result: Record<string, string> = {};\n\n for (const [key, value] of contextResourceIds.entries()) {\n if (value === undefined) {\n continue;\n }\n\n // Handle string or string[] - for arrays, take first element (same as getContextResourceId)\n const stringValue = Array.isArray(value) ? value[0] : value;\n if (stringValue !== undefined) {\n result[key] = stringValue;\n }\n }\n\n return result;\n }\n\n /**\n * Extract scopes from context resource identifiers for scope room notifications\n */\n /**\n * Which scope rooms this mutation's rows belong to.\n *\n * Delegates to `deriveResourceScopeRoomQualifiers` in `@wildo-ai/saas-models`, which is where the\n * rule now lives so that a CLIENT caching a read can subscribe to exactly the rooms this emits\n * into. Two copies of this rule would agree only until one side gained a case, and the failure\n * would be silent — a client subscribed to the wrong room does not error, it simply never hears\n * that its cache is stale.\n */\n private extractScopesFromContext(\n contextResourceIdentifiers: Record<string, string>,\n primaryScope: ResourcePrimaryScope\n ): Array<{ scopeKey: string; scopeId: string }> {\n return deriveResourceScopeRoomQualifiers(contextResourceIdentifiers, primaryScope) as Array<{\n scopeKey: string;\n scopeId: string;\n }>;\n }\n}\n"]}
1
+ {"version":3,"file":"notifications-dispatcher.backend.service.js","sourceRoot":"","sources":["../../../../src/notifications/services/notifications-dispatcher.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE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CAAC;YAC5D,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;YAC5B,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH;;;;;;;;OAQG;IACK,wBAAwB,CAC9B,0BAAkD,EAClD,YAAkC;QAElC,OAAO,iCAAiC,CAAC,0BAA0B,EAAE,YAAY,CAG/E,CAAC;IACL,CAAC;;AAp3EU,6BAA6B;IADzC,UAAU,EAAE;IAQR,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;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAA;IACnD,WAAA,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;IACvC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAC7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,CAAA;IAKtD,YAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;IAAE,YAAA,QAAQ,EAAE,CAAA;qCAd1B,aAAa;QACM,0BAA0B;QACzB,gBAAgB;QACZ,+BAA+B,sBAGnC,uBAAuB;QACD,yCAAyC;QACvD,+BAA+B;QAEhF,kCAAkC;GAjBvD,6BAA6B,CAq3EzC","sourcesContent":["import { inject, injectable, optional } from 'inversify';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { createHash, randomUUID } from 'node:crypto';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport {\n ResourceConfiguration_Operation,\n ResourcePrimaryScope,\n deriveResourceScopeRoomQualifiers,\n CoreM2MNotificationChannel,\n CoreUserNotificationChannel,\n CoreUserNotificationTarget,\n UserNotificationDefinition,\n UserNotificationDefinition_EmailSchema,\n userNotificationTargetIsSuppressibleByRecipientPreference,\n type OrganizationEmailNotifications,\n type UserPreferences_Notifications,\n UserNotificationDefinition_FrontEndSuccessSchema,\n M2MNotificationDefinition,\n NotificationBadgeSourceKind,\n buildNotificationBadgeDefinitionIndex,\n type NotificationScope,\n CoreResourceOperation,\n CoreWebSocketEvent,\n WS_ResourceNotificationPayload,\n WS_ResourceUpdatedPayload,\n WS_ResourceDeletedPayload,\n WS_ResourceSyncUpdatedPayload,\n WS_ResourceUpdateNotificationPayload,\n ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n EmailTemplateType,\n ResourceAction,\n NotificationLevel,\n CORE_APP_ROLES,\n CORE_ORG_ROLES,\n CoreResourceType,\n OrganizationMemberStatus,\n UserStatus,\n ResourcesConfigOperationsUrlsBuilderUtils,\n ResourcesConfig_OperationPathUtils,\n ResourceOperationVariantType,\n WebSocketResourceDeliveryTarget,\n ErrorType,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport { BrandAssetComposition, BrandAssetPurpose } from '@wildo-ai/saas-models';\nimport type { FieldMetaEntry, OrganizationMember, UserPreferences, UserProfile } from '@wildo-ai/saas-models';\nimport type { z } from 'zod';\nimport { AvailableLanguage } from '@wildo-ai/presets-components-models';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { describeCaughtError, projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { WebSocketService, WebSocketMessage } from '~wildo-backend-lib/requests/service/websocket.service';\nimport { NotificationBadgeBackendService } from './notification-badge.backend.service';\nimport {\n type EmailBackendService,\n type EmailSendResult,\n} from '~wildo-backend-lib/notifications/email/services/email.backend.service';\n// Internal callers go through the path alias (`@wildo-ai/saas-backend-lib/custom-batch-manifests`\n// is the public spec-layer subpath; self-imports through the public package name are not\n// wired in this workspace's tsconfig path map).\nimport { EMAIL_BATCH_SEND_BATCH_REF } from '~wildo-backend-lib/base-classes/services/batches/engine-custom-batch-manifests';\nimport type { QueueBackendService } from '~wildo-backend-lib/queue/queue.backend.service';\nimport { AppConfigurationService } from '~wildo-backend-lib/config/services/app-configuration.backend.service';\nimport { getConfiguredPrimaryLanguage } from '~wildo-backend-lib/config/services/app-configuration.backend.utils';\nimport { AuthControllerUtils } from '~wildo-backend-lib/security/authentications/services/utils/auth-controller.utils';\nimport { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport { M2MWebhookDispatcherBackendService } from '~wildo-backend-lib/notifications/webhooks/outbound/services/m2m-webhook-dispatcher.backend.service';\n\n/**\n * Notification Dispatcher Service\n *\n * Handles dispatching of all notification types based on resource operation configurations:\n * - Notification badge operations (incrementing/decrementing/resetting badge counts)\n * - User notifications (email, SMS, push, WebSocket, frontend success)\n * - M2M (Machine-to-Machine) notifications (webhooks)\n * - Resource room notifications (path-independent collaboration)\n */\n/** Batch threshold for email sending - above this, use queue */\nconst EMAIL_BATCH_THRESHOLD = 10;\n\n/**\n * Canonical template identity for operation-authored email notifications.\n *\n * Startup validation and runtime dispatch must use the same derivation;\n * otherwise an application can boot against one template reference and fail\n * only after a mutation commits because delivery derived another.\n */\nexport function buildUserNotificationEmailTemplateRef(\n operation: {\n resourceIdentifier: string;\n operationIdentifier: string;\n variantKey?: string;\n },\n notification: {\n identifier: string;\n target?: string;\n customNotificationRef?: string;\n },\n): string {\n const targetKebab =\n (notification.target || notification.identifier)\n .toLowerCase()\n .replace(/_/g, '-');\n const refParts = [\n 'email',\n operation.resourceIdentifier,\n operation.operationIdentifier,\n ];\n if (operation.variantKey) {\n refParts.push(operation.variantKey);\n }\n refParts.push(targetKebab);\n const baseRef = refParts.join('.');\n return notification.customNotificationRef\n ? `${baseRef}_${notification.customNotificationRef}`\n : baseRef;\n}\n\n/**\n * Optional identity source for post-commit email submissions.\n *\n * Token-backed operation dispatch passes the committed token ID. The\n * dispatcher derives one deterministic provider identity per concrete\n * notification and recipient, so a fan-out cannot accidentally deduplicate\n * distinct emails while a repeated logical send remains provider-idempotent\n * where the selected adapter supports it.\n */\nexport interface NotificationDispatchOptions {\n emailSubmissionSourceId?: string;\n}\n\n/**\n * Derive a fixed-size provider submission identity without exposing recipient\n * data in transport headers. A new token ID produces a new identity, so an\n * explicit RESEND is intentionally a new logical email.\n */\nexport function deriveEmailNotificationSubmissionId(\n sourceId: string,\n notificationIdentifier: string,\n templateRef: string,\n recipientIdentity: { email?: string; userId?: string },\n): string {\n return createHash('sha256')\n .update(JSON.stringify({\n sourceId,\n notificationIdentifier,\n templateRef,\n recipientIdentity,\n }))\n .digest('hex');\n}\n\ntype CachedRoutePaths = { url: string; parameters: { fieldIdentifier: string; resourceType: string }[] }[];\n\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * Normalise a mutated-object slot (`currentObject` / `previousObject`) to the list of plain rows a\n * derived-badge recompute must read its `scopeField` from.\n *\n * A single write yields one object; a bulk write yields an array; `undefined` (CREATE has no\n * pre-image; a slot may be absent) yields nothing. Non-record array entries and bulk-result blobs\n * (`{ updatedIds: [...] }`) are dropped — they carry no per-row field truth.\n */\nfunction toDerivedBadgeRowArray(value: unknown): Record<string, unknown>[] {\n if (Array.isArray(value)) {\n return value.filter(isPlainRecord);\n }\n return isPlainRecord(value) ? [value] : [];\n}\n\nfunction normalizeResourceId(value: unknown): string | undefined {\n if (typeof value === 'string' && value.length > 0) {\n return value;\n }\n\n if (\n typeof value === 'object'\n && value !== null\n && typeof (value as { toString?: () => string }).toString === 'function'\n ) {\n const normalized = value.toString();\n if (normalized.length > 0 && normalized !== '[object Object]') {\n return normalized;\n }\n }\n\n return undefined;\n}\n\nfunction resolveResourceObjectForSync(\n currentObject: unknown,\n resourceId: string,\n affectedIds: string[],\n): Record<string, unknown> | undefined {\n if (Array.isArray(currentObject)) {\n return currentObject.find((candidate): candidate is Record<string, unknown> => (\n // `_id` ONLY — `id` is Mongoose's built-in virtual (surrogate-PK resources only) and does not\n // exist on PostgreSQL. The arm was dead, since `_id` is always present and evaluated first.\n isPlainRecord(candidate) && normalizeResourceId(candidate._id) === resourceId\n ));\n }\n\n if (!isPlainRecord(currentObject)) {\n return undefined;\n }\n\n if (typeof currentObject._id === 'string' && currentObject._id !== resourceId) {\n return undefined;\n }\n\n // A shared bulk result blob (e.g. { updatedIds: [...] }) is not authoritative\n // per-resource replay truth for sync-grade room payloads.\n if (affectedIds.length > 1 && typeof currentObject._id !== 'string') {\n return undefined;\n }\n\n return currentObject;\n}\n\nfunction splitResourceObjectForWebSocket(resourceObject: Record<string, unknown>): {\n cleanedResourceData: Record<string, unknown>;\n fieldMeta?: Record<string, FieldMetaEntry>;\n version?: number;\n} {\n const { _field_meta, ...rest } = resourceObject;\n return {\n cleanedResourceData: rest,\n fieldMeta: _field_meta as Record<string, FieldMetaEntry> | undefined,\n version: resourceObject._version as number | undefined,\n };\n}\n\nexport function shouldOmitResourceUrlForOperation(\n effectiveOperation: CoreResourceOperation | undefined,\n): boolean {\n return effectiveOperation === CoreResourceOperation.DELETE\n || effectiveOperation === CoreResourceOperation.DELETE_MANY;\n}\n\nexport function buildResourceRoomSyncPayload(params: {\n resourceType: string;\n resourceId: string;\n contextResourceIdentifiers: Record<string, string>;\n action: ResourceAction;\n affectedIds: string[];\n operationIdentifier: string;\n operationPathKey?: string;\n variantType?: ResourceOperationVariantType;\n isOperationDefault?: boolean;\n isBulkOperation?: boolean;\n variantKey?: string;\n initiatorUserId?: string;\n currentObject: unknown;\n timestamp?: Date;\n}): WS_ResourceSyncUpdatedPayload | WS_ResourceDeletedPayload | null {\n const timestamp = params.timestamp ?? new Date();\n\n if (params.action === ResourceAction.DELETED) {\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: ResourceAction.DELETED,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n };\n }\n\n const resourceObject = resolveResourceObjectForSync(\n params.currentObject,\n params.resourceId,\n params.affectedIds,\n );\n if (!resourceObject) {\n return null;\n }\n\n const {\n cleanedResourceData,\n fieldMeta,\n version,\n } = splitResourceObjectForWebSocket(resourceObject);\n\n if (version == null) {\n return null;\n }\n\n // Sync-grade resource-room events are the only websocket payloads allowed to\n // carry authoritative replay data for a specific resource. If we cannot prove\n // both the per-resource object body and its authoritative version, callers\n // must fall back to a notification-grade stale hint instead.\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.RESOURCE_ROOM_SYNC,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: params.action,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n version,\n resourceData: cleanedResourceData,\n fieldMeta,\n };\n}\n\nexport function buildScopeRoomNotificationPayload(params: {\n resourceType: string;\n resourceId: string;\n contextResourceIdentifiers: Record<string, string>;\n action: ResourceAction;\n affectedIds: string[];\n operationIdentifier: string;\n operationPathKey?: string;\n variantType?: ResourceOperationVariantType;\n isOperationDefault?: boolean;\n isBulkOperation?: boolean;\n variantKey?: string;\n initiatorUserId?: string;\n currentObject: unknown;\n timestamp?: Date;\n}): WS_ResourceUpdateNotificationPayload {\n const timestamp = params.timestamp ?? new Date();\n // Scope rooms are collection/list invalidation surfaces. For multi-id writes\n // they must not overstate single-resource replay truth, so replay-like fields\n // are only included when the payload still represents one authoritative row.\n const shouldIncludeReplayLikeFields = params.affectedIds.length <= 1;\n const resourceObject = resolveResourceObjectForSync(\n params.currentObject,\n params.resourceId,\n params.affectedIds,\n );\n const splitResourceObject = shouldIncludeReplayLikeFields && resourceObject\n ? splitResourceObjectForWebSocket(resourceObject)\n : null;\n\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.SCOPE_ROOM_NOTIFICATION,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: params.action,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n version: splitResourceObject?.version,\n resourceData: splitResourceObject?.cleanedResourceData,\n fieldMeta: splitResourceObject?.fieldMeta,\n };\n}\n\nexport function buildResourceRoomStaleHintPayload(params: {\n resourceType: string;\n resourceId: string;\n contextResourceIdentifiers: Record<string, string>;\n action: ResourceAction;\n affectedIds: string[];\n operationIdentifier: string;\n operationPathKey?: string;\n variantType?: ResourceOperationVariantType;\n isOperationDefault?: boolean;\n isBulkOperation?: boolean;\n variantKey?: string;\n initiatorUserId?: string;\n timestamp?: Date;\n}): WS_ResourceUpdateNotificationPayload {\n const timestamp = params.timestamp ?? new Date();\n return {\n deliveryTarget: WebSocketResourceDeliveryTarget.RESOURCE_ROOM_NOTIFICATION,\n resourceType: params.resourceType,\n resourceId: params.resourceId,\n contextResourceIdentifiers: params.contextResourceIdentifiers,\n action: params.action,\n affectedIds: params.affectedIds,\n operationIdentifier: params.operationIdentifier,\n operationPathKey: params.operationPathKey,\n variantType: params.variantType,\n isOperationDefault: params.isOperationDefault,\n isBulkOperation: params.isBulkOperation,\n variantKey: params.variantKey,\n initiatorUserId: params.initiatorUserId,\n timestamp,\n };\n}\n\n@injectable()\nexport class NotificationDispatcherService {\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n private readRoutePathsCache = new Map<string, CachedRoutePaths | null>();\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.WebSocketService) private webSocketService: WebSocketService,\n @inject(SAAS_SERVICE_TYPES.NotificationBadgeService) private badgeService: NotificationBadgeBackendService,\n @inject(SAAS_SERVICE_TYPES.EmailService) private emailService: EmailBackendService,\n @inject(SAAS_SERVICE_TYPES.QueueBackendService) private queueService: QueueBackendService,\n @inject(SAAS_SERVICE_TYPES.AppConfigService) private appConfigService: AppConfigurationService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.M2MWebhookDispatcherService)\n private m2mWebhookDispatcher: M2MWebhookDispatcherBackendService,\n // Appended LAST so positional construction in tests keeps working, and `@optional()` so a\n // minimal container still builds: the only consumer degrades to the caller's context, which is\n // the pre-existing behaviour.\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) @optional()\n private readonly executionContextCreator?: ExecutionContextCreatorBackendService,\n ) {\n this.logDebug = this.logger.debugByType('NotificationDispatcherService');\n this.logger.setDebugTypeLogging('NotificationDispatcherService', false);\n }\n\n /**\n * Dispatch notifications based on operation configuration\n *\n * @param executionContext - The execution context containing operation details and user information\n * @param functionParameters - Parameters containing input data, current object, and context\n */\n async dispatchNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n options?: NotificationDispatchOptions,\n ): Promise<void> {\n const operation = executionContext.operation;\n\n try {\n const results = await Promise.allSettled([\n this.dispatchConfiguredNotifications(\n executionContext,\n functionParameters,\n options,\n ),\n this.dispatchResourceRoomNotifications(executionContext, functionParameters),\n ]);\n\n for (const result of results) {\n if (result.status === 'rejected') {\n this.logger.error('Error dispatching notifications', {\n ...projectCaughtErrorLogFields(result.reason),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n } catch (error) {\n this.logger.error('Failed to dispatch notifications', {\n ...projectCaughtErrorLogFields(error),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n\n async dispatchConfiguredNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n options?: NotificationDispatchOptions,\n ): Promise<void> {\n const operation = executionContext.operation;\n\n try {\n // Dispatch authored notification types in parallel. Resource-room\n // synchronization can be invoked independently from this path when the\n // caller only has post-write object truth and not a full computation context.\n const results = await Promise.allSettled([\n // 1. Notification badge operations (EVENT_COUNTER: authored per-op increments)\n this.dispatchNotificationBadgeOperations(executionContext, functionParameters),\n\n // 2. User notifications (email, SMS, push, WebSocket, frontend success)\n this.dispatchUserNotifications(\n executionContext,\n functionParameters,\n options?.emailSubmissionSourceId,\n ),\n\n // 3. M2M notifications (webhooks)\n this.dispatchM2MNotifications(executionContext, functionParameters),\n\n // 4. DERIVED_QUERY badge recomputes: any badge whose source resource was\n // just mutated is re-counted from the source collection (never drifts).\n this.dispatchDerivedBadgeRecomputes(executionContext, functionParameters),\n ]);\n\n for (const result of results) {\n if (result.status === 'rejected') {\n this.logger.error('Error dispatching notifications', {\n ...projectCaughtErrorLogFields(result.reason),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n\n this.logDebug('All notifications dispatched successfully', {\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n userNotificationCount: (operation.userNotifications || []).length,\n badgeOperationsCount: (operation.notificationBadgeOperations || []).length,\n m2mNotificationsCount: (operation.m2mNotifications || []).length,\n });\n\n } catch (error) {\n // Log but don't throw - notifications should not break the main operation\n this.logger.error('Error dispatching notifications', {\n ...projectCaughtErrorLogFields(error),\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n }\n }\n\n /**\n * Dispatch notification badge operations\n *\n * @param executionContext - The execution context\n * @param functionParameters - Function parameters with data context\n * @private\n */\n private async dispatchNotificationBadgeOperations<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters\n ): Promise<void> {\n const operation = executionContext.operation;\n const badgeOperations = operation.notificationBadgeOperations || [];\n\n if (badgeOperations.length === 0) {\n return;\n }\n\n const definitionsByKey = buildNotificationBadgeDefinitionIndex(\n this.resourcesRegistry.getResourcesRegistry().notificationBadgeDefinitions ?? [],\n );\n\n for (const badgeOp of badgeOperations) {\n /**\n * The DEFINITION decides the badge, including its SCOPE.\n *\n * This used to take the scope from `determineBadgeScope(executionContext)` — the operation's\n * own `resourcePrimaryScope`, with an initiator-shaped fallback — and pass the authored\n * identifier straight through with no lookup at all. Two things followed. An operation on a\n * user-scoped resource wrote a USER counter even when the definition it named lived at\n * organization scope, so the row it created belonged to no definition. And an identifier that\n * matched no definition wrote a counter nothing could ever render, reported nowhere.\n *\n * Resolving the ref first fixes both at once: the scope is read off the definition, and an\n * unresolvable ref cannot reach the write. Only the scopeId — WHOSE badge — remains a runtime\n * question, and it is answered from the initiator at the definition's own scope.\n */\n const definition = definitionsByKey.get(badgeOp.badgeRef);\n if (!definition) {\n /**\n * Unreachable on an application that started: `validateNotificationBadgeDeclarations`\n * refuses this at configuration time. Kept as defence in depth for a host that assembles a\n * registry by another route, and loud because a silent skip here is the original defect.\n */\n this.logger.warn('Badge operation names no registered badge definition — skipping', {\n badgeRef: badgeOp.badgeRef,\n operation: badgeOp.operation,\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n continue;\n }\n\n const scopeId = this.resolveBadgeScopeId(executionContext, definition.scope);\n if (!scopeId) {\n this.logDebug('No scope id for the badge definition\\'s scope, skipping badge operation', {\n badgeRef: badgeOp.badgeRef,\n scope: definition.scope,\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n });\n continue;\n }\n\n try {\n await this.badgeService.executeBadgeOperation(\n executionContext,\n definition.scope,\n scopeId,\n definition.identifier,\n badgeOp.operation,\n 1 // Default value (can be extended to support custom values)\n );\n\n this.logDebug('Badge operation executed', {\n badgeRef: badgeOp.badgeRef,\n operation: badgeOp.operation,\n scope: definition.scope,\n scopeId,\n });\n } catch (error) {\n this.logger.warn('Failed to execute badge operation', {\n badgeRef: badgeOp.badgeRef,\n operation: badgeOp.operation,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n }\n\n /**\n * Recompute every DERIVED_QUERY badge whose source resource is the one just\n * mutated (R5). Reads the registered `notificationBadgeDefinitions`, filters to\n * derived badges pointing at `operation.resourceIdentifier`, resolves the badge's\n * scopeId from the initiator, and asks the badge service to re-count + emit.\n *\n * Runs on the same write-time dispatch as event badges. Read operations don't\n * reach here (notifications dispatch is post-write), and the recompute is\n * idempotent regardless. Per-badge failures are logged and never abort siblings.\n */\n private async dispatchDerivedBadgeRecomputes<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n ): Promise<void> {\n const operation = executionContext.operation;\n const definitions = this.resourcesRegistry.getResourcesRegistry().notificationBadgeDefinitions ?? [];\n\n const derivedForThisResource = definitions.filter(\n (definition) =>\n definition.source.kind === NotificationBadgeSourceKind.DERIVED_QUERY &&\n definition.source.resourceType === operation.resourceIdentifier,\n );\n if (derivedForThisResource.length === 0) {\n return;\n }\n\n // The scopeId of a derived badge is the VALUE of its `scopeField` on the MUTATED ROW — never\n // the actor. A derived \"incomplete todos assigned to me\" badge is scoped by the todo's\n // `assignedToUserId`; when an admin assigns/reassigns/completes a todo on a member's behalf,\n // it is the MEMBER's badge that changed, and the admin never had a stake in it. Resolving the\n // scope from `executionContext.initiatorIds` (the previous behaviour) silently skipped EVERY\n // cross-user mutation — the affected user's count stayed stale until a reconnect reseeded it.\n //\n // Both the post-write row (`currentObject`) and, when the framework captured one, the pre-image\n // (`previousObject`) are consulted: a reassignment moves TWO scopes — the row leaves the prior\n // holder's set (pre-image) and joins the new holder's (post-image). A completion or a same-scope\n // edit moves ONE, which the post-image alone covers. `recomputeDerivedBadge` SETs the\n // authoritative count for each scope from the source collection, so recomputing a scope that did\n // not actually change is harmless (it re-derives the same number) — the correctness requirement\n // is only that no affected scope is MISSED.\n const affectedRows = [\n ...toDerivedBadgeRowArray(functionParameters.currentObject),\n ...toDerivedBadgeRowArray(functionParameters.previousObject),\n ];\n\n for (const definition of derivedForThisResource) {\n const source = definition.source;\n if (source.kind !== NotificationBadgeSourceKind.DERIVED_QUERY) {\n continue; // narrowed by the filter above; re-checked for the type guard on `scopeField`.\n }\n\n const scopeIds = new Set<string>();\n for (const row of affectedRows) {\n const value = row[source.scopeField];\n if (typeof value === 'string' && value.length > 0) {\n scopeIds.add(value);\n }\n }\n\n if (scopeIds.size === 0) {\n // No affected scope carries the badge's scopeField (e.g. a todo with no assignee) — nothing\n // to recompute. This is normal, not an error: no user's count could have changed.\n this.logDebug('No affected scopeId for derived badge, skipping', {\n identifier: definition.identifier,\n scopeField: source.scopeField,\n });\n continue;\n }\n\n for (const scopeId of scopeIds) {\n try {\n await this.badgeService.recomputeDerivedBadge(executionContext, definition, scopeId);\n } catch (error) {\n this.logger.warn('Failed to recompute derived badge', {\n identifier: definition.identifier,\n resourceType: operation.resourceIdentifier,\n scopeId,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n }\n }\n\n /**\n * Resolve WHOSE badge this is — the scopeId — for a scope the DEFINITION already fixed.\n *\n * ## Why this no longer decides the scope\n *\n * Its predecessor (`determineBadgeScope`) answered both halves from the execution context: it\n * read `operation.resourcePrimaryScope`, mapped `USER_SELF` → `initiatorIds.userId` and\n * `ORGANIZATIONS` → `initiatorIds.organizationId`, and for anything else — `APPLICATION`,\n * `ANONYMOUS`, or an unscoped operation — guessed, preferring the organization when the request\n * happened to carry one and falling back to the user. That guess decided which COLLECTION a\n * counter was written to, from a property of the operation that has nothing to say about which\n * badge the author meant. An operation on a user-scoped resource could only ever move a\n * user-scoped counter, whatever badge its `badgeRef` named.\n *\n * The definition names the scope, so only the id is left, and the id is genuinely a runtime fact:\n * which user, which organization. `null` means the request carries no identity at that scope\n * (an anonymous or purely application-scoped call reaching an org-scoped badge), which is a skip\n * rather than an error — no principal's count could have changed.\n */\n private resolveBadgeScopeId<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n ): string | null {\n const initiatorIds = executionContext.initiatorIds;\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n return initiatorIds?.userId || null;\n case ResourcePrimaryScope.ORGANIZATIONS:\n return initiatorIds?.organizationId || null;\n default:\n return null;\n }\n }\n\n /**\n * Dispatch user notifications\n *\n * @param executionContext - The execution context\n * @param functionParameters - Function parameters with data context\n * @private\n */\n private async dispatchUserNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const operation = executionContext.operation;\n const userNotifications = operation.userNotifications || [];\n\n if (userNotifications.length === 0) {\n return [];\n }\n\n const emailResults: EmailSendResult[] = [];\n for (const notification of userNotifications) {\n try {\n // Config-declared side-effect gate: skip a notification whose `condition` evaluates falsy\n // against the post-operation context. Evaluated before channel resolution and the\n // email-by-address path, so it gates every channel uniformly. Canonical use: the org-member\n // invite email fires only for INVITED rows, never for an ACTIVE direct-add (founder /\n // SSO-JIT / SCIM), whose denormalized `userEmail` is the member's OWN address. Absent =\n // always dispatch.\n //\n // It sits INSIDE the try deliberately. The predicate is application-authored code running\n // in the dispatcher's loop, so one that throws is a single notification's failure and not\n // the operation's. Evaluated outside, one bad predicate ended the loop and silently dropped\n // every notification declared after it, which is exactly what the catch below exists to\n // prevent.\n if (notification.condition && !notification.condition(functionParameters)) {\n this.logDebug('Skipping user notification: condition not met', {\n identifier: notification.identifier,\n channel: notification.channel,\n target: notification.target,\n });\n continue;\n }\n\n const notificationEmailResults = await this.dispatchSingleUserNotification(\n executionContext,\n functionParameters,\n notification,\n emailSubmissionSourceId,\n );\n emailResults.push(...notificationEmailResults);\n } catch (error) {\n this.logger.warn('Failed to dispatch user notification', {\n identifier: notification.identifier,\n channel: notification.channel,\n target: notification.target,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n return emailResults;\n }\n\n /**\n * Dispatch a single user notification based on its channel\n */\n private async dispatchSingleUserNotification<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const channel = notification.channel;\n\n switch (channel) {\n case CoreUserNotificationChannel.WEBSOCKET:\n await this.dispatchWebSocketUserNotification(executionContext, functionParameters, notification);\n return [];\n\n case CoreUserNotificationChannel.EMAIL:\n case CoreUserNotificationChannel.SMS:\n case CoreUserNotificationChannel.PUSH:\n // Email/SMS/Push notifications require recipient userContext fetching\n return this.dispatchEmailSmsPushUserNotification(\n executionContext,\n functionParameters,\n notification,\n emailSubmissionSourceId,\n );\n\n case CoreUserNotificationChannel.FRONT_END_SUCCESS:\n // Frontend success notifications are handled client-side\n // We can optionally send them via WebSocket for SPAs\n await this.dispatchWebSocketUserNotification(executionContext, functionParameters, notification);\n return [];\n\n default:\n this.logDebug('Unknown notification channel', {\n channel,\n identifier: notification.identifier,\n });\n return [];\n }\n }\n\n /**\n * Dispatch Email/SMS/Push user notifications\n * These channels require recipient userContext fetching for template rendering\n */\n private async dispatchEmailSmsPushUserNotification<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const target = notification.target;\n const channel = notification.channel;\n\n /*\n * The recipient channel switches (#409) do NOT apply on the email-by-address path below. The\n * address comes from a field on the operation's own object and identifies no user, so there is\n * no preferences row to consult — the canonical case is an invitation sent to somebody who does\n * not have an account yet. Suppression is a property of a KNOWN recipient, and this path has\n * none by construction.\n */\n // Email-by-address: when an EMAIL notification declares `recipientEmailField`, the\n // recipient is a raw address read from the current object — a party who is NOT a\n // platform user (an organization-invitation invitee, an inbound lead). There is no\n // `userId` to resolve, so this bypasses `getUserIdsForTarget` entirely.\n const recipientEmailField = channel === CoreUserNotificationChannel.EMAIL\n ? (notification as z.infer<typeof UserNotificationDefinition_EmailSchema>).recipientEmailField\n : undefined;\n if (recipientEmailField) {\n return this.dispatchEmailToRecipientAddress(\n executionContext,\n functionParameters,\n notification,\n recipientEmailField,\n emailSubmissionSourceId,\n );\n }\n\n /*\n * Organization notification ROUTING (#410, decided 2026-09-08).\n *\n * A tenant's `organizationNotifications` record carries four category addresses and four\n * category switches. It is seeded by apps-manager at provisioning, rendered and edited through\n * the organizations preset, audited — and until now read by NOTHING: organization-targeted\n * notifications resolved to member user ids by role and went to each member's own address, so a\n * tenant that filled the settings screen in changed nothing at all.\n *\n * The category is DERIVED from the notification's target, not declared. The target vocabulary\n * and the record's categories line up one-for-one — `ORGANIZATION_BILLING` ↔ `billing`,\n * `ORGANIZATION_SECURITY` ↔ `security`, and so on — so a second authoring surface would only be\n * a place for the two to disagree.\n *\n * A configured address REPLACES the member fan-out rather than adding to it. A tenant that\n * routes security mail to a SOC address is saying where that mail goes, not asking for a copy;\n * sending both would make the setting an amplifier instead of a router.\n */\n const organizationRouting = channel === CoreUserNotificationChannel.EMAIL\n ? await this.resolveOrganizationNotificationRouting(executionContext, notification, target)\n : undefined;\n\n if (organizationRouting?.suppressed) {\n this.logDebug('Skipping organization notification: the tenant switched this category off', {\n identifier: notification.identifier,\n target,\n category: organizationRouting.category,\n });\n return [];\n }\n\n if (organizationRouting?.address) {\n return this.dispatchEmailToOrganizationAddress(\n executionContext,\n functionParameters,\n notification,\n organizationRouting.address,\n organizationRouting.category,\n emailSubmissionSourceId,\n );\n }\n\n // Get user IDs based on target\n const userIds = await this.getUserIdsForTarget(\n executionContext,\n functionParameters,\n notification,\n target,\n );\n\n if (userIds.length === 0) {\n this.logDebug('No user IDs found for notification', {\n identifier: notification.identifier,\n target,\n channel,\n });\n return [];\n }\n\n // Handle by channel type\n switch (channel) {\n case CoreUserNotificationChannel.EMAIL:\n return this.dispatchEmailNotifications(\n executionContext,\n functionParameters,\n notification,\n userIds,\n emailSubmissionSourceId,\n );\n\n case CoreUserNotificationChannel.SMS:\n case CoreUserNotificationChannel.PUSH:\n // SMS and Push not yet implemented\n this.logDebug('SMS/Push notifications not yet implemented', {\n identifier: notification.identifier,\n channel,\n userCount: userIds.length,\n });\n return [];\n }\n }\n\n /**\n * Build the shared email-dispatch context for a user notification: the resolved\n * `templateRef`, the app default `locale`, and the `baseContext` (object + additional\n * context, including the token `acceptUrl` enricher). These are computed ONCE per\n * notification (recipient-independent), so both the user-id recipient path\n * (`dispatchEmailNotifications`) and the email-by-address path\n * (`dispatchEmailToRecipientAddress`) render from identical context.\n */\n private async buildEmailNotificationContext<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n ) {\n const operation = executionContext.operation;\n\n // Build template reference from executionContext.operation (guaranteed correct after doOperation corrections)\n const templateRef = buildUserNotificationEmailTemplateRef(\n {\n resourceIdentifier: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n ...(operation.variantKey && {\n variantKey: String(operation.variantKey),\n }),\n },\n notification,\n );\n\n // Determine the app primary locale from backend configuration.\n const locale = this.getDefaultLocale();\n\n // Get app identity and ID from config.\n // Slice 3.7 (F-53) terminology pin: `appIdentity.appName` is the\n // canonical id (from `WildoSaasConfig.name`), `appIdentity.displayName`\n // is the UI label. Notifications want the UI label, so we resolve a\n // local `appDisplayLabel` from `displayName ?? appName ?? 'Application'`\n // and pass it under the template prop name `appName` (existing\n // template contract — renaming the prop would ripple to every email\n // template, tracked separately).\n const appConfig = this.appConfigService.config as Record<string, unknown>;\n const appIdentity = appConfig.appIdentity as { appName?: string; displayName?: string } | undefined;\n const applicationId = this.appConfigService.applicationId || 'unknown';\n const appDisplayLabel = appIdentity?.displayName || appIdentity?.appName || 'Application';\n\n // Resolve dashboard URL — scope/target-aware (admin targets → APP_ADMIN, else MAIN_APP)\n const dashboardUrl = this.resolveDashboardUrlForNotification(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>, notification\n );\n\n // Fetch initiator name when user-initiated (for \"X added you\" style personalization)\n const initiatorUserId = executionContext.initiatorIds?.userId;\n const initiatorContext = initiatorUserId ? await this.fetchUserContext(initiatorUserId) : undefined;\n const initiatorName = initiatorContext?.firstName ?? initiatorContext?.name ?? undefined;\n\n // Resolve organization name from executionContext (org-scoped resources only)\n const organizationName = await this.resolveOrganizationName(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>, executionContext\n );\n\n // Resolve direct resource URL (e.g. /organizations/:orgId/todos/:todoId → full link)\n const resourceUrl = this.resolveResourceUrl(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>,\n functionParameters.currentObject as Record<string, unknown> | undefined,\n executionContext,\n dashboardUrl\n );\n\n // Build base context from function parameters\n const baseContext = {\n currentObject: functionParameters.currentObject,\n objectContext: {\n primaryScopeContext: {\n appName: appDisplayLabel,\n applicationId,\n organizationName: organizationName ?? undefined,\n // App brand logo for the email header. Resolve the email-optimised\n // lockup from config brandAssets; `resolveBrandAsset` falls back\n // (EMAIL → DEFAULT theme → PRIMARY), and the resolver returns\n // undefined when no brand asset was generated yet. ABSOLUTE variant:\n // email clients can't fetch a same-origin `/brand/<ref>.png`, so a\n // relative brand-asset path is prefixed with the app public base URL.\n logoUrl: this.appConfigService.resolveBrandLogoAbsoluteUrl({\n composition: BrandAssetComposition.LOCKUP,\n purpose: BrandAssetPurpose.EMAIL,\n }) ?? undefined,\n },\n },\n additionalContext: {\n operationType: String(operation.operationIdentifier),\n resourceType: String(operation.resourceIdentifier),\n dashboardUrl: dashboardUrl ?? undefined,\n initiatorName: initiatorName ?? undefined,\n resourceUrl: resourceUrl ?? undefined,\n // Token-consume link for token-bearing emails (e.g. invitation accept):\n // <frontendBase><emailLinkPath>?token=<tokenValue> when the op generated a\n // token and declares `tokenGeneration.emailLinkPath`. Undefined otherwise.\n acceptUrl: this.resolveTokenAcceptUrl(\n operation as unknown as ResourceConfiguration_Operation<any, any, any>,\n functionParameters,\n dashboardUrl,\n ) ?? undefined,\n },\n };\n\n return { templateRef, locale, baseContext };\n }\n\n /**\n * Dispatch email notifications to a list of users.\n * Uses direct sending for small lists, batch queue for larger lists.\n */\n private async dispatchEmailNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n userIds: string[],\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const { templateRef, locale, baseContext } = await this.buildEmailNotificationContext(\n executionContext,\n functionParameters,\n notification,\n );\n\n if (userIds.length > EMAIL_BATCH_THRESHOLD) {\n await this.enqueueEmailBatch(\n templateRef,\n locale,\n userIds,\n baseContext,\n notification,\n emailSubmissionSourceId,\n );\n return [];\n }\n\n // Direct sending for smaller lists\n const results: EmailSendResult[] = [];\n for (const userId of userIds) {\n try {\n const recipientUserContext = await this.fetchUserContext(userId);\n\n if (!recipientUserContext?.email) {\n this.logger.warn('No email address for user, skipping notification', {\n userId,\n identifier: notification.identifier,\n });\n continue;\n }\n\n if (!this.recipientAcceptsNotificationChannel(notification, recipientUserContext)) {\n this.logDebug('Skipping user notification: recipient switched this channel off', {\n userId,\n identifier: notification.identifier,\n channel: notification.channel,\n });\n continue;\n }\n\n const recipientLocale = this.resolveRecipientLocale(recipientUserContext, locale);\n const result = await this.emailService.send({\n ...(emailSubmissionSourceId && {\n submissionId: deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { userId },\n ),\n }),\n templateRef,\n locale: recipientLocale,\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientUserContext.email,\n context: {\n ...baseContext,\n userContext: {\n userId,\n email: recipientUserContext.email,\n name: recipientUserContext.name,\n firstName: recipientUserContext.firstName,\n },\n },\n });\n results.push(result);\n\n this.logDebug('Email notification sent', {\n identifier: notification.identifier,\n userId,\n success: result.success,\n submissionId: result.submissionId,\n outcome: result.outcome,\n providerMessageIds: result.providerMessageIds,\n });\n } catch (error) {\n this.logger.warn('Failed to send email notification', {\n userId,\n identifier: notification.identifier,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n return results;\n }\n\n /**\n * Deliver a single email to a raw address read from the current object — the\n * email-by-address path selected when an EMAIL notification declares\n * `recipientEmailField` (see `dispatchEmailSmsPushUserNotification`).\n *\n * The recipient is `currentObject[recipientEmailField]` (a top-level string field,\n * e.g. `email`) — a party who is NOT a platform user (an invitation invitee, an\n * inbound lead), so there is no `userId` and no user preferences. The app default\n * locale is used, and the shared notification context is reused verbatim, so\n * token-bearing emails still carry their `acceptUrl`. Best-effort: a missing address\n * or a send failure is logged and swallowed, never thrown into the operation pipeline.\n */\n /**\n * Which of the tenant's four notification categories an organization-targeted notification\n * belongs to, or `undefined` when the target names no category.\n *\n * DERIVED from the target rather than declared per notification (#410). The two vocabularies were\n * built to line up and a mapping table is the only place they can drift; the entries that are\n * absent are absent for a reason:\n *\n * - `ORGANIZATION_USERS` fans out to every member BY DESIGN. Routing it to one address would\n * change who the message is for, not merely where it lands.\n * - `ORGANIZATION` is the tenant itself with no category, so it falls to `defaultEmailAddress`\n * below without belonging to a switch.\n */\n private static readonly ORGANIZATION_NOTIFICATION_CATEGORY_BY_TARGET: Readonly<Record<string, 'billing' | 'security' | 'administrative' | 'usersManagement'>> = Object.freeze({\n [CoreUserNotificationTarget.ORGANIZATION_BILLING]: 'billing',\n [CoreUserNotificationTarget.ORGANIZATION_SECURITY]: 'security',\n [CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE]: 'administrative',\n [CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT]: 'usersManagement',\n });\n\n /**\n * Resolve where an organization-targeted email should go, and whether it should go at all.\n *\n * Returns `undefined` for a target this record does not govern, so the caller falls through to\n * the ordinary member fan-out. Reading the record is best-effort: a tenant with no\n * `organizationNotifications` row, or a read that fails, must fall through to the behaviour that\n * existed before this feature rather than silently dropping the notification.\n */\n private async resolveOrganizationNotificationRouting<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n notification: UserNotificationDefinition,\n target: string,\n ): Promise<{ address?: string; suppressed: boolean; category?: string } | undefined> {\n const category = NotificationDispatcherService.ORGANIZATION_NOTIFICATION_CATEGORY_BY_TARGET[target];\n const isTenantWide = target === CoreUserNotificationTarget.ORGANIZATION;\n if (!category && !isTenantWide) return undefined;\n\n const organizationId = (executionContext as any)?.initiatorIds?.organizationId as string | undefined;\n if (!organizationId) return undefined;\n\n let settings: OrganizationEmailNotifications | undefined;\n try {\n const repository = this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_NOTIFICATIONS);\n if (!repository) return undefined;\n const record = await repository.read<{ emailNotifications?: OrganizationEmailNotifications }>(\n { operation: { resourceIdentifier: CoreResourceType.ORGANIZATION_NOTIFICATIONS, operationIdentifier: 'read' } } as any,\n { organizationId },\n { excludeContextualFilter: true },\n );\n settings = record?.emailNotifications;\n } catch {\n this.logDebug('Failed to read organization notification settings; falling back to member fan-out', {\n identifier: notification.identifier,\n organizationId,\n });\n return undefined;\n }\n\n if (!settings) return undefined;\n\n // The switch is a suppression and applies whether or not an address is configured: a tenant\n // that turns billing notifications off means it for the members too, not only for the address.\n if (category && settings[category] === false) {\n return { suppressed: true, category };\n }\n\n const categoryAddress = category\n ? settings[`${category}Address` as keyof OrganizationEmailNotifications]\n : undefined;\n const address = (typeof categoryAddress === 'string' && categoryAddress.trim())\n || (typeof settings.defaultEmailAddress === 'string' && settings.defaultEmailAddress.trim())\n || undefined;\n\n return { address: address || undefined, suppressed: false, category };\n }\n\n /**\n * Send one organization-routed email to the tenant's configured address (#410).\n *\n * Deliberately NOT reusing `dispatchEmailToRecipientAddress`: that path exists for an address\n * read off the operation's own object — an invitee who has no account — and its logging and its\n * `userId: ''` sentinel both say so. This recipient is a tenant's own routing address, a\n * different thing with a different reason for having no user, and collapsing them would make the\n * logs unable to answer which kind of send happened.\n */\n private async dispatchEmailToOrganizationAddress<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n recipientEmail: string,\n category: string | undefined,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const { templateRef, locale, baseContext } = await this.buildEmailNotificationContext(\n executionContext,\n functionParameters,\n notification,\n );\n\n try {\n const result = await this.emailService.send({\n ...(emailSubmissionSourceId && {\n submissionId: deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { email: recipientEmail },\n ),\n }),\n templateRef,\n locale,\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientEmail,\n context: {\n ...baseContext,\n // A routing address belongs to the TENANT, not to a person: `userId: ''` is the same\n // \"no platform user\" sentinel the by-address path uses, for a different reason.\n userContext: { userId: '', email: recipientEmail },\n },\n });\n\n this.logDebug('Organization-routed notification sent', {\n identifier: notification.identifier,\n category,\n success: result.success,\n submissionId: result.submissionId,\n outcome: result.outcome,\n });\n return [result];\n } catch (error) {\n this.logger.warn('Failed to send organization-routed notification', {\n identifier: notification.identifier,\n category,\n ...projectCaughtErrorLogFields(error),\n });\n return [];\n }\n }\n\n private async dispatchEmailToRecipientAddress<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n recipientEmailField: string,\n emailSubmissionSourceId?: string,\n ): Promise<EmailSendResult[]> {\n const operation = executionContext.operation;\n const currentObject = functionParameters.currentObject as Record<string, unknown> | undefined;\n const rawAddress = currentObject?.[recipientEmailField];\n const recipientEmail = typeof rawAddress === 'string' ? rawAddress.trim() : '';\n\n if (!recipientEmail) {\n this.logger.warn('Email-by-address notification has no recipient address on the current object; skipping', {\n identifier: notification.identifier,\n recipientEmailField,\n resourceType: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n });\n return [];\n }\n\n const { templateRef, locale, baseContext } = await this.buildEmailNotificationContext(\n executionContext,\n functionParameters,\n notification,\n );\n\n try {\n const result = await this.emailService.send({\n ...(emailSubmissionSourceId && {\n submissionId: deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { email: recipientEmail },\n ),\n }),\n templateRef,\n locale,\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientEmail,\n context: {\n ...baseContext,\n // Non-user recipient: only the address is known. `userId: ''` is the explicit\n // \"no platform user\" sentinel for the required `EmailUserContext.userId` field.\n userContext: {\n userId: '',\n email: recipientEmail,\n },\n },\n });\n\n this.logDebug('Email-by-address notification sent', {\n identifier: notification.identifier,\n recipientEmailField,\n success: result.success,\n submissionId: result.submissionId,\n outcome: result.outcome,\n providerMessageIds: result.providerMessageIds,\n });\n return [result];\n } catch (error) {\n this.logger.warn('Failed to send email-by-address notification', {\n identifier: notification.identifier,\n recipientEmailField,\n ...projectCaughtErrorLogFields(error),\n });\n return [];\n }\n }\n\n /**\n * Enqueue a batch of emails for asynchronous sending.\n * Used for large recipient lists (above EMAIL_BATCH_THRESHOLD).\n */\n private async enqueueEmailBatch(\n templateRef: string,\n locale: AvailableLanguage,\n userIds: string[],\n baseContext: Record<string, unknown>,\n notification: UserNotificationDefinition,\n emailSubmissionSourceId?: string,\n ): Promise<void> {\n // Fetch all user contexts first\n const emailItems: Array<{\n submissionId: string;\n templateRef: string;\n locale: string;\n type: string;\n to: string;\n context: Record<string, unknown>;\n }> = [];\n\n for (const userId of userIds) {\n try {\n const recipientUserContext = await this.fetchUserContext(userId);\n\n if (!recipientUserContext?.email) {\n continue;\n }\n\n // Same gate as the direct loop above. Both exist because the dispatcher splits on list size,\n // and a suppression applied to only one of them would depend on how many recipients an\n // operation happened to have.\n if (!this.recipientAcceptsNotificationChannel(notification, recipientUserContext)) {\n this.logDebug('Skipping user notification in batch: recipient switched this channel off', {\n userId,\n identifier: notification.identifier,\n channel: notification.channel,\n });\n continue;\n }\n\n emailItems.push({\n submissionId: emailSubmissionSourceId\n ? deriveEmailNotificationSubmissionId(\n emailSubmissionSourceId,\n notification.identifier,\n templateRef,\n { userId },\n )\n : randomUUID(),\n templateRef,\n locale: this.resolveRecipientLocale(recipientUserContext, locale),\n type: EmailTemplateType.TRANSACTIONAL,\n to: recipientUserContext.email,\n context: {\n ...baseContext,\n userContext: {\n userId,\n email: recipientUserContext.email,\n name: recipientUserContext.name,\n firstName: recipientUserContext.firstName,\n },\n },\n });\n } catch (error) {\n this.logger.warn('Failed to fetch user context for batch', {\n userId,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n\n if (emailItems.length === 0) {\n this.logDebug('No valid email recipients for batch', {\n identifier: notification.identifier,\n });\n return;\n }\n\n // Enqueue the batch\n const { jobId } = await this.queueService.enqueueCustomBatch(\n EMAIL_BATCH_SEND_BATCH_REF,\n {\n batchId: `${notification.identifier}-${randomUUID()}`,\n emails: emailItems,\n retryOnFailure: true,\n maxRetries: 3,\n }\n );\n\n this.logDebug('Email batch enqueued', {\n identifier: notification.identifier,\n jobId,\n emailCount: emailItems.length,\n });\n }\n\n /**\n * Get default locale from app config\n */\n private getDefaultLocale(): AvailableLanguage {\n return getConfiguredPrimaryLanguage(this.appConfigService.config);\n }\n\n private resolveRecipientLocale(\n recipientUserContext: { preferredLanguage?: AvailableLanguage } | undefined,\n fallbackLocale: AvailableLanguage,\n ): AvailableLanguage {\n return recipientUserContext?.preferredLanguage || fallbackLocale;\n }\n\n private normalizeAvailableLanguage(value: unknown): AvailableLanguage | undefined {\n return Object.values(AvailableLanguage).includes(value as AvailableLanguage)\n ? value as AvailableLanguage\n : undefined;\n }\n\n private async fetchUserPreferences(userId: string): Promise<UserPreferences | undefined> {\n try {\n const userPreferencesRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USER_PREFERENCES);\n if (!userPreferencesRepository) {\n this.logDebug('No user preferences repository available for recipient locale resolution', { userId });\n return undefined;\n }\n\n return await userPreferencesRepository.read<UserPreferences>(\n { operation: { resourceIdentifier: CoreResourceType.USER_PREFERENCES, operationIdentifier: 'read' } } as any,\n { userId },\n { excludeContextualFilter: true },\n ) ?? undefined;\n } catch {\n this.logDebug('Failed to fetch user preferences for recipient locale resolution', { userId });\n return undefined;\n }\n }\n\n /**\n * Resolve the recipient's profile (`USER_PROFILES`, 1:1 with `USERS` via a\n * unique `userId` FK — read context-addressed by `{ userId }`, exactly like\n * {@link fetchUserPreferences}). This is where the human name fields live\n * (`firstName` / `lastName` / `displayName`); the `USERS` row carries none of\n * them. Best-effort: a missing repository or read failure degrades to\n * `undefined` so the caller can fall back to the email address.\n */\n private async fetchUserProfile(userId: string): Promise<UserProfile | undefined> {\n try {\n const userProfilesRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USER_PROFILES);\n if (!userProfilesRepository) {\n this.logDebug('No user profiles repository available for recipient name resolution', { userId });\n return undefined;\n }\n\n return await userProfilesRepository.read<UserProfile>(\n { operation: { resourceIdentifier: CoreResourceType.USER_PROFILES, operationIdentifier: 'read' } } as any,\n { userId },\n { excludeContextualFilter: true },\n ) ?? undefined;\n } catch {\n this.logDebug('Failed to fetch user profile for recipient name resolution', { userId });\n return undefined;\n }\n }\n\n /**\n * Get user IDs for a notification target\n * Handles both fixed targets and custom userIdsSelector\n */\n private async getUserIdsForTarget<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition,\n target: string\n ): Promise<string[]> {\n // Custom user targeting via userIdsSelector\n if (target === CoreUserNotificationTarget.USERS_CUSTOM && notification.userIdsSelector) {\n // Ensure objectContext has the expected structure (parents/children)\n const objectContext = functionParameters.objectContext || {};\n const normalizedObjectContext = {\n parents: (objectContext as any)?.parents || {},\n children: (objectContext as any)?.children || {}\n };\n\n return Array.from(new Set(notification.userIdsSelector({\n currentObject: functionParameters.currentObject,\n inputDto: functionParameters.inputDto,\n objectContext: normalizedObjectContext,\n initiatorIds: functionParameters.initiatorIds\n })));\n }\n\n // Fixed targets - extract from executionContext.initiatorIds\n const initiatorIds = executionContext.initiatorIds;\n\n switch (target) {\n case CoreUserNotificationTarget.USER_SELF:\n return initiatorIds?.userId ? [initiatorIds.userId] : [];\n\n case CoreUserNotificationTarget.ORGANIZATION:\n case CoreUserNotificationTarget.ORGANIZATION_USERS:\n return this.getOrganizationRecipientUserIds(executionContext, initiatorIds?.organizationId);\n\n case CoreUserNotificationTarget.ORGANIZATION_BILLING:\n case CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE:\n case CoreUserNotificationTarget.ORGANIZATION_SECURITY:\n return this.getOrganizationRecipientUserIds(\n executionContext,\n initiatorIds?.organizationId,\n this.mapOrganizationTargetToRoles(target as CoreUserNotificationTarget, notification),\n );\n\n case CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR:\n case CoreUserNotificationTarget.APPLICATION_BILLING:\n case CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.APPLICATION_SECURITY:\n case CoreUserNotificationTarget.APPLICATION_SUPPORT:\n case CoreUserNotificationTarget.APPLICATION_OTHER:\n case CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER:\n /*\n * Resolved since #507. Seventeen shipped engine notifications target APPLICATION_ADMINISTRATOR\n * on the EMAIL channel — application API-key lifecycle, OAuth-client lifecycle and user events —\n * and every one of them used to fall into `default:`, resolve nobody, and send nothing. None\n * declares `recipientEmailField`, so none escaped through the by-address path.\n *\n * It went unnoticed because the WEBSOCKET branch for these same targets always worked\n * (`mapApplicationTargetToRoles` + `sendToAppRole`), so an administrator watching a dashboard\n * saw the events live and the feature appeared to work. Only the email half was dead.\n */\n return this.getApplicationRecipientUserIds(\n executionContext,\n this.mapApplicationTargetToRoles(target as CoreUserNotificationTarget, notification),\n );\n\n case CoreUserNotificationTarget.INBOUND_CONTACT:\n /*\n * Resolves NO user, deliberately and not by omission. An inbound contact is a person who is not\n * a user of this application — the notification reaches them through `recipientEmailField`, the\n * by-address path, which never calls this method. Returning `[]` here is the correct answer and\n * is stated as its own case so it is not mistaken for the defect above.\n */\n return [];\n\n default:\n /*\n * Every member of the vocabulary now has an explicit answer, so reaching here means a target was\n * ADDED and nobody decided what it resolves to.\n *\n * This is a WARN and not a debug line, which is the second half of #507's fix. The defect above\n * survived because a `default:` arm silently returned no recipients for seven enum members while\n * logging at debug — a channel `AbstractControllerBackendService` disables — so the dispatcher\n * reported success and delivered nothing. A target the dispatcher cannot serve has to say so\n * where somebody reads it.\n */\n this.logger.warn('Notification target resolves no recipients: the dispatcher has no rule for it', {\n target,\n identifier: notification.identifier,\n channel: notification.channel,\n });\n return [];\n }\n }\n\n /**\n * The users an APPLICATION-level notification is addressed to: holders of the target's app roles.\n *\n * The app-level counterpart of {@link getOrganizationRecipientUserIds}, and it mirrors that method\n * deliberately — same sub-call context, same initiator exclusion, same \"no repository means no\n * recipients\" posture — so the two halves of one feature cannot drift into behaving differently.\n *\n * ## Tenancy: there is no tenant to cross\n *\n * These recipients are application-level administrators rather than members of the tenant whose row\n * triggered the event, so the question \"does this leak one tenant's data to another\" has to be\n * answered rather than assumed. It is answered by the population: all 17 notifications sit on\n * APPLICATION-scoped resources (`users`, application API keys, application OAuth clients), and\n * `resolveOrganizationName` — the only place a tenant's name enters an email context — returns\n * `undefined` unless the operation's `resourcePrimaryScope` is `ORGANIZATIONS`. So no tenant name\n * reaches these bodies, by construction rather than by care.\n *\n * That is a property of the CURRENT population, not a guarantee about future ones. An\n * ORGANIZATIONS-scoped operation that adds an `APPLICATION_*` notification would put a tenant's data\n * in front of a non-member, and this is the comment that should stop it.\n *\n * ## Why the query filters rather than listing everyone\n *\n * `appRoles` is `.isDBIndexed()`, and the same `$in` shape is what the super-administrator floor uses\n * to count administrators. The organization path can afford to filter roles in memory because its\n * population is one tenant's roster; the application population is every user of the application.\n */\n private async getApplicationRecipientUserIds(\n executionContext: ExecutionContext<any>,\n appRoles: string[],\n ): Promise<string[]> {\n if (appRoles.length === 0) {\n return [];\n }\n\n const usersRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USERS);\n if (!usersRepository) {\n // WARN rather than debug: this is the shape that hid #507 for the life of the target.\n this.logger.warn('No users repository available for application-level notification targeting', {\n appRoles,\n });\n return [];\n }\n\n // Same reasoning as the organization roster read: this runs during dispatch for a notification\n // attached to ANY resource operation, so the caller's context is keyed to that resource and its\n // contextual filter is fail-closed on a field USERS does not model.\n const recipientReadContext = this.executionContextCreator\n ? await this.executionContextCreator.createForSubCall(\n executionContext as any,\n CoreResourceType.USERS,\n CoreResourceOperation.LIST,\n )\n : executionContext;\n\n const candidates = await usersRepository.list<{ _id?: string; appRoles?: string[]; status?: string }>(\n recipientReadContext as any,\n {\n appRoles: { $in: [...appRoles] },\n // ACTIVE only. A suspended or pending administrator is not someone to notify, and the\n // retention hide at the repository chokepoint already keeps erased-but-retained rows out —\n // which matters here because `appRoles` is `.isAuditEvidence()` and survives the scrub, so a\n // retained row would otherwise still match a role filter.\n status: UserStatus.ACTIVE,\n },\n );\n\n const initiatorUserId = executionContext.initiatorIds?.userId;\n return Array.from(new Set(\n (Array.isArray(candidates) ? candidates : [])\n .map((candidate) => candidate?._id)\n .filter((userId): userId is string => typeof userId === 'string' && userId.length > 0)\n // Mirrors the organization path: the administrator who rotated the key does not need an email\n // telling them they rotated it.\n .filter((userId) => userId !== initiatorUserId),\n ));\n }\n\n /**\n * Resolve the per-recipient context consumed by every greeting surface (email\n * subject/body, the `initiatorName` personalization, batch/direct sends).\n *\n * The human name fields (`firstName` / `lastName` / `displayName`) live on\n * `USER_PROFILES`, NOT on the `USERS` row — `UserSchema` carries only the email\n * identity anchor, status, roles and timestamps. Reading `firstName`/`name`\n * off the `USERS` row (as this method historically did) therefore resolved to\n * `undefined` for EVERY user, so greetings rendered blank and any\n * `{firstName}`-style label placeholder leaked its literal token to the\n * recipient — `interpolateLabelParams` returns the raw `{token}` verbatim when\n * the param is absent.\n *\n * Names are now read from the user's profile and degrade to `email` when a\n * user has no profile yet (SSO-JIT / anonymous edge cases, or a not-yet-seeded\n * profile). This mirrors the SCIM formatter's `displayName || fullName ||\n * email` degradation so every surface renders *something* human — never a\n * blank, never a raw placeholder token. `name` carries the same greeting label\n * as `displayName`; `firstName` is the informal variant with the same email\n * floor.\n */\n /**\n * Whether this notification may be sent to THIS recipient on THIS channel, given the recipient's\n * own channel switches (#409).\n *\n * Until 2026-09-08 `UserPreferences.notifications` was stored, editable on the self-preferences\n * screen, classified as personal data, subject-exported and reset on erasure — and read by\n * nothing. A person who turned email off still received email.\n *\n * ONE predicate rather than a check at each of the three send loops, because that is the shape\n * this repository's own rule asks for: an invariant applied at some of its call sites is the\n * defect it keeps recording. The loops call this; nothing else decides.\n *\n * Three ways a message is delivered regardless, each for a different reason:\n * - the target is ROLE-addressed (see `userNotificationTargetIsSuppressibleByRecipientPreference`)\n * — the recipient did not choose to receive it as a person;\n * - the notification declares `alwaysDeliver` — a security notice a compromised account's owner\n * must still receive;\n * - the channel has no switch, or the recipient has no preferences row at all. A missing record\n * must never read as \"everything off\": preferences are created lazily, so a user who has never\n * opened the settings screen would otherwise silently stop receiving everything.\n */\n private recipientAcceptsNotificationChannel(\n notification: UserNotificationDefinition,\n recipientUserContext: { notificationChannelPreferences?: UserPreferences_Notifications } | undefined,\n ): boolean {\n if (notification.alwaysDeliver === true) return true;\n if (!userNotificationTargetIsSuppressibleByRecipientPreference(notification.target)) return true;\n\n const preferences = recipientUserContext?.notificationChannelPreferences;\n if (!preferences) return true;\n\n switch (notification.channel) {\n case CoreUserNotificationChannel.EMAIL:\n return preferences.email !== false;\n case CoreUserNotificationChannel.SMS:\n return preferences.sms !== false;\n case CoreUserNotificationChannel.PUSH:\n return preferences.push !== false;\n default:\n // WEBSOCKET and FRONT_END_SUCCESS carry no switch of their own. The `inApp` preference\n // governs the notification CENTRE, which is a frontend surface — `NotificationContext`\n // honours it there, because suppressing the socket frame would also suppress the live\n // UI updates that ride the same channel.\n return true;\n }\n }\n\n private async fetchUserContext(userId: string): Promise<any | undefined> {\n try {\n const userRepository = this.repositoriesRegistry.getRepository(CoreResourceType.USERS);\n if (!userRepository) {\n this.logDebug('No user repository available for fetchUserContext', { userId });\n return undefined;\n }\n const user = await userRepository.read(\n { operation: { resourceIdentifier: CoreResourceType.USERS, operationIdentifier: 'read' } } as any,\n userId,\n { excludeContextualFilter: true },\n );\n if (!user) return undefined;\n\n const email = (user as any).email as string | undefined;\n\n // Profile (name fields) and preferences (locale) are independent lookups\n // keyed only by `userId`, so resolve them concurrently — adding the profile\n // read must not serialize an extra round-trip per recipient on batch sends.\n // Both helpers are best-effort (own try/catch → undefined), so `Promise.all`\n // never rejects here.\n const [profile, preferences] = await Promise.all([\n this.fetchUserProfile(userId),\n this.fetchUserPreferences(userId),\n ]);\n\n // Names come from USER_PROFILES (1:1 with USERS). Fall back to `email` so a\n // profile-less recipient still gets a sensible greeting and never a blank\n // or a leaked `{firstName}` token. `filter(Boolean)` drops a missing half of\n // the name; `|| undefined` collapses the empty-string join so the `??`\n // chain reaches the email floor.\n const fullName = [profile?.firstName, profile?.lastName].filter(Boolean).join(' ') || undefined;\n const displayName = profile?.displayName ?? fullName ?? email;\n const firstName = profile?.firstName ?? email;\n\n const preferredLanguage = this.normalizeAvailableLanguage(preferences?.languagePreferences?.primaryLanguage)\n ?? this.normalizeAvailableLanguage(preferences?.regional?.locale);\n return {\n email,\n displayName,\n name: displayName,\n firstName,\n preferredLanguage,\n // The recipient's own channel switches (#409). Costs NOTHING extra: the preferences record\n // is already read above for the locale, and only its language fields were being consumed —\n // which is precisely why a user who turned email off kept receiving email.\n notificationChannelPreferences: preferences?.notifications,\n userId,\n };\n } catch {\n this.logDebug('Failed to fetch user context', { userId });\n return undefined;\n }\n }\n\n private async getOrganizationRecipientUserIds(\n executionContext: ExecutionContext<any>,\n organizationId: string | undefined,\n allowedRoles?: string[],\n ): Promise<string[]> {\n if (!organizationId) {\n return [];\n }\n\n const organizationMembersRepository = this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_MEMBERS);\n if (!organizationMembersRepository) {\n this.logDebug('No organization members repository available for notification targeting', {\n organizationId,\n });\n return [];\n }\n\n // Read the roster on a SUB-CALL context, not the caller's. This runs during dispatch for a\n // notification attached to ANY resource operation, so the caller's context is keyed to that\n // resource — a nested route contributes its own FK (`todoId`, …), and the repository's contextual\n // filter is fail-closed on a field ORGANIZATION_MEMBERS does not model: it THROWS rather than\n // ignoring it. Narrowing keeps `organizationId`/`userId` (both real columns) and drops the rest.\n // Falls back to the caller's context only when the creator is unavailable (minimal containers).\n const rosterReadContext = this.executionContextCreator\n ? await this.executionContextCreator.createForSubCall(\n executionContext as any,\n CoreResourceType.ORGANIZATION_MEMBERS,\n CoreResourceOperation.LIST,\n )\n : executionContext;\n\n const membershipSummaries = await organizationMembersRepository.list<OrganizationMember>(\n rosterReadContext as any,\n {\n organizationId,\n status: OrganizationMemberStatus.ACTIVE,\n },\n );\n const memberships = await Promise.all(\n membershipSummaries.map(async (membership) => {\n if (membership?.userId && Array.isArray(membership.roles)) {\n return membership;\n }\n if (membership?._id) {\n try {\n return await organizationMembersRepository.read(\n executionContext as any,\n membership._id,\n ) as OrganizationMember | null;\n } catch {\n return membership;\n }\n }\n return membership;\n }),\n );\n\n const allowedRoleSet = allowedRoles && allowedRoles.length > 0\n ? new Set(allowedRoles)\n : null;\n const initiatorUserId = executionContext.initiatorIds?.userId;\n const userIds = memberships\n .filter((membership): membership is OrganizationMember => Boolean(membership))\n .filter((membership) => membership.status === OrganizationMemberStatus.ACTIVE)\n .filter((membership) => typeof membership.userId === 'string' && membership.userId.length > 0)\n .filter((membership) => membership.userId !== initiatorUserId)\n .filter((membership) => {\n if (!allowedRoleSet) {\n return true;\n }\n return membership.roles.some((role) => allowedRoleSet.has(role));\n })\n .map((membership) => membership.userId);\n\n return Array.from(new Set(userIds));\n }\n\n /**\n * Build the public token-consume URL for a token-bearing notification email.\n *\n * When the operation generated a consumable token — its `tokenValue` was injected\n * into `functionParameters.additionalContext` by the services-registry-handler\n * before dispatch — AND the operation declares `tokenGeneration.emailLinkPath`,\n * this returns `<frontendBaseUrl><emailLinkPath>?token=<tokenValue>` (e.g. the\n * `/invitation?token=…` acceptance link). Returns undefined otherwise, so the\n * email template falls back to its generic CTA. Generic across token types — the\n * consume path comes from the operation's declarative config, not hard-coded here.\n */\n private resolveTokenAcceptUrl(\n operation: ResourceConfiguration_Operation<any, any, any>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n frontendBaseUrl: string | undefined,\n ): string | undefined {\n const emailLinkPath = 'tokenGeneration' in operation ? operation.tokenGeneration?.emailLinkPath : undefined;\n // `additionalContext` is injected dynamically by the services-registry-handler\n // (it carries the freshly-minted `tokenValue`); it is not on the static\n // FunctionParameters type, so read it through a narrow cast.\n const tokenValue = (functionParameters as { additionalContext?: Record<string, unknown> })\n .additionalContext?.tokenValue;\n if (!emailLinkPath || typeof tokenValue !== 'string' || tokenValue.length === 0 || !frontendBaseUrl) {\n return undefined;\n }\n const base = frontendBaseUrl.endsWith('/') ? frontendBaseUrl.slice(0, -1) : frontendBaseUrl;\n const path = emailLinkPath.startsWith('/') ? emailLinkPath : `/${emailLinkPath}`;\n return `${base}${path}?token=${encodeURIComponent(tokenValue)}`;\n }\n\n /**\n * Resolve the correct frontend app URL based on notification target.\n * Uses the config-driven reverse lookup: notification target → user type (via defaultAppRoles) → app type.\n * Admin-targeted notifications route to the app type that serves admin user types.\n * All other notifications route to the default frontend app type.\n */\n private resolveDashboardUrlForNotification(\n _operation: ResourceConfiguration_Operation<any, any, any>,\n notification: UserNotificationDefinition\n ): string | undefined {\n const target = notification.target;\n const config = this.appConfigService.config;\n\n const isAdminTarget =\n target === CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR ||\n target === CoreUserNotificationTarget.APPLICATION_BILLING ||\n target === CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT ||\n target === CoreUserNotificationTarget.APPLICATION_SECURITY ||\n target === CoreUserNotificationTarget.APPLICATION_SUPPORT ||\n target === CoreUserNotificationTarget.APPLICATION_OTHER ||\n target === CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER;\n\n let appType: string | null = null;\n\n if (isAdminTarget) {\n const adminUserType = Object.entries(config.userTypes)\n .find(([, def]) => def.defaultAppRoles?.includes(CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN))?.[0];\n appType = adminUserType\n ? this.appConfigService.resolveFrontendServiceNameFromUserType(adminUserType)\n : null;\n }\n\n if (!appType) {\n appType = this.appConfigService.resolveDefaultFrontendServiceName();\n }\n\n if (!appType) return undefined;\n return AuthControllerUtils.lookupFrontendPublicUrl(config, appType) ?? undefined;\n }\n\n /**\n * Resolve organization name for email context.\n * Only fetches for org-scoped resources (ORGANIZATIONS scope) using the org ID\n * from executionContext. Returns undefined for USER_SELF, APPLICATION scopes.\n */\n private async resolveOrganizationName(\n operation: ResourceConfiguration_Operation<any, any, any>,\n executionContext: ExecutionContext<any>\n ): Promise<string | undefined> {\n if (operation.resourcePrimaryScope !== ResourcePrimaryScope.ORGANIZATIONS) {\n return undefined;\n }\n\n const organizationId = executionContext.initiatorIds?.organizationId;\n if (!organizationId) {\n return undefined;\n }\n\n try {\n const orgRepository = this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATIONS);\n if (!orgRepository) {\n return undefined;\n }\n const org = await orgRepository.read(\n { operation: { resourceIdentifier: CoreResourceType.ORGANIZATIONS, operationIdentifier: 'read' } } as any,\n organizationId,\n { excludeContextualFilter: true },\n );\n if (!org) return undefined;\n return (org as any).displayName ?? (org as any).name ?? undefined;\n } catch {\n this.logDebug('Failed to resolve organization name', { organizationId });\n return undefined;\n }\n }\n\n /**\n * Resolve a direct resource URL for the entity that triggered the notification.\n * Builds the READ operation's frontend route and replaces `:param` placeholders\n * with actual IDs from the currentObject and executionContext.\n * Returns undefined for destructive operations (DELETE) or when resolution fails.\n */\n private resolveResourceUrl(\n operation: ResourceConfiguration_Operation<any, any, any>,\n currentObject: Record<string, unknown> | undefined,\n executionContext: ExecutionContext<any>,\n dashboardUrl: string | undefined\n ): string | undefined {\n if (!dashboardUrl || !currentObject) return undefined;\n\n const effectiveOperation = this.resolveEffectiveCoreOperation(\n operation.operationIdentifier,\n operation.resourceOperationLike,\n );\n if (shouldOmitResourceUrlForOperation(effectiveOperation)) {\n return undefined;\n }\n\n try {\n const resourceType = String(operation.resourceIdentifier);\n const routePaths = this.getReadRoutePaths(resourceType);\n if (!routePaths) return undefined;\n\n const resourceConfig = this.resourcesRegistry.tryGetResourceConfiguration(resourceType as any);\n\n const idSources: Record<string, unknown> = {\n ...(executionContext.initiatorIds ?? {}),\n ...(currentObject as Record<string, unknown>),\n };\n\n const entityId = (currentObject as any).id ?? (currentObject as any)._id;\n const selfFieldId = resourceConfig?.resourceFieldIdentifier;\n if (selfFieldId && entityId) {\n idSources[selfFieldId] = entityId;\n }\n\n const base = dashboardUrl.endsWith('/') ? dashboardUrl.slice(0, -1) : dashboardUrl;\n\n for (const { url: routeTemplate, parameters } of routePaths) {\n let resolved = routeTemplate;\n let allResolved = true;\n for (const param of parameters) {\n const value = idSources[param.fieldIdentifier];\n if (!value) { allResolved = false; break; }\n resolved = resolved.replace(`:${param.fieldIdentifier}`, String(value));\n }\n if (allResolved && !resolved.includes(':')) {\n return `${base}${resolved}`;\n }\n }\n\n return undefined;\n } catch {\n this.logDebug('Failed to resolve resource URL', {\n resourceIdentifier: String(operation.resourceIdentifier),\n });\n return undefined;\n }\n }\n\n /**\n * Get cached READ operation route paths for a resource type.\n * Computed once per resource type since configs are immutable after initialization.\n * Returns null (cached miss) when the resource has no routable READ operation.\n */\n private getReadRoutePaths(resourceType: string): CachedRoutePaths | null {\n if (this.readRoutePathsCache.has(resourceType)) {\n return this.readRoutePathsCache.get(resourceType)!;\n }\n\n const resourceConfig = this.resourcesRegistry.tryGetResourceConfiguration(resourceType as any);\n if (!resourceConfig) {\n this.readRoutePathsCache.set(resourceType, null);\n return null;\n }\n\n const readCandidates = resourceConfig.operations.filter(\n (op: ResourceConfiguration_Operation<any, any, any>) =>\n op.operationIdentifier === CoreResourceOperation.READ\n && op.isOperationDefault === true\n && !('isBulkOperation' in op && op.isBulkOperation === true)\n && (\n op.variantType === ResourceOperationVariantType.API_CALL\n || op.variantType === ResourceOperationVariantType.API_CALL_WITH_CALLBACK\n )\n );\n if (readCandidates.length > 1) {\n const candidateVariants = readCandidates.map((op) => ({\n variantType: op.variantType,\n variantKey: op.variantKey,\n }));\n this.logDebug('Ambiguous notification READ route candidates', {\n resourceType,\n candidateVariants,\n });\n throw this.errorBuilder.buildError(\n ErrorType.CONFIGURATION,\n undefined,\n {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_OPERATION_FAILED,\n context: {\n message: 'Notification deep-link routing requires exactly one default non-bulk URL-bearing READ operation',\n resourceType,\n candidateVariants,\n },\n },\n );\n }\n const readOp = readCandidates[0];\n if (!readOp) {\n this.readRoutePathsCache.set(resourceType, null);\n return null;\n }\n\n const allFieldIds = this.resourcesRegistry.getAllResourceFieldIdentifiers();\n const paths = ResourcesConfigOperationsUrlsBuilderUtils.buildOperationFrontendRoutePaths(\n resourceConfig, readOp as any, allFieldIds\n );\n\n const result = paths.length > 0 ? paths : null;\n this.readRoutePathsCache.set(resourceType, result);\n return result;\n }\n\n /**\n * Dispatch WebSocket-based user notification\n * Routes to appropriate rooms based on target\n */\n private async dispatchWebSocketUserNotification<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters,\n notification: UserNotificationDefinition\n ): Promise<void> {\n const operation = executionContext.operation;\n const target = notification.target;\n const operationPathKey = (() => {\n try {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n } catch (error) {\n this.logDebug('Unable to serialize resource notification operation path key', {\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n error: describeCaughtError(error),\n });\n return undefined;\n }\n })();\n\n // Build the notification payload\n const payload: WS_ResourceNotificationPayload = {\n resourceType: operation.resourceIdentifier,\n operationIdentifier: String(operation.operationIdentifier),\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation: 'isBulkOperation' in operation && operation.isBulkOperation === true,\n variantKey: operation.variantKey,\n action: this.mapOperationToAction(\n operation.operationIdentifier,\n operation.resourceOperationLike,\n ),\n // Pass configured notification level (if provided) - frontend will use this over action-based default\n // UserNotificationLevel and NotificationLevel are identical enums - cast through unknown\n notificationLevel: notification.level as unknown as NotificationLevel | undefined,\n affectedIds: this.extractAffectedIds(functionParameters.currentObject),\n contextResourceIdentifiers: this.convertContextResourceIdsToRecord(executionContext),\n notificationIdentifier: notification.identifier,\n initiatorUserId: executionContext.initiatorIds?.userId,\n timestamp: new Date(),\n };\n\n // Copy FRONT_END_SUCCESS-specific display hints into the WS payload.\n // The backend does NOT interpret these — it passes them through for the frontend.\n if (notification.channel === CoreUserNotificationChannel.FRONT_END_SUCCESS) {\n const feNotification = notification as z.infer<typeof UserNotificationDefinition_FrontEndSuccessSchema>;\n if (feNotification.celebration || feNotification.nextStep) {\n payload.frontendDisplayHints = {\n celebration: feNotification.celebration,\n nextStep: feNotification.nextStep,\n };\n }\n }\n\n const message: WebSocketMessage = {\n type: CoreWebSocketEvent.RESOURCE_NOTIFICATION,\n payload,\n timestamp: new Date(),\n userId: executionContext.initiatorIds?.userId,\n organizationId: executionContext.initiatorIds?.organizationId,\n };\n\n // Route based on target\n switch (target) {\n case CoreUserNotificationTarget.USER_SELF:\n if (executionContext.initiatorIds?.userId) {\n await this.webSocketService.sendToUser(executionContext.initiatorIds.userId, message);\n }\n break;\n\n case CoreUserNotificationTarget.ORGANIZATION:\n case CoreUserNotificationTarget.ORGANIZATION_USERS:\n if (executionContext.initiatorIds?.organizationId) {\n await this.webSocketService.sendToOrganization(\n executionContext.initiatorIds.organizationId,\n message,\n // Optionally exclude the initiator\n executionContext.initiatorIds?.userId ? [executionContext.initiatorIds.userId] : undefined\n );\n }\n break;\n\n case CoreUserNotificationTarget.ORGANIZATION_BILLING:\n case CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE:\n case CoreUserNotificationTarget.ORGANIZATION_SECURITY:\n // Send to specific role rooms within the organization\n if (executionContext.initiatorIds?.organizationId && notification.userRoles) {\n for (const role of notification.userRoles) {\n await this.webSocketService.sendToRole(\n executionContext.initiatorIds.organizationId,\n role,\n message\n );\n }\n }\n break;\n\n case CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR:\n case CoreUserNotificationTarget.APPLICATION_BILLING:\n case CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.APPLICATION_SECURITY:\n case CoreUserNotificationTarget.APPLICATION_SUPPORT:\n case CoreUserNotificationTarget.APPLICATION_OTHER:\n case CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER:\n // Application-level notifications go to admin dashboard users\n // Map target to app-level role name for WebSocket room targeting\n const appRoles = this.mapApplicationTargetToRoles(target, notification);\n for (const appRole of appRoles) {\n await this.webSocketService.sendToAppRole(appRole, message);\n }\n this.logDebug('Application-level notification sent', {\n target,\n identifier: notification.identifier,\n roles: appRoles,\n });\n break;\n\n case CoreUserNotificationTarget.USERS_CUSTOM:\n // Custom user targeting via userIdsSelector\n if (notification.userIdsSelector) {\n // Ensure objectContext has the expected structure (parents/children)\n const objectContext = functionParameters.objectContext || {};\n const normalizedObjectContext = {\n parents: (objectContext as any)?.parents || {},\n children: (objectContext as any)?.children || {}\n };\n\n const userIds = notification.userIdsSelector({\n currentObject: functionParameters.currentObject,\n inputDto: functionParameters.inputDto,\n objectContext: normalizedObjectContext,\n initiatorIds: functionParameters.initiatorIds\n });\n\n // For WebSocket, we only need userIds (no need to fetch userContext)\n for (const userId of userIds) {\n await this.webSocketService.sendToUser(userId, message);\n }\n }\n break;\n\n case CoreUserNotificationTarget.INBOUND_CONTACT:\n // Inbound contact notifications (e.g., contact form submissions)\n // Route to support and admin roles by default\n const inboundContactRoles = notification.userRoles?.length\n ? notification.userRoles\n : [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n for (const role of inboundContactRoles) {\n await this.webSocketService.sendToAppRole(role, message);\n }\n this.logDebug('Inbound contact notification sent', {\n identifier: notification.identifier,\n roles: inboundContactRoles,\n });\n break;\n\n default:\n this.logDebug('Unknown notification target', {\n target,\n identifier: notification.identifier,\n });\n }\n }\n\n /**\n * Dispatch M2M notifications (webhooks)\n *\n * @param executionContext - The execution context\n * @param functionParameters - Function parameters with data context\n * @private\n */\n private async dispatchM2MNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters\n ): Promise<void> {\n const operation = executionContext.operation;\n const m2mNotifications = operation.m2mNotifications || [];\n\n if (m2mNotifications.length === 0) {\n return;\n }\n\n for (const m2mNotification of m2mNotifications) {\n const channel = m2mNotification.channel as CoreM2MNotificationChannel | string;\n\n if (\n channel === CoreM2MNotificationChannel.WEBHOOK_ORGANIZATION\n || channel === CoreM2MNotificationChannel.WEBHOOK_APPLICATION\n ) {\n // Delegate to the dispatcher; it owns scope resolution, feature\n // gating, config loading, payload serialization, log creation\n // and queue enqueue. Failures inside `enqueueDelivery` are logged\n // here and never bubble back to the caller — webhook delivery\n // is best-effort and must not block the primary operation.\n try {\n await this.m2mWebhookDispatcher.enqueueDelivery(\n operation as ResourceConfiguration_Operation<any, any, any>,\n m2mNotification as M2MNotificationDefinition,\n executionContext as ExecutionContext<ResourceConfiguration_Operation<any, any, any>>,\n functionParameters,\n );\n } catch (error) {\n this.logger.error('Failed to dispatch M2M webhook delivery', {\n channel,\n resourceIdentifier: String(operation.resourceIdentifier),\n operationIdentifier: String(operation.operationIdentifier),\n ...projectCaughtErrorLogFields(error),\n });\n }\n continue;\n }\n\n throw new Error(`M2M notification channel '${channel}' is not implemented.`);\n }\n }\n\n /**\n * Dispatch resource-room notifications (path-independent collaboration).\n *\n * This stays separately callable because some post-write orchestration paths\n * only have authoritative object truth and initiator ids, not the full\n * computation context required for authored notification delivery.\n */\n async dispatchResourceRoomNotifications<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n functionParameters: ResourceConfiguration_OperationVariant_CustomImplementation_FunctionParameters\n ): Promise<void> {\n const operation = executionContext.operation;\n const resourceType = operation.resourceIdentifier;\n const currentObject = functionParameters.currentObject;\n\n // Only dispatch for write operations\n const operationIdentifier = operation.operationIdentifier;\n if (!this.isWriteOperation(operationIdentifier, operation.resourceOperationLike)) {\n return;\n }\n\n const affectedIds = this.extractAffectedIds(currentObject);\n if (affectedIds.length === 0) {\n return;\n }\n\n const action = this.mapOperationToAction(\n operationIdentifier,\n operation.resourceOperationLike,\n );\n const contextResourceIdentifiers = this.convertContextResourceIdsToRecord(executionContext);\n const initiatorUserId = executionContext.initiatorIds?.userId;\n\n const timestamp = new Date();\n const operationIdentifierString = String(operationIdentifier);\n const operationPathKey = (() => {\n try {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n } catch (error) {\n this.logDebug('Unable to serialize resource-room operation path key', {\n resourceType,\n operationIdentifier: operationIdentifierString,\n variantType: operation.variantType,\n variantKey: operation.variantKey,\n error: describeCaughtError(error),\n });\n return undefined;\n }\n })();\n const isBulkOperation = 'isBulkOperation' in operation && operation.isBulkOperation === true;\n const scopePayload = buildScopeRoomNotificationPayload({\n resourceType,\n resourceId: affectedIds[0],\n contextResourceIdentifiers,\n action,\n affectedIds,\n operationIdentifier: operationIdentifierString,\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation,\n variantKey: operation.variantKey,\n initiatorUserId,\n currentObject,\n timestamp,\n });\n\n // Emit to individual resource rooms\n for (const resourceId of affectedIds) {\n const resourcePayload = buildResourceRoomSyncPayload({\n resourceType,\n resourceId,\n contextResourceIdentifiers,\n action,\n affectedIds,\n operationIdentifier: operationIdentifierString,\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation,\n variantKey: operation.variantKey,\n initiatorUserId,\n currentObject,\n timestamp,\n });\n\n const resourceNotificationFallback = buildResourceRoomStaleHintPayload({\n resourceType,\n resourceId,\n contextResourceIdentifiers,\n action,\n affectedIds,\n operationIdentifier: operationIdentifierString,\n operationPathKey,\n variantType: operation.variantType,\n isOperationDefault: operation.isOperationDefault,\n isBulkOperation,\n variantKey: operation.variantKey,\n initiatorUserId,\n timestamp,\n });\n\n // Resource rooms get the strongest contract first: try authoritative sync\n // replay for that exact id, and degrade to a notification-grade stale hint\n // only when the backend cannot prove replay truth or the websocket layer\n // rejects the replay payload during canonical validation.\n if (!resourcePayload) {\n this.logDebug('Skipped resource-room sync payload due to missing authoritative replay data', {\n resourceType,\n resourceId,\n action,\n affectedCount: affectedIds.length,\n });\n this.webSocketService.emitToResourceRoom(\n resourceType,\n resourceId,\n CoreWebSocketEvent.RESOURCE_UPDATED,\n resourceNotificationFallback,\n );\n continue;\n }\n\n const event = action === ResourceAction.DELETED\n ? CoreWebSocketEvent.RESOURCE_DELETED\n : CoreWebSocketEvent.RESOURCE_UPDATED;\n\n const emitted = this.webSocketService.emitToResourceRoom(resourceType, resourceId, event, resourcePayload);\n if (!emitted) {\n this.logDebug('Skipped resource-room sync emit after canonical replay validation failure', {\n resourceType,\n resourceId,\n action,\n affectedCount: affectedIds.length,\n });\n this.webSocketService.emitToResourceRoom(\n resourceType,\n resourceId,\n CoreWebSocketEvent.RESOURCE_UPDATED,\n resourceNotificationFallback,\n );\n }\n }\n\n // Scope rooms are emitted separately from per-resource rooms because they\n // serve list/cache refresh semantics rather than authoritative per-resource\n // replay semantics.\n const scopes = this.extractScopesFromContext(contextResourceIdentifiers, operation.resourcePrimaryScope);\n if (scopes.length > 0) {\n this.webSocketService.emitToScopeRooms(\n resourceType,\n scopes,\n CoreWebSocketEvent.RESOURCE_UPDATED,\n scopePayload,\n );\n }\n\n this.logDebug('Resource room notifications dispatched', {\n resourceType,\n action,\n affectedCount: affectedIds.length,\n scopeCount: scopes.length,\n });\n }\n\n // ================================\n // Helper Methods\n // ================================\n\n /**\n * Map APPLICATION_* notification targets to app-level role names for WebSocket targeting.\n *\n * These roles correspond to the `app:role:${role}` rooms that users join when they have\n * application-level permissions (e.g., super admins, support staff).\n *\n * @param target - The CoreUserNotificationTarget\n * @param notification - The notification definition (may contain userRoles override)\n * @returns Array of role names to target\n */\n private mapApplicationTargetToRoles(\n target: CoreUserNotificationTarget,\n notification: UserNotificationDefinition\n ): string[] {\n // If userRoles is explicitly provided, use those\n if (notification.userRoles && notification.userRoles.length > 0) {\n return notification.userRoles;\n }\n\n // Map target to default app-level roles using CORE_APP_ROLES enum\n // These should match the roles that users with app-level permissions have\n switch (target) {\n case CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_BILLING:\n return [CORE_APP_ROLES.APP_ADMIN_BILLING_MANAGER, CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_SECURITY:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_SUPPORT:\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER:\n return [CORE_APP_ROLES.APP_ADMIN_VIEWER, CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n\n case CoreUserNotificationTarget.APPLICATION_OTHER:\n default:\n // Default to admin roles for generic application notifications\n return [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN];\n }\n }\n\n private mapOrganizationTargetToRoles(\n target: CoreUserNotificationTarget,\n notification: UserNotificationDefinition,\n ): string[] {\n /*\n * The override is consulted ONLY for a target that reads it (#495).\n *\n * This short-circuit used to run FIRST, before the switch — so `userRoles` on `ORGANIZATION` or\n * `ORGANIZATION_USERS` narrowed the recipients resolved here, while the websocket branch for those\n * same two targets calls `sendToOrganization` and never reads it. One declaration, two behaviours,\n * decided by which channel the notification happened to use, with no diagnostic either way.\n *\n * Those two targets mean EVERYONE in the tenant by definition, so the empty list below is the\n * answer on both channels and the override has no business changing it. `userNotificationTargetReadsUserRoles`\n * is the same predicate the schema refuses on, so a declaration that reaches here can only be one\n * the vocabulary admits.\n */\n switch (target) {\n case CoreUserNotificationTarget.ORGANIZATION_BILLING:\n case CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT:\n case CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE:\n case CoreUserNotificationTarget.ORGANIZATION_SECURITY:\n return notification.userRoles && notification.userRoles.length > 0\n ? notification.userRoles\n : [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN];\n case CoreUserNotificationTarget.ORGANIZATION:\n case CoreUserNotificationTarget.ORGANIZATION_USERS:\n default:\n return [];\n }\n }\n\n /**\n * Map operation identifier to action type\n */\n private mapOperationToAction(\n operationIdentifier: any,\n resourceOperationLike?: CoreResourceOperation,\n ): ResourceAction {\n const effectiveOperation = this.resolveEffectiveCoreOperation(operationIdentifier, resourceOperationLike);\n\n switch (effectiveOperation) {\n case CoreResourceOperation.CREATE:\n case CoreResourceOperation.CREATE_MANY:\n return ResourceAction.CREATED;\n case CoreResourceOperation.DELETE:\n case CoreResourceOperation.DELETE_MANY:\n return ResourceAction.DELETED;\n case CoreResourceOperation.UPDATE:\n case CoreResourceOperation.UPDATE_MANY:\n default:\n return ResourceAction.UPDATED;\n }\n }\n\n /**\n * Check if operation is a write operation (CREATE, UPDATE, DELETE)\n */\n private isWriteOperation(\n operationIdentifier: any,\n resourceOperationLike?: CoreResourceOperation,\n ): boolean {\n const effectiveOperation = this.resolveEffectiveCoreOperation(operationIdentifier, resourceOperationLike);\n return (\n effectiveOperation === CoreResourceOperation.CREATE ||\n effectiveOperation === CoreResourceOperation.CREATE_MANY ||\n effectiveOperation === CoreResourceOperation.UPDATE ||\n effectiveOperation === CoreResourceOperation.UPDATE_MANY ||\n effectiveOperation === CoreResourceOperation.DELETE ||\n effectiveOperation === CoreResourceOperation.DELETE_MANY\n );\n }\n\n private resolveEffectiveCoreOperation(\n operationIdentifier: any,\n resourceOperationLike?: CoreResourceOperation,\n ): CoreResourceOperation | undefined {\n if (resourceOperationLike) {\n return resourceOperationLike;\n }\n\n const candidate = String(operationIdentifier) as CoreResourceOperation;\n return Object.values(CoreResourceOperation).includes(candidate)\n ? candidate\n : undefined;\n }\n\n /**\n * Extract affected IDs from the current object (result)\n */\n private extractAffectedIds(currentObject: any): string[] {\n if (!currentObject) {\n return [];\n }\n\n // Handle a BARE ID STRING (single DELETE). A single `delete` returns the deleted `_id` as a plain\n // string (services-registry-handler `delete(): Promise<string | string[]>`), so `currentObject` is\n // that string — NOT `{ _id }`. Without this branch the id fell through to `return []` and the whole\n // resource-room broadcast early-returned, so a single delete emitted NEITHER `resource:deleted`\n // (resource room) NOR `resource:updated` action=deleted (scope room). DELETE_MANY already worked via\n // the array branch below (bare-string items). The not-found case returns `''`, excluded by the\n // `!currentObject`/length guard. Placed FIRST because a string has no `_id`/`id` for the object branch.\n if (typeof currentObject === 'string') {\n return currentObject.length > 0 ? [currentObject] : [];\n }\n\n // Handle array of objects (bulk operations)\n if (Array.isArray(currentObject)) {\n return currentObject\n .flatMap((item) => {\n if (typeof item === 'string' && item.length > 0) {\n return [item];\n }\n\n if (item && (item._id || item.id)) {\n return [String(item._id || item.id)];\n }\n\n return [];\n });\n }\n\n // Handle single object\n if (currentObject._id || currentObject.id) {\n return [String(currentObject._id || currentObject.id)];\n }\n\n // Handle delete responses\n if (currentObject.deletedIds) {\n return currentObject.deletedIds.map((id: any) => String(id));\n }\n if (currentObject.deletedId) {\n return [String(currentObject.deletedId)];\n }\n\n // Handle update responses\n if (currentObject.updatedIds) {\n return currentObject.updatedIds.map((id: any) => String(id));\n }\n\n return [];\n }\n\n /**\n * Convert ExecutionContext context resource IDs Map to Record<string, string>\n * Handles string, string[], and undefined values appropriately\n */\n private convertContextResourceIdsToRecord<\n TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>\n >(\n executionContext: ExecutionContext<TResourceConfigOperation>\n ): Record<string, string> {\n const contextResourceIds = executionContext.getContextResourceIds();\n const result: Record<string, string> = {};\n\n for (const [key, value] of contextResourceIds.entries()) {\n if (value === undefined) {\n continue;\n }\n\n // Handle string or string[] - for arrays, take first element (same as getContextResourceId)\n const stringValue = Array.isArray(value) ? value[0] : value;\n if (stringValue !== undefined) {\n result[key] = stringValue;\n }\n }\n\n return result;\n }\n\n /**\n * Extract scopes from context resource identifiers for scope room notifications\n */\n /**\n * Which scope rooms this mutation's rows belong to.\n *\n * Delegates to `deriveResourceScopeRoomQualifiers` in `@wildo-ai/saas-models`, which is where the\n * rule now lives so that a CLIENT caching a read can subscribe to exactly the rooms this emits\n * into. Two copies of this rule would agree only until one side gained a case, and the failure\n * would be silent — a client subscribed to the wrong room does not error, it simply never hears\n * that its cache is stale.\n */\n private extractScopesFromContext(\n contextResourceIdentifiers: Record<string, string>,\n primaryScope: ResourcePrimaryScope\n ): Array<{ scopeKey: string; scopeId: string }> {\n return deriveResourceScopeRoomQualifiers(contextResourceIdentifiers, primaryScope) as Array<{\n scopeKey: string;\n scopeId: string;\n }>;\n }\n}\n"]}