@openrails/billing-ui 0.282.0 → 0.283.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 (215) hide show
  1. package/README.md +108 -364
  2. package/dist/account/format.d.ts +5 -1
  3. package/dist/admin/context.d.ts +38 -46
  4. package/dist/admin/lib/api/endpoints.d.ts +4 -4
  5. package/dist/admin/lib/api/index.d.ts +4 -4
  6. package/dist/admin/lib/api/metrics.d.ts +15 -6
  7. package/dist/admin/lib/capabilities.d.ts +2 -0
  8. package/dist/admin/lib/format.d.ts +29 -1
  9. package/dist/admin/lib/mutations.d.ts +0 -10
  10. package/dist/admin/lib/queries.d.ts +16 -10
  11. package/dist/admin/messages.d.ts +61 -20
  12. package/dist/admin/pages/catalog/price-wizard-logic.d.ts +2 -0
  13. package/dist/admin/pages/catalog/price-wizard.d.ts +1 -3
  14. package/dist/admin/pages/customers/credits.d.ts +4 -1
  15. package/dist/admin/pages/dashboard/levels.d.ts +8 -0
  16. package/dist/admin/pages/dashboard/lib.d.ts +16 -7
  17. package/dist/admin/pages/dashboard/programs.d.ts +3 -0
  18. package/dist/admin/pages/dashboard/query-builder.d.ts +20 -0
  19. package/dist/admin/pages/dashboard/range.d.ts +8 -2
  20. package/dist/admin/pages/dashboard/registry.d.ts +14 -0
  21. package/dist/admin/pages/dashboard/reports-model.d.ts +8 -4
  22. package/dist/admin/pages/dashboard/reports.d.ts +1 -1
  23. package/dist/admin/pages/dashboard/units.d.ts +5 -0
  24. package/dist/admin/pages/dashboard/use-range.d.ts +5 -1
  25. package/dist/admin/pages/dashboard/widget-editor.d.ts +7 -2
  26. package/dist/admin/pages/dashboard/widget-tile.d.ts +10 -4
  27. package/dist/admin/pages/dashboard/widget-viz.d.ts +10 -5
  28. package/dist/admin/pages/ops/signals.d.ts +4 -0
  29. package/dist/admin/pages/payments/attempts.d.ts +2 -2
  30. package/dist/admin/pages/payments/health-model.d.ts +20 -20
  31. package/dist/admin/pages/subscriptions/views.d.ts +4 -0
  32. package/dist/admin-attempts-CRkxeVfQ.js +417 -0
  33. package/dist/admin-attempts-CRkxeVfQ.js.map +1 -0
  34. package/dist/{admin-auth-CTLBqp7N.js → admin-auth-C0pBH3kp.js} +2 -2
  35. package/dist/{admin-auth-CTLBqp7N.js.map → admin-auth-C0pBH3kp.js.map} +1 -1
  36. package/dist/{admin-badge-3zABrSBc.js → admin-badge-C_-j7ANF.js} +2 -2
  37. package/dist/{admin-badge-3zABrSBc.js.map → admin-badge-C_-j7ANF.js.map} +1 -1
  38. package/dist/{admin-button-FRNl7_Yf.js → admin-button-BV5MAL2H.js} +2 -2
  39. package/dist/{admin-button-FRNl7_Yf.js.map → admin-button-BV5MAL2H.js.map} +1 -1
  40. package/dist/{admin-capabilities-uSi2Pb2h.js → admin-capabilities-B3ZfkA49.js} +21 -13
  41. package/dist/admin-capabilities-B3ZfkA49.js.map +1 -0
  42. package/dist/{admin-card-YKPGmx5w.js → admin-card-DQ61c-kV.js} +2 -2
  43. package/dist/{admin-card-YKPGmx5w.js.map → admin-card-DQ61c-kV.js.map} +1 -1
  44. package/dist/admin-catalog-DAnsClai.js +867 -0
  45. package/dist/admin-catalog-DAnsClai.js.map +1 -0
  46. package/dist/{admin-cursor-pager-BGgOOq7s.js → admin-cursor-pager-dkNj-gb6.js} +22 -22
  47. package/dist/{admin-cursor-pager-BGgOOq7s.js.map → admin-cursor-pager-dkNj-gb6.js.map} +1 -1
  48. package/dist/admin-customer-search-DDMn_5Us.js +115 -0
  49. package/dist/admin-customer-search-DDMn_5Us.js.map +1 -0
  50. package/dist/{admin-customers-DFQ75ZBi.js → admin-customers-BMaugwpg.js} +24 -25
  51. package/dist/admin-customers-BMaugwpg.js.map +1 -0
  52. package/dist/admin-dashboard-DbbfrIOq.js +510 -0
  53. package/dist/admin-dashboard-DbbfrIOq.js.map +1 -0
  54. package/dist/{admin-data-table-DyYm4h_Y.js → admin-data-table-BjA8cBsr.js} +5 -5
  55. package/dist/{admin-data-table-DyYm4h_Y.js.map → admin-data-table-BjA8cBsr.js.map} +1 -1
  56. package/dist/admin-detail-BVJcnTO-.js +1361 -0
  57. package/dist/admin-detail-BVJcnTO-.js.map +1 -0
  58. package/dist/{admin-detail-CG3kLIDS.js → admin-detail-DO9wd12I.js} +130 -107
  59. package/dist/admin-detail-DO9wd12I.js.map +1 -0
  60. package/dist/{admin-detail-SLijWf4F.js → admin-detail-M7YFYOGN.js} +211 -210
  61. package/dist/{admin-detail-SLijWf4F.js.map → admin-detail-M7YFYOGN.js.map} +1 -1
  62. package/dist/admin-detail-sOLj-K-Y.js +336 -0
  63. package/dist/{admin-detail-wttCvrxI.js.map → admin-detail-sOLj-K-Y.js.map} +1 -1
  64. package/dist/admin-detail-uZ-eR2TT.js +292 -0
  65. package/dist/{admin-detail-BytmF-e3.js.map → admin-detail-uZ-eR2TT.js.map} +1 -1
  66. package/dist/{admin-dialog-BVx92baz.js → admin-dialog-BxRcYcQM.js} +3 -3
  67. package/dist/{admin-dialog-BVx92baz.js.map → admin-dialog-BxRcYcQM.js.map} +1 -1
  68. package/dist/{admin-dropdown-menu-BV7vxYr9.js → admin-dropdown-menu-DlyaKwyU.js} +2 -2
  69. package/dist/{admin-dropdown-menu-BV7vxYr9.js.map → admin-dropdown-menu-DlyaKwyU.js.map} +1 -1
  70. package/dist/{admin-dunning-D8lAP7OA.js → admin-dunning-CDy6aMAj.js} +2 -2
  71. package/dist/{admin-dunning-D8lAP7OA.js.map → admin-dunning-CDy6aMAj.js.map} +1 -1
  72. package/dist/{admin-fact-card-CTQyFmQY.js → admin-fact-card-2DujC_r3.js} +2 -2
  73. package/dist/{admin-fact-card-CTQyFmQY.js.map → admin-fact-card-2DujC_r3.js.map} +1 -1
  74. package/dist/{admin-utils-CuwG3SAt.js → admin-format-Bc4NWK0F.js} +491 -328
  75. package/dist/admin-format-Bc4NWK0F.js.map +1 -0
  76. package/dist/{admin-health-DWpONa-7.js → admin-health-DePsyIlc.js} +217 -196
  77. package/dist/admin-health-DePsyIlc.js.map +1 -0
  78. package/dist/{admin-imports-Dsd5QmAe.js → admin-imports-BrQH3u9M.js} +85 -86
  79. package/dist/{admin-imports-Dsd5QmAe.js.map → admin-imports-BrQH3u9M.js.map} +1 -1
  80. package/dist/{admin-input-DhYEd7Yp.js → admin-input-BZ2ExV_5.js} +2 -2
  81. package/dist/{admin-input-DhYEd7Yp.js.map → admin-input-BZ2ExV_5.js.map} +1 -1
  82. package/dist/{admin-label-DwUfUVm6.js → admin-label-DecDO0oV.js} +2 -2
  83. package/dist/{admin-label-DwUfUVm6.js.map → admin-label-DecDO0oV.js.map} +1 -1
  84. package/dist/{admin-linked-table-row-CqG_aCwd.js → admin-linked-table-row-ChxhVptQ.js} +3 -3
  85. package/dist/{admin-linked-table-row-CqG_aCwd.js.map → admin-linked-table-row-ChxhVptQ.js.map} +1 -1
  86. package/dist/{admin-map-dialog-DZuPq4UA.js → admin-map-dialog-CQmGOBMw.js} +12 -12
  87. package/dist/{admin-map-dialog-DZuPq4UA.js.map → admin-map-dialog-CQmGOBMw.js.map} +1 -1
  88. package/dist/admin-metering-OXGOVQ7e.js +1716 -0
  89. package/dist/{admin-metering-kGrQIiEX.js.map → admin-metering-OXGOVQ7e.js.map} +1 -1
  90. package/dist/{admin-missing-record-CjIQEv9L.js → admin-missing-record-B_9LpSIW.js} +4 -4
  91. package/dist/{admin-missing-record-CjIQEv9L.js.map → admin-missing-record-B_9LpSIW.js.map} +1 -1
  92. package/dist/admin-ops-BTSunx1i.js +357 -0
  93. package/dist/{admin-ops-B1Gwrsq6.js.map → admin-ops-BTSunx1i.js.map} +1 -1
  94. package/dist/{admin-orders-DRpUMK7N.js → admin-orders-LqlpQVFo.js} +59 -60
  95. package/dist/{admin-orders-DRpUMK7N.js.map → admin-orders-LqlpQVFo.js.map} +1 -1
  96. package/dist/{admin-parked-uH5dSPjL.js → admin-parked-Ch6mlS5f.js} +61 -62
  97. package/dist/{admin-parked-uH5dSPjL.js.map → admin-parked-Ch6mlS5f.js.map} +1 -1
  98. package/dist/{admin-payments-DFW5O19Q.js → admin-payments-yNntF4i4.js} +42 -42
  99. package/dist/{admin-payments-DFW5O19Q.js.map → admin-payments-yNntF4i4.js.map} +1 -1
  100. package/dist/{admin-price-detail-CaUekDWP.js → admin-price-detail-DvmcYr8B.js} +131 -132
  101. package/dist/admin-price-detail-DvmcYr8B.js.map +1 -0
  102. package/dist/{admin-price-format-BrXm8J1w.js → admin-price-format-Btdg11-J.js} +2 -2
  103. package/dist/{admin-price-format-BrXm8J1w.js.map → admin-price-format-Btdg11-J.js.map} +1 -1
  104. package/dist/admin-price-wizard-EFO3nBV8.js +376 -0
  105. package/dist/admin-price-wizard-EFO3nBV8.js.map +1 -0
  106. package/dist/{admin-proposals-BuPBTbX7.js → admin-proposals-CO0LKHM8.js} +119 -120
  107. package/dist/{admin-proposals-BuPBTbX7.js.map → admin-proposals-CO0LKHM8.js.map} +1 -1
  108. package/dist/admin-provider-prices-ZjQeEV1n.js +239 -0
  109. package/dist/{admin-provider-prices-BtyrGlSd.js.map → admin-provider-prices-ZjQeEV1n.js.map} +1 -1
  110. package/dist/admin-query-builder-DedekYUU.js +252 -0
  111. package/dist/admin-query-builder-DedekYUU.js.map +1 -0
  112. package/dist/{admin-range-picker-B1C1R9Yh.js → admin-range-picker-1WGFlYYw.js} +46 -24
  113. package/dist/admin-range-picker-1WGFlYYw.js.map +1 -0
  114. package/dist/admin-records-A2R52prt.js +389 -0
  115. package/dist/{admin-records-CZ_Q1j7i.js.map → admin-records-A2R52prt.js.map} +1 -1
  116. package/dist/admin-reports-ySY9v463.js +420 -0
  117. package/dist/admin-reports-ySY9v463.js.map +1 -0
  118. package/dist/{admin-select-CCliJ9d-.js → admin-select-CgZq2j0G.js} +2 -2
  119. package/dist/{admin-select-CCliJ9d-.js.map → admin-select-CgZq2j0G.js.map} +1 -1
  120. package/dist/admin-settings-kOW1nPGB.js +1818 -0
  121. package/dist/admin-settings-kOW1nPGB.js.map +1 -0
  122. package/dist/{admin-shared-Bozlh9cy.js → admin-shared-DoBOSwkv.js} +33 -34
  123. package/dist/{admin-shared-Bozlh9cy.js.map → admin-shared-DoBOSwkv.js.map} +1 -1
  124. package/dist/admin-signals-D_iWk2r5.js +124 -0
  125. package/dist/admin-signals-D_iWk2r5.js.map +1 -0
  126. package/dist/{admin-skeleton-CKxohm-g.js → admin-skeleton-DdqwXcr4.js} +2 -2
  127. package/dist/{admin-skeleton-CKxohm-g.js.map → admin-skeleton-DdqwXcr4.js.map} +1 -1
  128. package/dist/{admin-status-badge-BhHyBG8J.js → admin-status-badge-B8rjk6QR.js} +5 -3
  129. package/dist/admin-status-badge-B8rjk6QR.js.map +1 -0
  130. package/dist/{admin-subscriptions-VwEbVACW.js → admin-subscriptions-CjYPSPs-.js} +43 -38
  131. package/dist/admin-subscriptions-CjYPSPs-.js.map +1 -0
  132. package/dist/{admin-switch-CE0N-HwZ.js → admin-switch-CyYmt8wi.js} +2 -2
  133. package/dist/{admin-switch-CE0N-HwZ.js.map → admin-switch-CyYmt8wi.js.map} +1 -1
  134. package/dist/{admin-table-Ce6xyiwJ.js → admin-table-ByPfWNq8.js} +2 -2
  135. package/dist/{admin-table-Ce6xyiwJ.js.map → admin-table-ByPfWNq8.js.map} +1 -1
  136. package/dist/admin-tabs-DKa6QljL.js +45 -0
  137. package/dist/admin-tabs-DKa6QljL.js.map +1 -0
  138. package/dist/{admin-textarea-CBAshts8.js → admin-textarea-CQg__KGc.js} +2 -2
  139. package/dist/{admin-textarea-CBAshts8.js.map → admin-textarea-CQg__KGc.js.map} +1 -1
  140. package/dist/{admin-typed-confirm-dialog-C1kHdYgH.js → admin-typed-confirm-dialog-BvAYEh3H.js} +6 -6
  141. package/dist/{admin-typed-confirm-dialog-C1kHdYgH.js.map → admin-typed-confirm-dialog-BvAYEh3H.js.map} +1 -1
  142. package/dist/admin-widget-tile-DDI3eaRy.js +290 -0
  143. package/dist/admin-widget-tile-DDI3eaRy.js.map +1 -0
  144. package/dist/admin-widget-viz-Db9CQ2Sx.js +1084 -0
  145. package/dist/admin-widget-viz-Db9CQ2Sx.js.map +1 -0
  146. package/dist/admin.css +1 -1
  147. package/dist/admin.js +660 -609
  148. package/dist/admin.js.map +1 -1
  149. package/dist/buy-button.d.ts +4 -2
  150. package/dist/cart.d.ts +4 -2
  151. package/dist/client/client.d.ts +16 -3
  152. package/dist/client/generated/error-codes.d.ts +1 -1
  153. package/dist/client/generated/routes.d.ts +296 -181
  154. package/dist/client/generated/wire.d.ts +509 -277
  155. package/dist/client/index.d.ts +1 -1
  156. package/dist/client/types.d.ts +70 -6
  157. package/dist/{client-BrURpRWz.js → client-D8qT6xjo.js} +84 -44
  158. package/dist/client-D8qT6xjo.js.map +1 -0
  159. package/dist/client.js +1 -1
  160. package/dist/components/billing-fields.d.ts +5 -3
  161. package/dist/components/platform-card-form.d.ts +3 -1
  162. package/dist/{hooks-Bbp1RWgw.js → hooks-CX09fAJA.js} +86 -60
  163. package/dist/hooks-CX09fAJA.js.map +1 -0
  164. package/dist/index.d.ts +1 -1
  165. package/dist/index.js +842 -779
  166. package/dist/index.js.map +1 -1
  167. package/dist/lib/billing-fields.d.ts +15 -0
  168. package/dist/lib/billing.d.ts +23 -5
  169. package/dist/product-list.d.ts +4 -2
  170. package/dist/react/config.d.ts +10 -2
  171. package/dist/react/index.d.ts +1 -1
  172. package/dist/react.js +1 -1
  173. package/dist/styles.css +1 -1
  174. package/dist/tokenized-card-form.d.ts +10 -2
  175. package/docs/payment-form-contract.md +6 -15
  176. package/package.json +6 -6
  177. package/dist/admin/lib/api/copilot.d.ts +0 -6
  178. package/dist/admin/pages/catalog/copilot-panel.d.ts +0 -4
  179. package/dist/admin-attempts-Cs2u-BLY.js +0 -418
  180. package/dist/admin-attempts-Cs2u-BLY.js.map +0 -1
  181. package/dist/admin-capabilities-uSi2Pb2h.js.map +0 -1
  182. package/dist/admin-catalog-DB5lr46V.js +0 -1096
  183. package/dist/admin-catalog-DB5lr46V.js.map +0 -1
  184. package/dist/admin-customers-DFQ75ZBi.js.map +0 -1
  185. package/dist/admin-dashboard-Q_4-OFsE.js +0 -461
  186. package/dist/admin-dashboard-Q_4-OFsE.js.map +0 -1
  187. package/dist/admin-detail-BytmF-e3.js +0 -293
  188. package/dist/admin-detail-CG3kLIDS.js.map +0 -1
  189. package/dist/admin-detail-RS0o4-Cq.js +0 -1351
  190. package/dist/admin-detail-RS0o4-Cq.js.map +0 -1
  191. package/dist/admin-detail-wttCvrxI.js +0 -337
  192. package/dist/admin-format-D9Ablh0P.js +0 -169
  193. package/dist/admin-format-D9Ablh0P.js.map +0 -1
  194. package/dist/admin-health-DWpONa-7.js.map +0 -1
  195. package/dist/admin-metering-kGrQIiEX.js +0 -1717
  196. package/dist/admin-ops-B1Gwrsq6.js +0 -358
  197. package/dist/admin-price-detail-CaUekDWP.js.map +0 -1
  198. package/dist/admin-price-wizard-CCejN6lZ.js +0 -355
  199. package/dist/admin-price-wizard-CCejN6lZ.js.map +0 -1
  200. package/dist/admin-provider-prices-BtyrGlSd.js +0 -240
  201. package/dist/admin-range-picker-B1C1R9Yh.js.map +0 -1
  202. package/dist/admin-records-CZ_Q1j7i.js +0 -390
  203. package/dist/admin-reports-ZDEVF7aC.js +0 -319
  204. package/dist/admin-reports-ZDEVF7aC.js.map +0 -1
  205. package/dist/admin-settings-HBiilJTI.js +0 -1818
  206. package/dist/admin-settings-HBiilJTI.js.map +0 -1
  207. package/dist/admin-status-badge-BhHyBG8J.js.map +0 -1
  208. package/dist/admin-subscriptions-VwEbVACW.js.map +0 -1
  209. package/dist/admin-tabs-BPfOyBa6.js +0 -156
  210. package/dist/admin-tabs-BPfOyBa6.js.map +0 -1
  211. package/dist/admin-utils-CuwG3SAt.js.map +0 -1
  212. package/dist/admin-widget-viz-Dd1Fjd_j.js +0 -643
  213. package/dist/admin-widget-viz-Dd1Fjd_j.js.map +0 -1
  214. package/dist/client-BrURpRWz.js.map +0 -1
  215. package/dist/hooks-Bbp1RWgw.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  export { CANCEL_REASON_MAX, CANCEL_REASON_MIN, createBillingClient, isWalletAction, isWalletRejection, RETRY_BUDGET_MS, signWalletAction, WalletRejectedError, type BillingClient, type BillingClientOptions, type ListOptions, type OrderResult, type SendSolanaTransaction, type SubscriptionChangeInput, type UsageOptions, } from './client';
2
2
  export { redeemAssertion, tokenSource, type RedeemAssertionOptions, type TokenResponse, type TokenSource, type TokenSourceOptions, } from './token-source';
3
3
  export { BillingError, isBillingError, isServerError, readBillingError, toBillingError, transportFailure, type BillingErrorBody, } from './errors';
4
- export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerEntitlement, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, LowBalanceLine, NewCard, CardCaptureReference, NextAction, Order, OrderPaymentAttempt, OrderLine, OrderLineRefusal, OrderPaymentInput, OrderPreviewLine, Page, Payment, PaymentMethod, PaymentRecovery, Price, Product, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangeOption, SubscriptionChangePreview, Usage, UsageRow, } from './types';
4
+ export type { Account, Balance, CaptchaConfig, CardSummary, Cart, Currency, CurrencyScales, CustomerConfig, CustomerEntitlement, CustomerLimit, PaymentConfig, PaymentFailure, PublicConfig, PublicMerchant, ListPage, LowBalanceLine, NewCard, CardCaptureReference, NextAction, Order, OrderAttribution, OrderPaymentAttempt, OrderLine, OrderLineRefusal, OrderPaymentInput, OrderPreviewLine, Page, Payment, PaymentMethod, PaymentRecovery, Price, Product, Subscription, SubscriptionDunning, SubscriptionProduct, SubscriptionStatus, SubscriptionChange, SubscriptionChangeOption, SubscriptionChangePreview, Usage, UsageRow, } from './types';
5
5
  export { amountToDecimal, decimalToAmount, formatAmount, type Amount, } from '../lib/money';
@@ -809,6 +809,17 @@ export type Payment = z.infer<typeof paymentSchema>;
809
809
  */
810
810
  export declare const customerEntitlementSchema: z.ZodType<wire.CustomerEntitlement>;
811
811
  export type CustomerEntitlement = wire.CustomerEntitlement;
812
+ /**
813
+ * Where the customer stands on one limit in its current window, in `unit`:
814
+ * `capacity` (its products' sum or its override, plus adjustments), `used`,
815
+ * `held` by open holds and `remaining`, which may be negative. A window not
816
+ * yet open, a rate and a lifetime limit have no `window_starts_at`;
817
+ * `resets_at` is null when nothing refills it.
818
+ */
819
+ export declare const customerLimitSchema: z.ZodType<wire.CustomerLimit>;
820
+ export type CustomerLimit = wire.CustomerLimit;
821
+ /** Where the host's page says a checkout's customer came from; each field is optional. */
822
+ export type OrderAttribution = Partial<wire.OrderAttribution>;
812
823
  /**
813
824
  * A customer's money in one currency, as of `as_of`. `accrued_amount` is what
814
825
  * its running charges have charged and the ledger does not hold yet, already
@@ -879,8 +890,7 @@ export declare const accountSchema: z.ZodObject<{
879
890
  }, z.core.$strip>;
880
891
  export type Account = z.infer<typeof accountSchema>;
881
892
  /**
882
- * One group of a usage report: its events and their total `amount`.
883
- * `dimensions` are the summed event dimensions when grouped by event type.
893
+ * One group of a usage report: its usage items and their total `amount`.
884
894
  * Grouped by meter, `key` is the meter, `cell` its matrix cell and
885
895
  * `quantity` what it priced.
886
896
  */
@@ -890,7 +900,6 @@ export declare const usageRowSchema: z.ZodObject<{
890
900
  event_count: z.ZodNumber;
891
901
  amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
892
902
  quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
893
- dimensions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
894
903
  }, z.core.$strip>;
895
904
  export type UsageRow = z.infer<typeof usageRowSchema>;
896
905
  /**
@@ -910,7 +919,6 @@ export declare const usageSchema: z.ZodObject<{
910
919
  event_count: z.ZodNumber;
911
920
  amount: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
912
921
  quantity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
913
- dimensions: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
914
922
  }, z.core.$strip>>;
915
923
  next_cursor: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
916
924
  }, z.core.$strip>;
@@ -1062,6 +1070,25 @@ export declare const paymentConfigSchema: z.ZodObject<{
1062
1070
  status?: string | null | undefined;
1063
1071
  retry_after?: number | null | undefined;
1064
1072
  }[] | null | undefined>>;
1073
+ billing_fields: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1074
+ country: z.ZodCatch<z.ZodEnum<{
1075
+ hidden: "hidden";
1076
+ optional: "optional";
1077
+ required: "required";
1078
+ }>>;
1079
+ postal_code: z.ZodCatch<z.ZodEnum<{
1080
+ auto: "auto";
1081
+ hidden: "hidden";
1082
+ optional: "optional";
1083
+ required: "required";
1084
+ }>>;
1085
+ }, z.core.$strip>>>, z.ZodTransform<{
1086
+ country: "hidden" | "optional" | "required";
1087
+ postal_code: "auto" | "hidden" | "optional" | "required";
1088
+ }, {
1089
+ country: "hidden" | "optional" | "required";
1090
+ postal_code: "auto" | "hidden" | "optional" | "required";
1091
+ } | null | undefined>>;
1065
1092
  solana: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1066
1093
  network: z.ZodString;
1067
1094
  chain: z.ZodString;
@@ -1117,8 +1144,9 @@ export declare const publicMerchantSchema: z.ZodObject<{
1117
1144
  export type PublicMerchant = z.infer<typeof publicMerchantSchema>;
1118
1145
  /**
1119
1146
  * What any browser needs to know about the deployment (`GET /config`, no
1120
- * credential): the mount's capabilities, the currency registry and the
1121
- * captcha (null when the deployment challenges nobody).
1147
+ * credential): the mount's capabilities, the currency registry, the captcha
1148
+ * (null when the deployment challenges nobody) and whether it serves usage
1149
+ * (an event store is attached).
1122
1150
  */
1123
1151
  export declare const publicConfigSchema: z.ZodObject<{
1124
1152
  capabilities: z.ZodObject<{
@@ -1145,6 +1173,7 @@ export declare const publicConfigSchema: z.ZodObject<{
1145
1173
  action: z.ZodString;
1146
1174
  token_header: z.ZodString;
1147
1175
  }, z.core.$strip>>>;
1176
+ usage: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
1148
1177
  }, z.core.$strip>;
1149
1178
  export type PublicConfig = z.infer<typeof publicConfigSchema>;
1150
1179
  /**
@@ -1187,6 +1216,25 @@ export declare const customerConfigSchema: z.ZodObject<{
1187
1216
  status?: string | null | undefined;
1188
1217
  retry_after?: number | null | undefined;
1189
1218
  }[] | null | undefined>>;
1219
+ billing_fields: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
1220
+ country: z.ZodCatch<z.ZodEnum<{
1221
+ hidden: "hidden";
1222
+ optional: "optional";
1223
+ required: "required";
1224
+ }>>;
1225
+ postal_code: z.ZodCatch<z.ZodEnum<{
1226
+ auto: "auto";
1227
+ hidden: "hidden";
1228
+ optional: "optional";
1229
+ required: "required";
1230
+ }>>;
1231
+ }, z.core.$strip>>>, z.ZodTransform<{
1232
+ country: "hidden" | "optional" | "required";
1233
+ postal_code: "auto" | "hidden" | "optional" | "required";
1234
+ }, {
1235
+ country: "hidden" | "optional" | "required";
1236
+ postal_code: "auto" | "hidden" | "optional" | "required";
1237
+ } | null | undefined>>;
1190
1238
  solana: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1191
1239
  network: z.ZodString;
1192
1240
  chain: z.ZodString;
@@ -1225,6 +1273,22 @@ export declare const customerConfigSchema: z.ZodObject<{
1225
1273
  embed_origins: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>, z.ZodTransform<string[], string[] | null | undefined>>;
1226
1274
  }, z.core.$strip>;
1227
1275
  client_country: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string | null | undefined>>;
1276
+ currencies: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1277
+ code: z.ZodString;
1278
+ name: z.ZodString;
1279
+ symbol: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1280
+ scale: z.ZodNumber;
1281
+ }, z.core.$strip>>>>, z.ZodTransform<{
1282
+ code: string;
1283
+ name: string;
1284
+ scale: number;
1285
+ symbol?: string | null | undefined;
1286
+ }[], {
1287
+ code: string;
1288
+ name: string;
1289
+ scale: number;
1290
+ symbol?: string | null | undefined;
1291
+ }[] | null | undefined>>;
1228
1292
  }, z.core.$strip>;
1229
1293
  export type CustomerConfig = z.infer<typeof customerConfigSchema>;
1230
1294
  /**
@@ -555,6 +555,16 @@ var pe = e.object({
555
555
  entitlement: e.string(),
556
556
  quantity: e.number().int().nullable()
557
557
  }), he = e.object({
558
+ customer_id: e.string(),
559
+ limit: e.string(),
560
+ unit: e.string(),
561
+ capacity: A,
562
+ used: A,
563
+ held: A,
564
+ remaining: A,
565
+ window_starts_at: j.nullable(),
566
+ resets_at: j.nullable()
567
+ }), ge = e.object({
558
568
  currency: e.string(),
559
569
  billing_mode: e.string(),
560
570
  balance_amount: A,
@@ -574,30 +584,29 @@ var pe = e.object({
574
584
  "merchant",
575
585
  "default"
576
586
  ])
577
- }), ge = e.object({
587
+ }), _e = e.object({
578
588
  id: e.string(),
579
- balances: e.array(he),
589
+ balances: e.array(ge),
580
590
  default_payment_methods: e.array(e.object({
581
591
  currency: e.string(),
582
592
  payment_method_id: e.string()
583
593
  })),
584
594
  low_balance_lines: e.array(W)
585
- }), _e = e.object({
595
+ }), ve = e.object({
586
596
  key: e.string(),
587
597
  cell: e.string().nullish(),
588
598
  event_count: e.number(),
589
599
  amount: A,
590
- quantity: e.number().nullish(),
591
- dimensions: e.record(e.string(), e.number()).nullish()
592
- }), ve = e.object({
600
+ quantity: e.number().nullish()
601
+ }), ye = e.object({
593
602
  customer_id: e.string(),
594
603
  currency: e.string(),
595
604
  from: j,
596
605
  to: j,
597
606
  group_by: e.string(),
598
- rows: e.array(_e),
607
+ rows: e.array(ve),
599
608
  next_cursor: e.string().nullish().transform((e) => e ?? null)
600
- }), ye = e.object({
609
+ }), be = e.object({
601
610
  code: e.string(),
602
611
  decimals: e.number(),
603
612
  minor_decimals: e.number().nullish()
@@ -612,7 +621,7 @@ var pe = e.object({
612
621
  effective: e.string(),
613
622
  is_estimate: e.boolean().nullish(),
614
623
  message: e.string().nullish()
615
- }), be = e.object({
624
+ }), xe = e.object({
616
625
  product: P,
617
626
  price: N,
618
627
  preview: G
@@ -629,8 +638,24 @@ var pe = e.object({
629
638
  next_charge_amount: A.nullish(),
630
639
  next_charge_date: j.nullish(),
631
640
  message: e.string().nullish()
632
- }), xe = e.object({
641
+ }), Se = e.object({
633
642
  psps: e.array(p).nullish().transform((e) => e ?? []),
643
+ billing_fields: e.object({
644
+ country: e.enum([
645
+ "required",
646
+ "optional",
647
+ "hidden"
648
+ ]).catch("required"),
649
+ postal_code: e.enum([
650
+ "auto",
651
+ "required",
652
+ "optional",
653
+ "hidden"
654
+ ]).catch("auto")
655
+ }).nullish().transform((e) => e ?? {
656
+ country: "required",
657
+ postal_code: "auto"
658
+ }),
634
659
  solana: e.object({
635
660
  network: e.string(),
636
661
  chain: e.string(),
@@ -644,13 +669,13 @@ var pe = e.object({
644
669
  recurring_eligible: e.boolean().nullish()
645
670
  })).nullish().transform((e) => e ?? [])
646
671
  }).nullish()
647
- }), Se = e.object({
672
+ }), Ce = e.object({
648
673
  provider: e.string(),
649
674
  site_key: e.string(),
650
675
  script_url: e.string(),
651
676
  action: e.string(),
652
677
  token_header: e.string()
653
- }), Ce = e.object({
678
+ }), we = e.object({
654
679
  display_name: e.string(),
655
680
  logo_url: e.string().nullish(),
656
681
  support_url: e.string().nullish(),
@@ -663,18 +688,25 @@ var pe = e.object({
663
688
  route_groups: e.record(e.string(), e.boolean()),
664
689
  features: e.record(e.string(), e.boolean())
665
690
  }),
666
- currencies: e.array(ye).nullish().transform((e) => e ?? []),
667
- captcha: Se.nullish()
691
+ currencies: e.array(be).nullish().transform((e) => e ?? []),
692
+ captcha: Ce.nullish(),
693
+ usage: e.boolean().nullish().transform((e) => e ?? !0)
668
694
  }), J = e.object({
669
- payment: xe,
670
- merchant: Ce,
671
- client_country: e.string().nullish().transform((e) => e ?? "")
695
+ payment: Se,
696
+ merchant: we,
697
+ client_country: e.string().nullish().transform((e) => e ?? ""),
698
+ currencies: e.array(e.object({
699
+ code: e.string(),
700
+ name: e.string(),
701
+ symbol: e.string().nullish(),
702
+ scale: e.number().int()
703
+ })).nullish().transform((e) => e ?? [])
672
704
  }), Y = class extends Error {
673
705
  constructor(e = "The wallet request was declined.") {
674
706
  super(e), this.name = "WalletRejectedError";
675
707
  }
676
- }, X = 4, we = 500, Te = (e) => e?.type === "solana_sign_transactions" && !!e.transactions?.length;
677
- async function Ee(e, t) {
708
+ }, Te = 4, Ee = 500, X = (e) => e?.type === "solana_sign_transactions" && !!e.transactions?.length;
709
+ async function De(e, t) {
678
710
  let n = "";
679
711
  for (let r of e.transactions ?? []) {
680
712
  try {
@@ -687,9 +719,9 @@ async function Ee(e, t) {
687
719
  if (!n) throw i("wallet_no_signature", "The wallet returned no signature.");
688
720
  return n;
689
721
  }
690
- var De = 2e3, Z = 300;
691
- function Oe(e) {
692
- let t = ke(e.headers.get("Retry-After"));
722
+ var Oe = 2e3, Z = 300;
723
+ function ke(e) {
724
+ let t = Ae(e.headers.get("Retry-After"));
693
725
  switch (e.status) {
694
726
  case 429: return t;
695
727
  case 503: return t ?? Z;
@@ -698,7 +730,7 @@ function Oe(e) {
698
730
  default: return null;
699
731
  }
700
732
  }
701
- function ke(e) {
733
+ function Ae(e) {
702
734
  if (!e) return null;
703
735
  if (/^\d+$/.test(e.trim())) return Number(e.trim()) * 1e3;
704
736
  let t = Date.parse(e);
@@ -715,8 +747,8 @@ function Q(e, t) {
715
747
  t?.addEventListener("abort", a, { once: !0 });
716
748
  });
717
749
  }
718
- function Ae(e = {}) {
719
- let t = (e.baseUrl ?? "/billing/v1").replace(/\/+$/, ""), r = e.fetch ?? ((e, t) => fetch(e, t)), o = je({
750
+ function je(e = {}) {
751
+ let t = (e.baseUrl ?? "/billing/v1").replace(/\/+$/, ""), r = e.fetch ?? ((e, t) => fetch(e, t)), o = Me({
720
752
  ...u,
721
753
  ...e.currencies
722
754
  });
@@ -735,7 +767,7 @@ function Ae(e = {}) {
735
767
  n.body !== void 0 && i.set("Content-Type", "application/json");
736
768
  let o = n.public ? void 0 : await e.getToken?.();
737
769
  o && i.set("Authorization", `Bearer ${o}`);
738
- let u = e.language?.();
770
+ let u = e.language ? e.language() : C;
739
771
  u && i.set("Accept-Language", u);
740
772
  let d = n.method ?? "GET", f = {
741
773
  method: d,
@@ -760,7 +792,7 @@ function Ae(e = {}) {
760
792
  e.getToken.invalidate(o), o = await e.getToken(), i.set("Authorization", `Bearer ${o}`), h = !0, u--;
761
793
  continue;
762
794
  }
763
- let g = Oe(d);
795
+ let g = ke(d);
764
796
  if (u >= p || g === null || m + g > 2e3) throw await a(d);
765
797
  await d.body?.cancel().catch(() => void 0), m += await Q(g, n.signal);
766
798
  }
@@ -776,11 +808,11 @@ function Ae(e = {}) {
776
808
  if (!o.success) throw i("invalid_response", `${t}: ${o.error.issues[0]?.path.join(".")} ${o.error.issues[0]?.message}`);
777
809
  return o.data;
778
810
  }
779
- let p = (e) => encodeURIComponent(e), m = M(L), h = M(R), g = M(pe), _ = M(B), v = M(me), y = M(be), b = (e, t) => ({
811
+ let p = (e) => encodeURIComponent(e), m = M(L), h = M(R), g = M(pe), _ = M(B), v = M(me), y = M(he), b = M(xe), x = (e, t) => ({
780
812
  limit: e.limit ?? t,
781
813
  cursor: e.cursor ?? void 0
782
814
  });
783
- async function x(e, t) {
815
+ async function S(e, t) {
784
816
  try {
785
817
  return { order: await f(B, e, t) };
786
818
  } catch (e) {
@@ -794,13 +826,17 @@ function Ae(e = {}) {
794
826
  throw e;
795
827
  }
796
828
  }
829
+ let C;
797
830
  return {
798
831
  baseUrl: t,
832
+ setLanguage(e) {
833
+ C = e;
834
+ },
799
835
  listSubscriptions(e = {}) {
800
836
  return f(m, "/me/subscriptions", {
801
837
  query: {
802
838
  status: e.status ?? "all",
803
- ...b(e, 100)
839
+ ...x(e, 100)
804
840
  },
805
841
  signal: e.signal
806
842
  });
@@ -831,7 +867,7 @@ function Ae(e = {}) {
831
867
  });
832
868
  },
833
869
  listSubscriptionChangeOptions(e, t) {
834
- return f(y, `/me/subscriptions/${p(e)}/change/options`, { signal: t });
870
+ return f(b, `/me/subscriptions/${p(e)}/change/options`, { signal: t });
835
871
  },
836
872
  previewSubscriptionChange(e, t, n) {
837
873
  return f(G, `/me/subscriptions/${p(e)}/change/preview`, {
@@ -862,7 +898,7 @@ function Ae(e = {}) {
862
898
  },
863
899
  listPaymentMethods(e = {}) {
864
900
  return f(h, "/me/payment-methods", {
865
- query: b(e, 100),
901
+ query: x(e, 100),
866
902
  signal: e.signal
867
903
  });
868
904
  },
@@ -886,14 +922,15 @@ function Ae(e = {}) {
886
922
  await d("/me/cart", { method: "DELETE" });
887
923
  },
888
924
  createOrder(e) {
889
- return x("/me/orders", {
925
+ return S("/me/orders", {
890
926
  method: "POST",
891
927
  body: {
892
928
  ...e.cart ? { cart: !0 } : { lines: e.lines ?? [] },
893
929
  ...e.expectedTotal === void 0 ? {} : { expected_total: e.expectedTotal },
894
930
  ...e.payment === void 0 ? {} : { payment: e.payment },
895
931
  ...e.reusable === void 0 ? {} : { reusable: e.reusable },
896
- ...e.payUrl === void 0 ? {} : { pay_url: e.payUrl }
932
+ ...e.payUrl === void 0 ? {} : { pay_url: e.payUrl },
933
+ ...e.attribution === void 0 ? {} : { attribution: e.attribution }
897
934
  },
898
935
  headers: e.idempotencyKey ? { "Idempotency-Key": e.idempotencyKey } : void 0
899
936
  });
@@ -904,7 +941,7 @@ function Ae(e = {}) {
904
941
  signal: e.signal
905
942
  }) : f(_, "/me/orders", {
906
943
  query: {
907
- ...b(e, 20),
944
+ ...x(e, 20),
908
945
  origin: e.origin,
909
946
  status: e.status,
910
947
  subscription_id: e.subscriptionId,
@@ -923,7 +960,7 @@ function Ae(e = {}) {
923
960
  });
924
961
  },
925
962
  payOrder(e, t) {
926
- return x(`/me/orders/${p(e)}/pay`, {
963
+ return S(`/me/orders/${p(e)}/pay`, {
927
964
  method: "POST",
928
965
  body: {
929
966
  payment: t.payment,
@@ -937,7 +974,7 @@ function Ae(e = {}) {
937
974
  await d(`/me/orders/${p(e)}/pay-url-failure`, { method: "POST" });
938
975
  },
939
976
  confirmOrder(e, t) {
940
- return x(`/me/orders/${p(e)}/confirm`, {
977
+ return S(`/me/orders/${p(e)}/confirm`, {
941
978
  method: "POST",
942
979
  body: t?.signature ? { signature: t.signature } : {}
943
980
  });
@@ -960,7 +997,7 @@ function Ae(e = {}) {
960
997
  listPayments(e = {}) {
961
998
  return f(g, "/me/payments", {
962
999
  query: {
963
- ...b(e, 20),
1000
+ ...x(e, 20),
964
1001
  rail: e.rail
965
1002
  },
966
1003
  signal: e.signal
@@ -969,7 +1006,7 @@ function Ae(e = {}) {
969
1006
  getEntitlements(e = {}) {
970
1007
  return f(v, "/me/entitlements", {
971
1008
  query: {
972
- ...b(e, 500),
1009
+ ...x(e, 500),
973
1010
  at: e.at,
974
1011
  prefix: e.prefix
975
1012
  },
@@ -977,7 +1014,7 @@ function Ae(e = {}) {
977
1014
  });
978
1015
  },
979
1016
  getAccount(e) {
980
- return f(ge, "/me", { signal: e });
1017
+ return f(_e, "/me", { signal: e });
981
1018
  },
982
1019
  setLowBalanceLine(e) {
983
1020
  return f(W, `/me/low-balance-lines/${p(e.currency.toUpperCase())}`, {
@@ -989,7 +1026,7 @@ function Ae(e = {}) {
989
1026
  });
990
1027
  },
991
1028
  getUsage(e) {
992
- return f(ve, "/me/usage", {
1029
+ return f(ye, "/me/usage", {
993
1030
  query: {
994
1031
  currency: e.currency,
995
1032
  group_by: e.groupBy,
@@ -1001,6 +1038,9 @@ function Ae(e = {}) {
1001
1038
  signal: e.signal
1002
1039
  });
1003
1040
  },
1041
+ getLimits(e) {
1042
+ return f(y, "/me/limits", { signal: e });
1043
+ },
1004
1044
  getConfig(e) {
1005
1045
  return f(q, "/config", {
1006
1046
  signal: e,
@@ -1013,10 +1053,10 @@ function Ae(e = {}) {
1013
1053
  currencies: o
1014
1054
  };
1015
1055
  }
1016
- function je(e) {
1056
+ function Me(e) {
1017
1057
  return Object.fromEntries(Object.entries(e).map(([e, t]) => [e.toUpperCase(), t]));
1018
1058
  }
1019
1059
  var $ = (e) => e instanceof Y || e instanceof Error && e.name === "WalletRejectedError" || e instanceof t && e.code === "wallet_rejected";
1020
- export { l as A, f as C, r as D, n as E, i as O, m as S, t as T, x as _, Ae as a, y as b, Ee as c, D as d, ne as f, T as g, ae as h, Y as i, c as j, a as k, J as l, ie as m, X as n, Te as o, re as p, De as r, $ as s, we as t, q as u, b as v, d as w, p as x, g as y };
1060
+ export { l as A, f as C, r as D, n as E, i as O, m as S, t as T, x as _, je as a, y as b, De as c, D as d, ne as f, T as g, ae as h, Y as i, c as j, a as k, J as l, ie as m, Te as n, X as o, re as p, Oe as r, $ as s, Ee as t, q as u, b as v, d as w, p as x, g as y };
1021
1061
 
1022
- //# sourceMappingURL=client-BrURpRWz.js.map
1062
+ //# sourceMappingURL=client-D8qT6xjo.js.map