@delopay/sdk 0.496.0 → 0.499.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 (330) hide show
  1. package/dist/airwallexCard.cjs.map +1 -1
  2. package/dist/branding.cjs.map +1 -1
  3. package/dist/cardFormStyles.cjs.map +1 -1
  4. package/dist/checkoutSession.cjs +2 -2
  5. package/dist/checkoutSession.cjs.map +1 -1
  6. package/dist/checkoutSession.js +1 -1
  7. package/dist/chunk-244VZFFO.cjs.map +1 -1
  8. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  9. package/dist/chunk-34PC72O7.cjs.map +1 -1
  10. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  11. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  12. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  13. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  14. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  15. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  16. package/dist/{chunk-2NVGA4G5.cjs → chunk-575SNLIT.cjs} +35 -1
  17. package/dist/chunk-575SNLIT.cjs.map +1 -0
  18. package/dist/chunk-5CITBN33.cjs.map +1 -1
  19. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  20. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  21. package/dist/chunk-5QS67SBO.cjs.map +1 -1
  22. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  23. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  24. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  25. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  26. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  27. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  28. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  29. package/dist/{chunk-QG6AD33A.js → chunk-7H2VFIPS.js} +2 -2
  30. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  31. package/dist/chunk-7NKJD5ST.cjs.map +1 -1
  32. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  33. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  34. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  35. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  36. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  37. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  38. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  39. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  40. package/dist/{chunk-MXSUWL6O.js → chunk-BS6MTTT6.js} +13 -1
  41. package/dist/chunk-BS6MTTT6.js.map +1 -0
  42. package/dist/chunk-BT3UAUEV.cjs.map +1 -1
  43. package/dist/{chunk-IM6A64ON.js → chunk-BX2CT7FR.js} +13 -1
  44. package/dist/chunk-BX2CT7FR.js.map +1 -0
  45. package/dist/chunk-CAMALM35.cjs.map +1 -1
  46. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  47. package/dist/{chunk-MOFPVWNN.js → chunk-CQQW5JU7.js} +2 -2
  48. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  49. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  50. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  51. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  52. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  53. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  54. package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
  55. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  56. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  57. package/dist/chunk-F6QJB4XP.cjs.map +1 -1
  58. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  59. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  60. package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
  61. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  62. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  63. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  64. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  65. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  66. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  67. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  68. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  69. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  70. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  71. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  72. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  73. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  74. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  75. package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
  76. package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
  77. package/dist/{chunk-OFZJ4JAH.cjs → chunk-K3XXGAOR.cjs} +3 -3
  78. package/dist/chunk-K3XXGAOR.cjs.map +1 -0
  79. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  80. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  81. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  82. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  83. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  84. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  85. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  86. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  87. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  88. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  89. package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
  90. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  91. package/dist/{chunk-GLQ7EJAH.cjs → chunk-NULOAF7W.cjs} +13 -1
  92. package/dist/chunk-NULOAF7W.cjs.map +1 -0
  93. package/dist/{chunk-YWN76H2W.cjs → chunk-NX36HDXE.cjs} +13 -1
  94. package/dist/chunk-NX36HDXE.cjs.map +1 -0
  95. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  96. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  97. package/dist/chunk-OAEKP665.cjs.map +1 -1
  98. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  99. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  100. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  101. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  102. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  103. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  104. package/dist/chunk-PYNHK6AP.cjs.map +1 -1
  105. package/dist/{chunk-F6LZ2YNM.js → chunk-Q5S7YKB3.js} +35 -1
  106. package/dist/chunk-Q5S7YKB3.js.map +1 -0
  107. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  108. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  109. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  110. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  111. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  112. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  113. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  114. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  115. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  116. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  117. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  118. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  119. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  120. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  121. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  122. package/dist/chunk-UTCXNBID.cjs.map +1 -1
  123. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  124. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  125. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  126. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  127. package/dist/chunk-W457XUA6.cjs.map +1 -1
  128. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  129. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  130. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  131. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  132. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  133. package/dist/chunk-YFRAI34Y.cjs.map +1 -1
  134. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  135. package/dist/chunk-YW4DVKNT.cjs.map +1 -1
  136. package/dist/chunk-ZGMIHHGL.cjs.map +1 -1
  137. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  138. package/dist/{chunk-XPSN5YYU.cjs → chunk-ZMJT2YPZ.cjs} +3 -3
  139. package/dist/chunk-ZMJT2YPZ.cjs.map +1 -0
  140. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  141. package/dist/client.cjs +2 -2
  142. package/dist/client.cjs.map +1 -1
  143. package/dist/client.js +1 -1
  144. package/dist/core.cjs.map +1 -1
  145. package/dist/currencies.cjs.map +1 -1
  146. package/dist/enigmaCardForm.cjs.map +1 -1
  147. package/dist/error.cjs.map +1 -1
  148. package/dist/eventStream.cjs.map +1 -1
  149. package/dist/exportDownload.cjs.map +1 -1
  150. package/dist/feeProgram.cjs.map +1 -1
  151. package/dist/index.cjs +4 -4
  152. package/dist/index.cjs.map +1 -1
  153. package/dist/index.d.cts +1 -1
  154. package/dist/index.d.ts +1 -1
  155. package/dist/index.js +3 -3
  156. package/dist/internal/resources/admin.cjs.map +1 -1
  157. package/dist/internal/resources/admin.d.cts +1 -1
  158. package/dist/internal/resources/admin.d.ts +1 -1
  159. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  160. package/dist/internal/resources/adminBranding.d.cts +1 -1
  161. package/dist/internal/resources/adminBranding.d.ts +1 -1
  162. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  163. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
  164. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
  165. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  166. package/dist/internal/resources/adminFeePlans.d.cts +1 -1
  167. package/dist/internal/resources/adminFeePlans.d.ts +1 -1
  168. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  169. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  170. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  171. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  172. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  173. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  174. package/dist/internal/resources/adminLive.cjs.map +1 -1
  175. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  176. package/dist/internal/resources/adminNotices.d.cts +1 -1
  177. package/dist/internal/resources/adminNotices.d.ts +1 -1
  178. package/dist/internal/resources/adminPortal.cjs +2 -2
  179. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  180. package/dist/internal/resources/adminPortal.d.cts +9 -2
  181. package/dist/internal/resources/adminPortal.d.ts +9 -2
  182. package/dist/internal/resources/adminPortal.js +1 -1
  183. package/dist/internal/resources/adminPricing.cjs +2 -2
  184. package/dist/internal/resources/adminPricing.cjs.map +1 -1
  185. package/dist/internal/resources/adminPricing.d.cts +19 -1
  186. package/dist/internal/resources/adminPricing.d.ts +19 -1
  187. package/dist/internal/resources/adminPricing.js +1 -1
  188. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  189. package/dist/internal/resources/adminSupport.d.cts +1 -1
  190. package/dist/internal/resources/adminSupport.d.ts +1 -1
  191. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  192. package/dist/internal/resources/auditLogs.d.cts +1 -1
  193. package/dist/internal/resources/auditLogs.d.ts +1 -1
  194. package/dist/internal/resources/cache.cjs.map +1 -1
  195. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  196. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  197. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  198. package/dist/internal/resources/configs.cjs.map +1 -1
  199. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  200. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  201. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  202. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  203. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  204. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  205. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  206. package/dist/internal/resources/diagnostic.d.cts +1 -1
  207. package/dist/internal/resources/diagnostic.d.ts +1 -1
  208. package/dist/internal/resources/gsm.cjs.map +1 -1
  209. package/dist/internal/resources/gsm.d.cts +1 -1
  210. package/dist/internal/resources/gsm.d.ts +1 -1
  211. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  212. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  213. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  214. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  215. package/dist/internal/resources/platformBilling.d.cts +1 -1
  216. package/dist/internal/resources/platformBilling.d.ts +1 -1
  217. package/dist/internal/resources/platformFees.cjs.map +1 -1
  218. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  219. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  220. package/dist/internal/resources/platformSettings.d.cts +1 -1
  221. package/dist/internal/resources/platformSettings.d.ts +1 -1
  222. package/dist/internal.cjs +9 -9
  223. package/dist/internal.cjs.map +1 -1
  224. package/dist/internal.d.cts +2 -2
  225. package/dist/internal.d.ts +2 -2
  226. package/dist/internal.js +5 -5
  227. package/dist/listQuery.cjs.map +1 -1
  228. package/dist/panes.cjs.map +1 -1
  229. package/dist/paymentPresentation.cjs.map +1 -1
  230. package/dist/recordCounter.cjs.map +1 -1
  231. package/dist/resources/aiTools.cjs.map +1 -1
  232. package/dist/resources/analytics.cjs +2 -2
  233. package/dist/resources/analytics.cjs.map +1 -1
  234. package/dist/resources/analytics.d.cts +9 -1
  235. package/dist/resources/analytics.d.ts +9 -1
  236. package/dist/resources/analytics.js +1 -1
  237. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  238. package/dist/resources/apiKeys.cjs.map +1 -1
  239. package/dist/resources/audit.cjs.map +1 -1
  240. package/dist/resources/authentication.cjs.map +1 -1
  241. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  242. package/dist/resources/billing.cjs.map +1 -1
  243. package/dist/resources/buyerAccount.cjs.map +1 -1
  244. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  245. package/dist/resources/buyerConversations.cjs.map +1 -1
  246. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  247. package/dist/resources/buyerPortal.cjs.map +1 -1
  248. package/dist/resources/cards.cjs.map +1 -1
  249. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  250. package/dist/resources/checkoutDomains.cjs.map +1 -1
  251. package/dist/resources/checkoutMethods.cjs.map +1 -1
  252. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  253. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  254. package/dist/resources/connectors.cjs.map +1 -1
  255. package/dist/resources/contentEncryption.cjs.map +1 -1
  256. package/dist/resources/costRules.cjs.map +1 -1
  257. package/dist/resources/customers.cjs.map +1 -1
  258. package/dist/resources/deploymentBranding.cjs.map +1 -1
  259. package/dist/resources/disputes.cjs.map +1 -1
  260. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  261. package/dist/resources/events.cjs.map +1 -1
  262. package/dist/resources/export.cjs.map +1 -1
  263. package/dist/resources/externalRecords.cjs.map +1 -1
  264. package/dist/resources/featureMatrix.cjs.map +1 -1
  265. package/dist/resources/fees.cjs.map +1 -1
  266. package/dist/resources/files.cjs.map +1 -1
  267. package/dist/resources/forex.cjs.map +1 -1
  268. package/dist/resources/identityVerifications.cjs.map +1 -1
  269. package/dist/resources/industries.cjs.map +1 -1
  270. package/dist/resources/invoiceSettings.cjs.map +1 -1
  271. package/dist/resources/invoices.cjs.map +1 -1
  272. package/dist/resources/live.cjs.map +1 -1
  273. package/dist/resources/mandates.cjs.map +1 -1
  274. package/dist/resources/merchantAccounts.cjs.map +1 -1
  275. package/dist/resources/messageTemplates.cjs.map +1 -1
  276. package/dist/resources/notices.cjs.map +1 -1
  277. package/dist/resources/operationLimits.cjs.map +1 -1
  278. package/dist/resources/paymentLinks.cjs.map +1 -1
  279. package/dist/resources/paymentMethods.cjs.map +1 -1
  280. package/dist/resources/payments.cjs.map +1 -1
  281. package/dist/resources/payoutDestinations.cjs.map +1 -1
  282. package/dist/resources/payouts.cjs.map +1 -1
  283. package/dist/resources/paypalDisputes.cjs.map +1 -1
  284. package/dist/resources/persons.cjs.map +1 -1
  285. package/dist/resources/poll.cjs.map +1 -1
  286. package/dist/resources/processorCosts.cjs.map +1 -1
  287. package/dist/resources/processorImports.cjs.map +1 -1
  288. package/dist/resources/products.cjs.map +1 -1
  289. package/dist/resources/profileAcquirers.cjs.map +1 -1
  290. package/dist/resources/profiles.cjs.map +1 -1
  291. package/dist/resources/projects.cjs.map +1 -1
  292. package/dist/resources/refunds.cjs.map +1 -1
  293. package/dist/resources/regions.cjs.map +1 -1
  294. package/dist/resources/relay.cjs.map +1 -1
  295. package/dist/resources/risk.cjs.map +1 -1
  296. package/dist/resources/routing.cjs.map +1 -1
  297. package/dist/resources/search.cjs.map +1 -1
  298. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  299. package/dist/resources/settings.cjs.map +1 -1
  300. package/dist/resources/settlement.cjs.map +1 -1
  301. package/dist/resources/shareLinks.cjs.map +1 -1
  302. package/dist/resources/shopLabels.cjs.map +1 -1
  303. package/dist/resources/shopify.cjs.map +1 -1
  304. package/dist/resources/shops.cjs.map +1 -1
  305. package/dist/resources/stripeConnect.cjs.map +1 -1
  306. package/dist/resources/subscriptions.cjs.map +1 -1
  307. package/dist/resources/support.cjs.map +1 -1
  308. package/dist/resources/threeDsRules.cjs.map +1 -1
  309. package/dist/resources/users.cjs.map +1 -1
  310. package/dist/resources/vatRates.cjs.map +1 -1
  311. package/dist/resources/verification.cjs.map +1 -1
  312. package/dist/resources/webhooks.cjs.map +1 -1
  313. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  314. package/dist/trustedOrigins.cjs.map +1 -1
  315. package/dist/{types-D_Y2A9ny.d.cts → types-FHqOLCyI.d.cts} +181 -1
  316. package/dist/{types-BxgOWS55.d.ts → types-SEJjet2B.d.ts} +181 -1
  317. package/dist/types.cjs.map +1 -1
  318. package/dist/types.d.cts +106 -4
  319. package/dist/types.d.ts +106 -4
  320. package/package.json +1 -1
  321. package/dist/chunk-2NVGA4G5.cjs.map +0 -1
  322. package/dist/chunk-F6LZ2YNM.js.map +0 -1
  323. package/dist/chunk-GLQ7EJAH.cjs.map +0 -1
  324. package/dist/chunk-IM6A64ON.js.map +0 -1
  325. package/dist/chunk-MXSUWL6O.js.map +0 -1
  326. package/dist/chunk-OFZJ4JAH.cjs.map +0 -1
  327. package/dist/chunk-XPSN5YYU.cjs.map +0 -1
  328. package/dist/chunk-YWN76H2W.cjs.map +0 -1
  329. /package/dist/{chunk-QG6AD33A.js.map → chunk-7H2VFIPS.js.map} +0 -0
  330. /package/dist/{chunk-MOFPVWNN.js.map → chunk-CQQW5JU7.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/tmp/publish-sdk-04990/dist/chunk-K3XXGAOR.cjs","../src/checkoutSession.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACoEA,SAAS,wBAAA,CAAyB,KAAA,EAAwD;AACxF,EAAA,GAAA,CAAI,CAAC,KAAA,EAAO,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AAiByC,EAAA;AACpB,IAAA;AACjB,MAAA;AAC+C,MAAA;AAC/C,MAAA;AAC2E,QAAA;AACtE,QAAA;AACqC,QAAA;AAC1C,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAasC,EAAA;AACkB,IAAA;AACyB,MAAA;AAC1E,MAAA;AACqC,MAAA;AACzC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB8C,EAAA;AAC+B,IAAA;AAClE,MAAA;AACmC,QAAA;AACvB,QAAA;AACD,QAAA;AACU,QAAA;AAC5B,MAAA;AACG,MAAA;AACqC,MAAA;AACzC,IAAA;AACH,EAAA;AACF;AD/VsG;AACA;AACA;AACA","file":"/tmp/publish-sdk-04990/dist/chunk-K3XXGAOR.cjs","sourcesContent":[null,"import { Delopay } from './client';\nimport type { DelopayLogger, RequestExtras } from './client';\nimport { DelopayError } from './error';\nimport type {\n BrowserCardClaimRequest,\n BrowserCardClaimResponse,\n CheckoutAddonChoiceRequest,\n CheckoutAddonChoiceResponse,\n CheckoutDataResponse,\n CheckoutTax,\n CheckoutTaxRequest,\n CheckoutIdentityEmailCodeRequest,\n CheckoutIdentityEmailCodeResponse,\n CheckoutIdentityEmailVerifyRequest,\n CheckoutIdentityEmailVerifyResponse,\n CheckoutIdentityReuseRequest,\n CheckoutIdentityVerificationResponse,\n CheckoutIdentityVerificationStartRequest,\n CheckoutDeviceSessionCompleteRequest,\n CheckoutDeviceSessionResponse,\n ConfirmSubscriptionRequest,\n ConfirmSubscriptionResponse,\n EpayoutsMethodsOptions,\n EpayoutsMethodsResponse,\n MollieApplePaySessionRequest,\n MollieApplePaySessionResponse,\n MicropaymentBankSessionRequest,\n MicropaymentBankSessionResponse,\n EpayoutsPaypalDeclineRequest,\n EpayoutsPaypalDeclineResponse,\n EpayoutsPaypalOrderResponse,\n PaymentAbandonAttemptResponse,\n PaymentReopenAttemptResponse,\n PaymentConfirmRequest,\n PaymentMethodListResponse,\n PaymentMethodPresentationResponse,\n PaymentResponse,\n PaymentsPostSessionTokensRequest,\n PaymentsPostSessionTokensResponse,\n PaymentUpdateRequest,\n RecordCheckoutEventRequest,\n RecordCheckoutEventResponse,\n ReplayIngestParams,\n ReplayIngestResponse,\n NomupayCardAuthorizationRequest,\n NomupayCardAuthorizationResponse,\n StripeHostedConfirmRequest,\n SubscriptionCheckoutResponse,\n SubscriptionReturnStatusResponse,\n SelectSubscriptionMethodRequest,\n SubscriptionCheckoutMethod,\n SubscriptionMethodOptionsResponse,\n SubscriptionResponse,\n StripeHostedConfirmResponse,\n EnigmaFormSession,\n VaultCollectSessionParams,\n VaultCollectSessionResponse,\n VaultPaymentMethodRequest,\n VaultPaymentMethodResponse,\n VaultSavedCardsResponse,\n} from './types';\n\n/**\n * A publishable (browser-safe) API key. The template type rejects secret\n * keys (`prd_…` / `snd_…`) at compile time, so a checkout cannot be handed\n * a credential that would reach secret-key routes.\n */\nexport type PublishableKey = `pk_${string}`;\n\n/**\n * Drop any caller-supplied credential headers (case-insensitively), so a\n * route can only ever carry the one credential its family requires — the\n * class's isolation guarantee must hold against per-call `headers` too.\n * Non-credential extras (`Idempotency-Key`, `X-Dp-*`, …) pass through.\n */\nfunction withoutCredentialHeaders(extra?: Record<string, string>): Record<string, string> {\n if (!extra) return {};\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(extra)) {\n const lower = key.toLowerCase();\n if (lower === 'api-key' || lower === 'authorization') continue;\n out[key] = value;\n }\n return out;\n}\n\n/** The query a vault form session is asked with: the buyer's locale and the form's look. */\nfunction vaultFormQuery(params?: VaultCollectSessionParams): Record<string, string | undefined> {\n const look = params?.appearance;\n return {\n locale: params?.locale,\n form_surface: look?.surface,\n form_text: look?.text,\n form_border: look?.border,\n form_accent: look?.accent,\n form_danger: look?.danger,\n form_font: look?.font,\n form_radius: look?.radius,\n form_size: look?.size,\n form_labels: look?.labels,\n form_chrome: look?.chrome,\n form_label: look?.label,\n form_hints: look?.hints === undefined ? undefined : String(look.hints),\n form_order: look?.order,\n form_marks: look?.marks,\n form_focus: look?.focus,\n form_motion: look?.motion,\n form_height: look?.height,\n form_gap: look?.gap,\n form_corner: look?.corner,\n form_fill: look?.fill,\n form_custom: look?.custom ? 'true' : undefined,\n };\n}\n\n/** Drop one header (case-insensitively) from a caller-supplied extras map. */\nfunction withoutHeader(headers: Record<string, string>, name: string): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(headers)) {\n if (key.toLowerCase() === name) continue;\n out[key] = value;\n }\n return out;\n}\n\n/** Configuration for a {@link CheckoutSession}. */\nexport interface CheckoutSessionOptions {\n /** The merchant the payment belongs to. */\n merchantId: string;\n /** The payment this session is about. */\n paymentId: string;\n /**\n * The merchant's publishable key (`pk_prd_…` / `pk_snd_…`), from the\n * checkout payload's `pub_key`. Required for the `/payments/*` and\n * `/payment-methods` calls.\n */\n publishableKey?: PublishableKey;\n /**\n * The payment's client secret, from the checkout payload. Required for\n * every `/payment-link/*` call, and rides along on the payment calls.\n */\n clientSecret?: string;\n /** Override the API base URL (e.g. `/api` behind a same-origin proxy). */\n baseUrl?: string;\n /** Use the sandbox environment. Ignored when `baseUrl` is set. */\n sandbox?: boolean;\n /** Per-request timeout in milliseconds. */\n timeout?: number;\n /** Maximum automatic retries for retryable requests. */\n maxRetries?: number;\n debug?: boolean;\n logger?: DelopayLogger;\n}\n\n/**\n * Buyer-side client for a single hosted-checkout payment.\n *\n * Binds the two browser-safe credentials once — the merchant's publishable\n * key and the payment's client secret — and sends each request with exactly\n * the credential its route expects:\n *\n * - `/payment-link/*` side-channel routes authenticate with\n * `Authorization: Bearer <client_secret>`.\n * - `/payments/*` and `/payment-methods` authenticate with the publishable\n * key in the `api-key` header, with the client secret as query parameter\n * or body field.\n *\n * Neither credential can reach a secret-key route: the publishable key is\n * typed to the `pk_` prefix and the client secret only ever leaves as a\n * bearer token / parameter, never as an `api-key`.\n *\n * @example\n * ```typescript\n * const session = new CheckoutSession({\n * merchantId: checkout.merchant_id,\n * paymentId: checkout.payment_id,\n * publishableKey: checkout.pub_key,\n * clientSecret: checkout.client_secret,\n * });\n * const catalog = await session.epayoutsMethods('de');\n * ```\n */\n/**\n * A `CompressionStream` constructor, as much of it as this module uses.\n *\n * Declared structurally rather than taken from the DOM lib: the global is\n * absent in some runtimes this SDK is dropped into, and a type that asserts it\n * exists would make the feature test look redundant to the next reader.\n */\ntype GzipStreamCtor = new (format: 'gzip') => {\n readable: ReadableStream<Uint8Array>;\n writable: WritableStream<Uint8Array>;\n};\n\n/**\n * Gzip a JSON body, or answer `null` where the runtime cannot.\n *\n * `null` is not a failure — it is the caller's instruction to send the body\n * uncompressed. `CompressionStream` is a global in Node 18+ and in current\n * browsers but is missing from older Safari and from some embedded runtimes,\n * and this SDK carries no runtime dependencies, so there is no polyfill to\n * reach for. Sending plain JSON is always correct; the server reads the\n * encoding off the header it is given.\n *\n * The compressed stream is drained to an `ArrayBuffer` rather than handed to\n * `fetch` as a stream. A streamed request body needs `duplex: 'half'`, cannot\n * be replayed on a retry, and is refused outright together with `keepalive` —\n * which is precisely the case a recorder needs when the page is navigating\n * away.\n */\nasync function gzipJson(value: unknown): Promise<ArrayBuffer | null> {\n const ctor = (globalThis as { CompressionStream?: GzipStreamCtor }).CompressionStream;\n if (typeof ctor !== 'function') return null;\n try {\n const bytes = new TextEncoder().encode(JSON.stringify(value));\n return await new Response(\n new Blob([bytes]).stream().pipeThrough(new ctor('gzip')),\n ).arrayBuffer();\n } catch {\n // A runtime carrying the constructor but unable to run it — no\n // `Blob.prototype.stream`, no `pipeThrough` — is the uncompressed case\n // too. A recording must never cost the caller a payment page.\n return null;\n }\n}\n\nexport class CheckoutSession {\n private readonly client: Delopay;\n private readonly merchantId: string;\n private readonly paymentId: string;\n private readonly publishableKey?: PublishableKey;\n private readonly clientSecret?: string;\n\n constructor(options: CheckoutSessionOptions) {\n this.merchantId = options.merchantId;\n this.paymentId = options.paymentId;\n this.publishableKey = options.publishableKey;\n this.clientSecret = options.clientSecret;\n // Constructed WITHOUT a key: every call attaches its own credential\n // explicitly, so a bearer-authenticated route never carries an api-key\n // header and vice versa.\n this.client = new Delopay('', {\n baseUrl: options.baseUrl,\n sandbox: options.sandbox,\n timeout: options.timeout,\n maxRetries: options.maxRetries,\n debug: options.debug,\n logger: options.logger,\n });\n }\n\n private get linkBase(): string {\n return `/payment-link/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`;\n }\n\n /** Headers for the client-secret bearer routes (`/payment-link/*`). */\n private bearerHeaders(extra?: Record<string, string>): Record<string, string> {\n return {\n ...withoutCredentialHeaders(extra),\n Authorization: `Bearer ${this.requireClientSecret()}`,\n };\n }\n\n /** Headers for the publishable-key routes (`/payments/*`, `/payment-methods`). */\n private pkHeaders(extra?: Record<string, string>): Record<string, string> {\n if (!this.publishableKey) {\n throw new DelopayError('This call requires the publishable key', {\n status: 0,\n code: 'MISSING_CREDENTIAL',\n type: 'invalid_request',\n });\n }\n return { ...withoutCredentialHeaders(extra), 'api-key': this.publishableKey };\n }\n\n private requireClientSecret(): string {\n if (!this.clientSecret) {\n throw new DelopayError('This call requires the payment client secret', {\n status: 0,\n code: 'MISSING_CREDENTIAL',\n type: 'invalid_request',\n });\n }\n return this.clientSecret;\n }\n\n /**\n * The hosted checkout's bootstrap payload for a one-time payment —\n * `CheckoutDetails` while payable, a status view once settled.\n *\n * Deliberately unauthenticated: a `pay_` link bootstraps before any\n * credential exists, so no credential header is ever attached (caller\n * extras are still stripped of credentials). Core fields and the collection\n * policy are typed; provider-specific fields remain available as unknown.\n *\n * `theme` (a named checkout variant) and `country` are the route's declared\n * query parameters. `country` is a manual override of the buyer country the\n * router otherwise resolves from the client IP — it decides which payment\n * methods the layout shows — as an ISO 3166-1 alpha-2 code, sent uppercased\n * and omitted when empty. `locale` travels as `Accept-Language` — the only\n * channel the backend's locale resolution reads; a `?locale=` query is\n * silently ignored by this route.\n *\n * `cardOnly` is a direct link to the card form (`payment_method=card`):\n * when the Stripe card form being prepared is the one the link names, its\n * PaymentIntent is created for `card` alone. `cardProvider` and\n * `cardAccount` name that form's connector and account; absent or blank\n * matches any.\n *\n * `entry` opens one of the shop's checkout entries (`?entry=`): the layout\n * holds only that entry's methods and is drawn in its named look, and\n * `entry` on the answer says whether it had anything to offer.\n *\n * `GET /payment-link/data/{merchantId}/{paymentId}`\n */\n async fetchCheckoutData(\n params?: {\n locale?: string;\n theme?: string;\n country?: string;\n cardOnly?: boolean;\n cardProvider?: string;\n cardAccount?: string;\n entry?: string;\n },\n options?: RequestExtras,\n ): Promise<CheckoutDataResponse> {\n const country = params?.country?.trim().toUpperCase();\n return this.client.request(\n 'GET',\n `/payment-link/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n query: {\n theme: params?.theme,\n country: country || undefined,\n card_only: params?.cardOnly || undefined,\n card_provider: params?.cardOnly ? params.cardProvider?.trim() || undefined : undefined,\n card_account: params?.cardOnly ? params.cardAccount?.trim() || undefined : undefined,\n entry: params?.entry?.trim() || undefined,\n },\n ...options,\n headers: {\n ...(params?.locale\n ? {\n ...withoutHeader(withoutCredentialHeaders(options?.headers), 'accept-language'),\n 'Accept-Language': params.locale,\n }\n : withoutCredentialHeaders(options?.headers)),\n },\n },\n );\n }\n\n /**\n * The subscription twin of {@link CheckoutSession.fetchCheckoutData}: the\n * bootstrap payload for a `sub_` checkout. Authenticated with the\n * subscription's client secret (construct the session with the `sub_…` id\n * in the `paymentId` slot). `locale` travels as `Accept-Language`, same\n * as {@link CheckoutSession.fetchCheckoutData}.\n *\n * `GET /subscriptions/data/{merchantId}/{subscriptionId}`\n */\n async fetchSubscriptionData(\n params?: { locale?: string },\n options?: RequestExtras,\n ): Promise<SubscriptionCheckoutResponse> {\n return this.client.request(\n 'GET',\n `/subscriptions/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n ...options,\n headers: {\n ...(params?.locale\n ? {\n ...withoutHeader(this.bearerHeaders(options?.headers), 'accept-language'),\n 'Accept-Language': params.locale,\n }\n : this.bearerHeaders(options?.headers)),\n },\n },\n );\n }\n\n /**\n * Report buyer/device signals for rails that never reach\n * `/payments/{id}/confirm` (the Stripe SAQ-A rail: raw cards, Apple Pay,\n * Google Pay). Same telemetry contract as\n * {@link CheckoutSession.recordEvent}: sent with `keepalive: true`, and\n * failures resolve instead of rejecting — signals must never block or\n * break a checkout. Unauthenticated by design.\n *\n * `POST /payment-link/client-signals/{merchantId}/{paymentId}`\n */\n async reportClientSignals(\n params: {\n browser_info?: Record<string, unknown>;\n signals: Record<string, unknown>;\n },\n options?: RequestExtras,\n ): Promise<void> {\n try {\n await this.client.request(\n 'POST',\n `/payment-link/client-signals/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n body: params,\n keepalive: true,\n ...options,\n headers: withoutCredentialHeaders(options?.headers),\n },\n );\n } catch {\n // Telemetry: swallowing is the contract, not an oversight.\n }\n }\n\n /**\n * Store one slice of the buyer's checkout recording on our own side.\n * Called by the hosted checkout as the buyer works through the page; the\n * client secret is attached automatically.\n *\n * **Not telemetry semantics, on purpose.** Unlike\n * {@link CheckoutSession.recordEvent}, this rejects with a `DelopayError`\n * like every other payment call, because the recorder has to tell the\n * answers apart: a `400` with code `IR_16` means the backend will not take\n * this recording (recording is off on that deployment, the recording is\n * full, the payment is already recording a different session, or this\n * number is stored with different content) and the recorder must stop; any\n * other `400` is the slice itself being refused; a transport failure may be\n * retried with the **same** bytes under the **same** number, which the\n * backend answers with `duplicate: true`.\n *\n * Pass `keepalive: true` for the last slice of a page that is navigating\n * away (a redirect rail); browsers refuse keepalive bodies over ~64 KiB, so\n * only a small final slice should carry it.\n *\n * Pass `compress: true` to send the slice gzipped. Recorded page events\n * compress heavily, so this is mostly a saving on the buyer's connection. It\n * is opt-in and degrades silently: a runtime without `CompressionStream`\n * sends the same slice uncompressed rather than failing, so a caller never\n * has to feature-test before asking for it.\n *\n * ⚠️ `keepalive` overrides it. Compressing means awaiting a stream read\n * before the request is made, and `keepalive` protects a request only once\n * it has been initiated — so a page torn down mid-compression would drop the\n * final slice altogether. A slice sent with `keepalive` therefore always\n * travels uncompressed, whatever `compress` says. Passing both is allowed and\n * is what a recorder should do: every ordinary slice compresses, and the last\n * one is sent the way that actually arrives.\n *\n * For a precompressed event array, pass `compressed_events` and `gzipBody`.\n * The latter receives the complete JSON request (including the session's\n * client secret) and must return gzip bytes synchronously. Fetch then starts\n * before this method yields, including on a page-navigation slice. A\n * keepalive request is used only when that prepared body is at most 60 KiB.\n *\n * `POST /payments/{paymentId}/replay/slice` (publishable key)\n */\n async storeReplaySlice(\n params: ReplayIngestParams,\n options?: RequestExtras & {\n keepalive?: boolean;\n compress?: boolean;\n /** Gzip a prepared JSON envelope synchronously before the request starts. */\n gzipBody?: (body: Uint8Array) => Uint8Array;\n },\n ): Promise<ReplayIngestResponse> {\n const { keepalive, compress, gzipBody, ...extras } = options ?? {};\n // Built before anything can be compressed, so a missing credential still\n // rejects without a request going out.\n const body = { ...params, client_secret: this.requireClientSecret() };\n const headers = this.pkHeaders(extras.headers);\n // `keepalive` wins over `compress`, and that is a correctness rule rather\n // than a preference. `keepalive` preserves a request only once it has been\n // *initiated*; compressing first means awaiting a stream read, and a page\n // torn down during that await never reaches `fetch()` at all — the final\n // slice is then lost outright, which is the one thing `keepalive` exists to\n // prevent. Losing a slice to save bytes is the wrong trade, so the slice a\n // page is navigating away from travels uncompressed. It is also the\n // smallest one: browsers refuse keepalive bodies over ~64 KiB anyway.\n const encoded = gzipBody?.(new TextEncoder().encode(JSON.stringify(body)));\n const gzipped = encoded\n ? Uint8Array.from(encoded).buffer\n : compress === true && keepalive !== true\n ? await gzipJson(body)\n : null;\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/replay/slice`,\n {\n body: gzipped ?? body,\n ...(keepalive !== undefined\n ? { keepalive: encoded ? keepalive && encoded.byteLength <= 60 * 1024 : keepalive }\n : {}),\n ...extras,\n // `Content-Type` has to be stated for the compressed body: the client\n // only sets it for a body it serialises itself, and the bytes are\n // still JSON — gzip is how they travel, not what they are.\n headers:\n gzipped === null\n ? headers\n : { ...headers, 'Content-Type': 'application/json', 'Content-Encoding': 'gzip' },\n },\n );\n }\n\n /**\n * The status a buyer coming back from the processor's checkout may read:\n * the subscription's status, and whether the processor has reported it yet\n * (`awaiting_processor`). Construct the session with the `sub_…` id in the\n * `paymentId` slot.\n *\n * Authenticated with the return token (`rt`) the return URL carried, sent as\n * `Authorization: Bearer <rt>`. That token reads only this, for a day; it is\n * never the client secret, which this call does not send.\n *\n * `GET /subscriptions/return-status/{merchantId}/{subscriptionId}`\n */\n async subscriptionReturnStatus(\n returnToken: string,\n options?: RequestExtras,\n ): Promise<SubscriptionReturnStatusResponse> {\n if (!returnToken) {\n throw new DelopayError('This call requires the return token (rt) from the return URL', {\n status: 0,\n code: 'MISSING_CREDENTIAL',\n type: 'invalid_request',\n });\n }\n return this.client.request(\n 'GET',\n `/subscriptions/return-status/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n ...options,\n headers: {\n ...withoutCredentialHeaders(options?.headers),\n Authorization: `Bearer ${returnToken}`,\n },\n },\n );\n }\n\n /**\n * The methods the buyer may pick for a subscription that waits for the\n * choice (`method_choice_pending`), judged for the buyer. Call it from the\n * buyer's browser: the sell-to country is read from this request's own\n * connection. A cancelled subscription answers 400, and one that already\n * bills on an account answers 409 (`DE_20`). Authenticated with the\n * subscription's client secret.\n *\n * `GET /subscriptions/method-options/{merchantId}/{subscriptionId}`\n */\n async subscriptionMethodOptions(\n options?: RequestExtras,\n ): Promise<SubscriptionMethodOptionsResponse> {\n return this.client.request(\n 'GET',\n `/subscriptions/method-options/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Bind a waiting subscription to the method the buyer picked and open its\n * first cycle on that method's billing account. The methods are judged\n * again from this request; afterwards\n * {@link CheckoutSession.fetchSubscriptionData} describes the bound\n * subscription (Stripe's Payment Element for `card`, `confirmSubscription`\n * for the others). Picking the same method again answers the bound\n * subscription. A subscription bound to another method already, or whose\n * billing account changed meanwhile, answers 409 (`DE_20`); a method not\n * offered to this buyer, or a cancelled subscription, answers 400.\n * Authenticated with the subscription's client secret.\n *\n * `POST /subscriptions/select-method/{merchantId}/{subscriptionId}`\n */\n async selectSubscriptionMethod(\n method: SubscriptionCheckoutMethod,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n const body: SelectSubscriptionMethodRequest = { method };\n return this.client.request(\n 'POST',\n `/subscriptions/select-method/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n body,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Confirm a subscription (PayPal approval rail). The client secret is\n * attached automatically; the shop's profile id travels as the\n * `X-Profile-Id` header the subscription routes require.\n *\n * `POST /subscriptions/{subscriptionId}/confirm` (publishable key)\n */\n async confirmSubscription(\n subscriptionId: string,\n profileId: string,\n params: Omit<ConfirmSubscriptionRequest, 'client_secret'>,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.client.request(\n 'POST',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`,\n {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n // Strip any caller-supplied x-profile-id first (case-insensitively):\n // Fetch folds duplicate headers into `caller, pro_x`, and the\n // subscription routes must see exactly one profile scope.\n headers: {\n ...withoutHeader(this.pkHeaders(options?.headers), 'x-profile-id'),\n 'X-Profile-Id': profileId,\n },\n },\n );\n }\n\n /**\n * The e-Payouts rail catalog for the buyer's country, plus the set of\n * countries that have at least one vendor.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/epayouts/methods`\n *\n * Pass `{ paypalSdk: true }` from a checkout drawing an experimental PayPal\n * SDK pane to also receive e-Payouts' PayPal client id\n * (`paypal_client_id`, `paypal_currency`); it is present only when `ppal`\n * is among the methods.\n *\n * @param country - Lowercase ISO 3166-1 alpha-2 country code.\n */\n async epayoutsMethods(\n country: string,\n options?: RequestExtras & EpayoutsMethodsOptions,\n ): Promise<EpayoutsMethodsResponse> {\n const { paypalSdk, merchantConnectorId, ...extras } = options ?? {};\n return this.client.request('GET', `${this.linkBase}/epayouts/methods`, {\n query: paypalSdk\n ? {\n cc: country,\n paypal_sdk: 'true',\n ...(merchantConnectorId ? { merchant_connector_id: merchantConnectorId } : {}),\n }\n : { cc: country },\n ...extras,\n headers: this.bearerHeaders(extras.headers),\n });\n }\n\n /**\n * The PayPal order e-Payouts created for the payment, for the PayPal SDK's\n * `createOrder` on the PayPal Express or Pay with card pane, after the payment\n * was confirmed through that pane. Return `order_id` from `createOrder` and\n * send the buyer to `approve_url` once PayPal approved it; without an order,\n * or when PayPal's button cannot be drawn, send the buyer to `redirect_url`.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-order`\n */\n async epayoutsPaypalOrder(options?: RequestExtras): Promise<EpayoutsPaypalOrderResponse> {\n return this.client.request('POST', `${this.linkBase}/epayouts/paypal-order`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Report PayPal's refusal of the card or the payer on the PayPal Express or\n * Pay with card pane (for example `INSTRUMENT_DECLINED`, `PAYER_CANNOT_PAY`,\n * or `AUTHENTICATION_FAILED` for a failed 3-D Secure). The attempt is\n * recorded declined and the payment stays payable with another card or\n * method. An issue that is not a refusal, or a payment that no longer awaits\n * PayPal, is left as it is (`declined: false`). Nothing here captures: the\n * payment settles from e-Payouts' notification.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-decline`\n */\n async epayoutsPaypalDecline(\n params: EpayoutsPaypalDeclineRequest,\n options?: RequestExtras,\n ): Promise<EpayoutsPaypalDeclineResponse> {\n return this.client.request('POST', `${this.linkBase}/epayouts/paypal-decline`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Record a buyer-side checkout event on the payment's status timeline.\n *\n * Telemetry semantics, built in so callers can genuinely fire-and-forget:\n * the request is sent with `keepalive: true` (it survives the document\n * navigating away, e.g. right before a `window.open`), and transport or\n * server failures resolve to `undefined` instead of rejecting — telemetry\n * must never break a checkout or surface an unhandled rejection. Do not\n * `await` this in a click handler that must stay synchronous.\n *\n * A missing client secret still throws `MISSING_CREDENTIAL`: that is a\n * wiring bug, not a telemetry failure.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/checkout-events`\n */\n async recordEvent(\n params: RecordCheckoutEventRequest,\n options?: RequestExtras,\n ): Promise<RecordCheckoutEventResponse | undefined> {\n const headers = this.bearerHeaders(options?.headers);\n try {\n return await this.client.request('POST', `${this.linkBase}/checkout-events`, {\n body: params,\n keepalive: true,\n ...options,\n headers,\n });\n } catch {\n return undefined;\n }\n }\n\n /** Create a new Apple merchant-validation session for a payable Mollie checkout.\n * Requires a live Mollie validation key even for a test payment; never charges.\n * Browser Origin must match the configured checkout domain.\n */\n async mollieApplePaySession(\n params: MollieApplePaySessionRequest,\n options?: RequestExtras,\n ): Promise<MollieApplePaySessionResponse> {\n return this.client.request('POST', `${this.linkBase}/mollie/apple-pay-session`, {\n ...options,\n body: params,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Prepare MicroPayment transfer instructions or an unsigned SEPA mandate.\n * No debit is approved. Show the returned mandate disclosure before collecting\n * acceptance, then confirm with metadata.micropayment_preparation and, for\n * new SEPA mandates, explicit customer_acceptance. Every SEPA confirm must\n * acknowledge its amount/date notice with metadata.micropayment_prenotified.\n * Echo native_pane_merchant_connector_id and the returned\n * native_pane_quote_generation on confirm. Saved reuse sends\n * recurring_details: { type: 'payment_method_id', data: payment_method_id }\n * with payment_method: 'bank_debit', payment_method_type: 'sepa' and no raw\n * bank data. Only saved off-session preparation may omit quote_generation.\n * Transfer instructions become available only after canonical confirmation.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/micropayment/bank-session`\n */\n async micropaymentBankSession(\n params: MicropaymentBankSessionRequest,\n options?: RequestExtras,\n ): Promise<MicropaymentBankSessionResponse> {\n return this.client.request('POST', `${this.linkBase}/micropayment/bank-session`, {\n ...options,\n body: params,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * A short-lived VGS Collect session for browser-side card capture.\n *\n * **Exactly one refusal means \"this shop has no vault\": a 400 carrying\n * `IR_19`.** Every other refusal means a vault exists and could not be used,\n * and answering it by falling back to the processor's own card pane sends an\n * unprotected card number to the very processor the shop pays to hide it\n * from — the bug this endpoint's error contract exists to prevent.\n *\n * A **404 is not benign.** The router answers it when the shop's vault\n * account cannot be found — the state a shop is left in when its vault\n * connector is deleted while the profile keeps naming the id: it still\n * reports the vault as enabled and still expects its cards cloaked. The same\n * status also covers a payment that does not exist.\n *\n * `params.appearance` asks for a form styled to match the page (Enigma\n * Vault). The answer then carries `height`, the frame height to use. If the\n * vault refuses the styled form the answer is the plain one, without\n * `height`. `params.locale` is the buyer's locale.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/vault/collect-session`\n */\n async vaultCollectSession(\n options?: RequestExtras,\n params?: VaultCollectSessionParams,\n ): Promise<VaultCollectSessionResponse> {\n return this.client.request('GET', `${this.linkBase}/vault/collect-session`, {\n ...options,\n query: vaultFormQuery(params),\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * The saved cards the buyer of this payment can pay with, on a shop whose\n * vault keeps the security code itself (Enigma Vault): the cards of the\n * payment's own customer that the shop's vault holds, most recently used\n * first. A payment without a customer answers an empty list.\n *\n * Draw saved cards from this list, not from the customer's payment-method\n * list: that one also carries cards the security-code form cannot open.\n * To pay with one, mint its form with {@link vaultSecurityCodeSession},\n * and confirm with its `payment_token` once the form reports the code\n * stored.\n *\n * A shop without a vault, and a VGS shop, answer `400`.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/vault/saved-cards`\n */\n async vaultSavedCards(options?: RequestExtras): Promise<VaultSavedCardsResponse> {\n return this.client.request('GET', `${this.linkBase}/vault/saved-cards`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Remove one of the buyer's saved cards, named by its `payment_token` from\n * {@link vaultSavedCards}: from the customer's saved cards and from the\n * shop's vault, with every saved copy of the same card. Only a card of the\n * payment's own customer that the shop's vault holds can be removed, and\n * only within the payment's session.\n *\n * Refusals throw a `DelopayError`:\n *\n * - `400` with code `IR_16` and `data.reason` set to a\n * {@link VaultSavedCardRemovalRefusal}: the card stays listed.\n * `saved_card_in_use` means a subscription or agreement still charges it,\n * `saved_card_payment_in_progress` a payment with it is in flight, and\n * `saved_card_removal_unavailable` that the shop cannot remove cards here.\n * - `404`: the card is not one this buyer can remove, for example because it\n * is already gone.\n * - `422` with code `IR_29`: the token is no longer held. Read\n * {@link vaultSavedCards} again and remove the card by its new token.\n *\n * `DELETE /payment-link/{merchantId}/{paymentId}/vault/saved-cards/{paymentToken}`\n */\n async vaultRemoveSavedCard(paymentToken: string, options?: RequestExtras): Promise<void> {\n await this.client.request(\n 'DELETE',\n `${this.linkBase}/vault/saved-cards/${encodeURIComponent(paymentToken)}`,\n {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Mint the security-code form for a saved card, on a shop whose vault keeps\n * the code itself (Enigma Vault). The buyer re-enters the code into the\n * vault's own form, so it never reaches the checkout; confirm with the saved\n * card's `payment_token` once the form reports it stored.\n *\n * `paymentToken` is the saved card's token from {@link vaultSavedCards}. A\n * VGS shop answers `400`: VGS re-collects the code with Collect.\n *\n * `params.appearance` asks for a form styled to match the page, as on\n * {@link vaultCollectSession}. The styled form is the security-code field\n * alone, with no label: draw the label beside the frame, and size the frame\n * to the answer's `height`. `labels` is ignored. If the vault refuses the\n * styled form the answer is the plain one, without `height`.\n *\n * The form stores one code and then disables itself. After a failed\n * payment, mint a new form before the buyer tries again.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/vault/security-code-session`\n */\n async vaultSecurityCodeSession(\n paymentToken: string,\n options?: RequestExtras,\n params?: VaultCollectSessionParams,\n ): Promise<EnigmaFormSession> {\n return this.client.request('GET', `${this.linkBase}/vault/security-code-session`, {\n ...options,\n query: { payment_token: paymentToken, ...vaultFormQuery(params) },\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Register the aliased card as a payment method and mint the one-shot\n * `payment_token` the confirm call spends.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/vault/payment-method`\n */\n async registerVaultPaymentMethod(\n params: VaultPaymentMethodRequest,\n options?: RequestExtras,\n ): Promise<VaultPaymentMethodResponse> {\n return this.client.request('POST', `${this.linkBase}/vault/payment-method`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Reserve this payment attempt before a hosted card form contacts Stripe,\n * Airwallex, or NomuPay. Send the provider object rendered to this checkout\n * and retain the same `flow_id` across retries and any 3-D Secure step.\n *\n * Only `authorized: true` permits the form to contact its processor. A\n * competing flow receives `false` and must reload; an unresolved provider\n * outcome stays reserved, regardless of elapsed time. A buyer-blocklist\n * refusal throws a `DelopayError` with code `DE_14`; a shop whose payments\n * DeloPay stopped is refused with `DE_22`, and a shop whose payments the\n * merchant switched off with `DE_21`.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/browser-card-claim`\n */\n async claimBrowserCard(\n params: BrowserCardClaimRequest,\n options?: RequestExtras,\n ): Promise<BrowserCardClaimResponse> {\n return this.client.request('POST', `${this.linkBase}/browser-card-claim`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Confirm the Stripe card form's PaymentIntent through the router, for a\n * checkout payload with `card_connector_server_confirm: true`. Stripe refuses\n * a Stripe.js confirm of such an intent.\n *\n * Send the PaymentMethod `stripe.createPaymentMethod` produced from the\n * Payment Element (or Express Checkout Element), which needs\n * `paymentMethodCreation: 'manual'` on the Elements instance. A\n * ConfirmationToken is refused with `400`: Stripe will not confirm such an\n * intent with one.\n *\n * The router judges the card's issuing country and the buyer's IP country\n * against the shop's sell-to restrictions before Stripe authorises, and a\n * refusal throws a `DelopayError` with code `DE_10`. A buyer on the\n * merchant's buyer blocklist is refused before any Stripe call with code\n * `DE_14` (`buyer_blocked`, 422), which names no entry, a shop whose\n * payments DeloPay stopped with `DE_22`, and a shop whose payments the\n * merchant switched off with `DE_21`. A buyer the merchant's buyer risk\n * model refuses fails with `DE_23` (`buyer_risk_refused`, 422), which says\n * nothing about the signals. When the answer's\n * `status` is `requires_action`, run `stripe.handleNextAction` with its\n * `client_secret` — safe, because the intent is `confirmation_method=manual`\n * and that secret confirms nothing without the secret key — then call this\n * again without a payment method to finalize.\n *\n * Reserve the attempt with {@link claimBrowserCard} first. Send its granted\n * `flow_id` as `browser_flow_id` on both the initial and post-action confirm;\n * an omitted, null or nonholder flow is refused with `400` and code `IR_16`.\n *\n * A PaymentMethod rules out what `stripe.createPaymentMethod` cannot\n * produce: Stripe names Amazon Pay and Klarna in the Express Checkout\n * Element, which need `stripe.createConfirmationToken` instead. Neither can\n * be paid through this route, so a caller must not offer them on a\n * server-confirmed intent — mount the Express Checkout Element with those\n * methods `'never'`, as DeloPay's own checkout does. The router drops only\n * the methods its server-side confirm cannot finish at all (BLIK and ACSS\n * pre-authorized debits) from the card form's mount, so the rest of the\n * selection still reaches the element and is the caller's to constrain.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/stripe-confirm`\n */\n async confirmStripeCardForm(\n params: StripeHostedConfirmRequest,\n options?: RequestExtras,\n ): Promise<StripeHostedConfirmResponse> {\n return this.client.request('POST', `${this.linkBase}/stripe-confirm`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Make the buyer's add-on choice while the checkout data answers\n * `type: 'addon_choice'`.\n *\n * Only price ids and quantities are sent; the router prices them from the\n * catalog and judges every selection group's bounds. The payment's lines and\n * amount change together, once: the choice is final afterwards, the same\n * choice sent again answers the same result, and another is refused with\n * `IR_16` — as is a choice once anything could have been charged at the\n * previous amount. Fetch the checkout data again afterwards for the payment\n * methods at the final amount.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/addons`\n */\n async chooseAddons(\n params: CheckoutAddonChoiceRequest,\n options?: RequestExtras,\n ): Promise<CheckoutAddonChoiceResponse> {\n return this.client.request('POST', `${this.linkBase}/addons`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Send the buyer's tax country, region and VAT ID while the checkout data's\n * `tax.step` is `open`, and get the VAT the payment carries for them.\n *\n * `close: false` recalculates and keeps the step open, for a live total\n * while the buyer types; it also opens a confirmed step again while nothing\n * was prepared at a provider. `close: true` recalculates and confirms: the\n * payment is charged what the answer says, and the checkout data, fetched\n * again, answers the payment methods with `tax.step` `closed`. A confirmed\n * step answers the same closing request again. A change once something was\n * prepared at a provider is refused with `DE_28` (409), as is one while the\n * add-on choice is open or after the checkout expired. A malformed country\n * or region is refused with `IR_06` (400).\n *\n * `POST /payment-link/{merchantId}/{paymentId}/tax`\n */\n async submitTax(params: CheckoutTaxRequest, options?: RequestExtras): Promise<CheckoutTax> {\n return this.client.request('POST', `${this.linkBase}/tax`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * The payment's identity verification step: whether the payment asked for\n * one, its outcome, and the provider's page while it is pending. A pending\n * verification is read from the provider first, so call this when the buyer\n * comes back from the provider's page.\n *\n * `required` is `false` when the payment asked for no verification.\n * `can_retry` is `true` after an expired or abandoned attempt; start a new\n * one with {@link CheckoutSession.startIdentityVerification}.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/identity-verification`\n */\n async identityVerification(\n options?: RequestExtras,\n ): Promise<CheckoutIdentityVerificationResponse> {\n return this.client.request('GET', `${this.linkBase}/identity-verification`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Resume the payment's pending identity verification, start it, or start a\n * new attempt after an expired or abandoned one. For legacy single-step\n * verifications, send the buyer to the returned top-level\n * `verification_url`. When starting or resuming a specific `step_index` in\n * a multi-step flow, locate the matching entry in `response.steps` by\n * `step_index` and redirect to its `verification_url` (top-level\n * `verification_url` summarizes the first unverified step, not necessarily\n * the requested index). The provider sends the buyer back to `return_url`,\n * which must be on the payment's checkout origin.\n *\n * Refusals throw a `DelopayError`: `400` when the return URL is not on the\n * payment's checkout or the verification is already decided, `404` when the\n * payment asked for no verification.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification`\n */\n async startIdentityVerification(\n params: CheckoutIdentityVerificationStartRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityVerificationResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Mail the buyer a code that confirms their email, so the payment can reuse\n * a verification the merchant already has for them. Offer it only while the\n * checkout data says `identity_verification_reuse_allowed`. The answer is\n * the same whether or not the merchant verified anyone with the address.\n *\n * Refusals throw a `DelopayError`: `400` with code `DE_26` and the reason as\n * its message (`IV_REUSE_OFF` when the payment's requirement does not allow\n * reuse, `IV_REUSE_STEP` when the payment has no verification step a reuse\n * can stand for, `IV_EMAIL_INVALID`), `429` after too many codes for the\n * caller or the address.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification/email-code`\n */\n async sendIdentityEmailCode(\n params: CheckoutIdentityEmailCodeRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityEmailCodeResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification/email-code`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Check the code the buyer entered. `reusable` says only whether the\n * merchant has a verification the payment can reuse; then call\n * {@link CheckoutSession.reuseIdentityVerification}. Otherwise pass the\n * `challenge_id` as `email_challenge_id` to\n * {@link CheckoutSession.startIdentityVerification}, so a later payment can\n * reuse the verification it starts.\n *\n * Refusals throw a `DelopayError`: `400` with code `DE_26` and the reason as\n * its message. `IV_CODE_INCORRECT` is a wrong code, with the tries left in\n * `data.attempts_left`; `IV_CODE_EXPIRED` is an expired code or one out of\n * tries; `IV_CHALLENGE_UNKNOWN` names no code of this payment.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification/email-code/verify`\n */\n async verifyIdentityEmailCode(\n params: CheckoutIdentityEmailVerifyRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityEmailVerifyResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification/email-code/verify`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Reuse the merchant's verification for the buyer's confirmed email as the\n * payment's verification. Needs the challenge confirmed on this payment in\n * the last 30 minutes, and uses it up. No provider session, provider cost or\n * DeloPay fee is made. Answers the payment's verification step, verified.\n *\n * Refusals throw a `DelopayError`: `400` with code `DE_26` and the reason as\n * its message (`IV_CHALLENGE_NOT_CONFIRMED`, `IV_REUSE_NOT_ELIGIBLE`,\n * `IV_REUSE_OFF`, `IV_REUSE_STEP`).\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification/reuse`\n */\n async reuseIdentityVerification(\n params: CheckoutIdentityReuseRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityVerificationResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification/reuse`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Start the device assessment of the payment's checkout. `required` is\n * `false` when the shop assesses no devices, the payment's device is already\n * assessed, or the provider cannot start a session: go on without it. Run\n * the named `library` with the `token`, then call\n * {@link CheckoutSession.completeDeviceSession}.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/device-session`\n */\n async startDeviceSession(options?: RequestExtras): Promise<CheckoutDeviceSessionResponse> {\n return this.client.request('POST', `${this.linkBase}/device-session`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Report the device assessment finished. The router records it with the\n * provider and stores the signal on the payment. Refused with `400` when the\n * session and token are not the payment's pending ones.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/device-session/complete`\n */\n async completeDeviceSession(\n params: CheckoutDeviceSessionCompleteRequest,\n options?: RequestExtras,\n ): Promise<void> {\n await this.client.request('POST', `${this.linkBase}/device-session/complete`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Ask whether NomuPay's COPYandPAY widget may submit a card, from the\n * form's pre-submit hook.\n *\n * Only for a checkout stamped `NomupayOppwaCheckoutData.submit_grant`: the\n * card form sits beside always-shown wallet buttons of another account, and\n * this answer closes those buttons before it allows the card. `authorized`\n * is `false` when the payment no longer waits for a payment method, or when\n * this is not the attempt's live card-form checkout; when a wallet beside it\n * is already being paid, the route answers an error instead. Submit the\n * widget only on `true`.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/nomupay-card-authorization`\n */\n async nomupayCardAuthorization(\n params: NomupayCardAuthorizationRequest,\n options?: RequestExtras,\n ): Promise<NomupayCardAuthorizationResponse> {\n return this.client.request('POST', `${this.linkBase}/nomupay-card-authorization`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * The payment's current state — status polling for redirect/popup rails.\n *\n * `GET /payments/{paymentId}` (publishable key + client secret)\n */\n async retrievePayment(options?: RequestExtras): Promise<PaymentResponse> {\n return this.client.request('GET', `/payments/${encodeURIComponent(this.paymentId)}`, {\n query: { client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * Update the payment before confirmation (e.g. persist custom-field\n * answers as `metadata` on rails that never hit `/confirm`). The client\n * secret is attached automatically.\n *\n * `POST /payments/{paymentId}` (publishable key)\n */\n async updatePayment(\n params: PaymentUpdateRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.client.request('POST', `/payments/${encodeURIComponent(this.paymentId)}`, {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * Confirm the payment. The client secret is attached automatically; pass\n * an `Idempotency-Key` header via `options` to make retries safe.\n *\n * `POST /payments/{paymentId}/confirm` (publishable key)\n */\n async confirmPayment(\n params: PaymentConfirmRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.client.request('POST', `/payments/${encodeURIComponent(this.paymentId)}/confirm`, {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * Mint the processor-side session a browser SDK completes — the PayPal\n * order that PayPal's buttons or Card Fields attach the buyer's choice to.\n * The client secret is attached automatically.\n *\n * For PayPal Card Fields pass `payment_method: 'card'` and the\n * `merchant_connector_id` the checkout was rendered with; the order id comes\n * back in `next_action.next_action_data.order_id` and is what the SDK's\n * `createOrder` returns. The confirm that captures it sends the same order\n * and account as `payment_method_data.card_reference`.\n *\n * Send a distinct `Idempotency-Key` through `options.headers` for each new\n * card submission; reuse it only to retry that same session request. The\n * returned order is bound to this attempt and account. Sessions cannot\n * replace an order while authentication or money processing is unresolved,\n * or after authorization/capture; stale or foreign references are refused.\n *\n * `POST /payments/{paymentId}/post-session-tokens` (publishable key)\n */\n async postSessionTokens(\n params: PaymentsPostSessionTokensRequest,\n options?: RequestExtras,\n ): Promise<PaymentsPostSessionTokensResponse> {\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/post-session-tokens`,\n {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Abandon the attempt the buyer left open on a connector's hosted page\n * (the payment sits in `requires_customer_action`) and open a fresh attempt\n * awaiting a payment method, so the same payment can be confirmed again\n * with another method or connector. Nothing has been authorised on the\n * abandoned attempt; it is voided locally and kept in the attempt history.\n * Idempotent: a payment already in `requires_payment_method` comes back\n * unchanged with `abandoned_attempt_id: null`.\n *\n * `POST /payments/{paymentId}/abandon-attempt` (publishable key + client secret)\n */\n async abandonAttempt(options?: RequestExtras): Promise<PaymentAbandonAttemptResponse> {\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/abandon-attempt`,\n {\n body: { client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Reopen a provider session the buyer switched away from, when they pick the\n * same method again, instead of opening a second session at the provider\n *. Pass an `attempt_id` from the checkout's\n * `reopenable_attempts`; the attempt becomes the payment's active one again\n * and `redirect_url` sends the buyer back to it. Refused (`IR_16`) when the\n * payment no longer awaits a method, a payment is under way on the checkout,\n * or the session can no longer be reopened (settled, lapsed at the provider,\n * ended by the switch); open a new session as usual then.\n *\n * `POST /payments/{paymentId}/reopen-attempt` (publishable key + client secret)\n */\n async reopenAttempt(\n attemptId: string,\n options?: RequestExtras,\n ): Promise<PaymentReopenAttemptResponse> {\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/reopen-attempt`,\n {\n body: { client_secret: this.requireClientSecret(), attempt_id: attemptId },\n ...options,\n headers: this.pkHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Payment methods available for this payment.\n *\n * `GET /payment-methods` (publishable key + client secret)\n *\n * @param params - Optional filters; `country` is the highest-precedence\n * geo hint, ahead of billing address and IP geolocation.\n */\n async listPaymentMethods(\n params?: { country?: string },\n options?: RequestExtras,\n ): Promise<PaymentMethodListResponse> {\n return this.client.request('GET', '/payment-methods', {\n query: { client_secret: this.requireClientSecret(), country: params?.country },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * This payment's checkout buttons, as the hosted checkout draws them: order,\n * labels, artwork, and what selecting each one does. The shop, environment,\n * currency and amount are the payment's. Ask again when the cart changes;\n * an answer is never reused for another payment.\n *\n * `GET /account/payment-methods/presentation` (publishable key + client secret)\n *\n * @param params - `country` outranks the billing address and IP\n * geolocation; `locale` names the language of the labels.\n */\n async paymentMethodPresentation(\n params?: { country?: string; locale?: string; contract_version?: number },\n options?: RequestExtras,\n ): Promise<PaymentMethodPresentationResponse> {\n return this.client.request('GET', '/account/payment-methods/presentation', {\n query: {\n client_secret: this.requireClientSecret(),\n country: params?.country,\n locale: params?.locale,\n contract_version: params?.contract_version,\n },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-K5Q2H3VD.cjs","../src/internal/resources/adminSupport.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACeA,IAAM,KAAA,EAAO,CAAC,EAAA,EAAA,GACZ,CAAA,oCAAA,EAAuC,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAGrC;AACyB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO+B,EAAA;AACb,IAAA;AACX,MAAA;AACtD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAM0F,EAAA;AACb,IAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAM+E,EAAA;AACA,IAAA;AAC/E,EAAA;AAAA;AAGkE,EAAA;AAC7B,IAAA;AACrC,EAAA;AAAA;AAG0F,EAAA;AACzC,IAAA;AACjD,EAAA;AAAA;AAGsF,EAAA;AACjC,IAAA;AACG,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAGsF,EAAA;AACxB,IAAA;AAC9D,EAAA;AAAA;AAAA;AAAA;AAAA;AAWkC,EAAA;AACN,IAAA;AACoB,IAAA;AACM,IAAA;AACb,IAAA;AAC8B,IAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAMoE,EAAA;AACO,IAAA;AACzD,MAAA;AACf,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAMkE,EAAA;AAClB,IAAA;AAChD,EAAA;AACF;AD7BiF;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-K5Q2H3VD.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n SupportAttachmentView,\n SupportMessageList,\n SupportMessagesQuery,\n SupportMessageView,\n} from '../../types';\nimport type {\n SupportRecipientList,\n SupportRecipientsQuery,\n SupportStaffConversationCreate,\n SupportStaffConversationList,\n SupportStaffConversationView,\n SupportStaffListQuery,\n SupportStaffMessageCreate,\n SupportStaffUpdate,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\nconst path = (id: string): string =>\n `/admin-portal/support/conversations/${encodeURIComponent(id)}`;\n\n/** DeloPay's support queue, across merchants. Answers 404 while support is not available. */\nexport class AdminSupport {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The queue, the latest message first unless `sort_by` says otherwise.\n * Several `kind`, `category` or `status` values match a conversation with\n * any of them. `GET /admin-portal/support/conversations`\n */\n async list(query?: SupportStaffListQuery): Promise<SupportStaffConversationList> {\n return this.request('GET', '/admin-portal/support/conversations', {\n query: csvQuery(query, ['kind', 'category', 'status']),\n });\n }\n\n /**\n * Open a conversation towards a merchant, one of its shops or one of its members,\n * with a first message from the support team. `POST /admin-portal/support/conversations`\n */\n async create(body: SupportStaffConversationCreate): Promise<SupportStaffConversationView> {\n return this.request('POST', '/admin-portal/support/conversations', { body });\n }\n\n /**\n * The members of a merchant a message can be addressed to, with whether their role\n * opens the support page. `GET /admin-portal/support/recipients`\n */\n async recipients(query: SupportRecipientsQuery): Promise<SupportRecipientList> {\n return this.request('GET', '/admin-portal/support/recipients', { query: { ...query } });\n }\n\n /** One conversation. `GET /admin-portal/support/conversations/{id}` */\n async retrieve(id: string): Promise<SupportStaffConversationView> {\n return this.request('GET', path(id));\n }\n\n /** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */\n async update(id: string, body: SupportStaffUpdate): Promise<SupportStaffConversationView> {\n return this.request('PATCH', path(id), { body });\n }\n\n /** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */\n async messages(id: string, query?: SupportMessagesQuery): Promise<SupportMessageList> {\n return this.request('GET', `${path(id)}/messages`, {\n query: query === undefined ? undefined : { ...query },\n });\n }\n\n /** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */\n async reply(id: string, body: SupportStaffMessageCreate): Promise<SupportMessageView> {\n return this.request('POST', `${path(id)}/messages`, { body });\n }\n\n /**\n * Upload a file for a message from staff, scanned like a merchant's.\n * `POST /admin-portal/support/conversations/{id}/attachments`\n */\n async uploadAttachment(\n id: string,\n file: Blob,\n clientUploadId: string,\n fileName?: string,\n ): Promise<SupportAttachmentView> {\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', `${path(id)}/attachments`, { body: form });\n }\n\n /**\n * Fetch a file once its scan is clean. A blocked file stays shut for staff too.\n * `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`\n */\n async downloadAttachment(id: string, fileId: string): Promise<Blob> {\n return this.request('GET', `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {\n responseType: 'blob',\n });\n }\n\n /**\n * Clear the staff unread mark and read the conversation as it is now.\n * `POST /admin-portal/support/conversations/{id}/read`\n */\n async markRead(id: string): Promise<SupportStaffConversationView> {\n return this.request('POST', `${path(id)}/read`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/publish-sdk-04990/dist/chunk-K5Q2H3VD.cjs","../src/internal/resources/adminSupport.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACeA,IAAM,KAAA,EAAO,CAAC,EAAA,EAAA,GACZ,CAAA,oCAAA,EAAuC,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAGrC;AACyB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO+B,EAAA;AACb,IAAA;AACX,MAAA;AACtD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAM0F,EAAA;AACb,IAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAM+E,EAAA;AACA,IAAA;AAC/E,EAAA;AAAA;AAGkE,EAAA;AAC7B,IAAA;AACrC,EAAA;AAAA;AAG0F,EAAA;AACzC,IAAA;AACjD,EAAA;AAAA;AAGsF,EAAA;AACjC,IAAA;AACG,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAGsF,EAAA;AACxB,IAAA;AAC9D,EAAA;AAAA;AAAA;AAAA;AAAA;AAWkC,EAAA;AACN,IAAA;AACoB,IAAA;AACM,IAAA;AACb,IAAA;AAC8B,IAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAMoE,EAAA;AACO,IAAA;AACzD,MAAA;AACf,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAMkE,EAAA;AAClB,IAAA;AAChD,EAAA;AACF;AD7BiF;AACA;AACA;AACA","file":"/tmp/publish-sdk-04990/dist/chunk-K5Q2H3VD.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n SupportAttachmentView,\n SupportMessageList,\n SupportMessagesQuery,\n SupportMessageView,\n} from '../../types';\nimport type {\n SupportRecipientList,\n SupportRecipientsQuery,\n SupportStaffConversationCreate,\n SupportStaffConversationList,\n SupportStaffConversationView,\n SupportStaffListQuery,\n SupportStaffMessageCreate,\n SupportStaffUpdate,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\nconst path = (id: string): string =>\n `/admin-portal/support/conversations/${encodeURIComponent(id)}`;\n\n/** DeloPay's support queue, across merchants. Answers 404 while support is not available. */\nexport class AdminSupport {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The queue, the latest message first unless `sort_by` says otherwise.\n * Several `kind`, `category` or `status` values match a conversation with\n * any of them. `GET /admin-portal/support/conversations`\n */\n async list(query?: SupportStaffListQuery): Promise<SupportStaffConversationList> {\n return this.request('GET', '/admin-portal/support/conversations', {\n query: csvQuery(query, ['kind', 'category', 'status']),\n });\n }\n\n /**\n * Open a conversation towards a merchant, one of its shops or one of its members,\n * with a first message from the support team. `POST /admin-portal/support/conversations`\n */\n async create(body: SupportStaffConversationCreate): Promise<SupportStaffConversationView> {\n return this.request('POST', '/admin-portal/support/conversations', { body });\n }\n\n /**\n * The members of a merchant a message can be addressed to, with whether their role\n * opens the support page. `GET /admin-portal/support/recipients`\n */\n async recipients(query: SupportRecipientsQuery): Promise<SupportRecipientList> {\n return this.request('GET', '/admin-portal/support/recipients', { query: { ...query } });\n }\n\n /** One conversation. `GET /admin-portal/support/conversations/{id}` */\n async retrieve(id: string): Promise<SupportStaffConversationView> {\n return this.request('GET', path(id));\n }\n\n /** Change status, kind, category or assignee. `PATCH /admin-portal/support/conversations/{id}` */\n async update(id: string, body: SupportStaffUpdate): Promise<SupportStaffConversationView> {\n return this.request('PATCH', path(id), { body });\n }\n\n /** Messages, notes included. `GET /admin-portal/support/conversations/{id}/messages` */\n async messages(id: string, query?: SupportMessagesQuery): Promise<SupportMessageList> {\n return this.request('GET', `${path(id)}/messages`, {\n query: query === undefined ? undefined : { ...query },\n });\n }\n\n /** Answer, or leave a note. `POST /admin-portal/support/conversations/{id}/messages` */\n async reply(id: string, body: SupportStaffMessageCreate): Promise<SupportMessageView> {\n return this.request('POST', `${path(id)}/messages`, { body });\n }\n\n /**\n * Upload a file for a message from staff, scanned like a merchant's.\n * `POST /admin-portal/support/conversations/{id}/attachments`\n */\n async uploadAttachment(\n id: string,\n file: Blob,\n clientUploadId: string,\n fileName?: string,\n ): Promise<SupportAttachmentView> {\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', `${path(id)}/attachments`, { body: form });\n }\n\n /**\n * Fetch a file once its scan is clean. A blocked file stays shut for staff too.\n * `GET /admin-portal/support/conversations/{id}/attachments/{fileId}`\n */\n async downloadAttachment(id: string, fileId: string): Promise<Blob> {\n return this.request('GET', `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {\n responseType: 'blob',\n });\n }\n\n /**\n * Clear the staff unread mark and read the conversation as it is now.\n * `POST /admin-portal/support/conversations/{id}/read`\n */\n async markRead(id: string): Promise<SupportStaffConversationView> {\n return this.request('POST', `${path(id)}/read`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-KD5Y2YWK.cjs","../src/recordCounter.ts"],"names":[],"mappings":"AAAA;ACgBA,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,MAAA,EAAQ,EAAA;AACd,IAAM,UAAA,EAAY,EAAA;AAClB,IAAM,WAAA,EAAa,GAAA;AACnB,IAAM,YAAA,EAAc,GAAA;AACpB,IAAM,aAAA,EAAe,EAAA;AACrB,IAAM,cAAA,EAAgB,EAAA;AA0Bf,IAAM,iBAAA,EAAN,MAAgD;AAAA,EAAhD,WAAA,CAAA,EAAA;AACL,IAAA,IAAA,CAAQ,SAAA,EAAW,KAAA;AACnB,IAAA,IAAA,CAAQ,SAAA,EAAW,CAAA;AAEnB;AAAA,IAAA,IAAA,CAAQ,eAAA,EAAiB,KAAA;AAAA,EAAA;AAAA,EAEzB,IAAA,CAAK,KAAA,EAAyB;AAC5B,IAAA,IAAI,SAAA,EAAW,IAAA,CAAK,QAAA;AACpB,IAAA,IAAI,SAAA,EAAW,IAAA,CAAK,QAAA;AACpB,IAAA,IAAI,eAAA,EAAiB,IAAA,CAAK,cAAA;AAC1B,IAAA,IAAA,CAAA,MAAW,KAAA,GAAQ,KAAA,EAAO;AACxB,MAAA,GAAA,CAAI,KAAA,IAAS,KAAA,EAAO;AAClB,QAAA,SAAA,EAAW,CAAC,QAAA;AACZ,QAAA,eAAA,EAAiB,IAAA;AAAA,MACnB,EAAA,KAAA,GAAA,CAAW,QAAA,EAAU;AACnB,QAAA,eAAA,EAAiB,IAAA;A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AAA;AAAA,UAAA,KAAA,GAAA,CACR,MAAA,IAAU,CAAA,EAAG;AACpB,YAAA,MAAA,EAAQ,MAAA;AACR,YAAA,KAAA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAA;AACb,IAAA,IAAA,CAAK,SAAA,EAAW,QAAA;AAChB,IAAA,IAAA,CAAK,QAAA,EAAU,OAAA;AACf,IAAA,IAAA,CAAK,YAAA,EAAc,WAAA;AACnB,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAA;AACb,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAA;AAAA,EACf;AAAA,EAEA,IAAI,OAAA,CAAA,EAAkB;AACpB,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,QAAA,CAAA,EAAoB;AACtB,IAAA,OAAO,IAAA,CAAK,MAAA,IAAU,MAAA;AAAA,EACxB;AAAA,EAEA,MAAA,CAAA,EAAiB;AACf,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AACF,CAAA;AD/DA;AACA;AACE;AACA;AACF,qGAAC","file":"/tmp/publish-sdk-0496/dist/chunk-KD5Y2YWK.cjs","sourcesContent":[null,"/**\n * Incremental record counters for streamed export bodies.\n *\n * An export streams its body and announces, in `X-Delopay-Record-Count`, how\n * many records that body will hold. These count the records actually received,\n * chunk by chunk, so a download can show `receivedRecords` of\n * `expectedRecords` while it runs and the finished file can be held to the\n * announced figure.\n *\n * They work on **bytes**, never on decoded text. Every character they look at —\n * `\"` `\\` `{` `}` `[` `]` and the line break — is ASCII, and no byte of a\n * multi-byte UTF-8 sequence falls in the ASCII range, so a chunk boundary can\n * land anywhere, the middle of a character included, without a decoder having\n * to carry a partial sequence across it.\n */\n\nconst LF = 0x0a;\nconst CR = 0x0d;\nconst QUOTE = 0x22;\nconst BACKSLASH = 0x5c;\nconst OPEN_BRACE = 0x7b;\nconst CLOSE_BRACE = 0x7d;\nconst OPEN_BRACKET = 0x5b;\nconst CLOSE_BRACKET = 0x5d;\n\n/** Counts the records in a body fed to it one chunk at a time. */\nexport interface RecordCounter {\n /** Feed the next chunk of the body, in order. */\n push(chunk: Uint8Array): void;\n /** Records complete in what has been fed so far. */\n readonly records: number;\n /**\n * Whether what has been fed ends where a whole export body ends. A body\n * that stops anywhere else was cut off, whatever its record count says.\n */\n readonly complete: boolean;\n /** Records in the body, once it has ended. Does not change the counter. */\n finish(): number;\n}\n\n/**\n * RFC 4180 CSV with a header line: one record per line, where a field holding\n * `,` `\"` or a line break is quoted and a quote inside it is doubled.\n *\n * A newline inside quotes is part of a field, not the end of a record, so every\n * `\"` toggles \"inside quotes\". A doubled `\"\"` toggles twice and leaves it as it\n * was, which is exactly its meaning. Records are the newlines outside quotes,\n * less one for the header.\n */\nexport class CsvRecordCounter implements RecordCounter {\n private inQuotes = false;\n private newlines = 0;\n /** Whether anything but a line break has arrived since the last newline. */\n private lineHasContent = false;\n\n push(chunk: Uint8Array): void {\n let inQuotes = this.inQuotes;\n let newlines = this.newlines;\n let lineHasContent = this.lineHasContent;\n for (const byte of chunk) {\n if (byte === QUOTE) {\n inQuotes = !inQuotes;\n lineHasContent = true;\n } else if (inQuotes) {\n lineHasContent = true;\n } else if (byte === LF) {\n newlines++;\n lineHasContent = false;\n } else if (byte !== CR) {\n lineHasContent = true;\n }\n }\n this.inQuotes = inQuotes;\n this.newlines = newlines;\n this.lineHasContent = lineHasContent;\n }\n\n get records(): number {\n return Math.max(0, this.newlines - 1);\n }\n\n /**\n * The export writer ends every line — the header and each record — with a\n * newline, so a whole body ends on one, outside quotes. RFC 4180 lets a\n * final line break be omitted, but these bodies never omit it, and without\n * that rule a file cut part-way through its last unquoted field\n * (`pay_1,12` of `pay_1,123`) would count as one more whole record and\n * match the figure it was announced with.\n */\n get complete(): boolean {\n return this.newlines >= 1 && !this.inQuotes && !this.lineHasContent;\n }\n\n /**\n * The records that ended. An unterminated tail is not one of them — see\n * {@link complete}.\n */\n finish(): number {\n return this.records;\n }\n}\n\n/** Before the rows array, inside it, and past its end. */\nconst SEEKING = 0;\nconst COUNTING = 1;\nconst CLOSED = 2;\ntype ArrayState = typeof SEEKING | typeof COUNTING | typeof CLOSED;\n\n/**\n * A JSON object whose rows are an array member — `{\"records\":[…],…}` or\n * `{\"data\":[…],…}`.\n *\n * Counts the elements of the **first** array that is a direct member of the\n * top-level object: each one is counted as it closes back to that array's\n * depth, so a record is counted once it has fully arrived, never on its first\n * byte. Counting stops when that array closes, so an array later in the\n * envelope (inside the echoed `filters`, say) is never mistaken for rows.\n *\n * Strings are tracked with their escapes, so a `}` `]` or `\"` inside a value\n * is text, not structure. Elements are counted when an object or array closes;\n * a bare scalar element is not a record and is not counted.\n */\nexport class JsonArrayRecordCounter implements RecordCounter {\n private depth = 0;\n private inString = false;\n private escaped = false;\n private topIsObject = false;\n private state: ArrayState = SEEKING;\n private count = 0;\n\n push(chunk: Uint8Array): void {\n if (this.state === CLOSED) return;\n let { depth, inString, escaped, topIsObject, count } = this;\n let state: ArrayState = this.state;\n for (const byte of chunk) {\n if (inString) {\n if (escaped) escaped = false;\n else if (byte === BACKSLASH) escaped = true;\n else if (byte === QUOTE) inString = false;\n continue;\n }\n if (byte === QUOTE) {\n inString = true;\n } else if (byte === OPEN_BRACE || byte === OPEN_BRACKET) {\n if (depth === 0 && byte === OPEN_BRACE) topIsObject = true;\n if (byte === OPEN_BRACKET && depth === 1 && topIsObject && state === SEEKING) {\n state = COUNTING;\n }\n depth++;\n } else if (byte === CLOSE_BRACE || byte === CLOSE_BRACKET) {\n depth--;\n if (state === COUNTING) {\n // Depth 2 is the rows array's own level: a value closing back to it\n // is one complete row. Closing to depth 1 is the array itself ending.\n if (depth === 2) count++;\n else if (depth === 1) {\n state = CLOSED;\n break;\n }\n }\n }\n }\n this.depth = depth;\n this.inString = inString;\n this.escaped = escaped;\n this.topIsObject = topIsObject;\n this.state = state;\n this.count = count;\n }\n\n get records(): number {\n return this.count;\n }\n\n /**\n * Whether the rows array has closed. What follows it is checked by parsing\n * the whole document, which a cut-off body fails.\n */\n get complete(): boolean {\n return this.state === CLOSED;\n }\n\n finish(): number {\n return this.count;\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/publish-sdk-04990/dist/chunk-KD5Y2YWK.cjs","../src/recordCounter.ts"],"names":[],"mappings":"AAAA;ACgBA,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,MAAA,EAAQ,EAAA;AACd,IAAM,UAAA,EAAY,EAAA;AAClB,IAAM,WAAA,EAAa,GAAA;AACnB,IAAM,YAAA,EAAc,GAAA;AACpB,IAAM,aAAA,EAAe,EAAA;AACrB,IAAM,cAAA,EAAgB,EAAA;AA0Bf,IAAM,iBAAA,EAAN,MAAgD;AAAA,EAAhD,WAAA,CAAA,EAAA;AACL,IAAA,IAAA,CAAQ,SAAA,EAAW,KAAA;AACnB,IAAA,IAAA,CAAQ,SAAA,EAAW,CAAA;AAEnB;AAAA,IAAA,IAAA,CAAQ,eAAA,EAAiB,KAAA;AAAA,EAAA;AAAA,EAEzB,IAAA,CAAK,KAAA,EAAyB;AAC5B,IAAA,IAAI,SAAA,EAAW,IAAA,CAAK,QAAA;AACpB,IAAA,IAAI,SAAA,EAAW,IAAA,CAAK,QAAA;AACpB,IAAA,IAAI,eAAA,EAAiB,IAAA,CAAK,cAAA;AAC1B,IAAA,IAAA,CAAA,MAAW,KAAA,GAAQ,KAAA,EAAO;AACxB,MAAA,GAAA,CAAI,KAAA,IAAS,KAAA,EAAO;AAClB,QAAA,SAAA,EAAW,CAAC,QAAA;AACZ,QAAA,eAAA,EAAiB,IAAA;AAAA,MACnB,EAAA,KAAA,GAAA,CAAW,QAAA,EAAU;AACnB,QAAA,eAAA,EAAiB,IAAA;AAAA,MACnB,EAAA,KAAA,GAAA,CAAW,KAAA,IAAS,EAAA,EAAI;AACtB,QAAA,QAAA,EAAA;AACA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A;AACR,YAAA,KAAA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AACA,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAA;AACb,IAAA,IAAA,CAAK,SAAA,EAAW,QAAA;AAChB,IAAA,IAAA,CAAK,QAAA,EAAU,OAAA;AACf,IAAA,IAAA,CAAK,YAAA,EAAc,WAAA;AACnB,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAA;AACb,IAAA,IAAA,CAAK,MAAA,EAAQ,KAAA;AAAA,EACf;AAAA,EAEA,IAAI,OAAA,CAAA,EAAkB;AACpB,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,QAAA,CAAA,EAAoB;AACtB,IAAA,OAAO,IAAA,CAAK,MAAA,IAAU,MAAA;AAAA,EACxB;AAAA,EAEA,MAAA,CAAA,EAAiB;AACf,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EACd;AACF,CAAA;AD/DA;AACA;AACE;AACA;AACF,qGAAC","file":"/tmp/publish-sdk-04990/dist/chunk-KD5Y2YWK.cjs","sourcesContent":[null,"/**\n * Incremental record counters for streamed export bodies.\n *\n * An export streams its body and announces, in `X-Delopay-Record-Count`, how\n * many records that body will hold. These count the records actually received,\n * chunk by chunk, so a download can show `receivedRecords` of\n * `expectedRecords` while it runs and the finished file can be held to the\n * announced figure.\n *\n * They work on **bytes**, never on decoded text. Every character they look at —\n * `\"` `\\` `{` `}` `[` `]` and the line break — is ASCII, and no byte of a\n * multi-byte UTF-8 sequence falls in the ASCII range, so a chunk boundary can\n * land anywhere, the middle of a character included, without a decoder having\n * to carry a partial sequence across it.\n */\n\nconst LF = 0x0a;\nconst CR = 0x0d;\nconst QUOTE = 0x22;\nconst BACKSLASH = 0x5c;\nconst OPEN_BRACE = 0x7b;\nconst CLOSE_BRACE = 0x7d;\nconst OPEN_BRACKET = 0x5b;\nconst CLOSE_BRACKET = 0x5d;\n\n/** Counts the records in a body fed to it one chunk at a time. */\nexport interface RecordCounter {\n /** Feed the next chunk of the body, in order. */\n push(chunk: Uint8Array): void;\n /** Records complete in what has been fed so far. */\n readonly records: number;\n /**\n * Whether what has been fed ends where a whole export body ends. A body\n * that stops anywhere else was cut off, whatever its record count says.\n */\n readonly complete: boolean;\n /** Records in the body, once it has ended. Does not change the counter. */\n finish(): number;\n}\n\n/**\n * RFC 4180 CSV with a header line: one record per line, where a field holding\n * `,` `\"` or a line break is quoted and a quote inside it is doubled.\n *\n * A newline inside quotes is part of a field, not the end of a record, so every\n * `\"` toggles \"inside quotes\". A doubled `\"\"` toggles twice and leaves it as it\n * was, which is exactly its meaning. Records are the newlines outside quotes,\n * less one for the header.\n */\nexport class CsvRecordCounter implements RecordCounter {\n private inQuotes = false;\n private newlines = 0;\n /** Whether anything but a line break has arrived since the last newline. */\n private lineHasContent = false;\n\n push(chunk: Uint8Array): void {\n let inQuotes = this.inQuotes;\n let newlines = this.newlines;\n let lineHasContent = this.lineHasContent;\n for (const byte of chunk) {\n if (byte === QUOTE) {\n inQuotes = !inQuotes;\n lineHasContent = true;\n } else if (inQuotes) {\n lineHasContent = true;\n } else if (byte === LF) {\n newlines++;\n lineHasContent = false;\n } else if (byte !== CR) {\n lineHasContent = true;\n }\n }\n this.inQuotes = inQuotes;\n this.newlines = newlines;\n this.lineHasContent = lineHasContent;\n }\n\n get records(): number {\n return Math.max(0, this.newlines - 1);\n }\n\n /**\n * The export writer ends every line — the header and each record — with a\n * newline, so a whole body ends on one, outside quotes. RFC 4180 lets a\n * final line break be omitted, but these bodies never omit it, and without\n * that rule a file cut part-way through its last unquoted field\n * (`pay_1,12` of `pay_1,123`) would count as one more whole record and\n * match the figure it was announced with.\n */\n get complete(): boolean {\n return this.newlines >= 1 && !this.inQuotes && !this.lineHasContent;\n }\n\n /**\n * The records that ended. An unterminated tail is not one of them — see\n * {@link complete}.\n */\n finish(): number {\n return this.records;\n }\n}\n\n/** Before the rows array, inside it, and past its end. */\nconst SEEKING = 0;\nconst COUNTING = 1;\nconst CLOSED = 2;\ntype ArrayState = typeof SEEKING | typeof COUNTING | typeof CLOSED;\n\n/**\n * A JSON object whose rows are an array member — `{\"records\":[…],…}` or\n * `{\"data\":[…],…}`.\n *\n * Counts the elements of the **first** array that is a direct member of the\n * top-level object: each one is counted as it closes back to that array's\n * depth, so a record is counted once it has fully arrived, never on its first\n * byte. Counting stops when that array closes, so an array later in the\n * envelope (inside the echoed `filters`, say) is never mistaken for rows.\n *\n * Strings are tracked with their escapes, so a `}` `]` or `\"` inside a value\n * is text, not structure. Elements are counted when an object or array closes;\n * a bare scalar element is not a record and is not counted.\n */\nexport class JsonArrayRecordCounter implements RecordCounter {\n private depth = 0;\n private inString = false;\n private escaped = false;\n private topIsObject = false;\n private state: ArrayState = SEEKING;\n private count = 0;\n\n push(chunk: Uint8Array): void {\n if (this.state === CLOSED) return;\n let { depth, inString, escaped, topIsObject, count } = this;\n let state: ArrayState = this.state;\n for (const byte of chunk) {\n if (inString) {\n if (escaped) escaped = false;\n else if (byte === BACKSLASH) escaped = true;\n else if (byte === QUOTE) inString = false;\n continue;\n }\n if (byte === QUOTE) {\n inString = true;\n } else if (byte === OPEN_BRACE || byte === OPEN_BRACKET) {\n if (depth === 0 && byte === OPEN_BRACE) topIsObject = true;\n if (byte === OPEN_BRACKET && depth === 1 && topIsObject && state === SEEKING) {\n state = COUNTING;\n }\n depth++;\n } else if (byte === CLOSE_BRACE || byte === CLOSE_BRACKET) {\n depth--;\n if (state === COUNTING) {\n // Depth 2 is the rows array's own level: a value closing back to it\n // is one complete row. Closing to depth 1 is the array itself ending.\n if (depth === 2) count++;\n else if (depth === 1) {\n state = CLOSED;\n break;\n }\n }\n }\n }\n this.depth = depth;\n this.inString = inString;\n this.escaped = escaped;\n this.topIsObject = topIsObject;\n this.state = state;\n this.count = count;\n }\n\n get records(): number {\n return this.count;\n }\n\n /**\n * Whether the rows array has closed. What follows it is checked by parsing\n * the whole document, which a cut-off body fails.\n */\n get complete(): boolean {\n return this.state === CLOSED;\n }\n\n finish(): number {\n return this.count;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-KJDMNF2T.cjs","../src/exportDownload.ts"],"names":["received"],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACKA,IAAM,oBAAA,EAAsB,wBAAA;AAGrB,IAAM,oBAAA,EAAsB,+BAAA;AAO5B,IAAM,wBAAA,EAA0B,EAAA,EAAI,IAAA;AAOpC,SAAS,kBAAA,CAAmB,YAAA,EAA0C;AAC3E,EAAA,MAAM,MAAA,EAAQ,IAAI,WAAA,CAAY,CAAA,CAAE,MAAA,CAAO,IAAA,CAAK,SAAA,CAAU,YAAY,CAAC,CAAA;AACnE,EAAA,IAAI,OAAA,EAAS,EAAA;AACb,EAAA,IAAA,CAAA,MAAW,KAAA,GAAQ,KAAA,EAAO,OAAA,GAAU,MAAA,CAAO,YAAA,CAAa,IAAI,CAAA;AAC5D,EAAA,MAAM,QAAA,EAAU,IAAA,CAAK,MAAM,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AACtF,EAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,uBAAA,EAAyB;AAC5C,IAAA,MAAM,IAAI,mCAAA;AAAA,MACR,CAAA,uBAAA,EAA0B,OAAA,CAAQ,MAAM,CAAA,yCAAA,EAA4C,uBAAuB,CAAA,CAAA;AAC3G,MAAA;AACU,QAAA;AACF,QAAA;AACA,QAAA;AACsE,QAAA;AAC9E,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACT;AAc2F;AAGC;AAuB5B;AAClC,EAAA;AACA,EAAA;AACO,EAAA;AACP,EAAA;AACiB,EAAA;AAC/C;AAEgE;AACZ,EA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A;AACA,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AAEgD,EAAA;AACxC,IAAA;AACyF,MAAA;AAC7F,MAAA;AACA,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AAEO,EAAA;AACE,IAAA;AACe,IAAA;AACH,IAAA;AACF,IAAA;AACA,IAAA;AAClB,EAAA;AACM,EAAA;AACT;AAG6C;AACtC,EAAA;AACC,EAAA;AACD,EAAA;AACP;AAmBkB;AACqE,EAAA;AAEjC,EAAA;AACY,IAAA;AAChE,EAAA;AAGgD,EAAA;AAClD;AAgBc;AACsB,EAAA;AAC3B,EAAA;AACL,IAAA;AACiF,IAAA;AACjF,IAAA;AACF,EAAA;AACF;AD3JkH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-KJDMNF2T.cjs","sourcesContent":[null,"import { DelopayError } from './error';\nimport type { DownloadProgressEvent, RequestFn, RequestOptions } from './client';\nimport type {\n ExportFormat,\n ExportOptions,\n ExportPresentation,\n ExportProgress,\n ExportTransferOptions,\n} from './types';\nimport { CsvRecordCounter, JsonArrayRecordCounter } from './recordCounter';\nimport type { RecordCounter } from './recordCounter';\n\n/** The header a streamed export announces its record count in. */\nconst RECORD_COUNT_HEADER = 'x-delopay-record-count';\n\n/** The header a PDF export's words travel in. */\nexport const PRESENTATION_HEADER = 'X-Delopay-Export-Presentation';\n\n/**\n * Longest encoded presentation the server reads. A longer one is refused\n * there with `IR_06`; checked here first, so the caller hears it before a\n * request is sent and without a proxy's opinion of a long header in between.\n */\nexport const MAX_PRESENTATION_HEADER = 6 * 1024;\n\n/**\n * `presentation` as the header carries it: base64url, unpadded, of its UTF-8\n * JSON. Rejects with `EXPORT_PRESENTATION_TOO_LARGE` past\n * {@link MAX_PRESENTATION_HEADER}.\n */\nexport function encodePresentation(presentation: ExportPresentation): string {\n const bytes = new TextEncoder().encode(JSON.stringify(presentation));\n let binary = '';\n for (const byte of bytes) binary += String.fromCharCode(byte);\n const encoded = btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n if (encoded.length > MAX_PRESENTATION_HEADER) {\n throw new DelopayError(\n `Export presentation is ${encoded.length} bytes encoded; the server reads at most ${MAX_PRESENTATION_HEADER}`,\n {\n status: 0,\n code: 'EXPORT_PRESENTATION_TOO_LARGE',\n type: 'invalid_request',\n data: { encoded_length: encoded.length, max_length: MAX_PRESENTATION_HEADER },\n },\n );\n }\n return encoded;\n}\n\n/**\n * Where a `json` export keeps its rows, and its own count of them.\n *\n * Every list export answers `{\"records\":[…],\"record_count\":N,\"filters\":{…}}`;\n * the disputes workspace answers `{\"data\":[…],\"total_count\":N}`.\n */\nexport interface ExportEnvelopeShape {\n rows: string;\n count: string;\n}\n\n/** `{\"records\":[…],\"record_count\":N,\"filters\":{…}}` — every list export. */\nexport const LIST_ENVELOPE: ExportEnvelopeShape = { rows: 'records', count: 'record_count' };\n\n/** `{\"data\":[…],\"total_count\":N}` — the disputes workspace export. */\nexport const WORKSPACE_ENVELOPE: ExportEnvelopeShape = { rows: 'data', count: 'total_count' };\n\n/** One export request, as the resource method built it. */\nexport interface ExportCall {\n method: string;\n path: string;\n /**\n * The request without its transfer options: filters, headers (`Accept`\n * included) and `responseType`.\n */\n request: RequestOptions;\n format: ExportFormat;\n /** The `json` envelope. Defaults to {@link LIST_ENVELOPE}. */\n envelope?: ExportEnvelopeShape;\n}\n\n/**\n * `X-Delopay-Record-Count` as a count, or `null` when there is none.\n *\n * Only a plain run of digits is a count. Anything else — a value a proxy\n * mangled, two values folded into one — is treated as no announcement rather\n * than guessed at.\n */\nfunction parseRecordCount(header: string | null): number | null {\n if (header === null) return null;\n const trimmed = header.trim();\n if (!/^\\d+$/.test(trimmed)) return null;\n const value = Number(trimmed);\n return Number.isSafeInteger(value) ? value : null;\n}\n\nfunction counterFor(format: ExportFormat): RecordCounter | null {\n if (format === 'csv') return new CsvRecordCounter();\n if (format === 'json') return new JsonArrayRecordCounter();\n return null;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** `\" of the N announced\"`, or nothing when the server announced no count. */\nfunction announced(expected: number | null): string {\n return expected === null ? '' : ` of the ${expected} announced`;\n}\n\nfunction incomplete(\n message: string,\n expected: number | null,\n received: number,\n requestId: string | undefined,\n): DelopayError {\n return new DelopayError(message, {\n status: 0,\n code: 'EXPORT_INCOMPLETE',\n type: 'export_incomplete',\n ...(requestId !== undefined ? { requestId } : {}),\n data: { expected_records: expected, received_records: received },\n });\n}\n\n/**\n * Run one export: send it, report its progress, and hold the finished body to\n * the size the server announced before handing it back.\n *\n * The check is the point. These are finance files, and a body that ends short\n * of `X-Delopay-Record-Count` is a file missing rows that would otherwise open,\n * sum and reconcile without a word. It is refused with `EXPORT_INCOMPLETE`\n * rather than returned. For `json` the envelope's own count is held to its\n * rows as well, and a body that is not a whole JSON document is incomplete by\n * definition.\n *\n * `onProgress` hears `preparing` synchronously, before anything is sent — the\n * caller's `async` method runs this far on the call itself.\n */\nexport async function downloadExport<T>(\n request: RequestFn,\n call: ExportCall,\n options: ExportTransferOptions | undefined,\n): Promise<T> {\n const { format } = call;\n const envelope = call.envelope ?? LIST_ENVELOPE;\n const onProgress = options?.onProgress;\n\n let latest: ExportProgress = {\n phase: 'preparing',\n receivedBytes: 0,\n totalBytes: null,\n receivedRecords: 0,\n expectedRecords: null,\n };\n // What the current attempt's headers announced, what its body has\n // delivered, and whether the caller's own listener threw. Kept on an object\n // because the listeners below write it.\n const seen: {\n attempt: number;\n counter: RecordCounter | null;\n expected: number | null;\n requestId: string | undefined;\n listenerError: { error: unknown } | null;\n } = { attempt: -1, counter: null, expected: null, requestId: undefined, listenerError: null };\n\n // A copy each time, so a listener that keeps the snapshots it is given\n // keeps what it was told. What it throws is remembered so it reaches the\n // caller as itself: a `SyntaxError` in a progress bar is not a body that\n // failed to parse.\n const report = (progress: ExportProgress) => {\n latest = progress;\n if (!onProgress) return;\n try {\n onProgress({ ...progress });\n } catch (error) {\n seen.listenerError = { error };\n throw error;\n }\n };\n report(latest);\n\n const onDownloadProgress = (event: DownloadProgressEvent) => {\n if (event.attempt !== seen.attempt) {\n // The headers of a new attempt: a retry starts the body over, so the\n // count does too.\n seen.attempt = event.attempt;\n seen.counter = counterFor(format);\n // A PDF is not counted, so an announced count could only ever fail it.\n seen.expected =\n format === 'pdf' ? null : parseRecordCount(event.headers.get(RECORD_COUNT_HEADER));\n seen.requestId =\n event.headers.get('x-request-id') ?? event.headers.get('x-trace-id') ?? undefined;\n }\n if (event.chunk.byteLength > 0) seen.counter?.push(event.chunk);\n report({\n phase: 'receiving',\n receivedBytes: event.loaded,\n totalBytes: event.total,\n receivedRecords: seen.counter?.records ?? 0,\n expectedRecords: seen.expected,\n });\n };\n\n let result: unknown;\n try {\n result = await request<unknown>(call.method, call.path, {\n ...call.request,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n ...(options?.timeout !== undefined ? { timeout: options.timeout } : {}),\n onDownloadProgress,\n });\n } catch (err) {\n if (seen.listenerError !== null && err === seen.listenerError.error) throw err;\n // The body arrived whole as far as the connection could tell, but it does\n // not parse: it stopped part-way through the document.\n if (format === 'json' && seen.attempt >= 0 && err instanceof SyntaxError) {\n const received = seen.counter?.records ?? 0;\n throw incomplete(\n seen.expected === null\n ? `Export incomplete: the body ended part-way through the JSON document, after ${received} records`\n : `Export incomplete: the server announced ${seen.expected} records, and the body ended part-way through the JSON document after ${received}`,\n seen.expected,\n received,\n seen.requestId,\n );\n }\n throw err;\n }\n\n const { expected, requestId } = seen;\n let received = 0;\n if (format === 'json') {\n // Only the export's own envelope is a JSON export. Anything else — an\n // empty 200, which parses to nothing — delivered no file, and a count of\n // zero records must not be read as a complete empty one.\n const rows = isRecord(result) ? result[envelope.rows] : undefined;\n if (!Array.isArray(rows)) {\n throw incomplete(\n `Export incomplete: the body is not an export envelope with a \"${envelope.rows}\" array, so it carries 0 records${announced(expected)}`,\n expected,\n 0,\n requestId,\n );\n }\n received = rows.length;\n const declared = isRecord(result) ? result[envelope.count] : undefined;\n if (typeof declared === 'number' && declared !== rows.length) {\n throw incomplete(\n `Export incomplete: the file's ${envelope.count} is ${declared}, but it carries ${rows.length} records`,\n declared,\n rows.length,\n requestId,\n );\n }\n } else if (format === 'csv') {\n const counter = seen.counter;\n received = counter?.finish() ?? 0;\n // Checked whether or not a count was announced: every line of an export\n // body ends in a newline, so one that ends anywhere else was cut off.\n if (!counter?.complete) {\n throw incomplete(\n `Export incomplete: the CSV body ended part-way through a line, after ${received} complete records${announced(expected)}`,\n expected,\n received,\n requestId,\n );\n }\n }\n\n if (expected !== null && received !== expected) {\n throw incomplete(\n `Export incomplete: the server announced ${expected} records, and the body carried ${received}`,\n expected,\n received,\n requestId,\n );\n }\n\n report({\n phase: 'done',\n receivedBytes: latest.receivedBytes,\n totalBytes: latest.totalBytes,\n receivedRecords: received,\n expectedRecords: expected,\n });\n return result as T;\n}\n\n/** The media type each format is asked for by name. */\nconst ACCEPT: Record<ExportFormat, string> = {\n csv: 'text/csv',\n json: 'application/json',\n pdf: 'application/pdf',\n};\n\n/**\n * Headers and response handling for one export.\n *\n * The format is negotiated with `Accept`, never a request field. The API's\n * reason is that an export reuses its list's filter model as literally the same\n * type, and several of those are `deny_unknown_fields` — so a `format` key in\n * the query or body is a 400, not an option. That holds for the transactions\n * export too, whose body is the payments list filter.\n *\n * `csv` and `pdf` are not JSON, and the client parses a body as JSON unless it\n * is told otherwise, so a missing `responseType` would be a `SyntaxError` on\n * the first comma rather than a wrong type.\n */\nexport function negotiated(\n options: RequestOptions,\n format: ExportFormat,\n presentation?: ExportPresentation,\n): RequestOptions {\n const headers: Record<string, string> = { ...options.headers, Accept: ACCEPT[format] };\n // Only a PDF prints words; a CSV or JSON file is sent none.\n if (format === 'pdf' && presentation !== undefined) {\n headers[PRESENTATION_HEADER] = encodePresentation(presentation);\n }\n return format === 'json'\n ? { ...options, headers }\n : { ...options, headers, responseType: 'blob' };\n}\n\n/**\n * Send one list export in the format `options` asks for — `json` unless told\n * otherwise — with its progress and its record-count check.\n *\n * `base` is the request as the list would send it: its filters in `body` or\n * `query`, and any header of its own. The format's `Accept` and\n * `responseType` are added here.\n */\nexport function runExport<T>(\n request: RequestFn,\n method: string,\n path: string,\n base: RequestOptions,\n options: ExportOptions | undefined,\n): Promise<T> {\n const format = options?.format ?? 'json';\n return downloadExport<T>(\n request,\n { method, path, request: negotiated(base, format, options?.presentation), format },\n options,\n );\n}\n"]}
1
+ {"version":3,"sources":["/tmp/publish-sdk-04990/dist/chunk-KJDMNF2T.cjs","../src/exportDownload.ts"],"names":["received"],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACKA,IAAM,oBAAA,EAAsB,wBAAA;AAGrB,IAAM,oBAAA,EAAsB,+BAAA;AAO5B,IAAM,wBAAA,EAA0B,EAAA,EAAI,IAAA;AAOpC,SAAS,kBAAA,CAAmB,YAAA,EAA0C;AAC3E,EAAA,MAAM,MAAA,EAAQ,IAAI,WAAA,CAAY,CAAA,CAAE,MAAA,CAAO,IAAA,CAAK,SAAA,CAAU,YAAY,CAAC,CAAA;AACnE,EAAA,IAAI,OAAA,EAAS,EAAA;AACb,EAAA,IAAA,CAAA,MAAW,KAAA,GAAQ,KAAA,EAAO,OAAA,GAAU,MAAA,CAAO,YAAA,CAAa,IAAI,CAAA;AAC5D,EAAA,MAAM,QAAA,EAAU,IAAA,CAAK,MAAM,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AACtF,EAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,EAAS,uBAAA,EAAyB;AAC5C,IAAA,MAAM,IAAI,mCAAA;AAAA,MACR,CAAA,uBAAA,EAA0B,OAAA,CAAQ,M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AA;AACA,QAAA;AACA,QAAA;AACF,MAAA;AACF,IAAA;AACgB,IAAA;AAC6C,IAAA;AACC,IAAA;AACtD,MAAA;AACyF,QAAA;AAC7F,QAAA;AACK,QAAA;AACL,QAAA;AACF,MAAA;AACF,IAAA;AAC2B,EAAA;AACN,IAAA;AACW,IAAA;AAGR,IAAA;AAChB,MAAA;AACgG,QAAA;AACpG,QAAA;AACA,QAAA;AACA,QAAA;AACF,MAAA;AACF,IAAA;AACF,EAAA;AAEgD,EAAA;AACxC,IAAA;AACyF,MAAA;AAC7F,MAAA;AACA,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AAEO,EAAA;AACE,IAAA;AACe,IAAA;AACH,IAAA;AACF,IAAA;AACA,IAAA;AAClB,EAAA;AACM,EAAA;AACT;AAG6C;AACtC,EAAA;AACC,EAAA;AACD,EAAA;AACP;AAmBkB;AACqE,EAAA;AAEjC,EAAA;AACY,IAAA;AAChE,EAAA;AAGgD,EAAA;AAClD;AAgBc;AACsB,EAAA;AAC3B,EAAA;AACL,IAAA;AACiF,IAAA;AACjF,IAAA;AACF,EAAA;AACF;AD3JkH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/publish-sdk-04990/dist/chunk-KJDMNF2T.cjs","sourcesContent":[null,"import { DelopayError } from './error';\nimport type { DownloadProgressEvent, RequestFn, RequestOptions } from './client';\nimport type {\n ExportFormat,\n ExportOptions,\n ExportPresentation,\n ExportProgress,\n ExportTransferOptions,\n} from './types';\nimport { CsvRecordCounter, JsonArrayRecordCounter } from './recordCounter';\nimport type { RecordCounter } from './recordCounter';\n\n/** The header a streamed export announces its record count in. */\nconst RECORD_COUNT_HEADER = 'x-delopay-record-count';\n\n/** The header a PDF export's words travel in. */\nexport const PRESENTATION_HEADER = 'X-Delopay-Export-Presentation';\n\n/**\n * Longest encoded presentation the server reads. A longer one is refused\n * there with `IR_06`; checked here first, so the caller hears it before a\n * request is sent and without a proxy's opinion of a long header in between.\n */\nexport const MAX_PRESENTATION_HEADER = 6 * 1024;\n\n/**\n * `presentation` as the header carries it: base64url, unpadded, of its UTF-8\n * JSON. Rejects with `EXPORT_PRESENTATION_TOO_LARGE` past\n * {@link MAX_PRESENTATION_HEADER}.\n */\nexport function encodePresentation(presentation: ExportPresentation): string {\n const bytes = new TextEncoder().encode(JSON.stringify(presentation));\n let binary = '';\n for (const byte of bytes) binary += String.fromCharCode(byte);\n const encoded = btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n if (encoded.length > MAX_PRESENTATION_HEADER) {\n throw new DelopayError(\n `Export presentation is ${encoded.length} bytes encoded; the server reads at most ${MAX_PRESENTATION_HEADER}`,\n {\n status: 0,\n code: 'EXPORT_PRESENTATION_TOO_LARGE',\n type: 'invalid_request',\n data: { encoded_length: encoded.length, max_length: MAX_PRESENTATION_HEADER },\n },\n );\n }\n return encoded;\n}\n\n/**\n * Where a `json` export keeps its rows, and its own count of them.\n *\n * Every list export answers `{\"records\":[…],\"record_count\":N,\"filters\":{…}}`;\n * the disputes workspace answers `{\"data\":[…],\"total_count\":N}`.\n */\nexport interface ExportEnvelopeShape {\n rows: string;\n count: string;\n}\n\n/** `{\"records\":[…],\"record_count\":N,\"filters\":{…}}` — every list export. */\nexport const LIST_ENVELOPE: ExportEnvelopeShape = { rows: 'records', count: 'record_count' };\n\n/** `{\"data\":[…],\"total_count\":N}` — the disputes workspace export. */\nexport const WORKSPACE_ENVELOPE: ExportEnvelopeShape = { rows: 'data', count: 'total_count' };\n\n/** One export request, as the resource method built it. */\nexport interface ExportCall {\n method: string;\n path: string;\n /**\n * The request without its transfer options: filters, headers (`Accept`\n * included) and `responseType`.\n */\n request: RequestOptions;\n format: ExportFormat;\n /** The `json` envelope. Defaults to {@link LIST_ENVELOPE}. */\n envelope?: ExportEnvelopeShape;\n}\n\n/**\n * `X-Delopay-Record-Count` as a count, or `null` when there is none.\n *\n * Only a plain run of digits is a count. Anything else — a value a proxy\n * mangled, two values folded into one — is treated as no announcement rather\n * than guessed at.\n */\nfunction parseRecordCount(header: string | null): number | null {\n if (header === null) return null;\n const trimmed = header.trim();\n if (!/^\\d+$/.test(trimmed)) return null;\n const value = Number(trimmed);\n return Number.isSafeInteger(value) ? value : null;\n}\n\nfunction counterFor(format: ExportFormat): RecordCounter | null {\n if (format === 'csv') return new CsvRecordCounter();\n if (format === 'json') return new JsonArrayRecordCounter();\n return null;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** `\" of the N announced\"`, or nothing when the server announced no count. */\nfunction announced(expected: number | null): string {\n return expected === null ? '' : ` of the ${expected} announced`;\n}\n\nfunction incomplete(\n message: string,\n expected: number | null,\n received: number,\n requestId: string | undefined,\n): DelopayError {\n return new DelopayError(message, {\n status: 0,\n code: 'EXPORT_INCOMPLETE',\n type: 'export_incomplete',\n ...(requestId !== undefined ? { requestId } : {}),\n data: { expected_records: expected, received_records: received },\n });\n}\n\n/**\n * Run one export: send it, report its progress, and hold the finished body to\n * the size the server announced before handing it back.\n *\n * The check is the point. These are finance files, and a body that ends short\n * of `X-Delopay-Record-Count` is a file missing rows that would otherwise open,\n * sum and reconcile without a word. It is refused with `EXPORT_INCOMPLETE`\n * rather than returned. For `json` the envelope's own count is held to its\n * rows as well, and a body that is not a whole JSON document is incomplete by\n * definition.\n *\n * `onProgress` hears `preparing` synchronously, before anything is sent — the\n * caller's `async` method runs this far on the call itself.\n */\nexport async function downloadExport<T>(\n request: RequestFn,\n call: ExportCall,\n options: ExportTransferOptions | undefined,\n): Promise<T> {\n const { format } = call;\n const envelope = call.envelope ?? LIST_ENVELOPE;\n const onProgress = options?.onProgress;\n\n let latest: ExportProgress = {\n phase: 'preparing',\n receivedBytes: 0,\n totalBytes: null,\n receivedRecords: 0,\n expectedRecords: null,\n };\n // What the current attempt's headers announced, what its body has\n // delivered, and whether the caller's own listener threw. Kept on an object\n // because the listeners below write it.\n const seen: {\n attempt: number;\n counter: RecordCounter | null;\n expected: number | null;\n requestId: string | undefined;\n listenerError: { error: unknown } | null;\n } = { attempt: -1, counter: null, expected: null, requestId: undefined, listenerError: null };\n\n // A copy each time, so a listener that keeps the snapshots it is given\n // keeps what it was told. What it throws is remembered so it reaches the\n // caller as itself: a `SyntaxError` in a progress bar is not a body that\n // failed to parse.\n const report = (progress: ExportProgress) => {\n latest = progress;\n if (!onProgress) return;\n try {\n onProgress({ ...progress });\n } catch (error) {\n seen.listenerError = { error };\n throw error;\n }\n };\n report(latest);\n\n const onDownloadProgress = (event: DownloadProgressEvent) => {\n if (event.attempt !== seen.attempt) {\n // The headers of a new attempt: a retry starts the body over, so the\n // count does too.\n seen.attempt = event.attempt;\n seen.counter = counterFor(format);\n // A PDF is not counted, so an announced count could only ever fail it.\n seen.expected =\n format === 'pdf' ? null : parseRecordCount(event.headers.get(RECORD_COUNT_HEADER));\n seen.requestId =\n event.headers.get('x-request-id') ?? event.headers.get('x-trace-id') ?? undefined;\n }\n if (event.chunk.byteLength > 0) seen.counter?.push(event.chunk);\n report({\n phase: 'receiving',\n receivedBytes: event.loaded,\n totalBytes: event.total,\n receivedRecords: seen.counter?.records ?? 0,\n expectedRecords: seen.expected,\n });\n };\n\n let result: unknown;\n try {\n result = await request<unknown>(call.method, call.path, {\n ...call.request,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n ...(options?.timeout !== undefined ? { timeout: options.timeout } : {}),\n onDownloadProgress,\n });\n } catch (err) {\n if (seen.listenerError !== null && err === seen.listenerError.error) throw err;\n // The body arrived whole as far as the connection could tell, but it does\n // not parse: it stopped part-way through the document.\n if (format === 'json' && seen.attempt >= 0 && err instanceof SyntaxError) {\n const received = seen.counter?.records ?? 0;\n throw incomplete(\n seen.expected === null\n ? `Export incomplete: the body ended part-way through the JSON document, after ${received} records`\n : `Export incomplete: the server announced ${seen.expected} records, and the body ended part-way through the JSON document after ${received}`,\n seen.expected,\n received,\n seen.requestId,\n );\n }\n throw err;\n }\n\n const { expected, requestId } = seen;\n let received = 0;\n if (format === 'json') {\n // Only the export's own envelope is a JSON export. Anything else — an\n // empty 200, which parses to nothing — delivered no file, and a count of\n // zero records must not be read as a complete empty one.\n const rows = isRecord(result) ? result[envelope.rows] : undefined;\n if (!Array.isArray(rows)) {\n throw incomplete(\n `Export incomplete: the body is not an export envelope with a \"${envelope.rows}\" array, so it carries 0 records${announced(expected)}`,\n expected,\n 0,\n requestId,\n );\n }\n received = rows.length;\n const declared = isRecord(result) ? result[envelope.count] : undefined;\n if (typeof declared === 'number' && declared !== rows.length) {\n throw incomplete(\n `Export incomplete: the file's ${envelope.count} is ${declared}, but it carries ${rows.length} records`,\n declared,\n rows.length,\n requestId,\n );\n }\n } else if (format === 'csv') {\n const counter = seen.counter;\n received = counter?.finish() ?? 0;\n // Checked whether or not a count was announced: every line of an export\n // body ends in a newline, so one that ends anywhere else was cut off.\n if (!counter?.complete) {\n throw incomplete(\n `Export incomplete: the CSV body ended part-way through a line, after ${received} complete records${announced(expected)}`,\n expected,\n received,\n requestId,\n );\n }\n }\n\n if (expected !== null && received !== expected) {\n throw incomplete(\n `Export incomplete: the server announced ${expected} records, and the body carried ${received}`,\n expected,\n received,\n requestId,\n );\n }\n\n report({\n phase: 'done',\n receivedBytes: latest.receivedBytes,\n totalBytes: latest.totalBytes,\n receivedRecords: received,\n expectedRecords: expected,\n });\n return result as T;\n}\n\n/** The media type each format is asked for by name. */\nconst ACCEPT: Record<ExportFormat, string> = {\n csv: 'text/csv',\n json: 'application/json',\n pdf: 'application/pdf',\n};\n\n/**\n * Headers and response handling for one export.\n *\n * The format is negotiated with `Accept`, never a request field. The API's\n * reason is that an export reuses its list's filter model as literally the same\n * type, and several of those are `deny_unknown_fields` — so a `format` key in\n * the query or body is a 400, not an option. That holds for the transactions\n * export too, whose body is the payments list filter.\n *\n * `csv` and `pdf` are not JSON, and the client parses a body as JSON unless it\n * is told otherwise, so a missing `responseType` would be a `SyntaxError` on\n * the first comma rather than a wrong type.\n */\nexport function negotiated(\n options: RequestOptions,\n format: ExportFormat,\n presentation?: ExportPresentation,\n): RequestOptions {\n const headers: Record<string, string> = { ...options.headers, Accept: ACCEPT[format] };\n // Only a PDF prints words; a CSV or JSON file is sent none.\n if (format === 'pdf' && presentation !== undefined) {\n headers[PRESENTATION_HEADER] = encodePresentation(presentation);\n }\n return format === 'json'\n ? { ...options, headers }\n : { ...options, headers, responseType: 'blob' };\n}\n\n/**\n * Send one list export in the format `options` asks for — `json` unless told\n * otherwise — with its progress and its record-count check.\n *\n * `base` is the request as the list would send it: its filters in `body` or\n * `query`, and any header of its own. The format's `Accept` and\n * `responseType` are added here.\n */\nexport function runExport<T>(\n request: RequestFn,\n method: string,\n path: string,\n base: RequestOptions,\n options: ExportOptions | undefined,\n): Promise<T> {\n const format = options?.format ?? 'json';\n return downloadExport<T>(\n request,\n { method, path, request: negotiated(base, format, options?.presentation), format },\n options,\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-KLONGJCL.cjs","../src/resources/costRules.ts"],"names":[],"mappings":"AAAA;ACqBO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,IAAA,CAAK,UAAA,EAAyD;AAClE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,aAAA,EAAe,EAAE,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW,EAAE,CAAC,CAAA;AAAA,EAClF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,MAAA,EACA,UAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe;AAAA,MACzC,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,MAAA,EACA,MAAA,EACA,UAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,YAAA,EAAe,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AAC5D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS0F,EAAA;AACxB,IAAA;AAC7B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD5ByE;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-KLONGJCL.cjs","sourcesContent":[null,"import type {\n CreateMerchantCostRuleRequest,\n MerchantCostRuleDeleteResponse,\n MerchantCostRuleResponse,\n UpdateMerchantCostRuleRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Merchant cost rules: what a merchant's own goods and partners' shares cost\n * it, as a percentage, a flat amount or both, merchant-wide or for one shop,\n * over a validity window.\n *\n * A rule is a record, not an instruction. It writes no billing ledger entry and\n * moves no money. Its rate, category and scope cannot be edited; a price change\n * is a new rule with a new window.\n *\n * Every route needs a dashboard session for the merchant: listing needs the\n * merchant account read permission, every change the write permission. A\n * shop-scoped session reaches nothing here.\n */\nexport class CostRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every cost rule of the merchant.\n * `GET /cost-rules`\n *\n * @param merchantId - The merchant account ID.\n */\n async list(merchantId: string): Promise<MerchantCostRuleResponse[]> {\n return this.request('GET', '/cost-rules', { query: { merchant_id: merchantId } });\n }\n\n /**\n * Record a cost rule.\n * `POST /cost-rules`\n *\n * @param params - The rule.\n * @param merchantId - The merchant account ID.\n */\n async create(\n params: CreateMerchantCostRuleRequest,\n merchantId: string,\n ): Promise<MerchantCostRuleResponse> {\n return this.request('POST', '/cost-rules', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Close, deactivate or rename a cost rule.\n * `PUT /cost-rules/{rule_id}`\n *\n * @param ruleId - The rule ID.\n * @param params - What to change.\n * @param merchantId - The merchant account ID.\n */\n async update(\n ruleId: string,\n params: UpdateMerchantCostRuleRequest,\n merchantId: string,\n ): Promise<MerchantCostRuleResponse> {\n return this.request('PUT', `/cost-rules/${encodeURIComponent(ruleId)}`, {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Delete a cost rule.\n * `DELETE /cost-rules/{rule_id}`\n *\n * @param ruleId - The rule ID.\n * @param merchantId - The merchant account ID.\n */\n async delete(ruleId: string, merchantId: string): Promise<MerchantCostRuleDeleteResponse> {\n return this.request('DELETE', `/cost-rules/${encodeURIComponent(ruleId)}`, {\n query: { merchant_id: merchantId },\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/publish-sdk-04990/dist/chunk-KLONGJCL.cjs","../src/resources/costRules.ts"],"names":[],"mappings":"AAAA;ACqBO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,IAAA,CAAK,UAAA,EAAyD;AAClE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,aAAA,EAAe,EAAE,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW,EAAE,CAAC,CAAA;AAAA,EAClF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,MAAA,EACA,UAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe;AAAA,MACzC,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,MAAA,EACA,MAAA,EACA,UAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,YAAA,EAAe,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AAC5D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS0F,EAAA;AACxB,IAAA;AAC7B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD5ByE;AACA;AACA;AACA","file":"/tmp/publish-sdk-04990/dist/chunk-KLONGJCL.cjs","sourcesContent":[null,"import type {\n CreateMerchantCostRuleRequest,\n MerchantCostRuleDeleteResponse,\n MerchantCostRuleResponse,\n UpdateMerchantCostRuleRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Merchant cost rules: what a merchant's own goods and partners' shares cost\n * it, as a percentage, a flat amount or both, merchant-wide or for one shop,\n * over a validity window.\n *\n * A rule is a record, not an instruction. It writes no billing ledger entry and\n * moves no money. Its rate, category and scope cannot be edited; a price change\n * is a new rule with a new window.\n *\n * Every route needs a dashboard session for the merchant: listing needs the\n * merchant account read permission, every change the write permission. A\n * shop-scoped session reaches nothing here.\n */\nexport class CostRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every cost rule of the merchant.\n * `GET /cost-rules`\n *\n * @param merchantId - The merchant account ID.\n */\n async list(merchantId: string): Promise<MerchantCostRuleResponse[]> {\n return this.request('GET', '/cost-rules', { query: { merchant_id: merchantId } });\n }\n\n /**\n * Record a cost rule.\n * `POST /cost-rules`\n *\n * @param params - The rule.\n * @param merchantId - The merchant account ID.\n */\n async create(\n params: CreateMerchantCostRuleRequest,\n merchantId: string,\n ): Promise<MerchantCostRuleResponse> {\n return this.request('POST', '/cost-rules', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Close, deactivate or rename a cost rule.\n * `PUT /cost-rules/{rule_id}`\n *\n * @param ruleId - The rule ID.\n * @param params - What to change.\n * @param merchantId - The merchant account ID.\n */\n async update(\n ruleId: string,\n params: UpdateMerchantCostRuleRequest,\n merchantId: string,\n ): Promise<MerchantCostRuleResponse> {\n return this.request('PUT', `/cost-rules/${encodeURIComponent(ruleId)}`, {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Delete a cost rule.\n * `DELETE /cost-rules/{rule_id}`\n *\n * @param ruleId - The rule ID.\n * @param merchantId - The merchant account ID.\n */\n async delete(ruleId: string, merchantId: string): Promise<MerchantCostRuleDeleteResponse> {\n return this.request('DELETE', `/cost-rules/${encodeURIComponent(ruleId)}`, {\n query: { merchant_id: merchantId },\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-LJ2EG6JK.cjs","../src/resources/paymentMethods.ts"],"names":[],"mappings":"AAAA;ACeO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBlD,MAAM,MAAA,CAAO,MAAA,EAAoE;AAC/E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,QAAA,CAAS,QAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,iBAAA,EAAo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ACoC,IAAA;AACxE,EAAA;AAAA;AAGsF,EAAA;AACd,IAAA;AACxE,EAAA;AAAA;AAG6F,EAAA;AACf,IAAA;AAC9E,EAAA;AAAA;AAGiF,EAAA;AACP,IAAA;AAC1E,EAAA;AAAA;AAG+F,EAAA;AACjB,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAGwF,EAAA;AACZ,IAAA;AAC5E,EAAA;AAAA;AAG2F,EAAA;AACnB,IAAA;AACxE,EAAA;AAAA;AAMoC,EAAA;AAC0C,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADhDgF;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-LJ2EG6JK.cjs","sourcesContent":[null,"import type {\n PaymentMethodCreateRequest,\n PaymentMethodResponse,\n PaymentMethodUpdateRequest,\n PaymentMethodListParams,\n PaymentMethodListResponse,\n PaymentMethodDeleteResponse,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n CustomerPaymentMethodsListParams,\n CustomerPaymentMethodsListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Create and manage saved payment methods for customers. */\nexport class PaymentMethods {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Save a new payment method (card, bank account, wallet, etc.).\n *\n * @param params - Payment method data including type and card/bank details.\n * @returns The saved payment method.\n *\n * @example\n * ```typescript\n * const pm = await delopay.paymentMethods.create({\n * payment_method: 'card',\n * customer_id: 'cus_123',\n * client_secret: 'cs_...',\n * });\n * ```\n */\n async create(params: PaymentMethodCreateRequest): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods', { body: params });\n }\n\n /**\n * Retrieve a saved payment method by its ID.\n *\n * @param methodId - The payment method ID.\n * @returns The payment method.\n */\n async retrieve(methodId: string): Promise<PaymentMethodResponse> {\n return this.request('GET', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * Update an existing payment method (e.g. update card expiry).\n *\n * @param methodId - The payment method ID to update.\n * @param params - Fields to update (card expiry, holder name, etc.).\n * @returns The updated payment method.\n */\n async update(\n methodId: string,\n params: PaymentMethodUpdateRequest,\n ): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/update`, {\n body: params,\n });\n }\n\n /**\n * Delete a saved payment method.\n *\n * @param methodId - The payment method ID to delete.\n * @returns Deletion confirmation.\n */\n async delete(methodId: string): Promise<PaymentMethodDeleteResponse> {\n return this.request('DELETE', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * List the payment methods available for a payment — the discovery endpoint a\n * custom checkout renders its tiles from.\n *\n * Callable with a publishable key plus the payment's `client_secret`, so it\n * runs from the browser. The returned set is already filtered by country,\n * order value and the merchant's availability rules, and each entry carries\n * `display` (name + icon slug) and `amount_limits` (the order values it stays\n * available for) so you do not have to maintain either alongside.\n *\n * This is *not* the customer's saved methods — see {@link listForCustomer}.\n *\n * @param params - `client_secret`, plus optional `country`, `amount` and filters.\n * @returns The methods available for the payment, grouped by payment method.\n *\n * @example\n * ```typescript\n * const { payment_methods } = await delopay.paymentMethods.list({\n * client_secret: 'pay_abc_secret_xyz',\n * country: 'DE',\n * amount: 25000,\n * });\n *\n * for (const group of payment_methods) {\n * for (const method of group.payment_method_types) {\n * // Re-check availability yourself as the cart total changes, instead of\n * // re-listing on every keystroke.\n * const limits = method.amount_limits;\n * const available =\n * !limits ||\n * ((limits.min_amount == null || cartTotal >= limits.min_amount) &&\n * (limits.max_amount == null || cartTotal <= limits.max_amount) &&\n * !limits.excluded_ranges.some(\n * (band) => cartTotal >= band.min_amount && cartTotal <= band.max_amount,\n * ));\n *\n * if (available) render(method.display?.display_name, method.display?.icon_slug);\n * }\n * }\n * ```\n */\n async list(params?: PaymentMethodListParams): Promise<PaymentMethodListResponse> {\n return this.request('GET', '/payment-methods', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * The shop's payment buttons as the hosted checkout draws them: order,\n * labels in the shop's or caller's language, artwork, and what selecting\n * each one does. For rendering payment buttons on your own site without a\n * local table of provider names and icons.\n *\n * With a secret key, name the shop (`profile_id`) and optionally the\n * environment and a buyer context; the answer may be reused for\n * `cache.max_age_seconds` — {@link PresentationCache} does that. With a\n * publishable key, pass the payment's `client_secret` (or use\n * `CheckoutSession.paymentMethodPresentation`); that answer is never reused.\n *\n * A displayed entry is not a promise: the payment is confirmed against the\n * current configuration.\n *\n * `GET /account/payment-methods/presentation`\n *\n * @example\n * ```typescript\n * const buttons = await delopay.paymentMethods.presentation({\n * profile_id: 'pro_123',\n * country: 'DE',\n * currency: 'EUR',\n * amount: 4999,\n * locale: 'de',\n * });\n * for (const entry of buttons.entries) {\n * if (entry.kind === 'heading') renderHeading(entry.label);\n * else renderButton(entry.label, entry.sublabel, presentationIconSrc(entry));\n * }\n * ```\n */\n async presentation(\n params?: PaymentMethodPresentationParams,\n options?: RequestExtras,\n ): Promise<PaymentMethodPresentationResponse> {\n return this.request('GET', '/account/payment-methods/presentation', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * List all saved payment methods for a customer, optionally filtered.\n *\n * @param customerId - The customer ID.\n * @param params - Optional filters: `client_secret`, `accepted_countries`, `accepted_currencies`,\n * `amount`, `recurring_enabled`, `installment_payment_enabled`, `limit`, `card_networks`.\n * @returns Customer's saved payment methods.\n *\n * @example\n * ```typescript\n * const { customer_payment_methods } = await delopay.paymentMethods.listForCustomer(\n * 'cus_123',\n * { accepted_currencies: ['EUR'], amount: 5000 },\n * );\n * ```\n */\n async listForCustomer(\n customerId: string,\n params?: CustomerPaymentMethodsListParams,\n ): Promise<CustomerPaymentMethodsListResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/payment-methods`, {\n query: params as Record<\n string,\n string | number | boolean | (string | number | boolean)[] | null | undefined\n >,\n });\n }\n\n /**\n * Set a payment method as the default for a customer.\n *\n * @param customerId - The customer ID.\n * @param methodId - The payment method ID to set as default.\n * @returns The updated payment method.\n */\n async setDefault(customerId: string, methodId: string): Promise<PaymentMethodResponse> {\n return this.request(\n 'POST',\n `/customers/${encodeURIComponent(customerId)}/payment-methods/${encodeURIComponent(methodId)}/default`,\n );\n }\n\n // --- Advanced operations (Task 3.3) ---\n\n /** Migrate a payment method. `POST /payment-methods/migrate` */\n async migrate(params: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods/migrate', { body: params });\n }\n\n /** Batch migrate payment methods. `POST /payment-methods/migrate-batch` */\n async migrateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/migrate-batch', { body: params });\n }\n\n /** Batch update payment methods. `POST /payment-methods/update-batch` */\n async updateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/update-batch', { body: params });\n }\n\n /** Batch retrieve payment methods. `GET /payment-methods/batch` */\n async batchRetrieve(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentMethodResponse[]> {\n return this.request('GET', '/payment-methods/batch', { query: params });\n }\n\n /** Tokenize a card. `POST /payment-methods/tokenize-card` */\n async tokenizeCard(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card', { body: params });\n }\n\n /** Batch tokenize cards. `POST /payment-methods/tokenize-card-batch` */\n async tokenizeCardBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card-batch', { body: params });\n }\n\n /** Initiate payment method collect link flow. `POST /payment-methods/collect` */\n async collect(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/collect', { body: params });\n }\n\n /** Save a payment method. `POST /payment-methods/{methodId}/save` */\n async save(methodId: string, params?: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/save`, {\n body: params,\n });\n }\n\n /** Create payment method auth link token. `POST /payment-methods/auth/link` */\n async createAuthLink(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/link', { body: params });\n }\n\n /** Exchange payment method auth token. `POST /payment-methods/auth/exchange` */\n async exchangeAuthToken(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/exchange', { body: params });\n }\n\n /** Tokenize card using existing PM. `POST /payment-methods/{methodId}/tokenize-card` */\n async tokenizeCardForMethod(\n methodId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/tokenize-card`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/publish-sdk-04990/dist/chunk-LJ2EG6JK.cjs","../src/resources/paymentMethods.ts"],"names":[],"mappings":"AAAA;ACeO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBlD,MAAM,MAAA,CAAO,MAAA,EAAoE;AAC/E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,QAAA,CAAS,QAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYkC,EAAA;AAC4C,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQqE,EAA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;AACH,EAAA;AAAA;AAGwF,EAAA;AACZ,IAAA;AAC5E,EAAA;AAAA;AAG2F,EAAA;AACnB,IAAA;AACxE,EAAA;AAAA;AAMoC,EAAA;AAC0C,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADhDgF;AACA;AACA;AACA","file":"/tmp/publish-sdk-04990/dist/chunk-LJ2EG6JK.cjs","sourcesContent":[null,"import type {\n PaymentMethodCreateRequest,\n PaymentMethodResponse,\n PaymentMethodUpdateRequest,\n PaymentMethodListParams,\n PaymentMethodListResponse,\n PaymentMethodDeleteResponse,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n CustomerPaymentMethodsListParams,\n CustomerPaymentMethodsListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Create and manage saved payment methods for customers. */\nexport class PaymentMethods {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Save a new payment method (card, bank account, wallet, etc.).\n *\n * @param params - Payment method data including type and card/bank details.\n * @returns The saved payment method.\n *\n * @example\n * ```typescript\n * const pm = await delopay.paymentMethods.create({\n * payment_method: 'card',\n * customer_id: 'cus_123',\n * client_secret: 'cs_...',\n * });\n * ```\n */\n async create(params: PaymentMethodCreateRequest): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods', { body: params });\n }\n\n /**\n * Retrieve a saved payment method by its ID.\n *\n * @param methodId - The payment method ID.\n * @returns The payment method.\n */\n async retrieve(methodId: string): Promise<PaymentMethodResponse> {\n return this.request('GET', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * Update an existing payment method (e.g. update card expiry).\n *\n * @param methodId - The payment method ID to update.\n * @param params - Fields to update (card expiry, holder name, etc.).\n * @returns The updated payment method.\n */\n async update(\n methodId: string,\n params: PaymentMethodUpdateRequest,\n ): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/update`, {\n body: params,\n });\n }\n\n /**\n * Delete a saved payment method.\n *\n * @param methodId - The payment method ID to delete.\n * @returns Deletion confirmation.\n */\n async delete(methodId: string): Promise<PaymentMethodDeleteResponse> {\n return this.request('DELETE', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * List the payment methods available for a payment — the discovery endpoint a\n * custom checkout renders its tiles from.\n *\n * Callable with a publishable key plus the payment's `client_secret`, so it\n * runs from the browser. The returned set is already filtered by country,\n * order value and the merchant's availability rules, and each entry carries\n * `display` (name + icon slug) and `amount_limits` (the order values it stays\n * available for) so you do not have to maintain either alongside.\n *\n * This is *not* the customer's saved methods — see {@link listForCustomer}.\n *\n * @param params - `client_secret`, plus optional `country`, `amount` and filters.\n * @returns The methods available for the payment, grouped by payment method.\n *\n * @example\n * ```typescript\n * const { payment_methods } = await delopay.paymentMethods.list({\n * client_secret: 'pay_abc_secret_xyz',\n * country: 'DE',\n * amount: 25000,\n * });\n *\n * for (const group of payment_methods) {\n * for (const method of group.payment_method_types) {\n * // Re-check availability yourself as the cart total changes, instead of\n * // re-listing on every keystroke.\n * const limits = method.amount_limits;\n * const available =\n * !limits ||\n * ((limits.min_amount == null || cartTotal >= limits.min_amount) &&\n * (limits.max_amount == null || cartTotal <= limits.max_amount) &&\n * !limits.excluded_ranges.some(\n * (band) => cartTotal >= band.min_amount && cartTotal <= band.max_amount,\n * ));\n *\n * if (available) render(method.display?.display_name, method.display?.icon_slug);\n * }\n * }\n * ```\n */\n async list(params?: PaymentMethodListParams): Promise<PaymentMethodListResponse> {\n return this.request('GET', '/payment-methods', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * The shop's payment buttons as the hosted checkout draws them: order,\n * labels in the shop's or caller's language, artwork, and what selecting\n * each one does. For rendering payment buttons on your own site without a\n * local table of provider names and icons.\n *\n * With a secret key, name the shop (`profile_id`) and optionally the\n * environment and a buyer context; the answer may be reused for\n * `cache.max_age_seconds` — {@link PresentationCache} does that. With a\n * publishable key, pass the payment's `client_secret` (or use\n * `CheckoutSession.paymentMethodPresentation`); that answer is never reused.\n *\n * A displayed entry is not a promise: the payment is confirmed against the\n * current configuration.\n *\n * `GET /account/payment-methods/presentation`\n *\n * @example\n * ```typescript\n * const buttons = await delopay.paymentMethods.presentation({\n * profile_id: 'pro_123',\n * country: 'DE',\n * currency: 'EUR',\n * amount: 4999,\n * locale: 'de',\n * });\n * for (const entry of buttons.entries) {\n * if (entry.kind === 'heading') renderHeading(entry.label);\n * else renderButton(entry.label, entry.sublabel, presentationIconSrc(entry));\n * }\n * ```\n */\n async presentation(\n params?: PaymentMethodPresentationParams,\n options?: RequestExtras,\n ): Promise<PaymentMethodPresentationResponse> {\n return this.request('GET', '/account/payment-methods/presentation', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * List all saved payment methods for a customer, optionally filtered.\n *\n * @param customerId - The customer ID.\n * @param params - Optional filters: `client_secret`, `accepted_countries`, `accepted_currencies`,\n * `amount`, `recurring_enabled`, `installment_payment_enabled`, `limit`, `card_networks`.\n * @returns Customer's saved payment methods.\n *\n * @example\n * ```typescript\n * const { customer_payment_methods } = await delopay.paymentMethods.listForCustomer(\n * 'cus_123',\n * { accepted_currencies: ['EUR'], amount: 5000 },\n * );\n * ```\n */\n async listForCustomer(\n customerId: string,\n params?: CustomerPaymentMethodsListParams,\n ): Promise<CustomerPaymentMethodsListResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/payment-methods`, {\n query: params as Record<\n string,\n string | number | boolean | (string | number | boolean)[] | null | undefined\n >,\n });\n }\n\n /**\n * Set a payment method as the default for a customer.\n *\n * @param customerId - The customer ID.\n * @param methodId - The payment method ID to set as default.\n * @returns The updated payment method.\n */\n async setDefault(customerId: string, methodId: string): Promise<PaymentMethodResponse> {\n return this.request(\n 'POST',\n `/customers/${encodeURIComponent(customerId)}/payment-methods/${encodeURIComponent(methodId)}/default`,\n );\n }\n\n // --- Advanced operations (Task 3.3) ---\n\n /** Migrate a payment method. `POST /payment-methods/migrate` */\n async migrate(params: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods/migrate', { body: params });\n }\n\n /** Batch migrate payment methods. `POST /payment-methods/migrate-batch` */\n async migrateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/migrate-batch', { body: params });\n }\n\n /** Batch update payment methods. `POST /payment-methods/update-batch` */\n async updateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/update-batch', { body: params });\n }\n\n /** Batch retrieve payment methods. `GET /payment-methods/batch` */\n async batchRetrieve(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentMethodResponse[]> {\n return this.request('GET', '/payment-methods/batch', { query: params });\n }\n\n /** Tokenize a card. `POST /payment-methods/tokenize-card` */\n async tokenizeCard(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card', { body: params });\n }\n\n /** Batch tokenize cards. `POST /payment-methods/tokenize-card-batch` */\n async tokenizeCardBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card-batch', { body: params });\n }\n\n /** Initiate payment method collect link flow. `POST /payment-methods/collect` */\n async collect(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/collect', { body: params });\n }\n\n /** Save a payment method. `POST /payment-methods/{methodId}/save` */\n async save(methodId: string, params?: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/save`, {\n body: params,\n });\n }\n\n /** Create payment method auth link token. `POST /payment-methods/auth/link` */\n async createAuthLink(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/link', { body: params });\n }\n\n /** Exchange payment method auth token. `POST /payment-methods/auth/exchange` */\n async exchangeAuthToken(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/exchange', { body: params });\n }\n\n /** Tokenize card using existing PM. `POST /payment-methods/{methodId}/tokenize-card` */\n async tokenizeCardForMethod(\n methodId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/tokenize-card`, {\n body: params,\n });\n }\n}\n"]}