@zonastery/bursar 0.0.2 → 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 (493) 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 +45 -13
  15. package/dist/billing/billing-store.d.ts.map +1 -1
  16. package/dist/billing/billing-store.js.map +1 -1
  17. package/dist/billing/contracts.d.ts +149 -0
  18. package/dist/billing/contracts.d.ts.map +1 -0
  19. package/dist/billing/contracts.js +2 -0
  20. package/dist/billing/contracts.js.map +1 -0
  21. package/dist/billing/event-handlers.d.ts +57 -0
  22. package/dist/billing/event-handlers.d.ts.map +1 -0
  23. package/dist/billing/event-handlers.js +667 -0
  24. package/dist/billing/event-handlers.js.map +1 -0
  25. package/dist/billing/event-processor.d.ts +19 -0
  26. package/dist/billing/event-processor.d.ts.map +1 -0
  27. package/dist/billing/event-processor.js +105 -0
  28. package/dist/billing/event-processor.js.map +1 -0
  29. package/dist/billing/financial-event-handlers.d.ts +26 -0
  30. package/dist/billing/financial-event-handlers.d.ts.map +1 -0
  31. package/dist/billing/financial-event-handlers.js +241 -0
  32. package/dist/billing/financial-event-handlers.js.map +1 -0
  33. package/dist/billing/index.d.ts +8 -5
  34. package/dist/billing/index.d.ts.map +1 -1
  35. package/dist/billing/index.js +4 -4
  36. package/dist/billing/index.js.map +1 -1
  37. package/dist/billing/management.d.ts +59 -0
  38. package/dist/billing/management.d.ts.map +1 -0
  39. package/dist/billing/management.js +113 -0
  40. package/dist/billing/management.js.map +1 -0
  41. package/dist/billing/policy-window.d.ts +24 -0
  42. package/dist/billing/policy-window.d.ts.map +1 -0
  43. package/dist/billing/policy-window.js +88 -0
  44. package/dist/billing/policy-window.js.map +1 -0
  45. package/dist/billing/postgres/repositories/auto-recharge.d.ts +32 -0
  46. package/dist/billing/postgres/repositories/auto-recharge.d.ts.map +1 -0
  47. package/dist/billing/postgres/repositories/auto-recharge.js +178 -0
  48. package/dist/billing/postgres/repositories/auto-recharge.js.map +1 -0
  49. package/dist/billing/postgres/repositories/customer.d.ts +12 -0
  50. package/dist/billing/postgres/repositories/customer.d.ts.map +1 -0
  51. package/dist/billing/postgres/repositories/customer.js +33 -0
  52. package/dist/billing/postgres/repositories/customer.js.map +1 -0
  53. package/dist/billing/postgres/repositories/dispute.d.ts +7 -0
  54. package/dist/billing/postgres/repositories/dispute.d.ts.map +1 -0
  55. package/dist/billing/postgres/repositories/dispute.js +18 -0
  56. package/dist/billing/postgres/repositories/dispute.js.map +1 -0
  57. package/dist/billing/postgres/repositories/event.d.ts +21 -0
  58. package/dist/billing/postgres/repositories/event.d.ts.map +1 -0
  59. package/dist/billing/postgres/repositories/event.js +47 -0
  60. package/dist/billing/postgres/repositories/event.js.map +1 -0
  61. package/dist/billing/postgres/repositories/invoice.d.ts +9 -0
  62. package/dist/billing/postgres/repositories/invoice.d.ts.map +1 -0
  63. package/dist/billing/postgres/repositories/invoice.js +36 -0
  64. package/dist/billing/postgres/repositories/invoice.js.map +1 -0
  65. package/dist/billing/postgres/repositories/offer.d.ts +26 -0
  66. package/dist/billing/postgres/repositories/offer.d.ts.map +1 -0
  67. package/dist/billing/postgres/repositories/offer.js +73 -0
  68. package/dist/billing/postgres/repositories/offer.js.map +1 -0
  69. package/dist/billing/postgres/repositories/payment.d.ts +32 -0
  70. package/dist/billing/postgres/repositories/payment.d.ts.map +1 -0
  71. package/dist/billing/postgres/repositories/payment.js +78 -0
  72. package/dist/billing/postgres/repositories/payment.js.map +1 -0
  73. package/dist/billing/postgres/repositories/preferences.d.ts +15 -0
  74. package/dist/billing/postgres/repositories/preferences.d.ts.map +1 -0
  75. package/dist/billing/postgres/repositories/preferences.js +23 -0
  76. package/dist/billing/postgres/repositories/preferences.js.map +1 -0
  77. package/dist/billing/postgres/repositories/refund.d.ts +7 -0
  78. package/dist/billing/postgres/repositories/refund.d.ts.map +1 -0
  79. package/dist/billing/postgres/repositories/refund.js +32 -0
  80. package/dist/billing/postgres/repositories/refund.js.map +1 -0
  81. package/dist/billing/postgres/repositories/subscription.d.ts +46 -0
  82. package/dist/billing/postgres/repositories/subscription.d.ts.map +1 -0
  83. package/dist/billing/postgres/repositories/subscription.js +187 -0
  84. package/dist/billing/postgres/repositories/subscription.js.map +1 -0
  85. package/dist/billing/postgres/repositories/topup.d.ts +27 -0
  86. package/dist/billing/postgres/repositories/topup.d.ts.map +1 -0
  87. package/dist/billing/postgres/repositories/topup.js +51 -0
  88. package/dist/billing/postgres/repositories/topup.js.map +1 -0
  89. package/dist/billing/postgres/store.d.ts +87 -0
  90. package/dist/billing/postgres/store.d.ts.map +1 -0
  91. package/dist/billing/postgres/store.js +527 -0
  92. package/dist/billing/postgres/store.js.map +1 -0
  93. package/dist/billing/service-types.d.ts +37 -0
  94. package/dist/billing/service-types.d.ts.map +1 -0
  95. package/dist/billing/service-types.js +2 -0
  96. package/dist/billing/service-types.js.map +1 -0
  97. package/dist/billing/types/auto-recharge.d.ts +56 -0
  98. package/dist/billing/types/auto-recharge.d.ts.map +1 -0
  99. package/dist/billing/types/auto-recharge.js +2 -0
  100. package/dist/billing/types/auto-recharge.js.map +1 -0
  101. package/dist/billing/types/catalog.d.ts +47 -0
  102. package/dist/billing/types/catalog.d.ts.map +1 -0
  103. package/dist/billing/types/catalog.js +2 -0
  104. package/dist/billing/types/catalog.js.map +1 -0
  105. package/dist/billing/types/common.d.ts +16 -0
  106. package/dist/billing/types/common.d.ts.map +1 -0
  107. package/dist/billing/types/common.js +2 -0
  108. package/dist/billing/types/common.js.map +1 -0
  109. package/dist/billing/types/documents.d.ts +39 -0
  110. package/dist/billing/types/documents.d.ts.map +1 -0
  111. package/dist/billing/types/documents.js +2 -0
  112. package/dist/billing/types/documents.js.map +1 -0
  113. package/dist/billing/types/events.d.ts +75 -0
  114. package/dist/billing/types/events.d.ts.map +1 -0
  115. package/dist/billing/types/events.js +38 -0
  116. package/dist/billing/types/events.js.map +1 -0
  117. package/dist/billing/types/index.d.ts +8 -0
  118. package/dist/billing/types/index.d.ts.map +1 -0
  119. package/dist/billing/types/index.js +8 -0
  120. package/dist/billing/types/index.js.map +1 -0
  121. package/dist/billing/types/preferences.d.ts +13 -0
  122. package/dist/billing/types/preferences.d.ts.map +1 -0
  123. package/dist/billing/types/preferences.js +2 -0
  124. package/dist/billing/types/preferences.js.map +1 -0
  125. package/dist/billing/types/subscriptions.d.ts +97 -0
  126. package/dist/billing/types/subscriptions.d.ts.map +1 -0
  127. package/dist/billing/types/subscriptions.js +12 -0
  128. package/dist/billing/types/subscriptions.js.map +1 -0
  129. package/dist/breakdown.d.ts +3 -1
  130. package/dist/breakdown.d.ts.map +1 -1
  131. package/dist/breakdown.js +4 -1
  132. package/dist/breakdown.js.map +1 -1
  133. package/dist/browser.d.ts +8 -0
  134. package/dist/browser.d.ts.map +1 -0
  135. package/dist/browser.js +7 -0
  136. package/dist/browser.js.map +1 -0
  137. package/dist/bursar.d.ts +80 -0
  138. package/dist/bursar.d.ts.map +1 -0
  139. package/dist/bursar.js +129 -0
  140. package/dist/bursar.js.map +1 -0
  141. package/dist/catalog.d.ts +61 -0
  142. package/dist/catalog.d.ts.map +1 -0
  143. package/dist/catalog.js +95 -0
  144. package/dist/catalog.js.map +1 -0
  145. package/dist/commerce/errors.d.ts +69 -0
  146. package/dist/commerce/errors.d.ts.map +1 -0
  147. package/dist/commerce/errors.js +107 -0
  148. package/dist/commerce/errors.js.map +1 -0
  149. package/dist/commerce/index.d.ts +6 -0
  150. package/dist/commerce/index.d.ts.map +1 -0
  151. package/dist/commerce/index.js +6 -0
  152. package/dist/commerce/index.js.map +1 -0
  153. package/dist/commerce/plan-change.d.ts +10 -0
  154. package/dist/commerce/plan-change.d.ts.map +1 -0
  155. package/dist/commerce/plan-change.js +42 -0
  156. package/dist/commerce/plan-change.js.map +1 -0
  157. package/dist/commerce/provider-registry.d.ts +18 -0
  158. package/dist/commerce/provider-registry.d.ts.map +1 -0
  159. package/dist/commerce/provider-registry.js +70 -0
  160. package/dist/commerce/provider-registry.js.map +1 -0
  161. package/dist/commerce/service.d.ts +73 -0
  162. package/dist/commerce/service.d.ts.map +1 -0
  163. package/dist/commerce/service.js +981 -0
  164. package/dist/commerce/service.js.map +1 -0
  165. package/dist/commerce/types.d.ts +217 -0
  166. package/dist/commerce/types.d.ts.map +1 -0
  167. package/dist/commerce/types.js.map +1 -0
  168. package/dist/config/parse-access.d.ts +6 -0
  169. package/dist/config/parse-access.d.ts.map +1 -0
  170. package/dist/config/parse-access.js +72 -0
  171. package/dist/config/parse-access.js.map +1 -0
  172. package/dist/config/parse-commerce.d.ts +3 -0
  173. package/dist/config/parse-commerce.d.ts.map +1 -0
  174. package/dist/config/parse-commerce.js +236 -0
  175. package/dist/config/parse-commerce.js.map +1 -0
  176. package/dist/config/parse-credits.d.ts +3 -0
  177. package/dist/config/parse-credits.d.ts.map +1 -0
  178. package/dist/config/parse-credits.js +99 -0
  179. package/dist/config/parse-credits.js.map +1 -0
  180. package/dist/config/parse-plans.d.ts +5 -0
  181. package/dist/config/parse-plans.d.ts.map +1 -0
  182. package/dist/config/parse-plans.js +126 -0
  183. package/dist/config/parse-plans.js.map +1 -0
  184. package/dist/config/parse-pricing.d.ts +4 -0
  185. package/dist/config/parse-pricing.d.ts.map +1 -0
  186. package/dist/config/parse-pricing.js +252 -0
  187. package/dist/config/parse-pricing.js.map +1 -0
  188. package/dist/config/parse-utils.d.ts +18 -0
  189. package/dist/config/parse-utils.d.ts.map +1 -0
  190. package/dist/config/parse-utils.js +118 -0
  191. package/dist/config/parse-utils.js.map +1 -0
  192. package/dist/config/types.d.ts +327 -0
  193. package/dist/config/types.d.ts.map +1 -0
  194. package/dist/config/types.js +2 -0
  195. package/dist/config/types.js.map +1 -0
  196. package/dist/config.d.ts +6 -23
  197. package/dist/config.d.ts.map +1 -1
  198. package/dist/config.js +86 -385
  199. package/dist/config.js.map +1 -1
  200. package/dist/{stores → credits}/events.d.ts +6 -6
  201. package/dist/credits/events.d.ts.map +1 -0
  202. package/dist/{stores → credits}/events.js +5 -5
  203. package/dist/credits/events.js.map +1 -0
  204. package/dist/credits/lease-workflow.d.ts +90 -0
  205. package/dist/credits/lease-workflow.d.ts.map +1 -0
  206. package/dist/credits/lease-workflow.js +378 -0
  207. package/dist/credits/lease-workflow.js.map +1 -0
  208. package/dist/credits/low-balance-monitor.d.ts +26 -0
  209. package/dist/credits/low-balance-monitor.d.ts.map +1 -0
  210. package/dist/credits/low-balance-monitor.js +110 -0
  211. package/dist/credits/low-balance-monitor.js.map +1 -0
  212. package/dist/credits/postgres/repositories/analytics.d.ts +77 -0
  213. package/dist/credits/postgres/repositories/analytics.d.ts.map +1 -0
  214. package/dist/credits/postgres/repositories/analytics.js +151 -0
  215. package/dist/credits/postgres/repositories/analytics.js.map +1 -0
  216. package/dist/credits/postgres/repositories/balance.d.ts +66 -0
  217. package/dist/credits/postgres/repositories/balance.d.ts.map +1 -0
  218. package/dist/credits/postgres/repositories/balance.js +139 -0
  219. package/dist/credits/postgres/repositories/balance.js.map +1 -0
  220. package/dist/credits/postgres/repositories/bucket.d.ts +25 -0
  221. package/dist/credits/postgres/repositories/bucket.d.ts.map +1 -0
  222. package/dist/credits/postgres/repositories/bucket.js +52 -0
  223. package/dist/credits/postgres/repositories/bucket.js.map +1 -0
  224. package/dist/credits/postgres/repositories/deduction.d.ts +55 -0
  225. package/dist/credits/postgres/repositories/deduction.d.ts.map +1 -0
  226. package/dist/credits/postgres/repositories/deduction.js +130 -0
  227. package/dist/credits/postgres/repositories/deduction.js.map +1 -0
  228. package/dist/credits/postgres/repositories/lease.d.ts +69 -0
  229. package/dist/credits/postgres/repositories/lease.d.ts.map +1 -0
  230. package/dist/credits/postgres/repositories/lease.js +148 -0
  231. package/dist/credits/postgres/repositories/lease.js.map +1 -0
  232. package/dist/credits/postgres/repositories/plan.d.ts +105 -0
  233. package/dist/credits/postgres/repositories/plan.d.ts.map +1 -0
  234. package/dist/credits/postgres/repositories/plan.js +182 -0
  235. package/dist/credits/postgres/repositories/plan.js.map +1 -0
  236. package/dist/credits/postgres/repositories/pricing.d.ts +28 -0
  237. package/dist/credits/postgres/repositories/pricing.d.ts.map +1 -0
  238. package/dist/credits/postgres/repositories/pricing.js +70 -0
  239. package/dist/credits/postgres/repositories/pricing.js.map +1 -0
  240. package/dist/credits/postgres/repositories/team.d.ts +63 -0
  241. package/dist/credits/postgres/repositories/team.d.ts.map +1 -0
  242. package/dist/credits/postgres/repositories/team.js +120 -0
  243. package/dist/credits/postgres/repositories/team.js.map +1 -0
  244. package/dist/credits/postgres/store.d.ts +84 -0
  245. package/dist/credits/postgres/store.d.ts.map +1 -0
  246. package/dist/credits/postgres/store.js +765 -0
  247. package/dist/credits/postgres/store.js.map +1 -0
  248. package/dist/credits/postgres/value-mappers.d.ts +17 -0
  249. package/dist/credits/postgres/value-mappers.d.ts.map +1 -0
  250. package/dist/credits/postgres/value-mappers.js +98 -0
  251. package/dist/credits/postgres/value-mappers.js.map +1 -0
  252. package/dist/credits/pricing-runtime.d.ts +34 -0
  253. package/dist/credits/pricing-runtime.d.ts.map +1 -0
  254. package/dist/credits/pricing-runtime.js +141 -0
  255. package/dist/credits/pricing-runtime.js.map +1 -0
  256. package/dist/credits/queries.d.ts +33 -0
  257. package/dist/credits/queries.d.ts.map +1 -0
  258. package/dist/credits/queries.js +71 -0
  259. package/dist/credits/queries.js.map +1 -0
  260. package/dist/credits/service-errors.d.ts +4 -0
  261. package/dist/credits/service-errors.d.ts.map +1 -0
  262. package/dist/credits/service-errors.js +57 -0
  263. package/dist/credits/service-errors.js.map +1 -0
  264. package/dist/credits/service-types.d.ts +122 -0
  265. package/dist/credits/service-types.d.ts.map +1 -0
  266. package/dist/credits/service-types.js +2 -0
  267. package/dist/credits/service-types.js.map +1 -0
  268. package/dist/credits/service.d.ts +207 -0
  269. package/dist/credits/service.d.ts.map +1 -0
  270. package/dist/credits/service.js +594 -0
  271. package/dist/credits/service.js.map +1 -0
  272. package/dist/credits/store.d.ts +167 -0
  273. package/dist/credits/store.d.ts.map +1 -0
  274. package/dist/{stores/credit-store.js → credits/store.js} +23 -43
  275. package/dist/credits/store.js.map +1 -0
  276. package/dist/credits/types/account.d.ts +82 -0
  277. package/dist/credits/types/account.d.ts.map +1 -0
  278. package/dist/credits/types/account.js +2 -0
  279. package/dist/credits/types/account.js.map +1 -0
  280. package/dist/credits/types/admission.d.ts +39 -0
  281. package/dist/credits/types/admission.d.ts.map +1 -0
  282. package/dist/credits/types/admission.js +2 -0
  283. package/dist/credits/types/admission.js.map +1 -0
  284. package/dist/credits/types/analytics.d.ts +52 -0
  285. package/dist/credits/types/analytics.d.ts.map +1 -0
  286. package/dist/credits/types/analytics.js +2 -0
  287. package/dist/credits/types/analytics.js.map +1 -0
  288. package/dist/credits/types/catalog.d.ts +69 -0
  289. package/dist/credits/types/catalog.d.ts.map +1 -0
  290. package/dist/credits/types/catalog.js +2 -0
  291. package/dist/credits/types/catalog.js.map +1 -0
  292. package/dist/credits/types/grants.d.ts +24 -0
  293. package/dist/credits/types/grants.d.ts.map +1 -0
  294. package/dist/credits/types/grants.js +2 -0
  295. package/dist/credits/types/grants.js.map +1 -0
  296. package/dist/credits/types/index.d.ts +9 -0
  297. package/dist/credits/types/index.d.ts.map +1 -0
  298. package/dist/credits/types/index.js +2 -0
  299. package/dist/credits/types/index.js.map +1 -0
  300. package/dist/credits/types/ledger.d.ts +77 -0
  301. package/dist/credits/types/ledger.d.ts.map +1 -0
  302. package/dist/credits/types/ledger.js +2 -0
  303. package/dist/credits/types/ledger.js.map +1 -0
  304. package/dist/credits/types/quotas.d.ts +40 -0
  305. package/dist/credits/types/quotas.d.ts.map +1 -0
  306. package/dist/credits/types/quotas.js +2 -0
  307. package/dist/credits/types/quotas.js.map +1 -0
  308. package/dist/credits/types/teams.d.ts +44 -0
  309. package/dist/credits/types/teams.d.ts.map +1 -0
  310. package/dist/credits/types/teams.js +2 -0
  311. package/dist/credits/types/teams.js.map +1 -0
  312. package/dist/engine.d.ts +18 -39
  313. package/dist/engine.d.ts.map +1 -1
  314. package/dist/engine.js +169 -145
  315. package/dist/engine.js.map +1 -1
  316. package/dist/errors.d.ts +84 -25
  317. package/dist/errors.d.ts.map +1 -1
  318. package/dist/errors.js +117 -24
  319. package/dist/errors.js.map +1 -1
  320. package/dist/expr/ast.d.ts +46 -0
  321. package/dist/expr/ast.d.ts.map +1 -0
  322. package/dist/expr/ast.js +18 -0
  323. package/dist/expr/ast.js.map +1 -0
  324. package/dist/expr/evaluator.d.ts +4 -0
  325. package/dist/expr/evaluator.d.ts.map +1 -0
  326. package/dist/expr/evaluator.js +144 -0
  327. package/dist/expr/evaluator.js.map +1 -0
  328. package/dist/expr/language.d.ts +5 -0
  329. package/dist/expr/language.d.ts.map +1 -0
  330. package/dist/expr/language.js +73 -0
  331. package/dist/expr/language.js.map +1 -0
  332. package/dist/expr/parser.d.ts +24 -0
  333. package/dist/expr/parser.d.ts.map +1 -0
  334. package/dist/expr/parser.js +175 -0
  335. package/dist/expr/parser.js.map +1 -0
  336. package/dist/expr/tokenizer.d.ts +7 -0
  337. package/dist/expr/tokenizer.d.ts.map +1 -0
  338. package/dist/expr/tokenizer.js +85 -0
  339. package/dist/expr/tokenizer.js.map +1 -0
  340. package/dist/expr.d.ts +7 -58
  341. package/dist/expr.d.ts.map +1 -1
  342. package/dist/expr.js +41 -640
  343. package/dist/expr.js.map +1 -1
  344. package/dist/generated/pricing-config.schema.json +2764 -0
  345. package/dist/generated/pricing-config.types.d.ts +674 -0
  346. package/dist/generated/pricing-config.types.d.ts.map +1 -0
  347. package/dist/generated/pricing-config.types.js +8 -0
  348. package/dist/generated/pricing-config.types.js.map +1 -0
  349. package/dist/index.d.ts +21 -17
  350. package/dist/index.d.ts.map +1 -1
  351. package/dist/index.js +12 -10
  352. package/dist/index.js.map +1 -1
  353. package/dist/load-pricing-file.d.ts.map +1 -1
  354. package/dist/load-pricing-file.js.map +1 -1
  355. package/dist/metrics.d.ts +6 -16
  356. package/dist/metrics.d.ts.map +1 -1
  357. package/dist/node.d.ts +9 -2
  358. package/dist/node.d.ts.map +1 -1
  359. package/dist/node.js +6 -2
  360. package/dist/node.js.map +1 -1
  361. package/dist/providers/_shared.d.ts +9 -0
  362. package/dist/providers/_shared.d.ts.map +1 -0
  363. package/dist/providers/_shared.js +25 -0
  364. package/dist/providers/_shared.js.map +1 -0
  365. package/dist/providers/dodo/client-contract.d.ts +106 -0
  366. package/dist/providers/dodo/client-contract.d.ts.map +1 -0
  367. package/dist/providers/dodo/client-contract.js +2 -0
  368. package/dist/providers/dodo/client-contract.js.map +1 -0
  369. package/dist/providers/dodo/event-mapper.d.ts +5 -3
  370. package/dist/providers/dodo/event-mapper.d.ts.map +1 -1
  371. package/dist/providers/dodo/event-mapper.js +213 -38
  372. package/dist/providers/dodo/event-mapper.js.map +1 -1
  373. package/dist/providers/dodo/index.d.ts +1 -0
  374. package/dist/providers/dodo/index.d.ts.map +1 -1
  375. package/dist/providers/dodo/index.js.map +1 -1
  376. package/dist/providers/dodo/provider.d.ts +24 -14
  377. package/dist/providers/dodo/provider.d.ts.map +1 -1
  378. package/dist/providers/dodo/provider.js +249 -31
  379. package/dist/providers/dodo/provider.js.map +1 -1
  380. package/dist/providers/index.d.ts +3 -1
  381. package/dist/providers/index.d.ts.map +1 -1
  382. package/dist/providers/index.js +1 -0
  383. package/dist/providers/index.js.map +1 -1
  384. package/dist/providers/mock/provider.d.ts +14 -10
  385. package/dist/providers/mock/provider.d.ts.map +1 -1
  386. package/dist/providers/mock/provider.js +78 -10
  387. package/dist/providers/mock/provider.js.map +1 -1
  388. package/dist/providers/stripe/event-mapper.d.ts +3 -3
  389. package/dist/providers/stripe/event-mapper.d.ts.map +1 -1
  390. package/dist/providers/stripe/event-mapper.js +139 -30
  391. package/dist/providers/stripe/event-mapper.js.map +1 -1
  392. package/dist/providers/stripe/provider.d.ts +21 -12
  393. package/dist/providers/stripe/provider.d.ts.map +1 -1
  394. package/dist/providers/stripe/provider.js +175 -17
  395. package/dist/providers/stripe/provider.js.map +1 -1
  396. package/dist/providers/types.d.ts +128 -32
  397. package/dist/providers/types.d.ts.map +1 -1
  398. package/dist/providers/types.js +17 -1
  399. package/dist/providers/types.js.map +1 -1
  400. package/dist/retry.d.ts +13 -0
  401. package/dist/retry.d.ts.map +1 -0
  402. package/dist/retry.js +28 -0
  403. package/dist/retry.js.map +1 -0
  404. package/dist/shared/logger.d.ts +10 -0
  405. package/dist/shared/logger.d.ts.map +1 -0
  406. package/dist/shared/logger.js +15 -0
  407. package/dist/shared/logger.js.map +1 -0
  408. package/dist/shared/postgres-client.d.ts +51 -0
  409. package/dist/shared/postgres-client.d.ts.map +1 -0
  410. package/dist/shared/postgres-client.js +101 -0
  411. package/dist/shared/postgres-client.js.map +1 -0
  412. package/dist/shared/postgres-types.d.ts +7 -0
  413. package/dist/shared/postgres-types.d.ts.map +1 -0
  414. package/dist/shared/postgres-types.js +2 -0
  415. package/dist/shared/postgres-types.js.map +1 -0
  416. package/dist/shared/postgres-validation.d.ts +8 -0
  417. package/dist/shared/postgres-validation.d.ts.map +1 -0
  418. package/dist/shared/postgres-validation.js +40 -0
  419. package/dist/shared/postgres-validation.js.map +1 -0
  420. package/dist/storage/adapters/clickhouse.d.ts +61 -0
  421. package/dist/storage/adapters/clickhouse.d.ts.map +1 -0
  422. package/dist/storage/adapters/clickhouse.js +329 -0
  423. package/dist/storage/adapters/clickhouse.js.map +1 -0
  424. package/dist/storage/adapters/s3.d.ts +35 -0
  425. package/dist/storage/adapters/s3.d.ts.map +1 -0
  426. package/dist/storage/adapters/s3.js +100 -0
  427. package/dist/storage/adapters/s3.js.map +1 -0
  428. package/dist/storage/outbox-worker.d.ts +40 -0
  429. package/dist/storage/outbox-worker.d.ts.map +1 -0
  430. package/dist/storage/outbox-worker.js +132 -0
  431. package/dist/storage/outbox-worker.js.map +1 -0
  432. package/dist/storage/ports.d.ts +77 -0
  433. package/dist/storage/ports.d.ts.map +1 -0
  434. package/dist/storage/ports.js +2 -0
  435. package/dist/storage/ports.js.map +1 -0
  436. package/dist/storage/postgres-repository.d.ts +14 -0
  437. package/dist/storage/postgres-repository.d.ts.map +1 -0
  438. package/dist/storage/postgres-repository.js +130 -0
  439. package/dist/storage/postgres-repository.js.map +1 -0
  440. package/dist/storage/runtime.d.ts +67 -0
  441. package/dist/storage/runtime.d.ts.map +1 -0
  442. package/dist/storage/runtime.js +313 -0
  443. package/dist/storage/runtime.js.map +1 -0
  444. package/package.json +36 -20
  445. package/dist/allowance.d.ts +0 -48
  446. package/dist/allowance.d.ts.map +0 -1
  447. package/dist/allowance.js +0 -140
  448. package/dist/allowance.js.map +0 -1
  449. package/dist/billing/billing-manager.d.ts +0 -66
  450. package/dist/billing/billing-manager.d.ts.map +0 -1
  451. package/dist/billing/billing-manager.js +0 -560
  452. package/dist/billing/billing-manager.js.map +0 -1
  453. package/dist/billing/billing-types.d.ts +0 -203
  454. package/dist/billing/billing-types.d.ts.map +0 -1
  455. package/dist/billing/billing-types.js +0 -6
  456. package/dist/billing/billing-types.js.map +0 -1
  457. package/dist/billing/memory-billing-store.d.ts +0 -37
  458. package/dist/billing/memory-billing-store.d.ts.map +0 -1
  459. package/dist/billing/memory-billing-store.js +0 -197
  460. package/dist/billing/memory-billing-store.js.map +0 -1
  461. package/dist/billing/postgres-billing-store.d.ts +0 -35
  462. package/dist/billing/postgres-billing-store.d.ts.map +0 -1
  463. package/dist/billing/postgres-billing-store.js +0 -274
  464. package/dist/billing/postgres-billing-store.js.map +0 -1
  465. package/dist/billing/supabase-billing-store.d.ts +0 -29
  466. package/dist/billing/supabase-billing-store.d.ts.map +0 -1
  467. package/dist/billing/supabase-billing-store.js +0 -250
  468. package/dist/billing/supabase-billing-store.js.map +0 -1
  469. package/dist/manager.d.ts +0 -444
  470. package/dist/manager.d.ts.map +0 -1
  471. package/dist/manager.js +0 -1153
  472. package/dist/manager.js.map +0 -1
  473. package/dist/stores/credit-store.d.ts +0 -198
  474. package/dist/stores/credit-store.d.ts.map +0 -1
  475. package/dist/stores/credit-store.js.map +0 -1
  476. package/dist/stores/events.d.ts.map +0 -1
  477. package/dist/stores/events.js.map +0 -1
  478. package/dist/stores/memory-store.d.ts +0 -187
  479. package/dist/stores/memory-store.d.ts.map +0 -1
  480. package/dist/stores/memory-store.js +0 -1890
  481. package/dist/stores/memory-store.js.map +0 -1
  482. package/dist/stores/postgres-store.d.ts +0 -100
  483. package/dist/stores/postgres-store.d.ts.map +0 -1
  484. package/dist/stores/postgres-store.js +0 -891
  485. package/dist/stores/postgres-store.js.map +0 -1
  486. package/dist/stores/supabase-store.d.ts +0 -87
  487. package/dist/stores/supabase-store.d.ts.map +0 -1
  488. package/dist/stores/supabase-store.js +0 -948
  489. package/dist/stores/supabase-store.js.map +0 -1
  490. package/dist/types.d.ts +0 -463
  491. package/dist/types.d.ts.map +0 -1
  492. package/dist/types.js.map +0 -1
  493. /package/dist/{types.js → commerce/types.js} +0 -0
@@ -0,0 +1,8 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=pricing-config.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing-config.types.js","sourceRoot":"","sources":["../../src/generated/pricing-config.types.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;GAIG"}
package/dist/index.d.ts CHANGED
@@ -1,22 +1,26 @@
1
1
  export { PricingEngine } from "./engine.js";
2
- export type { AllowancePeriod, FeatureLimitPeriod } from "./allowance.js";
3
- export { resolveAllowanceWindow, resolveCalendarWindow } from "./allowance.js";
4
2
  export type { CostBreakdown } from "./breakdown.js";
5
3
  export { makeCostBreakdown } from "./breakdown.js";
6
- export type { ToolCall, UsageMetrics } from "./metrics.js";
7
- export type { PricingConfig } from "./config.js";
8
- export { loadConfigFromDict } from "./config.js";
9
- export { CapabilityNotSupportedError, CapReachedError, ConcurrencyLimitError, ConfigError, ExpressionError, FeatureLimitReachedError, FeatureNotEntitledError, ImportError, InsufficientCreditsError, LeaseExpiredError, LeaseNotFoundError, PricingNotLoadedError, RefundError, StoreError, } from "./errors.js";
4
+ export type { UsageMetrics } from "./metrics.js";
5
+ export type { BursarConfigData, ParsedBursarConfig, PricingConfig, CreditsConfig, PlanDefinition, CommerceConfig, Window, Charge, FeatureDefinition, } from "./config.js";
6
+ export { loadConfigFromDict, canonicalBursarConfigDict } from "./config.js";
7
+ export { projectPublicCatalog } from "./catalog.js";
8
+ export type { PublicCatalog, PublicCatalogOffer, PublicCatalogPlan, PublicCatalogWindow, } from "./catalog.js";
9
+ export { BursarError, CapabilityNotSupportedError, CapReachedError, ConcurrencyLimitError, CreditError, ConfigError, ExpressionError, FeatureNotEntitledError, ImportError, InsufficientCreditsError, LeaseExpiredError, LeaseNotFoundError, OperationNotAllowedError, PricingNotLoadedError, RefundError, QuotaExceededError, StoreError, bursarErrorHttpStatus, bursarErrorPublicMessage, isRetryableBursarError, } from "./errors.js";
10
+ export type { BursarErrorCategory } from "./errors.js";
11
+ export { retryBursarOperation } from "./retry.js";
12
+ export type { BursarRetryOptions } from "./retry.js";
10
13
  export { validateExpression, evaluateExpression } from "./expr.js";
11
- export { CreditManager } from "./manager.js";
12
- export type { CanAffordOptions, CreditManagerOptions, LowBalanceConfig, PolicyPreset, ReserveOptions, RunBilledOptions, SettleOptions, } from "./manager.js";
13
- export type { AddCreditsResult, AddTeamMemberResult, AggregateStats, AllowanceResult, AvailableResult, BalanceResult, BillingMode, CanAffordResult, CapCheckResult, CheckFeatureResult, CreateTeamResult, CreditMetadata, DailySpendRow, DeductionResult, DeductWithAllowanceOptions, FeatureLimit, FeatureLimitResult, GetUserPlanResult, LeaseResult, OperationPolicy, PlanDefinition, PricingConfigData, PricingConfigResult, RefundResult, ReleaseResult, SetUserPlanResult, SetupResult, SpendByModelRow, SpendByUserRow, ListTransactionsOptions, ListUsageEventsOptions, PaginatedTransactions, UserTransactionRow, SpendCap, SweepResult, Team, TeamBalanceResult, TeamDeductionResult, TeamMember, TierBalance, TierBalancesResult, TierDefinition, TopUserRow, } from "./types.js";
14
- export type { CreateLeaseOptions, SettleLeaseOptions } from "./stores/credit-store.js";
15
- export { CreditStore } from "./stores/credit-store.js";
16
- export { HttpxSupabaseStore } from "./stores/supabase-store.js";
17
- export { PostgresStore } from "./stores/postgres-store.js";
18
- export type { CreditEvent, CreditEventType } from "./stores/events.js";
19
- export { CreditEventEmitter } from "./stores/events.js";
20
- export { BillingStore, MemoryBillingStore, PostgresBillingStore, SupabaseBillingStore, BillingManager, } from "./billing/index.js";
21
- export type { BillingConfig, BillingCreditTopup, BillingCustomerInfo, BillingDisputeInfo, BillingEvent, BillingEventClaim, BillingEventResult, BillingEventType, BillingInvoiceInfo, BillingOffer, BillingOfferInterval, BillingPaymentInfo, BillingProvider, BillingProviderRefs, BillingRefundInfo, BillingSubscriptionInfo, BillingSubscriptionOfferRef, BillingSubscriptionState, BillingSubscriptionStatus, EntitlementMode, } from "./billing/index.js";
14
+ export { AccountService, Bursar, CatalogService } from "./bursar.js";
15
+ export type { AccountCreatedInput, AccountCreatedResult, BursarOptions, BillingEventSink, BillingService, CommerceOptions, CreditsService, } from "./bursar.js";
16
+ export * from "./commerce/index.js";
17
+ export type { AddCreditsResult, AddTeamMemberResult, AggregateStats, AllowanceResult, AvailableResult, BalanceResult, BillingMode, BursarConfigHistoryItem, BursarConfigResult, BucketBalance, BucketBalancesResult, BucketDefinition, CanAffordResult, CheckFeatureResult, CreateTeamResult, CreditMetadata, DailySpendRow, DeductionResult, DeductWithAllowanceOptions, ExecuteGrantProgramRequest, GetUserPlanResult, GrantProgramAwardResult, GrantProgramTrigger, LeaseResult, LeasePricingContext, ListQuotaEventsOptions, PlanAllowancePolicy, PlanAdmissionPolicy, PlanCreditPolicy, PlanMigrationBatchResult, PlanMigrationStartResult, QuotaEvent, QuotaState, RefundResult, ReleaseResult, SetUserPlanResult, SpendByModelRow, SpendByUserRow, ListLedgerEntriesOptions, ListUsageChargesOptions, ListUsageEntriesOptions, LedgerCursor, LedgerPage, LedgerEntry, UsageCharge, UsageChargeCursor, UsageChargePage, SweepResult, Team, TeamBalanceResult, TeamDeductionResult, TeamMember, TopUserRow, UsageAnalyticsStore, } from "./credits/types/index.js";
18
+ export type { CreateLeaseOptions, SettleLeaseOptions } from "./credits/store.js";
19
+ export { CreditStore } from "./credits/store.js";
20
+ export { PostgresStore } from "./credits/postgres/store.js";
21
+ export type { CreditEvent, CreditEventType } from "./credits/events.js";
22
+ export { CreditEventEmitter } from "./credits/events.js";
23
+ export { BillingStore, PostgresBillingStore } from "./billing/index.js";
24
+ export { AUTO_RECHARGE_STATES, BillingEventType } from "./billing/index.js";
25
+ export type { BillingAutoRechargeAttempt, BillingAutoRechargeProfile, BillingAutoRechargeStatus, BillingProvisioningPort, BillingCreditTopup, BillingCustomerInfo, BillingCustomerRecord, BillingDisputeInfo, BillingEvent, BillingEventClaim, BillingEventHandler, BillingEventResult, BillingInvoiceInfo, BillingOffer, BillingOfferInterval, BillingPaymentInfo, BillingPreferences, BillingProvider, BillingRefundInfo, BillingSubscriptionInfo, BillingSubscriptionChange, BillingSubscriptionChangeInput, BillingSubscriptionOfferContext, BillingSubscriptionChangeState, BillingSubscriptionState, BillingSubscriptionStatus, EntitlementMode, ProviderRef, SubscriptionGrant, } from "./billing/index.js";
22
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,cAAc,EACd,UAAU,GACX,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGvF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA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B,0BAA0B,EAC1B,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,8BAA8B,EAC9B,+BAA+B,EAC/B,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,eAAe,EACf,WAAW,EACX,iBAAiB,GAClB,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,16 +1,18 @@
1
1
  export { PricingEngine } from "./engine.js";
2
- export { resolveAllowanceWindow, resolveCalendarWindow } from "./allowance.js";
3
2
  export { makeCostBreakdown } from "./breakdown.js";
4
- export { loadConfigFromDict } from "./config.js";
5
- export { CapabilityNotSupportedError, CapReachedError, ConcurrencyLimitError, ConfigError, ExpressionError, FeatureLimitReachedError, FeatureNotEntitledError, ImportError, InsufficientCreditsError, LeaseExpiredError, LeaseNotFoundError, PricingNotLoadedError, RefundError, StoreError, } from "./errors.js";
3
+ export { loadConfigFromDict, canonicalBursarConfigDict } from "./config.js";
4
+ export { projectPublicCatalog } from "./catalog.js";
5
+ export { BursarError, CapabilityNotSupportedError, CapReachedError, ConcurrencyLimitError, CreditError, ConfigError, ExpressionError, FeatureNotEntitledError, ImportError, InsufficientCreditsError, LeaseExpiredError, LeaseNotFoundError, OperationNotAllowedError, PricingNotLoadedError, RefundError, QuotaExceededError, StoreError, bursarErrorHttpStatus, bursarErrorPublicMessage, isRetryableBursarError, } from "./errors.js";
6
+ export { retryBursarOperation } from "./retry.js";
6
7
  export { validateExpression, evaluateExpression } from "./expr.js";
7
- // Manager
8
- export { CreditManager } from "./manager.js";
8
+ // Application facade. Credit/billing orchestration is internal to Bursar.
9
+ export { AccountService, Bursar, CatalogService } from "./bursar.js";
10
+ export * from "./commerce/index.js";
9
11
  // Stores
10
- export { CreditStore } from "./stores/credit-store.js";
11
- export { HttpxSupabaseStore } from "./stores/supabase-store.js";
12
- export { PostgresStore } from "./stores/postgres-store.js";
13
- export { CreditEventEmitter } from "./stores/events.js";
12
+ export { CreditStore } from "./credits/store.js";
13
+ export { PostgresStore } from "./credits/postgres/store.js";
14
+ export { CreditEventEmitter } from "./credits/events.js";
14
15
  // Billing
15
- export { BillingStore, MemoryBillingStore, PostgresBillingStore, SupabaseBillingStore, BillingManager, } from "./billing/index.js";
16
+ export { BillingStore, PostgresBillingStore } from "./billing/index.js";
17
+ export { AUTO_RECHARGE_STATES, BillingEventType } from "./billing/index.js";
16
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEnE,UAAU;AACV,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AA6D7C,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM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,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"load-pricing-file.d.ts","sourceRoot":"","sources":["../src/load-pricing-file.ts"],"names":[],"mappings":"AAgEA;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2BxF"}
1
+ {"version":3,"file":"load-pricing-file.d.ts","sourceRoot":"","sources":["../src/load-pricing-file.ts"],"names":[],"mappings":"AAkEA;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA2BxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"load-pricing-file.js","sourceRoot":"","sources":["../src/load-pricing-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAOvD;;;;;GAKG;AACH,SAAS,YAAY,CAAC,GAAY;IAChC,MAAM,SAAS,GAAG,GAAuD,CAAC;IAC1E,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACzC,OAAO,SAAuB,CAAC;IACjC,CAAC;IACD,IAAI,SAAS,CAAC,OAAO,IAAI,OAAO,SAAS,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACtE,OAAO,SAAS,CAAC,OAAqB,CAAC;IACzC,CAAC;IACD,MAAM,IAAI,WAAW,CAAC,4DAA4D,CAAC,CAAC;AACtF,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,QAAgB;IACrC,IAAI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AAE,KAAK,EAAE,CAAC,CAAC;QAC3F,CAAC;QACD,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,MAAe,CAAC;QACpB,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,WAAW,CAAC,mBAAmB,QAAQ,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CAAC,mBAAmB,QAAQ,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC"}
package/dist/metrics.d.ts CHANGED
@@ -1,19 +1,9 @@
1
- /** A single tool invocation recorded during an agent step. */
2
- export interface ToolCall {
3
- name: string;
4
- }
5
- /** Raw usage counters collected across one or more agent steps. */
1
+ import type Decimal from "decimal.js";
2
+ /** One provider-neutral billable operation. */
6
3
  export interface UsageMetrics {
7
- model?: string | null;
8
- inputTokens?: number;
9
- outputTokens?: number;
10
- cacheReadTokens?: number;
11
- cacheWriteTokens?: number;
12
- toolCalls?: ToolCall[];
13
- searchQueries?: number;
14
- searchResults?: number;
15
- webSearchCalls?: number;
16
- codeExecCalls?: number;
17
- fixedJob?: string | null;
4
+ operation: string;
5
+ measures?: Record<string, number | string>;
6
+ dimensions?: Record<string, string | number | boolean | Decimal.Value>;
7
+ metadata?: Record<string, unknown>;
18
8
  }
19
9
  //# sourceMappingURL=metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAEtC,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
package/dist/node.d.ts CHANGED
@@ -6,10 +6,17 @@
6
6
  * ``@zonastery/bursar/node`` subpath when you need Node-specific behaviour:
7
7
  *
8
8
  * ```ts
9
- * import { MemoryStore } from "@zonastery/bursar/node";
10
9
  * import { loadPricingFile } from "@zonastery/bursar/node";
11
10
  * ```
12
11
  */
13
- export { MemoryStore } from "./stores/memory-store.js";
14
12
  export { loadPricingFile } from "./load-pricing-file.js";
13
+ export { BursarRuntime, createBursarRuntime } from "./storage/runtime.js";
14
+ export type { BursarRuntimeHealth, BursarRuntimeOptions, BursarRuntimeStartOptions, } from "./storage/runtime.js";
15
+ export { OutboxWorker } from "./storage/outbox-worker.js";
16
+ export type { OutboxRunResult, OutboxWorkerOptions } from "./storage/outbox-worker.js";
17
+ export { ClickHouseUsageStore } from "./storage/adapters/clickhouse.js";
18
+ export type { ClickHouseClient, ClickHouseQueryResult, ClickHouseUsageStoreOptions, } from "./storage/adapters/clickhouse.js";
19
+ export { S3BillingArchive } from "./storage/adapters/s3.js";
20
+ export type { S3BillingArchiveOptions, S3Credentials } from "./storage/adapters/s3.js";
21
+ export type { BillingEventPayloadExport, BillingPayloadArchive, BillingPayloadArchiveResult, OutboxEvent, OutboxHandler, OutboxStore, UsageChargeExport, UsageEventSink, } from "./storage/ports.js";
15
22
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,YAAY,EACV,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACvF,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,WAAW,EACX,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,MAAM,oBAAoB,CAAC"}
package/dist/node.js CHANGED
@@ -6,10 +6,14 @@
6
6
  * ``@zonastery/bursar/node`` subpath when you need Node-specific behaviour:
7
7
  *
8
8
  * ```ts
9
- * import { MemoryStore } from "@zonastery/bursar/node";
10
9
  * import { loadPricingFile } from "@zonastery/bursar/node";
11
10
  * ```
12
11
  */
13
- export { MemoryStore } from "./stores/memory-store.js";
14
12
  export { loadPricingFile } from "./load-pricing-file.js";
13
+ // Optional high-volume storage infrastructure. These adapters are Node-only;
14
+ // the main package remains the PostgreSQL-first application API.
15
+ export { BursarRuntime, createBursarRuntime } from "./storage/runtime.js";
16
+ export { OutboxWorker } from "./storage/outbox-worker.js";
17
+ export { ClickHouseUsageStore } from "./storage/adapters/clickhouse.js";
18
+ export { S3BillingArchive } from "./storage/adapters/s3.js";
15
19
  //# sourceMappingURL=node.js.map
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,6EAA6E;AAC7E,iEAAiE;AACjE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAM1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { BillingEvent, BillingEventResult } from "../billing/index.js";
2
+ import type { BillingEventSink } from "../bursar.js";
3
+ /**
4
+ * Wrapper around the facade event sink that throws on unhandled results (except
5
+ * "unhandled_event_type" which is a permanent no-op). Ensures the provider
6
+ * receives a retryable signal when the event could not be processed.
7
+ */
8
+ export declare function callBillingEventSink(sink: BillingEventSink, event: BillingEvent): Promise<BillingEventResult>;
9
+ //# sourceMappingURL=_shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/providers/_shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAQrD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,kBAAkB,CAAC,CAgB7B"}
@@ -0,0 +1,25 @@
1
+ const BUSY_RETRY_DELAYS_MS = [25, 50, 100, 200, 400, 800];
2
+ function delay(milliseconds) {
3
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
4
+ }
5
+ /**
6
+ * Wrapper around the facade event sink that throws on unhandled results (except
7
+ * "unhandled_event_type" which is a permanent no-op). Ensures the provider
8
+ * receives a retryable signal when the event could not be processed.
9
+ */
10
+ export async function callBillingEventSink(sink, event) {
11
+ for (let attempt = 0;; attempt += 1) {
12
+ const result = await sink.ingestBillingEvent(event);
13
+ if (result.error === "claim_busy" && attempt < BUSY_RETRY_DELAYS_MS.length) {
14
+ await delay(BUSY_RETRY_DELAYS_MS[attempt]);
15
+ continue;
16
+ }
17
+ if (!result.handled &&
18
+ result.error !== "unhandled_event_type" &&
19
+ result.error !== "user_not_found") {
20
+ throw new Error(`Bursar failed to ingest billing event: ${result.error}`);
21
+ }
22
+ return result;
23
+ }
24
+ }
25
+ //# sourceMappingURL=_shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../src/providers/_shared.ts"],"names":[],"mappings":"AAGA,MAAM,oBAAoB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE1D,SAAS,KAAK,CAAC,YAAoB;IACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAsB,EACtB,KAAmB;IAEnB,KAAK,IAAI,OAAO,GAAG,CAAC,GAAI,OAAO,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,IAAI,OAAO,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC;YAC3E,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3C,SAAS;QACX,CAAC;QACD,IACE,CAAC,MAAM,CAAC,OAAO;YACf,MAAM,CAAC,KAAK,KAAK,sBAAsB;YACvC,MAAM,CAAC,KAAK,KAAK,gBAAgB,EACjC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -0,0 +1,106 @@
1
+ import type DodoPayments from "dodopayments";
2
+ import type { CheckoutPaymentStatus } from "../types.js";
3
+ /**
4
+ * The public Dodo SDK surface used by Bursar.
5
+ *
6
+ * This structural boundary prevents compatible Dodo SDK installations from
7
+ * becoming nominally incompatible through private class and APIPromise fields.
8
+ */
9
+ interface DodoCheckoutSession {
10
+ checkout_url?: string | null;
11
+ payment_id?: string | null;
12
+ payment_status?: CheckoutPaymentStatus;
13
+ session_id?: string;
14
+ }
15
+ interface DodoCheckoutPreview {
16
+ current_breakup: {
17
+ total_amount: number;
18
+ tax?: number | null;
19
+ };
20
+ currency: string;
21
+ }
22
+ interface DodoPayment {
23
+ payment_id: string;
24
+ status?: string | null;
25
+ total_amount: number;
26
+ currency: string;
27
+ payment_link?: string | null;
28
+ }
29
+ interface DodoPlanChangePreview {
30
+ immediate_charge: {
31
+ effective_at: string;
32
+ line_items: Array<{
33
+ type: string;
34
+ product_id?: string;
35
+ name?: string | null;
36
+ description?: string | null;
37
+ unit_price?: number;
38
+ quantity?: number;
39
+ proration_factor?: number;
40
+ currency?: string;
41
+ tax?: number | null;
42
+ }>;
43
+ summary: {
44
+ total_amount: number;
45
+ settlement_amount: number;
46
+ settlement_currency: string;
47
+ settlement_tax?: number | null;
48
+ tax?: number | null;
49
+ customer_credits: number;
50
+ };
51
+ };
52
+ new_plan?: {
53
+ recurring_pre_tax_amount?: number | null;
54
+ currency?: string | null;
55
+ next_billing_date?: string | null;
56
+ } | null;
57
+ }
58
+ export interface DodoClient {
59
+ checkoutSessions: {
60
+ create(body: Parameters<DodoPayments["checkoutSessions"]["create"]>[0], options?: {
61
+ idempotencyKey?: string;
62
+ }): Promise<DodoCheckoutSession>;
63
+ preview(body: Parameters<DodoPayments["checkoutSessions"]["preview"]>[0]): Promise<DodoCheckoutPreview>;
64
+ retrieve(sessionId: Parameters<DodoPayments["checkoutSessions"]["retrieve"]>[0]): Promise<DodoCheckoutSession>;
65
+ };
66
+ customers: {
67
+ create(body: Parameters<DodoPayments["customers"]["create"]>[0]): Promise<{
68
+ customer_id: string;
69
+ }>;
70
+ customerPortal: {
71
+ create(customerId: Parameters<DodoPayments["customers"]["customerPortal"]["create"]>[0], body: Parameters<DodoPayments["customers"]["customerPortal"]["create"]>[1]): Promise<{
72
+ link: string;
73
+ }>;
74
+ };
75
+ retrievePaymentMethods(customerId: Parameters<DodoPayments["customers"]["retrievePaymentMethods"]>[0]): Promise<{
76
+ items: Array<{
77
+ payment_method?: string | null;
78
+ payment_method_id: string;
79
+ recurring_enabled?: boolean | null;
80
+ card?: {
81
+ last4_digits?: string | null;
82
+ card_network?: string | null;
83
+ expiry_month?: string | null;
84
+ expiry_year?: string | null;
85
+ } | null;
86
+ }>;
87
+ }>;
88
+ };
89
+ payments: {
90
+ retrieve(paymentId: Parameters<DodoPayments["payments"]["retrieve"]>[0]): Promise<DodoPayment>;
91
+ };
92
+ subscriptions: {
93
+ cancelChangePlan(subscriptionId: Parameters<DodoPayments["subscriptions"]["cancelChangePlan"]>[0], options?: {
94
+ idempotencyKey?: string;
95
+ }): Promise<unknown>;
96
+ changePlan(subscriptionId: Parameters<DodoPayments["subscriptions"]["changePlan"]>[0], body: Parameters<DodoPayments["subscriptions"]["changePlan"]>[1], options?: {
97
+ idempotencyKey?: string;
98
+ }): Promise<unknown>;
99
+ previewChangePlan(subscriptionId: Parameters<DodoPayments["subscriptions"]["previewChangePlan"]>[0], body: Parameters<DodoPayments["subscriptions"]["previewChangePlan"]>[1]): Promise<DodoPlanChangePreview>;
100
+ update(subscriptionId: Parameters<DodoPayments["subscriptions"]["update"]>[0], body: Parameters<DodoPayments["subscriptions"]["update"]>[1], options?: {
101
+ idempotencyKey?: string;
102
+ }): Promise<unknown>;
103
+ };
104
+ }
105
+ export {};
106
+ //# sourceMappingURL=client-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-contract.d.ts","sourceRoot":"","sources":["../../../src/providers/dodo/client-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD;;;;;GAKG;AACH,UAAU,mBAAmB;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,mBAAmB;IAC3B,eAAe,EAAE;QACf,YAAY,EAAE,MAAM,CAAC;QACrB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,UAAU,qBAAqB;IAC7B,gBAAgB,EAAE;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,KAAK,CAAC;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YACrB,WAAW,CAAC,EAAE,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CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-contract.js","sourceRoot":"","sources":["../../../src/providers/dodo/client-contract.ts"],"names":[],"mappings":""}
@@ -1,4 +1,6 @@
1
- import type { BillingManager } from "../../billing/index.js";
2
- import type { ProviderLogger } from "../types.js";
3
- export declare function handleDodoBillingEvent(type: string, data: Record<string, unknown>, userId: string | null, metadata: Record<string, string>, bm: BillingManager, logger?: ProviderLogger): Promise<void>;
1
+ import type { BillingEventSink } from "../../bursar.js";
2
+ import { type ProviderLogger } from "../types.js";
3
+ /** Dodo sometimes sends dates in JS toString() format (e.g. "Sat Jul 18 2026 05:15:24 GMT+0000..."). Normalize to ISO 8601. */
4
+ export declare function normalizeDate(raw: unknown): string | null;
5
+ export declare function handleDodoBillingEvent(type: string, data: Record<string, unknown>, userId: string | null, metadata: Record<string, string>, sink: BillingEventSink, logger?: ProviderLogger | null): Promise<void>;
4
6
  //# sourceMappingURL=event-mapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-mapper.d.ts","sourceRoot":"","sources":["../../../src/providers/dodo/event-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA6B,MAAM,wBAAwB,CAAC;AAExF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,EAAE,EAAE,cAAc,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CAgLf"}
1
+ {"version":3,"file":"event-mapper.d.ts","sourceRoot":"","sources":["../../../src/providers/dodo/event-mapper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMxD,OAAO,EAAE,KAAK,cAAc,EAA2B,MAAM,aAAa,CAAC;AAmB3E,+HAA+H;AAC/H,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOzD;AAyBD,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,IAAI,EAAE,gBAAgB,EACtB,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqTf"}