@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
@@ -11,6 +11,7 @@ import type { PlatformMutualizedHandlerBackendService } from '../../../requests/
11
11
  import type { ServerlessServicesHandlerBackendService } from '../../../requests/service/serverless-services-handler.backend.service';
12
12
  import type { ExecutionContextCreatorBackendService } from '../../../runtime/services/execution-context-creator.backend.service';
13
13
  import type { SystemAccessBackendService } from '../../../base-classes/services/services/system-access.backend.service';
14
+ import type { WorkerRemoteClientFactoryBackendService } from '../../../applications/services/worker-remote-client-factory.backend.service';
14
15
  import type { ServiceOptions } from '../../../base-classes/models/repositories.backend.schemas';
15
16
  type Augment<TAugment extends object | undefined = undefined> = TAugment extends undefined ? {} : TAugment;
16
17
  export type ResourceOperationCustomImplementation_InputTypeOf<TMode extends ResourceOperation_CustomServiceImplementationMode = ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL, TInput extends (z.ZodSchema | undefined) = z.ZodAny | undefined, TOutput extends z.ZodSchema = z.ZodAny, TAugment extends object | undefined = undefined> = (TMode extends ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL | ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS ? TInput extends z.ZodSchema ? z.infer<TInput> : never : TMode extends ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS ? TInput extends z.ZodSchema ? z.infer<TInput> & Augment<TAugment> : never : z.infer<TOutput>);
@@ -82,6 +83,27 @@ export type ResourceOperation_CustomImplementation_Utils = {
82
83
  * not bind the system-access service still construct.
83
84
  */
84
85
  systemAccessService?: SystemAccessBackendService;
86
+ /**
87
+ * Dispatch to one of the application's declared WORKERS — the sanctioned way to move work off the
88
+ * request path from application backend code.
89
+ *
90
+ * `workerClientFactory.client('<workerName>').post('/route', body)` mints the
91
+ * `APPLICATION_WORKER_REQUEST` JWT the worker's verifier pins and reaches the worker at the URL
92
+ * the deploy injected. The factory fails CLOSED on an undeclared worker rather than dispatching to
93
+ * a guessed address.
94
+ *
95
+ * ## Why it had to be added here (#426)
96
+ *
97
+ * The factory shipped, was bound in DI, and had NO caller anywhere — and this is why: a custom
98
+ * implementation is the one place an application writes backend logic, and this bag was the only
99
+ * thing it receives. There was no handle, so no application COULD call a worker, which is the
100
+ * deeper half of why the backend-to-worker chain had never run for anyone. Adding the handle is
101
+ * what turns a shipped mechanism into a reachable one.
102
+ *
103
+ * Optional for the same reason `systemAccessService` is: a minimal test container that does not
104
+ * bind the factory must still construct.
105
+ */
106
+ workerClientFactory?: WorkerRemoteClientFactoryBackendService;
85
107
  /** SAML metadata service — for DISCOVER_ENDPOINTS (emits SAML_METADATA_PARSED) */
86
108
  samlMetadataService?: {
87
109
  parseIdPMetadata(metadataXml: string): unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"resource-operation-custom-implementation-base.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,iDAAiD,EAGlD,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACnH,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,0EAA0E,CAAC;AAChI,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,6CAA6C,CAAC;AACzG,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AACrK,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qFAAqF,CAAC;AAC5I,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,iFAAiF,CAAC;AAC/I,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,iFAAiF,CAAC;AAC/I,OAAO,KAAK,EAAE,qCAAqC,EAAE,MAAM,+EAA+E,CAAC;AAC3I,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iFAAiF,CAAC;AAClI,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qEAAqE,CAAC;AAE1G,KAAK,OAAO,CAAC,QAAQ,SAAS,MAAM,GAAC,SAAS,GAAG,SAAS,IAAI,QAAQ,SAAS,SAAS,GAAG,EAAE,GAAG,QAAQ,CAAC;AAEzG,MAAM,MAAM,iDAAiD,CAC3D,KAAK,SAAS,iDAAiD,GAAG,iDAAiD,CAAC,YAAY,EAChI,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,EAC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,gBAAgB,CAAC,GAAG,CAAC,EACvC,KAAK,EAAE,4CAA4C,GAClD,OAAO,CAAC,kDAAkD,CACzD,iDAAiD,CAAC,wBAAwB,EAC1E,MAAM,EAAE,OAAO,CAChB,CAAC;IAEJ;;;;;;;;;;;;;;;;;;OAkBG;aACa,sBAAsB,CACpC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,iDAAiD,CACtD,iDAAiD,CAAC,wBAAwB,EAC1E,MAAM,EAAE,OAAO,CAChB,EACD,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACvC,KAAK,EAAE,4CAA4C,GAClD,OAAO,CAAC,kDAAkD,CACzD,iDAAiD,CAAC,wBAAwB,EAC1E,MAAM,EAAE,OAAO,CAChB,CAAC;IAEJ;;;;;;;;;;;;;;;;;;OAkBG;aACa,QAAQ,CACtB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,iDAAiD,CACtD,iDAAiD,CAAC,UAAU,EAC5D,MAAM,EAAE,OAAO,CAChB,EACD,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACvC,KAAK,EAAE,4CAA4C,GAClD,OAAO,CAAC,kDAAkD,CACzD,iDAAiD,CAAC,UAAU,EAC5D,MAAM,EAAE,OAAO,CAChB,CAAC;CACL"}
1
+ {"version":3,"file":"resource-operation-custom-implementation-base.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,iDAAiD,EAGlD,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAC5G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kEAAkE,CAAC;AACnH,OA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DAAiD,CAAC,wBAAwB,EAC1E,MAAM,EAAE,OAAO,CAChB,EACD,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACvC,KAAK,EAAE,4CAA4C,GAClD,OAAO,CAAC,kDAAkD,CACzD,iDAAiD,CAAC,wBAAwB,EAC1E,MAAM,EAAE,OAAO,CAChB,CAAC;IAEJ;;;;;;;;;;;;;;;;;;OAkBG;aACa,QAAQ,CACtB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,KAAK,EAAE,iDAAiD,CACtD,iDAAiD,CAAC,UAAU,EAC5D,MAAM,EAAE,OAAO,CAChB,EACD,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,EACvC,KAAK,EAAE,4CAA4C,GAClD,OAAO,CAAC,kDAAkD,CACzD,iDAAiD,CAAC,UAAU,EAC5D,MAAM,EAAE,OAAO,CAChB,CAAC;CACL"}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-operation-custom-implementation-base.backend.service.js","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,iDAAiD,EACjD,SAAS,EACT,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAgD/B,MAAM,CAAC,MAAM,wDAAwD,GAAG,CACtE,IAAuD,EACvD,aAAiC,EACjC,MAAe,EACf,aAAsB,EACtB,YAAyC,EAChC,EAAE;IAEX,MAAM,KAAK,GAAG,CAAC,MAAgC,EAAE,MAAe,EAAE,QAAiB,KAAK,EAAW,EAAE;QACnG,IAAI,CAAC,MAAM;YACT,OAAO,MAAM,CAAC;QAEhB,IAAG,MAAM,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,KAAK;gBACP,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;Y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0E;QAC1E,uEAAuE;QACvE,IAAI,IAAI,KAAK,iDAAiD,CAAC,uBAAuB,EAAE,CAAC;YACvF,OAAO,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAY,CAAC;QACvD,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,EAAE,aAAa,CAAY,CAAC;IACjD,CAAC;AACH,CAAC,CAAA;AA2FD,MAAM,OAAgB,yCAAyC;CAwJ9D","sourcesContent":["import { z } from 'zod';\nimport {\n ResourceConfiguration_Operation,\n ResourceConfiguration_OperationPath,\n ResourceOperation_CustomServiceImplementationMode,\n ErrorType,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ServicesRegistryHandlerBackendService } from './services-registry-handler.backend.service';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport type { ExternalApiHandlerBackendService } from '~wildo-backend-lib/external-providers/services/external-api-handler.backend.service';\nimport type { PlatformMutualizedHandlerBackendService } from '~wildo-backend-lib/requests/service/platform-mutualized-handler.backend.service';\nimport type { ServerlessServicesHandlerBackendService } from '~wildo-backend-lib/requests/service/serverless-services-handler.backend.service';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { ServiceOptions } from '~wildo-backend-lib/base-classes/models/repositories.backend.schemas';\n\ntype Augment<TAugment extends object|undefined = undefined> = TAugment extends undefined ? {} : TAugment;\n\nexport type ResourceOperationCustomImplementation_InputTypeOf<\n TMode extends ResourceOperation_CustomServiceImplementationMode = ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL,\n TInput extends (z.ZodSchema | undefined) = z.ZodAny | undefined,\n TOutput extends z.ZodSchema = z.ZodAny,\n TAugment extends object|undefined = undefined\n> =(\n TMode extends ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL | ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS\n ? TInput extends z.ZodSchema\n ? z.infer<TInput>\n : never\n : TMode extends ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS\n ? TInput extends z.ZodSchema\n ? z.infer<TInput> & Augment<TAugment>\n : never\n : z.infer<TOutput>\n)\n\nexport type ResourceOperationCustomImplementation_OutputTypeOf<\n TMode extends ResourceOperation_CustomServiceImplementationMode = ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL,\n TInput extends (z.ZodSchema | undefined) = z.ZodAny | undefined,\n TOutput extends z.ZodSchema = z.ZodAny,\n TAugment extends object|undefined = undefined\n> = (\n TMode extends ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS\n ? TInput extends z.ZodSchema\n ? z.infer<TInput> & Augment<TAugment>\n : Augment<TAugment>\n : z.infer<TOutput>\n)\n\n\n\nexport const parseResourceOperation_CustomServiceImplementationSchema = <TSchema extends z.ZodTypeAny | undefined, TReturn = TSchema extends z.ZodTypeAny ? z.infer<TSchema> : unknown>(\n mode: ResourceOperation_CustomServiceImplementationMode,\n inputOrOutput: 'input' | 'output',\n schema: TSchema,\n objectToParse: unknown,\n errorBuilder?: ErrorBuilderBackendService,\n): TReturn => {\n\n const parse = (schema: z.ZodTypeAny | undefined, object: unknown, loose: boolean = false): unknown => {\n if (!schema)\n return object;\n\n if(schema instanceof z.ZodObject) {\n if (loose)\n return z.looseObject(schema.shape).parse(object);\n return schema.parse(object);\n }\n if(schema instanceof z.ZodArray) {\n if (!(object instanceof Array)) {\n if (errorBuilder) {\n /** @wildo_source:part:start example.backend.operation.error-throw facet:kind:usage-example facet:audience:app-developer */\n // Inside a backend custom-operation hook you receive `utils.errorBuilder`.\n // Throw a WildoError with it — NEVER `throw new Error(...)`:\n // • the ErrorType drives the HTTP status (VALIDATION → 400 here);\n // • customMessageReference names the localized user message (resolved by\n // tErrorMessage → errors_messages.<ref>.msg) — do NOT hardcode English;\n // • any dynamic values go in `context` as structured keys (log-only for\n // most types), never interpolated into a `context.message` string.\n throw errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n });\n /** @wildo_source:part:end example.backend.operation.error-throw */\n }\n // Bootstrap/leaf fallback ONLY — errorBuilder is unavailable here (pre-DI).\n throw new Error('Input is not an array');\n }\n const itemSchema = (schema as z.ZodArray<z.ZodTypeAny>).element;\n object = object.map((item: unknown) => parse(itemSchema, item, loose));\n return object;\n }\n return schema.parse(object);\n }\n\n if(inputOrOutput === 'input') {\n // PREFIX and REPLACE both receive data that may contain augmented fields\n // from basicPrefixOperation or prior PREFIX handlers — use loose parse\n // to preserve those fields while still validating declared schema fields.\n if (mode === ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS\n || mode === ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS) {\n return parse(schema, objectToParse, true) as TReturn;\n }\n return parse(schema, objectToParse) as TReturn;\n\n } else {\n // PREFIX output may contain augmented fields (TAugment) that the declared\n // output schema doesn't know about — use loose parse to preserve them.\n if (mode === ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS) {\n return parse(schema, objectToParse, true) as TReturn;\n }\n return parse(schema, objectToParse) as TReturn;\n }\n}\n\n\n\n/**\n * Utilities object provided to custom implementation methods.\n *\n * Contains:\n * - Service instances (logger, errorBuilder, registries, handlers)\n * - `executionContextCreator`: Creates child execution contexts for cross-resource sub-calls\n * - Contextual data for the operation:\n * - `objectContext`: Parent and child resource data (fetched based on resource configuration)\n * - `initiatorUserContext`: User context of the user/organization/application initiating the operation\n * - `currentObject`: The current resource object (for UPDATE/DELETE operations) or input data (for CREATE operations)\n *\n * Context fields are populated automatically by the service registry handler based on:\n * - Resource configuration context needs analysis\n * - Operation type (CREATE uses input data, UPDATE/DELETE fetches current object)\n *\n * ### Cross-resource operations\n *\n * For cross-resource calls from custom impls, use `utils.executionContextCreator.createForSubCall()`\n * to create a child context with proper depth tracking and cycle detection, then pass it\n * to `utils.servicesRegistry`. Example:\n *\n * ```ts\n * const subCtx = await utils.executionContextCreator.createForSubCall(\n * executionContext, targetResourceType, CoreResourceOperation.CREATE\n * );\n * await utils.servicesRegistry.create(targetResourceType, subCtx, data);\n * ```\n *\n * Calling `servicesRegistry` directly with the parent context is functionally safe\n * (doOperation corrects the operation), but skips depth/cycle tracking.\n */\nexport type ResourceOperation_CustomImplementation_Utils = {\n logger: LoggerService;\n errorBuilder: ErrorBuilderBackendService;\n resourcesRegistry: ResourcesRegistryBackendService;\n servicesRegistry: ServicesRegistryHandlerBackendService;\n /**\n * Options of the operation currently executing, including its database\n * transaction. Cross-resource mutations from a hook must forward these\n * options when they belong to the same semantic unit of work.\n */\n serviceOptions?: ServiceOptions;\n repositoriesRegistry: RepositoriesRegistryHandlerBackendService;\n externalApiHandler: ExternalApiHandlerBackendService;\n platformMutualizedHandler: PlatformMutualizedHandlerBackendService;\n serverlessServicesHandler: ServerlessServicesHandlerBackendService;\n /**\n * Creates child execution contexts for cross-resource sub-calls with proper\n * depth tracking and cycle detection. Use `createForSubCall()` when calling\n * `servicesRegistry` methods from a custom implementation.\n */\n executionContextCreator: ExecutionContextCreatorBackendService;\n /**\n * The SANCTIONED privileged-access path for custom implementations. A custom\n * impl is a request-triggered elevation site: it runs inside the caller's\n * (often anonymous / low-privilege) execution context but sometimes must read\n * or write a resource that context cannot reach (e.g. an anonymous lead-capture\n * CREATE that needs a users-by-email lookup). Route those through\n * `systemAccessService.readAsSystem` / `listAsSystem` / `createAsSystem` /\n * `updateAsSystem` — each is fail-closed on the target's `systemAccessPolicy`\n * opt-in AND emits a `SYSTEM_CONTEXT_*` audit event. Do NOT hand-build a\n * super-admin context via `executionContextCreator` for an ACL bypass; that\n * path is ungated and unaudited. Optional so minimal test containers that do\n * not bind the system-access service still construct.\n */\n systemAccessService?: SystemAccessBackendService;\n /** SAML metadata service — for DISCOVER_ENDPOINTS (emits SAML_METADATA_PARSED) */\n samlMetadataService?: { parseIdPMetadata(metadataXml: string): unknown };\n /**\n * Contextual data about parent and child resources.\n * Structure: { parents: Record<string, any>, children: Record<string, any> }\n * Populated based on resource configuration context needs.\n */\n objectContext?: { parents: Record<string, any>; children: Record<string, any> };\n /**\n * User context of the initiator (user/organization/application) performing the operation.\n * Populated from execution context.\n */\n initiatorUserContext?: any;\n /**\n * Current resource object (for UPDATE/DELETE) or input data (for CREATE).\n * For UPDATE/DELETE: Fetched from repository before custom implementation execution.\n * For CREATE: Uses the input data provided to the operation.\n */\n currentObject?: any;\n};\n\nexport abstract class ResourceOperationCustomImplementationBase<\n TInput extends z.ZodSchema = z.ZodAny,\n TOutput extends z.ZodSchema = z.ZodAny,\n> {\n\n public abstract getPlaceholders(): ResourceOperation_CustomServiceImplementationMode[];\n\n /**\n * Replaces the ENTIRE operation pipeline — no core CRUD, no notifications, no other hooks.\n * Single-owner mode: if multiple registrations declare this, highest priority wins.\n *\n * A registration exposing this mode cannot enable `transactionalCore`: the\n * override returns before the framework-owned core transaction is entered,\n * so advertising that atomicity boundary would be false.\n */\n public abstract overrideAll(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL, TInput, TOutput>,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL,\n TInput, TOutput\n >>;\n\n /**\n * Runs before core CRUD. Augments `data` via spread-merge (`data = { ...data, ...result }`).\n *\n * **Multi-registration execution:** handlers run sequentially by ascending priority number\n * (lower number = higher priority = runs first). Each handler receives the accumulated `data`\n * from all prior handlers. For field conflicts, **last-writer-wins**: the handler with the\n * HIGHEST priority number (lowest priority) overwrites fields set by earlier handlers.\n *\n * **Array inputs (CREATE_MANY):** handler must return the full transformed array, not a\n * spread-merged object. Non-array returns are silently dropped with a debug log.\n *\n * `utils.currentObject` reflects pre-PREFIX state (original DB record or CREATE input).\n */\n public abstract prefixCoreOperations<TAugment extends object|undefined = undefined>(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS,\n TInput, TOutput, TAugment>,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS,\n TInput, TOutput, TAugment\n >>;\n\n /**\n * Replaces the core CRUD **result** — the core DB operation still runs, this overwrites `currentState`.\n * Receives PREFIX-augmented `data` as input. Single-owner mode: highest priority wins.\n */\n public abstract replaceCoreOperations<TAugment extends object|undefined = undefined>(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS,\n TInput, TOutput, TAugment\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS,\n TInput, TOutput, TAugment\n >>;\n\n /**\n * Runs after core CRUD and REPLACE. Input is the core operation result.\n *\n * **DELETE operations:** `input` is a `string` (the deleted `_id`) or `string[]` (bulk),\n * NOT the deleted document. Use `utils.currentObject` to access the pre-deletion document.\n * Handlers must guard against non-object input when destructuring.\n *\n * With multi-registration, handlers run sequentially by priority — each receives the previous handler's output.\n */\n public abstract postfixCoreOperations(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.POSTFIX_CORE_OPERARTIONS,\n TInput, TOutput\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.POSTFIX_CORE_OPERARTIONS,\n TInput, TOutput\n >>;\n\n /**\n * Runs after notification dispatch. Input is the current operation result.\n *\n * **DELETE operations:** `input` is a `string` (the deleted `_id`) or `string[]` (bulk),\n * NOT the deleted document. Use `utils.currentObject` to access the pre-deletion document.\n *\n * With multi-registration, handlers run sequentially by priority — each receives the previous handler's output.\n *\n * On a framework-owned transactional operation, this hook runs only after\n * the root commit and framework post-commit effects finish. It receives the\n * committed callback attempt's context and no completed transaction in\n * `utils.serviceOptions`. A thrown error therefore rejects the response after\n * an irreversible commit; this phase is for request-scoped result transforms,\n * not mutation-owned external work.\n *\n * Because the phase transforms the returned value, it is not accepted when\n * the operation reuses an explicit or ambient caller-owned transaction:\n * that nested call must return before its caller can commit.\n */\n public abstract afterUserNotifications(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AFTER_USER_NOTIFICATIONS,\n TInput, TOutput\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AFTER_USER_NOTIFICATIONS,\n TInput, TOutput\n >>;\n\n /**\n * Final hook — runs at the very end of the pipeline, after notifications and lifecycle evaluations.\n *\n * **DELETE operations:** `input` is a `string` (the deleted `_id`) or `string[]` (bulk),\n * NOT the deleted document. Use `utils.currentObject` to access the pre-deletion document.\n *\n * With multi-registration, handlers run sequentially by priority — each receives the previous handler's output.\n *\n * On a framework-owned transactional operation, this hook runs only after\n * the root commit and framework post-commit effects finish. It receives the\n * committed callback attempt's context and no completed transaction in\n * `utils.serviceOptions`. A thrown error therefore rejects the response after\n * an irreversible commit; this phase is for request-scoped result transforms,\n * not mutation-owned external work.\n *\n * Because the phase transforms the returned value, it is not accepted when\n * the operation reuses an explicit or ambient caller-owned transaction:\n * that nested call must return before its caller can commit.\n */\n public abstract atTheEnd(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AT_THE_END,\n TInput, TOutput\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AT_THE_END,\n TInput, TOutput\n >>;\n}\n"]}
1
+ {"version":3,"file":"resource-operation-custom-implementation-base.backend.service.js","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-operation-custom-implementation-base.backend.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,iDAAiD,EACjD,SAAS,EACT,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAiD/B,MAAM,CAAC,MAAM,wDAAwD,GAAG,CACtE,IAAuD,EACvD,aAAiC,EACjC,MAAe,EACf,aAAsB,EACtB,YAAyC,EAChC,EAAE;IAEX,MAAM,KAAK,GAAG,CAAC,MAAgC,EAAE,MAAe,EAAE,QAAiB,KAAK,EAAW,EAAE;QACnG,IAAI,CAAC,MAAM;YACT,OAAO,MAAM,CAAC;QAEhB,IAAG,MAAM,YAAY,CAAC,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,KAAK;gBACP,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACnD,OAAO,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QACD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E,CAAC;YACvF,OAAO,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAY,CAAC;QACvD,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,EAAE,aAAa,CAAY,CAAC;IACjD,CAAC;AACH,CAAC,CAAA;AAgHD,MAAM,OAAgB,yCAAyC;CAwJ9D","sourcesContent":["import { z } from 'zod';\nimport {\n ResourceConfiguration_Operation,\n ResourceConfiguration_OperationPath,\n ResourceOperation_CustomServiceImplementationMode,\n ErrorType,\n ErrorCustomMessageReference,\n} from '@wildo-ai/saas-models';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport type { LoggerService } from '~wildo-backend-lib/monitoring/logger/services/logger.service';\nimport type { ErrorBuilderBackendService } from '~wildo-backend-lib/errors/services/error-builder.backend.service';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ServicesRegistryHandlerBackendService } from './services-registry-handler.backend.service';\nimport type { RepositoriesRegistryHandlerBackendService } from '~wildo-backend-lib/base-classes/services/repositories/repositories-registry-handler.backend.service';\nimport type { ExternalApiHandlerBackendService } from '~wildo-backend-lib/external-providers/services/external-api-handler.backend.service';\nimport type { PlatformMutualizedHandlerBackendService } from '~wildo-backend-lib/requests/service/platform-mutualized-handler.backend.service';\nimport type { ServerlessServicesHandlerBackendService } from '~wildo-backend-lib/requests/service/serverless-services-handler.backend.service';\nimport type { ExecutionContextCreatorBackendService } from '~wildo-backend-lib/runtime/services/execution-context-creator.backend.service';\nimport type { SystemAccessBackendService } from '~wildo-backend-lib/base-classes/services/services/system-access.backend.service';\nimport type { WorkerRemoteClientFactoryBackendService } from '~wildo-backend-lib/applications/services/worker-remote-client-factory.backend.service';\nimport type { ServiceOptions } from '~wildo-backend-lib/base-classes/models/repositories.backend.schemas';\n\ntype Augment<TAugment extends object|undefined = undefined> = TAugment extends undefined ? {} : TAugment;\n\nexport type ResourceOperationCustomImplementation_InputTypeOf<\n TMode extends ResourceOperation_CustomServiceImplementationMode = ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL,\n TInput extends (z.ZodSchema | undefined) = z.ZodAny | undefined,\n TOutput extends z.ZodSchema = z.ZodAny,\n TAugment extends object|undefined = undefined\n> =(\n TMode extends ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL | ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS\n ? TInput extends z.ZodSchema\n ? z.infer<TInput>\n : never\n : TMode extends ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS\n ? TInput extends z.ZodSchema\n ? z.infer<TInput> & Augment<TAugment>\n : never\n : z.infer<TOutput>\n)\n\nexport type ResourceOperationCustomImplementation_OutputTypeOf<\n TMode extends ResourceOperation_CustomServiceImplementationMode = ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL,\n TInput extends (z.ZodSchema | undefined) = z.ZodAny | undefined,\n TOutput extends z.ZodSchema = z.ZodAny,\n TAugment extends object|undefined = undefined\n> = (\n TMode extends ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS\n ? TInput extends z.ZodSchema\n ? z.infer<TInput> & Augment<TAugment>\n : Augment<TAugment>\n : z.infer<TOutput>\n)\n\n\n\nexport const parseResourceOperation_CustomServiceImplementationSchema = <TSchema extends z.ZodTypeAny | undefined, TReturn = TSchema extends z.ZodTypeAny ? z.infer<TSchema> : unknown>(\n mode: ResourceOperation_CustomServiceImplementationMode,\n inputOrOutput: 'input' | 'output',\n schema: TSchema,\n objectToParse: unknown,\n errorBuilder?: ErrorBuilderBackendService,\n): TReturn => {\n\n const parse = (schema: z.ZodTypeAny | undefined, object: unknown, loose: boolean = false): unknown => {\n if (!schema)\n return object;\n\n if(schema instanceof z.ZodObject) {\n if (loose)\n return z.looseObject(schema.shape).parse(object);\n return schema.parse(object);\n }\n if(schema instanceof z.ZodArray) {\n if (!(object instanceof Array)) {\n if (errorBuilder) {\n /** @wildo_source:part:start example.backend.operation.error-throw facet:kind:usage-example facet:audience:app-developer */\n // Inside a backend custom-operation hook you receive `utils.errorBuilder`.\n // Throw a WildoError with it — NEVER `throw new Error(...)`:\n // • the ErrorType drives the HTTP status (VALIDATION → 400 here);\n // • customMessageReference names the localized user message (resolved by\n // tErrorMessage → errors_messages.<ref>.msg) — do NOT hardcode English;\n // • any dynamic values go in `context` as structured keys (log-only for\n // most types), never interpolated into a `context.message` string.\n throw errorBuilder.buildError(ErrorType.VALIDATION, undefined, {\n customMessageReference: ErrorCustomMessageReference.SERVICE_RESOURCE_VALIDATION_FAILED,\n });\n /** @wildo_source:part:end example.backend.operation.error-throw */\n }\n // Bootstrap/leaf fallback ONLY — errorBuilder is unavailable here (pre-DI).\n throw new Error('Input is not an array');\n }\n const itemSchema = (schema as z.ZodArray<z.ZodTypeAny>).element;\n object = object.map((item: unknown) => parse(itemSchema, item, loose));\n return object;\n }\n return schema.parse(object);\n }\n\n if(inputOrOutput === 'input') {\n // PREFIX and REPLACE both receive data that may contain augmented fields\n // from basicPrefixOperation or prior PREFIX handlers — use loose parse\n // to preserve those fields while still validating declared schema fields.\n if (mode === ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS\n || mode === ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS) {\n return parse(schema, objectToParse, true) as TReturn;\n }\n return parse(schema, objectToParse) as TReturn;\n\n } else {\n // PREFIX output may contain augmented fields (TAugment) that the declared\n // output schema doesn't know about — use loose parse to preserve them.\n if (mode === ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS) {\n return parse(schema, objectToParse, true) as TReturn;\n }\n return parse(schema, objectToParse) as TReturn;\n }\n}\n\n\n\n/**\n * Utilities object provided to custom implementation methods.\n *\n * Contains:\n * - Service instances (logger, errorBuilder, registries, handlers)\n * - `executionContextCreator`: Creates child execution contexts for cross-resource sub-calls\n * - Contextual data for the operation:\n * - `objectContext`: Parent and child resource data (fetched based on resource configuration)\n * - `initiatorUserContext`: User context of the user/organization/application initiating the operation\n * - `currentObject`: The current resource object (for UPDATE/DELETE operations) or input data (for CREATE operations)\n *\n * Context fields are populated automatically by the service registry handler based on:\n * - Resource configuration context needs analysis\n * - Operation type (CREATE uses input data, UPDATE/DELETE fetches current object)\n *\n * ### Cross-resource operations\n *\n * For cross-resource calls from custom impls, use `utils.executionContextCreator.createForSubCall()`\n * to create a child context with proper depth tracking and cycle detection, then pass it\n * to `utils.servicesRegistry`. Example:\n *\n * ```ts\n * const subCtx = await utils.executionContextCreator.createForSubCall(\n * executionContext, targetResourceType, CoreResourceOperation.CREATE\n * );\n * await utils.servicesRegistry.create(targetResourceType, subCtx, data);\n * ```\n *\n * Calling `servicesRegistry` directly with the parent context is functionally safe\n * (doOperation corrects the operation), but skips depth/cycle tracking.\n */\nexport type ResourceOperation_CustomImplementation_Utils = {\n logger: LoggerService;\n errorBuilder: ErrorBuilderBackendService;\n resourcesRegistry: ResourcesRegistryBackendService;\n servicesRegistry: ServicesRegistryHandlerBackendService;\n /**\n * Options of the operation currently executing, including its database\n * transaction. Cross-resource mutations from a hook must forward these\n * options when they belong to the same semantic unit of work.\n */\n serviceOptions?: ServiceOptions;\n repositoriesRegistry: RepositoriesRegistryHandlerBackendService;\n externalApiHandler: ExternalApiHandlerBackendService;\n platformMutualizedHandler: PlatformMutualizedHandlerBackendService;\n serverlessServicesHandler: ServerlessServicesHandlerBackendService;\n /**\n * Creates child execution contexts for cross-resource sub-calls with proper\n * depth tracking and cycle detection. Use `createForSubCall()` when calling\n * `servicesRegistry` methods from a custom implementation.\n */\n executionContextCreator: ExecutionContextCreatorBackendService;\n /**\n * The SANCTIONED privileged-access path for custom implementations. A custom\n * impl is a request-triggered elevation site: it runs inside the caller's\n * (often anonymous / low-privilege) execution context but sometimes must read\n * or write a resource that context cannot reach (e.g. an anonymous lead-capture\n * CREATE that needs a users-by-email lookup). Route those through\n * `systemAccessService.readAsSystem` / `listAsSystem` / `createAsSystem` /\n * `updateAsSystem` — each is fail-closed on the target's `systemAccessPolicy`\n * opt-in AND emits a `SYSTEM_CONTEXT_*` audit event. Do NOT hand-build a\n * super-admin context via `executionContextCreator` for an ACL bypass; that\n * path is ungated and unaudited. Optional so minimal test containers that do\n * not bind the system-access service still construct.\n */\n systemAccessService?: SystemAccessBackendService;\n /**\n * Dispatch to one of the application's declared WORKERS — the sanctioned way to move work off the\n * request path from application backend code.\n *\n * `workerClientFactory.client('<workerName>').post('/route', body)` mints the\n * `APPLICATION_WORKER_REQUEST` JWT the worker's verifier pins and reaches the worker at the URL\n * the deploy injected. The factory fails CLOSED on an undeclared worker rather than dispatching to\n * a guessed address.\n *\n * ## Why it had to be added here (#426)\n *\n * The factory shipped, was bound in DI, and had NO caller anywhere — and this is why: a custom\n * implementation is the one place an application writes backend logic, and this bag was the only\n * thing it receives. There was no handle, so no application COULD call a worker, which is the\n * deeper half of why the backend-to-worker chain had never run for anyone. Adding the handle is\n * what turns a shipped mechanism into a reachable one.\n *\n * Optional for the same reason `systemAccessService` is: a minimal test container that does not\n * bind the factory must still construct.\n */\n workerClientFactory?: WorkerRemoteClientFactoryBackendService;\n /** SAML metadata service — for DISCOVER_ENDPOINTS (emits SAML_METADATA_PARSED) */\n samlMetadataService?: { parseIdPMetadata(metadataXml: string): unknown };\n /**\n * Contextual data about parent and child resources.\n * Structure: { parents: Record<string, any>, children: Record<string, any> }\n * Populated based on resource configuration context needs.\n */\n objectContext?: { parents: Record<string, any>; children: Record<string, any> };\n /**\n * User context of the initiator (user/organization/application) performing the operation.\n * Populated from execution context.\n */\n initiatorUserContext?: any;\n /**\n * Current resource object (for UPDATE/DELETE) or input data (for CREATE).\n * For UPDATE/DELETE: Fetched from repository before custom implementation execution.\n * For CREATE: Uses the input data provided to the operation.\n */\n currentObject?: any;\n};\n\nexport abstract class ResourceOperationCustomImplementationBase<\n TInput extends z.ZodSchema = z.ZodAny,\n TOutput extends z.ZodSchema = z.ZodAny,\n> {\n\n public abstract getPlaceholders(): ResourceOperation_CustomServiceImplementationMode[];\n\n /**\n * Replaces the ENTIRE operation pipeline — no core CRUD, no notifications, no other hooks.\n * Single-owner mode: if multiple registrations declare this, highest priority wins.\n *\n * A registration exposing this mode cannot enable `transactionalCore`: the\n * override returns before the framework-owned core transaction is entered,\n * so advertising that atomicity boundary would be false.\n */\n public abstract overrideAll(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL, TInput, TOutput>,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.OVERRIDE_ALL,\n TInput, TOutput\n >>;\n\n /**\n * Runs before core CRUD. Augments `data` via spread-merge (`data = { ...data, ...result }`).\n *\n * **Multi-registration execution:** handlers run sequentially by ascending priority number\n * (lower number = higher priority = runs first). Each handler receives the accumulated `data`\n * from all prior handlers. For field conflicts, **last-writer-wins**: the handler with the\n * HIGHEST priority number (lowest priority) overwrites fields set by earlier handlers.\n *\n * **Array inputs (CREATE_MANY):** handler must return the full transformed array, not a\n * spread-merged object. Non-array returns are silently dropped with a debug log.\n *\n * `utils.currentObject` reflects pre-PREFIX state (original DB record or CREATE input).\n */\n public abstract prefixCoreOperations<TAugment extends object|undefined = undefined>(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS,\n TInput, TOutput, TAugment>,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.PREFIX_CORE_OPERARTIONS,\n TInput, TOutput, TAugment\n >>;\n\n /**\n * Replaces the core CRUD **result** — the core DB operation still runs, this overwrites `currentState`.\n * Receives PREFIX-augmented `data` as input. Single-owner mode: highest priority wins.\n */\n public abstract replaceCoreOperations<TAugment extends object|undefined = undefined>(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS,\n TInput, TOutput, TAugment\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.REPLACE_CORE_OPERARTIONS,\n TInput, TOutput, TAugment\n >>;\n\n /**\n * Runs after core CRUD and REPLACE. Input is the core operation result.\n *\n * **DELETE operations:** `input` is a `string` (the deleted `_id`) or `string[]` (bulk),\n * NOT the deleted document. Use `utils.currentObject` to access the pre-deletion document.\n * Handlers must guard against non-object input when destructuring.\n *\n * With multi-registration, handlers run sequentially by priority — each receives the previous handler's output.\n */\n public abstract postfixCoreOperations(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.POSTFIX_CORE_OPERARTIONS,\n TInput, TOutput\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.POSTFIX_CORE_OPERARTIONS,\n TInput, TOutput\n >>;\n\n /**\n * Runs after notification dispatch. Input is the current operation result.\n *\n * **DELETE operations:** `input` is a `string` (the deleted `_id`) or `string[]` (bulk),\n * NOT the deleted document. Use `utils.currentObject` to access the pre-deletion document.\n *\n * With multi-registration, handlers run sequentially by priority — each receives the previous handler's output.\n *\n * On a framework-owned transactional operation, this hook runs only after\n * the root commit and framework post-commit effects finish. It receives the\n * committed callback attempt's context and no completed transaction in\n * `utils.serviceOptions`. A thrown error therefore rejects the response after\n * an irreversible commit; this phase is for request-scoped result transforms,\n * not mutation-owned external work.\n *\n * Because the phase transforms the returned value, it is not accepted when\n * the operation reuses an explicit or ambient caller-owned transaction:\n * that nested call must return before its caller can commit.\n */\n public abstract afterUserNotifications(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AFTER_USER_NOTIFICATIONS,\n TInput, TOutput\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AFTER_USER_NOTIFICATIONS,\n TInput, TOutput\n >>;\n\n /**\n * Final hook — runs at the very end of the pipeline, after notifications and lifecycle evaluations.\n *\n * **DELETE operations:** `input` is a `string` (the deleted `_id`) or `string[]` (bulk),\n * NOT the deleted document. Use `utils.currentObject` to access the pre-deletion document.\n *\n * With multi-registration, handlers run sequentially by priority — each receives the previous handler's output.\n *\n * On a framework-owned transactional operation, this hook runs only after\n * the root commit and framework post-commit effects finish. It receives the\n * committed callback attempt's context and no completed transaction in\n * `utils.serviceOptions`. A thrown error therefore rejects the response after\n * an irreversible commit; this phase is for request-scoped result transforms,\n * not mutation-owned external work.\n *\n * Because the phase transforms the returned value, it is not accepted when\n * the operation reuses an explicit or ambient caller-owned transaction:\n * that nested call must return before its caller can commit.\n */\n public abstract atTheEnd(\n _id: string | undefined,\n input: ResourceOperationCustomImplementation_InputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AT_THE_END,\n TInput, TOutput\n >,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils\n ): Promise<ResourceOperationCustomImplementation_OutputTypeOf<\n ResourceOperation_CustomServiceImplementationMode.AT_THE_END,\n TInput, TOutput\n >>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"resource-status-transition.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-status-transition.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAM,EAAE,CAAC;IACnC,iFAAiF;IACjF,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;CACrF,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChB;AAyHD;;;;;;;;GAQG;AACH,wBAAgB,qCAAqC,CACnD,UAAU,EAAE,kCAAkC,GAC7C,0CAA0C,CAoL5C;AAED,6EAA6E;AAC7E,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,SAAS,kCAAkC,EAAE,GACzD,0CAA0C,EAAE,CAE9C"}
1
+ {"version":3,"file":"resource-status-transition.custom-impl.backend.service.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-status-transition.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AAGH,OAAO,EAEL,gBAAgB,EAKjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,0CAA0C,EAChD,MAAM,4GAA4G,CAAC;AAEpH,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,iHAAiH,CAAC;AACpL,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAC;AAgB5G,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,qGAAqG,CAAC;AA4BrK;;;;;;;;GAQG;AACH,oBAAY,8BAA8B;IACxC,0FAA0F;IAC1F,aAAa,kBAAkB;IAC/B;;;;OAIG;IACH,gBAAgB,qBAAqB;CACtC;AAED;;;;;;;;;GASG;AACH,oBAAY,4BAA4B;IACtC,qDAAqD;IACrD,GAAG,QAAQ;IACX;;;;OAIG;IACH,KAAK,UAAU;CAChB;AAOD,MAAM,MAAM,kCAAkC,GAC1C;IACE,IAAI,EAAE,4BAA4B,CAAC,GAAG,CAAC;IACvC,+DAA+D;IAC/D,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,8BAA8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,CAAC;IAC7B,oFAAoF;IACpF,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxC,KAAK,EAAE,4CAA4C,CAAC;IACpD,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,qDAAqD,CAAC,MAAM,EAAE;IAClF,UAAU,EAAE,kCAAkC,CAAC;IAC/C,UAAU,EAAE,gBAAgB,CAAC;IAC7B,oFAAoF;IACpF,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,CAAC,CAAC;IACxC,KAAK,EAAE,4CAA4C,CAAC;IACpD,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,iFAAiF;IACjF,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;CACrF,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChB;AA4HD;;;;;;;;GAQG;AACH,wBAAgB,qCAAqC,CACnD,UAAU,EAAE,kCAAkC,GAC7C,0CAA0C,CAoL5C;AAED,6EAA6E;AAC7E,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,SAAS,kCAAkC,EAAE,GACzD,0CAA0C,EAAE,CAE9C"}
@@ -86,7 +86,7 @@
86
86
  * write, and may not retire the last accountable administrative principal of an application or of a
87
87
  * tenant.
88
88
  */
89
- import { ErrorCustomMessageReference, ErrorType, ResourceOperationVariantType, } from '@wildo-ai/saas-models';
89
+ import { AdministrativeContinuityBreachDetection, ErrorCustomMessageReference, ErrorType, ResourceOperationVariantType, } from '@wildo-ai/saas-models';
90
90
  import { createResourceCustomServiceImplementation, } from '../../../base-classes/services/services/resource-operation-custom-implementation.factory.backend.js';
91
91
  import { assertSuperAdminFloorPreservedForTransition, createSuperAdminConferralResolver, isSuperAdminFloorGovernedSubjectResource, } from '../../../security/authorizations/super-admin-floor.backend.utils.js';
92
92
  import { assertOrganizationOwnerFloorPreservedForTransition, createOrganizationOwnerConferralResolver, createOrganizationOwnerFloorPopulationContext, isOrganizationOwnerFloorAuthorityBearingResource, isOrganizationOwnerFloorGovernedSubjectResource, reportOrganizationsStrandedByUserDeactivation, membershipTransitionCouldReduceOwners, } from '../../../security/authorizations/organization-owner-floor.backend.utils.js';
@@ -434,6 +434,9 @@ function resolveStatusTransitionFloorGuards(definition, container) {
434
434
  await container.get(SAAS_SERVICE_TYPES.AuditLogsService)
435
435
  .logOrganizationOwnerFloorBreached({
436
436
  organizationId: breach.organizationId,
437
+ // A guard SAW this one and let it through, which is what separates it from the boot
438
+ // report's observation of a tenant stranded out-of-band.
439
+ detectedBy: AdministrativeContinuityBreachDetection.ALLOWED_LIFECYCLE_ACTION,
437
440
  reducedMemberIds: breach.reducedMemberIds,
438
441
  remainingUsableOwners: breach.remainingUsableOwners,
439
442
  operationIdentifier: definition.operationIdentifier,
@@ -1 +1 @@
1
- {"version":3,"file":"resource-status-transition.custom-impl.backend.service.js","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-status-transition.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AAGH,OAAO,EAEL,2BAA2B,EAC3B,SAAS,EACT,4BAA4B,GAE7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yCAAyC,GAE1C,MAAM,4GAA4G,CAAC;AAIpH,OAAO,EACL,2CAA2C,EAC3C,iCAAiC,EACjC,wCAAwC,GACzC,MAAM,4EAA4E,CAAC;AACpF,OAAO,EACL,kDAAkD,EAClD,wCAAwC,EACxC,6CAA6C,EAC7C,gDAAgD,EAChD,+CAA+C,EAC/C,6CAA6C,EAC7C,qCAAqC,GACtC,MAAM,mFAAmF,CAAC;AAG3F,OAAO,EA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sourcesContent":["/**\n * The shared implementation behind every account/entity lifecycle verb.\n *\n * ## What these verbs have in common\n *\n * SUSPEND, ACTIVATE, REACTIVATE, DEACTIVATE_ACCOUNT and their siblings differ only in which status\n * they write and which statuses they accept as a starting point. Each one validates a transition,\n * then writes `{status}` plus at most a scheduling date. Hand-rolling that per verb is how the\n * catalogue drifted in the first place: on 2026-08-01 a sweep found thirteen routed lifecycle\n * variants that declared a request contract, persisted nothing, and answered HTTP 200 — an operator\n * told a CRITICAL suspension had taken effect while the tenant kept serving.\n *\n * One factory, one place where the rules live.\n *\n * ## Why the transition is re-checked here, when `enabledCondition` already gates it\n *\n * It is a fail-closed backstop, NOT a duplicated rule. A custom implementation is addressed by an\n * EXACT operation-path key, so it runs for that path regardless of how the path was reached, while\n * `enabledCondition` is evaluated by the URL-facing dispatch. The organization-members config\n * records the same reasoning for why a role-change verb would not inherit UPDATE's ceiling gate.\n * The two also read different things: the gate sees the pre-fetched object, this sees the row the\n * write is actually about to land on.\n *\n * The rule itself is not duplicated — `allowedFromStatuses` is declared once per registration, and\n * the operation's `enabledCondition` is authored from the same set.\n *\n * ## Why `authoritativeFields` is mandatory here\n *\n * Every status field these verbs write is `.excludeFromUpdate()` — that is the whole reason the\n * verbs exist rather than letting a client PATCH the field. The repository re-parses every write\n * against the operation's `requestDto`, which names no status, so without an explicit declaration\n * the value survives only by being inferred as \"a key the hook added\". That inference is defeated\n * by any caller who reaches the service tier with the key already in the payload, and the write\n * silently becomes empty. See `resolveServerInjectedFieldAllowList` for the full mechanism.\n *\n * ## The trail is registered in the PREFIX and executes on COMMIT\n *\n * Both halves of that matter, and neither works alone:\n *\n * - **Registered in the prefix**, because that is the only phase that can see the caller's\n * `reason` / `suspensionReason`. The POSTFIX input is typed `z.infer<TOutput>` — the persisted\n * row — and these are not schema columns, so they appear on neither. Decision D2 named the trail\n * as their home; this is what actually puts them there.\n * - **Executed on commit**, because the prefix runs BEFORE persistence. Emitting there directly\n * would leave an audit row asserting a suspension that never happened whenever the write failed\n * — evidence of a state change nobody made, which is worse than no record.\n *\n * `registerTransactionPostCommitEffect` gives both, which is why this factory declares\n * `transactionalCore`. Note this changes NO deployment's transaction posture: the core engine\n * already declares transaction-requiring boundaries unconditionally (organization\n * activate/suspend/request_deletion/restore, organization-units MOVE, platform-access grants,\n * organization-member writes), so `validateInitializedRuntimeTransactionReadiness` already probes\n * every adapter at startup and a store that cannot commit already fails there. An earlier revision\n * of this comment claimed the opposite and used it to defer the fix — that was wrong, and it is\n * recorded here so the claim is not made a second time.\n *\n * `targetStatus` is the persisted FACT once the effect runs, not merely the intent: `status` is\n * declared in `authoritativeFields`, so the strict re-parse cannot strip the patch, and the startup\n * guard proves every declared name is a real persisted field of the resource.\n *\n * ## Why the administrative floors are enforced HERE and not per verb\n *\n * `status` is one of the two axes that decide whether a principal is an administratively usable\n * administrator — of the APPLICATION (with `appRoles`) or of ONE ORGANIZATION (with a membership's\n * `roles`) — and every verb served by this factory writes it. Both floors were originally wired onto\n * their resource's core `UPDATE`, but a custom implementation resolves by an EXACT operation-path\n * key, so neither extended to anything else:\n *\n * - `PUT /users/{id}/suspend-user` reached the same `status` field through this registration and\n * returned 200 on the LAST usable super-administrator, leaving an application with no principal\n * able to administer it and no in-product recovery door (every one is gated on the role now\n * unusable). Proven end-to-end before it was fixed.\n * - `organizationMembers | suspend` was the exact sibling: it strands ONE tenant, and\n * `ORGANIZATION_MEMBERS` declares no super-admin variant, so a platform administrator who is not\n * a member cannot re-own the stranded organization afterwards. Recovery exists, but only from\n * OUTSIDE the tenant: `organizationMembers.grantOwnership` is platform-tier.\n *\n * Placing the calls in the SHARED implementation rather than on each verb covers every current and\n * future status verb on every governed resource at once, which is the only version of this fix that\n * cannot be re-opened by the next lifecycle verb somebody adds. Each floor is gated on the subject\n * resource because the floors are scoped invariants while this factory is generic — see\n * {@link resolveStatusTransitionFloorGuards}.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — access-affecting lifecycle\n * changes run through one guarded authority that records what happened, rather than a generic field\n * write, and may not retire the last accountable administrative principal of an application or of a\n * tenant.\n */\n\nimport type { Container } from 'inversify';\nimport {\n CoreResourceType,\n ErrorCustomMessageReference,\n ErrorType,\n ResourceOperationVariantType,\n type ResourceConfiguration_OperationPath,\n} from '@wildo-ai/saas-models';\nimport {\n createResourceCustomServiceImplementation,\n type ResourceCustomServiceImplementationFactory,\n} from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation.factory.backend';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ResourceOperation_CustomImplementation_Utils } from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation-base.backend.service';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport {\n assertSuperAdminFloorPreservedForTransition,\n createSuperAdminConferralResolver,\n isSuperAdminFloorGovernedSubjectResource,\n} from '~wildo-backend-lib/security/authorizations/super-admin-floor.backend.utils';\nimport {\n assertOrganizationOwnerFloorPreservedForTransition,\n createOrganizationOwnerConferralResolver,\n createOrganizationOwnerFloorPopulationContext,\n isOrganizationOwnerFloorAuthorityBearingResource,\n isOrganizationOwnerFloorGovernedSubjectResource,\n reportOrganizationsStrandedByUserDeactivation,\n membershipTransitionCouldReduceOwners,\n} from '~wildo-backend-lib/security/authorizations/organization-owner-floor.backend.utils';\nimport type { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport type { AuthExecutionContextFactoryBackendService } from '~wildo-backend-lib/security/authentications/services/auth-execution-context-factory.backend.service';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport {\n describeUnaddressableShape,\n resolveSingleSubjectId,\n} from '~wildo-backend-lib/base-classes/utils/single-subject-addressing.backend.utils';\nimport { registerTransactionPostCommitEffect } from '~wildo-backend-lib/databases/models/transaction.shared.schemas';\nimport { describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\n\n/** The status field every lifecycle-bearing resource in the engine uses. */\nconst STATUS_FIELD = 'status';\n\n/**\n * The caller's justification for a transition, under whichever name its verb gives it.\n *\n * `suspend` calls it `suspensionReason`; the others call it `reason`. Both spellings are read here\n * rather than threaded through each definition, because the value has ONE destination — the audit\n * row — and the request-contract vocabulary is a per-verb surface detail, not a semantic difference.\n * It is never persisted on the row: a suspension reason is a compliance artefact nothing reads back,\n * so a schema column would only create something an erasure would later have to scrub.\n */\nfunction resolveAuthoredTransitionReason(input: unknown): string | undefined {\n if (!input || typeof input !== 'object') return undefined;\n const payload = input as { reason?: unknown; suspensionReason?: unknown };\n const authored = payload.suspensionReason ?? payload.reason;\n return typeof authored === 'string' && authored.length > 0 ? authored : undefined;\n}\n\n/**\n * How a verb's request contract expresses \"and automatically undo this later\".\n *\n * The persisted field is always `scheduledReactivationAt` — named for the effect so one field and\n * one sweep serve every verb — but the caller-facing vocabulary differs per verb, and one of them\n * is not even an instant. Translating here keeps each request contract in its own natural terms\n * while the row stays uniform, the same split `ORGANIZATION_UNITS` MOVE uses (`newParentUnitId` in,\n * `parentUnitId` + `path` persisted).\n */\nexport enum StatusTransitionScheduleSource {\n /** The contract carries an absolute instant (`suspensionEndDate`, `reactivationDate`). */\n ABSOLUTE_DATE = 'absolute_date',\n /**\n * The contract carries a whole number of DAYS (`suspensionDuration`), resolved to an instant at\n * write time. A duration is meaningless without the moment it is measured from, and the row\n * records no such moment — so resolving it later would be guesswork.\n */\n DURATION_IN_DAYS = 'duration_in_days',\n}\n\n/**\n * What a verb DOES to the pending schedule — the discriminator of\n * {@link ResourceStatusTransitionScheduling}.\n *\n * A named vocabulary rather than an inline `'set' | 'clear'` union, for the same reason\n * {@link StatusTransitionScheduleSource} is one: it is a closed set with exactly one runtime source,\n * so every definition, every narrow, and every test fixture derives from here instead of re-spelling\n * the literal. The two axes are independent — `source` says how the caller EXPRESSES a schedule,\n * this says whether the verb writes one at all.\n */\nexport enum StatusTransitionScheduleMode {\n /** Carry a caller-supplied schedule onto the row. */\n SET = 'set',\n /**\n * Clear any pending schedule. Every \"undo\" verb uses this: a membership reactivated by hand must\n * not still carry the date at which a sweep would have reactivated it anyway, or a later\n * suspension would inherit a stale deadline.\n */\n CLEAR = 'clear',\n}\n\n/** The field the reactivation sweep reads. Declared once; every verb writes this same name. */\nconst SCHEDULED_REACTIVATION_FIELD = 'scheduledReactivationAt';\n\nconst MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;\n\nexport type ResourceStatusTransitionScheduling =\n | {\n mode: StatusTransitionScheduleMode.SET;\n /** The key in the operation's `requestDto` that carries it. */\n requestField: string;\n source: StatusTransitionScheduleSource;\n }\n | {\n mode: StatusTransitionScheduleMode.CLEAR;\n };\n\nexport interface ResourceStatusTransitionDefinition {\n resourceIdentifier: CoreResourceType;\n /** The custom verb this implements, e.g. `suspend`. */\n operationIdentifier: string;\n /** Written to `status` when the transition is legal. */\n targetStatus: string;\n /**\n * The ONLY statuses this verb may run from. Anything else is a `CONFLICT`.\n *\n * Fail-closed by construction: an unlisted status is refused rather than allowed. Keep it\n * identical to the operation's `enabledCondition` — the gate is the fast, user-facing rejection,\n * this is the backstop that cannot be routed around.\n */\n allowedFromStatuses: readonly string[];\n /** Optional time-boxing. Omit for a verb whose contract offers the caller no window. */\n scheduling?: ResourceStatusTransitionScheduling;\n /**\n * Whether this transition REMOVES access rather than restoring it.\n *\n * Declared, not inferred. The obvious proxies are both wrong: \"sets a schedule\" happens to\n * correlate today (you time-box a restriction) but is a coincidence of the current verbs, and\n * \"target is not ACTIVE\" cannot be evaluated generically because each resource has its own\n * status vocabulary. It only feeds the audit event's risk grading, where getting it backwards\n * would file suspensions among routine reinstatements — so it is worth one explicit word per\n * definition.\n */\n restrictsAccess: boolean;\n /** Overrides the generated debug label when a resource needs a clearer one. */\n debugLabel?: string;\n}\n\n/**\n * A NARROW VIEW of the pre-operation snapshot — NOT a description of what the row contains.\n *\n * `utils.currentObject` comes from `fetchCurrentObjectForOperation`, which performs a full\n * `repository.read` on the addressed id, so the snapshot carries EVERY readable field of the row.\n * This type lists only what this implementation reads, and the authority fields are optional because\n * they exist on SOME governed resources and not others — not because a live row is expected to be\n * sparse. Test doubles for `currentObject` should mirror a persisted row, not this projection.\n *\n * The authority axes are read only by the floor guards (see {@link resolveStatusTransitionFloorGuards}):\n *\n * - `appRoles` — the APPLICATION axis, on `USERS` / `USER_SELF`. Those are two resource\n * configurations over the SAME collection sharing `UserSchema` as their `mainSchema`, so the field\n * is present through either door.\n * - `roles` + `organizationId` — the ORGANIZATIONS axis, on `ORGANIZATION_MEMBERS`. The first decides\n * whether the row is an owner grant; the second names the population to measure.\n *\n * All three are typed `unknown` rather than `string[]`/`string` on purpose: this is the raw snapshot,\n * and each floor's own helpers are the authority on what a valid value is.\n */\ntype StatusBearingRow = {\n _id: string;\n status?: string;\n appRoles?: unknown;\n roles?: unknown;\n organizationId?: unknown;\n};\n\n/**\n * Refuse a payload that already carries a field this verb owns.\n *\n * Defence in depth for the same hole `authoritativeFields` closes. With the declaration in place\n * such a payload is harmless — the hook's value wins — but the request is still malformed: passing\n * `status` to `suspend` asks the verb to do something other than suspend. A loud 400 beats\n * honouring one of two contradictory instructions, and it surfaces a caller who believes the field\n * is theirs to set.\n */\nfunction assertNoAuthoredFieldInRequest(\n input: unknown,\n authoredFields: readonly string[],\n definition: ResourceStatusTransitionDefinition,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils,\n): void {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return;\n\n const offending = authoredFields.filter((field) =>\n Object.prototype.hasOwnProperty.call(input, field));\n if (offending.length === 0) return;\n\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message:\n `The '${definition.operationIdentifier}' operation owns ${offending.join(', ')} and does not `\n + 'accept it from the caller',\n reason: 'resource_status_transition_authored_field_in_request',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n offendingFields: offending,\n },\n });\n}\n\n/** Resolve the caller's scheduling input to the absolute instant the sweep compares against. */\nfunction resolveScheduledReactivation(\n scheduling: ResourceStatusTransitionScheduling,\n input: unknown,\n definition: ResourceStatusTransitionDefinition,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils,\n): Date | null {\n // `null`, not `undefined`: the patch must actively CLEAR a stale deadline, and an `undefined`\n // value is dropped by the write rather than unsetting the field.\n if (scheduling.mode === StatusTransitionScheduleMode.CLEAR) return null;\n\n const authored = (input as Record<string, unknown> | undefined)?.[scheduling.requestField];\n if (authored === undefined || authored === null) return null;\n\n if (scheduling.source === StatusTransitionScheduleSource.ABSOLUTE_DATE) {\n const asDate = authored instanceof Date ? authored : new Date(String(authored));\n if (Number.isNaN(asDate.getTime())) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message: `${scheduling.requestField} is not a valid date`,\n reason: 'resource_status_transition_invalid_schedule',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n },\n });\n }\n return asDate;\n }\n\n // DURATION_IN_DAYS — resolve against now, because the row records no other reference moment.\n const days = typeof authored === 'number' ? authored : Number(authored);\n if (!Number.isFinite(days) || days <= 0) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message: `${scheduling.requestField} must be a positive number of days`,\n reason: 'resource_status_transition_invalid_schedule',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n received: authored,\n },\n });\n }\n return new Date(Date.now() + days * MILLISECONDS_PER_DAY);\n}\n\n/**\n * The fields a definition writes — and therefore exactly what it must declare as authoritative.\n *\n * Derived rather than authored so the declaration cannot drift from the patch. A verb that gains a\n * schedule gains the declaration in the same edit.\n */\nexport function resolveStatusTransitionAuthoredFields(\n definition: ResourceStatusTransitionDefinition,\n): string[] {\n return definition.scheduling\n ? [STATUS_FIELD, SCHEDULED_REACTIVATION_FIELD]\n : [STATUS_FIELD];\n}\n\n/**\n * Build the `prefixCoreOperations` patch for one transition.\n *\n * Exported for testing: it is the whole decision, and it is pure apart from the row it is handed.\n */\nexport function buildStatusTransitionPatch(params: {\n definition: ResourceStatusTransitionDefinition;\n currentRow: StatusBearingRow;\n input: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n}): Record<string, unknown> {\n const { definition, currentRow, input, executionContext, utils } = params;\n\n if (!definition.allowedFromStatuses.includes(currentRow.status ?? '')) {\n throw utils.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {\n customMessageReference: ErrorCustomMessageReference.RESOURCE_STATUS_TRANSITION_CONFLICT,\n context: {\n reason: 'resource_status_transition_not_permitted_from_current_status',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: currentRow._id,\n currentStatus: currentRow.status ?? null,\n targetStatus: definition.targetStatus,\n allowedFromStatuses: [...definition.allowedFromStatuses],\n },\n });\n }\n\n const patch: Record<string, unknown> = { [STATUS_FIELD]: definition.targetStatus };\n\n if (definition.scheduling) {\n patch[SCHEDULED_REACTIVATION_FIELD] = resolveScheduledReactivation(\n definition.scheduling, input, definition, executionContext, utils,\n );\n }\n\n return patch;\n}\n\n/**\n * Refuse a transition that would leave the application with no administratively usable\n * super-administrator.\n *\n * ## Only the status axis moves\n *\n * These verbs write `status` and at most a schedule — never `appRoles`. So the roles are passed as\n * BOTH the previous and the next value: the transition check needs the authority axis to decide\n * whether the subject counted at all, and stating it unchanged is what makes \"this write cannot\n * touch conferral\" explicit rather than implied by omission.\n *\n * ## Cost\n *\n * `assertSuperAdminFloorPreservedForTransition` short-circuits before issuing any query unless the\n * subject counted toward the floor BEFORE the write and would stop counting after it. So an\n * ordinary user suspension, and every transition INTO the authenticable set (`unsuspend_user`,\n * whose subject was by definition not usable beforehand), pay two set-membership tests and nothing\n * else. Only the genuinely dangerous case reaches the population query.\n *\n * ## Fail closed on a snapshot without the authority axis\n *\n * `appRoles` is what the whole decision turns on. A snapshot that lacks it cannot answer whether\n * this subject is an administrator, and answering \"not an administrator\" would fail OPEN on exactly\n * the input the guard exists for. Refusing instead mirrors the sibling `users | DELETE` guard, and\n * costs nothing in practice: the field carries a `.default([APP_USER])` and both floor-governed\n * resources read the same `UserSchema`, so a live snapshot always carries it.\n *\n * Exported for testing: like {@link buildStatusTransitionPatch} it is the whole decision, and it is\n * pure apart from the row and the collaborators it is handed.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — an account-lifecycle change\n * must not retire the last accountable administrative principal.\n */\nexport async function assertStatusTransitionPreservesSuperAdminFloor(params: {\n definition: ResourceStatusTransitionDefinition;\n currentRow: StatusBearingRow;\n /** The status the patch is about to write — read from the patch, not re-derived. */\n nextStatus: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n conferringRoles: readonly string[];\n}): Promise<void> {\n const { definition, currentRow, nextStatus, executionContext, utils, conferringRoles } = params;\n\n if (!Array.isArray(currentRow.appRoles)) {\n throw utils.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {\n context: {\n message:\n 'Refused: the application roles of the account being changed could not be read, so it cannot '\n + 'be proven that this transition would not disable the last usable super-administrator.',\n reason: 'resource_status_transition_subject_authority_unreadable',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: currentRow._id,\n },\n });\n }\n\n await assertSuperAdminFloorPreservedForTransition({\n subjectUserId: currentRow._id,\n previousRoles: currentRow.appRoles,\n previousStatus: currentRow.status,\n // Unchanged by construction — see the header.\n nextRoles: currentRow.appRoles,\n nextStatus,\n executionContext,\n repositoriesRegistry: utils.repositoriesRegistry,\n errorBuilder: utils.errorBuilder,\n conferringRoles,\n operationIdentifier: definition.operationIdentifier,\n });\n}\n\n/**\n * Refuse a transition that would leave an organization with no administratively usable owner.\n *\n * The ORGANIZATION-scope twin of {@link assertStatusTransitionPreservesSuperAdminFloor}, and the\n * differences are all consequences of the population being per-tenant rather than per-application:\n *\n * - **The subject names its own population.** `organizationId` selects which tenant to measure, so a\n * snapshot without it cannot be evaluated at all — unlike the application floor, where there is\n * only ever one population.\n * - **The measurement runs under a SYSTEM context, not the caller's.** The floor must see every owner\n * membership AND the `status` of every one of those owners' `User` rows, and the `ORG_ADMIN`s who\n * reach these verbs cannot list `USERS` at all. The authority owns that decision — see\n * {@link createOrganizationOwnerFloorPopulationContext}.\n * - **The short-circuit is asked HERE, before the context is built.** Constructing the system context\n * is a registry lookup plus a possible application-id resolution, and suspending an ordinary member\n * — the overwhelmingly common case — must not pay for it. This is not a second copy of the rule:\n * {@link membershipTransitionCouldReduceOwners} is the authority's own predicate, and the assertion\n * below calls it again.\n *\n * Fails closed on a snapshot that carries no `roles` or no `organizationId`, for the reason the\n * application twin does: answering \"not an owner\" would fail OPEN on exactly the input the guard\n * exists for, and a suspended last owner cannot be reactivated by anyone — `ORGANIZATION_MEMBERS`\n * declares exactly one cross-tenant variant — `grantOwnership` — so recovery from a stranded state\n * is a platform-operator action, never a tenant one. That is why the in-tenant refusal still stands.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — a membership-lifecycle change\n * must not retire a tenant's last accountable administrative principal.\n */\nexport async function assertStatusTransitionPreservesOrganizationOwnerFloor(params: {\n definition: ResourceStatusTransitionDefinition;\n currentRow: StatusBearingRow;\n /** The status the patch is about to write — read from the patch, not re-derived. */\n nextStatus: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n conferringRoles: readonly string[];\n /** Resolved lazily and only once a reduction is established — see the header. */\n resolveAuthExecutionContextFactory: () => AuthExecutionContextFactoryBackendService;\n}): Promise<void> {\n const {\n definition, currentRow, nextStatus, executionContext, utils, conferringRoles,\n resolveAuthExecutionContextFactory,\n } = params;\n\n const organizationId = typeof currentRow.organizationId === 'string' ? currentRow.organizationId : undefined;\n\n if (!Array.isArray(currentRow.roles) || !organizationId) {\n throw utils.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {\n context: {\n message:\n 'Refused: the roles or the owning organization of the membership being changed could not be '\n + \"read, so it cannot be proven that this transition would not retire the organization's last \"\n + 'usable owner.',\n reason: 'resource_status_transition_subject_authority_unreadable',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: currentRow._id,\n },\n });\n }\n\n const transition = {\n previousRoles: currentRow.roles,\n previousStatus: currentRow.status,\n // Unchanged by construction: these verbs write `status` and at most a schedule, never `roles`.\n nextRoles: currentRow.roles,\n nextStatus,\n conferringRoles,\n };\n\n if (!membershipTransitionCouldReduceOwners(transition)) return;\n\n await assertOrganizationOwnerFloorPreservedForTransition({\n ...transition,\n memberId: currentRow._id,\n organizationId,\n executionContext: await createOrganizationOwnerFloorPopulationContext(resolveAuthExecutionContextFactory()),\n repositoriesRegistry: utils.repositoriesRegistry,\n errorBuilder: utils.errorBuilder,\n operationIdentifier: definition.operationIdentifier,\n });\n}\n\n/**\n * One administrative floor a status transition must not breach, bound to a single definition.\n *\n * A list rather than a chain of `if`s inside the hook, because the set of floors that govern a row is\n * a property of the RESOURCE and is therefore decidable once, at factory construction, from static\n * data. Adding the next authority is one entry here — and, more to the point, a lifecycle verb added\n * to a governed resource inherits every floor automatically instead of depending on somebody\n * remembering to wire it. That omission is the whole defect class this file now closes.\n */\ntype StatusTransitionFloorGuard = (params: {\n currentRow: StatusBearingRow;\n nextStatus: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n}) => Promise<void>;\n\n/**\n * The floors that govern one definition's resource, resolved once when the factory is built.\n *\n * Every collaborator is bound LAZILY. Factories are constructed during module registration, which can\n * run before the authorization and authentication services are bound, so an eager `container.get`\n * would turn a guard into a startup crash. The conferral resolvers additionally re-read the live role\n * table on every call, because `initializeRolesWithCustom` mutates it in place.\n *\n * A resource governed by NO floor gets an empty list and pays nothing at all — not a container\n * lookup, not a closure invocation. That is the common case (organization units, and every\n * application resource that grows a lifecycle verb later).\n */\nfunction resolveStatusTransitionFloorGuards(\n definition: ResourceStatusTransitionDefinition,\n container: Container,\n): StatusTransitionFloorGuard[] {\n const guards: StatusTransitionFloorGuard[] = [];\n\n if (isSuperAdminFloorGovernedSubjectResource(definition.resourceIdentifier)) {\n const superAdminConferralResolver = createSuperAdminConferralResolver(container);\n guards.push(({ currentRow, nextStatus, executionContext, utils }) =>\n assertStatusTransitionPreservesSuperAdminFloor({\n definition,\n currentRow,\n nextStatus,\n executionContext,\n utils,\n conferringRoles: superAdminConferralResolver(),\n }));\n }\n\n // ── USERS lifecycle: REPORT, never refuse ──────────────────────────────────────────────────\n // A deactivated user stops counting as a usable owner, so this transition can strand a tenant —\n // and unlike every other floor surface it must still be allowed to proceed. Suspension is normally\n // incident response, and refusing it would mean an operator cannot lock out a compromised owner\n // without first transferring ownership using the tenant the attacker controls. The stranded tenant\n // is recoverable (boot report finds it, `grantOwnership` repairs it); the live hostile session is\n // not. See `reportOrganizationsStrandedByUserDeactivation` for the full argument.\n if (isOrganizationOwnerFloorGovernedSubjectResource(definition.resourceIdentifier)) {\n const strandingConferralResolver = createOrganizationOwnerConferralResolver(container);\n guards.push(async ({ currentRow, nextStatus, executionContext, utils }) => {\n await reportOrganizationsStrandedByUserDeactivation({\n subjectUserId: String(currentRow._id),\n nextStatus,\n executionContext,\n repositoriesRegistry: utils.repositoriesRegistry,\n errorBuilder: utils.errorBuilder,\n conferringRoles: strandingConferralResolver(),\n operationIdentifier: definition.operationIdentifier,\n report: async (breach) => {\n // An AUDIT ROW, not a log line — one per stranded tenant. The justification for allowing\n // this write at all is that the consequence becomes visible, and a log line is not\n // queryable evidence and never reaches a SIEM. `CRITICAL` + the AUTHORIZATION category\n // route it through the same export path as every other authority event.\n await container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService)\n .logOrganizationOwnerFloorBreached({\n organizationId: breach.organizationId,\n reducedMemberIds: breach.reducedMemberIds,\n remainingUsableOwners: breach.remainingUsableOwners,\n operationIdentifier: definition.operationIdentifier,\n subjectUserId: String(currentRow._id),\n subjectNextStatus: String(nextStatus),\n }, executionContext);\n\n // The log line stays as the operator-facing half: an audit row is for the auditor, and\n // whoever is on call during an incident is reading logs, not the trail.\n utils.logger?.error?.(\n 'Organization left with no administratively usable owner by a user lifecycle transition',\n {\n reason: 'organization_owner_floor_stranded_by_user_deactivation',\n organizationId: breach.organizationId,\n subjectUserId: String(currentRow._id),\n remedy: 'organizationMembers.grantOwnership (platform-tier) restores an owner.',\n },\n );\n },\n });\n });\n }\n\n if (isOrganizationOwnerFloorAuthorityBearingResource(definition.resourceIdentifier)) {\n const ownerConferralResolver = createOrganizationOwnerConferralResolver(container);\n let authExecutionContextFactory: AuthExecutionContextFactoryBackendService | undefined;\n const resolveAuthExecutionContextFactory = (): AuthExecutionContextFactoryBackendService =>\n (authExecutionContextFactory ??= container.get<AuthExecutionContextFactoryBackendService>(\n SAAS_SERVICE_TYPES.AuthExecutionContextFactory,\n ));\n\n guards.push(({ currentRow, nextStatus, executionContext, utils }) =>\n assertStatusTransitionPreservesOrganizationOwnerFloor({\n definition,\n currentRow,\n nextStatus,\n executionContext,\n utils,\n conferringRoles: ownerConferralResolver(),\n resolveAuthExecutionContextFactory,\n }));\n }\n\n return guards;\n}\n\n/**\n * One lifecycle transition, as a registrable custom implementation.\n *\n * Modelled on `createOrganizationUnitStatusTransitionFactory`, which established the pattern for\n * this engine: validate against the loaded row, then RETURN the field patch for the core UPDATE to\n * persist rather than writing directly. The difference is that this one is resource-agnostic and\n * declares `authoritativeFields`, which the org-units original did not need — its `status` is not\n * `.excludeFromUpdate()`, so its patch survived on the introduced-key inference alone.\n */\nexport function createResourceStatusTransitionFactory(\n definition: ResourceStatusTransitionDefinition,\n): ResourceCustomServiceImplementationFactory {\n const authoredFields = resolveStatusTransitionAuthoredFields(definition);\n\n const factory = (_resourcesRegistryService: ResourcesRegistryBackendService, container: Container) => {\n const floorGuards = resolveStatusTransitionFloorGuards(definition, container);\n\n return createResourceCustomServiceImplementation({\n operationPath: {\n resourceIdentifier: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n variantType: ResourceOperationVariantType.API_CALL,\n isOperationDefault: true,\n } as ResourceConfiguration_OperationPath<any, any>,\n debugLabel:\n definition.debugLabel\n ?? `${String(definition.resourceIdentifier)}.${definition.operationIdentifier}.status-transition`,\n // `status` and `scheduledReactivationAt` are `.excludeFromUpdate()` on every resource this\n // serves. Without this the repository's strict re-parse drops the patch for any caller who\n // reached the service tier with the key already present, and the verb answers success having\n // changed nothing — the exact defect it was written to fix.\n authoritativeFields: authoredFields,\n // The audit row is registered from the PREFIX (the only phase that can see the caller's\n // `reason`) and executes on COMMIT, so it never describes a write that rolled back. That\n // needs a commit hook to exist, which is what this declares.\n //\n // No participants: the transition writes exactly one row, on the operation's own resource,\n // which the framework includes automatically. Contrast the ORGANIZATIONS lifecycle verbs,\n // which name ORGANIZATION_MEMBERS + USERS because they reconcile membership-derived global\n // `userTypes` in the same unit of work.\n //\n // This does NOT change any deployment's transaction posture: the core engine already\n // declares transaction-requiring boundaries unconditionally (organization\n // activate/suspend/request_deletion/restore, organization-units MOVE, platform-access\n // grants, organization-member writes), so `validateInitializedRuntimeTransactionReadiness`\n // already probes every adapter at startup and a store that cannot commit already fails\n // there — see the `rejects transaction readiness against a standalone MongoDB server` pin.\n transactionalCore: true,\n transactionParticipants: {},\n handlers: {\n prefixCoreOperations: async (_id, input, executionContext, _operationPath, utils) => {\n // Fail closed on anything but a single addressed row. An ids array or a population filter\n // reaching this path would make the status check evaluate against the wrong thing — or\n // against nothing — while still returning a patch the core write would happily apply.\n //\n // A conditional `{ _id, … }` filter is single-subject and therefore admitted: `_id` names the\n // row the pre-fetched `currentObject` below describes, and the extra predicates only decide\n // whether the core write lands. Refusing it used to make status transitions the ONE verb\n // family that could not be written as a compare-and-swap.\n const subjectResourceId = resolveSingleSubjectId(_id);\n if (subjectResourceId === undefined) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message:\n `${definition.operationIdentifier} requires a single addressed resource to validate `\n + 'the status transition',\n reason: 'resource_status_transition_unaddressed',\n resourceType: definition.resourceIdentifier,\n receivedAddressing: describeUnaddressableShape(_id),\n },\n });\n }\n\n assertNoAuthoredFieldInRequest(input, authoredFields, definition, executionContext, utils);\n\n // The framework pre-fetches the target row for UPDATE-like operations, so this is the row\n // the write is about to land on. Absent means the transition cannot be validated — which\n // must never read as \"allowed\" on an access-affecting verb.\n const currentRow = utils.currentObject as StatusBearingRow | undefined;\n if (!currentRow) {\n throw utils.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n reason: 'resource_status_transition_target_not_found',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: subjectResourceId,\n },\n });\n }\n\n const patch = buildStatusTransitionPatch({\n definition,\n currentRow: { ...currentRow, _id: subjectResourceId },\n input,\n executionContext,\n utils,\n });\n\n // AFTER the transition-legality check on purpose: a verb refused because it cannot run\n // from the current status should say so — the more specific finding — and should not\n // have issued a floor's population query on the way to being rejected anyway.\n for (const assertFloorPreserved of floorGuards) {\n await assertFloorPreserved({\n currentRow: { ...currentRow, _id: subjectResourceId },\n // Read from the patch rather than re-derived from the definition, so no guard can\n // measure a status other than the one about to be persisted.\n nextStatus: patch[STATUS_FIELD],\n executionContext,\n utils,\n });\n }\n\n // Trail the transition. Registered HERE — the only phase that can see the caller's\n // `reason`, since the POSTFIX input is typed `z.infer<TOutput>` (the persisted row) and\n // `reason` is not a schema column, so it appears on neither.\n //\n // It EXECUTES on commit, so it never describes a write that rolled back. That is why the\n // registration declares `transactionalCore` above: without a commit hook the choice would\n // be between emitting early (recording suspensions that later failed) and emitting from a\n // postfix that cannot see the reason. With one, neither compromise is necessary.\n //\n // `targetStatus` is the persisted fact once this commits, not merely the intent: `status`\n // is declared in `authoritativeFields`, so the patch cannot be stripped by the strict\n // re-parse, and the startup guard proves every declared name is a real persisted field.\n // Fail CLOSED on a missing transaction rather than skipping the trail. This registration\n // declares `transactionalCore`, so the framework guarantees one; its absence means that\n // contract is broken, and silently proceeding would perform an access-affecting\n // transition with no record — the outcome the audit exists to make impossible. Same shape\n // as `registerOrganizationLifecycleAudit` on the tenant verbs.\n const transaction = utils.serviceOptions?.transaction;\n if (!transaction) {\n throw utils.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message:\n 'A status transition cannot be recorded: no transaction is active, but this '\n + 'operation declares transactionalCore.',\n reason: 'resource_status_transition_audit_requires_transaction',\n resourceType: String(definition.resourceIdentifier),\n operationIdentifier: String(definition.operationIdentifier),\n },\n });\n }\n\n registerTransactionPostCommitEffect(transaction, {\n key: `resource-status-transition:${String(definition.resourceIdentifier)}`\n + `:${definition.operationIdentifier}:${subjectResourceId}`,\n execute: async () => {\n try {\n await container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService)\n .logResourceStatusTransitionPerformed({\n resourceType: String(definition.resourceIdentifier),\n operationIdentifier: String(definition.operationIdentifier),\n subjectId: subjectResourceId,\n performedBy: String(executionContext?.initiatorIds?.userId ?? 'system'),\n previousStatus: String((currentRow as { status?: unknown }).status ?? ''),\n newStatus: definition.targetStatus,\n isRestricting: definition.restrictsAccess,\n // The field decision D2 promised the trail would carry. Both spellings are\n // accepted because the verbs differ: `suspend` names it `suspensionReason`,\n // the rest `reason`.\n reason: resolveAuthoredTransitionReason(input),\n scheduledReactivationAt:\n patch[SCHEDULED_REACTIVATION_FIELD] instanceof Date\n ? patch[SCHEDULED_REACTIVATION_FIELD] as Date\n : undefined,\n organizationId:\n ((currentRow as { organizationId?: unknown }).organizationId as string | undefined)\n ?? executionContext?.initiatorIds?.organizationId,\n }, executionContext);\n } catch (error) {\n // A trail failure must not fail the transition it describes — but it must be loud,\n // so a dropped record reaches whoever is on call rather than vanishing.\n utils.logger?.error?.('Failed to record a status-transition audit event', {\n reason: 'resource_status_transition_audit_emission_failed',\n resourceType: String(definition.resourceIdentifier),\n operationIdentifier: String(definition.operationIdentifier),\n error: describeCaughtError(error),\n });\n }\n },\n });\n\n return patch;\n },\n },\n });\n };\n\n return factory as unknown as ResourceCustomServiceImplementationFactory;\n}\n\n/** Build every registration for a resource's lifecycle verbs in one call. */\nexport function createResourceStatusTransitionFactories(\n definitions: readonly ResourceStatusTransitionDefinition[],\n): ResourceCustomServiceImplementationFactory[] {\n return definitions.map(createResourceStatusTransitionFactory);\n}\n"]}
1
+ {"version":3,"file":"resource-status-transition.custom-impl.backend.service.js","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-status-transition.custom-impl.backend.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AAGH,OAAO,EACL,uCAAuC,EAEvC,2BAA2B,EAC3B,SAAS,EACT,4BAA4B,GAE7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,yCAAyC,GAE1C,MAAM,4GAA4G,CAAC;AAIpH,OAAO,EACL,2CAA2C,EAC3C,iCAAiC,EACjC,wCAAwC,GACzC,MAAM,4EAA4E,CAAC;AACpF,OAAO,EACL,kDAAkD,EAClD,wCAAwC,EACxC,6CAA6C,EAC7C,gDAAgD,EAChD,+CAA+C,EAC/C,6CAA6C,EAC7C,qCAAqC,GACtC,MAAM,mFAAmF,CAAC;AAG3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,+EAA+E,CAAC;AACvF,OAAO,EAAE,mCAAmC,EAAE,MAAM,gEAAgE,CAAC;AACrH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8EAA8E,CAAC;AAEnH,4EAA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UAAmC,CAAC,MAAM,IAAI,EAAE,CAAC;oCACzE,SAAS,EAAE,UAAU,CAAC,YAAY;oCAClC,aAAa,EAAE,UAAU,CAAC,eAAe;oCACzC,2EAA2E;oCAC3E,4EAA4E;oCAC5E,qBAAqB;oCACrB,MAAM,EAAE,+BAA+B,CAAC,KAAK,CAAC;oCAC9C,uBAAuB,EACrB,KAAK,CAAC,4BAA4B,CAAC,YAAY,IAAI;wCACjD,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAS;wCAC7C,CAAC,CAAC,SAAS;oCACf,cAAc,EACV,UAA2C,CAAC,cAAqC;2CAChF,gBAAgB,EAAE,YAAY,EAAE,cAAc;iCACpD,EAAE,gBAAgB,CAAC,CAAC;4BACzB,CAAC;4BAAC,OAAO,KAAK,EAAE,CAAC;gCACf,mFAAmF;gCACnF,wEAAwE;gCACxE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,kDAAkD,EAAE;oCACxE,MAAM,EAAE,kDAAkD;oCAC1D,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC;oCACnD,mBAAmB,EAAE,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC;oCAC3D,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC;iCAClC,CAAC,CAAC;4BACL,CAAC;wBACH,CAAC;qBACF,CAAC,CAAC;oBAEH,OAAO,KAAK,CAAC;gBACf,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,OAAgE,CAAC;AAC1E,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,uCAAuC,CACrD,WAA0D;IAE1D,OAAO,WAAW,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;AAChE,CAAC","sourcesContent":["/**\n * The shared implementation behind every account/entity lifecycle verb.\n *\n * ## What these verbs have in common\n *\n * SUSPEND, ACTIVATE, REACTIVATE, DEACTIVATE_ACCOUNT and their siblings differ only in which status\n * they write and which statuses they accept as a starting point. Each one validates a transition,\n * then writes `{status}` plus at most a scheduling date. Hand-rolling that per verb is how the\n * catalogue drifted in the first place: on 2026-08-01 a sweep found thirteen routed lifecycle\n * variants that declared a request contract, persisted nothing, and answered HTTP 200 — an operator\n * told a CRITICAL suspension had taken effect while the tenant kept serving.\n *\n * One factory, one place where the rules live.\n *\n * ## Why the transition is re-checked here, when `enabledCondition` already gates it\n *\n * It is a fail-closed backstop, NOT a duplicated rule. A custom implementation is addressed by an\n * EXACT operation-path key, so it runs for that path regardless of how the path was reached, while\n * `enabledCondition` is evaluated by the URL-facing dispatch. The organization-members config\n * records the same reasoning for why a role-change verb would not inherit UPDATE's ceiling gate.\n * The two also read different things: the gate sees the pre-fetched object, this sees the row the\n * write is actually about to land on.\n *\n * The rule itself is not duplicated — `allowedFromStatuses` is declared once per registration, and\n * the operation's `enabledCondition` is authored from the same set.\n *\n * ## Why `authoritativeFields` is mandatory here\n *\n * Every status field these verbs write is `.excludeFromUpdate()` — that is the whole reason the\n * verbs exist rather than letting a client PATCH the field. The repository re-parses every write\n * against the operation's `requestDto`, which names no status, so without an explicit declaration\n * the value survives only by being inferred as \"a key the hook added\". That inference is defeated\n * by any caller who reaches the service tier with the key already in the payload, and the write\n * silently becomes empty. See `resolveServerInjectedFieldAllowList` for the full mechanism.\n *\n * ## The trail is registered in the PREFIX and executes on COMMIT\n *\n * Both halves of that matter, and neither works alone:\n *\n * - **Registered in the prefix**, because that is the only phase that can see the caller's\n * `reason` / `suspensionReason`. The POSTFIX input is typed `z.infer<TOutput>` — the persisted\n * row — and these are not schema columns, so they appear on neither. Decision D2 named the trail\n * as their home; this is what actually puts them there.\n * - **Executed on commit**, because the prefix runs BEFORE persistence. Emitting there directly\n * would leave an audit row asserting a suspension that never happened whenever the write failed\n * — evidence of a state change nobody made, which is worse than no record.\n *\n * `registerTransactionPostCommitEffect` gives both, which is why this factory declares\n * `transactionalCore`. Note this changes NO deployment's transaction posture: the core engine\n * already declares transaction-requiring boundaries unconditionally (organization\n * activate/suspend/request_deletion/restore, organization-units MOVE, platform-access grants,\n * organization-member writes), so `validateInitializedRuntimeTransactionReadiness` already probes\n * every adapter at startup and a store that cannot commit already fails there. An earlier revision\n * of this comment claimed the opposite and used it to defer the fix — that was wrong, and it is\n * recorded here so the claim is not made a second time.\n *\n * `targetStatus` is the persisted FACT once the effect runs, not merely the intent: `status` is\n * declared in `authoritativeFields`, so the strict re-parse cannot strip the patch, and the startup\n * guard proves every declared name is a real persisted field of the resource.\n *\n * ## Why the administrative floors are enforced HERE and not per verb\n *\n * `status` is one of the two axes that decide whether a principal is an administratively usable\n * administrator — of the APPLICATION (with `appRoles`) or of ONE ORGANIZATION (with a membership's\n * `roles`) — and every verb served by this factory writes it. Both floors were originally wired onto\n * their resource's core `UPDATE`, but a custom implementation resolves by an EXACT operation-path\n * key, so neither extended to anything else:\n *\n * - `PUT /users/{id}/suspend-user` reached the same `status` field through this registration and\n * returned 200 on the LAST usable super-administrator, leaving an application with no principal\n * able to administer it and no in-product recovery door (every one is gated on the role now\n * unusable). Proven end-to-end before it was fixed.\n * - `organizationMembers | suspend` was the exact sibling: it strands ONE tenant, and\n * `ORGANIZATION_MEMBERS` declares no super-admin variant, so a platform administrator who is not\n * a member cannot re-own the stranded organization afterwards. Recovery exists, but only from\n * OUTSIDE the tenant: `organizationMembers.grantOwnership` is platform-tier.\n *\n * Placing the calls in the SHARED implementation rather than on each verb covers every current and\n * future status verb on every governed resource at once, which is the only version of this fix that\n * cannot be re-opened by the next lifecycle verb somebody adds. Each floor is gated on the subject\n * resource because the floors are scoped invariants while this factory is generic — see\n * {@link resolveStatusTransitionFloorGuards}.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — access-affecting lifecycle\n * changes run through one guarded authority that records what happened, rather than a generic field\n * write, and may not retire the last accountable administrative principal of an application or of a\n * tenant.\n */\n\nimport type { Container } from 'inversify';\nimport {\n AdministrativeContinuityBreachDetection,\n CoreResourceType,\n ErrorCustomMessageReference,\n ErrorType,\n ResourceOperationVariantType,\n type ResourceConfiguration_OperationPath,\n} from '@wildo-ai/saas-models';\nimport {\n createResourceCustomServiceImplementation,\n type ResourceCustomServiceImplementationFactory,\n} from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation.factory.backend';\nimport type { ResourcesRegistryBackendService } from '~wildo-backend-lib/resources/services/resources-registry.backend.service';\nimport type { ResourceOperation_CustomImplementation_Utils } from '~wildo-backend-lib/base-classes/services/services/resource-operation-custom-implementation-base.backend.service';\nimport type { ExecutionContext } from '~wildo-backend-lib/runtime/models/execution-context.backend.schemas';\nimport {\n assertSuperAdminFloorPreservedForTransition,\n createSuperAdminConferralResolver,\n isSuperAdminFloorGovernedSubjectResource,\n} from '~wildo-backend-lib/security/authorizations/super-admin-floor.backend.utils';\nimport {\n assertOrganizationOwnerFloorPreservedForTransition,\n createOrganizationOwnerConferralResolver,\n createOrganizationOwnerFloorPopulationContext,\n isOrganizationOwnerFloorAuthorityBearingResource,\n isOrganizationOwnerFloorGovernedSubjectResource,\n reportOrganizationsStrandedByUserDeactivation,\n membershipTransitionCouldReduceOwners,\n} from '~wildo-backend-lib/security/authorizations/organization-owner-floor.backend.utils';\nimport type { AuditLogsBackendService } from '~wildo-backend-lib/compliance/audit-trails/services/audit-logs.backend.service';\nimport type { AuthExecutionContextFactoryBackendService } from '~wildo-backend-lib/security/authentications/services/auth-execution-context-factory.backend.service';\nimport { SAAS_SERVICE_TYPES } from '~wildo-backend-lib/inject/models/service-types';\nimport {\n describeUnaddressableShape,\n resolveSingleSubjectId,\n} from '~wildo-backend-lib/base-classes/utils/single-subject-addressing.backend.utils';\nimport { registerTransactionPostCommitEffect } from '~wildo-backend-lib/databases/models/transaction.shared.schemas';\nimport { describeCaughtError } from '~wildo-backend-lib/errors/utils/error-log-level-classification.backend.utils';\n\n/** The status field every lifecycle-bearing resource in the engine uses. */\nconst STATUS_FIELD = 'status';\n\n/**\n * The caller's justification for a transition, under whichever name its verb gives it.\n *\n * `suspend` calls it `suspensionReason`; the others call it `reason`. Both spellings are read here\n * rather than threaded through each definition, because the value has ONE destination — the audit\n * row — and the request-contract vocabulary is a per-verb surface detail, not a semantic difference.\n * It is never persisted on the row: a suspension reason is a compliance artefact nothing reads back,\n * so a schema column would only create something an erasure would later have to scrub.\n */\nfunction resolveAuthoredTransitionReason(input: unknown): string | undefined {\n if (!input || typeof input !== 'object') return undefined;\n const payload = input as { reason?: unknown; suspensionReason?: unknown };\n const authored = payload.suspensionReason ?? payload.reason;\n return typeof authored === 'string' && authored.length > 0 ? authored : undefined;\n}\n\n/**\n * How a verb's request contract expresses \"and automatically undo this later\".\n *\n * The persisted field is always `scheduledReactivationAt` — named for the effect so one field and\n * one sweep serve every verb — but the caller-facing vocabulary differs per verb, and one of them\n * is not even an instant. Translating here keeps each request contract in its own natural terms\n * while the row stays uniform, the same split `ORGANIZATION_UNITS` MOVE uses (`newParentUnitId` in,\n * `parentUnitId` + `path` persisted).\n */\nexport enum StatusTransitionScheduleSource {\n /** The contract carries an absolute instant (`suspensionEndDate`, `reactivationDate`). */\n ABSOLUTE_DATE = 'absolute_date',\n /**\n * The contract carries a whole number of DAYS (`suspensionDuration`), resolved to an instant at\n * write time. A duration is meaningless without the moment it is measured from, and the row\n * records no such moment — so resolving it later would be guesswork.\n */\n DURATION_IN_DAYS = 'duration_in_days',\n}\n\n/**\n * What a verb DOES to the pending schedule — the discriminator of\n * {@link ResourceStatusTransitionScheduling}.\n *\n * A named vocabulary rather than an inline `'set' | 'clear'` union, for the same reason\n * {@link StatusTransitionScheduleSource} is one: it is a closed set with exactly one runtime source,\n * so every definition, every narrow, and every test fixture derives from here instead of re-spelling\n * the literal. The two axes are independent — `source` says how the caller EXPRESSES a schedule,\n * this says whether the verb writes one at all.\n */\nexport enum StatusTransitionScheduleMode {\n /** Carry a caller-supplied schedule onto the row. */\n SET = 'set',\n /**\n * Clear any pending schedule. Every \"undo\" verb uses this: a membership reactivated by hand must\n * not still carry the date at which a sweep would have reactivated it anyway, or a later\n * suspension would inherit a stale deadline.\n */\n CLEAR = 'clear',\n}\n\n/** The field the reactivation sweep reads. Declared once; every verb writes this same name. */\nconst SCHEDULED_REACTIVATION_FIELD = 'scheduledReactivationAt';\n\nconst MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;\n\nexport type ResourceStatusTransitionScheduling =\n | {\n mode: StatusTransitionScheduleMode.SET;\n /** The key in the operation's `requestDto` that carries it. */\n requestField: string;\n source: StatusTransitionScheduleSource;\n }\n | {\n mode: StatusTransitionScheduleMode.CLEAR;\n };\n\nexport interface ResourceStatusTransitionDefinition {\n resourceIdentifier: CoreResourceType;\n /** The custom verb this implements, e.g. `suspend`. */\n operationIdentifier: string;\n /** Written to `status` when the transition is legal. */\n targetStatus: string;\n /**\n * The ONLY statuses this verb may run from. Anything else is a `CONFLICT`.\n *\n * Fail-closed by construction: an unlisted status is refused rather than allowed. Keep it\n * identical to the operation's `enabledCondition` — the gate is the fast, user-facing rejection,\n * this is the backstop that cannot be routed around.\n */\n allowedFromStatuses: readonly string[];\n /** Optional time-boxing. Omit for a verb whose contract offers the caller no window. */\n scheduling?: ResourceStatusTransitionScheduling;\n /**\n * Whether this transition REMOVES access rather than restoring it.\n *\n * Declared, not inferred. The obvious proxies are both wrong: \"sets a schedule\" happens to\n * correlate today (you time-box a restriction) but is a coincidence of the current verbs, and\n * \"target is not ACTIVE\" cannot be evaluated generically because each resource has its own\n * status vocabulary. It only feeds the audit event's risk grading, where getting it backwards\n * would file suspensions among routine reinstatements — so it is worth one explicit word per\n * definition.\n */\n restrictsAccess: boolean;\n /** Overrides the generated debug label when a resource needs a clearer one. */\n debugLabel?: string;\n}\n\n/**\n * A NARROW VIEW of the pre-operation snapshot — NOT a description of what the row contains.\n *\n * `utils.currentObject` comes from `fetchCurrentObjectForOperation`, which performs a full\n * `repository.read` on the addressed id, so the snapshot carries EVERY readable field of the row.\n * This type lists only what this implementation reads, and the authority fields are optional because\n * they exist on SOME governed resources and not others — not because a live row is expected to be\n * sparse. Test doubles for `currentObject` should mirror a persisted row, not this projection.\n *\n * The authority axes are read only by the floor guards (see {@link resolveStatusTransitionFloorGuards}):\n *\n * - `appRoles` — the APPLICATION axis, on `USERS` / `USER_SELF`. Those are two resource\n * configurations over the SAME collection sharing `UserSchema` as their `mainSchema`, so the field\n * is present through either door.\n * - `roles` + `organizationId` — the ORGANIZATIONS axis, on `ORGANIZATION_MEMBERS`. The first decides\n * whether the row is an owner grant; the second names the population to measure.\n *\n * All three are typed `unknown` rather than `string[]`/`string` on purpose: this is the raw snapshot,\n * and each floor's own helpers are the authority on what a valid value is.\n */\ntype StatusBearingRow = {\n _id: string;\n status?: string;\n appRoles?: unknown;\n roles?: unknown;\n organizationId?: unknown;\n};\n\n/**\n * Refuse a payload that already carries a field this verb owns.\n *\n * Defence in depth for the same hole `authoritativeFields` closes. With the declaration in place\n * such a payload is harmless — the hook's value wins — but the request is still malformed: passing\n * `status` to `suspend` asks the verb to do something other than suspend. A loud 400 beats\n * honouring one of two contradictory instructions, and it surfaces a caller who believes the field\n * is theirs to set.\n */\nfunction assertNoAuthoredFieldInRequest(\n input: unknown,\n authoredFields: readonly string[],\n definition: ResourceStatusTransitionDefinition,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils,\n): void {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return;\n\n const offending = authoredFields.filter((field) =>\n Object.prototype.hasOwnProperty.call(input, field));\n if (offending.length === 0) return;\n\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message:\n `The '${definition.operationIdentifier}' operation owns ${offending.join(', ')} and does not `\n + 'accept it from the caller',\n reason: 'resource_status_transition_authored_field_in_request',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n offendingFields: offending,\n },\n });\n}\n\n/** Resolve the caller's scheduling input to the absolute instant the sweep compares against. */\nfunction resolveScheduledReactivation(\n scheduling: ResourceStatusTransitionScheduling,\n input: unknown,\n definition: ResourceStatusTransitionDefinition,\n executionContext: ExecutionContext<any>,\n utils: ResourceOperation_CustomImplementation_Utils,\n): Date | null {\n // `null`, not `undefined`: the patch must actively CLEAR a stale deadline, and an `undefined`\n // value is dropped by the write rather than unsetting the field.\n if (scheduling.mode === StatusTransitionScheduleMode.CLEAR) return null;\n\n const authored = (input as Record<string, unknown> | undefined)?.[scheduling.requestField];\n if (authored === undefined || authored === null) return null;\n\n if (scheduling.source === StatusTransitionScheduleSource.ABSOLUTE_DATE) {\n const asDate = authored instanceof Date ? authored : new Date(String(authored));\n if (Number.isNaN(asDate.getTime())) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message: `${scheduling.requestField} is not a valid date`,\n reason: 'resource_status_transition_invalid_schedule',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n },\n });\n }\n return asDate;\n }\n\n // DURATION_IN_DAYS — resolve against now, because the row records no other reference moment.\n const days = typeof authored === 'number' ? authored : Number(authored);\n if (!Number.isFinite(days) || days <= 0) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message: `${scheduling.requestField} must be a positive number of days`,\n reason: 'resource_status_transition_invalid_schedule',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n received: authored,\n },\n });\n }\n return new Date(Date.now() + days * MILLISECONDS_PER_DAY);\n}\n\n/**\n * The fields a definition writes — and therefore exactly what it must declare as authoritative.\n *\n * Derived rather than authored so the declaration cannot drift from the patch. A verb that gains a\n * schedule gains the declaration in the same edit.\n */\nexport function resolveStatusTransitionAuthoredFields(\n definition: ResourceStatusTransitionDefinition,\n): string[] {\n return definition.scheduling\n ? [STATUS_FIELD, SCHEDULED_REACTIVATION_FIELD]\n : [STATUS_FIELD];\n}\n\n/**\n * Build the `prefixCoreOperations` patch for one transition.\n *\n * Exported for testing: it is the whole decision, and it is pure apart from the row it is handed.\n */\nexport function buildStatusTransitionPatch(params: {\n definition: ResourceStatusTransitionDefinition;\n currentRow: StatusBearingRow;\n input: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n}): Record<string, unknown> {\n const { definition, currentRow, input, executionContext, utils } = params;\n\n if (!definition.allowedFromStatuses.includes(currentRow.status ?? '')) {\n throw utils.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {\n customMessageReference: ErrorCustomMessageReference.RESOURCE_STATUS_TRANSITION_CONFLICT,\n context: {\n reason: 'resource_status_transition_not_permitted_from_current_status',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: currentRow._id,\n currentStatus: currentRow.status ?? null,\n targetStatus: definition.targetStatus,\n allowedFromStatuses: [...definition.allowedFromStatuses],\n },\n });\n }\n\n const patch: Record<string, unknown> = { [STATUS_FIELD]: definition.targetStatus };\n\n if (definition.scheduling) {\n patch[SCHEDULED_REACTIVATION_FIELD] = resolveScheduledReactivation(\n definition.scheduling, input, definition, executionContext, utils,\n );\n }\n\n return patch;\n}\n\n/**\n * Refuse a transition that would leave the application with no administratively usable\n * super-administrator.\n *\n * ## Only the status axis moves\n *\n * These verbs write `status` and at most a schedule — never `appRoles`. So the roles are passed as\n * BOTH the previous and the next value: the transition check needs the authority axis to decide\n * whether the subject counted at all, and stating it unchanged is what makes \"this write cannot\n * touch conferral\" explicit rather than implied by omission.\n *\n * ## Cost\n *\n * `assertSuperAdminFloorPreservedForTransition` short-circuits before issuing any query unless the\n * subject counted toward the floor BEFORE the write and would stop counting after it. So an\n * ordinary user suspension, and every transition INTO the authenticable set (`unsuspend_user`,\n * whose subject was by definition not usable beforehand), pay two set-membership tests and nothing\n * else. Only the genuinely dangerous case reaches the population query.\n *\n * ## Fail closed on a snapshot without the authority axis\n *\n * `appRoles` is what the whole decision turns on. A snapshot that lacks it cannot answer whether\n * this subject is an administrator, and answering \"not an administrator\" would fail OPEN on exactly\n * the input the guard exists for. Refusing instead mirrors the sibling `users | DELETE` guard, and\n * costs nothing in practice: the field carries a `.default([APP_USER])` and both floor-governed\n * resources read the same `UserSchema`, so a live snapshot always carries it.\n *\n * Exported for testing: like {@link buildStatusTransitionPatch} it is the whole decision, and it is\n * pure apart from the row and the collaborators it is handed.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — an account-lifecycle change\n * must not retire the last accountable administrative principal.\n */\nexport async function assertStatusTransitionPreservesSuperAdminFloor(params: {\n definition: ResourceStatusTransitionDefinition;\n currentRow: StatusBearingRow;\n /** The status the patch is about to write — read from the patch, not re-derived. */\n nextStatus: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n conferringRoles: readonly string[];\n}): Promise<void> {\n const { definition, currentRow, nextStatus, executionContext, utils, conferringRoles } = params;\n\n if (!Array.isArray(currentRow.appRoles)) {\n throw utils.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {\n context: {\n message:\n 'Refused: the application roles of the account being changed could not be read, so it cannot '\n + 'be proven that this transition would not disable the last usable super-administrator.',\n reason: 'resource_status_transition_subject_authority_unreadable',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: currentRow._id,\n },\n });\n }\n\n await assertSuperAdminFloorPreservedForTransition({\n subjectUserId: currentRow._id,\n previousRoles: currentRow.appRoles,\n previousStatus: currentRow.status,\n // Unchanged by construction — see the header.\n nextRoles: currentRow.appRoles,\n nextStatus,\n executionContext,\n repositoriesRegistry: utils.repositoriesRegistry,\n errorBuilder: utils.errorBuilder,\n conferringRoles,\n operationIdentifier: definition.operationIdentifier,\n });\n}\n\n/**\n * Refuse a transition that would leave an organization with no administratively usable owner.\n *\n * The ORGANIZATION-scope twin of {@link assertStatusTransitionPreservesSuperAdminFloor}, and the\n * differences are all consequences of the population being per-tenant rather than per-application:\n *\n * - **The subject names its own population.** `organizationId` selects which tenant to measure, so a\n * snapshot without it cannot be evaluated at all — unlike the application floor, where there is\n * only ever one population.\n * - **The measurement runs under a SYSTEM context, not the caller's.** The floor must see every owner\n * membership AND the `status` of every one of those owners' `User` rows, and the `ORG_ADMIN`s who\n * reach these verbs cannot list `USERS` at all. The authority owns that decision — see\n * {@link createOrganizationOwnerFloorPopulationContext}.\n * - **The short-circuit is asked HERE, before the context is built.** Constructing the system context\n * is a registry lookup plus a possible application-id resolution, and suspending an ordinary member\n * — the overwhelmingly common case — must not pay for it. This is not a second copy of the rule:\n * {@link membershipTransitionCouldReduceOwners} is the authority's own predicate, and the assertion\n * below calls it again.\n *\n * Fails closed on a snapshot that carries no `roles` or no `organizationId`, for the reason the\n * application twin does: answering \"not an owner\" would fail OPEN on exactly the input the guard\n * exists for, and a suspended last owner cannot be reactivated by anyone — `ORGANIZATION_MEMBERS`\n * declares exactly one cross-tenant variant — `grantOwnership` — so recovery from a stranded state\n * is a platform-operator action, never a tenant one. That is why the in-tenant refusal still stands.\n *\n * assurance-control: WILDO.ACCESS.ADMINISTRATIVE_CONTINUITY — a membership-lifecycle change\n * must not retire a tenant's last accountable administrative principal.\n */\nexport async function assertStatusTransitionPreservesOrganizationOwnerFloor(params: {\n definition: ResourceStatusTransitionDefinition;\n currentRow: StatusBearingRow;\n /** The status the patch is about to write — read from the patch, not re-derived. */\n nextStatus: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n conferringRoles: readonly string[];\n /** Resolved lazily and only once a reduction is established — see the header. */\n resolveAuthExecutionContextFactory: () => AuthExecutionContextFactoryBackendService;\n}): Promise<void> {\n const {\n definition, currentRow, nextStatus, executionContext, utils, conferringRoles,\n resolveAuthExecutionContextFactory,\n } = params;\n\n const organizationId = typeof currentRow.organizationId === 'string' ? currentRow.organizationId : undefined;\n\n if (!Array.isArray(currentRow.roles) || !organizationId) {\n throw utils.errorBuilder.buildError(ErrorType.CONFLICT, executionContext, {\n context: {\n message:\n 'Refused: the roles or the owning organization of the membership being changed could not be '\n + \"read, so it cannot be proven that this transition would not retire the organization's last \"\n + 'usable owner.',\n reason: 'resource_status_transition_subject_authority_unreadable',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: currentRow._id,\n },\n });\n }\n\n const transition = {\n previousRoles: currentRow.roles,\n previousStatus: currentRow.status,\n // Unchanged by construction: these verbs write `status` and at most a schedule, never `roles`.\n nextRoles: currentRow.roles,\n nextStatus,\n conferringRoles,\n };\n\n if (!membershipTransitionCouldReduceOwners(transition)) return;\n\n await assertOrganizationOwnerFloorPreservedForTransition({\n ...transition,\n memberId: currentRow._id,\n organizationId,\n executionContext: await createOrganizationOwnerFloorPopulationContext(resolveAuthExecutionContextFactory()),\n repositoriesRegistry: utils.repositoriesRegistry,\n errorBuilder: utils.errorBuilder,\n operationIdentifier: definition.operationIdentifier,\n });\n}\n\n/**\n * One administrative floor a status transition must not breach, bound to a single definition.\n *\n * A list rather than a chain of `if`s inside the hook, because the set of floors that govern a row is\n * a property of the RESOURCE and is therefore decidable once, at factory construction, from static\n * data. Adding the next authority is one entry here — and, more to the point, a lifecycle verb added\n * to a governed resource inherits every floor automatically instead of depending on somebody\n * remembering to wire it. That omission is the whole defect class this file now closes.\n */\ntype StatusTransitionFloorGuard = (params: {\n currentRow: StatusBearingRow;\n nextStatus: unknown;\n executionContext: ExecutionContext<any>;\n utils: ResourceOperation_CustomImplementation_Utils;\n}) => Promise<void>;\n\n/**\n * The floors that govern one definition's resource, resolved once when the factory is built.\n *\n * Every collaborator is bound LAZILY. Factories are constructed during module registration, which can\n * run before the authorization and authentication services are bound, so an eager `container.get`\n * would turn a guard into a startup crash. The conferral resolvers additionally re-read the live role\n * table on every call, because `initializeRolesWithCustom` mutates it in place.\n *\n * A resource governed by NO floor gets an empty list and pays nothing at all — not a container\n * lookup, not a closure invocation. That is the common case (organization units, and every\n * application resource that grows a lifecycle verb later).\n */\nfunction resolveStatusTransitionFloorGuards(\n definition: ResourceStatusTransitionDefinition,\n container: Container,\n): StatusTransitionFloorGuard[] {\n const guards: StatusTransitionFloorGuard[] = [];\n\n if (isSuperAdminFloorGovernedSubjectResource(definition.resourceIdentifier)) {\n const superAdminConferralResolver = createSuperAdminConferralResolver(container);\n guards.push(({ currentRow, nextStatus, executionContext, utils }) =>\n assertStatusTransitionPreservesSuperAdminFloor({\n definition,\n currentRow,\n nextStatus,\n executionContext,\n utils,\n conferringRoles: superAdminConferralResolver(),\n }));\n }\n\n // ── USERS lifecycle: REPORT, never refuse ──────────────────────────────────────────────────\n // A deactivated user stops counting as a usable owner, so this transition can strand a tenant —\n // and unlike every other floor surface it must still be allowed to proceed. Suspension is normally\n // incident response, and refusing it would mean an operator cannot lock out a compromised owner\n // without first transferring ownership using the tenant the attacker controls. The stranded tenant\n // is recoverable (boot report finds it, `grantOwnership` repairs it); the live hostile session is\n // not. See `reportOrganizationsStrandedByUserDeactivation` for the full argument.\n if (isOrganizationOwnerFloorGovernedSubjectResource(definition.resourceIdentifier)) {\n const strandingConferralResolver = createOrganizationOwnerConferralResolver(container);\n guards.push(async ({ currentRow, nextStatus, executionContext, utils }) => {\n await reportOrganizationsStrandedByUserDeactivation({\n subjectUserId: String(currentRow._id),\n nextStatus,\n executionContext,\n repositoriesRegistry: utils.repositoriesRegistry,\n errorBuilder: utils.errorBuilder,\n conferringRoles: strandingConferralResolver(),\n operationIdentifier: definition.operationIdentifier,\n report: async (breach) => {\n // An AUDIT ROW, not a log line — one per stranded tenant. The justification for allowing\n // this write at all is that the consequence becomes visible, and a log line is not\n // queryable evidence and never reaches a SIEM. `CRITICAL` + the AUTHORIZATION category\n // route it through the same export path as every other authority event.\n await container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService)\n .logOrganizationOwnerFloorBreached({\n organizationId: breach.organizationId,\n // A guard SAW this one and let it through, which is what separates it from the boot\n // report's observation of a tenant stranded out-of-band.\n detectedBy: AdministrativeContinuityBreachDetection.ALLOWED_LIFECYCLE_ACTION,\n reducedMemberIds: breach.reducedMemberIds,\n remainingUsableOwners: breach.remainingUsableOwners,\n operationIdentifier: definition.operationIdentifier,\n subjectUserId: String(currentRow._id),\n subjectNextStatus: String(nextStatus),\n }, executionContext);\n\n // The log line stays as the operator-facing half: an audit row is for the auditor, and\n // whoever is on call during an incident is reading logs, not the trail.\n utils.logger?.error?.(\n 'Organization left with no administratively usable owner by a user lifecycle transition',\n {\n reason: 'organization_owner_floor_stranded_by_user_deactivation',\n organizationId: breach.organizationId,\n subjectUserId: String(currentRow._id),\n remedy: 'organizationMembers.grantOwnership (platform-tier) restores an owner.',\n },\n );\n },\n });\n });\n }\n\n if (isOrganizationOwnerFloorAuthorityBearingResource(definition.resourceIdentifier)) {\n const ownerConferralResolver = createOrganizationOwnerConferralResolver(container);\n let authExecutionContextFactory: AuthExecutionContextFactoryBackendService | undefined;\n const resolveAuthExecutionContextFactory = (): AuthExecutionContextFactoryBackendService =>\n (authExecutionContextFactory ??= container.get<AuthExecutionContextFactoryBackendService>(\n SAAS_SERVICE_TYPES.AuthExecutionContextFactory,\n ));\n\n guards.push(({ currentRow, nextStatus, executionContext, utils }) =>\n assertStatusTransitionPreservesOrganizationOwnerFloor({\n definition,\n currentRow,\n nextStatus,\n executionContext,\n utils,\n conferringRoles: ownerConferralResolver(),\n resolveAuthExecutionContextFactory,\n }));\n }\n\n return guards;\n}\n\n/**\n * One lifecycle transition, as a registrable custom implementation.\n *\n * Modelled on `createOrganizationUnitStatusTransitionFactory`, which established the pattern for\n * this engine: validate against the loaded row, then RETURN the field patch for the core UPDATE to\n * persist rather than writing directly. The difference is that this one is resource-agnostic and\n * declares `authoritativeFields`, which the org-units original did not need — its `status` is not\n * `.excludeFromUpdate()`, so its patch survived on the introduced-key inference alone.\n */\nexport function createResourceStatusTransitionFactory(\n definition: ResourceStatusTransitionDefinition,\n): ResourceCustomServiceImplementationFactory {\n const authoredFields = resolveStatusTransitionAuthoredFields(definition);\n\n const factory = (_resourcesRegistryService: ResourcesRegistryBackendService, container: Container) => {\n const floorGuards = resolveStatusTransitionFloorGuards(definition, container);\n\n return createResourceCustomServiceImplementation({\n operationPath: {\n resourceIdentifier: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n variantType: ResourceOperationVariantType.API_CALL,\n isOperationDefault: true,\n } as ResourceConfiguration_OperationPath<any, any>,\n debugLabel:\n definition.debugLabel\n ?? `${String(definition.resourceIdentifier)}.${definition.operationIdentifier}.status-transition`,\n // `status` and `scheduledReactivationAt` are `.excludeFromUpdate()` on every resource this\n // serves. Without this the repository's strict re-parse drops the patch for any caller who\n // reached the service tier with the key already present, and the verb answers success having\n // changed nothing — the exact defect it was written to fix.\n authoritativeFields: authoredFields,\n // The audit row is registered from the PREFIX (the only phase that can see the caller's\n // `reason`) and executes on COMMIT, so it never describes a write that rolled back. That\n // needs a commit hook to exist, which is what this declares.\n //\n // No participants: the transition writes exactly one row, on the operation's own resource,\n // which the framework includes automatically. Contrast the ORGANIZATIONS lifecycle verbs,\n // which name ORGANIZATION_MEMBERS + USERS because they reconcile membership-derived global\n // `userTypes` in the same unit of work.\n //\n // This does NOT change any deployment's transaction posture: the core engine already\n // declares transaction-requiring boundaries unconditionally (organization\n // activate/suspend/request_deletion/restore, organization-units MOVE, platform-access\n // grants, organization-member writes), so `validateInitializedRuntimeTransactionReadiness`\n // already probes every adapter at startup and a store that cannot commit already fails\n // there — see the `rejects transaction readiness against a standalone MongoDB server` pin.\n transactionalCore: true,\n transactionParticipants: {},\n handlers: {\n prefixCoreOperations: async (_id, input, executionContext, _operationPath, utils) => {\n // Fail closed on anything but a single addressed row. An ids array or a population filter\n // reaching this path would make the status check evaluate against the wrong thing — or\n // against nothing — while still returning a patch the core write would happily apply.\n //\n // A conditional `{ _id, … }` filter is single-subject and therefore admitted: `_id` names the\n // row the pre-fetched `currentObject` below describes, and the extra predicates only decide\n // whether the core write lands. Refusing it used to make status transitions the ONE verb\n // family that could not be written as a compare-and-swap.\n const subjectResourceId = resolveSingleSubjectId(_id);\n if (subjectResourceId === undefined) {\n throw utils.errorBuilder.buildError(ErrorType.VALIDATION, executionContext, {\n context: {\n message:\n `${definition.operationIdentifier} requires a single addressed resource to validate `\n + 'the status transition',\n reason: 'resource_status_transition_unaddressed',\n resourceType: definition.resourceIdentifier,\n receivedAddressing: describeUnaddressableShape(_id),\n },\n });\n }\n\n assertNoAuthoredFieldInRequest(input, authoredFields, definition, executionContext, utils);\n\n // The framework pre-fetches the target row for UPDATE-like operations, so this is the row\n // the write is about to land on. Absent means the transition cannot be validated — which\n // must never read as \"allowed\" on an access-affecting verb.\n const currentRow = utils.currentObject as StatusBearingRow | undefined;\n if (!currentRow) {\n throw utils.errorBuilder.buildError(ErrorType.NOT_FOUND, executionContext, {\n customMessageReference: ErrorCustomMessageReference.NOT_FOUND,\n context: {\n reason: 'resource_status_transition_target_not_found',\n resourceType: definition.resourceIdentifier,\n operationIdentifier: definition.operationIdentifier,\n resourceId: subjectResourceId,\n },\n });\n }\n\n const patch = buildStatusTransitionPatch({\n definition,\n currentRow: { ...currentRow, _id: subjectResourceId },\n input,\n executionContext,\n utils,\n });\n\n // AFTER the transition-legality check on purpose: a verb refused because it cannot run\n // from the current status should say so — the more specific finding — and should not\n // have issued a floor's population query on the way to being rejected anyway.\n for (const assertFloorPreserved of floorGuards) {\n await assertFloorPreserved({\n currentRow: { ...currentRow, _id: subjectResourceId },\n // Read from the patch rather than re-derived from the definition, so no guard can\n // measure a status other than the one about to be persisted.\n nextStatus: patch[STATUS_FIELD],\n executionContext,\n utils,\n });\n }\n\n // Trail the transition. Registered HERE — the only phase that can see the caller's\n // `reason`, since the POSTFIX input is typed `z.infer<TOutput>` (the persisted row) and\n // `reason` is not a schema column, so it appears on neither.\n //\n // It EXECUTES on commit, so it never describes a write that rolled back. That is why the\n // registration declares `transactionalCore` above: without a commit hook the choice would\n // be between emitting early (recording suspensions that later failed) and emitting from a\n // postfix that cannot see the reason. With one, neither compromise is necessary.\n //\n // `targetStatus` is the persisted fact once this commits, not merely the intent: `status`\n // is declared in `authoritativeFields`, so the patch cannot be stripped by the strict\n // re-parse, and the startup guard proves every declared name is a real persisted field.\n // Fail CLOSED on a missing transaction rather than skipping the trail. This registration\n // declares `transactionalCore`, so the framework guarantees one; its absence means that\n // contract is broken, and silently proceeding would perform an access-affecting\n // transition with no record — the outcome the audit exists to make impossible. Same shape\n // as `registerOrganizationLifecycleAudit` on the tenant verbs.\n const transaction = utils.serviceOptions?.transaction;\n if (!transaction) {\n throw utils.errorBuilder.buildError(ErrorType.CONFIGURATION, executionContext, {\n customMessageReference: ErrorCustomMessageReference.CONFIGURATION,\n context: {\n message:\n 'A status transition cannot be recorded: no transaction is active, but this '\n + 'operation declares transactionalCore.',\n reason: 'resource_status_transition_audit_requires_transaction',\n resourceType: String(definition.resourceIdentifier),\n operationIdentifier: String(definition.operationIdentifier),\n },\n });\n }\n\n registerTransactionPostCommitEffect(transaction, {\n key: `resource-status-transition:${String(definition.resourceIdentifier)}`\n + `:${definition.operationIdentifier}:${subjectResourceId}`,\n execute: async () => {\n try {\n await container.get<AuditLogsBackendService>(SAAS_SERVICE_TYPES.AuditLogsService)\n .logResourceStatusTransitionPerformed({\n resourceType: String(definition.resourceIdentifier),\n operationIdentifier: String(definition.operationIdentifier),\n subjectId: subjectResourceId,\n performedBy: String(executionContext?.initiatorIds?.userId ?? 'system'),\n previousStatus: String((currentRow as { status?: unknown }).status ?? ''),\n newStatus: definition.targetStatus,\n isRestricting: definition.restrictsAccess,\n // The field decision D2 promised the trail would carry. Both spellings are\n // accepted because the verbs differ: `suspend` names it `suspensionReason`,\n // the rest `reason`.\n reason: resolveAuthoredTransitionReason(input),\n scheduledReactivationAt:\n patch[SCHEDULED_REACTIVATION_FIELD] instanceof Date\n ? patch[SCHEDULED_REACTIVATION_FIELD] as Date\n : undefined,\n organizationId:\n ((currentRow as { organizationId?: unknown }).organizationId as string | undefined)\n ?? executionContext?.initiatorIds?.organizationId,\n }, executionContext);\n } catch (error) {\n // A trail failure must not fail the transition it describes — but it must be loud,\n // so a dropped record reaches whoever is on call rather than vanishing.\n utils.logger?.error?.('Failed to record a status-transition audit event', {\n reason: 'resource_status_transition_audit_emission_failed',\n resourceType: String(definition.resourceIdentifier),\n operationIdentifier: String(definition.operationIdentifier),\n error: describeCaughtError(error),\n });\n }\n },\n });\n\n return patch;\n },\n },\n });\n };\n\n return factory as unknown as ResourceCustomServiceImplementationFactory;\n}\n\n/** Build every registration for a resource's lifecycle verbs in one call. */\nexport function createResourceStatusTransitionFactories(\n definitions: readonly ResourceStatusTransitionDefinition[],\n): ResourceCustomServiceImplementationFactory[] {\n return definitions.map(createResourceStatusTransitionFactory);\n}\n"]}
@@ -12,6 +12,7 @@
12
12
  * operation declares no gate yet, the set here is still authoritative and the gate should be added
13
13
  * to match.
14
14
  */
15
+ import { type ResourceStatusTransitionDefinition } from '../../../base-classes/services/services/resource-status-transition.custom-impl.backend.service';
15
16
  import type { ResourceCustomServiceImplementationFactory } from '../../../base-classes/services/services/resource-operation-custom-implementation.factory.backend';
16
17
  /**
17
18
  * Every engine lifecycle transition served by the SHARED implementation.
@@ -37,5 +38,15 @@ import type { ResourceCustomServiceImplementationFactory } from '../../../base-c
37
38
  * `authoritativeFields`, so their patches survive the repository's strict re-parse for the same
38
39
  * reason these do.
39
40
  */
41
+ /**
42
+ * Every engine transition, as DATA.
43
+ *
44
+ * Exported so a test can assert a property OF THE SHIPPED TABLE rather than of a fixture it wrote
45
+ * itself. That distinction is not academic: the first version of the #430 disjointness pin declared
46
+ * its own two definitions and asserted they did not overlap, which stayed green when the production
47
+ * `unsuspend_user` was widened to accept `INACTIVE` — the exact change it existed to forbid. A pin
48
+ * that cannot see the table cannot pin the table.
49
+ */
50
+ export declare const ENGINE_STATUS_TRANSITION_DEFINITIONS: readonly ResourceStatusTransitionDefinition[];
40
51
  export declare function createEngineResourceStatusTransitionFactories(): ResourceCustomServiceImplementationFactory[];
41
52
  //# sourceMappingURL=resource-status-transition.definitions.backend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource-status-transition.definitions.backend.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-status-transition.definitions.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgBH,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,4GAA4G,CAAC;AAmH7K;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,6CAA6C,IAAI,0CAA0C,EAAE,CAM5G"}
1
+ {"version":3,"file":"resource-status-transition.definitions.backend.d.ts","sourceRoot":"","sources":["../../../../../../src/base-classes/services/services/resource-status-transition.definitions.backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,OAAO,EAIL,KAAK,kCAAkC,EACxC,MAAM,0GAA0G,CAAC;AAClH,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,4GAA4G,CAAC;AA2I7K;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;;;;;;;;GAQG;AACH,eAAO,MAAM,oCAAoC,EAAE,SAAS,kCAAkC,EAI7F,CAAC;AAEF,wBAAgB,6CAA6C,IAAI,0CAA0C,EAAE,CAE5G"}
@@ -81,6 +81,30 @@ const USER_TRANSITIONS = [
81
81
  restrictsAccess: false,
82
82
  scheduling: { mode: StatusTransitionScheduleMode.CLEAR },
83
83
  },
84
+ /*
85
+ * The administrative door back from a SELF-deactivated account (#430).
86
+ *
87
+ * `allowedFromStatuses` is INACTIVE and NOT SUSPENDED, and the pair above is why: an imposed halt
88
+ * and a chosen departure are lifted by different verbs on purpose, so `reactivate_user` and
89
+ * `unsuspend_user` have DISJOINT source states. A single verb covering both was the rejected
90
+ * option — it reads as a simplification and erases the one distinction these two states carry.
91
+ *
92
+ * Routing it through this factory is also what makes the write land: `status` is
93
+ * `.excludeFromUpdate()`, so an operation writing it directly persists nothing and reports
94
+ * success. The factory is the SYSTEM door, and it is also what emits the transition audit row and
95
+ * runs the administrative-continuity floors — the three things a config-level status prefix
96
+ * silently skipped when `REACTIVATE_ACCOUNT` was implemented that way.
97
+ */
98
+ {
99
+ resourceIdentifier: CoreResourceType.USERS,
100
+ operationIdentifier: Users_Operations.REACTIVATE_USER,
101
+ targetStatus: UserStatus.ACTIVE,
102
+ allowedFromStatuses: [UserStatus.INACTIVE],
103
+ restrictsAccess: false,
104
+ // Clears any residual deadline, so a reinstated account cannot inherit scheduling state from an
105
+ // earlier administrative suspension. Same reason as the self-service inverse below.
106
+ scheduling: { mode: StatusTransitionScheduleMode.CLEAR },
107
+ },
84
108
  ];
85
109
  /**
86
110
  * SELF-SERVICE account deactivation.
@@ -148,11 +172,21 @@ const USER_SELF_TRANSITIONS = [
148
172
  * `authoritativeFields`, so their patches survive the repository's strict re-parse for the same
149
173
  * reason these do.
150
174
  */
175
+ /**
176
+ * Every engine transition, as DATA.
177
+ *
178
+ * Exported so a test can assert a property OF THE SHIPPED TABLE rather than of a fixture it wrote
179
+ * itself. That distinction is not academic: the first version of the #430 disjointness pin declared
180
+ * its own two definitions and asserted they did not overlap, which stayed green when the production
181
+ * `unsuspend_user` was widened to accept `INACTIVE` — the exact change it existed to forbid. A pin
182
+ * that cannot see the table cannot pin the table.
183
+ */
184
+ export const ENGINE_STATUS_TRANSITION_DEFINITIONS = [
185
+ ...ORGANIZATION_MEMBER_TRANSITIONS,
186
+ ...USER_TRANSITIONS,
187
+ ...USER_SELF_TRANSITIONS,
188
+ ];
151
189
  export function createEngineResourceStatusTransitionFactories() {
152
- return createResourceStatusTransitionFactories([
153
- ...ORGANIZATION_MEMBER_TRANSITIONS,
154
- ...USER_TRANSITIONS,
155
- ...USER_SELF_TRANSITIONS,
156
- ]);
190
+ return createResourceStatusTransitionFactories([...ENGINE_STATUS_TRANSITION_DEFINITIONS]);
157
191
  }
158
192
  //# sourceMappingURL=resource-status-transition.definitions.backend.js.map