@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,235 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.reportingRoutes = exports.downloadReportQuery = exports.listReportRunsQuery = exports.createReportRunParams = exports.reportRunSchema = exports.reportRunParametersSchema = exports.reportTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const objects_1 = require("../../common/objects");
6
+ const envelopes_1 = require("../../common/envelopes");
7
+ const objects_2 = require("../../common/objects");
8
+ const params_1 = require("../../common/params");
9
+ const primitives_1 = require("../../common/primitives");
10
+ const route_1 = require("../../route");
11
+ const money_1 = require("../../vocabulary/money");
12
+ const reporting_1 = require("../../vocabulary/reporting");
13
+ /**
14
+ * Reporting (Stripe's `reporting.*`): a merchant asks for a report over an
15
+ * interval, Peable computes it in the background and stores the CSV as a
16
+ * `file_…` of purpose `finance_report_run` — or downloads the same CSV at once,
17
+ * streamed (`GET /v1/reporting/report_types/{id}/csv`). Both are ONE report:
18
+ * the same layout, the same columns, the same computation. The layouts are
19
+ * `REPORT_TYPE_LAYOUTS` in `@peable.to/shared-types/reporting`.
20
+ */
21
+ const reportTypeId = zod_1.z.enum(reporting_1.REPORT_TYPE_IDS);
22
+ /** `reporting.report_type` — what can be run, and over which interval data exists. */
23
+ exports.reportTypeSchema = (0, objects_2.defineObject)('reporting.report_type', 'ReportType', zod_1.z
24
+ .object({
25
+ id: reportTypeId.describe('`payments.itemized.1`, …; the trailing number is the layout version.'),
26
+ object: zod_1.z.literal('reporting.report_type'),
27
+ livemode: primitives_1.livemode,
28
+ name: zod_1.z.string(),
29
+ version: zod_1.z
30
+ .number()
31
+ .int()
32
+ .describe("The column layout's version — the trailing number of the id."),
33
+ columns: zod_1.z
34
+ .array(zod_1.z.string())
35
+ .describe('Every column `parameters.columns` may name, in the order they are written.'),
36
+ default_columns: zod_1.z.array(zod_1.z.string()),
37
+ data_available_start: primitives_1.unixSeconds.describe('The earliest `interval_start` with data.'),
38
+ data_available_end: primitives_1.unixSeconds.describe('The latest `interval_end` a run may ask for: now — the data is live.'),
39
+ updated: primitives_1.unixSeconds.describe('When the layout last changed.'),
40
+ })
41
+ .strict(), {
42
+ examples: [
43
+ {
44
+ id: 'balance.summary.1',
45
+ object: 'reporting.report_type',
46
+ livemode: false,
47
+ name: 'Balance summary',
48
+ version: 1,
49
+ columns: [
50
+ 'category',
51
+ 'description',
52
+ 'currency',
53
+ 'net_amount',
54
+ 'transaction_count',
55
+ 'net_amount_decimal',
56
+ ],
57
+ default_columns: ['category', 'description', 'currency', 'net_amount'],
58
+ data_available_start: 1790000000,
59
+ data_available_end: 1793750400,
60
+ updated: 1793664000,
61
+ },
62
+ ],
63
+ });
64
+ /** What a run was asked to cover. */
65
+ exports.reportRunParametersSchema = (0, objects_2.defineComponent)('ReportRunParameters', zod_1.z
66
+ .object({
67
+ interval_start: primitives_1.unixSeconds.describe('Inclusive.'),
68
+ interval_end: primitives_1.unixSeconds.describe('Exclusive.'),
69
+ columns: zod_1.z
70
+ .array(zod_1.z.string())
71
+ .optional()
72
+ .describe("The columns, in the layout's order; the report type's `default_columns` when absent."),
73
+ currency: primitives_1.currency.optional().describe('Only this currency.'),
74
+ })
75
+ .strict());
76
+ /** `reporting.report_run` (`frr_…`). */
77
+ exports.reportRunSchema = (0, objects_2.defineObject)('reporting.report_run', 'ReportRun', zod_1.z
78
+ .object({
79
+ id: zod_1.z.string(),
80
+ object: zod_1.z.literal('reporting.report_run'),
81
+ livemode: primitives_1.livemode,
82
+ created: primitives_1.unixSeconds,
83
+ report_type: reportTypeId,
84
+ parameters: exports.reportRunParametersSchema,
85
+ status: zod_1.z.enum(reporting_1.REPORT_RUN_STATUSES),
86
+ error: zod_1.z.string().nullable().describe('Why a `failed` run failed; `null` otherwise.'),
87
+ result: (0, objects_1.embedded)('file')
88
+ .nullable()
89
+ .describe('The CSV once `succeeded` — a File of purpose `finance_report_run` (`GET /v1/files/{id}/contents` reads it).'),
90
+ succeeded_at: primitives_1.unixSeconds.nullable(),
91
+ })
92
+ .strict(), {
93
+ examples: [
94
+ {
95
+ id: 'frr_0193b8f34d1e4a6b8c27',
96
+ object: 'reporting.report_run',
97
+ livemode: false,
98
+ created: 1793750400,
99
+ report_type: 'balance.summary.1',
100
+ parameters: { interval_start: 1790985600, interval_end: 1793577600 },
101
+ status: 'pending',
102
+ error: null,
103
+ result: null,
104
+ succeeded_at: null,
105
+ },
106
+ ],
107
+ });
108
+ const column = zod_1.z.string().min(1).max(64);
109
+ /** `POST /v1/reporting/report_runs`. */
110
+ exports.createReportRunParams = zod_1.z
111
+ .object({
112
+ report_type: reportTypeId,
113
+ parameters: zod_1.z
114
+ .object({
115
+ interval_start: params_1.unixSecondsParam.describe('Inclusive, Unix seconds.'),
116
+ interval_end: params_1.unixSecondsParam.describe('Exclusive, Unix seconds; after `interval_start` and not in the future.'),
117
+ columns: zod_1.z
118
+ .array(column)
119
+ .min(1)
120
+ .max(64)
121
+ .optional()
122
+ .describe("Columns of the report type's layout, each once."),
123
+ currency: zod_1.z.enum(money_1.CURRENCY_CODES).optional(),
124
+ })
125
+ .strict(),
126
+ })
127
+ .strict();
128
+ exports.listReportRunsQuery = (0, params_1.listQuery)({ report_type: reportTypeId.optional() });
129
+ /**
130
+ * A download's query: a run's `parameters`, spelled as a query string
131
+ * (`columns[]=a&columns[]=b`, or one `columns=a`).
132
+ */
133
+ exports.downloadReportQuery = zod_1.z
134
+ .object({
135
+ interval_start: (0, params_1.queryInteger)({ min: 0 }).describe('Inclusive, Unix seconds.'),
136
+ interval_end: (0, params_1.queryInteger)({ min: 0 }).describe('Exclusive, Unix seconds.'),
137
+ columns: (0, objects_2.describe)(zod_1.z
138
+ .union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())])
139
+ .transform((value) => (typeof value === 'string' ? [value] : value))
140
+ .pipe(zod_1.z.array(column).min(1).max(64)), {
141
+ description: "Columns of the report type's layout, each once.",
142
+ jsonSchema: {
143
+ type: 'array',
144
+ items: { type: 'string', minLength: 1, maxLength: 64 },
145
+ minItems: 1,
146
+ maxItems: 64,
147
+ },
148
+ }).optional(),
149
+ currency: zod_1.z.enum(money_1.CURRENCY_CODES).optional(),
150
+ })
151
+ .strict();
152
+ const reportTypeIdParam = { id: 'The report type (`payments.itemized.1`, …).' };
153
+ exports.reportingRoutes = [
154
+ (0, route_1.defineRoute)({
155
+ operationId: 'listReportTypes',
156
+ method: 'get',
157
+ path: '/v1/reporting/report_types',
158
+ tag: 'Reporting',
159
+ summary: 'List report types',
160
+ description: 'Every report Peable produces (a complete set), with the interval data exists for.',
161
+ auth: 'service',
162
+ scope: 'payments:read',
163
+ query: params_1.emptyQuery,
164
+ response: (0, envelopes_1.listOf)(exports.reportTypeSchema),
165
+ sdk: 'reporting.reportTypes.list',
166
+ }),
167
+ (0, route_1.defineRoute)({
168
+ operationId: 'retrieveReportType',
169
+ method: 'get',
170
+ path: '/v1/reporting/report_types/{id}',
171
+ tag: 'Reporting',
172
+ summary: 'Retrieve a report type',
173
+ auth: 'service',
174
+ scope: 'payments:read',
175
+ params: reportTypeIdParam,
176
+ query: params_1.emptyQuery,
177
+ response: exports.reportTypeSchema,
178
+ sdk: 'reporting.reportTypes.retrieve',
179
+ }),
180
+ (0, route_1.defineRoute)({
181
+ operationId: 'downloadReport',
182
+ method: 'get',
183
+ path: '/v1/reporting/report_types/{id}/csv',
184
+ tag: 'Reporting',
185
+ summary: 'Download a report',
186
+ description: 'The same report a run produces, with the same parameters, streamed at once as CSV instead of stored. Every refusal is the JSON error before the first byte; a read that fails afterwards aborts the response, so a truncated file never ends cleanly.',
187
+ auth: 'service',
188
+ scope: 'payments:read',
189
+ params: reportTypeIdParam,
190
+ query: exports.downloadReportQuery,
191
+ response: { kind: 'binary', contentType: 'text/csv' },
192
+ sdk: 'reporting.reportTypes.download',
193
+ }),
194
+ (0, route_1.defineRoute)({
195
+ operationId: 'createReportRun',
196
+ method: 'post',
197
+ path: '/v1/reporting/report_runs',
198
+ tag: 'Reporting',
199
+ summary: 'Create a report run',
200
+ description: 'Answers `pending` at once; the CSV is produced in the background and announced with `reporting.report_run.succeeded` (or `.failed`).',
201
+ auth: 'service',
202
+ scope: 'payments:read',
203
+ idempotent: true,
204
+ body: exports.createReportRunParams,
205
+ response: exports.reportRunSchema,
206
+ sdk: 'reporting.reportRuns.create',
207
+ }),
208
+ (0, route_1.defineRoute)({
209
+ operationId: 'listReportRuns',
210
+ method: 'get',
211
+ path: '/v1/reporting/report_runs',
212
+ tag: 'Reporting',
213
+ summary: 'List report runs',
214
+ auth: 'service',
215
+ scope: 'payments:read',
216
+ query: exports.listReportRunsQuery,
217
+ response: (0, envelopes_1.listOf)(exports.reportRunSchema),
218
+ sdk: 'reporting.reportRuns.list',
219
+ expandable: 'reporting.report_run',
220
+ }),
221
+ (0, route_1.defineRoute)({
222
+ operationId: 'retrieveReportRun',
223
+ method: 'get',
224
+ path: '/v1/reporting/report_runs/{id}',
225
+ tag: 'Reporting',
226
+ summary: 'Retrieve a report run',
227
+ auth: 'service',
228
+ scope: 'payments:read',
229
+ params: { id: 'The report run (`frr_…`).' },
230
+ query: params_1.expandOnlyQuery,
231
+ response: exports.reportRunSchema,
232
+ sdk: 'reporting.reportRuns.retrieve',
233
+ expandable: 'reporting.report_run',
234
+ }),
235
+ ];
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requestLogRoutes = exports.streamRequestLogsQuery = exports.listRequestLogsQuery = exports.requestLogSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const envelopes_1 = require("../../common/envelopes");
6
+ const objects_1 = require("../../common/objects");
7
+ const params_1 = require("../../common/params");
8
+ const primitives_1 = require("../../common/primitives");
9
+ const route_1 = require("../../route");
10
+ const reporting_1 = require("../../vocabulary/reporting");
11
+ /**
12
+ * One merchant API request, as Peable recorded it (`req_…`) — the request log
13
+ * Orbit and `peable logs tail` read. Its `id` IS the `Request-Id` that request
14
+ * was answered with, so the id a merchant quotes to support and the log row
15
+ * are the same thing.
16
+ *
17
+ * Deliberately thin: method, path (no query string), status, duration and the
18
+ * `Idempotency-Key` it carried. No body, no headers, no query string, no caller
19
+ * address — a log a merchant can read is a log that must not hold what a
20
+ * request carried. Kept 30 days.
21
+ */
22
+ exports.requestLogSchema = (0, objects_1.defineObject)('request_log', 'RequestLog', zod_1.z
23
+ .object({
24
+ id: zod_1.z.string().describe("The request's `Request-Id` (`req_…`)."),
25
+ object: zod_1.z.literal('request_log'),
26
+ livemode: primitives_1.livemode,
27
+ method: zod_1.z.enum(reporting_1.REQUEST_LOG_METHODS),
28
+ path: zod_1.z.string().describe('The path that was requested, without its query string.'),
29
+ status: zod_1.z.number().int().describe('The HTTP status it was answered with.'),
30
+ duration_ms: zod_1.z
31
+ .number()
32
+ .int()
33
+ .nonnegative()
34
+ .describe('How long the gateway took to answer, in milliseconds.'),
35
+ idempotency_key: zod_1.z
36
+ .string()
37
+ .nullable()
38
+ .describe('The `Idempotency-Key` the request carried, if it carried a valid one.'),
39
+ created: primitives_1.unixSeconds.describe('When it was answered.'),
40
+ })
41
+ .strict(), {
42
+ examples: [
43
+ {
44
+ id: 'req_0193b8f35e9c4f2a7b18',
45
+ object: 'request_log',
46
+ livemode: false,
47
+ method: 'POST',
48
+ path: '/v1/payment_intents',
49
+ status: 201,
50
+ duration_ms: 84,
51
+ idempotency_key: '5f1d3c2e-8a4b-4f6e-9d2c-1b7a0e3f4c5d',
52
+ created: 1793750400,
53
+ },
54
+ ],
55
+ });
56
+ /** `status=404` (one code) or `status=4xx` (a class). */
57
+ const requestLogStatusFilter = zod_1.z
58
+ .union([(0, params_1.queryInteger)({ min: 100, max: 599 }), zod_1.z.enum(reporting_1.REQUEST_LOG_STATUS_CLASSES)])
59
+ .describe('One status code (`404`) or a class (`2xx`, `3xx`, `4xx`, `5xx`).');
60
+ const requestLogFilters = {
61
+ status: requestLogStatusFilter.optional(),
62
+ method: zod_1.z.enum(reporting_1.REQUEST_LOG_METHODS).optional(),
63
+ };
64
+ exports.listRequestLogsQuery = (0, params_1.listQuery)(requestLogFilters);
65
+ /** The live tail's filters: the list's, without paging. */
66
+ exports.streamRequestLogsQuery = zod_1.z.object(requestLogFilters).strict();
67
+ exports.requestLogRoutes = [
68
+ (0, route_1.defineRoute)({
69
+ operationId: 'listRequestLogs',
70
+ method: 'get',
71
+ path: '/v1/request_logs',
72
+ tag: 'Request logs',
73
+ summary: 'List request logs',
74
+ description: 'Your API requests of the last 30 days, newest first, filtered by `status`, `method` and `created`.',
75
+ auth: 'service',
76
+ scope: 'payments:read',
77
+ query: exports.listRequestLogsQuery,
78
+ response: (0, envelopes_1.listOf)(exports.requestLogSchema),
79
+ sdk: 'requestLogs.list',
80
+ expandable: 'request_log',
81
+ }),
82
+ (0, route_1.defineRoute)({
83
+ operationId: 'streamRequestLogs',
84
+ method: 'get',
85
+ path: '/v1/request_logs/stream',
86
+ tag: 'Request logs',
87
+ summary: 'Stream request logs',
88
+ description: 'Server-Sent Events: each request as it is answered (`event: request_log`), after a `ready` event. Reconnect with `Last-Event-ID` to resume without a gap. Test mode only; a stream ends after 15 minutes.',
89
+ auth: 'service',
90
+ scope: 'payments:read',
91
+ testModeOnly: true,
92
+ query: exports.streamRequestLogsQuery,
93
+ response: { kind: 'stream', event: exports.requestLogSchema },
94
+ sdk: 'requestLogs.stream',
95
+ }),
96
+ (0, route_1.defineRoute)({
97
+ operationId: 'retrieveRequestLog',
98
+ method: 'get',
99
+ path: '/v1/request_logs/{id}',
100
+ tag: 'Request logs',
101
+ summary: 'Retrieve a request log',
102
+ description: 'By `Request-Id`; 404 once older than 30 days.',
103
+ auth: 'service',
104
+ scope: 'payments:read',
105
+ params: { id: 'The `Request-Id` (`req_…`).' },
106
+ query: params_1.expandOnlyQuery,
107
+ response: exports.requestLogSchema,
108
+ sdk: 'requestLogs.retrieve',
109
+ }),
110
+ ];
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transferRoutes = exports.listPaymentIntentTransfersQuery = exports.listTransfersQuery = exports.reverseTransferParams = exports.createTransferParams = exports.transferWithReversalSchema = exports.transferReversalSchema = exports.transferSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const envelopes_1 = require("../../common/envelopes");
6
+ const objects_1 = require("../../common/objects");
7
+ const params_1 = require("../../common/params");
8
+ const primitives_1 = require("../../common/primitives");
9
+ const route_1 = require("../../route");
10
+ const connect_1 = require("../../vocabulary/connect");
11
+ const money_1 = require("../../vocabulary/money");
12
+ /**
13
+ * Transfers (`tr_…`) — a marketplace settling one seller out of a funded
14
+ * payment — and their reversals.
15
+ *
16
+ * The amounts come from the merchant and are recorded, never computed: Peable
17
+ * does not know what a marketplace fee is. The provider's own transfer id never
18
+ * crosses (ADR 0001 D3).
19
+ */
20
+ exports.transferSchema = (0, objects_1.defineObject)('transfer', 'Transfer', zod_1.z
21
+ .object({
22
+ id: zod_1.z.string(),
23
+ object: zod_1.z.literal('transfer'),
24
+ livemode: primitives_1.livemode,
25
+ external_ref: zod_1.z
26
+ .string()
27
+ .describe("The merchant's OWN id for what this settles. Their idempotency."),
28
+ connected_account: (0, objects_1.expandable)('connected_account', "The seller's `ca_…` — never their account id at the provider — or the ConnectedAccount with `expand[]=connected_account`."),
29
+ payment_intent: (0, objects_1.expandable)('payment_intent', 'The `pi_…` this settlement was funded by, or the PaymentIntent with `expand[]=payment_intent`.'),
30
+ amount: primitives_1.amount,
31
+ currency: zod_1.z.string(),
32
+ amount_reversed: primitives_1.amount.describe("CUMULATIVE, in the units of `amount` — the provider's own total, never a sum of the reversals."),
33
+ status: zod_1.z.enum(connect_1.TRANSFER_STATUSES),
34
+ failure_message: zod_1.z.string().nullable(),
35
+ created: primitives_1.unixSeconds,
36
+ updated_at: primitives_1.unixSeconds,
37
+ })
38
+ .strict(), {
39
+ examples: [
40
+ {
41
+ id: 'tr_0193b8f33c5a4b7e9d02',
42
+ object: 'transfer',
43
+ livemode: false,
44
+ external_ref: 'order_6735_seller_4821',
45
+ connected_account: 'ca_0193b8f2d4e1aa07c3b2',
46
+ payment_intent: 'pi_0193b8f2e8a14f6c9d31',
47
+ amount: '1700',
48
+ currency: 'EUR',
49
+ amount_reversed: '0',
50
+ status: 'paid',
51
+ failure_message: null,
52
+ created: 1793750400,
53
+ updated_at: 1793750402,
54
+ },
55
+ ],
56
+ });
57
+ /**
58
+ * One reversal operation. It exists as an object because an AMOUNT IS NOT AN
59
+ * IDENTITY: two reversals of one settlement for the same amount are two
60
+ * operations, and a caller needs to tell which one a response is about.
61
+ */
62
+ exports.transferReversalSchema = (0, objects_1.defineObject)('transfer_reversal', 'TransferReversal', zod_1.z
63
+ .object({
64
+ id: zod_1.z.string(),
65
+ object: zod_1.z.literal('transfer_reversal'),
66
+ livemode: primitives_1.livemode,
67
+ external_ref: zod_1.z.string().describe("The merchant's own id for this reversal."),
68
+ amount: primitives_1.amount,
69
+ currency: zod_1.z.string(),
70
+ status: zod_1.z.enum(connect_1.TRANSFER_REVERSAL_STATUSES),
71
+ failure_message: zod_1.z.string().nullable(),
72
+ created: primitives_1.unixSeconds,
73
+ })
74
+ .strict());
75
+ /** What `POST /v1/transfers/{transferId}/reversals` answers: the transfer, and the leg. */
76
+ exports.transferWithReversalSchema = (0, objects_1.defineComponent)('TransferWithReversal', exports.transferSchema.extend({ reversal: exports.transferReversalSchema }).strict());
77
+ /**
78
+ * A canonical base-unit integer string, validated with the SAME predicate the
79
+ * database CHECK is rendered from. A `z.number()` here would be a silent
80
+ * precision ceiling on a money value.
81
+ */
82
+ const transferAmount = zod_1.z
83
+ .string()
84
+ .refine(money_1.isBaseUnitString, "amount must be a canonical integer string in the currency's smallest unit")
85
+ // `'0'` passes the predicate above, and a zero transfer is not a transfer:
86
+ // it would consume the merchant's `external_ref`, so the REAL settlement of
87
+ // that order could never be created afterwards.
88
+ .refine((value) => value !== '0', 'a transfer of 0 is not a transfer');
89
+ /**
90
+ * `POST /v1/transfers`: settle one seller out of a funded payment. The seller
91
+ * by exactly one of its two addresses; the currency is the payment's, never the
92
+ * request's (a transfer in another currency is an FX conversion nothing here
93
+ * performs).
94
+ */
95
+ exports.createTransferParams = zod_1.z
96
+ .object({
97
+ payment_intent: zod_1.z.string().min(1).describe('The `pi_…` this settles out of.'),
98
+ connected_account: zod_1.z.string().min(1).optional().describe("The seller's `ca_…`."),
99
+ connected_account_ref: zod_1.z
100
+ .string()
101
+ .min(1)
102
+ .max(255)
103
+ .optional()
104
+ .describe('Or your own id for the seller (its `external_ref`).'),
105
+ external_ref: zod_1.z
106
+ .string()
107
+ .min(1)
108
+ .max(255)
109
+ .describe('Your own id for what this settles — the idempotency: the same ref answers the stored settlement (200), a different payment or amount under it is a 409.'),
110
+ amount: transferAmount,
111
+ })
112
+ .strict()
113
+ .refine((body) => Boolean(body.connected_account) !== Boolean(body.connected_account_ref), {
114
+ message: 'name the seller by exactly one of connected_account or connected_account_ref',
115
+ });
116
+ exports.reverseTransferParams = zod_1.z
117
+ .object({
118
+ amount: transferAmount,
119
+ // Required, and durable. It used to be satisfiable by the
120
+ // `Idempotency-Key` header instead; that header is now the generic 24-hour
121
+ // retry layer (ADR 0014 D3), which the SDK fills with a fresh uuid per call
122
+ // — accepting it here would hand every un-referenced reversal a random
123
+ // identity, and an application's own retry a second reversal.
124
+ external_ref: zod_1.z
125
+ .string()
126
+ .min(1)
127
+ .max(255)
128
+ .describe('Your own id for THIS reversal — required and durable: two reversals for the same amount are two operations.'),
129
+ })
130
+ .strict();
131
+ exports.listTransfersQuery = (0, params_1.listQuery)({
132
+ payment_intent: params_1.idParam.optional().describe('Only the settlements of this payment (`pi_…`).'),
133
+ connected_account: params_1.idParam.optional().describe('Only the settlements to this seller (`ca_…`).'),
134
+ });
135
+ /** The per-payment list: the payment is in the path. */
136
+ exports.listPaymentIntentTransfersQuery = (0, params_1.listQuery)({});
137
+ const transferIdParam = { transferId: 'The transfer (`tr_…`).' };
138
+ exports.transferRoutes = [
139
+ (0, route_1.defineRoute)({
140
+ operationId: 'createTransfer',
141
+ method: 'post',
142
+ path: '/v1/transfers',
143
+ tag: 'Transfers',
144
+ summary: 'Create a transfer',
145
+ description: 'Settles one seller out of a funded payment (201). An order already settled answers the stored settlement (200): a merchant retrying after a timeout needs to know whether they just paid a seller twice.',
146
+ auth: 'service',
147
+ scope: 'payments:write',
148
+ idempotent: true,
149
+ body: exports.createTransferParams,
150
+ response: exports.transferSchema,
151
+ status: 201,
152
+ sdk: 'transfers.create',
153
+ }),
154
+ (0, route_1.defineRoute)({
155
+ operationId: 'createTransferReversal',
156
+ method: 'post',
157
+ path: '/v1/transfers/{transferId}/reversals',
158
+ tag: 'Transfers',
159
+ summary: 'Reverse a transfer',
160
+ description: 'Takes some or all of a settlement back (201), or answers the reversal this `external_ref` already made (200).',
161
+ auth: 'service',
162
+ scope: 'payments:write',
163
+ idempotent: true,
164
+ params: transferIdParam,
165
+ body: exports.reverseTransferParams,
166
+ response: exports.transferWithReversalSchema,
167
+ status: 201,
168
+ sdk: 'transfers.reverse',
169
+ }),
170
+ (0, route_1.defineRoute)({
171
+ operationId: 'listTransferReversals',
172
+ method: 'get',
173
+ path: '/v1/transfers/{transferId}/reversals',
174
+ tag: 'Transfers',
175
+ summary: "List a transfer's reversals",
176
+ description: 'Newest first. A complete set (`has_more: false`): a settlement can only be reversed down to zero.',
177
+ auth: 'service',
178
+ scope: 'payments:read',
179
+ params: transferIdParam,
180
+ query: params_1.expandOnlyQuery,
181
+ response: (0, envelopes_1.listOf)(exports.transferReversalSchema),
182
+ sdk: 'transfers.listReversals',
183
+ }),
184
+ (0, route_1.defineRoute)({
185
+ operationId: 'listTransfers',
186
+ method: 'get',
187
+ path: '/v1/transfers',
188
+ tag: 'Transfers',
189
+ summary: 'List transfers',
190
+ description: 'Newest first, narrowed by `payment_intent` and/or `connected_account`.',
191
+ auth: 'service',
192
+ scope: 'payments:read',
193
+ query: exports.listTransfersQuery,
194
+ response: (0, envelopes_1.listOf)(exports.transferSchema),
195
+ sdk: 'transfers.list',
196
+ expandable: 'transfer',
197
+ }),
198
+ (0, route_1.defineRoute)({
199
+ operationId: 'retrieveTransfer',
200
+ method: 'get',
201
+ path: '/v1/transfers/{transferId}',
202
+ tag: 'Transfers',
203
+ summary: 'Retrieve a transfer',
204
+ auth: 'service',
205
+ scope: 'payments:read',
206
+ params: transferIdParam,
207
+ query: params_1.expandOnlyQuery,
208
+ response: exports.transferSchema,
209
+ sdk: 'transfers.retrieve',
210
+ expandable: 'transfer',
211
+ }),
212
+ (0, route_1.defineRoute)({
213
+ operationId: 'listPaymentIntentTransfers',
214
+ method: 'get',
215
+ path: '/v1/payment_intents/{intentId}/transfers',
216
+ tag: 'Transfers',
217
+ summary: "List a payment's transfers",
218
+ description: 'What one payment settled, newest first. The reconciliation read.',
219
+ auth: 'service',
220
+ scope: 'payments:read',
221
+ params: { intentId: 'The payment intent (`pi_…`).' },
222
+ query: exports.listPaymentIntentTransfersQuery,
223
+ response: (0, envelopes_1.listOf)(exports.transferSchema),
224
+ sdk: 'transfers.listForPaymentIntent',
225
+ expandable: 'transfer',
226
+ }),
227
+ ];