@peable.to/contracts 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/dist/cjs/common/address.js +81 -0
  2. package/dist/cjs/common/envelopes.js +101 -0
  3. package/dist/cjs/common/objects.js +85 -0
  4. package/dist/cjs/common/params.js +211 -0
  5. package/dist/cjs/common/primitives.js +39 -0
  6. package/dist/cjs/contributions.js +22 -0
  7. package/dist/cjs/index.js +40 -137
  8. package/dist/cjs/openapi/document.js +297 -0
  9. package/dist/cjs/openapi/index.js +7 -0
  10. package/dist/cjs/openapi/webhooks.js +17 -0
  11. package/dist/cjs/resources/billingEngine/billingPortal.js +237 -0
  12. package/dist/cjs/resources/billingEngine/creditNotes.js +189 -0
  13. package/dist/cjs/resources/billingEngine/customerBalanceTransactions.js +90 -0
  14. package/dist/cjs/resources/billingEngine/index.js +43 -0
  15. package/dist/cjs/resources/billingEngine/invoiceItems.js +155 -0
  16. package/dist/cjs/resources/billingEngine/invoices.js +509 -0
  17. package/dist/cjs/resources/billingEngine/params.js +43 -0
  18. package/dist/cjs/resources/billingEngine/public.js +326 -0
  19. package/dist/cjs/resources/billingEngine/subscriptions.js +476 -0
  20. package/dist/cjs/resources/catalog/billing.js +755 -0
  21. package/dist/cjs/resources/catalog/billingSettings.js +131 -0
  22. package/dist/cjs/resources/catalog/coupons.js +222 -0
  23. package/dist/cjs/resources/catalog/entitlements.js +257 -0
  24. package/dist/cjs/resources/catalog/index.js +58 -0
  25. package/dist/cjs/resources/catalog/meters.js +279 -0
  26. package/dist/cjs/resources/catalog/prices.js +423 -0
  27. package/dist/cjs/resources/catalog/products.js +228 -0
  28. package/dist/cjs/resources/catalog/promotionCodes.js +174 -0
  29. package/dist/cjs/resources/catalog/shared.js +75 -0
  30. package/dist/cjs/resources/catalog/testClocks.js +127 -0
  31. package/dist/cjs/resources/checkout/checkoutSessions.js +582 -0
  32. package/dist/cjs/resources/checkout/contributions.js +172 -0
  33. package/dist/cjs/resources/checkout/files.js +133 -0
  34. package/dist/cjs/resources/checkout/index.js +57 -0
  35. package/dist/cjs/resources/checkout/merchants.js +290 -0
  36. package/dist/cjs/resources/checkout/paymentLinks.js +330 -0
  37. package/dist/cjs/resources/checkout/paymentMethodConfigurations.js +262 -0
  38. package/dist/cjs/resources/checkout/shared.js +368 -0
  39. package/dist/cjs/resources/connect/account.js +332 -0
  40. package/dist/cjs/resources/connect/applicationFees.js +113 -0
  41. package/dist/cjs/resources/connect/balance.js +212 -0
  42. package/dist/cjs/resources/connect/connectedAccounts.js +260 -0
  43. package/dist/cjs/resources/connect/index.js +51 -0
  44. package/dist/cjs/resources/connect/onboarding.js +82 -0
  45. package/dist/cjs/resources/connect/payouts.js +196 -0
  46. package/dist/cjs/resources/connect/reporting.js +235 -0
  47. package/dist/cjs/resources/connect/requestLogs.js +110 -0
  48. package/dist/cjs/resources/connect/transfers.js +227 -0
  49. package/dist/cjs/resources/core/customers.js +194 -0
  50. package/dist/cjs/resources/core/index.js +23 -0
  51. package/dist/cjs/resources/core/paymentMethods.js +134 -0
  52. package/dist/cjs/resources/events/events.js +357 -0
  53. package/dist/cjs/resources/events/index.js +29 -0
  54. package/dist/cjs/resources/events/webhookDeliveries.js +93 -0
  55. package/dist/cjs/resources/events/webhookEndpoints.js +215 -0
  56. package/dist/cjs/resources/payments/charges.js +157 -0
  57. package/dist/cjs/resources/payments/disputes.js +204 -0
  58. package/dist/cjs/resources/payments/index.js +41 -0
  59. package/dist/cjs/resources/payments/paymentIntents.js +529 -0
  60. package/dist/cjs/resources/payments/refunds.js +245 -0
  61. package/dist/cjs/resources/payments/setupIntents.js +158 -0
  62. package/dist/cjs/resources/payments/social.js +182 -0
  63. package/dist/cjs/resources/payments/testHelpers.js +39 -0
  64. package/dist/cjs/resources/tax/assessments.js +217 -0
  65. package/dist/cjs/resources/tax/businessProfile.js +99 -0
  66. package/dist/cjs/resources/tax/calculations.js +176 -0
  67. package/dist/cjs/resources/tax/capabilities.js +42 -0
  68. package/dist/cjs/resources/tax/codes.js +37 -0
  69. package/dist/cjs/resources/tax/complianceActions.js +56 -0
  70. package/dist/cjs/resources/tax/deadlines.js +59 -0
  71. package/dist/cjs/resources/tax/documents.js +128 -0
  72. package/dist/cjs/resources/tax/index.js +80 -0
  73. package/dist/cjs/resources/tax/locationEvidence.js +131 -0
  74. package/dist/cjs/resources/tax/operatingLocations.js +98 -0
  75. package/dist/cjs/resources/tax/products.js +67 -0
  76. package/dist/cjs/resources/tax/registrationDeclarations.js +124 -0
  77. package/dist/cjs/resources/tax/registrations.js +82 -0
  78. package/dist/cjs/resources/tax/reports.js +92 -0
  79. package/dist/cjs/resources/tax/reviewItems.js +116 -0
  80. package/dist/cjs/resources/tax/ruleSet.js +68 -0
  81. package/dist/cjs/resources/tax/salesDestinations.js +94 -0
  82. package/dist/cjs/resources/tax/settings.js +104 -0
  83. package/dist/cjs/resources/tax/shared.js +62 -0
  84. package/dist/cjs/resources/tax/transactions.js +102 -0
  85. package/dist/cjs/route.js +22 -0
  86. package/dist/cjs/routes.js +31 -0
  87. package/dist/cjs/vocabulary/billingPortal.js +15 -0
  88. package/dist/cjs/vocabulary/catalog.js +110 -0
  89. package/dist/cjs/vocabulary/checkout.js +53 -0
  90. package/dist/cjs/vocabulary/connect.js +95 -0
  91. package/dist/cjs/vocabulary/errors.js +174 -0
  92. package/dist/cjs/vocabulary/events.js +176 -0
  93. package/dist/cjs/vocabulary/files.js +44 -0
  94. package/dist/cjs/vocabulary/index.js +37 -0
  95. package/dist/cjs/vocabulary/invoices.js +52 -0
  96. package/dist/cjs/vocabulary/lists.js +22 -0
  97. package/dist/cjs/vocabulary/merchants.js +23 -0
  98. package/dist/cjs/vocabulary/money.js +104 -0
  99. package/dist/cjs/vocabulary/paymentMethodConfigurations.js +36 -0
  100. package/dist/cjs/vocabulary/payments.js +195 -0
  101. package/dist/cjs/vocabulary/reporting.js +27 -0
  102. package/dist/cjs/vocabulary/subscriptions.js +60 -0
  103. package/dist/cjs/vocabulary/tax.js +237 -0
  104. package/dist/cjs/vocabulary/version.js +12 -0
  105. package/dist/esm/common/address.js +76 -0
  106. package/dist/esm/common/envelopes.js +95 -0
  107. package/dist/esm/common/objects.js +74 -0
  108. package/dist/esm/common/params.js +203 -0
  109. package/dist/esm/common/primitives.js +35 -0
  110. package/dist/esm/contributions.js +5 -0
  111. package/dist/esm/index.js +26 -134
  112. package/dist/esm/openapi/document.js +294 -0
  113. package/dist/esm/openapi/index.js +2 -0
  114. package/dist/esm/openapi/webhooks.js +14 -0
  115. package/dist/esm/resources/billingEngine/billingPortal.js +234 -0
  116. package/dist/esm/resources/billingEngine/creditNotes.js +186 -0
  117. package/dist/esm/resources/billingEngine/customerBalanceTransactions.js +87 -0
  118. package/dist/esm/resources/billingEngine/index.js +26 -0
  119. package/dist/esm/resources/billingEngine/invoiceItems.js +152 -0
  120. package/dist/esm/resources/billingEngine/invoices.js +506 -0
  121. package/dist/esm/resources/billingEngine/params.js +39 -0
  122. package/dist/esm/resources/billingEngine/public.js +323 -0
  123. package/dist/esm/resources/billingEngine/subscriptions.js +473 -0
  124. package/dist/esm/resources/catalog/billing.js +752 -0
  125. package/dist/esm/resources/catalog/billingSettings.js +128 -0
  126. package/dist/esm/resources/catalog/coupons.js +219 -0
  127. package/dist/esm/resources/catalog/entitlements.js +254 -0
  128. package/dist/esm/resources/catalog/index.js +38 -0
  129. package/dist/esm/resources/catalog/meters.js +276 -0
  130. package/dist/esm/resources/catalog/prices.js +419 -0
  131. package/dist/esm/resources/catalog/products.js +225 -0
  132. package/dist/esm/resources/catalog/promotionCodes.js +171 -0
  133. package/dist/esm/resources/catalog/shared.js +67 -0
  134. package/dist/esm/resources/catalog/testClocks.js +124 -0
  135. package/dist/esm/resources/checkout/checkoutSessions.js +579 -0
  136. package/dist/esm/resources/checkout/contributions.js +167 -0
  137. package/dist/esm/resources/checkout/files.js +130 -0
  138. package/dist/esm/resources/checkout/index.js +25 -0
  139. package/dist/esm/resources/checkout/merchants.js +287 -0
  140. package/dist/esm/resources/checkout/paymentLinks.js +327 -0
  141. package/dist/esm/resources/checkout/paymentMethodConfigurations.js +259 -0
  142. package/dist/esm/resources/checkout/shared.js +363 -0
  143. package/dist/esm/resources/connect/account.js +329 -0
  144. package/dist/esm/resources/connect/applicationFees.js +110 -0
  145. package/dist/esm/resources/connect/balance.js +209 -0
  146. package/dist/esm/resources/connect/connectedAccounts.js +257 -0
  147. package/dist/esm/resources/connect/index.js +34 -0
  148. package/dist/esm/resources/connect/onboarding.js +79 -0
  149. package/dist/esm/resources/connect/payouts.js +193 -0
  150. package/dist/esm/resources/connect/reporting.js +232 -0
  151. package/dist/esm/resources/connect/requestLogs.js +107 -0
  152. package/dist/esm/resources/connect/transfers.js +224 -0
  153. package/dist/esm/resources/core/customers.js +191 -0
  154. package/dist/esm/resources/core/index.js +6 -0
  155. package/dist/esm/resources/core/paymentMethods.js +131 -0
  156. package/dist/esm/resources/events/events.js +353 -0
  157. package/dist/esm/resources/events/index.js +12 -0
  158. package/dist/esm/resources/events/webhookDeliveries.js +90 -0
  159. package/dist/esm/resources/events/webhookEndpoints.js +212 -0
  160. package/dist/esm/resources/payments/charges.js +154 -0
  161. package/dist/esm/resources/payments/disputes.js +201 -0
  162. package/dist/esm/resources/payments/index.js +24 -0
  163. package/dist/esm/resources/payments/paymentIntents.js +526 -0
  164. package/dist/esm/resources/payments/refunds.js +242 -0
  165. package/dist/esm/resources/payments/setupIntents.js +155 -0
  166. package/dist/esm/resources/payments/social.js +179 -0
  167. package/dist/esm/resources/payments/testHelpers.js +36 -0
  168. package/dist/esm/resources/tax/assessments.js +214 -0
  169. package/dist/esm/resources/tax/businessProfile.js +96 -0
  170. package/dist/esm/resources/tax/calculations.js +173 -0
  171. package/dist/esm/resources/tax/capabilities.js +39 -0
  172. package/dist/esm/resources/tax/codes.js +34 -0
  173. package/dist/esm/resources/tax/complianceActions.js +53 -0
  174. package/dist/esm/resources/tax/deadlines.js +56 -0
  175. package/dist/esm/resources/tax/documents.js +125 -0
  176. package/dist/esm/resources/tax/index.js +63 -0
  177. package/dist/esm/resources/tax/locationEvidence.js +128 -0
  178. package/dist/esm/resources/tax/operatingLocations.js +95 -0
  179. package/dist/esm/resources/tax/products.js +64 -0
  180. package/dist/esm/resources/tax/registrationDeclarations.js +121 -0
  181. package/dist/esm/resources/tax/registrations.js +79 -0
  182. package/dist/esm/resources/tax/reports.js +89 -0
  183. package/dist/esm/resources/tax/reviewItems.js +113 -0
  184. package/dist/esm/resources/tax/ruleSet.js +65 -0
  185. package/dist/esm/resources/tax/salesDestinations.js +91 -0
  186. package/dist/esm/resources/tax/settings.js +101 -0
  187. package/dist/esm/resources/tax/shared.js +58 -0
  188. package/dist/esm/resources/tax/transactions.js +99 -0
  189. package/dist/esm/route.js +16 -0
  190. package/dist/esm/routes.js +27 -0
  191. package/dist/esm/vocabulary/billingPortal.js +12 -0
  192. package/dist/esm/vocabulary/catalog.js +106 -0
  193. package/dist/esm/vocabulary/checkout.js +50 -0
  194. package/dist/esm/vocabulary/connect.js +92 -0
  195. package/dist/esm/vocabulary/errors.js +169 -0
  196. package/dist/esm/vocabulary/events.js +173 -0
  197. package/dist/esm/vocabulary/files.js +41 -0
  198. package/dist/esm/vocabulary/index.js +21 -0
  199. package/dist/esm/vocabulary/invoices.js +49 -0
  200. package/dist/esm/vocabulary/lists.js +19 -0
  201. package/dist/esm/vocabulary/merchants.js +20 -0
  202. package/dist/esm/vocabulary/money.js +98 -0
  203. package/dist/esm/vocabulary/paymentMethodConfigurations.js +33 -0
  204. package/dist/esm/vocabulary/payments.js +192 -0
  205. package/dist/esm/vocabulary/reporting.js +24 -0
  206. package/dist/esm/vocabulary/subscriptions.js +57 -0
  207. package/dist/esm/vocabulary/tax.js +233 -0
  208. package/dist/esm/vocabulary/version.js +9 -0
  209. package/dist/types/common/address.d.ts +62 -0
  210. package/dist/types/common/envelopes.d.ts +88 -0
  211. package/dist/types/common/objects.d.ts +107 -0
  212. package/dist/types/common/params.d.ts +156 -0
  213. package/dist/types/common/primitives.d.ts +56 -0
  214. package/dist/types/contributions.d.ts +1 -0
  215. package/dist/types/index.d.ts +16 -171
  216. package/dist/types/openapi/document.d.ts +16 -0
  217. package/dist/types/openapi/index.d.ts +2 -0
  218. package/dist/types/openapi/webhooks.d.ts +15 -0
  219. package/dist/types/resources/billingEngine/billingPortal.d.ts +742 -0
  220. package/dist/types/resources/billingEngine/creditNotes.d.ts +655 -0
  221. package/dist/types/resources/billingEngine/customerBalanceTransactions.d.ts +282 -0
  222. package/dist/types/resources/billingEngine/index.d.ts +6071 -0
  223. package/dist/types/resources/billingEngine/invoiceItems.d.ts +502 -0
  224. package/dist/types/resources/billingEngine/invoices.d.ts +2547 -0
  225. package/dist/types/resources/billingEngine/params.d.ts +51 -0
  226. package/dist/types/resources/billingEngine/public.d.ts +1860 -0
  227. package/dist/types/resources/billingEngine/subscriptions.d.ts +1519 -0
  228. package/dist/types/resources/catalog/billing.d.ts +1723 -0
  229. package/dist/types/resources/catalog/billingSettings.d.ts +160 -0
  230. package/dist/types/resources/catalog/coupons.d.ts +403 -0
  231. package/dist/types/resources/catalog/entitlements.d.ts +422 -0
  232. package/dist/types/resources/catalog/index.d.ts +3155 -0
  233. package/dist/types/resources/catalog/meters.d.ts +474 -0
  234. package/dist/types/resources/catalog/prices.d.ts +1091 -0
  235. package/dist/types/resources/catalog/products.d.ts +430 -0
  236. package/dist/types/resources/catalog/promotionCodes.d.ts +369 -0
  237. package/dist/types/resources/catalog/shared.d.ts +34 -0
  238. package/dist/types/resources/catalog/testClocks.d.ts +220 -0
  239. package/dist/types/resources/checkout/checkoutSessions.d.ts +3207 -0
  240. package/dist/types/resources/checkout/contributions.d.ts +375 -0
  241. package/dist/types/resources/checkout/files.d.ts +280 -0
  242. package/dist/types/resources/checkout/index.d.ts +5678 -0
  243. package/dist/types/resources/checkout/merchants.d.ts +395 -0
  244. package/dist/types/resources/checkout/paymentLinks.d.ts +1728 -0
  245. package/dist/types/resources/checkout/paymentMethodConfigurations.d.ts +2104 -0
  246. package/dist/types/resources/checkout/shared.d.ts +419 -0
  247. package/dist/types/resources/connect/account.d.ts +483 -0
  248. package/dist/types/resources/connect/applicationFees.d.ts +198 -0
  249. package/dist/types/resources/connect/balance.d.ts +399 -0
  250. package/dist/types/resources/connect/connectedAccounts.d.ts +494 -0
  251. package/dist/types/resources/connect/index.d.ts +2094 -0
  252. package/dist/types/resources/connect/onboarding.d.ts +95 -0
  253. package/dist/types/resources/connect/payouts.d.ts +527 -0
  254. package/dist/types/resources/connect/reporting.d.ts +506 -0
  255. package/dist/types/resources/connect/requestLogs.d.ts +236 -0
  256. package/dist/types/resources/connect/transfers.d.ts +436 -0
  257. package/dist/types/resources/core/customers.d.ts +619 -0
  258. package/dist/types/resources/core/index.d.ts +679 -0
  259. package/dist/types/resources/core/paymentMethods.d.ts +336 -0
  260. package/dist/types/resources/events/events.d.ts +731 -0
  261. package/dist/types/resources/events/index.d.ts +1727 -0
  262. package/dist/types/resources/events/webhookDeliveries.d.ts +436 -0
  263. package/dist/types/resources/events/webhookEndpoints.d.ts +1502 -0
  264. package/dist/types/resources/payments/charges.d.ts +390 -0
  265. package/dist/types/resources/payments/disputes.d.ts +822 -0
  266. package/dist/types/resources/payments/index.d.ts +3517 -0
  267. package/dist/types/resources/payments/paymentIntents.d.ts +2080 -0
  268. package/dist/types/resources/payments/refunds.d.ts +684 -0
  269. package/dist/types/resources/payments/setupIntents.d.ts +391 -0
  270. package/dist/types/resources/payments/social.d.ts +266 -0
  271. package/dist/types/resources/payments/testHelpers.d.ts +178 -0
  272. package/dist/types/resources/tax/assessments.d.ts +787 -0
  273. package/dist/types/resources/tax/businessProfile.d.ts +134 -0
  274. package/dist/types/resources/tax/calculations.d.ts +261 -0
  275. package/dist/types/resources/tax/capabilities.d.ts +81 -0
  276. package/dist/types/resources/tax/codes.d.ts +29 -0
  277. package/dist/types/resources/tax/complianceActions.d.ts +97 -0
  278. package/dist/types/resources/tax/deadlines.d.ts +133 -0
  279. package/dist/types/resources/tax/documents.d.ts +257 -0
  280. package/dist/types/resources/tax/index.d.ts +1946 -0
  281. package/dist/types/resources/tax/locationEvidence.d.ts +246 -0
  282. package/dist/types/resources/tax/operatingLocations.d.ts +170 -0
  283. package/dist/types/resources/tax/products.d.ts +68 -0
  284. package/dist/types/resources/tax/registrationDeclarations.d.ts +270 -0
  285. package/dist/types/resources/tax/registrations.d.ts +103 -0
  286. package/dist/types/resources/tax/reports.d.ts +129 -0
  287. package/dist/types/resources/tax/reviewItems.d.ts +226 -0
  288. package/dist/types/resources/tax/ruleSet.d.ts +219 -0
  289. package/dist/types/resources/tax/salesDestinations.d.ts +158 -0
  290. package/dist/types/resources/tax/settings.d.ts +122 -0
  291. package/dist/types/resources/tax/shared.d.ts +43 -0
  292. package/dist/types/resources/tax/transactions.d.ts +404 -0
  293. package/dist/types/route.d.ts +86 -0
  294. package/dist/types/routes.d.ts +23 -0
  295. package/dist/types/vocabulary/billingPortal.d.ts +15 -0
  296. package/dist/types/vocabulary/catalog.d.ts +97 -0
  297. package/dist/types/vocabulary/checkout.d.ts +49 -0
  298. package/dist/types/vocabulary/connect.d.ts +62 -0
  299. package/dist/types/vocabulary/errors.d.ts +145 -0
  300. package/dist/types/vocabulary/events.d.ts +171 -0
  301. package/dist/types/vocabulary/files.d.ts +30 -0
  302. package/dist/types/vocabulary/index.d.ts +17 -0
  303. package/dist/types/vocabulary/invoices.d.ts +39 -0
  304. package/dist/types/vocabulary/lists.d.ts +9 -0
  305. package/dist/types/vocabulary/merchants.d.ts +9 -0
  306. package/dist/types/vocabulary/money.d.ts +59 -0
  307. package/dist/types/vocabulary/paymentMethodConfigurations.d.ts +22 -0
  308. package/dist/types/vocabulary/payments.d.ts +117 -0
  309. package/dist/types/vocabulary/reporting.d.ts +18 -0
  310. package/dist/types/vocabulary/subscriptions.d.ts +45 -0
  311. package/dist/types/vocabulary/tax.d.ts +163 -0
  312. package/dist/types/vocabulary/version.d.ts +10 -0
  313. package/package.json +51 -11
  314. package/dist/cjs/openapi.js +0 -165
  315. package/dist/esm/openapi.js +0 -161
  316. package/dist/types/openapi.d.ts +0 -148
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // Payment method breadth on the card rail (`pmc_…`, `pmd_…`). Zod-free.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PAYMENT_METHOD_UNAVAILABLE_REASONS = exports.PAYMENT_METHOD_CONFIGURATION_TYPES = void 0;
5
+ /**
6
+ * The methods a configuration can turn on.
7
+ *
8
+ * `apple_pay` and `google_pay` are WALLETS over a card: a payment made with one
9
+ * is a `card` payment, so they appear here and never in a PaymentIntent's
10
+ * `payment_method_types`. `bizum` is listed because merchants ask for it and the
11
+ * honest answer is a reason, not an absence: the provider does not offer it.
12
+ *
13
+ * Deliberately absent: the provider's own consumer wallet (its brand on Orbit's
14
+ * checkout, `payment-provider-boundary.md`) and giropay (discontinued by the
15
+ * scheme).
16
+ */
17
+ exports.PAYMENT_METHOD_CONFIGURATION_TYPES = [
18
+ 'card',
19
+ 'apple_pay',
20
+ 'google_pay',
21
+ 'sepa_debit',
22
+ 'ideal',
23
+ 'bancontact',
24
+ 'eps',
25
+ 'bizum',
26
+ ];
27
+ /**
28
+ * Why a method cannot be offered whatever the merchant chooses.
29
+ *
30
+ * - `provider_unsupported` — the processing provider does not offer it;
31
+ * - `requires_card` — a wallet rides on card payments, and card is off.
32
+ */
33
+ exports.PAYMENT_METHOD_UNAVAILABLE_REASONS = [
34
+ 'provider_unsupported',
35
+ 'requires_card',
36
+ ];
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ // The payments vocabulary (ADR 0014 D5): the closed value sets the payment
3
+ // intent, charge, refund, dispute, setup intent, social and test-helper
4
+ // contracts are built from. Zod-free, so the wallet and the shared types read
5
+ // them without bundling a schema.
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.SIMULATED_FAIRCOIN_OUTCOMES = exports.ENRICH_MAX_ADDRESSES = exports.ENRICHMENT_KINDS = exports.SOCIAL_PAYMENT_DIRECTIONS = exports.SOCIAL_SOURCE_REF_MAX_LENGTH = exports.SOCIAL_SOURCE_APP_MAX_LENGTH = exports.SETUP_INTENT_CANCELLATION_REASONS = exports.SETUP_INTENT_USAGES = exports.SETUP_INTENT_STATUSES = exports.DISPUTE_EVIDENCE_TEXT_MAX = exports.DISPUTE_FILE_EVIDENCE_FIELDS = exports.DISPUTE_TEXT_EVIDENCE_FIELDS = exports.DISPUTE_REASONS = exports.DISPUTE_STATUSES = exports.SETTLEMENT_STATUSES = exports.REFUND_ORIGINS = exports.REFUND_REASONS = exports.REFUND_STATUSES = exports.CLIENT_ACTION_KINDS = exports.PAYMENT_ERROR_TYPES = exports.PAYMENT_METHOD_TYPES = exports.CARD_RAIL_PAYMENT_METHOD_TYPES = exports.PAYMENT_INTENT_SETUP_FUTURE_USAGES = exports.PAYMENT_INTENT_CAPTURE_METHODS = exports.MERCHANT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_CANCELLATION_REASONS = exports.PAYMENT_INTENT_STATUSES = exports.PAYMENT_INTENT_RAILS = void 0;
8
+ /**
9
+ * Which rail moves the money (ADR 0001 D1). On the INTENT, not on the merchant:
10
+ * one merchant takes both, and the rail decides which fields mean anything.
11
+ */
12
+ exports.PAYMENT_INTENT_RAILS = ['faircoin', 'card'];
13
+ /**
14
+ * Stripe's seven statuses, and no others (ADR 0019). The FairCoin rail walks
15
+ * four of them (`requires_action` → `processing` → `succeeded` | `canceled`); a
16
+ * card walks all seven. The order is the lifecycle table's
17
+ * (`@peable.to/shared-types`), which the database CHECK is rendered from.
18
+ */
19
+ exports.PAYMENT_INTENT_STATUSES = [
20
+ 'requires_payment_method',
21
+ 'requires_confirmation',
22
+ 'requires_action',
23
+ 'processing',
24
+ 'requires_capture',
25
+ 'succeeded',
26
+ 'canceled',
27
+ ];
28
+ /**
29
+ * Why an intent was cancelled — Stripe's reasons, plus `underpaid` (FairCoin
30
+ * only: a transaction paid less than the amount).
31
+ */
32
+ exports.PAYMENT_INTENT_CANCELLATION_REASONS = [
33
+ 'abandoned',
34
+ 'automatic',
35
+ 'duplicate',
36
+ 'fraudulent',
37
+ 'requested_by_customer',
38
+ 'underpaid',
39
+ ];
40
+ /** The reasons a MERCHANT may give `POST /v1/payment_intents/:id/cancel`. */
41
+ exports.MERCHANT_CANCELLATION_REASONS = [
42
+ 'abandoned',
43
+ 'duplicate',
44
+ 'fraudulent',
45
+ 'requested_by_customer',
46
+ ];
47
+ /** When a card is captured: at confirmation, or by `POST …/capture` (card only). */
48
+ exports.PAYMENT_INTENT_CAPTURE_METHODS = ['automatic', 'manual'];
49
+ /** Card only: keep the payment method on the customer for later (ADR 0016). */
50
+ exports.PAYMENT_INTENT_SETUP_FUTURE_USAGES = ['on_session', 'off_session'];
51
+ /** The card-rail types a PaymentIntent can carry in `payment_method_types`. */
52
+ exports.CARD_RAIL_PAYMENT_METHOD_TYPES = [
53
+ 'card',
54
+ 'sepa_debit',
55
+ 'ideal',
56
+ 'bancontact',
57
+ 'eps',
58
+ ];
59
+ /**
60
+ * Every payment method type a PaymentIntent can carry: `faircoin` on the chain
61
+ * rail, the card rail's otherwise. Wallets (Apple Pay, Google Pay) are `card`.
62
+ */
63
+ exports.PAYMENT_METHOD_TYPES = ['faircoin', ...exports.CARD_RAIL_PAYMENT_METHOD_TYPES];
64
+ /** The kinds of `last_payment_error` (and a SetupIntent's `last_setup_error`). */
65
+ exports.PAYMENT_ERROR_TYPES = ['card_error', 'payment_error', 'api_error'];
66
+ /** How the payer's client continues: a confirmation credential, or a redirect. */
67
+ exports.CLIENT_ACTION_KINDS = ['client_secret', 'redirect'];
68
+ // ---------------------------------------------------------------------------
69
+ // Refunds and settlements
70
+ // ---------------------------------------------------------------------------
71
+ /**
72
+ * Where one refund stands — the MONEY's own lifecycle, not the payment's.
73
+ * `canceled` only through `POST /v1/refunds/:id/cancel`.
74
+ */
75
+ exports.REFUND_STATUSES = ['pending', 'succeeded', 'failed', 'canceled'];
76
+ /** Stripe's refund reasons. */
77
+ exports.REFUND_REASONS = ['duplicate', 'fraudulent', 'requested_by_customer'];
78
+ /**
79
+ * Who created a refund. `provider`: it appeared at the acquirer (a dashboard
80
+ * refund, a dispute's resolution) and was imported, without an `external_ref`.
81
+ */
82
+ exports.REFUND_ORIGINS = ['merchant', 'provider'];
83
+ /** Where a payment's settlement figures stand. `unknown` is not zero. */
84
+ exports.SETTLEMENT_STATUSES = ['available', 'pending', 'unknown'];
85
+ // ---------------------------------------------------------------------------
86
+ // Disputes
87
+ // ---------------------------------------------------------------------------
88
+ /**
89
+ * Where a dispute stands. `needs_response` and `under_review` are open; `won`
90
+ * and `lost` are terminal. There is deliberately no `closed`.
91
+ */
92
+ exports.DISPUTE_STATUSES = ['needs_response', 'under_review', 'won', 'lost'];
93
+ /** Why the cardholder disputed — Stripe's enum; an unmapped network reason reads `general`. */
94
+ exports.DISPUTE_REASONS = [
95
+ 'bank_cannot_process',
96
+ 'check_returned',
97
+ 'credit_not_processed',
98
+ 'customer_initiated',
99
+ 'debit_not_authorized',
100
+ 'duplicate',
101
+ 'fraudulent',
102
+ 'general',
103
+ 'incorrect_account_details',
104
+ 'insufficient_funds',
105
+ 'noncompliant',
106
+ 'product_not_received',
107
+ 'product_unacceptable',
108
+ 'subscription_canceled',
109
+ 'unrecognized',
110
+ ];
111
+ /**
112
+ * The TEXT evidence fields — the network's names, never a Peable paraphrase: a
113
+ * merchant assembling a defence reads their acquirer's guidance, and renamed
114
+ * fields would make it not apply. The Stripe adapter's name map is a total
115
+ * `Record` over this set, so a field added here does not compile until it
116
+ * carries it.
117
+ */
118
+ exports.DISPUTE_TEXT_EVIDENCE_FIELDS = [
119
+ 'access_activity_log',
120
+ 'billing_address',
121
+ 'cancellation_policy_disclosure',
122
+ 'cancellation_rebuttal',
123
+ 'customer_email_address',
124
+ 'customer_name',
125
+ 'customer_purchase_ip',
126
+ 'duplicate_charge_explanation',
127
+ 'product_description',
128
+ 'refund_policy_disclosure',
129
+ 'refund_refusal_explanation',
130
+ 'service_date',
131
+ 'shipping_address',
132
+ 'shipping_carrier',
133
+ 'shipping_date',
134
+ 'shipping_tracking_number',
135
+ 'uncategorized_text',
136
+ ];
137
+ /** The FILE evidence fields: each names a `file_…` of purpose `dispute_evidence`. */
138
+ exports.DISPUTE_FILE_EVIDENCE_FIELDS = [
139
+ 'cancellation_policy',
140
+ 'customer_communication',
141
+ 'customer_signature',
142
+ 'duplicate_charge_documentation',
143
+ 'receipt',
144
+ 'refund_policy',
145
+ 'service_documentation',
146
+ 'shipping_documentation',
147
+ 'uncategorized_file',
148
+ ];
149
+ /** The provider's ceiling on one TEXT evidence field, restated where the request is parsed. */
150
+ exports.DISPUTE_EVIDENCE_TEXT_MAX = 20000;
151
+ // ---------------------------------------------------------------------------
152
+ // SetupIntents
153
+ // ---------------------------------------------------------------------------
154
+ exports.SETUP_INTENT_STATUSES = [
155
+ 'requires_payment_method',
156
+ 'requires_confirmation',
157
+ 'requires_action',
158
+ 'processing',
159
+ 'canceled',
160
+ 'succeeded',
161
+ ];
162
+ exports.SETUP_INTENT_USAGES = ['on_session', 'off_session'];
163
+ exports.SETUP_INTENT_CANCELLATION_REASONS = [
164
+ 'abandoned',
165
+ 'duplicate',
166
+ 'requested_by_customer',
167
+ ];
168
+ // ---------------------------------------------------------------------------
169
+ // Social payments and enrichment
170
+ // ---------------------------------------------------------------------------
171
+ /**
172
+ * Longest `source.app` of a social payment: an app slug, not a label. The
173
+ * column CHECK reads the same bound.
174
+ */
175
+ exports.SOCIAL_SOURCE_APP_MAX_LENGTH = 32;
176
+ /**
177
+ * Longest `source.ref` of a social payment. The bound is the whole defence: the
178
+ * value is opaque, so nothing downstream would notice it growing.
179
+ */
180
+ exports.SOCIAL_SOURCE_REF_MAX_LENGTH = 128;
181
+ /** Which side of a social payment the caller was on. */
182
+ exports.SOCIAL_PAYMENT_DIRECTIONS = ['sent', 'received'];
183
+ /** Where a transaction's counterparty identity came from. */
184
+ exports.ENRICHMENT_KINDS = ['merchant', 'user', 'unknown'];
185
+ /** How many addresses one `POST /v1/enrich` resolves (and one social history lists). */
186
+ exports.ENRICH_MAX_ADDRESSES = 50;
187
+ // ---------------------------------------------------------------------------
188
+ // Test helpers
189
+ // ---------------------------------------------------------------------------
190
+ /**
191
+ * What `simulate_faircoin_payment` pretends the payer did: `settled` paid the
192
+ * full amount (`processing` → `succeeded`); `underpaid` sent less
193
+ * (`processing` → `canceled`, `cancellation_reason: 'underpaid'`).
194
+ */
195
+ exports.SIMULATED_FAIRCOIN_OUTCOMES = ['settled', 'underpaid'];
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ // Reporting and request-log vocabulary: the report types Peable produces, a
3
+ // run's lifecycle, and the methods and status classes a request log is
4
+ // filtered by. Zod-free, like every vocabulary module.
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.REQUEST_LOG_RETENTION_DAYS = exports.REQUEST_LOG_STATUS_CLASSES = exports.REQUEST_LOG_METHODS = exports.REPORT_RUN_STATUSES = exports.REPORT_TYPE_IDS = void 0;
7
+ /**
8
+ * Every report Peable produces, by Stripe's versioned id: the trailing `.1` is
9
+ * the column layout's version, so a layout can change under a new id without
10
+ * changing a report a merchant already parses. The layouts themselves are
11
+ * `REPORT_TYPE_LAYOUTS` in `@peable.to/shared-types/reporting`.
12
+ */
13
+ exports.REPORT_TYPE_IDS = [
14
+ 'payments.itemized.1',
15
+ 'balance.summary.1',
16
+ 'balance_transactions.itemized.1',
17
+ 'payouts.itemized.1',
18
+ 'refunds.itemized.1',
19
+ 'disputes.itemized.1',
20
+ ];
21
+ exports.REPORT_RUN_STATUSES = ['pending', 'succeeded', 'failed'];
22
+ /** The HTTP methods a request log records. */
23
+ exports.REQUEST_LOG_METHODS = ['GET', 'POST', 'DELETE', 'PATCH', 'PUT'];
24
+ /** A request-log `status` filter's class form (`4xx` is 400–499). */
25
+ exports.REQUEST_LOG_STATUS_CLASSES = ['2xx', '3xx', '4xx', '5xx'];
26
+ /** How long a request log is kept (and served). */
27
+ exports.REQUEST_LOG_RETENTION_DAYS = 30;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ // Subscriptions (ADR 0018 §1) — the closed value sets their schemas are built
3
+ // from. Zod-free: `@peable.to/shared-types` re-exports them at runtime.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.RESUME_BILLING_CYCLE_ANCHORS = exports.SUBSCRIPTION_CANCELLATION_REASONS = exports.TRIAL_END_BEHAVIORS = exports.PAUSE_COLLECTION_BEHAVIORS = exports.PAYMENT_BEHAVIORS = exports.CREATE_PRORATION_BEHAVIORS = exports.PRORATION_BEHAVIORS = exports.COLLECTION_METHODS = exports.SUBSCRIPTION_LIST_STATUSES = exports.SUBSCRIPTION_STATUSES = void 0;
6
+ /**
7
+ * Where a subscription stands — Stripe's eight.
8
+ *
9
+ * - `incomplete` — the first invoice is not paid yet; expires to
10
+ * `incomplete_expired` when nobody pays it in time.
11
+ * - `incomplete_expired` — terminal: the first invoice was never paid.
12
+ * - `trialing` — in a trial; nothing is charged until it ends.
13
+ * - `active` — in good standing.
14
+ * - `past_due` — a renewal invoice failed; dunning is retrying it.
15
+ * - `unpaid` — dunning gave up and the merchant's final action
16
+ * is `unpaid`: invoices are still created, access
17
+ * should be withdrawn.
18
+ * - `canceled` — terminal.
19
+ * - `paused` — a trial ended with no payment method and the
20
+ * trial's end behaviour was `pause`; resumed with
21
+ * `POST /v1/subscriptions/:id/resume`.
22
+ */
23
+ exports.SUBSCRIPTION_STATUSES = [
24
+ 'incomplete',
25
+ 'incomplete_expired',
26
+ 'trialing',
27
+ 'active',
28
+ 'past_due',
29
+ 'unpaid',
30
+ 'canceled',
31
+ 'paused',
32
+ ];
33
+ /** `status=` on a subscription list: a status, `all` (including canceled), or `ended`. */
34
+ exports.SUBSCRIPTION_LIST_STATUSES = [...exports.SUBSCRIPTION_STATUSES, 'all', 'ended'];
35
+ /** How the subscription's invoices are collected. FairCoin is always `send_invoice`. */
36
+ exports.COLLECTION_METHODS = ['charge_automatically', 'send_invoice'];
37
+ /** How a change mid-period is billed. */
38
+ exports.PRORATION_BEHAVIORS = ['create_prorations', 'none', 'always_invoice'];
39
+ /** The proration behaviours a subscription CREATE accepts: there is nothing to invoice at once yet. */
40
+ exports.CREATE_PRORATION_BEHAVIORS = [
41
+ 'create_prorations',
42
+ 'none',
43
+ ];
44
+ /** What a create does when the first invoice cannot be paid at once. */
45
+ exports.PAYMENT_BEHAVIORS = [
46
+ 'allow_incomplete',
47
+ 'default_incomplete',
48
+ 'error_if_incomplete',
49
+ ];
50
+ /** What happens to the invoices of a subscription whose collection is paused. */
51
+ exports.PAUSE_COLLECTION_BEHAVIORS = ['keep_as_draft', 'mark_uncollectible', 'void'];
52
+ /** What a trial ending with no payment method does (`trial_settings.end_behavior`). */
53
+ exports.TRIAL_END_BEHAVIORS = ['cancel', 'create_invoice', 'pause'];
54
+ /** Why a subscription was cancelled. */
55
+ exports.SUBSCRIPTION_CANCELLATION_REASONS = [
56
+ 'cancellation_requested',
57
+ 'payment_failed',
58
+ ];
59
+ /** `billing_cycle_anchor` on a resume: a new period now (the default), or the anchor kept. */
60
+ exports.RESUME_BILLING_CYCLE_ANCHORS = ['now', 'unchanged'];
@@ -0,0 +1,237 @@
1
+ "use strict";
2
+ // Peable Tax vocabulary (ADR 0011, ADR 0020): the closed value sets the tax
3
+ // contracts are built from, and the database mirrors as CHECKs. Zod-free, so
4
+ // Orbit and the shared types read them at runtime without constructing a schema.
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TAX_COMPLIANCE_CAPABILITY_CATEGORIES = exports.TAX_COMPLIANCE_CAPABILITY_STATUSES = exports.TAX_DEADLINE_STATUSES = exports.TAX_DEADLINE_KINDS = exports.TAX_ACTOR_TYPES = exports.TAX_REVIEW_DECISIONS = exports.TAX_REVIEW_SEVERITIES = exports.TAX_REVIEW_ITEM_STATUSES = exports.TAX_OBLIGATION_OUTCOMES = exports.TAX_RULE_REVIEW_STATUSES = exports.TAX_THRESHOLD_PERIODS = exports.TAX_TYPES = exports.TAX_DOCUMENT_CHECKLIST_STATUSES = exports.TAX_DOCUMENT_KINDS = exports.TAX_FILING_FREQUENCIES = exports.TAX_REGISTRATION_DECLARATION_STATUSES = exports.TAX_OPERATING_LOCATION_KINDS = exports.TAX_SUPPLY_TYPES = exports.TAX_CUSTOMER_TYPES = exports.TAX_LEGAL_ENTITY_TYPES = exports.DEFAULT_TAX_CODE = exports.NONTAXABLE_TAX_CODE = exports.TAX_CODES = exports.TAX_TRANSACTION_TYPES = exports.TAX_COLLECTIONS = exports.TAX_EVIDENCE_STATUSES = exports.TAX_REGISTRATION_STATUSES = exports.TAX_CALCULATION_ACCOUNTS = exports.TAX_SETTINGS_STATUSES = exports.TAX_BEHAVIORS = exports.TAX_LOCATION_EVIDENCE_TYPES = exports.TAX_REGISTRATION_SCHEMES = void 0;
7
+ exports.isKnownTaxCode = isKnownTaxCode;
8
+ // ── Collection (ADR 0011) ────────────────────────────────────────────────────
9
+ /**
10
+ * How a registration lets the seller collect. `standard`/`simplified` cover one
11
+ * country; the EU One-Stop-Shop schemes cover every EU member state from one
12
+ * identification state; the US is per state; Canadian PST/QST is per province.
13
+ */
14
+ exports.TAX_REGISTRATION_SCHEMES = [
15
+ 'standard',
16
+ 'simplified',
17
+ 'eu_oss_union',
18
+ 'eu_oss_non_union',
19
+ 'us_state_sales_tax',
20
+ 'ca_provincial',
21
+ ];
22
+ /**
23
+ * Location evidence a jurisdiction accepts. There is deliberately no language,
24
+ * currency, locale or timezone: none of them is evidence of where a customer
25
+ * lives, and Peable cannot be told otherwise.
26
+ */
27
+ exports.TAX_LOCATION_EVIDENCE_TYPES = [
28
+ 'billing_address',
29
+ 'ip_address',
30
+ 'payment_method_country',
31
+ 'bank_country',
32
+ 'sim_country',
33
+ 'landline_country',
34
+ ];
35
+ /** Whether a line's amount includes its tax (`inclusive`) or tax is added on top. */
36
+ exports.TAX_BEHAVIORS = ['inclusive', 'exclusive'];
37
+ /** `active` once the owner approved; any edit returns the settings to `draft`. */
38
+ exports.TAX_SETTINGS_STATUSES = ['draft', 'active'];
39
+ /**
40
+ * Which provider account calculates for a merchant. `platform`: Peable's own
41
+ * provider account, available only to official Oxy applications, whose seller
42
+ * is the platform's legal entity. `none`: no provider; sales in a registered
43
+ * jurisdiction cannot be calculated and fail closed.
44
+ */
45
+ exports.TAX_CALCULATION_ACCOUNTS = ['platform', 'none'];
46
+ /** `pending_approval` until the owner approves; `scheduled` before `active_from`. */
47
+ exports.TAX_REGISTRATION_STATUSES = [
48
+ 'pending_approval',
49
+ 'scheduled',
50
+ 'active',
51
+ 'expired',
52
+ ];
53
+ /** Only `sufficient` evidence can be calculated against. */
54
+ exports.TAX_EVIDENCE_STATUSES = ['sufficient', 'insufficient', 'conflicting'];
55
+ /**
56
+ * Why a calculation's tax is what it is: `collect` (a registration covers the
57
+ * customer and the provider calculated), `not_registered` (no registration
58
+ * covers them: zero tax, recorded as such), `nontaxable` (every line used the
59
+ * nontaxable code).
60
+ */
61
+ exports.TAX_COLLECTIONS = ['collect', 'not_registered', 'nontaxable'];
62
+ /** A sale, or a refund (or credit note) of one. */
63
+ exports.TAX_TRANSACTION_TYPES = ['transaction', 'reversal'];
64
+ /**
65
+ * The product tax codes Peable accepts, starting with digital services and
66
+ * SaaS — what every Oxy application sells. Ids are Stripe Tax's tax codes, so a
67
+ * code means the same thing to Peable and to the provider calculating it.
68
+ * Adding a category is adding a row here; classifying a product is the seller's
69
+ * decision.
70
+ */
71
+ exports.TAX_CODES = Object.freeze([
72
+ {
73
+ id: 'txcd_00000000',
74
+ name: 'Nontaxable',
75
+ description: 'A product that is not subject to tax anywhere. No tax is calculated.',
76
+ },
77
+ {
78
+ id: 'txcd_10000000',
79
+ name: 'General - Electronically Supplied Services',
80
+ description: 'A service delivered electronically over the internet with minimal human involvement.',
81
+ },
82
+ {
83
+ id: 'txcd_10103000',
84
+ name: 'Software as a service (SaaS) - personal use',
85
+ description: 'Hosted software accessed online, sold to consumers for personal use.',
86
+ },
87
+ {
88
+ id: 'txcd_10103001',
89
+ name: 'Software as a service (SaaS) - business use',
90
+ description: 'Hosted software accessed online, sold to businesses for business use.',
91
+ },
92
+ {
93
+ id: 'txcd_10202000',
94
+ name: 'Downloadable Software - personal use',
95
+ description: 'Software downloaded to the customer’s device, for personal use.',
96
+ },
97
+ {
98
+ id: 'txcd_10202003',
99
+ name: 'Downloadable Software - business use',
100
+ description: 'Software downloaded to the customer’s device, for business use.',
101
+ },
102
+ {
103
+ id: 'txcd_10701100',
104
+ name: 'Website Hosting',
105
+ description: 'Hosting of a website or web application on the seller’s servers.',
106
+ },
107
+ ]);
108
+ /** The code of a product that is taxed nowhere. */
109
+ exports.NONTAXABLE_TAX_CODE = 'txcd_00000000';
110
+ /** The code a merchant's settings start with: electronically supplied services. */
111
+ exports.DEFAULT_TAX_CODE = 'txcd_10000000';
112
+ const KNOWN_TAX_CODES = new Set(exports.TAX_CODES.map((code) => code.id));
113
+ /** Whether `id` is one of {@link TAX_CODES}. */
114
+ function isKnownTaxCode(id) {
115
+ return KNOWN_TAX_CODES.has(id);
116
+ }
117
+ // ── Business compliance (ADR 0020) ───────────────────────────────────────────
118
+ /** `unknown` is an answer, not a gap: the owner says they do not know yet. */
119
+ exports.TAX_LEGAL_ENTITY_TYPES = [
120
+ 'corporation',
121
+ 'limited_liability_company',
122
+ 'partnership',
123
+ 'sole_proprietorship',
124
+ 'nonprofit',
125
+ 'public_body',
126
+ 'other',
127
+ 'unknown',
128
+ ];
129
+ exports.TAX_CUSTOMER_TYPES = ['consumers', 'businesses', 'both', 'unknown'];
130
+ exports.TAX_SUPPLY_TYPES = [
131
+ 'digital_services',
132
+ 'software_as_a_service',
133
+ 'physical_goods',
134
+ 'professional_services',
135
+ 'other',
136
+ ];
137
+ /**
138
+ * Where the business ACTUALLY operates. `head_office` and `fixed_establishment`
139
+ * are the owner's statement of establishment (the EU rule reads them); any
140
+ * location in a US state is physical presence there.
141
+ */
142
+ exports.TAX_OPERATING_LOCATION_KINDS = [
143
+ 'head_office',
144
+ 'fixed_establishment',
145
+ 'office',
146
+ 'warehouse',
147
+ 'employees',
148
+ 'inventory',
149
+ 'other',
150
+ ];
151
+ /**
152
+ * Where the business stands with a tax authority, IN ITS OWN WORDS.
153
+ *
154
+ * - `unknown` — the owner does not know; an assessment escalates it.
155
+ * - `not_registered` — the owner says there is no registration.
156
+ * - `application_pending` — an application was made outside Peable and the
157
+ * authority has not answered: an ambiguous outcome, never treated as
158
+ * registered.
159
+ * - `registered` — the owner says the authority registered the business, from
160
+ * `effective_from`.
161
+ * - `rejected` — the authority refused the application.
162
+ * - `ended` — the registration ended at `effective_to`.
163
+ */
164
+ exports.TAX_REGISTRATION_DECLARATION_STATUSES = [
165
+ 'unknown',
166
+ 'not_registered',
167
+ 'application_pending',
168
+ 'registered',
169
+ 'rejected',
170
+ 'ended',
171
+ ];
172
+ exports.TAX_FILING_FREQUENCIES = ['monthly', 'quarterly', 'annual', 'unknown'];
173
+ exports.TAX_DOCUMENT_KINDS = [
174
+ 'registration_certificate',
175
+ 'authority_correspondence',
176
+ 'incorporation_record',
177
+ 'filing_confirmation',
178
+ 'payment_receipt',
179
+ 'other',
180
+ ];
181
+ /** `provided`: an available document is attached; `unavailable`: only removed ones are. */
182
+ exports.TAX_DOCUMENT_CHECKLIST_STATUSES = ['provided', 'missing', 'unavailable'];
183
+ /** The tax a jurisdiction rule is about. */
184
+ exports.TAX_TYPES = ['vat', 'sales_tax'];
185
+ /** The window a rule's threshold is measured over. */
186
+ exports.TAX_THRESHOLD_PERIODS = [
187
+ 'current_or_previous_calendar_year',
188
+ 'preceding_twelve_calendar_months',
189
+ ];
190
+ /** Whether a tax professional has signed a rule off. */
191
+ exports.TAX_RULE_REVIEW_STATUSES = ['unreviewed', 'reviewed'];
192
+ /**
193
+ * What an assessment found for one jurisdiction.
194
+ *
195
+ * - `registration_declared` — the owner declares a registration in force.
196
+ * - `likely_required` — the rule indicates an obligation; a person decides.
197
+ * - `approaching_threshold` — at or above 80% of the threshold.
198
+ * - `not_indicated` — nothing in the recorded facts indicates one.
199
+ * - `uncertain` — the facts are missing or contradictory; escalated.
200
+ * - `unsupported` — sales exist where no supported rule applies.
201
+ */
202
+ exports.TAX_OBLIGATION_OUTCOMES = [
203
+ 'registration_declared',
204
+ 'likely_required',
205
+ 'approaching_threshold',
206
+ 'not_indicated',
207
+ 'uncertain',
208
+ 'unsupported',
209
+ ];
210
+ exports.TAX_REVIEW_ITEM_STATUSES = ['open', 'resolved', 'dismissed'];
211
+ exports.TAX_REVIEW_SEVERITIES = ['action_required', 'review'];
212
+ /** What the owner decided. None of them activates collection. */
213
+ exports.TAX_REVIEW_DECISIONS = [
214
+ 'will_register',
215
+ 'registered_outside_peable',
216
+ 'not_required',
217
+ 'accepted_risk',
218
+ 'facts_corrected',
219
+ 'dismissed',
220
+ ];
221
+ /** Who recorded a compliance change: the owner, a service credential, or Peable itself. */
222
+ exports.TAX_ACTOR_TYPES = ['user', 'service', 'system'];
223
+ exports.TAX_DEADLINE_KINDS = ['return', 'payment', 'registration'];
224
+ exports.TAX_DEADLINE_STATUSES = ['upcoming', 'due_soon', 'passed'];
225
+ exports.TAX_COMPLIANCE_CAPABILITY_STATUSES = [
226
+ 'available',
227
+ 'limited',
228
+ 'not_available',
229
+ 'out_of_scope',
230
+ ];
231
+ /** VAT/sales tax, corporate income tax and annual company filings are different obligations. */
232
+ exports.TAX_COMPLIANCE_CAPABILITY_CATEGORIES = [
233
+ 'vat_sales_tax',
234
+ 'corporate_income_tax',
235
+ 'annual_company_filings',
236
+ 'workflow',
237
+ ];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PEABLE_API_VERSIONS = exports.PEABLE_API_VERSION = void 0;
4
+ /**
5
+ * The date of the one wire (ADR 0014 D2): echoed as `Peable-Version` on every
6
+ * response, the `api_version` every event is stored under, and the only value
7
+ * a caller may send in `Peable-Version`. One constant, so the header, the
8
+ * stored events and the SDK's `apiVersion` cannot name two different wires.
9
+ */
10
+ exports.PEABLE_API_VERSION = '2026-11-03';
11
+ /** Every wire date the gateway serves. Dated versions side by side are a later decision (ADR 0014 D2). */
12
+ exports.PEABLE_API_VERSIONS = [exports.PEABLE_API_VERSION];
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ import { contractRegistry } from './objects.js';
3
+ /**
4
+ * Stripe's address and shipping shapes — as returned (every field present,
5
+ * `null` when not given) and as a request carries them (every field optional).
6
+ * Shared by every object that holds one: intents, customers, payment methods,
7
+ * checkout sessions.
8
+ */
9
+ export const addressSchema = z
10
+ .object({
11
+ line1: z.string().nullable(),
12
+ line2: z.string().nullable(),
13
+ city: z.string().nullable(),
14
+ state: z.string().nullable(),
15
+ postal_code: z.string().nullable(),
16
+ country: z.string().nullable().describe('ISO 3166-1 alpha-2.'),
17
+ })
18
+ .strict();
19
+ contractRegistry.add(addressSchema, { id: 'Address' });
20
+ export const shippingSchema = z
21
+ .object({
22
+ name: z.string(),
23
+ phone: z.string().nullable(),
24
+ address: addressSchema,
25
+ carrier: z.string().nullable(),
26
+ tracking_number: z.string().nullable(),
27
+ })
28
+ .strict();
29
+ contractRegistry.add(shippingSchema, { id: 'Shipping' });
30
+ const line = z.string().max(500);
31
+ /** An address as a request carries it: every field optional. */
32
+ export const addressParams = z
33
+ .object({
34
+ line1: line.optional(),
35
+ line2: line.optional(),
36
+ city: line.optional(),
37
+ state: line.optional(),
38
+ postal_code: z.string().max(40).optional(),
39
+ country: z
40
+ .string()
41
+ .regex(/^[A-Z]{2}$/, 'country must be an ISO 3166-1 alpha-2 code')
42
+ .optional(),
43
+ })
44
+ .strict();
45
+ /** Shipping as a request carries it: only `name` and `address` are required. */
46
+ export const shippingParams = z
47
+ .object({
48
+ name: z.string().min(1).max(500),
49
+ phone: z.string().max(40).optional(),
50
+ address: addressParams,
51
+ carrier: z.string().max(200).optional(),
52
+ tracking_number: z.string().max(200).optional(),
53
+ })
54
+ .strict();
55
+ export const emailParam = z.email().max(512);
56
+ /** A request address in the stored (and wire) shape: every field present. */
57
+ export function toAddress(input) {
58
+ return {
59
+ line1: input.line1 ?? null,
60
+ line2: input.line2 ?? null,
61
+ city: input.city ?? null,
62
+ state: input.state ?? null,
63
+ postal_code: input.postal_code ?? null,
64
+ country: input.country ?? null,
65
+ };
66
+ }
67
+ /** Request shipping in the stored (and wire) shape. */
68
+ export function toShipping(input) {
69
+ return {
70
+ name: input.name,
71
+ phone: input.phone ?? null,
72
+ address: toAddress(input.address),
73
+ carrier: input.carrier ?? null,
74
+ tracking_number: input.tracking_number ?? null,
75
+ };
76
+ }