@wildo-ai/saas-models 1.1.5 → 1.1.6

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 (888) hide show
  1. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts.map +1 -1
  2. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -1
  3. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  4. package/dist/esm/applications/applications-context.schemas.d.ts +176 -2
  5. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  6. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  7. package/dist/esm/applications/applications.shared.resources-config.schemas.js +3 -2
  8. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  9. package/dist/esm/applications/applications.shared.schemas.d.ts +7 -5
  10. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  11. package/dist/esm/applications/applications.shared.schemas.js +6 -4
  12. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  13. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +10 -1
  14. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  15. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +49 -15
  16. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.schemas.js +2 -2
  18. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +25 -0
  20. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  21. package/dist/esm/billing/billing-configuration.shared.schemas.js +19 -0
  22. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +27 -5
  24. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  25. package/dist/esm/billing/billing-enums.shared.schemas.js +30 -4
  26. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/billing-types.shared.schemas.d.ts +37 -11
  28. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  29. package/dist/esm/billing/billing-types.shared.schemas.js +31 -19
  30. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  31. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +2 -0
  32. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  33. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +18 -7
  34. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  35. package/dist/esm/billing/credit-pool.shared.schemas.d.ts +2 -0
  36. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  37. package/dist/esm/billing/credit-pool.shared.schemas.js +7 -1
  38. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  39. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +6 -6
  40. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  41. package/dist/esm/billing/invoice-ref.shared.schemas.js +1 -1
  42. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/price.shared.schemas.js +5 -3
  45. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  46. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts +11 -1
  47. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +39 -23
  49. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  50. package/dist/esm/billing/product-definition.shared.schemas.d.ts +30 -2
  51. package/dist/esm/billing/product-definition.shared.schemas.d.ts.map +1 -1
  52. package/dist/esm/billing/product-definition.shared.schemas.js +35 -0
  53. package/dist/esm/billing/product-definition.shared.schemas.js.map +1 -1
  54. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +6 -3
  55. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/product.shared.schemas.d.ts +7 -3
  57. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  58. package/dist/esm/billing/product.shared.schemas.js +22 -7
  59. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  60. package/dist/esm/billing/promotions.shared.resources-config.schemas.js +8 -8
  61. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  62. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts +135 -0
  63. package/dist/esm/billing/public-pricing-catalog.shared.atoms.d.ts.map +1 -0
  64. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js +112 -0
  65. package/dist/esm/billing/public-pricing-catalog.shared.atoms.js.map +1 -0
  66. package/dist/esm/billing/public-pricing-catalog.shared.d.ts +30 -0
  67. package/dist/esm/billing/public-pricing-catalog.shared.d.ts.map +1 -0
  68. package/dist/esm/billing/public-pricing-catalog.shared.js +53 -0
  69. package/dist/esm/billing/public-pricing-catalog.shared.js.map +1 -0
  70. package/dist/esm/billing/referral-reward.shared.schemas.d.ts +51 -0
  71. package/dist/esm/billing/referral-reward.shared.schemas.d.ts.map +1 -0
  72. package/dist/esm/billing/referral-reward.shared.schemas.js +92 -0
  73. package/dist/esm/billing/referral-reward.shared.schemas.js.map +1 -0
  74. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts +54 -33
  75. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  76. package/dist/esm/billing/referral.shared.resources-config.schemas.js +56 -2
  77. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  78. package/dist/esm/billing/referral.shared.schemas.d.ts +22 -37
  79. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  80. package/dist/esm/billing/referral.shared.schemas.js +24 -44
  81. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  82. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +9 -1
  83. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  84. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +55 -22
  85. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  86. package/dist/esm/billing/subscription.shared.schemas.d.ts +80 -5
  87. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  88. package/dist/esm/billing/subscription.shared.schemas.js +85 -25
  89. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  90. package/dist/esm/billing/usage-record.shared.schemas.js +5 -5
  91. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  92. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +143 -2
  93. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  94. package/dist/esm/companion/provider-discovery.shared.schemas.js +84 -1
  95. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  96. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -1
  97. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  98. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +4 -0
  99. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  100. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts +70 -0
  101. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.d.ts.map +1 -1
  102. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js +87 -0
  103. package/dist/esm/compliance/audit-trails/audit-actor.shared.schemas.js.map +1 -1
  104. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts +34 -0
  105. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +137 -3
  107. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -1
  108. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts +7 -0
  109. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.d.ts.map +1 -1
  110. package/dist/esm/compliance/audit-trails/audit-log-sink.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +28 -2
  112. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  113. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +29 -8
  114. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  115. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +29 -6
  116. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  117. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +38 -9
  118. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  119. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +1822 -146
  120. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  121. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +1777 -87
  122. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  123. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts +10 -0
  124. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  125. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +148 -7
  126. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  127. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +2 -0
  128. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  129. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js +2 -0
  130. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  131. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts +0 -8
  132. package/dist/esm/compliance/privacy/data-retention.shared.schemas.d.ts.map +0 -1
  133. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js.map +0 -1
  134. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +17 -8
  135. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -1
  136. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +43 -20
  137. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -1
  138. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +38 -0
  139. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  140. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +39 -0
  141. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  142. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts +35 -0
  143. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.d.ts.map +1 -0
  144. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js +82 -0
  145. package/dist/esm/compliance/privacy/legal-hold-subject-attribution.shared.utils.js.map +1 -0
  146. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts +37 -0
  147. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.d.ts.map +1 -0
  148. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js +223 -0
  149. package/dist/esm/compliance/privacy/legal-holds.shared.resources-config.schemas.js.map +1 -0
  150. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts +222 -0
  151. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.d.ts.map +1 -0
  152. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js +331 -0
  153. package/dist/esm/compliance/privacy/legal-holds.shared.schemas.js.map +1 -0
  154. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +37 -3
  155. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  156. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +33 -4
  157. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  158. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts +52 -0
  159. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.d.ts.map +1 -0
  160. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js +116 -0
  161. package/dist/esm/compliance/privacy/provider-capability-disclosure.shared.schemas.js.map +1 -0
  162. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts +11 -0
  163. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.d.ts.map +1 -0
  164. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js +11 -0
  165. package/dist/esm/compliance/privacy/purpose-ref.shared.schemas.js.map +1 -0
  166. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts +93 -0
  167. package/dist/esm/compliance/privacy/retention-binding.shared.utils.d.ts.map +1 -0
  168. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js +149 -0
  169. package/dist/esm/compliance/privacy/retention-binding.shared.utils.js.map +1 -0
  170. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts +43 -0
  171. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.d.ts.map +1 -0
  172. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js +106 -0
  173. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.resources-config.schemas.js.map +1 -0
  174. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts +209 -0
  175. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.d.ts.map +1 -0
  176. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js +226 -0
  177. package/dist/esm/compliance/privacy/retention-enforcement-records.shared.schemas.js.map +1 -0
  178. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts +129 -5
  179. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.d.ts.map +1 -1
  180. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js +128 -4
  181. package/dist/esm/compliance/privacy/retention-schedule.shared.schemas.js.map +1 -1
  182. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts +53 -0
  183. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.d.ts.map +1 -0
  184. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js +74 -0
  185. package/dist/esm/compliance/privacy/retention-scope-deleted.shared.utils.js.map +1 -0
  186. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts +311 -0
  187. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.d.ts.map +1 -0
  188. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js +355 -0
  189. package/dist/esm/compliance/privacy/subject-data-recipients.shared.schemas.js.map +1 -0
  190. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +178 -39
  191. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  192. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +145 -35
  193. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  194. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.d.ts.map +1 -1
  195. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js +26 -0
  196. package/dist/esm/compliance/privacy/subject-export-render.shared.utils.js.map +1 -1
  197. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts +9 -0
  198. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  199. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  200. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +109 -1
  201. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  202. package/dist/esm/config/app-configuration-shared.shared.schemas.js +57 -0
  203. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  204. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +69 -0
  205. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  206. package/dist/esm/config/entity-identity-config.shared.schemas.js +93 -0
  207. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  208. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +16 -16
  209. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +160 -61
  210. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  211. package/dist/esm/config/frontend/navigation.shared.schemas.js +297 -65
  212. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  213. package/dist/esm/errors/caught-error-description.shared.utils.d.ts +69 -0
  214. package/dist/esm/errors/caught-error-description.shared.utils.d.ts.map +1 -0
  215. package/dist/esm/errors/caught-error-description.shared.utils.js +77 -0
  216. package/dist/esm/errors/caught-error-description.shared.utils.js.map +1 -0
  217. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +76 -3
  218. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  219. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +76 -2
  220. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  221. package/dist/esm/errors/errors.shared.schemas.d.ts +20 -1
  222. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  223. package/dist/esm/errors/errors.shared.schemas.js +16 -9
  224. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  225. package/dist/esm/errors/errors.shared.utils.d.ts +0 -24
  226. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  227. package/dist/esm/errors/errors.shared.utils.js +0 -39
  228. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  229. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +6 -7
  230. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -1
  231. package/dist/esm/errors/thrown-value-description.shared.utils.js +6 -7
  232. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -1
  233. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts +70 -0
  234. package/dist/esm/external-data/external-data-pipeline-description.shared.d.ts.map +1 -0
  235. package/dist/esm/external-data/external-data-pipeline-description.shared.js +92 -0
  236. package/dist/esm/external-data/external-data-pipeline-description.shared.js.map +1 -0
  237. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts +154 -0
  238. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.d.ts.map +1 -0
  239. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js +161 -0
  240. package/dist/esm/external-data/external-data-pipeline-pass-mode.shared.js.map +1 -0
  241. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +1071 -23
  242. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  243. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js +1065 -17
  244. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  245. package/dist/esm/external-data/external-data-provenance.shared.d.ts +71 -0
  246. package/dist/esm/external-data/external-data-provenance.shared.d.ts.map +1 -0
  247. package/dist/esm/external-data/external-data-provenance.shared.js +88 -0
  248. package/dist/esm/external-data/external-data-provenance.shared.js.map +1 -0
  249. package/dist/esm/external-data.exports.d.ts +5 -0
  250. package/dist/esm/external-data.exports.d.ts.map +1 -1
  251. package/dist/esm/external-data.exports.js +11 -0
  252. package/dist/esm/external-data.exports.js.map +1 -1
  253. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +17 -2
  254. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  255. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +22 -4
  256. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  258. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +3 -0
  259. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  260. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -1
  261. package/dist/esm/external-providers/engine-capability-surface.shared.js +2 -0
  262. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -1
  263. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +152 -1
  264. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  265. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +4 -3
  266. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  267. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +4 -3
  268. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +45 -0
  270. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -1
  271. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +14 -0
  272. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -1
  273. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +188 -4
  274. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  275. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +76 -9
  276. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  277. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts +175 -33
  278. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -1
  279. package/dist/esm/external-providers/frontend-provider-public-config.shared.js +247 -42
  280. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -1
  281. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts +53 -0
  282. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.d.ts.map +1 -0
  283. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js +41 -0
  284. package/dist/esm/external-providers/model-cost-accounting-config.shared.schemas.js.map +1 -0
  285. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts +150 -0
  286. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.d.ts.map +1 -0
  287. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js +22 -0
  288. package/dist/esm/external-providers/provider-address-lookup-contract.shared.types.js.map +1 -0
  289. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts +42 -0
  290. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.d.ts.map +1 -0
  291. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js +49 -0
  292. package/dist/esm/external-providers/provider-augmentation-opt-ins.shared.schemas.js.map +1 -0
  293. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +53 -0
  294. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -1
  295. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js +56 -0
  296. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -1
  297. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +34 -0
  298. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  299. package/dist/esm/external-providers/provider-capability.shared.schemas.js +34 -0
  300. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  301. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +341 -4
  302. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  303. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +270 -20
  304. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  305. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts +6 -2
  306. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -1
  307. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js +6 -2
  308. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -1
  309. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +174 -1
  310. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  311. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +125 -0
  312. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  313. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +3 -3
  314. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts +42 -0
  315. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.d.ts.map +1 -0
  316. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js +57 -0
  317. package/dist/esm/external-providers/provider-package-allow-list.shared.schemas.js.map +1 -0
  318. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +6 -0
  319. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  320. package/dist/esm/external-providers/provider-protocol.shared.schemas.js +6 -0
  321. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  322. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts +58 -0
  323. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.d.ts.map +1 -0
  324. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js +35 -0
  325. package/dist/esm/external-providers/provider-scope-reauthorization.shared.schemas.js.map +1 -0
  326. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts +115 -0
  327. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.d.ts.map +1 -0
  328. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js +137 -0
  329. package/dist/esm/external-providers/provider-shared-connections.shared.schemas.js.map +1 -0
  330. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts +73 -0
  331. package/dist/esm/external-providers/provider-usage-cost.shared.d.ts.map +1 -0
  332. package/dist/esm/external-providers/provider-usage-cost.shared.js +171 -0
  333. package/dist/esm/external-providers/provider-usage-cost.shared.js.map +1 -0
  334. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts +12 -0
  335. package/dist/esm/external-providers/provider-usage-pricing.example.d.ts.map +1 -0
  336. package/dist/esm/external-providers/provider-usage-pricing.example.js +40 -0
  337. package/dist/esm/external-providers/provider-usage-pricing.example.js.map +1 -0
  338. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts +68 -32
  339. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.d.ts.map +1 -1
  340. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js +63 -52
  341. package/dist/esm/external-providers/provider-usage-pricing.shared.schemas.js.map +1 -1
  342. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts +5 -5
  343. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  344. package/dist/esm/features/application-features.shared.resources-config.schemas.js +13 -5
  345. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  346. package/dist/esm/features/connected-feature.example.d.ts.map +1 -1
  347. package/dist/esm/features/connected-feature.example.js +2 -1
  348. package/dist/esm/features/connected-feature.example.js.map +1 -1
  349. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  350. package/dist/esm/features/core-feature-definitions.shared.js +2 -1
  351. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  352. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  353. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  354. package/dist/esm/features/feature-definition.shared.schemas.d.ts +2 -11
  355. package/dist/esm/features/feature-definition.shared.schemas.d.ts.map +1 -1
  356. package/dist/esm/features/feature-definition.shared.schemas.js +0 -12
  357. package/dist/esm/features/feature-definition.shared.schemas.js.map +1 -1
  358. package/dist/esm/features/scope-features.shared.schemas.d.ts +31 -17
  359. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  360. package/dist/esm/features/scope-features.shared.schemas.js +27 -5
  361. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  362. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +5 -5
  363. package/dist/esm/flows-actors/actors.shared.schemas.d.ts +127 -11
  364. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  365. package/dist/esm/flows-actors/actors.shared.schemas.js +32 -1
  366. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  367. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +16 -0
  368. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  369. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js +7 -0
  370. package/dist/esm/flows-actors/agent-traceability.shared.schemas.js.map +1 -1
  371. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts +68 -0
  372. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.d.ts.map +1 -0
  373. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js +276 -0
  374. package/dist/esm/flows-actors/agent-work-decisions.shared.resources-config.schemas.js.map +1 -0
  375. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts +468 -0
  376. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.d.ts.map +1 -0
  377. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js +472 -0
  378. package/dist/esm/flows-actors/agent-work-decisions.shared.schemas.js.map +1 -0
  379. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts +118 -0
  380. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.d.ts.map +1 -0
  381. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js +144 -0
  382. package/dist/esm/flows-actors/autonomous-agents.shared.schemas.js.map +1 -0
  383. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +142 -8
  384. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  385. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +209 -11
  386. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  387. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +37 -2
  388. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  389. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +30 -2
  390. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  391. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts +0 -11
  392. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  393. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js +12 -5
  394. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  395. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts +45 -6
  396. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  397. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js +31 -5
  398. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  399. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +30 -30
  400. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  401. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +15 -7
  402. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  403. package/dist/esm/flows-actors/flows.shared.schemas.d.ts +15 -0
  404. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  405. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +506 -0
  406. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -1
  407. package/dist/esm/flows-actors/human-decision.shared.schemas.js +502 -0
  408. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -1
  409. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts +46 -0
  410. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.d.ts.map +1 -0
  411. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js +65 -0
  412. package/dist/esm/flows-actors/model-call-attributions.shared.resources-config.schemas.js.map +1 -0
  413. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts +120 -0
  414. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.d.ts.map +1 -0
  415. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js +165 -0
  416. package/dist/esm/flows-actors/model-call-attributions.shared.schemas.js.map +1 -0
  417. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts +45 -0
  418. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.d.ts.map +1 -0
  419. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js +127 -0
  420. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.resources-config.schemas.js.map +1 -0
  421. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts +83 -0
  422. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.d.ts.map +1 -0
  423. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js +97 -0
  424. package/dist/esm/flows-actors/model-cost-period-aggregates.shared.schemas.js.map +1 -0
  425. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts +136 -0
  426. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.d.ts.map +1 -0
  427. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js +90 -0
  428. package/dist/esm/flows-actors/model-cost-summary.shared.schemas.js.map +1 -0
  429. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +5 -1
  430. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -1
  431. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js +19 -4
  432. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -1
  433. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts +13 -15
  434. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -1
  435. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js +30 -17
  436. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -1
  437. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts +268 -0
  438. package/dist/esm/flows-actors/review-deadlines.shared.schemas.d.ts.map +1 -0
  439. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js +576 -0
  440. package/dist/esm/flows-actors/review-deadlines.shared.schemas.js.map +1 -0
  441. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +30 -0
  442. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  443. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts +129 -0
  444. package/dist/esm/flows-actors/work-attribution.shared.schemas.d.ts.map +1 -0
  445. package/dist/esm/flows-actors/work-attribution.shared.schemas.js +141 -0
  446. package/dist/esm/flows-actors/work-attribution.shared.schemas.js.map +1 -0
  447. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts +22 -1
  448. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.d.ts.map +1 -1
  449. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js +23 -0
  450. package/dist/esm/frontend-definitions/frontend-notification-custom-message-ref.definitions.js.map +1 -1
  451. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +61 -0
  452. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -1
  453. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +61 -0
  454. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -1
  455. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  456. package/dist/esm/guidance/guidance-state.shared.schemas.js +11 -10
  457. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  458. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +6 -6
  459. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  460. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  461. package/dist/esm/guidance/progression-state.shared.schemas.js +8 -7
  462. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  463. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +1 -1
  464. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  465. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +550 -30
  466. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  467. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +498 -34
  468. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  469. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts +62 -0
  470. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.d.ts.map +1 -0
  471. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js +66 -0
  472. package/dist/esm/http-api-binding/http-api-erasure-stance.shared.js.map +1 -0
  473. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts +133 -0
  474. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.d.ts.map +1 -0
  475. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js +191 -0
  476. package/dist/esm/http-api-binding/http-api-rest-write-operations.shared.schemas.js.map +1 -0
  477. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +37 -6
  478. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -1
  479. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js +37 -6
  480. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -1
  481. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts +36 -0
  482. package/dist/esm/i18n/application-config-vocabulary.shared.d.ts.map +1 -0
  483. package/dist/esm/i18n/application-config-vocabulary.shared.js +39 -0
  484. package/dist/esm/i18n/application-config-vocabulary.shared.js.map +1 -0
  485. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts +11 -0
  486. package/dist/esm/i18n/engine-open-vocabulary-values.shared.d.ts.map +1 -0
  487. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js +14 -0
  488. package/dist/esm/i18n/engine-open-vocabulary-values.shared.js.map +1 -0
  489. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts +20 -0
  490. package/dist/esm/i18n/engine-open-vocabulary.shared.d.ts.map +1 -0
  491. package/dist/esm/i18n/engine-open-vocabulary.shared.js +21 -0
  492. package/dist/esm/i18n/engine-open-vocabulary.shared.js.map +1 -0
  493. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts +94 -0
  494. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.d.ts.map +1 -0
  495. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js +206 -0
  496. package/dist/esm/inbound/conversation-threads.shared.resources-config.schemas.js.map +1 -0
  497. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts +169 -0
  498. package/dist/esm/inbound/conversation-threads.shared.schemas.d.ts.map +1 -0
  499. package/dist/esm/inbound/conversation-threads.shared.schemas.js +231 -0
  500. package/dist/esm/inbound/conversation-threads.shared.schemas.js.map +1 -0
  501. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts +195 -0
  502. package/dist/esm/inbound/inbound-channels.shared.schemas.d.ts.map +1 -0
  503. package/dist/esm/inbound/inbound-channels.shared.schemas.js +244 -0
  504. package/dist/esm/inbound/inbound-channels.shared.schemas.js.map +1 -0
  505. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts +36 -0
  506. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.d.ts.map +1 -0
  507. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js +169 -0
  508. package/dist/esm/inbound/inbound-delivery.shared.resources-config.schemas.js.map +1 -0
  509. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts +404 -0
  510. package/dist/esm/inbound/inbound-delivery.shared.schemas.d.ts.map +1 -0
  511. package/dist/esm/inbound/inbound-delivery.shared.schemas.js +449 -0
  512. package/dist/esm/inbound/inbound-delivery.shared.schemas.js.map +1 -0
  513. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts +46 -0
  514. package/dist/esm/inbound/inbound-endpoint-env.shared.d.ts.map +1 -0
  515. package/dist/esm/inbound/inbound-endpoint-env.shared.js +57 -0
  516. package/dist/esm/inbound/inbound-endpoint-env.shared.js.map +1 -0
  517. package/dist/esm/index.d.ts +58 -1
  518. package/dist/esm/index.d.ts.map +1 -1
  519. package/dist/esm/index.js +67 -1
  520. package/dist/esm/index.js.map +1 -1
  521. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +28 -0
  522. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -1
  523. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js +29 -0
  524. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  525. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +95 -1
  526. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -1
  527. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +121 -0
  528. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -1
  529. package/dist/esm/meta-workflows.exports.d.ts +0 -1
  530. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  531. package/dist/esm/meta-workflows.exports.js +0 -1
  532. package/dist/esm/meta-workflows.exports.js.map +1 -1
  533. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +7 -1
  534. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  535. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js +35 -0
  536. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  537. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts +131 -0
  538. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.d.ts.map +1 -0
  539. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js +258 -0
  540. package/dist/esm/notifications/inbound-email/inbound-email.shared.resources-config.schemas.js.map +1 -0
  541. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts +448 -0
  542. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.d.ts.map +1 -0
  543. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js +530 -0
  544. package/dist/esm/notifications/inbound-email/inbound-email.shared.schemas.js.map +1 -0
  545. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  546. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js +4 -3
  547. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  548. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +16 -1
  549. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  550. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +46 -16
  551. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  552. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts +19 -12
  553. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  554. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +77 -12
  555. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  556. package/dist/esm/notifications/notification-badges.schemas.d.ts +35 -3
  557. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  558. package/dist/esm/notifications/notification-badges.schemas.js +43 -3
  559. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  560. package/dist/esm/notifications/notifications.shared.schemas.d.ts +66 -399
  561. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/notifications/notifications.shared.schemas.js +111 -58
  563. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  564. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +5 -5
  565. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +6 -6
  566. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  567. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +3 -0
  568. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  569. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +60 -14
  570. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/organizations/organization-members.shared.schemas.d.ts +3 -0
  572. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  573. package/dist/esm/organizations/organization-members.shared.schemas.js +30 -0
  574. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  575. package/dist/esm/organizations/organization-notifications.shared.schemas.js +9 -9
  576. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  577. package/dist/esm/organizations/organization-preferences.shared.schemas.js +4 -4
  578. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  579. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts +0 -1
  580. package/dist/esm/organizations/organization-profile.shared.resources-config.schemas.d.ts.map +1 -1
  581. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +5 -5
  582. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  583. package/dist/esm/organizations/organization-profile.shared.schemas.js +15 -10
  584. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  585. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js +1 -1
  586. package/dist/esm/organizations/organization-unit-members.shared.resources-config.schemas.js.map +1 -1
  587. package/dist/esm/organizations/organization-unit-members.shared.schemas.d.ts.map +1 -1
  588. package/dist/esm/organizations/organization-unit-members.shared.schemas.js +2 -1
  589. package/dist/esm/organizations/organization-unit-members.shared.schemas.js.map +1 -1
  590. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts +63 -1
  591. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.d.ts.map +1 -1
  592. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js +106 -5
  593. package/dist/esm/organizations/organization-unit-narrowing-decision.shared.js.map +1 -1
  594. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  595. package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -0
  596. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  597. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  598. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js +7 -2
  599. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  600. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +3 -1
  601. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  602. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +12 -8
  603. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  604. package/dist/esm/organizations/organizations.shared.schemas.d.ts +7 -2
  605. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  606. package/dist/esm/organizations/organizations.shared.schemas.js +51 -1
  607. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  608. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts +58 -0
  609. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.d.ts.map +1 -0
  610. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js +188 -0
  611. package/dist/esm/organizations/service-provider-activity-feed.shared.resources-config.schemas.js.map +1 -0
  612. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts +122 -0
  613. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.d.ts.map +1 -0
  614. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js +136 -0
  615. package/dist/esm/organizations/service-provider-activity-feed.shared.schemas.js.map +1 -0
  616. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts +36 -0
  617. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.d.ts.map +1 -0
  618. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js +155 -0
  619. package/dist/esm/organizations/service-provider-capability-grants.shared.resources-config.schemas.js.map +1 -0
  620. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts +229 -0
  621. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.d.ts.map +1 -0
  622. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js +290 -0
  623. package/dist/esm/organizations/service-provider-capability-grants.shared.schemas.js.map +1 -0
  624. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts +48 -0
  625. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.d.ts.map +1 -0
  626. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js +50 -0
  627. package/dist/esm/organizations/service-provider-client-controls.shared.schemas.js.map +1 -0
  628. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts +97 -0
  629. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.d.ts.map +1 -0
  630. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js +572 -0
  631. package/dist/esm/organizations/service-provider-relationships.shared.resources-config.schemas.js.map +1 -0
  632. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts +590 -0
  633. package/dist/esm/organizations/service-provider-relationships.shared.schemas.d.ts.map +1 -0
  634. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js +869 -0
  635. package/dist/esm/organizations/service-provider-relationships.shared.schemas.js.map +1 -0
  636. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +36 -6
  637. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  638. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +57 -16
  639. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  640. package/dist/esm/provider-registration-runtime.exports.d.ts +0 -1
  641. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  642. package/dist/esm/provider-registration-runtime.exports.js +0 -1
  643. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  644. package/dist/esm/public-runtime/index.d.ts +30 -11
  645. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  646. package/dist/esm/public-runtime/index.js +30 -11
  647. package/dist/esm/public-runtime/index.js.map +1 -1
  648. package/dist/esm/queue/jobs.shared.schemas.d.ts +36 -8
  649. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  650. package/dist/esm/queue/jobs.shared.schemas.js +12 -0
  651. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  652. package/dist/esm/requests/header-keys.shared.d.ts +6 -0
  653. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  654. package/dist/esm/requests/header-keys.shared.js +7 -0
  655. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  656. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  657. package/dist/esm/requests/manual-controllers-routes-documentation.js +147 -8
  658. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  659. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +51 -23
  660. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  661. package/dist/esm/requests/manual-controllers-routes-urls.js +64 -0
  662. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  663. package/dist/esm/requests/websocket.shared.schemas.d.ts +78 -13
  664. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  665. package/dist/esm/requests/websocket.shared.schemas.js +91 -18
  666. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  667. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts +21 -0
  668. package/dist/esm/resources/embedded-resource-mark.shared.utils.d.ts.map +1 -0
  669. package/dist/esm/resources/embedded-resource-mark.shared.utils.js +22 -0
  670. package/dist/esm/resources/embedded-resource-mark.shared.utils.js.map +1 -0
  671. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  672. package/dist/esm/resources/resources-config.shared.factory.js +812 -32
  673. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  674. package/dist/esm/resources/resources-config.shared.schemas.d.ts +244 -48
  675. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  676. package/dist/esm/resources/resources-config.shared.schemas.js +151 -17
  677. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  678. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  679. package/dist/esm/resources/resources-registry.shared.core.definitions.js +353 -12
  680. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  681. package/dist/esm/resources/resources.shared.core.definitions.d.ts +45 -0
  682. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  683. package/dist/esm/resources/resources.shared.core.definitions.js +92 -0
  684. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  685. package/dist/esm/resources/resources.shared.schemas.d.ts +2 -17
  686. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  687. package/dist/esm/resources/resources.shared.schemas.js +24 -20
  688. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  689. package/dist/esm/resources/resources.shared.utils.d.ts +16 -8
  690. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  691. package/dist/esm/resources/resources.shared.utils.js +16 -8
  692. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  693. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts +2 -2
  694. package/dist/esm/resources/utils/collection-export.shared.utils.d.ts.map +1 -1
  695. package/dist/esm/resources/utils/collection-export.shared.utils.js +4 -2
  696. package/dist/esm/resources/utils/collection-export.shared.utils.js.map +1 -1
  697. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts +103 -0
  698. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.d.ts.map +1 -0
  699. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js +275 -0
  700. package/dist/esm/resources/utils/http-api-write-declaration.shared.utils.js.map +1 -0
  701. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts +51 -0
  702. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.d.ts.map +1 -0
  703. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js +28 -0
  704. package/dist/esm/resources/utils/no-subject-data-stance-coherence.shared.utils.js.map +1 -0
  705. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -1
  706. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js +30 -19
  707. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -1
  708. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts +2 -0
  709. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.d.ts.map +1 -0
  710. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js +33 -0
  711. package/dist/esm/resources/utils/request-schema-field-carriage.shared.utils.js.map +1 -0
  712. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts +15 -0
  713. package/dist/esm/resources/utils/resource-polymorphism.factory.d.ts.map +1 -1
  714. package/dist/esm/resources/utils/resource-polymorphism.factory.js +6 -1
  715. package/dist/esm/resources/utils/resource-polymorphism.factory.js.map +1 -1
  716. package/dist/esm/resources/utils/resource-polymorphism.schemas.js +30 -4
  717. package/dist/esm/resources/utils/resource-polymorphism.schemas.js.map +1 -1
  718. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +46 -0
  719. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  720. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +205 -22
  721. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  722. package/dist/esm/resources/utils/resources-serialization.utils.d.ts +19 -2
  723. package/dist/esm/resources/utils/resources-serialization.utils.d.ts.map +1 -1
  724. package/dist/esm/resources/utils/resources-serialization.utils.js +4 -0
  725. package/dist/esm/resources/utils/resources-serialization.utils.js.map +1 -1
  726. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  727. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +15 -9
  728. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  729. package/dist/esm/resources/work-unit.shared.schemas.d.ts +20 -0
  730. package/dist/esm/resources/work-unit.shared.schemas.d.ts.map +1 -0
  731. package/dist/esm/resources/work-unit.shared.schemas.js +19 -0
  732. package/dist/esm/resources/work-unit.shared.schemas.js.map +1 -0
  733. package/dist/esm/runtime/execution-context.shared.schemas.d.ts +48 -1
  734. package/dist/esm/runtime/execution-context.shared.schemas.d.ts.map +1 -1
  735. package/dist/esm/runtime/execution-context.shared.schemas.js +101 -9
  736. package/dist/esm/runtime/execution-context.shared.schemas.js.map +1 -1
  737. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
  738. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  739. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +37 -20
  740. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  741. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
  742. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  743. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +61 -48
  744. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  745. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts +26 -0
  746. package/dist/esm/security/api-keys/api-keys.shared.schemas.d.ts.map +1 -1
  747. package/dist/esm/security/api-keys/api-keys.shared.schemas.js +39 -5
  748. package/dist/esm/security/api-keys/api-keys.shared.schemas.js.map +1 -1
  749. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +5 -3
  750. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  751. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +6 -0
  752. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  753. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +2 -2
  754. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  755. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts +11 -0
  756. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  757. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js +19 -8
  758. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  759. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +1 -1
  760. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +5 -5
  761. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  762. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js +11 -11
  763. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  764. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts +2 -0
  765. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.d.ts.map +1 -1
  766. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js +9 -0
  767. package/dist/esm/security/authentications/scim/scim-tokens.shared.schemas.js.map +1 -1
  768. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts +169 -0
  769. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.d.ts.map +1 -0
  770. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js +162 -0
  771. package/dist/esm/security/authentications/service-provider-client-authentication.shared.schemas.js.map +1 -0
  772. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  773. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js +10 -8
  774. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  775. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +8 -8
  776. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  777. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  778. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +17 -16
  779. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  780. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  781. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +28 -25
  782. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  783. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts +17 -6
  784. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  785. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js +90 -38
  786. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  787. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -24
  788. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  789. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +79 -68
  790. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  791. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts +8 -1
  792. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  793. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +7 -0
  794. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  795. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +1 -1
  796. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -1
  797. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +7 -7
  798. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  799. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  800. package/dist/esm/security/authorizations/roles.shared.defaults.js +56 -0
  801. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  802. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +77 -1
  803. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  804. package/dist/esm/security/authorizations/roles.shared.schemas.js +90 -0
  805. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  806. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts +86 -0
  807. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.d.ts.map +1 -0
  808. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js +40 -0
  809. package/dist/esm/security/connected-accounts/provider-connection-listing.shared.schemas.js.map +1 -0
  810. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +2 -1
  811. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  812. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +2 -1
  813. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -1
  814. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +2 -1
  815. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  816. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +2 -1
  817. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  818. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +46 -14
  819. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  820. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +81 -21
  821. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  822. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts +69 -0
  823. package/dist/esm/security/credential-rotation-grace.shared.utils.d.ts.map +1 -0
  824. package/dist/esm/security/credential-rotation-grace.shared.utils.js +77 -0
  825. package/dist/esm/security/credential-rotation-grace.shared.utils.js.map +1 -0
  826. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  827. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +28 -8
  828. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  829. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +3 -1
  830. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  831. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +89 -14
  832. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  833. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +1 -0
  834. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  835. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +25 -4
  836. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  837. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +7 -1
  838. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -1
  839. package/dist/esm/security/outbound-target-control.shared.schemas.js +6 -0
  840. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -1
  841. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts +143 -0
  842. package/dist/esm/security/submission-challenge/submission-challenge.shared.d.ts.map +1 -0
  843. package/dist/esm/security/submission-challenge/submission-challenge.shared.js +123 -0
  844. package/dist/esm/security/submission-challenge/submission-challenge.shared.js.map +1 -0
  845. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts +384 -0
  846. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.d.ts.map +1 -0
  847. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js +327 -0
  848. package/dist/esm/systems-of-record/system-of-record-actions.shared.schemas.js.map +1 -0
  849. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +121 -8
  850. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -1
  851. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js +83 -4
  852. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -1
  853. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts +266 -8
  854. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -1
  855. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js +291 -7
  856. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -1
  857. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts +313 -3
  858. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -1
  859. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js +369 -3
  860. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -1
  861. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -1
  862. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js +2 -1
  863. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -1
  864. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +5 -3
  865. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  866. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js +19 -10
  867. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  868. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  869. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +6 -0
  870. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  871. package/dist/esm/users/user-preferences-reset.shared.utils.js +2 -2
  872. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  873. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +0 -3
  874. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  875. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +0 -3
  876. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  877. package/dist/esm/users/user-self.shared.resources-config.schemas.js +1 -1
  878. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  879. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  880. package/dist/esm/users/users.shared.resources-config.schemas.js +82 -20
  881. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  882. package/dist/esm/users/users.shared.schemas.d.ts +12 -9
  883. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  884. package/dist/esm/users/users.shared.schemas.js +49 -18
  885. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  886. package/package.json +4 -4
  887. package/dist/esm/compliance/privacy/data-retention.shared.schemas.js +0 -7
  888. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,10 +1,18 @@
1
1
  import { z } from "zod";
2
2
  import { ResourcePrimaryScope } from "../resources/resources.shared.schemas.js";
3
+ /**
4
+ * The channels the dispatcher delivers a user notification through.
5
+ *
6
+ * `SMS` and `PUSH` were members until #1799 and neither delivered: the dispatcher logged "not yet
7
+ * implemented" and returned, no notification in the engine or its applications declared either, and a
8
+ * notification definition had no text to send. They are removed rather than kept as channels an author
9
+ * could declare and never have sent. An SMS channel is buildable on the existing SMS provider — it
10
+ * needs a per-notification text contract and the verified phone — and returns when it is built; push
11
+ * has no infrastructure at all.
12
+ */
3
13
  export var CoreUserNotificationChannel;
4
14
  (function (CoreUserNotificationChannel) {
5
15
  CoreUserNotificationChannel["EMAIL"] = "email";
6
- CoreUserNotificationChannel["SMS"] = "sms";
7
- CoreUserNotificationChannel["PUSH"] = "push";
8
16
  CoreUserNotificationChannel["WEBSOCKET"] = "websocket";
9
17
  CoreUserNotificationChannel["FRONT_END_SUCCESS"] = "front_end_success";
10
18
  })(CoreUserNotificationChannel || (CoreUserNotificationChannel = {}));
@@ -15,10 +23,8 @@ export var UserNotificationLevel;
15
23
  UserNotificationLevel["WARNING"] = "warning";
16
24
  UserNotificationLevel["ERROR"] = "error";
17
25
  })(UserNotificationLevel || (UserNotificationLevel = {}));
18
- export const UserNotificationChannelSchema = z.union([
19
- z.enum(CoreUserNotificationChannel),
20
- z.string().min(1)
21
- ]);
26
+ /** A user notification channel: exactly the channels the dispatcher delivers (#1874). */
27
+ export const UserNotificationChannelSchema = z.enum(CoreUserNotificationChannel);
22
28
  /** @wildo_source:part:start saas.models.notifications.targets facet:layer:shared facet:audience:app-developer */
23
29
  /**
24
30
  * WHO a declared `userNotifications` entry reaches — and, on the EMAIL channel, whether the tenant
@@ -33,25 +39,28 @@ export const UserNotificationChannelSchema = z.union([
33
39
  * other target reaches somebody because of a ROLE they hold, and a personal switch must not
34
40
  * silently disable a tenant's administrative monitoring. See
35
41
  * {@link userNotificationTargetIsSuppressibleByRecipientPreference};
36
- * 3. **whether `userRoles` is read at all** — see {@link userNotificationTargetReadsUserRoles}. On the
37
- * two tenant-wide targets the field is REFUSED rather than ignored, because "everyone in the
38
- * tenant" is not a set a role list may narrow.
42
+ * 3. **whether `userRoles` is read at all** — see {@link userNotificationTargetReadsUserRoles}. Where it
43
+ * is not read it is REFUSED rather than ignored — on the two tenant-wide targets because "everyone
44
+ * in the tenant" is not a set a role list may narrow, and everywhere else because a filter that
45
+ * does nothing misleads whoever reads the declaration.
39
46
  *
40
47
  * ## Who each target resolves to
41
48
  *
42
49
  * | target | recipients |
43
50
  * |---|---|
44
51
  * | `USER_SELF` | the initiator of the operation |
45
- * | `USERS_CUSTOM` | whatever your `userIdsSelector` returns. Without that function the target resolves nobody |
52
+ * | `USERS_CUSTOM` | whatever your `userIdsSelector` returns. The function is required |
46
53
  * | `ORGANIZATION`, `ORGANIZATION_USERS` | every member of the initiator's tenant. `userRoles` is refused here |
47
54
  * | `ORGANIZATION_BILLING`, `ORGANIZATION_SECURITY`, `ORGANIZATION_USER_MANAGEMENT`, `ORGANIZATION_ADMINISTRATIVE` | members of the tenant holding `ORG_OWNER` or `ORG_ADMIN`, unless `userRoles` names a different set |
48
55
  * | `APPLICATION_BILLING` | holders of `APP_ADMIN_BILLING_MANAGER` or `APP_ADMIN_SUPER_ADMIN`, application-wide |
49
56
  * | `APPLICATION_ADMIN_VIEWER` | holders of `APP_ADMIN_VIEWER` or `APP_ADMIN_SUPER_ADMIN` |
50
57
  * | every other `APPLICATION_*` | holders of `APP_ADMIN_SUPER_ADMIN` |
51
- * | `INBOUND_CONTACT` | nobody, deliberately. The recipient is not a user of your application, so this target is only usable with an EMAIL notification declaring `recipientEmailField` |
58
+ * | `INBOUND_CONTACT` | on EMAIL, the contact themselves, through `recipientEmailField` (required: the contact is not a user of your application, so no target resolves them). On WEBSOCKET and FRONT_END_SUCCESS, an in-app alert to holders of `APP_ADMIN_SUPER_ADMIN`, unless `userRoles` names a different set |
52
59
  *
53
- * A target the dispatcher has no rule for resolves nobody and logs a warning — so a custom target
54
- * string (the schema accepts one) sends nothing on the email and websocket paths.
60
+ * The target must be one of these members, and a declaration that would reach nobody — `USERS_CUSTOM`
61
+ * without a `userIdsSelector`, `INBOUND_CONTACT` on EMAIL without `recipientEmailField` — is refused
62
+ * when the resource configuration is built, as is a `userRoles` or `userIdsSelector` the target never
63
+ * reads.
55
64
  *
56
65
  * ## The tenant can redirect or silence an ORGANIZATION-flavoured EMAIL, and you cannot override it
57
66
  *
@@ -91,7 +100,7 @@ export var CoreUserNotificationTarget;
91
100
  })(CoreUserNotificationTarget || (CoreUserNotificationTarget = {}));
92
101
  /**
93
102
  * Whether a notification aimed at this target may be SUPPRESSED by the recipient's own channel
94
- * preference (`UserPreferences.notifications.email` / `.sms` / `.push` / `.inApp`).
103
+ * preference (`UserPreferences.notifications.email` / `.inApp`).
95
104
  *
96
105
  * DERIVED from the target rather than declared per notification, because the target already carries
97
106
  * the distinction and a second field would be one more thing to get wrong on 87 declarations.
@@ -119,9 +128,11 @@ export function userNotificationTargetIsSuppressibleByRecipientPreference(target
119
128
  * The targets on which `userRoles` MEANS anything (#495).
120
129
  *
121
130
  * `userRoles` is not a recipient FILTER, which is how its name reads and how it has been authored. It
122
- * is the role-SELECTION override for the eleven role-scoped targets: `mapOrganizationTargetToRoles`
123
- * and `mapApplicationTargetToRoles` take it in place of their per-target default, and nothing else
124
- * anywhere reads it.
131
+ * is the role-SELECTION override for the eleven role-scoped targets — `mapOrganizationTargetToRoles`
132
+ * and `mapApplicationTargetToRoles` take it in place of their per-target default — and for
133
+ * `INBOUND_CONTACT` on the in-app channels, where it names the application roles alerted about a new
134
+ * contact in place of the default `APP_ADMIN_SUPER_ADMIN`. On EMAIL that target reaches the contact
135
+ * through `recipientEmailField` and reads no role, hence the `channel` parameter.
125
136
  *
126
137
  * On every other target it is inert, and inert in three different ways that all looked the same to an
127
138
  * author: `USER_SELF` addresses the initiator, `USERS_CUSTOM` goes straight to `userIdsSelector`, and
@@ -132,7 +143,10 @@ export function userNotificationTargetIsSuppressibleByRecipientPreference(target
132
143
  * defect was never specific to `USERS_CUSTOM` — refusing it there alone would leave the other three
133
144
  * free to mislead the next author in exactly the same way.
134
145
  */
135
- export function userNotificationTargetReadsUserRoles(target) {
146
+ export function userNotificationTargetReadsUserRoles(target, channel) {
147
+ if (target === CoreUserNotificationTarget.INBOUND_CONTACT) {
148
+ return channel !== CoreUserNotificationChannel.EMAIL;
149
+ }
136
150
  return target === CoreUserNotificationTarget.ORGANIZATION_BILLING
137
151
  || target === CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT
138
152
  || target === CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE
@@ -146,10 +160,15 @@ export function userNotificationTargetReadsUserRoles(target) {
146
160
  || target === CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER;
147
161
  }
148
162
  /** @wildo_source:part:end saas.models.notifications.targets */
149
- export const UserNotificationTargetSchema = z.union([
150
- z.enum(CoreUserNotificationTarget),
151
- z.string().min(1)
152
- ]);
163
+ /**
164
+ * A user notification target: exactly the members of {@link CoreUserNotificationTarget}.
165
+ *
166
+ * This accepted any string beside the enum, and a string the dispatcher had no rule for resolved nobody — a
167
+ * notification that type-checked, built, and reached no one. Every member has an arm in the dispatcher, so the
168
+ * vocabulary IS the set of targets that can be delivered, and a declaration naming anything else is refused when
169
+ * the resource configuration is built.
170
+ */
171
+ export const UserNotificationTargetSchema = z.enum(CoreUserNotificationTarget);
153
172
  // =====================================================
154
173
  // Celebration & Next-Step Enums (Phase 1a)
155
174
  // =====================================================
@@ -217,10 +236,10 @@ export const FrontendDisplayHintsSchema = z.object({
217
236
  *
218
237
  * ## What actually sends
219
238
  *
220
- * `EMAIL`, `WEBSOCKET` and `FRONT_END_SUCCESS` deliver. **`SMS` and `PUSH` are declaration vocabulary
221
- * only** — the dispatcher's branch for them logs and returns without sending. The framework does have
222
- * an SMS transport (authentication's one-time codes use it) and this dispatcher is not wired to it,
223
- * so declaring an SMS notification is inert rather than pending.
239
+ * `EMAIL`, `WEBSOCKET` and `FRONT_END_SUCCESS` are the channels, and all three deliver. There is no
240
+ * SMS or push notification channel: both were declaration vocabulary that the dispatcher logged and
241
+ * dropped, and were removed. The framework's SMS transport serves authentication's one-time codes, not
242
+ * resource notifications.
224
243
  *
225
244
  * For an EMAIL, create the template directory the reference names. The startup validator resolves
226
245
  * every declared reference through the configured locale chain before the application takes traffic,
@@ -260,7 +279,7 @@ export const FrontendDisplayHintsSchema = z.object({
260
279
  */
261
280
  export const UserNotificationDefinition_BaseSchema = z.object({
262
281
  identifier: z.string().min(1),
263
- target: z.string(),
282
+ target: UserNotificationTargetSchema,
264
283
  level: z.enum(UserNotificationLevel).optional(),
265
284
  primaryScope: z.enum(ResourcePrimaryScope),
266
285
  /**
@@ -380,47 +399,77 @@ export const UserNotificationDefinition_FrontEndSuccessSchema = UserNotification
380
399
  /** Suggested next action after operation completes — rendered as CTA in toast or celebration */
381
400
  nextStep: FrontendDisplayHintsNextStepSchema.optional(),
382
401
  });
383
- /** SMS channel — not yet implemented, plain base */
384
- export const UserNotificationDefinition_SMSSchema = UserNotificationDefinition_BaseSchema.extend({
385
- channel: z.literal(CoreUserNotificationChannel.SMS),
386
- });
387
- /** PUSH channel — not yet implemented, plain base */
388
- export const UserNotificationDefinition_PushSchema = UserNotificationDefinition_BaseSchema.extend({
389
- channel: z.literal(CoreUserNotificationChannel.PUSH),
390
- });
391
- /** Catch-all for custom channels (any string not matching core channels) */
392
- export const UserNotificationDefinition_CustomChannelSchema = UserNotificationDefinition_BaseSchema.extend({
393
- channel: z.string().min(1),
394
- });
395
402
  /**
396
- * Final union of all notification channel variants.
397
- * Uses z.union() (not z.discriminatedUnion) because the catch-all custom channel
398
- * uses z.string() which is not a literal discriminant.
399
- * Order matters: specific literals are tried before the catch-all string.
403
+ * Final union of all notification channel variants — exactly the channels the dispatcher delivers (#1874).
404
+ *
405
+ * There used to be a fourth member, a catch-all `channel: z.string()` "for custom channels". Nothing delivered a
406
+ * custom channel: the dispatcher's `default` arm logged at debug and sent nothing, so `channel: 'slack'` passed
407
+ * validation and every dispatch was silently empty — the class #1799 removed for SMS and push. A channel is now one
408
+ * of `CoreUserNotificationChannel`, and the resource factory parses every declared notification against this schema
409
+ * (`processUserNotifications`), so an unknown one is refused when the configuration is built. A new channel is
410
+ * added by giving it a member here AND a delivery arm in the dispatcher, never by naming it.
400
411
  */
401
412
  export const UserNotificationDefinitionSchema = z.union([
402
413
  UserNotificationDefinition_EmailSchema,
403
414
  UserNotificationDefinition_WebSocketSchema,
404
415
  UserNotificationDefinition_FrontEndSuccessSchema,
405
- UserNotificationDefinition_SMSSchema,
406
- UserNotificationDefinition_PushSchema,
407
- UserNotificationDefinition_CustomChannelSchema,
408
416
  ])
409
417
  /**
410
- * `userRoles` on a target that never reads it is a filter that silently does nothing (#495).
418
+ * A declaration must reach somebody, and every field it carries must be read.
419
+ *
420
+ * Each rule below is a declaration the schema used to accept and the dispatcher then ignored, silently:
421
+ *
422
+ * - `userRoles` on a target that never reads it is a filter that does nothing (#495). An email sent by
423
+ * address (`recipientEmailField`) resolves no target at all, so it reads neither `userRoles` nor
424
+ * `userIdsSelector`.
425
+ * - `userIdsSelector` is read by `USERS_CUSTOM` alone; on any other target it is a function nothing calls.
426
+ * - `USERS_CUSTOM` without a `userIdsSelector` resolves nobody.
427
+ * - `INBOUND_CONTACT` on EMAIL resolves nobody by target: the contact is not a user, and is reached only
428
+ * through `recipientEmailField`.
429
+ *
430
+ * The resource factory parses every declaration against this schema, so each is refused when the
431
+ * configuration is built rather than discovered as an email nobody received.
411
432
  *
412
433
  * Refined on the UNION rather than on the base object, deliberately: the base is `.extend()`ed by
413
- * six channel variants, and a refinement there would be dropped by every one of them — the shape of
414
- * bug this refinement exists to prevent.
434
+ * every channel variant, and a refinement there would be dropped by each of them — the shape of bug
435
+ * this refinement exists to prevent.
415
436
  */
416
437
  .superRefine((notification, context) => {
417
- if (notification.userRoles !== undefined && !userNotificationTargetReadsUserRoles(notification.target)) {
438
+ const sentByAddress = notification.channel === CoreUserNotificationChannel.EMAIL && !!notification.recipientEmailField;
439
+ if (notification.userRoles !== undefined && (sentByAddress || !userNotificationTargetReadsUserRoles(notification.target, notification.channel))) {
418
440
  context.addIssue({
419
441
  code: 'custom',
420
442
  path: ['userRoles'],
421
- message: `userRoles is only read for a role-scoped target and would be inert on "${notification.target}". `
422
- + 'It selects WHICH roles a role-scoped target reaches; it does not filter the recipients of any other '
423
- + 'target. Remove it, or address the notification to a role-scoped target.',
443
+ message: sentByAddress
444
+ ? 'userRoles is never read on an email sent to recipientEmailField, which resolves no target. Remove it.'
445
+ : `userRoles is only read for a role-scoped target and would be inert on "${notification.target}" `
446
+ + `(channel "${notification.channel}"). It selects WHICH roles a role-scoped target reaches; it does not `
447
+ + 'filter the recipients of any other target. Remove it, or address the notification to a role-scoped target.',
448
+ });
449
+ }
450
+ if (notification.userIdsSelector !== undefined && (sentByAddress || notification.target !== CoreUserNotificationTarget.USERS_CUSTOM)) {
451
+ context.addIssue({
452
+ code: 'custom',
453
+ path: ['userIdsSelector'],
454
+ message: sentByAddress
455
+ ? 'userIdsSelector is never called on an email sent to recipientEmailField. Remove it.'
456
+ : `userIdsSelector is only called for the "${CoreUserNotificationTarget.USERS_CUSTOM}" target and would be inert on `
457
+ + `"${notification.target}". Remove it, or address the notification to "${CoreUserNotificationTarget.USERS_CUSTOM}".`,
458
+ });
459
+ }
460
+ if (notification.target === CoreUserNotificationTarget.USERS_CUSTOM && !sentByAddress && notification.userIdsSelector === undefined) {
461
+ context.addIssue({
462
+ code: 'custom',
463
+ path: ['userIdsSelector'],
464
+ message: `The "${CoreUserNotificationTarget.USERS_CUSTOM}" target reaches whoever userIdsSelector returns; without one it reaches nobody.`,
465
+ });
466
+ }
467
+ if (notification.target === CoreUserNotificationTarget.INBOUND_CONTACT && notification.channel === CoreUserNotificationChannel.EMAIL && !sentByAddress) {
468
+ context.addIssue({
469
+ code: 'custom',
470
+ path: ['recipientEmailField'],
471
+ message: `An email to the "${CoreUserNotificationTarget.INBOUND_CONTACT}" target reaches nobody by target: the contact is `
472
+ + 'not a user of the application. Name the field holding their address in recipientEmailField.',
424
473
  });
425
474
  }
426
475
  });
@@ -439,13 +488,17 @@ export var CoreM2MNotificationChannel;
439
488
  CoreM2MNotificationChannel["WEBHOOK_ORGANIZATION"] = "webhook_organization";
440
489
  CoreM2MNotificationChannel["WEBHOOK_APPLICATION"] = "webhook_application";
441
490
  })(CoreM2MNotificationChannel || (CoreM2MNotificationChannel = {}));
442
- export const M2MNotificationChannelSchema = z.union([
443
- z.enum(CoreM2MNotificationChannel),
444
- z.string().min(1)
445
- ]);
491
+ /**
492
+ * An M2M notification channel: exactly the two webhook channels the dispatcher delivers.
493
+ *
494
+ * This accepted any string, and the dispatcher threw "not implemented" for anything but the two webhooks — at
495
+ * dispatch, after the write, where the throw also skipped every later M2M notification of the same operation. The
496
+ * resource factory now refuses any other channel when the configuration is built.
497
+ */
498
+ export const M2MNotificationChannelSchema = z.enum(CoreM2MNotificationChannel);
446
499
  export const M2MNotificationDefinitionSchema = z.object({
447
500
  identifier: z.string().min(1),
448
- channel: z.string(),
501
+ channel: M2MNotificationChannelSchema,
449
502
  level: z.enum(M2MNotificationLevel).optional(),
450
503
  });
451
504
  //# sourceMappingURL=notifications.shared.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.shared.schemas.js","sourceRoot":"","sources":["../../../../src/notifications/notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,MAAM,CAAN,IAAY,2BAMX;AAND,WAAY,2BAA2B;IACrC,8CAAe,CAAA;IACf,0CAAW,CAAA;IACX,4CAAa,CAAA;IACb,sDAAuB,CAAA;IACvB,sEAAuC,CAAA;AACzC,CAAC,EANW,2BAA2B,KAA3B,2BAA2B,QAMtC;AAED,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;AACjB,CAAC,EALW,qBAAqB,KAArB,qBAAqB,QAKhC;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC;IACjD,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;IACnC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpB,CAAC,CAAC;AAGH,iHAAiH;AACjH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAN,IAAY,0BAiBX;AAjBD,WAAY,0BAA0B;IAClC,qFAAuD,CAAA;IACvD,yEAA2C,CAAA;IAC3C,yFAA2D,CAAA;IAC3D,2EAA6C,CAAA;IAC7C,yEAA2C,CAAA;IAC3C,qEAAuC,CAAA;IACvC,mFAAqD,CAAA;IACrD,2DAA6B,CAAA;IAC7B,uEAAyC,CAAA;IAC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AI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,WAAW,CAAC;YACnB,OAAO,EAAE,0EAA0E,YAAY,CAAC,MAAM,KAAK;kBACvG,sGAAsG;kBACtG,yEAAyE;SAC9E,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,oFAAoF;AAEpF;;GAEG;AAIH,MAAM,CAAN,IAAY,oBAIT;AAJH,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,2CAAmB,CAAA;IACnB,uCAAe,CAAA;AACjB,CAAC,EAJS,oBAAoB,KAApB,oBAAoB,QAI7B;AAEH,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IAClC,2EAA6C,CAAA;IAC7C,yEAA2C,CAAA;AAC/C,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC;IAChD,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC;IAClC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { ResourcePrimaryScope } from \"../resources/resources.shared.schemas\";\n\n\nexport enum CoreUserNotificationChannel {\n EMAIL = 'email',\n SMS = 'sms',\n PUSH = 'push',\n WEBSOCKET = 'websocket',\n FRONT_END_SUCCESS = 'front_end_success',\n}\n\nexport enum UserNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\nexport const UserNotificationChannelSchema = z.union([\n z.enum(CoreUserNotificationChannel),\n z.string().min(1)\n]);\n\n\n/** @wildo_source:part:start saas.models.notifications.targets facet:layer:shared facet:audience:app-developer */\n/**\n * WHO a declared `userNotifications` entry reaches — and, on the EMAIL channel, whether the tenant\n * gets to redirect or silence it.\n *\n * Imported from `@wildo-ai/saas-models`. The target is the single most consequential field of a\n * notification declaration, because it decides three separate things at once:\n *\n * 1. **the recipients** — resolved per member below;\n * 2. **whether the recipient's own channel preference can suppress it** — only `USER_SELF` and\n * `USERS_CUSTOM` are suppressible, because only they reach a person about their own affairs. Every\n * other target reaches somebody because of a ROLE they hold, and a personal switch must not\n * silently disable a tenant's administrative monitoring. See\n * {@link userNotificationTargetIsSuppressibleByRecipientPreference};\n * 3. **whether `userRoles` is read at all** — see {@link userNotificationTargetReadsUserRoles}. On the\n * two tenant-wide targets the field is REFUSED rather than ignored, because \"everyone in the\n * tenant\" is not a set a role list may narrow.\n *\n * ## Who each target resolves to\n *\n * | target | recipients |\n * |---|---|\n * | `USER_SELF` | the initiator of the operation |\n * | `USERS_CUSTOM` | whatever your `userIdsSelector` returns. Without that function the target resolves nobody |\n * | `ORGANIZATION`, `ORGANIZATION_USERS` | every member of the initiator's tenant. `userRoles` is refused here |\n * | `ORGANIZATION_BILLING`, `ORGANIZATION_SECURITY`, `ORGANIZATION_USER_MANAGEMENT`, `ORGANIZATION_ADMINISTRATIVE` | members of the tenant holding `ORG_OWNER` or `ORG_ADMIN`, unless `userRoles` names a different set |\n * | `APPLICATION_BILLING` | holders of `APP_ADMIN_BILLING_MANAGER` or `APP_ADMIN_SUPER_ADMIN`, application-wide |\n * | `APPLICATION_ADMIN_VIEWER` | holders of `APP_ADMIN_VIEWER` or `APP_ADMIN_SUPER_ADMIN` |\n * | every other `APPLICATION_*` | holders of `APP_ADMIN_SUPER_ADMIN` |\n * | `INBOUND_CONTACT` | nobody, deliberately. The recipient is not a user of your application, so this target is only usable with an EMAIL notification declaring `recipientEmailField` |\n *\n * A target the dispatcher has no rule for resolves nobody and logs a warning — so a custom target\n * string (the schema accepts one) sends nothing on the email and websocket paths.\n *\n * ## The tenant can redirect or silence an ORGANIZATION-flavoured EMAIL, and you cannot override it\n *\n * Each tenant owns a notification-settings record with a per-category switch and a per-category\n * address, and the category is DERIVED from the target — `ORGANIZATION_BILLING` to `billing`,\n * `ORGANIZATION_SECURITY` to `security`, and so on. Two consequences to design around:\n *\n * - **a configured address REPLACES the member fan-out**, it does not add to it. A tenant routing\n * security mail to a monitoring address is saying where that mail goes, not asking for a copy;\n * - **the category switch suppresses the notification entirely**, whether or not an address is\n * configured. A tenant that turns billing notifications off means it for the members too.\n *\n * `ORGANIZATION` belongs to no category, so no category switch silences it; the tenant-wide\n * `defaultEmailAddress` can redirect it. `ORGANIZATION_USERS` always keeps its member fan-out:\n * neither a category switch nor the tenant-wide default address redirects or suppresses that target.\n *\n * This applies to EMAIL only. The websocket and in-product paths always fan out to the members.\n */\nexport enum CoreUserNotificationTarget {\n APPLICATION_ADMINISTRATOR = 'application_administrator',\n APPLICATION_BILLING = 'application_billing',\n APPLICATION_USER_MANAGEMENT = 'application_user_management',\n APPLICATION_SECURITY = 'application_security',\n APPLICATION_SUPPORT = 'application_support',\n APPLICATION_OTHER = 'application_other',\n APPLICATION_ADMIN_VIEWER = 'application_admin_viewer',\n ORGANIZATION = 'organization',\n ORGANIZATION_USERS = 'organization_users',\n ORGANIZATION_BILLING = 'organization_billing',\n ORGANIZATION_USER_MANAGEMENT = 'organization_user_management',\n ORGANIZATION_ADMINISTRATIVE = 'organization_administrative',\n ORGANIZATION_SECURITY = 'organization_security',\n USER_SELF = 'user_self',\n USERS_CUSTOM = 'users_custom',\n INBOUND_CONTACT = 'inbound_contact',\n}\n\n/**\n * Whether a notification aimed at this target may be SUPPRESSED by the recipient's own channel\n * preference (`UserPreferences.notifications.email` / `.sms` / `.push` / `.inApp`).\n *\n * DERIVED from the target rather than declared per notification, because the target already carries\n * the distinction and a second field would be one more thing to get wrong on 87 declarations.\n *\n * `USER_SELF` and `USERS_CUSTOM` reach a PERSON about their own affairs — those are the messages a\n * person is choosing about when they turn a channel off, and honouring that choice is the whole\n * point of the switch existing (#409).\n *\n * Every other target reaches somebody because of a ROLE they hold: an application administrator, an\n * organization's security or billing contact. A personal channel preference must not silently\n * disable a tenant's or an application's administrative monitoring — the recipient did not choose to\n * receive those as a person and cannot switch them off as one. A tenant that wants role mail\n * elsewhere routes it, which is what the organization notification-settings record is for.\n *\n * Nothing here reaches account RECOVERY. Password reset, magic link and email verification are sent\n * directly through the email service and never pass through the notification dispatcher, so no\n * channel preference can lock a person out of their own account. That measurement is what made\n * suppression safe to implement at all.\n */\nexport function userNotificationTargetIsSuppressibleByRecipientPreference(target: string): boolean {\n return target === CoreUserNotificationTarget.USER_SELF\n || target === CoreUserNotificationTarget.USERS_CUSTOM;\n}\n\n/**\n * The targets on which `userRoles` MEANS anything (#495).\n *\n * `userRoles` is not a recipient FILTER, which is how its name reads and how it has been authored. It\n * is the role-SELECTION override for the eleven role-scoped targets: `mapOrganizationTargetToRoles`\n * and `mapApplicationTargetToRoles` take it in place of their per-target default, and nothing else\n * anywhere reads it.\n *\n * On every other target it is inert, and inert in three different ways that all looked the same to an\n * author: `USER_SELF` addresses the initiator, `USERS_CUSTOM` goes straight to `userIdsSelector`, and\n * `ORGANIZATION`/`ORGANIZATION_USERS` mean everyone in the tenant by definition. Declaring it there\n * is a filter that silently does nothing, which is what the refinement below now refuses.\n *\n * Scoped as a POSITIVE list of targets that read it rather than a rule about one target, because the\n * defect was never specific to `USERS_CUSTOM` — refusing it there alone would leave the other three\n * free to mislead the next author in exactly the same way.\n */\nexport function userNotificationTargetReadsUserRoles(target: string): boolean {\n return target === CoreUserNotificationTarget.ORGANIZATION_BILLING\n || target === CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT\n || target === CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE\n || target === CoreUserNotificationTarget.ORGANIZATION_SECURITY\n || target === CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR\n || target === CoreUserNotificationTarget.APPLICATION_BILLING\n || target === CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT\n || target === CoreUserNotificationTarget.APPLICATION_SECURITY\n || target === CoreUserNotificationTarget.APPLICATION_SUPPORT\n || target === CoreUserNotificationTarget.APPLICATION_OTHER\n || target === CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER;\n}\n/** @wildo_source:part:end saas.models.notifications.targets */\n\nexport const UserNotificationTargetSchema = z.union([\n z.enum(CoreUserNotificationTarget),\n z.string().min(1)\n]);\n\n\n\n// =====================================================\n// Celebration & Next-Step Enums (Phase 1a)\n// =====================================================\n\n/** @wildo_source:part:start saas.models.milestone-celebration */\n/**\n * How the frontend renders a celebration after a successful operation — the value a milestone's\n * `celebrationMode` takes. Import from `@wildo-ai/saas-models`.\n * - CONFETTI: a lightweight, non-blocking confetti burst over the page. Decorative only: no message,\n * no next step, nothing to dismiss.\n * - OVERLAY: a dialog carrying the celebration animation, the milestone's title, the message, an\n * optional next-step action and a dismiss.\n * - LOTTIE: in the framework's DEFAULT celebration overlay, identical to OVERLAY — the same dialog\n * and the same animation. It is the mode to use when the application's OWN celebration-overlay\n * preset draws something distinct for it, such as a per-milestone animation chosen from the\n * notification identifier the preset receives.\n */\nexport enum CelebrationDisplayMode {\n OVERLAY = 'overlay',\n CONFETTI = 'confetti',\n LOTTIE = 'lottie',\n}\n/** @wildo_source:part:end saas.models.milestone-celebration */\n\n/**\n * Type of next-step suggestion attached to a notification.\n * - OPERATION: Navigate to and/or trigger a resource operation\n * - URL: Navigate to an arbitrary URL (internal or external)\n */\nexport enum NotificationNextStepType {\n OPERATION = 'operation',\n URL = 'url',\n}\n\n// =====================================================\n// Frontend Display Hints Schema (reusable)\n// =====================================================\n\nexport const FrontendDisplayHintsCelebrationSchema = z.object({\n mode: z.enum(CelebrationDisplayMode).default(CelebrationDisplayMode.OVERLAY),\n});\nexport type FrontendDisplayHintsCelebration = z.infer<typeof FrontendDisplayHintsCelebrationSchema>;\n\nexport const FrontendDisplayHintsNextStepSchema = z.object({\n /** Operation path (e.g., \"TASKS.CREATE.default\") or URL */\n operationRef: z.string(),\n type: z.enum(NotificationNextStepType).default(NotificationNextStepType.OPERATION),\n});\nexport type FrontendDisplayHintsNextStep = z.infer<typeof FrontendDisplayHintsNextStepSchema>;\n\nexport const FrontendDisplayHintsSchema = z.object({\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\nexport type FrontendDisplayHints = z.infer<typeof FrontendDisplayHintsSchema>;\n\n// =====================================================\n// UserNotificationDefinition — Discriminated Union on `channel`\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.notifications.user-notification-definition facet:layer:shared facet:audience:app-developer\n *\n * One notification an operation sends. Declared as `userNotifications` on a resource operation, in\n * the resource config — an array, so one operation may send several.\n *\n * ```ts\n * userNotifications: [\n * { target: CoreUserNotificationTarget.USER_SELF, channel: CoreUserNotificationChannel.EMAIL,\n * condition: ({ currentObject }) => currentObject.status === 'INVITED' },\n * { target: CoreUserNotificationTarget.ORGANIZATION_USERS, channel: CoreUserNotificationChannel.WEBSOCKET },\n * ]\n * ```\n *\n * ## What actually sends\n *\n * `EMAIL`, `WEBSOCKET` and `FRONT_END_SUCCESS` deliver. **`SMS` and `PUSH` are declaration vocabulary\n * only** — the dispatcher's branch for them logs and returns without sending. The framework does have\n * an SMS transport (authentication's one-time codes use it) and this dispatcher is not wired to it,\n * so declaring an SMS notification is inert rather than pending.\n *\n * For an EMAIL, create the template directory the reference names. The startup validator resolves\n * every declared reference through the configured locale chain before the application takes traffic,\n * and prints the exact directory to create when one is missing.\n *\n * ## The recipient's preferences are honoured, and three things override them\n *\n * A recipient who has switched a channel off does not receive it. Three deliberate exceptions:\n *\n * - a ROLE-addressed target — the recipient did not choose to receive it as a person;\n * - `alwaysDeliver: true` — declare it on a security notice a compromised account's owner must still\n * receive;\n * - a recipient with NO preferences row at all, because preferences are created lazily and a missing\n * record must never read as \"everything off\".\n *\n * The `inApp` switch suppresses optional personal message presentation (toast, centre and celebration),\n * not the socket frame. Declarative frames carry target and alwaysDeliver to the frontend gate;\n * required and responsibility-addressed messages remain visible. Local operation feedback and\n * resource refresh events are independent of this personal-message preference.\n *\n * ## `condition` gates the notification, not the operation\n *\n * The predicate goes on the notification. It decides only whether this one message is sent; refusing\n * the CALL is a separate declaration on the operation variant, and the two are independent — a\n * variant can be enabled while its notification is gated off, and the reverse. The form deliberately\n * matches an operation variant's `enabledCondition` so both read the same way.\n *\n * ## Emailing somebody who is not a user\n *\n * `recipientEmailField` names a TOP-LEVEL field on the record holding the address. There is no\n * recipient, so there are no recipient preferences and no recipient language: the message goes out in\n * the application's default locale. A nested address cannot be named, nor a list — the path sends\n * exactly one message per notification. Pair it with a `condition` when the same operation also\n * serves rows whose address belongs to somebody who must not be written to.\n *\n * Base fields shared by all user notification channel variants.\n */\nexport const UserNotificationDefinition_BaseSchema = z.object({\n identifier: z.string().min(1),\n target: z.string(),\n level: z.enum(UserNotificationLevel).optional(),\n primaryScope: z.enum(ResourcePrimaryScope),\n /**\n * Role-SELECTION override for a role-scoped target — NOT a recipient filter. See\n * {@link userNotificationTargetReadsUserRoles}, which is also what refuses it elsewhere.\n */\n userRoles: z.array(z.string()).optional(),\n userIdsSelector: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => string[]\n >((val) => typeof val === 'function').optional(),\n /**\n * Optional gate — dispatch this notification ONLY when the predicate returns truthy\n * against the post-operation context. Absent = always dispatches (backward compatible).\n * Evaluated per-notification BEFORE channel resolution, so it uniformly gates every\n * channel (email/websocket/front-end-success/…).\n *\n * The canonical use is a POLYMORPHIC operation whose notification must fire for only one\n * branch: the org-member CREATE op serves both INVITE (`status` INVITED — send the invite\n * email to `userEmail`) and DIRECT-ADD (`status` ACTIVE — founder / SSO-JIT / SCIM, whose\n * `userEmail` is the member's OWN address, so an \"you've been invited\" email is a\n * misdelivery). Keying on `currentObject.status === INVITED` fires the invite email for\n * invites only.\n *\n * Params mirror `userIdsSelector` (its sibling), so an author writes the same\n * `({ currentObject }) => …` form used by the operation-variant `enabledCondition`.\n *\n * @example `({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED`\n */\n condition: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => boolean\n >((val) => typeof val === 'function').optional(),\n /**\n * Custom notification reference for disambiguating multiple notifications of the same type.\n *\n * REQUIRED when:\n * - There are 2+ notifications with the same target in the same operation\n * - Example: 2+ USERS_CUSTOM notifications (one for creator, one for assignee)\n *\n * This allows distinguishing between multiple similar notifications\n * in the same operation (e.g., \"notify-creator\" vs \"notify-assignee\").\n *\n * Format: lowercase-kebab-case (e.g., \"notify-creator\", \"task-assigned\")\n * Will be appended to auto-generated identifier for notification/template lookup.\n */\n customNotificationRef: z.string().min(1).optional(),\n /**\n * Deliver this notification even when the recipient has switched its channel OFF.\n *\n * Only meaningful on a target that is suppressible in the first place — `USER_SELF` and\n * `USERS_CUSTOM` (see `userNotificationTargetIsSuppressibleByRecipientPreference`). On a\n * role-addressed target the preference never applied, so this flag changes nothing there.\n *\n * The narrow escape, for the case the target axis cannot express: a message that reaches a\n * person about their OWN affairs and is nevertheless a security notice they should not be able\n * to silence — a credential minted or destroyed on their account, an authentication factor\n * changed. Those are the alerts a person most needs when they did NOT perform the action.\n *\n * Author it with the reason at the site. It is deliberately not a default and deliberately not\n * derived: \"is this alert one a compromised account's owner must still receive?\" is a judgement\n * about the message, and inventing a rule for it would be a rule nobody could check.\n */\n alwaysDeliver: z.boolean().optional(),\n});\n\n// --- Channel-specific variants ---\n\n/** EMAIL channel — template-oriented (email-specific fields handled by email templates) */\nexport const UserNotificationDefinition_EmailSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.EMAIL),\n /**\n * Deliver this email to a raw address read from the current object, rather than\n * to a resolved platform user.\n *\n * When set, the recipient is `currentObject[recipientEmailField]` (a top-level\n * string field — e.g. `'email'`). The dispatcher sends a single email directly to\n * that address using the application's default locale, BYPASSING the `userId`-based\n * `target` resolution entirely.\n *\n * This is the framework's mechanism for notifying a party who is **not (yet) a\n * platform user** — an organization-invitation invitee, an inbound lead — for whom\n * no `userId` exists. Without it, the only email recipients the dispatcher can\n * resolve are members/initiators by id (`fetchUserContext(userId).email`).\n *\n * When this is set, `target` no longer selects the recipient; it is retained only\n * to (a) classify the notification, (b) drive the email `templateRef` derivation,\n * and (c) route the dashboard URL (admin app vs main app). Choose a `target` whose\n * dashboard-routing class matches the recipient (e.g. `USER_SELF` for a main-app\n * link).\n *\n * All other context is built identically to a user-targeted email (organization\n * name, initiator name, and the token `acceptUrl` enricher), so token-bearing\n * emails such as invitations still carry their `<frontendBase><emailLinkPath>?token=`\n * acceptance link.\n */\n recipientEmailField: z.string().trim().min(1).optional(),\n});\n\n/** WEBSOCKET channel — pure WebSocket push (no frontend display) */\nexport const UserNotificationDefinition_WebSocketSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.WEBSOCKET),\n});\n\n/**\n * FRONT_END_SUCCESS channel — frontend display with optional celebration + nextStep.\n *\n * `celebration`: Tells the frontend to render richer feedback than a simple toast.\n * `nextStep`: Suggested next action rendered as a CTA button in the toast or celebration overlay.\n *\n * Example usage in operation config:\n * ```\n * userNotifications: [{\n * identifier: 'first-document-created',\n * target: CoreUserNotificationTarget.USER_SELF,\n * channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\n * primaryScope: ResourcePrimaryScope.ORGANIZATIONS,\n * celebration: { mode: CelebrationDisplayMode.OVERLAY },\n * nextStep: { operationRef: 'DOCUMENTS.LIST.default', type: NotificationNextStepType.OPERATION },\n * }]\n * ```\n */\nexport const UserNotificationDefinition_FrontEndSuccessSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.FRONT_END_SUCCESS),\n /** Celebration display hints — triggers richer frontend feedback (overlay/confetti/lottie) */\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n /** Suggested next action after operation completes — rendered as CTA in toast or celebration */\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\n\n/** SMS channel — not yet implemented, plain base */\nexport const UserNotificationDefinition_SMSSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.SMS),\n});\n\n/** PUSH channel — not yet implemented, plain base */\nexport const UserNotificationDefinition_PushSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.PUSH),\n});\n\n/** Catch-all for custom channels (any string not matching core channels) */\nexport const UserNotificationDefinition_CustomChannelSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.string().min(1),\n});\n\n/**\n * Final union of all notification channel variants.\n * Uses z.union() (not z.discriminatedUnion) because the catch-all custom channel\n * uses z.string() which is not a literal discriminant.\n * Order matters: specific literals are tried before the catch-all string.\n */\nexport const UserNotificationDefinitionSchema = z.union([\n UserNotificationDefinition_EmailSchema,\n UserNotificationDefinition_WebSocketSchema,\n UserNotificationDefinition_FrontEndSuccessSchema,\n UserNotificationDefinition_SMSSchema,\n UserNotificationDefinition_PushSchema,\n UserNotificationDefinition_CustomChannelSchema,\n])\n /**\n * `userRoles` on a target that never reads it is a filter that silently does nothing (#495).\n *\n * Refined on the UNION rather than on the base object, deliberately: the base is `.extend()`ed by\n * six channel variants, and a refinement there would be dropped by every one of them — the shape of\n * bug this refinement exists to prevent.\n */\n .superRefine((notification, context) => {\n if (notification.userRoles !== undefined && !userNotificationTargetReadsUserRoles(notification.target)) {\n context.addIssue({\n code: 'custom',\n path: ['userRoles'],\n message: `userRoles is only read for a role-scoped target and would be inert on \"${notification.target}\". `\n + 'It selects WHICH roles a role-scoped target reaches; it does not filter the recipients of any other '\n + 'target. Remove it, or address the notification to a role-scoped target.',\n });\n }\n });\nexport type UserNotificationDefinition = z.infer<typeof UserNotificationDefinitionSchema>;\n/** @wildo_source:part:end saas.models.notifications.user-notification-definition */\n\n/**\n * M2M Notification Channels\n */\n\n\n\nexport enum M2MNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n ERROR = 'error',\n }\n\nexport enum CoreM2MNotificationChannel {\n WEBHOOK_ORGANIZATION = 'webhook_organization',\n WEBHOOK_APPLICATION = 'webhook_application',\n}\n\nexport const M2MNotificationChannelSchema = z.union([\n z.enum(CoreM2MNotificationChannel),\n z.string().min(1)\n]);\n\nexport const M2MNotificationDefinitionSchema = z.object({\n identifier: z.string().min(1),\n channel: z.string(),\n level: z.enum(M2MNotificationLevel).optional(),\n});\nexport type M2MNotificationDefinition = z.infer<typeof M2MNotificationDefinitionSchema>;\n\n/**\n * Inferred types (interfaces defined above for isolatedDeclarations compatibility)\n */\n\nexport type UserNotificationTarget = string;\nexport type NotificationChannel = string;\nexport type M2MNotificationChannel = string;\n"]}
1
+ {"version":3,"file":"notifications.shared.schemas.js","sourceRoot":"","sources":["../../../../src/notifications/notifications.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACrC,8CAAe,CAAA;IACf,sDAAuB,CAAA;IACvB,sEAAuC,CAAA;AACzC,CAAC,EAJW,2BAA2B,KAA3B,2BAA2B,QAItC;AAED,MAAM,CAAN,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;AACjB,CAAC,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C;QACvJ,OAAO,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,qBAAqB,CAAC;YAC7B,OAAO,EAAE,oBAAoB,0BAA0B,CAAC,eAAe,oDAAoD;kBACvH,6FAA6F;SAClG,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,oFAAoF;AAEpF;;GAEG;AAIH,MAAM,CAAN,IAAY,oBAIT;AAJH,WAAY,oBAAoB;IAC5B,qCAAa,CAAA;IACb,2CAAmB,CAAA;IACnB,uCAAe,CAAA;AACjB,CAAC,EAJS,oBAAoB,KAApB,oBAAoB,QAI7B;AAEH,MAAM,CAAN,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IAClC,2EAA6C,CAAA;IAC7C,yEAA2C,CAAA;AAC/C,CAAC,EAHW,0BAA0B,KAA1B,0BAA0B,QAGrC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,4BAA4B;IACrC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { ResourcePrimaryScope } from \"../resources/resources.shared.schemas\";\n\n\n/**\n * The channels the dispatcher delivers a user notification through.\n *\n * `SMS` and `PUSH` were members until #1799 and neither delivered: the dispatcher logged \"not yet\n * implemented\" and returned, no notification in the engine or its applications declared either, and a\n * notification definition had no text to send. They are removed rather than kept as channels an author\n * could declare and never have sent. An SMS channel is buildable on the existing SMS provider — it\n * needs a per-notification text contract and the verified phone — and returns when it is built; push\n * has no infrastructure at all.\n */\nexport enum CoreUserNotificationChannel {\n EMAIL = 'email',\n WEBSOCKET = 'websocket',\n FRONT_END_SUCCESS = 'front_end_success',\n}\n\nexport enum UserNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\n/** A user notification channel: exactly the channels the dispatcher delivers (#1874). */\nexport const UserNotificationChannelSchema = z.enum(CoreUserNotificationChannel);\n\n\n/** @wildo_source:part:start saas.models.notifications.targets facet:layer:shared facet:audience:app-developer */\n/**\n * WHO a declared `userNotifications` entry reaches — and, on the EMAIL channel, whether the tenant\n * gets to redirect or silence it.\n *\n * Imported from `@wildo-ai/saas-models`. The target is the single most consequential field of a\n * notification declaration, because it decides three separate things at once:\n *\n * 1. **the recipients** — resolved per member below;\n * 2. **whether the recipient's own channel preference can suppress it** — only `USER_SELF` and\n * `USERS_CUSTOM` are suppressible, because only they reach a person about their own affairs. Every\n * other target reaches somebody because of a ROLE they hold, and a personal switch must not\n * silently disable a tenant's administrative monitoring. See\n * {@link userNotificationTargetIsSuppressibleByRecipientPreference};\n * 3. **whether `userRoles` is read at all** — see {@link userNotificationTargetReadsUserRoles}. Where it\n * is not read it is REFUSED rather than ignored — on the two tenant-wide targets because \"everyone\n * in the tenant\" is not a set a role list may narrow, and everywhere else because a filter that\n * does nothing misleads whoever reads the declaration.\n *\n * ## Who each target resolves to\n *\n * | target | recipients |\n * |---|---|\n * | `USER_SELF` | the initiator of the operation |\n * | `USERS_CUSTOM` | whatever your `userIdsSelector` returns. The function is required |\n * | `ORGANIZATION`, `ORGANIZATION_USERS` | every member of the initiator's tenant. `userRoles` is refused here |\n * | `ORGANIZATION_BILLING`, `ORGANIZATION_SECURITY`, `ORGANIZATION_USER_MANAGEMENT`, `ORGANIZATION_ADMINISTRATIVE` | members of the tenant holding `ORG_OWNER` or `ORG_ADMIN`, unless `userRoles` names a different set |\n * | `APPLICATION_BILLING` | holders of `APP_ADMIN_BILLING_MANAGER` or `APP_ADMIN_SUPER_ADMIN`, application-wide |\n * | `APPLICATION_ADMIN_VIEWER` | holders of `APP_ADMIN_VIEWER` or `APP_ADMIN_SUPER_ADMIN` |\n * | every other `APPLICATION_*` | holders of `APP_ADMIN_SUPER_ADMIN` |\n * | `INBOUND_CONTACT` | on EMAIL, the contact themselves, through `recipientEmailField` (required: the contact is not a user of your application, so no target resolves them). On WEBSOCKET and FRONT_END_SUCCESS, an in-app alert to holders of `APP_ADMIN_SUPER_ADMIN`, unless `userRoles` names a different set |\n *\n * The target must be one of these members, and a declaration that would reach nobody — `USERS_CUSTOM`\n * without a `userIdsSelector`, `INBOUND_CONTACT` on EMAIL without `recipientEmailField` — is refused\n * when the resource configuration is built, as is a `userRoles` or `userIdsSelector` the target never\n * reads.\n *\n * ## The tenant can redirect or silence an ORGANIZATION-flavoured EMAIL, and you cannot override it\n *\n * Each tenant owns a notification-settings record with a per-category switch and a per-category\n * address, and the category is DERIVED from the target — `ORGANIZATION_BILLING` to `billing`,\n * `ORGANIZATION_SECURITY` to `security`, and so on. Two consequences to design around:\n *\n * - **a configured address REPLACES the member fan-out**, it does not add to it. A tenant routing\n * security mail to a monitoring address is saying where that mail goes, not asking for a copy;\n * - **the category switch suppresses the notification entirely**, whether or not an address is\n * configured. A tenant that turns billing notifications off means it for the members too.\n *\n * `ORGANIZATION` belongs to no category, so no category switch silences it; the tenant-wide\n * `defaultEmailAddress` can redirect it. `ORGANIZATION_USERS` always keeps its member fan-out:\n * neither a category switch nor the tenant-wide default address redirects or suppresses that target.\n *\n * This applies to EMAIL only. The websocket and in-product paths always fan out to the members.\n */\nexport enum CoreUserNotificationTarget {\n APPLICATION_ADMINISTRATOR = 'application_administrator',\n APPLICATION_BILLING = 'application_billing',\n APPLICATION_USER_MANAGEMENT = 'application_user_management',\n APPLICATION_SECURITY = 'application_security',\n APPLICATION_SUPPORT = 'application_support',\n APPLICATION_OTHER = 'application_other',\n APPLICATION_ADMIN_VIEWER = 'application_admin_viewer',\n ORGANIZATION = 'organization',\n ORGANIZATION_USERS = 'organization_users',\n ORGANIZATION_BILLING = 'organization_billing',\n ORGANIZATION_USER_MANAGEMENT = 'organization_user_management',\n ORGANIZATION_ADMINISTRATIVE = 'organization_administrative',\n ORGANIZATION_SECURITY = 'organization_security',\n USER_SELF = 'user_self',\n USERS_CUSTOM = 'users_custom',\n INBOUND_CONTACT = 'inbound_contact',\n}\n\n/**\n * Whether a notification aimed at this target may be SUPPRESSED by the recipient's own channel\n * preference (`UserPreferences.notifications.email` / `.inApp`).\n *\n * DERIVED from the target rather than declared per notification, because the target already carries\n * the distinction and a second field would be one more thing to get wrong on 87 declarations.\n *\n * `USER_SELF` and `USERS_CUSTOM` reach a PERSON about their own affairs — those are the messages a\n * person is choosing about when they turn a channel off, and honouring that choice is the whole\n * point of the switch existing (#409).\n *\n * Every other target reaches somebody because of a ROLE they hold: an application administrator, an\n * organization's security or billing contact. A personal channel preference must not silently\n * disable a tenant's or an application's administrative monitoring — the recipient did not choose to\n * receive those as a person and cannot switch them off as one. A tenant that wants role mail\n * elsewhere routes it, which is what the organization notification-settings record is for.\n *\n * Nothing here reaches account RECOVERY. Password reset, magic link and email verification are sent\n * directly through the email service and never pass through the notification dispatcher, so no\n * channel preference can lock a person out of their own account. That measurement is what made\n * suppression safe to implement at all.\n */\nexport function userNotificationTargetIsSuppressibleByRecipientPreference(target: string): boolean {\n return target === CoreUserNotificationTarget.USER_SELF\n || target === CoreUserNotificationTarget.USERS_CUSTOM;\n}\n\n/**\n * The targets on which `userRoles` MEANS anything (#495).\n *\n * `userRoles` is not a recipient FILTER, which is how its name reads and how it has been authored. It\n * is the role-SELECTION override for the eleven role-scoped targets — `mapOrganizationTargetToRoles`\n * and `mapApplicationTargetToRoles` take it in place of their per-target default — and for\n * `INBOUND_CONTACT` on the in-app channels, where it names the application roles alerted about a new\n * contact in place of the default `APP_ADMIN_SUPER_ADMIN`. On EMAIL that target reaches the contact\n * through `recipientEmailField` and reads no role, hence the `channel` parameter.\n *\n * On every other target it is inert, and inert in three different ways that all looked the same to an\n * author: `USER_SELF` addresses the initiator, `USERS_CUSTOM` goes straight to `userIdsSelector`, and\n * `ORGANIZATION`/`ORGANIZATION_USERS` mean everyone in the tenant by definition. Declaring it there\n * is a filter that silently does nothing, which is what the refinement below now refuses.\n *\n * Scoped as a POSITIVE list of targets that read it rather than a rule about one target, because the\n * defect was never specific to `USERS_CUSTOM` — refusing it there alone would leave the other three\n * free to mislead the next author in exactly the same way.\n */\nexport function userNotificationTargetReadsUserRoles(target: string, channel: string): boolean {\n if (target === CoreUserNotificationTarget.INBOUND_CONTACT) {\n return channel !== CoreUserNotificationChannel.EMAIL;\n }\n return target === CoreUserNotificationTarget.ORGANIZATION_BILLING\n || target === CoreUserNotificationTarget.ORGANIZATION_USER_MANAGEMENT\n || target === CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE\n || target === CoreUserNotificationTarget.ORGANIZATION_SECURITY\n || target === CoreUserNotificationTarget.APPLICATION_ADMINISTRATOR\n || target === CoreUserNotificationTarget.APPLICATION_BILLING\n || target === CoreUserNotificationTarget.APPLICATION_USER_MANAGEMENT\n || target === CoreUserNotificationTarget.APPLICATION_SECURITY\n || target === CoreUserNotificationTarget.APPLICATION_SUPPORT\n || target === CoreUserNotificationTarget.APPLICATION_OTHER\n || target === CoreUserNotificationTarget.APPLICATION_ADMIN_VIEWER;\n}\n/** @wildo_source:part:end saas.models.notifications.targets */\n\n/**\n * A user notification target: exactly the members of {@link CoreUserNotificationTarget}.\n *\n * This accepted any string beside the enum, and a string the dispatcher had no rule for resolved nobody — a\n * notification that type-checked, built, and reached no one. Every member has an arm in the dispatcher, so the\n * vocabulary IS the set of targets that can be delivered, and a declaration naming anything else is refused when\n * the resource configuration is built.\n */\nexport const UserNotificationTargetSchema = z.enum(CoreUserNotificationTarget);\n\n\n\n// =====================================================\n// Celebration & Next-Step Enums (Phase 1a)\n// =====================================================\n\n/** @wildo_source:part:start saas.models.milestone-celebration */\n/**\n * How the frontend renders a celebration after a successful operation — the value a milestone's\n * `celebrationMode` takes. Import from `@wildo-ai/saas-models`.\n * - CONFETTI: a lightweight, non-blocking confetti burst over the page. Decorative only: no message,\n * no next step, nothing to dismiss.\n * - OVERLAY: a dialog carrying the celebration animation, the milestone's title, the message, an\n * optional next-step action and a dismiss.\n * - LOTTIE: in the framework's DEFAULT celebration overlay, identical to OVERLAY — the same dialog\n * and the same animation. It is the mode to use when the application's OWN celebration-overlay\n * preset draws something distinct for it, such as a per-milestone animation chosen from the\n * notification identifier the preset receives.\n */\nexport enum CelebrationDisplayMode {\n OVERLAY = 'overlay',\n CONFETTI = 'confetti',\n LOTTIE = 'lottie',\n}\n/** @wildo_source:part:end saas.models.milestone-celebration */\n\n/**\n * Type of next-step suggestion attached to a notification.\n * - OPERATION: Navigate to and/or trigger a resource operation\n * - URL: Navigate to an arbitrary URL (internal or external)\n */\nexport enum NotificationNextStepType {\n OPERATION = 'operation',\n URL = 'url',\n}\n\n// =====================================================\n// Frontend Display Hints Schema (reusable)\n// =====================================================\n\nexport const FrontendDisplayHintsCelebrationSchema = z.object({\n mode: z.enum(CelebrationDisplayMode).default(CelebrationDisplayMode.OVERLAY),\n});\nexport type FrontendDisplayHintsCelebration = z.infer<typeof FrontendDisplayHintsCelebrationSchema>;\n\nexport const FrontendDisplayHintsNextStepSchema = z.object({\n /** Operation path (e.g., \"TASKS.CREATE.default\") or URL */\n operationRef: z.string(),\n type: z.enum(NotificationNextStepType).default(NotificationNextStepType.OPERATION),\n});\nexport type FrontendDisplayHintsNextStep = z.infer<typeof FrontendDisplayHintsNextStepSchema>;\n\nexport const FrontendDisplayHintsSchema = z.object({\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\nexport type FrontendDisplayHints = z.infer<typeof FrontendDisplayHintsSchema>;\n\n// =====================================================\n// UserNotificationDefinition — Discriminated Union on `channel`\n// =====================================================\n\n/**\n * @wildo_source:part:start saas.models.notifications.user-notification-definition facet:layer:shared facet:audience:app-developer\n *\n * One notification an operation sends. Declared as `userNotifications` on a resource operation, in\n * the resource config — an array, so one operation may send several.\n *\n * ```ts\n * userNotifications: [\n * { target: CoreUserNotificationTarget.USER_SELF, channel: CoreUserNotificationChannel.EMAIL,\n * condition: ({ currentObject }) => currentObject.status === 'INVITED' },\n * { target: CoreUserNotificationTarget.ORGANIZATION_USERS, channel: CoreUserNotificationChannel.WEBSOCKET },\n * ]\n * ```\n *\n * ## What actually sends\n *\n * `EMAIL`, `WEBSOCKET` and `FRONT_END_SUCCESS` are the channels, and all three deliver. There is no\n * SMS or push notification channel: both were declaration vocabulary that the dispatcher logged and\n * dropped, and were removed. The framework's SMS transport serves authentication's one-time codes, not\n * resource notifications.\n *\n * For an EMAIL, create the template directory the reference names. The startup validator resolves\n * every declared reference through the configured locale chain before the application takes traffic,\n * and prints the exact directory to create when one is missing.\n *\n * ## The recipient's preferences are honoured, and three things override them\n *\n * A recipient who has switched a channel off does not receive it. Three deliberate exceptions:\n *\n * - a ROLE-addressed target — the recipient did not choose to receive it as a person;\n * - `alwaysDeliver: true` — declare it on a security notice a compromised account's owner must still\n * receive;\n * - a recipient with NO preferences row at all, because preferences are created lazily and a missing\n * record must never read as \"everything off\".\n *\n * The `inApp` switch suppresses optional personal message presentation (toast, centre and celebration),\n * not the socket frame. Declarative frames carry target and alwaysDeliver to the frontend gate;\n * required and responsibility-addressed messages remain visible. Local operation feedback and\n * resource refresh events are independent of this personal-message preference.\n *\n * ## `condition` gates the notification, not the operation\n *\n * The predicate goes on the notification. It decides only whether this one message is sent; refusing\n * the CALL is a separate declaration on the operation variant, and the two are independent — a\n * variant can be enabled while its notification is gated off, and the reverse. The form deliberately\n * matches an operation variant's `enabledCondition` so both read the same way.\n *\n * ## Emailing somebody who is not a user\n *\n * `recipientEmailField` names a TOP-LEVEL field on the record holding the address. There is no\n * recipient, so there are no recipient preferences and no recipient language: the message goes out in\n * the application's default locale. A nested address cannot be named, nor a list — the path sends\n * exactly one message per notification. Pair it with a `condition` when the same operation also\n * serves rows whose address belongs to somebody who must not be written to.\n *\n * Base fields shared by all user notification channel variants.\n */\nexport const UserNotificationDefinition_BaseSchema = z.object({\n identifier: z.string().min(1),\n target: UserNotificationTargetSchema,\n level: z.enum(UserNotificationLevel).optional(),\n primaryScope: z.enum(ResourcePrimaryScope),\n /**\n * Role-SELECTION override for a role-scoped target — NOT a recipient filter. See\n * {@link userNotificationTargetReadsUserRoles}, which is also what refuses it elsewhere.\n */\n userRoles: z.array(z.string()).optional(),\n userIdsSelector: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => string[]\n >((val) => typeof val === 'function').optional(),\n /**\n * Optional gate — dispatch this notification ONLY when the predicate returns truthy\n * against the post-operation context. Absent = always dispatches (backward compatible).\n * Evaluated per-notification BEFORE channel resolution, so it uniformly gates every\n * channel (email/websocket/front-end-success/…).\n *\n * The canonical use is a POLYMORPHIC operation whose notification must fire for only one\n * branch: the org-member CREATE op serves both INVITE (`status` INVITED — send the invite\n * email to `userEmail`) and DIRECT-ADD (`status` ACTIVE — founder / SSO-JIT / SCIM, whose\n * `userEmail` is the member's OWN address, so an \"you've been invited\" email is a\n * misdelivery). Keying on `currentObject.status === INVITED` fires the invite email for\n * invites only.\n *\n * Params mirror `userIdsSelector` (its sibling), so an author writes the same\n * `({ currentObject }) => …` form used by the operation-variant `enabledCondition`.\n *\n * @example `({ currentObject }) => currentObject.status === OrganizationMemberStatus.INVITED`\n */\n condition: z.custom<\n (params: {\n currentObject: any;\n inputDto: any;\n objectContext: { parents: Record<string, any>; children: Record<string, any> };\n initiatorIds: { userId?: string; organizationId?: string; applicationId?: string };\n }) => boolean\n >((val) => typeof val === 'function').optional(),\n /**\n * Custom notification reference for disambiguating multiple notifications of the same type.\n *\n * REQUIRED when:\n * - There are 2+ notifications with the same target in the same operation\n * - Example: 2+ USERS_CUSTOM notifications (one for creator, one for assignee)\n *\n * This allows distinguishing between multiple similar notifications\n * in the same operation (e.g., \"notify-creator\" vs \"notify-assignee\").\n *\n * Format: lowercase-kebab-case (e.g., \"notify-creator\", \"task-assigned\")\n * Will be appended to auto-generated identifier for notification/template lookup.\n */\n customNotificationRef: z.string().min(1).optional(),\n /**\n * Deliver this notification even when the recipient has switched its channel OFF.\n *\n * Only meaningful on a target that is suppressible in the first place — `USER_SELF` and\n * `USERS_CUSTOM` (see `userNotificationTargetIsSuppressibleByRecipientPreference`). On a\n * role-addressed target the preference never applied, so this flag changes nothing there.\n *\n * The narrow escape, for the case the target axis cannot express: a message that reaches a\n * person about their OWN affairs and is nevertheless a security notice they should not be able\n * to silence — a credential minted or destroyed on their account, an authentication factor\n * changed. Those are the alerts a person most needs when they did NOT perform the action.\n *\n * Author it with the reason at the site. It is deliberately not a default and deliberately not\n * derived: \"is this alert one a compromised account's owner must still receive?\" is a judgement\n * about the message, and inventing a rule for it would be a rule nobody could check.\n */\n alwaysDeliver: z.boolean().optional(),\n});\n\n// --- Channel-specific variants ---\n\n/** EMAIL channel — template-oriented (email-specific fields handled by email templates) */\nexport const UserNotificationDefinition_EmailSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.EMAIL),\n /**\n * Deliver this email to a raw address read from the current object, rather than\n * to a resolved platform user.\n *\n * When set, the recipient is `currentObject[recipientEmailField]` (a top-level\n * string field — e.g. `'email'`). The dispatcher sends a single email directly to\n * that address using the application's default locale, BYPASSING the `userId`-based\n * `target` resolution entirely.\n *\n * This is the framework's mechanism for notifying a party who is **not (yet) a\n * platform user** — an organization-invitation invitee, an inbound lead — for whom\n * no `userId` exists. Without it, the only email recipients the dispatcher can\n * resolve are members/initiators by id (`fetchUserContext(userId).email`).\n *\n * When this is set, `target` no longer selects the recipient; it is retained only\n * to (a) classify the notification, (b) drive the email `templateRef` derivation,\n * and (c) route the dashboard URL (admin app vs main app). Choose a `target` whose\n * dashboard-routing class matches the recipient (e.g. `USER_SELF` for a main-app\n * link).\n *\n * All other context is built identically to a user-targeted email (organization\n * name, initiator name, and the token `acceptUrl` enricher), so token-bearing\n * emails such as invitations still carry their `<frontendBase><emailLinkPath>?token=`\n * acceptance link.\n */\n recipientEmailField: z.string().trim().min(1).optional(),\n});\n\n/** WEBSOCKET channel — pure WebSocket push (no frontend display) */\nexport const UserNotificationDefinition_WebSocketSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.WEBSOCKET),\n});\n\n/**\n * FRONT_END_SUCCESS channel — frontend display with optional celebration + nextStep.\n *\n * `celebration`: Tells the frontend to render richer feedback than a simple toast.\n * `nextStep`: Suggested next action rendered as a CTA button in the toast or celebration overlay.\n *\n * Example usage in operation config:\n * ```\n * userNotifications: [{\n * identifier: 'first-document-created',\n * target: CoreUserNotificationTarget.USER_SELF,\n * channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\n * primaryScope: ResourcePrimaryScope.ORGANIZATIONS,\n * celebration: { mode: CelebrationDisplayMode.OVERLAY },\n * nextStep: { operationRef: 'DOCUMENTS.LIST.default', type: NotificationNextStepType.OPERATION },\n * }]\n * ```\n */\nexport const UserNotificationDefinition_FrontEndSuccessSchema = UserNotificationDefinition_BaseSchema.extend({\n channel: z.literal(CoreUserNotificationChannel.FRONT_END_SUCCESS),\n /** Celebration display hints — triggers richer frontend feedback (overlay/confetti/lottie) */\n celebration: FrontendDisplayHintsCelebrationSchema.optional(),\n /** Suggested next action after operation completes — rendered as CTA in toast or celebration */\n nextStep: FrontendDisplayHintsNextStepSchema.optional(),\n});\n\n/**\n * Final union of all notification channel variants — exactly the channels the dispatcher delivers (#1874).\n *\n * There used to be a fourth member, a catch-all `channel: z.string()` \"for custom channels\". Nothing delivered a\n * custom channel: the dispatcher's `default` arm logged at debug and sent nothing, so `channel: 'slack'` passed\n * validation and every dispatch was silently empty — the class #1799 removed for SMS and push. A channel is now one\n * of `CoreUserNotificationChannel`, and the resource factory parses every declared notification against this schema\n * (`processUserNotifications`), so an unknown one is refused when the configuration is built. A new channel is\n * added by giving it a member here AND a delivery arm in the dispatcher, never by naming it.\n */\nexport const UserNotificationDefinitionSchema = z.union([\n UserNotificationDefinition_EmailSchema,\n UserNotificationDefinition_WebSocketSchema,\n UserNotificationDefinition_FrontEndSuccessSchema,\n])\n /**\n * A declaration must reach somebody, and every field it carries must be read.\n *\n * Each rule below is a declaration the schema used to accept and the dispatcher then ignored, silently:\n *\n * - `userRoles` on a target that never reads it is a filter that does nothing (#495). An email sent by\n * address (`recipientEmailField`) resolves no target at all, so it reads neither `userRoles` nor\n * `userIdsSelector`.\n * - `userIdsSelector` is read by `USERS_CUSTOM` alone; on any other target it is a function nothing calls.\n * - `USERS_CUSTOM` without a `userIdsSelector` resolves nobody.\n * - `INBOUND_CONTACT` on EMAIL resolves nobody by target: the contact is not a user, and is reached only\n * through `recipientEmailField`.\n *\n * The resource factory parses every declaration against this schema, so each is refused when the\n * configuration is built rather than discovered as an email nobody received.\n *\n * Refined on the UNION rather than on the base object, deliberately: the base is `.extend()`ed by\n * every channel variant, and a refinement there would be dropped by each of them — the shape of bug\n * this refinement exists to prevent.\n */\n .superRefine((notification, context) => {\n const sentByAddress = notification.channel === CoreUserNotificationChannel.EMAIL && !!notification.recipientEmailField;\n if (notification.userRoles !== undefined && (sentByAddress || !userNotificationTargetReadsUserRoles(notification.target, notification.channel))) {\n context.addIssue({\n code: 'custom',\n path: ['userRoles'],\n message: sentByAddress\n ? 'userRoles is never read on an email sent to recipientEmailField, which resolves no target. Remove it.'\n : `userRoles is only read for a role-scoped target and would be inert on \"${notification.target}\" `\n + `(channel \"${notification.channel}\"). It selects WHICH roles a role-scoped target reaches; it does not `\n + 'filter the recipients of any other target. Remove it, or address the notification to a role-scoped target.',\n });\n }\n if (notification.userIdsSelector !== undefined && (sentByAddress || notification.target !== CoreUserNotificationTarget.USERS_CUSTOM)) {\n context.addIssue({\n code: 'custom',\n path: ['userIdsSelector'],\n message: sentByAddress\n ? 'userIdsSelector is never called on an email sent to recipientEmailField. Remove it.'\n : `userIdsSelector is only called for the \"${CoreUserNotificationTarget.USERS_CUSTOM}\" target and would be inert on `\n + `\"${notification.target}\". Remove it, or address the notification to \"${CoreUserNotificationTarget.USERS_CUSTOM}\".`,\n });\n }\n if (notification.target === CoreUserNotificationTarget.USERS_CUSTOM && !sentByAddress && notification.userIdsSelector === undefined) {\n context.addIssue({\n code: 'custom',\n path: ['userIdsSelector'],\n message: `The \"${CoreUserNotificationTarget.USERS_CUSTOM}\" target reaches whoever userIdsSelector returns; without one it reaches nobody.`,\n });\n }\n if (notification.target === CoreUserNotificationTarget.INBOUND_CONTACT && notification.channel === CoreUserNotificationChannel.EMAIL && !sentByAddress) {\n context.addIssue({\n code: 'custom',\n path: ['recipientEmailField'],\n message: `An email to the \"${CoreUserNotificationTarget.INBOUND_CONTACT}\" target reaches nobody by target: the contact is `\n + 'not a user of the application. Name the field holding their address in recipientEmailField.',\n });\n }\n });\nexport type UserNotificationDefinition = z.infer<typeof UserNotificationDefinitionSchema>;\n/** @wildo_source:part:end saas.models.notifications.user-notification-definition */\n\n/**\n * M2M Notification Channels\n */\n\n\n\nexport enum M2MNotificationLevel {\n INFO = 'info',\n SUCCESS = 'success',\n ERROR = 'error',\n }\n\nexport enum CoreM2MNotificationChannel {\n WEBHOOK_ORGANIZATION = 'webhook_organization',\n WEBHOOK_APPLICATION = 'webhook_application',\n}\n\n/**\n * An M2M notification channel: exactly the two webhook channels the dispatcher delivers.\n *\n * This accepted any string, and the dispatcher threw \"not implemented\" for anything but the two webhooks — at\n * dispatch, after the write, where the throw also skipped every later M2M notification of the same operation. The\n * resource factory now refuses any other channel when the configuration is built.\n */\nexport const M2MNotificationChannelSchema = z.enum(CoreM2MNotificationChannel);\n\nexport const M2MNotificationDefinitionSchema = z.object({\n identifier: z.string().min(1),\n channel: M2MNotificationChannelSchema,\n level: z.enum(M2MNotificationLevel).optional(),\n});\nexport type M2MNotificationDefinition = z.infer<typeof M2MNotificationDefinitionSchema>;\n\n"]}
@@ -26,12 +26,12 @@ export declare const OrganizationFeaturesResetFeaturesRequestDtoSchema: z.ZodObj
26
26
  }, z.core.$strip>;
27
27
  type OrganizationFeaturesCoreOperations = CoreResourceOperation.CREATE | CoreResourceOperation.READ | CoreResourceOperation.SEARCH | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE;
28
28
  export declare const organizationFeaturesResourceConfiguration_InitializationFactory: (resourcesRelationships: ResourceRelationship[]) => import("..").ResourceConfiguration<typeof OrganizationFeatures_Operations, OrganizationFeaturesCoreOperations, z.ZodObject<{
29
- features: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<typeof CoreFeature>, z.ZodString]>>>>>;
30
- limits: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>>>;
29
+ features: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodArray<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodUnion<readonly [z.ZodEnum<typeof CoreFeature>, z.ZodString]>>>>>>;
30
+ limits: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodRecord<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>, import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodNumber>>>>>;
31
31
  manualOverrides: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodObject<{
32
- addedFeatures: z.ZodDefault<z.ZodArray<z.ZodString>>;
33
- removedFeatures: z.ZodDefault<z.ZodArray<z.ZodString>>;
34
- limitOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
32
+ addedFeatures: z.ZodDefault<z.ZodArray<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>;
33
+ removedFeatures: z.ZodDefault<z.ZodArray<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>;
34
+ limitOverrides: z.ZodDefault<z.ZodRecord<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>, import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodNumber>>>;
35
35
  }, z.core.$strip>>>;
36
36
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
37
37
  organizationId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>>>>;
@@ -22,15 +22,15 @@ export var OrganizationFeatures_Operations;
22
22
  OrganizationFeatures_Operations["RESET_FEATURES"] = "reset_features";
23
23
  })(OrganizationFeatures_Operations || (OrganizationFeatures_Operations = {}));
24
24
  export const OrganizationFeaturesEnableFeatureRequestDtoSchema = z.object({
25
- featureId: z.enum(CoreFeature),
26
- reason: z.string().max(500).optional()
25
+ featureId: z.enum(CoreFeature).describe('The feature to switch on. It is added to this scope\'s manual overrides and taken off its removed list, so it stays on through billing changes.'),
26
+ reason: z.string().max(500).optional().describe('Why the feature is being switched on. Recorded on the audit trail with the change.')
27
27
  });
28
28
  export const OrganizationFeaturesDisableFeatureRequestDtoSchema = z.object({
29
- featureId: z.enum(CoreFeature),
30
- reason: z.string().min(1).max(500)
29
+ featureId: z.enum(CoreFeature).describe('The feature to switch off. It is added to this scope\'s removed list and taken off its added list, so it stays off through billing changes.'),
30
+ reason: z.string().min(1).max(500).describe('Why the feature is being switched off. Recorded on the audit trail with the change.')
31
31
  });
32
32
  export const OrganizationFeaturesResetFeaturesRequestDtoSchema = z.object({
33
- reason: z.string().min(1).max(500)
33
+ reason: z.string().min(1).max(500).describe('Why every manual override is being cleared. Recorded on the audit trail with the change.')
34
34
  });
35
35
  const ORGANIZATION_FEATURES_SORT_FIELDS = ['features'];
36
36
  const ORGANIZATION_FEATURES_FILTER_FIELDS = {
@@ -166,7 +166,7 @@ export const organizationFeaturesResourceConfiguration_InitializationFactory = (
166
166
  // The collection-scoped route shape is UPDATE_MANY-like, but the
167
167
  // override-all implementation persists and returns the singleton
168
168
  // feature ledger. Keep the wire response owned here rather than
169
- // inheriting DefaultUpdateManyResponseSchema from the route shape.
169
+ // inheriting the per-row response an UPDATE_MANY answers.
170
170
  customResponseDto: ScopeFeaturesWithOverridesSchema,
171
171
  }
172
172
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"organization-features.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAEzH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAA8C,MAAM,uCAAuC,CAAC;AAC/J,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAEtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,M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Q;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,wCAAwC;oBACvF,SAAS,EAAE,0BAA0B,CAAC,MAAM;oBAC5C,qBAAqB,EAAE,qBAAqB,CAAC,WAAW;oBACxD,UAAU,EAAE,iDAAiD;oBAC7D,iEAAiE;oBACjE,iEAAiE;oBACjE,gEAAgE;oBAChE,mEAAmE;oBACnE,iBAAiB,EAAE,gCAAgC;iBACpD;aACF;SACF;QAED,CAAC,+BAA+B,CAAC,eAAe,CAAC,EAAE;YACjD,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,yCAAyC;oBACxF,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,WAAW;oBACxD,UAAU,EAAE,kDAAkD;oBAC9D,iBAAiB,EAAE,gCAAgC;iBACpD;aACF;SACF;QAED,CAAC,+BAA+B,CAAC,cAAc,CAAC,EAAE;YAChD,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,uCAAuC;oBACtF,SAAS,EAAE,0BAA0B,CAAC,QAAQ;oBAC9C,yFAAyF;oBACzF,wEAAwE;oBACxE,aAAa,EAAE,8BAA8B,CAAC,YAAY;oBAC1D,qBAAqB,EAAE,qBAAqB,CAAC,WAAW;oBACxD,UAAU,EAAE,iDAAiD;oBAC7D,iBAAiB,EAAE,gCAAgC;iBACpD;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Organization Features Shared Resource Configuration\n *\n * Resource configuration for organization feature management.\n * Controls which features are available to organizations.\n */\n\nimport { z } from 'zod';\nimport { CoreFeature } from './organization-features.shared.schemas';\nimport { OrganizationFeaturesSchema, ScopeFeaturesWithOverridesSchema } from '../features/scope-features.shared.schemas';\n\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceOperationReversibility, ResourcePrimaryScope, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../notifications/notifications.shared.schemas';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\n\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\n\n// Custom operations enum for organization features\nexport enum OrganizationFeatures_Operations {\n ENABLE_FEATURE = 'enable_feature',\n DISABLE_FEATURE = 'disable_feature',\n RESET_FEATURES = 'reset_features', // Reset to default features\n}\n\nexport const OrganizationFeaturesEnableFeatureRequestDtoSchema = z.object({\n featureId: z.enum(CoreFeature),\n reason: z.string().max(500).optional()\n});\n\nexport const OrganizationFeaturesDisableFeatureRequestDtoSchema = z.object({\n featureId: z.enum(CoreFeature),\n reason: z.string().min(1).max(500)\n});\n\nexport const OrganizationFeaturesResetFeaturesRequestDtoSchema = z.object({\n reason: z.string().min(1).max(500)\n});\n\nconst ORGANIZATION_FEATURES_SORT_FIELDS = ['features'];\n\nconst ORGANIZATION_FEATURES_FILTER_FIELDS = {\n features: z.enum(CoreFeature),\n};\n\ntype OrganizationFeaturesCoreOperations =\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.READ\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\n/*\nOrganization Features Resource Configuration Factory\n*/\nexport const organizationFeaturesResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof OrganizationFeatures_Operations,\n OrganizationFeaturesCoreOperations,\n typeof OrganizationFeaturesSchema\n>({\n mainSchema: OrganizationFeaturesSchema,\n resourceIdentifier: CoreResourceType.ORGANIZATION_FEATURES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATION_FEATURES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n /*\n * The framework may materialise this scope's row on a caller's behalf — the same opt-in, for the\n * same reason, as the APPLICATION_FEATURES twin beside it.\n *\n * `systemAccessPolicy.create: ALLOWED` is what #1179's seam reads before materialising a\n * context-addressed singleton the caller never named, so an administrator can START setting a\n * tenant's entitlement overrides instead of being 404ed for the framework's own omission. The row\n * written is the scope foreign key and nothing else; this resource's schema fills the rest.\n *\n * NOTE, measured 2026-09-19: this does NOT make a READ materialise. That seam is reached for\n * UPDATE and DELETE only — extending it to READ was tried and reverted, because a probe of the\n * running backend showed the read route never enters it. A tenant whose row is still absent\n * therefore still 404s when the Entitlements pane reads it; making that row EXIST is a seeding\n * question, not an access-policy one.\n */\n systemAccessPolicy: {\n read: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition onParentDelete\n // cascade so the row is physically removed when its org is deleted. Without it the\n // cascade throws ErrorType.CONFIGURATION on any org that has a features row.\n CoreResourceOperation.DELETE\n ],\n\n customOperation: OrganizationFeatures_Operations,\n\n // assurance-control: WILDO.ENTITLEMENT.NO_SELF_GRANT — a tenant cannot widen its own entitlements.\n //\n // This ledger IS the organization's entitlement set, so the only thing standing between a tenant\n // administrator and an arbitrary feature grant is the role on each WRITE below. Every one of them —\n // CREATE, UPDATE, DELETE, ENABLE_FEATURE, DISABLE_FEATURE, RESET_FEATURES — is\n // `APP_ADMIN_SUPER_ADMIN`, a role no organization-scope entry can confer, while READ and SEARCH are\n // deliberately `ORG_MEMBER` so a tenant can see what it has without being able to change it.\n //\n // Field-level protection is NOT available here and would be the wrong instrument if it were: the\n // super-admin path has to write these same fields, so `excludeFromUpdate` would block the legitimate\n // grant along with the illegitimate one. The role gate is therefore the whole control, and adding a\n // tenant role to any write below removes it entirely rather than weakening it. Pinned by\n // `security-sensitive-operation-reachability.backend.test.ts`, which asserts the exact role array.\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER], // Org members can view features\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['features'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: ORGANIZATION_FEATURES_FILTER_FIELDS,\n sortFields: ORGANIZATION_FEATURES_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 50,\n }\n ],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can update organization features\n riskLevel: ResourceOperationRiskLevel.HIGH,\n requestDto: ScopeFeaturesWithOverridesSchema.partial(),\n }\n ],\n },\n\n // Internal-only (REPOSITORY_ONLY): powers the composition onParentDelete cascade,\n // not a public API surface — the ledger is reset, never DELETEd, over HTTP.\n // Role is APP_ADMIN_SUPER_ADMIN (matching this ledger's CREATE/UPDATE), NOT the\n // org-scope-admin (ORG_ADMIN) used by other org-scoped onParentDelete adopters\n // (progression/guidance/preferences): the features ledger is super-admin-managed —\n // org-admins have no authority over it — so its teardown tracks the super-admin tier.\n // Ratified 2026-07-11; the role is inert here anyway (REPOSITORY_ONLY → the cascade\n // calls repository.delete() with no role check). Do NOT \"align\" this to ORG_ADMIN.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n\n [OrganizationFeatures_Operations.ENABLE_FEATURE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can enable features\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto: OrganizationFeaturesEnableFeatureRequestDtoSchema,\n // The collection-scoped route shape is UPDATE_MANY-like, but the\n // override-all implementation persists and returns the singleton\n // feature ledger. Keep the wire response owned here rather than\n // inheriting DefaultUpdateManyResponseSchema from the route shape.\n customResponseDto: ScopeFeaturesWithOverridesSchema,\n }\n ],\n },\n\n [OrganizationFeatures_Operations.DISABLE_FEATURE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can disable features\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto: OrganizationFeaturesDisableFeatureRequestDtoSchema,\n customResponseDto: ScopeFeaturesWithOverridesSchema,\n }\n ],\n },\n\n [OrganizationFeatures_Operations.RESET_FEATURES]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can reset features\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n // IRREVERSIBLE: Clears every override on the organization. No backup of the list exists.\n // This is what admits it to the danger zone; risk alone no longer does.\n reversibility: ResourceOperationReversibility.IRREVERSIBLE,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto: OrganizationFeaturesResetFeaturesRequestDtoSchema,\n customResponseDto: ScopeFeaturesWithOverridesSchema,\n }\n ],\n }\n },\n});\n"]}
1
+ {"version":3,"file":"organization-features.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/organizations/organization-features.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAEzH,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAA8C,MAAM,uCAAuC,CAAC;AAC/J,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAEtH,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAE1G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAEjG,mDAAmD;AACnD,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACzC,oEAAiC,CAAA;IACjC,sEAAmC,CAAA;IACn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EAAE,wCAAwC;oBACvF,SAAS,EAAE,0BAA0B,CAAC,MAAM;oBAC5C,qBAAqB,EAAE,qBAAqB,CAAC,WAAW;oBACxD,UAAU,EAAE,iDAAiD;oBAC7D,iEAAiE;oBACjE,iEAAiE;oBACjE,gEAAgE;oBAChE,0DAA0D;oBAC1D,iBAAiB,EAAE,gCAAgC;iBACpD;aACF;SACF;QAED,CAAC,+BAA+B,CAAC,eAAe,CAAC,EAAE;YACjD,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,yCAAyC;oBACxF,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,qBAAqB,EAAE,qBAAqB,CAAC,WAAW;oBACxD,UAAU,EAAE,kDAAkD;oBAC9D,iBAAiB,EAAE,gCAAgC;iBACpD;aACF;SACF;QAED,CAAC,+BAA+B,CAAC,cAAc,CAAC,EAAE;YAChD,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,uCAAuC;oBACtF,SAAS,EAAE,0BAA0B,CAAC,QAAQ;oBAC9C,yFAAyF;oBACzF,wEAAwE;oBACxE,aAAa,EAAE,8BAA8B,CAAC,YAAY;oBAC1D,qBAAqB,EAAE,qBAAqB,CAAC,WAAW;oBACxD,UAAU,EAAE,iDAAiD;oBAC7D,iBAAiB,EAAE,gCAAgC;iBACpD;aACF;SACF;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Organization Features Shared Resource Configuration\n *\n * Resource configuration for organization feature management.\n * Controls which features are available to organizations.\n */\n\nimport { z } from 'zod';\nimport { CoreFeature } from './organization-features.shared.schemas';\nimport { OrganizationFeaturesSchema, ScopeFeaturesWithOverridesSchema } from '../features/scope-features.shared.schemas';\n\nimport { CoreResourceOperation } from '../resources/resources.shared.core.definitions';\nimport { ResourceOperationRiskLevel, ResourceOperationReversibility, ResourcePrimaryScope, ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../notifications/notifications.shared.schemas';\nimport { ResourceOperationVariantType } from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\n\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\n\n// Custom operations enum for organization features\nexport enum OrganizationFeatures_Operations {\n ENABLE_FEATURE = 'enable_feature',\n DISABLE_FEATURE = 'disable_feature',\n RESET_FEATURES = 'reset_features', // Reset to default features\n}\n\nexport const OrganizationFeaturesEnableFeatureRequestDtoSchema = z.object({\n featureId: z.enum(CoreFeature).describe('The feature to switch on. It is added to this scope\\'s manual overrides and taken off its removed list, so it stays on through billing changes.'),\n reason: z.string().max(500).optional().describe('Why the feature is being switched on. Recorded on the audit trail with the change.')\n});\n\nexport const OrganizationFeaturesDisableFeatureRequestDtoSchema = z.object({\n featureId: z.enum(CoreFeature).describe('The feature to switch off. It is added to this scope\\'s removed list and taken off its added list, so it stays off through billing changes.'),\n reason: z.string().min(1).max(500).describe('Why the feature is being switched off. Recorded on the audit trail with the change.')\n});\n\nexport const OrganizationFeaturesResetFeaturesRequestDtoSchema = z.object({\n reason: z.string().min(1).max(500).describe('Why every manual override is being cleared. Recorded on the audit trail with the change.')\n});\n\nconst ORGANIZATION_FEATURES_SORT_FIELDS = ['features'];\n\nconst ORGANIZATION_FEATURES_FILTER_FIELDS = {\n features: z.enum(CoreFeature),\n};\n\ntype OrganizationFeaturesCoreOperations =\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.READ\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\n/*\nOrganization Features Resource Configuration Factory\n*/\nexport const organizationFeaturesResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n typeof OrganizationFeatures_Operations,\n OrganizationFeaturesCoreOperations,\n typeof OrganizationFeaturesSchema\n>({\n mainSchema: OrganizationFeaturesSchema,\n resourceIdentifier: CoreResourceType.ORGANIZATION_FEATURES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATION_FEATURES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n\n /*\n * The framework may materialise this scope's row on a caller's behalf — the same opt-in, for the\n * same reason, as the APPLICATION_FEATURES twin beside it.\n *\n * `systemAccessPolicy.create: ALLOWED` is what #1179's seam reads before materialising a\n * context-addressed singleton the caller never named, so an administrator can START setting a\n * tenant's entitlement overrides instead of being 404ed for the framework's own omission. The row\n * written is the scope foreign key and nothing else; this resource's schema fills the rest.\n *\n * NOTE, measured 2026-09-19: this does NOT make a READ materialise. That seam is reached for\n * UPDATE and DELETE only — extending it to READ was tried and reverted, because a probe of the\n * running backend showed the read route never enters it. A tenant whose row is still absent\n * therefore still 404s when the Entitlements pane reads it; making that row EXIST is a seeding\n * question, not an access-policy one.\n */\n systemAccessPolicy: {\n read: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n },\n\n coreOperations: [\n CoreResourceOperation.CREATE,\n CoreResourceOperation.READ,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition onParentDelete\n // cascade so the row is physically removed when its org is deleted. Without it the\n // cascade throws ErrorType.CONFIGURATION on any org that has a features row.\n CoreResourceOperation.DELETE\n ],\n\n customOperation: OrganizationFeatures_Operations,\n\n // assurance-control: WILDO.ENTITLEMENT.NO_SELF_GRANT — a tenant cannot widen its own entitlements.\n //\n // This ledger IS the organization's entitlement set, so the only thing standing between a tenant\n // administrator and an arbitrary feature grant is the role on each WRITE below. Every one of them —\n // CREATE, UPDATE, DELETE, ENABLE_FEATURE, DISABLE_FEATURE, RESET_FEATURES — is\n // `APP_ADMIN_SUPER_ADMIN`, a role no organization-scope entry can confer, while READ and SEARCH are\n // deliberately `ORG_MEMBER` so a tenant can see what it has without being able to change it.\n //\n // Field-level protection is NOT available here and would be the wrong instrument if it were: the\n // super-admin path has to write these same fields, so `excludeFromUpdate` would block the legitimate\n // grant along with the illegitimate one. The role gate is therefore the whole control, and adding a\n // tenant role to any write below removes it entirely rather than weakening it. Pinned by\n // `security-sensitive-operation-reachability.backend.test.ts`, which asserts the exact role array.\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }\n ],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER], // Org members can view features\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n [CoreResourceOperation.SEARCH]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['features'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: ORGANIZATION_FEATURES_FILTER_FIELDS,\n sortFields: ORGANIZATION_FEATURES_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 50,\n }\n ],\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can update organization features\n riskLevel: ResourceOperationRiskLevel.HIGH,\n requestDto: ScopeFeaturesWithOverridesSchema.partial(),\n }\n ],\n },\n\n // Internal-only (REPOSITORY_ONLY): powers the composition onParentDelete cascade,\n // not a public API surface — the ledger is reset, never DELETEd, over HTTP.\n // Role is APP_ADMIN_SUPER_ADMIN (matching this ledger's CREATE/UPDATE), NOT the\n // org-scope-admin (ORG_ADMIN) used by other org-scoped onParentDelete adopters\n // (progression/guidance/preferences): the features ledger is super-admin-managed —\n // org-admins have no authority over it — so its teardown tracks the super-admin tier.\n // Ratified 2026-07-11; the role is inert here anyway (REPOSITORY_ONLY → the cascade\n // calls repository.delete() with no role check). Do NOT \"align\" this to ORG_ADMIN.\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }\n ],\n },\n\n [OrganizationFeatures_Operations.ENABLE_FEATURE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can enable features\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto: OrganizationFeaturesEnableFeatureRequestDtoSchema,\n // The collection-scoped route shape is UPDATE_MANY-like, but the\n // override-all implementation persists and returns the singleton\n // feature ledger. Keep the wire response owned here rather than\n // inheriting the per-row response an UPDATE_MANY answers.\n customResponseDto: ScopeFeaturesWithOverridesSchema,\n }\n ],\n },\n\n [OrganizationFeatures_Operations.DISABLE_FEATURE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can disable features\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto: OrganizationFeaturesDisableFeatureRequestDtoSchema,\n customResponseDto: ScopeFeaturesWithOverridesSchema,\n }\n ],\n },\n\n [OrganizationFeatures_Operations.RESET_FEATURES]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Only super admins can reset features\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n // IRREVERSIBLE: Clears every override on the organization. No backup of the list exists.\n // This is what admits it to the danger zone; risk alone no longer does.\n reversibility: ResourceOperationReversibility.IRREVERSIBLE,\n resourceOperationLike: CoreResourceOperation.UPDATE_MANY,\n requestDto: OrganizationFeaturesResetFeaturesRequestDtoSchema,\n customResponseDto: ScopeFeaturesWithOverridesSchema,\n }\n ],\n }\n },\n});\n"]}
@@ -41,6 +41,9 @@ export declare const organizationMembersResourceConfiguration_InitializationFact
41
41
  userTitle: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>>;
42
42
  invitedByUserId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>>;
43
43
  invitedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDate>>>>;
44
+ serviceProviderRelationshipId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>>>>;
45
+ providerOrganizationId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>>>>;
46
+ providerOrganizationName: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>>;
44
47
  instanceLabel: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>;
45
48
  createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDefault<z.ZodDate>>>>>;
46
49
  updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDefault<z.ZodDate>>>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"organization-members.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,wBAAwB,EACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAoD,oBAAoB,EAA+B,MAAM,uCAAuC,CAAC;AAO5J,OAAO,EACL,wBAAwB,EAEzB,MAAM,6DAA6D,CAAC;AAMrE,OAAO,EAAkB,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAmCjG,oBAAY,8BAA8B;IACxC,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,eAAe,mBAAmB;CACnC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+CAA+C;;;CAK3B,CAAC;AAsBlC,KAAK,iCAAiC,GAClC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,KAAK,GAE3B,qBAAqB,CAAC,WAAW,CAAC;AAKtC,eAAO,MAAM,8DAA8D,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;mBAggB3H,CAAC"}
1
+ {"version":3,"file":"organization-members.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/organizations/organization-members.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,wBAAwB,EACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAoD,oBAAoB,EAA+B,MAAM,uCAAuC,CAAC;AAO5J,OAAO,EACL,wBAAwB,EAEzB,MAAM,6DAA6D,CAAC;AAMrE,OAAO,EAAkB,cAAc,EAAE,MAAM,iDAAiD,CAAC;AAmCjG,oBAAY,8BAA8B;IACxC,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,eAAe,mBAAmB;CACnC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,+CAA+C;;;CAK3B,CAAC;AA4DlC,KAAK,iCAAiC,GAClC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,KAAK,GAE3B,qBAAqB,CAAC,WAAW,CAAC;AAKtC,eAAO,MAAM,8DAA8D,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;mBAghB3H,CAAC"}