@wildo-ai/saas-models 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (588) hide show
  1. package/dist/esm/applications/applications-context.schemas.d.ts +16 -10
  2. package/dist/esm/applications/applications-context.schemas.d.ts.map +1 -1
  3. package/dist/esm/applications/applications.shared.resources-config.schemas.d.ts.map +1 -1
  4. package/dist/esm/applications/applications.shared.resources-config.schemas.js +4 -3
  5. package/dist/esm/applications/applications.shared.resources-config.schemas.js.map +1 -1
  6. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts +1 -1
  7. package/dist/esm/billing/billing-account.shared.resources-config.schemas.d.ts.map +1 -1
  8. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js +36 -0
  9. package/dist/esm/billing/billing-account.shared.resources-config.schemas.js.map +1 -1
  10. package/dist/esm/billing/billing-account.shared.schemas.d.ts.map +1 -1
  11. package/dist/esm/billing/billing-account.shared.schemas.js +8 -1
  12. package/dist/esm/billing/billing-account.shared.schemas.js.map +1 -1
  13. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts +0 -4
  14. package/dist/esm/billing/billing-configuration.shared.schemas.d.ts.map +1 -1
  15. package/dist/esm/billing/billing-configuration.shared.schemas.js +59 -17
  16. package/dist/esm/billing/billing-configuration.shared.schemas.js.map +1 -1
  17. package/dist/esm/billing/billing-enums.shared.schemas.d.ts +77 -21
  18. package/dist/esm/billing/billing-enums.shared.schemas.d.ts.map +1 -1
  19. package/dist/esm/billing/billing-enums.shared.schemas.js +85 -23
  20. package/dist/esm/billing/billing-enums.shared.schemas.js.map +1 -1
  21. package/dist/esm/billing/billing-types.shared.schemas.d.ts +5 -5
  22. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts +1 -1
  23. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.d.ts.map +1 -1
  24. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js +39 -0
  25. package/dist/esm/billing/credit-pool.shared.resources-config.schemas.js.map +1 -1
  26. package/dist/esm/billing/credit-pool.shared.schemas.d.ts +6 -6
  27. package/dist/esm/billing/credit-pool.shared.schemas.d.ts.map +1 -1
  28. package/dist/esm/billing/credit-pool.shared.schemas.js +8 -4
  29. package/dist/esm/billing/credit-pool.shared.schemas.js.map +1 -1
  30. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts +1 -1
  31. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.d.ts.map +1 -1
  32. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js +35 -0
  33. package/dist/esm/billing/invoice-ref.shared.resources-config.schemas.js.map +1 -1
  34. package/dist/esm/billing/invoice-ref.shared.schemas.d.ts.map +1 -1
  35. package/dist/esm/billing/invoice-ref.shared.schemas.js +8 -3
  36. package/dist/esm/billing/invoice-ref.shared.schemas.js.map +1 -1
  37. package/dist/esm/billing/price.shared.schemas.d.ts.map +1 -1
  38. package/dist/esm/billing/price.shared.schemas.js +7 -1
  39. package/dist/esm/billing/price.shared.schemas.js.map +1 -1
  40. package/dist/esm/billing/product-behavior-policy.shared.schemas.d.ts.map +1 -1
  41. package/dist/esm/billing/product-behavior-policy.shared.schemas.js +52 -11
  42. package/dist/esm/billing/product-behavior-policy.shared.schemas.js.map +1 -1
  43. package/dist/esm/billing/product-definition.shared.schemas.d.ts +2 -2
  44. package/dist/esm/billing/product.shared.resources-config.schemas.d.ts +2 -2
  45. package/dist/esm/billing/product.shared.schemas.d.ts +2 -2
  46. package/dist/esm/billing/product.shared.schemas.d.ts.map +1 -1
  47. package/dist/esm/billing/product.shared.schemas.js +7 -3
  48. package/dist/esm/billing/product.shared.schemas.js.map +1 -1
  49. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts +2 -2
  50. package/dist/esm/billing/subscription.shared.resources-config.schemas.d.ts.map +1 -1
  51. package/dist/esm/billing/subscription.shared.resources-config.schemas.js +54 -1
  52. package/dist/esm/billing/subscription.shared.resources-config.schemas.js.map +1 -1
  53. package/dist/esm/billing/subscription.shared.schemas.d.ts +4 -4
  54. package/dist/esm/billing/subscription.shared.schemas.d.ts.map +1 -1
  55. package/dist/esm/billing/subscription.shared.schemas.js +6 -2
  56. package/dist/esm/billing/subscription.shared.schemas.js.map +1 -1
  57. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts +1 -1
  58. package/dist/esm/billing/usage-record.shared.resources-config.schemas.d.ts.map +1 -1
  59. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js +39 -0
  60. package/dist/esm/billing/usage-record.shared.resources-config.schemas.js.map +1 -1
  61. package/dist/esm/billing/usage-record.shared.schemas.d.ts +11 -7
  62. package/dist/esm/billing/usage-record.shared.schemas.d.ts.map +1 -1
  63. package/dist/esm/billing/usage-record.shared.schemas.js +29 -6
  64. package/dist/esm/billing/usage-record.shared.schemas.js.map +1 -1
  65. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts +69 -2
  66. package/dist/esm/companion/provider-discovery.shared.schemas.d.ts.map +1 -1
  67. package/dist/esm/companion/provider-discovery.shared.schemas.js +20 -1
  68. package/dist/esm/companion/provider-discovery.shared.schemas.js.map +1 -1
  69. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts +85 -0
  70. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.d.ts.map +1 -0
  71. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js +157 -0
  72. package/dist/esm/compliance/audit-trails/application-audit-logs.shared.resources-config.schemas.js.map +1 -0
  73. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.d.ts.map +1 -1
  74. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js +35 -2
  75. package/dist/esm/compliance/audit-trails/audit-logs.shared.resources-config.schemas.js.map +1 -1
  76. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts +23 -0
  77. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.d.ts.map +1 -1
  78. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js +56 -0
  79. package/dist/esm/compliance/audit-trails/audit-trail-config.shared.schemas.js.map +1 -1
  80. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts +541 -20
  81. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.d.ts.map +1 -1
  82. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js +605 -23
  83. package/dist/esm/compliance/audit-trails/auditable-events.shared.schema.js.map +1 -1
  84. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.d.ts.map +1 -1
  85. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js +96 -3
  86. package/dist/esm/compliance/audit-trails/security-audit-event-envelope.shared.schema.js.map +1 -1
  87. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts +49 -0
  88. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.d.ts.map +1 -1
  89. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js +124 -1
  90. package/dist/esm/compliance/privacy/impersonalization-scrub.shared.utils.js.map +1 -1
  91. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts +11 -3
  92. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.d.ts.map +1 -1
  93. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js +11 -3
  94. package/dist/esm/compliance/privacy/impersonalization.shared.schemas.js.map +1 -1
  95. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts +94 -0
  96. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.d.ts.map +1 -0
  97. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js +211 -0
  98. package/dist/esm/compliance/privacy/operating-jurisdictions.shared.schemas.js.map +1 -0
  99. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts +67 -12
  100. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.d.ts.map +1 -1
  101. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js +95 -8
  102. package/dist/esm/compliance/privacy/operator-compliance-identity.shared.schemas.js.map +1 -1
  103. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts +17 -0
  104. package/dist/esm/compliance/privacy/privacy.shared.schemas.d.ts.map +1 -1
  105. package/dist/esm/compliance/privacy/privacy.shared.schemas.js +27 -4
  106. package/dist/esm/compliance/privacy/privacy.shared.schemas.js.map +1 -1
  107. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts +89 -16
  108. package/dist/esm/compliance/privacy/redaction.shared.schemas.d.ts.map +1 -1
  109. package/dist/esm/compliance/privacy/redaction.shared.schemas.js +101 -15
  110. package/dist/esm/compliance/privacy/redaction.shared.schemas.js.map +1 -1
  111. package/dist/esm/compliance/privacy/subject-export.shared.schemas.d.ts.map +1 -1
  112. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js +12 -5
  113. package/dist/esm/compliance/privacy/subject-export.shared.schemas.js.map +1 -1
  114. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts +21 -0
  115. package/dist/esm/config/analytics-value-moments.shared.schemas.d.ts.map +1 -1
  116. package/dist/esm/config/analytics-value-moments.shared.schemas.js +20 -0
  117. package/dist/esm/config/analytics-value-moments.shared.schemas.js.map +1 -1
  118. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts +9 -5
  119. package/dist/esm/config/app-configuration-shared.shared.schemas.d.ts.map +1 -1
  120. package/dist/esm/config/app-configuration-shared.shared.schemas.js +29 -0
  121. package/dist/esm/config/app-configuration-shared.shared.schemas.js.map +1 -1
  122. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts +8 -1
  123. package/dist/esm/config/auth-config-resolution.shared.utils.d.ts.map +1 -1
  124. package/dist/esm/config/auth-config-resolution.shared.utils.js +29 -0
  125. package/dist/esm/config/auth-config-resolution.shared.utils.js.map +1 -1
  126. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts +95 -17
  127. package/dist/esm/config/entity-identity-config.shared.schemas.d.ts.map +1 -1
  128. package/dist/esm/config/entity-identity-config.shared.schemas.js +86 -8
  129. package/dist/esm/config/entity-identity-config.shared.schemas.js.map +1 -1
  130. package/dist/esm/config/frontend/chart-definition.shared.schemas.d.ts +12 -12
  131. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts +33 -0
  132. package/dist/esm/config/frontend/navigation.shared.schemas.d.ts.map +1 -1
  133. package/dist/esm/config/frontend/navigation.shared.schemas.js +32 -0
  134. package/dist/esm/config/frontend/navigation.shared.schemas.js.map +1 -1
  135. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts +40 -1
  136. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.d.ts.map +1 -1
  137. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js +40 -1
  138. package/dist/esm/errors/errors.custom-message-ref.shared.definitions.js.map +1 -1
  139. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts +57 -11
  140. package/dist/esm/external-data/external-data-pipeline.shared.schemas.d.ts.map +1 -1
  141. package/dist/esm/external-data/external-data-pipeline.shared.schemas.js.map +1 -1
  142. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts +109 -64
  143. package/dist/esm/external-providers/engine-capabilities.shared.schemas.d.ts.map +1 -1
  144. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js +200 -19
  145. package/dist/esm/external-providers/engine-capabilities.shared.schemas.js.map +1 -1
  146. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts +15 -3
  147. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.d.ts.map +1 -1
  148. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js +32 -7
  149. package/dist/esm/external-providers/engine-capability-resolution-mode.shared.js.map +1 -1
  150. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts +84 -7
  151. package/dist/esm/external-providers/frontend-bootstrap.shared.schemas.d.ts.map +1 -1
  152. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts +59 -0
  153. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.d.ts.map +1 -0
  154. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js +61 -0
  155. package/dist/esm/external-providers/frontend-capability-public-config.shared.schemas.js.map +1 -0
  156. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts +97 -0
  157. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.d.ts.map +1 -0
  158. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js +41 -0
  159. package/dist/esm/external-providers/frontend-capability-runtime.shared.types.js.map +1 -0
  160. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts +148 -2
  161. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.d.ts.map +1 -1
  162. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js +56 -1
  163. package/dist/esm/external-providers/frontend-provider-entry.shared.schemas.js.map +1 -1
  164. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts +9 -31
  165. package/dist/esm/external-providers/provider-capability.shared.schemas.d.ts.map +1 -1
  166. package/dist/esm/external-providers/provider-capability.shared.schemas.js +8 -5
  167. package/dist/esm/external-providers/provider-capability.shared.schemas.js.map +1 -1
  168. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts +18 -8
  169. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.d.ts.map +1 -1
  170. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js +9 -4
  171. package/dist/esm/external-providers/provider-compliance-profile.shared.schemas.js.map +1 -1
  172. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts +338 -0
  173. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.d.ts.map +1 -0
  174. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js +332 -0
  175. package/dist/esm/external-providers/provider-frontend-surface.shared.schemas.js.map +1 -0
  176. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts +178 -9
  177. package/dist/esm/external-providers/provider-metadata.shared.schemas.d.ts.map +1 -1
  178. package/dist/esm/external-providers/provider-metadata.shared.schemas.js +181 -9
  179. package/dist/esm/external-providers/provider-metadata.shared.schemas.js.map +1 -1
  180. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts +7 -5
  181. package/dist/esm/external-providers/provider-protocol.shared.schemas.d.ts.map +1 -1
  182. package/dist/esm/external-providers/provider-protocol.shared.schemas.js +7 -5
  183. package/dist/esm/external-providers/provider-protocol.shared.schemas.js.map +1 -1
  184. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts +40 -0
  185. package/dist/esm/external-providers/provider-tier-rule.shared.utils.d.ts.map +1 -0
  186. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js +80 -0
  187. package/dist/esm/external-providers/provider-tier-rule.shared.utils.js.map +1 -0
  188. package/dist/esm/features/core-feature-definitions.shared.d.ts.map +1 -1
  189. package/dist/esm/features/core-feature-definitions.shared.js +7 -1
  190. package/dist/esm/features/core-feature-definitions.shared.js.map +1 -1
  191. package/dist/esm/features/feature-builders.shared.d.ts +32 -0
  192. package/dist/esm/features/feature-builders.shared.d.ts.map +1 -1
  193. package/dist/esm/features/feature-builders.shared.js +32 -0
  194. package/dist/esm/features/feature-builders.shared.js.map +1 -1
  195. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts +1 -1
  196. package/dist/esm/features/user-features.shared.resources-config.schemas.d.ts.map +1 -1
  197. package/dist/esm/features/user-features.shared.resources-config.schemas.js +48 -0
  198. package/dist/esm/features/user-features.shared.resources-config.schemas.js.map +1 -1
  199. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts +156 -0
  200. package/dist/esm/files/file-upload-grant.shared.schemas.d.ts.map +1 -0
  201. package/dist/esm/files/file-upload-grant.shared.schemas.js +175 -0
  202. package/dist/esm/files/file-upload-grant.shared.schemas.js.map +1 -0
  203. package/dist/esm/files/files.shared.schemas.d.ts +52 -4
  204. package/dist/esm/files/files.shared.schemas.d.ts.map +1 -1
  205. package/dist/esm/files/files.shared.schemas.js +55 -4
  206. package/dist/esm/files/files.shared.schemas.js.map +1 -1
  207. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts +1 -1
  208. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.d.ts.map +1 -1
  209. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js +33 -0
  210. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.resources-config.schemas.js.map +1 -1
  211. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.d.ts.map +1 -1
  212. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js +6 -2
  213. package/dist/esm/flows-actors/a2a-push-delivery-log.shared.schemas.js.map +1 -1
  214. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts +1 -1
  215. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.d.ts.map +1 -1
  216. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js +53 -0
  217. package/dist/esm/flows-actors/a2a-token-budget-state.shared.resources-config.schemas.js.map +1 -1
  218. package/dist/esm/flows-actors/actors.shared.schemas.d.ts.map +1 -1
  219. package/dist/esm/flows-actors/actors.shared.schemas.js +3 -2
  220. package/dist/esm/flows-actors/actors.shared.schemas.js.map +1 -1
  221. package/dist/esm/flows-actors/agents.shared.schemas.d.ts +54 -5
  222. package/dist/esm/flows-actors/agents.shared.schemas.d.ts.map +1 -1
  223. package/dist/esm/flows-actors/agents.shared.schemas.js.map +1 -1
  224. package/dist/esm/flows-actors/apps-blueprint/apps-blueprint.shared.schemas.d.ts +6 -6
  225. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts +0 -3
  226. package/dist/esm/flows-actors/deliberation.shared.schemas.d.ts.map +1 -1
  227. package/dist/esm/flows-actors/deliberation.shared.schemas.js +0 -5
  228. package/dist/esm/flows-actors/deliberation.shared.schemas.js.map +1 -1
  229. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts +1 -1
  230. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.d.ts.map +1 -1
  231. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js +43 -0
  232. package/dist/esm/flows-actors/flows-actors-execution.shared.resources-config.schemas.js.map +1 -1
  233. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts +14 -0
  234. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.d.ts.map +1 -1
  235. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js +48 -6
  236. package/dist/esm/flows-actors/flows-actors-execution.shared.schemas.js.map +1 -1
  237. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts +1 -1
  238. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.d.ts.map +1 -1
  239. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js +41 -0
  240. package/dist/esm/flows-actors/flows-actors-task.shared.resources-config.schemas.js.map +1 -1
  241. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts +0 -7
  242. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.d.ts.map +1 -1
  243. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js +23 -13
  244. package/dist/esm/flows-actors/flows-actors-task.shared.schemas.js.map +1 -1
  245. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts +19 -0
  246. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.d.ts.map +1 -1
  247. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js +33 -0
  248. package/dist/esm/flows-actors/flows-actors.commons.shared.schemas.js.map +1 -1
  249. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts +14 -9
  250. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.d.ts.map +1 -1
  251. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js +14 -9
  252. package/dist/esm/flows-actors/flows-actors.io.shared.schemas.js.map +1 -1
  253. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.d.ts.map +1 -1
  254. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js +3 -2
  255. package/dist/esm/flows-actors/flows-actors.system.shared.schemas.js.map +1 -1
  256. package/dist/esm/flows-actors/flows.shared.schemas.d.ts.map +1 -1
  257. package/dist/esm/flows-actors/flows.shared.schemas.js +3 -2
  258. package/dist/esm/flows-actors/flows.shared.schemas.js.map +1 -1
  259. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts +128 -0
  260. package/dist/esm/flows-actors/mcp-servers.shared.schemas.d.ts.map +1 -0
  261. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js +142 -0
  262. package/dist/esm/flows-actors/mcp-servers.shared.schemas.js.map +1 -0
  263. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts +0 -3
  264. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.d.ts.map +1 -1
  265. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js +1 -4
  266. package/dist/esm/flows-actors/meta-workflows/budget-authority.meta-workflows.shared.schemas.js.map +1 -1
  267. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts +0 -16
  268. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.d.ts.map +1 -1
  269. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js +1 -17
  270. package/dist/esm/flows-actors/meta-workflows/context-selection.meta-workflows.shared.schemas.js.map +1 -1
  271. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.d.ts +3 -3
  272. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js +3 -3
  273. package/dist/esm/flows-actors/meta-workflows/decisions.meta-workflows.shared.schemas.js.map +1 -1
  274. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts +2 -8
  275. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.d.ts.map +1 -1
  276. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js +4 -15
  277. package/dist/esm/flows-actors/meta-workflows/execution-binding-common.meta-workflows.shared.schemas.js.map +1 -1
  278. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts +1 -1
  279. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.d.ts.map +1 -1
  280. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js +51 -0
  281. package/dist/esm/guidance/guidance-state.shared.resources-config.schemas.js.map +1 -1
  282. package/dist/esm/guidance/guidance-state.shared.schemas.d.ts.map +1 -1
  283. package/dist/esm/guidance/guidance-state.shared.schemas.js +8 -2
  284. package/dist/esm/guidance/guidance-state.shared.schemas.js.map +1 -1
  285. package/dist/esm/guidance/guidance-state.shared.utils.d.ts.map +1 -1
  286. package/dist/esm/guidance/guidance-state.shared.utils.js +1 -0
  287. package/dist/esm/guidance/guidance-state.shared.utils.js.map +1 -1
  288. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts +1 -1
  289. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.d.ts.map +1 -1
  290. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js +51 -0
  291. package/dist/esm/guidance/lifecycle-state.shared.resources-config.schemas.js.map +1 -1
  292. package/dist/esm/guidance/lifecycle-state.shared.schemas.d.ts.map +1 -1
  293. package/dist/esm/guidance/lifecycle-state.shared.schemas.js +28 -3
  294. package/dist/esm/guidance/lifecycle-state.shared.schemas.js.map +1 -1
  295. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts +9 -1
  296. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.d.ts.map +1 -1
  297. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js +51 -0
  298. package/dist/esm/guidance/progression-state.shared.resources-config.schemas.js.map +1 -1
  299. package/dist/esm/guidance/progression-state.shared.schemas.d.ts +46 -0
  300. package/dist/esm/guidance/progression-state.shared.schemas.d.ts.map +1 -1
  301. package/dist/esm/guidance/progression-state.shared.schemas.js +67 -4
  302. package/dist/esm/guidance/progression-state.shared.schemas.js.map +1 -1
  303. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts +356 -52
  304. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.d.ts.map +1 -1
  305. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js +166 -39
  306. package/dist/esm/http-api-binding/http-api-binding.shared.schemas.js.map +1 -1
  307. package/dist/esm/index.d.ts +15 -0
  308. package/dist/esm/index.d.ts.map +1 -1
  309. package/dist/esm/index.js +15 -0
  310. package/dist/esm/index.js.map +1 -1
  311. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts +11 -2
  312. package/dist/esm/notifications/email/email-template-registry.shared.schemas.d.ts.map +1 -1
  313. package/dist/esm/notifications/email/email-template-registry.shared.schemas.js.map +1 -1
  314. package/dist/esm/notifications/email/email-template.shared.enums.d.ts +15 -0
  315. package/dist/esm/notifications/email/email-template.shared.enums.d.ts.map +1 -1
  316. package/dist/esm/notifications/email/email-template.shared.enums.js +15 -0
  317. package/dist/esm/notifications/email/email-template.shared.enums.js.map +1 -1
  318. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts +70 -0
  319. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.d.ts.map +1 -0
  320. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js +71 -0
  321. package/dist/esm/notifications/m2m/m2m-webhook-delivery-contract.shared.js.map +1 -0
  322. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts +1 -0
  323. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.d.ts.map +1 -1
  324. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js +19 -0
  325. package/dist/esm/notifications/m2m/webhook-config.shared.resources-config.schemas.js.map +1 -1
  326. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts +30 -0
  327. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.d.ts.map +1 -1
  328. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js +65 -1
  329. package/dist/esm/notifications/m2m/webhook-config.shared.schemas.js.map +1 -1
  330. package/dist/esm/notifications/notification-badges.core.definitions.d.ts +6 -4
  331. package/dist/esm/notifications/notification-badges.core.definitions.d.ts.map +1 -1
  332. package/dist/esm/notifications/notification-badges.core.definitions.js +6 -4
  333. package/dist/esm/notifications/notification-badges.core.definitions.js.map +1 -1
  334. package/dist/esm/notifications/notification-badges.schemas.d.ts +167 -5
  335. package/dist/esm/notifications/notification-badges.schemas.d.ts.map +1 -1
  336. package/dist/esm/notifications/notification-badges.schemas.js +191 -6
  337. package/dist/esm/notifications/notification-badges.schemas.js.map +1 -1
  338. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts +1 -1
  339. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.d.ts.map +1 -1
  340. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js +36 -0
  341. package/dist/esm/notifications/notification-badges.shared.resources-config.schemas.js.map +1 -1
  342. package/dist/esm/notifications/notifications.shared.schemas.d.ts +107 -0
  343. package/dist/esm/notifications/notifications.shared.schemas.d.ts.map +1 -1
  344. package/dist/esm/notifications/notifications.shared.schemas.js +149 -1
  345. package/dist/esm/notifications/notifications.shared.schemas.js.map +1 -1
  346. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts +1 -1
  347. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.d.ts.map +1 -1
  348. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js +44 -0
  349. package/dist/esm/organizations/organization-members.shared.resources-config.schemas.js.map +1 -1
  350. package/dist/esm/organizations/organization-members.shared.schemas.d.ts.map +1 -1
  351. package/dist/esm/organizations/organization-members.shared.schemas.js +15 -4
  352. package/dist/esm/organizations/organization-members.shared.schemas.js.map +1 -1
  353. package/dist/esm/organizations/organization-notifications.shared.schemas.d.ts.map +1 -1
  354. package/dist/esm/organizations/organization-notifications.shared.schemas.js +22 -1
  355. package/dist/esm/organizations/organization-notifications.shared.schemas.js.map +1 -1
  356. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts +26 -0
  357. package/dist/esm/organizations/organization-preferences.shared.schemas.d.ts.map +1 -1
  358. package/dist/esm/organizations/organization-preferences.shared.schemas.js +25 -0
  359. package/dist/esm/organizations/organization-preferences.shared.schemas.js.map +1 -1
  360. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts +25 -0
  361. package/dist/esm/organizations/organization-profile.shared.schemas.d.ts.map +1 -1
  362. package/dist/esm/organizations/organization-profile.shared.schemas.js +42 -17
  363. package/dist/esm/organizations/organization-profile.shared.schemas.js.map +1 -1
  364. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts +3 -2
  365. package/dist/esm/organizations/organization-unit-narrowing.shared.d.ts.map +1 -1
  366. package/dist/esm/organizations/organization-unit-narrowing.shared.js +9 -2
  367. package/dist/esm/organizations/organization-unit-narrowing.shared.js.map +1 -1
  368. package/dist/esm/organizations/organizations.shared.resources-config.schemas.d.ts.map +1 -1
  369. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js +35 -12
  370. package/dist/esm/organizations/organizations.shared.resources-config.schemas.js.map +1 -1
  371. package/dist/esm/public-runtime/index.d.ts +49 -2
  372. package/dist/esm/public-runtime/index.d.ts.map +1 -1
  373. package/dist/esm/public-runtime/index.js +48 -1
  374. package/dist/esm/public-runtime/index.js.map +1 -1
  375. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts +6 -5
  376. package/dist/esm/queue/jobs.shared.resources-config.schemas.d.ts.map +1 -1
  377. package/dist/esm/queue/jobs.shared.resources-config.schemas.js +23 -5
  378. package/dist/esm/queue/jobs.shared.resources-config.schemas.js.map +1 -1
  379. package/dist/esm/queue/jobs.shared.schemas.d.ts +16 -3
  380. package/dist/esm/queue/jobs.shared.schemas.d.ts.map +1 -1
  381. package/dist/esm/queue/jobs.shared.schemas.js +16 -3
  382. package/dist/esm/queue/jobs.shared.schemas.js.map +1 -1
  383. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts +137 -0
  384. package/dist/esm/requests/manual-controllers-routes-documentation.d.ts.map +1 -0
  385. package/dist/esm/requests/manual-controllers-routes-documentation.js +1201 -0
  386. package/dist/esm/requests/manual-controllers-routes-documentation.js.map +1 -0
  387. package/dist/esm/requests/manual-controllers-routes-urls.d.ts +67 -0
  388. package/dist/esm/requests/manual-controllers-routes-urls.d.ts.map +1 -1
  389. package/dist/esm/requests/manual-controllers-routes-urls.js +78 -0
  390. package/dist/esm/requests/manual-controllers-routes-urls.js.map +1 -1
  391. package/dist/esm/requests/rate-limits.shared.schemas.d.ts +11 -1
  392. package/dist/esm/requests/rate-limits.shared.schemas.d.ts.map +1 -1
  393. package/dist/esm/requests/rate-limits.shared.schemas.js +11 -1
  394. package/dist/esm/requests/rate-limits.shared.schemas.js.map +1 -1
  395. package/dist/esm/requests/websocket.shared.schemas.d.ts +86 -4
  396. package/dist/esm/requests/websocket.shared.schemas.d.ts.map +1 -1
  397. package/dist/esm/requests/websocket.shared.schemas.js +138 -0
  398. package/dist/esm/requests/websocket.shared.schemas.js.map +1 -1
  399. package/dist/esm/resources/collection-query-parameters.shared.d.ts +22 -0
  400. package/dist/esm/resources/collection-query-parameters.shared.d.ts.map +1 -0
  401. package/dist/esm/resources/collection-query-parameters.shared.js +22 -0
  402. package/dist/esm/resources/collection-query-parameters.shared.js.map +1 -0
  403. package/dist/esm/resources/resources-config.shared.factory.d.ts +1 -0
  404. package/dist/esm/resources/resources-config.shared.factory.d.ts.map +1 -1
  405. package/dist/esm/resources/resources-config.shared.factory.js +189 -31
  406. package/dist/esm/resources/resources-config.shared.factory.js.map +1 -1
  407. package/dist/esm/resources/resources-config.shared.schemas.d.ts +395 -92
  408. package/dist/esm/resources/resources-config.shared.schemas.d.ts.map +1 -1
  409. package/dist/esm/resources/resources-config.shared.schemas.js +109 -20
  410. package/dist/esm/resources/resources-config.shared.schemas.js.map +1 -1
  411. package/dist/esm/resources/resources-registry.shared.core.definitions.d.ts.map +1 -1
  412. package/dist/esm/resources/resources-registry.shared.core.definitions.js +97 -5
  413. package/dist/esm/resources/resources-registry.shared.core.definitions.js.map +1 -1
  414. package/dist/esm/resources/resources-relationships.shared.factory.d.ts.map +1 -1
  415. package/dist/esm/resources/resources-relationships.shared.factory.js +15 -0
  416. package/dist/esm/resources/resources-relationships.shared.factory.js.map +1 -1
  417. package/dist/esm/resources/resources.shared.core.definitions.d.ts +37 -0
  418. package/dist/esm/resources/resources.shared.core.definitions.d.ts.map +1 -1
  419. package/dist/esm/resources/resources.shared.core.definitions.js +51 -0
  420. package/dist/esm/resources/resources.shared.core.definitions.js.map +1 -1
  421. package/dist/esm/resources/resources.shared.schemas.d.ts +11 -2
  422. package/dist/esm/resources/resources.shared.schemas.d.ts.map +1 -1
  423. package/dist/esm/resources/resources.shared.schemas.js +34 -3
  424. package/dist/esm/resources/resources.shared.schemas.js.map +1 -1
  425. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts +51 -0
  426. package/dist/esm/resources/utils/field-value-disclosure.utils.d.ts.map +1 -0
  427. package/dist/esm/resources/utils/field-value-disclosure.utils.js +53 -0
  428. package/dist/esm/resources/utils/field-value-disclosure.utils.js.map +1 -0
  429. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.d.ts.map +1 -1
  430. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js +21 -6
  431. package/dist/esm/resources/utils/resources-config-operations.dtos-builder.utils.js.map +1 -1
  432. package/dist/esm/resources/utils/resources-summary.utils.d.ts +16 -2
  433. package/dist/esm/resources/utils/resources-summary.utils.d.ts.map +1 -1
  434. package/dist/esm/resources/utils/resources-summary.utils.js +19 -5
  435. package/dist/esm/resources/utils/resources-summary.utils.js.map +1 -1
  436. package/dist/esm/resources/utils/shared-persistence-collection.utils.d.ts.map +1 -1
  437. package/dist/esm/resources/utils/shared-persistence-collection.utils.js +11 -0
  438. package/dist/esm/resources/utils/shared-persistence-collection.utils.js.map +1 -1
  439. package/dist/esm/runtime/domain-module.shared.definitions.d.ts +25 -0
  440. package/dist/esm/runtime/domain-module.shared.definitions.d.ts.map +1 -1
  441. package/dist/esm/runtime/domain-module.shared.definitions.js.map +1 -1
  442. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts +1 -0
  443. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.d.ts.map +1 -1
  444. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js +38 -0
  445. package/dist/esm/security/api-keys/api-keys-application.shared.resources-config.schemas.js.map +1 -1
  446. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts +1 -0
  447. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.d.ts.map +1 -1
  448. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js +38 -0
  449. package/dist/esm/security/api-keys/api-keys-organization.shared.resources-config.schemas.js.map +1 -1
  450. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts +4 -11
  451. package/dist/esm/security/authentications/authentication.shared.dto.schemas.d.ts.map +1 -1
  452. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js +0 -1
  453. package/dist/esm/security/authentications/authentication.shared.dto.schemas.js.map +1 -1
  454. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts +141 -5
  455. package/dist/esm/security/authentications/authentication.shared.schemas.d.ts.map +1 -1
  456. package/dist/esm/security/authentications/authentication.shared.schemas.js +147 -3
  457. package/dist/esm/security/authentications/authentication.shared.schemas.js.map +1 -1
  458. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts +17 -1
  459. package/dist/esm/security/authentications/consumable-token.shared.schemas.d.ts.map +1 -1
  460. package/dist/esm/security/authentications/consumable-token.shared.schemas.js +16 -0
  461. package/dist/esm/security/authentications/consumable-token.shared.schemas.js.map +1 -1
  462. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts +28 -0
  463. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.d.ts.map +1 -0
  464. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js +28 -0
  465. package/dist/esm/security/authentications/mfa-backup-code-contract.shared.js.map +1 -0
  466. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts +1 -0
  467. package/dist/esm/security/authentications/registration.shared.dto.schemas.d.ts.map +1 -1
  468. package/dist/esm/security/authentications/registration.shared.dto.schemas.js +11 -0
  469. package/dist/esm/security/authentications/registration.shared.dto.schemas.js.map +1 -1
  470. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts +15 -0
  471. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.d.ts.map +1 -1
  472. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js +21 -4
  473. package/dist/esm/security/authentications/scim/scim-provisioning-config.shared.schemas.js.map +1 -1
  474. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts +21 -0
  475. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.d.ts.map +1 -0
  476. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js +21 -0
  477. package/dist/esm/security/authentications/siem/siem-delivery-reliability-contract.shared.js.map +1 -0
  478. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts +61 -1
  479. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.d.ts.map +1 -1
  480. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js +208 -6
  481. package/dist/esm/security/authentications/sso/sso-config.shared.resources-config.schemas.js.map +1 -1
  482. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts +37 -27
  483. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.d.ts.map +1 -1
  484. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js +134 -12
  485. package/dist/esm/security/authentications/sso/sso-config.shared.schemas.js.map +1 -1
  486. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts +0 -6
  487. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.d.ts.map +1 -1
  488. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js +17 -8
  489. package/dist/esm/security/authentications/sso/sso-connection.shared.schemas.js.map +1 -1
  490. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts +1 -1
  491. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.d.ts.map +1 -1
  492. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js +70 -0
  493. package/dist/esm/security/authorizations/platform-access-grants.shared.resources-config.schemas.js.map +1 -1
  494. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts +45 -8
  495. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.d.ts.map +1 -1
  496. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js +56 -10
  497. package/dist/esm/security/authorizations/platform-access-grants.shared.schemas.js.map +1 -1
  498. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts +16 -1
  499. package/dist/esm/security/authorizations/roles.shared.schemas.d.ts.map +1 -1
  500. package/dist/esm/security/authorizations/roles.shared.schemas.js +16 -1
  501. package/dist/esm/security/authorizations/roles.shared.schemas.js.map +1 -1
  502. package/dist/esm/security/authorizations/roles.shared.utils.d.ts +54 -0
  503. package/dist/esm/security/authorizations/roles.shared.utils.d.ts.map +1 -1
  504. package/dist/esm/security/authorizations/roles.shared.utils.js +59 -0
  505. package/dist/esm/security/authorizations/roles.shared.utils.js.map +1 -1
  506. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts +31 -0
  507. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.d.ts.map +1 -0
  508. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js +198 -0
  509. package/dist/esm/security/connected-accounts/provider-credentials-organization.shared.resources-config.schemas.js.map +1 -0
  510. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts +31 -0
  511. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.d.ts.map +1 -0
  512. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js +191 -0
  513. package/dist/esm/security/connected-accounts/provider-credentials-user.shared.resources-config.schemas.js.map +1 -0
  514. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts +250 -0
  515. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.d.ts.map +1 -0
  516. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js +486 -0
  517. package/dist/esm/security/connected-accounts/provider-credentials.shared.schemas.js.map +1 -0
  518. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts +4 -1
  519. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.d.ts.map +1 -1
  520. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js +29 -0
  521. package/dist/esm/security/oauth-clients/oauth-clients-application.shared.resources-config.schemas.js.map +1 -1
  522. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts +4 -1
  523. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.d.ts.map +1 -1
  524. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js +29 -0
  525. package/dist/esm/security/oauth-clients/oauth-clients-organization.shared.resources-config.schemas.js.map +1 -1
  526. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts +67 -0
  527. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.d.ts.map +1 -1
  528. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js +44 -1
  529. package/dist/esm/security/oauth-clients/oauth-clients.shared.schemas.js.map +1 -1
  530. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts +1 -1
  531. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.d.ts.map +1 -1
  532. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js +35 -0
  533. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.resources-config.schemas.js.map +1 -1
  534. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts +13 -0
  535. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.d.ts.map +1 -1
  536. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js +31 -4
  537. package/dist/esm/security/oauth-clients/oauth-consent-grants.shared.schemas.js.map +1 -1
  538. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts +1 -1
  539. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.d.ts.map +1 -1
  540. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js +34 -0
  541. package/dist/esm/users/inbound-contacts.shared.resources-config.schemas.js.map +1 -1
  542. package/dist/esm/users/inbound-contacts.shared.schemas.d.ts.map +1 -1
  543. package/dist/esm/users/inbound-contacts.shared.schemas.js +7 -4
  544. package/dist/esm/users/inbound-contacts.shared.schemas.js.map +1 -1
  545. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts +1 -1
  546. package/dist/esm/users/user-credentials.shared.resources-config.schemas.d.ts.map +1 -1
  547. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js +37 -0
  548. package/dist/esm/users/user-credentials.shared.resources-config.schemas.js.map +1 -1
  549. package/dist/esm/users/user-credentials.shared.schemas.d.ts.map +1 -1
  550. package/dist/esm/users/user-credentials.shared.schemas.js +17 -2
  551. package/dist/esm/users/user-credentials.shared.schemas.js.map +1 -1
  552. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts +1 -1
  553. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.d.ts.map +1 -1
  554. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js +36 -0
  555. package/dist/esm/users/user-identity-links.shared.resources-config.schemas.js.map +1 -1
  556. package/dist/esm/users/user-identity-links.shared.schemas.d.ts.map +1 -1
  557. package/dist/esm/users/user-identity-links.shared.schemas.js +15 -5
  558. package/dist/esm/users/user-identity-links.shared.schemas.js.map +1 -1
  559. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts +5 -5
  560. package/dist/esm/users/user-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  561. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js +53 -0
  562. package/dist/esm/users/user-preferences.shared.resources-config.schemas.js.map +1 -1
  563. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts +1 -1
  564. package/dist/esm/users/user-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  565. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js +62 -0
  566. package/dist/esm/users/user-profiles.shared.resources-config.schemas.js.map +1 -1
  567. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts +5 -5
  568. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.d.ts.map +1 -1
  569. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js +53 -0
  570. package/dist/esm/users/user-self-preferences.shared.resources-config.schemas.js.map +1 -1
  571. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts +1 -1
  572. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.d.ts.map +1 -1
  573. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js +62 -0
  574. package/dist/esm/users/user-self-profiles.shared.resources-config.schemas.js.map +1 -1
  575. package/dist/esm/users/user-self.shared.resources-config.schemas.d.ts.map +1 -1
  576. package/dist/esm/users/user-self.shared.resources-config.schemas.js +33 -3
  577. package/dist/esm/users/user-self.shared.resources-config.schemas.js.map +1 -1
  578. package/dist/esm/users/users.shared.resources-config.schemas.d.ts +17 -1
  579. package/dist/esm/users/users.shared.resources-config.schemas.d.ts.map +1 -1
  580. package/dist/esm/users/users.shared.resources-config.schemas.js +136 -5
  581. package/dist/esm/users/users.shared.resources-config.schemas.js.map +1 -1
  582. package/dist/esm/users/users.shared.schemas.d.ts +62 -12
  583. package/dist/esm/users/users.shared.schemas.d.ts.map +1 -1
  584. package/dist/esm/users/users.shared.schemas.js +79 -23
  585. package/dist/esm/users/users.shared.schemas.js.map +1 -1
  586. package/dist/tsconfig.build.tsbuildinfo +1 -1
  587. package/package.json +5 -6
  588. package/dist/esm/.builder.pid +0 -9
@@ -16,23 +16,41 @@ export const BillingConfigurationSchema = z.object({
16
16
  enabled: z.boolean().default(false),
17
17
  /** Which billing provider to use (e.g., 'stripe') */
18
18
  providerRef: z.string().optional(),
19
- /** Webhook configuration */
20
- webhooks: z.object({
21
- /** Path for billing webhook endpoint */
22
- path: z.string().default('/api/v1/webhooks/billing'),
23
- /** Reference to the webhook signing secret (resolved from secrets at runtime) */
24
- signingSecretRef: z.string().optional(),
25
- }).optional(),
26
- /** Default ISO 4217 currency for new billing accounts / products */
19
+ /*
20
+ * NO `webhooks` block. `path` and `signingSecretRef` were declared here and read by NOTHING —
21
+ * `signingSecretRef` had zero references outside its own declaration — and they were removed on
22
+ * 2026-09-08 (#408) rather than relabelled, because unlike the commercial-intent keys below they
23
+ * were not even an input to anything.
24
+ *
25
+ * The route and the signing secret both come from the provider module's `WEBHOOK_ORIGINATOR`
26
+ * contract: `buildWebhookEndpoints` mounts it at `/api/v1/webhooks/<provider>/billing`. That is
27
+ * the single authority, and `webhook-auto-controller.backend.service.ts` already recorded the
28
+ * same conclusion when endpoint-level path/secret extras were dropped as dead in the 2026-05-06
29
+ * reshape. This block was the copy that survived that sweep.
30
+ */
31
+ /**
32
+ * DECLARATION-ONLY (#408, 2026-09-08). Read by the application-creation commercial-model brief and
33
+ * by no runtime billing path: nothing validates a product's currency against these, and what
34
+ * reaches the provider is each price's own `currency`. Authoring them records the commercial
35
+ * intent a reviewer reads; it enforces nothing.
36
+ */
27
37
  defaultCurrency: CurrencySchema.default('USD'),
28
- /** Supported currencies (for multi-currency apps) */
38
+ /** DECLARATION-ONLY see `defaultCurrency`. */
29
39
  supportedCurrencies: z.array(CurrencySchema).default(['USD']),
30
40
  /**
31
41
  * Tax configuration — calculation is ALWAYS delegated to provider (Stripe Tax, etc.).
32
42
  * We never calculate tax locally.
33
43
  */
34
44
  tax: z.object({
35
- /** How the provider handles tax calculation */
45
+ /**
46
+ * Whether the PROVIDER computes tax on a purchase. READ since 2026-09-08 (#408): the checkout
47
+ * path — the only production purchase route — sends `automaticTax` from this value.
48
+ *
49
+ * It reached nothing before that, so `PROVIDER_MANAGED` changed no behaviour and the provider
50
+ * account's own configuration silently decided. Enabling it changes invoice totals and the tax
51
+ * amounts persisted against them, which is why it is a decision an application makes rather
52
+ * than a default the framework picks.
53
+ */
36
54
  calculationMode: z.enum(TaxCalculationMode).default(TaxCalculationMode.DISABLED),
37
55
  /**
38
56
  * How prices are DISPLAYED to users (does not affect provider calculation).
@@ -41,7 +59,10 @@ export const BillingConfigurationSchema = z.object({
41
59
  * - 'inclusive': Prices shown including tax (TTC / inc-VAT). Tax is embedded.
42
60
  * Common for consumer-facing. Shows "€49/mo TTC" and tax is extracted at checkout.
43
61
  *
44
- * Overridable per product (product.taxDisplayMode) and per price (price.taxBehavior).
62
+ * DECLARATIVE ONLY: nothing reads this value. It is not an application-wide default that
63
+ * `product.taxDisplayMode` and `price.taxBehavior` override, because there is no resolution
64
+ * chain between the three. What reaches the billing provider is each price's own
65
+ * `taxBehavior`, and only that.
45
66
  */
46
67
  defaultDisplayMode: z.enum(TaxDisplayMode).default(TaxDisplayMode.EXCLUSIVE),
47
68
  }).default(() => ({
@@ -58,7 +79,12 @@ export const BillingConfigurationSchema = z.object({
58
79
  * Controls whether the promotions subsystem is active.
59
80
  */
60
81
  promotions: z.object({
61
- /** Whether promotions/coupons are enabled */
82
+ /**
83
+ * DECLARATION-ONLY (#408, 2026-09-08), and the sharpest of them: the promotions subsystem runs
84
+ * UNCONDITIONALLY. Promotion codes are applied at `billing-account.mutations` and resolved in
85
+ * `billing-state`, neither of which consults this flag — so setting it `false` disables
86
+ * nothing, which is a stronger statement than "is not read".
87
+ */
62
88
  enabled: z.boolean().default(true),
63
89
  }).default(() => ({
64
90
  enabled: true,
@@ -68,7 +94,10 @@ export const BillingConfigurationSchema = z.object({
68
94
  * Controls whether credit pools are enabled and defines default pool behavior.
69
95
  */
70
96
  creditPools: z.object({
71
- /** Whether credit pool functionality is enabled (auto-creation on CREDIT_PACK purchase) */
97
+ /**
98
+ * DECLARATION-ONLY (#408, 2026-09-08) — same shape as `promotions.enabled` above, and the same
99
+ * correction: credit pools run unconditionally in `billing-state`, so `false` disables nothing.
100
+ */
72
101
  enabled: z.boolean().default(true),
73
102
  /** Default initial balance for auto-created pools (default 0) */
74
103
  defaultInitialBalance: z.number().min(0).default(0),
@@ -80,13 +109,26 @@ export const BillingConfigurationSchema = z.object({
80
109
  defaultBehaviorPolicy: z.object({
81
110
  /** Default trial days for new subscriptions (0 = no trial) */
82
111
  defaultTrialDays: z.number().min(0).default(0),
83
- /** Grace period before marking subscription as past_due after failed payment */
112
+ /**
113
+ * DECLARATION-ONLY (#408, 2026-09-08). Dunning — how long to wait and how often to retry after a
114
+ * failed payment — is configured at the PROVIDER, on its own schedule, and nothing here reaches
115
+ * it. Binding them would mean writing a provider's retry settings from application config, which
116
+ * is a different feature from reading a policy at a call site.
117
+ */
84
118
  paymentGracePeriodDays: z.number().min(0).default(3),
85
- /** Maximum automatic payment retries before giving up */
119
+ /** DECLARATION-ONLY see `paymentGracePeriodDays`. */
86
120
  maxPaymentRetries: z.number().min(0).default(3),
87
- /** Default proration when no product-specific policy */
121
+ /** Default proration when no product-specific policy. READ by the change-plan path. */
88
122
  defaultProration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),
89
- /** Default cancellation behavior */
123
+ /**
124
+ * Default cancellation timing when neither the caller nor the plan product names one.
125
+ *
126
+ * READ since 2026-09-08 (#408). It was dead until then, and it is bound rather than relabelled
127
+ * because — unlike its neighbours above — it needs no provider call at all: cancellation timing
128
+ * is resolved locally, so the only thing standing between this key and meaning something was a
129
+ * reader. The chain is caller → product `behaviorPolicy.cancellation.defaultBehavior` → this →
130
+ * period-end.
131
+ */
90
132
  defaultCancellation: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),
91
133
  }).default(() => ({
92
134
  defaultTrialDays: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"billing-configuration.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,gCAAgC,CAAC;AAExC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,sDAAsD;IACtD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,qDAAqD;IACrD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAElC,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,wCAAwC;QACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,0BAA0B,CAAC;QACpD,iFAAiF;QACjF,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACxC,CAAC,CAAC,QAAQ,EAAE;I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GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;KACpD,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChB,OAAO,EAAE,IAAI;QACb,qBAAqB,EAAE,CAAC;KACzB,CAAC,CAAC;IAEH,uFAAuF;IACvF,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC;QAC9B,8DAA8D;QAC9D,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC9C,gFAAgF;QAChF,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACpD,yDAAyD;QACzD,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/C,wDAAwD;QACxD,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;QACxF,oCAAoC;QACpC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC;KAChF,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAChB,gBAAgB,EAAE,CAAC;QACnB,sBAAsB,EAAE,CAAC;QACzB,iBAAiB,EAAE,CAAC;QACpB,gBAAgB,EAAE,iBAAiB,CAAC,iBAAiB;QACrD,mBAAmB,EAAE,aAAa,CAAC,aAAa;KACjD,CAAC,CAAC;CACJ,CAAC,CAAC","sourcesContent":["/**\n * Billing Configuration Schema (Shared)\n *\n * Top-level billing configuration that custom apps provide at startup.\n * Controls: provider selection, currency, tax policy, enabled scopes,\n * and default behavior policies.\n *\n * @see billing-and-features-system.md §6.7 (Billing Configuration)\n */\n\nimport { z } from 'zod';\nimport { CurrencySchema } from '@wildo-ai/zod-decorators';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n TaxCalculationMode,\n TaxDisplayMode,\n ProrationBehavior,\n BillingTiming,\n} from './billing-enums.shared.schemas';\n\nexport const BillingConfigurationSchema = z.object({\n /** Master switch: is billing enabled for this app? */\n enabled: z.boolean().default(false),\n /** Which billing provider to use (e.g., 'stripe') */\n providerRef: z.string().optional(),\n\n /** Webhook configuration */\n webhooks: z.object({\n /** Path for billing webhook endpoint */\n path: z.string().default('/api/v1/webhooks/billing'),\n /** Reference to the webhook signing secret (resolved from secrets at runtime) */\n signingSecretRef: z.string().optional(),\n }).optional(),\n\n /** Default ISO 4217 currency for new billing accounts / products */\n defaultCurrency: CurrencySchema.default('USD'),\n /** Supported currencies (for multi-currency apps) */\n supportedCurrencies: z.array(CurrencySchema).default(['USD']),\n\n /**\n * Tax configuration — calculation is ALWAYS delegated to provider (Stripe Tax, etc.).\n * We never calculate tax locally.\n */\n tax: z.object({\n /** How the provider handles tax calculation */\n calculationMode: z.enum(TaxCalculationMode).default(TaxCalculationMode.DISABLED),\n\n /**\n * How prices are DISPLAYED to users (does not affect provider calculation).\n * - 'exclusive': Prices shown excluding tax (HT / ex-VAT). Tax added at checkout.\n * Common for B2B. Shows \"$49/mo\" and tax is added separately.\n * - 'inclusive': Prices shown including tax (TTC / inc-VAT). Tax is embedded.\n * Common for consumer-facing. Shows \"€49/mo TTC\" and tax is extracted at checkout.\n *\n * Overridable per product (product.taxDisplayMode) and per price (price.taxBehavior).\n */\n defaultDisplayMode: z.enum(TaxDisplayMode).default(TaxDisplayMode.EXCLUSIVE),\n }).default(() => ({\n calculationMode: TaxCalculationMode.DISABLED,\n defaultDisplayMode: TaxDisplayMode.EXCLUSIVE,\n })),\n\n /**\n * Which scopes can have billing accounts (default: ORGANIZATIONS only).\n * Can be extended to include USER_SELF (personal billing).\n */\n enabledScopes: z.array(z.enum(ResourcePrimaryScope)).default([ResourcePrimaryScope.ORGANIZATIONS]),\n\n /**\n * Promotions configuration.\n * Controls whether the promotions subsystem is active.\n */\n promotions: z.object({\n /** Whether promotions/coupons are enabled */\n enabled: z.boolean().default(true),\n }).default(() => ({\n enabled: true,\n })),\n\n /**\n * Credit pool configuration.\n * Controls whether credit pools are enabled and defines default pool behavior.\n */\n creditPools: z.object({\n /** Whether credit pool functionality is enabled (auto-creation on CREDIT_PACK purchase) */\n enabled: z.boolean().default(true),\n /** Default initial balance for auto-created pools (default 0) */\n defaultInitialBalance: z.number().min(0).default(0),\n }).default(() => ({\n enabled: true,\n defaultInitialBalance: 0,\n })),\n\n /** Global billing policy defaults (overridden by ProductBehaviorPolicy per product) */\n defaultBehaviorPolicy: z.object({\n /** Default trial days for new subscriptions (0 = no trial) */\n defaultTrialDays: z.number().min(0).default(0),\n /** Grace period before marking subscription as past_due after failed payment */\n paymentGracePeriodDays: z.number().min(0).default(3),\n /** Maximum automatic payment retries before giving up */\n maxPaymentRetries: z.number().min(0).default(3),\n /** Default proration when no product-specific policy */\n defaultProration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),\n /** Default cancellation behavior */\n defaultCancellation: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).default(() => ({\n defaultTrialDays: 0,\n paymentGracePeriodDays: 3,\n maxPaymentRetries: 3,\n defaultProration: ProrationBehavior.CREATE_PRORATIONS,\n defaultCancellation: BillingTiming.AT_PERIOD_END,\n })),\n});\nexport type BillingConfiguration = z.infer<typeof BillingConfigurationSchema>;\n"]}
1
+ {"version":3,"file":"billing-configuration.shared.schemas.js","sourceRoot":"","sources":["../../../../src/billing/billing-configuration.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MA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AG,EAAE,CAAC,CAAC;QAChB,gBAAgB,EAAE,CAAC;QACnB,sBAAsB,EAAE,CAAC;QACzB,iBAAiB,EAAE,CAAC;QACpB,gBAAgB,EAAE,iBAAiB,CAAC,iBAAiB;QACrD,mBAAmB,EAAE,aAAa,CAAC,aAAa;KACjD,CAAC,CAAC;CACJ,CAAC,CAAC","sourcesContent":["/**\n * Billing Configuration Schema (Shared)\n *\n * Top-level billing configuration that custom apps provide at startup.\n * Controls: provider selection, currency, tax policy, enabled scopes,\n * and default behavior policies.\n *\n * @see billing-and-features-system.md §6.7 (Billing Configuration)\n */\n\nimport { z } from 'zod';\nimport { CurrencySchema } from '@wildo-ai/zod-decorators';\nimport { ResourcePrimaryScope } from '../resources/resources.shared.schemas';\nimport {\n TaxCalculationMode,\n TaxDisplayMode,\n ProrationBehavior,\n BillingTiming,\n} from './billing-enums.shared.schemas';\n\nexport const BillingConfigurationSchema = z.object({\n /** Master switch: is billing enabled for this app? */\n enabled: z.boolean().default(false),\n /** Which billing provider to use (e.g., 'stripe') */\n providerRef: z.string().optional(),\n\n /*\n * NO `webhooks` block. `path` and `signingSecretRef` were declared here and read by NOTHING —\n * `signingSecretRef` had zero references outside its own declaration — and they were removed on\n * 2026-09-08 (#408) rather than relabelled, because unlike the commercial-intent keys below they\n * were not even an input to anything.\n *\n * The route and the signing secret both come from the provider module's `WEBHOOK_ORIGINATOR`\n * contract: `buildWebhookEndpoints` mounts it at `/api/v1/webhooks/<provider>/billing`. That is\n * the single authority, and `webhook-auto-controller.backend.service.ts` already recorded the\n * same conclusion when endpoint-level path/secret extras were dropped as dead in the 2026-05-06\n * reshape. This block was the copy that survived that sweep.\n */\n\n /**\n * DECLARATION-ONLY (#408, 2026-09-08). Read by the application-creation commercial-model brief and\n * by no runtime billing path: nothing validates a product's currency against these, and what\n * reaches the provider is each price's own `currency`. Authoring them records the commercial\n * intent a reviewer reads; it enforces nothing.\n */\n defaultCurrency: CurrencySchema.default('USD'),\n /** DECLARATION-ONLY — see `defaultCurrency`. */\n supportedCurrencies: z.array(CurrencySchema).default(['USD']),\n\n /**\n * Tax configuration — calculation is ALWAYS delegated to provider (Stripe Tax, etc.).\n * We never calculate tax locally.\n */\n tax: z.object({\n /**\n * Whether the PROVIDER computes tax on a purchase. READ since 2026-09-08 (#408): the checkout\n * path — the only production purchase route — sends `automaticTax` from this value.\n *\n * It reached nothing before that, so `PROVIDER_MANAGED` changed no behaviour and the provider\n * account's own configuration silently decided. Enabling it changes invoice totals and the tax\n * amounts persisted against them, which is why it is a decision an application makes rather\n * than a default the framework picks.\n */\n calculationMode: z.enum(TaxCalculationMode).default(TaxCalculationMode.DISABLED),\n\n /**\n * How prices are DISPLAYED to users (does not affect provider calculation).\n * - 'exclusive': Prices shown excluding tax (HT / ex-VAT). Tax added at checkout.\n * Common for B2B. Shows \"$49/mo\" and tax is added separately.\n * - 'inclusive': Prices shown including tax (TTC / inc-VAT). Tax is embedded.\n * Common for consumer-facing. Shows \"€49/mo TTC\" and tax is extracted at checkout.\n *\n * DECLARATIVE ONLY: nothing reads this value. It is not an application-wide default that\n * `product.taxDisplayMode` and `price.taxBehavior` override, because there is no resolution\n * chain between the three. What reaches the billing provider is each price's own\n * `taxBehavior`, and only that.\n */\n defaultDisplayMode: z.enum(TaxDisplayMode).default(TaxDisplayMode.EXCLUSIVE),\n }).default(() => ({\n calculationMode: TaxCalculationMode.DISABLED,\n defaultDisplayMode: TaxDisplayMode.EXCLUSIVE,\n })),\n\n /**\n * Which scopes can have billing accounts (default: ORGANIZATIONS only).\n * Can be extended to include USER_SELF (personal billing).\n */\n enabledScopes: z.array(z.enum(ResourcePrimaryScope)).default([ResourcePrimaryScope.ORGANIZATIONS]),\n\n /**\n * Promotions configuration.\n * Controls whether the promotions subsystem is active.\n */\n promotions: z.object({\n /**\n * DECLARATION-ONLY (#408, 2026-09-08), and the sharpest of them: the promotions subsystem runs\n * UNCONDITIONALLY. Promotion codes are applied at `billing-account.mutations` and resolved in\n * `billing-state`, neither of which consults this flag — so setting it `false` disables\n * nothing, which is a stronger statement than \"is not read\".\n */\n enabled: z.boolean().default(true),\n }).default(() => ({\n enabled: true,\n })),\n\n /**\n * Credit pool configuration.\n * Controls whether credit pools are enabled and defines default pool behavior.\n */\n creditPools: z.object({\n /**\n * DECLARATION-ONLY (#408, 2026-09-08) — same shape as `promotions.enabled` above, and the same\n * correction: credit pools run unconditionally in `billing-state`, so `false` disables nothing.\n */\n enabled: z.boolean().default(true),\n /** Default initial balance for auto-created pools (default 0) */\n defaultInitialBalance: z.number().min(0).default(0),\n }).default(() => ({\n enabled: true,\n defaultInitialBalance: 0,\n })),\n\n /** Global billing policy defaults (overridden by ProductBehaviorPolicy per product) */\n defaultBehaviorPolicy: z.object({\n /** Default trial days for new subscriptions (0 = no trial) */\n defaultTrialDays: z.number().min(0).default(0),\n /**\n * DECLARATION-ONLY (#408, 2026-09-08). Dunning — how long to wait and how often to retry after a\n * failed payment — is configured at the PROVIDER, on its own schedule, and nothing here reaches\n * it. Binding them would mean writing a provider's retry settings from application config, which\n * is a different feature from reading a policy at a call site.\n */\n paymentGracePeriodDays: z.number().min(0).default(3),\n /** DECLARATION-ONLY — see `paymentGracePeriodDays`. */\n maxPaymentRetries: z.number().min(0).default(3),\n /** Default proration when no product-specific policy. READ by the change-plan path. */\n defaultProration: z.enum(ProrationBehavior).default(ProrationBehavior.CREATE_PRORATIONS),\n /**\n * Default cancellation timing when neither the caller nor the plan product names one.\n *\n * READ since 2026-09-08 (#408). It was dead until then, and it is bound rather than relabelled\n * because — unlike its neighbours above — it needs no provider call at all: cancellation timing\n * is resolved locally, so the only thing standing between this key and meaning something was a\n * reader. The chain is caller → product `behaviorPolicy.cancellation.defaultBehavior` → this →\n * period-end.\n */\n defaultCancellation: z.enum(BillingTiming).default(BillingTiming.AT_PERIOD_END),\n }).default(() => ({\n defaultTrialDays: 0,\n paymentGracePeriodDays: 3,\n maxPaymentRetries: 3,\n defaultProration: ProrationBehavior.CREATE_PRORATIONS,\n defaultCancellation: BillingTiming.AT_PERIOD_END,\n })),\n});\nexport type BillingConfiguration = z.infer<typeof BillingConfigurationSchema>;\n"]}
@@ -5,13 +5,27 @@
5
5
  * These supersede the legacy enums from billing.shared.schemas.ts.
6
6
  *
7
7
  * Enums shared with the standard billing interface (PricingModel, BillingInterval,
8
- * TaxDisplayMode, SubscriptionStatus) are defined in @wildo-ai/external-connectors-models
9
- * and re-exported here for convenience.
8
+ * TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior) are defined in
9
+ * @wildo-ai/external-connectors-models and re-exported here for convenience.
10
10
  *
11
11
  * @see billing-and-features-system.md §6 (Billing Schemas)
12
12
  */
13
- export { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus } from '@wildo-ai/external-connectors-models';
13
+ export { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior } from '@wildo-ai/external-connectors-models';
14
14
  /**
15
+ * @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer
16
+ *
17
+ * The vocabularies an application types into its own product catalogue — the `ProductDefinition[]`
18
+ * it exports from its shared library and hands to the engine with its module declarations.
19
+ *
20
+ * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`
21
+ * are re-exported from the connector models, because their values ARE the provider's wire values.
22
+ *
23
+ * ⚠️ **The catalogue is ONE-WAY.** Sync pushes only rows that have no provider link yet, so a product
24
+ * or price edited in the provider's own dashboard is never read back, never reconciled, and never
25
+ * reported. Removing a product from the array does not retire it at the provider and does not
26
+ * deactivate the existing row — nothing detects that a previously synced key has disappeared. Treat
27
+ * the array as the source of truth and make every change through it.
28
+ *
15
29
  * Product types available in the billing catalog.
16
30
  *
17
31
  * | Type | Creates subscription? | Repeatable? | Grants features? | Usage tracked? |
@@ -49,11 +63,6 @@ export declare enum LimitGrantMode {
49
63
  /**
50
64
  * Proration behavior for plan changes (upgrade/downgrade).
51
65
  */
52
- export declare enum ProrationBehavior {
53
- CREATE_PRORATIONS = "create_prorations",
54
- NONE = "none",
55
- ALWAYS_INVOICE = "always_invoice"
56
- }
57
66
  /**
58
67
  * Billing timing: when to apply plan changes.
59
68
  */
@@ -61,6 +70,7 @@ export declare enum BillingTiming {
61
70
  IMMEDIATE = "immediate",
62
71
  AT_PERIOD_END = "at_period_end"
63
72
  }
73
+ /** @wildo_source:part:end saas.models.billing.catalog-vocabularies */
64
74
  /**
65
75
  * Metering aggregation window for usage records.
66
76
  */
@@ -85,24 +95,56 @@ export declare enum UsageSourceType {
85
95
  CUSTOM = "custom"
86
96
  }
87
97
  /**
88
- * Tax calculation mode: provider-managed or disabled.
98
+ * Where one metered usage row stands with respect to the provider flush.
99
+ *
100
+ * This was a BOOLEAN (`reportedToProvider`) until 2026-09-09, and the third state is the whole
101
+ * reason it is an enum now (#512). A boolean can say "not yet reported" and "reported", and the
102
+ * flush selects on the first — so a row that can NEVER be reported has nowhere to go. It stays
103
+ * pending, is re-selected by every run, fails identically, and grows an error backlog that no
104
+ * operator action can drain, on a five-minute schedule.
105
+ *
106
+ * The three states are genuinely distinct and must not be collapsed:
107
+ *
108
+ * - {@link PENDING} — the flush will try again. Every newly recorded row starts here.
109
+ * - {@link REPORTED} — the provider acknowledged the quantity. `reportedAt` says when. Terminal,
110
+ * and money has moved: never move a row back out of this state.
111
+ * - {@link UNREPORTABLE} — the flush determined the row can never be reported, for a reason named
112
+ * in `unreportableReason`. Terminal, and NO money moved. Marking such a row `REPORTED` instead
113
+ * would drain the backlog just as well and would be a lie no later reader could detect, which is
114
+ * exactly why the state exists rather than a shortcut.
89
115
  */
90
- export declare enum TaxCalculationMode {
91
- PROVIDER_MANAGED = "provider_managed",
92
- DISABLED = "disabled"
116
+ export declare enum UsageRecordFlushState {
117
+ PENDING = "pending",
118
+ REPORTED = "reported",
119
+ UNREPORTABLE = "unreportable"
93
120
  }
94
121
  /**
95
- * Invoice status values (maps to Stripe invoice statuses).
122
+ * Why a usage row was determined to be permanently unreportable.
96
123
  *
97
- * Invoices are created and managed entirely by the billing provider.
98
- * We store a thin reference for status tracking and quick display.
124
+ * One member today, and it is a closed vocabulary rather than a free string because the operator
125
+ * reading a retained financial record needs to know which permanent condition applies — and because
126
+ * the distinction between a PERMANENT and a TRANSIENT failure is the judgement this whole state
127
+ * turns on. A billing account that merely has no `providerCustomerId` yet is transient: the account
128
+ * exists, provisioning may still complete, and such a row stays {@link UsageRecordFlushState.PENDING}.
129
+ * Only a condition that cannot resolve itself belongs here.
99
130
  */
100
- export declare enum InvoiceStatus {
101
- DRAFT = "draft",
102
- OPEN = "open",
103
- PAID = "paid",
104
- VOID = "void",
105
- UNCOLLECTIBLE = "uncollectible"
131
+ export declare enum UsageRecordUnreportableReason {
132
+ /**
133
+ * The billing account row no longer exists.
134
+ *
135
+ * Reachable by design: usage rows are RETAINED when their subject is erased (the tax/audit
136
+ * obligation on `usage-record.shared.schemas.ts`), so a deleted account legitimately leaves rows
137
+ * behind with no provider customer to report them to. Nothing can restore the mapping, so the
138
+ * quantity will never be billed and saying so on the row is the only honest outcome.
139
+ */
140
+ BILLING_ACCOUNT_DELETED = "billing_account_deleted"
141
+ }
142
+ /**
143
+ * Tax calculation mode: provider-managed or disabled.
144
+ */
145
+ export declare enum TaxCalculationMode {
146
+ PROVIDER_MANAGED = "provider_managed",
147
+ DISABLED = "disabled"
106
148
  }
107
149
  /**
108
150
  * Billing-compatible scope types.
@@ -224,6 +266,20 @@ export declare enum BillingCheckoutMetadataKey {
224
266
  BILLING_ACCOUNT_ID = "wildo_billingAccountId",
225
267
  /** The catalog product key purchased — selects the credit pool and credits-per-unit on top-up. */
226
268
  PRODUCT_KEY = "wildo_productKey",
269
+ /**
270
+ * The PROMOTION row whose code the framework validated when it opened this checkout, so the
271
+ * redemption can be counted when the session COMPLETES (#518).
272
+ *
273
+ * Absent when the purchase used no code, which is the common case.
274
+ *
275
+ * Stamped rather than re-derived from the completed session, because the provider reports the
276
+ * DISCOUNT it applied and not the Wildo row that authorised it — and the row is what carries
277
+ * `maxRedemptions`. Like every key here it is written for the framework's own reconciliation and is
278
+ * never trusted as authority on its own: the redemption is counted with a compare-and-swap that
279
+ * refuses past the cap, so a tampered value can at worst count a redemption against a promotion
280
+ * that has room for one.
281
+ */
282
+ PROMOTION_ID = "wildo_promotionId",
227
283
  /**
228
284
  * The purchased quantity, as a decimal integer string (provider metadata values are strings).
229
285
  * Strictly parsed and bounded by {@link BILLING_CHECKOUT_MAX_QUANTITY} on the way back in.
@@ -1 +1 @@
1
- {"version":3,"file":"billing-enums.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/billing-enums.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAIzH;;;;;;;;;;;GAWG;AACH,oBAAY,WAAW;IACrB,gEAAgE;IAChE,IAAI,SAAS;IACb,6DAA6D;IAC7D,KAAK,UAAU;IACf,kEAAkE;IAClE,OAAO,YAAY;IACnB,6EAA6E;IAC7E,QAAQ,aAAa;IACrB,sEAAsE;IACtE,WAAW,gBAAgB;IAC3B,0EAA0E;IAC1E,IAAI,SAAS;CACd;AAED;;;;GAIG;AACH,oBAAY,cAAc;IACxB,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAID;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,iBAAiB,sBAAsB;IACvC,IAAI,SAAS;IACb,cAAc,mBAAmB;CAClC;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,SAAS,cAAc;IACvB,aAAa,kBAAkB;CAChC;AAMD;;GAEG;AACH,oBAAY,yBAAyB;IACnC,SAAS,cAAc;IACvB,kBAAkB,uBAAuB;CAC1C;AAED;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED;;GAEG;AACH,oB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IAC7C,kGAAkG;IAClG,WAAW,qBAAqB;IAChC;;;OAGG;IACH,QAAQ,mBAAmB;CAC5B;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC"}
1
+ {"version":3,"file":"billing-enums.shared.schemas.d.ts","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;AAI3J;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,WAAW;IACrB,gEAAgE;IAChE,IAAI,SAAS;IACb,6DAA6D;IAC7D,KAAK,UAAU;IACf,kEAAkE;IAClE,OAAO,YAAY;IACnB,6EAA6E;IAC7E,QAAQ,aAAa;IACrB,sEAAsE;IACtE,WAAW,gBAAgB;IAC3B,0EAA0E;IAC1E,IAAI,SAAS;CACd;AAED;;;;GAIG;AACH,oBAAY,cAAc;IACxB,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAID;;GAEG;AAKH;;GAEG;AACH,oBAAY,aAAa;IACvB,SAAS,cAAc;IACvB,aAAa,kBAAkB;CAChC;AACD,sEAAsE;AAMtE;;GAEG;AACH,oBAAY,yBAAyB;IACnC,SAAS,cAAc;IACvB,kBAAkB,uBAAuB;CAC1C;AAED;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,MAAM,WAAW;CAClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED;;;;;;;;;GASG;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;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,SAAU,CAAC"}
@@ -5,14 +5,28 @@
5
5
  * These supersede the legacy enums from billing.shared.schemas.ts.
6
6
  *
7
7
  * Enums shared with the standard billing interface (PricingModel, BillingInterval,
8
- * TaxDisplayMode, SubscriptionStatus) are defined in @wildo-ai/external-connectors-models
9
- * and re-exported here for convenience.
8
+ * TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior) are defined in
9
+ * @wildo-ai/external-connectors-models and re-exported here for convenience.
10
10
  *
11
11
  * @see billing-and-features-system.md §6 (Billing Schemas)
12
12
  */
13
- export { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus } from '@wildo-ai/external-connectors-models';
13
+ export { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus, InvoiceStatus, ProrationBehavior } from '@wildo-ai/external-connectors-models';
14
14
  // ── Product & Pricing ──────────────────────────────────────────────
15
15
  /**
16
+ * @wildo_source:part:start saas.models.billing.catalog-vocabularies facet:layer:shared facet:audience:app-developer
17
+ *
18
+ * The vocabularies an application types into its own product catalogue — the `ProductDefinition[]`
19
+ * it exports from its shared library and hands to the engine with its module declarations.
20
+ *
21
+ * Imported from `@wildo-ai/saas-models`. `PricingModel`, `BillingInterval` and `ProrationBehavior`
22
+ * are re-exported from the connector models, because their values ARE the provider's wire values.
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.
29
+ *
16
30
  * Product types available in the billing catalog.
17
31
  *
18
32
  * | Type | Creates subscription? | Repeatable? | Grants features? | Usage tracked? |
@@ -53,12 +67,9 @@ export var LimitGrantMode;
53
67
  /**
54
68
  * Proration behavior for plan changes (upgrade/downgrade).
55
69
  */
56
- export var ProrationBehavior;
57
- (function (ProrationBehavior) {
58
- ProrationBehavior["CREATE_PRORATIONS"] = "create_prorations";
59
- ProrationBehavior["NONE"] = "none";
60
- ProrationBehavior["ALWAYS_INVOICE"] = "always_invoice";
61
- })(ProrationBehavior || (ProrationBehavior = {}));
70
+ // ProrationBehavior: re-exported from @wildo-ai/external-connectors-models (see top of file).
71
+ // Moved there 2026-09-08 (#516) because its three values ARE the provider's wire values, so the
72
+ // request contract has to be able to name the type — see TaxDisplayMode for the same reasoning.
62
73
  /**
63
74
  * Billing timing: when to apply plan changes.
64
75
  */
@@ -67,6 +78,7 @@ export var BillingTiming;
67
78
  BillingTiming["IMMEDIATE"] = "immediate";
68
79
  BillingTiming["AT_PERIOD_END"] = "at_period_end";
69
80
  })(BillingTiming || (BillingTiming = {}));
81
+ /** @wildo_source:part:end saas.models.billing.catalog-vocabularies */
70
82
  // BillingInterval: re-exported from @wildo-ai/external-connectors-models (see top of file)
71
83
  // ── Metering & Usage ───────────────────────────────────────────────
72
84
  /**
@@ -95,6 +107,53 @@ export var UsageSourceType;
95
107
  UsageSourceType["RESOURCE_COUNT"] = "resource_count";
96
108
  UsageSourceType["CUSTOM"] = "custom";
97
109
  })(UsageSourceType || (UsageSourceType = {}));
110
+ /**
111
+ * Where one metered usage row stands with respect to the provider flush.
112
+ *
113
+ * This was a BOOLEAN (`reportedToProvider`) until 2026-09-09, and the third state is the whole
114
+ * reason it is an enum now (#512). A boolean can say "not yet reported" and "reported", and the
115
+ * flush selects on the first — so a row that can NEVER be reported has nowhere to go. It stays
116
+ * pending, is re-selected by every run, fails identically, and grows an error backlog that no
117
+ * operator action can drain, on a five-minute schedule.
118
+ *
119
+ * The three states are genuinely distinct and must not be collapsed:
120
+ *
121
+ * - {@link PENDING} — the flush will try again. Every newly recorded row starts here.
122
+ * - {@link REPORTED} — the provider acknowledged the quantity. `reportedAt` says when. Terminal,
123
+ * and money has moved: never move a row back out of this state.
124
+ * - {@link UNREPORTABLE} — the flush determined the row can never be reported, for a reason named
125
+ * in `unreportableReason`. Terminal, and NO money moved. Marking such a row `REPORTED` instead
126
+ * would drain the backlog just as well and would be a lie no later reader could detect, which is
127
+ * exactly why the state exists rather than a shortcut.
128
+ */
129
+ export var UsageRecordFlushState;
130
+ (function (UsageRecordFlushState) {
131
+ UsageRecordFlushState["PENDING"] = "pending";
132
+ UsageRecordFlushState["REPORTED"] = "reported";
133
+ UsageRecordFlushState["UNREPORTABLE"] = "unreportable";
134
+ })(UsageRecordFlushState || (UsageRecordFlushState = {}));
135
+ /**
136
+ * Why a usage row was determined to be permanently unreportable.
137
+ *
138
+ * One member today, and it is a closed vocabulary rather than a free string because the operator
139
+ * reading a retained financial record needs to know which permanent condition applies — and because
140
+ * the distinction between a PERMANENT and a TRANSIENT failure is the judgement this whole state
141
+ * turns on. A billing account that merely has no `providerCustomerId` yet is transient: the account
142
+ * exists, provisioning may still complete, and such a row stays {@link UsageRecordFlushState.PENDING}.
143
+ * Only a condition that cannot resolve itself belongs here.
144
+ */
145
+ export var UsageRecordUnreportableReason;
146
+ (function (UsageRecordUnreportableReason) {
147
+ /**
148
+ * The billing account row no longer exists.
149
+ *
150
+ * Reachable by design: usage rows are RETAINED when their subject is erased (the tax/audit
151
+ * obligation on `usage-record.shared.schemas.ts`), so a deleted account legitimately leaves rows
152
+ * behind with no provider customer to report them to. Nothing can restore the mapping, so the
153
+ * quantity will never be billed and saying so on the row is the only honest outcome.
154
+ */
155
+ UsageRecordUnreportableReason["BILLING_ACCOUNT_DELETED"] = "billing_account_deleted";
156
+ })(UsageRecordUnreportableReason || (UsageRecordUnreportableReason = {}));
98
157
  // ── Tax ────────────────────────────────────────────────────────────
99
158
  // TaxDisplayMode: re-exported from @wildo-ai/external-connectors-models (see top of file)
100
159
  /**
@@ -107,20 +166,9 @@ export var TaxCalculationMode;
107
166
  })(TaxCalculationMode || (TaxCalculationMode = {}));
108
167
  // ── Subscription & Invoice Status ──────────────────────────────────
109
168
  // SubscriptionStatus: re-exported from @wildo-ai/external-connectors-models (see top of file)
110
- /**
111
- * Invoice status values (maps to Stripe invoice statuses).
112
- *
113
- * Invoices are created and managed entirely by the billing provider.
114
- * We store a thin reference for status tracking and quick display.
115
- */
116
- export var InvoiceStatus;
117
- (function (InvoiceStatus) {
118
- InvoiceStatus["DRAFT"] = "draft";
119
- InvoiceStatus["OPEN"] = "open";
120
- InvoiceStatus["PAID"] = "paid";
121
- InvoiceStatus["VOID"] = "void";
122
- InvoiceStatus["UNCOLLECTIBLE"] = "uncollectible";
123
- })(InvoiceStatus || (InvoiceStatus = {}));
169
+ // InvoiceStatus: re-exported from @wildo-ai/external-connectors-models (see top of file).
170
+ // It moved there on 2026-09-09 so `StandardBilling_InvoiceData` could name it; the specifier every
171
+ // consumer imports is unchanged.
124
172
  // ── Billing Scope ──────────────────────────────────────────────────
125
173
  /**
126
174
  * Billing-compatible scope types.
@@ -252,6 +300,20 @@ export var BillingCheckoutMetadataKey;
252
300
  BillingCheckoutMetadataKey["BILLING_ACCOUNT_ID"] = "wildo_billingAccountId";
253
301
  /** The catalog product key purchased — selects the credit pool and credits-per-unit on top-up. */
254
302
  BillingCheckoutMetadataKey["PRODUCT_KEY"] = "wildo_productKey";
303
+ /**
304
+ * The PROMOTION row whose code the framework validated when it opened this checkout, so the
305
+ * redemption can be counted when the session COMPLETES (#518).
306
+ *
307
+ * Absent when the purchase used no code, which is the common case.
308
+ *
309
+ * Stamped rather than re-derived from the completed session, because the provider reports the
310
+ * DISCOUNT it applied and not the Wildo row that authorised it — and the row is what carries
311
+ * `maxRedemptions`. Like every key here it is written for the framework's own reconciliation and is
312
+ * never trusted as authority on its own: the redemption is counted with a compare-and-swap that
313
+ * refuses past the cap, so a tampered value can at worst count a redemption against a promotion
314
+ * that has room for one.
315
+ */
316
+ BillingCheckoutMetadataKey["PROMOTION_ID"] = "wildo_promotionId";
255
317
  /**
256
318
  * The purchased quantity, as a decimal integer string (provider metadata values are strings).
257
319
  * Strictly parsed and bounded by {@link BILLING_CHECKOUT_MAX_QUANTITY} on the way back in.
@@ -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,MAAM,sCAAsC,CAAC;AAEzH,sEAAsE;AAEtE;;;;;;;;;;;GAWG;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,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,4DAAuC,CAAA;IACvC,kCAAa,CAAA;IACb,sDAAiC,CAAA;AACnC,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,gDAA+B,CAAA;AACjC,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,2FAA2F;AAE3F,sEAAsE;AAEtE;;GAEG;AACH,MAAM,CAAN,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,oDAAuB,CAAA;IACvB,sEAAyC,CAAA;AAC3C,CAAC,EAHW,yBAAyB,KAAzB,yBAAy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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) are defined in @wildo-ai/external-connectors-models\n * and re-exported here for convenience.\n *\n * @see billing-and-features-system.md §6 (Billing Schemas)\n */\n\nexport { PricingModel, BillingInterval, TaxDisplayMode, SubscriptionStatus } from '@wildo-ai/external-connectors-models';\n\n// ── Product & Pricing ──────────────────────────────────────────────\n\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 */\nexport enum ProrationBehavior {\n CREATE_PRORATIONS = 'create_prorations',\n NONE = 'none',\n ALWAYS_INVOICE = 'always_invoice',\n}\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\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// ── 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/**\n * Invoice status values (maps to Stripe invoice statuses).\n *\n * Invoices are created and managed entirely by the billing provider.\n * We store a thin reference for status tracking and quick display.\n */\nexport enum InvoiceStatus {\n DRAFT = 'draft',\n OPEN = 'open',\n PAID = 'paid',\n VOID = 'void',\n UNCOLLECTIBLE = 'uncollectible',\n}\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 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,gGAAgG;AAChG,gGAAgG;AAEhG;;GAEG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,a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CAAqB,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"]}
@@ -88,13 +88,13 @@ export declare const BillingStateResponseSchema: z.ZodObject<{
88
88
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
89
89
  billingAccountId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>>;
90
90
  status: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodEnum<typeof import("@wildo-ai/external-connectors-models").SubscriptionStatus>>>>>;
91
- items: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodArray<z.ZodObject<{
91
+ items: z.ZodArray<z.ZodObject<{
92
92
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>;
93
93
  productId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
94
94
  priceId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
95
95
  quantity: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDefault<z.ZodNumber>>;
96
96
  providerSubscriptionItemId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>;
97
- }, z.core.$strip>>>;
97
+ }, z.core.$strip>>;
98
98
  currentPeriodStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDate>>;
99
99
  currentPeriodEnd: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodDate>>>;
100
100
  trialStart: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodDate>>;
@@ -141,11 +141,11 @@ export declare const BillingStateResponseSchema: z.ZodObject<{
141
141
  requirePaymentMethod: z.ZodDefault<z.ZodBoolean>;
142
142
  }, z.core.$strip>>;
143
143
  upgrade: z.ZodOptional<z.ZodObject<{
144
- proration: z.ZodDefault<z.ZodEnum<typeof import("./billing-enums.shared.schemas").ProrationBehavior>>;
144
+ proration: z.ZodDefault<z.ZodEnum<typeof import("@wildo-ai/external-connectors-models").ProrationBehavior>>;
145
145
  timing: z.ZodDefault<z.ZodEnum<typeof import("./billing-enums.shared.schemas").BillingTiming>>;
146
146
  }, z.core.$strip>>;
147
147
  downgrade: z.ZodOptional<z.ZodObject<{
148
- proration: z.ZodDefault<z.ZodEnum<typeof import("./billing-enums.shared.schemas").ProrationBehavior>>;
148
+ proration: z.ZodDefault<z.ZodEnum<typeof import("@wildo-ai/external-connectors-models").ProrationBehavior>>;
149
149
  timing: z.ZodDefault<z.ZodEnum<typeof import("./billing-enums.shared.schemas").BillingTiming>>;
150
150
  }, z.core.$strip>>;
151
151
  cancellation: z.ZodOptional<z.ZodObject<{
@@ -193,7 +193,7 @@ export declare const BillingStateResponseSchema: z.ZodObject<{
193
193
  invoices: z.ZodArray<z.ZodObject<{
194
194
  _id: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
195
195
  billingAccountId: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodString>>;
196
- status: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodEnum<typeof import("./billing-enums.shared.schemas").InvoiceStatus>>>>;
196
+ status: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodEnum<typeof import("@wildo-ai/external-connectors-models").InvoiceStatus>>>>;
197
197
  total: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedMoneySchema>>;
198
198
  hostedInvoiceUrl: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>;
199
199
  invoicePdfUrl: import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<import("@wildo-ai/zod-decorators").DecoratedPrimitiveZodType<z.ZodOptional<z.ZodString>>>;
@@ -21,5 +21,5 @@ export declare const CreditPool_ConsumeRequestDto: z.ZodObject<{
21
21
  export declare const CreditPool_TopUpRequestDto: z.ZodObject<{
22
22
  credits: z.ZodNumber;
23
23
  }, z.core.$strip>;
24
- export declare const creditPoolsPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<typeof CreditPool_Operations, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
24
+ export declare const creditPoolsPolymorphicFactories: Record<string, import("..").ResourceConfiguration_InitializationFactory<typeof CreditPool_Operations, CoreResourceOperation.READ | CoreResourceOperation.UPDATE | CoreResourceOperation.UPDATE_MANY | CoreResourceOperation.CREATE | CoreResourceOperation.LIST, any>>;
25
25
  //# sourceMappingURL=credit-pool.shared.resources-config.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"credit-pool.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/credit-pool.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAazG,oBAAY,qBAAqB;IAC/B;gEAC4D;IAC5D,OAAO,YAAY;IACnB;8GAC0G;IAC1G,MAAM,WAAW;CAClB;AAID,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,eAAO,MAAM,+BAA+B,oOAiH3C,CAAC"}
1
+ {"version":3,"file":"credit-pool.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../../src/billing/credit-pool.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAoB,MAAM,gDAAgD,CAAC;AAczG,oBAAY,qBAAqB;IAC/B;gEAC4D;IAC5D,OAAO,YAAY;IACnB;8GAC0G;IAC1G,MAAM,WAAW;CAClB;AAID,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;iBAErC,CAAC;AAEH,eAAO,MAAM,+BAA+B,wQA0J3C,CAAC"}