@peable.to/contracts 0.3.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 -97
  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 -94
  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 -134
  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 -138
  315. package/dist/esm/openapi.js +0 -134
  316. package/dist/types/openapi.d.ts +0 -145
@@ -0,0 +1,357 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eventRoutes = exports.WEBHOOK_EVENT_DESCRIPTIONS = exports.streamEventsQuery = exports.retrieveEventQuery = exports.listEventsQuery = exports.listEventsFilters = exports.eventSchema = exports.eventRequestSchema = exports.billingObservationSchema = void 0;
4
+ exports.eventSchemaOf = eventSchemaOf;
5
+ const zod_1 = require("zod");
6
+ const envelopes_1 = require("../../common/envelopes");
7
+ const objects_1 = 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 events_1 = require("../../vocabulary/events");
12
+ /**
13
+ * Events (`evt_…`, ADR 0014 D4) — Stripe's event names (ADR 0019) with the
14
+ * resource nested under `data.object`. Stored once, in the transaction of the
15
+ * change it records, kept 30 days (`/v1/events`), and delivered HMAC-signed to
16
+ * every matching webhook endpoint: a delivery's body and `GET /v1/events/:id`
17
+ * are byte for byte the same object.
18
+ */
19
+ /**
20
+ * The payload of `billing.observation.updated`: a wake-up, never paid or grant
21
+ * authority. Re-read the owner-bound resource it names.
22
+ */
23
+ exports.billingObservationSchema = (0, objects_1.defineObject)('billing_observation', 'BillingObservation', zod_1.z
24
+ .object({
25
+ object: zod_1.z.literal('billing_observation'),
26
+ livemode: primitives_1.livemode.describe('The mode of the billing cohort observed (ADR 0017).'),
27
+ resource_kind: zod_1.z.enum(['subscription', 'invoice']),
28
+ resource_id: zod_1.z.string().describe('The provider subscription or invoice observed.'),
29
+ subscription_id: zod_1.z
30
+ .string()
31
+ .optional()
32
+ .describe('Owner-scoped wake-up hint only; re-read the subscription before resolving a payer.'),
33
+ revision: zod_1.z.number().int().describe('The observation revision; later revisions are newer.'),
34
+ observed_at: primitives_1.unixSeconds,
35
+ })
36
+ .strict(), {
37
+ examples: [
38
+ {
39
+ object: 'billing_observation',
40
+ livemode: false,
41
+ resource_kind: 'subscription',
42
+ resource_id: 'sub_1Q2w3E4r5T6y7U8i',
43
+ subscription_id: 'sub_1Q2w3E4r5T6y7U8i',
44
+ revision: 3,
45
+ observed_at: 1793750400,
46
+ },
47
+ ],
48
+ });
49
+ /**
50
+ * What caused an event, when an API request did (Stripe's `event.request`).
51
+ * Both `null` for an event caused by something else — the chain watcher, the
52
+ * expiry sweeper, a provider's own notification.
53
+ */
54
+ exports.eventRequestSchema = (0, objects_1.defineComponent)('EventRequest', zod_1.z
55
+ .object({
56
+ id: zod_1.z
57
+ .string()
58
+ .nullable()
59
+ .describe('The `Request-Id` of the request whose change produced the event.'),
60
+ idempotency_key: zod_1.z
61
+ .string()
62
+ .nullable()
63
+ .describe('The `Idempotency-Key` that request carried, if any.'),
64
+ })
65
+ .strict());
66
+ const previousAttributes = zod_1.z
67
+ .record(zod_1.z.string(), zod_1.z.unknown())
68
+ .optional()
69
+ .describe('The fields of `object` that this change moved, with their values BEFORE it. Absent when the event is not a change of an existing object.');
70
+ /**
71
+ * The fields of the envelope that do not depend on its type, in the wire's
72
+ * order around `type` and `data` (`lib/serialize.ts` `toEventDTO`).
73
+ */
74
+ const head = {
75
+ id: zod_1.z.string().describe('`evt_…`.'),
76
+ object: zod_1.z.literal('event'),
77
+ };
78
+ const tail = {
79
+ created: primitives_1.unixSeconds,
80
+ livemode: primitives_1.livemode.describe('The mode of the merchant it was sent to, and of the object it carries (ADR 0017).'),
81
+ api_version: zod_1.z
82
+ .string()
83
+ .describe('The wire version the event was rendered with — the `Peable-Version` of the deployment that stored it. An event is a stored snapshot; it is not re-rendered when the wire moves on.'),
84
+ account: zod_1.z
85
+ .string()
86
+ .optional()
87
+ .describe('The connected account (`ca_…`) this event is about (ADR 0012 D7). Present on every event for an on-behalf payment and on `connected_account.updated`; absent otherwise.'),
88
+ };
89
+ /** The envelope around `type` and `data.object`. */
90
+ function envelope(type, object) {
91
+ return zod_1.z
92
+ .object({
93
+ ...head,
94
+ type,
95
+ ...tail,
96
+ data: zod_1.z.object({ object, previous_attributes: previousAttributes }).strict(),
97
+ request: exports.eventRequestSchema,
98
+ })
99
+ .strict();
100
+ }
101
+ /** The schema of the object an event of `type` carries, once its module registered it. */
102
+ const objectOf = (type) => zod_1.z.lazy(() => (0, objects_1.resolveObject)(events_1.WEBHOOK_EVENT_OBJECTS[type]));
103
+ /** Every object type an event can carry, each once. */
104
+ const EVENT_OBJECT_TYPES = [...new Set(Object.values(events_1.WEBHOOK_EVENT_OBJECTS))];
105
+ /**
106
+ * An event of any type. `data.object` is the resource `type` names
107
+ * (`WEBHOOK_EVENT_OBJECTS`), checked against THAT object's schema — a
108
+ * `payment_intent.succeeded` carrying a Customer is refused even though a
109
+ * Customer is a valid event object.
110
+ */
111
+ exports.eventSchema = (0, objects_1.defineObject)('event', 'Event', envelope(zod_1.z.enum(events_1.WEBHOOK_EVENT_TYPES), zod_1.z
112
+ .union(EVENT_OBJECT_TYPES.map((type) => zod_1.z.lazy(() => (0, objects_1.resolveObject)(type))))
113
+ .describe('The resource the event is about, as the API rendered it at the time.')).superRefine((event, ctx) => {
114
+ const expected = events_1.WEBHOOK_EVENT_OBJECTS[event.type];
115
+ const parsed = (0, objects_1.resolveObject)(expected).safeParse(event.data.object);
116
+ if (parsed.success)
117
+ return;
118
+ for (const issue of parsed.error.issues) {
119
+ ctx.addIssue({
120
+ code: 'custom',
121
+ path: ['data', 'object', ...issue.path],
122
+ message: `a ${event.type} event carries a ${expected}: ${issue.message}`,
123
+ });
124
+ }
125
+ }), {
126
+ examples: [
127
+ {
128
+ id: 'evt_0193b8f2c1a87d3e9f4b',
129
+ object: 'event',
130
+ type: 'webhook_endpoint.test',
131
+ created: 1793750400,
132
+ livemode: false,
133
+ api_version: '2026-11-03',
134
+ data: {
135
+ object: {
136
+ id: 'we_0193b8f2c1a87d3e9f4c',
137
+ object: 'webhook_endpoint',
138
+ livemode: false,
139
+ url: 'https://example.com/peable/webhooks',
140
+ description: null,
141
+ enabled_events: ['*'],
142
+ status: 'enabled',
143
+ disabled_reason: null,
144
+ api_version: '2026-11-03',
145
+ metadata: {},
146
+ created: 1793750000,
147
+ updated_at: 1793750000,
148
+ },
149
+ },
150
+ request: { id: 'req_0193b8f2c1a87d3e9f4d', idempotency_key: null },
151
+ },
152
+ ],
153
+ });
154
+ /**
155
+ * The envelope of one event type, `data.object` narrowed to its object: the
156
+ * request body of that type's webhook in the OpenAPI document.
157
+ */
158
+ function eventSchemaOf(type) {
159
+ return envelope(zod_1.z.literal(type), objectOf(type));
160
+ }
161
+ /**
162
+ * `type=payment_intent.settled` (exact) or `type=payment_intent.*` (a dotted
163
+ * prefix). `*` alone is no filter. Lowercase dotted names only, so the value is
164
+ * never a LIKE pattern of the caller's choosing.
165
+ */
166
+ const TYPE_FILTER_PATTERN = /^(\*|[a-z_]+(\.[a-z_]+)*(\.\*)?)$/;
167
+ function toTypeFilter(value) {
168
+ if (value === '*')
169
+ return undefined;
170
+ if (value.endsWith('.*'))
171
+ return { kind: 'prefix', prefix: value.slice(0, -1) };
172
+ return { kind: 'exact', type: value };
173
+ }
174
+ const typeFilter = zod_1.z
175
+ .string()
176
+ .max(100)
177
+ .regex(TYPE_FILTER_PATTERN, 'type is an event type, or a prefix ending in .* (payment_intent.*)')
178
+ .transform(toTypeFilter);
179
+ /** The filters `GET /v1/events` adds to the list parameters. */
180
+ exports.listEventsFilters = {
181
+ type: typeFilter
182
+ .optional()
183
+ .describe('An exact event type, or a prefix ending in `.*` (`payment_intent.*`).'),
184
+ delivery_success: params_1.queryBoolean
185
+ .optional()
186
+ .describe('`true`: only events every delivery of which succeeded. `false`: only events with a delivery still pending or failed.'),
187
+ payment_intent: params_1.idParam
188
+ .optional()
189
+ .describe('`pi_…`: only the events about that payment — the timeline of one payment.'),
190
+ };
191
+ exports.listEventsQuery = (0, params_1.listQuery)(exports.listEventsFilters);
192
+ exports.retrieveEventQuery = (0, params_1.retrieveQuery)({});
193
+ /**
194
+ * The stream's `types`: a comma-separated list of the same filters
195
+ * (`payment_intent.settled,connected_account.*`). Absent, or any `*`, is every
196
+ * event.
197
+ */
198
+ exports.streamEventsQuery = zod_1.z
199
+ .object({
200
+ types: zod_1.z
201
+ .string()
202
+ .max(2000)
203
+ .transform((value) => value.split(',').map((part) => part.trim()))
204
+ .pipe(zod_1.z
205
+ .array(zod_1.z
206
+ .string()
207
+ .max(100)
208
+ .regex(TYPE_FILTER_PATTERN, 'types is a comma-separated list of event types, or prefixes ending in .*')
209
+ .transform(toTypeFilter))
210
+ .min(1)
211
+ .max(32))
212
+ .optional()
213
+ .describe('Comma-separated event types or `prefix.*` patterns (`payment_intent.succeeded,charge.*`). Absent: every event.'),
214
+ })
215
+ .strict();
216
+ /** One line per event type: what happened when it is sent. Total, like the vocabulary. */
217
+ exports.WEBHOOK_EVENT_DESCRIPTIONS = {
218
+ 'payment_intent.created': 'A PaymentIntent was created.',
219
+ 'payment_intent.requires_action': 'A PaymentIntent needs the payer to act (pay, authenticate).',
220
+ 'payment_intent.processing': 'A PaymentIntent is processing: a FairCoin payment was broadcast, or a card payment is pending.',
221
+ 'payment_intent.amount_capturable_updated': 'A PaymentIntent was authorized and awaits capture (`capture_method: manual`).',
222
+ 'payment_intent.succeeded': 'A PaymentIntent succeeded: the payment is final.',
223
+ 'payment_intent.payment_failed': 'A payment attempt failed; a card PaymentIntent returns to `requires_payment_method`.',
224
+ 'payment_intent.canceled': 'A PaymentIntent was canceled — by the merchant, by expiry, or underpaid.',
225
+ 'charge.refunded': 'A Charge was refunded, partially or fully: `amount_refunded` moved.',
226
+ 'charge.dispute.created': 'A cardholder disputed a charge. Evidence is due by its deadline.',
227
+ 'charge.dispute.updated': 'A Dispute changed: evidence was staged or submitted.',
228
+ 'charge.dispute.closed': 'A Dispute closed; `status` carries the outcome.',
229
+ 'charge.dispute.funds_withdrawn': 'The network took the disputed amount from the balance.',
230
+ 'charge.dispute.funds_reinstated': 'The network returned the disputed amount (the dispute was won, or withdrawn).',
231
+ 'refund.created': 'A Refund was created.',
232
+ 'refund.updated': 'A Refund changed state.',
233
+ 'refund.failed': 'A Refund failed: the bank rejected it.',
234
+ 'customer.created': 'A Customer was created.',
235
+ 'customer.updated': 'A Customer was updated; `previous_attributes` names what moved.',
236
+ 'customer.deleted': 'A Customer was deleted.',
237
+ 'payment_method.attached': 'A PaymentMethod was attached to a Customer.',
238
+ 'payment_method.detached': 'A PaymentMethod was detached from its Customer.',
239
+ 'payment_method.updated': 'A PaymentMethod was updated.',
240
+ 'setup_intent.created': 'A SetupIntent was created.',
241
+ 'setup_intent.requires_action': 'A SetupIntent needs the customer to authenticate.',
242
+ 'setup_intent.succeeded': 'A SetupIntent succeeded: its PaymentMethod is saved.',
243
+ 'setup_intent.setup_failed': 'A SetupIntent attempt failed.',
244
+ 'setup_intent.canceled': 'A SetupIntent was canceled.',
245
+ 'billing.observation.updated': 'A recurring billing resource was observed to change. A wake-up only: re-read the resource.',
246
+ 'connected_account.updated': "A seller's connected account changed — its readiness, in practice.",
247
+ 'product.created': 'A Product was created.',
248
+ 'product.updated': 'A Product was updated; `previous_attributes` names what moved.',
249
+ 'product.deleted': 'A Product was deleted (it carries the product as it stood before).',
250
+ 'price.created': 'A Price was created.',
251
+ 'price.updated': 'A Price was updated (archiving one is `active: false`).',
252
+ 'coupon.created': 'A Coupon was created.',
253
+ 'coupon.updated': 'A Coupon was updated.',
254
+ 'coupon.deleted': 'A Coupon was deleted.',
255
+ 'promotion_code.created': 'A PromotionCode was created.',
256
+ 'promotion_code.updated': 'A PromotionCode was updated (archiving one is `active: false`).',
257
+ 'account.updated': "The merchant's own account changed: readiness, requirements or settings.",
258
+ 'application_fee.created': "Orbit's fee was taken on a succeeded charge.",
259
+ 'application_fee.refunded': 'Part or all of an application fee went back.',
260
+ 'payout.created': 'A Payout was created.',
261
+ 'payout.updated': 'A Payout changed.',
262
+ 'payout.paid': 'A Payout arrived in the bank account.',
263
+ 'payout.failed': 'A Payout failed.',
264
+ 'payout.canceled': 'A Payout was canceled.',
265
+ 'balance.available': 'Funds became available in the balance.',
266
+ 'checkout.session.completed': 'The payer finished a Checkout Session (paid, authorized, or a FairCoin payment confirming).',
267
+ 'checkout.session.expired': 'A Checkout Session expired, or the merchant expired it.',
268
+ 'checkout.session.async_payment_succeeded': "A completed Checkout Session's FairCoin payment confirmed.",
269
+ 'checkout.session.async_payment_failed': "A completed Checkout Session's FairCoin payment failed.",
270
+ 'payment_link.created': 'A PaymentLink was created.',
271
+ 'payment_link.updated': 'A PaymentLink was updated.',
272
+ 'reporting.report_run.succeeded': 'A ReportRun finished: its CSV is `result`.',
273
+ 'reporting.report_run.failed': 'A ReportRun could not be produced; `error` says why.',
274
+ 'customer.subscription.created': 'A Subscription was created.',
275
+ 'customer.subscription.updated': 'A Subscription changed; `previous_attributes` names what moved.',
276
+ 'customer.subscription.deleted': 'A Subscription ended.',
277
+ 'customer.subscription.trial_will_end': "A Subscription's trial ends in three days.",
278
+ 'customer.subscription.paused': 'A Subscription was paused (a trial ended with no payment method).',
279
+ 'customer.subscription.resumed': 'A paused Subscription resumed.',
280
+ 'invoice.created': 'An Invoice was created.',
281
+ 'invoice.updated': 'An Invoice changed.',
282
+ 'invoice.deleted': 'A draft Invoice was deleted.',
283
+ 'invoice.finalized': 'An Invoice was finalized.',
284
+ 'invoice.paid': 'An Invoice was paid.',
285
+ 'invoice.payment_failed': 'An attempt to pay an Invoice failed.',
286
+ 'invoice.payment_action_required': 'Paying an Invoice needs the customer to act.',
287
+ 'invoice.voided': 'An Invoice was voided.',
288
+ 'invoice.marked_uncollectible': 'An Invoice was marked uncollectible.',
289
+ 'invoice.upcoming': 'A renewal is days away; it carries a preview Invoice (`id` empty).',
290
+ 'invoice.sent': 'An Invoice was emailed to the customer.',
291
+ 'invoiceitem.created': 'An InvoiceItem was created.',
292
+ 'invoiceitem.deleted': 'An InvoiceItem was deleted.',
293
+ 'credit_note.created': 'A CreditNote was issued.',
294
+ 'credit_note.updated': 'A CreditNote was updated.',
295
+ 'credit_note.voided': 'A CreditNote was voided.',
296
+ 'test_helpers.test_clock.created': 'A test clock was created.',
297
+ 'test_helpers.test_clock.advancing': 'A test clock started advancing.',
298
+ 'test_helpers.test_clock.ready': 'A test clock finished advancing.',
299
+ 'test_helpers.test_clock.deleted': 'A test clock was deleted.',
300
+ 'billing.meter.created': 'A billing Meter was created.',
301
+ 'billing.meter.updated': 'A billing Meter was updated.',
302
+ 'billing.meter.deactivated': 'A billing Meter was deactivated.',
303
+ 'billing.meter.reactivated': 'A billing Meter was reactivated.',
304
+ 'entitlements.active_entitlement_summary.updated': "A customer's active entitlements changed — re-read them, then grant or withdraw access.",
305
+ 'billing_portal.configuration.created': 'A customer portal configuration was created.',
306
+ 'billing_portal.configuration.updated': 'A customer portal configuration was updated.',
307
+ 'billing_portal.session.created': 'A customer portal session was created.',
308
+ 'tax.assessment.created': 'A tax compliance assessment was run. Nothing was registered, filed or collected.',
309
+ 'tax.review_item.created': 'A tax assessment finding opened a review item.',
310
+ 'tax.review_item.updated': 'A tax review item was decided, or found again.',
311
+ 'webhook_endpoint.test': 'A test event, sent to ONE endpoint when its owner asks. It cannot be subscribed to.',
312
+ };
313
+ exports.eventRoutes = [
314
+ (0, route_1.defineRoute)({
315
+ operationId: 'listEvents',
316
+ method: 'get',
317
+ path: '/v1/events',
318
+ tag: 'Events',
319
+ summary: 'List events',
320
+ description: 'Every event of the last 30 days, newest first, rendered exactly as its webhook deliveries carried it.',
321
+ auth: 'service',
322
+ scope: 'payments:read',
323
+ query: exports.listEventsQuery,
324
+ response: (0, envelopes_1.listOf)(exports.eventSchema),
325
+ sdk: 'events.list',
326
+ expandable: 'event',
327
+ }),
328
+ (0, route_1.defineRoute)({
329
+ operationId: 'streamEvents',
330
+ method: 'get',
331
+ path: '/v1/events/stream',
332
+ tag: 'Events',
333
+ summary: 'Stream events',
334
+ description: 'Server-Sent Events: every event of this merchant as it commits, rendered exactly as a webhook delivery carries it (`event: event`, `id:` the `evt_…`). Resumes after `Last-Event-ID`. Test mode only — what `peable listen` forwards to a local server.',
335
+ auth: 'service',
336
+ scope: 'payments:read',
337
+ testModeOnly: true,
338
+ query: exports.streamEventsQuery,
339
+ response: { kind: 'stream', event: exports.eventSchema },
340
+ sdk: 'events.stream',
341
+ }),
342
+ (0, route_1.defineRoute)({
343
+ operationId: 'retrieveEvent',
344
+ method: 'get',
345
+ path: '/v1/events/{id}',
346
+ tag: 'Events',
347
+ summary: 'Retrieve an event',
348
+ description: 'A `404` once the event is older than 30 days.',
349
+ auth: 'service',
350
+ scope: 'payments:read',
351
+ params: { id: 'The event (`evt_…`).' },
352
+ query: exports.retrieveEventQuery,
353
+ response: exports.eventSchema,
354
+ sdk: 'events.retrieve',
355
+ expandable: 'event',
356
+ }),
357
+ ];
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.eventsRoutes = void 0;
18
+ const events_1 = require("./events");
19
+ const webhookDeliveries_1 = require("./webhookDeliveries");
20
+ const webhookEndpoints_1 = require("./webhookEndpoints");
21
+ __exportStar(require("./events"), exports);
22
+ __exportStar(require("./webhookDeliveries"), exports);
23
+ __exportStar(require("./webhookEndpoints"), exports);
24
+ /** Events, the webhook endpoints they are sent to, and the deliveries of them. */
25
+ exports.eventsRoutes = [
26
+ ...events_1.eventRoutes,
27
+ ...webhookEndpoints_1.webhookEndpointRoutes,
28
+ ...webhookDeliveries_1.webhookDeliveryRoutes,
29
+ ];
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.webhookDeliveryRoutes = exports.listWebhookDeliveriesQuery = exports.listWebhookDeliveriesFilters = exports.webhookDeliverySchema = 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 events_1 = require("../../vocabulary/events");
11
+ /**
12
+ * Webhook deliveries (ADR 0014 D4) — one event sent to one webhook endpoint.
13
+ * An event that matches three endpoints is three deliveries, each with its own
14
+ * attempts, retried for about three days (ADR 0001 D7).
15
+ */
16
+ exports.webhookDeliverySchema = (0, objects_1.defineObject)('webhook_delivery', 'WebhookDelivery', zod_1.z
17
+ .object({
18
+ id: zod_1.z.string(),
19
+ object: zod_1.z.literal('webhook_delivery'),
20
+ livemode: primitives_1.livemode.describe('The mode of the merchant it was sent for (ADR 0017).'),
21
+ event_id: zod_1.z.string().describe('The `evt_…` delivered — `GET /v1/events/:id` returns it.'),
22
+ event_type: zod_1.z.enum(events_1.WEBHOOK_EVENT_TYPES),
23
+ webhook_endpoint_id: zod_1.z.string().describe('The `we_…` it was sent to.'),
24
+ url: zod_1.z.string().describe('The URL actually POSTed to, as of the latest attempt.'),
25
+ attempts: zod_1.z.number().int().nonnegative(),
26
+ delivered: zod_1.z.boolean(),
27
+ last_status: zod_1.z
28
+ .enum(events_1.WEBHOOK_DELIVERY_STATUSES)
29
+ .describe('`pending`: will be attempted (`next_attempt_at`). `delivered`: terminal success. `failed`: the endpoint refused it (a 4xx, a blocked address) or was disabled first — never retried. `dead`: every attempt failed transiently for three days; it can be redelivered.'),
30
+ last_error: zod_1.z
31
+ .string()
32
+ .optional()
33
+ .describe('Why the last attempt did not succeed — operator-facing, never a secret.'),
34
+ next_attempt_at: primitives_1.unixSeconds
35
+ .optional()
36
+ .describe('When the next attempt is due. Absent once the delivery is terminal.'),
37
+ created: primitives_1.unixSeconds,
38
+ updated_at: primitives_1.unixSeconds,
39
+ })
40
+ .strict(), {
41
+ examples: [
42
+ {
43
+ id: '0193b8f2-c1a8-7d3e-9f4a-7d3e0193b8f2',
44
+ object: 'webhook_delivery',
45
+ livemode: false,
46
+ event_id: 'evt_0193b8f2c1a87d3e9f4b',
47
+ event_type: 'payment_intent.succeeded',
48
+ webhook_endpoint_id: 'we_0193b8f2c1a87d3e9f4c',
49
+ url: 'https://example.com/peable/webhooks',
50
+ attempts: 1,
51
+ delivered: true,
52
+ last_status: 'delivered',
53
+ created: 1793750400,
54
+ updated_at: 1793750401,
55
+ },
56
+ ],
57
+ });
58
+ /** The filters `GET /v1/webhook_deliveries` adds to the list parameters. */
59
+ exports.listWebhookDeliveriesFilters = {
60
+ event: params_1.idParam.optional().describe('Only the deliveries of this event (`evt_…`).'),
61
+ webhook_endpoint: params_1.idParam.optional().describe('Only the deliveries to this endpoint (`we_…`).'),
62
+ };
63
+ exports.listWebhookDeliveriesQuery = (0, params_1.listQuery)(exports.listWebhookDeliveriesFilters);
64
+ exports.webhookDeliveryRoutes = [
65
+ (0, route_1.defineRoute)({
66
+ operationId: 'listWebhookDeliveries',
67
+ method: 'get',
68
+ path: '/v1/webhook_deliveries',
69
+ tag: 'Webhook deliveries',
70
+ summary: 'List webhook deliveries',
71
+ description: "The delivery log, newest first: one event's deliveries, or one endpoint's. Both filters are public ids resolved inside your scope.",
72
+ auth: 'service',
73
+ scope: 'payments:read',
74
+ query: exports.listWebhookDeliveriesQuery,
75
+ response: (0, envelopes_1.listOf)(exports.webhookDeliverySchema),
76
+ sdk: 'webhookDeliveries.list',
77
+ expandable: 'webhook_delivery',
78
+ }),
79
+ (0, route_1.defineRoute)({
80
+ operationId: 'redeliverWebhookDelivery',
81
+ method: 'post',
82
+ path: '/v1/webhook_deliveries/{id}/redeliver',
83
+ tag: 'Webhook deliveries',
84
+ summary: 'Redeliver a webhook delivery',
85
+ description: "Send the delivery's event to its endpoint again — the SAME stored event, as a NEW delivery, attempted at once; answers that new delivery. Refused while the endpoint is disabled (`webhook_endpoint_disabled`).",
86
+ auth: 'service',
87
+ scope: 'payments:write',
88
+ idempotent: true,
89
+ params: { id: 'The webhook delivery.' },
90
+ response: exports.webhookDeliverySchema,
91
+ sdk: 'webhookDeliveries.redeliver',
92
+ }),
93
+ ];