@wildo-ai/saas-models 1.1.3 → 1.1.5

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 (890) hide show
  1. package/dist/esm/applications/application-metadata.shared.resources-config.schemas.d.ts +1 -1
  2. package/dist/esm/applications/application-versions.shared.resources-config.schemas.d.ts +1 -1
  3. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js +2 -2
  4. package/dist/esm/applications/application-versions.shared.resources-config.schemas.js.map +1 -1
  5. package/dist/esm/applications/applications-context.schemas.d.ts +236 -18
  6. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  7. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts +1 -0
  8. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  9. package/dist/esm/applications/applications.shared.resources-config.schemas.js +1 -1
  10. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  11. package/dist/esm/applications/applications.shared.schemas.d.ts +3 -2
  12. package/dist/esm/applications/applications.shared.schemas.d.ts.map +1 -1
  13. package/dist/esm/applications/applications.shared.schemas.js +40 -5
  14. package/dist/esm/applications/applications.shared.schemas.js.map +1 -1
  15. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -2
  16. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  17. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +1 -2
  18. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  19. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +87 -5
  20. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  21. package/dist/esm/billing/billing-enums.shared.schemas.js +91 -5
  22. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  23. package/dist/esm/billing/billing-types.shared.schemas.d.ts +25 -4
  24. package/dist/esm/billing/billing-types.shared.schemas.d.ts.map +1 -1
  25. package/dist/esm/billing/billing-types.shared.schemas.js +61 -0
  26. package/dist/esm/billing/billing-types.shared.schemas.js.map +1 -1
  27. package/dist/esm/billing/price.shared.resources-config.schemas.d.ts.map +1 -1
  28. package/dist/esm/billing/price.shared.resources-config.schemas.js +32 -2
  29. package/dist/esm/billing/price.shared.resources-config.schemas.js.map +1 -1
  30. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  31. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +1 -1
  32. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  33. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts.map +1 -1
  34. package/dist/esm/billing/product.shared.resources-config.schemas.js +32 -2
  35. package/dist/esm/billing/product.shared.resources-config.schemas.js.map +1 -1
  36. package/dist/esm/billing/product.shared.schemas.d.ts +1 -0
  37. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/product.shared.schemas.js +3 -0
  39. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  40. package/dist/esm/billing/promotions.shared.resources-config.schemas.d.ts.map +1 -1
  41. package/dist/esm/billing/promotions.shared.resources-config.schemas.js +33 -3
  42. package/dist/esm/billing/promotions.shared.resources-config.schemas.js.map +1 -1
  43. package/dist/esm/billing/referral.shared.resources-config.schemas.d.ts.map +1 -1
  44. package/dist/esm/billing/referral.shared.resources-config.schemas.js +22 -2
  45. package/dist/esm/billing/referral.shared.resources-config.schemas.js.map +1 -1
  46. package/dist/esm/billing/referral.shared.schemas.d.ts +1 -0
  47. package/dist/esm/billing/referral.shared.schemas.d.ts.map +1 -1
  48. package/dist/esm/billing/referral.shared.schemas.js +3 -0
  49. package/dist/esm/billing/referral.shared.schemas.js.map +1 -1
  50. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +23 -1
  51. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  52. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +48 -2
  53. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  54. package/dist/esm/billing/subscription.shared.schemas.d.ts +1 -0
  55. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  56. package/dist/esm/billing/subscription.shared.schemas.js +3 -0
  57. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  58. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts +49 -0
  59. package/dist/esm/billing/usage-flush-evidence.shared.schemas.d.ts.map +1 -0
  60. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js +48 -0
  61. package/dist/esm/billing/usage-flush-evidence.shared.schemas.js.map +1 -0
  62. package/dist/esm/billing/usage-record.shared.schemas.d.ts +1 -0
  63. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  64. package/dist/esm/billing/usage-record.shared.schemas.js +3 -0
  65. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  66. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +8 -0
  67. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  68. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +14 -3
  69. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  70. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +21 -7
  71. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -1
  72. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts +450 -0
  73. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.d.ts.map +1 -0
  74. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js +723 -0
  75. package/dist/esm/compliance/audit-trails/audit-export-projection.shared.schemas.js.map +1 -0
  76. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts +2 -2
  77. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +8 -0
  78. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  79. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +15 -0
  80. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  81. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +787 -21
  82. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  83. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +1079 -26
  84. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  85. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  86. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +51 -0
  87. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  88. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts +463 -0
  89. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.d.ts.map +1 -0
  90. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js +526 -0
  91. package/dist/esm/compliance/documents/governed-document-interactions.shared.schemas.js.map +1 -0
  92. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts +539 -15
  93. package/dist/esm/compliance/documents/governed-documents.shared.schemas.d.ts.map +1 -1
  94. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js +402 -14
  95. package/dist/esm/compliance/documents/governed-documents.shared.schemas.js.map +1 -1
  96. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts +18 -0
  97. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.d.ts.map +1 -0
  98. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js +89 -0
  99. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.resources-config.schemas.js.map +1 -0
  100. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts +47 -0
  101. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.d.ts.map +1 -0
  102. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js +73 -0
  103. package/dist/esm/compliance/documents/user-governed-document-acceptances.shared.schemas.js.map +1 -0
  104. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts +21 -0
  105. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.d.ts.map +1 -1
  106. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js +39 -1
  107. package/dist/esm/compliance/privacy/ai-use-posture.shared.schemas.js.map +1 -1
  108. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts +33 -0
  109. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.d.ts.map +1 -0
  110. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js +30 -0
  111. package/dist/esm/compliance/privacy/capability-consent-purposes.shared.utils.js.map +1 -0
  112. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts +6 -5
  113. package/dist/esm/compliance/privacy/client-storage.shared.schemas.d.ts.map +1 -1
  114. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js +15 -5
  115. package/dist/esm/compliance/privacy/client-storage.shared.schemas.js.map +1 -1
  116. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts +127 -0
  117. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.d.ts.map +1 -0
  118. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js +94 -0
  119. package/dist/esm/compliance/privacy/consent-gate-vocabulary.shared.schemas.js.map +1 -0
  120. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts +125 -0
  121. package/dist/esm/compliance/privacy/consent-purposes.shared.d.ts.map +1 -0
  122. package/dist/esm/compliance/privacy/consent-purposes.shared.js +136 -0
  123. package/dist/esm/compliance/privacy/consent-purposes.shared.js.map +1 -0
  124. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts +91 -0
  125. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.d.ts.map +1 -0
  126. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js +123 -0
  127. package/dist/esm/compliance/privacy/data-subject-rights.shared.schemas.js.map +1 -0
  128. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +27 -0
  129. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -1
  130. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +36 -2
  131. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -1
  132. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +68 -25
  133. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  134. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +74 -22
  135. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  136. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +9 -17
  137. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  138. package/dist/esm/compliance/privacy/privacy.shared.schemas.js +74 -31
  139. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  140. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts +47 -0
  141. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.d.ts.map +1 -0
  142. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js +98 -0
  143. package/dist/esm/compliance/privacy/subject-erasure-lane-evidence.shared.schemas.js.map +1 -0
  144. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts +368 -35
  145. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.d.ts.map +1 -1
  146. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js +403 -17
  147. package/dist/esm/compliance/privacy/subject-erasure.shared.schemas.js.map +1 -1
  148. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts +56 -0
  149. package/dist/esm/compliance/review-cadence.shared.schemas.d.ts.map +1 -0
  150. package/dist/esm/compliance/review-cadence.shared.schemas.js +71 -0
  151. package/dist/esm/compliance/review-cadence.shared.schemas.js.map +1 -0
  152. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts +161 -0
  153. package/dist/esm/compliance/risk-posture.shared.schemas.d.ts.map +1 -0
  154. package/dist/esm/compliance/risk-posture.shared.schemas.js +166 -0
  155. package/dist/esm/compliance/risk-posture.shared.schemas.js.map +1 -0
  156. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +4 -3
  157. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/config/analytics-value-moments.shared.schemas.js +4 -3
  159. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  160. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +222 -9
  161. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/config/app-configuration-shared.shared.schemas.js +232 -9
  163. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  164. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +75 -3
  165. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  166. package/dist/esm/config/auth-config-resolution.shared.utils.js +93 -4
  167. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  168. package/dist/esm/config/brand-assets.shared.schemas.d.ts +5 -4
  169. package/dist/esm/config/brand-assets.shared.schemas.d.ts.map +1 -1
  170. package/dist/esm/config/brand-assets.shared.schemas.js +14 -4
  171. package/dist/esm/config/brand-assets.shared.schemas.js.map +1 -1
  172. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +463 -19
  173. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  174. package/dist/esm/config/entity-identity-config.shared.schemas.js +535 -28
  175. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  176. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +14 -14
  177. package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts +139 -3
  178. package/dist/esm/config/frontend/chart-registration-alignment.shared.d.ts.map +1 -1
  179. package/dist/esm/config/frontend/chart-registration-alignment.shared.js +151 -4
  180. package/dist/esm/config/frontend/chart-registration-alignment.shared.js.map +1 -1
  181. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +21 -17
  182. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  183. package/dist/esm/config/frontend/navigation.shared.schemas.js +58 -40
  184. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  185. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts +90 -133
  186. package/dist/esm/config/frontend/onboarding.shared.schemas.d.ts.map +1 -1
  187. package/dist/esm/config/frontend/onboarding.shared.schemas.js +148 -100
  188. package/dist/esm/config/frontend/onboarding.shared.schemas.js.map +1 -1
  189. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +146 -43
  190. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  191. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +147 -42
  192. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  193. package/dist/esm/errors/errors.shared.definitions.js +1 -1
  194. package/dist/esm/errors/errors.shared.definitions.js.map +1 -1
  195. package/dist/esm/errors/errors.shared.schemas.d.ts +29 -40
  196. package/dist/esm/errors/errors.shared.schemas.d.ts.map +1 -1
  197. package/dist/esm/errors/errors.shared.schemas.js +37 -54
  198. package/dist/esm/errors/errors.shared.schemas.js.map +1 -1
  199. package/dist/esm/errors/errors.shared.utils.d.ts +24 -0
  200. package/dist/esm/errors/errors.shared.utils.d.ts.map +1 -1
  201. package/dist/esm/errors/errors.shared.utils.js +39 -0
  202. package/dist/esm/errors/errors.shared.utils.js.map +1 -1
  203. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts +27 -0
  204. package/dist/esm/errors/thrown-value-description.shared.utils.d.ts.map +1 -0
  205. package/dist/esm/errors/thrown-value-description.shared.utils.js +67 -0
  206. package/dist/esm/errors/thrown-value-description.shared.utils.js.map +1 -0
  207. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +48 -73
  208. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  209. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js +103 -9
  210. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  211. package/dist/esm/external-data.exports.d.ts +1 -0
  212. package/dist/esm/external-data.exports.d.ts.map +1 -1
  213. package/dist/esm/external-data.exports.js +1 -0
  214. package/dist/esm/external-data.exports.js.map +1 -1
  215. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +18 -12
  216. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  217. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +18 -12
  218. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  219. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts +5 -3
  220. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  221. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +5 -3
  222. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  223. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts +77 -0
  224. package/dist/esm/external-providers/engine-capability-surface.shared.d.ts.map +1 -0
  225. package/dist/esm/external-providers/engine-capability-surface.shared.js +173 -0
  226. package/dist/esm/external-providers/engine-capability-surface.shared.js.map +1 -0
  227. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts +2 -0
  228. package/dist/esm/external-providers/external-providers.shared.schemas.d.ts.map +1 -1
  229. package/dist/esm/external-providers/external-providers.shared.schemas.js +21 -0
  230. package/dist/esm/external-providers/external-providers.shared.schemas.js.map +1 -1
  231. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +131 -7
  232. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  233. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +114 -0
  234. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -1
  235. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +148 -0
  236. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -1
  237. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +108 -0
  238. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  239. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +86 -0
  240. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  241. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts +184 -0
  242. package/dist/esm/external-providers/frontend-provider-public-config.shared.d.ts.map +1 -0
  243. package/dist/esm/external-providers/frontend-provider-public-config.shared.js +216 -0
  244. package/dist/esm/external-providers/frontend-provider-public-config.shared.js.map +1 -0
  245. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts +30 -0
  246. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.d.ts.map +1 -0
  247. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js +32 -0
  248. package/dist/esm/external-providers/provider-authentication-assurance.shared.schemas.js.map +1 -0
  249. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts +86 -0
  250. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.d.ts.map +1 -0
  251. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js +85 -0
  252. package/dist/esm/external-providers/provider-browser-operations.shared.schemas.js.map +1 -0
  253. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +14 -13
  254. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  255. package/dist/esm/external-providers/provider-capability.shared.schemas.js +10 -10
  256. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  257. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +18 -8
  258. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  259. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +10 -4
  260. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  261. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts +165 -0
  262. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.d.ts.map +1 -0
  263. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js +39 -0
  264. package/dist/esm/external-providers/provider-frontend-component-contract.shared.types.js.map +1 -0
  265. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +7 -5
  266. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -1
  267. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +7 -5
  268. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -1
  269. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +8 -5
  270. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  271. package/dist/esm/external-providers/provider-metadata.shared.schemas.js +5 -2
  272. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  273. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts +2 -0
  274. package/dist/esm/features/application-features.shared.resources-config.schemas.d.ts.map +1 -1
  275. package/dist/esm/features/application-features.shared.resources-config.schemas.js +42 -3
  276. package/dist/esm/features/application-features.shared.resources-config.schemas.js.map +1 -1
  277. package/dist/esm/features/connected-feature.example.d.ts +64 -0
  278. package/dist/esm/features/connected-feature.example.d.ts.map +1 -0
  279. package/dist/esm/features/connected-feature.example.js +86 -0
  280. package/dist/esm/features/connected-feature.example.js.map +1 -0
  281. package/dist/esm/features/scope-features.shared.schemas.d.ts +53 -0
  282. package/dist/esm/features/scope-features.shared.schemas.d.ts.map +1 -1
  283. package/dist/esm/features/scope-features.shared.schemas.js +37 -0
  284. package/dist/esm/features/scope-features.shared.schemas.js.map +1 -1
  285. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
  286. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  287. package/dist/esm/features/user-features.shared.resources-config.schemas.js +42 -48
  288. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  289. package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts +73 -0
  290. package/dist/esm/files/file-remote-reference-link.shared.schemas.d.ts.map +1 -0
  291. package/dist/esm/files/file-remote-reference-link.shared.schemas.js +62 -0
  292. package/dist/esm/files/file-remote-reference-link.shared.schemas.js.map +1 -0
  293. package/dist/esm/files/files.shared.resources-config.schemas.d.ts +3 -3
  294. package/dist/esm/files/files.shared.resources-config.schemas.js +3 -3
  295. package/dist/esm/files/files.shared.resources-config.schemas.js.map +1 -1
  296. package/dist/esm/flows-actors/actors.shared.schemas.d.ts +152 -129
  297. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  298. package/dist/esm/flows-actors/actors.shared.schemas.js +99 -2
  299. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  300. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts +6 -0
  301. package/dist/esm/flows-actors/agent-traceability.shared.schemas.d.ts.map +1 -1
  302. package/dist/esm/flows-actors/agents.shared.schemas.d.ts +3 -3
  303. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  304. package/dist/esm/flows-actors/agents.shared.schemas.js +11 -5
  305. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  306. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +13 -0
  307. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  308. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  309. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts +45 -0
  310. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.d.ts.map +1 -0
  311. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js +51 -0
  312. package/dist/esm/flows-actors/execution-plan-readiness.shared.utils.js.map +1 -0
  313. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +31 -0
  314. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  315. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +61 -3
  316. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  317. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +2 -2
  318. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +16 -8
  319. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  320. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +23 -11
  321. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  322. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts +0 -189
  323. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.d.ts.map +1 -1
  324. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js +14 -50
  325. package/dist/esm/flows-actors/flows-actors.configuration.shared.schemas.js.map +1 -1
  326. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts +0 -3
  327. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.d.ts.map +1 -1
  328. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js +0 -1
  329. package/dist/esm/flows-actors/flows-actors.frontend.shared.schemas.js.map +1 -1
  330. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts +1 -67
  331. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  332. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +1 -2
  333. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  334. package/dist/esm/flows-actors/flows.shared.schemas.d.ts +0 -1
  335. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  336. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts +121 -0
  337. package/dist/esm/flows-actors/human-decision.shared.schemas.d.ts.map +1 -0
  338. package/dist/esm/flows-actors/human-decision.shared.schemas.js +252 -0
  339. package/dist/esm/flows-actors/human-decision.shared.schemas.js.map +1 -0
  340. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts +2 -0
  341. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -1
  342. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +13 -0
  343. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -1
  344. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts +24 -0
  345. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.d.ts.map +1 -0
  346. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js +80 -0
  347. package/dist/esm/flows-actors/provider-call-records.shared.resources-config.schemas.js.map +1 -0
  348. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts +123 -0
  349. package/dist/esm/flows-actors/provider-call-records.shared.schemas.d.ts.map +1 -0
  350. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js +181 -0
  351. package/dist/esm/flows-actors/provider-call-records.shared.schemas.js.map +1 -0
  352. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts +58 -81
  353. package/dist/esm/flows-actors/tasks.actors.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js +75 -38
  355. package/dist/esm/flows-actors/tasks.actors.shared.schemas.js.map +1 -1
  356. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts +217 -0
  357. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.d.ts.map +1 -0
  358. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js +230 -0
  359. package/dist/esm/frontend-definitions/settings-destination-ref.definitions.js.map +1 -0
  360. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts +106 -24
  361. package/dist/esm/guidance/guidance-flow.shared.schemas.d.ts.map +1 -1
  362. package/dist/esm/guidance/guidance-flow.shared.schemas.js +152 -14
  363. package/dist/esm/guidance/guidance-flow.shared.schemas.js.map +1 -1
  364. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts +0 -6
  365. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  366. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +0 -19
  367. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  368. package/dist/esm/guidance/milestone-builders.shared.d.ts +4 -2
  369. package/dist/esm/guidance/milestone-builders.shared.d.ts.map +1 -1
  370. package/dist/esm/guidance/milestone-builders.shared.js +4 -2
  371. package/dist/esm/guidance/milestone-builders.shared.js.map +1 -1
  372. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts +66 -4
  373. package/dist/esm/guidance/milestone-definition.shared.schemas.d.ts.map +1 -1
  374. package/dist/esm/guidance/milestone-definition.shared.schemas.js +50 -0
  375. package/dist/esm/guidance/milestone-definition.shared.schemas.js.map +1 -1
  376. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts +71 -0
  377. package/dist/esm/guidance/progression-presentation.shared.schemas.d.ts.map +1 -0
  378. package/dist/esm/guidance/progression-presentation.shared.schemas.js +72 -0
  379. package/dist/esm/guidance/progression-presentation.shared.schemas.js.map +1 -0
  380. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +2 -0
  381. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  382. package/dist/esm/guidance/progression-state.shared.schemas.d.ts +4 -0
  383. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  384. package/dist/esm/guidance/progression-state.shared.schemas.js +5 -0
  385. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  386. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.d.ts.map +1 -1
  387. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js +2 -1
  388. package/dist/esm/http-api-binding/http-api-binding-id.shared.utils.js.map +1 -1
  389. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +181 -412
  390. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  391. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +249 -199
  392. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  393. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts +107 -0
  394. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.d.ts.map +1 -0
  395. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js +108 -0
  396. package/dist/esm/http-api-binding/http-api-transport-dialect.shared.js.map +1 -0
  397. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts +38 -0
  398. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.d.ts.map +1 -0
  399. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js +42 -0
  400. package/dist/esm/http-api-binding/read-through-engine-anchors.shared.js.map +1 -0
  401. package/dist/esm/index.d.ts +47 -4
  402. package/dist/esm/index.d.ts.map +1 -1
  403. package/dist/esm/index.js +77 -16
  404. package/dist/esm/index.js.map +1 -1
  405. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +1 -0
  406. package/dist/esm/meta-workflows/actions.meta-workflows.shared.schemas.js.map +1 -0
  407. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +1 -0
  408. package/dist/esm/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +1 -0
  409. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts +130 -0
  410. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.d.ts.map +1 -0
  411. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js +104 -0
  412. package/dist/esm/meta-workflows/coding-tasks.meta-workflows.shared.schemas.js.map +1 -0
  413. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -0
  414. package/dist/esm/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -0
  415. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/decisions.meta-workflows.shared.schemas.d.ts +64 -0
  416. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +1 -0
  417. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/decisions.meta-workflows.shared.schemas.js +47 -0
  418. package/dist/esm/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -0
  419. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts +544 -0
  420. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.d.ts.map +1 -0
  421. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js +638 -0
  422. package/dist/esm/meta-workflows/orchestration.meta-workflows.shared.schemas.js.map +1 -0
  423. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/portable-primitives.meta-workflows.shared.schemas.d.ts +15 -8
  424. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +1 -0
  425. package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/portable-primitives.meta-workflows.shared.schemas.js +15 -8
  426. package/dist/esm/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +1 -0
  427. package/dist/esm/meta-workflows.exports.d.ts +21 -25
  428. package/dist/esm/meta-workflows.exports.d.ts.map +1 -1
  429. package/dist/esm/meta-workflows.exports.js +21 -25
  430. package/dist/esm/meta-workflows.exports.js.map +1 -1
  431. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts +16 -0
  432. package/dist/esm/notifications/email/email-submission.shared.enums.d.ts.map +1 -0
  433. package/dist/esm/notifications/email/email-submission.shared.enums.js +17 -0
  434. package/dist/esm/notifications/email/email-submission.shared.enums.js.map +1 -0
  435. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +36 -0
  436. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  437. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js +50 -3
  438. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  439. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  440. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js +4 -1
  441. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.resources-config.schemas.js.map +1 -1
  442. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts +2 -1
  443. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.d.ts.map +1 -1
  444. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js +3 -2
  445. package/dist/esm/notifications/m2m/m2m-webhook-delivery-log.shared.schemas.js.map +1 -1
  446. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  447. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +44 -3
  448. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  449. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
  450. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  451. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +12 -33
  452. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  453. package/dist/esm/notifications/notifications.shared.schemas.d.ts +68 -6
  454. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  455. package/dist/esm/notifications/notifications.shared.schemas.js +68 -6
  456. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  457. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts +145 -0
  458. package/dist/esm/organizations/application-owner-organization.shared.schemas.d.ts.map +1 -0
  459. package/dist/esm/organizations/application-owner-organization.shared.schemas.js +146 -0
  460. package/dist/esm/organizations/application-owner-organization.shared.schemas.js.map +1 -0
  461. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts +2 -0
  462. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.d.ts.map +1 -1
  463. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js +39 -3
  464. package/dist/esm/organizations/organization-features.shared.resources-config.schemas.js.map +1 -1
  465. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
  466. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  467. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +18 -14
  468. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  469. package/dist/esm/organizations/organization-members.shared.schemas.d.ts +1 -1
  470. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  471. package/dist/esm/organizations/organization-members.shared.schemas.js +9 -1
  472. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  473. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +2 -1
  474. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  475. package/dist/esm/organizations/organization-preferences.shared.schemas.js +3 -0
  476. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  477. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +3 -1
  478. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  479. package/dist/esm/organizations/organization-profile.shared.schemas.js +4 -2
  480. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  481. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +29 -2
  482. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  483. package/dist/esm/organizations/organization-unit-narrowing.shared.js +27 -0
  484. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  485. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts +2 -0
  486. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.d.ts.map +1 -1
  487. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js +3 -0
  488. package/dist/esm/organizations/organization-units.shared.resources-config.schemas.js.map +1 -1
  489. package/dist/esm/organizations/organization-units.shared.schemas.d.ts +17 -5
  490. package/dist/esm/organizations/organization-units.shared.schemas.d.ts.map +1 -1
  491. package/dist/esm/organizations/organization-units.shared.schemas.js +65 -5
  492. package/dist/esm/organizations/organization-units.shared.schemas.js.map +1 -1
  493. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts +51 -7
  494. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  495. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +151 -7
  496. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  497. package/dist/esm/organizations/organizations.shared.schemas.d.ts +18 -83
  498. package/dist/esm/organizations/organizations.shared.schemas.d.ts.map +1 -1
  499. package/dist/esm/organizations/organizations.shared.schemas.js +37 -19
  500. package/dist/esm/organizations/organizations.shared.schemas.js.map +1 -1
  501. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts +13 -0
  502. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.d.ts.map +1 -1
  503. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js +13 -0
  504. package/dist/esm/organizations/tenant-teardown-config.shared.schemas.js.map +1 -1
  505. package/dist/esm/provider-registration-runtime.exports.d.ts +1 -0
  506. package/dist/esm/provider-registration-runtime.exports.d.ts.map +1 -1
  507. package/dist/esm/provider-registration-runtime.exports.js +1 -0
  508. package/dist/esm/provider-registration-runtime.exports.js.map +1 -1
  509. package/dist/esm/public-runtime/index.d.ts +53 -2
  510. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  511. package/dist/esm/public-runtime/index.js +45 -2
  512. package/dist/esm/public-runtime/index.js.map +1 -1
  513. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +7 -8
  514. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  515. package/dist/esm/queue/jobs.shared.resources-config.schemas.js +30 -6
  516. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  517. package/dist/esm/queue/jobs.shared.schemas.d.ts +388 -2
  518. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  519. package/dist/esm/queue/jobs.shared.schemas.js +315 -11
  520. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  521. package/dist/esm/queue/jobs.shared.utils.d.ts +6 -4
  522. package/dist/esm/queue/jobs.shared.utils.d.ts.map +1 -1
  523. package/dist/esm/queue/jobs.shared.utils.js +5 -4
  524. package/dist/esm/queue/jobs.shared.utils.js.map +1 -1
  525. package/dist/esm/queue/queues.shared.schemas.d.ts +20 -8
  526. package/dist/esm/queue/queues.shared.schemas.d.ts.map +1 -1
  527. package/dist/esm/queue/queues.shared.schemas.js +23 -18
  528. package/dist/esm/queue/queues.shared.schemas.js.map +1 -1
  529. package/dist/esm/queue/queues.shared.utils.d.ts +4 -2
  530. package/dist/esm/queue/queues.shared.utils.d.ts.map +1 -1
  531. package/dist/esm/queue/queues.shared.utils.js +4 -2
  532. package/dist/esm/queue/queues.shared.utils.js.map +1 -1
  533. package/dist/esm/rag/rag-retrieval-health.shared.d.ts +27 -0
  534. package/dist/esm/rag/rag-retrieval-health.shared.d.ts.map +1 -0
  535. package/dist/esm/rag/rag-retrieval-health.shared.js +29 -0
  536. package/dist/esm/rag/rag-retrieval-health.shared.js.map +1 -0
  537. package/dist/esm/requests/header-keys.shared.d.ts +6 -0
  538. package/dist/esm/requests/header-keys.shared.d.ts.map +1 -1
  539. package/dist/esm/requests/header-keys.shared.js +7 -0
  540. package/dist/esm/requests/header-keys.shared.js.map +1 -1
  541. package/dist/esm/requests/idempotency-key.shared.d.ts +76 -0
  542. package/dist/esm/requests/idempotency-key.shared.d.ts.map +1 -0
  543. package/dist/esm/requests/idempotency-key.shared.js +112 -0
  544. package/dist/esm/requests/idempotency-key.shared.js.map +1 -0
  545. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -1
  546. package/dist/esm/requests/manual-controllers-routes-documentation.js +275 -20
  547. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -1
  548. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +134 -0
  549. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  550. package/dist/esm/requests/manual-controllers-routes-urls.js +153 -0
  551. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  552. package/dist/esm/requests/websocket.shared.schemas.d.ts +198 -20
  553. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  554. package/dist/esm/requests/websocket.shared.schemas.js +236 -5
  555. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  556. package/dist/esm/resources/child-operations.shared.schemas.d.ts +56 -5
  557. package/dist/esm/resources/child-operations.shared.schemas.d.ts.map +1 -1
  558. package/dist/esm/resources/child-operations.shared.schemas.js +97 -5
  559. package/dist/esm/resources/child-operations.shared.schemas.js.map +1 -1
  560. package/dist/esm/resources/context-policy.shared.schemas.d.ts +20 -0
  561. package/dist/esm/resources/context-policy.shared.schemas.d.ts.map +1 -1
  562. package/dist/esm/resources/context-policy.shared.schemas.js +3 -0
  563. package/dist/esm/resources/context-policy.shared.schemas.js.map +1 -1
  564. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  565. package/dist/esm/resources/resources-config.shared.factory.js +596 -34
  566. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  567. package/dist/esm/resources/resources-config.shared.schemas.d.ts +665 -40
  568. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  569. package/dist/esm/resources/resources-config.shared.schemas.js +315 -22
  570. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  571. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  572. package/dist/esm/resources/resources-registry.shared.core.definitions.js +431 -69
  573. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  574. package/dist/esm/resources/resources.shared.core.definitions.d.ts +36 -0
  575. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  576. package/dist/esm/resources/resources.shared.core.definitions.js +46 -0
  577. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  578. package/dist/esm/resources/resources.shared.schemas.d.ts +256 -10
  579. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  580. package/dist/esm/resources/resources.shared.schemas.js +209 -9
  581. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  582. package/dist/esm/resources/resources.shared.utils.d.ts +34 -8
  583. package/dist/esm/resources/resources.shared.utils.d.ts.map +1 -1
  584. package/dist/esm/resources/resources.shared.utils.js +69 -12
  585. package/dist/esm/resources/resources.shared.utils.js.map +1 -1
  586. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts +44 -12
  587. package/dist/esm/resources/utils/composition-cascade-deletability.validation.d.ts.map +1 -1
  588. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js +46 -23
  589. package/dist/esm/resources/utils/composition-cascade-deletability.validation.js.map +1 -1
  590. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts +61 -0
  591. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.d.ts.map +1 -0
  592. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js +79 -0
  593. package/dist/esm/resources/utils/dependent-lifecycle-classification.validation.js.map +1 -0
  594. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts +60 -0
  595. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.d.ts.map +1 -0
  596. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js +80 -0
  597. package/dist/esm/resources/utils/initiator-stamped-field-satisfiability.validation.js.map +1 -0
  598. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts +21 -0
  599. package/dist/esm/resources/utils/populated-file-fields.shared.utils.d.ts.map +1 -0
  600. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js +159 -0
  601. package/dist/esm/resources/utils/populated-file-fields.shared.utils.js.map +1 -0
  602. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts +15 -0
  603. package/dist/esm/resources/utils/resources-config-naming.utils.d.ts.map +1 -1
  604. package/dist/esm/resources/utils/resources-config-naming.utils.js +56 -11
  605. package/dist/esm/resources/utils/resources-config-naming.utils.js.map +1 -1
  606. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts +51 -1
  607. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  608. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +210 -51
  609. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  610. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts +34 -0
  611. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.d.ts.map +1 -1
  612. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js +45 -1
  613. package/dist/esm/resources/utils/resources-config-operations.urls-builder.utils.js.map +1 -1
  614. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts +29 -0
  615. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  616. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +30 -0
  617. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  618. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.d.ts.map +1 -1
  619. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js +49 -11
  620. package/dist/esm/resources/utils/templatable-file-fields.shared.utils.js.map +1 -1
  621. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  622. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +4 -1
  623. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  624. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  625. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +4 -1
  626. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  627. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +129 -17
  628. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  629. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +160 -6
  630. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  631. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +324 -9
  632. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  633. package/dist/esm/security/authentications/authentication.shared.schemas.js +411 -8
  634. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  635. package/dist/esm/security/authentications/authentication.shared.utils.d.ts +87 -4
  636. package/dist/esm/security/authentications/authentication.shared.utils.d.ts.map +1 -1
  637. package/dist/esm/security/authentications/authentication.shared.utils.js +95 -6
  638. package/dist/esm/security/authentications/authentication.shared.utils.js.map +1 -1
  639. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +23 -1
  640. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  641. package/dist/esm/security/authentications/consumable-token.shared.schemas.js +23 -1
  642. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  643. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts +7 -1
  644. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.d.ts.map +1 -1
  645. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js +7 -1
  646. package/dist/esm/security/authentications/cross-frontend-handoff.shared.dto.schemas.js.map +1 -1
  647. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts +74 -0
  648. package/dist/esm/security/authentications/password-blocklist.shared.utils.d.ts.map +1 -0
  649. package/dist/esm/security/authentications/password-blocklist.shared.utils.js +122 -0
  650. package/dist/esm/security/authentications/password-blocklist.shared.utils.js.map +1 -0
  651. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +88 -2
  652. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  653. package/dist/esm/security/authentications/registration.shared.dto.schemas.js +149 -2
  654. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  655. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts +57 -11
  656. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.d.ts.map +1 -1
  657. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js +44 -11
  658. package/dist/esm/security/authentications/scim/scim-organization-unit-mapping.shared.js.map +1 -1
  659. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.d.ts.map +1 -1
  660. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js +20 -7
  661. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.resources-config.schemas.js.map +1 -1
  662. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +16 -2
  663. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  664. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +32 -2
  665. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  666. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.d.ts.map +1 -1
  667. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js +7 -1
  668. package/dist/esm/security/authentications/scim/scim-tokens.shared.resources-config.schemas.js.map +1 -1
  669. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.d.ts.map +1 -1
  670. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js +4 -1
  671. package/dist/esm/security/authentications/siem/siem-delivery-dlq.shared.resources-config.schemas.js.map +1 -1
  672. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts +27 -0
  673. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.d.ts.map +1 -0
  674. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js +109 -0
  675. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.resources-config.schemas.js.map +1 -0
  676. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts +66 -0
  677. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.d.ts.map +1 -0
  678. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js +107 -0
  679. package/dist/esm/security/authentications/siem/siem-delivery-outbox.shared.schemas.js.map +1 -0
  680. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts +19 -0
  681. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.d.ts.map +1 -1
  682. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js +50 -13
  683. package/dist/esm/security/authentications/siem/siem-export-config.shared.resources-config.schemas.js.map +1 -1
  684. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts +18 -6
  685. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.d.ts.map +1 -1
  686. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js +133 -4
  687. package/dist/esm/security/authentications/siem/siem-export-config.shared.schemas.js.map +1 -1
  688. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts +29 -3
  689. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  690. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +81 -22
  691. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  692. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts +0 -40
  693. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  694. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +100 -26
  695. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  696. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts +9 -1
  697. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.d.ts.map +1 -1
  698. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js +9 -1
  699. package/dist/esm/security/authentications/sso/sso-connection.shared.resources-config.schemas.js.map +1 -1
  700. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +8 -2
  701. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  702. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +91 -4
  703. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  704. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts +50 -6
  705. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.d.ts.map +1 -1
  706. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js +50 -6
  707. package/dist/esm/security/authorizations/administrative-continuity.shared.schemas.js.map +1 -1
  708. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts +39 -0
  709. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.d.ts.map +1 -0
  710. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js +265 -0
  711. package/dist/esm/security/authorizations/application-access-grants.shared.resources-config.schemas.js.map +1 -0
  712. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts +187 -0
  713. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.d.ts.map +1 -0
  714. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js +271 -0
  715. package/dist/esm/security/authorizations/application-access-grants.shared.schemas.js.map +1 -0
  716. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +23 -0
  717. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  718. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +24 -0
  719. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  720. package/dist/esm/security/authorizations/roles.shared.defaults.d.ts.map +1 -1
  721. package/dist/esm/security/authorizations/roles.shared.defaults.js +6 -0
  722. package/dist/esm/security/authorizations/roles.shared.defaults.js.map +1 -1
  723. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +14 -0
  724. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  725. package/dist/esm/security/authorizations/roles.shared.schemas.js +19 -0
  726. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  727. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  728. package/dist/esm/security/authorizations/roles.shared.utils.js +2 -0
  729. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  730. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +4 -1
  731. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -1
  732. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +5 -2
  733. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -1
  734. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +13 -42
  735. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -1
  736. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +257 -13
  737. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -1
  738. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +281 -49
  739. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -1
  740. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +6 -3
  741. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  742. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +74 -4
  743. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  744. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +5 -2
  745. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  746. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +105 -3
  747. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  748. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts +67 -0
  749. package/dist/esm/security/outbound-target-control.shared.schemas.d.ts.map +1 -0
  750. package/dist/esm/security/outbound-target-control.shared.schemas.js +69 -0
  751. package/dist/esm/security/outbound-target-control.shared.schemas.js.map +1 -0
  752. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts +159 -0
  753. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.d.ts.map +1 -0
  754. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js +164 -0
  755. package/dist/esm/systems-of-record/system-of-record-credential-kind.shared.js.map +1 -0
  756. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts +209 -0
  757. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.d.ts.map +1 -0
  758. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js +150 -0
  759. package/dist/esm/systems-of-record/system-of-record-declaration.shared.schemas.js.map +1 -0
  760. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts +79 -0
  761. package/dist/esm/systems-of-record/system-of-record-env.shared.d.ts.map +1 -0
  762. package/dist/esm/systems-of-record/system-of-record-env.shared.js +116 -0
  763. package/dist/esm/systems-of-record/system-of-record-env.shared.js.map +1 -0
  764. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts +145 -0
  765. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.d.ts.map +1 -0
  766. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js +146 -0
  767. package/dist/esm/systems-of-record/system-of-record-error-codes.shared.js.map +1 -0
  768. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts +478 -0
  769. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.d.ts.map +1 -0
  770. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js +619 -0
  771. package/dist/esm/systems-of-record/system-of-record-facet.shared.schemas.js.map +1 -0
  772. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts +31 -0
  773. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.d.ts.map +1 -0
  774. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js +232 -0
  775. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.resources-config.schemas.js.map +1 -0
  776. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts +127 -0
  777. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.d.ts.map +1 -0
  778. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js +204 -0
  779. package/dist/esm/systems-of-record/system-of-record-partition-assignments.shared.schemas.js.map +1 -0
  780. package/dist/esm/testing/resource-config-builders.d.ts.map +1 -1
  781. package/dist/esm/testing/resource-config-builders.js +10 -4
  782. package/dist/esm/testing/resource-config-builders.js.map +1 -1
  783. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts +2 -1
  784. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.d.ts.map +1 -1
  785. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js +2 -1
  786. package/dist/esm/users/anonymous-user-marketing-metadata.shared.schemas.js.map +1 -1
  787. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts +139 -24
  788. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.d.ts.map +1 -1
  789. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js +255 -0
  790. package/dist/esm/users/anonymous-users.shared.resources-config.schemas.js.map +1 -1
  791. package/dist/esm/users/anonymous-users.shared.schema.d.ts +5 -3
  792. package/dist/esm/users/anonymous-users.shared.schema.d.ts.map +1 -1
  793. package/dist/esm/users/anonymous-users.shared.schema.js +18 -1
  794. package/dist/esm/users/anonymous-users.shared.schema.js.map +1 -1
  795. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +2 -1
  796. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  797. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +23 -0
  798. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  799. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts +2 -1
  800. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  801. package/dist/esm/users/user-consent-decision.shared.utils.d.ts +127 -0
  802. package/dist/esm/users/user-consent-decision.shared.utils.d.ts.map +1 -0
  803. package/dist/esm/users/user-consent-decision.shared.utils.js +189 -0
  804. package/dist/esm/users/user-consent-decision.shared.utils.js.map +1 -0
  805. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -0
  806. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  807. package/dist/esm/users/user-identity-links.shared.schemas.d.ts +1 -0
  808. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  809. package/dist/esm/users/user-identity-links.shared.schemas.js +30 -0
  810. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  811. package/dist/esm/users/user-preferences-reset.shared.utils.d.ts +6 -6
  812. package/dist/esm/users/user-preferences-reset.shared.utils.js +6 -6
  813. package/dist/esm/users/user-preferences-reset.shared.utils.js.map +1 -1
  814. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +74 -29
  815. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  816. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +99 -0
  817. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  818. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  819. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +25 -9
  820. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  821. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +4 -4
  822. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  823. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +12 -1
  824. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  825. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts +1 -0
  826. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  827. package/dist/esm/users/user-self.shared.resources-config.schemas.js +2 -2
  828. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  829. package/dist/esm/users/users.shared.resources-config.schemas.d.ts +1 -0
  830. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  831. package/dist/esm/users/users.shared.resources-config.schemas.js +2 -2
  832. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  833. package/dist/esm/users/users.shared.schemas.d.ts +28 -10
  834. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  835. package/dist/esm/users/users.shared.schemas.js +86 -11
  836. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  837. package/dist/tsconfig.build.tsbuildinfo +1 -1
  838. package/package.json +14 -35
  839. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.d.ts +0 -19
  840. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.d.ts.map +0 -1
  841. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.js +0 -35
  842. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint-agent-personas.shared.enums.js.map +0 -1
  843. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts +0 -213
  844. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts.map +0 -1
  845. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.js +0 -287
  846. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.js.map +0 -1
  847. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts +0 -236
  848. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.d.ts.map +0 -1
  849. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.js +0 -212
  850. package/dist/esm/flows-actors/apps-blueprint/artifacts.apps-blueprint.shared.schemas.js.map +0 -1
  851. package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.d.ts.map +0 -1
  852. package/dist/esm/flows-actors/meta-workflows/actions.meta-workflows.shared.schemas.js.map +0 -1
  853. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -17
  854. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +0 -1
  855. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +0 -31
  856. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +0 -1
  857. package/dist/esm/flows-actors/meta-workflows/catalog.meta-workflows.shared.schemas.d.ts.map +0 -1
  858. package/dist/esm/flows-actors/meta-workflows/catalog.meta-workflows.shared.schemas.js.map +0 -1
  859. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +0 -1
  860. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +0 -1
  861. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.d.ts +0 -28
  862. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.d.ts.map +0 -1
  863. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.js +0 -28
  864. package/dist/esm/flows-actors/meta-workflows/continuity-identifiers.meta-workflows.shared.schemas.js.map +0 -1
  865. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts.map +0 -1
  866. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +0 -1
  867. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +0 -100
  868. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +0 -1
  869. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +0 -232
  870. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +0 -1
  871. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.d.ts +0 -29
  872. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.d.ts.map +0 -1
  873. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.js +0 -58
  874. package/dist/esm/flows-actors/meta-workflows/execution-binding-vocabularies.meta-workflows.shared.schemas.js.map +0 -1
  875. package/dist/esm/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.d.ts.map +0 -1
  876. package/dist/esm/flows-actors/meta-workflows/portable-primitives.meta-workflows.shared.schemas.js.map +0 -1
  877. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts +0 -81
  878. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.d.ts.map +0 -1
  879. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.js +0 -82
  880. package/dist/esm/flows-actors/task-continuity-binding.actors.shared.schemas.js.map +0 -1
  881. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.d.ts +0 -2
  882. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.d.ts.map +0 -1
  883. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.js +0 -1
  884. package/dist/esm/flows-actors/utils/flow-actors.context-builder.apps-context.shared.utils.js.map +0 -1
  885. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/actions.meta-workflows.shared.schemas.d.ts +0 -0
  886. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/actions.meta-workflows.shared.schemas.js +0 -0
  887. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/catalog.meta-workflows.shared.schemas.d.ts +0 -0
  888. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/catalog.meta-workflows.shared.schemas.js +0 -0
  889. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/context-selection.meta-workflows.shared.schemas.d.ts +0 -0
  890. /package/dist/esm/{flows-actors/meta-workflows → meta-workflows}/context-selection.meta-workflows.shared.schemas.js +0 -0
@@ -21,11 +21,11 @@ export { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, Invo
21
21
  * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`
22
22
  * are re-exported from the connector models, because their values ARE the provider's wire values.
23
23
  *
24
- * ⚠️ **The catalogue is ONE-WAY.** Sync pushes only rows that have no provider link yet, so a product
25
- * or price edited in the provider's own dashboard is never read back, never reconciled, and never
26
- * reported. Removing a product from the array does not retire it at the provider and does not
27
- * deactivate the existing row — nothing detects that a previously synced key has disappeared. Treat
28
- * the array as the source of truth and make every change through it.
24
+ * The authored catalogue is the source of truth; provider-dashboard edits are not read back.
25
+ * A complete sync detects active local product keys absent from the array and deactivates those
26
+ * products and their active local prices, retaining the rows and reporting live subscribers.
27
+ * It does not archive provider products/prices or migrate/cancel subscribers. Treat provider
28
+ * retirement and customer migration as separate decisions, and inspect the complete sync result.
29
29
  *
30
30
  * Product types available in the billing catalog.
31
31
  *
@@ -154,6 +154,78 @@ export var UsageRecordUnreportableReason;
154
154
  */
155
155
  UsageRecordUnreportableReason["BILLING_ACCOUNT_DELETED"] = "billing_account_deleted";
156
156
  })(UsageRecordUnreportableReason || (UsageRecordUnreportableReason = {}));
157
+ // ── Provider reconciliation ────────────────────────────────────────
158
+ /**
159
+ * What KIND of disagreement a billing reconciliation run found between local billing state and the
160
+ * provider.
161
+ *
162
+ * A closed vocabulary rather than free text on a log line, because each kind has a different
163
+ * treatment and a different meaning when it persists, and a recorded run has to be able to say
164
+ * which one it saw how many times:
165
+ *
166
+ * - the two DRIFT kinds and the MISSING kind are REPAIRED, within the provider-authoritative field
167
+ * set only;
168
+ * - {@link SUBSCRIPTION_PROVIDER_STATE_UNREADABLE} is NEVER repaired — a failed read, including a
169
+ * provider saying the subscription does not exist, is not evidence the subscription ended, so it
170
+ * is reported and nothing is written.
171
+ *
172
+ * A steady non-zero count of any repaired kind means webhook delivery is failing and the sweep is
173
+ * papering over it; that is a different problem from the sweep failing, and only a per-kind count
174
+ * can tell them apart.
175
+ */
176
+ export var BillingReconciliationDivergenceKind;
177
+ (function (BillingReconciliationDivergenceKind) {
178
+ /** A live, provider-linked subscription disagreed with the provider on at least one provider-authoritative field. */
179
+ BillingReconciliationDivergenceKind["SUBSCRIPTION_FIELD_DRIFT"] = "subscription_field_drift";
180
+ /** The provider's state for a provider-linked subscription could not be read. Reported only; local state is untouched. */
181
+ BillingReconciliationDivergenceKind["SUBSCRIPTION_PROVIDER_STATE_UNREADABLE"] = "subscription_provider_state_unreadable";
182
+ /** An invoice the provider holds for a known customer had no local record — its webhook was never delivered. */
183
+ BillingReconciliationDivergenceKind["INVOICE_MISSING_LOCALLY"] = "invoice_missing_locally";
184
+ /** A locally recorded invoice carried a different status from the provider's. */
185
+ BillingReconciliationDivergenceKind["INVOICE_STATUS_DRIFT"] = "invoice_status_drift";
186
+ })(BillingReconciliationDivergenceKind || (BillingReconciliationDivergenceKind = {}));
187
+ /**
188
+ * A population a reconciliation run met and deliberately did NOT compare against the provider.
189
+ *
190
+ * Counted per run, because a sweep that silently skips rows is indistinguishable from one that
191
+ * compared them and found agreement — and "we reconciled everything" is only a true sentence when
192
+ * the skipped populations are stated beside it. Each member is a DECISION with a reason, not a gap:
193
+ *
194
+ * Populations that are never compared by design and therefore never met at all — terminal
195
+ * subscriptions, subscriptions known only to the provider, subscription items, invoice totals, and
196
+ * invoices older than the per-customer lookback — are named on `BillingReconciliationBackendService`
197
+ * rather than here, because a run cannot count what it never selects.
198
+ */
199
+ export var BillingReconciliationUncomparedPopulation;
200
+ (function (BillingReconciliationUncomparedPopulation) {
201
+ /** A local subscription with no provider link: there is no provider record to compare it against. */
202
+ BillingReconciliationUncomparedPopulation["SUBSCRIPTION_WITHOUT_PROVIDER_LINK"] = "subscription_without_provider_link";
203
+ /**
204
+ * A provider-linked subscription whose mutation slot holds a PREPARED admission: one of its mutations is
205
+ * about to call the provider, so the run neither read nor wrote it. Its next run re-reads it.
206
+ */
207
+ BillingReconciliationUncomparedPopulation["SUBSCRIPTION_MUTATION_ADMISSION_PREPARED"] = "subscription_mutation_admission_prepared";
208
+ /**
209
+ * A provider-linked subscription the run read and found disagreeing, but whose mutation slot was written after that read, so nothing
210
+ * was written: the difference may already be gone. The writer is not always a mutation or a webhook — recovery moving a held
211
+ * generation behind newer ones advances the same version without settling anything — so this counts a read to REPEAT, never a
212
+ * mutation observed. Counted here rather than as a divergence the run cannot confirm. Its next run re-reads it.
213
+ */
214
+ BillingReconciliationUncomparedPopulation["SUBSCRIPTION_SUPERSEDED_BEFORE_REPAIR"] = "subscription_superseded_before_repair";
215
+ /**
216
+ * A provider-linked subscription whose billing account or provider link no longer matches the identity its mutation slot
217
+ * records. A mutation refuses the same condition as `slot_identity_changed`; the run neither compares nor writes it, and it
218
+ * stays held until recovery resolves the slot.
219
+ */
220
+ BillingReconciliationUncomparedPopulation["SUBSCRIPTION_SLOT_IDENTITY_CHANGED"] = "subscription_slot_identity_changed";
221
+ /** A billing account with no provider customer: nothing at the provider can hold its invoices. */
222
+ BillingReconciliationUncomparedPopulation["BILLING_ACCOUNT_WITHOUT_PROVIDER_CUSTOMER"] = "billing_account_without_provider_customer";
223
+ /**
224
+ * A billing scope whose rows exceeded one run's page ceiling. The remainder is left to the next run:
225
+ * reconciliation is idempotent, so a prefix is safe, but the count says the run did not cover the scope.
226
+ */
227
+ BillingReconciliationUncomparedPopulation["SCOPE_TRUNCATED_AT_PAGE_CEILING"] = "scope_truncated_at_page_ceiling";
228
+ })(BillingReconciliationUncomparedPopulation || (BillingReconciliationUncomparedPopulation = {}));
157
229
  // ── Tax ────────────────────────────────────────────────────────────
158
230
  // TaxDisplayMode: re-exported from @wildo-ai/external-connectors-models (see top of file)
159
231
  /**
@@ -320,6 +392,20 @@ export var BillingCheckoutMetadataKey;
320
392
  */
321
393
  BillingCheckoutMetadataKey["QUANTITY"] = "wildo_quantity";
322
394
  })(BillingCheckoutMetadataKey || (BillingCheckoutMetadataKey = {}));
395
+ /**
396
+ * Framework-authoritative metadata keys the engine writes on a provider SUBSCRIPTION (#535), in the same reserved namespace
397
+ * as {@link BillingCheckoutMetadataKey} and under the same rule: every member starts with
398
+ * {@link BILLING_RESERVED_METADATA_KEY_PREFIX}, so no caller-authored metadata can be mistaken for it.
399
+ */
400
+ export var BillingSubscriptionMetadataKey;
401
+ (function (BillingSubscriptionMetadataKey) {
402
+ /**
403
+ * `<slotId>:<generation>` of the subscription mutation that sent the update. Written so reconciliation can match a
404
+ * provider object to the durable mutation that caused it — including a change whose response was lost. A reference, never
405
+ * authority on its own: a match is confirmed against the stored mutation's identity.
406
+ */
407
+ BillingSubscriptionMetadataKey["MUTATION"] = "wildo_mutation";
408
+ })(BillingSubscriptionMetadataKey || (BillingSubscriptionMetadataKey = {}));
323
409
  /**
324
410
  * Upper bound on a single checkout's line-item quantity, applied on BOTH sides of the provider
325
411
  * round trip: the OPEN_CHECKOUT request DTO refuses more, and the webhook consumer refuses to
@@ -1 +1 @@
1
- {"version":3,"file":"billing-enums.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-enums.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE3J,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,gEAAgE;IAChE,4BAAa,CAAA;IACb,6DAA6D;IAC7D,8BAAe,CAAA;IACf,kEAAkE;IAClE,kCAAmB,CAAA;IACnB,6EAA6E;IAC7E,oCAAqB,CAAA;IACrB,sEAAsE;IACtE,0CAA2B,CAAA;IAC3B,0EAA0E;IAC1E,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,sEAAsE;AAEtE;;GAEG;AACH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AK7B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;IACrB,yCAAmB,CAAA;IACnB,yDAAmC,CAAA;AACrC,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,mFAAmF;AAEnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,QAAQ,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,0BA8BX;AA9BD,WAAY,0BAA0B;IACpC;;;;;;OAMG;IACH,2EAA6C,CAAA;IAC7C,kGAAkG;IAClG,8DAAgC,CAAA;IAChC;;;;;;;;;;;;OAYG;IACH,gEAAkC,CAAA;IAClC;;;OAGG;IACH,yDAA2B,CAAA;AAC7B,CAAC,EA9BW,0BAA0B,KAA1B,0BAA0B,QA8BrC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC","sourcesContent":["/**\n * Billing Enums (Shared)\n *\n * All billing-system enums used across backend, frontend, and shared models.\n * These supersede the legacy enums from billing.shared.schemas.ts.\n *\n * Enums shared with the standard billing interface (PricingModel, BillingInterval,\n * TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior) are defined in\n * @wildo-ai/external-connectors-models and re-exported here for convenience.\n *\n * @see billing-and-features-system.md §6 (Billing Schemas)\n */\n\nexport { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior } from '@wildo-ai/external-connectors-models';\n\n// ── Product & Pricing ──────────────────────────────────────────────\n\n/**\n * @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer\n *\n * The vocabularies an application types into its own product catalogue — the `ProductDefinition[]`\n * it exports from its shared library and hands to the engine with its module declarations.\n *\n * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`\n * are re-exported from the connector models, because their values ARE the provider's wire values.\n *\n * ⚠️ **The catalogue is ONE-WAY.** Sync pushes only rows that have no provider link yet, so a product\n * or price edited in the provider's own dashboard is never read back, never reconciled, and never\n * reported. Removing a product from the array does not retire it at the provider and does not\n * deactivate the existing row — nothing detects that a previously synced key has disappeared. Treat\n * the array as the source of truth and make every change through it.\n *\n * Product types available in the billing catalog.\n *\n * | Type | Creates subscription? | Repeatable? | Grants features? | Usage tracked? |\n * |-------------|----------------------|-------------|------------------|----------------|\n * | PLAN | Yes (exclusive) | No (switch) | Yes | No |\n * | ADDON | Yes (stackable) | No (toggle) | Yes | No |\n * | METERED | Yes | No | Optional | Yes |\n * | ONE_TIME | No | No (once) | Optional | No |\n * | CREDIT_PACK | No | Yes | No (credits) | Credits-based |\n * | ITEM | No | Yes | Optional | No |\n */\nexport enum ProductType {\n /** Subscription plan, mutually exclusive per billing account */\n PLAN = 'plan',\n /** Optional subscription add-on, stackable on top of plan */\n ADDON = 'addon',\n /** Usage-based subscription (consumption reported to provider) */\n METERED = 'metered',\n /** Single purchase, once per billing account (e.g., setup fee, migration) */\n ONE_TIME = 'one_time',\n /** Buy a pack of credits/tokens (repeatable, consumable over time) */\n CREDIT_PACK = 'credit_pack',\n /** Purchasable item, repeatable (e.g., report generation, data export) */\n ITEM = 'item',\n}\n\n/**\n * Limit grant mode: how this product's limits compose with other products.\n * - SET: absolute value (replaces, used for PLAN base limits)\n * - ADD: additive (stacks on top, used for ADDON bonus limits)\n */\nexport enum LimitGrantMode {\n SET = 'set',\n ADD = 'add',\n}\n\n// ── Billing Lifecycle ──────────────────────────────────────────────\n\n/**\n * Proration behavior for plan changes (upgrade/downgrade).\n */\n// ProrationBehavior: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// Moved there 2026-09-08 (#516) because its three values ARE the provider's wire values, so the\n// request contract has to be able to name the type — see TaxDisplayMode for the same reasoning.\n\n/**\n * Billing timing: when to apply plan changes.\n */\nexport enum BillingTiming {\n IMMEDIATE = 'immediate',\n AT_PERIOD_END = 'at_period_end',\n}\n/** @wildo_source:part:end saas.models.billing.catalog-vocabularies */\n\n// BillingInterval: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// ── Metering & Usage ───────────────────────────────────────────────\n\n/**\n * Metering aggregation window for usage records.\n */\nexport enum MeteringAggregationWindow {\n PER_FLUSH = 'per_flush',\n PER_BILLING_PERIOD = 'per_billing_period',\n}\n\n/**\n * Usage aggregation type for metered prices.\n */\nexport enum UsageAggregationType {\n SUM = 'sum',\n MAX = 'max',\n LAST = 'last',\n}\n\n/**\n * Usage record source type.\n */\nexport enum UsageSourceType {\n OPERATION = 'operation',\n RESOURCE_COUNT = 'resource_count',\n CUSTOM = 'custom',\n}\n\n/**\n * Where one metered usage row stands with respect to the provider flush.\n *\n * This was a BOOLEAN (`reportedToProvider`) until 2026-09-09, and the third state is the whole\n * reason it is an enum now (#512). A boolean can say \"not yet reported\" and \"reported\", and the\n * flush selects on the first — so a row that can NEVER be reported has nowhere to go. It stays\n * pending, is re-selected by every run, fails identically, and grows an error backlog that no\n * operator action can drain, on a five-minute schedule.\n *\n * The three states are genuinely distinct and must not be collapsed:\n *\n * - {@link PENDING} — the flush will try again. Every newly recorded row starts here.\n * - {@link REPORTED} — the provider acknowledged the quantity. `reportedAt` says when. Terminal,\n * and money has moved: never move a row back out of this state.\n * - {@link UNREPORTABLE} — the flush determined the row can never be reported, for a reason named\n * in `unreportableReason`. Terminal, and NO money moved. Marking such a row `REPORTED` instead\n * would drain the backlog just as well and would be a lie no later reader could detect, which is\n * exactly why the state exists rather than a shortcut.\n */\nexport enum UsageRecordFlushState {\n PENDING = 'pending',\n REPORTED = 'reported',\n UNREPORTABLE = 'unreportable',\n}\n\n/**\n * Why a usage row was determined to be permanently unreportable.\n *\n * One member today, and it is a closed vocabulary rather than a free string because the operator\n * reading a retained financial record needs to know which permanent condition applies — and because\n * the distinction between a PERMANENT and a TRANSIENT failure is the judgement this whole state\n * turns on. A billing account that merely has no `providerCustomerId` yet is transient: the account\n * exists, provisioning may still complete, and such a row stays {@link UsageRecordFlushState.PENDING}.\n * Only a condition that cannot resolve itself belongs here.\n */\nexport enum UsageRecordUnreportableReason {\n /**\n * The billing account row no longer exists.\n *\n * Reachable by design: usage rows are RETAINED when their subject is erased (the tax/audit\n * obligation on `usage-record.shared.schemas.ts`), so a deleted account legitimately leaves rows\n * behind with no provider customer to report them to. Nothing can restore the mapping, so the\n * quantity will never be billed and saying so on the row is the only honest outcome.\n */\n BILLING_ACCOUNT_DELETED = 'billing_account_deleted',\n}\n\n// ── Tax ────────────────────────────────────────────────────────────\n\n// TaxDisplayMode: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n/**\n * Tax calculation mode: provider-managed or disabled.\n */\nexport enum TaxCalculationMode {\n PROVIDER_MANAGED = 'provider_managed',\n DISABLED = 'disabled',\n}\n\n// ── Subscription & Invoice Status ──────────────────────────────────\n\n// SubscriptionStatus: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// InvoiceStatus: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// It moved there on 2026-09-09 so `StandardBilling_InvoiceData` could name it; the specifier every\n// consumer imports is unchanged.\n\n// ── Billing Scope ──────────────────────────────────────────────────\n\n/**\n * Billing-compatible scope types.\n * Subset of ResourcePrimaryScope — excludes APPLICATION which has no billing variants.\n * Used by scope-agnostic billing resources (e.g., Referrals) that reference\n * billing accounts across different polymorphic collections.\n */\nexport enum BillingScopeType {\n ORGANIZATIONS = 'organizations',\n USER_SELF = 'user_self',\n}\n\n// ── Promotions & Referrals ─────────────────────────────────────────\n\n/**\n * Promotion type.\n */\nexport enum PromotionType {\n /** Direct discount */\n COUPON = 'coupon',\n /** Code-based discount */\n PROMOTION_CODE = 'promotion_code',\n /** Referral program */\n REFERRAL = 'referral',\n /** Special deal/offer */\n DEAL = 'deal',\n}\n\n/**\n * Discount type for promotions.\n */\nexport enum DiscountType {\n PERCENTAGE = 'percentage',\n FIXED_AMOUNT = 'fixed_amount',\n}\n\n/**\n * Promotion duration (how long the discount applies).\n */\nexport enum PromotionDuration {\n ONCE = 'once',\n REPEATING = 'repeating',\n FOREVER = 'forever',\n}\n\n/**\n * Referral status lifecycle.\n */\nexport enum ReferralStatus {\n PENDING = 'pending',\n ACCEPTED = 'accepted',\n CONVERTED = 'converted',\n EXPIRED = 'expired',\n CANCELLED = 'cancelled',\n}\n\n/**\n * Reward type for the referrer (person who referred).\n */\nexport enum ReferrerRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n COMMISSION = 'commission',\n}\n\n/**\n * Reward type for the referred (new customer).\n */\nexport enum ReferredRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n TRIAL_EXTENSION = 'trial_extension',\n}\n\n// ── Provider checkout metadata: the framework/caller trust boundary ─────────────\n\n/**\n * Prefix that marks a provider-metadata key as FRAMEWORK-AUTHORITATIVE.\n *\n * ## Why a reserved namespace exists at all\n *\n * A provider checkout session carries ONE flat `metadata` map, and two parties want to write into\n * it: the framework (which needs to recognise the purchase when the provider echoes the session\n * back on `checkout.session.completed`) and the application's own caller (who legitimately wants\n * to tag the purchase for their analytics or reconciliation).\n *\n * Those two writers do not have the same authority. The framework's entries decide WHICH billing\n * account is credited and HOW MUCH — the provider replays them verbatim inside a genuinely SIGNED\n * webhook, so a signature proves the provider sent them, never that the framework wrote them. The\n * caller's entries decide nothing.\n *\n * Sharing one un-partitioned namespace between those two authorities is what turned a caller-supplied\n * map into a credit-minting primitive: the producer spread caller metadata LAST, so `billingAccountId`\n * / `productKey` / `quantity` were simply overwritable, and the webhook consumer read the result back\n * as trusted framework state. Ordering alone is not the fix — swapping the spread leaves an\n * unmarked namespace in which the NEXT authoritative key is one careless line from being overridable\n * again. The prefix makes the trust boundary a property of the KEY, so it survives refactors.\n *\n * The boundary is enforced in three places, deliberately overlapping:\n * 1. the OPEN_CHECKOUT request DTO REFUSES any caller key carrying this prefix (loud, at the edge);\n * 2. the metadata builder writes the reserved entries LAST (structural, cannot be forgotten);\n * 3. the webhook consumer reads ONLY reserved keys, and re-derives the billing account from\n * provider-authoritative data rather than trusting the echoed value.\n *\n * @see BillingCheckoutMetadataKey for the reserved key vocabulary itself.\n */\nexport const BILLING_RESERVED_METADATA_KEY_PREFIX = 'wildo_';\n\n/**\n * The closed vocabulary of framework-authoritative provider-metadata keys.\n *\n * Every member MUST start with {@link BILLING_RESERVED_METADATA_KEY_PREFIX} — that is what makes the\n * DTO's caller-key refusal and the consumer's read-only-reserved rule line up. A member added\n * without the prefix would be silently overridable by a caller, which is the whole defect this\n * vocabulary exists to prevent, so a pinned test asserts the prefix across every member.\n *\n * Named rather than inlined because each member carries a different obligation on the consumer side\n * (one is cross-checked against provider truth, one selects the product, one is bounded and\n * strictly parsed) and a bare string literal has nowhere to record that.\n */\nexport enum BillingCheckoutMetadataKey {\n /**\n * The billing account the checkout was opened FOR.\n *\n * Written for traceability and cross-checking only. The webhook consumer re-derives the account\n * from the provider-authoritative customer id on the event and REFUSES the event if the echoed\n * value disagrees — it is never used as the account to credit.\n */\n BILLING_ACCOUNT_ID = 'wildo_billingAccountId',\n /** The catalog product key purchased — selects the credit pool and credits-per-unit on top-up. */\n PRODUCT_KEY = 'wildo_productKey',\n /**\n * The PROMOTION row whose code the framework validated when it opened this checkout, so the\n * redemption can be counted when the session COMPLETES (#518).\n *\n * Absent when the purchase used no code, which is the common case.\n *\n * Stamped rather than re-derived from the completed session, because the provider reports the\n * DISCOUNT it applied and not the Wildo row that authorised it — and the row is what carries\n * `maxRedemptions`. Like every key here it is written for the framework's own reconciliation and is\n * never trusted as authority on its own: the redemption is counted with a compare-and-swap that\n * refuses past the cap, so a tampered value can at worst count a redemption against a promotion\n * that has room for one.\n */\n PROMOTION_ID = 'wildo_promotionId',\n /**\n * The purchased quantity, as a decimal integer string (provider metadata values are strings).\n * Strictly parsed and bounded by {@link BILLING_CHECKOUT_MAX_QUANTITY} on the way back in.\n */\n QUANTITY = 'wildo_quantity',\n}\n\n/**\n * Upper bound on a single checkout's line-item quantity, applied on BOTH sides of the provider\n * round trip: the OPEN_CHECKOUT request DTO refuses more, and the webhook consumer refuses to\n * honour more.\n *\n * One shared constant rather than two, because a consumer bound lower than the producer bound would\n * silently refuse legitimate large purchases the framework itself allowed to be billed — the\n * failure mode where the customer is charged and the credits never arrive.\n *\n * The value is a framework policy ceiling, not a provider-derived one: it is deliberately far above\n * any plausible self-serve purchase and far below the range where an unbounded quantity becomes a\n * credit-minting primitive. An application whose catalog genuinely sells in larger units should\n * raise it here, where both sides read it, rather than at either end.\n */\nexport const BILLING_CHECKOUT_MAX_QUANTITY = 999_999;\n"]}
1
+ {"version":3,"file":"billing-enums.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-enums.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAE3J,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAN,IAAY,WAaX;AAbD,WAAY,WAAW;IACrB,gEAAgE;IAChE,4BAAa,CAAA;IACb,6DAA6D;IAC7D,8BAAe,CAAA;IACf,kEAAkE;IAClE,kCAAmB,CAAA;IACnB,6EAA6E;IAC7E,oCAAqB,CAAA;IACrB,sEAAsE;IACtE,0CAA2B,CAAA;IAC3B,0EAA0E;IAC1E,4BAAa,CAAA;AACf,CAAC,EAbW,WAAW,KAAX,WAAW,QAatB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED,sEAAsE;AAEtE;;GAEG;AACH,8FAA8F;AAC9F,gGA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,8BAOX;AAPD,WAAY,8BAA8B;IACxC;;;;OAIG;IACH,6DAA2B,CAAA;AAC7B,CAAC,EAPW,8BAA8B,KAA9B,8BAA8B,QAOzC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,OAAO,CAAC","sourcesContent":["/**\n * Billing Enums (Shared)\n *\n * All billing-system enums used across backend, frontend, and shared models.\n * These supersede the legacy enums from billing.shared.schemas.ts.\n *\n * Enums shared with the standard billing interface (PricingModel, BillingInterval,\n * TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior) are defined in\n * @wildo-ai/external-connectors-models and re-exported here for convenience.\n *\n * @see billing-and-features-system.md §6 (Billing Schemas)\n */\n\nexport { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior } from '@wildo-ai/external-connectors-models';\n\n// ── Product & Pricing ──────────────────────────────────────────────\n\n/**\n * @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer\n *\n * The vocabularies an application types into its own product catalogue — the `ProductDefinition[]`\n * it exports from its shared library and hands to the engine with its module declarations.\n *\n * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`\n * are re-exported from the connector models, because their values ARE the provider's wire values.\n *\n * The authored catalogue is the source of truth; provider-dashboard edits are not read back.\n * A complete sync detects active local product keys absent from the array and deactivates those\n * products and their active local prices, retaining the rows and reporting live subscribers.\n * It does not archive provider products/prices or migrate/cancel subscribers. Treat provider\n * retirement and customer migration as separate decisions, and inspect the complete sync result.\n *\n * Product types available in the billing catalog.\n *\n * | Type | Creates subscription? | Repeatable? | Grants features? | Usage tracked? |\n * |-------------|----------------------|-------------|------------------|----------------|\n * | PLAN | Yes (exclusive) | No (switch) | Yes | No |\n * | ADDON | Yes (stackable) | No (toggle) | Yes | No |\n * | METERED | Yes | No | Optional | Yes |\n * | ONE_TIME | No | No (once) | Optional | No |\n * | CREDIT_PACK | No | Yes | No (credits) | Credits-based |\n * | ITEM | No | Yes | Optional | No |\n */\nexport enum ProductType {\n /** Subscription plan, mutually exclusive per billing account */\n PLAN = 'plan',\n /** Optional subscription add-on, stackable on top of plan */\n ADDON = 'addon',\n /** Usage-based subscription (consumption reported to provider) */\n METERED = 'metered',\n /** Single purchase, once per billing account (e.g., setup fee, migration) */\n ONE_TIME = 'one_time',\n /** Buy a pack of credits/tokens (repeatable, consumable over time) */\n CREDIT_PACK = 'credit_pack',\n /** Purchasable item, repeatable (e.g., report generation, data export) */\n ITEM = 'item',\n}\n\n/**\n * Limit grant mode: how this product's limits compose with other products.\n * - SET: absolute value (replaces, used for PLAN base limits)\n * - ADD: additive (stacks on top, used for ADDON bonus limits)\n */\nexport enum LimitGrantMode {\n SET = 'set',\n ADD = 'add',\n}\n\n// ── Billing Lifecycle ──────────────────────────────────────────────\n\n/**\n * Proration behavior for plan changes (upgrade/downgrade).\n */\n// ProrationBehavior: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// Moved there 2026-09-08 (#516) because its three values ARE the provider's wire values, so the\n// request contract has to be able to name the type — see TaxDisplayMode for the same reasoning.\n\n/**\n * Billing timing: when to apply plan changes.\n */\nexport enum BillingTiming {\n IMMEDIATE = 'immediate',\n AT_PERIOD_END = 'at_period_end',\n}\n/** @wildo_source:part:end saas.models.billing.catalog-vocabularies */\n\n// BillingInterval: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// ── Metering & Usage ───────────────────────────────────────────────\n\n/**\n * Metering aggregation window for usage records.\n */\nexport enum MeteringAggregationWindow {\n PER_FLUSH = 'per_flush',\n PER_BILLING_PERIOD = 'per_billing_period',\n}\n\n/**\n * Usage aggregation type for metered prices.\n */\nexport enum UsageAggregationType {\n SUM = 'sum',\n MAX = 'max',\n LAST = 'last',\n}\n\n/**\n * Usage record source type.\n */\nexport enum UsageSourceType {\n OPERATION = 'operation',\n RESOURCE_COUNT = 'resource_count',\n CUSTOM = 'custom',\n}\n\n/**\n * Where one metered usage row stands with respect to the provider flush.\n *\n * This was a BOOLEAN (`reportedToProvider`) until 2026-09-09, and the third state is the whole\n * reason it is an enum now (#512). A boolean can say \"not yet reported\" and \"reported\", and the\n * flush selects on the first — so a row that can NEVER be reported has nowhere to go. It stays\n * pending, is re-selected by every run, fails identically, and grows an error backlog that no\n * operator action can drain, on a five-minute schedule.\n *\n * The three states are genuinely distinct and must not be collapsed:\n *\n * - {@link PENDING} — the flush will try again. Every newly recorded row starts here.\n * - {@link REPORTED} — the provider acknowledged the quantity. `reportedAt` says when. Terminal,\n * and money has moved: never move a row back out of this state.\n * - {@link UNREPORTABLE} — the flush determined the row can never be reported, for a reason named\n * in `unreportableReason`. Terminal, and NO money moved. Marking such a row `REPORTED` instead\n * would drain the backlog just as well and would be a lie no later reader could detect, which is\n * exactly why the state exists rather than a shortcut.\n */\nexport enum UsageRecordFlushState {\n PENDING = 'pending',\n REPORTED = 'reported',\n UNREPORTABLE = 'unreportable',\n}\n\n/**\n * Why a usage row was determined to be permanently unreportable.\n *\n * One member today, and it is a closed vocabulary rather than a free string because the operator\n * reading a retained financial record needs to know which permanent condition applies — and because\n * the distinction between a PERMANENT and a TRANSIENT failure is the judgement this whole state\n * turns on. A billing account that merely has no `providerCustomerId` yet is transient: the account\n * exists, provisioning may still complete, and such a row stays {@link UsageRecordFlushState.PENDING}.\n * Only a condition that cannot resolve itself belongs here.\n */\nexport enum UsageRecordUnreportableReason {\n /**\n * The billing account row no longer exists.\n *\n * Reachable by design: usage rows are RETAINED when their subject is erased (the tax/audit\n * obligation on `usage-record.shared.schemas.ts`), so a deleted account legitimately leaves rows\n * behind with no provider customer to report them to. Nothing can restore the mapping, so the\n * quantity will never be billed and saying so on the row is the only honest outcome.\n */\n BILLING_ACCOUNT_DELETED = 'billing_account_deleted',\n}\n\n// ── Provider reconciliation ────────────────────────────────────────\n\n/**\n * What KIND of disagreement a billing reconciliation run found between local billing state and the\n * provider.\n *\n * A closed vocabulary rather than free text on a log line, because each kind has a different\n * treatment and a different meaning when it persists, and a recorded run has to be able to say\n * which one it saw how many times:\n *\n * - the two DRIFT kinds and the MISSING kind are REPAIRED, within the provider-authoritative field\n * set only;\n * - {@link SUBSCRIPTION_PROVIDER_STATE_UNREADABLE} is NEVER repaired — a failed read, including a\n * provider saying the subscription does not exist, is not evidence the subscription ended, so it\n * is reported and nothing is written.\n *\n * A steady non-zero count of any repaired kind means webhook delivery is failing and the sweep is\n * papering over it; that is a different problem from the sweep failing, and only a per-kind count\n * can tell them apart.\n */\nexport enum BillingReconciliationDivergenceKind {\n /** A live, provider-linked subscription disagreed with the provider on at least one provider-authoritative field. */\n SUBSCRIPTION_FIELD_DRIFT = 'subscription_field_drift',\n /** The provider's state for a provider-linked subscription could not be read. Reported only; local state is untouched. */\n SUBSCRIPTION_PROVIDER_STATE_UNREADABLE = 'subscription_provider_state_unreadable',\n /** An invoice the provider holds for a known customer had no local record — its webhook was never delivered. */\n INVOICE_MISSING_LOCALLY = 'invoice_missing_locally',\n /** A locally recorded invoice carried a different status from the provider's. */\n INVOICE_STATUS_DRIFT = 'invoice_status_drift',\n}\n\n/**\n * A population a reconciliation run met and deliberately did NOT compare against the provider.\n *\n * Counted per run, because a sweep that silently skips rows is indistinguishable from one that\n * compared them and found agreement — and \"we reconciled everything\" is only a true sentence when\n * the skipped populations are stated beside it. Each member is a DECISION with a reason, not a gap:\n *\n * Populations that are never compared by design and therefore never met at all — terminal\n * subscriptions, subscriptions known only to the provider, subscription items, invoice totals, and\n * invoices older than the per-customer lookback — are named on `BillingReconciliationBackendService`\n * rather than here, because a run cannot count what it never selects.\n */\nexport enum BillingReconciliationUncomparedPopulation {\n /** A local subscription with no provider link: there is no provider record to compare it against. */\n SUBSCRIPTION_WITHOUT_PROVIDER_LINK = 'subscription_without_provider_link',\n /**\n * A provider-linked subscription whose mutation slot holds a PREPARED admission: one of its mutations is\n * about to call the provider, so the run neither read nor wrote it. Its next run re-reads it.\n */\n SUBSCRIPTION_MUTATION_ADMISSION_PREPARED = 'subscription_mutation_admission_prepared',\n /**\n * A provider-linked subscription the run read and found disagreeing, but whose mutation slot was written after that read, so nothing\n * was written: the difference may already be gone. The writer is not always a mutation or a webhook — recovery moving a held\n * generation behind newer ones advances the same version without settling anything — so this counts a read to REPEAT, never a\n * mutation observed. Counted here rather than as a divergence the run cannot confirm. Its next run re-reads it.\n */\n SUBSCRIPTION_SUPERSEDED_BEFORE_REPAIR = 'subscription_superseded_before_repair',\n /**\n * A provider-linked subscription whose billing account or provider link no longer matches the identity its mutation slot\n * records. A mutation refuses the same condition as `slot_identity_changed`; the run neither compares nor writes it, and it\n * stays held until recovery resolves the slot.\n */\n SUBSCRIPTION_SLOT_IDENTITY_CHANGED = 'subscription_slot_identity_changed',\n /** A billing account with no provider customer: nothing at the provider can hold its invoices. */\n BILLING_ACCOUNT_WITHOUT_PROVIDER_CUSTOMER = 'billing_account_without_provider_customer',\n /**\n * A billing scope whose rows exceeded one run's page ceiling. The remainder is left to the next run:\n * reconciliation is idempotent, so a prefix is safe, but the count says the run did not cover the scope.\n */\n SCOPE_TRUNCATED_AT_PAGE_CEILING = 'scope_truncated_at_page_ceiling',\n}\n\n// ── Tax ────────────────────────────────────────────────────────────\n\n// TaxDisplayMode: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n/**\n * Tax calculation mode: provider-managed or disabled.\n */\nexport enum TaxCalculationMode {\n PROVIDER_MANAGED = 'provider_managed',\n DISABLED = 'disabled',\n}\n\n// ── Subscription & Invoice Status ──────────────────────────────────\n\n// SubscriptionStatus: re-exported from @wildo-ai/external-connectors-models (see top of file)\n\n// InvoiceStatus: re-exported from @wildo-ai/external-connectors-models (see top of file).\n// It moved there on 2026-09-09 so `StandardBilling_InvoiceData` could name it; the specifier every\n// consumer imports is unchanged.\n\n// ── Billing Scope ──────────────────────────────────────────────────\n\n/**\n * Billing-compatible scope types.\n * Subset of ResourcePrimaryScope — excludes APPLICATION which has no billing variants.\n * Used by scope-agnostic billing resources (e.g., Referrals) that reference\n * billing accounts across different polymorphic collections.\n */\nexport enum BillingScopeType {\n ORGANIZATIONS = 'organizations',\n USER_SELF = 'user_self',\n}\n\n// ── Promotions & Referrals ─────────────────────────────────────────\n\n/**\n * Promotion type.\n */\nexport enum PromotionType {\n /** Direct discount */\n COUPON = 'coupon',\n /** Code-based discount */\n PROMOTION_CODE = 'promotion_code',\n /** Referral program */\n REFERRAL = 'referral',\n /** Special deal/offer */\n DEAL = 'deal',\n}\n\n/**\n * Discount type for promotions.\n */\nexport enum DiscountType {\n PERCENTAGE = 'percentage',\n FIXED_AMOUNT = 'fixed_amount',\n}\n\n/**\n * Promotion duration (how long the discount applies).\n */\nexport enum PromotionDuration {\n ONCE = 'once',\n REPEATING = 'repeating',\n FOREVER = 'forever',\n}\n\n/**\n * Referral status lifecycle.\n */\nexport enum ReferralStatus {\n PENDING = 'pending',\n ACCEPTED = 'accepted',\n CONVERTED = 'converted',\n EXPIRED = 'expired',\n CANCELLED = 'cancelled',\n}\n\n/**\n * Reward type for the referrer (person who referred).\n */\nexport enum ReferrerRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n COMMISSION = 'commission',\n}\n\n/**\n * Reward type for the referred (new customer).\n */\nexport enum ReferredRewardType {\n CREDIT = 'credit',\n DISCOUNT = 'discount',\n FEATURE = 'feature',\n TRIAL_EXTENSION = 'trial_extension',\n}\n\n// ── Provider checkout metadata: the framework/caller trust boundary ─────────────\n\n/**\n * Prefix that marks a provider-metadata key as FRAMEWORK-AUTHORITATIVE.\n *\n * ## Why a reserved namespace exists at all\n *\n * A provider checkout session carries ONE flat `metadata` map, and two parties want to write into\n * it: the framework (which needs to recognise the purchase when the provider echoes the session\n * back on `checkout.session.completed`) and the application's own caller (who legitimately wants\n * to tag the purchase for their analytics or reconciliation).\n *\n * Those two writers do not have the same authority. The framework's entries decide WHICH billing\n * account is credited and HOW MUCH — the provider replays them verbatim inside a genuinely SIGNED\n * webhook, so a signature proves the provider sent them, never that the framework wrote them. The\n * caller's entries decide nothing.\n *\n * Sharing one un-partitioned namespace between those two authorities is what turned a caller-supplied\n * map into a credit-minting primitive: the producer spread caller metadata LAST, so `billingAccountId`\n * / `productKey` / `quantity` were simply overwritable, and the webhook consumer read the result back\n * as trusted framework state. Ordering alone is not the fix — swapping the spread leaves an\n * unmarked namespace in which the NEXT authoritative key is one careless line from being overridable\n * again. The prefix makes the trust boundary a property of the KEY, so it survives refactors.\n *\n * The boundary is enforced in three places, deliberately overlapping:\n * 1. the OPEN_CHECKOUT request DTO REFUSES any caller key carrying this prefix (loud, at the edge);\n * 2. the metadata builder writes the reserved entries LAST (structural, cannot be forgotten);\n * 3. the webhook consumer reads ONLY reserved keys, and re-derives the billing account from\n * provider-authoritative data rather than trusting the echoed value.\n *\n * @see BillingCheckoutMetadataKey for the reserved key vocabulary itself.\n */\nexport const BILLING_RESERVED_METADATA_KEY_PREFIX = 'wildo_';\n\n/**\n * The closed vocabulary of framework-authoritative provider-metadata keys.\n *\n * Every member MUST start with {@link BILLING_RESERVED_METADATA_KEY_PREFIX} — that is what makes the\n * DTO's caller-key refusal and the consumer's read-only-reserved rule line up. A member added\n * without the prefix would be silently overridable by a caller, which is the whole defect this\n * vocabulary exists to prevent, so a pinned test asserts the prefix across every member.\n *\n * Named rather than inlined because each member carries a different obligation on the consumer side\n * (one is cross-checked against provider truth, one selects the product, one is bounded and\n * strictly parsed) and a bare string literal has nowhere to record that.\n */\nexport enum BillingCheckoutMetadataKey {\n /**\n * The billing account the checkout was opened FOR.\n *\n * Written for traceability and cross-checking only. The webhook consumer re-derives the account\n * from the provider-authoritative customer id on the event and REFUSES the event if the echoed\n * value disagrees — it is never used as the account to credit.\n */\n BILLING_ACCOUNT_ID = 'wildo_billingAccountId',\n /** The catalog product key purchased — selects the credit pool and credits-per-unit on top-up. */\n PRODUCT_KEY = 'wildo_productKey',\n /**\n * The PROMOTION row whose code the framework validated when it opened this checkout, so the\n * redemption can be counted when the session COMPLETES (#518).\n *\n * Absent when the purchase used no code, which is the common case.\n *\n * Stamped rather than re-derived from the completed session, because the provider reports the\n * DISCOUNT it applied and not the Wildo row that authorised it — and the row is what carries\n * `maxRedemptions`. Like every key here it is written for the framework's own reconciliation and is\n * never trusted as authority on its own: the redemption is counted with a compare-and-swap that\n * refuses past the cap, so a tampered value can at worst count a redemption against a promotion\n * that has room for one.\n */\n PROMOTION_ID = 'wildo_promotionId',\n /**\n * The purchased quantity, as a decimal integer string (provider metadata values are strings).\n * Strictly parsed and bounded by {@link BILLING_CHECKOUT_MAX_QUANTITY} on the way back in.\n */\n QUANTITY = 'wildo_quantity',\n}\n\n/**\n * Framework-authoritative metadata keys the engine writes on a provider SUBSCRIPTION (#535), in the same reserved namespace\n * as {@link BillingCheckoutMetadataKey} and under the same rule: every member starts with\n * {@link BILLING_RESERVED_METADATA_KEY_PREFIX}, so no caller-authored metadata can be mistaken for it.\n */\nexport enum BillingSubscriptionMetadataKey {\n /**\n * `<slotId>:<generation>` of the subscription mutation that sent the update. Written so reconciliation can match a\n * provider object to the durable mutation that caused it — including a change whose response was lost. A reference, never\n * authority on its own: a match is confirmed against the stored mutation's identity.\n */\n MUTATION = 'wildo_mutation',\n}\n\n/**\n * Upper bound on a single checkout's line-item quantity, applied on BOTH sides of the provider\n * round trip: the OPEN_CHECKOUT request DTO refuses more, and the webhook consumer refuses to\n * honour more.\n *\n * One shared constant rather than two, because a consumer bound lower than the producer bound would\n * silently refuse legitimate large purchases the framework itself allowed to be billed — the\n * failure mode where the customer is charged and the credits never arrive.\n *\n * The value is a framework policy ceiling, not a provider-derived one: it is deliberately far above\n * any plausible self-serve purchase and far below the range where an unbounded quantity becomes a\n * credit-minting primitive. An application whose catalog genuinely sells in larger units should\n * raise it here, where both sides read it, rather than at either end.\n */\nexport const BILLING_CHECKOUT_MAX_QUANTITY = 999_999;\n"]}
@@ -12,13 +12,14 @@ import type { MoneyValue } from '@wildo-ai/zod-decorators';
12
12
  import { ResourcePrimaryScope } from '../resources/resources.shared.schemas';
13
13
  export type { StandardBilling_SubscriptionData, StandardBilling_InvoicePreview } from '@wildo-ai/external-connectors-models';
14
14
  /**
15
- * Invoice preview: returned by previewPlanChange() to show prorated cost before committing.
16
- * Data comes from provider (Stripe's upcoming invoice API), NOT stored locally.
15
+ * Presentation value used by the billing plan-change preview. BillingContext transports the
16
+ * provider DTO; the plan-change flow converts its minor-unit amounts into this money shape.
17
+ * Invoice amount due must not be presented as an immediate charge without the resolved settlement policy.
17
18
  *
18
19
  * All monetary amounts use MoneyValue for bigint precision and self-contained currency.
19
20
  */
20
21
  export interface InvoicePreview {
21
- /** Prorated amount to charge/credit */
22
+ /** Previewed invoice amount due; settlement timing must be stated separately. */
22
23
  amount: MoneyValue;
23
24
  /** Line items breakdown (what changed, prorated amounts) */
24
25
  lineItems: Array<{
@@ -26,7 +27,7 @@ export interface InvoicePreview {
26
27
  amount: MoneyValue;
27
28
  quantity: number;
28
29
  }>;
29
- /** When this amount would be charged */
30
+ /** Invoice period boundaries, not a guaranteed charge time. */
30
31
  periodStart: Date;
31
32
  periodEnd: Date;
32
33
  }
@@ -74,7 +75,26 @@ export type CreditPoolBalance = z.infer<typeof CreditPoolBalanceSchema>;
74
75
  * project the external response. `BillingStateResponse` is derived from it so the
75
76
  * type and the runtime contract cannot drift.
76
77
  */
78
+ /** Independently loaded portions of the aggregate. Derived catalog projections use PRODUCTS. */
79
+ export declare enum BillingStateSlice {
80
+ BILLING_ACCOUNT = "billingAccount",
81
+ SUBSCRIPTION = "subscription",
82
+ PRODUCTS = "products",
83
+ PRICES = "prices",
84
+ INVOICES = "invoices",
85
+ USAGE = "usage",
86
+ CREDIT_POOLS = "creditPools",
87
+ ACTIVE_PROMOTIONS = "activePromotions"
88
+ }
89
+ /** Empty data is meaningful only when its query (and required dependencies) succeeded. */
90
+ export declare enum BillingSliceAvailability {
91
+ AVAILABLE = "available",
92
+ UNAVAILABLE = "unavailable"
93
+ }
94
+ export declare const BillingStateAvailabilitySchema: z.ZodRecord<z.ZodEnum<typeof BillingStateSlice>, z.ZodEnum<typeof BillingSliceAvailability>>;
95
+ export type BillingStateAvailability = z.infer<typeof BillingStateAvailabilitySchema>;
77
96
  export declare const BillingStateResponseSchema: z.ZodObject<{
97
+ availability: z.ZodRecord<z.ZodEnum<typeof BillingStateSlice>, z.ZodEnum<typeof BillingSliceAvailability>>;
78
98
  billingAccount: z.ZodNullable<z.ZodObject<{
79
99
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
80
100
  providerCustomerId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>;
@@ -237,6 +257,7 @@ export declare const BillingStateResponseSchema: z.ZodObject<{
237
257
  createdAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodDate>>>;
238
258
  updatedAt: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodDate>>>;
239
259
  }, z.core.$strip>>;
260
+ acquirableProductKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
240
261
  scopeType: z.ZodEnum<typeof ResourcePrimaryScope>;
241
262
  }, z.core.$strip>;
242
263
  export type BillingStateResponse = z.infer<typeof BillingStateResponseSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"billing-types.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAO3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAM7E,YAAY,EAAE,gCAAgC,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAI7H;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,MAAM,EAAE,UAAU,CAAC;IACnB,4DAA4D;IAC5D,SAAS,EAAE,KAAK,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,UAAU,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,wCAAwC;IACxC,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;CACjB;AAID;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;;;;;;;iBAc7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"file":"billing-types.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4DrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -63,7 +63,28 @@ export const CreditPoolBalanceSchema = z.object({
63
63
  * project the external response. `BillingStateResponse` is derived from it so the
64
64
  * type and the runtime contract cannot drift.
65
65
  */
66
+ /** Independently loaded portions of the aggregate. Derived catalog projections use PRODUCTS. */
67
+ export var BillingStateSlice;
68
+ (function (BillingStateSlice) {
69
+ BillingStateSlice["BILLING_ACCOUNT"] = "billingAccount";
70
+ BillingStateSlice["SUBSCRIPTION"] = "subscription";
71
+ BillingStateSlice["PRODUCTS"] = "products";
72
+ BillingStateSlice["PRICES"] = "prices";
73
+ BillingStateSlice["INVOICES"] = "invoices";
74
+ BillingStateSlice["USAGE"] = "usage";
75
+ BillingStateSlice["CREDIT_POOLS"] = "creditPools";
76
+ BillingStateSlice["ACTIVE_PROMOTIONS"] = "activePromotions";
77
+ })(BillingStateSlice || (BillingStateSlice = {}));
78
+ /** Empty data is meaningful only when its query (and required dependencies) succeeded. */
79
+ export var BillingSliceAvailability;
80
+ (function (BillingSliceAvailability) {
81
+ BillingSliceAvailability["AVAILABLE"] = "available";
82
+ BillingSliceAvailability["UNAVAILABLE"] = "unavailable";
83
+ })(BillingSliceAvailability || (BillingSliceAvailability = {}));
84
+ export const BillingStateAvailabilitySchema = z.record(z.enum(BillingStateSlice), z.enum(BillingSliceAvailability));
66
85
  export const BillingStateResponseSchema = z.object({
86
+ /** Query failures keep their empty transport placeholders but MUST NOT be presented as absence. */
87
+ availability: BillingStateAvailabilitySchema,
67
88
  billingAccount: BillingAccountSchema.nullable(),
68
89
  subscription: BillingSubscriptionBaseSchema.nullable(),
69
90
  products: z.array(ProductSchema),
@@ -80,6 +101,46 @@ export const BillingStateResponseSchema = z.object({
80
101
  * arbitrary checkout item the user might pick next.
81
102
  */
82
103
  activePromotions: z.array(PromotionSchema),
104
+ /**
105
+ * The subset of `products` (by `key`) a caller may ACQUIRE right now — buy, or move a
106
+ * subscription onto.
107
+ *
108
+ * ## Why a sibling key set rather than a filter on `products`
109
+ *
110
+ * One call serves two surfaces that want OPPOSITE things from it. An acquisition surface (a
111
+ * pricing table) must not offer a plan the purchase gate will refuse; a holding surface (the
112
+ * "your current plan" panel, the subscription-item → product resolution in the frontend billing
113
+ * context) must still be able to NAME a plan the catalogue has withdrawn, because a customer
114
+ * already on a retired plan is exactly who needs to see what they hold. Filtering `products` by
115
+ * `isActive` would serve the first and break the second — the same trade the `REMOVE_ADDON` call
116
+ * site settles by reading with `REFERENCE` intent rather than `ACQUIRE`.
117
+ *
118
+ * So the response DISTINGUISHES instead of filtering: `products` stays the full scope-visible
119
+ * catalog, and this set states which of them acquisition may offer.
120
+ *
121
+ * ## Why the server answers it at all
122
+ *
123
+ * `Product.isActive` is the declared off-boarding path, and the backend gate that makes
124
+ * retirement TRUE (`readProductByKey` with `ACQUIRE` intent) applies ONE predicate to it. A
125
+ * listing surface holds rows, not keys, so it cannot use that reader — and every listing left to
126
+ * itself re-derives the rule from the raw column. That had already happened twice by 2026-09-09,
127
+ * in a frontend component and in the reader, agreeing only by luck. This set is computed by the
128
+ * gate's own predicate, so a surface that reads it cannot drift from what checkout will accept.
129
+ *
130
+ * NOT a visibility answer: `isPublic` is a per-surface decision the server cannot take for every
131
+ * caller (a back-office catalog shows non-public rows). A customer pricing table composes the
132
+ * two; it must not re-spell either.
133
+ *
134
+ * The aggregate producer sets this field and BillingContext preserves it. Consumers
135
+ * must check PRODUCTS availability before interpreting this projection: an empty set
136
+ * from an unavailable catalog does not prove that nothing can be acquired.
137
+ *
138
+ * Absence therefore means "the producer did not project acquirability", never "nothing is
139
+ * acquirable" and never "everything is". A consumer that receives the set MUST use it in
140
+ * preference to re-deriving the rule; a consumer that does not is on the older, weaker footing
141
+ * this field exists to retire.
142
+ */
143
+ acquirableProductKeys: z.array(z.string()).optional(),
83
144
  scopeType: z.enum(ResourcePrimaryScope),
84
145
  });
85
146
  //# sourceMappingURL=billing-types.shared.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing-types.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AA8B7E,sEAAsE;AAEtE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,sDAAsD;IACtD,SAAS,EAAE,CAAC,CAAC,MAAM,CACjB,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,MAAM,CAAC;QACP,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;QAC9B,0CAA0C;QAC1C,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC1C,6DAA6D;QAC7D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,6BAA6B;QAC7B,cAAc,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;KACpC,CAAC,CACH;CACF,CAAC,CAAC;AAGH,sEAAsE;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAGH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC/C,YAAY,EAAE,6BAA6B,CAAC,QAAQ,EAAE;IACtD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;IAChC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACnC,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,uBAAuB,CAAC;IAC1D;;;;;;;OAOG;IACH,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;IAC1C,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC;CACxC,CAAC,CAAC","sourcesContent":["/**\n * Billing Supporting Types (Shared)\n *\n * Types used by the billing API, frontend hooks, and provider interface.\n * These are NOT DB schemas — they are API response shapes, provider abstractions,\n * and aggregated views.\n *\n * @see billing-and-features-system.md §6.2c (Supporting Types)\n */\n\nimport { z } from 'zod';\nimport type { MoneyValue } from '@wildo-ai/zod-decorators';\nimport { BillingAccountSchema } from './billing-account.shared.schemas';\nimport { BillingSubscriptionBaseSchema } from './subscription.shared.schemas';\nimport { ProductSchema } from './product.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\nimport { InvoiceRefSchema } from './invoice-ref.shared.schemas';\nimport { PromotionSchema } from './promotions.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\n\n// ── Provider Canonical Types ───────────────────────────────────────\n// StandardBilling_SubscriptionData and StandardBilling_InvoicePreview are\n// defined in @wildo-ai/external-connectors-models (standard billing interface)\n// and re-exported here for convenience.\nexport type { StandardBilling_SubscriptionData, StandardBilling_InvoicePreview } from '@wildo-ai/external-connectors-models';\n\n// ── Invoice Preview ────────────────────────────────────────────────\n\n/**\n * Invoice preview: returned by previewPlanChange() to show prorated cost before committing.\n * Data comes from provider (Stripe's upcoming invoice API), NOT stored locally.\n *\n * All monetary amounts use MoneyValue for bigint precision and self-contained currency.\n */\nexport interface InvoicePreview {\n /** Prorated amount to charge/credit */\n amount: MoneyValue;\n /** Line items breakdown (what changed, prorated amounts) */\n lineItems: Array<{\n description: string;\n amount: MoneyValue;\n quantity: number;\n }>;\n /** When this amount would be charged */\n periodStart: Date;\n periodEnd: Date;\n}\n\n// ── Usage Summary ──────────────────────────────────────────────────\n\n/**\n * Usage summary: aggregated usage data for the frontend UsageDashboard.\n * Computed from UsageRecords, keyed by metered product key.\n *\n * Authored as a Zod schema (not a bare interface) so it can compose into\n * `BillingStateResponseSchema` — the runtime contract wired as the `GET_STATE`\n * custom operation's `customResponseDto`. `UsageSummary` is derived from it to\n * keep the type and the runtime shape from drifting.\n */\nexport const UsageSummarySchema = z.object({\n /** Usage per metered product, keyed by product key */\n byProduct: z.record(\n z.string(),\n z.object({\n currentPeriodUsage: z.number(),\n /** Previous period (for trend display) */\n previousPeriodUsage: z.number().optional(),\n /** Usage limit (from product/subscription, if applicable) */\n limit: z.number().optional(),\n /** Last usage recorded at */\n lastRecordedAt: z.date().optional(),\n }),\n ),\n});\nexport type UsageSummary = z.infer<typeof UsageSummarySchema>;\n\n// ── Billing State Response ─────────────────────────────────────────\n\n/**\n * Per-pool credit balance projection embedded in the aggregated billing state.\n *\n * A lean view (NOT the full `CreditPool` resource) built by the billing-state\n * facade purely for the frontend balance display, keyed by pool key.\n */\nexport const CreditPoolBalanceSchema = z.object({\n available: z.number(),\n totalPurchased: z.number(),\n totalConsumed: z.number(),\n});\nexport type CreditPoolBalance = z.infer<typeof CreditPoolBalanceSchema>;\n\n/**\n * Aggregated billing state returned by the lazy facade endpoint.\n * Single source of truth for frontend BillingProvider and backend controller.\n *\n * Authored as a Zod schema (not a bare interface) because the `GET_STATE`\n * custom operation wires it as its `customResponseDto`. That operation borrows\n * the COUNT verb for its route/verb via `resourceOperationLike` but returns\n * THIS aggregated shape — so without a `customResponseDto` the DTO builder would\n * assign it the COUNT default envelope (`{ count }`), and the service output\n * would fail `transformOutput`'s `internalDto.parse` → HTTP 500. The composed\n * schema gives the builder the real runtime contract to validate against and to\n * project the external response. `BillingStateResponse` is derived from it so the\n * type and the runtime contract cannot drift.\n */\nexport const BillingStateResponseSchema = z.object({\n billingAccount: BillingAccountSchema.nullable(),\n subscription: BillingSubscriptionBaseSchema.nullable(),\n products: z.array(ProductSchema),\n prices: z.array(PriceSchema),\n invoices: z.array(InvoiceRefSchema),\n usage: UsageSummarySchema,\n creditPools: z.record(z.string(), CreditPoolBalanceSchema),\n /**\n * Scope/product-visible promotions for the current billing surface.\n *\n * This list intentionally excludes promotions that are inactive, exhausted,\n * unsynced with the billing provider, or targeted only at products outside the\n * current scope. It is not a promise that every entry is redeemable for any\n * arbitrary checkout item the user might pick next.\n */\n activePromotions: z.array(PromotionSchema),\n scopeType: z.enum(ResourcePrimaryScope),\n});\nexport type BillingStateResponse = z.infer<typeof BillingStateResponseSchema>;\n"]}
1
+ {"version":3,"file":"billing-types.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-types.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAA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C","sourcesContent":["/**\n * Billing Supporting Types (Shared)\n *\n * Types used by the billing API, frontend hooks, and provider interface.\n * These are NOT DB schemas — they are API response shapes, provider abstractions,\n * and aggregated views.\n *\n * @see billing-and-features-system.md §6.2c (Supporting Types)\n */\n\nimport { z } from 'zod';\nimport type { MoneyValue } from '@wildo-ai/zod-decorators';\nimport { BillingAccountSchema } from './billing-account.shared.schemas';\nimport { BillingSubscriptionBaseSchema } from './subscription.shared.schemas';\nimport { ProductSchema } from './product.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\nimport { InvoiceRefSchema } from './invoice-ref.shared.schemas';\nimport { PromotionSchema } from './promotions.shared.schemas';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\n\n// ── Provider Canonical Types ───────────────────────────────────────\n// StandardBilling_SubscriptionData and StandardBilling_InvoicePreview are\n// defined in @wildo-ai/external-connectors-models (standard billing interface)\n// and re-exported here for convenience.\nexport type { StandardBilling_SubscriptionData, StandardBilling_InvoicePreview } from '@wildo-ai/external-connectors-models';\n\n// ── Invoice Preview ────────────────────────────────────────────────\n\n/**\n * Presentation value used by the billing plan-change preview. BillingContext transports the\n * provider DTO; the plan-change flow converts its minor-unit amounts into this money shape.\n * Invoice amount due must not be presented as an immediate charge without the resolved settlement policy.\n *\n * All monetary amounts use MoneyValue for bigint precision and self-contained currency.\n */\nexport interface InvoicePreview {\n /** Previewed invoice amount due; settlement timing must be stated separately. */\n amount: MoneyValue;\n /** Line items breakdown (what changed, prorated amounts) */\n lineItems: Array<{\n description: string;\n amount: MoneyValue;\n quantity: number;\n }>;\n /** Invoice period boundaries, not a guaranteed charge time. */\n periodStart: Date;\n periodEnd: Date;\n}\n\n// ── Usage Summary ──────────────────────────────────────────────────\n\n/**\n * Usage summary: aggregated usage data for the frontend UsageDashboard.\n * Computed from UsageRecords, keyed by metered product key.\n *\n * Authored as a Zod schema (not a bare interface) so it can compose into\n * `BillingStateResponseSchema` — the runtime contract wired as the `GET_STATE`\n * custom operation's `customResponseDto`. `UsageSummary` is derived from it to\n * keep the type and the runtime shape from drifting.\n */\nexport const UsageSummarySchema = z.object({\n /** Usage per metered product, keyed by product key */\n byProduct: z.record(\n z.string(),\n z.object({\n currentPeriodUsage: z.number(),\n /** Previous period (for trend display) */\n previousPeriodUsage: z.number().optional(),\n /** Usage limit (from product/subscription, if applicable) */\n limit: z.number().optional(),\n /** Last usage recorded at */\n lastRecordedAt: z.date().optional(),\n }),\n ),\n});\nexport type UsageSummary = z.infer<typeof UsageSummarySchema>;\n\n// ── Billing State Response ─────────────────────────────────────────\n\n/**\n * Per-pool credit balance projection embedded in the aggregated billing state.\n *\n * A lean view (NOT the full `CreditPool` resource) built by the billing-state\n * facade purely for the frontend balance display, keyed by pool key.\n */\nexport const CreditPoolBalanceSchema = z.object({\n available: z.number(),\n totalPurchased: z.number(),\n totalConsumed: z.number(),\n});\nexport type CreditPoolBalance = z.infer<typeof CreditPoolBalanceSchema>;\n\n/**\n * Aggregated billing state returned by the lazy facade endpoint.\n * Single source of truth for frontend BillingProvider and backend controller.\n *\n * Authored as a Zod schema (not a bare interface) because the `GET_STATE`\n * custom operation wires it as its `customResponseDto`. That operation borrows\n * the COUNT verb for its route/verb via `resourceOperationLike` but returns\n * THIS aggregated shape — so without a `customResponseDto` the DTO builder would\n * assign it the COUNT default envelope (`{ count }`), and the service output\n * would fail `transformOutput`'s `internalDto.parse` → HTTP 500. The composed\n * schema gives the builder the real runtime contract to validate against and to\n * project the external response. `BillingStateResponse` is derived from it so the\n * type and the runtime contract cannot drift.\n */\n/** Independently loaded portions of the aggregate. Derived catalog projections use PRODUCTS. */\nexport enum BillingStateSlice {\n BILLING_ACCOUNT = 'billingAccount',\n SUBSCRIPTION = 'subscription',\n PRODUCTS = 'products',\n PRICES = 'prices',\n INVOICES = 'invoices',\n USAGE = 'usage',\n CREDIT_POOLS = 'creditPools',\n ACTIVE_PROMOTIONS = 'activePromotions',\n}\n\n/** Empty data is meaningful only when its query (and required dependencies) succeeded. */\nexport enum BillingSliceAvailability {\n AVAILABLE = 'available',\n UNAVAILABLE = 'unavailable',\n}\n\nexport const BillingStateAvailabilitySchema = z.record(z.enum(BillingStateSlice), z.enum(BillingSliceAvailability));\nexport type BillingStateAvailability = z.infer<typeof BillingStateAvailabilitySchema>;\n\nexport const BillingStateResponseSchema = z.object({\n /** Query failures keep their empty transport placeholders but MUST NOT be presented as absence. */\n availability: BillingStateAvailabilitySchema,\n billingAccount: BillingAccountSchema.nullable(),\n subscription: BillingSubscriptionBaseSchema.nullable(),\n products: z.array(ProductSchema),\n prices: z.array(PriceSchema),\n invoices: z.array(InvoiceRefSchema),\n usage: UsageSummarySchema,\n creditPools: z.record(z.string(), CreditPoolBalanceSchema),\n /**\n * Scope/product-visible promotions for the current billing surface.\n *\n * This list intentionally excludes promotions that are inactive, exhausted,\n * unsynced with the billing provider, or targeted only at products outside the\n * current scope. It is not a promise that every entry is redeemable for any\n * arbitrary checkout item the user might pick next.\n */\n activePromotions: z.array(PromotionSchema),\n /**\n * The subset of `products` (by `key`) a caller may ACQUIRE right now — buy, or move a\n * subscription onto.\n *\n * ## Why a sibling key set rather than a filter on `products`\n *\n * One call serves two surfaces that want OPPOSITE things from it. An acquisition surface (a\n * pricing table) must not offer a plan the purchase gate will refuse; a holding surface (the\n * \"your current plan\" panel, the subscription-item → product resolution in the frontend billing\n * context) must still be able to NAME a plan the catalogue has withdrawn, because a customer\n * already on a retired plan is exactly who needs to see what they hold. Filtering `products` by\n * `isActive` would serve the first and break the second — the same trade the `REMOVE_ADDON` call\n * site settles by reading with `REFERENCE` intent rather than `ACQUIRE`.\n *\n * So the response DISTINGUISHES instead of filtering: `products` stays the full scope-visible\n * catalog, and this set states which of them acquisition may offer.\n *\n * ## Why the server answers it at all\n *\n * `Product.isActive` is the declared off-boarding path, and the backend gate that makes\n * retirement TRUE (`readProductByKey` with `ACQUIRE` intent) applies ONE predicate to it. A\n * listing surface holds rows, not keys, so it cannot use that reader — and every listing left to\n * itself re-derives the rule from the raw column. That had already happened twice by 2026-09-09,\n * in a frontend component and in the reader, agreeing only by luck. This set is computed by the\n * gate's own predicate, so a surface that reads it cannot drift from what checkout will accept.\n *\n * NOT a visibility answer: `isPublic` is a per-surface decision the server cannot take for every\n * caller (a back-office catalog shows non-public rows). A customer pricing table composes the\n * two; it must not re-spell either.\n *\n * The aggregate producer sets this field and BillingContext preserves it. Consumers\n * must check PRODUCTS availability before interpreting this projection: an empty set\n * from an unavailable catalog does not prove that nothing can be acquired.\n *\n * Absence therefore means \"the producer did not project acquirability\", never \"nothing is\n * acquirable\" and never \"everything is\". A consumer that receives the set MUST use it in\n * preference to re-deriving the rule; a consumer that does not is on the older, weaker footing\n * this field exists to retire.\n */\n acquirableProductKeys: z.array(z.string()).optional(),\n scopeType: z.enum(ResourcePrimaryScope),\n});\nexport type BillingStateResponse = z.infer<typeof BillingStateResponseSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"price.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/price.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAI/C,KAAK,aAAa,GACd,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,iDAAiD,GAC5D,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;iCAsE9C,CAAC"}
1
+ {"version":3,"file":"price.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/price.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAI/C,KAAK,aAAa,GACd,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,iDAAiD,GAC5D,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;iCAoG9C,CAAC"}
@@ -35,12 +35,42 @@ export const pricesResourceConfiguration_InitializationFactory = (resourcesRelat
35
35
  }],
36
36
  },
37
37
  [CoreResourceOperation.LIST]: {
38
- variants: [{
38
+ variants: [
39
+ {
39
40
  variantType: ResourceOperationVariantType.INTERNAL_CALL,
40
41
  isDefault: true,
41
42
  roles: [CORE_APP_ROLES.APP_USER],
42
43
  riskLevel: ResourceOperationRiskLevel.LOW,
43
- }],
44
+ },
45
+ {
46
+ /*
47
+ * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.
48
+ *
49
+ * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives
50
+ * this resource through the service pipeline, and states that these catalog reads have "NO
51
+ * HTTP surface". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`
52
+ * keeps resolving it and no internal seam moves.
53
+ *
54
+ * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`
55
+ * settings destination targets `prices.list` and could never load — the rail entry, the tab and the
56
+ * heading all rendered, and every request 404'd at the ROUTER, because no route was ever
57
+ * mounted. An operator cannot price what they cannot see.
58
+ *
59
+ * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a
60
+ * widening: the aggregated billing state already ships products, prices and active promotions
61
+ * to EVERY authenticated client, so an admin-only list is strictly narrower than what the
62
+ * application discloses today.
63
+ *
64
+ * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is
65
+ * per variant TYPE, so the internal door and the HTTP door each stay the default of their own
66
+ * transport and the HTTP one needs no `variantKey` in its URL.
67
+ */
68
+ variantType: ResourceOperationVariantType.API_CALL,
69
+ isDefault: true,
70
+ roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],
71
+ riskLevel: ResourceOperationRiskLevel.LOW,
72
+ },
73
+ ],
44
74
  },
45
75
  [CoreResourceOperation.CREATE]: {
46
76
  variants: [{
@@ -1 +1 @@
1
- {"version":3,"file":"price.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/price.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD,MAAM,CAAC,MAAM,iDAAiD,GAAG,CAC/D,sBAA8C,EAC9C,EAAE,CAAC,0CAA0C,CAI7C;IACA,UAAU,EAAE,WAAW;IACvB,kBAAkB,EAAE,gBAAgB,CAAC,MAAM;IAC3C,uBAAuB,EAAE,kCAAkC,CAAC,gBAAgB,CAAC,MAAM,CAAC;IACpF,qBAAqB,EAAE,sBAAsB;IAC7C,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACd,qBAAqB,CAAC,IAAI;QAC1B,qBAAqB,CAAC,IAAI;QAC1B,qBAAqB,CAAC,MAAM;QAC5B,qBAAqB,CAAC,MAAM;QAC5B,oEAAoE;QACpE,yEAAyE;QACzE,2DAA2D;QAC3D,oEAAoE;QACpE,qBAAqB,CAAC,MAAM;KAC7B;IACD,uBAAuB,EAAE;QACvB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE;YAC5B,QAA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ACF,CAAC,CAAC","sourcesContent":["/**\n * Price Resource Configuration\n *\n * Admin-managed: APPLICATION-scoped, linked to products.\n */\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\n\ntype PricesCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const pricesResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n undefined,\n PricesCoreOps,\n typeof PriceSchema\n>({\n mainSchema: PriceSchema,\n resourceIdentifier: CoreResourceType.PRICES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PRICES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their\n // owning product is deleted. Without it the cascade throws\n // ErrorType.CONFIGURATION on any product that still has price rows.\n CoreResourceOperation.DELETE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their owning\n // product is deleted. Without a DELETE op the cascade (deleteChildrenImmediate)\n // throws ErrorType.CONFIGURATION on any product that still has price rows.\n // ORG_OWNER/HIGH: mirrors the price write tier (billing catalog is org-owned).\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n});\n"]}
1
+ {"version":3,"file":"price.shared.resources-config.schemas.js","sourceRoot":"","sources":["../../../../src/billing/price.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,kCAAkC,EAAE,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAE7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD,MAAM,CAAC,MAAM,iDAAiD,GAAG,CAC/D,sBAA8C,EAC9C,EAAE,CAAC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C,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C,CAAC;SACH;QACD,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,aAAa;oBACvD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,MAAM;iBAC7C,CAAC;SACH;QAED,yEAAyE;QACzE,gFAAgF;QAChF,gFAAgF;QAChF,2EAA2E;QAC3E,+EAA+E;QAC/E,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE;YAC9B,QAAQ,EAAE,CAAC;oBACT,WAAW,EAAE,4BAA4B,CAAC,eAAe;oBACzD,SAAS,EAAE,IAAI;oBACf,KAAK,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC;oBACjC,SAAS,EAAE,0BAA0B,CAAC,IAAI;iBAC3C,CAAC;SACH;KACF;CACF,CAAC,CAAC","sourcesContent":["/**\n * Price Resource Configuration\n *\n * Admin-managed: APPLICATION-scoped, linked to products.\n */\n\nimport { createResourceConfiguration_Initialization } from '../resources/resources-config.shared.factory';\nimport { CoreResourceOperation, CoreResourceType, coreResourceShared_FieldIdentifier } from '../resources/resources.shared.core.definitions';\nimport {\n ResourceOperationRiskLevel,\n ResourceOperationVariantType,\n ResourceRelationship,\n} from '../resources/resources.shared.schemas';\nimport { CORE_APP_ROLES, CORE_ORG_ROLES } from '../security/authorizations/roles.shared.schemas';\nimport { PriceSchema } from './price.shared.schemas';\n\ntype PricesCoreOps =\n | CoreResourceOperation.READ\n | CoreResourceOperation.LIST\n | CoreResourceOperation.CREATE\n | CoreResourceOperation.UPDATE\n | CoreResourceOperation.DELETE;\n\nexport const pricesResourceConfiguration_InitializationFactory = (\n resourcesRelationships: ResourceRelationship[]\n) => createResourceConfiguration_Initialization<\n undefined,\n PricesCoreOps,\n typeof PriceSchema\n>({\n mainSchema: PriceSchema,\n resourceIdentifier: CoreResourceType.PRICES,\n resourceFieldIdentifier: coreResourceShared_FieldIdentifier[CoreResourceType.PRICES],\n resourceRelationships: resourcesRelationships,\n isSystemResource: true,\n coreOperations: [\n CoreResourceOperation.READ,\n CoreResourceOperation.LIST,\n CoreResourceOperation.CREATE,\n CoreResourceOperation.UPDATE,\n // DELETE is REPOSITORY_ONLY (no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their\n // owning product is deleted. Without it the cascade throws\n // ErrorType.CONFIGURATION on any product that still has price rows.\n CoreResourceOperation.DELETE,\n ],\n operationsConfiguration: {\n [CoreResourceOperation.READ]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n }],\n },\n [CoreResourceOperation.LIST]: {\n variants: [\n {\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_USER],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n {\n /*\n * The OPERATOR's door onto the catalogue — added 2026-09-18 for issue #1295.\n *\n * The `INTERNAL_CALL` variant above is route-less by design: the billing back-office drives\n * this resource through the service pipeline, and states that these catalog reads have \"NO\n * HTTP surface\". That stays true and stays the DEFAULT, so `createForInternalServiceOperation`\n * keeps resolving it and no internal seam moves.\n *\n * What was missing is the surface an application ADMINISTRATOR needs. The `billing-catalog`\n * settings destination targets `prices.list` and could never load — the rail entry, the tab and the\n * heading all rendered, and every request 404'd at the ROUTER, because no route was ever\n * mounted. An operator cannot price what they cannot see.\n *\n * Gated on `APP_ADMIN_SUPER_ADMIN`, exactly what that destination already requires. Not a\n * widening: the aggregated billing state already ships products, prices and active promotions\n * to EVERY authenticated client, so an admin-only list is strictly narrower than what the\n * application discloses today.\n *\n * Two `isDefault: true` variants is the shape `organizations.CREATE` already uses — default is\n * per variant TYPE, so the internal door and the HTTP door each stay the default of their own\n * transport and the HTTP one needs no `variantKey` in its URL.\n */\n variantType: ResourceOperationVariantType.API_CALL,\n isDefault: true,\n roles: [CORE_APP_ROLES.APP_ADMIN_SUPER_ADMIN],\n riskLevel: ResourceOperationRiskLevel.LOW,\n },\n ],\n },\n [CoreResourceOperation.CREATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n [CoreResourceOperation.UPDATE]: {\n variants: [{\n variantType: ResourceOperationVariantType.INTERNAL_CALL,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.MEDIUM,\n }],\n },\n\n // Internal-only (REPOSITORY_ONLY, no HTTP route): powers the composition\n // onParentDelete cascade so price rows are physically removed when their owning\n // product is deleted. Without a DELETE op the cascade (deleteChildrenImmediate)\n // throws ErrorType.CONFIGURATION on any product that still has price rows.\n // ORG_OWNER/HIGH: mirrors the price write tier (billing catalog is org-owned).\n [CoreResourceOperation.DELETE]: {\n variants: [{\n variantType: ResourceOperationVariantType.REPOSITORY_ONLY,\n isDefault: true,\n roles: [CORE_ORG_ROLES.ORG_OWNER],\n riskLevel: ResourceOperationRiskLevel.HIGH,\n }],\n },\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"product-behavior-policy.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;;iBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8FtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
1
+ {"version":3,"file":"product-behavior-policy.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AAIxC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB;;;iBAK3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
@@ -75,7 +75,7 @@ export const ProductBehaviorPolicySchema = z.object({
75
75
  allowImmediate: z.boolean().default(false),
76
76
  /** Default cancellation timing when user cancels */
77
77
  defaultBehavior: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),
78
- }).optional(),
78
+ }).refine((policy) => policy.allowImmediate || policy.defaultBehavior !== BillingTiming.IMMEDIATE, { message: 'Immediate cancellation cannot be the default when immediate cancellation is forbidden.', path: ['defaultBehavior'] }).optional(),
79
79
  /**
80
80
  * Authored metering policy (for METERED products only), READ by
81
81
  * `UsageMeteringBackendService` since 2026-09-08 (#415).
@@ -1 +1 @@
1
- {"version":3,"file":"product-behavior-policy.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAExC,sEAAsE;AAEtE;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,2DAA2D;IAC3D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,0CAA0C;IAC1C,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC;CACzD,CAAC,CAAC;AAGH,sEAAsE;AAEtE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,mFAAmF;IACnF,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,0CAA0C;QAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC;;;;;;;;;;WAUG;QACH,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KACjD,CAAC,CAAC,QAAQ,EAAE;IAEb,uEAAuE;IACvE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,4EAA4E;QAC5E,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;QACjF,oDAAoD;QACpD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OA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,CAAC,CAAC,CAAC;SACzC,CAAC,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;KACpD,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC","sourcesContent":["/**\n * Product Behavior Policy & Limit Grant Schemas (Shared)\n *\n * Declarative configuration for how the billing provider and the engine\n * should handle product lifecycle (trial, proration, cancellation, metering).\n *\n * Also defines the LimitGrant schema that controls how product limits compose.\n *\n * @see billing-and-features-system.md §6.1 (LimitGrant), §6.1 (ProductBehaviorPolicy)\n */\n\nimport { z } from 'zod';\nimport {\n LimitGrantMode,\n ProrationBehavior,\n BillingTiming,\n MeteringAggregationWindow,\n} from './billing-enums.shared.schemas';\n\n// ── Limit Grant ────────────────────────────────────────────────────\n\n/**\n * A limit grant from a product.\n *\n * - SET mode: absolute value (replaces, used for PLAN base limits).\n * Example: \"Professional plan gives you 50 projects.\"\n * - ADD mode: additive (stacks on top, used for ADDON bonus limits).\n * Example: \"+10 extra projects.\"\n *\n * Aggregation algorithm in BillingFeatureSyncBackendService:\n * 1. Start with active PLAN's SET limits (only one active plan per billing account)\n * 2. For each active ADDON with ADD mode: sum onto current limit\n * 3. For each active ADDON with SET mode: take max(current, addon value)\n * 4. FEATURES_UNLIMITED always wins in any comparison\n */\nexport const LimitGrantSchema = z.object({\n /** The limit value (count or -1 for FEATURES_UNLIMITED) */\n value: z.number(),\n /** How this grant composes with others */\n mode: z.enum(LimitGrantMode).default(LimitGrantMode.SET),\n});\nexport type LimitGrant = z.infer<typeof LimitGrantSchema>;\n\n// ── Product Behavior Policy ────────────────────────────────────────\n\n/**\n * Declarative configuration for how the billing provider and the engine\n * should handle this product's lifecycle.\n *\n * This is the \"billing policy\" layer — NOT reimplementing provider logic,\n * but CONFIGURING the parameters that get passed to the provider's API.\n */\nexport const ProductBehaviorPolicySchema = z.object({\n /** Trial configuration (overrides global BillingConfiguration.defaultTrialDays) */\n trial: z.object({\n /** Number of trial days (0 = no trial) */\n days: z.number().min(0).default(0),\n /**\n * Require a payment method before the trial starts. READ since 2026-09-08 (#408).\n *\n * It reached no provider call before that, so a trial declared as requiring a card behaved\n * identically to one that did not — Wonder Todos' enterprise plan (`true`) and professional\n * plan (`false`) were indistinguishable at the provider.\n *\n * Only meaningful WITH a trial: a product declaring it alongside `days: 0` demands nothing,\n * because asking for a card up front on a purchase with no trial is a different decision and\n * nobody authored it.\n */\n requirePaymentMethod: z.boolean().default(false),\n }).optional(),\n\n /** Upgrade behavior (when switching TO this plan from a lower tier) */\n upgrade: z.object({\n /** Proration passed to provider: create_prorations, none, always_invoice */\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),\n /** Apply immediately or at end of current period */\n timing: z.enum(BillingTiming).default(BillingTiming.IMMEDIATE),\n }).optional(),\n\n /** Downgrade behavior (when switching FROM this plan to a lower tier) */\n downgrade: z.object({\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.NONE),\n timing: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).optional(),\n\n /** Cancellation behavior for subscriptions on this product */\n cancellation: z.object({\n /** Allow immediate cancellation (vs only at period end) */\n allowImmediate: z.boolean().default(false),\n /** Default cancellation timing when user cancels */\n defaultBehavior: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).optional(),\n\n /**\n * Authored metering policy (for METERED products only), READ by\n * `UsageMeteringBackendService` since 2026-09-08 (#415).\n *\n * Every field here was declared, defaulted, documented and read by NOTHING until then: the flush\n * merged every pending row by billing account and product whatever the product said, so\n * `preFlushAggregation: false` was unrepresentable and `aggregationWindow`'s two members selected\n * between behaviours that were the same behaviour. The note that stood here said exactly that and\n * asked that the gap stay visible rather than become \"a false runtime guarantee\"; this replaces it\n * because the guarantee is now real, and says which reader makes each field true.\n */\n metering: z.object({\n /**\n * How often to flush aggregated usage to the billing provider (minutes).\n *\n * Read by the engine's usage-flush batch, which picks the SHORTEST interval any metered product\n * authors — a schedule is one thing and the products sharing it are many, so the fastest promise\n * is the one that has to be kept. A product asking for less frequent reporting than its neighbour\n * still gets reported at the neighbour's cadence, which costs nothing: reporting sooner than\n * authored is never wrong, reporting later than authored is.\n */\n flushIntervalMinutes: z.number().min(1).default(60),\n /**\n * Whether one meter event may span a billing-period boundary.\n *\n * This is not a preference, it is a correctness choice about MONEY. A merged group carries ONE\n * timestamp and the provider assigns the event to the period that timestamp falls in, so\n * `PER_FLUSH` merging across a boundary bills the earlier period's usage into the later one.\n * `PER_BILLING_PERIOD` splits at the boundary, derived from the subscription's own\n * `currentPeriodStart` / `currentPeriodEnd`. Leave it `PER_FLUSH` when the product's periods do\n * not change what it costs.\n */\n aggregationWindow: z.enum(MeteringAggregationWindow).default(MeteringAggregationWindow.PER_FLUSH),\n /**\n * Aggregate locally before sending (sum same-key records into one meter event).\n *\n * `false` sends one event per recorded row, each with its own instant. Choose it when the provider\n * must see every event — because its aggregation is not a sum, or because the individual instants\n * matter. Local merging destroys both irreversibly, before the provider ever sees them.\n */\n preFlushAggregation: z.boolean().default(true),\n /**\n * Retry policy when a provider report fails.\n *\n * Safe only because every meter event carries a derived idempotency identifier: a retry after a\n * response lost in transit re-sends the same identifier and the provider discards it. Retrying\n * without that is how a timeout becomes a double charge, which is why the two shipped together.\n */\n retryPolicy: z.object({\n maxRetries: z.number().default(3),\n backoffMultiplier: z.number().default(2),\n }).default({ maxRetries: 3, backoffMultiplier: 2 }),\n }).optional(),\n});\nexport type ProductBehaviorPolicy = z.infer<typeof ProductBehaviorPolicySchema>;\n"]}
1
+ {"version":3,"file":"product-behavior-policy.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/product-behavior-policy.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AAExC,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AAE,CAAC;KACpD,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC","sourcesContent":["/**\n * Product Behavior Policy & Limit Grant Schemas (Shared)\n *\n * Declarative configuration for how the billing provider and the engine\n * should handle product lifecycle (trial, proration, cancellation, metering).\n *\n * Also defines the LimitGrant schema that controls how product limits compose.\n *\n * @see billing-and-features-system.md §6.1 (LimitGrant), §6.1 (ProductBehaviorPolicy)\n */\n\nimport { z } from 'zod';\nimport {\n LimitGrantMode,\n ProrationBehavior,\n BillingTiming,\n MeteringAggregationWindow,\n} from './billing-enums.shared.schemas';\n\n// ── Limit Grant ────────────────────────────────────────────────────\n\n/**\n * A limit grant from a product.\n *\n * - SET mode: absolute value (replaces, used for PLAN base limits).\n * Example: \"Professional plan gives you 50 projects.\"\n * - ADD mode: additive (stacks on top, used for ADDON bonus limits).\n * Example: \"+10 extra projects.\"\n *\n * Aggregation algorithm in BillingFeatureSyncBackendService:\n * 1. Start with active PLAN's SET limits (only one active plan per billing account)\n * 2. For each active ADDON with ADD mode: sum onto current limit\n * 3. For each active ADDON with SET mode: take max(current, addon value)\n * 4. FEATURES_UNLIMITED always wins in any comparison\n */\nexport const LimitGrantSchema = z.object({\n /** The limit value (count or -1 for FEATURES_UNLIMITED) */\n value: z.number(),\n /** How this grant composes with others */\n mode: z.enum(LimitGrantMode).default(LimitGrantMode.SET),\n});\nexport type LimitGrant = z.infer<typeof LimitGrantSchema>;\n\n// ── Product Behavior Policy ────────────────────────────────────────\n\n/**\n * Declarative configuration for how the billing provider and the engine\n * should handle this product's lifecycle.\n *\n * This is the \"billing policy\" layer — NOT reimplementing provider logic,\n * but CONFIGURING the parameters that get passed to the provider's API.\n */\nexport const ProductBehaviorPolicySchema = z.object({\n /** Trial configuration (overrides global BillingConfiguration.defaultTrialDays) */\n trial: z.object({\n /** Number of trial days (0 = no trial) */\n days: z.number().min(0).default(0),\n /**\n * Require a payment method before the trial starts. READ since 2026-09-08 (#408).\n *\n * It reached no provider call before that, so a trial declared as requiring a card behaved\n * identically to one that did not — Wonder Todos' enterprise plan (`true`) and professional\n * plan (`false`) were indistinguishable at the provider.\n *\n * Only meaningful WITH a trial: a product declaring it alongside `days: 0` demands nothing,\n * because asking for a card up front on a purchase with no trial is a different decision and\n * nobody authored it.\n */\n requirePaymentMethod: z.boolean().default(false),\n }).optional(),\n\n /** Upgrade behavior (when switching TO this plan from a lower tier) */\n upgrade: z.object({\n /** Proration passed to provider: create_prorations, none, always_invoice */\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),\n /** Apply immediately or at end of current period */\n timing: z.enum(BillingTiming).default(BillingTiming.IMMEDIATE),\n }).optional(),\n\n /** Downgrade behavior (when switching FROM this plan to a lower tier) */\n downgrade: z.object({\n proration: z.enum(ProrationBehavior).default(ProrationBehavior.NONE),\n timing: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).optional(),\n\n /** Cancellation behavior for subscriptions on this product */\n cancellation: z.object({\n /** Allow immediate cancellation (vs only at period end) */\n allowImmediate: z.boolean().default(false),\n /** Default cancellation timing when user cancels */\n defaultBehavior: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).refine(\n (policy) => policy.allowImmediate || policy.defaultBehavior !== BillingTiming.IMMEDIATE,\n { message: 'Immediate cancellation cannot be the default when immediate cancellation is forbidden.', path: ['defaultBehavior'] },\n ).optional(),\n\n /**\n * Authored metering policy (for METERED products only), READ by\n * `UsageMeteringBackendService` since 2026-09-08 (#415).\n *\n * Every field here was declared, defaulted, documented and read by NOTHING until then: the flush\n * merged every pending row by billing account and product whatever the product said, so\n * `preFlushAggregation: false` was unrepresentable and `aggregationWindow`'s two members selected\n * between behaviours that were the same behaviour. The note that stood here said exactly that and\n * asked that the gap stay visible rather than become \"a false runtime guarantee\"; this replaces it\n * because the guarantee is now real, and says which reader makes each field true.\n */\n metering: z.object({\n /**\n * How often to flush aggregated usage to the billing provider (minutes).\n *\n * Read by the engine's usage-flush batch, which picks the SHORTEST interval any metered product\n * authors — a schedule is one thing and the products sharing it are many, so the fastest promise\n * is the one that has to be kept. A product asking for less frequent reporting than its neighbour\n * still gets reported at the neighbour's cadence, which costs nothing: reporting sooner than\n * authored is never wrong, reporting later than authored is.\n */\n flushIntervalMinutes: z.number().min(1).default(60),\n /**\n * Whether one meter event may span a billing-period boundary.\n *\n * This is not a preference, it is a correctness choice about MONEY. A merged group carries ONE\n * timestamp and the provider assigns the event to the period that timestamp falls in, so\n * `PER_FLUSH` merging across a boundary bills the earlier period's usage into the later one.\n * `PER_BILLING_PERIOD` splits at the boundary, derived from the subscription's own\n * `currentPeriodStart` / `currentPeriodEnd`. Leave it `PER_FLUSH` when the product's periods do\n * not change what it costs.\n */\n aggregationWindow: z.enum(MeteringAggregationWindow).default(MeteringAggregationWindow.PER_FLUSH),\n /**\n * Aggregate locally before sending (sum same-key records into one meter event).\n *\n * `false` sends one event per recorded row, each with its own instant. Choose it when the provider\n * must see every event — because its aggregation is not a sum, or because the individual instants\n * matter. Local merging destroys both irreversibly, before the provider ever sees them.\n */\n preFlushAggregation: z.boolean().default(true),\n /**\n * Retry policy when a provider report fails.\n *\n * Safe only because every meter event carries a derived idempotency identifier: a retry after a\n * response lost in transit re-sends the same identifier and the provider discards it. Retrying\n * without that is how a timeout becomes a double charge, which is why the two shipped together.\n */\n retryPolicy: z.object({\n maxRetries: z.number().default(3),\n backoffMultiplier: z.number().default(2),\n }).default({ maxRetries: 3, backoffMultiplier: 2 }),\n }).optional(),\n});\nexport type ProductBehaviorPolicy = z.infer<typeof ProductBehaviorPolicySchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"product.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAI/C,KAAK,eAAe,GAChB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,mDAAmD,GAC9D,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAkE9C,CAAC"}
1
+ {"version":3,"file":"product.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/product.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,qBAAqB,EAAwD,MAAM,gDAAgD,CAAC;AAC7I,OAAO,EAGL,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAI/C,KAAK,eAAe,GAChB,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,GAC5B,qBAAqB,CAAC,MAAM,CAAC;AAEjC,eAAO,MAAM,mDAAmD,GAC9D,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgG9C,CAAC"}