@zonastery/bursar 0.0.1 → 1.0.0

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 (483) hide show
  1. package/README.md +85 -344
  2. package/dist/billing/auto-recharge-port.d.ts +27 -0
  3. package/dist/billing/auto-recharge-port.d.ts.map +1 -0
  4. package/dist/billing/auto-recharge-port.js +2 -0
  5. package/dist/billing/auto-recharge-port.js.map +1 -0
  6. package/dist/billing/auto-recharge-service.d.ts +43 -0
  7. package/dist/billing/auto-recharge-service.d.ts.map +1 -0
  8. package/dist/billing/auto-recharge-service.js +218 -0
  9. package/dist/billing/auto-recharge-service.js.map +1 -0
  10. package/dist/billing/billing-service.d.ts +71 -0
  11. package/dist/billing/billing-service.d.ts.map +1 -0
  12. package/dist/billing/billing-service.js +172 -0
  13. package/dist/billing/billing-service.js.map +1 -0
  14. package/dist/billing/billing-store.d.ts +59 -0
  15. package/dist/billing/billing-store.d.ts.map +1 -0
  16. package/dist/billing/billing-store.js +9 -0
  17. package/dist/billing/billing-store.js.map +1 -0
  18. package/dist/billing/contracts.d.ts +149 -0
  19. package/dist/billing/contracts.d.ts.map +1 -0
  20. package/dist/billing/contracts.js +2 -0
  21. package/dist/billing/contracts.js.map +1 -0
  22. package/dist/billing/event-handlers.d.ts +57 -0
  23. package/dist/billing/event-handlers.d.ts.map +1 -0
  24. package/dist/billing/event-handlers.js +667 -0
  25. package/dist/billing/event-handlers.js.map +1 -0
  26. package/dist/billing/event-processor.d.ts +19 -0
  27. package/dist/billing/event-processor.d.ts.map +1 -0
  28. package/dist/billing/event-processor.js +105 -0
  29. package/dist/billing/event-processor.js.map +1 -0
  30. package/dist/billing/financial-event-handlers.d.ts +26 -0
  31. package/dist/billing/financial-event-handlers.d.ts.map +1 -0
  32. package/dist/billing/financial-event-handlers.js +241 -0
  33. package/dist/billing/financial-event-handlers.js.map +1 -0
  34. package/dist/billing/index.d.ts +10 -0
  35. package/dist/billing/index.d.ts.map +1 -0
  36. package/dist/billing/index.js +6 -0
  37. package/dist/billing/index.js.map +1 -0
  38. package/dist/billing/management.d.ts +59 -0
  39. package/dist/billing/management.d.ts.map +1 -0
  40. package/dist/billing/management.js +113 -0
  41. package/dist/billing/management.js.map +1 -0
  42. package/dist/billing/policy-window.d.ts +24 -0
  43. package/dist/billing/policy-window.d.ts.map +1 -0
  44. package/dist/billing/policy-window.js +88 -0
  45. package/dist/billing/policy-window.js.map +1 -0
  46. package/dist/billing/postgres/repositories/auto-recharge.d.ts +32 -0
  47. package/dist/billing/postgres/repositories/auto-recharge.d.ts.map +1 -0
  48. package/dist/billing/postgres/repositories/auto-recharge.js +178 -0
  49. package/dist/billing/postgres/repositories/auto-recharge.js.map +1 -0
  50. package/dist/billing/postgres/repositories/customer.d.ts +12 -0
  51. package/dist/billing/postgres/repositories/customer.d.ts.map +1 -0
  52. package/dist/billing/postgres/repositories/customer.js +33 -0
  53. package/dist/billing/postgres/repositories/customer.js.map +1 -0
  54. package/dist/billing/postgres/repositories/dispute.d.ts +7 -0
  55. package/dist/billing/postgres/repositories/dispute.d.ts.map +1 -0
  56. package/dist/billing/postgres/repositories/dispute.js +18 -0
  57. package/dist/billing/postgres/repositories/dispute.js.map +1 -0
  58. package/dist/billing/postgres/repositories/event.d.ts +21 -0
  59. package/dist/billing/postgres/repositories/event.d.ts.map +1 -0
  60. package/dist/billing/postgres/repositories/event.js +47 -0
  61. package/dist/billing/postgres/repositories/event.js.map +1 -0
  62. package/dist/billing/postgres/repositories/invoice.d.ts +9 -0
  63. package/dist/billing/postgres/repositories/invoice.d.ts.map +1 -0
  64. package/dist/billing/postgres/repositories/invoice.js +36 -0
  65. package/dist/billing/postgres/repositories/invoice.js.map +1 -0
  66. package/dist/billing/postgres/repositories/offer.d.ts +26 -0
  67. package/dist/billing/postgres/repositories/offer.d.ts.map +1 -0
  68. package/dist/billing/postgres/repositories/offer.js +73 -0
  69. package/dist/billing/postgres/repositories/offer.js.map +1 -0
  70. package/dist/billing/postgres/repositories/payment.d.ts +32 -0
  71. package/dist/billing/postgres/repositories/payment.d.ts.map +1 -0
  72. package/dist/billing/postgres/repositories/payment.js +78 -0
  73. package/dist/billing/postgres/repositories/payment.js.map +1 -0
  74. package/dist/billing/postgres/repositories/preferences.d.ts +15 -0
  75. package/dist/billing/postgres/repositories/preferences.d.ts.map +1 -0
  76. package/dist/billing/postgres/repositories/preferences.js +23 -0
  77. package/dist/billing/postgres/repositories/preferences.js.map +1 -0
  78. package/dist/billing/postgres/repositories/refund.d.ts +7 -0
  79. package/dist/billing/postgres/repositories/refund.d.ts.map +1 -0
  80. package/dist/billing/postgres/repositories/refund.js +32 -0
  81. package/dist/billing/postgres/repositories/refund.js.map +1 -0
  82. package/dist/billing/postgres/repositories/subscription.d.ts +46 -0
  83. package/dist/billing/postgres/repositories/subscription.d.ts.map +1 -0
  84. package/dist/billing/postgres/repositories/subscription.js +187 -0
  85. package/dist/billing/postgres/repositories/subscription.js.map +1 -0
  86. package/dist/billing/postgres/repositories/topup.d.ts +27 -0
  87. package/dist/billing/postgres/repositories/topup.d.ts.map +1 -0
  88. package/dist/billing/postgres/repositories/topup.js +51 -0
  89. package/dist/billing/postgres/repositories/topup.js.map +1 -0
  90. package/dist/billing/postgres/store.d.ts +87 -0
  91. package/dist/billing/postgres/store.d.ts.map +1 -0
  92. package/dist/billing/postgres/store.js +527 -0
  93. package/dist/billing/postgres/store.js.map +1 -0
  94. package/dist/billing/service-types.d.ts +37 -0
  95. package/dist/billing/service-types.d.ts.map +1 -0
  96. package/dist/billing/service-types.js +2 -0
  97. package/dist/billing/service-types.js.map +1 -0
  98. package/dist/billing/types/auto-recharge.d.ts +56 -0
  99. package/dist/billing/types/auto-recharge.d.ts.map +1 -0
  100. package/dist/billing/types/auto-recharge.js +2 -0
  101. package/dist/billing/types/auto-recharge.js.map +1 -0
  102. package/dist/billing/types/catalog.d.ts +47 -0
  103. package/dist/billing/types/catalog.d.ts.map +1 -0
  104. package/dist/billing/types/catalog.js +2 -0
  105. package/dist/billing/types/catalog.js.map +1 -0
  106. package/dist/billing/types/common.d.ts +16 -0
  107. package/dist/billing/types/common.d.ts.map +1 -0
  108. package/dist/billing/types/common.js +2 -0
  109. package/dist/billing/types/common.js.map +1 -0
  110. package/dist/billing/types/documents.d.ts +39 -0
  111. package/dist/billing/types/documents.d.ts.map +1 -0
  112. package/dist/billing/types/documents.js +2 -0
  113. package/dist/billing/types/documents.js.map +1 -0
  114. package/dist/billing/types/events.d.ts +75 -0
  115. package/dist/billing/types/events.d.ts.map +1 -0
  116. package/dist/billing/types/events.js +38 -0
  117. package/dist/billing/types/events.js.map +1 -0
  118. package/dist/billing/types/index.d.ts +8 -0
  119. package/dist/billing/types/index.d.ts.map +1 -0
  120. package/dist/billing/types/index.js +8 -0
  121. package/dist/billing/types/index.js.map +1 -0
  122. package/dist/billing/types/preferences.d.ts +13 -0
  123. package/dist/billing/types/preferences.d.ts.map +1 -0
  124. package/dist/billing/types/preferences.js +2 -0
  125. package/dist/billing/types/preferences.js.map +1 -0
  126. package/dist/billing/types/subscriptions.d.ts +97 -0
  127. package/dist/billing/types/subscriptions.d.ts.map +1 -0
  128. package/dist/billing/types/subscriptions.js +12 -0
  129. package/dist/billing/types/subscriptions.js.map +1 -0
  130. package/dist/breakdown.d.ts +3 -1
  131. package/dist/breakdown.d.ts.map +1 -1
  132. package/dist/breakdown.js +4 -1
  133. package/dist/breakdown.js.map +1 -1
  134. package/dist/browser.d.ts +8 -0
  135. package/dist/browser.d.ts.map +1 -0
  136. package/dist/browser.js +7 -0
  137. package/dist/browser.js.map +1 -0
  138. package/dist/bursar.d.ts +80 -0
  139. package/dist/bursar.d.ts.map +1 -0
  140. package/dist/bursar.js +129 -0
  141. package/dist/bursar.js.map +1 -0
  142. package/dist/catalog.d.ts +61 -0
  143. package/dist/catalog.d.ts.map +1 -0
  144. package/dist/catalog.js +95 -0
  145. package/dist/catalog.js.map +1 -0
  146. package/dist/commerce/errors.d.ts +69 -0
  147. package/dist/commerce/errors.d.ts.map +1 -0
  148. package/dist/commerce/errors.js +107 -0
  149. package/dist/commerce/errors.js.map +1 -0
  150. package/dist/commerce/index.d.ts +6 -0
  151. package/dist/commerce/index.d.ts.map +1 -0
  152. package/dist/commerce/index.js +6 -0
  153. package/dist/commerce/index.js.map +1 -0
  154. package/dist/commerce/plan-change.d.ts +10 -0
  155. package/dist/commerce/plan-change.d.ts.map +1 -0
  156. package/dist/commerce/plan-change.js +42 -0
  157. package/dist/commerce/plan-change.js.map +1 -0
  158. package/dist/commerce/provider-registry.d.ts +18 -0
  159. package/dist/commerce/provider-registry.d.ts.map +1 -0
  160. package/dist/commerce/provider-registry.js +70 -0
  161. package/dist/commerce/provider-registry.js.map +1 -0
  162. package/dist/commerce/service.d.ts +73 -0
  163. package/dist/commerce/service.d.ts.map +1 -0
  164. package/dist/commerce/service.js +981 -0
  165. package/dist/commerce/service.js.map +1 -0
  166. package/dist/commerce/types.d.ts +217 -0
  167. package/dist/commerce/types.d.ts.map +1 -0
  168. package/dist/commerce/types.js.map +1 -0
  169. package/dist/config/parse-access.d.ts +6 -0
  170. package/dist/config/parse-access.d.ts.map +1 -0
  171. package/dist/config/parse-access.js +72 -0
  172. package/dist/config/parse-access.js.map +1 -0
  173. package/dist/config/parse-commerce.d.ts +3 -0
  174. package/dist/config/parse-commerce.d.ts.map +1 -0
  175. package/dist/config/parse-commerce.js +236 -0
  176. package/dist/config/parse-commerce.js.map +1 -0
  177. package/dist/config/parse-credits.d.ts +3 -0
  178. package/dist/config/parse-credits.d.ts.map +1 -0
  179. package/dist/config/parse-credits.js +99 -0
  180. package/dist/config/parse-credits.js.map +1 -0
  181. package/dist/config/parse-plans.d.ts +5 -0
  182. package/dist/config/parse-plans.d.ts.map +1 -0
  183. package/dist/config/parse-plans.js +126 -0
  184. package/dist/config/parse-plans.js.map +1 -0
  185. package/dist/config/parse-pricing.d.ts +4 -0
  186. package/dist/config/parse-pricing.d.ts.map +1 -0
  187. package/dist/config/parse-pricing.js +252 -0
  188. package/dist/config/parse-pricing.js.map +1 -0
  189. package/dist/config/parse-utils.d.ts +18 -0
  190. package/dist/config/parse-utils.d.ts.map +1 -0
  191. package/dist/config/parse-utils.js +118 -0
  192. package/dist/config/parse-utils.js.map +1 -0
  193. package/dist/config/types.d.ts +327 -0
  194. package/dist/config/types.d.ts.map +1 -0
  195. package/dist/config/types.js +2 -0
  196. package/dist/config/types.js.map +1 -0
  197. package/dist/config.d.ts +6 -22
  198. package/dist/config.d.ts.map +1 -1
  199. package/dist/config.js +82 -263
  200. package/dist/config.js.map +1 -1
  201. package/dist/{stores → credits}/events.d.ts +6 -6
  202. package/dist/credits/events.d.ts.map +1 -0
  203. package/dist/{stores → credits}/events.js +5 -5
  204. package/dist/credits/events.js.map +1 -0
  205. package/dist/credits/lease-workflow.d.ts +90 -0
  206. package/dist/credits/lease-workflow.d.ts.map +1 -0
  207. package/dist/credits/lease-workflow.js +378 -0
  208. package/dist/credits/lease-workflow.js.map +1 -0
  209. package/dist/credits/low-balance-monitor.d.ts +26 -0
  210. package/dist/credits/low-balance-monitor.d.ts.map +1 -0
  211. package/dist/credits/low-balance-monitor.js +110 -0
  212. package/dist/credits/low-balance-monitor.js.map +1 -0
  213. package/dist/credits/postgres/repositories/analytics.d.ts +77 -0
  214. package/dist/credits/postgres/repositories/analytics.d.ts.map +1 -0
  215. package/dist/credits/postgres/repositories/analytics.js +151 -0
  216. package/dist/credits/postgres/repositories/analytics.js.map +1 -0
  217. package/dist/credits/postgres/repositories/balance.d.ts +66 -0
  218. package/dist/credits/postgres/repositories/balance.d.ts.map +1 -0
  219. package/dist/credits/postgres/repositories/balance.js +139 -0
  220. package/dist/credits/postgres/repositories/balance.js.map +1 -0
  221. package/dist/credits/postgres/repositories/bucket.d.ts +25 -0
  222. package/dist/credits/postgres/repositories/bucket.d.ts.map +1 -0
  223. package/dist/credits/postgres/repositories/bucket.js +52 -0
  224. package/dist/credits/postgres/repositories/bucket.js.map +1 -0
  225. package/dist/credits/postgres/repositories/deduction.d.ts +55 -0
  226. package/dist/credits/postgres/repositories/deduction.d.ts.map +1 -0
  227. package/dist/credits/postgres/repositories/deduction.js +130 -0
  228. package/dist/credits/postgres/repositories/deduction.js.map +1 -0
  229. package/dist/credits/postgres/repositories/lease.d.ts +69 -0
  230. package/dist/credits/postgres/repositories/lease.d.ts.map +1 -0
  231. package/dist/credits/postgres/repositories/lease.js +148 -0
  232. package/dist/credits/postgres/repositories/lease.js.map +1 -0
  233. package/dist/credits/postgres/repositories/plan.d.ts +105 -0
  234. package/dist/credits/postgres/repositories/plan.d.ts.map +1 -0
  235. package/dist/credits/postgres/repositories/plan.js +182 -0
  236. package/dist/credits/postgres/repositories/plan.js.map +1 -0
  237. package/dist/credits/postgres/repositories/pricing.d.ts +28 -0
  238. package/dist/credits/postgres/repositories/pricing.d.ts.map +1 -0
  239. package/dist/credits/postgres/repositories/pricing.js +70 -0
  240. package/dist/credits/postgres/repositories/pricing.js.map +1 -0
  241. package/dist/credits/postgres/repositories/team.d.ts +63 -0
  242. package/dist/credits/postgres/repositories/team.d.ts.map +1 -0
  243. package/dist/credits/postgres/repositories/team.js +120 -0
  244. package/dist/credits/postgres/repositories/team.js.map +1 -0
  245. package/dist/credits/postgres/store.d.ts +84 -0
  246. package/dist/credits/postgres/store.d.ts.map +1 -0
  247. package/dist/credits/postgres/store.js +765 -0
  248. package/dist/credits/postgres/store.js.map +1 -0
  249. package/dist/credits/postgres/value-mappers.d.ts +17 -0
  250. package/dist/credits/postgres/value-mappers.d.ts.map +1 -0
  251. package/dist/credits/postgres/value-mappers.js +98 -0
  252. package/dist/credits/postgres/value-mappers.js.map +1 -0
  253. package/dist/credits/pricing-runtime.d.ts +34 -0
  254. package/dist/credits/pricing-runtime.d.ts.map +1 -0
  255. package/dist/credits/pricing-runtime.js +141 -0
  256. package/dist/credits/pricing-runtime.js.map +1 -0
  257. package/dist/credits/queries.d.ts +33 -0
  258. package/dist/credits/queries.d.ts.map +1 -0
  259. package/dist/credits/queries.js +71 -0
  260. package/dist/credits/queries.js.map +1 -0
  261. package/dist/credits/service-errors.d.ts +4 -0
  262. package/dist/credits/service-errors.d.ts.map +1 -0
  263. package/dist/credits/service-errors.js +57 -0
  264. package/dist/credits/service-errors.js.map +1 -0
  265. package/dist/credits/service-types.d.ts +122 -0
  266. package/dist/credits/service-types.d.ts.map +1 -0
  267. package/dist/credits/service-types.js +2 -0
  268. package/dist/credits/service-types.js.map +1 -0
  269. package/dist/credits/service.d.ts +207 -0
  270. package/dist/credits/service.d.ts.map +1 -0
  271. package/dist/credits/service.js +594 -0
  272. package/dist/credits/service.js.map +1 -0
  273. package/dist/{stores/credit-store.d.ts → credits/store.d.ts} +67 -71
  274. package/dist/credits/store.d.ts.map +1 -0
  275. package/dist/{stores/credit-store.js → credits/store.js} +30 -6
  276. package/dist/credits/store.js.map +1 -0
  277. package/dist/credits/types/account.d.ts +82 -0
  278. package/dist/credits/types/account.d.ts.map +1 -0
  279. package/dist/credits/types/account.js +2 -0
  280. package/dist/credits/types/account.js.map +1 -0
  281. package/dist/credits/types/admission.d.ts +39 -0
  282. package/dist/credits/types/admission.d.ts.map +1 -0
  283. package/dist/credits/types/admission.js +2 -0
  284. package/dist/credits/types/admission.js.map +1 -0
  285. package/dist/credits/types/analytics.d.ts +52 -0
  286. package/dist/credits/types/analytics.d.ts.map +1 -0
  287. package/dist/credits/types/analytics.js +2 -0
  288. package/dist/credits/types/analytics.js.map +1 -0
  289. package/dist/credits/types/catalog.d.ts +69 -0
  290. package/dist/credits/types/catalog.d.ts.map +1 -0
  291. package/dist/credits/types/catalog.js +2 -0
  292. package/dist/credits/types/catalog.js.map +1 -0
  293. package/dist/credits/types/grants.d.ts +24 -0
  294. package/dist/credits/types/grants.d.ts.map +1 -0
  295. package/dist/credits/types/grants.js +2 -0
  296. package/dist/credits/types/grants.js.map +1 -0
  297. package/dist/credits/types/index.d.ts +9 -0
  298. package/dist/credits/types/index.d.ts.map +1 -0
  299. package/dist/credits/types/index.js +2 -0
  300. package/dist/credits/types/index.js.map +1 -0
  301. package/dist/credits/types/ledger.d.ts +77 -0
  302. package/dist/credits/types/ledger.d.ts.map +1 -0
  303. package/dist/credits/types/ledger.js +2 -0
  304. package/dist/credits/types/ledger.js.map +1 -0
  305. package/dist/credits/types/quotas.d.ts +40 -0
  306. package/dist/credits/types/quotas.d.ts.map +1 -0
  307. package/dist/credits/types/quotas.js +2 -0
  308. package/dist/credits/types/quotas.js.map +1 -0
  309. package/dist/credits/types/teams.d.ts +44 -0
  310. package/dist/credits/types/teams.d.ts.map +1 -0
  311. package/dist/credits/types/teams.js +2 -0
  312. package/dist/credits/types/teams.js.map +1 -0
  313. package/dist/engine.d.ts +18 -39
  314. package/dist/engine.d.ts.map +1 -1
  315. package/dist/engine.js +169 -145
  316. package/dist/engine.js.map +1 -1
  317. package/dist/errors.d.ts +84 -25
  318. package/dist/errors.d.ts.map +1 -1
  319. package/dist/errors.js +117 -24
  320. package/dist/errors.js.map +1 -1
  321. package/dist/expr/ast.d.ts +46 -0
  322. package/dist/expr/ast.d.ts.map +1 -0
  323. package/dist/expr/ast.js +18 -0
  324. package/dist/expr/ast.js.map +1 -0
  325. package/dist/expr/evaluator.d.ts +4 -0
  326. package/dist/expr/evaluator.d.ts.map +1 -0
  327. package/dist/expr/evaluator.js +144 -0
  328. package/dist/expr/evaluator.js.map +1 -0
  329. package/dist/expr/language.d.ts +5 -0
  330. package/dist/expr/language.d.ts.map +1 -0
  331. package/dist/expr/language.js +73 -0
  332. package/dist/expr/language.js.map +1 -0
  333. package/dist/expr/parser.d.ts +24 -0
  334. package/dist/expr/parser.d.ts.map +1 -0
  335. package/dist/expr/parser.js +175 -0
  336. package/dist/expr/parser.js.map +1 -0
  337. package/dist/expr/tokenizer.d.ts +7 -0
  338. package/dist/expr/tokenizer.d.ts.map +1 -0
  339. package/dist/expr/tokenizer.js +85 -0
  340. package/dist/expr/tokenizer.js.map +1 -0
  341. package/dist/expr.d.ts +7 -58
  342. package/dist/expr.d.ts.map +1 -1
  343. package/dist/expr.js +41 -640
  344. package/dist/expr.js.map +1 -1
  345. package/dist/generated/pricing-config.schema.json +2764 -0
  346. package/dist/generated/pricing-config.types.d.ts +674 -0
  347. package/dist/generated/pricing-config.types.d.ts.map +1 -0
  348. package/dist/generated/pricing-config.types.js +8 -0
  349. package/dist/generated/pricing-config.types.js.map +1 -0
  350. package/dist/index.d.ts +21 -15
  351. package/dist/index.d.ts.map +1 -1
  352. package/dist/index.js +13 -9
  353. package/dist/index.js.map +1 -1
  354. package/dist/load-pricing-file.d.ts.map +1 -1
  355. package/dist/load-pricing-file.js +61 -6
  356. package/dist/load-pricing-file.js.map +1 -1
  357. package/dist/metrics.d.ts +6 -16
  358. package/dist/metrics.d.ts.map +1 -1
  359. package/dist/node.d.ts +9 -2
  360. package/dist/node.d.ts.map +1 -1
  361. package/dist/node.js +6 -2
  362. package/dist/node.js.map +1 -1
  363. package/dist/providers/_shared.d.ts +9 -0
  364. package/dist/providers/_shared.d.ts.map +1 -0
  365. package/dist/providers/_shared.js +25 -0
  366. package/dist/providers/_shared.js.map +1 -0
  367. package/dist/providers/dodo/client-contract.d.ts +106 -0
  368. package/dist/providers/dodo/client-contract.d.ts.map +1 -0
  369. package/dist/providers/dodo/client-contract.js +2 -0
  370. package/dist/providers/dodo/client-contract.js.map +1 -0
  371. package/dist/providers/dodo/event-mapper.d.ts +6 -0
  372. package/dist/providers/dodo/event-mapper.d.ts.map +1 -0
  373. package/dist/providers/dodo/event-mapper.js +344 -0
  374. package/dist/providers/dodo/event-mapper.js.map +1 -0
  375. package/dist/providers/dodo/index.d.ts +4 -0
  376. package/dist/providers/dodo/index.d.ts.map +1 -0
  377. package/dist/providers/dodo/index.js +3 -0
  378. package/dist/providers/dodo/index.js.map +1 -0
  379. package/dist/providers/dodo/provider.d.ts +53 -0
  380. package/dist/providers/dodo/provider.d.ts.map +1 -0
  381. package/dist/providers/dodo/provider.js +353 -0
  382. package/dist/providers/dodo/provider.js.map +1 -0
  383. package/dist/providers/index.d.ts +9 -0
  384. package/dist/providers/index.d.ts.map +1 -0
  385. package/dist/providers/index.js +7 -0
  386. package/dist/providers/index.js.map +1 -0
  387. package/dist/providers/mock/index.d.ts +2 -0
  388. package/dist/providers/mock/index.d.ts.map +1 -0
  389. package/dist/providers/mock/index.js +2 -0
  390. package/dist/providers/mock/index.js.map +1 -0
  391. package/dist/providers/mock/provider.d.ts +41 -0
  392. package/dist/providers/mock/provider.d.ts.map +1 -0
  393. package/dist/providers/mock/provider.js +124 -0
  394. package/dist/providers/mock/provider.js.map +1 -0
  395. package/dist/providers/stripe/event-mapper.d.ts +7 -0
  396. package/dist/providers/stripe/event-mapper.d.ts.map +1 -0
  397. package/dist/providers/stripe/event-mapper.js +342 -0
  398. package/dist/providers/stripe/event-mapper.js.map +1 -0
  399. package/dist/providers/stripe/index.d.ts +3 -0
  400. package/dist/providers/stripe/index.d.ts.map +1 -0
  401. package/dist/providers/stripe/index.js +3 -0
  402. package/dist/providers/stripe/index.js.map +1 -0
  403. package/dist/providers/stripe/provider.d.ts +48 -0
  404. package/dist/providers/stripe/provider.d.ts.map +1 -0
  405. package/dist/providers/stripe/provider.js +289 -0
  406. package/dist/providers/stripe/provider.js.map +1 -0
  407. package/dist/providers/types.d.ts +175 -0
  408. package/dist/providers/types.d.ts.map +1 -0
  409. package/dist/providers/types.js +18 -0
  410. package/dist/providers/types.js.map +1 -0
  411. package/dist/retry.d.ts +13 -0
  412. package/dist/retry.d.ts.map +1 -0
  413. package/dist/retry.js +28 -0
  414. package/dist/retry.js.map +1 -0
  415. package/dist/shared/logger.d.ts +10 -0
  416. package/dist/shared/logger.d.ts.map +1 -0
  417. package/dist/shared/logger.js +15 -0
  418. package/dist/shared/logger.js.map +1 -0
  419. package/dist/shared/postgres-client.d.ts +51 -0
  420. package/dist/shared/postgres-client.d.ts.map +1 -0
  421. package/dist/shared/postgres-client.js +101 -0
  422. package/dist/shared/postgres-client.js.map +1 -0
  423. package/dist/shared/postgres-types.d.ts +7 -0
  424. package/dist/shared/postgres-types.d.ts.map +1 -0
  425. package/dist/shared/postgres-types.js +2 -0
  426. package/dist/shared/postgres-types.js.map +1 -0
  427. package/dist/shared/postgres-validation.d.ts +8 -0
  428. package/dist/shared/postgres-validation.d.ts.map +1 -0
  429. package/dist/shared/postgres-validation.js +40 -0
  430. package/dist/shared/postgres-validation.js.map +1 -0
  431. package/dist/storage/adapters/clickhouse.d.ts +61 -0
  432. package/dist/storage/adapters/clickhouse.d.ts.map +1 -0
  433. package/dist/storage/adapters/clickhouse.js +329 -0
  434. package/dist/storage/adapters/clickhouse.js.map +1 -0
  435. package/dist/storage/adapters/s3.d.ts +35 -0
  436. package/dist/storage/adapters/s3.d.ts.map +1 -0
  437. package/dist/storage/adapters/s3.js +100 -0
  438. package/dist/storage/adapters/s3.js.map +1 -0
  439. package/dist/storage/outbox-worker.d.ts +40 -0
  440. package/dist/storage/outbox-worker.d.ts.map +1 -0
  441. package/dist/storage/outbox-worker.js +132 -0
  442. package/dist/storage/outbox-worker.js.map +1 -0
  443. package/dist/storage/ports.d.ts +77 -0
  444. package/dist/storage/ports.d.ts.map +1 -0
  445. package/dist/storage/ports.js +2 -0
  446. package/dist/storage/ports.js.map +1 -0
  447. package/dist/storage/postgres-repository.d.ts +14 -0
  448. package/dist/storage/postgres-repository.d.ts.map +1 -0
  449. package/dist/storage/postgres-repository.js +130 -0
  450. package/dist/storage/postgres-repository.js.map +1 -0
  451. package/dist/storage/runtime.d.ts +67 -0
  452. package/dist/storage/runtime.d.ts.map +1 -0
  453. package/dist/storage/runtime.js +313 -0
  454. package/dist/storage/runtime.js.map +1 -0
  455. package/package.json +70 -12
  456. package/dist/allowance.d.ts +0 -48
  457. package/dist/allowance.d.ts.map +0 -1
  458. package/dist/allowance.js +0 -140
  459. package/dist/allowance.js.map +0 -1
  460. package/dist/manager.d.ts +0 -421
  461. package/dist/manager.d.ts.map +0 -1
  462. package/dist/manager.js +0 -1112
  463. package/dist/manager.js.map +0 -1
  464. package/dist/stores/credit-store.d.ts.map +0 -1
  465. package/dist/stores/credit-store.js.map +0 -1
  466. package/dist/stores/events.d.ts.map +0 -1
  467. package/dist/stores/events.js.map +0 -1
  468. package/dist/stores/memory-store.d.ts +0 -178
  469. package/dist/stores/memory-store.d.ts.map +0 -1
  470. package/dist/stores/memory-store.js +0 -1833
  471. package/dist/stores/memory-store.js.map +0 -1
  472. package/dist/stores/postgres-store.d.ts +0 -95
  473. package/dist/stores/postgres-store.d.ts.map +0 -1
  474. package/dist/stores/postgres-store.js +0 -872
  475. package/dist/stores/postgres-store.js.map +0 -1
  476. package/dist/stores/supabase-store.d.ts +0 -76
  477. package/dist/stores/supabase-store.d.ts.map +0 -1
  478. package/dist/stores/supabase-store.js +0 -865
  479. package/dist/stores/supabase-store.js.map +0 -1
  480. package/dist/types.d.ts +0 -462
  481. package/dist/types.d.ts.map +0 -1
  482. package/dist/types.js.map +0 -1
  483. /package/dist/{types.js → commerce/types.js} +0 -0
@@ -0,0 +1,2764 @@
1
+ {
2
+ "$defs": {
3
+ "AdmissionConfig": {
4
+ "additionalProperties": false,
5
+ "properties": {
6
+ "policies": {
7
+ "additionalProperties": {
8
+ "$ref": "#/$defs/AdmissionPolicy"
9
+ },
10
+ "title": "Policies",
11
+ "type": "object"
12
+ }
13
+ },
14
+ "title": "AdmissionConfig",
15
+ "type": "object"
16
+ },
17
+ "AdmissionPolicy": {
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "max_in_flight": {
21
+ "anyOf": [
22
+ {
23
+ "minimum": 1,
24
+ "type": "integer"
25
+ },
26
+ {
27
+ "type": "null"
28
+ }
29
+ ],
30
+ "default": null,
31
+ "title": "Max In Flight"
32
+ },
33
+ "operations": {
34
+ "additionalProperties": {
35
+ "$ref": "#/$defs/OperationAdmission"
36
+ },
37
+ "title": "Operations",
38
+ "type": "object"
39
+ }
40
+ },
41
+ "title": "AdmissionPolicy",
42
+ "type": "object"
43
+ },
44
+ "AfterGrantExpiry": {
45
+ "additionalProperties": false,
46
+ "properties": {
47
+ "type": {
48
+ "const": "after_grant",
49
+ "title": "Type",
50
+ "type": "string"
51
+ },
52
+ "interval": {
53
+ "$ref": "#/$defs/BillingInterval"
54
+ },
55
+ "timezone": {
56
+ "default": "UTC",
57
+ "title": "Timezone",
58
+ "type": "string"
59
+ }
60
+ },
61
+ "required": [
62
+ "type",
63
+ "interval"
64
+ ],
65
+ "title": "AfterGrantExpiry",
66
+ "type": "object"
67
+ },
68
+ "AutoRechargeGuardrails": {
69
+ "additionalProperties": false,
70
+ "properties": {
71
+ "eligible_topups": {
72
+ "items": {
73
+ "type": "string"
74
+ },
75
+ "minItems": 1,
76
+ "title": "Eligible Topups",
77
+ "type": "array"
78
+ },
79
+ "balance_below": {
80
+ "$ref": "#/$defs/DecimalRange"
81
+ },
82
+ "rearm_above": {
83
+ "description": "Balance that rearms auto-recharge; it must exceed balance_below.maximum.",
84
+ "examples": [
85
+ "10.500000"
86
+ ],
87
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
88
+ "title": "Rearm Above",
89
+ "type": "string"
90
+ },
91
+ "quantity": {
92
+ "$ref": "#/$defs/IntegerRange"
93
+ },
94
+ "limits": {
95
+ "$ref": "#/$defs/AutoRechargeLimits"
96
+ }
97
+ },
98
+ "required": [
99
+ "eligible_topups",
100
+ "balance_below",
101
+ "rearm_above",
102
+ "quantity",
103
+ "limits"
104
+ ],
105
+ "title": "AutoRechargeGuardrails",
106
+ "type": "object"
107
+ },
108
+ "AutoRechargeLimits": {
109
+ "additionalProperties": false,
110
+ "properties": {
111
+ "max_purchases": {
112
+ "minimum": 1,
113
+ "title": "Max Purchases",
114
+ "type": "integer"
115
+ },
116
+ "window": {
117
+ "anyOf": [
118
+ {
119
+ "$ref": "#/$defs/CalendarWindow"
120
+ },
121
+ {
122
+ "$ref": "#/$defs/RollingWindow"
123
+ }
124
+ ],
125
+ "title": "Window"
126
+ },
127
+ "max_charge_minor": {
128
+ "minimum": 1,
129
+ "title": "Max Charge Minor",
130
+ "type": "integer"
131
+ },
132
+ "cooldown": {
133
+ "$ref": "#/$defs/Duration"
134
+ },
135
+ "max_consecutive_failures": {
136
+ "default": 3,
137
+ "minimum": 1,
138
+ "title": "Max Consecutive Failures",
139
+ "type": "integer"
140
+ },
141
+ "failure_action": {
142
+ "const": "pause",
143
+ "default": "pause",
144
+ "title": "Failure Action",
145
+ "type": "string"
146
+ }
147
+ },
148
+ "required": [
149
+ "max_purchases",
150
+ "window",
151
+ "max_charge_minor",
152
+ "cooldown"
153
+ ],
154
+ "title": "AutoRechargeLimits",
155
+ "type": "object"
156
+ },
157
+ "Availability": {
158
+ "additionalProperties": false,
159
+ "properties": {
160
+ "starts_at": {
161
+ "anyOf": [
162
+ {
163
+ "format": "date-time",
164
+ "type": "string"
165
+ },
166
+ {
167
+ "type": "null"
168
+ }
169
+ ],
170
+ "default": null,
171
+ "title": "Starts At"
172
+ },
173
+ "ends_at": {
174
+ "anyOf": [
175
+ {
176
+ "format": "date-time",
177
+ "type": "string"
178
+ },
179
+ {
180
+ "type": "null"
181
+ }
182
+ ],
183
+ "default": null,
184
+ "title": "Ends At"
185
+ },
186
+ "regions": {
187
+ "items": {
188
+ "type": "string"
189
+ },
190
+ "title": "Regions",
191
+ "type": "array"
192
+ }
193
+ },
194
+ "title": "Availability",
195
+ "type": "object"
196
+ },
197
+ "BillingInterval": {
198
+ "additionalProperties": false,
199
+ "properties": {
200
+ "unit": {
201
+ "enum": [
202
+ "day",
203
+ "week",
204
+ "month",
205
+ "year"
206
+ ],
207
+ "title": "Unit",
208
+ "type": "string"
209
+ },
210
+ "count": {
211
+ "default": 1,
212
+ "minimum": 1,
213
+ "title": "Count",
214
+ "type": "integer"
215
+ }
216
+ },
217
+ "required": [
218
+ "unit"
219
+ ],
220
+ "title": "BillingInterval",
221
+ "type": "object"
222
+ },
223
+ "BooleanFeature": {
224
+ "additionalProperties": false,
225
+ "properties": {
226
+ "type": {
227
+ "const": "boolean",
228
+ "title": "Type",
229
+ "type": "string"
230
+ },
231
+ "default": {
232
+ "type": "boolean",
233
+ "title": "Default"
234
+ }
235
+ },
236
+ "required": [
237
+ "type",
238
+ "default"
239
+ ],
240
+ "title": "BooleanFeature",
241
+ "type": "object"
242
+ },
243
+ "BucketDefinition": {
244
+ "additionalProperties": false,
245
+ "properties": {
246
+ "priority": {
247
+ "minimum": 0,
248
+ "title": "Priority",
249
+ "type": "integer"
250
+ },
251
+ "expiry": {
252
+ "discriminator": {
253
+ "mapping": {
254
+ "after_grant": "#/$defs/AfterGrantExpiry",
255
+ "end_of_window": "#/$defs/EndOfWindowExpiry",
256
+ "fixed_at": "#/$defs/FixedExpiry",
257
+ "never": "#/$defs/NeverExpiry",
258
+ "subscription_end": "#/$defs/SubscriptionEndExpiry"
259
+ },
260
+ "propertyName": "type"
261
+ },
262
+ "oneOf": [
263
+ {
264
+ "$ref": "#/$defs/NeverExpiry"
265
+ },
266
+ {
267
+ "$ref": "#/$defs/AfterGrantExpiry"
268
+ },
269
+ {
270
+ "$ref": "#/$defs/EndOfWindowExpiry"
271
+ },
272
+ {
273
+ "$ref": "#/$defs/FixedExpiry"
274
+ },
275
+ {
276
+ "$ref": "#/$defs/SubscriptionEndExpiry"
277
+ }
278
+ ],
279
+ "title": "Expiry"
280
+ }
281
+ },
282
+ "required": [
283
+ "priority"
284
+ ],
285
+ "title": "BucketDefinition",
286
+ "type": "object"
287
+ },
288
+ "CalendarWindow": {
289
+ "additionalProperties": false,
290
+ "properties": {
291
+ "type": {
292
+ "const": "calendar",
293
+ "title": "Type",
294
+ "type": "string"
295
+ },
296
+ "unit": {
297
+ "enum": [
298
+ "day",
299
+ "week",
300
+ "month",
301
+ "year"
302
+ ],
303
+ "title": "Unit",
304
+ "type": "string"
305
+ },
306
+ "count": {
307
+ "default": 1,
308
+ "minimum": 1,
309
+ "title": "Count",
310
+ "type": "integer"
311
+ },
312
+ "timezone": {
313
+ "default": "UTC",
314
+ "title": "Timezone",
315
+ "type": "string"
316
+ }
317
+ },
318
+ "required": [
319
+ "type",
320
+ "unit"
321
+ ],
322
+ "title": "CalendarWindow",
323
+ "type": "object"
324
+ },
325
+ "CatalogConfig": {
326
+ "additionalProperties": false,
327
+ "properties": {
328
+ "default_plan": {
329
+ "anyOf": [
330
+ {
331
+ "type": "string"
332
+ },
333
+ {
334
+ "type": "null"
335
+ }
336
+ ],
337
+ "default": null,
338
+ "title": "Default Plan"
339
+ }
340
+ },
341
+ "title": "CatalogConfig",
342
+ "type": "object"
343
+ },
344
+ "ChargeUnmatched": {
345
+ "additionalProperties": false,
346
+ "properties": {
347
+ "action": {
348
+ "const": "charge",
349
+ "title": "Action",
350
+ "type": "string"
351
+ },
352
+ "charge": {
353
+ "discriminator": {
354
+ "mapping": {
355
+ "expression": "#/$defs/ExpressionCharge",
356
+ "flat": "#/$defs/FlatCharge",
357
+ "graduated": "#/$defs/GraduatedCharge",
358
+ "package": "#/$defs/PackageCharge",
359
+ "per_unit": "#/$defs/PerUnitCharge",
360
+ "sum": "#/$defs/SumCharge",
361
+ "volume": "#/$defs/VolumeCharge"
362
+ },
363
+ "propertyName": "type"
364
+ },
365
+ "oneOf": [
366
+ {
367
+ "$ref": "#/$defs/FlatCharge"
368
+ },
369
+ {
370
+ "$ref": "#/$defs/PerUnitCharge"
371
+ },
372
+ {
373
+ "$ref": "#/$defs/PackageCharge"
374
+ },
375
+ {
376
+ "$ref": "#/$defs/GraduatedCharge"
377
+ },
378
+ {
379
+ "$ref": "#/$defs/VolumeCharge"
380
+ },
381
+ {
382
+ "$ref": "#/$defs/ExpressionCharge"
383
+ },
384
+ {
385
+ "$ref": "#/$defs/SumCharge"
386
+ }
387
+ ],
388
+ "title": "Charge"
389
+ }
390
+ },
391
+ "required": [
392
+ "action",
393
+ "charge"
394
+ ],
395
+ "title": "ChargeUnmatched",
396
+ "type": "object"
397
+ },
398
+ "CommerceConfig": {
399
+ "additionalProperties": false,
400
+ "properties": {
401
+ "providers": {
402
+ "additionalProperties": {
403
+ "discriminator": {
404
+ "mapping": {
405
+ "custom": "#/$defs/CustomProvider",
406
+ "dodo": "#/$defs/DodoProvider",
407
+ "stripe": "#/$defs/StripeProvider"
408
+ },
409
+ "propertyName": "type"
410
+ },
411
+ "oneOf": [
412
+ {
413
+ "$ref": "#/$defs/StripeProvider"
414
+ },
415
+ {
416
+ "$ref": "#/$defs/DodoProvider"
417
+ },
418
+ {
419
+ "$ref": "#/$defs/CustomProvider"
420
+ }
421
+ ]
422
+ },
423
+ "title": "Providers",
424
+ "type": "object"
425
+ },
426
+ "offers": {
427
+ "additionalProperties": {
428
+ "discriminator": {
429
+ "mapping": {
430
+ "subscription": "#/$defs/SubscriptionOffer",
431
+ "topup": "#/$defs/TopupOffer"
432
+ },
433
+ "propertyName": "type"
434
+ },
435
+ "oneOf": [
436
+ {
437
+ "$ref": "#/$defs/SubscriptionOffer"
438
+ },
439
+ {
440
+ "$ref": "#/$defs/TopupOffer"
441
+ }
442
+ ]
443
+ },
444
+ "title": "Offers",
445
+ "type": "object"
446
+ },
447
+ "subscription_changes": {
448
+ "anyOf": [
449
+ {
450
+ "$ref": "#/$defs/SubscriptionChanges"
451
+ },
452
+ {
453
+ "type": "null"
454
+ }
455
+ ],
456
+ "default": null
457
+ },
458
+ "auto_recharge": {
459
+ "anyOf": [
460
+ {
461
+ "$ref": "#/$defs/AutoRechargeGuardrails"
462
+ },
463
+ {
464
+ "type": "null"
465
+ }
466
+ ],
467
+ "default": null
468
+ }
469
+ },
470
+ "title": "CommerceConfig",
471
+ "type": "object"
472
+ },
473
+ "CreditAccounting": {
474
+ "additionalProperties": false,
475
+ "properties": {
476
+ "unit": {
477
+ "const": "credit",
478
+ "default": "credit",
479
+ "title": "Unit",
480
+ "type": "string"
481
+ },
482
+ "scale": {
483
+ "const": 6,
484
+ "default": 6,
485
+ "title": "Scale",
486
+ "type": "integer"
487
+ },
488
+ "rounding": {
489
+ "const": "half_up",
490
+ "default": "half_up",
491
+ "title": "Rounding",
492
+ "type": "string"
493
+ }
494
+ },
495
+ "title": "CreditAccounting",
496
+ "type": "object"
497
+ },
498
+ "CreditAllowance": {
499
+ "additionalProperties": false,
500
+ "properties": {
501
+ "amount": {
502
+ "examples": [
503
+ "10.500000"
504
+ ],
505
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
506
+ "title": "Amount",
507
+ "type": "string"
508
+ },
509
+ "window": {
510
+ "discriminator": {
511
+ "mapping": {
512
+ "calendar": "#/$defs/CalendarWindow",
513
+ "plan_assignment": "#/$defs/PlanAssignmentWindow",
514
+ "rolling": "#/$defs/RollingWindow"
515
+ },
516
+ "propertyName": "type"
517
+ },
518
+ "oneOf": [
519
+ {
520
+ "$ref": "#/$defs/CalendarWindow"
521
+ },
522
+ {
523
+ "$ref": "#/$defs/RollingWindow"
524
+ },
525
+ {
526
+ "$ref": "#/$defs/PlanAssignmentWindow"
527
+ }
528
+ ],
529
+ "title": "Window"
530
+ }
531
+ },
532
+ "required": [
533
+ "amount",
534
+ "window"
535
+ ],
536
+ "title": "CreditAllowance",
537
+ "type": "object"
538
+ },
539
+ "CreditDisplay": {
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "currency": {
543
+ "pattern": "^[A-Z]{3}$",
544
+ "title": "Currency",
545
+ "type": "string"
546
+ },
547
+ "units_per_major": {
548
+ "examples": [
549
+ "10.500000"
550
+ ],
551
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
552
+ "title": "Units Per Major",
553
+ "type": "string"
554
+ }
555
+ },
556
+ "required": [
557
+ "currency",
558
+ "units_per_major"
559
+ ],
560
+ "title": "CreditDisplay",
561
+ "type": "object"
562
+ },
563
+ "CreditLinePolicy": {
564
+ "additionalProperties": false,
565
+ "properties": {
566
+ "type": {
567
+ "const": "credit_line",
568
+ "title": "Type",
569
+ "type": "string"
570
+ },
571
+ "limit": {
572
+ "examples": [
573
+ "10.500000"
574
+ ],
575
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
576
+ "title": "Limit",
577
+ "type": "string"
578
+ }
579
+ },
580
+ "required": [
581
+ "type",
582
+ "limit"
583
+ ],
584
+ "title": "CreditLinePolicy",
585
+ "type": "object"
586
+ },
587
+ "CreditsConfig": {
588
+ "additionalProperties": false,
589
+ "properties": {
590
+ "accounting": {
591
+ "$ref": "#/$defs/CreditAccounting",
592
+ "description": "Fixed v1 accounting convention. It may be omitted; canonical output includes the defaults."
593
+ },
594
+ "buckets": {
595
+ "additionalProperties": {
596
+ "$ref": "#/$defs/BucketDefinition"
597
+ },
598
+ "title": "Buckets",
599
+ "type": "object"
600
+ },
601
+ "default_bucket": {
602
+ "anyOf": [
603
+ {
604
+ "type": "string"
605
+ },
606
+ {
607
+ "type": "null"
608
+ }
609
+ ],
610
+ "default": null,
611
+ "title": "Default Bucket"
612
+ },
613
+ "policies": {
614
+ "additionalProperties": {
615
+ "discriminator": {
616
+ "mapping": {
617
+ "credit_line": "#/$defs/CreditLinePolicy",
618
+ "prepaid": "#/$defs/PrepaidCreditPolicy"
619
+ },
620
+ "propertyName": "type"
621
+ },
622
+ "oneOf": [
623
+ {
624
+ "$ref": "#/$defs/PrepaidCreditPolicy"
625
+ },
626
+ {
627
+ "$ref": "#/$defs/CreditLinePolicy"
628
+ }
629
+ ]
630
+ },
631
+ "title": "Policies",
632
+ "type": "object"
633
+ },
634
+ "grant_programs": {
635
+ "additionalProperties": {
636
+ "$ref": "#/$defs/GrantProgram"
637
+ },
638
+ "title": "Grant Programs",
639
+ "type": "object"
640
+ },
641
+ "display": {
642
+ "anyOf": [
643
+ {
644
+ "$ref": "#/$defs/CreditDisplay"
645
+ },
646
+ {
647
+ "type": "null"
648
+ }
649
+ ],
650
+ "default": null
651
+ }
652
+ },
653
+ "title": "CreditsConfig",
654
+ "type": "object"
655
+ },
656
+ "CustomObjectReference": {
657
+ "additionalProperties": false,
658
+ "properties": {
659
+ "type": {
660
+ "const": "custom_object",
661
+ "title": "Type",
662
+ "type": "string"
663
+ },
664
+ "object_kind": {
665
+ "enum": [
666
+ "subscription",
667
+ "one_time"
668
+ ],
669
+ "title": "Object Kind",
670
+ "type": "string"
671
+ },
672
+ "external_id": {
673
+ "minLength": 1,
674
+ "title": "External Id",
675
+ "type": "string"
676
+ }
677
+ },
678
+ "required": [
679
+ "type",
680
+ "object_kind",
681
+ "external_id"
682
+ ],
683
+ "title": "CustomObjectReference",
684
+ "type": "object"
685
+ },
686
+ "CustomProvider": {
687
+ "additionalProperties": false,
688
+ "properties": {
689
+ "type": {
690
+ "const": "custom",
691
+ "title": "Type",
692
+ "type": "string"
693
+ },
694
+ "adapter": {
695
+ "minLength": 1,
696
+ "title": "Adapter",
697
+ "type": "string"
698
+ }
699
+ },
700
+ "required": [
701
+ "type",
702
+ "adapter"
703
+ ],
704
+ "title": "CustomProvider",
705
+ "type": "object"
706
+ },
707
+ "CycleGrant": {
708
+ "additionalProperties": false,
709
+ "properties": {
710
+ "amount": {
711
+ "examples": [
712
+ "10.500000"
713
+ ],
714
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
715
+ "title": "Amount",
716
+ "type": "string"
717
+ },
718
+ "bucket": {
719
+ "title": "Bucket",
720
+ "type": "string"
721
+ },
722
+ "renewal": {
723
+ "enum": [
724
+ "replace_previous",
725
+ "accumulate"
726
+ ],
727
+ "title": "Renewal",
728
+ "type": "string"
729
+ },
730
+ "expiry": {
731
+ "discriminator": {
732
+ "mapping": {
733
+ "after_grant": "#/$defs/AfterGrantExpiry",
734
+ "end_of_window": "#/$defs/EndOfWindowExpiry",
735
+ "fixed_at": "#/$defs/FixedExpiry",
736
+ "never": "#/$defs/NeverExpiry",
737
+ "subscription_end": "#/$defs/SubscriptionEndExpiry"
738
+ },
739
+ "propertyName": "type"
740
+ },
741
+ "oneOf": [
742
+ {
743
+ "$ref": "#/$defs/NeverExpiry"
744
+ },
745
+ {
746
+ "$ref": "#/$defs/AfterGrantExpiry"
747
+ },
748
+ {
749
+ "$ref": "#/$defs/EndOfWindowExpiry"
750
+ },
751
+ {
752
+ "$ref": "#/$defs/FixedExpiry"
753
+ },
754
+ {
755
+ "$ref": "#/$defs/SubscriptionEndExpiry"
756
+ }
757
+ ],
758
+ "title": "Expiry"
759
+ }
760
+ },
761
+ "required": [
762
+ "amount",
763
+ "bucket",
764
+ "renewal"
765
+ ],
766
+ "title": "CycleGrant",
767
+ "type": "object"
768
+ },
769
+ "DecimalRange": {
770
+ "additionalProperties": false,
771
+ "properties": {
772
+ "minimum": {
773
+ "examples": [
774
+ "10.500000"
775
+ ],
776
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
777
+ "title": "Minimum",
778
+ "type": "string"
779
+ },
780
+ "maximum": {
781
+ "examples": [
782
+ "10.500000"
783
+ ],
784
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
785
+ "title": "Maximum",
786
+ "type": "string"
787
+ },
788
+ "default": {
789
+ "type": "string",
790
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
791
+ "examples": [
792
+ "10.500000"
793
+ ],
794
+ "title": "Default"
795
+ }
796
+ },
797
+ "required": [
798
+ "minimum",
799
+ "maximum",
800
+ "default"
801
+ ],
802
+ "title": "DecimalRange",
803
+ "type": "object"
804
+ },
805
+ "DimensionDefinition": {
806
+ "additionalProperties": false,
807
+ "properties": {
808
+ "type": {
809
+ "enum": [
810
+ "string",
811
+ "number",
812
+ "boolean"
813
+ ],
814
+ "title": "Type",
815
+ "type": "string"
816
+ },
817
+ "required": {
818
+ "default": true,
819
+ "title": "Required",
820
+ "type": "boolean"
821
+ }
822
+ },
823
+ "required": [
824
+ "type"
825
+ ],
826
+ "title": "DimensionDefinition",
827
+ "type": "object"
828
+ },
829
+ "DodoProductReference": {
830
+ "additionalProperties": false,
831
+ "properties": {
832
+ "type": {
833
+ "const": "dodo_product",
834
+ "title": "Type",
835
+ "type": "string"
836
+ },
837
+ "product_id": {
838
+ "minLength": 1,
839
+ "title": "Product Id",
840
+ "type": "string"
841
+ }
842
+ },
843
+ "required": [
844
+ "type",
845
+ "product_id"
846
+ ],
847
+ "title": "DodoProductReference",
848
+ "type": "object"
849
+ },
850
+ "DodoProvider": {
851
+ "additionalProperties": false,
852
+ "properties": {
853
+ "type": {
854
+ "const": "dodo",
855
+ "title": "Type",
856
+ "type": "string"
857
+ }
858
+ },
859
+ "required": [
860
+ "type"
861
+ ],
862
+ "title": "DodoProvider",
863
+ "type": "object"
864
+ },
865
+ "Duration": {
866
+ "additionalProperties": false,
867
+ "properties": {
868
+ "unit": {
869
+ "enum": [
870
+ "second",
871
+ "minute",
872
+ "hour",
873
+ "day",
874
+ "week"
875
+ ],
876
+ "title": "Unit",
877
+ "type": "string"
878
+ },
879
+ "count": {
880
+ "minimum": 1,
881
+ "title": "Count",
882
+ "type": "integer"
883
+ }
884
+ },
885
+ "required": [
886
+ "unit",
887
+ "count"
888
+ ],
889
+ "title": "Duration",
890
+ "type": "object"
891
+ },
892
+ "EndOfWindowExpiry": {
893
+ "additionalProperties": false,
894
+ "properties": {
895
+ "type": {
896
+ "const": "end_of_window",
897
+ "title": "Type",
898
+ "type": "string"
899
+ },
900
+ "window": {
901
+ "anyOf": [
902
+ {
903
+ "$ref": "#/$defs/CalendarWindow"
904
+ },
905
+ {
906
+ "$ref": "#/$defs/PlanAssignmentWindow"
907
+ }
908
+ ],
909
+ "title": "Window"
910
+ }
911
+ },
912
+ "required": [
913
+ "type",
914
+ "window"
915
+ ],
916
+ "title": "EndOfWindowExpiry",
917
+ "type": "object"
918
+ },
919
+ "EntitlementsConfig": {
920
+ "additionalProperties": false,
921
+ "properties": {
922
+ "features": {
923
+ "additionalProperties": {
924
+ "discriminator": {
925
+ "mapping": {
926
+ "boolean": "#/$defs/BooleanFeature",
927
+ "enum": "#/$defs/EnumFeature",
928
+ "integer": "#/$defs/IntegerFeature",
929
+ "string": "#/$defs/StringFeature"
930
+ },
931
+ "propertyName": "type"
932
+ },
933
+ "oneOf": [
934
+ {
935
+ "$ref": "#/$defs/BooleanFeature"
936
+ },
937
+ {
938
+ "$ref": "#/$defs/EnumFeature"
939
+ },
940
+ {
941
+ "$ref": "#/$defs/IntegerFeature"
942
+ },
943
+ {
944
+ "$ref": "#/$defs/StringFeature"
945
+ }
946
+ ]
947
+ },
948
+ "title": "Features",
949
+ "type": "object"
950
+ }
951
+ },
952
+ "title": "EntitlementsConfig",
953
+ "type": "object"
954
+ },
955
+ "EnumFeature": {
956
+ "additionalProperties": false,
957
+ "properties": {
958
+ "type": {
959
+ "const": "enum",
960
+ "title": "Type",
961
+ "type": "string"
962
+ },
963
+ "values": {
964
+ "items": {
965
+ "type": "string"
966
+ },
967
+ "minItems": 1,
968
+ "title": "Values",
969
+ "type": "array"
970
+ },
971
+ "default": {
972
+ "type": "string",
973
+ "title": "Default"
974
+ }
975
+ },
976
+ "required": [
977
+ "type",
978
+ "values",
979
+ "default"
980
+ ],
981
+ "title": "EnumFeature",
982
+ "type": "object"
983
+ },
984
+ "EqualMatcher": {
985
+ "additionalProperties": false,
986
+ "properties": {
987
+ "op": {
988
+ "const": "eq",
989
+ "title": "Op",
990
+ "type": "string"
991
+ },
992
+ "value": {
993
+ "anyOf": [
994
+ {
995
+ "type": "string"
996
+ },
997
+ {
998
+ "type": "number"
999
+ },
1000
+ {
1001
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
1002
+ "type": "string"
1003
+ },
1004
+ {
1005
+ "type": "boolean"
1006
+ }
1007
+ ],
1008
+ "title": "Value"
1009
+ }
1010
+ },
1011
+ "required": [
1012
+ "op",
1013
+ "value"
1014
+ ],
1015
+ "title": "EqualMatcher",
1016
+ "type": "object"
1017
+ },
1018
+ "ExpressionCharge": {
1019
+ "additionalProperties": false,
1020
+ "properties": {
1021
+ "type": {
1022
+ "const": "expression",
1023
+ "title": "Type",
1024
+ "type": "string"
1025
+ },
1026
+ "formula": {
1027
+ "minLength": 1,
1028
+ "title": "Formula",
1029
+ "type": "string"
1030
+ }
1031
+ },
1032
+ "required": [
1033
+ "type",
1034
+ "formula"
1035
+ ],
1036
+ "title": "ExpressionCharge",
1037
+ "type": "object"
1038
+ },
1039
+ "FixedExpiry": {
1040
+ "additionalProperties": false,
1041
+ "properties": {
1042
+ "type": {
1043
+ "const": "fixed_at",
1044
+ "title": "Type",
1045
+ "type": "string"
1046
+ },
1047
+ "at": {
1048
+ "format": "date-time",
1049
+ "title": "At",
1050
+ "type": "string"
1051
+ }
1052
+ },
1053
+ "required": [
1054
+ "type",
1055
+ "at"
1056
+ ],
1057
+ "title": "FixedExpiry",
1058
+ "type": "object"
1059
+ },
1060
+ "FlatCharge": {
1061
+ "additionalProperties": false,
1062
+ "properties": {
1063
+ "type": {
1064
+ "const": "flat",
1065
+ "title": "Type",
1066
+ "type": "string"
1067
+ },
1068
+ "amount": {
1069
+ "examples": [
1070
+ "10.500000"
1071
+ ],
1072
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1073
+ "title": "Amount",
1074
+ "type": "string"
1075
+ }
1076
+ },
1077
+ "required": [
1078
+ "type",
1079
+ "amount"
1080
+ ],
1081
+ "title": "FlatCharge",
1082
+ "type": "object"
1083
+ },
1084
+ "GraduatedCharge": {
1085
+ "additionalProperties": false,
1086
+ "properties": {
1087
+ "type": {
1088
+ "const": "graduated",
1089
+ "title": "Type",
1090
+ "type": "string"
1091
+ },
1092
+ "measure": {
1093
+ "title": "Measure",
1094
+ "type": "string"
1095
+ },
1096
+ "tiers": {
1097
+ "items": {
1098
+ "$ref": "#/$defs/GraduatedTier"
1099
+ },
1100
+ "minItems": 1,
1101
+ "title": "Tiers",
1102
+ "type": "array"
1103
+ }
1104
+ },
1105
+ "required": [
1106
+ "type",
1107
+ "measure",
1108
+ "tiers"
1109
+ ],
1110
+ "title": "GraduatedCharge",
1111
+ "type": "object"
1112
+ },
1113
+ "GraduatedTier": {
1114
+ "additionalProperties": false,
1115
+ "properties": {
1116
+ "up_to": {
1117
+ "anyOf": [
1118
+ {
1119
+ "examples": [
1120
+ "10.500000"
1121
+ ],
1122
+ "gt": 0,
1123
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1124
+ "type": "string"
1125
+ },
1126
+ {
1127
+ "type": "null"
1128
+ }
1129
+ ],
1130
+ "default": null,
1131
+ "title": "Up To"
1132
+ },
1133
+ "rate": {
1134
+ "examples": [
1135
+ "10.500000"
1136
+ ],
1137
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1138
+ "title": "Rate",
1139
+ "type": "string"
1140
+ }
1141
+ },
1142
+ "required": [
1143
+ "rate"
1144
+ ],
1145
+ "title": "GraduatedTier",
1146
+ "type": "object"
1147
+ },
1148
+ "GrantAward": {
1149
+ "additionalProperties": false,
1150
+ "properties": {
1151
+ "recipient": {
1152
+ "default": "subject",
1153
+ "enum": [
1154
+ "subject",
1155
+ "referrer"
1156
+ ],
1157
+ "title": "Recipient",
1158
+ "type": "string"
1159
+ },
1160
+ "amount": {
1161
+ "examples": [
1162
+ "10.500000"
1163
+ ],
1164
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1165
+ "title": "Amount",
1166
+ "type": "string"
1167
+ },
1168
+ "bucket": {
1169
+ "title": "Bucket",
1170
+ "type": "string"
1171
+ },
1172
+ "expiry": {
1173
+ "anyOf": [
1174
+ {
1175
+ "discriminator": {
1176
+ "mapping": {
1177
+ "after_grant": "#/$defs/AfterGrantExpiry",
1178
+ "end_of_window": "#/$defs/EndOfWindowExpiry",
1179
+ "fixed_at": "#/$defs/FixedExpiry",
1180
+ "never": "#/$defs/NeverExpiry",
1181
+ "subscription_end": "#/$defs/SubscriptionEndExpiry"
1182
+ },
1183
+ "propertyName": "type"
1184
+ },
1185
+ "oneOf": [
1186
+ {
1187
+ "$ref": "#/$defs/NeverExpiry"
1188
+ },
1189
+ {
1190
+ "$ref": "#/$defs/AfterGrantExpiry"
1191
+ },
1192
+ {
1193
+ "$ref": "#/$defs/EndOfWindowExpiry"
1194
+ },
1195
+ {
1196
+ "$ref": "#/$defs/FixedExpiry"
1197
+ },
1198
+ {
1199
+ "$ref": "#/$defs/SubscriptionEndExpiry"
1200
+ }
1201
+ ]
1202
+ },
1203
+ {
1204
+ "type": "null"
1205
+ }
1206
+ ],
1207
+ "default": null,
1208
+ "title": "Expiry"
1209
+ }
1210
+ },
1211
+ "required": [
1212
+ "amount",
1213
+ "bucket"
1214
+ ],
1215
+ "title": "GrantAward",
1216
+ "type": "object"
1217
+ },
1218
+ "GrantEligibility": {
1219
+ "additionalProperties": false,
1220
+ "properties": {
1221
+ "plans": {
1222
+ "items": {
1223
+ "type": "string"
1224
+ },
1225
+ "title": "Plans",
1226
+ "type": "array"
1227
+ },
1228
+ "regions": {
1229
+ "items": {
1230
+ "type": "string"
1231
+ },
1232
+ "title": "Regions",
1233
+ "type": "array"
1234
+ }
1235
+ },
1236
+ "title": "GrantEligibility",
1237
+ "type": "object"
1238
+ },
1239
+ "GrantProgram": {
1240
+ "additionalProperties": false,
1241
+ "properties": {
1242
+ "trigger": {
1243
+ "enum": [
1244
+ "account_created",
1245
+ "referral_completed",
1246
+ "promo_code_redeemed",
1247
+ "manual"
1248
+ ],
1249
+ "title": "Trigger",
1250
+ "type": "string"
1251
+ },
1252
+ "awards": {
1253
+ "items": {
1254
+ "$ref": "#/$defs/GrantAward"
1255
+ },
1256
+ "minItems": 1,
1257
+ "title": "Awards",
1258
+ "type": "array"
1259
+ },
1260
+ "availability": {
1261
+ "anyOf": [
1262
+ {
1263
+ "$ref": "#/$defs/Availability"
1264
+ },
1265
+ {
1266
+ "type": "null"
1267
+ }
1268
+ ],
1269
+ "default": null
1270
+ },
1271
+ "eligibility": {
1272
+ "$ref": "#/$defs/GrantEligibility"
1273
+ },
1274
+ "max_awards_per_subject": {
1275
+ "default": 1,
1276
+ "minimum": 1,
1277
+ "title": "Max Awards Per Subject",
1278
+ "type": "integer"
1279
+ },
1280
+ "idempotency_scope": {
1281
+ "default": "subject",
1282
+ "enum": [
1283
+ "subject",
1284
+ "event"
1285
+ ],
1286
+ "title": "Idempotency Scope",
1287
+ "type": "string"
1288
+ }
1289
+ },
1290
+ "required": [
1291
+ "trigger",
1292
+ "awards"
1293
+ ],
1294
+ "title": "GrantProgram",
1295
+ "type": "object"
1296
+ },
1297
+ "InMatcher": {
1298
+ "additionalProperties": false,
1299
+ "properties": {
1300
+ "op": {
1301
+ "const": "in",
1302
+ "title": "Op",
1303
+ "type": "string"
1304
+ },
1305
+ "values": {
1306
+ "items": {
1307
+ "anyOf": [
1308
+ {
1309
+ "type": "string"
1310
+ },
1311
+ {
1312
+ "type": "number"
1313
+ },
1314
+ {
1315
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
1316
+ "type": "string"
1317
+ },
1318
+ {
1319
+ "type": "boolean"
1320
+ }
1321
+ ]
1322
+ },
1323
+ "minItems": 1,
1324
+ "title": "Values",
1325
+ "type": "array"
1326
+ }
1327
+ },
1328
+ "required": [
1329
+ "op",
1330
+ "values"
1331
+ ],
1332
+ "title": "InMatcher",
1333
+ "type": "object"
1334
+ },
1335
+ "IntegerFeature": {
1336
+ "additionalProperties": false,
1337
+ "properties": {
1338
+ "type": {
1339
+ "const": "integer",
1340
+ "title": "Type",
1341
+ "type": "string"
1342
+ },
1343
+ "default": {
1344
+ "type": "integer",
1345
+ "title": "Default"
1346
+ },
1347
+ "minimum": {
1348
+ "anyOf": [
1349
+ {
1350
+ "type": "integer"
1351
+ },
1352
+ {
1353
+ "type": "null"
1354
+ }
1355
+ ],
1356
+ "default": null,
1357
+ "title": "Minimum"
1358
+ },
1359
+ "maximum": {
1360
+ "anyOf": [
1361
+ {
1362
+ "type": "integer"
1363
+ },
1364
+ {
1365
+ "type": "null"
1366
+ }
1367
+ ],
1368
+ "default": null,
1369
+ "title": "Maximum"
1370
+ }
1371
+ },
1372
+ "required": [
1373
+ "type",
1374
+ "default"
1375
+ ],
1376
+ "title": "IntegerFeature",
1377
+ "type": "object"
1378
+ },
1379
+ "IntegerRange": {
1380
+ "additionalProperties": false,
1381
+ "properties": {
1382
+ "minimum": {
1383
+ "minimum": 1,
1384
+ "title": "Minimum",
1385
+ "type": "integer"
1386
+ },
1387
+ "maximum": {
1388
+ "minimum": 1,
1389
+ "title": "Maximum",
1390
+ "type": "integer"
1391
+ },
1392
+ "default": {
1393
+ "type": "integer",
1394
+ "minimum": 1,
1395
+ "title": "Default"
1396
+ }
1397
+ },
1398
+ "required": [
1399
+ "minimum",
1400
+ "maximum",
1401
+ "default"
1402
+ ],
1403
+ "title": "IntegerRange",
1404
+ "type": "object"
1405
+ },
1406
+ "MeasureDefinition": {
1407
+ "additionalProperties": false,
1408
+ "properties": {
1409
+ "unit": {
1410
+ "title": "Unit",
1411
+ "type": "string"
1412
+ }
1413
+ },
1414
+ "required": [
1415
+ "unit"
1416
+ ],
1417
+ "title": "MeasureDefinition",
1418
+ "type": "object"
1419
+ },
1420
+ "NeverExpiry": {
1421
+ "additionalProperties": false,
1422
+ "properties": {
1423
+ "type": {
1424
+ "const": "never",
1425
+ "title": "Type",
1426
+ "type": "string"
1427
+ }
1428
+ },
1429
+ "required": [
1430
+ "type"
1431
+ ],
1432
+ "title": "NeverExpiry",
1433
+ "type": "object"
1434
+ },
1435
+ "NotInMatcher": {
1436
+ "additionalProperties": false,
1437
+ "properties": {
1438
+ "op": {
1439
+ "const": "not_in",
1440
+ "title": "Op",
1441
+ "type": "string"
1442
+ },
1443
+ "values": {
1444
+ "items": {
1445
+ "anyOf": [
1446
+ {
1447
+ "type": "string"
1448
+ },
1449
+ {
1450
+ "type": "number"
1451
+ },
1452
+ {
1453
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
1454
+ "type": "string"
1455
+ },
1456
+ {
1457
+ "type": "boolean"
1458
+ }
1459
+ ]
1460
+ },
1461
+ "minItems": 1,
1462
+ "title": "Values",
1463
+ "type": "array"
1464
+ }
1465
+ },
1466
+ "required": [
1467
+ "op",
1468
+ "values"
1469
+ ],
1470
+ "title": "NotInMatcher",
1471
+ "type": "object"
1472
+ },
1473
+ "OfferPrice": {
1474
+ "additionalProperties": false,
1475
+ "properties": {
1476
+ "amount_minor": {
1477
+ "minimum": 0,
1478
+ "title": "Amount Minor",
1479
+ "type": "integer"
1480
+ },
1481
+ "currency": {
1482
+ "title": "Currency",
1483
+ "type": "string"
1484
+ },
1485
+ "tax_behavior": {
1486
+ "default": "unspecified",
1487
+ "enum": [
1488
+ "inclusive",
1489
+ "exclusive",
1490
+ "unspecified"
1491
+ ],
1492
+ "title": "Tax Behavior",
1493
+ "type": "string"
1494
+ }
1495
+ },
1496
+ "required": [
1497
+ "amount_minor",
1498
+ "currency"
1499
+ ],
1500
+ "title": "OfferPrice",
1501
+ "type": "object"
1502
+ },
1503
+ "OperationAdmission": {
1504
+ "additionalProperties": false,
1505
+ "properties": {
1506
+ "max_in_flight": {
1507
+ "minimum": 1,
1508
+ "title": "Max In Flight",
1509
+ "type": "integer"
1510
+ }
1511
+ },
1512
+ "required": [
1513
+ "max_in_flight"
1514
+ ],
1515
+ "title": "OperationAdmission",
1516
+ "type": "object"
1517
+ },
1518
+ "OperationDefinition": {
1519
+ "additionalProperties": false,
1520
+ "properties": {
1521
+ "measures": {
1522
+ "additionalProperties": {
1523
+ "$ref": "#/$defs/MeasureDefinition"
1524
+ },
1525
+ "title": "Measures",
1526
+ "type": "object"
1527
+ },
1528
+ "dimensions": {
1529
+ "additionalProperties": {
1530
+ "$ref": "#/$defs/DimensionDefinition"
1531
+ },
1532
+ "title": "Dimensions",
1533
+ "type": "object"
1534
+ }
1535
+ },
1536
+ "required": [
1537
+ "measures"
1538
+ ],
1539
+ "title": "OperationDefinition",
1540
+ "type": "object"
1541
+ },
1542
+ "OperationPricing": {
1543
+ "additionalProperties": false,
1544
+ "properties": {
1545
+ "rules": {
1546
+ "items": {
1547
+ "$ref": "#/$defs/PriceRule"
1548
+ },
1549
+ "title": "Rules",
1550
+ "type": "array"
1551
+ },
1552
+ "unmatched": {
1553
+ "discriminator": {
1554
+ "mapping": {
1555
+ "charge": "#/$defs/ChargeUnmatched",
1556
+ "reject": "#/$defs/RejectUnmatched"
1557
+ },
1558
+ "propertyName": "action"
1559
+ },
1560
+ "oneOf": [
1561
+ {
1562
+ "$ref": "#/$defs/RejectUnmatched"
1563
+ },
1564
+ {
1565
+ "$ref": "#/$defs/ChargeUnmatched"
1566
+ }
1567
+ ],
1568
+ "title": "Unmatched"
1569
+ }
1570
+ },
1571
+ "required": [
1572
+ "unmatched"
1573
+ ],
1574
+ "title": "OperationPricing",
1575
+ "type": "object"
1576
+ },
1577
+ "PackageCharge": {
1578
+ "additionalProperties": false,
1579
+ "properties": {
1580
+ "type": {
1581
+ "const": "package",
1582
+ "title": "Type",
1583
+ "type": "string"
1584
+ },
1585
+ "measure": {
1586
+ "title": "Measure",
1587
+ "type": "string"
1588
+ },
1589
+ "units": {
1590
+ "examples": [
1591
+ "10.500000"
1592
+ ],
1593
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1594
+ "title": "Units",
1595
+ "type": "string"
1596
+ },
1597
+ "amount": {
1598
+ "examples": [
1599
+ "10.500000"
1600
+ ],
1601
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1602
+ "title": "Amount",
1603
+ "type": "string"
1604
+ },
1605
+ "rounding": {
1606
+ "default": "ceil",
1607
+ "enum": [
1608
+ "ceil",
1609
+ "floor",
1610
+ "nearest"
1611
+ ],
1612
+ "title": "Rounding",
1613
+ "type": "string"
1614
+ }
1615
+ },
1616
+ "required": [
1617
+ "type",
1618
+ "measure",
1619
+ "units",
1620
+ "amount"
1621
+ ],
1622
+ "title": "PackageCharge",
1623
+ "type": "object"
1624
+ },
1625
+ "PerUnitCharge": {
1626
+ "additionalProperties": false,
1627
+ "properties": {
1628
+ "type": {
1629
+ "const": "per_unit",
1630
+ "title": "Type",
1631
+ "type": "string"
1632
+ },
1633
+ "measure": {
1634
+ "title": "Measure",
1635
+ "type": "string"
1636
+ },
1637
+ "rate": {
1638
+ "description": "Credits charged for each unit_size units of the selected measure.",
1639
+ "examples": [
1640
+ "10.500000"
1641
+ ],
1642
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1643
+ "title": "Rate",
1644
+ "type": "string"
1645
+ },
1646
+ "unit_size": {
1647
+ "default": "1",
1648
+ "description": "Number of measure units represented by one rate unit; use 1000000 for per-million-token rates.",
1649
+ "examples": [
1650
+ "10.500000"
1651
+ ],
1652
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
1653
+ "title": "Unit Size",
1654
+ "type": "string"
1655
+ }
1656
+ },
1657
+ "required": [
1658
+ "type",
1659
+ "measure",
1660
+ "rate"
1661
+ ],
1662
+ "title": "PerUnitCharge",
1663
+ "type": "object"
1664
+ },
1665
+ "PlanAssignmentWindow": {
1666
+ "additionalProperties": false,
1667
+ "properties": {
1668
+ "type": {
1669
+ "const": "plan_assignment",
1670
+ "title": "Type",
1671
+ "type": "string"
1672
+ },
1673
+ "interval": {
1674
+ "$ref": "#/$defs/BillingInterval"
1675
+ },
1676
+ "timezone": {
1677
+ "default": "UTC",
1678
+ "title": "Timezone",
1679
+ "type": "string"
1680
+ }
1681
+ },
1682
+ "required": [
1683
+ "type",
1684
+ "interval"
1685
+ ],
1686
+ "title": "PlanAssignmentWindow",
1687
+ "type": "object"
1688
+ },
1689
+ "PlanDefinition": {
1690
+ "additionalProperties": false,
1691
+ "properties": {
1692
+ "display_name": {
1693
+ "minLength": 1,
1694
+ "title": "Display Name",
1695
+ "type": "string"
1696
+ },
1697
+ "rank": {
1698
+ "default": 0,
1699
+ "description": "Public catalog ordering. Lower ranks appear first; ties are ordered by plan key.",
1700
+ "minimum": 0,
1701
+ "title": "Rank",
1702
+ "type": "integer"
1703
+ },
1704
+ "description": {
1705
+ "anyOf": [
1706
+ {
1707
+ "type": "string"
1708
+ },
1709
+ {
1710
+ "type": "null"
1711
+ }
1712
+ ],
1713
+ "default": null,
1714
+ "title": "Description"
1715
+ },
1716
+ "rate_card": {
1717
+ "anyOf": [
1718
+ {
1719
+ "type": "string"
1720
+ },
1721
+ {
1722
+ "type": "null"
1723
+ }
1724
+ ],
1725
+ "default": null,
1726
+ "title": "Rate Card"
1727
+ },
1728
+ "allowed_operations": {
1729
+ "items": {
1730
+ "type": "string"
1731
+ },
1732
+ "title": "Allowed Operations",
1733
+ "type": "array"
1734
+ },
1735
+ "features": {
1736
+ "additionalProperties": {
1737
+ "anyOf": [
1738
+ {
1739
+ "type": "boolean"
1740
+ },
1741
+ {
1742
+ "type": "integer"
1743
+ },
1744
+ {
1745
+ "type": "string"
1746
+ }
1747
+ ]
1748
+ },
1749
+ "title": "Features",
1750
+ "type": "object"
1751
+ },
1752
+ "credit_allowance": {
1753
+ "anyOf": [
1754
+ {
1755
+ "$ref": "#/$defs/CreditAllowance"
1756
+ },
1757
+ {
1758
+ "type": "null"
1759
+ }
1760
+ ],
1761
+ "default": null
1762
+ },
1763
+ "quotas": {
1764
+ "additionalProperties": {
1765
+ "$ref": "#/$defs/QuotaDefinition"
1766
+ },
1767
+ "title": "Quotas",
1768
+ "type": "object"
1769
+ },
1770
+ "credit_policy": {
1771
+ "anyOf": [
1772
+ {
1773
+ "type": "string"
1774
+ },
1775
+ {
1776
+ "type": "null"
1777
+ }
1778
+ ],
1779
+ "default": null,
1780
+ "title": "Credit Policy"
1781
+ },
1782
+ "admission_policy": {
1783
+ "anyOf": [
1784
+ {
1785
+ "type": "string"
1786
+ },
1787
+ {
1788
+ "type": "null"
1789
+ }
1790
+ ],
1791
+ "default": null,
1792
+ "title": "Admission Policy"
1793
+ },
1794
+ "revision_policy": {
1795
+ "anyOf": [
1796
+ {
1797
+ "enum": [
1798
+ "immediate",
1799
+ "next_renewal",
1800
+ "pinned"
1801
+ ],
1802
+ "type": "string"
1803
+ },
1804
+ {
1805
+ "type": "null"
1806
+ }
1807
+ ],
1808
+ "default": null,
1809
+ "description": "Plan revision behavior. When omitted, subscription-backed plans use next_renewal and other plans use immediate.",
1810
+ "title": "Revision Policy"
1811
+ }
1812
+ },
1813
+ "required": [
1814
+ "display_name"
1815
+ ],
1816
+ "title": "PlanDefinition",
1817
+ "type": "object"
1818
+ },
1819
+ "PrefixMatcher": {
1820
+ "additionalProperties": false,
1821
+ "properties": {
1822
+ "op": {
1823
+ "const": "prefix",
1824
+ "title": "Op",
1825
+ "type": "string"
1826
+ },
1827
+ "value": {
1828
+ "minLength": 1,
1829
+ "title": "Value",
1830
+ "type": "string"
1831
+ }
1832
+ },
1833
+ "required": [
1834
+ "op",
1835
+ "value"
1836
+ ],
1837
+ "title": "PrefixMatcher",
1838
+ "type": "object"
1839
+ },
1840
+ "PrepaidCreditPolicy": {
1841
+ "additionalProperties": false,
1842
+ "properties": {
1843
+ "type": {
1844
+ "const": "prepaid",
1845
+ "title": "Type",
1846
+ "type": "string"
1847
+ }
1848
+ },
1849
+ "required": [
1850
+ "type"
1851
+ ],
1852
+ "title": "PrepaidCreditPolicy",
1853
+ "type": "object"
1854
+ },
1855
+ "PriceRule": {
1856
+ "additionalProperties": false,
1857
+ "properties": {
1858
+ "when": {
1859
+ "additionalProperties": {
1860
+ "discriminator": {
1861
+ "mapping": {
1862
+ "eq": "#/$defs/EqualMatcher",
1863
+ "in": "#/$defs/InMatcher",
1864
+ "not_in": "#/$defs/NotInMatcher",
1865
+ "prefix": "#/$defs/PrefixMatcher",
1866
+ "range": "#/$defs/RangeMatcher"
1867
+ },
1868
+ "propertyName": "op"
1869
+ },
1870
+ "oneOf": [
1871
+ {
1872
+ "$ref": "#/$defs/EqualMatcher"
1873
+ },
1874
+ {
1875
+ "$ref": "#/$defs/InMatcher"
1876
+ },
1877
+ {
1878
+ "$ref": "#/$defs/NotInMatcher"
1879
+ },
1880
+ {
1881
+ "$ref": "#/$defs/PrefixMatcher"
1882
+ },
1883
+ {
1884
+ "$ref": "#/$defs/RangeMatcher"
1885
+ }
1886
+ ]
1887
+ },
1888
+ "minProperties": 1,
1889
+ "title": "When",
1890
+ "type": "object"
1891
+ },
1892
+ "charge": {
1893
+ "discriminator": {
1894
+ "mapping": {
1895
+ "expression": "#/$defs/ExpressionCharge",
1896
+ "flat": "#/$defs/FlatCharge",
1897
+ "graduated": "#/$defs/GraduatedCharge",
1898
+ "package": "#/$defs/PackageCharge",
1899
+ "per_unit": "#/$defs/PerUnitCharge",
1900
+ "sum": "#/$defs/SumCharge",
1901
+ "volume": "#/$defs/VolumeCharge"
1902
+ },
1903
+ "propertyName": "type"
1904
+ },
1905
+ "oneOf": [
1906
+ {
1907
+ "$ref": "#/$defs/FlatCharge"
1908
+ },
1909
+ {
1910
+ "$ref": "#/$defs/PerUnitCharge"
1911
+ },
1912
+ {
1913
+ "$ref": "#/$defs/PackageCharge"
1914
+ },
1915
+ {
1916
+ "$ref": "#/$defs/GraduatedCharge"
1917
+ },
1918
+ {
1919
+ "$ref": "#/$defs/VolumeCharge"
1920
+ },
1921
+ {
1922
+ "$ref": "#/$defs/ExpressionCharge"
1923
+ },
1924
+ {
1925
+ "$ref": "#/$defs/SumCharge"
1926
+ }
1927
+ ],
1928
+ "title": "Charge"
1929
+ }
1930
+ },
1931
+ "required": [
1932
+ "when",
1933
+ "charge"
1934
+ ],
1935
+ "title": "PriceRule",
1936
+ "type": "object"
1937
+ },
1938
+ "PricingConfig": {
1939
+ "additionalProperties": false,
1940
+ "properties": {
1941
+ "operations": {
1942
+ "additionalProperties": {
1943
+ "$ref": "#/$defs/OperationDefinition"
1944
+ },
1945
+ "title": "Operations",
1946
+ "type": "object"
1947
+ },
1948
+ "rate_cards": {
1949
+ "additionalProperties": {
1950
+ "$ref": "#/$defs/RateCard"
1951
+ },
1952
+ "title": "Rate Cards",
1953
+ "type": "object"
1954
+ }
1955
+ },
1956
+ "required": [
1957
+ "operations",
1958
+ "rate_cards"
1959
+ ],
1960
+ "title": "PricingConfig",
1961
+ "type": "object"
1962
+ },
1963
+ "QuantityBounds": {
1964
+ "additionalProperties": false,
1965
+ "properties": {
1966
+ "minimum": {
1967
+ "default": 1,
1968
+ "minimum": 1,
1969
+ "title": "Minimum",
1970
+ "type": "integer"
1971
+ },
1972
+ "maximum": {
1973
+ "default": 1,
1974
+ "minimum": 1,
1975
+ "title": "Maximum",
1976
+ "type": "integer"
1977
+ },
1978
+ "default": {
1979
+ "type": "integer",
1980
+ "minimum": 1,
1981
+ "default": 1,
1982
+ "title": "Default"
1983
+ }
1984
+ },
1985
+ "title": "QuantityBounds",
1986
+ "type": "object"
1987
+ },
1988
+ "QuotaDefinition": {
1989
+ "additionalProperties": false,
1990
+ "properties": {
1991
+ "operation": {
1992
+ "title": "Operation",
1993
+ "type": "string"
1994
+ },
1995
+ "measure": {
1996
+ "title": "Measure",
1997
+ "type": "string"
1998
+ },
1999
+ "limit": {
2000
+ "examples": [
2001
+ "10.500000"
2002
+ ],
2003
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
2004
+ "title": "Limit",
2005
+ "type": "string"
2006
+ },
2007
+ "window": {
2008
+ "discriminator": {
2009
+ "mapping": {
2010
+ "calendar": "#/$defs/CalendarWindow",
2011
+ "plan_assignment": "#/$defs/PlanAssignmentWindow",
2012
+ "rolling": "#/$defs/RollingWindow"
2013
+ },
2014
+ "propertyName": "type"
2015
+ },
2016
+ "oneOf": [
2017
+ {
2018
+ "$ref": "#/$defs/CalendarWindow"
2019
+ },
2020
+ {
2021
+ "$ref": "#/$defs/RollingWindow"
2022
+ },
2023
+ {
2024
+ "$ref": "#/$defs/PlanAssignmentWindow"
2025
+ }
2026
+ ],
2027
+ "title": "Window"
2028
+ },
2029
+ "enforcement": {
2030
+ "enum": [
2031
+ "block",
2032
+ "allow"
2033
+ ],
2034
+ "title": "Enforcement",
2035
+ "type": "string"
2036
+ },
2037
+ "emit_at_percent": {
2038
+ "items": {
2039
+ "type": "integer"
2040
+ },
2041
+ "title": "Emit At Percent",
2042
+ "type": "array"
2043
+ }
2044
+ },
2045
+ "required": [
2046
+ "operation",
2047
+ "measure",
2048
+ "limit",
2049
+ "window",
2050
+ "enforcement"
2051
+ ],
2052
+ "title": "QuotaDefinition",
2053
+ "type": "object"
2054
+ },
2055
+ "RangeMatcher": {
2056
+ "additionalProperties": false,
2057
+ "properties": {
2058
+ "op": {
2059
+ "const": "range",
2060
+ "title": "Op",
2061
+ "type": "string"
2062
+ },
2063
+ "gt": {
2064
+ "anyOf": [
2065
+ {
2066
+ "examples": [
2067
+ "10.500000"
2068
+ ],
2069
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
2070
+ "type": "string"
2071
+ },
2072
+ {
2073
+ "type": "null"
2074
+ }
2075
+ ],
2076
+ "default": null,
2077
+ "title": "Gt"
2078
+ },
2079
+ "gte": {
2080
+ "anyOf": [
2081
+ {
2082
+ "examples": [
2083
+ "10.500000"
2084
+ ],
2085
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
2086
+ "type": "string"
2087
+ },
2088
+ {
2089
+ "type": "null"
2090
+ }
2091
+ ],
2092
+ "default": null,
2093
+ "title": "Gte"
2094
+ },
2095
+ "lt": {
2096
+ "anyOf": [
2097
+ {
2098
+ "examples": [
2099
+ "10.500000"
2100
+ ],
2101
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
2102
+ "type": "string"
2103
+ },
2104
+ {
2105
+ "type": "null"
2106
+ }
2107
+ ],
2108
+ "default": null,
2109
+ "title": "Lt"
2110
+ },
2111
+ "lte": {
2112
+ "anyOf": [
2113
+ {
2114
+ "examples": [
2115
+ "10.500000"
2116
+ ],
2117
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
2118
+ "type": "string"
2119
+ },
2120
+ {
2121
+ "type": "null"
2122
+ }
2123
+ ],
2124
+ "default": null,
2125
+ "title": "Lte"
2126
+ }
2127
+ },
2128
+ "required": [
2129
+ "op"
2130
+ ],
2131
+ "title": "RangeMatcher",
2132
+ "type": "object"
2133
+ },
2134
+ "RateCard": {
2135
+ "additionalProperties": false,
2136
+ "properties": {
2137
+ "extends": {
2138
+ "anyOf": [
2139
+ {
2140
+ "type": "string"
2141
+ },
2142
+ {
2143
+ "type": "null"
2144
+ }
2145
+ ],
2146
+ "default": null,
2147
+ "title": "Extends"
2148
+ },
2149
+ "operations": {
2150
+ "additionalProperties": {
2151
+ "$ref": "#/$defs/OperationPricing"
2152
+ },
2153
+ "title": "Operations",
2154
+ "type": "object"
2155
+ }
2156
+ },
2157
+ "title": "RateCard",
2158
+ "type": "object"
2159
+ },
2160
+ "RejectUnmatched": {
2161
+ "additionalProperties": false,
2162
+ "properties": {
2163
+ "action": {
2164
+ "const": "reject",
2165
+ "title": "Action",
2166
+ "type": "string"
2167
+ }
2168
+ },
2169
+ "required": [
2170
+ "action"
2171
+ ],
2172
+ "title": "RejectUnmatched",
2173
+ "type": "object"
2174
+ },
2175
+ "RollingWindow": {
2176
+ "additionalProperties": false,
2177
+ "properties": {
2178
+ "type": {
2179
+ "const": "rolling",
2180
+ "title": "Type",
2181
+ "type": "string"
2182
+ },
2183
+ "duration": {
2184
+ "$ref": "#/$defs/Duration"
2185
+ }
2186
+ },
2187
+ "required": [
2188
+ "type",
2189
+ "duration"
2190
+ ],
2191
+ "title": "RollingWindow",
2192
+ "type": "object"
2193
+ },
2194
+ "StringFeature": {
2195
+ "additionalProperties": false,
2196
+ "properties": {
2197
+ "type": {
2198
+ "const": "string",
2199
+ "title": "Type",
2200
+ "type": "string"
2201
+ },
2202
+ "default": {
2203
+ "type": "string",
2204
+ "title": "Default"
2205
+ },
2206
+ "pattern": {
2207
+ "anyOf": [
2208
+ {
2209
+ "type": "string"
2210
+ },
2211
+ {
2212
+ "type": "null"
2213
+ }
2214
+ ],
2215
+ "default": null,
2216
+ "title": "Pattern"
2217
+ }
2218
+ },
2219
+ "required": [
2220
+ "type",
2221
+ "default"
2222
+ ],
2223
+ "title": "StringFeature",
2224
+ "type": "object"
2225
+ },
2226
+ "StripePriceReference": {
2227
+ "additionalProperties": false,
2228
+ "properties": {
2229
+ "type": {
2230
+ "const": "stripe_price",
2231
+ "title": "Type",
2232
+ "type": "string"
2233
+ },
2234
+ "price_id": {
2235
+ "minLength": 1,
2236
+ "title": "Price Id",
2237
+ "type": "string"
2238
+ }
2239
+ },
2240
+ "required": [
2241
+ "type",
2242
+ "price_id"
2243
+ ],
2244
+ "title": "StripePriceReference",
2245
+ "type": "object"
2246
+ },
2247
+ "StripeProvider": {
2248
+ "additionalProperties": false,
2249
+ "properties": {
2250
+ "type": {
2251
+ "const": "stripe",
2252
+ "title": "Type",
2253
+ "type": "string"
2254
+ }
2255
+ },
2256
+ "required": [
2257
+ "type"
2258
+ ],
2259
+ "title": "StripeProvider",
2260
+ "type": "object"
2261
+ },
2262
+ "SubscriptionChangePolicy": {
2263
+ "additionalProperties": false,
2264
+ "properties": {
2265
+ "effective": {
2266
+ "enum": [
2267
+ "immediate",
2268
+ "renewal"
2269
+ ],
2270
+ "title": "Effective",
2271
+ "type": "string"
2272
+ },
2273
+ "proration": {
2274
+ "enum": [
2275
+ "prorated",
2276
+ "none"
2277
+ ],
2278
+ "title": "Proration",
2279
+ "type": "string"
2280
+ },
2281
+ "payment_failure": {
2282
+ "default": "prevent_change",
2283
+ "enum": [
2284
+ "prevent_change",
2285
+ "apply_change"
2286
+ ],
2287
+ "title": "Payment Failure",
2288
+ "type": "string"
2289
+ }
2290
+ },
2291
+ "required": [
2292
+ "effective",
2293
+ "proration"
2294
+ ],
2295
+ "title": "SubscriptionChangePolicy",
2296
+ "type": "object"
2297
+ },
2298
+ "SubscriptionChanges": {
2299
+ "additionalProperties": false,
2300
+ "properties": {
2301
+ "upgrade": {
2302
+ "anyOf": [
2303
+ {
2304
+ "$ref": "#/$defs/SubscriptionChangePolicy"
2305
+ },
2306
+ {
2307
+ "type": "null"
2308
+ }
2309
+ ],
2310
+ "default": null
2311
+ },
2312
+ "downgrade": {
2313
+ "anyOf": [
2314
+ {
2315
+ "$ref": "#/$defs/SubscriptionChangePolicy"
2316
+ },
2317
+ {
2318
+ "type": "null"
2319
+ }
2320
+ ],
2321
+ "default": null
2322
+ },
2323
+ "lateral": {
2324
+ "anyOf": [
2325
+ {
2326
+ "$ref": "#/$defs/SubscriptionChangePolicy"
2327
+ },
2328
+ {
2329
+ "type": "null"
2330
+ }
2331
+ ],
2332
+ "default": null
2333
+ },
2334
+ "cadence_change": {
2335
+ "anyOf": [
2336
+ {
2337
+ "$ref": "#/$defs/SubscriptionChangePolicy"
2338
+ },
2339
+ {
2340
+ "type": "null"
2341
+ }
2342
+ ],
2343
+ "default": null
2344
+ }
2345
+ },
2346
+ "title": "SubscriptionChanges",
2347
+ "type": "object"
2348
+ },
2349
+ "SubscriptionEndExpiry": {
2350
+ "additionalProperties": false,
2351
+ "properties": {
2352
+ "type": {
2353
+ "const": "subscription_end",
2354
+ "title": "Type",
2355
+ "type": "string"
2356
+ }
2357
+ },
2358
+ "required": [
2359
+ "type"
2360
+ ],
2361
+ "title": "SubscriptionEndExpiry",
2362
+ "type": "object"
2363
+ },
2364
+ "SubscriptionOffer": {
2365
+ "additionalProperties": false,
2366
+ "properties": {
2367
+ "display_name": {
2368
+ "minLength": 1,
2369
+ "title": "Display Name",
2370
+ "type": "string"
2371
+ },
2372
+ "description": {
2373
+ "anyOf": [
2374
+ {
2375
+ "type": "string"
2376
+ },
2377
+ {
2378
+ "type": "null"
2379
+ }
2380
+ ],
2381
+ "default": null,
2382
+ "title": "Description"
2383
+ },
2384
+ "sort_order": {
2385
+ "default": 0,
2386
+ "title": "Sort Order",
2387
+ "type": "integer"
2388
+ },
2389
+ "availability": {
2390
+ "anyOf": [
2391
+ {
2392
+ "$ref": "#/$defs/Availability"
2393
+ },
2394
+ {
2395
+ "type": "null"
2396
+ }
2397
+ ],
2398
+ "default": null
2399
+ },
2400
+ "price": {
2401
+ "$ref": "#/$defs/OfferPrice"
2402
+ },
2403
+ "providers": {
2404
+ "additionalProperties": {
2405
+ "discriminator": {
2406
+ "mapping": {
2407
+ "custom_object": "#/$defs/CustomObjectReference",
2408
+ "dodo_product": "#/$defs/DodoProductReference",
2409
+ "stripe_price": "#/$defs/StripePriceReference"
2410
+ },
2411
+ "propertyName": "type"
2412
+ },
2413
+ "oneOf": [
2414
+ {
2415
+ "$ref": "#/$defs/StripePriceReference"
2416
+ },
2417
+ {
2418
+ "$ref": "#/$defs/DodoProductReference"
2419
+ },
2420
+ {
2421
+ "$ref": "#/$defs/CustomObjectReference"
2422
+ }
2423
+ ]
2424
+ },
2425
+ "minProperties": 1,
2426
+ "title": "Providers",
2427
+ "type": "object"
2428
+ },
2429
+ "type": {
2430
+ "const": "subscription",
2431
+ "title": "Type",
2432
+ "type": "string"
2433
+ },
2434
+ "plan": {
2435
+ "title": "Plan",
2436
+ "type": "string"
2437
+ },
2438
+ "billing_interval": {
2439
+ "$ref": "#/$defs/BillingInterval"
2440
+ },
2441
+ "trial": {
2442
+ "anyOf": [
2443
+ {
2444
+ "$ref": "#/$defs/BillingInterval"
2445
+ },
2446
+ {
2447
+ "type": "null"
2448
+ }
2449
+ ],
2450
+ "default": null
2451
+ },
2452
+ "cycle_grant": {
2453
+ "anyOf": [
2454
+ {
2455
+ "$ref": "#/$defs/CycleGrant"
2456
+ },
2457
+ {
2458
+ "type": "null"
2459
+ }
2460
+ ],
2461
+ "default": null
2462
+ }
2463
+ },
2464
+ "required": [
2465
+ "display_name",
2466
+ "price",
2467
+ "providers",
2468
+ "type",
2469
+ "plan",
2470
+ "billing_interval"
2471
+ ],
2472
+ "title": "SubscriptionOffer",
2473
+ "type": "object"
2474
+ },
2475
+ "SumCharge": {
2476
+ "additionalProperties": false,
2477
+ "properties": {
2478
+ "type": {
2479
+ "const": "sum",
2480
+ "title": "Type",
2481
+ "type": "string"
2482
+ },
2483
+ "components": {
2484
+ "items": {
2485
+ "discriminator": {
2486
+ "mapping": {
2487
+ "expression": "#/$defs/ExpressionCharge",
2488
+ "flat": "#/$defs/FlatCharge",
2489
+ "graduated": "#/$defs/GraduatedCharge",
2490
+ "package": "#/$defs/PackageCharge",
2491
+ "per_unit": "#/$defs/PerUnitCharge",
2492
+ "sum": "#/$defs/SumCharge",
2493
+ "volume": "#/$defs/VolumeCharge"
2494
+ },
2495
+ "propertyName": "type"
2496
+ },
2497
+ "oneOf": [
2498
+ {
2499
+ "$ref": "#/$defs/FlatCharge"
2500
+ },
2501
+ {
2502
+ "$ref": "#/$defs/PerUnitCharge"
2503
+ },
2504
+ {
2505
+ "$ref": "#/$defs/PackageCharge"
2506
+ },
2507
+ {
2508
+ "$ref": "#/$defs/GraduatedCharge"
2509
+ },
2510
+ {
2511
+ "$ref": "#/$defs/VolumeCharge"
2512
+ },
2513
+ {
2514
+ "$ref": "#/$defs/ExpressionCharge"
2515
+ },
2516
+ {
2517
+ "$ref": "#/$defs/SumCharge"
2518
+ }
2519
+ ]
2520
+ },
2521
+ "minItems": 1,
2522
+ "title": "Components",
2523
+ "type": "array"
2524
+ }
2525
+ },
2526
+ "required": [
2527
+ "type",
2528
+ "components"
2529
+ ],
2530
+ "title": "SumCharge",
2531
+ "type": "object"
2532
+ },
2533
+ "TopupOffer": {
2534
+ "additionalProperties": false,
2535
+ "properties": {
2536
+ "display_name": {
2537
+ "minLength": 1,
2538
+ "title": "Display Name",
2539
+ "type": "string"
2540
+ },
2541
+ "description": {
2542
+ "anyOf": [
2543
+ {
2544
+ "type": "string"
2545
+ },
2546
+ {
2547
+ "type": "null"
2548
+ }
2549
+ ],
2550
+ "default": null,
2551
+ "title": "Description"
2552
+ },
2553
+ "sort_order": {
2554
+ "default": 0,
2555
+ "title": "Sort Order",
2556
+ "type": "integer"
2557
+ },
2558
+ "availability": {
2559
+ "anyOf": [
2560
+ {
2561
+ "$ref": "#/$defs/Availability"
2562
+ },
2563
+ {
2564
+ "type": "null"
2565
+ }
2566
+ ],
2567
+ "default": null
2568
+ },
2569
+ "price": {
2570
+ "$ref": "#/$defs/OfferPrice"
2571
+ },
2572
+ "providers": {
2573
+ "additionalProperties": {
2574
+ "discriminator": {
2575
+ "mapping": {
2576
+ "custom_object": "#/$defs/CustomObjectReference",
2577
+ "dodo_product": "#/$defs/DodoProductReference",
2578
+ "stripe_price": "#/$defs/StripePriceReference"
2579
+ },
2580
+ "propertyName": "type"
2581
+ },
2582
+ "oneOf": [
2583
+ {
2584
+ "$ref": "#/$defs/StripePriceReference"
2585
+ },
2586
+ {
2587
+ "$ref": "#/$defs/DodoProductReference"
2588
+ },
2589
+ {
2590
+ "$ref": "#/$defs/CustomObjectReference"
2591
+ }
2592
+ ]
2593
+ },
2594
+ "minProperties": 1,
2595
+ "title": "Providers",
2596
+ "type": "object"
2597
+ },
2598
+ "type": {
2599
+ "const": "topup",
2600
+ "title": "Type",
2601
+ "type": "string"
2602
+ },
2603
+ "credits_per_unit": {
2604
+ "examples": [
2605
+ "10.500000"
2606
+ ],
2607
+ "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
2608
+ "title": "Credits Per Unit",
2609
+ "type": "string"
2610
+ },
2611
+ "quantity": {
2612
+ "$ref": "#/$defs/QuantityBounds"
2613
+ },
2614
+ "bucket": {
2615
+ "title": "Bucket",
2616
+ "type": "string"
2617
+ },
2618
+ "expiry": {
2619
+ "anyOf": [
2620
+ {
2621
+ "discriminator": {
2622
+ "mapping": {
2623
+ "after_grant": "#/$defs/AfterGrantExpiry",
2624
+ "end_of_window": "#/$defs/EndOfWindowExpiry",
2625
+ "fixed_at": "#/$defs/FixedExpiry",
2626
+ "never": "#/$defs/NeverExpiry",
2627
+ "subscription_end": "#/$defs/SubscriptionEndExpiry"
2628
+ },
2629
+ "propertyName": "type"
2630
+ },
2631
+ "oneOf": [
2632
+ {
2633
+ "$ref": "#/$defs/NeverExpiry"
2634
+ },
2635
+ {
2636
+ "$ref": "#/$defs/AfterGrantExpiry"
2637
+ },
2638
+ {
2639
+ "$ref": "#/$defs/EndOfWindowExpiry"
2640
+ },
2641
+ {
2642
+ "$ref": "#/$defs/FixedExpiry"
2643
+ },
2644
+ {
2645
+ "$ref": "#/$defs/SubscriptionEndExpiry"
2646
+ }
2647
+ ]
2648
+ },
2649
+ {
2650
+ "type": "null"
2651
+ }
2652
+ ],
2653
+ "default": null,
2654
+ "title": "Expiry"
2655
+ },
2656
+ "lot_behavior": {
2657
+ "default": "separate_lots",
2658
+ "enum": [
2659
+ "separate_lots",
2660
+ "merge_and_refresh"
2661
+ ],
2662
+ "title": "Lot Behavior",
2663
+ "type": "string"
2664
+ }
2665
+ },
2666
+ "required": [
2667
+ "display_name",
2668
+ "price",
2669
+ "providers",
2670
+ "type",
2671
+ "credits_per_unit",
2672
+ "bucket"
2673
+ ],
2674
+ "title": "TopupOffer",
2675
+ "type": "object"
2676
+ },
2677
+ "VolumeCharge": {
2678
+ "additionalProperties": false,
2679
+ "properties": {
2680
+ "type": {
2681
+ "const": "volume",
2682
+ "title": "Type",
2683
+ "type": "string"
2684
+ },
2685
+ "measure": {
2686
+ "title": "Measure",
2687
+ "type": "string"
2688
+ },
2689
+ "tiers": {
2690
+ "items": {
2691
+ "$ref": "#/$defs/GraduatedTier"
2692
+ },
2693
+ "minItems": 1,
2694
+ "title": "Tiers",
2695
+ "type": "array"
2696
+ }
2697
+ },
2698
+ "required": [
2699
+ "type",
2700
+ "measure",
2701
+ "tiers"
2702
+ ],
2703
+ "title": "VolumeCharge",
2704
+ "type": "object"
2705
+ }
2706
+ },
2707
+ "additionalProperties": false,
2708
+ "properties": {
2709
+ "version": {
2710
+ "const": 1,
2711
+ "title": "Version",
2712
+ "type": "integer"
2713
+ },
2714
+ "catalog": {
2715
+ "$ref": "#/$defs/CatalogConfig",
2716
+ "description": "Catalog-wide publication settings such as the default signup plan."
2717
+ },
2718
+ "pricing": {
2719
+ "anyOf": [
2720
+ {
2721
+ "$ref": "#/$defs/PricingConfig"
2722
+ },
2723
+ {
2724
+ "type": "null"
2725
+ }
2726
+ ],
2727
+ "default": null,
2728
+ "description": "Usage operations, their measures and dimensions, and reusable rate cards."
2729
+ },
2730
+ "credits": {
2731
+ "$ref": "#/$defs/CreditsConfig",
2732
+ "description": "Credit buckets, spending policies, grants, and optional display conversion."
2733
+ },
2734
+ "entitlements": {
2735
+ "$ref": "#/$defs/EntitlementsConfig",
2736
+ "description": "Typed feature definitions referenced by plan feature values."
2737
+ },
2738
+ "admission": {
2739
+ "$ref": "#/$defs/AdmissionConfig",
2740
+ "description": "Reusable global and per-operation concurrency policies."
2741
+ },
2742
+ "plans": {
2743
+ "additionalProperties": {
2744
+ "$ref": "#/$defs/PlanDefinition"
2745
+ },
2746
+ "description": "Product plans keyed by stable snake_case identifiers.",
2747
+ "title": "Plans",
2748
+ "type": "object"
2749
+ },
2750
+ "commerce": {
2751
+ "$ref": "#/$defs/CommerceConfig",
2752
+ "description": "Payment providers, subscription and top-up offers, and purchase guardrails."
2753
+ }
2754
+ },
2755
+ "required": [
2756
+ "version",
2757
+ "credits"
2758
+ ],
2759
+ "title": "BursarConfig",
2760
+ "type": "object",
2761
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2762
+ "$id": "https://zonastery.github.io/bursar/pricing-config.schema.json",
2763
+ "$comment": "Structural schema. Run `bursar config validate` for cross-reference and pricing semantics."
2764
+ }