@zonastery/bursar 2.0.6 → 2.2.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 (379) hide show
  1. package/README.md +33 -4
  2. package/dist/billing/auto-recharge-port.d.ts +11 -0
  3. package/dist/billing/auto-recharge-port.d.ts.map +1 -1
  4. package/dist/billing/auto-recharge-port.js.map +1 -1
  5. package/dist/billing/auto-recharge-service.d.ts.map +1 -1
  6. package/dist/billing/auto-recharge-service.js +53 -26
  7. package/dist/billing/auto-recharge-service.js.map +1 -1
  8. package/dist/billing/billing-service.d.ts +38 -3
  9. package/dist/billing/billing-service.d.ts.map +1 -1
  10. package/dist/billing/billing-service.js +51 -7
  11. package/dist/billing/billing-service.js.map +1 -1
  12. package/dist/billing/billing-store.d.ts +34 -9
  13. package/dist/billing/billing-store.d.ts.map +1 -1
  14. package/dist/billing/billing-store.js +2 -0
  15. package/dist/billing/billing-store.js.map +1 -1
  16. package/dist/billing/contracts.d.ts +35 -3
  17. package/dist/billing/contracts.d.ts.map +1 -1
  18. package/dist/billing/contracts.js.map +1 -1
  19. package/dist/billing/event-handlers.d.ts +1 -2
  20. package/dist/billing/event-handlers.d.ts.map +1 -1
  21. package/dist/billing/event-handlers.js +69 -29
  22. package/dist/billing/event-handlers.js.map +1 -1
  23. package/dist/billing/event-processor.d.ts +2 -2
  24. package/dist/billing/event-processor.d.ts.map +1 -1
  25. package/dist/billing/event-processor.js +82 -19
  26. package/dist/billing/event-processor.js.map +1 -1
  27. package/dist/billing/financial-event-handlers.d.ts +2 -0
  28. package/dist/billing/financial-event-handlers.d.ts.map +1 -1
  29. package/dist/billing/financial-event-handlers.js +168 -44
  30. package/dist/billing/financial-event-handlers.js.map +1 -1
  31. package/dist/billing/index.d.ts +1 -1
  32. package/dist/billing/index.d.ts.map +1 -1
  33. package/dist/billing/index.js.map +1 -1
  34. package/dist/billing/management.d.ts +16 -3
  35. package/dist/billing/management.d.ts.map +1 -1
  36. package/dist/billing/management.js +11 -2
  37. package/dist/billing/management.js.map +1 -1
  38. package/dist/billing/postgres/repositories/auto-recharge.d.ts +13 -1
  39. package/dist/billing/postgres/repositories/auto-recharge.d.ts.map +1 -1
  40. package/dist/billing/postgres/repositories/auto-recharge.js +71 -12
  41. package/dist/billing/postgres/repositories/auto-recharge.js.map +1 -1
  42. package/dist/billing/postgres/repositories/invoice.d.ts +3 -2
  43. package/dist/billing/postgres/repositories/invoice.d.ts.map +1 -1
  44. package/dist/billing/postgres/repositories/invoice.js +33 -3
  45. package/dist/billing/postgres/repositories/invoice.js.map +1 -1
  46. package/dist/billing/postgres/repositories/offer.d.ts +5 -1
  47. package/dist/billing/postgres/repositories/offer.d.ts.map +1 -1
  48. package/dist/billing/postgres/repositories/offer.js +7 -10
  49. package/dist/billing/postgres/repositories/offer.js.map +1 -1
  50. package/dist/billing/postgres/repositories/payment.d.ts +6 -1
  51. package/dist/billing/postgres/repositories/payment.d.ts.map +1 -1
  52. package/dist/billing/postgres/repositories/payment.js +25 -16
  53. package/dist/billing/postgres/repositories/payment.js.map +1 -1
  54. package/dist/billing/postgres/repositories/subscription-change.d.ts +1 -0
  55. package/dist/billing/postgres/repositories/subscription-change.d.ts.map +1 -1
  56. package/dist/billing/postgres/repositories/subscription-change.js +25 -4
  57. package/dist/billing/postgres/repositories/subscription-change.js.map +1 -1
  58. package/dist/billing/postgres/repositories/subscription.d.ts +3 -2
  59. package/dist/billing/postgres/repositories/subscription.d.ts.map +1 -1
  60. package/dist/billing/postgres/repositories/subscription.js +44 -48
  61. package/dist/billing/postgres/repositories/subscription.js.map +1 -1
  62. package/dist/billing/postgres/repositories/topup.d.ts +6 -1
  63. package/dist/billing/postgres/repositories/topup.d.ts.map +1 -1
  64. package/dist/billing/postgres/repositories/topup.js +27 -10
  65. package/dist/billing/postgres/repositories/topup.js.map +1 -1
  66. package/dist/billing/postgres/store.d.ts +46 -34
  67. package/dist/billing/postgres/store.d.ts.map +1 -1
  68. package/dist/billing/postgres/store.js +152 -126
  69. package/dist/billing/postgres/store.js.map +1 -1
  70. package/dist/billing/service-types.d.ts +0 -1
  71. package/dist/billing/service-types.d.ts.map +1 -1
  72. package/dist/billing/service-types.js.map +1 -1
  73. package/dist/billing/types/auto-recharge.d.ts +2 -0
  74. package/dist/billing/types/auto-recharge.d.ts.map +1 -1
  75. package/dist/billing/types/auto-recharge.js.map +1 -1
  76. package/dist/billing/types/catalog.d.ts +1 -0
  77. package/dist/billing/types/catalog.d.ts.map +1 -1
  78. package/dist/billing/types/catalog.js.map +1 -1
  79. package/dist/billing/types/documents.d.ts +15 -1
  80. package/dist/billing/types/documents.d.ts.map +1 -1
  81. package/dist/billing/types/documents.js.map +1 -1
  82. package/dist/billing/types/events.d.ts +2 -0
  83. package/dist/billing/types/events.d.ts.map +1 -1
  84. package/dist/billing/types/events.js +15 -0
  85. package/dist/billing/types/events.js.map +1 -1
  86. package/dist/billing/types/subscriptions.d.ts +12 -0
  87. package/dist/billing/types/subscriptions.d.ts.map +1 -1
  88. package/dist/billing/types/subscriptions.js.map +1 -1
  89. package/dist/breakdown.d.ts +2 -24
  90. package/dist/breakdown.d.ts.map +1 -1
  91. package/dist/breakdown.js +1 -29
  92. package/dist/breakdown.js.map +1 -1
  93. package/dist/bursar.d.ts +13 -21
  94. package/dist/bursar.d.ts.map +1 -1
  95. package/dist/bursar.js +44 -50
  96. package/dist/bursar.js.map +1 -1
  97. package/dist/catalog.d.ts +21 -2
  98. package/dist/catalog.d.ts.map +1 -1
  99. package/dist/catalog.js +27 -4
  100. package/dist/catalog.js.map +1 -1
  101. package/dist/cli.d.ts +3 -0
  102. package/dist/cli.d.ts.map +1 -0
  103. package/dist/cli.js +147 -0
  104. package/dist/cli.js.map +1 -0
  105. package/dist/commerce/plan-change.d.ts +3 -3
  106. package/dist/commerce/plan-change.d.ts.map +1 -1
  107. package/dist/commerce/plan-change.js +14 -7
  108. package/dist/commerce/plan-change.js.map +1 -1
  109. package/dist/commerce/provider-registry.d.ts.map +1 -1
  110. package/dist/commerce/provider-registry.js +8 -2
  111. package/dist/commerce/provider-registry.js.map +1 -1
  112. package/dist/commerce/service.d.ts +2 -0
  113. package/dist/commerce/service.d.ts.map +1 -1
  114. package/dist/commerce/service.js +330 -76
  115. package/dist/commerce/service.js.map +1 -1
  116. package/dist/commerce/types.d.ts +12 -3
  117. package/dist/commerce/types.d.ts.map +1 -1
  118. package/dist/commerce/types.js.map +1 -1
  119. package/dist/config/availability.d.ts +4 -0
  120. package/dist/config/availability.d.ts.map +1 -0
  121. package/dist/config/availability.js +10 -0
  122. package/dist/config/availability.js.map +1 -0
  123. package/dist/config/normalize.d.ts +7 -0
  124. package/dist/config/normalize.d.ts.map +1 -0
  125. package/dist/config/normalize.js +119 -0
  126. package/dist/config/normalize.js.map +1 -0
  127. package/dist/config/parse-access.d.ts.map +1 -1
  128. package/dist/config/parse-access.js +4 -1
  129. package/dist/config/parse-access.js.map +1 -1
  130. package/dist/config/parse-commerce.d.ts +5 -1
  131. package/dist/config/parse-commerce.d.ts.map +1 -1
  132. package/dist/config/parse-commerce.js +79 -22
  133. package/dist/config/parse-commerce.js.map +1 -1
  134. package/dist/config/parse-credits.d.ts.map +1 -1
  135. package/dist/config/parse-credits.js +10 -7
  136. package/dist/config/parse-credits.js.map +1 -1
  137. package/dist/config/parse-plans.d.ts.map +1 -1
  138. package/dist/config/parse-plans.js +31 -15
  139. package/dist/config/parse-plans.js.map +1 -1
  140. package/dist/config/parse-pricing.d.ts.map +1 -1
  141. package/dist/config/parse-pricing.js +42 -27
  142. package/dist/config/parse-pricing.js.map +1 -1
  143. package/dist/config/parse-utils.d.ts +4 -0
  144. package/dist/config/parse-utils.d.ts.map +1 -1
  145. package/dist/config/parse-utils.js +26 -1
  146. package/dist/config/parse-utils.js.map +1 -1
  147. package/dist/config/types.d.ts +8 -4
  148. package/dist/config/types.d.ts.map +1 -1
  149. package/dist/config/types.js.map +1 -1
  150. package/dist/config.d.ts +5 -4
  151. package/dist/config.d.ts.map +1 -1
  152. package/dist/config.js +118 -70
  153. package/dist/config.js.map +1 -1
  154. package/dist/credits/amount.d.ts.map +1 -1
  155. package/dist/credits/amount.js +5 -4
  156. package/dist/credits/amount.js.map +1 -1
  157. package/dist/credits/catalog-runtime.d.ts +15 -2
  158. package/dist/credits/catalog-runtime.d.ts.map +1 -1
  159. package/dist/credits/catalog-runtime.js +77 -21
  160. package/dist/credits/catalog-runtime.js.map +1 -1
  161. package/dist/credits/lease-workflow.d.ts +3 -1
  162. package/dist/credits/lease-workflow.d.ts.map +1 -1
  163. package/dist/credits/lease-workflow.js +47 -38
  164. package/dist/credits/lease-workflow.js.map +1 -1
  165. package/dist/credits/low-balance-monitor.d.ts +2 -7
  166. package/dist/credits/low-balance-monitor.d.ts.map +1 -1
  167. package/dist/credits/low-balance-monitor.js +6 -57
  168. package/dist/credits/low-balance-monitor.js.map +1 -1
  169. package/dist/credits/postgres/repositories/analytics.d.ts +3 -3
  170. package/dist/credits/postgres/repositories/analytics.d.ts.map +1 -1
  171. package/dist/credits/postgres/repositories/analytics.js +25 -7
  172. package/dist/credits/postgres/repositories/analytics.js.map +1 -1
  173. package/dist/credits/postgres/repositories/balance.d.ts +28 -0
  174. package/dist/credits/postgres/repositories/balance.d.ts.map +1 -1
  175. package/dist/credits/postgres/repositories/balance.js +33 -14
  176. package/dist/credits/postgres/repositories/balance.js.map +1 -1
  177. package/dist/credits/postgres/repositories/bucket.d.ts.map +1 -1
  178. package/dist/credits/postgres/repositories/bucket.js +2 -2
  179. package/dist/credits/postgres/repositories/bucket.js.map +1 -1
  180. package/dist/credits/postgres/repositories/catalog.d.ts +2 -2
  181. package/dist/credits/postgres/repositories/catalog.d.ts.map +1 -1
  182. package/dist/credits/postgres/repositories/catalog.js +2 -12
  183. package/dist/credits/postgres/repositories/catalog.js.map +1 -1
  184. package/dist/credits/postgres/repositories/deduction.d.ts +2 -0
  185. package/dist/credits/postgres/repositories/deduction.d.ts.map +1 -1
  186. package/dist/credits/postgres/repositories/deduction.js +9 -2
  187. package/dist/credits/postgres/repositories/deduction.js.map +1 -1
  188. package/dist/credits/postgres/repositories/lease.d.ts +3 -0
  189. package/dist/credits/postgres/repositories/lease.d.ts.map +1 -1
  190. package/dist/credits/postgres/repositories/lease.js +46 -12
  191. package/dist/credits/postgres/repositories/lease.js.map +1 -1
  192. package/dist/credits/postgres/repositories/plan.d.ts +6 -1
  193. package/dist/credits/postgres/repositories/plan.d.ts.map +1 -1
  194. package/dist/credits/postgres/repositories/plan.js +13 -3
  195. package/dist/credits/postgres/repositories/plan.js.map +1 -1
  196. package/dist/credits/postgres/repositories/team.d.ts +1 -1
  197. package/dist/credits/postgres/repositories/team.d.ts.map +1 -1
  198. package/dist/credits/postgres/repositories/team.js +9 -5
  199. package/dist/credits/postgres/repositories/team.js.map +1 -1
  200. package/dist/credits/postgres/store.d.ts +30 -20
  201. package/dist/credits/postgres/store.d.ts.map +1 -1
  202. package/dist/credits/postgres/store.js +335 -251
  203. package/dist/credits/postgres/store.js.map +1 -1
  204. package/dist/credits/postgres/value-mappers.d.ts.map +1 -1
  205. package/dist/credits/postgres/value-mappers.js +4 -4
  206. package/dist/credits/postgres/value-mappers.js.map +1 -1
  207. package/dist/credits/rated-wire.d.ts +7 -0
  208. package/dist/credits/rated-wire.d.ts.map +1 -0
  209. package/dist/credits/rated-wire.js +70 -0
  210. package/dist/credits/rated-wire.js.map +1 -0
  211. package/dist/credits/service-errors.d.ts.map +1 -1
  212. package/dist/credits/service-errors.js +8 -1
  213. package/dist/credits/service-errors.js.map +1 -1
  214. package/dist/credits/service-types.d.ts +5 -7
  215. package/dist/credits/service-types.d.ts.map +1 -1
  216. package/dist/credits/service-types.js.map +1 -1
  217. package/dist/credits/service.d.ts +12 -9
  218. package/dist/credits/service.d.ts.map +1 -1
  219. package/dist/credits/service.js +161 -138
  220. package/dist/credits/service.js.map +1 -1
  221. package/dist/credits/store.d.ts +11 -3
  222. package/dist/credits/store.d.ts.map +1 -1
  223. package/dist/credits/store.js +9 -0
  224. package/dist/credits/store.js.map +1 -1
  225. package/dist/credits/types/account.d.ts +9 -1
  226. package/dist/credits/types/account.d.ts.map +1 -1
  227. package/dist/credits/types/account.js.map +1 -1
  228. package/dist/credits/types/admission.d.ts +1 -0
  229. package/dist/credits/types/admission.d.ts.map +1 -1
  230. package/dist/credits/types/admission.js.map +1 -1
  231. package/dist/credits/types/catalog.d.ts +1 -0
  232. package/dist/credits/types/catalog.d.ts.map +1 -1
  233. package/dist/credits/types/catalog.js.map +1 -1
  234. package/dist/credits/types/grants.d.ts +12 -0
  235. package/dist/credits/types/grants.d.ts.map +1 -1
  236. package/dist/credits/types/grants.js.map +1 -1
  237. package/dist/credits/types/ledger.d.ts +13 -0
  238. package/dist/credits/types/ledger.d.ts.map +1 -1
  239. package/dist/credits/types/ledger.js.map +1 -1
  240. package/dist/credits/types/quotas.d.ts +2 -1
  241. package/dist/credits/types/quotas.d.ts.map +1 -1
  242. package/dist/credits/types/quotas.js.map +1 -1
  243. package/dist/engine.d.ts +4 -1
  244. package/dist/engine.d.ts.map +1 -1
  245. package/dist/engine.js +59 -36
  246. package/dist/engine.js.map +1 -1
  247. package/dist/errors.d.ts +12 -1
  248. package/dist/errors.d.ts.map +1 -1
  249. package/dist/errors.js +13 -0
  250. package/dist/errors.js.map +1 -1
  251. package/dist/expr/evaluator.d.ts.map +1 -1
  252. package/dist/expr/evaluator.js +29 -9
  253. package/dist/expr/evaluator.js.map +1 -1
  254. package/dist/expr/language.js +1 -1
  255. package/dist/expr/language.js.map +1 -1
  256. package/dist/expr.d.ts.map +1 -1
  257. package/dist/expr.js +5 -6
  258. package/dist/expr.js.map +1 -1
  259. package/dist/generated/pricing-config.schema.json +272 -228
  260. package/dist/generated/pricing-config.types.d.ts +128 -79
  261. package/dist/generated/pricing-config.types.d.ts.map +1 -1
  262. package/dist/generated/pricing-config.types.js.map +1 -1
  263. package/dist/index.d.ts +8 -6
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js +4 -2
  266. package/dist/index.js.map +1 -1
  267. package/dist/load-config-file.d.ts +5 -1
  268. package/dist/load-config-file.d.ts.map +1 -1
  269. package/dist/load-config-file.js +56 -17
  270. package/dist/load-config-file.js.map +1 -1
  271. package/dist/metrics.d.ts +1 -1
  272. package/dist/metrics.d.ts.map +1 -1
  273. package/dist/metrics.js.map +1 -1
  274. package/dist/node.d.ts +2 -2
  275. package/dist/node.d.ts.map +1 -1
  276. package/dist/node.js +1 -1
  277. package/dist/node.js.map +1 -1
  278. package/dist/pricing-decimal.d.ts +7 -0
  279. package/dist/pricing-decimal.d.ts.map +1 -0
  280. package/dist/pricing-decimal.js +43 -0
  281. package/dist/pricing-decimal.js.map +1 -0
  282. package/dist/providers/dodo/better-auth-core.d.ts +1 -1
  283. package/dist/providers/dodo/better-auth-core.d.ts.map +1 -1
  284. package/dist/providers/dodo/better-auth-core.js +2 -2
  285. package/dist/providers/dodo/better-auth-core.js.map +1 -1
  286. package/dist/providers/dodo/better-auth.d.ts.map +1 -1
  287. package/dist/providers/dodo/better-auth.js +16 -2
  288. package/dist/providers/dodo/better-auth.js.map +1 -1
  289. package/dist/providers/dodo/event-mapper.d.ts +1 -1
  290. package/dist/providers/dodo/event-mapper.d.ts.map +1 -1
  291. package/dist/providers/dodo/event-mapper.js +124 -18
  292. package/dist/providers/dodo/event-mapper.js.map +1 -1
  293. package/dist/providers/dodo/nextjs-core.d.ts +1 -1
  294. package/dist/providers/dodo/nextjs-core.d.ts.map +1 -1
  295. package/dist/providers/dodo/nextjs-core.js +2 -2
  296. package/dist/providers/dodo/nextjs-core.js.map +1 -1
  297. package/dist/providers/dodo/nextjs.d.ts.map +1 -1
  298. package/dist/providers/dodo/nextjs.js +16 -6
  299. package/dist/providers/dodo/nextjs.js.map +1 -1
  300. package/dist/providers/dodo/provider.d.ts +5 -2
  301. package/dist/providers/dodo/provider.d.ts.map +1 -1
  302. package/dist/providers/dodo/provider.js +46 -7
  303. package/dist/providers/dodo/provider.js.map +1 -1
  304. package/dist/providers/dodo/verified-payment-payload.d.ts +6 -0
  305. package/dist/providers/dodo/verified-payment-payload.d.ts.map +1 -0
  306. package/dist/providers/dodo/verified-payment-payload.js +42 -0
  307. package/dist/providers/dodo/verified-payment-payload.js.map +1 -0
  308. package/dist/providers/index.d.ts +1 -1
  309. package/dist/providers/index.d.ts.map +1 -1
  310. package/dist/providers/index.js.map +1 -1
  311. package/dist/providers/mock/provider.d.ts +4 -1
  312. package/dist/providers/mock/provider.d.ts.map +1 -1
  313. package/dist/providers/mock/provider.js +3 -1
  314. package/dist/providers/mock/provider.js.map +1 -1
  315. package/dist/providers/stripe/event-mapper.d.ts.map +1 -1
  316. package/dist/providers/stripe/event-mapper.js +51 -24
  317. package/dist/providers/stripe/event-mapper.js.map +1 -1
  318. package/dist/providers/stripe/provider.d.ts +4 -1
  319. package/dist/providers/stripe/provider.d.ts.map +1 -1
  320. package/dist/providers/stripe/provider.js +118 -34
  321. package/dist/providers/stripe/provider.js.map +1 -1
  322. package/dist/providers/types.d.ts +16 -2
  323. package/dist/providers/types.d.ts.map +1 -1
  324. package/dist/providers/types.js +9 -0
  325. package/dist/providers/types.js.map +1 -1
  326. package/dist/shared/postgres-client.d.ts +5 -0
  327. package/dist/shared/postgres-client.d.ts.map +1 -1
  328. package/dist/shared/postgres-client.js +72 -11
  329. package/dist/shared/postgres-client.js.map +1 -1
  330. package/dist/shared/postgres-errors.d.ts.map +1 -1
  331. package/dist/shared/postgres-errors.js +6 -0
  332. package/dist/shared/postgres-errors.js.map +1 -1
  333. package/dist/shared/provider-rejection.d.ts +3 -0
  334. package/dist/shared/provider-rejection.d.ts.map +1 -0
  335. package/dist/shared/provider-rejection.js +17 -0
  336. package/dist/shared/provider-rejection.js.map +1 -0
  337. package/dist/shared/timestamp.d.ts +5 -0
  338. package/dist/shared/timestamp.d.ts.map +1 -0
  339. package/dist/shared/timestamp.js +21 -0
  340. package/dist/shared/timestamp.js.map +1 -0
  341. package/dist/starter.yaml +17 -0
  342. package/dist/storage/adapters/clickhouse.d.ts +1 -1
  343. package/dist/storage/adapters/clickhouse.d.ts.map +1 -1
  344. package/dist/storage/adapters/clickhouse.js +42 -37
  345. package/dist/storage/adapters/clickhouse.js.map +1 -1
  346. package/dist/storage/adapters/s3.d.ts +5 -0
  347. package/dist/storage/adapters/s3.d.ts.map +1 -1
  348. package/dist/storage/adapters/s3.js +46 -14
  349. package/dist/storage/adapters/s3.js.map +1 -1
  350. package/dist/storage/diagnostics.d.ts +3 -7
  351. package/dist/storage/diagnostics.d.ts.map +1 -1
  352. package/dist/storage/diagnostics.js +6 -15
  353. package/dist/storage/diagnostics.js.map +1 -1
  354. package/dist/storage/outbox-worker.d.ts.map +1 -1
  355. package/dist/storage/outbox-worker.js +4 -3
  356. package/dist/storage/outbox-worker.js.map +1 -1
  357. package/dist/storage/ports.d.ts +8 -0
  358. package/dist/storage/ports.d.ts.map +1 -1
  359. package/dist/storage/ports.js.map +1 -1
  360. package/dist/storage/postgres-repository.d.ts +1 -3
  361. package/dist/storage/postgres-repository.d.ts.map +1 -1
  362. package/dist/storage/postgres-repository.js +34 -12
  363. package/dist/storage/postgres-repository.js.map +1 -1
  364. package/dist/storage/raw-json.d.ts +10 -0
  365. package/dist/storage/raw-json.d.ts.map +1 -0
  366. package/dist/storage/raw-json.js +19 -0
  367. package/dist/storage/raw-json.js.map +1 -0
  368. package/dist/storage/runtime.d.ts +15 -10
  369. package/dist/storage/runtime.d.ts.map +1 -1
  370. package/dist/storage/runtime.js +97 -68
  371. package/dist/storage/runtime.js.map +1 -1
  372. package/dist/telemetry/index.d.ts +1 -1
  373. package/dist/telemetry/index.js +1 -1
  374. package/dist/telemetry/index.js.map +1 -1
  375. package/package.json +78 -71
  376. package/dist/credits/queries.d.ts +0 -33
  377. package/dist/credits/queries.d.ts.map +0 -1
  378. package/dist/credits/queries.js +0 -71
  379. package/dist/credits/queries.js.map +0 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","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OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,UAAU;AACV,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { PricingEngine } from \"./engine.js\";\nexport type { CostBreakdown } from \"./breakdown.js\";\nexport { makeCostBreakdown } from \"./breakdown.js\";\nexport type { UsageMetrics } from \"./metrics.js\";\nexport type {\n BursarConfigData,\n CatalogRollout,\n ParsedBursarConfig,\n PricingConfig,\n CreditsConfig,\n PlanDefinition,\n PlanEvolution,\n PlanRollout,\n PlanRolloutStrategy,\n CommerceConfig,\n Window,\n Charge,\n FeatureDefinition,\n} from \"./config.js\";\nexport {\n canonicalBursarConfigDict,\n canonicalCatalogRolloutDict,\n loadCatalogRollout,\n loadConfigFromDict,\n validateCatalogRollout,\n} from \"./config.js\";\nexport { projectPublicCatalog } from \"./catalog.js\";\nexport type {\n PublicCatalog,\n PublicCatalogOffer,\n PublicCatalogPlan,\n PublicCatalogWindow,\n} from \"./catalog.js\";\nexport {\n AutoRechargeDisabledError,\n AutoRechargeNotConfiguredError,\n BillingError,\n BursarError,\n CapabilityNotConfiguredError,\n CapabilityNotSupportedError,\n CapReachedError,\n ConcurrencyLimitError,\n CreditError,\n ConfigError,\n ExpressionError,\n FeatureNotEntitledError,\n ImportError,\n InsufficientCreditsError,\n LeaseExpiredError,\n LeaseNotFoundError,\n OperationNotAllowedError,\n PaymentMethodRequiredError,\n ProviderCapabilityNotSupportedError,\n ProviderResponseError,\n CatalogNotLoadedError,\n RefundError,\n QuotaExceededError,\n StoreError,\n StoreClosedError,\n StoreTimeoutError,\n StoreUnavailableError,\n bursarErrorHttpStatus,\n bursarErrorPublicMessage,\n isBursarError,\n isRetryableBursarError,\n} from \"./errors.js\";\nexport type {\n BursarErrorCategory,\n BursarErrorDetails,\n BursarErrorOptions,\n SerializedBursarError,\n StoreErrorOptions,\n} from \"./errors.js\";\nexport { retryBursarOperation } from \"./retry.js\";\nexport type { BursarRetryOptions } from \"./retry.js\";\nexport { validateExpression, evaluateExpression } from \"./expr.js\";\nexport {\n BURSAR_INSTRUMENTATION_SCOPE,\n BURSAR_INSTRUMENTATION_VERSION,\n NOOP_INSTRUMENTATION,\n NoopInstrumentation,\n getDefaultInstrumentation,\n sanitizeTelemetryAttributes,\n setDefaultInstrumentation,\n telemetryErrorAttributes,\n telemetryOperationAttributes,\n} from \"./telemetry/index.js\";\nexport type {\n Instrumentation,\n TelemetryAttributes,\n TelemetryAttributeValue,\n} from \"./telemetry/index.js\";\n\n// Application facade. Credit/billing orchestration is internal to Bursar.\nexport { AccountService, Bursar, CatalogService } from \"./bursar.js\";\nexport type {\n AccountCreatedInput,\n AccountCreatedResult,\n BillingBursarOptions,\n BursarOptions,\n BillingCapability,\n BillingEventSink,\n CommerceOptions,\n CreditsService,\n CreditsOnlyBursarOptions,\n} from \"./bursar.js\";\nexport * from \"./commerce/index.js\";\n\n// Types\nexport type {\n AddCreditsResult,\n AddTeamMemberResult,\n AggregateStats,\n AllowanceResult,\n AvailableResult,\n BalanceResult,\n BillingMode,\n CatalogRevisionSummary,\n CatalogRevision,\n BucketBalance,\n BucketBalancesResult,\n BucketDefinition,\n CanAffordResult,\n CheckFeatureResult,\n CreateTeamResult,\n CreditMetadata,\n DailySpendRow,\n DeductionResult,\n DeductionFailure,\n DeductionSuccess,\n DeductWithAllowanceOptions,\n ExecuteGrantProgramRequest,\n GetUserPlanResult,\n GrantProgramAwardResult,\n GrantProgramTrigger,\n LeaseResult,\n LeaseFailure,\n LeaseSuccess,\n LeasePricingContext,\n ListQuotaEventsOptions,\n PlanAllowancePolicy,\n PlanAdmissionPolicy,\n PlanCreditPolicy,\n PlanMigrationBatchResult,\n PlanMigrationStartResult,\n QuotaEvent,\n QuotaState,\n RefundResult,\n RefundFailure,\n RefundSuccess,\n RevokeCreditsResult,\n ReleaseResult,\n SetUserPlanResult,\n SpendByModelRow,\n SpendByUserRow,\n ListLedgerEntriesOptions,\n ListUsageChargesOptions,\n ListUsageEntriesOptions,\n LedgerCursor,\n LedgerPage,\n LedgerEntry,\n UsageCharge,\n UsageChargeCursor,\n UsageChargePage,\n UsageRecordResult,\n UsageRecordFailure,\n UsageRecordSuccess,\n SweepResult,\n Team,\n TeamBalanceResult,\n TeamDeductionResult,\n TeamDeductionFailure,\n TeamDeductionSuccess,\n TeamMember,\n TopUserRow,\n UsageAnalyticsStore,\n} from \"./credits/types/index.js\";\n\n// Store options\nexport type { CreateLeaseOptions, CreateTeamOptions, SettleLeaseOptions } from \"./credits/store.js\";\nexport type {\n AddCreditsOptions,\n BeginBilledOperationOptions,\n CanAffordOptions,\n CreditsServiceOptions,\n DeductCreditsOptions,\n DeductFlatJobOptions,\n DeductOptions,\n DeductTeamOptions,\n ExactAmount,\n GrantSubscriptionCycleOptions,\n LowBalanceConfig,\n MetricsOrAmount,\n PostDeductionContext,\n RecordUsageOptions,\n RefundCreditsOptions,\n ReserveOptions,\n RunBilledOptions,\n SettleOptions,\n} from \"./credits/service-types.js\";\n\n// Stores\nexport { CreditStore } from \"./credits/store.js\";\nexport { PostgresStore } from \"./credits/postgres/store.js\";\nexport type { PostgresStoreOptions } from \"./credits/postgres/store.js\";\nexport type { PostgresConnectionOptions } from \"./shared/postgres-client.js\";\nexport { PROVIDER_ENVIRONMENTS } from \"./providers/environment.js\";\nexport type { ProviderEnvironment } from \"./providers/environment.js\";\n\n// Events\nexport type { CreditEvent, CreditEventType } from \"./credits/events.js\";\nexport { CreditEventEmitter } from \"./credits/events.js\";\n\n// Billing\nexport { BillingStore, PostgresBillingStore } from \"./billing/index.js\";\nexport { AUTO_RECHARGE_STATES, BillingEventType } from \"./billing/index.js\";\nexport type { BillingServiceOptions } from \"./billing/billing-service.js\";\n\nexport type {\n BillingAutoRechargeAttempt,\n BillingAutoRechargeAttemptState,\n BillingAutoRechargeProfile,\n BillingAutoRechargeStatus,\n BillingProvisioningPort,\n BillingCreditPostingResult,\n BillingCustomerInfo,\n BillingCustomerRecord,\n BillingDisputeInfo,\n BillingEvent,\n BillingEventClaim,\n BillingEventHandler,\n BillingEventResult,\n BillingInvoiceInfo,\n BillingInvoiceRecord,\n BillingOfferInterval,\n BillingPaymentInfo,\n BillingPaymentRecord,\n BillingPreferences,\n PostgresBillingStoreOptions,\n BillingRefundInfo,\n BillingSubscriptionInfo,\n BillingSubscriptionChange,\n BillingSubscriptionChangeInput,\n BillingSubscriptionOfferContext,\n BillingSubscriptionChangeState,\n BillingSubscriptionState,\n BillingSubscriptionStatus,\n EntitlementMode,\n ProviderRef,\n SubscriptionGrant,\n} from \"./billing/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAkB5C,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAQpD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC9B,YAAY,EACZ,WAAW,EACX,4BAA4B,EAC5B,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,mCAAmC,EACnC,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAO9B,0EAA0E;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAYrE,cAAc,qBAAqB,CAAC;AAqGpC,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,UAAU;AACV,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["/** Confirmed plan changes can be retried using the same operation key and request. */\nexport const PLAN_CHANGE_REPLAY_SAFE = true;\n\nexport { PricingEngine } from \"./engine.js\";\nexport type { CostBreakdown } from \"./breakdown.js\";\nexport type { UsageMetrics } from \"./metrics.js\";\nexport type {\n BursarConfigData,\n CatalogRollout,\n ParsedBursarConfig,\n PricingConfig,\n CreditsConfig,\n PlanDefinition,\n PlanEvolution,\n PlanRollout,\n PlanRolloutStrategy,\n CommerceConfig,\n Window,\n Charge,\n FeatureDefinition,\n} from \"./config.js\";\nexport {\n canonicalBursarConfigDict,\n canonicalCatalogRolloutDict,\n loadCatalogRollout,\n loadConfigFromDict,\n validateCatalogRollout,\n} from \"./config.js\";\nexport { projectPublicCatalog } from \"./catalog.js\";\nexport type {\n PublicCatalog,\n PublicCatalogOffer,\n PublicCatalogScope,\n PublicCatalogPlan,\n PublicCatalogWindow,\n} from \"./catalog.js\";\nexport {\n AutoRechargeDisabledError,\n AutoRechargeNotConfiguredError,\n BillingError,\n BursarError,\n CapabilityNotConfiguredError,\n CapabilityNotSupportedError,\n CapReachedError,\n ConcurrencyLimitError,\n CreditError,\n ConfigError,\n ExpressionError,\n FeatureNotEntitledError,\n ImportError,\n IdempotencyConflictError,\n InsufficientCreditsError,\n LeaseExpiredError,\n LeaseNotFoundError,\n OperationNotAllowedError,\n PaymentMethodRequiredError,\n ProviderCapabilityNotSupportedError,\n ProviderResponseError,\n CatalogNotLoadedError,\n StaleQuoteError,\n RefundError,\n QuotaExceededError,\n StoreError,\n StoreClosedError,\n StoreTimeoutError,\n StoreUnavailableError,\n bursarErrorHttpStatus,\n bursarErrorPublicMessage,\n isBursarError,\n isRetryableBursarError,\n} from \"./errors.js\";\nexport type {\n BursarErrorCategory,\n BursarErrorDetails,\n BursarErrorOptions,\n SerializedBursarError,\n StoreErrorOptions,\n} from \"./errors.js\";\nexport { retryBursarOperation } from \"./retry.js\";\nexport type { BursarRetryOptions } from \"./retry.js\";\nexport { validateExpression, evaluateExpression } from \"./expr.js\";\nexport {\n BURSAR_INSTRUMENTATION_SCOPE,\n BURSAR_INSTRUMENTATION_VERSION,\n NOOP_INSTRUMENTATION,\n NoopInstrumentation,\n getDefaultInstrumentation,\n sanitizeTelemetryAttributes,\n setDefaultInstrumentation,\n telemetryErrorAttributes,\n telemetryOperationAttributes,\n} from \"./telemetry/index.js\";\nexport type {\n Instrumentation,\n TelemetryAttributes,\n TelemetryAttributeValue,\n} from \"./telemetry/index.js\";\n\n// Application facade. Credit/billing orchestration is internal to Bursar.\nexport { AccountService, Bursar, CatalogService } from \"./bursar.js\";\nexport type {\n AccountCreatedInput,\n AccountCreatedResult,\n BillingBursarOptions,\n BursarOptions,\n BillingCapability,\n BillingEventSink,\n CommerceOptions,\n CreditsService,\n CreditsOnlyBursarOptions,\n} from \"./bursar.js\";\nexport * from \"./commerce/index.js\";\n\n// Types\nexport type {\n AddCreditsResult,\n AddTeamMemberResult,\n AggregateStats,\n AllowanceResult,\n AvailableResult,\n BalanceResult,\n BillingMode,\n CatalogRevisionSummary,\n CatalogRevision,\n BucketBalance,\n BucketBalancesResult,\n BucketDefinition,\n CanAffordResult,\n CheckFeatureResult,\n CreateTeamResult,\n CreditMetadata,\n DailySpendRow,\n DeductionResult,\n DeductionFailure,\n DeductionSuccess,\n DeductWithAllowanceOptions,\n ExecuteGrantProgramRequest,\n GetUserPlanResult,\n GrantProgramAwardResult,\n GrantProgramTrigger,\n LeaseResult,\n LeaseFailure,\n LeaseSuccess,\n LeasePricingContext,\n ListQuotaEventsOptions,\n PlanAllowancePolicy,\n PlanAdmissionPolicy,\n PlanCreditPolicy,\n PlanMigrationBatchResult,\n PlanMigrationStartResult,\n QuotaEvent,\n QuotaState,\n RefundResult,\n RefundFailure,\n RefundSuccess,\n RevokeCreditsResult,\n ReleaseResult,\n SetUserPlanResult,\n SpendByModelRow,\n SpendByUserRow,\n ListLedgerEntriesOptions,\n ListUsageChargesOptions,\n ListUsageEntriesOptions,\n LedgerCursor,\n LedgerPage,\n LedgerEntry,\n OperationReceipt,\n UsageCharge,\n UsageChargeCursor,\n UsageChargePage,\n UsageRecordResult,\n UsageRecordFailure,\n UsageRecordSuccess,\n SweepResult,\n Team,\n TeamBalanceResult,\n TeamDeductionResult,\n TeamDeductionFailure,\n TeamDeductionSuccess,\n TeamMember,\n TopUserRow,\n UsageAnalyticsStore,\n} from \"./credits/types/index.js\";\n\n// Store options\nexport type {\n CreateLeaseOptions,\n CreateTeamOptions,\n DeductTeamStoreOptions,\n SettleLeaseOptions,\n} from \"./credits/store.js\";\nexport type {\n AddCreditsOptions,\n BeginBilledOperationOptions,\n CanAffordOptions,\n CreditsServiceOptions,\n DeductCreditsOptions,\n DeductFlatJobOptions,\n DeductOptions,\n DeductTeamOptions,\n ExactAmount,\n GrantSubscriptionCycleOptions,\n LowBalanceConfig,\n MetricsOrAmount,\n PostDeductionContext,\n RecordUsageOptions,\n RefundCreditsOptions,\n ReserveOptions,\n RunBilledOptions,\n SettleOptions,\n} from \"./credits/service-types.js\";\n\n// Stores\nexport { CreditStore } from \"./credits/store.js\";\nexport { PostgresStore } from \"./credits/postgres/store.js\";\nexport type { PostgresStoreOptions } from \"./credits/postgres/store.js\";\nexport type { PostgresConnectionOptions } from \"./shared/postgres-client.js\";\nexport { resolveProviderId } from \"./config/parse-commerce.js\";\nexport { PROVIDER_ENVIRONMENTS } from \"./providers/environment.js\";\nexport type { ProviderEnvironment } from \"./providers/environment.js\";\n\n// Events\nexport type { CreditEvent, CreditEventType } from \"./credits/events.js\";\nexport { CreditEventEmitter } from \"./credits/events.js\";\n\n// Billing\nexport { BillingStore, PostgresBillingStore } from \"./billing/index.js\";\nexport { AUTO_RECHARGE_STATES, BillingEventType } from \"./billing/index.js\";\nexport type { BillingServiceOptions } from \"./billing/billing-service.js\";\n\nexport type {\n BillingAutoRechargeAttempt,\n BillingAutoRechargeAttemptState,\n BillingAutoRechargeProfile,\n BillingAutoRechargeStatus,\n BillingProvisioningPort,\n BillingCreditPostingResult,\n BillingCustomerInfo,\n BillingCustomerRecord,\n BillingDisputeInfo,\n BillingEvent,\n BillingEventClaim,\n BillingEventHandler,\n BillingEventResult,\n BillingInvoiceInfo,\n BillingInvoiceRecord,\n BillingInvoiceCursor,\n BillingInvoicePage,\n ListBillingInvoicesOptions,\n BillingOfferInterval,\n BillingPaymentInfo,\n BillingPaymentRecord,\n BillingPreferences,\n PostgresBillingStoreOptions,\n BillingRefundInfo,\n BillingSubscriptionInfo,\n BillingSubscriptionChange,\n BillingSubscriptionChangeInput,\n BillingSubscriptionOfferContext,\n BillingSubscriptionChangeState,\n BillingSubscriptionState,\n BillingSubscriptionStatus,\n EntitlementMode,\n ProviderRef,\n SubscriptionGrant,\n} from \"./billing/index.js\";\n"]}
@@ -1,3 +1,5 @@
1
+ import type { BursarConfigData } from "./config/types.js";
2
+ import type { ProviderEnvironment } from "./providers/environment.js";
1
3
  import { type JsonObject } from "./shared/json.js";
2
4
  /**
3
5
  * Read a JSON or YAML Bursar config file from disk.
@@ -8,5 +10,7 @@ import { type JsonObject } from "./shared/json.js";
8
10
  * JSON syntax is validated by the platform parser and mapping keys are also
9
11
  * checked by js-yaml so duplicate config fields cannot silently overwrite.
10
12
  */
11
- export declare function loadConfigFile(filepath: string): Promise<JsonObject>;
13
+ export declare function loadRawConfigFile(filepath: string): Promise<JsonObject>;
14
+ /** Load, validate, and normalize a configuration for catalog publication. */
15
+ export declare function loadConfigFile(filepath: string, environment?: ProviderEnvironment): Promise<BursarConfigData>;
12
16
  //# sourceMappingURL=load-config-file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-config-file.d.ts","sourceRoot":"","sources":["../src/load-config-file.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,KAAK,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAqDjF;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAgC1E"}
1
+ {"version":3,"file":"load-config-file.d.ts","sourceRoot":"","sources":["../src/load-config-file.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAgB,KAAK,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AAiFjF;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA0C7E;AAED,6EAA6E;AAC7E,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,mBAAmB,GAChC,OAAO,CAAC,gBAAgB,CAAC,CAE3B"}
@@ -1,16 +1,39 @@
1
- import { readFileSync, statSync } from "fs";
1
+ import { readFile, stat } from "node:fs/promises";
2
2
  import { extname } from "path";
3
- import { load as parseYaml } from "js-yaml";
3
+ import { CORE_SCHEMA, load as parseYaml, realMapTag } from "js-yaml";
4
4
  import { z } from "zod";
5
+ import { canonicalBursarConfigDict } from "./config.js";
5
6
  import { ConfigError } from "./errors.js";
6
7
  import { isJsonObject } from "./shared/json.js";
8
+ // js-yaml's real-map schema preserves scalar key types; validate every
9
+ // nested mapping before turning it into a JSON object.
10
+ const yamlJsonValue = z.lazy(() => z.union([
11
+ z.string(),
12
+ z.number().finite(),
13
+ z.boolean(),
14
+ z.null(),
15
+ z.array(yamlJsonValue),
16
+ z.map(z.string(), yamlJsonValue).transform((value) => Object.fromEntries(value)),
17
+ ]));
18
+ function rejectYamlVersionDirective(content) {
19
+ // YAML directives can only appear in the header, before document content.
20
+ for (const line of content.replace(/^\uFEFF/, "").split(/\r?\n/)) {
21
+ if (!line.trim() || line.trimStart().startsWith("#"))
22
+ continue;
23
+ if (/^%YAML(?:\s|$)/.test(line)) {
24
+ throw new Error("YAML version directives are not supported");
25
+ }
26
+ if (!line.startsWith("%"))
27
+ break;
28
+ }
29
+ }
7
30
  function parseJsonWithUniqueKeys(content) {
8
31
  const parsed = z.json().parse(JSON.parse(content));
9
32
  // JSON is a strict subset of YAML. js-yaml retains source-level mapping
10
33
  // keys and rejects duplicates, including nested and escape-equivalent keys;
11
34
  // native JSON.parse above remains the authority for strict JSON syntax and
12
35
  // for the returned JavaScript value.
13
- parseYaml(content, { json: false });
36
+ parseYaml(content, { json: false, maxAliases: 0 });
14
37
  return parsed;
15
38
  }
16
39
  /**
@@ -18,10 +41,10 @@ function parseJsonWithUniqueKeys(content) {
18
41
  * failures into a clean {@link ConfigError} instead of a raw Node `fs` error
19
42
  * (mirrors the Python CLI's `_load_config_file`).
20
43
  */
21
- function readFileClean(filepath) {
22
- let stat;
44
+ async function readFileClean(filepath) {
45
+ let fileStat;
23
46
  try {
24
- stat = statSync(filepath);
47
+ fileStat = await stat(filepath);
25
48
  }
26
49
  catch (cause) {
27
50
  const code = z.object({ code: z.string().optional() }).safeParse(cause).data?.code;
@@ -30,17 +53,21 @@ function readFileClean(filepath) {
30
53
  if (code === "EACCES")
31
54
  throw new ConfigError(`Permission denied: ${filepath}`);
32
55
  const message = cause instanceof Error ? cause.message : String(cause);
33
- throw new ConfigError(`Could not read ${filepath}: ${message}`, [], { cause });
56
+ throw new ConfigError(`Could not read ${filepath}: ${message}`, [], {
57
+ cause,
58
+ });
34
59
  }
35
- if (stat.isDirectory()) {
60
+ if (fileStat.isDirectory()) {
36
61
  throw new ConfigError(`Not a file (is a directory): ${filepath}`);
37
62
  }
38
63
  try {
39
- return readFileSync(filepath, "utf-8");
64
+ return await readFile(filepath, "utf-8");
40
65
  }
41
66
  catch (cause) {
42
67
  const message = cause instanceof Error ? cause.message : String(cause);
43
- throw new ConfigError(`Could not read ${filepath}: ${message}`, [], { cause });
68
+ throw new ConfigError(`Could not read ${filepath}: ${message}`, [], {
69
+ cause,
70
+ });
44
71
  }
45
72
  }
46
73
  /** Guard against an empty file or a non-object parse result (e.g. an empty YAML document). */
@@ -65,36 +92,48 @@ function assertNonEmptyObject(data, filepath) {
65
92
  * JSON syntax is validated by the platform parser and mapping keys are also
66
93
  * checked by js-yaml so duplicate config fields cannot silently overwrite.
67
94
  */
68
- export async function loadConfigFile(filepath) {
95
+ export async function loadRawConfigFile(filepath) {
69
96
  const extension = extname(filepath).toLowerCase();
70
97
  if (!new Set([".json", ".yaml", ".yml"]).has(extension)) {
71
98
  throw new ConfigError(`Unsupported config file format: ${extension || "<none>"}. Expected .json, .yaml, or .yml`);
72
99
  }
73
100
  if (extension === ".yaml" || extension === ".yml") {
74
- const content = readFileClean(filepath);
101
+ const content = await readFileClean(filepath);
75
102
  let parsed;
76
103
  try {
77
- const yamlValue = parseYaml(content, { json: false });
78
- const jsonValue = z.json().safeParse(yamlValue);
104
+ rejectYamlVersionDirective(content);
105
+ const jsonValue = yamlJsonValue.optional().safeParse(parseYaml(content, {
106
+ json: false,
107
+ maxAliases: 0,
108
+ schema: CORE_SCHEMA.withTags(realMapTag),
109
+ }));
79
110
  if (!jsonValue.success)
80
111
  throw new ConfigError("YAML document must contain JSON values");
81
112
  parsed = jsonValue.data;
82
113
  }
83
114
  catch (cause) {
84
115
  const message = cause instanceof Error ? cause.message : String(cause);
85
- throw new ConfigError(`Invalid YAML in ${filepath}: ${message}`, [], { cause });
116
+ throw new ConfigError(`Invalid YAML in ${filepath}: ${message}`, [], {
117
+ cause,
118
+ });
86
119
  }
87
120
  return assertNonEmptyObject(parsed, filepath);
88
121
  }
89
- const content = readFileClean(filepath);
122
+ const content = await readFileClean(filepath);
90
123
  let parsed;
91
124
  try {
92
125
  parsed = parseJsonWithUniqueKeys(content);
93
126
  }
94
127
  catch (cause) {
95
128
  const message = cause instanceof Error ? cause.message : String(cause);
96
- throw new ConfigError(`Invalid JSON in ${filepath}: ${message}`, [], { cause });
129
+ throw new ConfigError(`Invalid JSON in ${filepath}: ${message}`, [], {
130
+ cause,
131
+ });
97
132
  }
98
133
  return assertNonEmptyObject(parsed, filepath);
99
134
  }
135
+ /** Load, validate, and normalize a configuration for catalog publication. */
136
+ export async function loadConfigFile(filepath, environment) {
137
+ return canonicalBursarConfigDict(await loadRawConfigFile(filepath), environment);
138
+ }
100
139
  //# sourceMappingURL=load-config-file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-config-file.js","sourceRoot":"","sources":["../src/load-config-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE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AG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,WAAW,CAAC,mBAAmB,QAAQ,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { readFileSync, statSync } from \"fs\";\nimport { extname } from \"path\";\nimport { load as parseYaml } from \"js-yaml\";\nimport { z } from \"zod\";\nimport { ConfigError } from \"./errors.js\";\nimport { isJsonObject, type JsonObject, type JsonValue } from \"./shared/json.js\";\n\nfunction parseJsonWithUniqueKeys(content: string): JsonValue {\n const parsed = z.json().parse(JSON.parse(content));\n // JSON is a strict subset of YAML. js-yaml retains source-level mapping\n // keys and rejects duplicates, including nested and escape-equivalent keys;\n // native JSON.parse above remains the authority for strict JSON syntax and\n // for the returned JavaScript value.\n parseYaml(content, { json: false });\n return parsed;\n}\n\n/**\n * Read a file's contents, converting missing-file/directory/permission\n * failures into a clean {@link ConfigError} instead of a raw Node `fs` error\n * (mirrors the Python CLI's `_load_config_file`).\n */\nfunction readFileClean(filepath: string): string {\n let stat: ReturnType<typeof statSync> | undefined;\n try {\n stat = statSync(filepath);\n } catch (cause) {\n const code = z.object({ code: z.string().optional() }).safeParse(cause).data?.code;\n if (code === \"ENOENT\") throw new ConfigError(`Config file not found: ${filepath}`);\n if (code === \"EACCES\") throw new ConfigError(`Permission denied: ${filepath}`);\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Could not read ${filepath}: ${message}`, [], { cause });\n }\n if (stat.isDirectory()) {\n throw new ConfigError(`Not a file (is a directory): ${filepath}`);\n }\n try {\n return readFileSync(filepath, \"utf-8\");\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Could not read ${filepath}: ${message}`, [], { cause });\n }\n}\n\n/** Guard against an empty file or a non-object parse result (e.g. an empty YAML document). */\nfunction assertNonEmptyObject(data: JsonValue | undefined, filepath: string): JsonObject {\n if (data == null) {\n throw new ConfigError(`Bursar config is empty: ${filepath}`);\n }\n if (!isJsonObject(data)) {\n throw new ConfigError(`Bursar config must be a JSON/YAML object: ${filepath}`);\n }\n if (Object.keys(data).length === 0) {\n throw new ConfigError(`Bursar config is empty: ${filepath}`);\n }\n return data;\n}\n\n/**\n * Read a JSON or YAML Bursar config file from disk.\n *\n * Returns the raw parsed dict (suitable for ``loadConfigFromDict`` or\n * ``PricingEngine.fromDict``).\n *\n * JSON syntax is validated by the platform parser and mapping keys are also\n * checked by js-yaml so duplicate config fields cannot silently overwrite.\n */\nexport async function loadConfigFile(filepath: string): Promise<JsonObject> {\n const extension = extname(filepath).toLowerCase();\n if (!new Set([\".json\", \".yaml\", \".yml\"]).has(extension)) {\n throw new ConfigError(\n `Unsupported config file format: ${extension || \"<none>\"}. Expected .json, .yaml, or .yml`,\n );\n }\n\n if (extension === \".yaml\" || extension === \".yml\") {\n const content = readFileClean(filepath);\n let parsed: JsonValue | undefined;\n try {\n const yamlValue = parseYaml(content, { json: false });\n const jsonValue = z.json().safeParse(yamlValue);\n if (!jsonValue.success) throw new ConfigError(\"YAML document must contain JSON values\");\n parsed = jsonValue.data;\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Invalid YAML in ${filepath}: ${message}`, [], { cause });\n }\n return assertNonEmptyObject(parsed, filepath);\n }\n\n const content = readFileClean(filepath);\n let parsed: JsonValue;\n try {\n parsed = parseJsonWithUniqueKeys(content);\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Invalid JSON in ${filepath}: ${message}`, [], { cause });\n }\n return assert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OAAO,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,MAAiB,CAAC;IACtB,IAAI,CAAC;QACH,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,WAAW,CAAC,mBAAmB,QAAQ,KAAK,OAAO,EAAE,EAAE,EAAE,EAAE;YACnE,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IACD,OAAO,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC;AAED,6EAA6E;AAC7E,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAgB,EAChB,WAAiC;IAEjC,OAAO,yBAAyB,CAAC,MAAM,iBAAiB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import { readFile, stat } from \"node:fs/promises\";\nimport { extname } from \"path\";\nimport { CORE_SCHEMA, load as parseYaml, realMapTag } from \"js-yaml\";\nimport { z } from \"zod\";\nimport { canonicalBursarConfigDict } from \"./config.js\";\nimport type { BursarConfigData } from \"./config/types.js\";\nimport type { ProviderEnvironment } from \"./providers/environment.js\";\nimport { ConfigError } from \"./errors.js\";\nimport { isJsonObject, type JsonObject, type JsonValue } from \"./shared/json.js\";\n\n// js-yaml's real-map schema preserves scalar key types; validate every\n// nested mapping before turning it into a JSON object.\nconst yamlJsonValue: z.ZodType<JsonValue> = z.lazy(() =>\n z.union([\n z.string(),\n z.number().finite(),\n z.boolean(),\n z.null(),\n z.array(yamlJsonValue),\n z.map(z.string(), yamlJsonValue).transform((value) => Object.fromEntries(value)),\n ]),\n);\n\nfunction rejectYamlVersionDirective(content: string): void {\n // YAML directives can only appear in the header, before document content.\n for (const line of content.replace(/^\\uFEFF/, \"\").split(/\\r?\\n/)) {\n if (!line.trim() || line.trimStart().startsWith(\"#\")) continue;\n if (/^%YAML(?:\\s|$)/.test(line)) {\n throw new Error(\"YAML version directives are not supported\");\n }\n if (!line.startsWith(\"%\")) break;\n }\n}\n\nfunction parseJsonWithUniqueKeys(content: string): JsonValue {\n const parsed = z.json().parse(JSON.parse(content));\n // JSON is a strict subset of YAML. js-yaml retains source-level mapping\n // keys and rejects duplicates, including nested and escape-equivalent keys;\n // native JSON.parse above remains the authority for strict JSON syntax and\n // for the returned JavaScript value.\n parseYaml(content, { json: false, maxAliases: 0 });\n return parsed;\n}\n\n/**\n * Read a file's contents, converting missing-file/directory/permission\n * failures into a clean {@link ConfigError} instead of a raw Node `fs` error\n * (mirrors the Python CLI's `_load_config_file`).\n */\nasync function readFileClean(filepath: string): Promise<string> {\n let fileStat: Awaited<ReturnType<typeof stat>>;\n try {\n fileStat = await stat(filepath);\n } catch (cause) {\n const code = z.object({ code: z.string().optional() }).safeParse(cause).data?.code;\n if (code === \"ENOENT\") throw new ConfigError(`Config file not found: ${filepath}`);\n if (code === \"EACCES\") throw new ConfigError(`Permission denied: ${filepath}`);\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Could not read ${filepath}: ${message}`, [], {\n cause,\n });\n }\n if (fileStat.isDirectory()) {\n throw new ConfigError(`Not a file (is a directory): ${filepath}`);\n }\n try {\n return await readFile(filepath, \"utf-8\");\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Could not read ${filepath}: ${message}`, [], {\n cause,\n });\n }\n}\n\n/** Guard against an empty file or a non-object parse result (e.g. an empty YAML document). */\nfunction assertNonEmptyObject(data: JsonValue | undefined, filepath: string): JsonObject {\n if (data == null) {\n throw new ConfigError(`Bursar config is empty: ${filepath}`);\n }\n if (!isJsonObject(data)) {\n throw new ConfigError(`Bursar config must be a JSON/YAML object: ${filepath}`);\n }\n if (Object.keys(data).length === 0) {\n throw new ConfigError(`Bursar config is empty: ${filepath}`);\n }\n return data;\n}\n\n/**\n * Read a JSON or YAML Bursar config file from disk.\n *\n * Returns the raw parsed dict (suitable for ``loadConfigFromDict`` or\n * ``PricingEngine.fromDict``).\n *\n * JSON syntax is validated by the platform parser and mapping keys are also\n * checked by js-yaml so duplicate config fields cannot silently overwrite.\n */\nexport async function loadRawConfigFile(filepath: string): Promise<JsonObject> {\n const extension = extname(filepath).toLowerCase();\n if (!new Set([\".json\", \".yaml\", \".yml\"]).has(extension)) {\n throw new ConfigError(\n `Unsupported config file format: ${extension || \"<none>\"}. Expected .json, .yaml, or .yml`,\n );\n }\n\n if (extension === \".yaml\" || extension === \".yml\") {\n const content = await readFileClean(filepath);\n let parsed: JsonValue | undefined;\n try {\n rejectYamlVersionDirective(content);\n const jsonValue = yamlJsonValue.optional().safeParse(\n parseYaml(content, {\n json: false,\n maxAliases: 0,\n schema: CORE_SCHEMA.withTags(realMapTag),\n }),\n );\n if (!jsonValue.success) throw new ConfigError(\"YAML document must contain JSON values\");\n parsed = jsonValue.data;\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Invalid YAML in ${filepath}: ${message}`, [], {\n cause,\n });\n }\n return assertNonEmptyObject(parsed, filepath);\n }\n\n const content = await readFileClean(filepath);\n let parsed: JsonValue;\n try {\n parsed = parseJsonWithUniqueKeys(content);\n } catch (cause) {\n const message = cause instanceof Error ? cause.message : String(cause);\n throw new ConfigError(`Invalid JSON in ${filepath}: ${message}`, [], {\n cause,\n });\n }\n return assertNonEmptyObject(parsed, filepath);\n}\n\n/** Load, validate, and normalize a configuration for catalog publication. */\nexport async function loadConfigFile(\n filepath: string,\n environment?: ProviderEnvironment,\n): Promise<BursarConfigData> {\n return canonicalBursarConfigDict(await loadRawConfigFile(filepath), environment);\n}\n"]}
package/dist/metrics.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { StructuredObject } from "./shared/json.js";
3
3
  /** One provider-neutral billable operation. */
4
4
  export interface UsageMetrics {
5
5
  operation: string;
6
- measures?: Record<string, number | string>;
6
+ measures?: Record<string, number | string | Decimal>;
7
7
  dimensions?: Record<string, string | number | boolean | Decimal.Value>;
8
8
  metadata?: StructuredObject;
9
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,+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,gBAAgB,CAAC;CAC7B"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACvE,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"","sourcesContent":["import type { Decimal } from \"decimal.js\";\nimport type { StructuredObject } from \"./shared/json.js\";\n\n/** One provider-neutral billable operation. */\nexport interface UsageMetrics {\n operation: string;\n measures?: Record<string, number | string>;\n dimensions?: Record<string, string | number | boolean | Decimal.Value>;\n metadata?: StructuredObject;\n}\n"]}
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"","sourcesContent":["import type { Decimal } from \"decimal.js\";\nimport type { StructuredObject } from \"./shared/json.js\";\n\n/** One provider-neutral billable operation. */\nexport interface UsageMetrics {\n operation: string;\n measures?: Record<string, number | string | Decimal>;\n dimensions?: Record<string, string | number | boolean | Decimal.Value>;\n metadata?: StructuredObject;\n}\n"]}
package/dist/node.d.ts CHANGED
@@ -9,10 +9,10 @@
9
9
  * import { loadConfigFile } from "@zonastery/bursar/node";
10
10
  * ```
11
11
  */
12
- export { loadConfigFile } from "./load-config-file.js";
12
+ export { loadConfigFile, loadRawConfigFile } from "./load-config-file.js";
13
13
  export { BursarRuntime, createBursarRuntime } from "./storage/runtime.js";
14
14
  export type { BursarRuntimeBursarOptions, BursarRuntimeHealth, BursarRuntimeOptions, BursarRuntimeStartOptions, } from "./storage/runtime.js";
15
- export type { BursarRuntimeDiagnostics, BursarRuntimeState, CatalogDependencyCheck, CheckDependenciesOptions, DependencyCheck, DependencyStatus, OutboxDependencyCheck, OutboxStatusSnapshot, WorkerErrorSnapshot, WorkerLifecycle, WorkerRunSnapshot, WorkerState, } from "./storage/diagnostics.js";
15
+ export type { BursarRuntimeDiagnostics, BursarRuntimeState, CatalogDependencyCheck, DependencyCheck, DependencyStatus, OutboxDependencyCheck, OutboxStatusSnapshot, WorkerErrorSnapshot, WorkerLifecycle, WorkerRunSnapshot, WorkerState, } from "./storage/diagnostics.js";
16
16
  export { BursarMaintenance, BursarOperatorMaintenance } from "./storage/maintenance.js";
17
17
  export type { MaintenanceRunOptions, MaintenanceRunResult, MaintenanceRunStatus, MaintenanceOperations, MaintenanceTaskResult, MaintenanceTaskStatus, OperatorMaintenanceRunOptions, PartitionMaintenanceResult, StorageMaintenanceCounts, StorageMaintenanceResult, StorageMaintenanceStatus, StoragePartition, } from "./storage/maintenance.js";
18
18
  export { OutboxWorker } from "./storage/outbox-worker.js";
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,WAAW,GACZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACxF,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC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AwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AACpC,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,EACV,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,uBAAuB,EACvB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,cAAc,GACf,MAAM,oBAAoB,CAAC"}
package/dist/node.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * import { loadConfigFile } from "@zonastery/bursar/node";
10
10
  * ```
11
11
  */
12
- export { loadConfigFile } from "./load-config-file.js";
12
+ export { loadConfigFile, loadRawConfigFile } from "./load-config-file.js";
13
13
  // Optional high-volume storage infrastructure. These adapters are Node-only;
14
14
  // the main package remains the PostgreSQL-first application API.
15
15
  export { BursarRuntime, createBursarRuntime } from "./storage/runtime.js";
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,6EAA6E;AAC7E,iEAAiE;AACjE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAqB1E,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAexF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAQ1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * Node.js-only bursar exports.\n *\n * These modules depend on Node built-ins (`crypto`, `fs`) and are not\n * compatible with Edge Runtime environments. Import them from the\n * ``@zonastery/bursar/node`` subpath when you need Node-specific behaviour:\n *\n * ```ts\n * import { loadConfigFile } from \"@zonastery/bursar/node\";\n * ```\n */\n\nexport { loadConfigFile } from \"./load-config-file.js\";\n\n// Optional high-volume storage infrastructure. These adapters are Node-only;\n// the main package remains the PostgreSQL-first application API.\nexport { BursarRuntime, createBursarRuntime } from \"./storage/runtime.js\";\nexport type {\n BursarRuntimeBursarOptions,\n BursarRuntimeHealth,\n BursarRuntimeOptions,\n BursarRuntimeStartOptions,\n} from \"./storage/runtime.js\";\nexport type {\n BursarRuntimeDiagnostics,\n BursarRuntimeState,\n CatalogDependencyCheck,\n CheckDependenciesOptions,\n DependencyCheck,\n DependencyStatus,\n OutboxDependencyCheck,\n OutboxStatusSnapshot,\n WorkerErrorSnapshot,\n WorkerLifecycle,\n WorkerRunSnapshot,\n WorkerState,\n} from \"./storage/diagnostics.js\";\nexport { BursarMaintenance, BursarOperatorMaintenance } from \"./storage/maintenance.js\";\nexport type {\n MaintenanceRunOptions,\n MaintenanceRunResult,\n MaintenanceRunStatus,\n MaintenanceOperations,\n MaintenanceTaskResult,\n MaintenanceTaskStatus,\n OperatorMaintenanceRunOptions,\n PartitionMaintenanceResult,\n StorageMaintenanceCounts,\n StorageMaintenanceResult,\n StorageMaintenanceStatus,\n StoragePartition,\n} from \"./storage/maintenance.js\";\nexport { OutboxWorker } from \"./storage/outbox-worker.js\";\nexport type {\n OutboxClaimLossPhase,\n OutboxEventOutcome,\n OutboxEventOutcomeStatus,\n OutboxRunResult,\n OutboxWorkerOptions,\n} from \"./storage/outbox-worker.js\";\nexport { ClickHouseUsageStore } from \"./storage/adapters/clickhouse.js\";\nexport type {\n ClickHouseClient,\n ClickHouseQueryResult,\n ClickHouseUsageStoreOptions,\n} from \"./storage/adapters/clickhouse.js\";\nexport { S3BillingArchive } from \"./storage/adapters/s3.js\";\nexport type {\n S3ArchiveCommand,\n S3ArchiveCommandInput,\n S3ArchiveClient,\n S3ArchiveCommandResult,\n S3ArchiveClientFactory,\n S3BillingArchiveOptions,\n S3Credentials,\n S3PutObjectOptions,\n} from \"./storage/adapters/s3.js\";\nexport type {\n BillingEventPayloadExport,\n BillingPayloadArchive,\n BillingPayloadArchiveResult,\n OutboxClaimRenewalStore,\n OutboxDeadLetter,\n OutboxDeadLetterCursor,\n OutboxDeadLetterListOptions,\n OutboxDeadLetterPage,\n OutboxEvent,\n OutboxHandler,\n OutboxRecoveryStore,\n OutboxStats,\n OutboxStore,\n UsageChargeExport,\n UsageEventSink,\n} from \"./storage/ports.js\";\n"]}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1E,6EAA6E;AAC7E,iEAAiE;AACjE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAoB1E,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAexF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAQ1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * Node.js-only bursar exports.\n *\n * These modules depend on Node built-ins (`crypto`, `fs`) and are not\n * compatible with Edge Runtime environments. Import them from the\n * ``@zonastery/bursar/node`` subpath when you need Node-specific behaviour:\n *\n * ```ts\n * import { loadConfigFile } from \"@zonastery/bursar/node\";\n * ```\n */\n\nexport { loadConfigFile, loadRawConfigFile } from \"./load-config-file.js\";\n\n// Optional high-volume storage infrastructure. These adapters are Node-only;\n// the main package remains the PostgreSQL-first application API.\nexport { BursarRuntime, createBursarRuntime } from \"./storage/runtime.js\";\nexport type {\n BursarRuntimeBursarOptions,\n BursarRuntimeHealth,\n BursarRuntimeOptions,\n BursarRuntimeStartOptions,\n} from \"./storage/runtime.js\";\nexport type {\n BursarRuntimeDiagnostics,\n BursarRuntimeState,\n CatalogDependencyCheck,\n DependencyCheck,\n DependencyStatus,\n OutboxDependencyCheck,\n OutboxStatusSnapshot,\n WorkerErrorSnapshot,\n WorkerLifecycle,\n WorkerRunSnapshot,\n WorkerState,\n} from \"./storage/diagnostics.js\";\nexport { BursarMaintenance, BursarOperatorMaintenance } from \"./storage/maintenance.js\";\nexport type {\n MaintenanceRunOptions,\n MaintenanceRunResult,\n MaintenanceRunStatus,\n MaintenanceOperations,\n MaintenanceTaskResult,\n MaintenanceTaskStatus,\n OperatorMaintenanceRunOptions,\n PartitionMaintenanceResult,\n StorageMaintenanceCounts,\n StorageMaintenanceResult,\n StorageMaintenanceStatus,\n StoragePartition,\n} from \"./storage/maintenance.js\";\nexport { OutboxWorker } from \"./storage/outbox-worker.js\";\nexport type {\n OutboxClaimLossPhase,\n OutboxEventOutcome,\n OutboxEventOutcomeStatus,\n OutboxRunResult,\n OutboxWorkerOptions,\n} from \"./storage/outbox-worker.js\";\nexport { ClickHouseUsageStore } from \"./storage/adapters/clickhouse.js\";\nexport type {\n ClickHouseClient,\n ClickHouseQueryResult,\n ClickHouseUsageStoreOptions,\n} from \"./storage/adapters/clickhouse.js\";\nexport { S3BillingArchive } from \"./storage/adapters/s3.js\";\nexport type {\n S3ArchiveCommand,\n S3ArchiveCommandInput,\n S3ArchiveClient,\n S3ArchiveCommandResult,\n S3ArchiveClientFactory,\n S3BillingArchiveOptions,\n S3Credentials,\n S3PutObjectOptions,\n} from \"./storage/adapters/s3.js\";\nexport type {\n BillingEventPayloadExport,\n BillingPayloadArchive,\n BillingPayloadArchiveResult,\n OutboxClaimRenewalStore,\n OutboxDeadLetter,\n OutboxDeadLetterCursor,\n OutboxDeadLetterListOptions,\n OutboxDeadLetterPage,\n OutboxEvent,\n OutboxHandler,\n OutboxRecoveryStore,\n OutboxStats,\n OutboxStore,\n UsageChargeExport,\n UsageEventSink,\n} from \"./storage/ports.js\";\n"]}
@@ -0,0 +1,7 @@
1
+ import { Decimal } from "decimal.js";
2
+ export declare const PricingDecimal: typeof Decimal;
3
+ /** Accept decimal.js instances from its CJS, ESM, and cloned constructors. */
4
+ export declare function isDecimalValue(value: unknown): value is Decimal;
5
+ /** Copy even existing Decimal instances so arithmetic uses the pricing context. */
6
+ export declare function pricingDecimal(value: Decimal.Value): Decimal;
7
+ //# sourceMappingURL=pricing-decimal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing-decimal.d.ts","sourceRoot":"","sources":["../src/pricing-decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,eAAO,MAAM,cAAc,gBAIzB,CAAC;AAMH,8EAA8E;AAG9E,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAc/D;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAM5D"}
@@ -0,0 +1,43 @@
1
+ import { Decimal } from "decimal.js";
2
+ // Isolate pricing from applications that configure decimal.js globally. Fifty
3
+ // significant digits provide 30 guard digits beyond the database's 20-digit
4
+ // credit amounts; final credit amounts are rounded to six decimal places.
5
+ export const PricingDecimal = Decimal.clone({
6
+ defaults: true,
7
+ precision: 50,
8
+ rounding: Decimal.ROUND_HALF_UP,
9
+ });
10
+ function isNativeDecimal(value) {
11
+ return value instanceof Decimal;
12
+ }
13
+ /** Accept decimal.js instances from its CJS, ESM, and cloned constructors. */
14
+ // Runtime inputs must be validated before they can be narrowed to Decimal.
15
+ // oxlint-disable-next-line anti-slop/no-unknown-parameters
16
+ export function isDecimalValue(value) {
17
+ if (!Decimal.isDecimal(value))
18
+ return false;
19
+ if (isNativeDecimal(value))
20
+ return true;
21
+ const prototype = Object.getPrototypeOf(value);
22
+ if (!prototype || prototype === Object.prototype || typeof value.toExponential !== "function")
23
+ return false;
24
+ try {
25
+ // Decimal.isDecimal uses a public marker, so also require an actual
26
+ // decimal.js operation to produce a parseable canonical representation.
27
+ new PricingDecimal(value.toExponential());
28
+ return true;
29
+ }
30
+ catch {
31
+ return false;
32
+ }
33
+ }
34
+ /** Copy even existing Decimal instances so arithmetic uses the pricing context. */
35
+ export function pricingDecimal(value) {
36
+ if (Decimal.isDecimal(value) && !isNativeDecimal(value)) {
37
+ if (!isDecimalValue(value))
38
+ throw new TypeError("Invalid Decimal value");
39
+ return new PricingDecimal(value.toExponential());
40
+ }
41
+ return new PricingDecimal(value);
42
+ }
43
+ //# sourceMappingURL=pricing-decimal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing-decimal.js","sourceRoot":"","sources":["../src/pricing-decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,8EAA8E;AAC9E,4EAA4E;AAC5E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC;IAC1C,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,OAAO,CAAC,aAAa;CAChC,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,KAAK,YAAY,OAAO,CAAC;AAClC,CAAC;AAED,8EAA8E;AAC9E,2EAA2E;AAC3E,2DAA2D;AAC3D,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,eAAe,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,MAAM,CAAC,SAAS,IAAI,OAAO,KAAK,CAAC,aAAa,KAAK,UAAU;QAC3F,OAAO,KAAK,CAAC;IACf,IAAI,CAAC;QACH,oEAAoE;QACpE,wEAAwE;QACxE,IAAI,cAAc,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,cAAc,CAAC,KAAoB;IACjD,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,uBAAuB,CAAC,CAAC;QACzE,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import { Decimal } from \"decimal.js\";\n\n// Isolate pricing from applications that configure decimal.js globally. Fifty\n// significant digits provide 30 guard digits beyond the database's 20-digit\n// credit amounts; final credit amounts are rounded to six decimal places.\nexport const PricingDecimal = Decimal.clone({\n defaults: true,\n precision: 50,\n rounding: Decimal.ROUND_HALF_UP,\n});\n\nfunction isNativeDecimal(value: Decimal): boolean {\n return value instanceof Decimal;\n}\n\n/** Accept decimal.js instances from its CJS, ESM, and cloned constructors. */\n// Runtime inputs must be validated before they can be narrowed to Decimal.\n// oxlint-disable-next-line anti-slop/no-unknown-parameters\nexport function isDecimalValue(value: unknown): value is Decimal {\n if (!Decimal.isDecimal(value)) return false;\n if (isNativeDecimal(value)) return true;\n const prototype = Object.getPrototypeOf(value);\n if (!prototype || prototype === Object.prototype || typeof value.toExponential !== \"function\")\n return false;\n try {\n // Decimal.isDecimal uses a public marker, so also require an actual\n // decimal.js operation to produce a parseable canonical representation.\n new PricingDecimal(value.toExponential());\n return true;\n } catch {\n return false;\n }\n}\n\n/** Copy even existing Decimal instances so arithmetic uses the pricing context. */\nexport function pricingDecimal(value: Decimal.Value): Decimal {\n if (Decimal.isDecimal(value) && !isNativeDecimal(value)) {\n if (!isDecimalValue(value)) throw new TypeError(\"Invalid Decimal value\");\n return new PricingDecimal(value.toExponential());\n }\n return new PricingDecimal(value);\n}\n"]}
@@ -8,7 +8,7 @@ export type DodoBetterAuthWebhookPayload = Parameters<OfficialOnPayload>[0];
8
8
  export interface DodoBetterAuthWebhookAdapterConfig {
9
9
  webhookKey: string;
10
10
  eventHandlers?: Omit<OfficialWebhookConfig, "webhookKey" | "onPayload">;
11
- onPayload(payload: DodoBetterAuthWebhookPayload): Promise<void>;
11
+ onPayload(payload: DodoBetterAuthWebhookPayload, verifiedPayload?: DodoBetterAuthWebhookPayload): Promise<void>;
12
12
  }
13
13
  export type DodoBetterAuthWebhookAdapter = (config: DodoBetterAuthWebhookAdapterConfig) => DodoBetterAuthWebhookPlugin;
14
14
  export interface DodoBetterAuthWebhookCoreOptions extends DodoWebhookBridgeOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"better-auth-core.d.ts","sourceRoot":"","sources":["../../../src/providers/dodo/better-auth-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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
  return adapter({
6
6
  webhookKey,
7
7
  eventHandlers,
8
- onPayload: async (payload) => {
9
- const result = await processPayload(payload);
8
+ onPayload: async (payload, verifiedPayload) => {
9
+ const result = await processPayload(verifiedPayload ?? payload);
10
10
  await onProcessed?.(result, payload);
11
11
  },
12
12
  });
@@ -1 +1 @@
1
- {"version":3,"file":"better-auth-core.js","sourceRoot":"","sources":["../../../src/providers/dodo/better-auth-core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAiC,MAAM,qBAAqB,CAAC;AA4B7F,MAAM,UAAU,0BAA0B,CAAC,OAAyC;IAClF,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IACtF,MAAM,cAAc,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;QACb,UAAU;QACV,aAAa;QACb,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { WebhookResult } from \"../types.js\";\nimport { createDodoWebhookBridge, type DodoWebhookBridgeOptions } from \"./webhook-bridge.js\";\n\ntype OfficialDodoWebhooks = typeof import(\"@dodopayments/better-auth\").webhooks;\ntype OfficialWebhookConfig = Parameters<OfficialDodoWebhooks>[0];\ntype OfficialOnPayload = NonNullable<OfficialWebhookConfig[\"onPayload\"]>;\nexport type DodoBetterAuthWebhookPlugin = ReturnType<OfficialDodoWebhooks>;\nexport type DodoBetterAuthWebhookPayload = Parameters<OfficialOnPayload>[0];\n\nexport interface DodoBetterAuthWebhookAdapterConfig {\n webhookKey: string;\n eventHandlers?: Omit<OfficialWebhookConfig, \"webhookKey\" | \"onPayload\">;\n onPayload(payload: DodoBetterAuthWebhookPayload): Promise<void>;\n}\n\nexport type DodoBetterAuthWebhookAdapter = (\n config: DodoBetterAuthWebhookAdapterConfig,\n) => DodoBetterAuthWebhookPlugin;\n\nexport interface DodoBetterAuthWebhookCoreOptions extends DodoWebhookBridgeOptions {\n webhookKey: string;\n eventHandlers?: Omit<OfficialWebhookConfig, \"webhookKey\" | \"onPayload\">;\n onProcessed?: (\n result: WebhookResult,\n payload: DodoBetterAuthWebhookPayload,\n ) => void | Promise<void>;\n adapter: DodoBetterAuthWebhookAdapter;\n}\n\nexport function dodoBetterAuthWebhooksCore(options: DodoBetterAuthWebhookCoreOptions) {\n const { webhookKey, eventHandlers, onProcessed, adapter, ...bridgeOptions } = options;\n const processPayload = createDodoWebhookBridge(bridgeOptions);\n return adapter({\n webhookKey,\n eventHandlers,\n onPayload: async (payload) => {\n const result = await processPayload(payload);\n await onProcessed?.(result, payload);\n },\n });\n}\n"]}
1
+ {"version":3,"file":"better-auth-core.js","sourceRoot":"","sources":["../../../src/providers/dodo/better-auth-core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAiC,MAAM,qBAAqB,CAAC;AA+B7F,MAAM,UAAU,0BAA0B,CAAC,OAAyC;IAClF,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IACtF,MAAM,cAAc,GAAG,uBAAuB,CAAC,aAAa,CAAC,CAAC;IAC9D,OAAO,OAAO,CAAC;QACb,UAAU;QACV,aAAa;QACb,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE;YAC5C,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;YAChE,MAAM,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { WebhookResult } from \"../types.js\";\nimport { createDodoWebhookBridge, type DodoWebhookBridgeOptions } from \"./webhook-bridge.js\";\n\ntype OfficialDodoWebhooks = typeof import(\"@dodopayments/better-auth\").webhooks;\ntype OfficialWebhookConfig = Parameters<OfficialDodoWebhooks>[0];\ntype OfficialOnPayload = NonNullable<OfficialWebhookConfig[\"onPayload\"]>;\nexport type DodoBetterAuthWebhookPlugin = ReturnType<OfficialDodoWebhooks>;\nexport type DodoBetterAuthWebhookPayload = Parameters<OfficialOnPayload>[0];\n\nexport interface DodoBetterAuthWebhookAdapterConfig {\n webhookKey: string;\n eventHandlers?: Omit<OfficialWebhookConfig, \"webhookKey\" | \"onPayload\">;\n onPayload(\n payload: DodoBetterAuthWebhookPayload,\n verifiedPayload?: DodoBetterAuthWebhookPayload,\n ): Promise<void>;\n}\n\nexport type DodoBetterAuthWebhookAdapter = (\n config: DodoBetterAuthWebhookAdapterConfig,\n) => DodoBetterAuthWebhookPlugin;\n\nexport interface DodoBetterAuthWebhookCoreOptions extends DodoWebhookBridgeOptions {\n webhookKey: string;\n eventHandlers?: Omit<OfficialWebhookConfig, \"webhookKey\" | \"onPayload\">;\n onProcessed?: (\n result: WebhookResult,\n payload: DodoBetterAuthWebhookPayload,\n ) => void | Promise<void>;\n adapter: DodoBetterAuthWebhookAdapter;\n}\n\nexport function dodoBetterAuthWebhooksCore(options: DodoBetterAuthWebhookCoreOptions) {\n const { webhookKey, eventHandlers, onProcessed, adapter, ...bridgeOptions } = options;\n const processPayload = createDodoWebhookBridge(bridgeOptions);\n return adapter({\n webhookKey,\n eventHandlers,\n onPayload: async (payload, verifiedPayload) => {\n const result = await processPayload(verifiedPayload ?? payload);\n await onProcessed?.(result, payload);\n },\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"better-auth.d.ts","sourceRoot":"","sources":["../../../src/providers/dodo/better-auth.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,mCAAmC,C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,EAAE,MAAM,qBAAqB,CAAC;AAEpE,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,4BAA4B,EAC5B,2BAA2B,GAC5B,CAAC;AACF,MAAM,MAAM,kCAAkC,GAAG,WAAW,CAC1D,kCAAkC,CAAC,eAAe,CAAC,CACpD,CAAC;AAEF,MAAM,WAAW,4BAA6B,SAAQ,wBAAwB;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,kCAAkC,CAAC;IACnD,WAAW,CAAC,EAAE,CACZ,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,4BAA4B,KAClC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,CAAC,EAAE,4BAA4B,CAAC;CACxC;AAED,0EAA0E;AAC1E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,4BAA4B;;;;;;;;EAiC3E;AAED,4EAA4E;AAC5E,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,oBAAoB,GACzB,0BAA0B,GAAG,IAAI,CAInC"}
@@ -1,16 +1,30 @@
1
1
  import { webhooks as officialDodoWebhooks } from "@dodopayments/better-auth";
2
2
  import { z } from "zod";
3
3
  import { dodoBetterAuthWebhooksCore, } from "./better-auth-core.js";
4
+ import { restoreVerifiedPaymentFields } from "./verified-payment-payload.js";
4
5
  /** Build a Better Auth Dodo webhook plugin backed by Bursar ingestion. */
5
6
  export function dodoBetterAuthWebhooks(options) {
6
7
  const { adapter, ...coreOptions } = options;
7
8
  const createPlugin = adapter ??
8
9
  ((config) => {
9
- return officialDodoWebhooks({
10
+ const official = (onPayload) => officialDodoWebhooks({
10
11
  ...config.eventHandlers,
11
12
  webhookKey: config.webhookKey,
12
- onPayload: config.onPayload,
13
+ onPayload,
13
14
  });
15
+ return (pluginConfig) => {
16
+ const plugin = official(config.onPayload)(pluginConfig);
17
+ const endpoint = plugin.dodopaymentsWebhooks;
18
+ const wrapped = Object.assign(async (...args) => {
19
+ const request = args[0]?.request;
20
+ if (!request)
21
+ return endpoint(...args);
22
+ const signedBody = await request.clone().text();
23
+ const scoped = official((payload) => config.onPayload(payload, restoreVerifiedPaymentFields(payload, signedBody)))(pluginConfig);
24
+ return scoped.dodopaymentsWebhooks(...args);
25
+ }, endpoint);
26
+ return { ...plugin, dodopaymentsWebhooks: wrapped };
27
+ };
14
28
  });
15
29
  return dodoBetterAuthWebhooksCore({
16
30
  ...coreOptions,
@@ -1 +1 @@
1
- {"version":3,"file":"better-auth.js","sourceRoot":"","sources":["../../../src/providers/dodo/better-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,0BAA0B,GAK3B,MAAM,uBAAuB,CAAC;AAuB/B,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB,CAAC,OAAqC;IAC1E,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,YAAY,GAChB,OAAO;QACP,CAAC,CAAC,MAAM,EAAE,EAAE;YACV,OAAO,oBAAoB,CAAC;gBAC1B,GAAG,MAAM,CAAC,aAAa;gBACvB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,OAAO,0BAA0B,CAAC;QAChC,GAAG,WAAW;QACd,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;AACL,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CACpC,IAA0B;IAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC;IACvC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/E,CAAC","sourcesContent":["import { webhooks as officialDodoWebhooks } from \"@dodopayments/better-auth\";\nimport { z } from \"zod\";\n\nimport type {\n BetterAuthBursarUser,\n BetterAuthProviderCustomer,\n} from \"../../integrations/better-auth.js\";\nimport type { WebhookResult } from \"../types.js\";\nimport {\n dodoBetterAuthWebhooksCore,\n type DodoBetterAuthWebhookAdapter,\n type DodoBetterAuthWebhookAdapterConfig,\n type DodoBetterAuthWebhookPayload,\n type DodoBetterAuthWebhookPlugin,\n} from \"./better-auth-core.js\";\nimport type { DodoWebhookBridgeOptions } from \"./webhook-bridge.js\";\n\nexport type {\n DodoBetterAuthWebhookAdapter,\n DodoBetterAuthWebhookAdapterConfig,\n DodoBetterAuthWebhookPayload,\n DodoBetterAuthWebhookPlugin,\n};\nexport type DodoBetterAuthWebhookEventHandlers = NonNullable<\n DodoBetterAuthWebhookAdapterConfig[\"eventHandlers\"]\n>;\n\nexport interface DodoBetterAuthWebhookOptions extends DodoWebhookBridgeOptions {\n webhookKey: string;\n eventHandlers?: DodoBetterAuthWebhookEventHandlers;\n onProcessed?: (\n result: WebhookResult,\n payload: DodoBetterAuthWebhookPayload,\n ) => void | Promise<void>;\n adapter?: DodoBetterAuthWebhookAdapter;\n}\n\n/** Build a Better Auth Dodo webhook plugin backed by Bursar ingestion. */\nexport function dodoBetterAuthWebhooks(options: DodoBetterAuthWebhookOptions) {\n const { adapter, ...coreOptions } = options;\n const createPlugin: DodoBetterAuthWebhookAdapter =\n adapter ??\n ((config) => {\n return officialDodoWebhooks({\n ...config.eventHandlers,\n webhookKey: config.webhookKey,\n onPayload: config.onPayload,\n });\n });\n return dodoBetterAuthWebhooksCore({\n ...coreOptions,\n adapter: createPlugin,\n });\n}\n\n/** Resolve the customer field maintained by `@dodopayments/better-auth`. */\nexport function dodoBetterAuthCustomer(\n user: BetterAuthBursarUser,\n): BetterAuthProviderCustomer | null {\n const customerId = user.dodoCustomerId;\n const parsed = z.string().trim().min(1).safeParse(customerId);\n return parsed.success ? { provider: \"dodo\", customerId: parsed.data } : null;\n}\n"]}
1
+ {"version":3,"file":"better-auth.js","sourceRoot":"","sources":["../../../src/providers/dodo/better-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EACL,0BAA0B,GAK3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAuB7E,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB,CAAC,OAAqC;IAC1E,MAAM,EAAE,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,YAAY,GAChB,OAAO;QACP,CAAC,CAAC,MAAM,EAAE,EAAE;YACV,MAAM,QAAQ,GAAG,CAAC,SAAkC,EAAE,EAAE,CACtD,oBAAoB,CAAC;gBACnB,GAAG,MAAM,CAAC,aAAa;gBACvB,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,SAAS;aACV,CAAC,CAAC;YACL,OAAO,CAAC,YAAY,EAAE,EAAE;gBACtB,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAC;gBACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,oBAAoB,CAAC;gBAC7C,MAAM,OAAO,GAAoB,MAAM,CAAC,MAAM,CAC5C,KAAK,EAAE,GAAG,IAAiC,EAAE,EAAE;oBAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;oBACjC,IAAI,CAAC,OAAO;wBAAE,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;oBACvC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;oBAChD,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAClC,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,4BAA4B,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAC7E,CAAC,YAAY,CAAC,CAAC;oBAChB,OAAO,MAAM,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,CAAC;gBAC9C,CAAC,EACD,QAAQ,CACT,CAAC;gBACF,OAAO,EAAE,GAAG,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC;YACtD,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,OAAO,0BAA0B,CAAC;QAChC,GAAG,WAAW;QACd,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC;AACL,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,sBAAsB,CACpC,IAA0B;IAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC;IACvC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/E,CAAC","sourcesContent":["import { webhooks as officialDodoWebhooks } from \"@dodopayments/better-auth\";\nimport { z } from \"zod\";\n\nimport type {\n BetterAuthBursarUser,\n BetterAuthProviderCustomer,\n} from \"../../integrations/better-auth.js\";\nimport type { WebhookResult } from \"../types.js\";\nimport {\n dodoBetterAuthWebhooksCore,\n type DodoBetterAuthWebhookAdapter,\n type DodoBetterAuthWebhookAdapterConfig,\n type DodoBetterAuthWebhookPayload,\n type DodoBetterAuthWebhookPlugin,\n} from \"./better-auth-core.js\";\nimport { restoreVerifiedPaymentFields } from \"./verified-payment-payload.js\";\nimport type { DodoWebhookBridgeOptions } from \"./webhook-bridge.js\";\n\nexport type {\n DodoBetterAuthWebhookAdapter,\n DodoBetterAuthWebhookAdapterConfig,\n DodoBetterAuthWebhookPayload,\n DodoBetterAuthWebhookPlugin,\n};\nexport type DodoBetterAuthWebhookEventHandlers = NonNullable<\n DodoBetterAuthWebhookAdapterConfig[\"eventHandlers\"]\n>;\n\nexport interface DodoBetterAuthWebhookOptions extends DodoWebhookBridgeOptions {\n webhookKey: string;\n eventHandlers?: DodoBetterAuthWebhookEventHandlers;\n onProcessed?: (\n result: WebhookResult,\n payload: DodoBetterAuthWebhookPayload,\n ) => void | Promise<void>;\n adapter?: DodoBetterAuthWebhookAdapter;\n}\n\n/** Build a Better Auth Dodo webhook plugin backed by Bursar ingestion. */\nexport function dodoBetterAuthWebhooks(options: DodoBetterAuthWebhookOptions) {\n const { adapter, ...coreOptions } = options;\n const createPlugin: DodoBetterAuthWebhookAdapter =\n adapter ??\n ((config) => {\n const official = (onPayload: typeof config.onPayload) =>\n officialDodoWebhooks({\n ...config.eventHandlers,\n webhookKey: config.webhookKey,\n onPayload,\n });\n return (pluginConfig) => {\n const plugin = official(config.onPayload)(pluginConfig);\n const endpoint = plugin.dodopaymentsWebhooks;\n const wrapped: typeof endpoint = Object.assign(\n async (...args: Parameters<typeof endpoint>) => {\n const request = args[0]?.request;\n if (!request) return endpoint(...args);\n const signedBody = await request.clone().text();\n const scoped = official((payload) =>\n config.onPayload(payload, restoreVerifiedPaymentFields(payload, signedBody)),\n )(pluginConfig);\n return scoped.dodopaymentsWebhooks(...args);\n },\n endpoint,\n );\n return { ...plugin, dodopaymentsWebhooks: wrapped };\n };\n });\n return dodoBetterAuthWebhooksCore({\n ...coreOptions,\n adapter: createPlugin,\n });\n}\n\n/** Resolve the customer field maintained by `@dodopayments/better-auth`. */\nexport function dodoBetterAuthCustomer(\n user: BetterAuthBursarUser,\n): BetterAuthProviderCustomer | null {\n const customerId = user.dodoCustomerId;\n const parsed = z.string().trim().min(1).safeParse(customerId);\n return parsed.success ? { provider: \"dodo\", customerId: parsed.data } : null;\n}\n"]}
@@ -6,6 +6,6 @@ type DodoDateInput = ExternalValue;
6
6
  /** Dodo sometimes sends dates in JS toString() format (e.g. "Sat Jul 18 2026 05:15:24 GMT+0000..."). Normalize to ISO 8601. */
7
7
  export declare function normalizeDate(raw: DodoDateInput): string | null;
8
8
  export declare function dodoBillingEventId<TData>(payload: DodoWebhookEnvelope<TData>): string;
9
- export declare function handleDodoBillingEvent<TData>(payload: DodoWebhookEnvelope<TData>, accountId: string | null, metadata: Record<string, string>, sink: BillingEventSink, logger?: ProviderLogger | null): Promise<void>;
9
+ export declare function handleDodoBillingEvent<TData>(payload: DodoWebhookEnvelope<TData>, accountId: string | null, metadata: Record<string, string>, sink: BillingEventSink, logger?: ProviderLogger | null, exactRawTimestamp?: boolean): Promise<void>;
10
10
  export {};
11
11
  //# 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":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAOxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,KAAK,cAAc,EAA2B,MAAM,aAAa,CAAC;AAoB3E,KAAK,aAAa,GAAG,aAAa,CAAC;AA6CnC,+HAA+H;AAC/H,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAY/D;AAoBD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,mB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