@delopay/sdk 0.481.0 → 0.482.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 (340) 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-U72OIM7A.cjs → chunk-2OVTWQ3B.cjs} +7 -2
  10. package/dist/chunk-2OVTWQ3B.cjs.map +1 -0
  11. package/dist/{chunk-TSAQN7I5.js → chunk-2W55GSRP.js} +2 -2
  12. package/dist/chunk-2W55GSRP.js.map +1 -0
  13. package/dist/chunk-34PC72O7.cjs.map +1 -1
  14. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  15. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  16. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  17. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  18. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  19. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  20. package/dist/chunk-5CITBN33.cjs.map +1 -1
  21. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  22. package/dist/{chunk-LZUHCGJ3.js → chunk-5LSXCHJU.js} +5 -2
  23. package/dist/chunk-5LSXCHJU.js.map +1 -0
  24. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  25. package/dist/chunk-5QS67SBO.cjs.map +1 -1
  26. package/dist/chunk-6BFZS4YP.cjs.map +1 -1
  27. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  28. package/dist/{chunk-6MXPGE7O.cjs → chunk-6EOKEO6F.cjs} +9 -9
  29. package/dist/chunk-6EOKEO6F.cjs.map +1 -0
  30. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  31. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  32. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  33. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  34. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  35. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  36. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  37. package/dist/chunk-7NKJD5ST.cjs.map +1 -1
  38. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  39. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  40. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  41. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  42. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  43. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  44. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  45. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  46. package/dist/{chunk-FDHLDKNY.cjs → chunk-BT3UAUEV.cjs} +2 -2
  47. package/dist/chunk-BT3UAUEV.cjs.map +1 -0
  48. package/dist/chunk-CAMALM35.cjs.map +1 -1
  49. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  50. package/dist/{chunk-EK7RLJZB.js → chunk-CQ5WZMCN.js} +7 -2
  51. package/dist/chunk-CQ5WZMCN.js.map +1 -0
  52. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  53. package/dist/chunk-CYH4HZ4Y.cjs.map +1 -1
  54. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  55. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  56. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  57. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  58. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  59. package/dist/{chunk-OPOSNWK4.cjs → chunk-EYHSXJMJ.cjs} +4 -2
  60. package/dist/chunk-EYHSXJMJ.cjs.map +1 -0
  61. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  62. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  63. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  64. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  65. package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
  66. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  67. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  68. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  69. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  70. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  71. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  72. package/dist/chunk-HLHML5ES.cjs.map +1 -1
  73. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  74. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  75. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  76. package/dist/{chunk-ABDDRKOT.js → chunk-HYQXNRST.js} +3 -2
  77. package/dist/chunk-HYQXNRST.js.map +1 -0
  78. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  79. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  80. package/dist/chunk-IGHAJNC6.cjs.map +1 -1
  81. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  82. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  83. package/dist/{chunk-NH2TUO7X.js → chunk-J3NCUUG7.js} +5 -5
  84. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  85. package/dist/{chunk-E2TF7JDB.cjs → chunk-J5RPSRBQ.cjs} +9 -8
  86. package/dist/chunk-J5RPSRBQ.cjs.map +1 -0
  87. package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
  88. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  89. package/dist/{chunk-CPGGSHNB.js → chunk-K5WRCYXA.js} +4 -2
  90. package/dist/chunk-K5WRCYXA.js.map +1 -0
  91. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  92. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  93. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  94. package/dist/{chunk-EHRQSUIK.js → chunk-KRP467VJ.js} +2 -2
  95. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  96. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  97. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  98. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  99. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  100. package/dist/chunk-MCNDMK7F.cjs.map +1 -1
  101. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  102. package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
  103. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  104. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  105. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  106. package/dist/chunk-OAEKP665.cjs.map +1 -1
  107. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  108. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  109. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  110. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  111. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  112. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  113. package/dist/chunk-PYNHK6AP.cjs.map +1 -1
  114. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  115. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  116. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  117. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  118. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  119. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  120. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  121. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  122. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  123. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  124. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  125. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  126. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  127. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  128. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  129. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  130. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  131. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  132. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  133. package/dist/chunk-VZ3BSIVU.cjs.map +1 -1
  134. package/dist/chunk-W457XUA6.cjs.map +1 -1
  135. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  136. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  137. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  138. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  139. package/dist/{chunk-2MSCXFWD.cjs → chunk-Y6LKUYGJ.cjs} +3 -3
  140. package/dist/chunk-Y6LKUYGJ.cjs.map +1 -0
  141. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  142. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  143. package/dist/{chunk-OWP7XBY2.cjs → chunk-YW4DVKNT.cjs} +5 -2
  144. package/dist/chunk-YW4DVKNT.cjs.map +1 -0
  145. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  146. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  147. package/dist/client.cjs +2 -2
  148. package/dist/client.cjs.map +1 -1
  149. package/dist/client.js +1 -1
  150. package/dist/core.cjs.map +1 -1
  151. package/dist/currencies.cjs.map +1 -1
  152. package/dist/enigmaCardForm.cjs.map +1 -1
  153. package/dist/error.cjs.map +1 -1
  154. package/dist/eventStream.cjs.map +1 -1
  155. package/dist/exportDownload.cjs.map +1 -1
  156. package/dist/feeProgram.cjs.map +1 -1
  157. package/dist/index.cjs +7 -7
  158. package/dist/index.cjs.map +1 -1
  159. package/dist/index.js +6 -6
  160. package/dist/internal/resources/admin.cjs.map +1 -1
  161. package/dist/internal/resources/admin.d.cts +1 -1
  162. package/dist/internal/resources/admin.d.ts +1 -1
  163. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  164. package/dist/internal/resources/adminBranding.d.cts +1 -1
  165. package/dist/internal/resources/adminBranding.d.ts +1 -1
  166. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  167. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
  168. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
  169. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  170. package/dist/internal/resources/adminFeePlans.d.cts +1 -1
  171. package/dist/internal/resources/adminFeePlans.d.ts +1 -1
  172. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  173. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  174. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  175. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  176. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  177. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  178. package/dist/internal/resources/adminLive.cjs.map +1 -1
  179. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  180. package/dist/internal/resources/adminNotices.d.cts +1 -1
  181. package/dist/internal/resources/adminNotices.d.ts +1 -1
  182. package/dist/internal/resources/adminPortal.cjs +2 -2
  183. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  184. package/dist/internal/resources/adminPortal.d.cts +1 -1
  185. package/dist/internal/resources/adminPortal.d.ts +1 -1
  186. package/dist/internal/resources/adminPortal.js +1 -1
  187. package/dist/internal/resources/adminPricing.cjs.map +1 -1
  188. package/dist/internal/resources/adminPricing.d.cts +1 -1
  189. package/dist/internal/resources/adminPricing.d.ts +1 -1
  190. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  191. package/dist/internal/resources/adminSupport.d.cts +1 -1
  192. package/dist/internal/resources/adminSupport.d.ts +1 -1
  193. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  194. package/dist/internal/resources/auditLogs.d.cts +1 -1
  195. package/dist/internal/resources/auditLogs.d.ts +1 -1
  196. package/dist/internal/resources/cache.cjs.map +1 -1
  197. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  198. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  199. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  200. package/dist/internal/resources/configs.cjs.map +1 -1
  201. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  202. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  203. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  204. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  205. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  206. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  207. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  208. package/dist/internal/resources/diagnostic.d.cts +1 -1
  209. package/dist/internal/resources/diagnostic.d.ts +1 -1
  210. package/dist/internal/resources/gsm.cjs.map +1 -1
  211. package/dist/internal/resources/gsm.d.cts +1 -1
  212. package/dist/internal/resources/gsm.d.ts +1 -1
  213. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  214. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  215. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  216. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  217. package/dist/internal/resources/platformBilling.d.cts +1 -1
  218. package/dist/internal/resources/platformBilling.d.ts +1 -1
  219. package/dist/internal/resources/platformFees.cjs.map +1 -1
  220. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  221. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  222. package/dist/internal/resources/platformSettings.d.cts +1 -1
  223. package/dist/internal/resources/platformSettings.d.ts +1 -1
  224. package/dist/internal.cjs +10 -10
  225. package/dist/internal.cjs.map +1 -1
  226. package/dist/internal.d.cts +1 -1
  227. package/dist/internal.d.ts +1 -1
  228. package/dist/internal.js +7 -7
  229. package/dist/listQuery.cjs.map +1 -1
  230. package/dist/panes.cjs.map +1 -1
  231. package/dist/paymentPresentation.cjs.map +1 -1
  232. package/dist/recordCounter.cjs.map +1 -1
  233. package/dist/resources/aiTools.cjs.map +1 -1
  234. package/dist/resources/analytics.cjs.map +1 -1
  235. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  236. package/dist/resources/apiKeys.cjs.map +1 -1
  237. package/dist/resources/audit.cjs.map +1 -1
  238. package/dist/resources/authentication.cjs.map +1 -1
  239. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  240. package/dist/resources/billing.cjs.map +1 -1
  241. package/dist/resources/buyerAccount.cjs.map +1 -1
  242. package/dist/resources/buyerBlocklist.cjs +2 -2
  243. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  244. package/dist/resources/buyerBlocklist.js +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 +2 -2
  258. package/dist/resources/customers.cjs.map +1 -1
  259. package/dist/resources/customers.js +1 -1
  260. package/dist/resources/deploymentBranding.cjs.map +1 -1
  261. package/dist/resources/disputes.cjs +2 -2
  262. package/dist/resources/disputes.cjs.map +1 -1
  263. package/dist/resources/disputes.js +1 -1
  264. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  265. package/dist/resources/events.cjs.map +1 -1
  266. package/dist/resources/export.cjs.map +1 -1
  267. package/dist/resources/externalRecords.cjs.map +1 -1
  268. package/dist/resources/featureMatrix.cjs.map +1 -1
  269. package/dist/resources/fees.cjs.map +1 -1
  270. package/dist/resources/files.cjs.map +1 -1
  271. package/dist/resources/forex.cjs.map +1 -1
  272. package/dist/resources/identityVerifications.cjs.map +1 -1
  273. package/dist/resources/industries.cjs.map +1 -1
  274. package/dist/resources/invoiceSettings.cjs.map +1 -1
  275. package/dist/resources/invoices.cjs.map +1 -1
  276. package/dist/resources/live.cjs.map +1 -1
  277. package/dist/resources/mandates.cjs.map +1 -1
  278. package/dist/resources/merchantAccounts.cjs.map +1 -1
  279. package/dist/resources/messageTemplates.cjs.map +1 -1
  280. package/dist/resources/notices.cjs.map +1 -1
  281. package/dist/resources/operationLimits.cjs.map +1 -1
  282. package/dist/resources/paymentLinks.cjs.map +1 -1
  283. package/dist/resources/paymentMethods.cjs.map +1 -1
  284. package/dist/resources/payments.cjs.map +1 -1
  285. package/dist/resources/payoutDestinations.cjs.map +1 -1
  286. package/dist/resources/payouts.cjs.map +1 -1
  287. package/dist/resources/paypalDisputes.cjs.map +1 -1
  288. package/dist/resources/persons.cjs +2 -2
  289. package/dist/resources/persons.cjs.map +1 -1
  290. package/dist/resources/persons.js +1 -1
  291. package/dist/resources/poll.cjs.map +1 -1
  292. package/dist/resources/processorCosts.cjs.map +1 -1
  293. package/dist/resources/processorImports.cjs.map +1 -1
  294. package/dist/resources/products.cjs.map +1 -1
  295. package/dist/resources/profileAcquirers.cjs.map +1 -1
  296. package/dist/resources/profiles.cjs.map +1 -1
  297. package/dist/resources/projects.cjs.map +1 -1
  298. package/dist/resources/refunds.cjs.map +1 -1
  299. package/dist/resources/regions.cjs.map +1 -1
  300. package/dist/resources/relay.cjs.map +1 -1
  301. package/dist/resources/risk.cjs.map +1 -1
  302. package/dist/resources/routing.cjs.map +1 -1
  303. package/dist/resources/search.cjs.map +1 -1
  304. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  305. package/dist/resources/settings.cjs.map +1 -1
  306. package/dist/resources/settlement.cjs.map +1 -1
  307. package/dist/resources/shareLinks.cjs.map +1 -1
  308. package/dist/resources/shopLabels.cjs.map +1 -1
  309. package/dist/resources/shopify.cjs.map +1 -1
  310. package/dist/resources/shops.cjs.map +1 -1
  311. package/dist/resources/stripeConnect.cjs.map +1 -1
  312. package/dist/resources/subscriptions.cjs.map +1 -1
  313. package/dist/resources/support.cjs.map +1 -1
  314. package/dist/resources/threeDsRules.cjs.map +1 -1
  315. package/dist/resources/users.cjs.map +1 -1
  316. package/dist/resources/vatRates.cjs.map +1 -1
  317. package/dist/resources/verification.cjs.map +1 -1
  318. package/dist/resources/webhooks.cjs.map +1 -1
  319. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  320. package/dist/trustedOrigins.cjs.map +1 -1
  321. package/dist/{types-yDOfhGt3.d.cts → types-JtFGu9hw.d.cts} +8 -2
  322. package/dist/{types-fgHam_o6.d.ts → types-T_iCK6Xn.d.ts} +8 -2
  323. package/dist/types.cjs.map +1 -1
  324. package/dist/types.d.cts +44 -0
  325. package/dist/types.d.ts +44 -0
  326. package/package.json +1 -1
  327. package/dist/chunk-2MSCXFWD.cjs.map +0 -1
  328. package/dist/chunk-6MXPGE7O.cjs.map +0 -1
  329. package/dist/chunk-ABDDRKOT.js.map +0 -1
  330. package/dist/chunk-CPGGSHNB.js.map +0 -1
  331. package/dist/chunk-E2TF7JDB.cjs.map +0 -1
  332. package/dist/chunk-EK7RLJZB.js.map +0 -1
  333. package/dist/chunk-FDHLDKNY.cjs.map +0 -1
  334. package/dist/chunk-LZUHCGJ3.js.map +0 -1
  335. package/dist/chunk-OPOSNWK4.cjs.map +0 -1
  336. package/dist/chunk-OWP7XBY2.cjs.map +0 -1
  337. package/dist/chunk-TSAQN7I5.js.map +0 -1
  338. package/dist/chunk-U72OIM7A.cjs.map +0 -1
  339. /package/dist/{chunk-NH2TUO7X.js.map → chunk-J3NCUUG7.js.map} +0 -0
  340. /package/dist/{chunk-EHRQSUIK.js.map → chunk-KRP467VJ.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0482/dist/chunk-Y6LKUYGJ.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,OAAO,CAAC,CAAA;AACpB,EAAA,MAAM,IAAA,EAA8B,CAAC,CAAA;AACrC,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,KAAK,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,MAAM,MAAA,EAAQ,GAAA,CAAI,WAAA,CAAY,CAAA;AAC9B,IAAA,GAAA,CAAI,MAAA,IAAU,UAAA,GAAa,MAAA,IAAU,eAAA,EAAiB,QAAA;AACtD,IAAA,GAAA,CAAI,GAAG,EAAA,EAAI,KAAA;AAAA,EACb;AACA,EAAA,OAAO,GAAA;AACT;AAGA,SAAS,cAAA,CAAe,MAAA,EAAwE;AAC9F,EAAA,MAAM,KAAA,kBAAO,MAAA,2BAAQ,YAAA;AACrB,EAAA,OAAO;AAAA,IACL,MAAA,kBAAQ,MAAA,6BAAQ,QAAA;AAAA,IAChB,YAAA,kBAAc,IAAA,6BAAM,SAAA;AAAA,IACpB,SAAA,kBAAW,IAAA,6BAAM,MAAA;AAAA,IACjB,WAAA,kBAAa,IAAA,6BAAM,QAAA;AAAA,IACnB,WAAA,kBAAa,IAAA,6BAAM,QAAA;AAAA,IACnB,WAAA,kBAAa,IAAA,6BAAM,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A;AAAA;AAAA;AAAA;AAwB8C,EAAA;AACzB,IAAA;AACjB,MAAA;AAC+C,MAAA;AAC/C,MAAA;AAC+D,QAAA;AAC1D,QAAA;AACqC,QAAA;AAC1C,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAasF,EAAA;AACjE,IAAA;AACjB,MAAA;AAC+C,MAAA;AAC/C,MAAA;AACoD,QAAA;AAC/C,QAAA;AACqC,QAAA;AAC1C,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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/w2-sdk-publish-0482/dist/chunk-Y6LKUYGJ.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. Send the buyer to the\n * returned `verification_url`; the provider sends them 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/sdkpub/delopay-typescript-sdk/dist/chunk-Y7LSSRNJ.cjs","../src/internal/resources/adminCheckoutDomains.ts"],"names":[],"mappings":"AAAA;AC0CA,SAAS,WAAA,CACP,KAAA,EACyC;AACzC,EAAA,MAAM,EAAE,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAM,EAAA,EAAI,MAAM,EAAA,mBAAI,KAAA,UAAS,CAAC,GAAA;AACvD,EAAA,OAAO,EAAE,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAM,EAAA,EAAI,MAAM,CAAA;AAC5C;AAWO,IAAM,qBAAA,EAAN,MAA2B;AAAA,EAChC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlD,MAAM,QAAA,CAAA,EAA6C;AACjD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gCAAgC,CAAA;AAA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A;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAY,MAAA;AACV,MAAA;AAC8G,IAAA;AAChH,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,MAAA;AAC1C,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAkE,EAAA;AACpE;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAAoF,EAAA;AAExF;ADjHA;AACA;AACA;AACA","file":"/tmp/sdkpub/delopay-typescript-sdk/dist/chunk-Y7LSSRNJ.cjs","sourcesContent":[null,"import type {\n AdminMerchantCheckoutDomains,\n ApplePayVerificationFileCreateRequest,\n ApplePayVerificationFileResponse,\n ApplePayVerificationFileUpdateRequest,\n CheckoutDomainCreateRequest,\n CheckoutDomainResponse,\n CheckoutDomainsEntitlementSaved,\n CheckoutDomainsEntitlementUpdate,\n CheckoutDomainsOverview,\n CheckoutHostAvailability,\n CheckoutHostAvailabilityQuery,\n CheckoutHostCheckList,\n CheckoutHostChecksQuery,\n CheckoutHostCreateRequest,\n CheckoutHostHealthList,\n CheckoutHostHealthQuery,\n CheckoutHostPrimaryImpact,\n CheckoutHostRegistrationCounts,\n CheckoutHostRenameImpact,\n CheckoutHostRenameRequest,\n CheckoutHostRenameResponse,\n CheckoutDomainAdminAlerts,\n CheckoutDomainsEntitlementPreview,\n MerchantHostSuspendRequest,\n MerchantHostsList,\n MerchantHostsQuery,\n PlatformCloudflare,\n PlatformCloudflareConnect,\n} from '../types';\nimport type {\n CheckoutHostHealthDetail,\n CloudflareOAuthCallback,\n CloudflareOAuthStart,\n CheckoutHostPauseRequest,\n CheckoutHostPreview,\n CheckoutHostResponse,\n CheckoutHostUpdateRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/** The filters of the checks log, taken key by key so nothing else reaches the query. */\nfunction checksQuery(\n query: Omit<CheckoutHostChecksQuery, 'format'> | undefined,\n): Omit<CheckoutHostChecksQuery, 'format'> {\n const { host_id, result, from, to, limit } = query ?? {};\n return { host_id, result, from, to, limit };\n}\n\n/**\n * Checkout domains for DeloPay staff: the platform's checkout hosts and base\n * domains, the Apple Pay verification file library, host health and the raw\n * check log, the platform Cloudflare connection, and each merchant's\n * checkout-domain entitlement and addresses.\n *\n * Reads need a staff role; every write needs account management and is\n * recorded in the audit log.\n */\nexport class AdminCheckoutDomains {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every platform domain and host, the Apple Pay file library, the config fallback and how pool hostnames are spelled.\n * `GET /admin-portal/checkout-domains`\n */\n async overview(): Promise<CheckoutDomainsOverview> {\n return this.request('GET', '/admin-portal/checkout-domains');\n }\n\n /**\n * The raw checks of the last 7 days, filtered by host, result and time.\n * `GET /admin-portal/checkout-domains/checks`\n */\n async listChecks(\n query?: Omit<CheckoutHostChecksQuery, 'format'>,\n ): Promise<CheckoutHostCheckList> {\n // Always JSON here, whatever a caller's object carries at runtime.\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'json' },\n });\n }\n\n /**\n * The same checks as a CSV file (`format=csv`), for a download.\n * `GET /admin-portal/checkout-domains/checks?format=csv`\n */\n async exportChecks(query?: Omit<CheckoutHostChecksQuery, 'format'>): Promise<Blob> {\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'csv' },\n responseType: 'blob',\n });\n }\n\n /**\n * Add a checkout domain\n * `POST /admin-portal/checkout-domains/domains`\n */\n async createDomain(params: CheckoutDomainCreateRequest): Promise<CheckoutDomainResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/domains', { body: params });\n }\n\n /**\n * Remove a checkout domain\n * `DELETE /admin-portal/checkout-domains/domains/{domain_id}`\n */\n async deleteDomain(domainId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/domains/${encodeURIComponent(domainId)}`,\n );\n }\n\n /**\n * Upload an Apple Pay verification file. The stored file is read back\n * before it is saved; when that fails nothing is saved, and the refusal\n * (`code` `IR_16`, `data.reason`) is `file_unreadable` (the file storage\n * writes but does not read: check its configuration) or `file_corrupted`\n * (the stored bytes differ from the upload: try again).\n * `POST /admin-portal/checkout-domains/files`\n */\n async uploadFile(\n params: ApplePayVerificationFileCreateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/files', { body: params });\n }\n\n /**\n * Change an Apple Pay verification file\n * `PATCH /admin-portal/checkout-domains/files/{file_id}`\n */\n async updateFile(\n fileId: string,\n params: ApplePayVerificationFileUpdateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove an Apple Pay verification file\n * `DELETE /admin-portal/checkout-domains/files/{file_id}`\n */\n async deleteFile(fileId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n );\n }\n\n /**\n * The bytes of an Apple Pay verification file, presets included.\n * `GET /admin-portal/checkout-domains/files/{file_id}/content`\n */\n async downloadFile(fileId: string): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}/content`,\n { responseType: 'blob' },\n );\n }\n\n /**\n * Every host with its health, uptime and payments, with counts per summary filter; sorted and searched on the server.\n * `GET /admin-portal/checkout-domains/health`\n */\n async health(query?: CheckoutHostHealthQuery): Promise<CheckoutHostHealthList> {\n return this.request('GET', '/admin-portal/checkout-domains/health', { query: { ...query } });\n }\n\n /**\n * Add a checkout host\n * `POST /admin-portal/checkout-domains/hosts`\n */\n async createHost(params: CheckoutHostCreateRequest): Promise<CheckoutHostResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/hosts', { body: params });\n }\n\n /**\n * Whether a platform host name is free\n * `GET /admin-portal/checkout-domains/hosts/availability`\n */\n async hostAvailability(query: CheckoutHostAvailabilityQuery): Promise<CheckoutHostAvailability> {\n return this.request('GET', '/admin-portal/checkout-domains/hosts/availability', {\n query: { ...query },\n });\n }\n\n /**\n * Change a checkout host\n * `PATCH /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async updateHost(\n hostId: string,\n params: CheckoutHostUpdateRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove a host, in two steps for every kind: it must stop taking traffic\n * first. Refusals (`code` `IR_16`, `data.reason`): `primary_host`,\n * `last_default_host`, `configured_host` (the configured checkout address),\n * `host_takes_traffic` (pause or rename it first), `host_draining`\n * (`retry_after_seconds`), `host_in_use` (`payment_ids`) and `host_changed`.\n * `DELETE /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async deleteHost(hostId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n );\n }\n\n /**\n * Check a checkout host now\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/check`\n */\n async checkHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/check`,\n );\n }\n\n /**\n * One host's health page: uptime, 90 days, incidents, the checks where the result changed, and usage.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/health`\n */\n async hostHealth(hostId: string): Promise<CheckoutHostHealthDetail> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/health`,\n );\n }\n\n /**\n * Pause a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/pause`\n */\n async pauseHost(hostId: string, params: CheckoutHostPauseRequest): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/pause`,\n { body: params },\n );\n }\n\n /**\n * Resume a paused checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/resume`\n */\n async resumeHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/resume`,\n );\n }\n\n /**\n * A signed preview link of a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/preview`\n */\n async previewHost(hostId: string): Promise<CheckoutHostPreview> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/preview`,\n );\n }\n\n /**\n * Make a ready default host the primary one: new links use it within about 30 seconds. Old hosts keep serving.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/primary`\n */\n async makePrimary(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary`,\n );\n }\n\n /**\n * What making a host primary would change for Apple Pay registrations.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/primary-impact`\n */\n async primaryImpact(hostId: string): Promise<CheckoutHostPrimaryImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary-impact`,\n );\n }\n\n /**\n * A checkout host's Apple Pay registrations, counted\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/registrations`\n */\n async hostRegistrations(hostId: string): Promise<CheckoutHostRegistrationCounts> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/registrations`,\n );\n }\n\n /**\n * Rename a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/rename`\n */\n async renameHost(\n hostId: string,\n params: CheckoutHostRenameRequest,\n ): Promise<CheckoutHostRenameResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename`,\n { body: params },\n );\n }\n\n /**\n * What renaming a host would cost: the processors whose Apple Pay registration of the hostname is lost, and the merchants affected.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/rename-impact`\n */\n async renameImpact(hostId: string): Promise<CheckoutHostRenameImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename-impact`,\n );\n }\n\n /**\n * Create the host's proxied DNS record through the platform Cloudflare connection.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/dns`\n */\n async createHostDns(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/dns`,\n );\n }\n\n /**\n * the platform Cloudflare connection\n * `GET /admin-portal/checkout-domains/cloudflare`\n */\n async cloudflare(): Promise<PlatformCloudflare> {\n return this.request('GET', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * connect or replace the platform Cloudflare token\n * `PUT /admin-portal/checkout-domains/cloudflare`\n */\n async connectCloudflare(params: PlatformCloudflareConnect): Promise<PlatformCloudflare> {\n return this.request('PUT', '/admin-portal/checkout-domains/cloudflare', { body: params });\n }\n\n /**\n * disconnect the platform Cloudflare token\n * `DELETE /admin-portal/checkout-domains/cloudflare`\n */\n async disconnectCloudflare(): Promise<void> {\n return this.request('DELETE', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * check the platform Cloudflare token again\n * `POST /admin-portal/checkout-domains/cloudflare/check`\n */\n async checkCloudflare(): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/check');\n }\n\n /**\n * Start \"Connect with Cloudflare\" (OAuth) for the platform connection,\n * instead of pasting a token. Send the person to `authorize_url`;\n * Cloudflare sends them back to the deployment's redirect URI with `code`\n * and `state`, which go to {@link finishCloudflareOAuth} before\n * `expires_at`. Offered only while `cloudflare()` says `oauth_available`;\n * otherwise refused with `cloudflare_oauth_unavailable`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/start`\n */\n async startCloudflareOAuth(): Promise<CloudflareOAuthStart> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/start');\n }\n\n /**\n * Finish \"Connect with Cloudflare\" for the platform: pass the `code` and\n * `state` from the redirect unchanged. The same person who started it\n * must finish it, and a `state` works once. Answers with the platform\n * connection as it now is. A refusal throws a `DelopayError` with `code`\n * `IR_16` and the reason in `data.reason`, among them\n * `cloudflare_oauth_state_invalid`, `cloudflare_oauth_rejected` and\n * `cloudflare_scopes_missing`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/callback`\n */\n async finishCloudflareOAuth(params: CloudflareOAuthCallback): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/callback', {\n body: params,\n });\n }\n\n /**\n * every merchant's checkout addresses\n * `GET /admin-portal/checkout-domains/merchant-hosts`\n */\n async merchantHosts(query?: MerchantHostsQuery): Promise<MerchantHostsList> {\n return this.request('GET', '/admin-portal/checkout-domains/merchant-hosts', {\n query: { ...query },\n });\n }\n\n /**\n * a merchant's checkout domains and entitlement\n * `GET /admin-portal/merchants/{merchant_id}/checkout-domains`\n */\n async merchantCheckoutDomains(merchantId: string): Promise<AdminMerchantCheckoutDomains> {\n return this.request(\n 'GET',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains`,\n );\n }\n\n /**\n * A merchant's checkout-domain entitlement. Turning a kind off suspends that kind's addresses; lowering the maximum removes nothing.\n * `PUT /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement`\n */\n async updateEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementSaved> {\n return this.request(\n 'PUT',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement`,\n { body: params },\n );\n }\n\n /**\n * Suspend a merchant's address: its shops fall back to the default address for new links.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/suspend`\n */\n async suspendMerchantHost(\n merchantId: string,\n hostId: string,\n params: MerchantHostSuspendRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/suspend`,\n { body: params },\n );\n }\n\n /**\n * Lift a suspension; the address sets up again until its next check passes.\n * Refused with `kind_not_entitled` while the entitlement does not allow its\n * kind.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/unsuspend`\n */\n async unsuspendMerchantHost(merchantId: string, hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/unsuspend`,\n );\n }\n\n /**\n * What an entitlement change would do, saving nothing: the entitlement as\n * it would be and the addresses it would suspend.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement/preview`\n */\n async previewEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementPreview> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement/preview`,\n { body: params },\n );\n }\n\n /**\n * Who on the platform team hears about checkout hosts: the platform's own\n * hosts (on by default) and merchant addresses down for 30 minutes or more\n * (off by default).\n * `GET /admin-portal/checkout-domains/alerts`\n */\n async alerts(): Promise<CheckoutDomainAdminAlerts> {\n return this.request('GET', '/admin-portal/checkout-domains/alerts');\n }\n\n /**\n * Save the platform team's checkout host alerts.\n * `PUT /admin-portal/checkout-domains/alerts`\n */\n async updateAlerts(params: CheckoutDomainAdminAlerts): Promise<CheckoutDomainAdminAlerts> {\n return this.request('PUT', '/admin-portal/checkout-domains/alerts', { body: params });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0482/dist/chunk-Y7LSSRNJ.cjs","../src/internal/resources/adminCheckoutDomains.ts"],"names":[],"mappings":"AAAA;AC0CA,SAAS,WAAA,CACP,KAAA,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A;AAAA;AAAA;AAAA,EAAA;AAaE,IAAA;AAAwF,MAAA;AAChF,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAA4E,MAAA;AACxD,IAAA;AACnB,EAAA;AACH;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,IAAA;AAC3D,EAAA;AACF;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,MAAA;AAC1C,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAY,MAAA;AACV,MAAA;AAC8G,MAAA;AAC/F,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAY,MAAA;AACV,MAAA;AAC8G,IAAA;AAChH,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,MAAA;AAC1C,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAkE,EAAA;AACpE;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAAoF,EAAA;AAExF;ADjHA;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0482/dist/chunk-Y7LSSRNJ.cjs","sourcesContent":[null,"import type {\n AdminMerchantCheckoutDomains,\n ApplePayVerificationFileCreateRequest,\n ApplePayVerificationFileResponse,\n ApplePayVerificationFileUpdateRequest,\n CheckoutDomainCreateRequest,\n CheckoutDomainResponse,\n CheckoutDomainsEntitlementSaved,\n CheckoutDomainsEntitlementUpdate,\n CheckoutDomainsOverview,\n CheckoutHostAvailability,\n CheckoutHostAvailabilityQuery,\n CheckoutHostCheckList,\n CheckoutHostChecksQuery,\n CheckoutHostCreateRequest,\n CheckoutHostHealthList,\n CheckoutHostHealthQuery,\n CheckoutHostPrimaryImpact,\n CheckoutHostRegistrationCounts,\n CheckoutHostRenameImpact,\n CheckoutHostRenameRequest,\n CheckoutHostRenameResponse,\n CheckoutDomainAdminAlerts,\n CheckoutDomainsEntitlementPreview,\n MerchantHostSuspendRequest,\n MerchantHostsList,\n MerchantHostsQuery,\n PlatformCloudflare,\n PlatformCloudflareConnect,\n} from '../types';\nimport type {\n CheckoutHostHealthDetail,\n CloudflareOAuthCallback,\n CloudflareOAuthStart,\n CheckoutHostPauseRequest,\n CheckoutHostPreview,\n CheckoutHostResponse,\n CheckoutHostUpdateRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/** The filters of the checks log, taken key by key so nothing else reaches the query. */\nfunction checksQuery(\n query: Omit<CheckoutHostChecksQuery, 'format'> | undefined,\n): Omit<CheckoutHostChecksQuery, 'format'> {\n const { host_id, result, from, to, limit } = query ?? {};\n return { host_id, result, from, to, limit };\n}\n\n/**\n * Checkout domains for DeloPay staff: the platform's checkout hosts and base\n * domains, the Apple Pay verification file library, host health and the raw\n * check log, the platform Cloudflare connection, and each merchant's\n * checkout-domain entitlement and addresses.\n *\n * Reads need a staff role; every write needs account management and is\n * recorded in the audit log.\n */\nexport class AdminCheckoutDomains {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every platform domain and host, the Apple Pay file library, the config fallback and how pool hostnames are spelled.\n * `GET /admin-portal/checkout-domains`\n */\n async overview(): Promise<CheckoutDomainsOverview> {\n return this.request('GET', '/admin-portal/checkout-domains');\n }\n\n /**\n * The raw checks of the last 7 days, filtered by host, result and time.\n * `GET /admin-portal/checkout-domains/checks`\n */\n async listChecks(\n query?: Omit<CheckoutHostChecksQuery, 'format'>,\n ): Promise<CheckoutHostCheckList> {\n // Always JSON here, whatever a caller's object carries at runtime.\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'json' },\n });\n }\n\n /**\n * The same checks as a CSV file (`format=csv`), for a download.\n * `GET /admin-portal/checkout-domains/checks?format=csv`\n */\n async exportChecks(query?: Omit<CheckoutHostChecksQuery, 'format'>): Promise<Blob> {\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'csv' },\n responseType: 'blob',\n });\n }\n\n /**\n * Add a checkout domain\n * `POST /admin-portal/checkout-domains/domains`\n */\n async createDomain(params: CheckoutDomainCreateRequest): Promise<CheckoutDomainResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/domains', { body: params });\n }\n\n /**\n * Remove a checkout domain\n * `DELETE /admin-portal/checkout-domains/domains/{domain_id}`\n */\n async deleteDomain(domainId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/domains/${encodeURIComponent(domainId)}`,\n );\n }\n\n /**\n * Upload an Apple Pay verification file. The stored file is read back\n * before it is saved; when that fails nothing is saved, and the refusal\n * (`code` `IR_16`, `data.reason`) is `file_unreadable` (the file storage\n * writes but does not read: check its configuration) or `file_corrupted`\n * (the stored bytes differ from the upload: try again).\n * `POST /admin-portal/checkout-domains/files`\n */\n async uploadFile(\n params: ApplePayVerificationFileCreateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/files', { body: params });\n }\n\n /**\n * Change an Apple Pay verification file\n * `PATCH /admin-portal/checkout-domains/files/{file_id}`\n */\n async updateFile(\n fileId: string,\n params: ApplePayVerificationFileUpdateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove an Apple Pay verification file\n * `DELETE /admin-portal/checkout-domains/files/{file_id}`\n */\n async deleteFile(fileId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n );\n }\n\n /**\n * The bytes of an Apple Pay verification file, presets included.\n * `GET /admin-portal/checkout-domains/files/{file_id}/content`\n */\n async downloadFile(fileId: string): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}/content`,\n { responseType: 'blob' },\n );\n }\n\n /**\n * Every host with its health, uptime and payments, with counts per summary filter; sorted and searched on the server.\n * `GET /admin-portal/checkout-domains/health`\n */\n async health(query?: CheckoutHostHealthQuery): Promise<CheckoutHostHealthList> {\n return this.request('GET', '/admin-portal/checkout-domains/health', { query: { ...query } });\n }\n\n /**\n * Add a checkout host\n * `POST /admin-portal/checkout-domains/hosts`\n */\n async createHost(params: CheckoutHostCreateRequest): Promise<CheckoutHostResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/hosts', { body: params });\n }\n\n /**\n * Whether a platform host name is free\n * `GET /admin-portal/checkout-domains/hosts/availability`\n */\n async hostAvailability(query: CheckoutHostAvailabilityQuery): Promise<CheckoutHostAvailability> {\n return this.request('GET', '/admin-portal/checkout-domains/hosts/availability', {\n query: { ...query },\n });\n }\n\n /**\n * Change a checkout host\n * `PATCH /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async updateHost(\n hostId: string,\n params: CheckoutHostUpdateRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove a host, in two steps for every kind: it must stop taking traffic\n * first. Refusals (`code` `IR_16`, `data.reason`): `primary_host`,\n * `last_default_host`, `configured_host` (the configured checkout address),\n * `host_takes_traffic` (pause or rename it first), `host_draining`\n * (`retry_after_seconds`), `host_in_use` (`payment_ids`) and `host_changed`.\n * `DELETE /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async deleteHost(hostId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n );\n }\n\n /**\n * Check a checkout host now\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/check`\n */\n async checkHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/check`,\n );\n }\n\n /**\n * One host's health page: uptime, 90 days, incidents, the checks where the result changed, and usage.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/health`\n */\n async hostHealth(hostId: string): Promise<CheckoutHostHealthDetail> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/health`,\n );\n }\n\n /**\n * Pause a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/pause`\n */\n async pauseHost(hostId: string, params: CheckoutHostPauseRequest): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/pause`,\n { body: params },\n );\n }\n\n /**\n * Resume a paused checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/resume`\n */\n async resumeHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/resume`,\n );\n }\n\n /**\n * A signed preview link of a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/preview`\n */\n async previewHost(hostId: string): Promise<CheckoutHostPreview> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/preview`,\n );\n }\n\n /**\n * Make a ready default host the primary one: new links use it within about 30 seconds. Old hosts keep serving.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/primary`\n */\n async makePrimary(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary`,\n );\n }\n\n /**\n * What making a host primary would change for Apple Pay registrations.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/primary-impact`\n */\n async primaryImpact(hostId: string): Promise<CheckoutHostPrimaryImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary-impact`,\n );\n }\n\n /**\n * A checkout host's Apple Pay registrations, counted\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/registrations`\n */\n async hostRegistrations(hostId: string): Promise<CheckoutHostRegistrationCounts> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/registrations`,\n );\n }\n\n /**\n * Rename a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/rename`\n */\n async renameHost(\n hostId: string,\n params: CheckoutHostRenameRequest,\n ): Promise<CheckoutHostRenameResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename`,\n { body: params },\n );\n }\n\n /**\n * What renaming a host would cost: the processors whose Apple Pay registration of the hostname is lost, and the merchants affected.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/rename-impact`\n */\n async renameImpact(hostId: string): Promise<CheckoutHostRenameImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename-impact`,\n );\n }\n\n /**\n * Create the host's proxied DNS record through the platform Cloudflare connection.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/dns`\n */\n async createHostDns(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/dns`,\n );\n }\n\n /**\n * the platform Cloudflare connection\n * `GET /admin-portal/checkout-domains/cloudflare`\n */\n async cloudflare(): Promise<PlatformCloudflare> {\n return this.request('GET', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * connect or replace the platform Cloudflare token\n * `PUT /admin-portal/checkout-domains/cloudflare`\n */\n async connectCloudflare(params: PlatformCloudflareConnect): Promise<PlatformCloudflare> {\n return this.request('PUT', '/admin-portal/checkout-domains/cloudflare', { body: params });\n }\n\n /**\n * disconnect the platform Cloudflare token\n * `DELETE /admin-portal/checkout-domains/cloudflare`\n */\n async disconnectCloudflare(): Promise<void> {\n return this.request('DELETE', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * check the platform Cloudflare token again\n * `POST /admin-portal/checkout-domains/cloudflare/check`\n */\n async checkCloudflare(): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/check');\n }\n\n /**\n * Start \"Connect with Cloudflare\" (OAuth) for the platform connection,\n * instead of pasting a token. Send the person to `authorize_url`;\n * Cloudflare sends them back to the deployment's redirect URI with `code`\n * and `state`, which go to {@link finishCloudflareOAuth} before\n * `expires_at`. Offered only while `cloudflare()` says `oauth_available`;\n * otherwise refused with `cloudflare_oauth_unavailable`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/start`\n */\n async startCloudflareOAuth(): Promise<CloudflareOAuthStart> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/start');\n }\n\n /**\n * Finish \"Connect with Cloudflare\" for the platform: pass the `code` and\n * `state` from the redirect unchanged. The same person who started it\n * must finish it, and a `state` works once. Answers with the platform\n * connection as it now is. A refusal throws a `DelopayError` with `code`\n * `IR_16` and the reason in `data.reason`, among them\n * `cloudflare_oauth_state_invalid`, `cloudflare_oauth_rejected` and\n * `cloudflare_scopes_missing`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/callback`\n */\n async finishCloudflareOAuth(params: CloudflareOAuthCallback): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/callback', {\n body: params,\n });\n }\n\n /**\n * every merchant's checkout addresses\n * `GET /admin-portal/checkout-domains/merchant-hosts`\n */\n async merchantHosts(query?: MerchantHostsQuery): Promise<MerchantHostsList> {\n return this.request('GET', '/admin-portal/checkout-domains/merchant-hosts', {\n query: { ...query },\n });\n }\n\n /**\n * a merchant's checkout domains and entitlement\n * `GET /admin-portal/merchants/{merchant_id}/checkout-domains`\n */\n async merchantCheckoutDomains(merchantId: string): Promise<AdminMerchantCheckoutDomains> {\n return this.request(\n 'GET',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains`,\n );\n }\n\n /**\n * A merchant's checkout-domain entitlement. Turning a kind off suspends that kind's addresses; lowering the maximum removes nothing.\n * `PUT /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement`\n */\n async updateEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementSaved> {\n return this.request(\n 'PUT',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement`,\n { body: params },\n );\n }\n\n /**\n * Suspend a merchant's address: its shops fall back to the default address for new links.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/suspend`\n */\n async suspendMerchantHost(\n merchantId: string,\n hostId: string,\n params: MerchantHostSuspendRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/suspend`,\n { body: params },\n );\n }\n\n /**\n * Lift a suspension; the address sets up again until its next check passes.\n * Refused with `kind_not_entitled` while the entitlement does not allow its\n * kind.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/unsuspend`\n */\n async unsuspendMerchantHost(merchantId: string, hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/unsuspend`,\n );\n }\n\n /**\n * What an entitlement change would do, saving nothing: the entitlement as\n * it would be and the addresses it would suspend.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement/preview`\n */\n async previewEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementPreview> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement/preview`,\n { body: params },\n );\n }\n\n /**\n * Who on the platform team hears about checkout hosts: the platform's own\n * hosts (on by default) and merchant addresses down for 30 minutes or more\n * (off by default).\n * `GET /admin-portal/checkout-domains/alerts`\n */\n async alerts(): Promise<CheckoutDomainAdminAlerts> {\n return this.request('GET', '/admin-portal/checkout-domains/alerts');\n }\n\n /**\n * Save the platform team's checkout host alerts.\n * `PUT /admin-portal/checkout-domains/alerts`\n */\n async updateAlerts(params: CheckoutDomainAdminAlerts): Promise<CheckoutDomainAdminAlerts> {\n return this.request('PUT', '/admin-portal/checkout-domains/alerts', { body: params });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/sdkpub/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA,EAIA,MAAM,WAAA,CACJ,IAAA,EACA,SAAA,EACA,OAAA,EACqC;AACrC,IAAA,MAAM,KAAA,EAAO,IAAI,QAAA,CAAS,CAAA;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,IAAI,CAAA;AACxB,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB;AAAA,MAC9C,IAAA,EAAM,IAAA;AAAA,MACN,GAAG,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,OAAO;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,MAAA,E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A;AAAA;AAAA;AAW6C,EAAA;AACY,IAAA;AAC/C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBwC,EAAA;AACgC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/sdkpub/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0482/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA,EAIA,MAAM,WAAA,CACJ,IAAA,EACA,SAAA,EACA,OAAA,EACqC;AACrC,IAAA,MAAM,KAAA,EAAO,IAAI,QAAA,CAAS,CAAA;A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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBqC,EAAA;AACmB,IAAA;AAC9C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAUyC,EAAA;AACa,IAAA;AACE,MAAA;AACnB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcwC,EAAA;AAC+B,IAAA;AAClC,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW6C,EAAA;AACY,IAAA;AAC/C,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBwC,EAAA;AACgC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0482/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
@@ -1,11 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/resources/customers.ts
2
2
  function toQuery(params) {
3
3
  if (!params) return void 0;
4
- const { profile_ids, ...rest } = params;
4
+ const { profile_ids, industry, ...rest } = params;
5
5
  const query = rest;
6
6
  if (profile_ids && profile_ids.length > 0) {
7
7
  query.profile_ids = profile_ids.join(",");
8
8
  }
9
+ if (industry && industry.length > 0) {
10
+ query.industry = industry.join(",");
11
+ }
9
12
  return query;
10
13
  }
11
14
  var Customers = class {
@@ -278,4 +281,4 @@ var Customers = class {
278
281
 
279
282
 
280
283
  exports.Customers = Customers;
281
- //# sourceMappingURL=chunk-OWP7XBY2.cjs.map
284
+ //# sourceMappingURL=chunk-YW4DVKNT.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0482/dist/chunk-YW4DVKNT.cjs","../src/resources/customers.ts"],"names":[],"mappings":"AAAA;ACiCA,SAAS,OAAA,CACP,MAAA,EACmE;AACnE,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,EAAE,WAAA,EAAa,QAAA,EAAU,GAAG,KAAK,EAAA,EAAI,MAAA;AAC3C,EAAA,MAAM,MAAA,EAAQ,IAAA;AAGd,EAAA,GAAA,CAAI,YAAA,GAAe,WAAA,CAAY,OAAA,EAAS,CAAA,EAAG;AACzC,IAAA,KAAA,CAAM,YAAA,EAAc,WAAA,CAAY,IAAA,CAAK,GAAG,CAAA;AAAA,EAC1C;AACA,EAAA,GAAA,CAAI,SAAA,GAAY,QAAA,CAAS,OAAA,EAAS,CAAA,EAAG;AACnC,IAAA,KAAA,CAAM,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,EACpC;AACA,EAAA,OAAO,KAAA;AACT;AAGO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlD,MAAM,qBAAA,CACJ,MAAA,EACA,OAAA,EACgD;AAChD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4CAAA,EAA8C;AAAA,MACxE,IAAA,EAAM,MAAA;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A;AAAA;AAAA;AASoF,EAAA;AACQ,IAAA;AAC5F,EAAA;AACF;ADtG+F;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0482/dist/chunk-YW4DVKNT.cjs","sourcesContent":[null,"import type {\n BuyerInvoiceLink,\n BuyerInvoiceLinkRequest,\n BuyerPortalLinkPage,\n BuyerPortalPageQuery,\n CustomerCreateRequest,\n CustomerIdentityHistoryRequest,\n CustomerIdentityHistoryResponse,\n CustomerIdentityHistorySearchRequest,\n CustomerIdentityImportPreviewRequest,\n CustomerIdentityImportPreviewResponse,\n CustomerIdentityImportRequest,\n CustomerIdentityImportResponse,\n CustomerResponse,\n CustomerShopBulkPlacementRequest,\n CustomerShopBulkPlacementResponse,\n CustomerShopPlacementResponse,\n CustomerUpdateRequest,\n CustomerListParams,\n CustomerListResponse,\n CustomerListWithCountParams,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Flatten list params for the query string.\n *\n * `profile_ids` must go out as ONE comma-separated value. The client\n * serializes arrays as repeated keys (`?profile_ids=a&profile_ids=b`), and the\n * customers endpoints cannot parse that — the whole request fails, rather than\n * the second id being ignored. So the join happens here, once, instead of at\n * four call sites.\n */\nfunction toQuery(\n params?: CustomerListParams,\n): Record<string, string | number | boolean | undefined> | undefined {\n if (!params) return undefined;\n const { profile_ids, industry, ...rest } = params;\n const query = rest as Record<string, string | number | boolean | undefined>;\n // An empty array means \"no shop filter\", which is the absent key — sending\n // `profile_ids=` would work too, but omitting it keeps the URL honest.\n if (profile_ids && profile_ids.length > 0) {\n query.profile_ids = profile_ids.join(',');\n }\n if (industry && industry.length > 0) {\n query.industry = industry.join(',');\n }\n return query;\n}\n\n/** Create and manage customer profiles. */\nexport class Customers {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Check identity import rows (email addresses, names, handles) and say what an import would do\n * with each. Writes nothing. Merchant-wide callers only.\n */\n async previewIdentityImport(\n params: CustomerIdentityImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportPreviewResponse> {\n return this.request('POST', '/customers/identity-history/import/preview', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Record identity import rows in the customers' identity history, apart from their current\n * details. Idempotent per `idempotency_key`; the same key with different rows is refused (400, `IR_38`).\n * A transient failure is retried with the unchanged key when client retries are enabled.\n */\n async importIdentityHistory(\n params: CustomerIdentityImportRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('POST', '/customers/identity-history/import', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /** Read an identity import back: its rows and the history entries they map to. */\n async retrieveIdentityImport(\n runId: string,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('GET', `/customers/identity-history/import/${encodeURIComponent(runId)}`, {\n ...options,\n });\n }\n\n /** The identity history of up to 1,000 customers. */\n async listIdentityHistory(\n params: CustomerIdentityHistoryRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/list', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Search the merchant's identity history for email addresses, names and handles containing a\n * text of at least three characters. The text travels in the body, never in the URL.\n */\n async searchIdentityHistory(\n params: CustomerIdentityHistorySearchRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/search', {\n body: params,\n ...options,\n });\n }\n\n /** Issue a shop-scoped buyer portal link for this customer. */\n async createPortalLink(\n customerId: string,\n params: BuyerInvoiceLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerInvoiceLink> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n body: params,\n ...options,\n });\n }\n\n /** List issued grants without disclosing their secret URLs. */\n async listPortalLinks(\n customerId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalLinkPage> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async revokePortalLink(\n customerId: string,\n linkId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,\n { ...options },\n );\n }\n\n /**\n * Create a new customer.\n *\n * @param params - Customer creation parameters (name, email, phone, address, etc.).\n * @returns The created customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.create({\n * email: 'alice@example.com',\n * name: 'Alice Smith',\n * });\n * ```\n */\n async create(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers', { body: params });\n }\n\n /**\n * Retrieve a customer by their ID.\n *\n * @param customerId - The unique customer ID.\n * @returns The customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.retrieve('cus_abc123');\n * ```\n */\n async retrieve(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Place an existing customer in a shop of the merchant, so the shop's API keys and team members\n * find the customer before any payment. The customer keeps the shops they already belong to;\n * placing one already in the shop changes nothing (`already_in_shop`). Needs a merchant-wide key:\n * a key bound to one shop is refused. An unknown customer answers `CustomerNotFound` (404).\n * `POST /customers/{customer_id}/shops`\n *\n * @param customerId - The customer to place.\n * @param profileId - The shop. It must belong to the merchant.\n */\n async placeInShop(\n customerId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<CustomerShopPlacementResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/shops`, {\n body: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Place up to 500 existing customers in one shop of the merchant, for example after an import.\n * The answer lists every distinct customer in request order with what happened: `placed`,\n * `already_in_shop` or `not_found`. Needs a merchant-wide key. `POST /customers/shops/place`\n */\n async placeManyInShop(\n params: CustomerShopBulkPlacementRequest,\n options?: RequestExtras,\n ): Promise<CustomerShopBulkPlacementResponse> {\n return this.request('POST', '/customers/shops/place', { body: params, ...options });\n }\n\n /**\n * Update an existing customer's details.\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update (name, email, address, metadata, etc.).\n * @returns The updated customer.\n */\n async update(\n customerId: string,\n params: CustomerUpdateRequest,\n options?: RequestExtras,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a customer and all their saved payment methods.\n *\n * @param customerId - The customer ID to delete.\n * @returns The deleted customer object.\n */\n async delete(customerId: string): Promise<CustomerResponse> {\n return this.request('DELETE', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * List customers, optionally filtered by customer id/name/email prefix,\n * shop (`profile_id`), or project (`project_id`).\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n *\n * @example\n * ```typescript\n * // Customers who have transacted in a specific shop.\n * const customers = await delopay.customers.list({ profile_id: 'pro_abc123' });\n *\n * // Several shops at once (unions with profile_id / project_id).\n * const many = await delopay.customers.list({\n * profile_ids: ['pro_abc123', 'pro_def456'],\n * });\n * ```\n */\n async list(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/list', {\n query: toQuery(params),\n });\n }\n\n // --- OLAP extensions (Task 4.6) ---\n\n /**\n * List customers with count. Supports the same `profile_id` / `project_id`\n * shop filters as {@link list}. `GET /customers/list-with-count`\n */\n async listWithCount(params?: CustomerListWithCountParams): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * List customers scoped to the authenticated dashboard user's shop\n * (business profile). The JWT auto-scopes to its own `profile`; an explicit\n * `profile_id` / `project_id` outside that scope is rejected with\n * `AccessForbidden`. `GET /customers/profile/list`\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n */\n async listByProfile(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/profile/list', {\n query: toQuery(params),\n });\n }\n\n /**\n * Profile-scoped variant of {@link listWithCount}.\n * `GET /customers/profile/list-with-count`\n */\n async listByProfileWithCount(\n params?: CustomerListWithCountParams,\n ): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/profile/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * Retrieve one customer, scoped to the authenticated dashboard user's shop\n * (business profile). The shop-scoped counterpart of {@link retrieve}, and\n * what makes a shop's own customer list clickable: the list is\n * `ProfileCustomerRead` while {@link retrieve} is merchant-level, so a shop\n * member could see a customer they could not open.\n *\n * A customer belonging to a sibling shop answers `CustomerNotFound` — the\n * same answer as a customer that does not exist, deliberately, so one shop\n * cannot enumerate another's customer ids.\n *\n * `GET /customers/profile/{customerId}`\n *\n * @param customerId - The unique customer ID.\n * @returns The customer, with `profile_ids` narrowed to the caller's own shop.\n */\n async retrieveByProfile(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Create a customer from a shop, recording that it belongs to that shop so\n * the shop can see the customer it just created. The shop is taken from the\n * credential; a caller-chosen `customer_id` is rejected.\n *\n * `POST /customers/profile`\n *\n * @param params - The customer to create.\n * @returns The created customer.\n */\n async createByProfile(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers/profile', { body: params });\n }\n\n /**\n * Update a customer from a shop, if the customer belongs to that shop.\n * A sibling shop's customer answers `CustomerNotFound`, as with\n * {@link retrieveByProfile}.\n *\n * `POST /customers/profile/{customerId}`\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update.\n * @returns The updated customer.\n */\n async updateByProfile(\n customerId: string,\n params: CustomerUpdateRequest,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/profile/${encodeURIComponent(customerId)}`, {\n body: params,\n });\n }\n\n /** List mandates for a customer. `GET /customers/{customerId}/mandates` */\n async listMandates(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/mandates`);\n }\n\n /**\n * List one customer's mandates, scoped to the caller's shop. Same membership\n * rule as {@link retrieveByProfile}: a sibling shop's customer answers\n * `CustomerNotFound` before any mandate is read.\n *\n * `GET /customers/profile/{customerId}/mandates`\n */\n async listMandatesByProfile(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}/mandates`);\n }\n}\n"]}