@wildo-ai/saas-backend-lib 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (853) hide show
  1. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.d.ts.map +1 -1
  2. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js +19 -1
  3. package/dist/esm/applications/services/worker-remote-client-factory.backend.service.js.map +1 -1
  4. package/dist/esm/base-classes/models/manual-controllers.backend.definition.d.ts.map +1 -1
  5. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js +4 -0
  6. package/dist/esm/base-classes/models/manual-controllers.backend.definition.js.map +1 -1
  7. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts +35 -0
  8. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.d.ts.map +1 -0
  9. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js +111 -0
  10. package/dist/esm/base-classes/services/batches/child-lifecycle-teardown.batch.backend.service.js.map +1 -0
  11. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts +50 -0
  12. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.d.ts.map +1 -0
  13. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js +199 -0
  14. package/dist/esm/base-classes/services/batches/credential-expiry-sweep.batch.backend.service.js.map +1 -0
  15. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts +111 -0
  16. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.d.ts.map +1 -1
  17. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js +140 -0
  18. package/dist/esm/base-classes/services/batches/engine-custom-batch-manifests.js.map +1 -1
  19. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.d.ts.map +1 -1
  20. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js +27 -6
  21. package/dist/esm/base-classes/services/controllers/controller-resource.backend.service.js.map +1 -1
  22. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts +124 -13
  23. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.d.ts.map +1 -1
  24. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js +207 -21
  25. package/dist/esm/base-classes/services/repositories/http-api/http-api-provider-access.backend.js.map +1 -1
  26. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts +60 -8
  27. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.d.ts.map +1 -1
  28. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js +174 -26
  29. package/dist/esm/base-classes/services/repositories/http-api/http-api-read-client.backend.js.map +1 -1
  30. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts +47 -4
  31. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.d.ts.map +1 -1
  32. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js +96 -29
  33. package/dist/esm/base-classes/services/repositories/http-api/http-api-resource-repository.backend.service.js.map +1 -1
  34. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts +55 -0
  35. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.d.ts.map +1 -0
  36. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js +114 -0
  37. package/dist/esm/base-classes/services/repositories/http-api/http-api-rest-operation-reference.backend.js.map +1 -0
  38. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts +89 -14
  39. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.d.ts.map +1 -1
  40. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js +84 -11
  41. package/dist/esm/base-classes/services/repositories/http-api/http-api-transport.backend.js.map +1 -1
  42. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.d.ts.map +1 -1
  43. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js +9 -1
  44. package/dist/esm/base-classes/services/repositories/infrastructure-tier-contract.backend.js.map +1 -1
  45. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts +49 -0
  46. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.d.ts.map +1 -1
  47. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js +171 -18
  48. package/dist/esm/base-classes/services/repositories/postgresql-resource-repository.backend.service.js.map +1 -1
  49. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.d.ts.map +1 -1
  50. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js +23 -3
  51. package/dist/esm/base-classes/services/repositories/repositories-registry-handler.backend.service.js.map +1 -1
  52. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.d.ts.map +1 -1
  53. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js +20 -0
  54. package/dist/esm/base-classes/services/repositories/repository-resource.backend.service.js.map +1 -1
  55. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts +22 -0
  56. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.d.ts.map +1 -1
  57. package/dist/esm/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.js.map +1 -1
  58. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.d.ts.map +1 -1
  59. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js +4 -1
  60. package/dist/esm/base-classes/services/services/resource-status-transition.custom-impl.backend.service.js.map +1 -1
  61. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts +11 -0
  62. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.d.ts.map +1 -1
  63. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js +39 -5
  64. package/dist/esm/base-classes/services/services/resource-status-transition.definitions.backend.js.map +1 -1
  65. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts +181 -2
  66. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.d.ts.map +1 -1
  67. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js +529 -41
  68. package/dist/esm/base-classes/services/services/services-registry-handler.backend.service.js.map +1 -1
  69. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts +36 -3
  70. package/dist/esm/base-classes/services/services/system-access.backend.service.d.ts.map +1 -1
  71. package/dist/esm/base-classes/services/services/system-access.backend.service.js +70 -8
  72. package/dist/esm/base-classes/services/services/system-access.backend.service.js.map +1 -1
  73. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts +28 -0
  74. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.d.ts.map +1 -0
  75. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js +90 -0
  76. package/dist/esm/billing/batches/billing-reconciliation.batch.backend.service.js.map +1 -0
  77. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts +44 -0
  78. package/dist/esm/billing/batches/usage-flush.batch.backend.service.d.ts.map +1 -0
  79. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js +99 -0
  80. package/dist/esm/billing/batches/usage-flush.batch.backend.service.js.map +1 -0
  81. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts +91 -0
  82. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.d.ts.map +1 -0
  83. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js +152 -0
  84. package/dist/esm/billing/models/billing-provider-event-settlement.backend.schemas.js.map +1 -0
  85. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts +186 -0
  86. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.d.ts.map +1 -0
  87. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js +474 -0
  88. package/dist/esm/billing/services/back-office/billing-reconciliation.backend.service.js.map +1 -0
  89. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts +100 -0
  90. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.d.ts.map +1 -1
  91. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js +209 -6
  92. package/dist/esm/billing/services/back-office/product-catalog-sync.backend.service.js.map +1 -1
  93. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts +200 -4
  94. package/dist/esm/billing/services/back-office/usage-metering.backend.service.d.ts.map +1 -1
  95. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js +593 -64
  96. package/dist/esm/billing/services/back-office/usage-metering.backend.service.js.map +1 -1
  97. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts +36 -0
  98. package/dist/esm/billing/services/billing-adapter-registry.backend.d.ts.map +1 -0
  99. package/dist/esm/billing/services/billing-adapter-registry.backend.js +83 -0
  100. package/dist/esm/billing/services/billing-adapter-registry.backend.js.map +1 -0
  101. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts +9 -0
  102. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.d.ts.map +1 -1
  103. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js +11 -1
  104. package/dist/esm/billing/services/billing-checkout-metadata.backend.utils.js.map +1 -1
  105. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.d.ts.map +1 -1
  106. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js +48 -7
  107. package/dist/esm/billing/services/custom-impl/billing-account.mutations.custom-impl.backend.service.js.map +1 -1
  108. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts +38 -1
  109. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.d.ts.map +1 -1
  110. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js +67 -2
  111. package/dist/esm/billing/services/custom-impl/billing-custom-impl-utils.backend.js.map +1 -1
  112. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts +30 -1
  113. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.d.ts.map +1 -1
  114. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js +43 -1
  115. package/dist/esm/billing/services/custom-impl/billing-custom-implementations.backend.js.map +1 -1
  116. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts +11 -3
  117. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.d.ts.map +1 -1
  118. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js +30 -16
  119. package/dist/esm/billing/services/custom-impl/promotion.custom-ops.custom-impl.backend.service.js.map +1 -1
  120. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.d.ts.map +1 -1
  121. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js +104 -25
  122. package/dist/esm/billing/services/custom-impl/subscription.mutations.custom-impl.backend.service.js.map +1 -1
  123. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts +18 -1
  124. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.d.ts.map +1 -1
  125. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js +106 -2
  126. package/dist/esm/billing/services/stripe-standard-billing-provider.backend.service.js.map +1 -1
  127. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts +52 -0
  128. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.d.ts.map +1 -0
  129. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js +74 -0
  130. package/dist/esm/billing/services/webhooks/__tests__/settlement-ledger.test-double.js.map +1 -0
  131. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts +104 -11
  132. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.d.ts.map +1 -1
  133. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js +260 -26
  134. package/dist/esm/billing/services/webhooks/billing-webhook-event-router.backend.service.js.map +1 -1
  135. package/dist/esm/billing/testing/mock-billing-provider.d.ts +30 -1
  136. package/dist/esm/billing/testing/mock-billing-provider.d.ts.map +1 -1
  137. package/dist/esm/billing/testing/mock-billing-provider.js +25 -0
  138. package/dist/esm/billing/testing/mock-billing-provider.js.map +1 -1
  139. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js +11 -4
  140. package/dist/esm/compliance/audit-trails/batches/audit-logs-archive.batch.backend.service.js.map +1 -1
  141. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts +225 -13
  142. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.d.ts.map +1 -1
  143. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js +340 -62
  144. package/dist/esm/compliance/audit-trails/services/audit-event-dispatcher.backend.service.js.map +1 -1
  145. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts +244 -7
  146. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.d.ts.map +1 -1
  147. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js +386 -5
  148. package/dist/esm/compliance/audit-trails/services/audit-logs.backend.service.js.map +1 -1
  149. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.d.ts.map +1 -1
  150. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js +7 -1
  151. package/dist/esm/compliance/audit-trails/services/composite-audit-log-sink.backend.js.map +1 -1
  152. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts +6 -2
  153. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.d.ts.map +1 -1
  154. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js +31 -9
  155. package/dist/esm/compliance/audit-trails/services/siem-export-config-cache-invalidation.custom-impl.backend.service.js.map +1 -1
  156. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts +42 -0
  157. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.d.ts.map +1 -1
  158. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js +57 -1
  159. package/dist/esm/compliance/audit-trails/services/siem-webhook-delivery.backend.service.js.map +1 -1
  160. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts +110 -0
  161. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.d.ts.map +1 -0
  162. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js +192 -0
  163. package/dist/esm/compliance/audit-trails/services/utils/leased-value-cache.backend.utils.js.map +1 -0
  164. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.d.ts.map +1 -1
  165. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js +31 -0
  166. package/dist/esm/compliance/audit-trails/services/utils/ocsf-activity-mapping.backend.utils.js.map +1 -1
  167. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts +5 -0
  168. package/dist/esm/config/bootstrap/application-runtime-profile.backend.d.ts.map +1 -1
  169. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js +6 -0
  170. package/dist/esm/config/bootstrap/application-runtime-profile.backend.js.map +1 -1
  171. package/dist/esm/config/models/app-config.backend.schemas.d.ts +142 -46
  172. package/dist/esm/config/models/app-config.backend.schemas.d.ts.map +1 -1
  173. package/dist/esm/config/models/app-config.backend.schemas.js +121 -12
  174. package/dist/esm/config/models/app-config.backend.schemas.js.map +1 -1
  175. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts +38 -15
  176. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.d.ts.map +1 -1
  177. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js +17 -2
  178. package/dist/esm/config/models/provider-runtime-artifact.backend.schemas.js.map +1 -1
  179. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts +0 -1
  180. package/dist/esm/config/services/app-configuration-loader.backend.service.d.ts.map +1 -1
  181. package/dist/esm/config/services/app-configuration-loader.backend.service.js +68 -76
  182. package/dist/esm/config/services/app-configuration-loader.backend.service.js.map +1 -1
  183. package/dist/esm/config/services/app-configuration.backend.service.d.ts.map +1 -1
  184. package/dist/esm/config/services/app-configuration.backend.service.js +23 -1
  185. package/dist/esm/config/services/app-configuration.backend.service.js.map +1 -1
  186. package/dist/esm/config/services/app-configuration.backend.utils.d.ts +33 -0
  187. package/dist/esm/config/services/app-configuration.backend.utils.d.ts.map +1 -1
  188. package/dist/esm/config/services/app-configuration.backend.utils.js +39 -1
  189. package/dist/esm/config/services/app-configuration.backend.utils.js.map +1 -1
  190. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts +25 -0
  191. package/dist/esm/config/services/application-startup-config-validator.backend.service.d.ts.map +1 -1
  192. package/dist/esm/config/services/application-startup-config-validator.backend.service.js +41 -1
  193. package/dist/esm/config/services/application-startup-config-validator.backend.service.js.map +1 -1
  194. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.d.ts.map +1 -1
  195. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js +48 -0
  196. package/dist/esm/databases/services/postgresql-schema-plan-diff.backend.js.map +1 -1
  197. package/dist/esm/errors/services/error-builder.backend.service.d.ts +13 -1
  198. package/dist/esm/errors/services/error-builder.backend.service.d.ts.map +1 -1
  199. package/dist/esm/errors/services/error-builder.backend.service.js +13 -1
  200. package/dist/esm/errors/services/error-builder.backend.service.js.map +1 -1
  201. package/dist/esm/errors/services/error-handler.backend.service.d.ts +70 -7
  202. package/dist/esm/errors/services/error-handler.backend.service.d.ts.map +1 -1
  203. package/dist/esm/errors/services/error-handler.backend.service.js +129 -8
  204. package/dist/esm/errors/services/error-handler.backend.service.js.map +1 -1
  205. package/dist/esm/errors/services/rate-limit.backend.service.d.ts +66 -0
  206. package/dist/esm/errors/services/rate-limit.backend.service.d.ts.map +1 -1
  207. package/dist/esm/errors/services/rate-limit.backend.service.js +102 -25
  208. package/dist/esm/errors/services/rate-limit.backend.service.js.map +1 -1
  209. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts +5 -0
  210. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.d.ts.map +1 -1
  211. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js +25 -0
  212. package/dist/esm/errors/utils/error-log-level-classification.backend.utils.js.map +1 -1
  213. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts +33 -0
  214. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.d.ts.map +1 -1
  215. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js +40 -0
  216. package/dist/esm/errors/utils/rate-limit-environment-relaxation.backend.utils.js.map +1 -1
  217. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts +59 -2
  218. package/dist/esm/external-data/external-data-pipeline-run.backend.service.d.ts.map +1 -1
  219. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js +52 -17
  220. package/dist/esm/external-data/external-data-pipeline-run.backend.service.js.map +1 -1
  221. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts +4 -2
  222. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.d.ts.map +1 -1
  223. package/dist/esm/external-providers/models/provider-selection-resolution-evidence.backend.definitions.js.map +1 -1
  224. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts +256 -0
  225. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.d.ts.map +1 -0
  226. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js +333 -0
  227. package/dist/esm/external-providers/operations/provider-operation-executor.backend.service.js.map +1 -0
  228. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts +56 -0
  229. package/dist/esm/external-providers/operations/provider-operation-request.backend.d.ts.map +1 -0
  230. package/dist/esm/external-providers/operations/provider-operation-request.backend.js +211 -0
  231. package/dist/esm/external-providers/operations/provider-operation-request.backend.js.map +1 -0
  232. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts +45 -0
  233. package/dist/esm/external-providers/operations/provider-request-signing.backend.d.ts.map +1 -0
  234. package/dist/esm/external-providers/operations/provider-request-signing.backend.js +216 -0
  235. package/dist/esm/external-providers/operations/provider-request-signing.backend.js.map +1 -0
  236. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts +56 -0
  237. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.d.ts.map +1 -0
  238. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js +78 -0
  239. package/dist/esm/external-providers/operations/provider-rest-call-client.backend.js.map +1 -0
  240. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts +1 -1
  241. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.d.ts.map +1 -1
  242. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js +2 -2
  243. package/dist/esm/external-providers/services/__tests__/mock-external-providers-registry.service.js.map +1 -1
  244. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts +89 -0
  245. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.d.ts.map +1 -0
  246. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js +164 -0
  247. package/dist/esm/external-providers/services/backend-provider-loader.backend.service.js.map +1 -0
  248. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts +26 -27
  249. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.d.ts.map +1 -1
  250. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js +50 -64
  251. package/dist/esm/external-providers/services/backend-provider-registry.backend.service.js.map +1 -1
  252. package/dist/esm/external-providers/services/document-extraction.backend.service.d.ts.map +1 -1
  253. package/dist/esm/external-providers/services/document-extraction.backend.service.js +3 -3
  254. package/dist/esm/external-providers/services/document-extraction.backend.service.js.map +1 -1
  255. package/dist/esm/external-providers/services/embeddings.backend.service.d.ts.map +1 -1
  256. package/dist/esm/external-providers/services/embeddings.backend.service.js +4 -4
  257. package/dist/esm/external-providers/services/embeddings.backend.service.js.map +1 -1
  258. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts +292 -7
  259. package/dist/esm/external-providers/services/external-providers-registry.backend.service.d.ts.map +1 -1
  260. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js +533 -45
  261. package/dist/esm/external-providers/services/external-providers-registry.backend.service.js.map +1 -1
  262. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.d.ts.map +1 -1
  263. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js +25 -2
  264. package/dist/esm/external-providers/services/frontend-bootstrap.backend.service.js.map +1 -1
  265. package/dist/esm/files/controllers/file.controller.d.ts.map +1 -1
  266. package/dist/esm/files/controllers/file.controller.js +21 -13
  267. package/dist/esm/files/controllers/file.controller.js.map +1 -1
  268. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.d.ts.map +1 -1
  269. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js +39 -15
  270. package/dist/esm/files/handlers/resource-file-upload-handler.backend.service.js.map +1 -1
  271. package/dist/esm/files/services/file-scanning.backend.service.d.ts +94 -9
  272. package/dist/esm/files/services/file-scanning.backend.service.d.ts.map +1 -1
  273. package/dist/esm/files/services/file-scanning.backend.service.js +197 -17
  274. package/dist/esm/files/services/file-scanning.backend.service.js.map +1 -1
  275. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts +60 -1
  276. package/dist/esm/files/services/file-text-extraction.backend.service.d.ts.map +1 -1
  277. package/dist/esm/files/services/file-text-extraction.backend.service.js +167 -8
  278. package/dist/esm/files/services/file-text-extraction.backend.service.js.map +1 -1
  279. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts +53 -2
  280. package/dist/esm/files/services/file-upload-grant.backend.service.d.ts.map +1 -1
  281. package/dist/esm/files/services/file-upload-grant.backend.service.js +127 -3
  282. package/dist/esm/files/services/file-upload-grant.backend.service.js.map +1 -1
  283. package/dist/esm/files/services/files.backend.service.d.ts +68 -0
  284. package/dist/esm/files/services/files.backend.service.d.ts.map +1 -1
  285. package/dist/esm/files/services/files.backend.service.js +175 -5
  286. package/dist/esm/files/services/files.backend.service.js.map +1 -1
  287. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts +109 -0
  288. package/dist/esm/files/storage/application-storage-key.backend.utils.d.ts.map +1 -0
  289. package/dist/esm/files/storage/application-storage-key.backend.utils.js +123 -0
  290. package/dist/esm/files/storage/application-storage-key.backend.utils.js.map +1 -0
  291. package/dist/esm/files/storage/file-storage-provider.types.d.ts +16 -10
  292. package/dist/esm/files/storage/file-storage-provider.types.d.ts.map +1 -1
  293. package/dist/esm/files/storage/file-storage-provider.types.js.map +1 -1
  294. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts +67 -8
  295. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.d.ts.map +1 -1
  296. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js +101 -28
  297. package/dist/esm/files/storage/local-directory-storage-provider.backend.service.js.map +1 -1
  298. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.d.ts.map +1 -1
  299. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js +8 -55
  300. package/dist/esm/files/storage/wildo-managed-storage-provider.backend.service.js.map +1 -1
  301. package/dist/esm/files/utils/file-field-schema-path.backend.utils.d.ts.map +1 -1
  302. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js +20 -0
  303. package/dist/esm/files/utils/file-field-schema-path.backend.utils.js.map +1 -1
  304. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts +86 -0
  305. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.d.ts.map +1 -0
  306. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js +288 -0
  307. package/dist/esm/files/utils/office-document-text-extraction.backend.utils.js.map +1 -0
  308. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts +15 -0
  309. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.d.ts.map +1 -1
  310. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js +76 -5
  311. package/dist/esm/flows-actors/a2a/batches/a2a-abandoned-task-sweep.batch.backend.service.js.map +1 -1
  312. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.d.ts.map +1 -1
  313. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js +6 -1
  314. package/dist/esm/flows-actors/a2a/controllers/a2a.controller.js.map +1 -1
  315. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts +60 -0
  316. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.d.ts.map +1 -1
  317. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js +63 -0
  318. package/dist/esm/flows-actors/a2a/models/a2a.backend.schemas.js.map +1 -1
  319. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts +74 -0
  320. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.d.ts.map +1 -1
  321. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js +196 -40
  322. package/dist/esm/flows-actors/a2a/services/a2a-task-cancellation.backend.service.js.map +1 -1
  323. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts +7 -1
  324. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.d.ts.map +1 -1
  325. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js +53 -1
  326. package/dist/esm/flows-actors/a2a/services/a2a-task.backend.service.js.map +1 -1
  327. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts +18 -0
  328. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.d.ts.map +1 -1
  329. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js +18 -0
  330. package/dist/esm/flows-actors/a2a/services/a2a-token-budget.backend.service.js.map +1 -1
  331. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts +12 -7
  332. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.d.ts.map +1 -1
  333. package/dist/esm/flows-actors/a2a/services/a2a.backend.service.js.map +1 -1
  334. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts +0 -13
  335. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.d.ts.map +1 -1
  336. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js +14 -22
  337. package/dist/esm/flows-actors/models/agent-catalogs.backend.definitions.js.map +1 -1
  338. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts +8 -3
  339. package/dist/esm/flows-actors/models/core-facets.backend.definitions.d.ts.map +1 -1
  340. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js +25 -15
  341. package/dist/esm/flows-actors/models/core-facets.backend.definitions.js.map +1 -1
  342. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts +13 -1
  343. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.d.ts.map +1 -1
  344. package/dist/esm/flows-actors/models/flows-actors.backend.schemas.js.map +1 -1
  345. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts +88 -8
  346. package/dist/esm/flows-actors/models/function-tools.backend.definitions.d.ts.map +1 -1
  347. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js +333 -31
  348. package/dist/esm/flows-actors/models/function-tools.backend.definitions.js.map +1 -1
  349. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.d.ts.map +1 -1
  350. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js +4 -2
  351. package/dist/esm/flows-actors/models/market-generation.actors-system.backend.definitions.js.map +1 -1
  352. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts +113 -0
  353. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.d.ts.map +1 -0
  354. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js +62 -0
  355. package/dist/esm/flows-actors/models/mcp-client.backend.definitions.js.map +1 -0
  356. package/dist/esm/flows-actors/services/actors-system.backend.service.d.ts.map +1 -1
  357. package/dist/esm/flows-actors/services/actors-system.backend.service.js +0 -2
  358. package/dist/esm/flows-actors/services/actors-system.backend.service.js.map +1 -1
  359. package/dist/esm/flows-actors/services/agents.backend.service.d.ts +28 -1
  360. package/dist/esm/flows-actors/services/agents.backend.service.d.ts.map +1 -1
  361. package/dist/esm/flows-actors/services/agents.backend.service.js +204 -18
  362. package/dist/esm/flows-actors/services/agents.backend.service.js.map +1 -1
  363. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts +5 -1
  364. package/dist/esm/flows-actors/services/conversational-execution.backend.service.d.ts.map +1 -1
  365. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js +79 -16
  366. package/dist/esm/flows-actors/services/conversational-execution.backend.service.js.map +1 -1
  367. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts +34 -5
  368. package/dist/esm/flows-actors/services/flows-actors-registry.service.d.ts.map +1 -1
  369. package/dist/esm/flows-actors/services/flows-actors-registry.service.js +154 -20
  370. package/dist/esm/flows-actors/services/flows-actors-registry.service.js.map +1 -1
  371. package/dist/esm/flows-actors/services/flows.backend.services.d.ts.map +1 -1
  372. package/dist/esm/flows-actors/services/flows.backend.services.js +27 -23
  373. package/dist/esm/flows-actors/services/flows.backend.services.js.map +1 -1
  374. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.d.ts.map +1 -1
  375. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js +7 -1
  376. package/dist/esm/flows-actors/services/llm-observability-agent-call-trace-sink.backend.js.map +1 -1
  377. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts +90 -0
  378. package/dist/esm/flows-actors/services/mcp-client.backend.service.d.ts.map +1 -0
  379. package/dist/esm/flows-actors/services/mcp-client.backend.service.js +368 -0
  380. package/dist/esm/flows-actors/services/mcp-client.backend.service.js.map +1 -0
  381. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts +9 -5
  382. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.d.ts.map +1 -1
  383. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js +12 -17
  384. package/dist/esm/flows-actors/services/prompt-compiler.backend.service.js.map +1 -1
  385. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.d.ts.map +1 -1
  386. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js +8 -4
  387. package/dist/esm/flows-actors/utils/acp-session-runner.backend.utils.js.map +1 -1
  388. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts +0 -207
  389. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.d.ts.map +1 -1
  390. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js +8 -243
  391. package/dist/esm/flows-actors/utils/meta-workflow-canonical-json.backend.utils.js.map +1 -1
  392. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.d.ts.map +1 -1
  393. package/dist/esm/flows-actors/utils/meta-workflow-structured-generation-plan.backend.utils.js.map +1 -1
  394. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts +9 -14
  395. package/dist/esm/guidance/services/milestone-evaluator.backend.service.d.ts.map +1 -1
  396. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js +18 -89
  397. package/dist/esm/guidance/services/milestone-evaluator.backend.service.js.map +1 -1
  398. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts +86 -0
  399. package/dist/esm/guidance/services/progression-state-store.backend.service.d.ts.map +1 -0
  400. package/dist/esm/guidance/services/progression-state-store.backend.service.js +155 -0
  401. package/dist/esm/guidance/services/progression-state-store.backend.service.js.map +1 -0
  402. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts +10 -0
  403. package/dist/esm/i18n/controllers/i18n-controller.backend.service.d.ts.map +1 -1
  404. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js +55 -5
  405. package/dist/esm/i18n/controllers/i18n-controller.backend.service.js.map +1 -1
  406. package/dist/esm/index.d.ts +11 -4
  407. package/dist/esm/index.d.ts.map +1 -1
  408. package/dist/esm/index.js +31 -4
  409. package/dist/esm/index.js.map +1 -1
  410. package/dist/esm/inject/models/container.d.ts.map +1 -1
  411. package/dist/esm/inject/models/container.js +78 -10
  412. package/dist/esm/inject/models/container.js.map +1 -1
  413. package/dist/esm/inject/models/service-types.d.ts +17 -3
  414. package/dist/esm/inject/models/service-types.d.ts.map +1 -1
  415. package/dist/esm/inject/models/service-types.js +19 -3
  416. package/dist/esm/inject/models/service-types.js.map +1 -1
  417. package/dist/esm/mcp/controllers/mcp.controller.d.ts.map +1 -1
  418. package/dist/esm/mcp/controllers/mcp.controller.js +20 -0
  419. package/dist/esm/mcp/controllers/mcp.controller.js.map +1 -1
  420. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts +56 -1
  421. package/dist/esm/mcp/services/mcp-server.backend.service.d.ts.map +1 -1
  422. package/dist/esm/mcp/services/mcp-server.backend.service.js +107 -11
  423. package/dist/esm/mcp/services/mcp-server.backend.service.js.map +1 -1
  424. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.d.ts.map +1 -1
  425. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js +22 -0
  426. package/dist/esm/mcp/services/mcp-tool-adapter.backend.service.js.map +1 -1
  427. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.d.ts.map +1 -1
  428. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js +49 -4
  429. package/dist/esm/monitoring/analytics/controllers/analytics.backend.controller.js.map +1 -1
  430. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts +66 -0
  431. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.d.ts.map +1 -0
  432. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js +199 -0
  433. package/dist/esm/monitoring/analytics/services/value-moment-definition-registry.backend.service.js.map +1 -0
  434. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts +149 -13
  435. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.d.ts.map +1 -1
  436. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js +411 -19
  437. package/dist/esm/monitoring/analytics/services/value-moment-engine.backend.service.js.map +1 -1
  438. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts +11 -2
  439. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.d.ts.map +1 -1
  440. package/dist/esm/monitoring/analytics/services/value-moment-handler-registry.backend.service.js.map +1 -1
  441. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts +28 -9
  442. package/dist/esm/monitoring/logger/models/logger.backend.schemas.d.ts.map +1 -1
  443. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js +30 -10
  444. package/dist/esm/monitoring/logger/models/logger.backend.schemas.js.map +1 -1
  445. package/dist/esm/monitoring/logger/services/logger.service.d.ts +12 -0
  446. package/dist/esm/monitoring/logger/services/logger.service.d.ts.map +1 -1
  447. package/dist/esm/monitoring/logger/services/logger.service.js +52 -11
  448. package/dist/esm/monitoring/logger/services/logger.service.js.map +1 -1
  449. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts +62 -0
  450. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.d.ts.map +1 -0
  451. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js +78 -0
  452. package/dist/esm/monitoring/logger/utils/log-severity-floor.backend.utils.js.map +1 -0
  453. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts +309 -0
  454. package/dist/esm/monitoring/observability/audit-observation-emission.backend.d.ts.map +1 -0
  455. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js +385 -0
  456. package/dist/esm/monitoring/observability/audit-observation-emission.backend.js.map +1 -0
  457. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts +1 -0
  458. package/dist/esm/monitoring/observability/models/observability.backend.schemas.d.ts.map +1 -1
  459. package/dist/esm/monitoring/observability/models/observability.backend.schemas.js.map +1 -1
  460. package/dist/esm/monitoring/observability/services/metrics.service.d.ts +21 -0
  461. package/dist/esm/monitoring/observability/services/metrics.service.d.ts.map +1 -1
  462. package/dist/esm/monitoring/observability/services/metrics.service.js +38 -0
  463. package/dist/esm/monitoring/observability/services/metrics.service.js.map +1 -1
  464. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts +0 -80
  465. package/dist/esm/notifications/email/models/email-context-provider.interface.d.ts.map +0 -1
  466. package/dist/esm/notifications/email/models/email-context-provider.interface.js +0 -25
  467. package/dist/esm/notifications/email/models/email-context-provider.interface.js.map +0 -1
  468. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts +0 -49
  469. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.d.ts.map +0 -1
  470. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js +0 -141
  471. package/dist/esm/notifications/email/services/email-context-provider-registry.backend.service.js.map +0 -1
  472. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts +0 -37
  473. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.d.ts.map +0 -1
  474. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js +0 -121
  475. package/dist/esm/notifications/email/services/email-template-compiler.backend.service.js.map +0 -1
  476. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts +66 -1
  477. package/dist/esm/notifications/email/services/email-template-registry.backend.service.d.ts.map +1 -1
  478. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js +105 -10
  479. package/dist/esm/notifications/email/services/email-template-registry.backend.service.js.map +1 -1
  480. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts +0 -58
  481. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.d.ts.map +0 -1
  482. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js +0 -223
  483. package/dist/esm/notifications/email/services/email-template-sandbox.backend.service.js.map +0 -1
  484. package/dist/esm/notifications/email/services/email-template-validator.backend.service.d.ts.map +1 -1
  485. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js +10 -1
  486. package/dist/esm/notifications/email/services/email-template-validator.backend.service.js.map +1 -1
  487. package/dist/esm/notifications/email/services/email.backend.service.d.ts +60 -4
  488. package/dist/esm/notifications/email/services/email.backend.service.d.ts.map +1 -1
  489. package/dist/esm/notifications/email/services/email.backend.service.js +145 -43
  490. package/dist/esm/notifications/email/services/email.backend.service.js.map +1 -1
  491. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts +0 -1
  492. package/dist/esm/notifications/email/utils/color-conversion.utils.d.ts.map +1 -1
  493. package/dist/esm/notifications/email/utils/color-conversion.utils.js.map +1 -1
  494. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts +142 -21
  495. package/dist/esm/notifications/services/notification-badge.backend.service.d.ts.map +1 -1
  496. package/dist/esm/notifications/services/notification-badge.backend.service.js +283 -58
  497. package/dist/esm/notifications/services/notification-badge.backend.service.js.map +1 -1
  498. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts +99 -13
  499. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.d.ts.map +1 -1
  500. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js +422 -66
  501. package/dist/esm/notifications/services/notifications-dispatcher.backend.service.js.map +1 -1
  502. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts +2 -2
  503. package/dist/esm/notifications/sms/services/sms.backend.service.d.ts.map +1 -1
  504. package/dist/esm/notifications/sms/services/sms.backend.service.js +5 -5
  505. package/dist/esm/notifications/sms/services/sms.backend.service.js.map +1 -1
  506. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts +117 -5
  507. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.d.ts.map +1 -1
  508. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js +164 -6
  509. package/dist/esm/notifications/webhooks/controllers/webhook-auto-controller.backend.service.js.map +1 -1
  510. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts +0 -6
  511. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.d.ts.map +1 -1
  512. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js +46 -1
  513. package/dist/esm/notifications/webhooks/outbound/batches/m2m-webhook-delivery.batch.backend.service.js.map +1 -1
  514. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.d.ts.map +1 -1
  515. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js +16 -6
  516. package/dist/esm/notifications/webhooks/outbound/m2m-webhook-signed-request.backend.utils.js.map +1 -1
  517. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.d.ts.map +1 -1
  518. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js +12 -12
  519. package/dist/esm/notifications/webhooks/outbound/services/webhook-config-test-endpoint.custom-impl.backend.service.js.map +1 -1
  520. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts +16 -0
  521. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.d.ts.map +1 -1
  522. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js +18 -0
  523. package/dist/esm/notifications/webhooks/services/webhook-handler.backend.service.js.map +1 -1
  524. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.d.ts +2 -2
  525. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js +2 -2
  526. package/dist/esm/organizations/batches/organization-purge.batch.backend.service.js.map +1 -1
  527. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.d.ts.map +1 -1
  528. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js +63 -2
  529. package/dist/esm/organizations/services/organization-custom-implementation.backend.service.js.map +1 -1
  530. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts +66 -0
  531. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.d.ts.map +1 -0
  532. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js +257 -0
  533. package/dist/esm/queue/adapters/in-memory-queue-adapter.backend.service.js.map +1 -0
  534. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts +12 -0
  535. package/dist/esm/queue/adapters/queue-adapter.backend.binding.d.ts.map +1 -0
  536. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js +47 -0
  537. package/dist/esm/queue/adapters/queue-adapter.backend.binding.js.map +1 -0
  538. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts +87 -0
  539. package/dist/esm/queue/adapters/queue-adapter.backend.interface.d.ts.map +1 -0
  540. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js +1 -0
  541. package/dist/esm/queue/adapters/queue-adapter.backend.interface.js.map +1 -0
  542. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts +31 -0
  543. package/dist/esm/queue/adapters/queue-adapter.backend.options.d.ts.map +1 -0
  544. package/dist/esm/queue/adapters/queue-adapter.backend.options.js +13 -0
  545. package/dist/esm/queue/adapters/queue-adapter.backend.options.js.map +1 -0
  546. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts +19 -25
  547. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.d.ts.map +1 -1
  548. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js +33 -0
  549. package/dist/esm/queue/adapters/rabbitmq-adapter.backend.service.js.map +1 -1
  550. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts +2 -2
  551. package/dist/esm/queue/domain-queue-consumer.backend.service.d.ts.map +1 -1
  552. package/dist/esm/queue/domain-queue-consumer.backend.service.js +1 -4
  553. package/dist/esm/queue/domain-queue-consumer.backend.service.js.map +1 -1
  554. package/dist/esm/queue/job-consumer.backend.service.d.ts +2 -2
  555. package/dist/esm/queue/job-consumer.backend.service.d.ts.map +1 -1
  556. package/dist/esm/queue/job-consumer.backend.service.js +1 -4
  557. package/dist/esm/queue/job-consumer.backend.service.js.map +1 -1
  558. package/dist/esm/queue/job-executor.backend.service.d.ts +2 -2
  559. package/dist/esm/queue/job-executor.backend.service.d.ts.map +1 -1
  560. package/dist/esm/queue/job-executor.backend.service.js +1 -4
  561. package/dist/esm/queue/job-executor.backend.service.js.map +1 -1
  562. package/dist/esm/queue/queue-monitoring.backend.service.d.ts +8 -4
  563. package/dist/esm/queue/queue-monitoring.backend.service.d.ts.map +1 -1
  564. package/dist/esm/queue/queue-monitoring.backend.service.js +25 -17
  565. package/dist/esm/queue/queue-monitoring.backend.service.js.map +1 -1
  566. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts +16 -1
  567. package/dist/esm/queue/queue-worker-initializer.backend.service.d.ts.map +1 -1
  568. package/dist/esm/queue/queue-worker-initializer.backend.service.js +16 -1
  569. package/dist/esm/queue/queue-worker-initializer.backend.service.js.map +1 -1
  570. package/dist/esm/queue/queue.backend.service.d.ts +3 -3
  571. package/dist/esm/queue/queue.backend.service.d.ts.map +1 -1
  572. package/dist/esm/queue/queue.backend.service.js +26 -4
  573. package/dist/esm/queue/queue.backend.service.js.map +1 -1
  574. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts +2 -2
  575. package/dist/esm/queue/worker-shutdown-manager.backend.service.d.ts.map +1 -1
  576. package/dist/esm/queue/worker-shutdown-manager.backend.service.js +18 -3
  577. package/dist/esm/queue/worker-shutdown-manager.backend.service.js.map +1 -1
  578. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts +50 -25
  579. package/dist/esm/rag/utils/rag-chunking.backend.utils.d.ts.map +1 -1
  580. package/dist/esm/rag/utils/rag-chunking.backend.utils.js +147 -39
  581. package/dist/esm/rag/utils/rag-chunking.backend.utils.js.map +1 -1
  582. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts +12 -3
  583. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.d.ts.map +1 -1
  584. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js +12 -3
  585. package/dist/esm/rag/utils/rag-context-assembly.backend.utils.js.map +1 -1
  586. package/dist/esm/requests/service/websocket.service.d.ts +9 -0
  587. package/dist/esm/requests/service/websocket.service.d.ts.map +1 -1
  588. package/dist/esm/requests/service/websocket.service.js +32 -8
  589. package/dist/esm/requests/service/websocket.service.js.map +1 -1
  590. package/dist/esm/resources/models/custom-service-implementations.backend.definition.d.ts.map +1 -1
  591. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js +14 -2
  592. package/dist/esm/resources/models/custom-service-implementations.backend.definition.js.map +1 -1
  593. package/dist/esm/resources/models/resources-operations.backend.definitions.d.ts.map +1 -1
  594. package/dist/esm/resources/models/resources-operations.backend.definitions.js +2 -0
  595. package/dist/esm/resources/models/resources-operations.backend.definitions.js.map +1 -1
  596. package/dist/esm/resources/models/resources-relationships.backend.definitions.d.ts.map +1 -1
  597. package/dist/esm/resources/models/resources-relationships.backend.definitions.js +14 -0
  598. package/dist/esm/resources/models/resources-relationships.backend.definitions.js.map +1 -1
  599. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts +2 -1
  600. package/dist/esm/resources/models/resources-types.backend.schemas.d.ts.map +1 -1
  601. package/dist/esm/resources/models/resources-types.backend.schemas.js +8 -0
  602. package/dist/esm/resources/models/resources-types.backend.schemas.js.map +1 -1
  603. package/dist/esm/resources/services/resources-registry.backend.service.d.ts +60 -5
  604. package/dist/esm/resources/services/resources-registry.backend.service.d.ts.map +1 -1
  605. package/dist/esm/resources/services/resources-registry.backend.service.js +90 -6
  606. package/dist/esm/resources/services/resources-registry.backend.service.js.map +1 -1
  607. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts +36 -3
  608. package/dist/esm/runtime/controllers/health-controller.backend.service.d.ts.map +1 -1
  609. package/dist/esm/runtime/controllers/health-controller.backend.service.js +32 -10
  610. package/dist/esm/runtime/controllers/health-controller.backend.service.js.map +1 -1
  611. package/dist/esm/runtime/domain-module.backend.definitions.d.ts +24 -0
  612. package/dist/esm/runtime/domain-module.backend.definitions.d.ts.map +1 -1
  613. package/dist/esm/runtime/domain-module.backend.definitions.js +24 -0
  614. package/dist/esm/runtime/domain-module.backend.definitions.js.map +1 -1
  615. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts +51 -0
  616. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.d.ts.map +1 -1
  617. package/dist/esm/runtime/services/health-readiness-contributor.backend.interface.js.map +1 -1
  618. package/dist/esm/runtime/services/http-server.backend.service.d.ts +26 -0
  619. package/dist/esm/runtime/services/http-server.backend.service.d.ts.map +1 -1
  620. package/dist/esm/runtime/services/http-server.backend.service.js +181 -1
  621. package/dist/esm/runtime/services/http-server.backend.service.js.map +1 -1
  622. package/dist/esm/runtime/services/start-application.backend.service.d.ts +19 -1
  623. package/dist/esm/runtime/services/start-application.backend.service.d.ts.map +1 -1
  624. package/dist/esm/runtime/services/start-application.backend.service.js +261 -77
  625. package/dist/esm/runtime/services/start-application.backend.service.js.map +1 -1
  626. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts +15 -0
  627. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.d.ts.map +1 -1
  628. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js +28 -0
  629. package/dist/esm/security/api-keys/api-keys.custom-impl.backend.service.js.map +1 -1
  630. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts +5 -1
  631. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.d.ts.map +1 -1
  632. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js +24 -4
  633. package/dist/esm/security/authentications/batches/anonymous-session-cleanup.batch.backend.service.js.map +1 -1
  634. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.d.ts.map +1 -1
  635. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js +29 -4
  636. package/dist/esm/security/authentications/controllers/authentication-controller.backend.service.js.map +1 -1
  637. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts +114 -0
  638. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.d.ts.map +1 -1
  639. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js +354 -3
  640. package/dist/esm/security/authentications/controllers/oauth-provider-controller.backend.service.js.map +1 -1
  641. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts +1 -0
  642. package/dist/esm/security/authentications/models/cimd.backend.schemas.d.ts.map +1 -1
  643. package/dist/esm/security/authentications/models/cimd.backend.schemas.js +22 -0
  644. package/dist/esm/security/authentications/models/cimd.backend.schemas.js.map +1 -1
  645. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts +15 -0
  646. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.d.ts.map +1 -1
  647. package/dist/esm/security/authentications/models/oauth2-connection.backend.schemas.js.map +1 -1
  648. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts +0 -2
  649. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.d.ts.map +1 -1
  650. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js +23 -14
  651. package/dist/esm/security/authentications/services/admin-config/auth-organization-configuration.service.js.map +1 -1
  652. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts +0 -1
  653. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.d.ts.map +1 -1
  654. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js +15 -12
  655. package/dist/esm/security/authentications/services/admin-config/domain-to-org-lookup.backend.service.js.map +1 -1
  656. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts +113 -3
  657. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.d.ts.map +1 -1
  658. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js +207 -30
  659. package/dist/esm/security/authentications/services/admin-config/domain-verification.backend.service.js.map +1 -1
  660. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts +95 -2
  661. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.d.ts.map +1 -1
  662. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js +153 -9
  663. package/dist/esm/security/authentications/services/admin-config/enterprise-user-provisioning.backend.service.js.map +1 -1
  664. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts +190 -0
  665. package/dist/esm/security/authentications/services/anonymous-session.backend.service.d.ts.map +1 -1
  666. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js +377 -53
  667. package/dist/esm/security/authentications/services/anonymous-session.backend.service.js.map +1 -1
  668. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.d.ts.map +1 -1
  669. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js +68 -1
  670. package/dist/esm/security/authentications/services/auth-methods/auth-method-management.backend.service.js.map +1 -1
  671. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts +41 -0
  672. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.d.ts.map +1 -1
  673. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js +202 -23
  674. package/dist/esm/security/authentications/services/auth-methods/auth-registration.backend.service.js.map +1 -1
  675. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.d.ts.map +1 -1
  676. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js +42 -1
  677. package/dist/esm/security/authentications/services/auth-methods/oauth2-authentication.backend.service.js.map +1 -1
  678. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.d.ts.map +1 -1
  679. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js +34 -4
  680. package/dist/esm/security/authentications/services/auth-methods/oauth2-connection-resolver.backend.service.js.map +1 -1
  681. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts +29 -5
  682. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.d.ts.map +1 -1
  683. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js +77 -5
  684. package/dist/esm/security/authentications/services/auth-methods/webauthn.backend.service.js.map +1 -1
  685. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts +17 -1
  686. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.d.ts.map +1 -1
  687. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js +49 -17
  688. package/dist/esm/security/authentications/services/auth-token-issuer.backend.service.js.map +1 -1
  689. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts +43 -1
  690. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.d.ts.map +1 -1
  691. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js +277 -97
  692. package/dist/esm/security/authentications/services/authentication-orchestrator.backend.service.js.map +1 -1
  693. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts +28 -5
  694. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.d.ts.map +1 -1
  695. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js +72 -12
  696. package/dist/esm/security/authentications/services/cimd-client-metadata.backend.service.js.map +1 -1
  697. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.d.ts.map +1 -1
  698. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js +3 -0
  699. package/dist/esm/security/authentications/services/custom-impls/auth-custom-implementations.backend.js.map +1 -1
  700. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts +28 -0
  701. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.d.ts.map +1 -0
  702. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js +283 -0
  703. package/dist/esm/security/authentications/services/custom-impls/sso-config-domain-verification.custom-impl.backend.service.js.map +1 -0
  704. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts +4 -3
  705. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.d.ts.map +1 -1
  706. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js +4 -3
  707. package/dist/esm/security/authentications/services/custom-impls/sso-config.custom-impl.backend.service.js.map +1 -1
  708. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts +35 -0
  709. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.d.ts.map +1 -1
  710. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js +111 -21
  711. package/dist/esm/security/authentications/services/oauth-provider-token.backend.service.js.map +1 -1
  712. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts +14 -1
  713. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.d.ts.map +1 -1
  714. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js +49 -8
  715. package/dist/esm/security/authentications/services/oidc-authorization-code.backend.service.js.map +1 -1
  716. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.d.ts.map +1 -1
  717. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js +4 -0
  718. package/dist/esm/security/authentications/services/utils/auth-policy-resolution.backend.utils.js.map +1 -1
  719. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.d.ts.map +1 -1
  720. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js +6 -0
  721. package/dist/esm/security/authentications/services/utils/auth-user-lookup.backend.service.js.map +1 -1
  722. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts +37 -1
  723. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.d.ts.map +1 -1
  724. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js +51 -0
  725. package/dist/esm/security/authentications/services/utils/external-turn-rate-limit.backend.utils.js.map +1 -1
  726. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts +41 -0
  727. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.d.ts.map +1 -1
  728. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js +45 -0
  729. package/dist/esm/security/authentications/utils/enterprise-sso-enforcement.backend.utils.js.map +1 -1
  730. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts +116 -0
  731. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.d.ts.map +1 -0
  732. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js +162 -0
  733. package/dist/esm/security/authorizations/cross-tenant-read-observation.backend.js.map +1 -0
  734. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts +20 -20
  735. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.d.ts.map +1 -1
  736. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js +27 -28
  737. package/dist/esm/security/authorizations/organization-owner-floor.backend.utils.js.map +1 -1
  738. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.d.ts.map +1 -1
  739. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js +77 -3
  740. package/dist/esm/security/authorizations/platform-access-grant-custom-implementation.backend.service.js.map +1 -1
  741. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts +4 -0
  742. package/dist/esm/security/authorizations/role-ceiling.backend.utils.d.ts.map +1 -1
  743. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js +4 -0
  744. package/dist/esm/security/authorizations/role-ceiling.backend.utils.js.map +1 -1
  745. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts +93 -0
  746. package/dist/esm/security/authorizations/role-conferral.backend.utils.d.ts.map +1 -0
  747. package/dist/esm/security/authorizations/role-conferral.backend.utils.js +95 -0
  748. package/dist/esm/security/authorizations/role-conferral.backend.utils.js.map +1 -0
  749. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts +124 -1
  750. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.d.ts.map +1 -1
  751. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js +142 -5
  752. package/dist/esm/security/authorizations/scope-root-collection-confinement.backend.js.map +1 -1
  753. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts +74 -8
  754. package/dist/esm/security/authorizations/services/authorizations.backend.service.d.ts.map +1 -1
  755. package/dist/esm/security/authorizations/services/authorizations.backend.service.js +175 -19
  756. package/dist/esm/security/authorizations/services/authorizations.backend.service.js.map +1 -1
  757. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts +6 -14
  758. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.d.ts.map +1 -1
  759. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js +13 -22
  760. package/dist/esm/security/authorizations/super-admin-floor.backend.utils.js.map +1 -1
  761. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts +60 -0
  762. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.d.ts.map +1 -0
  763. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js +79 -0
  764. package/dist/esm/security/connected-accounts/connection-target-authorization.backend.js.map +1 -0
  765. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts +161 -0
  766. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.d.ts.map +1 -0
  767. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js +512 -0
  768. package/dist/esm/security/connected-accounts/controllers/provider-connection.controller.backend.service.js.map +1 -0
  769. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts +59 -0
  770. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.d.ts.map +1 -0
  771. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js +22 -0
  772. package/dist/esm/security/connected-accounts/organization-provider-credential-resolver.port.js.map +1 -0
  773. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts +44 -0
  774. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.d.ts.map +1 -0
  775. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js +20 -0
  776. package/dist/esm/security/connected-accounts/provider-oauth2-refresher.port.js.map +1 -0
  777. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts +191 -0
  778. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.d.ts.map +1 -0
  779. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js +385 -0
  780. package/dist/esm/security/connected-accounts/services/organization-provider-credential-store.backend.service.js.map +1 -0
  781. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts +41 -0
  782. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
  783. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js +358 -0
  784. package/dist/esm/security/connected-accounts/services/organization-provider-credentials.custom-impl.backend.service.js.map +1 -0
  785. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts +160 -0
  786. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.d.ts.map +1 -0
  787. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js +266 -0
  788. package/dist/esm/security/connected-accounts/services/provider-oauth2-exchange.backend.js.map +1 -0
  789. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts +111 -0
  790. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.d.ts.map +1 -0
  791. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js +107 -0
  792. package/dist/esm/security/connected-accounts/services/provider-oauth2-pending-authorization.backend.service.js.map +1 -0
  793. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts +54 -0
  794. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.d.ts.map +1 -0
  795. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js +153 -0
  796. package/dist/esm/security/connected-accounts/services/provider-oauth2-refresher.backend.service.js.map +1 -0
  797. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts +195 -0
  798. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.d.ts.map +1 -0
  799. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js +387 -0
  800. package/dist/esm/security/connected-accounts/services/user-provider-credential-store.backend.service.js.map +1 -0
  801. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts +45 -0
  802. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.d.ts.map +1 -0
  803. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js +291 -0
  804. package/dist/esm/security/connected-accounts/services/user-provider-credentials.custom-impl.backend.service.js.map +1 -0
  805. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts +62 -0
  806. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.d.ts.map +1 -0
  807. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js +29 -0
  808. package/dist/esm/security/connected-accounts/user-provider-credential-resolver.port.js.map +1 -0
  809. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts +127 -0
  810. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.d.ts.map +1 -0
  811. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js +277 -0
  812. package/dist/esm/security/connected-accounts/utils/provider-credential-envelope.backend.utils.js.map +1 -0
  813. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts +66 -0
  814. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.d.ts.map +1 -0
  815. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js +75 -0
  816. package/dist/esm/security/connected-accounts/utils/stored-credential-value.backend.utils.js.map +1 -0
  817. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts +21 -3
  818. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.d.ts.map +1 -1
  819. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js +26 -16
  820. package/dist/esm/security/consumable-tokens/services/consumable-token.backend.service.js.map +1 -1
  821. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts +9 -4
  822. package/dist/esm/security/credential-rotation-grace.backend.utils.d.ts.map +1 -1
  823. package/dist/esm/security/credential-rotation-grace.backend.utils.js +9 -4
  824. package/dist/esm/security/credential-rotation-grace.backend.utils.js.map +1 -1
  825. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts +26 -0
  826. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.d.ts.map +1 -1
  827. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js +43 -0
  828. package/dist/esm/security/oauth-clients/oauth-client-generation.backend.utils.js.map +1 -1
  829. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts +8 -1
  830. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.d.ts.map +1 -1
  831. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js +49 -0
  832. package/dist/esm/security/oauth-clients/oauth-clients.custom-impl.backend.service.js.map +1 -1
  833. package/dist/esm/security/scim/controllers/scim.backend.controller.d.ts.map +1 -1
  834. package/dist/esm/security/scim/controllers/scim.backend.controller.js +17 -5
  835. package/dist/esm/security/scim/controllers/scim.backend.controller.js.map +1 -1
  836. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts +67 -29
  837. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.d.ts.map +1 -1
  838. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js +47 -25
  839. package/dist/esm/security/scim/models/scim-protocol.backend.schemas.js.map +1 -1
  840. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts +10 -2
  841. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.d.ts.map +1 -1
  842. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js +10 -2
  843. package/dist/esm/security/ssrf/outbound-target-guard.backend.utils.js.map +1 -1
  844. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts +143 -0
  845. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.d.ts.map +1 -0
  846. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js +258 -0
  847. package/dist/esm/security/ssrf/pinned-outbound-fetch.backend.utils.js.map +1 -0
  848. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts +39 -0
  849. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.d.ts.map +1 -0
  850. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js +159 -0
  851. package/dist/esm/users/services/user-read-retained.custom-impl.backend.service.js.map +1 -0
  852. package/dist/tsconfig.build.tsbuildinfo +1 -1
  853. package/package.json +11 -9
@@ -1 +1 @@
1
- {"version":3,"file":"notification-badge.backend.service.js","sourceRoot":"","sources":["../../../../../src/notifications/services/notification-badge.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAC3H,OAAO,EACL,yCAAyC,GAE1C,M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,MAAM,CAAC,IAAI,CAAC,kDAAkD,EAAE;oBACnE,KAAK;oBACL,OAAO;oBACP,UAAU;iBACX,CAAC,CAAC;gBACH,MAAM;QACV,CAAC;IACH,CAAC;CACF,CAAA;AAzjBY,+BAA+B;IAD3C,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAA;IACjC,WAAA,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAC9C,WAAA,MAAM,CAAC,kBAAkB,CAAC,kCAAkC,CAAC,CAAA;IAC7D,WAAA,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAA;IAClD,WAAA,MAAM,CAAC,kBAAkB,CAAC,qCAAqC,CAAC,CAAA;qCALL,aAAa;QACM,0BAA0B;QACH,yCAAyC;QAC/D,gBAAgB;QACR,+BAA+B;QACX,qCAAqC;GAVxI,+BAA+B,CAyjB3C","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport {\n RepositoriesRegistryHandlerBackendService,\n type BackendResourceRepository,\n} 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 { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { ResourceConfiguration_Operation } from '@wildo-ai/saas-models';\nimport {\n ResourcePrimaryScope,\n NotificationBadgeOperation,\n NotificationBadge,\n NotificationBadgeDefinition,\n NotificationBadgeSourceKind,\n CoreResourceType,\n CoreResourceOperation,\n NotificationBadgeIdentifier,\n CoreWebSocketEvent,\n WS_BadgeUpdatePayload,\n} from '@wildo-ai/saas-models';\nimport { WebSocketService, WebSocketMessage } from '~wildo-backend-lib/requests/service/websocket.service';\n\n/**\n * Badge reference format: `${scope}:${scopeId}:${identifier}`\n * Examples:\n * - user_self:user123:new_messages\n * - organization:org456:pending_tasks\n */\nexport interface BadgeReference {\n scope: ResourcePrimaryScope;\n scopeId: string;\n identifier: NotificationBadgeIdentifier;\n}\n\nexport interface BadgeUpdateResult {\n badgeReference: string;\n previousCount: number;\n newCount: number;\n}\n\n/**\n * The derived-badge SOURCE count passes a fully explicit, self-scoped filter\n * (`{ ...authoredFilter, [scopeField]: scopeId }`), so ambient contextual\n * filtering is skipped — the count must be identical regardless of the execution\n * context driving the recompute. (The badge resource's OWN ops instead use a\n * dedicated badge-scoped EC — see `buildBadgeExecutionContext` — so their scope\n * FK is injected/filtered correctly rather than bypassed.)\n */\nconst EXPLICIT_SCOPE_REPO_OPTIONS = { excludeContextualFilter: true } as const;\n\n/**\n * NotificationBadgeBackendService\n *\n * Manages notification badge counts stored in the database.\n * Provides operations to increment, decrement, set, and reset badge counts.\n * Emits WebSocket events when badge counts change.\n */\n@injectable()\nexport class NotificationBadgeBackendService {\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.WebSocketService) private readonly webSocketService: WebSocketService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n ) {\n this.logDebug = this.logger.debugByType('NotificationBadgeService');\n this.logger.setDebugTypeLogging('NotificationBadgeService', false);\n }\n\n /**\n * Build a badge-resource-scoped execution context for the badge's OWN\n * repository operations (read/create/update on `userNotificationBadges` /\n * `organizationNotificationBadges`).\n *\n * WHY this exists — the badge scope FK (`userId` / `organizationId`) is a\n * parent-scope field that the framework AUTO-EXCLUDES from the create DTO\n * (it is meant to be injected from the request's URL/scope context). A badge\n * write driven by a system service (dispatcher recompute / connect-seed) has\n * no such URL context, and reusing the TRIGGERING operation's execution\n * context (e.g. a `todos` op, or the connect-seed's `APPLICATION.READ`) carries\n * the WRONG scope — `context_filter` / `context_enrichment` fail closed, or the\n * scope FK is simply never injected (`userId: Path 'userId' is required`).\n *\n * Building a dedicated internal EC for the badge resource, with ONLY the badge's\n * own scope field in its context map, makes the standard pipeline correct:\n * context enrichment injects the scope FK on create, and contextual filtering\n * scopes reads by exactly that field. Mirrors the `FilesBackendService`\n * internal-repository-context pattern.\n */\n private buildBadgeExecutionContext(scope: ResourcePrimaryScope, scopeId: string): Promise<ExecutionContext<any>> {\n const isUserScope = scope === ResourcePrimaryScope.USER_SELF;\n const resourceType = isUserScope\n ? CoreResourceType.USER_NOTIFICATION_BADGES\n : CoreResourceType.ORGANIZATION_NOTIFICATION_BADGES;\n const scopeFieldIdentifier = isUserScope ? 'userId' : 'organizationId';\n // The scope goes ONLY in the context map (enrichment injects it / contextual\n // filtering scopes by it). It must NOT go in `initiatorIds`: an internal\n // (`internally_initiated_request`) EC forbids identity fields there — only\n // `applicationId` is allowed.\n return this.executionContextCreator.createForInternalRepositoryOperation({\n resourceType,\n operationIdentifier: CoreResourceOperation.CREATE,\n contextResourcesFieldIdentifier: new Map([[scopeFieldIdentifier, scopeId]]),\n });\n }\n\n /**\n * Build a badge reference string\n */\n public buildBadgeReference(scope: ResourcePrimaryScope, scopeId: string, identifier: NotificationBadgeIdentifier): string {\n return `${scope}:${scopeId}:${identifier}`;\n }\n\n /**\n * Parse a badge reference string.\n *\n * Validates that the embedded scope is a SUPPORTED badge scope (USER_SELF or\n * ORGANIZATIONS). The polymorphism refactor dropped APPLICATION-scope badges\n * (no canonical identifiers existed at that scope and no resource type backs\n * it anymore) — so a reference like `application:appId:foo` is rejected here\n * to fail fast at parse time rather than later during dispatch.\n */\n public parseBadgeReference(badgeReference: string): BadgeReference | null {\n const parts = badgeReference.split(':');\n if (parts.length !== 3) return null;\n\n const [scope, scopeId, identifier] = parts;\n if (!this.isSupportedScope(scope)) {\n return null;\n }\n\n return {\n scope: scope as ResourcePrimaryScope,\n scopeId,\n identifier: identifier as NotificationBadgeIdentifier,\n };\n }\n\n /**\n * Get badge count for a specific identifier and scope\n */\n public async getBadgeCount<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<number> {\n try {\n const badge = await this.findBadge(executionContext, scope, scopeId, identifier);\n return badge?.count ?? 0;\n } catch (error) {\n this.logger.warn('Failed to get badge count', {\n scope,\n scopeId,\n identifier,\n ...projectCaughtErrorLogFields(error),\n });\n return 0;\n }\n }\n\n /**\n * Get all badges for a specific scope\n */\n public async getAllBadges<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string\n ): Promise<Array<{ identifier: string; count: number }>> {\n try {\n const repository = this.resolveRepository(scope);\n if (!repository) {\n this.logger.warn('NotificationBadges repository not found', { scope });\n return [];\n }\n\n const filter = this.buildScopeFilter(scope, scopeId);\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n const badges = await repository.list<NotificationBadge>(badgeExecutionContext, filter);\n\n return badges.map(badge => ({\n identifier: badge.identifier,\n count: badge.count,\n }));\n } catch (error) {\n this.logger.warn('Failed to get all badges', {\n scope,\n scopeId,\n ...projectCaughtErrorLogFields(error),\n });\n return [];\n }\n }\n\n /**\n * Execute a badge operation (increment, decrement, set, reset)\n */\n public async executeBadgeOperation<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n operation: NotificationBadgeOperation,\n value: number = 1\n ): Promise<BadgeUpdateResult> {\n const repository = this.resolveRepository(scope);\n if (!repository) {\n throw this.errorBuilder.buildError(\n 'INTERNAL' as any,\n executionContext,\n {\n customMessageReference: 'NOTIFICATION_BADGES_REPOSITORY_NOT_FOUND' as any,\n context: { scope },\n }\n );\n }\n\n // Find existing badge\n let badge = await this.findBadge(executionContext, scope, scopeId, identifier);\n const previousCount = badge?.count ?? 0;\n let newCount: number;\n\n // Calculate new count based on operation\n switch (operation) {\n case NotificationBadgeOperation.INCREMENT:\n newCount = previousCount + value;\n break;\n case NotificationBadgeOperation.DECREMENT:\n newCount = Math.max(0, previousCount - value);\n break;\n case NotificationBadgeOperation.SET:\n newCount = Math.max(0, value);\n break;\n case NotificationBadgeOperation.RESET:\n newCount = 0;\n break;\n default:\n newCount = previousCount;\n }\n\n // Update or create badge through a badge-resource-scoped EC (see\n // buildBadgeExecutionContext) so context enrichment injects the scope FK\n // (userId / organizationId) that the create DTO auto-excludes.\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n if (badge) {\n await repository.update<NotificationBadge>(badgeExecutionContext, badge._id, {\n count: newCount,\n updatedAt: new Date(),\n } as any);\n } else {\n // Create new badge\n const newBadge = this.buildNewBadge(scope, scopeId, identifier, newCount);\n await repository.create<NotificationBadge>(badgeExecutionContext, newBadge);\n }\n\n const badgeReference = this.buildBadgeReference(scope, scopeId, identifier);\n\n // Emit WebSocket event\n await this.emitBadgeUpdate(scope, scopeId, identifier, newCount, executionContext.initiatorIds?.userId);\n\n this.logDebug('Badge operation executed', {\n badgeReference,\n operation,\n previousCount,\n newCount,\n });\n\n return {\n badgeReference,\n previousCount,\n newCount,\n };\n }\n\n /**\n * Increment a badge count\n */\n public async increment<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n amount: number = 1\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.INCREMENT,\n amount\n );\n }\n\n /**\n * Decrement a badge count\n */\n public async decrement<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n amount: number = 1\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.DECREMENT,\n amount\n );\n }\n\n /**\n * Set a badge count to a specific value\n */\n public async set<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n value: number\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.SET,\n value\n );\n }\n\n /**\n * Reset a badge count to zero\n */\n public async reset<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.RESET\n );\n }\n\n /**\n * Recompute a DERIVED_QUERY badge and persist the result (R5).\n *\n * The count is RE-DERIVED from the source resource collection every time\n * (`count(resourceType where {...filter, [scopeField]: scopeId})`) and then\n * `SET` onto the badge — it is never incrementally tracked, so it CANNOT\n * drift (bulk mutations, deletes, reopen, out-of-band edits all reconcile on\n * the next recompute). Called by the dispatcher when the source resource is\n * mutated. No-op for non-DERIVED definitions.\n */\n public async recomputeDerivedBadge<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n definition: NotificationBadgeDefinition,\n scopeId: string\n ): Promise<void> {\n if (definition.source.kind !== NotificationBadgeSourceKind.DERIVED_QUERY) {\n return;\n }\n\n const source = definition.source;\n const sourceRepository = this.repositoriesRegistry.getRepository(source.resourceType);\n if (!sourceRepository) {\n this.logger.warn('Derived badge source repository not found', {\n identifier: definition.identifier,\n resourceType: source.resourceType,\n });\n return;\n }\n\n // Bind the scope onto the authored filter, then count the source collection.\n // The filter is FULLY self-scoped (`[scopeField]: scopeId` pins it to the\n // badge's own scope), so the count must be identical regardless of which\n // execution context drives the recompute. Build a dedicated internal EC for the\n // SOURCE resource's own count rather than reusing the caller's EC — the mutation\n // path passes the triggering op's EC (works), but the connect-seed passes an\n // APPLICATION.READ EC, and counting a foreign resource off that mismatched EC\n // threw \"Cannot read properties of undefined (reading 'operations')\". With the\n // source-scoped EC + explicit filter, contextual filtering is skipped.\n let sourceExecutionContext: ExecutionContext<any> = executionContext;\n try {\n sourceExecutionContext = await this.executionContextCreator.createForInternalRepositoryOperation({\n resourceType: source.resourceType,\n operationIdentifier: CoreResourceOperation.COUNT,\n });\n } catch {\n // Fall back to the caller's EC if the source resource has no resolvable\n // internal count operation (the explicit filter still scopes the count).\n }\n const filter = { ...source.filter, [source.scopeField]: scopeId };\n const { count } = await sourceRepository.count(sourceExecutionContext, filter, EXPLICIT_SCOPE_REPO_OPTIONS);\n\n // SET (not increment) — the derived count is authoritative.\n await this.set(executionContext, definition.scope, scopeId, definition.identifier, count);\n }\n\n /**\n * Seed every registered badge for a freshly-connected client (R6a —\n * compute-on-connect). For each definition in the connecting scope: DERIVED\n * badges are recomputed (fresh count, emits), EVENT badges have their stored\n * count re-emitted so the client paints the current value on first render.\n *\n * `executionContext` MUST be the connecting user's own authenticated context\n * (built by the WS layer from the validated socket auth) and `initiatorIds`\n * MUST be the server-validated socket identity — never client handshake data —\n * so the scopeId that drives every count is pinned to the caller's own scope\n * (no cross-tenant read). Per-badge failures are logged, never abort siblings.\n */\n public async syncBadgesForConnection<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n initiatorIds: { userId?: string | null; organizationId?: string | null }\n ): Promise<void> {\n const definitions = this.resourcesRegistry.getResourcesRegistry().notificationBadgeDefinitions ?? [];\n if (definitions.length === 0) {\n return;\n }\n\n for (const definition of definitions) {\n const scopeId =\n definition.scope === ResourcePrimaryScope.USER_SELF\n ? initiatorIds.userId\n : definition.scope === ResourcePrimaryScope.ORGANIZATIONS\n ? initiatorIds.organizationId\n : null;\n if (!scopeId) {\n continue;\n }\n\n try {\n if (definition.source.kind === NotificationBadgeSourceKind.DERIVED_QUERY) {\n await this.recomputeDerivedBadge(executionContext, definition, scopeId);\n } else {\n // EVENT_COUNTER — re-emit the stored value so the client seeds on connect.\n const count = await this.getBadgeCount(executionContext, definition.scope, scopeId, definition.identifier);\n await this.emitBadgeUpdate(definition.scope, scopeId, definition.identifier, count, initiatorIds.userId ?? undefined);\n }\n } catch (error) {\n this.logger.warn('Failed to seed badge on connection', {\n identifier: definition.identifier,\n scope: definition.scope,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n }\n\n // ================================\n // Private Helper Methods\n // ================================\n\n /**\n * Find a badge by scope, scopeId, and identifier\n */\n private async findBadge<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<NotificationBadge | null> {\n const repository = this.resolveRepository(scope);\n if (!repository) {\n return null;\n }\n\n const filter = {\n ...this.buildScopeFilter(scope, scopeId),\n identifier,\n };\n\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n const badges = await repository.list<NotificationBadge>(badgeExecutionContext, filter);\n return badges.length > 0 ? badges[0] : null;\n }\n\n /**\n * Resolve the repository for a given badge scope.\n *\n * Polymorphism dispatch:\n * USER_SELF → `USER_NOTIFICATION_BADGES` repository\n * ORGANIZATIONS → `ORGANIZATION_NOTIFICATION_BADGES` repository\n * APPLICATION → unsupported (variant dropped); returns `undefined` so\n * callers can fail-fast with their own error context.\n *\n * Returns `undefined` (not throws) so the caller controls error semantics —\n * `executeBadgeOperation` throws an explicit error, while `findBadge` /\n * `getAllBadges` swallow and return empty results to keep the read path\n * resilient (per existing behavior).\n */\n private resolveRepository(scope: ResourcePrimaryScope): BackendResourceRepository | undefined {\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n return this.repositoriesRegistry.getRepository(CoreResourceType.USER_NOTIFICATION_BADGES);\n case ResourcePrimaryScope.ORGANIZATIONS:\n return this.repositoriesRegistry.getRepository(CoreResourceType.ORGANIZATION_NOTIFICATION_BADGES);\n default:\n return undefined;\n }\n }\n\n /**\n * Whether a string scope value is one of the supported badge scopes.\n * Used by `parseBadgeReference` to reject APPLICATION-scoped references\n * at parse time (the variant was dropped in the polymorphism refactor).\n */\n private isSupportedScope(scope: string): scope is ResourcePrimaryScope {\n return scope === ResourcePrimaryScope.USER_SELF\n || scope === ResourcePrimaryScope.ORGANIZATIONS;\n }\n\n /**\n * Build filter for scope-specific queries.\n *\n * Each variant has its own collection, so the scope discriminator field is\n * implicit — we only need to filter by the scope-id field. The scope key is\n * still set on the payload (`buildNewBadge`) because the schema requires it\n * as the discriminated-union tag.\n */\n private buildScopeFilter(scope: ResourcePrimaryScope, scopeId: string): Record<string, any> {\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n return { userId: scopeId };\n case ResourcePrimaryScope.ORGANIZATIONS:\n return { organizationId: scopeId };\n default:\n return {};\n }\n }\n\n /**\n * Build a new badge document.\n *\n * `scope` is required by the schema (it is the discriminated-union tag), so\n * we still set it on the payload even though each variant lives in a\n * dedicated collection.\n */\n private buildNewBadge(\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n count: number\n ): Partial<NotificationBadge> {\n const now = new Date();\n const base: any = {\n scope,\n identifier,\n count,\n createdAt: now,\n updatedAt: now,\n };\n\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n base.userId = scopeId;\n break;\n case ResourcePrimaryScope.ORGANIZATIONS:\n base.organizationId = scopeId;\n break;\n }\n\n return base;\n }\n\n /**\n * Emit WebSocket event for badge update.\n *\n * Routing:\n * USER_SELF → `sendToUser(scopeId, …)`\n * ORGANIZATIONS → `sendToOrganization(scopeId, …)`\n *\n * The APPLICATION arm is gone (the variant was dropped). If a future need\n * for global broadcast badges arises, reintroduce it as its own scope and\n * resource type rather than re-overloading APPLICATION.\n */\n private async emitBadgeUpdate(\n scope: ResourcePrimaryScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n newCount: number,\n initiatorUserId?: string\n ): Promise<void> {\n const badgeReference = this.buildBadgeReference(scope, scopeId, identifier);\n\n const payload: WS_BadgeUpdatePayload = {\n badgeReference,\n badgeCount: newCount,\n organizationId: scope === ResourcePrimaryScope.ORGANIZATIONS ? scopeId : undefined,\n };\n\n const message: WebSocketMessage = {\n type: CoreWebSocketEvent.BADGE_UPDATE,\n payload,\n timestamp: new Date(),\n userId: initiatorUserId,\n };\n\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n await this.webSocketService.sendToUser(scopeId, message);\n break;\n case ResourcePrimaryScope.ORGANIZATIONS:\n await this.webSocketService.sendToOrganization(scopeId, message);\n break;\n default:\n this.logger.warn('Skipping badge WS emission for unsupported scope', {\n scope,\n scopeId,\n identifier,\n });\n break;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"notification-badge.backend.service.js","sourceRoot":"","sources":["../../../../../src/notifications/services/notification-badge.backend.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAC9G,OAAO,EAAE,2BAA2B,EAAE,MAAM,8EAA8E,CAAC;AAC3H,OAAO,EACL,yCAAyC,GAE1C,MAAM,qGAAqG,CAAC;AAC7G,OAAO,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAC3H,OAAO,EAAE,qCAAqC,EAAE,MAAM,+EAA+E,CAAC;AAGtI,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAG1B,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,EAErB,+BAA+B,EAC/B,+BAA+B,EAE/B,kBAAkB,GAGnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAoB,MAAM,uDAAuD,CAAC;AAsB3G;;;;;;;GAOG;AACH,MAAM,2BAA2B,GAAG,EAAE,uBAAuB,EAAE,IAAI,EAAW,CAAC;AAE/E;;;;;;;;;;;;;;GAcG;AACH,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAEtC;;;;;;GAMG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAKY;IACa;IACe;IAClB;IACO;IACc;IAR3E,QAAQ,CAA+D;IAEjF,YACsD,MAAqB,EACR,YAAwC,EACzB,oBAA+D,EACjF,gBAAkC,EAC3B,iBAAkD,EACpC,uBAA8D;QAL7F,WAAM,GAAN,MAAM,CAAe;QACR,iBAAY,GAAZ,YAAY,CAA4B;QACzB,yB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 'inversify';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport { projectCaughtErrorLogFields } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\nimport {\n RepositoriesRegistryHandlerBackendService,\n type BackendResourceRepository,\n} 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 { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport { ResourceConfiguration_Operation } from '@wildo-ai/saas-models';\nimport {\n ResourcePrimaryScope,\n NotificationBadgeOperation,\n NotificationBadge,\n NotificationBadgeDefinition,\n NotificationBadgeSourceKind,\n CoreResourceType,\n CoreResourceOperation,\n NotificationBadgeIdentifier,\n buildNotificationBadgeReference,\n parseNotificationBadgeReference,\n type NotificationScope,\n CoreWebSocketEvent,\n WS_BadgeUpdatePayload,\n type ResourceType,\n} from '@wildo-ai/saas-models';\nimport { WebSocketService, WebSocketMessage } from '~wildo-backend-lib/requests/service/websocket.service';\n\n/**\n * A parsed badge REFERENCE — one badge ROW, addressed as `<scope>:<scopeId>:<identifier>`.\n *\n * The FORMAT is not defined here. It lives once in `@wildo-ai/saas-models`\n * (`buildNotificationBadgeReference` / `parseNotificationBadgeReference`) because the browser badge\n * store parses the same string off the wire, and two hand-rolled `split(':')` implementations are\n * how a producer and a consumer come to disagree about what the parts mean.\n */\nexport interface BadgeReference {\n scope: NotificationScope;\n scopeId: string;\n identifier: NotificationBadgeIdentifier;\n}\n\nexport interface BadgeUpdateResult {\n badgeReference: string;\n previousCount: number;\n newCount: number;\n}\n\n/**\n * The derived-badge SOURCE count passes a fully explicit, self-scoped filter\n * (`{ ...authoredFilter, [scopeField]: scopeId }`), so ambient contextual\n * filtering is skipped — the count must be identical regardless of the execution\n * context driving the recompute. (The badge resource's OWN ops instead use a\n * dedicated badge-scoped EC — see `buildBadgeExecutionContext` — so their scope\n * FK is injected/filtered correctly rather than bypassed.)\n */\nconst EXPLICIT_SCOPE_REPO_OPTIONS = { excludeContextualFilter: true } as const;\n\n/**\n * How many times a RELATIVE badge write (increment / decrement) re-attempts its guarded statement\n * before giving up and reporting the count it can observe.\n *\n * Two is what the mechanism needs and three is the margin. A first pass misses only when the badge\n * row does not exist yet; the pass then materializes a ZERO row and the SECOND pass applies the\n * delta to it. The only other way a pass can miss is the decrement's two-statement floor (see\n * {@link NotificationBadgeBackendService.applyGuardedCountDelta}) losing a race in the window\n * between its two statements — that is a genuine retry, and one spare pass is generous for a\n * contention window measured in a single round trip.\n *\n * The loop terminates on its own budget rather than on a condition, because the exhaustion outcome\n * is deliberately NOT a throw: a badge is a decoration, and failing a domain mutation because a\n * counter could not be advanced would trade a cosmetic defect for a functional one.\n */\nconst RELATIVE_BADGE_WRITE_PASSES = 3;\n\n/**\n * NotificationBadgeBackendService\n *\n * Manages notification badge counts stored in the database.\n * Provides operations to increment, decrement, set, and reset badge counts.\n * Emits WebSocket events when badge counts change.\n */\n@injectable()\nexport class NotificationBadgeBackendService {\n\n protected logDebug: (message: string, context?: Record<string, unknown>) => void;\n\n constructor(\n @inject(SAAS_SERVICE_TYPES.Logger) private readonly logger: LoggerService,\n @inject(SAAS_SERVICE_TYPES.ErrorBuilderService) private readonly errorBuilder: ErrorBuilderBackendService,\n @inject(SAAS_SERVICE_TYPES.RepositoriesRegistryHandlerService) private readonly repositoriesRegistry: RepositoriesRegistryHandlerBackendService,\n @inject(SAAS_SERVICE_TYPES.WebSocketService) private readonly webSocketService: WebSocketService,\n @inject(SAAS_SERVICE_TYPES.ResourceRegistryService) private readonly resourcesRegistry: ResourcesRegistryBackendService,\n @inject(SAAS_SERVICE_TYPES.ExecutionContextCreatorBackendService) private readonly executionContextCreator: ExecutionContextCreatorBackendService,\n ) {\n this.logDebug = this.logger.debugByType('NotificationBadgeService');\n this.logger.setDebugTypeLogging('NotificationBadgeService', false);\n }\n\n /**\n * Build a badge-resource-scoped execution context for the badge's OWN\n * repository operations (read/create/update on `userNotificationBadges` /\n * `organizationNotificationBadges`).\n *\n * WHY this exists — the badge scope FK (`userId` / `organizationId`) is a\n * parent-scope field that the framework AUTO-EXCLUDES from the create DTO\n * (it is meant to be injected from the request's URL/scope context). A badge\n * write driven by a system service (dispatcher recompute / connect-seed) has\n * no such URL context, and reusing the TRIGGERING operation's execution\n * context (e.g. a `todos` op, or the connect-seed's `APPLICATION.READ`) carries\n * the WRONG scope — `context_filter` / `context_enrichment` fail closed, or the\n * scope FK is simply never injected (`userId: Path 'userId' is required`).\n *\n * Building a dedicated internal EC for the badge resource, with ONLY the badge's\n * own scope field in its context map, makes the standard pipeline correct:\n * context enrichment injects the scope FK on create, and contextual filtering\n * scopes reads by exactly that field. Mirrors the `FilesBackendService`\n * internal-repository-context pattern.\n */\n private buildBadgeExecutionContext(scope: NotificationScope, scopeId: string): Promise<ExecutionContext<any>> {\n const isUserScope = scope === ResourcePrimaryScope.USER_SELF;\n const resourceType = isUserScope\n ? CoreResourceType.USER_NOTIFICATION_BADGES\n : CoreResourceType.ORGANIZATION_NOTIFICATION_BADGES;\n const scopeFieldIdentifier = isUserScope ? 'userId' : 'organizationId';\n // The scope goes ONLY in the context map (enrichment injects it / contextual\n // filtering scopes by it). It must NOT go in `initiatorIds`: an internal\n // (`internally_initiated_request`) EC forbids identity fields there — only\n // `applicationId` is allowed.\n return this.executionContextCreator.createForInternalRepositoryOperation({\n resourceType,\n operationIdentifier: CoreResourceOperation.CREATE,\n contextResourcesFieldIdentifier: new Map([[scopeFieldIdentifier, scopeId]]),\n });\n }\n\n /**\n * Build a badge reference string.\n *\n * Delegates to the shared builder rather than re-templating the format: the browser reduces this\n * exact string to a badge KEY on arrival, so the producer and the consumer must be reading one\n * definition of where the parts are.\n */\n public buildBadgeReference(scope: NotificationScope, scopeId: string, identifier: NotificationBadgeIdentifier): string {\n return buildNotificationBadgeReference(scope, scopeId, identifier);\n }\n\n /**\n * Parse a badge reference string.\n *\n * Validates that the embedded scope is a SUPPORTED badge scope (USER_SELF or\n * ORGANIZATIONS). The polymorphism refactor dropped APPLICATION-scope badges\n * (no canonical identifiers existed at that scope and no resource type backs\n * it anymore) — so a reference like `application:appId:foo` is rejected here\n * to fail fast at parse time rather than later during dispatch.\n */\n public parseBadgeReference(badgeReference: string): BadgeReference | null {\n return parseNotificationBadgeReference(badgeReference);\n }\n\n /**\n * Get badge count for a specific identifier and scope\n */\n public async getBadgeCount<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<number> {\n try {\n const badge = await this.findBadge(executionContext, scope, scopeId, identifier);\n return badge?.count ?? 0;\n } catch (error) {\n this.logger.warn('Failed to get badge count', {\n scope,\n scopeId,\n identifier,\n ...projectCaughtErrorLogFields(error),\n });\n return 0;\n }\n }\n\n /**\n * Get all badges for a specific scope\n */\n public async getAllBadges<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string\n ): Promise<Array<{ identifier: string; count: number }>> {\n try {\n const repository = this.resolveRepository(scope);\n if (!repository) {\n this.logger.warn('NotificationBadges repository not found', { scope });\n return [];\n }\n\n const filter = this.buildScopeFilter(scope, scopeId);\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n const badges = await repository.list<NotificationBadge>(badgeExecutionContext, filter);\n\n return badges.map(badge => ({\n identifier: badge.identifier,\n count: badge.count,\n }));\n } catch (error) {\n this.logger.warn('Failed to get all badges', {\n scope,\n scopeId,\n ...projectCaughtErrorLogFields(error),\n });\n return [];\n }\n }\n\n /**\n * Execute a badge operation (increment, decrement, set, reset).\n *\n * ## Two write shapes, because the vocabulary carries two kinds of change\n *\n * `SET` and `RESET` are ABSOLUTE: the value written does not depend on the value read, so a plain\n * read-then-write is already correct — concurrent absolute writes are last-writer-wins, which is\n * what \"set it to N\" means.\n *\n * `INCREMENT` and `DECREMENT` are RELATIVE, and that is where this method used to lose data. It\n * read `count`, computed `count ± value` in JavaScript, and wrote the result back. Two operations\n * committing concurrently both read the SAME previous value, so the second write overwrote the\n * first and one increment vanished — with no error, no log, and a badge that is simply too low\n * forever after (an EVENT_COUNTER badge is never re-derived; that is the whole distinction\n * `NotificationBadgeSourceKind` draws, and it is why the drift is permanent here and self-healing\n * on a DERIVED_QUERY badge).\n *\n * More checking cannot fix that — the two writers have nothing to collide on. So the relative arms\n * now go through the adapter-neutral guarded mutation, where the STORE performs the arithmetic in\n * one statement (`$inc` on MongoDB, `COALESCE(col, 0) + delta` on PostgreSQL) and the two writers\n * collide on the row itself. See {@link applyRelativeCountChange}.\n */\n public async executeBadgeOperation<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n operation: NotificationBadgeOperation,\n value: number = 1\n ): Promise<BadgeUpdateResult> {\n const resourceType = this.resolveResourceType(scope);\n const repository = this.resolveRepository(scope);\n if (!resourceType || !repository) {\n throw this.errorBuilder.buildError(\n 'INTERNAL' as any,\n executionContext,\n {\n customMessageReference: 'NOTIFICATION_BADGES_REPOSITORY_NOT_FOUND' as any,\n context: { scope },\n }\n );\n }\n\n let previousCount: number;\n let newCount: number;\n\n switch (operation) {\n case NotificationBadgeOperation.INCREMENT:\n case NotificationBadgeOperation.DECREMENT: {\n const delta = operation === NotificationBadgeOperation.INCREMENT ? value : -value;\n ({ previousCount, newCount } = await this.applyRelativeCountChange(resourceType, scope, scopeId, identifier, delta));\n break;\n }\n case NotificationBadgeOperation.SET:\n case NotificationBadgeOperation.RESET: {\n const absoluteCount = operation === NotificationBadgeOperation.SET ? Math.max(0, value) : 0;\n ({ previousCount, newCount } = await this.writeAbsoluteCount(repository, scope, scopeId, identifier, absoluteCount));\n break;\n }\n default: {\n /**\n * The vocabulary is closed, but the dispatcher reaches this method through\n * `badgeOp.operation as NotificationBadgeOperation` — an unchecked cast over an authored\n * string — so an unknown member can arrive at runtime.\n *\n * It now reads the count and writes NOTHING. The previous behaviour wrote `previousCount`\n * back over itself, which on an absent badge MATERIALIZED a zero row for an operation\n * nobody could name: a write performed because the switch had no other arm to fall into.\n * The event is still emitted below, so a client that asked for an unknown operation is\n * told the current value rather than left silent.\n */\n previousCount = await this.getBadgeCount(executionContext, scope, scopeId, identifier);\n newCount = previousCount;\n this.logger.warn('Unknown notification badge operation — reporting the current count without writing', {\n scope,\n scopeId,\n identifier,\n operation: String(operation),\n });\n break;\n }\n }\n\n const badgeReference = this.buildBadgeReference(scope, scopeId, identifier);\n\n // Emit WebSocket event\n await this.emitBadgeUpdate(scope, scopeId, identifier, newCount, executionContext.initiatorIds?.userId);\n\n this.logDebug('Badge operation executed', {\n badgeReference,\n operation,\n previousCount,\n newCount,\n });\n\n return {\n badgeReference,\n previousCount,\n newCount,\n };\n }\n\n /**\n * Apply a RELATIVE change (`+value` / `-value`) to a badge counter without ever reading it into\n * JavaScript first.\n *\n * ## The shape, and why it is a loop rather than a straight line\n *\n * A guarded mutation only mutates a row that ALREADY EXISTS — it returns `null` when its filter\n * matched nothing, and it cannot insert. A badge row, meanwhile, is materialized lazily on its\n * first write. So the write is \"apply the delta; if there was no row, materialize one at ZERO and\n * apply the delta to that\".\n *\n * **Materializing at ZERO rather than at the target is the load-bearing detail.** Creating the row\n * already carrying `value` would mean two racing first-increments each insert a row holding `1`,\n * and one of the two increments is lost exactly as before — the defect would simply have moved\n * from the update to the insert. Creating at zero and then letting BOTH callers apply their own\n * delta through the atomic statement keeps every increment: the store matches one row for both,\n * and it ends at 2.\n *\n * ## The residual, stated rather than hidden\n *\n * Two racing materializations can still leave a DUPLICATE badge row, because nothing in the schema\n * makes `(scopeId, identifier)` unique — `identifier` carries `.isSummaryField()` and no\n * `.isUnique()`, so the store has no constraint to refuse the second insert with. That duplicate\n * hazard is older than this method and is not what this change is about: it costs a stray row,\n * whereas the read-modify-write cost a permanently wrong number. Closing it means a unique index,\n * which is an engine resource change owing a migration in every PostgreSQL-backed surface\n * (`.claude/rules/engine-resource-changes-owe-migrations.md`) and belongs with the badge-identity\n * work, not here.\n *\n * @returns the count before and after, as observed from the row the store returned.\n */\n private async applyRelativeCountChange(\n resourceType: ResourceType,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n delta: number\n ): Promise<{ previousCount: number; newCount: number }> {\n /**\n * The identity of the ONE row this write may touch.\n *\n * Tenant scoping is preserved BY CONSTRUCTION rather than by the execution context: the guarded\n * mutation is an infrastructure-tier door whose contract puts scope-aware filter construction on\n * the caller, and the scope key (`userId` / `organizationId`) is right here in the filter, so\n * the statement cannot reach another tenant's badge. That is the same posture the promotion\n * redemption counter and the credit pool take.\n */\n const identityFilter = { ...this.buildScopeFilter(scope, scopeId), identifier };\n\n for (let pass = 0; pass < RELATIVE_BADGE_WRITE_PASSES; pass += 1) {\n const applied = await this.applyGuardedCountDelta(resourceType, identityFilter, delta);\n if (applied) {\n return applied;\n }\n\n /**\n * Nothing matched. There are exactly two reasons, and they need opposite responses, so ask\n * which one it is instead of assuming.\n *\n * - The badge row does not exist yet — materialize it and let the next pass apply the delta.\n * - A DECREMENT lost the race between its two floor statements (see\n * {@link applyGuardedCountDelta}) — the row exists, and materializing would duplicate it.\n * Retry the pair instead.\n *\n * The read costs a round trip on a path taken once per badge lifetime (plus a genuinely rare\n * contention window), which is why it is affordable here and would not be on the hot arm.\n */\n const existing = await this.findBadgeByIdentity(scope, scopeId, identifier);\n if (!existing) {\n await this.materializeZeroBadge(scope, scopeId, identifier);\n }\n }\n\n /**\n * Every pass lost its race. Report what the row currently holds and write nothing further: a\n * badge is a decoration, and the caller is a domain mutation that has already committed, so\n * throwing here would turn a cosmetic loss into a failed user action. The warning is what makes\n * the loss visible — silence is what let the original read-modify-write defect live.\n */\n const current = await this.findBadgeByIdentity(scope, scopeId, identifier);\n const currentCount = current?.count ?? 0;\n this.logger.warn('Notification badge counter change was dropped after exhausting its atomic write passes', {\n scope,\n scopeId,\n identifier,\n delta,\n currentCount,\n passes: RELATIVE_BADGE_WRITE_PASSES,\n });\n return { previousCount: currentCount, newCount: currentCount };\n }\n\n /**\n * ONE attempt at the atomic delta. Returns the before/after counts, or `null` when no row matched.\n *\n * ## The decrement floor lives in the FILTER, not in `Math.max`\n *\n * `Math.max(0, previousCount - value)` computes the floor from a value read moments earlier, which\n * is the very read this change exists to remove. The floor is therefore expressed as a GUARD the\n * store evaluates in the same statement as the write — `count: { $gte: magnitude }` — which is the\n * idiom the promotion redemption counter uses for its `maxRedemptions` ceiling.\n *\n * That guard alone would REFUSE a decrement that cannot be taken in full, where the previous\n * behaviour CLAMPED it to zero. Preserving the clamp needs a second statement, because neither\n * adapter's neutral vocabulary can express \"subtract, floored at zero\" in one (there is no `$max`\n * in `RepositoryGuardedMutation`, deliberately — an operator no adapter pair can honour identically\n * does not get a name there). So a below-floor row is set to zero by a SECOND guarded statement,\n * itself conditioned on the row still being below the floor. Each statement is atomic, and the\n * pair is safe in every interleaving:\n *\n * - first matched → the count fell by exactly `magnitude`;\n * - first missed, second matched → the count was below the floor at the moment of the write and is\n * now zero, which is what `Math.max(0, count - value)` meant for that count;\n * - both missed → either no row, or a concurrent INCREMENT crossed the floor between the two\n * statements. The caller distinguishes those and retries rather than concluding.\n *\n * ## `updatedAt` is deliberately absent from the descriptor\n *\n * Both adapters bump it themselves — mongoose's `timestamps` hook on one, an explicit\n * planned-column assignment inside `prepareGuardedUpdate` on the other. Passing it here would be a\n * second authority for the same field, and the two would disagree the day either arm changes.\n */\n private async applyGuardedCountDelta(\n resourceType: ResourceType,\n identityFilter: Record<string, unknown>,\n delta: number\n ): Promise<{ previousCount: number; newCount: number } | null> {\n if (delta >= 0) {\n const incremented = await this.repositoriesRegistry.atomicGuardedMutation<NotificationBadge>(\n resourceType,\n identityFilter,\n { increment: { count: delta } },\n );\n if (!incremented) return null;\n return { previousCount: incremented.count - delta, newCount: incremented.count };\n }\n\n const magnitude = -delta;\n\n const decremented = await this.repositoriesRegistry.atomicGuardedMutation<NotificationBadge>(\n resourceType,\n { ...identityFilter, count: { $gte: magnitude } },\n { increment: { count: delta } },\n );\n if (decremented) {\n return { previousCount: decremented.count + magnitude, newCount: decremented.count };\n }\n\n const clamped = await this.repositoriesRegistry.atomicGuardedMutation<NotificationBadge>(\n resourceType,\n { ...identityFilter, count: { $lt: magnitude } },\n { set: { count: 0 } },\n );\n if (!clamped) return null;\n /**\n * `previousCount` is reported as the post-write zero rather than as an estimate. The row's\n * pre-write count was somewhere in `[0, magnitude)` and the statement that overwrote it cannot\n * report the value it replaced — a guarded mutation returns the row AFTER the write on both\n * adapters. Nothing reads this field (it exists on `BadgeUpdateResult` and is consumed only by\n * this service's own debug line), and an invented number would be worse than a floor.\n */\n return { previousCount: clamped.count, newCount: clamped.count };\n }\n\n /**\n * Insert the badge row at ZERO so a subsequent atomic delta has something to mutate.\n *\n * Goes through the SERVICE tier (`repository.create` with the badge-scoped execution context)\n * rather than a raw insert, so the row is schema-validated and gets its scope FK injected by\n * context enrichment at birth — see {@link buildBadgeExecutionContext} for why the triggering\n * operation's own context cannot serve here.\n */\n private async materializeZeroBadge(\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<void> {\n const repository = this.resolveRepository(scope);\n if (!repository) return;\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n await repository.create<NotificationBadge>(badgeExecutionContext, this.buildNewBadge(scope, scopeId, identifier, 0));\n }\n\n /**\n * Write an ABSOLUTE count (`SET` / `RESET`).\n *\n * The read here is NOT a read-modify-write: the value written is fixed by the caller, so a\n * concurrent absolute write can only replace it wholesale, which is what an absolute write means.\n * The read decides update-versus-insert and supplies the reported `previousCount`.\n */\n private async writeAbsoluteCount(\n repository: BackendResourceRepository,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n absoluteCount: number\n ): Promise<{ previousCount: number; newCount: number }> {\n const badge = await this.findBadgeByIdentity(scope, scopeId, identifier);\n const previousCount = badge?.count ?? 0;\n\n // Update or create badge through a badge-resource-scoped EC (see\n // buildBadgeExecutionContext) so context enrichment injects the scope FK\n // (userId / organizationId) that the create DTO auto-excludes.\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n if (badge) {\n await repository.update<NotificationBadge>(badgeExecutionContext, badge._id, {\n count: absoluteCount,\n updatedAt: new Date(),\n } as any);\n } else {\n await repository.create<NotificationBadge>(badgeExecutionContext, this.buildNewBadge(scope, scopeId, identifier, absoluteCount));\n }\n\n return { previousCount, newCount: absoluteCount };\n }\n\n /**\n * Increment a badge count\n */\n public async increment<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n amount: number = 1\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.INCREMENT,\n amount\n );\n }\n\n /**\n * Decrement a badge count\n */\n public async decrement<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n amount: number = 1\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.DECREMENT,\n amount\n );\n }\n\n /**\n * Set a badge count to a specific value\n */\n public async set<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n value: number\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.SET,\n value\n );\n }\n\n /**\n * Reset a badge count to zero\n */\n public async reset<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<BadgeUpdateResult> {\n return this.executeBadgeOperation(\n executionContext,\n scope,\n scopeId,\n identifier,\n NotificationBadgeOperation.RESET\n );\n }\n\n /**\n * Recompute a DERIVED_QUERY badge and persist the result (R5).\n *\n * The count is RE-DERIVED from the source resource collection every time\n * (`count(resourceType where {...filter, [scopeField]: scopeId})`) and then\n * `SET` onto the badge — it is never incrementally tracked, so it CANNOT\n * drift (bulk mutations, deletes, reopen, out-of-band edits all reconcile on\n * the next recompute). Called by the dispatcher when the source resource is\n * mutated. No-op for non-DERIVED definitions.\n */\n public async recomputeDerivedBadge<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n definition: NotificationBadgeDefinition,\n scopeId: string\n ): Promise<void> {\n if (definition.source.kind !== NotificationBadgeSourceKind.DERIVED_QUERY) {\n return;\n }\n\n const source = definition.source;\n const sourceRepository = this.repositoriesRegistry.getRepository(source.resourceType);\n if (!sourceRepository) {\n this.logger.warn('Derived badge source repository not found', {\n identifier: definition.identifier,\n resourceType: source.resourceType,\n });\n return;\n }\n\n // Bind the scope onto the authored filter, then count the source collection.\n // The filter is FULLY self-scoped (`[scopeField]: scopeId` pins it to the\n // badge's own scope), so the count must be identical regardless of which\n // execution context drives the recompute. Build a dedicated internal EC for the\n // SOURCE resource's own count rather than reusing the caller's EC — the mutation\n // path passes the triggering op's EC (works), but the connect-seed passes an\n // APPLICATION.READ EC, and counting a foreign resource off that mismatched EC\n // threw \"Cannot read properties of undefined (reading 'operations')\". With the\n // source-scoped EC + explicit filter, contextual filtering is skipped.\n let sourceExecutionContext: ExecutionContext<any> = executionContext;\n try {\n sourceExecutionContext = await this.executionContextCreator.createForInternalRepositoryOperation({\n resourceType: source.resourceType,\n operationIdentifier: CoreResourceOperation.COUNT,\n });\n } catch {\n // Fall back to the caller's EC if the source resource has no resolvable\n // internal count operation (the explicit filter still scopes the count).\n }\n const filter = { ...source.filter, [source.scopeField]: scopeId };\n const { count } = await sourceRepository.count(sourceExecutionContext, filter, EXPLICIT_SCOPE_REPO_OPTIONS);\n\n // SET (not increment) — the derived count is authoritative.\n await this.set(executionContext, definition.scope, scopeId, definition.identifier, count);\n }\n\n /**\n * Seed every registered badge for a freshly-connected client (R6a —\n * compute-on-connect). For each definition in the connecting scope: DERIVED\n * badges are recomputed (fresh count, emits), EVENT badges have their stored\n * count re-emitted so the client paints the current value on first render.\n *\n * `executionContext` MUST be the connecting user's own authenticated context\n * (built by the WS layer from the validated socket auth) and `initiatorIds`\n * MUST be the server-validated socket identity — never client handshake data —\n * so the scopeId that drives every count is pinned to the caller's own scope\n * (no cross-tenant read). Per-badge failures are logged, never abort siblings.\n */\n public async syncBadgesForConnection<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n initiatorIds: { userId?: string | null; organizationId?: string | null }\n ): Promise<void> {\n const definitions = this.resourcesRegistry.getResourcesRegistry().notificationBadgeDefinitions ?? [];\n if (definitions.length === 0) {\n return;\n }\n\n for (const definition of definitions) {\n const scopeId =\n definition.scope === ResourcePrimaryScope.USER_SELF\n ? initiatorIds.userId\n : definition.scope === ResourcePrimaryScope.ORGANIZATIONS\n ? initiatorIds.organizationId\n : null;\n if (!scopeId) {\n continue;\n }\n\n try {\n if (definition.source.kind === NotificationBadgeSourceKind.DERIVED_QUERY) {\n await this.recomputeDerivedBadge(executionContext, definition, scopeId);\n } else {\n // EVENT_COUNTER — re-emit the stored value so the client seeds on connect.\n const count = await this.getBadgeCount(executionContext, definition.scope, scopeId, definition.identifier);\n await this.emitBadgeUpdate(definition.scope, scopeId, definition.identifier, count, initiatorIds.userId ?? undefined);\n }\n } catch (error) {\n this.logger.warn('Failed to seed badge on connection', {\n identifier: definition.identifier,\n scope: definition.scope,\n ...projectCaughtErrorLogFields(error),\n });\n }\n }\n }\n\n // ================================\n // Private Helper Methods\n // ================================\n\n /**\n * Find a badge by scope, scopeId, and identifier.\n *\n * `executionContext` is the CALLER's context and is deliberately not used for the read: a badge\n * read runs on its own badge-resource-scoped context, exactly as a badge write does, because the\n * triggering operation's context carries the wrong scope (see {@link buildBadgeExecutionContext}).\n * The parameter is kept so the private read reads like every other method on this service.\n */\n private findBadge<TResourceConfigOperation extends ResourceConfiguration_Operation<any, any, any>>(\n executionContext: ExecutionContext<TResourceConfigOperation>,\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<NotificationBadge | null> {\n return this.findBadgeByIdentity(scope, scopeId, identifier);\n }\n\n /**\n * The badge read itself, addressed only by identity.\n *\n * Split out of {@link findBadge} because the atomic write path has no caller execution context to\n * pass — it is reconciling its own guarded statements, not serving a request — and inventing one\n * to satisfy a parameter the read never consults would be ceremony.\n */\n private async findBadgeByIdentity(\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier\n ): Promise<NotificationBadge | null> {\n const repository = this.resolveRepository(scope);\n if (!repository) {\n return null;\n }\n\n const filter = {\n ...this.buildScopeFilter(scope, scopeId),\n identifier,\n };\n\n const badgeExecutionContext = await this.buildBadgeExecutionContext(scope, scopeId);\n const badges = await repository.list<NotificationBadge>(badgeExecutionContext, filter);\n return badges.length > 0 ? badges[0] : null;\n }\n\n /**\n * Resolve the repository for a given badge scope.\n *\n * Polymorphism dispatch:\n * USER_SELF → `USER_NOTIFICATION_BADGES` repository\n * ORGANIZATIONS → `ORGANIZATION_NOTIFICATION_BADGES` repository\n * APPLICATION → unsupported (variant dropped); returns `undefined` so\n * callers can fail-fast with their own error context.\n *\n * Returns `undefined` (not throws) so the caller controls error semantics —\n * `executeBadgeOperation` throws an explicit error, while `findBadge` /\n * `getAllBadges` swallow and return empty results to keep the read path\n * resilient (per existing behavior).\n */\n private resolveRepository(scope: NotificationScope): BackendResourceRepository | undefined {\n const resourceType = this.resolveResourceType(scope);\n return resourceType ? this.repositoriesRegistry.getRepository(resourceType) : undefined;\n }\n\n /**\n * Resolve the RESOURCE TYPE backing a badge scope — the same polymorphism dispatch\n * {@link resolveRepository} performs, named separately because the atomic write path addresses the\n * registry by resource type rather than by repository handle.\n *\n * One switch, two consumers: a second copy of this mapping is how a future third scope reaches one\n * of them and not the other.\n */\n private resolveResourceType(scope: NotificationScope): ResourceType | undefined {\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n return CoreResourceType.USER_NOTIFICATION_BADGES;\n case ResourcePrimaryScope.ORGANIZATIONS:\n return CoreResourceType.ORGANIZATION_NOTIFICATION_BADGES;\n default:\n return undefined;\n }\n }\n\n /**\n * Build filter for scope-specific queries.\n *\n * Each variant has its own collection, so the scope discriminator field is\n * implicit — we only need to filter by the scope-id field. The scope key is\n * still set on the payload (`buildNewBadge`) because the schema requires it\n * as the discriminated-union tag.\n */\n private buildScopeFilter(scope: NotificationScope, scopeId: string): Record<string, any> {\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n return { userId: scopeId };\n case ResourcePrimaryScope.ORGANIZATIONS:\n return { organizationId: scopeId };\n default:\n return {};\n }\n }\n\n /**\n * Build a new badge document.\n *\n * `scope` is required by the schema (it is the discriminated-union tag), so\n * we still set it on the payload even though each variant lives in a\n * dedicated collection.\n */\n private buildNewBadge(\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n count: number\n ): Partial<NotificationBadge> {\n const now = new Date();\n const base: any = {\n scope,\n identifier,\n count,\n createdAt: now,\n updatedAt: now,\n };\n\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n base.userId = scopeId;\n break;\n case ResourcePrimaryScope.ORGANIZATIONS:\n base.organizationId = scopeId;\n break;\n }\n\n return base;\n }\n\n /**\n * Emit WebSocket event for badge update.\n *\n * Routing:\n * USER_SELF → `sendToUser(scopeId, …)`\n * ORGANIZATIONS → `sendToOrganization(scopeId, …)`\n *\n * The APPLICATION arm is gone (the variant was dropped). If a future need\n * for global broadcast badges arises, reintroduce it as its own scope and\n * resource type rather than re-overloading APPLICATION.\n */\n private async emitBadgeUpdate(\n scope: NotificationScope,\n scopeId: string,\n identifier: NotificationBadgeIdentifier,\n newCount: number,\n initiatorUserId?: string\n ): Promise<void> {\n const badgeReference = this.buildBadgeReference(scope, scopeId, identifier);\n\n const payload: WS_BadgeUpdatePayload = {\n badgeReference,\n badgeCount: newCount,\n organizationId: scope === ResourcePrimaryScope.ORGANIZATIONS ? scopeId : undefined,\n };\n\n const message: WebSocketMessage = {\n type: CoreWebSocketEvent.BADGE_UPDATE,\n payload,\n timestamp: new Date(),\n userId: initiatorUserId,\n };\n\n switch (scope) {\n case ResourcePrimaryScope.USER_SELF:\n await this.webSocketService.sendToUser(scopeId, message);\n break;\n case ResourcePrimaryScope.ORGANIZATIONS:\n await this.webSocketService.sendToOrganization(scopeId, message);\n break;\n default:\n this.logger.warn('Skipping badge WS emission for unsupported scope', {\n scope,\n scopeId,\n identifier,\n });\n break;\n }\n }\n}\n"]}
@@ -139,22 +139,25 @@ export declare class NotificationDispatcherService {
139
139
  */
140
140
  private dispatchDerivedBadgeRecomputes;
141
141
  /**
142
- * Determine the badge scope and scopeId from execution context.
142
+ * Resolve WHOSE badge this is — the scopeId — for a scope the DEFINITION already fixed.
143
143
  *
144
- * Only USER_SELF and ORGANIZATIONS are supported badge scopes after the
145
- * polymorphism refactor (`.cursor/plans/notification-badges-polymorphism-refactor.md`):
146
- * the APPLICATION variant was dropped (no canonical badges declared at app
147
- * scope and no resource type backs it anymore). An operation whose
148
- * `resourcePrimaryScope` is APPLICATION (or any other unsupported value)
149
- * yields `{ scope: null, scopeId: null }` so the caller logs and skips
150
- * cleanly — never silently dispatches into the badge service where
151
- * `resolveRepository(APPLICATION)` would throw.
144
+ * ## Why this no longer decides the scope
152
145
  *
153
- * The fallback (org-then-user from `initiatorIds`) is retained for the
154
- * `undefined` / unscoped operation case so badge effects on operations that
155
- * happen to share an org/user context still fire.
146
+ * Its predecessor (`determineBadgeScope`) answered both halves from the execution context: it
147
+ * read `operation.resourcePrimaryScope`, mapped `USER_SELF` → `initiatorIds.userId` and
148
+ * `ORGANIZATIONS` → `initiatorIds.organizationId`, and for anything else — `APPLICATION`,
149
+ * `ANONYMOUS`, or an unscoped operation — guessed, preferring the organization when the request
150
+ * happened to carry one and falling back to the user. That guess decided which COLLECTION a
151
+ * counter was written to, from a property of the operation that has nothing to say about which
152
+ * badge the author meant. An operation on a user-scoped resource could only ever move a
153
+ * user-scoped counter, whatever badge its `badgeRef` named.
154
+ *
155
+ * The definition names the scope, so only the id is left, and the id is genuinely a runtime fact:
156
+ * which user, which organization. `null` means the request carries no identity at that scope
157
+ * (an anonymous or purely application-scoped call reaching an org-scoped badge), which is a skip
158
+ * rather than an error — no principal's count could have changed.
156
159
  */
157
- private determineBadgeScope;
160
+ private resolveBadgeScopeId;
158
161
  /**
159
162
  * Dispatch user notifications
160
163
  *
@@ -198,6 +201,39 @@ export declare class NotificationDispatcherService {
198
201
  * token-bearing emails still carry their `acceptUrl`. Best-effort: a missing address
199
202
  * or a send failure is logged and swallowed, never thrown into the operation pipeline.
200
203
  */
204
+ /**
205
+ * Which of the tenant's four notification categories an organization-targeted notification
206
+ * belongs to, or `undefined` when the target names no category.
207
+ *
208
+ * DERIVED from the target rather than declared per notification (#410). The two vocabularies were
209
+ * built to line up and a mapping table is the only place they can drift; the entries that are
210
+ * absent are absent for a reason:
211
+ *
212
+ * - `ORGANIZATION_USERS` fans out to every member BY DESIGN. Routing it to one address would
213
+ * change who the message is for, not merely where it lands.
214
+ * - `ORGANIZATION` is the tenant itself with no category, so it falls to `defaultEmailAddress`
215
+ * below without belonging to a switch.
216
+ */
217
+ private static readonly ORGANIZATION_NOTIFICATION_CATEGORY_BY_TARGET;
218
+ /**
219
+ * Resolve where an organization-targeted email should go, and whether it should go at all.
220
+ *
221
+ * Returns `undefined` for a target this record does not govern, so the caller falls through to
222
+ * the ordinary member fan-out. Reading the record is best-effort: a tenant with no
223
+ * `organizationNotifications` row, or a read that fails, must fall through to the behaviour that
224
+ * existed before this feature rather than silently dropping the notification.
225
+ */
226
+ private resolveOrganizationNotificationRouting;
227
+ /**
228
+ * Send one organization-routed email to the tenant's configured address (#410).
229
+ *
230
+ * Deliberately NOT reusing `dispatchEmailToRecipientAddress`: that path exists for an address
231
+ * read off the operation's own object — an invitee who has no account — and its logging and its
232
+ * `userId: ''` sentinel both say so. This recipient is a tenant's own routing address, a
233
+ * different thing with a different reason for having no user, and collapsing them would make the
234
+ * logs unable to answer which kind of send happened.
235
+ */
236
+ private dispatchEmailToOrganizationAddress;
201
237
  private dispatchEmailToRecipientAddress;
202
238
  /**
203
239
  * Enqueue a batch of emails for asynchronous sending.
@@ -225,6 +261,34 @@ export declare class NotificationDispatcherService {
225
261
  * Handles both fixed targets and custom userIdsSelector
226
262
  */
227
263
  private getUserIdsForTarget;
264
+ /**
265
+ * The users an APPLICATION-level notification is addressed to: holders of the target's app roles.
266
+ *
267
+ * The app-level counterpart of {@link getOrganizationRecipientUserIds}, and it mirrors that method
268
+ * deliberately — same sub-call context, same initiator exclusion, same "no repository means no
269
+ * recipients" posture — so the two halves of one feature cannot drift into behaving differently.
270
+ *
271
+ * ## Tenancy: there is no tenant to cross
272
+ *
273
+ * These recipients are application-level administrators rather than members of the tenant whose row
274
+ * triggered the event, so the question "does this leak one tenant's data to another" has to be
275
+ * answered rather than assumed. It is answered by the population: all 17 notifications sit on
276
+ * APPLICATION-scoped resources (`users`, application API keys, application OAuth clients), and
277
+ * `resolveOrganizationName` — the only place a tenant's name enters an email context — returns
278
+ * `undefined` unless the operation's `resourcePrimaryScope` is `ORGANIZATIONS`. So no tenant name
279
+ * reaches these bodies, by construction rather than by care.
280
+ *
281
+ * That is a property of the CURRENT population, not a guarantee about future ones. An
282
+ * ORGANIZATIONS-scoped operation that adds an `APPLICATION_*` notification would put a tenant's data
283
+ * in front of a non-member, and this is the comment that should stop it.
284
+ *
285
+ * ## Why the query filters rather than listing everyone
286
+ *
287
+ * `appRoles` is `.isDBIndexed()`, and the same `$in` shape is what the super-administrator floor uses
288
+ * to count administrators. The organization path can afford to filter roles in memory because its
289
+ * population is one tenant's roster; the application population is every user of the application.
290
+ */
291
+ private getApplicationRecipientUserIds;
228
292
  /**
229
293
  * Resolve the per-recipient context consumed by every greeting surface (email
230
294
  * subject/body, the `initiatorName` personalization, batch/direct sends).
@@ -246,6 +310,28 @@ export declare class NotificationDispatcherService {
246
310
  * as `displayName`; `firstName` is the informal variant with the same email
247
311
  * floor.
248
312
  */
313
+ /**
314
+ * Whether this notification may be sent to THIS recipient on THIS channel, given the recipient's
315
+ * own channel switches (#409).
316
+ *
317
+ * Until 2026-09-08 `UserPreferences.notifications` was stored, editable on the self-preferences
318
+ * screen, classified as personal data, subject-exported and reset on erasure — and read by
319
+ * nothing. A person who turned email off still received email.
320
+ *
321
+ * ONE predicate rather than a check at each of the three send loops, because that is the shape
322
+ * this repository's own rule asks for: an invariant applied at some of its call sites is the
323
+ * defect it keeps recording. The loops call this; nothing else decides.
324
+ *
325
+ * Three ways a message is delivered regardless, each for a different reason:
326
+ * - the target is ROLE-addressed (see `userNotificationTargetIsSuppressibleByRecipientPreference`)
327
+ * — the recipient did not choose to receive it as a person;
328
+ * - the notification declares `alwaysDeliver` — a security notice a compromised account's owner
329
+ * must still receive;
330
+ * - the channel has no switch, or the recipient has no preferences row at all. A missing record
331
+ * must never read as "everything off": preferences are created lazily, so a user who has never
332
+ * opened the settings screen would otherwise silently stop receiving everything.
333
+ */
334
+ private recipientAcceptsNotificationChannel;
249
335
  private fetchUserContext;
250
336
  private getOrganizationRecipientUserIds;
251
337
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"notifications-dispatcher.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/services/notifications-dispatcher.backend.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,+EAA+E,CAAC;AAE3I,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AACvG,OAAO,EACL,+BAA+B,EAY/B,qBAAqB,EAIrB,yBAAyB,EACzB,6BAA6B,EAC7B,oCAAoC,EACpC,8EAA8E,EAE9E,cAAc,EAQd,4BAA4B,EAI7B,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAoB,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,uEAAuE,CAAC;AAK/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAG/G,OAAO,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AAChK,OAAO,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAC3H,OAAO,EAAE,kCAAkC,EAAE,MAAM,oGAAoG,CAAC;AAcxJ;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,SAAS,EAAE;IACT,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,EACD,YAAY,EAAE;IACZ,UAAU,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ACH;;;;;;;;OAQG;IACH,OAAO,CAAC,wBAAwB;CASjC"}
1
+ {"version":3,"file":"notifications-dispatcher.backend.service.d.ts","sourceRoot":"","sources":["../../../../../src/notifications/services/notifications-dispatcher.backend.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,+EAA+E,CAAC;AAE3I,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AACvG,OAAO,EACL,+BAA+B,EAgB/B,qBAAqB,EAIrB,yBAAyB,EACzB,6BAA6B,EAC7B,oCAAoC,EACpC,8EAA8E,EAE9E,cAAc,EASd,4BAA4B,EAI7B,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AAE9G,OAAO,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAoB,MAAM,uDAAuD,CAAC;AAC3G,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,uEAAuE,CAAC;AAK/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sEAAsE,CAAC;AAG/G,OAAO,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AAChK,OAAO,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAC3H,OAAO,EAAE,kCAAkC,EAAE,MAAM,oGAAoG,CAAC;AAcxJ;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,SAAS,EAAE;IACT,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,EACD,YAAY,EAAE;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IA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