@wildo-ai/saas-models 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (588) hide show
  1. package/dist/esm/applications/applications-context.schemas.d.ts +16 -10
  2. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  3. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  4. package/dist/esm/applications/applications.shared.resources-config.schemas.js +4 -3
  5. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  6. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -1
  7. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  8. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +36 -0
  9. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  10. package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
  11. package/dist/esm/billing/billing-account.shared.schemas.js +8 -1
  12. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  13. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +0 -4
  14. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  15. package/dist/esm/billing/billing-configuration.shared.schemas.js +59 -17
  16. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +77 -21
  18. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  19. package/dist/esm/billing/billing-enums.shared.schemas.js +85 -23
  20. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  21. package/dist/esm/billing/billing-types.shared.schemas.d.ts +5 -5
  22. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +1 -1
  23. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  24. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +39 -0
  25. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  26. package/dist/esm/billing/credit-pool.shared.schemas.d.ts +6 -6
  27. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  28. package/dist/esm/billing/credit-pool.shared.schemas.js +8 -4
  29. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  30. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts +1 -1
  31. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
  32. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +35 -0
  33. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  34. package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
  35. package/dist/esm/billing/invoice-ref.shared.schemas.js +8 -3
  36. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  37. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/price.shared.schemas.js +7 -1
  39. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  40. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  41. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +52 -11
  42. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/product-definition.shared.schemas.d.ts +2 -2
  44. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +2 -2
  45. package/dist/esm/billing/product.shared.schemas.d.ts +2 -2
  46. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  47. package/dist/esm/billing/product.shared.schemas.js +7 -3
  48. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  49. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +2 -2
  50. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  51. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +54 -1
  52. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  53. package/dist/esm/billing/subscription.shared.schemas.d.ts +4 -4
  54. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  55. package/dist/esm/billing/subscription.shared.schemas.js +6 -2
  56. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  57. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts +1 -1
  58. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
  59. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js +39 -0
  60. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
  61. package/dist/esm/billing/usage-record.shared.schemas.d.ts +11 -7
  62. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  63. package/dist/esm/billing/usage-record.shared.schemas.js +29 -6
  64. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  65. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +69 -2
  66. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  67. package/dist/esm/companion/provider-discovery.shared.schemas.js +20 -1
  68. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  69. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +85 -0
  70. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -0
  71. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +157 -0
  72. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -0
  73. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  74. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +35 -2
  75. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  76. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +23 -0
  77. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  78. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +56 -0
  79. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  80. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +541 -20
  81. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  82. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +605 -23
  83. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  84. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  85. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +96 -3
  86. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  87. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts +49 -0
  88. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
  89. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js +124 -1
  90. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
  91. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +11 -3
  92. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  93. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +11 -3
  94. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  95. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +94 -0
  96. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -0
  97. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +211 -0
  98. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -0
  99. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +67 -12
  100. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  101. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +95 -8
  102. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  103. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +17 -0
  104. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  105. package/dist/esm/compliance/privacy/privacy.shared.schemas.js +27 -4
  106. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  107. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts +89 -16
  108. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  109. package/dist/esm/compliance/privacy/redaction.shared.schemas.js +101 -15
  110. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  112. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js +12 -5
  113. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  114. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +21 -0
  115. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  116. package/dist/esm/config/analytics-value-moments.shared.schemas.js +20 -0
  117. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  118. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +9 -5
  119. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  120. package/dist/esm/config/app-configuration-shared.shared.schemas.js +29 -0
  121. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  122. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +8 -1
  123. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  124. package/dist/esm/config/auth-config-resolution.shared.utils.js +29 -0
  125. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  126. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +95 -17
  127. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  128. package/dist/esm/config/entity-identity-config.shared.schemas.js +86 -8
  129. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  130. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +12 -12
  131. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +33 -0
  132. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  133. package/dist/esm/config/frontend/navigation.shared.schemas.js +32 -0
  134. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  135. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +40 -1
  136. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  137. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +40 -1
  138. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  139. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +57 -11
  140. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  141. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  142. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +109 -64
  143. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  144. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +200 -19
  145. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  146. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts +15 -3
  147. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  148. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +32 -7
  149. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  150. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +84 -7
  151. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  152. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +59 -0
  153. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -0
  154. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +61 -0
  155. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -0
  156. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +97 -0
  157. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -0
  158. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +41 -0
  159. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -0
  160. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +148 -2
  161. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +56 -1
  163. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  164. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +9 -31
  165. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  166. package/dist/esm/external-providers/provider-capability.shared.schemas.js +8 -5
  167. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  168. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +18 -8
  169. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  170. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +9 -4
  171. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  172. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +338 -0
  173. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -0
  174. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +332 -0
  175. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -0
  176. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +178 -9
  177. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  178. package/dist/esm/external-providers/provider-metadata.shared.schemas.js +181 -9
  179. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  180. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +7 -5
  181. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  182. package/dist/esm/external-providers/provider-protocol.shared.schemas.js +7 -5
  183. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  184. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts +40 -0
  185. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -0
  186. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js +80 -0
  187. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -0
  188. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  189. package/dist/esm/features/core-feature-definitions.shared.js +7 -1
  190. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  191. package/dist/esm/features/feature-builders.shared.d.ts +32 -0
  192. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  193. package/dist/esm/features/feature-builders.shared.js +32 -0
  194. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  195. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
  196. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  197. package/dist/esm/features/user-features.shared.resources-config.schemas.js +48 -0
  198. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  199. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts +156 -0
  200. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -0
  201. package/dist/esm/files/file-upload-grant.shared.schemas.js +175 -0
  202. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -0
  203. package/dist/esm/files/files.shared.schemas.d.ts +52 -4
  204. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  205. package/dist/esm/files/files.shared.schemas.js +55 -4
  206. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  207. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts +1 -1
  208. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  209. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js +33 -0
  210. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
  211. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
  212. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js +6 -2
  213. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
  214. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts +1 -1
  215. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
  216. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js +53 -0
  217. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
  218. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  219. package/dist/esm/flows-actors/actors.shared.schemas.js +3 -2
  220. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  221. package/dist/esm/flows-actors/agents.shared.schemas.d.ts +54 -5
  222. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  223. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  224. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts +6 -6
  225. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +0 -3
  226. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  227. package/dist/esm/flows-actors/deliberation.shared.schemas.js +0 -5
  228. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  229. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts +1 -1
  230. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
  231. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js +43 -0
  232. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
  233. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +14 -0
  234. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  235. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +48 -6
  236. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  237. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts +1 -1
  238. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
  239. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js +41 -0
  240. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
  241. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +0 -7
  242. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
  243. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js +23 -13
  244. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
  245. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +19 -0
  246. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  247. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +33 -0
  248. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  249. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts +14 -9
  250. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  251. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +14 -9
  252. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  253. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  254. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +3 -2
  255. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  256. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  257. package/dist/esm/flows-actors/flows.shared.schemas.js +3 -2
  258. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  259. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts +128 -0
  260. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -0
  261. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +142 -0
  262. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -0
  263. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -3
  264. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +1 -1
  265. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +1 -4
  266. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +1 -1
  267. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts +0 -16
  268. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
  269. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js +1 -17
  270. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
  271. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +3 -3
  272. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js +3 -3
  273. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  274. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +2 -8
  275. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +1 -1
  276. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +4 -15
  277. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +1 -1
  278. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts +1 -1
  279. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
  280. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js +51 -0
  281. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
  282. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  283. package/dist/esm/guidance/guidance-state.shared.schemas.js +8 -2
  284. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  285. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  286. package/dist/esm/guidance/guidance-state.shared.utils.js +1 -0
  287. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  288. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts +1 -1
  289. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
  290. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js +51 -0
  291. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
  292. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  293. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +28 -3
  294. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  295. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +9 -1
  296. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  297. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js +51 -0
  298. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
  299. package/dist/esm/guidance/progression-state.shared.schemas.d.ts +46 -0
  300. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  301. package/dist/esm/guidance/progression-state.shared.schemas.js +67 -4
  302. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  303. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +356 -52
  304. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  305. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +166 -39
  306. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  307. package/dist/esm/index.d.ts +15 -0
  308. package/dist/esm/index.d.ts.map +1 -1
  309. package/dist/esm/index.js +15 -0
  310. package/dist/esm/index.js.map +1 -1
  311. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +11 -2
  312. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  313. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  314. package/dist/esm/notifications/email/email-template.shared.enums.d.ts +15 -0
  315. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  316. package/dist/esm/notifications/email/email-template.shared.enums.js +15 -0
  317. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  318. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts +70 -0
  319. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -0
  320. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js +71 -0
  321. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -0
  322. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +1 -0
  323. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  324. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +19 -0
  325. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  326. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts +30 -0
  327. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  328. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +65 -1
  329. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  330. package/dist/esm/notifications/notification-badges.core.definitions.d.ts +6 -4
  331. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  332. package/dist/esm/notifications/notification-badges.core.definitions.js +6 -4
  333. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  334. package/dist/esm/notifications/notification-badges.schemas.d.ts +167 -5
  335. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  336. package/dist/esm/notifications/notification-badges.schemas.js +191 -6
  337. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  338. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
  339. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  340. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +36 -0
  341. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  342. package/dist/esm/notifications/notifications.shared.schemas.d.ts +107 -0
  343. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  344. package/dist/esm/notifications/notifications.shared.schemas.js +149 -1
  345. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  346. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
  347. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  348. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +44 -0
  349. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  350. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  351. package/dist/esm/organizations/organization-members.shared.schemas.js +15 -4
  352. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  353. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/organizations/organization-notifications.shared.schemas.js +22 -1
  355. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  356. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +26 -0
  357. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  358. package/dist/esm/organizations/organization-preferences.shared.schemas.js +25 -0
  359. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  360. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +25 -0
  361. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  362. package/dist/esm/organizations/organization-profile.shared.schemas.js +42 -17
  363. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  364. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +3 -2
  365. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  366. package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -2
  367. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  368. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  369. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +35 -12
  370. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  371. package/dist/esm/public-runtime/index.d.ts +49 -2
  372. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  373. package/dist/esm/public-runtime/index.js +48 -1
  374. package/dist/esm/public-runtime/index.js.map +1 -1
  375. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +6 -5
  376. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  377. package/dist/esm/queue/jobs.shared.resources-config.schemas.js +23 -5
  378. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  379. package/dist/esm/queue/jobs.shared.schemas.d.ts +16 -3
  380. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  381. package/dist/esm/queue/jobs.shared.schemas.js +16 -3
  382. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  383. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts +137 -0
  384. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -0
  385. package/dist/esm/requests/manual-controllers-routes-documentation.js +1201 -0
  386. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -0
  387. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +67 -0
  388. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  389. package/dist/esm/requests/manual-controllers-routes-urls.js +78 -0
  390. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  391. package/dist/esm/requests/rate-limits.shared.schemas.d.ts +11 -1
  392. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  393. package/dist/esm/requests/rate-limits.shared.schemas.js +11 -1
  394. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  395. package/dist/esm/requests/websocket.shared.schemas.d.ts +86 -4
  396. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  397. package/dist/esm/requests/websocket.shared.schemas.js +138 -0
  398. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  399. package/dist/esm/resources/collection-query-parameters.shared.d.ts +22 -0
  400. package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -0
  401. package/dist/esm/resources/collection-query-parameters.shared.js +22 -0
  402. package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -0
  403. package/dist/esm/resources/resources-config.shared.factory.d.ts +1 -0
  404. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  405. package/dist/esm/resources/resources-config.shared.factory.js +189 -31
  406. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  407. package/dist/esm/resources/resources-config.shared.schemas.d.ts +395 -92
  408. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  409. package/dist/esm/resources/resources-config.shared.schemas.js +109 -20
  410. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  411. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  412. package/dist/esm/resources/resources-registry.shared.core.definitions.js +97 -5
  413. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  414. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  415. package/dist/esm/resources/resources-relationships.shared.factory.js +15 -0
  416. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  417. package/dist/esm/resources/resources.shared.core.definitions.d.ts +37 -0
  418. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  419. package/dist/esm/resources/resources.shared.core.definitions.js +51 -0
  420. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  421. package/dist/esm/resources/resources.shared.schemas.d.ts +11 -2
  422. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  423. package/dist/esm/resources/resources.shared.schemas.js +34 -3
  424. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  425. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts +51 -0
  426. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -0
  427. package/dist/esm/resources/utils/field-value-disclosure.utils.js +53 -0
  428. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -0
  429. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  430. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +21 -6
  431. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  432. package/dist/esm/resources/utils/resources-summary.utils.d.ts +16 -2
  433. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  434. package/dist/esm/resources/utils/resources-summary.utils.js +19 -5
  435. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  436. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  437. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +11 -0
  438. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  439. package/dist/esm/runtime/domain-module.shared.definitions.d.ts +25 -0
  440. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  441. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  442. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
  443. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  444. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +38 -0
  445. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  446. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
  447. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  448. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +38 -0
  449. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  450. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +4 -11
  451. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  452. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +0 -1
  453. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  454. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +141 -5
  455. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  456. package/dist/esm/security/authentications/authentication.shared.schemas.js +147 -3
  457. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  458. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +17 -1
  459. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  460. package/dist/esm/security/authentications/consumable-token.shared.schemas.js +16 -0
  461. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  462. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts +28 -0
  463. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -0
  464. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js +28 -0
  465. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -0
  466. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +1 -0
  467. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  468. package/dist/esm/security/authentications/registration.shared.dto.schemas.js +11 -0
  469. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  470. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +15 -0
  471. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  472. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +21 -4
  473. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  474. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts +21 -0
  475. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -0
  476. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js +21 -0
  477. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -0
  478. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts +61 -1
  479. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  480. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +208 -6
  481. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  482. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts +37 -27
  483. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  484. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +134 -12
  485. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  486. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -6
  487. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  488. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +17 -8
  489. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  490. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts +1 -1
  491. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  492. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +70 -0
  493. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  494. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +45 -8
  495. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  496. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +56 -10
  497. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  498. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +16 -1
  499. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  500. package/dist/esm/security/authorizations/roles.shared.schemas.js +16 -1
  501. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  502. package/dist/esm/security/authorizations/roles.shared.utils.d.ts +54 -0
  503. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  504. package/dist/esm/security/authorizations/roles.shared.utils.js +59 -0
  505. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  506. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +31 -0
  507. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -0
  508. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +198 -0
  509. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -0
  510. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +31 -0
  511. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -0
  512. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +191 -0
  513. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -0
  514. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +250 -0
  515. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -0
  516. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +486 -0
  517. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -0
  518. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +4 -1
  519. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  520. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +29 -0
  521. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  522. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +4 -1
  523. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  524. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +29 -0
  525. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  526. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +67 -0
  527. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  528. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +44 -1
  529. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  530. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts +1 -1
  531. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
  532. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js +35 -0
  533. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
  534. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts +13 -0
  535. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  536. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js +31 -4
  537. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  538. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +1 -1
  539. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  540. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +34 -0
  541. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  542. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  543. package/dist/esm/users/inbound-contacts.shared.schemas.js +7 -4
  544. package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
  545. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts +1 -1
  546. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
  547. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js +37 -0
  548. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
  549. package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
  550. package/dist/esm/users/user-credentials.shared.schemas.js +17 -2
  551. package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
  552. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -1
  553. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  554. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js +36 -0
  555. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
  556. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  557. package/dist/esm/users/user-identity-links.shared.schemas.js +15 -5
  558. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  559. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +5 -5
  560. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  561. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +53 -0
  562. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  563. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts +1 -1
  564. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  565. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +62 -0
  566. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  567. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +5 -5
  568. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  569. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +53 -0
  570. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts +1 -1
  572. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  573. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js +62 -0
  574. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
  575. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  576. package/dist/esm/users/user-self.shared.resources-config.schemas.js +33 -3
  577. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  578. package/dist/esm/users/users.shared.resources-config.schemas.d.ts +17 -1
  579. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  580. package/dist/esm/users/users.shared.resources-config.schemas.js +136 -5
  581. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  582. package/dist/esm/users/users.shared.schemas.d.ts +62 -12
  583. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  584. package/dist/esm/users/users.shared.schemas.js +79 -23
  585. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  586. package/dist/tsconfig.build.tsbuildinfo +1 -1
  587. package/package.json +5 -6
  588. package/dist/esm/.builder.pid +0 -9
@@ -18,6 +18,7 @@ export declare const ApplicationFullCurrentContextSchema: z.ZodObject<{
18
18
  displayName: z.ZodOptional<z.ZodString>;
19
19
  description: z.ZodOptional<z.ZodString>;
20
20
  version: z.ZodString;
21
+ applicationId: z.ZodOptional<z.ZodString>;
21
22
  }, z.core.$strip>;
22
23
  brandAssets: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
24
  composition: z.ZodEnum<typeof import("..").BrandAssetComposition>;
@@ -146,6 +147,11 @@ export declare const ApplicationFullCurrentContextSchema: z.ZodObject<{
146
147
  requireSpecialChars: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
147
148
  expiryDays: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
148
149
  }, z.core.$strip>>;
150
+ stepUpAuth: z.ZodOptional<z.ZodObject<{
151
+ enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
152
+ maxAgeSeconds: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
153
+ methods: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("..").AuthMethod>>>>;
154
+ }, z.core.$strip>>;
149
155
  }, z.core.$strip>>;
150
156
  scimProvisioning: z.ZodOptional<z.ZodObject<{
151
157
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -165,10 +171,6 @@ export declare const ApplicationFullCurrentContextSchema: z.ZodObject<{
165
171
  billing: z.ZodOptional<z.ZodObject<{
166
172
  enabled: z.ZodDefault<z.ZodBoolean>;
167
173
  providerRef: z.ZodOptional<z.ZodString>;
168
- webhooks: z.ZodOptional<z.ZodObject<{
169
- path: z.ZodDefault<z.ZodString>;
170
- signingSecretRef: z.ZodOptional<z.ZodString>;
171
- }, z.core.$strip>>;
172
174
  defaultCurrency: z.ZodDefault<z.ZodUnion<[z.ZodEnum<typeof import("@wildo-ai/zod-decorators").AvailableCurrency>, z.ZodString]>>;
173
175
  supportedCurrencies: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodEnum<typeof import("@wildo-ai/zod-decorators").AvailableCurrency>, z.ZodString]>>>;
174
176
  tax: z.ZodDefault<z.ZodObject<{
@@ -187,7 +189,7 @@ export declare const ApplicationFullCurrentContextSchema: z.ZodObject<{
187
189
  defaultTrialDays: z.ZodDefault<z.ZodNumber>;
188
190
  paymentGracePeriodDays: z.ZodDefault<z.ZodNumber>;
189
191
  maxPaymentRetries: z.ZodDefault<z.ZodNumber>;
190
- defaultProration: z.ZodDefault<z.ZodEnum<typeof import("..").ProrationBehavior>>;
192
+ defaultProration: z.ZodDefault<z.ZodEnum<typeof import("@wildo-ai/external-connectors-models").ProrationBehavior>>;
191
193
  defaultCancellation: z.ZodDefault<z.ZodEnum<typeof import("..").BillingTiming>>;
192
194
  }, z.core.$strip>>;
193
195
  }, z.core.$strip>>;
@@ -290,6 +292,7 @@ export declare const ApplicationFullCurrentContextSchema: z.ZodObject<{
290
292
  }, z.core.$strip>>;
291
293
  auditTrail: z.ZodOptional<z.ZodObject<{
292
294
  archiveAfterDays: z.ZodOptional<z.ZodNumber>;
295
+ allowPrivateNetworkSiemCollectors: z.ZodOptional<z.ZodBoolean>;
293
296
  }, z.core.$strip>>;
294
297
  }, z.core.$strip>;
295
298
  metadata: z.ZodObject<{
@@ -323,6 +326,7 @@ export declare const ApplicationContextSchema: z.ZodObject<{
323
326
  displayName: z.ZodOptional<z.ZodString>;
324
327
  description: z.ZodOptional<z.ZodString>;
325
328
  version: z.ZodString;
329
+ applicationId: z.ZodOptional<z.ZodString>;
326
330
  }, z.core.$strip>;
327
331
  brandAssets: z.ZodOptional<z.ZodArray<z.ZodObject<{
328
332
  composition: z.ZodEnum<typeof import("..").BrandAssetComposition>;
@@ -451,6 +455,11 @@ export declare const ApplicationContextSchema: z.ZodObject<{
451
455
  requireSpecialChars: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
452
456
  expiryDays: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
453
457
  }, z.core.$strip>>;
458
+ stepUpAuth: z.ZodOptional<z.ZodObject<{
459
+ enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
460
+ maxAgeSeconds: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
461
+ methods: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodEnum<typeof import("..").AuthMethod>>>>;
462
+ }, z.core.$strip>>;
454
463
  }, z.core.$strip>>;
455
464
  scimProvisioning: z.ZodOptional<z.ZodObject<{
456
465
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -470,10 +479,6 @@ export declare const ApplicationContextSchema: z.ZodObject<{
470
479
  billing: z.ZodOptional<z.ZodObject<{
471
480
  enabled: z.ZodDefault<z.ZodBoolean>;
472
481
  providerRef: z.ZodOptional<z.ZodString>;
473
- webhooks: z.ZodOptional<z.ZodObject<{
474
- path: z.ZodDefault<z.ZodString>;
475
- signingSecretRef: z.ZodOptional<z.ZodString>;
476
- }, z.core.$strip>>;
477
482
  defaultCurrency: z.ZodDefault<z.ZodUnion<[z.ZodEnum<typeof import("@wildo-ai/zod-decorators").AvailableCurrency>, z.ZodString]>>;
478
483
  supportedCurrencies: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodEnum<typeof import("@wildo-ai/zod-decorators").AvailableCurrency>, z.ZodString]>>>;
479
484
  tax: z.ZodDefault<z.ZodObject<{
@@ -492,7 +497,7 @@ export declare const ApplicationContextSchema: z.ZodObject<{
492
497
  defaultTrialDays: z.ZodDefault<z.ZodNumber>;
493
498
  paymentGracePeriodDays: z.ZodDefault<z.ZodNumber>;
494
499
  maxPaymentRetries: z.ZodDefault<z.ZodNumber>;
495
- defaultProration: z.ZodDefault<z.ZodEnum<typeof import("..").ProrationBehavior>>;
500
+ defaultProration: z.ZodDefault<z.ZodEnum<typeof import("@wildo-ai/external-connectors-models").ProrationBehavior>>;
496
501
  defaultCancellation: z.ZodDefault<z.ZodEnum<typeof import("..").BillingTiming>>;
497
502
  }, z.core.$strip>>;
498
503
  }, z.core.$strip>>;
@@ -595,6 +600,7 @@ export declare const ApplicationContextSchema: z.ZodObject<{
595
600
  }, z.core.$strip>>;
596
601
  auditTrail: z.ZodOptional<z.ZodObject<{
597
602
  archiveAfterDays: z.ZodOptional<z.ZodNumber>;
603
+ allowPrivateNetworkSiemCollectors: z.ZodOptional<z.ZodBoolean>;
598
604
  }, z.core.$strip>>;
599
605
  }, z.core.$strip>>;
600
606
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"applications-context.schemas.d.ts","sourceRoot":"","sources":["../../../../src/applications/applications-context.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI9C,CAAC;AAEH,MAAM,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAInC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"applications.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/applications/applications.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAsC,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AA+E7E,KAAK,yBAAyB,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAKjC,eAAO,MAAM,sDAAsD,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;kBAiNnH,CAAC"}
1
+ {"version":3,"file":"applications.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/applications/applications.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAsC,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AA+E7E,KAAK,yBAAyB,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAKjC,eAAO,MAAM,sDAAsD,GAAI,wBAAwB,oBAAoB,EAAE;;;;;;kBAkNnH,CAAC"}
@@ -255,9 +255,10 @@ export const applicationResourceConfiguration_InitializationFactory = (resources
255
255
  // deleting one destroys everything scoped beneath it. Same reasoning as
256
256
  // `ORGANIZATIONS | DELETE`: `riskLevel` is UI-only and the per-user-type `stepUpAuth`
257
257
  // policy is opt-in, off by default, and freshness-satisfied — neither challenges the
258
- // caller here. Carries the same accepted audience limitation (re-auth is PASSWORD-only,
259
- // and directory-managed users have no password by design); see the note on
260
- // `ORGANIZATIONS | DELETE`.
258
+ // caller here. Re-authentication itself accepts PASSWORD, an enrolled second factor
259
+ // (TOTP or a backup code) and PASSKEY, so a directory-managed user whose local first
260
+ // factor the framework destroys can still clear the gate through their second factor;
261
+ // see the note on `ORGANIZATIONS | DELETE` for how that came about.
261
262
  //
262
263
  // assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-authentication before a high-impact action.
263
264
  requiresStepUpAuthentication: true,
@@ -1 +1 @@
1
- {"version":3,"file":"applications.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/applications/applications.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,kCAAkC,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAE7I,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EA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AC,cAAc,CAAC,qBAAqB,CAAC,EAAE,0CAA0C;oBACzF,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,0CAA0C;iBAC3C;aACF;YACD,iBAAiB,EAAE;gBACjB;oBACE,MAAM,EAAE,0BAA0B,CAAC,2BAA2B;oBAC9D,OAAO,EAAE,2BAA2B,CAAC,KAAK;iBAC3C;aACF;SACF;QAED,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE;gBACR;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,2CAA2C;oBAC9E,SAAS,EAAE,0BAA0B,CAAC,QAAQ;oBAC9C,uFAAuF;oBACvF,wEAAwE;oBACxE,sFAAsF;oBACtF,qFAAqF;oBACrF,wFAAwF;oBACxF,2EAA2E;oBAC3E,4BAA4B;oBAC5B,EAAE;oBACF,4GAA4G;oBAC5G,4BAA4B,EAAE,IAAI;iBACnC;gBACD;oBACE,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,KAAK;oBAChB,UAAU,EAAE,OAAO;oBACnB,KAAK,EAAE,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,0CAA0C;oBACzF,SAAS,EAAE,0BAA0B,CAAC,IAAI;oBAC1C,0EAA0E;oBAC1E,4BAA4B,EAAE,IAAI;iBACnC;aACF;YACD,iBAAiB,EAAE;gBACjB;oBACE,MAAM,EAAE,0BAA0B,CAAC,2BAA2B;oBAC9D,OAAO,EAAE,2BAA2B,CAAC,KAAK;iBAC3C;aACF;SACF;KACF;CAEF,CAAC,CAAC","sourcesContent":["/**\n * Application Shared Resource Configuration\n *\n * Resource configuration for application management.\n * Supports both organization self-management and platform admin oversight.\n */\n\nimport { z } from 'zod';\nimport { ApplicationSchema } from './applications.shared.schemas';\n\nimport { coreResourceShared_FieldIdentifier, CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { ResourceOperationVariantType, ResourceOperationRiskLevel } from '../resources/resources.shared.schemas';\nimport { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../notifications/notifications.shared.schemas';\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 applications.\n//\n// CROSS-ORGANIZATION APPLICATION TRANSFER IS INTENTIONALLY NOT A FRAMEWORK CAPABILITY.\n// `TRANSFER` was declared here in two variants (`ORG_ADMIN` default at `riskLevel: CRITICAL`, and\n// an `APP_ADMIN_SUPER_ADMIN` `admin` variant adding `bypassOwnerApproval`), taking\n// `{ targetOrganizationId, transferReason }`. Both were ROUTED but never implemented, so each\n// request fell through to the generic core UPDATE, which persists only fields the resource schema\n// declares. Neither `targetOrganizationId` nor `transferReason` is one, so every call answered\n// **HTTP 200 having changed nothing** — an operator was told a CRITICAL cross-tenant move had\n// succeeded while the application stayed exactly where it was. Removed 2026-08-01.\n//\n// It was REMOVED rather than implemented on five independent grounds:\n//\n// 1. NO FIELD TO WRITE. `ApplicationSchema` carries no owning-organization field.\n// 2. NO RELATIONSHIP TO RE-POINT. The resources registry declares no\n// `ORGANIZATIONS → APPLICATION` edge; applications are not organization-owned here.\n// 3. THE OWNERSHIP DIRECTION IS INVERTED. `APPLICATION` is a top-level, self-anchored\n// `ResourcePrimaryScope`. The application IS the tenant container; organizations are a\n// sibling scope living inside its tenancy. \"Transferring\" the application to one of its own\n// organizations is incoherent, not merely unimplemented.\n// 4. WHERE ORGANIZATION OWNERSHIP DOES EXIST, IT IS ALREADY IMMUTABLE. The platform\n// app-factory's own application record binds `organizationId` at create and marks it\n// `excludeFromUpdate()` — a different resource, on a different service, already refusing\n// this mutation.\n// 5. FRAMEWORK PRECEDENT. Cross-organization MEMBER transfer is refused for exactly this\n// reason — a tenant-boundary crossing the framework does not sanction (see\n// `organization-members.shared.resources-config.schemas.ts`). An application is the tenant\n// container itself, so the argument applies with more force, not less.\n//\n// `bypassOwnerApproval` additionally named an approval flow that does not exist, and neither\n// variant emitted an audit event despite being cross-tenant and CRITICAL. Re-declaring an\n// application re-parenting verb would require, at minimum: a persisted ownership edge, an\n// approval flow for the flag to bypass, a custom implementation that writes the edge, and\n// audit/SIEM emission on both request and completion.\n//\n// APPLICATION STATUS LIFECYCLE IS INTENTIONALLY NOT A FRAMEWORK CAPABILITY EITHER.\n// `ACTIVATE` and `SUSPEND` were declared here as `APP_ADMIN_SUPER_ADMIN` verbs (`MEDIUM` and\n// `CRITICAL` respectively, both with a generated bulk variant) taking `{ reason }` and\n// `{ suspensionReason, notifyOwners }`. Like TRANSFER they were ROUTED but never implemented, so\n// each fell through to the generic core UPDATE and answered **HTTP 200 having changed nothing** —\n// an operator was told a CRITICAL application suspension had taken effect while the application\n// kept serving. Removed 2026-08-01, on grounds that compound with TRANSFER's:\n//\n// 1. NO FIELD TO WRITE — and no plausible one. `ApplicationSchema` is\n// `{_id, appSlug, appDisplayName, lastVersion, platformAppId}`: an identity row, carrying no\n// lifecycle state at all. There is nothing to transition.\n// 2. THE LIFECYCLE IS OWNED ONE TIER UP. An application's real operational state lives at the\n// platform tier (`PLATFORM_APPLICATIONS` / `Wildo_Application_Config`), provisioned and\n// managed by the platform apps-manager. This row is the in-app registry entry an application\n// reads to know its own identity — halting an application is a platform-tier action, not a\n// self-service field flip on the application's own copy of its name.\n// 3. SAME INVERTED OWNERSHIP AS TRANSFER (ground 3 above). `APPLICATION` is a top-level\n// `ResourcePrimaryScope`; suspending the tenant container from inside its own tenancy is\n// incoherent, and the suspending super-admin's own session lives in that container.\n//\n// The resource specification's framing — \"Created per org, managed by admins, and may be\n// transferred or suspended under governance\", with 409s for destination-org slug collisions —\n// describes a per-organization application marketplace. The framework does not implement one, and\n// inventing an `ApplicationStatus` to satisfy two unimplemented buttons would have built that\n// model backwards from its UI. Re-declaring these verbs requires the ownership model first.\n//\n// Applications consequently declare NO custom operations (hence the `undefined` custom-operation\n// type parameter below). See `.claude/plans/status-lifecycle-operations-analysis.md` and\n// `.claude/plans/routed-unimplemented-operations-fail-closed.md`.\n\nconst APPLICATION_SORT_FIELDS = ['appDisplayName', 'appSlug'];\n\nconst APPLICATION_FILTER_FIELDS = {\n appSlug: z.string(),\n appDisplayName: z.string(),\n};\n\ntype ApplicationCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\n/*\nApplications Resource Configuration Factory\n*/\nexport const applicationResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n undefined,\n ApplicationCoreOperations,\n typeof ApplicationSchema\n>({\n mainSchema: ApplicationSchema,\n resourceIdentifier: CoreResourceType.APPLICATION,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true, // Applications are core system resources\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE\n ],\n\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can create applications\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n // Use database definition so platformAppId and lastVersion are preserved\n // requestDto auto-derived from decorators\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can create applications for any org\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\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 applications\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can view any application\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n /**\n * ⚠️ NOTHING CONFINES THIS QUERY — and that is safe for a reason worth stating, because the\n * comment on the default variant used to imply a mechanism that does not exist.\n *\n * `applications` is its own scope ROOT, so both repositories blacklist the APPLICATIONS axis and\n * this LIST compiles to the EMPTY filter (measured 2026-08-12,\n * `base-classes/__tests__/scope-root-collection-confinement.probe.test.ts`, RESIDUAL sweep). The\n * old wording — \"Org members can list *their* applications\" — is exactly the shape of the claim\n * that was FALSE on `organizations` and cost a full tenant-isolation investigation, one role tier\n * higher.\n *\n * What makes it safe here is ARCHITECTURE, not a predicate: **one database per application.**\n * \"An application's organizations live in that application's own database\"\n * (`organizations.shared.schemas.ts`, on `slug` uniqueness), so this collection holds that\n * application's own row and a caller can only ever see the application they are already using.\n * Measured: an ordinary `ORG_MEMBER` receives 1 of 1 rows, projected to four summary fields.\n *\n * So the two variants below differ in ROLE, not in reach — `admin` exists for the fields and\n * operations it unlocks elsewhere, not because it sees more rows here.\n *\n * ⚠️ This rests on the one-database-per-application invariant. `CREATE` is super-admin gated, so\n * a second application row COULD be written into this database; if that ever becomes a real\n * deployment shape, this resource inherits the `organizations` defect at the `ORG_MEMBER` tier\n * and must be confined on `initiatorIds.applicationId`. Tracked as SEC-SCOPEROOT-3.\n */\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER], // Unconfined by construction; safe because the collection holds this application only — see the block above\n riskLevel: ResourceOperationRiskLevel.LOW,\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can list all applications\n riskLevel: ResourceOperationRiskLevel.LOW,\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\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: ['name', 'description'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 50,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['name', 'description', 'slug'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 100,\n }\n ]\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can update their applications\n riskLevel: ResourceOperationRiskLevel.LOW,\n // requestDto auto-derived from decorators\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can update any application\n riskLevel: ResourceOperationRiskLevel.LOW,\n // requestDto auto-derived from decorators\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can delete their applications\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n // An APPLICATION is a top-level scope in this framework, not an org-owned artifact, so\n // deleting one destroys everything scoped beneath it. Same reasoning as\n // `ORGANIZATIONS | DELETE`: `riskLevel` is UI-only and the per-user-type `stepUpAuth`\n // policy is opt-in, off by default, and freshness-satisfied — neither challenges the\n // caller here. Carries the same accepted audience limitation (re-auth is PASSWORD-only,\n // and directory-managed users have no password by design); see the note on\n // `ORGANIZATIONS | DELETE`.\n //\n // assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-authentication before a high-impact action.\n requiresStepUpAuthentication: true,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can delete any application\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // Per-VARIANT flag — nothing is inherited from the default variant above.\n requiresStepUpAuthentication: true,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n }\n },\n\n});\n"]}
1
+ {"version":3,"file":"applications.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/applications/applications.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oBACE,MAAM,EAAE,0BAA0B,CAAC,2BAA2B;oBAC9D,OAAO,EAAE,2BAA2B,CAAC,KAAK;iBAC3C;aACF;SACF;KACF;CAEF,CAAC,CAAC","sourcesContent":["/**\n * Application Shared Resource Configuration\n *\n * Resource configuration for application management.\n * Supports both organization self-management and platform admin oversight.\n */\n\nimport { z } from 'zod';\nimport { ApplicationSchema } from './applications.shared.schemas';\n\nimport { coreResourceShared_FieldIdentifier, CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport { ResourceRelationship } from '../resources/resources.shared.schemas';\nimport { ResourceOperationVariantType, ResourceOperationRiskLevel } from '../resources/resources.shared.schemas';\nimport { CoreUserNotificationTarget, CoreUserNotificationChannel } from '../notifications/notifications.shared.schemas';\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 applications.\n//\n// CROSS-ORGANIZATION APPLICATION TRANSFER IS INTENTIONALLY NOT A FRAMEWORK CAPABILITY.\n// `TRANSFER` was declared here in two variants (`ORG_ADMIN` default at `riskLevel: CRITICAL`, and\n// an `APP_ADMIN_SUPER_ADMIN` `admin` variant adding `bypassOwnerApproval`), taking\n// `{ targetOrganizationId, transferReason }`. Both were ROUTED but never implemented, so each\n// request fell through to the generic core UPDATE, which persists only fields the resource schema\n// declares. Neither `targetOrganizationId` nor `transferReason` is one, so every call answered\n// **HTTP 200 having changed nothing** — an operator was told a CRITICAL cross-tenant move had\n// succeeded while the application stayed exactly where it was. Removed 2026-08-01.\n//\n// It was REMOVED rather than implemented on five independent grounds:\n//\n// 1. NO FIELD TO WRITE. `ApplicationSchema` carries no owning-organization field.\n// 2. NO RELATIONSHIP TO RE-POINT. The resources registry declares no\n// `ORGANIZATIONS → APPLICATION` edge; applications are not organization-owned here.\n// 3. THE OWNERSHIP DIRECTION IS INVERTED. `APPLICATION` is a top-level, self-anchored\n// `ResourcePrimaryScope`. The application IS the tenant container; organizations are a\n// sibling scope living inside its tenancy. \"Transferring\" the application to one of its own\n// organizations is incoherent, not merely unimplemented.\n// 4. WHERE ORGANIZATION OWNERSHIP DOES EXIST, IT IS ALREADY IMMUTABLE. The platform\n// app-factory's own application record binds `organizationId` at create and marks it\n// `excludeFromUpdate()` — a different resource, on a different service, already refusing\n// this mutation.\n// 5. FRAMEWORK PRECEDENT. Cross-organization MEMBER transfer is refused for exactly this\n// reason — a tenant-boundary crossing the framework does not sanction (see\n// `organization-members.shared.resources-config.schemas.ts`). An application is the tenant\n// container itself, so the argument applies with more force, not less.\n//\n// `bypassOwnerApproval` additionally named an approval flow that does not exist, and neither\n// variant emitted an audit event despite being cross-tenant and CRITICAL. Re-declaring an\n// application re-parenting verb would require, at minimum: a persisted ownership edge, an\n// approval flow for the flag to bypass, a custom implementation that writes the edge, and\n// audit/SIEM emission on both request and completion.\n//\n// APPLICATION STATUS LIFECYCLE IS INTENTIONALLY NOT A FRAMEWORK CAPABILITY EITHER.\n// `ACTIVATE` and `SUSPEND` were declared here as `APP_ADMIN_SUPER_ADMIN` verbs (`MEDIUM` and\n// `CRITICAL` respectively, both with a generated bulk variant) taking `{ reason }` and\n// `{ suspensionReason, notifyOwners }`. Like TRANSFER they were ROUTED but never implemented, so\n// each fell through to the generic core UPDATE and answered **HTTP 200 having changed nothing** —\n// an operator was told a CRITICAL application suspension had taken effect while the application\n// kept serving. Removed 2026-08-01, on grounds that compound with TRANSFER's:\n//\n// 1. NO FIELD TO WRITE — and no plausible one. `ApplicationSchema` is\n// `{_id, appSlug, appDisplayName, lastVersion, platformAppId}`: an identity row, carrying no\n// lifecycle state at all. There is nothing to transition.\n// 2. THE LIFECYCLE IS OWNED ONE TIER UP. An application's real operational state lives at the\n// platform tier (`PLATFORM_APPLICATIONS` / `Wildo_Application_Config`), provisioned and\n// managed by the platform apps-manager. This row is the in-app registry entry an application\n// reads to know its own identity — halting an application is a platform-tier action, not a\n// self-service field flip on the application's own copy of its name.\n// 3. SAME INVERTED OWNERSHIP AS TRANSFER (ground 3 above). `APPLICATION` is a top-level\n// `ResourcePrimaryScope`; suspending the tenant container from inside its own tenancy is\n// incoherent, and the suspending super-admin's own session lives in that container.\n//\n// The resource specification's framing — \"Created per org, managed by admins, and may be\n// transferred or suspended under governance\", with 409s for destination-org slug collisions —\n// describes a per-organization application marketplace. The framework does not implement one, and\n// inventing an `ApplicationStatus` to satisfy two unimplemented buttons would have built that\n// model backwards from its UI. Re-declaring these verbs requires the ownership model first.\n//\n// Applications consequently declare NO custom operations (hence the `undefined` custom-operation\n// type parameter below). See `.claude/plans/status-lifecycle-operations-analysis.md` and\n// `.claude/plans/routed-unimplemented-operations-fail-closed.md`.\n\nconst APPLICATION_SORT_FIELDS = ['appDisplayName', 'appSlug'];\n\nconst APPLICATION_FILTER_FIELDS = {\n appSlug: z.string(),\n appDisplayName: z.string(),\n};\n\ntype ApplicationCoreOperations =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.SEARCH\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\n/*\nApplications Resource Configuration Factory\n*/\nexport const applicationResourceConfiguration_InitializationFactory = (resourcesRelationships: ResourceRelationship[]) => createResourceConfiguration_Initialization<\n undefined,\n ApplicationCoreOperations,\n typeof ApplicationSchema\n>({\n mainSchema: ApplicationSchema,\n resourceIdentifier: CoreResourceType.APPLICATION,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.APPLICATION],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true, // Applications are core system resources\n\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.SEARCH,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE\n ],\n\n operationsConfiguration: {\n [CoreResourceOperation.CREATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can create applications\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n // Use database definition so platformAppId and lastVersion are preserved\n // requestDto auto-derived from decorators\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can create applications for any org\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE,\n channel: CoreUserNotificationChannel.EMAIL,\n },\n {\n target: CoreUserNotificationTarget.USER_SELF,\n channel: CoreUserNotificationChannel.FRONT_END_SUCCESS,\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 applications\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can view any application\n riskLevel: ResourceOperationRiskLevel.LOW,\n }\n ]\n },\n\n /**\n * ⚠️ NOTHING CONFINES THIS QUERY — and that is safe for a reason worth stating, because the\n * comment on the default variant used to imply a mechanism that does not exist.\n *\n * `applications` is its own scope ROOT, so both repositories blacklist the APPLICATIONS axis and\n * this LIST compiles to the EMPTY filter (measured 2026-08-12,\n * `base-classes/__tests__/scope-root-collection-confinement.probe.test.ts`, RESIDUAL sweep). The\n * old wording — \"Org members can list *their* applications\" — is exactly the shape of the claim\n * that was FALSE on `organizations` and cost a full tenant-isolation investigation, one role tier\n * higher.\n *\n * What makes it safe here is ARCHITECTURE, not a predicate: **one database per application.**\n * \"An application's organizations live in that application's own database\"\n * (`organizations.shared.schemas.ts`, on `slug` uniqueness), so this collection holds that\n * application's own row and a caller can only ever see the application they are already using.\n * Measured: an ordinary `ORG_MEMBER` receives 1 of 1 rows, projected to four summary fields.\n *\n * So the two variants below differ in ROLE, not in reach — `admin` exists for the fields and\n * operations it unlocks elsewhere, not because it sees more rows here.\n *\n * ⚠️ This rests on the one-database-per-application invariant. `CREATE` is super-admin gated, so\n * a second application row COULD be written into this database; if that ever becomes a real\n * deployment shape, this resource inherits the `organizations` defect at the `ORG_MEMBER` tier\n * and must be confined on `initiatorIds.applicationId`. Tracked as SEC-SCOPEROOT-3.\n */\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_MEMBER], // Unconfined by construction; safe because the collection holds this application only — see the block above\n riskLevel: ResourceOperationRiskLevel.LOW,\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can list all applications\n riskLevel: ResourceOperationRiskLevel.LOW,\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\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: ['name', 'description'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 50,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n isSearchable: true,\n searchableFields: ['name', 'description', 'slug'],\n searchableOptions: { caseSensitive: false, fullMatchOnly: false },\n filterFields: APPLICATION_FILTER_FIELDS,\n sortFields: APPLICATION_SORT_FIELDS,\n maxPaginatedResultPerPageLimit: 100,\n }\n ]\n },\n\n [CoreResourceOperation.UPDATE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can update their applications\n riskLevel: ResourceOperationRiskLevel.LOW,\n // requestDto auto-derived from decorators\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can update any application\n riskLevel: ResourceOperationRiskLevel.LOW,\n // requestDto auto-derived from decorators\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n },\n\n [CoreResourceOperation.DELETE]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_ADMIN], // Org admins can delete their applications\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n // An APPLICATION is a top-level scope in this framework, not an org-owned artifact, so\n // deleting one destroys everything scoped beneath it. Same reasoning as\n // `ORGANIZATIONS | DELETE`: `riskLevel` is UI-only and the per-user-type `stepUpAuth`\n // policy is opt-in, off by default, and freshness-satisfied — neither challenges the\n // caller here. Re-authentication itself accepts PASSWORD, an enrolled second factor\n // (TOTP or a backup code) and PASSKEY, so a directory-managed user whose local first\n // factor the framework destroys can still clear the gate through their second factor;\n // see the note on `ORGANIZATIONS | DELETE` for how that came about.\n //\n // assurance-control: WILDO.IDENTITY.STEP_UP_AUTHENTICATION — re-authentication before a high-impact action.\n requiresStepUpAuthentication: true,\n },\n {\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: false,\n variantKey: \"admin\",\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN], // Super admins can delete any application\n riskLevel: ResourceOperationRiskLevel.HIGH,\n // Per-VARIANT flag — nothing is inherited from the default variant above.\n requiresStepUpAuthentication: true,\n }\n ],\n userNotifications: [\n {\n target: CoreUserNotificationTarget.ORGANIZATION_ADMINISTRATIVE,\n channel: CoreUserNotificationChannel.EMAIL,\n }\n ]\n }\n },\n\n});\n"]}
@@ -41,5 +41,5 @@ export declare const BillingAccount_OpenPortalRequestDto: z.ZodObject<{
41
41
  * - organizationBillingAccounts
42
42
  * - userBillingAccounts
43
43
  */
44
- export declare const billingAccountsPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<typeof BillingAccount_Operations, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
44
+ export declare const billingAccountsPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<typeof BillingAccount_Operations, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY | CoreResourceOperation.DELETE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
45
45
  //# sourceMappingURL=billing-account.shared.resources-config.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing-account.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAezG,oBAAY,yBAAyB;IACnC,wEAAwE;IACxE,aAAa,kBAAkB;IAC/B,kEAAkE;IAClE,WAAW,gBAAgB;IAC3B,6FAA6F;IAC7F,SAAS,cAAc;CACxB;AAID,8CAA8C;AAC9C,eAAO,MAAM,qCAAqC;;;;;;;;;iBAqChD,CAAC;AAEH,4CAA4C;AAC5C,eAAO,MAAM,mCAAmC;;iBAE9C,CAAC;AAMH;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC,uQA2J/C,CAAC"}
1
+ {"version":3,"file":"billing-account.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAgBzG,oBAAY,yBAAyB;IACnC,wEAAwE;IACxE,aAAa,kBAAkB;IAC/B,kEAAkE;IAClE,WAAW,gBAAgB;IAC3B,6FAA6F;IAC7F,SAAS,cAAc;CACxB;AAID,8CAA8C;AAC9C,eAAO,MAAM,qCAAqC;;;;;;;;;iBAqChD,CAAC;AAEH,4CAA4C;AAC5C,eAAO,MAAM,mCAAmC;;iBAE9C,CAAC;AAMH;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC,2SAiM/C,CAAC"}
@@ -17,6 +17,7 @@ import { BILLING_CHECKOUT_MAX_QUANTITY, BILLING_RESERVED_METADATA_KEY_PREFIX } f
17
17
  import { billingAccountsPolymorphicDeclaration } from './billing-account.shared.schemas.js';
18
18
  import { BillingStateResponseSchema } from './billing-types.shared.schemas.js';
19
19
  import { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas.js';
20
+ import { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas.js';
20
21
  // ── Custom Operations ────────────────────────────────────────────────
21
22
  export var BillingAccount_Operations;
22
23
  (function (BillingAccount_Operations) {
@@ -105,6 +106,24 @@ export const billingAccountsPolymorphicFactories = createPolymorphicResourceConf
105
106
  list: ResourceSystemAccessMode.ALLOWED,
106
107
  },
107
108
  portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },
109
+ /**
110
+ * Subject erasure RETAINS this row and scrubs the provider customer id.
111
+ *
112
+ * The financial record is kept for the tax/audit obligation this family exists to serve, and — as the
113
+ * family's authoring rule states — erasure scrubs the linked USER rather than these rows, because the
114
+ * person is a foreign key. `providerCustomerId` is the exception the rule does not cover: it is a stable
115
+ * handle that re-identifies the person INSIDE the payment provider, so it is personal data this row holds.
116
+ * It takes `REMOVE`; everything else is retained.
117
+ */
118
+ retentionPolicy: {
119
+ mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,
120
+ },
121
+ /**
122
+ * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR the
123
+ * record belongs to — and the enum prescribes `NO_PRINCIPAL` for exactly that shape. The subject's own
124
+ * session ends through the `USERS` row, which is `SELF_PRINCIPAL`.
125
+ */
126
+ dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },
108
127
  customOperation: BillingAccount_Operations,
109
128
  coreOperations: [
110
129
  CoreResourceOperation.READ,
@@ -112,8 +131,25 @@ export const billingAccountsPolymorphicFactories = createPolymorphicResourceConf
112
131
  CoreResourceOperation.CREATE,
113
132
  CoreResourceOperation.UPDATE,
114
133
  CoreResourceOperation.DELETE,
134
+ // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.
135
+ CoreResourceOperation.UPDATE_MANY,
115
136
  ],
116
137
  operationsConfiguration: {
138
+ /*
139
+ * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it
140
+ * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,
141
+ * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the
142
+ * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the
143
+ * verb the impersonalize writer uses to stamp the retention markers.
144
+ */
145
+ [CoreResourceOperation.UPDATE_MANY]: {
146
+ variants: [{
147
+ variantType: ResourceOperationVariantType.INTERNAL_CALL,
148
+ isDefault: true,
149
+ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
150
+ riskLevel: ResourceOperationRiskLevel.CRITICAL,
151
+ }],
152
+ },
117
153
  [CoreResourceOperation.READ]: {
118
154
  variants: [{
119
155
  // API_CALL: the billing account is a user-facing record (Settings Hub → Billing →
@@ -1 +1 @@
1
- {"version":3,"file":"billing-account.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,qCAAqC,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAEhG,wEAAwE;AAExE,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,wEAAwE;IACxE,4DAA+B,CAAA;IAC/B,kEAAkE;IAClE,wDAA2B,CAAA;IAC3B,6FAA6F;IAC7F,oDAAuB,CAAA;AACzB,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC;AAED,wEAAwE;AAExE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE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CAAC,IAAI;oBACjD,UAAU,EAAE,mCAAmC;oBAC/C,kEAAkE;oBAClE,kDAAkD;oBAClD,iBAAiB,EAAE,CAAC,CAAC,MAAM,CAAC;wBAC1B,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE;qBACb,CAAC;iBACH,CAAC;SACH;QACD,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE;YACrC,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,KAAK;oBAClD,sEAAsE;oBACtE,sEAAsE;oBACtE,sEAAsE;oBACtE,sDAAsD;oBACtD,iBAAiB,EAAE,0BAA0B;iBAC9C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Billing Account Resource Configuration — Polymorphic\n *\n * Produces 3 factory functions (one per scope variant) via the polymorphic factory.\n * Spread into the registry factory map:\n * ...billingAccountsPolymorphicFactories\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { BILLING_CHECKOUT_MAX_QUANTITY, BILLING_RESERVED_METADATA_KEY_PREFIX } from './billing-enums.shared.schemas';\nimport { billingAccountsPolymorphicDeclaration } from './billing-account.shared.schemas';\nimport { BillingStateResponseSchema } from './billing-types.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum BillingAccount_Operations {\n /** Create a Stripe Checkout Session for the user to complete payment */\n OPEN_CHECKOUT = 'open_checkout',\n /** Open the Stripe Customer Portal for self-service management */\n OPEN_PORTAL = 'open_portal',\n /** Fetch aggregated billing state (account, subscription, products, prices, credit pools) */\n GET_STATE = 'get_state',\n}\n\n// ── Request DTOs ─────────────────────────────────────────────────────\n\n/** Request DTO for OPEN_CHECKOUT operation */\nexport const BillingAccount_OpenCheckoutRequestDto = z.object({\n productKey: z.string().min(1),\n priceId: z.string().min(1),\n successUrl: z.url(),\n cancelUrl: z.url(),\n /**\n * Bounded by the same constant the webhook consumer honours. An unbounded quantity here would be\n * billed by the provider and then refused on the way back in, charging the customer for credits\n * that never arrive.\n */\n quantity: z.number().int().min(1).max(BILLING_CHECKOUT_MAX_QUANTITY).default(1),\n trialDays: z.number().min(0).optional(),\n promotionCode: z.string().optional(),\n /**\n * Caller-supplied tags mirrored to the provider for the application's own analytics or\n * reconciliation. They carry NO authority.\n *\n * Keys in the framework-reserved namespace are REFUSED here rather than silently dropped: the\n * caller is trying to write into the namespace that decides which billing account gets credited\n * and by how much, and an app developer who typed a reserved key deserves to be told, not to\n * watch their tag vanish. Refusal at the DTO is the loud, outermost half of the boundary; the\n * builder's write-reserved-last ordering and the consumer's read-only-reserved rule are the two\n * structural halves. See {@link BILLING_RESERVED_METADATA_KEY_PREFIX}.\n *\n * The refinement sits on the KEY schema, not on the record: it keeps the DTO a plain `ZodRecord`\n * for the OpenAPI projector and the request-validation pipeline, where a wrapping effect would\n * change the node type every consumer of this DTO narrows on.\n */\n metadata: z\n .record(\n z.string().refine(\n (key) => !key.startsWith(BILLING_RESERVED_METADATA_KEY_PREFIX),\n `Metadata keys starting with \"${BILLING_RESERVED_METADATA_KEY_PREFIX}\" are reserved by the framework and cannot be supplied by the caller`,\n ),\n z.string(),\n )\n .optional(),\n});\n\n/** Request DTO for OPEN_PORTAL operation */\nexport const BillingAccount_OpenPortalRequestDto = z.object({\n returnUrl: z.url(),\n});\n\n// =============================================================================\n// POLYMORPHIC FACTORY — 2 variants (org, user)\n// =============================================================================\n\n/**\n * Polymorphic factory map for billing accounts.\n * Spread into `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...billingAccountsPolymorphicFactories\n *\n * Produces entries for:\n * - organizationBillingAccounts\n * - userBillingAccounts\n */\nexport const billingAccountsPolymorphicFactories = createPolymorphicResourceConfigurations(\n billingAccountsPolymorphicDeclaration,\n {\n isSystemResource: true,\n // System-context CREATE opt-in (fail-closed default is FORBIDDEN). The billing\n // account is auto-created by `BillingStateBackendService.getState()` on first\n // access via `SystemAccessBackendService.createAsSystem` — a trusted in-process\n // write with no HTTP surface and no request context to seed the scope FK. That\n // path relocates the ACL onto the billing service (which has already resolved\n // the scope) and injects the scope FK (`organizationId` / `userId`) through the\n // execution context map. Resource-level and shared by BOTH scope variants\n // (org + user) per the polymorphic-resource contract on ResourceSystemAccessPolicy.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own billing account. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n // System-context LIST opt-in. Subject erasure must enumerate the erased person's billing\n // accounts to reach their provider customer (cancel subscriptions, anonymize, detach payment\n // methods). That runs with no request context — the subject is being erased — so it reads\n // through `SystemAccessBackendService.listAsSystem`, which is fail-closed and refuses a\n // resource that has not opted in here.\n //\n // Safe to grant: LIST is the READ side, and the erasure path filters by the subject's own\n // scope FK. The default LIST variant is API_CALL, so it resolves through\n // `getServiceOperationPathDefault` — a REPOSITORY_ONLY-only LIST would pass this grant and\n // then fail to resolve at erasure time, which is the failure mode this comment exists to\n // stop someone from reintroducing.\n list: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n customOperation: BillingAccount_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n // API_CALL: the billing account is a user-facing record (Settings Hub → Billing →\n // Account, and the resource presets' LIST/READ views). REPOSITORY_ONLY would strip\n // the op from the frontend registry and register no HTTP route. Writes (auto-create\n // + webhook sync) are INTERNAL_CALL — run through the service pipeline, no HTTP surface.\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n [BillingAccount_Operations.OPEN_CHECKOUT]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingAccount_OpenCheckoutRequestDto,\n // Borrows UPDATE for its route/verb but returns the provider checkout\n // session, NOT the billing-account resource. Without this the DTO builder\n // would validate the service output against the resource schema and 500.\n customResponseDto: z.object({\n url: z.url(),\n sessionId: z.string(),\n }),\n }],\n },\n [BillingAccount_Operations.OPEN_PORTAL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.READ,\n requestDto: BillingAccount_OpenPortalRequestDto,\n // Borrows READ for its route/verb but returns the provider portal\n // redirect URL, NOT the billing-account resource.\n customResponseDto: z.object({\n url: z.url(),\n }),\n }],\n },\n [BillingAccount_Operations.GET_STATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.COUNT,\n // Borrows COUNT for its route/verb but returns the aggregated billing\n // state bundle, NOT a `{ count }`. Without this the DTO builder would\n // assign the COUNT default envelope and the service output would fail\n // `transformOutput`'s `internalDto.parse` → HTTP 500.\n customResponseDto: BillingStateResponseSchema,\n }],\n },\n },\n },\n);\n"]}
1
+ {"version":3,"file":"billing-account.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AACzG,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uCAAuC,EAAE,MAAM,kDAAkD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,qCAAqC,EAAE,MAAM,kCAAkC,CAA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C;oBACT,WAAW,EAAE,4BAA4B,CAAC,QAAQ;oBAClD,SAAS,EAAE,IAAI;oBACf,eAAe,EAAE;wBACf,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,EAAE,cAAc,CAAC,SAAS,CAAC;wBACtF,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC;qBACpD;oBACD,SAAS,EAAE,0BAA0B,CAAC,GAAG;oBACzC,qBAAqB,EAAE,qBAAqB,CAAC,KAAK;oBAClD,sEAAsE;oBACtE,sEAAsE;oBACtE,sEAAsE;oBACtE,sDAAsD;oBACtD,iBAAiB,EAAE,0BAA0B;iBAC9C,CAAC;SACH;KACF;CACF,CACF,CAAC","sourcesContent":["/**\n * Billing Account Resource Configuration — Polymorphic\n *\n * Produces 3 factory functions (one per scope variant) via the polymorphic factory.\n * Spread into the registry factory map:\n * ...billingAccountsPolymorphicFactories\n *\n * @see polymorphic-scope-approach-A-expansion.md — Phase 3\n */\n\nimport { z } from 'zod';\nimport { CoreResourceOperation, CoreResourceType } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n} from '../resources/resources.shared.schemas';\nimport { ResourceSystemAccessMode } from '../resources/resources-config.shared.schemas';\nimport { createPolymorphicResourceConfigurations } from '../resources/utils/resource-polymorphism.factory';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { BILLING_CHECKOUT_MAX_QUANTITY, BILLING_RESERVED_METADATA_KEY_PREFIX } from './billing-enums.shared.schemas';\nimport { billingAccountsPolymorphicDeclaration } from './billing-account.shared.schemas';\nimport { BillingStateResponseSchema } from './billing-types.shared.schemas';\nimport { DataPortabilityProvenance } from '../compliance/privacy/subject-export.shared.schemas';\nimport { ErasureRetentionMode, ResourceDataSubjectKind } from '../compliance/privacy/impersonalization.shared.schemas';\n\n// ── Custom Operations ────────────────────────────────────────────────\n\nexport enum BillingAccount_Operations {\n /** Create a Stripe Checkout Session for the user to complete payment */\n OPEN_CHECKOUT = 'open_checkout',\n /** Open the Stripe Customer Portal for self-service management */\n OPEN_PORTAL = 'open_portal',\n /** Fetch aggregated billing state (account, subscription, products, prices, credit pools) */\n GET_STATE = 'get_state',\n}\n\n// ── Request DTOs ─────────────────────────────────────────────────────\n\n/** Request DTO for OPEN_CHECKOUT operation */\nexport const BillingAccount_OpenCheckoutRequestDto = z.object({\n productKey: z.string().min(1),\n priceId: z.string().min(1),\n successUrl: z.url(),\n cancelUrl: z.url(),\n /**\n * Bounded by the same constant the webhook consumer honours. An unbounded quantity here would be\n * billed by the provider and then refused on the way back in, charging the customer for credits\n * that never arrive.\n */\n quantity: z.number().int().min(1).max(BILLING_CHECKOUT_MAX_QUANTITY).default(1),\n trialDays: z.number().min(0).optional(),\n promotionCode: z.string().optional(),\n /**\n * Caller-supplied tags mirrored to the provider for the application's own analytics or\n * reconciliation. They carry NO authority.\n *\n * Keys in the framework-reserved namespace are REFUSED here rather than silently dropped: the\n * caller is trying to write into the namespace that decides which billing account gets credited\n * and by how much, and an app developer who typed a reserved key deserves to be told, not to\n * watch their tag vanish. Refusal at the DTO is the loud, outermost half of the boundary; the\n * builder's write-reserved-last ordering and the consumer's read-only-reserved rule are the two\n * structural halves. See {@link BILLING_RESERVED_METADATA_KEY_PREFIX}.\n *\n * The refinement sits on the KEY schema, not on the record: it keeps the DTO a plain `ZodRecord`\n * for the OpenAPI projector and the request-validation pipeline, where a wrapping effect would\n * change the node type every consumer of this DTO narrows on.\n */\n metadata: z\n .record(\n z.string().refine(\n (key) => !key.startsWith(BILLING_RESERVED_METADATA_KEY_PREFIX),\n `Metadata keys starting with \"${BILLING_RESERVED_METADATA_KEY_PREFIX}\" are reserved by the framework and cannot be supplied by the caller`,\n ),\n z.string(),\n )\n .optional(),\n});\n\n/** Request DTO for OPEN_PORTAL operation */\nexport const BillingAccount_OpenPortalRequestDto = z.object({\n returnUrl: z.url(),\n});\n\n// =============================================================================\n// POLYMORPHIC FACTORY — 2 variants (org, user)\n// =============================================================================\n\n/**\n * Polymorphic factory map for billing accounts.\n * Spread into `coreShared_ResourcesConfigurations_FactoryMap`:\n * ...billingAccountsPolymorphicFactories\n *\n * Produces entries for:\n * - organizationBillingAccounts\n * - userBillingAccounts\n */\nexport const billingAccountsPolymorphicFactories = createPolymorphicResourceConfigurations(\n billingAccountsPolymorphicDeclaration,\n {\n isSystemResource: true,\n // System-context CREATE opt-in (fail-closed default is FORBIDDEN). The billing\n // account is auto-created by `BillingStateBackendService.getState()` on first\n // access via `SystemAccessBackendService.createAsSystem` — a trusted in-process\n // write with no HTTP surface and no request context to seed the scope FK. That\n // path relocates the ACL onto the billing service (which has already resolved\n // the scope) and injects the scope FK (`organizationId` / `userId`) through the\n // execution context map. Resource-level and shared by BOTH scope variants\n // (org + user) per the polymorphic-resource contract on ResourceSystemAccessPolicy.\n systemAccessPolicy: {\n // Subject-export disclosure. The subject's own billing account. Secrets and backend-only values are withheld by the export's security floor regardless of this grant. On a polymorphic resource this grant applies to EVERY generated variant, which is the documented intent of the shared config.\n exportSubject: ResourceSystemAccessMode.ALLOWED,\n create: ResourceSystemAccessMode.ALLOWED,\n // System-context LIST opt-in. Subject erasure must enumerate the erased person's billing\n // accounts to reach their provider customer (cancel subscriptions, anonymize, detach payment\n // methods). That runs with no request context — the subject is being erased — so it reads\n // through `SystemAccessBackendService.listAsSystem`, which is fail-closed and refuses a\n // resource that has not opted in here.\n //\n // Safe to grant: LIST is the READ side, and the erasure path filters by the subject's own\n // scope FK. The default LIST variant is API_CALL, so it resolves through\n // `getServiceOperationPathDefault` — a REPOSITORY_ONLY-only LIST would pass this grant and\n // then fail to resolve at erasure time, which is the failure mode this comment exists to\n // stop someone from reintroducing.\n list: ResourceSystemAccessMode.ALLOWED,\n },\n portabilityPolicy: { defaultProvenance: DataPortabilityProvenance.OBSERVED },\n\n /**\n * Subject erasure RETAINS this row and scrubs the provider customer id.\n *\n * The financial record is kept for the tax/audit obligation this family exists to serve, and — as the\n * family's authoring rule states — erasure scrubs the linked USER rather than these rows, because the\n * person is a foreign key. `providerCustomerId` is the exception the rule does not cover: it is a stable\n * handle that re-identifies the person INSIDE the payment provider, so it is personal data this row holds.\n * It takes `REMOVE`; everything else is retained.\n */\n retentionPolicy: {\n mode: ErasureRetentionMode.RETAIN_AND_IMPERSONALIZE,\n },\n\n /**\n * Erasing one of these rows revokes NO session. The row is not a person — its owner FK names the ACTOR the\n * record belongs to — and the enum prescribes `NO_PRINCIPAL` for exactly that shape. The subject's own\n * session ends through the `USERS` row, which is `SELF_PRINCIPAL`.\n */\n dataSubjectPolicy: { kind: ResourceDataSubjectKind.NO_PRINCIPAL },\n customOperation: BillingAccount_Operations,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n CoreResourceOperation.DELETE,\n // Route-less; `retentionPolicy` requires READ + LIST + UPDATE_MANY.\n CoreResourceOperation.UPDATE_MANY,\n ],\n operationsConfiguration: {\n /*\n * Route-less retention plumbing — INTERNAL_CALL registers no route, so no API surface is added, and it\n * must not be REPOSITORY_ONLY: the retention primitives resolve through `getServiceOperationPathDefault`,\n * which matches only INTERNAL_CALL / API_CALL. LIST is LOW (a read-shaped op may not claim the\n * HIGH/CRITICAL band, which carries an audit-emission obligation); UPDATE_MANY is CRITICAL — it is the\n * verb the impersonalize writer uses to stamp the retention markers.\n */\n [CoreResourceOperation.UPDATE_MANY]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n\n [CoreResourceOperation.READ]: {\n variants: [{\n // API_CALL: the billing account is a user-facing record (Settings Hub → Billing →\n // Account, and the resource presets' LIST/READ views). REPOSITORY_ONLY would strip\n // the op from the frontend registry and register no HTTP route. Writes (auto-create\n // + webhook sync) are INTERNAL_CALL — run through the service pipeline, no HTTP surface.\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.CRITICAL,\n }],\n },\n [BillingAccount_Operations.OPEN_CHECKOUT]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.HIGH,\n resourceOperationLike: CoreResourceOperation.UPDATE,\n requestDto: BillingAccount_OpenCheckoutRequestDto,\n // Borrows UPDATE for its route/verb but returns the provider checkout\n // session, NOT the billing-account resource. Without this the DTO builder\n // would validate the service output against the resource schema and 500.\n customResponseDto: z.object({\n url: z.url(),\n sessionId: z.string(),\n }),\n }],\n },\n [BillingAccount_Operations.OPEN_PORTAL]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.READ,\n requestDto: BillingAccount_OpenPortalRequestDto,\n // Borrows READ for its route/verb but returns the provider portal\n // redirect URL, NOT the billing-account resource.\n customResponseDto: z.object({\n url: z.url(),\n }),\n }],\n },\n [BillingAccount_Operations.GET_STATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n polymorphicRole: {\n [CoreResourceType.ORGANIZATIONS]: [CORE_ORG_ROLES.ORG_OWNER, CORE_ORG_ROLES.ORG_ADMIN],\n [CoreResourceType.USERS]: [CORE_APP_ROLES.APP_USER],\n },\n riskLevel: ResourceOperationRiskLevel.LOW,\n resourceOperationLike: CoreResourceOperation.COUNT,\n // Borrows COUNT for its route/verb but returns the aggregated billing\n // state bundle, NOT a `{ count }`. Without this the DTO builder would\n // assign the COUNT default envelope and the service output would fail\n // `transformOutput`'s `internalDto.parse` → HTTP 500.\n customResponseDto: BillingStateResponseSchema,\n }],\n },\n },\n },\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"billing-account.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAA6B,KAAK,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAOhI;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,4BAA4B,EAGhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,oBAAoB,EAGzD,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,uCAAuC,EAAE,oBAAoB,EAWzE,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBA0CnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;kBAMhD,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;;;;;;iBAA2B,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"billing-account.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAA6B,KAAK,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAShI;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,4BAA4B,EAGhE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,EAAE,oBAAoB,EAGzD,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,uCAAuC,EAAE,oBAAoB,EAWzE,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBAkDnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC;;;;;;;;kBAMhD,CAAC;AAMH,eAAO,MAAM,oBAAoB;;;;;;;;iBAA2B,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -23,6 +23,8 @@ import { PersonalDataCategory } from '../compliance/privacy/personal-data-catego
23
23
  import { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions.js';
24
24
  import { declarePolymorphicSchemas } from '../resources/utils/resource-polymorphism.schemas.js';
25
25
  import { BillingScopeType } from './billing-enums.shared.schemas.js';
26
+ import { RedactionType } from '../compliance/privacy/redaction.shared.schemas.js';
27
+ import { addImpersonalizeWith } from '@wildo-ai/zod-decorators';
26
28
  // =============================================================================
27
29
  // SHARED VARIANT DEFINITIONS
28
30
  // =============================================================================
@@ -101,7 +103,12 @@ export const BillingAccountBaseSchema = z.object({
101
103
  // hypothetical user-only variant would UNDER-report, which is the silent failure a notice must
102
104
  // never make; declaring on both at worst tells a reader the operator holds financial data, which
103
105
  // it does. The same note applies to the invoice, usage, credit-pool and subscription siblings.
104
- providerCustomerId: z.string().optional().isBackendOnly().dataCategories(PersonalDataCategory.FINANCIAL),
106
+ // REMOVE on erasure. This is the person's identifier AT THE PAYMENT PROVIDER — a stable handle that
107
+ // re-identifies them in a system we do not own, which is personal data this row HOLDS rather than a
108
+ // link it merely carries. The provider-side customer is retired by the billing subject-erasure
109
+ // external effect, so keeping the id afterwards would leave a dangling pointer at a deleted person.
110
+ // Clearable: the field is `.optional()`, so REMOVE resolves to a removed key rather than a rejected null.
111
+ providerCustomerId: addImpersonalizeWith(z.string().optional().isBackendOnly().dataCategories(PersonalDataCategory.FINANCIAL), RedactionType.REMOVE),
105
112
  /** Which provider (e.g., 'stripe') */
106
113
  providerRef: z.string().optional().isBackendOnly(),
107
114
  /** Status */
@@ -1 +1 @@
1
- {"version":3,"file":"billing-account.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,yBAAyB,EAAqC,MAAM,kDAAkD,CAAC;AAChI,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAmC;IACpE,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,aAAa,EAAE,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE;IACvK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,KAAK,EAAU,qBAAqB,EAAE,kCAAkC,C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,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE;IAElD,aAAa;IACb,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IAElE;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACrF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC;AAGH,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,yBAAyB,CAAC;IAC7E,gBAAgB,EAAE,iBAAiB;IACnC,mBAAmB,EAAE,kBAAkB;IACvC,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,wBAAwB;IACpC,QAAQ,EAAE,sBAAsB;CACjC,CAAC,CAAC;AAEH,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC","sourcesContent":["/**\n * Billing Account Schema (Shared) — Polymorphic\n *\n * BillingAccount is the PURE SCOPE BRIDGE between a Wildo entity and the billing provider.\n *\n * POLYMORPHIC EXPANSION: The base schema does NOT contain identity scope fields\n * (organizationId, userId). These are injected per variant by\n * `declarePolymorphicSchemas()`, producing 2 concrete resources:\n * - organizationBillingAccounts (with organizationId)\n * - userBillingAccounts (with userId)\n *\n * DELEGATION PRINCIPLE: All customer details (contact info, billing address, tax IDs,\n * payment methods) are managed by the provider. BillingAccount stores ONLY:\n * 1. The provider reference (which provider customer this maps to)\n * 2. Status\n * The scope reference is the injected identity FK.\n *\n * @see polymorphic-scope-approach-A-expansion.md\n * @see billing-and-features-system.md §6.1 (Core Design)\n */\n\nimport { z } from 'zod';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport type { PolymorphicFkVariant } from '@wildo-ai/zod-decorators';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { declarePolymorphicSchemas, type PolymorphicVariantDefinition } from '../resources/utils/resource-polymorphism.schemas';\nimport { BillingScopeType } from './billing-enums.shared.schemas';\n\n// =============================================================================\n// SHARED VARIANT DEFINITIONS\n// =============================================================================\n\n/**\n * The 2 billing scope variants — shared across BillingAccounts, Subscriptions, and children.\n * Centralised here to avoid repetition (DX concern from plan remarks #1).\n */\nexport const BILLING_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n];\n\n/**\n * FK variant definitions for child resources referencing polymorphic billing accounts.\n * Used on `billingAccountId` fields as: `.isForeignKey({ polymorphicVariants: BILLING_SCOPE_FK_VARIANTS })`\n *\n * This tells the polymorphic engine to rename `billingAccountId` per variant:\n * - organizations → `organizationBillingAccountId`\n * - users → `userBillingAccountId`\n */\nexport const BILLING_SCOPE_FK_VARIANTS: PolymorphicFkVariant[] = BILLING_SCOPE_VARIANTS.map(v => ({\n parentResourceType: v.parentResourceType,\n parentFieldIdentifier: v.parentFieldIdentifier,\n}));\n\n/**\n * FK variant definitions for a SHARED-FIELD DISCRIMINATED polymorphic\n * billing-account FK — e.g. a referral's `referrerBillingAccountId`, a single\n * column on the flat `referrals` resource that points at EITHER a user OR an\n * organization billing account, with the branch chosen PER RECORD by a sibling\n * `*ScopeType` field.\n *\n * Same scope branches as {@link BILLING_SCOPE_FK_VARIANTS}, but each variant\n * additionally carries the `discriminatorValue` ({@link BillingScopeType}) that\n * the holder record's discriminator field uses to select the branch. Declare as:\n *\n * ```ts\n * referrerBillingAccountId: z.string().min(1).isForeignKey({\n * polymorphicVariants: BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS,\n * polymorphicDiscriminatorField: 'referrerScopeType',\n * })\n * ```\n *\n * Contrast with {@link BILLING_SCOPE_FK_VARIANTS} (rename-only, used when the\n * HOLDER is itself polymorphically expanded). The branch TARGET is resolved at\n * runtime via the scope bridge: `discriminatorValue` selects the variant, whose\n * `parentResourceType` scope root matches the branch's `resourcePrimaryScope`.\n */\nexport const BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS: PolymorphicFkVariant[] = [\n {\n parentResourceType: CoreResourceType.ORGANIZATIONS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS],\n discriminatorValue: BillingScopeType.ORGANIZATIONS,\n },\n {\n parentResourceType: CoreResourceType.USERS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS],\n discriminatorValue: BillingScopeType.USER_SELF,\n },\n];\n\n// =============================================================================\n// BASE SCHEMA\n// =============================================================================\n\n/**\n * BillingAccount base schema — NO identity scope fields.\n * The polymorphic declaration injects the parent FK (organizationId / userId)\n * automatically per variant.\n */\nexport const BillingAccountBaseSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /** Provider sync - the ONLY provider-side reference we store */\n // ── FINANCIAL, and declared on the SHARED base rather than per scope variant ──\n //\n // This family is polymorphic: `userBillingAccounts` holds a person's billing relationship,\n // `organizationBillingAccounts` a company's, and both are built from this one schema. A category\n // declared here therefore reaches both, and that is the direction to err in — an organization on a\n // single-seat plan is one person, and the framework cannot tell which. Declaring only on a\n // hypothetical user-only variant would UNDER-report, which is the silent failure a notice must\n // never make; declaring on both at worst tells a reader the operator holds financial data, which\n // it does. The same note applies to the invoice, usage, credit-pool and subscription siblings.\n providerCustomerId: z.string().optional().isBackendOnly().dataCategories(PersonalDataCategory.FINANCIAL),\n /** Which provider (e.g., 'stripe') */\n providerRef: z.string().optional().isBackendOnly(),\n\n /** Status */\n isActive: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n /**\n * Open key-value bag for operational tagging (cost-centre, campaign ref, internal correlation id).\n *\n * ⚠️ **AUTHORING RULE — never store personal data here.** This row is RETAINED when its subject is\n * erased: the billing-retention decision keeps the financial record for tax/audit obligations, and\n * subject erasure scrubs the linked USER rather than these rows, because a billing row holds no\n * personal data of its own — the person is a foreign key. An open bag is the one place that\n * assumption can be broken by an app author, and nothing would catch it: the erasure scrub is\n * field-directed (`.impersonalizeWith()`), and it cannot reach inside an arbitrary record whose\n * keys it does not know.\n *\n * Concretely: no names, emails, phone numbers, addresses, free-text notes about a person, or\n * anything else that identifies one. Personal data written here SURVIVES an erasure — a compliance\n * breach that the retained label makes look intentional.\n *\n * Enforcement is deliberately NOT built (Q3, 2026-07-31): scrubbing these rows would require\n * hide/freeze to become separable from scrub — a real capability change with no current consumer.\n * Revisit only if an app is found using the bag this way.\n */\n metadata: z.record(z.string(), z.string()).optional(),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type BillingAccountBase = z.infer<typeof BillingAccountBaseSchema>;\n\n// =============================================================================\n// POLYMORPHIC DECLARATION\n// =============================================================================\n\n/**\n * Polymorphic declaration for BillingAccounts.\n * Produces 2 variants:\n * - organizations → organizationBillingAccounts (organizationId injected)\n * - users → userBillingAccounts (userId injected)\n */\nexport const billingAccountsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'billingAccounts',\n baseFieldIdentifier: 'billingAccountId',\n baseEnumKey: 'BILLING_ACCOUNTS',\n baseSchema: BillingAccountBaseSchema,\n variants: BILLING_SCOPE_VARIANTS,\n});\n\n// =============================================================================\n// EXPORTED SCHEMA & TYPE\n// =============================================================================\n\nexport const BillingAccountSchema = BillingAccountBaseSchema;\nexport type BillingAccount = z.infer<typeof BillingAccountBaseSchema>;\n"]}
1
+ {"version":3,"file":"billing-account.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-account.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AACtH,OAAO,EAAE,yBAAyB,EAAqC,MAAM,kDAAkD,CAAC;AAChI,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAmC;IACpE,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,aAAa,EAAE,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE;IACvK,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,KAAK,EAAU,qBAAqB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAU,cAAc,EAAE,IAAI,EAAE;CACxK,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA2B,sBA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E,CAAC,QAAQ,EAAE,CAAC,aAAa,EAAE;IAElD,aAAa;IACb,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IAElE;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;IACrF,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC,iBAAiB,EAAE;CACtF,CAAC,CAAC;AAGH,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,yBAAyB,CAAC;IAC7E,gBAAgB,EAAE,iBAAiB;IACnC,mBAAmB,EAAE,kBAAkB;IACvC,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,wBAAwB;IACpC,QAAQ,EAAE,sBAAsB;CACjC,CAAC,CAAC;AAEH,gFAAgF;AAChF,yBAAyB;AACzB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAC","sourcesContent":["/**\n * Billing Account Schema (Shared) — Polymorphic\n *\n * BillingAccount is the PURE SCOPE BRIDGE between a Wildo entity and the billing provider.\n *\n * POLYMORPHIC EXPANSION: The base schema does NOT contain identity scope fields\n * (organizationId, userId). These are injected per variant by\n * `declarePolymorphicSchemas()`, producing 2 concrete resources:\n * - organizationBillingAccounts (with organizationId)\n * - userBillingAccounts (with userId)\n *\n * DELEGATION PRINCIPLE: All customer details (contact info, billing address, tax IDs,\n * payment methods) are managed by the provider. BillingAccount stores ONLY:\n * 1. The provider reference (which provider customer this maps to)\n * 2. Status\n * The scope reference is the injected identity FK.\n *\n * @see polymorphic-scope-approach-A-expansion.md\n * @see billing-and-features-system.md §6.1 (Core Design)\n */\n\nimport { z } from 'zod';\nimport { PersonalDataCategory } from '../compliance/privacy/personal-data-category.shared.schemas';\nimport type { PolymorphicFkVariant } from '@wildo-ai/zod-decorators';\nimport { CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport { declarePolymorphicSchemas, type PolymorphicVariantDefinition } from '../resources/utils/resource-polymorphism.schemas';\nimport { BillingScopeType } from './billing-enums.shared.schemas';\nimport { RedactionType } from '../compliance/privacy/redaction.shared.schemas';\nimport { addImpersonalizeWith } from '@wildo-ai/zod-decorators';\n\n// =============================================================================\n// SHARED VARIANT DEFINITIONS\n// =============================================================================\n\n/**\n * The 2 billing scope variants — shared across BillingAccounts, Subscriptions, and children.\n * Centralised here to avoid repetition (DX concern from plan remarks #1).\n */\nexport const BILLING_SCOPE_VARIANTS: PolymorphicVariantDefinition[] = [\n { parentResourceType: CoreResourceType.ORGANIZATIONS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS], isPrimaryScope: true },\n { parentResourceType: CoreResourceType.USERS, parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS], isPrimaryScope: true },\n];\n\n/**\n * FK variant definitions for child resources referencing polymorphic billing accounts.\n * Used on `billingAccountId` fields as: `.isForeignKey({ polymorphicVariants: BILLING_SCOPE_FK_VARIANTS })`\n *\n * This tells the polymorphic engine to rename `billingAccountId` per variant:\n * - organizations → `organizationBillingAccountId`\n * - users → `userBillingAccountId`\n */\nexport const BILLING_SCOPE_FK_VARIANTS: PolymorphicFkVariant[] = BILLING_SCOPE_VARIANTS.map(v => ({\n parentResourceType: v.parentResourceType,\n parentFieldIdentifier: v.parentFieldIdentifier,\n}));\n\n/**\n * FK variant definitions for a SHARED-FIELD DISCRIMINATED polymorphic\n * billing-account FK — e.g. a referral's `referrerBillingAccountId`, a single\n * column on the flat `referrals` resource that points at EITHER a user OR an\n * organization billing account, with the branch chosen PER RECORD by a sibling\n * `*ScopeType` field.\n *\n * Same scope branches as {@link BILLING_SCOPE_FK_VARIANTS}, but each variant\n * additionally carries the `discriminatorValue` ({@link BillingScopeType}) that\n * the holder record's discriminator field uses to select the branch. Declare as:\n *\n * ```ts\n * referrerBillingAccountId: z.string().min(1).isForeignKey({\n * polymorphicVariants: BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS,\n * polymorphicDiscriminatorField: 'referrerScopeType',\n * })\n * ```\n *\n * Contrast with {@link BILLING_SCOPE_FK_VARIANTS} (rename-only, used when the\n * HOLDER is itself polymorphically expanded). The branch TARGET is resolved at\n * runtime via the scope bridge: `discriminatorValue` selects the variant, whose\n * `parentResourceType` scope root matches the branch's `resourcePrimaryScope`.\n */\nexport const BILLING_SCOPE_DISCRIMINATED_FK_VARIANTS: PolymorphicFkVariant[] = [\n {\n parentResourceType: CoreResourceType.ORGANIZATIONS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.ORGANIZATIONS],\n discriminatorValue: BillingScopeType.ORGANIZATIONS,\n },\n {\n parentResourceType: CoreResourceType.USERS,\n parentFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.USERS],\n discriminatorValue: BillingScopeType.USER_SELF,\n },\n];\n\n// =============================================================================\n// BASE SCHEMA\n// =============================================================================\n\n/**\n * BillingAccount base schema — NO identity scope fields.\n * The polymorphic declaration injects the parent FK (organizationId / userId)\n * automatically per variant.\n */\nexport const BillingAccountBaseSchema = z.object({\n _id: z.string().min(1).isPrimaryKey().isSummaryField(),\n\n /** Provider sync - the ONLY provider-side reference we store */\n // ── FINANCIAL, and declared on the SHARED base rather than per scope variant ──\n //\n // This family is polymorphic: `userBillingAccounts` holds a person's billing relationship,\n // `organizationBillingAccounts` a company's, and both are built from this one schema. A category\n // declared here therefore reaches both, and that is the direction to err in — an organization on a\n // single-seat plan is one person, and the framework cannot tell which. Declaring only on a\n // hypothetical user-only variant would UNDER-report, which is the silent failure a notice must\n // never make; declaring on both at worst tells a reader the operator holds financial data, which\n // it does. The same note applies to the invoice, usage, credit-pool and subscription siblings.\n // REMOVE on erasure. This is the person's identifier AT THE PAYMENT PROVIDER — a stable handle that\n // re-identifies them in a system we do not own, which is personal data this row HOLDS rather than a\n // link it merely carries. The provider-side customer is retired by the billing subject-erasure\n // external effect, so keeping the id afterwards would leave a dangling pointer at a deleted person.\n // Clearable: the field is `.optional()`, so REMOVE resolves to a removed key rather than a rejected null.\n providerCustomerId: addImpersonalizeWith(\n z.string().optional().isBackendOnly().dataCategories(PersonalDataCategory.FINANCIAL),\n RedactionType.REMOVE,\n ),\n /** Which provider (e.g., 'stripe') */\n providerRef: z.string().optional().isBackendOnly(),\n\n /** Status */\n isActive: z.boolean().default(true).isDBIndexed().isSummaryField(),\n\n /**\n * Open key-value bag for operational tagging (cost-centre, campaign ref, internal correlation id).\n *\n * ⚠️ **AUTHORING RULE — never store personal data here.** This row is RETAINED when its subject is\n * erased: the billing-retention decision keeps the financial record for tax/audit obligations, and\n * subject erasure scrubs the linked USER rather than these rows, because a billing row holds no\n * personal data of its own — the person is a foreign key. An open bag is the one place that\n * assumption can be broken by an app author, and nothing would catch it: the erasure scrub is\n * field-directed (`.impersonalizeWith()`), and it cannot reach inside an arbitrary record whose\n * keys it does not know.\n *\n * Concretely: no names, emails, phone numbers, addresses, free-text notes about a person, or\n * anything else that identifies one. Personal data written here SURVIVES an erasure — a compliance\n * breach that the retained label makes look intentional.\n *\n * Enforcement is deliberately NOT built (Q3, 2026-07-31): scrubbing these rows would require\n * hide/freeze to become separable from scrub — a real capability change with no current consumer.\n * Revisit only if an app is found using the bag this way.\n */\n metadata: z.record(z.string(), z.string()).optional(),\n createdAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n updatedAt: z.date().default(() => new Date()).excludeFromCreate().excludeFromUpdate(),\n});\nexport type BillingAccountBase = z.infer<typeof BillingAccountBaseSchema>;\n\n// =============================================================================\n// POLYMORPHIC DECLARATION\n// =============================================================================\n\n/**\n * Polymorphic declaration for BillingAccounts.\n * Produces 2 variants:\n * - organizations → organizationBillingAccounts (organizationId injected)\n * - users → userBillingAccounts (userId injected)\n */\nexport const billingAccountsPolymorphicDeclaration = declarePolymorphicSchemas({\n baseResourceType: 'billingAccounts',\n baseFieldIdentifier: 'billingAccountId',\n baseEnumKey: 'BILLING_ACCOUNTS',\n baseSchema: BillingAccountBaseSchema,\n variants: BILLING_SCOPE_VARIANTS,\n});\n\n// =============================================================================\n// EXPORTED SCHEMA & TYPE\n// =============================================================================\n\nexport const BillingAccountSchema = BillingAccountBaseSchema;\nexport type BillingAccount = z.infer<typeof BillingAccountBaseSchema>;\n"]}
@@ -13,10 +13,6 @@ import { TaxCalculationMode, TaxDisplayMode, ProrationBehavior, BillingTiming }
13
13
  export declare const BillingConfigurationSchema: z.ZodObject<{
14
14
  enabled: z.ZodDefault<z.ZodBoolean>;
15
15
  providerRef: z.ZodOptional<z.ZodString>;
16
- webhooks: z.ZodOptional<z.ZodObject<{
17
- path: z.ZodDefault<z.ZodString>;
18
- signingSecretRef: z.ZodOptional<z.ZodString>;
19
- }, z.core.$strip>>;
20
16
  defaultCurrency: z.ZodDefault<z.ZodUnion<[z.ZodEnum<typeof import("@wildo-ai/zod-decorators").AvailableCurrency>, z.ZodString]>>;
21
17
  supportedCurrencies: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodEnum<typeof import("@wildo-ai/zod-decorators").AvailableCurrency>, z.ZodString]>>>;
22
18
  tax: z.ZodDefault<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"billing-configuration.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACd,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4FrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"file":"billing-configuration.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACd,MAAM,gCAAgC,CAAC;AAExC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;iBAsIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}