@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,95 @@
1
+ import { z } from 'zod';
2
+ import { ERROR_CODES, ERROR_DOCS_BASE_URL, ERROR_TYPES } from '../vocabulary/errors.js';
3
+ import { contractRegistry, resolveObject } from './objects.js';
4
+ /**
5
+ * The envelopes every resource shares (ADR 0014 D1): the list, the search
6
+ * result, the deleted tombstone and the error.
7
+ */
8
+ /**
9
+ * One page of a list, newest first. `url` is the path that was listed, so a
10
+ * page carries enough to fetch the next one without the caller remembering
11
+ * where it came from.
12
+ */
13
+ export function listOf(item) {
14
+ return z
15
+ .object({
16
+ object: z.literal('list'),
17
+ data: z.array(item),
18
+ has_more: z
19
+ .boolean()
20
+ .describe('Whether another page exists in the direction this one was read.'),
21
+ url: z.string().describe('The path that was listed.'),
22
+ })
23
+ .strict();
24
+ }
25
+ /**
26
+ * One page of a search. Pages FORWARD only, by an opaque `next_page` token
27
+ * passed back as `page`, bound to the query it came from.
28
+ */
29
+ export function searchResultOf(item) {
30
+ return z
31
+ .object({
32
+ object: z.literal('search_result'),
33
+ data: z.array(item),
34
+ has_more: z.boolean(),
35
+ next_page: z
36
+ .string()
37
+ .nullable()
38
+ .describe('Pass as `page` for the next page; `null` on the last one.'),
39
+ url: z.string().describe('The path that was searched.'),
40
+ total_count: z
41
+ .number()
42
+ .int()
43
+ .nonnegative()
44
+ .optional()
45
+ .describe('Present only when asked for with `expand[]=total_count`.'),
46
+ })
47
+ .strict();
48
+ }
49
+ /** A deleted object, as its `DELETE` answers: `{id, object, deleted: true}`. */
50
+ export function deletedOf(object) {
51
+ return z.object({ id: z.string(), object: z.literal(object), deleted: z.literal(true) }).strict();
52
+ }
53
+ /** The error object inside every non-2xx answer. */
54
+ export const apiErrorSchema = z
55
+ .object({
56
+ type: z.enum(ERROR_TYPES).describe('The broad class a caller branches on first.'),
57
+ // A string rather than the closed `ERROR_CODES`: a `card_error` carries the
58
+ // provider's decline code (`insufficient_funds`, `expired_card`, …), which
59
+ // Peable passes through. Every code Peable itself answers with is an
60
+ // `ErrorCode` (the backend's `sendError` takes nothing else).
61
+ code: z
62
+ .string()
63
+ .optional()
64
+ .describe(`The machine-readable reason (one of ${String(ERROR_CODES.length)} documented at ${ERROR_DOCS_BASE_URL}, or a card network's decline code on a \`card_error\`).`),
65
+ decline_code: z
66
+ .string()
67
+ .optional()
68
+ .describe("A card issuer's decline reason, on a `card_error`."),
69
+ param: z
70
+ .string()
71
+ .optional()
72
+ .describe('The offending request field, in bracket notation (`metadata[order_id]`).'),
73
+ message: z.string().describe('A human-readable message, for a developer.'),
74
+ doc_url: z.url().optional().describe('The documentation of `code`.'),
75
+ request_id: z.string().nullable().describe('The `Request-Id` of this response, for support.'),
76
+ payment_intent: z
77
+ .lazy(() => resolveObject('payment_intent'))
78
+ .optional()
79
+ .describe('On a `card_error` from a confirm or an invoice payment: the PaymentIntent, as it now is.'),
80
+ invoice: z
81
+ .lazy(() => resolveObject('invoice'))
82
+ .optional()
83
+ .describe('On a failed invoice payment: the invoice, as it now is.'),
84
+ refresh_url: z
85
+ .url()
86
+ .optional()
87
+ .describe('On an expired onboarding link: where the seller gets a fresh one.'),
88
+ })
89
+ .strict();
90
+ /** `{ error: {...} }` — every non-2xx answer. */
91
+ export const errorEnvelopeSchema = z.object({ error: apiErrorSchema }).strict();
92
+ contractRegistry.add(errorEnvelopeSchema, {
93
+ id: 'Error',
94
+ description: 'Every non-2xx answer. The HTTP status and `error.type` identify the failure.',
95
+ });
@@ -0,0 +1,74 @@
1
+ import { z } from 'zod';
2
+ /** The one registry every contract schema's metadata lives in. */
3
+ export const contractRegistry = z.registry();
4
+ const objectSchemas = new Map();
5
+ /**
6
+ * Register a wire object: its `object` value (the key references use) and its
7
+ * component name. Returns the schema so a definition reads as one expression.
8
+ */
9
+ export function defineObject(type, id, schema, meta = {}) {
10
+ if (objectSchemas.has(type))
11
+ throw new Error(`object type '${type}' is defined twice`);
12
+ objectSchemas.set(type, schema);
13
+ contractRegistry.add(schema, { id, ...meta });
14
+ return schema;
15
+ }
16
+ /**
17
+ * Register a named schema that is not an expandable object — a tombstone, a
18
+ * shared sub-object, a polymorphic payload — as `#/components/schemas/<id>`.
19
+ */
20
+ export function defineComponent(id, schema, meta = {}) {
21
+ contractRegistry.add(schema, { id, ...meta });
22
+ return schema;
23
+ }
24
+ /** The registered schema of `type`, or `undefined`. */
25
+ export function objectSchema(type) {
26
+ return objectSchemas.get(type);
27
+ }
28
+ /**
29
+ * The registered schema of `type`. Resolved lazily (a reference is declared
30
+ * before the module defining its target has loaded), and loud when nothing
31
+ * registers it: a reference to an unknown object is a contract bug.
32
+ */
33
+ export function resolveObject(type) {
34
+ const schema = objectSchemas.get(type);
35
+ if (!schema)
36
+ throw new Error(`no wire object is registered as '${type}'`);
37
+ return schema;
38
+ }
39
+ /** Every registered object type, in registration order. */
40
+ export function objectTypes() {
41
+ return [...objectSchemas.keys()];
42
+ }
43
+ /**
44
+ * A reference `expand[]` can replace: the id (`cus_…`) or, expanded, the
45
+ * object. The naming rule (`lib/expand.ts` in the backend): an expandable
46
+ * reference is spelled WITHOUT `_id`, and a field without `_id` that is not
47
+ * expandable is a bug.
48
+ */
49
+ export function expandable(type, description) {
50
+ const resolved = z.lazy(() => resolveObject(type));
51
+ const union = z.union([z.string(), resolved]);
52
+ contractRegistry.add(union, {
53
+ 'x-peable-expandable': type,
54
+ ...(description === undefined ? {} : { description }),
55
+ });
56
+ return union;
57
+ }
58
+ /**
59
+ * A field that always carries the FULL object `type` names (never an id): a
60
+ * subscription item's `price`, a payer view's `payment_intent`, a report run's
61
+ * result `file`. Validated against the registered schema and typed through
62
+ * {@link Ref}, so {@link Expand} resolves it to that object's wire type.
63
+ */
64
+ export function embedded(type, description) {
65
+ const schema = z.lazy(() => resolveObject(type));
66
+ return (description === undefined
67
+ ? schema
68
+ : schema.describe(description));
69
+ }
70
+ /** Attach OpenAPI metadata to a schema without changing its type. */
71
+ export function describe(schema, meta) {
72
+ contractRegistry.add(schema, { ...contractRegistry.get(schema), ...meta });
73
+ return schema;
74
+ }
@@ -0,0 +1,203 @@
1
+ import { z } from 'zod';
2
+ import { LIST_LIMIT_DEFAULT, LIST_LIMIT_MAX, SEARCH_QUERY_MAX_LENGTH } from '../vocabulary/lists.js';
3
+ import { contractRegistry } from './objects.js';
4
+ /**
5
+ * Request-side building blocks (ADR 0014 D1).
6
+ *
7
+ * A request schema has two sides and both matter:
8
+ *
9
+ * - its INPUT (`z.input`) is the wire — what a caller sends, what the SDK's
10
+ * parameter types are, and what the OpenAPI document describes;
11
+ * - its OUTPUT (`z.output`) is what a backend handler receives once parsed —
12
+ * a query integer as a `number`, `expand` always an array, a metadata update
13
+ * as a `{ set, unset }` patch.
14
+ *
15
+ * So the transforms live HERE, beside the shape, and the backend never
16
+ * re-parses what a contract already decided.
17
+ */
18
+ /** Attach the JSON Schema a node is documented with when its input side is not the wire's spelling. */
19
+ function documentedAs(schema, jsonSchema) {
20
+ contractRegistry.add(schema, { ...contractRegistry.get(schema), jsonSchema });
21
+ return schema;
22
+ }
23
+ /**
24
+ * An integer in a query string. Arrives as a string from a URL, as a number
25
+ * from a typed caller; both are the same request.
26
+ */
27
+ export function queryInteger(bounds = {}) {
28
+ let target = z.number().int();
29
+ if (bounds.min !== undefined)
30
+ target = target.min(bounds.min);
31
+ if (bounds.max !== undefined)
32
+ target = target.max(bounds.max);
33
+ return documentedAs(z.union([z.number(), z.string()]).transform(Number).pipe(target), {
34
+ type: 'integer',
35
+ ...(bounds.min === undefined ? {} : { minimum: bounds.min }),
36
+ ...(bounds.max === undefined ? {} : { maximum: bounds.max }),
37
+ });
38
+ }
39
+ /** `true` / `false` in a query string (or a real boolean from a typed caller). */
40
+ export const queryBoolean = documentedAs(z.union([z.boolean(), z.enum(['true', 'false'])]).transform((v) => v === true || v === 'true'), { type: 'boolean' });
41
+ /** The latest representable instant (9999-12-31T23:59:59Z), the bound of every Unix-seconds parameter. */
42
+ export const MAX_UNIX_SECONDS = 253402300799;
43
+ /** Unix seconds in a body. */
44
+ export const unixSecondsParam = z.number().int().min(0).max(MAX_UNIX_SECONDS);
45
+ /** Unix seconds in a query string. */
46
+ export const queryUnixSeconds = queryInteger({ min: 0, max: MAX_UNIX_SECONDS });
47
+ /**
48
+ * `created=X` (exactly that second) or `created[gt|gte|lt|lte]=X`. The bare
49
+ * form is normalized to the range `[X, X]` so the repository reads one shape.
50
+ */
51
+ export const rangeParam = documentedAs(z.union([
52
+ queryUnixSeconds.transform((x) => ({ gte: x, lte: x })),
53
+ z
54
+ .object({
55
+ gt: queryUnixSeconds.optional(),
56
+ gte: queryUnixSeconds.optional(),
57
+ lt: queryUnixSeconds.optional(),
58
+ lte: queryUnixSeconds.optional(),
59
+ })
60
+ .strict()
61
+ .transform((range) => range),
62
+ ]), {
63
+ description: 'Unix seconds: exactly one second, or a range with `gt`, `gte`, `lt`, `lte`.',
64
+ oneOf: [
65
+ { type: 'integer', minimum: 0 },
66
+ {
67
+ type: 'object',
68
+ additionalProperties: false,
69
+ properties: {
70
+ gt: { type: 'integer', minimum: 0 },
71
+ gte: { type: 'integer', minimum: 0 },
72
+ lt: { type: 'integer', minimum: 0 },
73
+ lte: { type: 'integer', minimum: 0 },
74
+ },
75
+ },
76
+ ],
77
+ });
78
+ /**
79
+ * `expand[]=a&expand[]=b` arrives as an array; `expand=a` as a string. Both
80
+ * mean the same request. Dot paths, at most four levels; on a list every path
81
+ * starts with `data.`.
82
+ */
83
+ export const expandParam = documentedAs(z
84
+ .union([z.string(), z.array(z.string())])
85
+ .transform((value) => (typeof value === 'string' ? [value] : value))
86
+ .pipe(z.array(z.string().min(1).max(200)).max(20)), {
87
+ type: 'array',
88
+ items: { type: 'string', maxLength: 200 },
89
+ maxItems: 20,
90
+ description: 'Dot paths of references to replace with the objects they name (at most four levels; `data.`-prefixed on a list).',
91
+ });
92
+ /** The public id of a cursor. Bounded so a cursor is never an unbounded index probe. */
93
+ export const cursorParam = z.string().min(1).max(255);
94
+ /** An object id in a body or query. */
95
+ export const idParam = z.string().min(1).max(255);
96
+ /** The list limit: 1–100, default 10. */
97
+ export const limitParam = documentedAs(z
98
+ .union([z.number(), z.string()])
99
+ .transform(Number)
100
+ .pipe(z.number().int().min(1).max(LIST_LIMIT_MAX))
101
+ .optional()
102
+ .transform((value) => value ?? LIST_LIMIT_DEFAULT), { type: 'integer', minimum: 1, maximum: LIST_LIMIT_MAX, default: LIST_LIMIT_DEFAULT });
103
+ /** The parameters every list accepts. */
104
+ export const listShape = {
105
+ limit: limitParam,
106
+ starting_after: cursorParam
107
+ .optional()
108
+ .describe('The id of the LAST object of the previous page: the next page is older.'),
109
+ ending_before: cursorParam
110
+ .optional()
111
+ .describe('The id of the FIRST object of the current page: the page returned is newer.'),
112
+ created: rangeParam.optional(),
113
+ expand: expandParam.optional(),
114
+ };
115
+ function refuseBothCursors(query, ctx) {
116
+ if (query.starting_after !== undefined && query.ending_before !== undefined) {
117
+ ctx.addIssue({
118
+ code: 'custom',
119
+ path: ['ending_before'],
120
+ message: 'starting_after and ending_before are mutually exclusive',
121
+ });
122
+ }
123
+ }
124
+ /**
125
+ * A list query: the shared parameters plus the route's own filters.
126
+ *
127
+ * `.strict()`: an unknown parameter is a 400 naming it, never silently ignored
128
+ * — `?stauts=settled` answering every intent is a filter the caller believes
129
+ * they applied.
130
+ */
131
+ export function listQuery(filters) {
132
+ return z
133
+ .object({ ...listShape, ...filters })
134
+ .strict()
135
+ .superRefine((query, ctx) => refuseBothCursors(query, ctx));
136
+ }
137
+ /** A retrieve's query: `expand[]` and nothing else unless the route says so. */
138
+ export function retrieveQuery(extra) {
139
+ return z.object({ expand: expandParam.optional(), ...extra }).strict();
140
+ }
141
+ /** The query of a route that takes `expand[]` only. */
142
+ export const expandOnlyQuery = retrieveQuery({});
143
+ /** The query of a route that takes no parameters at all. */
144
+ export const emptyQuery = z.object({}).strict();
145
+ /** The parameters every `GET /v1/<objects>/search` accepts. */
146
+ export const searchShape = {
147
+ query: z
148
+ .string({ error: 'query is required' })
149
+ .min(1, 'query is required')
150
+ .max(SEARCH_QUERY_MAX_LENGTH, `a query is at most ${String(SEARCH_QUERY_MAX_LENGTH)} characters`)
151
+ .describe('Stripe\'s search query language: `email:"jenny@example.com"`, `amount>1000 AND currency:"EUR"`, `metadata[\'order_id\']:\'6735\'`, `name~"shirt"`, `-status:"canceled"`, `customer:null`.'),
152
+ limit: limitParam,
153
+ page: z
154
+ .string()
155
+ .min(1)
156
+ .max(512)
157
+ .optional()
158
+ .describe('The `next_page` of the previous page, with the SAME query.'),
159
+ expand: expandParam.optional(),
160
+ };
161
+ /** A search query. */
162
+ export const searchQuery = z.object(searchShape).strict();
163
+ export const METADATA_MAX_KEYS = 50;
164
+ export const METADATA_KEY_MAX = 40;
165
+ export const METADATA_VALUE_MAX = 500;
166
+ const metadataKey = z
167
+ .string()
168
+ .min(1, 'metadata keys cannot be empty')
169
+ .max(METADATA_KEY_MAX, `metadata keys are at most ${METADATA_KEY_MAX} characters`)
170
+ // A key is quoted back in bracket notation (`metadata[order_id]`) in every
171
+ // error's `param`; a key containing brackets would make that ambiguous.
172
+ .refine((key) => !/[[\]]/.test(key), 'metadata keys cannot contain square brackets');
173
+ const metadataValue = z
174
+ .string()
175
+ .max(METADATA_VALUE_MAX, `metadata values are at most ${METADATA_VALUE_MAX} characters`);
176
+ const metadataBag = z
177
+ .record(metadataKey, metadataValue)
178
+ .refine((bag) => Object.keys(bag).length <= METADATA_MAX_KEYS, `metadata holds at most ${METADATA_MAX_KEYS} keys`)
179
+ .describe('At most 50 keys; keys ≤ 40 characters, values ≤ 500.');
180
+ /**
181
+ * The bag a create stores. Empty values are dropped: there is nothing to unset
182
+ * yet.
183
+ */
184
+ export const metadataCreateParam = metadataBag.transform((bag) => Object.fromEntries(Object.entries(bag).filter(([, value]) => value !== '')));
185
+ /**
186
+ * The patch an update applies: named keys are set, a key sent as `""` is
187
+ * removed, keys not named are kept. The 50-key limit is then judged on the
188
+ * merged result, which only the database can see.
189
+ */
190
+ export const metadataUpdateParam = metadataBag
191
+ .transform((bag) => ({
192
+ set: Object.fromEntries(Object.entries(bag).filter(([, value]) => value !== '')),
193
+ unset: Object.entries(bag)
194
+ .filter(([, value]) => value === '')
195
+ .map(([key]) => key),
196
+ }))
197
+ .describe('A patch: named keys are set, a key sent as `""` is removed, others are kept.');
198
+ /** The answer when the MERGED bag would exceed the key limit. */
199
+ export const METADATA_LIMIT_MESSAGE = `metadata holds at most ${METADATA_MAX_KEYS} keys`;
200
+ /** `""` clears a field on an update, Stripe's rule. */
201
+ export const clearable = (schema) => z.union([schema, z.literal('')]);
202
+ /** Bounded text. */
203
+ export const text = (max) => z.string().max(max);
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import { BASE_UNIT_PATTERN, CURRENCY_CODES, FIAT_CURRENCY_CODES, NETWORK_TYPES, SIGNED_BASE_UNIT_PATTERN, } from '../vocabulary/money.js';
3
+ /**
4
+ * The house style's primitives (ADR 0014 D1), as RESPONSE schemas: what the
5
+ * gateway emits. Request-side building blocks (coercing query integers,
6
+ * `expand[]`, metadata patches) are in `params.ts`.
7
+ */
8
+ /** Every instant on the wire: integer Unix seconds. */
9
+ export const unixSeconds = z.number().int().nonnegative().describe('Unix seconds.');
10
+ /** A base-unit amount: an integer string in the currency's smallest unit (a FAIR amount does not fit a JS number). */
11
+ export const amount = z
12
+ .string()
13
+ .regex(BASE_UNIT_PATTERN)
14
+ .describe('Base units of `currency`, as an integer string (cents for EUR, m⊜ for FAIR).');
15
+ /** A signed base-unit amount (a customer balance, a balance transaction's net). */
16
+ export const signedAmount = z
17
+ .string()
18
+ .regex(SIGNED_BASE_UNIT_PATTERN)
19
+ .describe('Signed base units of `currency`, as an integer string.');
20
+ /** An uppercase ISO 4217 code, or `FAIR`. */
21
+ export const currency = z.enum(CURRENCY_CODES).describe('Uppercase ISO 4217 code, or `FAIR`.');
22
+ /** A currency the card rail can denominate in. */
23
+ export const fiatCurrency = z.enum(FIAT_CURRENCY_CODES);
24
+ /** The FairCoin network. */
25
+ export const network = z.enum(NETWORK_TYPES);
26
+ /** Whether the object exists in live mode (`false`: test mode). */
27
+ export const livemode = z.boolean().describe('`true` in live mode, `false` in test mode.');
28
+ /** The merchant's own key/value bag, as returned. */
29
+ export const metadata = z
30
+ .record(z.string(), z.string())
31
+ .describe('Your own key/value pairs: at most 50 keys, keys ≤ 40 characters, values ≤ 500.');
32
+ /** A nullable string — the shape of every optional text field on a response. */
33
+ export const nullableString = z.string().nullable();
34
+ /** A literal `object` discriminator. */
35
+ export const objectName = (name) => z.literal(name);
@@ -0,0 +1,5 @@
1
+ // `@peable.to/contracts/contributions` — the contribution schemas and FAIR
2
+ // amount helpers, without the rest of the API's schemas: the hosted checkout
3
+ // and Orbit import this subpath at runtime. The contracts themselves live in
4
+ // `resources/checkout/contributions.ts`, beside the other checkout routes.
5
+ export { contributionAmountSchema, contributionCollectionListSchema, contributionCollectionSchema, contributionDetailsSchema, contributionLinkSchema, contributionListSchema, contributionMintSchema, contributionOperationKeySchema, contributionPageQuerySchema, contributionPatchSchema, contributionScopeQuerySchema, createContributionSchema, decimalContributionAmount, formatContributionAmount, } from './resources/checkout/contributions.js';
package/dist/esm/index.js CHANGED
@@ -1,134 +1,26 @@
1
- import { z } from 'zod';
2
- export const contributionAmountSchema = z
3
- .string()
4
- .regex(/^[1-9][0-9]{0,15}$/)
5
- .refine((v) => /^[1-9][0-9]{0,15}$/.test(v) && BigInt(v) <= 9007199254740991n, 'Enter a positive FairCoin base-unit amount within the supported range');
6
- /** Every instant on the wire is integer Unix seconds (ADR 0014 D1). */
7
- const unixSecondsSchema = z.number().int().nonnegative();
8
- export const contributionDetailsSchema = z
9
- .object({
10
- organization_id: z.string().min(1).max(200),
11
- purpose: z.string().trim().min(1).max(500),
12
- amount_mode: z.enum(['fixed', 'free']),
13
- expires_at: unixSecondsSchema.nullable(),
14
- })
15
- .strict();
16
- export const createContributionSchema = z
17
- .object({
18
- purpose: contributionDetailsSchema.shape.purpose,
19
- amount_mode: contributionDetailsSchema.shape.amount_mode,
20
- amount: contributionAmountSchema.optional(),
21
- currency: z.literal('FAIR'),
22
- expires_at: unixSecondsSchema.nullable().optional(),
23
- })
24
- .strict()
25
- .refine((v) => (v.amount_mode === 'free' ? v.amount === undefined : v.amount !== undefined), 'Fixed contributions require an amount; free contributions omit it');
26
- export const contributionLinkSchema = z
27
- .object({
28
- id: z.string(),
29
- object: z.literal('payment_link'),
30
- amount: z.string(),
31
- currency: z.literal('FAIR'),
32
- network: z.enum(['mainnet', 'testnet']),
33
- active: z.boolean(),
34
- url: z.url(),
35
- contribution: contributionDetailsSchema,
36
- created: unixSecondsSchema,
37
- })
38
- .strict();
39
- /**
40
- * The one list envelope (ADR 0014 D1): `url` is the path that was listed.
41
- */
42
- function listSchema(item) {
43
- return z
44
- .object({
45
- object: z.literal('list'),
46
- data: z.array(item),
47
- has_more: z.boolean(),
48
- url: z.string(),
49
- })
50
- .strict();
51
- }
52
- export const contributionListSchema = listSchema(contributionLinkSchema);
53
- export const contributionCollectionSchema = z
54
- .object({
55
- id: z.string(),
56
- object: z.literal('payment_intent'),
57
- amount: z.string(),
58
- currency: z.literal('FAIR'),
59
- status: z.string(),
60
- created: unixSecondsSchema,
61
- refund_capability: z.literal('unsupported_non_custodial'),
62
- refunds: z.array(z
63
- .object({
64
- id: z.string(),
65
- object: z.literal('refund'),
66
- amount: z.string(),
67
- status: z.string(),
68
- created: unixSecondsSchema,
69
- })
70
- .strict()),
71
- })
72
- .strict();
73
- export const contributionCollectionListSchema = listSchema(contributionCollectionSchema);
74
- const unixSecondsQuery = z.coerce.number().int().nonnegative();
75
- /**
76
- * The list parameters every list accepts (ADR 0014 D1), newest first:
77
- *
78
- * - `limit` 1–100, default 10;
79
- * - `starting_after` — the id of the last object of the previous page — or
80
- * `ending_before` — the id of the first object of the current one, which
81
- * pages backwards and still answers newest first. Never both;
82
- * - `created` (one second) or `created[gt|gte|lt|lte]`, Unix seconds.
83
- *
84
- * Cursors are resolved by the gateway inside the caller's scope; one naming
85
- * anything else is a 400 with `param` naming the cursor.
86
- */
87
- export const listQueryShape = {
88
- limit: z.coerce.number().int().min(1).max(100).default(10),
89
- starting_after: z.string().min(1).max(255).optional(),
90
- ending_before: z.string().min(1).max(255).optional(),
91
- created: z
92
- .union([
93
- unixSecondsQuery.transform((x) => ({ gte: x, lte: x })),
94
- z
95
- .object({
96
- gt: unixSecondsQuery.optional(),
97
- gte: unixSecondsQuery.optional(),
98
- lt: unixSecondsQuery.optional(),
99
- lte: unixSecondsQuery.optional(),
100
- })
101
- .strict(),
102
- ])
103
- .optional(),
104
- };
105
- /**
106
- * Paging a contribution list: the list parameters (`link_…` cursors for links,
107
- * `pi_…` for collections) plus the environment the Test/Live toggle selects.
108
- */
109
- export const contributionPageQuerySchema = z
110
- .object({
111
- ...listQueryShape,
112
- environment: z.enum(['development', 'staging', 'production']),
113
- })
114
- .strict()
115
- .refine((query) => query.starting_after === undefined || query.ending_before === undefined, {
116
- message: 'starting_after and ending_before are mutually exclusive',
117
- path: ['ending_before'],
118
- });
119
- export const contributionMintSchema = z
120
- .object({ amount: contributionAmountSchema.optional() })
121
- .strict();
122
- export const contributionOperationKeySchema = z.string().uuid();
123
- export const contributionPatchSchema = z.object({ active: z.boolean() }).strict();
124
- export function decimalContributionAmount(value) {
125
- if (!/^(0|[1-9][0-9]{0,7})(\.[0-9]{1,8})?$/.test(value))
126
- throw new Error('Enter a FAIR amount with at most eight decimals');
127
- const [whole = '0', fraction = ''] = value.split('.');
128
- return contributionAmountSchema.parse((BigInt(whole) * 100000000n + BigInt(fraction.padEnd(8, '0'))).toString());
129
- }
130
- export function formatContributionAmount(value) {
131
- const units = BigInt(value);
132
- const fraction = (units % 100000000n).toString().padStart(8, '0').replace(/0+$/, '');
133
- return (units / 100000000n).toString() + (fraction ? `.${fraction}` : '');
134
- }
1
+ // @peable.to/contracts — the Peable wire, declared once (ADR 0014 D5).
2
+ //
3
+ // Every public route's request and response schema is a Zod schema here. The
4
+ // backend validates with these exact objects, the OpenAPI document
5
+ // (`@peable.to/contracts/openapi`) is generated from them, `@peable.to/shared-types`
6
+ // re-exports their inferred types, and `@peable.to/sdk`'s resource methods are
7
+ // generated from the route list.
8
+ //
9
+ // Importing this root constructs every schema. A bundle that only needs the
10
+ // closed value sets imports `@peable.to/contracts/vocabulary`.
11
+ export * from './common/address.js';
12
+ export * from './common/envelopes.js';
13
+ export * from './common/objects.js';
14
+ export * from './common/params.js';
15
+ export * from './common/primitives.js';
16
+ export * from './route.js';
17
+ export * from './routes.js';
18
+ export * from './vocabulary/index.js';
19
+ export * from './resources/core/index.js';
20
+ export * from './resources/payments/index.js';
21
+ export * from './resources/checkout/index.js';
22
+ export * from './resources/catalog/index.js';
23
+ export * from './resources/billingEngine/index.js';
24
+ export * from './resources/connect/index.js';
25
+ export * from './resources/tax/index.js';
26
+ export * from './resources/events/index.js';