@delopay/sdk 0.496.0 → 0.497.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 (285) 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-2NVGA4G5.cjs.map +1 -1
  10. package/dist/chunk-34PC72O7.cjs.map +1 -1
  11. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  12. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  13. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  14. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  15. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  16. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  17. package/dist/chunk-5CITBN33.cjs.map +1 -1
  18. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  19. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  20. package/dist/chunk-5QS67SBO.cjs.map +1 -1
  21. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  22. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  23. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  24. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  25. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  26. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  27. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  28. package/dist/{chunk-QG6AD33A.js → chunk-7H2VFIPS.js} +2 -2
  29. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  30. package/dist/chunk-7NKJD5ST.cjs.map +1 -1
  31. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  32. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  33. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  34. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  35. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  36. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  37. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  38. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  39. package/dist/{chunk-MXSUWL6O.js → chunk-BS6MTTT6.js} +13 -1
  40. package/dist/chunk-BS6MTTT6.js.map +1 -0
  41. package/dist/chunk-BT3UAUEV.cjs.map +1 -1
  42. package/dist/{chunk-IM6A64ON.js → chunk-BX2CT7FR.js} +13 -1
  43. package/dist/chunk-BX2CT7FR.js.map +1 -0
  44. package/dist/chunk-CAMALM35.cjs.map +1 -1
  45. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  46. package/dist/{chunk-MOFPVWNN.js → chunk-CQQW5JU7.js} +2 -2
  47. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  48. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  49. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  50. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  51. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  52. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  53. package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
  54. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  55. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  56. package/dist/chunk-F6QJB4XP.cjs.map +1 -1
  57. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  58. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  59. package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
  60. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  61. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  62. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  63. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  64. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  65. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  66. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  67. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  68. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  69. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  70. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  71. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  72. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  73. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  74. package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
  75. package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
  76. package/dist/{chunk-OFZJ4JAH.cjs → chunk-K3XXGAOR.cjs} +3 -3
  77. package/dist/chunk-K3XXGAOR.cjs.map +1 -0
  78. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  79. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  80. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  81. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  82. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  83. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  84. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  85. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  86. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  87. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  88. package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
  89. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  90. package/dist/{chunk-GLQ7EJAH.cjs → chunk-NULOAF7W.cjs} +13 -1
  91. package/dist/chunk-NULOAF7W.cjs.map +1 -0
  92. package/dist/{chunk-YWN76H2W.cjs → chunk-NX36HDXE.cjs} +13 -1
  93. package/dist/chunk-NX36HDXE.cjs.map +1 -0
  94. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  95. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  96. package/dist/chunk-OAEKP665.cjs.map +1 -1
  97. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  98. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  99. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  100. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  101. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  102. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  103. package/dist/chunk-PYNHK6AP.cjs.map +1 -1
  104. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  105. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  106. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  107. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  108. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  109. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  110. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  111. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  112. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  113. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  114. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  115. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  116. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  117. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  118. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  119. package/dist/chunk-UTCXNBID.cjs.map +1 -1
  120. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  121. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  122. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  123. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  124. package/dist/chunk-W457XUA6.cjs.map +1 -1
  125. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  126. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  127. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  128. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  129. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  130. package/dist/chunk-YFRAI34Y.cjs.map +1 -1
  131. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  132. package/dist/chunk-YW4DVKNT.cjs.map +1 -1
  133. package/dist/chunk-ZGMIHHGL.cjs.map +1 -1
  134. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  135. package/dist/{chunk-XPSN5YYU.cjs → chunk-ZMJT2YPZ.cjs} +3 -3
  136. package/dist/chunk-ZMJT2YPZ.cjs.map +1 -0
  137. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  138. package/dist/client.cjs +2 -2
  139. package/dist/client.cjs.map +1 -1
  140. package/dist/client.js +1 -1
  141. package/dist/core.cjs.map +1 -1
  142. package/dist/currencies.cjs.map +1 -1
  143. package/dist/enigmaCardForm.cjs.map +1 -1
  144. package/dist/error.cjs.map +1 -1
  145. package/dist/eventStream.cjs.map +1 -1
  146. package/dist/exportDownload.cjs.map +1 -1
  147. package/dist/feeProgram.cjs.map +1 -1
  148. package/dist/index.cjs +4 -4
  149. package/dist/index.cjs.map +1 -1
  150. package/dist/index.d.cts +1 -1
  151. package/dist/index.d.ts +1 -1
  152. package/dist/index.js +3 -3
  153. package/dist/internal/resources/admin.cjs.map +1 -1
  154. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  155. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  156. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  157. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  158. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  159. package/dist/internal/resources/adminLive.cjs.map +1 -1
  160. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  161. package/dist/internal/resources/adminPortal.cjs +2 -2
  162. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  163. package/dist/internal/resources/adminPortal.d.cts +8 -1
  164. package/dist/internal/resources/adminPortal.d.ts +8 -1
  165. package/dist/internal/resources/adminPortal.js +1 -1
  166. package/dist/internal/resources/adminPricing.cjs.map +1 -1
  167. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  168. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  169. package/dist/internal/resources/cache.cjs.map +1 -1
  170. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  171. package/dist/internal/resources/configs.cjs.map +1 -1
  172. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  173. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  174. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  175. package/dist/internal/resources/gsm.cjs.map +1 -1
  176. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  177. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  178. package/dist/internal/resources/platformFees.cjs.map +1 -1
  179. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  180. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  181. package/dist/internal.cjs +7 -7
  182. package/dist/internal.cjs.map +1 -1
  183. package/dist/internal.d.cts +1 -1
  184. package/dist/internal.d.ts +1 -1
  185. package/dist/internal.js +4 -4
  186. package/dist/listQuery.cjs.map +1 -1
  187. package/dist/panes.cjs.map +1 -1
  188. package/dist/paymentPresentation.cjs.map +1 -1
  189. package/dist/recordCounter.cjs.map +1 -1
  190. package/dist/resources/aiTools.cjs.map +1 -1
  191. package/dist/resources/analytics.cjs +2 -2
  192. package/dist/resources/analytics.cjs.map +1 -1
  193. package/dist/resources/analytics.d.cts +9 -1
  194. package/dist/resources/analytics.d.ts +9 -1
  195. package/dist/resources/analytics.js +1 -1
  196. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  197. package/dist/resources/apiKeys.cjs.map +1 -1
  198. package/dist/resources/audit.cjs.map +1 -1
  199. package/dist/resources/authentication.cjs.map +1 -1
  200. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  201. package/dist/resources/billing.cjs.map +1 -1
  202. package/dist/resources/buyerAccount.cjs.map +1 -1
  203. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  204. package/dist/resources/buyerConversations.cjs.map +1 -1
  205. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  206. package/dist/resources/buyerPortal.cjs.map +1 -1
  207. package/dist/resources/cards.cjs.map +1 -1
  208. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  209. package/dist/resources/checkoutDomains.cjs.map +1 -1
  210. package/dist/resources/checkoutMethods.cjs.map +1 -1
  211. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  212. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  213. package/dist/resources/connectors.cjs.map +1 -1
  214. package/dist/resources/contentEncryption.cjs.map +1 -1
  215. package/dist/resources/costRules.cjs.map +1 -1
  216. package/dist/resources/customers.cjs.map +1 -1
  217. package/dist/resources/deploymentBranding.cjs.map +1 -1
  218. package/dist/resources/disputes.cjs.map +1 -1
  219. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  220. package/dist/resources/events.cjs.map +1 -1
  221. package/dist/resources/export.cjs.map +1 -1
  222. package/dist/resources/externalRecords.cjs.map +1 -1
  223. package/dist/resources/featureMatrix.cjs.map +1 -1
  224. package/dist/resources/fees.cjs.map +1 -1
  225. package/dist/resources/files.cjs.map +1 -1
  226. package/dist/resources/forex.cjs.map +1 -1
  227. package/dist/resources/identityVerifications.cjs.map +1 -1
  228. package/dist/resources/industries.cjs.map +1 -1
  229. package/dist/resources/invoiceSettings.cjs.map +1 -1
  230. package/dist/resources/invoices.cjs.map +1 -1
  231. package/dist/resources/live.cjs.map +1 -1
  232. package/dist/resources/mandates.cjs.map +1 -1
  233. package/dist/resources/merchantAccounts.cjs.map +1 -1
  234. package/dist/resources/messageTemplates.cjs.map +1 -1
  235. package/dist/resources/notices.cjs.map +1 -1
  236. package/dist/resources/operationLimits.cjs.map +1 -1
  237. package/dist/resources/paymentLinks.cjs.map +1 -1
  238. package/dist/resources/paymentMethods.cjs.map +1 -1
  239. package/dist/resources/payments.cjs.map +1 -1
  240. package/dist/resources/payoutDestinations.cjs.map +1 -1
  241. package/dist/resources/payouts.cjs.map +1 -1
  242. package/dist/resources/paypalDisputes.cjs.map +1 -1
  243. package/dist/resources/persons.cjs.map +1 -1
  244. package/dist/resources/poll.cjs.map +1 -1
  245. package/dist/resources/processorCosts.cjs.map +1 -1
  246. package/dist/resources/processorImports.cjs.map +1 -1
  247. package/dist/resources/products.cjs.map +1 -1
  248. package/dist/resources/profileAcquirers.cjs.map +1 -1
  249. package/dist/resources/profiles.cjs.map +1 -1
  250. package/dist/resources/projects.cjs.map +1 -1
  251. package/dist/resources/refunds.cjs.map +1 -1
  252. package/dist/resources/regions.cjs.map +1 -1
  253. package/dist/resources/relay.cjs.map +1 -1
  254. package/dist/resources/risk.cjs.map +1 -1
  255. package/dist/resources/routing.cjs.map +1 -1
  256. package/dist/resources/search.cjs.map +1 -1
  257. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  258. package/dist/resources/settings.cjs.map +1 -1
  259. package/dist/resources/settlement.cjs.map +1 -1
  260. package/dist/resources/shareLinks.cjs.map +1 -1
  261. package/dist/resources/shopLabels.cjs.map +1 -1
  262. package/dist/resources/shopify.cjs.map +1 -1
  263. package/dist/resources/shops.cjs.map +1 -1
  264. package/dist/resources/stripeConnect.cjs.map +1 -1
  265. package/dist/resources/subscriptions.cjs.map +1 -1
  266. package/dist/resources/support.cjs.map +1 -1
  267. package/dist/resources/threeDsRules.cjs.map +1 -1
  268. package/dist/resources/users.cjs.map +1 -1
  269. package/dist/resources/vatRates.cjs.map +1 -1
  270. package/dist/resources/verification.cjs.map +1 -1
  271. package/dist/resources/webhooks.cjs.map +1 -1
  272. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  273. package/dist/trustedOrigins.cjs.map +1 -1
  274. package/dist/types.cjs.map +1 -1
  275. package/dist/types.d.cts +46 -1
  276. package/dist/types.d.ts +46 -1
  277. package/package.json +17 -19
  278. package/dist/chunk-GLQ7EJAH.cjs.map +0 -1
  279. package/dist/chunk-IM6A64ON.js.map +0 -1
  280. package/dist/chunk-MXSUWL6O.js.map +0 -1
  281. package/dist/chunk-OFZJ4JAH.cjs.map +0 -1
  282. package/dist/chunk-XPSN5YYU.cjs.map +0 -1
  283. package/dist/chunk-YWN76H2W.cjs.map +0 -1
  284. /package/dist/{chunk-QG6AD33A.js.map → chunk-7H2VFIPS.js.map} +0 -0
  285. /package/dist/{chunk-MOFPVWNN.js.map → chunk-CQQW5JU7.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-UTCXNBID.cjs","../src/resources/payments.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgDlD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EAC0B;AAC1B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,WAAA,EAAa,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;AAAA;AAG6F,EAAA;AAClD,IAAA;AACjC,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG4F,EAAA;AACjD,IAAA;AACjC,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAMoC,EAAA;AACO,IAAA;AACjC,MAAA;AACP,IAAA;AACH,EAAA;AACF;AAKkE;AAC5C,EAAA;AACqB,EAAA;AAClC,EAAA;AACF,IAAA;AAEC,IAAA;AAMN,EAAA;AACF;ADnN4D;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-UTCXNBID.cjs","sourcesContent":[null,"import type {\n BuyerRiskEvaluationsResponse,\n BuyerRiskEvidenceQuery,\n BuyerRiskEvidenceResponse,\n BuyerRiskReleaseResponse,\n PaymentAgentSignalResponse,\n PaymentClientContextListResponse,\n PaymentCreateRequest,\n ProductPaymentCreateRequest,\n ProductsPaymentCreateRequest,\n PaymentListFilterConstraints,\n PaymentListFilteredResponse,\n ProfilePaymentListFilterConstraints,\n PaymentListResponse,\n PaymentResponse,\n PaymentProductLines,\n PaymentShopifyResponse,\n PaymentRetrieveOptions,\n PaymentUpdateRequest,\n PaymentConfirmRequest,\n PaymentCaptureRequest,\n PaymentCancelRequest,\n PaymentAbortRequest,\n PaymentIntegrationTestRequest,\n PaymentIntegrationTestResponse,\n PaymentListParams,\n PaymentAttemptsListResponse,\n PaymentConnectorSettlementResponse,\n PaymentsDeletePolicyResponse,\n PaymentsDeleteResponse,\n PaymentStatusHistoryResponse,\n PaymentLogsResponse,\n PaymentLogConnectorCallDetail,\n PaymentLogIncomingWebhookDetail,\n PaymentLogOutgoingWebhookDetail,\n PaymentRoutingDecisionsResponse,\n PaymentStatementDescriptorsResponse,\n ShipmentTrackingCreateRequest,\n ShipmentTrackingListResponse,\n ShipmentTrackingResponse,\n ShipmentTrackingUpdateRequest,\n ReplayPlaybackResponse,\n ReplaySliceResponse,\n PaymentListFiltersExt,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Manage payment intents — create, confirm, capture, cancel, and list payments. */\nexport class Payments {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a new payment intent.\n *\n * @param params - An explicit amount and currency, or a DeloPay one-time\n * product whose active price supplies both on the server.\n * @param options - Optional per-call extras: extra `headers` (e.g. an\n * `Idempotency-Key` to make the create safe to retry), a `timeout` override,\n * and an `AbortSignal`.\n * @returns The created payment intent.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.create(\n * { amount: 5000, currency: 'EUR', customer_id: 'cus_123' },\n * { headers: { 'Idempotency-Key': 'order_1001' } },\n * );\n * ```\n *\n * @example Charge the active default price of a shop-owned product without\n * copying the product to the payment provider:\n * ```typescript\n * const payment = await delopay.payments.create({\n * product_id: 'prd_123',\n * profile_id: 'pro_123',\n * payment_link: true,\n * });\n * ```\n *\n * @example Send `test_mode` to pick the environment per payment, so a staging\n * deploy cannot charge real cards and a forgotten processor toggle cannot\n * swallow production traffic:\n * ```typescript\n * const payment = await delopay.payments.create({\n * amount: 5000,\n * currency: 'EUR',\n * test_mode: process.env.NODE_ENV !== 'production',\n * });\n * ```\n *\n * A payment that pins one connector through `routing` (the `single` form)\n * is now checked against `test_mode` here rather than at confirm: if that\n * connector has no credentials for the environment asked for, create fails\n * instead of handing back a payment whose checkout the buyer cannot\n * complete. `priority` and `volume_split` name several accounts and are\n * still resolved at confirm.\n */\n async create(\n params: PaymentCreateRequest | ProductPaymentCreateRequest | ProductsPaymentCreateRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.request('POST', '/payments', { body: params, ...options });\n }\n\n /**\n * Retrieve a payment by its ID.\n *\n * @param paymentId - The unique payment intent ID.\n * @param options - Optional query flags. `force_sync` reconciles the\n * intent's state with the connector before returning (useful to recover\n * a stuck intent when a webhook was lost). `all_keys_required` forces a\n * connector sync even for intents in early states like\n * `requires_payment_method` that would otherwise return the local\n * snapshot. Both flags work with JWT and API-key authentication.\n * @returns The payment intent.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.retrieve('pay_abc123');\n * const synced = await delopay.payments.retrieve('pay_abc123', {\n * force_sync: true,\n * all_keys_required: true,\n * });\n * ```\n */\n async retrieve(paymentId: string, options?: PaymentRetrieveOptions): Promise<PaymentResponse> {\n const path = `/payments/${encodeURIComponent(paymentId)}`;\n if (options === undefined) return this.request('GET', path);\n const query: Record<string, boolean> = {};\n if (options.force_sync !== undefined) query['force_sync'] = options.force_sync;\n if (options.all_keys_required !== undefined) {\n query['all_keys_required'] = options.all_keys_required;\n }\n if (Object.keys(query).length === 0) return this.request('GET', path);\n return this.request('GET', path, { query });\n }\n\n /**\n * The payment's buyer risk evaluations, newest first (at most 50): each\n * one's score from 0 to 100, its band, the action the merchant's model asks\n * for that band and the action that was taken, the signals that fired with\n * the points each added, and the model version it was scored with.\n *\n * A payment is scored at every confirm that is about to reach a processor;\n * a payment never scored answers an empty list. A caller scoped to one shop\n * reads only that shop's payments.\n *\n * `GET /payments/{paymentId}/buyer-risk`\n */\n async buyerRisk(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<BuyerRiskEvaluationsResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/buyer-risk`, options);\n }\n\n /**\n * Concrete evidence behind one fired buyer-risk signal on a payment:\n * IP addresses with location and VPN/proxy tags, earlier refused/disputed/\n * alerted/declined payments, 3-D Secure attempts, devices, masked cards\n * (brand and last four digits only), linked-group summaries, blocklist\n * entries, or identity verifications.\n *\n * Defaults to what the payment saw at scoring time (`view: 'scoring'`),\n * reports whether today's count differs (`changed_since_scoring`,\n * `current_count`), and accepts `view: 'current'` for the live view.\n * Enforces shop scoping, person/customer permissions, payment visibility,\n * and never names other merchants on `cross_merchant_fraud`.\n *\n * `GET /payments/{paymentId}/buyer-risk/evidence`\n */\n async buyerRiskEvidence(\n paymentId: string,\n params: BuyerRiskEvidenceQuery,\n options?: RequestExtras,\n ): Promise<BuyerRiskEvidenceResponse> {\n const query: Record<string, string | number> = { signal: params.signal };\n if (params.evaluation_id !== undefined && params.evaluation_id !== null) {\n query['evaluation_id'] = params.evaluation_id;\n }\n if (params.view !== undefined && params.view !== null) {\n query['view'] = params.view;\n }\n if (params.limit !== undefined && params.limit !== null) {\n query['limit'] = params.limit;\n }\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/buyer-risk/evidence`, {\n ...options,\n query,\n });\n }\n\n /**\n * Lift the holds put on an authorized payment when a chargeback prevention\n * alert or an AML hit on the same buyer arrived after it was scored and the\n * shop's `buyer_risk_source_changes` setting asked to hold it. Until then a\n * capture is refused with `IR_16`; after the release the payment can be\n * captured or cancelled as usual. A payment with no hold answers an empty\n * list. A caller scoped to one shop releases only that shop's payments.\n *\n * `POST /payments/{paymentId}/buyer-risk/release`\n */\n async releaseBuyerRiskHold(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<BuyerRiskReleaseResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/buyer-risk/release`,\n options,\n );\n }\n\n /**\n * What the payment's checkout client was, for AI shopping agents: a\n * verified agent (with its operator, protocol and key), an agent signature\n * that did not verify (with the reason), an automated client, or a browser.\n * The hosted checkout's render and the buyer's confirm are both judged, and\n * the strongest observation is kept.\n *\n * A payment never observed answers 404. A caller scoped to one shop reads\n * only that shop's payments.\n *\n * `GET /payments/{paymentId}/agent-signal`\n */\n async agentSignal(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentAgentSignalResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/agent-signal`, options);\n }\n\n /**\n * What a payment made from a Shopify store's cart was for: the cart lines,\n * shipping, discounts and totals as Shopify priced them, the Shopify order\n * made for it, and `order_sync`, where making that order stands. A payment\n * not made from a Shopify storefront answers 404.\n *\n * `GET /payments/{paymentId}/shopify`\n */\n async shopify(paymentId: string, options?: RequestExtras): Promise<PaymentShopifyResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/shopify`, options);\n }\n\n /** Product names and prices as frozen when the payment was created. */\n async productLines(paymentId: string): Promise<PaymentProductLines> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/lines`);\n }\n\n /**\n * List every attempt made on a payment, each with its full failure detail\n * (`error_code` / `error_message`, the Delopay-unified `unified_code` and\n * `unified_message`, and structured `error_details`).\n *\n * Useful for surfacing retries across connectors — e.g. \"attempt 1 stripe →\n * insufficient_funds, attempt 2 adyen → success\".\n *\n * `GET /payments/{paymentId}/attempts`\n *\n * @param paymentId - The payment intent ID whose attempts to list.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns The attempt list — `size` plus a `data` array of attempts.\n * @throws If the payment does not exist or belongs to another merchant (404).\n *\n * @example\n * ```typescript\n * const { size, data } = await delopay.payments.listAttempts('pay_abc123');\n * for (const attempt of data) {\n * console.log(attempt.status, attempt.unified_message ?? attempt.error_message);\n * }\n * ```\n */\n async listAttempts(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentAttemptsListResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/attempts`, options);\n }\n\n /**\n * The status timeline of a payment: every recorded creation / status\n * transition of the intent and its attempts, refunds and disputes, oldest\n * first. `complete: false` marks timelines partially reconstructed from\n * current records (payments created before the status log existed).\n *\n * @param paymentId - The payment intent ID.\n * @returns The ordered status-history events.\n *\n * @example\n * ```typescript\n * const { events, complete } = await delopay.payments.listStatusHistory('pay_abc123');\n * for (const event of events) {\n * console.log(event.timestamp, event.entity_type, event.status);\n * }\n * ```\n */\n async listStatusHistory(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentStatusHistoryResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/status-history`,\n options,\n );\n }\n\n /**\n * The traffic of a payment, oldest first: the requests DeloPay sent to the\n * payment provider, the webhooks the provider sent, and the webhooks DeloPay\n * sent to the shop with every delivery attempt. No payloads; read an entry\n * with {@link getLogConnectorCall}, {@link getLogIncomingWebhook} or\n * {@link getLogOutgoingWebhook}. Dashboard (JWT) only.\n *\n * @param paymentId - The payment intent ID.\n *\n * @example\n * ```typescript\n * const logs = await delopay.payments.listLogs('pay_abc123');\n * if (!logs.psp_traffic_recorded) console.log('provider traffic is not recorded');\n * ```\n */\n async listLogs(paymentId: string, options?: RequestExtras): Promise<PaymentLogsResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/logs`, options);\n }\n\n /** One provider request of a payment, with its masked request, response and error. */\n async getLogConnectorCall(\n paymentId: string,\n callId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogConnectorCallDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,\n options,\n );\n }\n\n /** One provider webhook of a payment, with its masked headers and body. */\n async getLogIncomingWebhook(\n paymentId: string,\n eventId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /** Every delivery attempt of one shop webhook of a payment, with request and response. */\n async getLogOutgoingWebhook(\n paymentId: string,\n initialAttemptId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogOutgoingWebhookDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,\n options,\n );\n }\n\n /**\n * What the payment's rail says about settling each attempt: whether the\n * money is still `pending` in the rail's hands, `available` in its balance\n * (**not** paid out), `paid_out` to a bank — with the payout's date and\n * reference — or came back as `payout_failed`; and, for the rest, which\n * kind of not-knowing applies (`unavailable`, `unknown`, `not_recorded`).\n * See {@link ConnectorSettlementStatus} for the seven values. The same\n * status for the active attempt rides on every list row and retrieve as\n * `connector_settlement_status`, and the list filters on it.\n *\n * Not the hosted-shop settlement API under `settlement.*`, which is host →\n * shop owner and manual; this is acquirer → merchant bank, per payment.\n *\n * Each attempt also carries what the rail itself took for it —\n * `processor_cost_amount` with its own `processor_cost_currency` and\n * `processor_cost_exponent`, the `processor_cost_source` that says how the\n * figure was obtained, the `processor_cost_basis` behind an estimate, and\n * the `connector_method_code` it was priced under. Recorded for **every**\n * merchant, not only those that host shops. Never present an `estimated`\n * cost as an observation, and read an absent `processor_cost_source` as\n * \"nothing was ever written\", which is not the `unavailable` the rail\n * answers with.\n *\n * `GET /payments/{paymentId}/settlement`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns The attempts this caller may see, oldest first, each with its\n * settlement status.\n * @throws If the payment does not exist (404), or the caller is a\n * profile-scoped (shop) role, who is refused rather than shown a redacted\n * body (403).\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.settlement('pay_abc123');\n * for (const attempt of attempts) {\n * if (attempt.status === 'paid_out') {\n * console.log(attempt.paid_out_at, attempt.payout_reference);\n * }\n * if (attempt.processor_cost_source === 'estimated') {\n * // Label it an estimate — it was derived from a cost schedule.\n * }\n * }\n * ```\n */\n async settlement(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentConnectorSettlementResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/settlement`, options);\n }\n\n /**\n * Update an existing payment intent before it is confirmed.\n *\n * @param paymentId - The payment intent ID to update.\n * @param params - Fields to update (amount, currency, metadata, etc.).\n * @returns The updated payment intent.\n */\n async update(paymentId: string, params: PaymentUpdateRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}`, { body: params });\n }\n\n /**\n * Confirm a payment intent, triggering authorisation with the selected gateway.\n *\n * @param paymentId - The payment intent ID to confirm.\n * @param params - Confirmation parameters (payment method data, return URL, etc.).\n * @returns The updated payment intent.\n *\n * A buyer the merchant's buyer risk model refuses fails before any processor\n * is called, with a `DelopayError` of code `DE_23` (`buyer_risk_refused`,\n * HTTP 422). The error does not say which signal fired; read the evaluation\n * with {@link Payments.buyerRisk}. A shop whose payments are switched off is\n * refused with `DE_21`.\n */\n async confirm(paymentId: string, params: PaymentConfirmRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/confirm`, {\n body: params,\n });\n }\n\n /**\n * Capture a previously authorised payment.\n *\n * @param paymentId - The payment intent ID to capture.\n * @param params - Optional capture parameters (partial capture amount, etc.).\n * @returns The updated payment intent.\n */\n async capture(paymentId: string, params?: PaymentCaptureRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/capture`, {\n body: params,\n });\n }\n\n /**\n * Cancel a payment intent that has not yet been captured.\n *\n * @param paymentId - The payment intent ID to cancel.\n * @param params - Optional cancellation reason.\n * @returns The updated payment intent.\n */\n async cancel(paymentId: string, params?: PaymentCancelRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/cancel`, {\n body: params,\n });\n }\n\n /**\n * Abort a payment nobody has paid. The payment becomes `aborted`: its hosted\n * checkout stops taking payments, a confirm is refused, and it can no longer\n * be reactivated. Every processor object a buyer could still pay is closed\n * where the processor allows it, and a `payment_aborted` webhook is sent.\n *\n * A success the processor confirms later still moves the payment to\n * `succeeded`, so the order can be fulfilled or refunded. Aborting an\n * aborted payment returns it unchanged. A payment that took money, holds an\n * authorisation or awaits a merchant decision is refused with `IR_16`\n * (HTTP 400).\n *\n * `POST /payments/{paymentId}/abort`\n *\n * @param paymentId - The payment intent ID to abort.\n * @param params - Optional `reason`, at most 255 characters, stored as the\n * attempt's cancellation reason (`merchant_aborted` when absent).\n * @returns The payment, with status `aborted`.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.abort('pay_123', { reason: 'order_cancelled' });\n * ```\n */\n async abort(paymentId: string, params?: PaymentAbortRequest): Promise<PaymentResponse> {\n // The route requires a JSON body, even an empty one.\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/abort`, {\n body: params ?? {},\n });\n }\n\n /**\n * Mark a payment as an integration test, or remove the mark.\n *\n * A marked payment stays live or test as it was; only analytics leave it\n * out, from their next refresh on. Every change is recorded in the\n * payment's status history with the person who made it. Needs a dashboard\n * JWT with write access to transactions. Asking for the mark the payment\n * already carries changes nothing (`changed: false`).\n *\n * `POST /payments/{paymentId}/integration-test`\n *\n * @example\n * ```typescript\n * const { is_integration_test } = await delopay.payments.setIntegrationTest('pay_123', {\n * is_integration_test: true,\n * });\n * ```\n */\n async setIntegrationTest(\n paymentId: string,\n params: PaymentIntegrationTestRequest,\n ): Promise<PaymentIntegrationTestResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/integration-test`, {\n body: params,\n });\n }\n\n /**\n * List payment intents, optionally filtered by customer, date range or\n * the integrations that created them (`integration_origin`).\n *\n * @param params - Optional filter and pagination parameters.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal` for cancellation.\n * @returns Paginated list of payment intents.\n *\n * @example\n * ```typescript\n * const { data } = await delopay.payments.list({ customer_id: 'cus_123', limit: 25 });\n * ```\n */\n async list(params?: PaymentListParams, options?: RequestExtras): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/list', {\n query: paymentListQuery(params),\n ...options,\n });\n }\n\n /**\n * The status timeline of client/device observations captured while the\n * buyer interacted with the payment (checkout opens, confirms, redirect\n * legs, reported client signals), oldest first.\n *\n * `GET /payments/{paymentId}/client-context`\n */\n async listClientContext(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentClientContextListResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/client-context`,\n options,\n );\n }\n\n /**\n * The routing decision recorded behind each attempt of a payment: which rule\n * matched, which candidates routing produced and which filter removed each,\n * which volume bucket was drawn and what the counters read, which\n * configuration version was live.\n *\n * This is the only truthful account of **how the connector was chosen**.\n * `routing_approach` on the payment is seeded on creation and several paths —\n * mandate, pre-routed and pinned-account among them — return before it is\n * overwritten, so it can still read `default_fallback` on a payment that was\n * routed by a rule. Read {@link RoutingDecision.decision_kind} instead.\n *\n * An attempt with `decision: null` simply has no record: the recorder is\n * best-effort, attempts that never reached routing have nothing to record,\n * and attempts predating the record exist in quantity. It is not an error.\n *\n * `GET /payments/{paymentId}/routing-decisions`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns Every attempt returned for this payment, with its decision.\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.routingDecisions('pay_abc123');\n * for (const attempt of attempts) {\n * if (!attempt.decision) continue;\n * console.log(attempt.connector, attempt.decision.decision_kind);\n * }\n * ```\n */\n async routingDecisions(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentRoutingDecisionsResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/routing-decisions`,\n options,\n );\n }\n\n /**\n * The statement name and suffix each attempt of a payment asked for and was\n * sent to its provider with. A name the merchant, the shop or the connector\n * account configures replaces the payment's own: `name_ignored` /\n * `suffix_ignored` say the payment's value was not used, and a `null` sent\n * value leaves the provider account's own default.\n *\n * Only attempts with a record are listed: one that carried no name and was\n * sent none, or ran before the record existed, is absent.\n *\n * `GET /payments/{paymentId}/statement-descriptors`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.statementDescriptors('pay_abc123');\n * const last = attempts.at(-1);\n * if (last?.name_ignored) console.log(`Sent as ${last.sent_name}`);\n * ```\n */\n async statementDescriptors(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentStatementDescriptorsResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/statement-descriptors`,\n options,\n );\n }\n\n /**\n * Every shipment tracking number added to a payment, oldest first. Cancelled\n * and replaced trackings are included, with `status: 'cancelled'`; a\n * replaced one names its correction in `replaced_by`.\n *\n * `GET /payments/{paymentId}/shipment-tracking`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const { data } = await delopay.payments.listShipmentTracking('pay_abc123');\n * const active = data.filter((t) => t.status === 'shipped');\n * ```\n */\n async listShipmentTracking(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingListResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/shipment-tracking`,\n options,\n );\n }\n\n /**\n * Add a shipment tracking number to a captured PayPal payment. PayPal shows\n * it to the buyer, and emails them when `notify_buyer` is `true`.\n *\n * Safe to retry: the same tracking number on the same payment returns the\n * tracking already added and never adds a second one at PayPal. The same\n * number with a different carrier or items is refused (`HE_01`); change it\n * with {@link Payments.updateShipmentTracking}.\n *\n * Refused with HTTP 400: `IR_06` for invalid input, `IR_16` for a payment\n * PayPal did not process or that is not captured, and a connector error,\n * carrying PayPal's reason, when PayPal refuses the tracking.\n *\n * `POST /payments/{paymentId}/shipment-tracking`\n *\n * @param paymentId - The payment intent ID.\n * @param params - The carrier, tracking number and, optionally, the items.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const tracking = await delopay.payments.addShipmentTracking('pay_abc123', {\n * carrier: 'UPS',\n * tracking_number: '1Z999AA10123456784',\n * notify_buyer: true,\n * });\n * if (tracking.sync_status === 'failed') console.log(tracking.sync_error);\n * ```\n */\n async addShipmentTracking(\n paymentId: string,\n params: ShipmentTrackingCreateRequest,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/shipment-tracking`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct, replace or cancel a shipment tracking added earlier.\n *\n * A new `tracking_number`, optionally with a new `carrier`, replaces the\n * tracking: a new tracking is added at PayPal and the old one is cancelled\n * there. A new `carrier` alone is refused once PayPal holds the tracking. The answer is then\n * the **new** tracking, with its own `tracking_id`; the old one reads\n * `status: 'cancelled'` with `replaced_by` set. New `items` replace every\n * item at PayPal. `status: 'cancelled'`, sent alone, withdraws the tracking\n * at PayPal. Safe to retry.\n *\n * `POST /payments/{paymentId}/shipment-tracking/{trackingId}`\n *\n * @param paymentId - The payment intent ID.\n * @param trackingId - The `trk_…` ID of the tracking to change.\n * @param params - At least one field to change.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * await delopay.payments.updateShipmentTracking('pay_abc123', 'trk_abc', {\n * status: 'cancelled',\n * });\n * ```\n */\n async updateShipmentTracking(\n paymentId: string,\n trackingId: string,\n params: ShipmentTrackingUpdateRequest,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/shipment-tracking/${encodeURIComponent(trackingId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Open a playback of the payment's stored checkout recording: the audited\n * act of watching. Answers the manifest — which slices exist, how long the\n * recording runs, whether a pause in it is expected — and the\n * `playback_id` every {@link Payments.replaySlice} call carries.\n *\n * A payment that was never recorded answers `200` with `slices: []` and\n * `session_id: null` — the ordinary case for every payment made before the\n * checkout started recording — not a `404`. `404` means the payment does not\n * exist. Fetch the slices in `sequence` order; a number missing from the\n * list is a gap, not the end.\n *\n * A `POST`, because it writes one audit row: the SDK retries `GET` on its\n * own, and a lost response must not open three playbacks. Calling this\n * again deliberately opens another playback.\n *\n * Requires the `PaymentReplay` permission on a dashboard session in addition\n * to payment read access.\n *\n * `POST /payments/{paymentId}/replay/playback`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n */\n async openReplayPlayback(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ReplayPlaybackResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/replay/playback`,\n options,\n );\n }\n\n /**\n * One slice of the payment's stored checkout recording, read against an\n * open playback: the rrweb events the checkout recorded under that number.\n * `playbackId` and the numbers come from {@link Payments.openReplayPlayback};\n * a `playbackId` that names no playback of this payment opened by this\n * caller, and a number the manifest does not list, both answer `404`.\n * Not audited per slice — the playback was.\n *\n * `GET /payments/{paymentId}/replay/playback/{playbackId}/slices/{sequence}`\n *\n * @param paymentId - The payment intent ID.\n * @param playbackId - The playback, from `openReplayPlayback`.\n * @param sequence - The slice number, from the playback's manifest.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n */\n async replaySlice(\n paymentId: string,\n playbackId: string,\n sequence: number,\n options?: RequestExtras,\n ): Promise<ReplaySliceResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/replay/playback/${encodeURIComponent(playbackId)}/slices/${encodeURIComponent(String(sequence))}`,\n options,\n );\n }\n\n /**\n * Soft-delete a payment. Only payments whose status is in the merchant's\n * delete policy (see {@link Payments.getDeletePolicy}) can be deleted;\n * anything else fails with a precondition error.\n *\n * `DELETE /payments/{paymentId}`\n */\n async delete(paymentId: string, options?: RequestExtras): Promise<PaymentsDeleteResponse> {\n return this.request('DELETE', `/payments/${encodeURIComponent(paymentId)}`, options);\n }\n\n /**\n * The effective deletable-status set for the calling merchant — lets a\n * dashboard show the delete action only where it is allowed.\n *\n * `GET /payments/delete-policy`\n */\n async getDeletePolicy(options?: RequestExtras): Promise<PaymentsDeletePolicyResponse> {\n return this.request('GET', '/payments/delete-policy', options);\n }\n\n // --- Advanced operations (Task 3.2) ---\n\n /** Generate session tokens. `POST /payments/session-tokens` */\n async sessionTokens(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payments/session-tokens', { body: params });\n }\n\n /** Retrieve payment with gateway credentials. `POST /payments/sync` */\n async sync(params: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', '/payments/sync', { body: params });\n }\n\n /** Cancel after partial capture. `POST /payments/{paymentId}/cancel-post-capture` */\n async cancelPostCapture(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/cancel-post-capture`, {\n body: params,\n });\n }\n\n /** Incrementally authorize more funds. `POST /payments/{paymentId}/incremental-authorization` */\n async incrementalAuthorization(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/incremental-authorization`,\n {\n body: params,\n },\n );\n }\n\n /** Extend authorization window. `POST /payments/{paymentId}/extend-authorization` */\n async extendAuthorization(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/extend-authorization`, {\n body: params,\n });\n }\n\n /** Complete authorization. `POST /payments/{paymentId}/complete-authorize` */\n async completeAuthorize(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/complete-authorize`, {\n body: params,\n });\n }\n\n /** Dynamic tax calculation. `POST /payments/{paymentId}/calculate-tax` */\n async calculateTax(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/calculate-tax`, {\n body: params,\n });\n }\n\n /** Update payment metadata. `POST /payments/{paymentId}/update-metadata` */\n async updateMetadata(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/update-metadata`, {\n body: params,\n });\n }\n\n /** Retrieve extended card info. `GET /payments/{paymentId}/extended-card-info` */\n async extendedCardInfo(paymentId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/extended-card-info`);\n }\n\n // --- OLAP extensions (Task 4.2) ---\n\n /** List payments (profile-scoped). `GET /payments/profile/list` */\n async listByProfile(params?: PaymentListParams): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/profile/list', {\n query: paymentListQuery(params),\n });\n }\n\n /** List payments across all shops. `GET /payments/list-all-shops` */\n async listAllShops(params?: PaymentListParams): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/list-all-shops', {\n query: paymentListQuery(params),\n });\n }\n\n /** List payments by filter (POST body). `POST /payments/list` */\n async listByFilter(params: PaymentListFilterConstraints): Promise<PaymentListFilteredResponse> {\n return this.request('POST', '/payments/list', { body: params });\n }\n\n /**\n * List payments by filter, scoped to the caller's profile (the shop-user\n * twin of `listByFilter`). The backend narrows to the profile from the\n * auth context, so `profile_id` / `project_id` must not be sent — and\n * neither may `connector_settlement_status`, which this route refuses\n * (403): a shop-scoped viewer is not shown the settlement state, and the\n * type leaves the key out so it cannot be probed through `total_count`.\n *\n * Not to be confused with {@link Payments.listByProfile}, which is the GET\n * cursor variant and rejects this body.\n *\n * `POST /payments/profile/list`\n */\n async listByProfileFilter(\n params: ProfilePaymentListFilterConstraints,\n options?: RequestExtras,\n ): Promise<PaymentListFilteredResponse> {\n return this.request('POST', '/payments/profile/list', { body: params, ...options });\n }\n\n /** Get payment filter options. `GET /payments/filter` */\n async getFilters(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentListFiltersExt> {\n return this.request('GET', '/payments/filter', { query: params });\n }\n\n /**\n * Get payment filter options, scoped to the caller's profile.\n * `GET /payments/profile/filter`\n */\n async getFiltersByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentListFiltersExt> {\n return this.request('GET', '/payments/profile/filter', { query: params });\n }\n\n /** Get payment aggregates. `GET /payments/aggregate` */\n async aggregate(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/payments/aggregate', { query: params });\n }\n\n /** Get payment aggregates (profile-scoped). `GET /payments/profile/aggregate` */\n async aggregateByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/payments/profile/aggregate', { query: params });\n }\n\n /** Manually update payment status. `PUT /payments/{paymentId}/manual-update` */\n async manualUpdate(paymentId: string, params: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('PUT', `/payments/${encodeURIComponent(paymentId)}/manual-update`, {\n body: params,\n });\n }\n\n /** Approve a payment waiting for review. `POST /payments/{paymentId}/approve` */\n async approve(paymentId: string, params?: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/approve`, {\n body: params,\n });\n }\n\n /** Reject a payment waiting for review. `POST /payments/{paymentId}/reject` */\n async reject(paymentId: string, params?: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/reject`, {\n body: params,\n });\n }\n\n /** Initiate external 3DS authentication. `POST /payments/{paymentId}/3ds/authentication` */\n async threeDsAuthentication(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/3ds/authentication`, {\n body: params,\n });\n }\n}\n\n/** The GET payment lists' query: `integration_origin` goes comma-separated. */\nfunction paymentListQuery(\n params?: PaymentListParams,\n): Record<string, string | number | null | undefined> | undefined {\n if (!params) return undefined;\n const { integration_origin, ...query } = params;\n return {\n ...query,\n ...(Array.isArray(integration_origin)\n ? integration_origin.length\n ? { integration_origin: integration_origin.join(',') }\n : {}\n : integration_origin != null\n ? { integration_origin }\n : {}),\n };\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-UTCXNBID.cjs","../src/resources/payments.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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6E,EAAA;AACpB,IAAA;AACvB,MAAA;AAC/B,IAAA;AACH,EAAA;AAAA;AAG+F,EAAA;AACvC,IAAA;AACxD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBwC,EAAA;AACkB,IAAA;AAC1D,EAAA;AAAA;AAKkC,EAAA;AACwB,IAAA;AAC1D,EAAA;AAAA;AAAA;AAAA;AAAA;AAQkC,EAAA;AACuB,IAAA;AACzD,EAAA;AAAA;AAKoC,EAAA;AACkB,IAAA;AACtD,EAAA;AAAA;AAKoC,EAAA;AACP,IAAA;AAC7B,EAAA;AAAA;AAGiG,EAAA;AACvD,IAAA;AAChC,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG6F,EAAA;AAClD,IAAA;AACjC,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG4F,EAAA;AACjD,IAAA;AACjC,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAMoC,EAAA;AACO,IAAA;AACjC,MAAA;AACP,IAAA;AACH,EAAA;AACF;AAKkE;AAC5C,EAAA;AACqB,EAAA;AAClC,EAAA;AACF,IAAA;AAEC,IAAA;AAMN,EAAA;AACF;ADnN4D;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-UTCXNBID.cjs","sourcesContent":[null,"import type {\n BuyerRiskEvaluationsResponse,\n BuyerRiskEvidenceQuery,\n BuyerRiskEvidenceResponse,\n BuyerRiskReleaseResponse,\n PaymentAgentSignalResponse,\n PaymentClientContextListResponse,\n PaymentCreateRequest,\n ProductPaymentCreateRequest,\n ProductsPaymentCreateRequest,\n PaymentListFilterConstraints,\n PaymentListFilteredResponse,\n ProfilePaymentListFilterConstraints,\n PaymentListResponse,\n PaymentResponse,\n PaymentProductLines,\n PaymentShopifyResponse,\n PaymentRetrieveOptions,\n PaymentUpdateRequest,\n PaymentConfirmRequest,\n PaymentCaptureRequest,\n PaymentCancelRequest,\n PaymentAbortRequest,\n PaymentIntegrationTestRequest,\n PaymentIntegrationTestResponse,\n PaymentListParams,\n PaymentAttemptsListResponse,\n PaymentConnectorSettlementResponse,\n PaymentsDeletePolicyResponse,\n PaymentsDeleteResponse,\n PaymentStatusHistoryResponse,\n PaymentLogsResponse,\n PaymentLogConnectorCallDetail,\n PaymentLogIncomingWebhookDetail,\n PaymentLogOutgoingWebhookDetail,\n PaymentRoutingDecisionsResponse,\n PaymentStatementDescriptorsResponse,\n ShipmentTrackingCreateRequest,\n ShipmentTrackingListResponse,\n ShipmentTrackingResponse,\n ShipmentTrackingUpdateRequest,\n ReplayPlaybackResponse,\n ReplaySliceResponse,\n PaymentListFiltersExt,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Manage payment intents — create, confirm, capture, cancel, and list payments. */\nexport class Payments {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a new payment intent.\n *\n * @param params - An explicit amount and currency, or a DeloPay one-time\n * product whose active price supplies both on the server.\n * @param options - Optional per-call extras: extra `headers` (e.g. an\n * `Idempotency-Key` to make the create safe to retry), a `timeout` override,\n * and an `AbortSignal`.\n * @returns The created payment intent.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.create(\n * { amount: 5000, currency: 'EUR', customer_id: 'cus_123' },\n * { headers: { 'Idempotency-Key': 'order_1001' } },\n * );\n * ```\n *\n * @example Charge the active default price of a shop-owned product without\n * copying the product to the payment provider:\n * ```typescript\n * const payment = await delopay.payments.create({\n * product_id: 'prd_123',\n * profile_id: 'pro_123',\n * payment_link: true,\n * });\n * ```\n *\n * @example Send `test_mode` to pick the environment per payment, so a staging\n * deploy cannot charge real cards and a forgotten processor toggle cannot\n * swallow production traffic:\n * ```typescript\n * const payment = await delopay.payments.create({\n * amount: 5000,\n * currency: 'EUR',\n * test_mode: process.env.NODE_ENV !== 'production',\n * });\n * ```\n *\n * A payment that pins one connector through `routing` (the `single` form)\n * is now checked against `test_mode` here rather than at confirm: if that\n * connector has no credentials for the environment asked for, create fails\n * instead of handing back a payment whose checkout the buyer cannot\n * complete. `priority` and `volume_split` name several accounts and are\n * still resolved at confirm.\n */\n async create(\n params: PaymentCreateRequest | ProductPaymentCreateRequest | ProductsPaymentCreateRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.request('POST', '/payments', { body: params, ...options });\n }\n\n /**\n * Retrieve a payment by its ID.\n *\n * @param paymentId - The unique payment intent ID.\n * @param options - Optional query flags. `force_sync` reconciles the\n * intent's state with the connector before returning (useful to recover\n * a stuck intent when a webhook was lost). `all_keys_required` forces a\n * connector sync even for intents in early states like\n * `requires_payment_method` that would otherwise return the local\n * snapshot. Both flags work with JWT and API-key authentication.\n * @returns The payment intent.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.retrieve('pay_abc123');\n * const synced = await delopay.payments.retrieve('pay_abc123', {\n * force_sync: true,\n * all_keys_required: true,\n * });\n * ```\n */\n async retrieve(paymentId: string, options?: PaymentRetrieveOptions): Promise<PaymentResponse> {\n const path = `/payments/${encodeURIComponent(paymentId)}`;\n if (options === undefined) return this.request('GET', path);\n const query: Record<string, boolean> = {};\n if (options.force_sync !== undefined) query['force_sync'] = options.force_sync;\n if (options.all_keys_required !== undefined) {\n query['all_keys_required'] = options.all_keys_required;\n }\n if (Object.keys(query).length === 0) return this.request('GET', path);\n return this.request('GET', path, { query });\n }\n\n /**\n * The payment's buyer risk evaluations, newest first (at most 50): each\n * one's score from 0 to 100, its band, the action the merchant's model asks\n * for that band and the action that was taken, the signals that fired with\n * the points each added, and the model version it was scored with.\n *\n * A payment is scored at every confirm that is about to reach a processor;\n * a payment never scored answers an empty list. A caller scoped to one shop\n * reads only that shop's payments.\n *\n * `GET /payments/{paymentId}/buyer-risk`\n */\n async buyerRisk(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<BuyerRiskEvaluationsResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/buyer-risk`, options);\n }\n\n /**\n * Concrete evidence behind one fired buyer-risk signal on a payment:\n * IP addresses with location and VPN/proxy tags, earlier refused/disputed/\n * alerted/declined payments, 3-D Secure attempts, devices, masked cards\n * (brand and last four digits only), linked-group summaries, blocklist\n * entries, or identity verifications.\n *\n * Defaults to what the payment saw at scoring time (`view: 'scoring'`),\n * reports whether today's count differs (`changed_since_scoring`,\n * `current_count`), and accepts `view: 'current'` for the live view.\n * Enforces shop scoping, person/customer permissions, payment visibility,\n * and never names other merchants on `cross_merchant_fraud`.\n *\n * `GET /payments/{paymentId}/buyer-risk/evidence`\n */\n async buyerRiskEvidence(\n paymentId: string,\n params: BuyerRiskEvidenceQuery,\n options?: RequestExtras,\n ): Promise<BuyerRiskEvidenceResponse> {\n const query: Record<string, string | number> = { signal: params.signal };\n if (params.evaluation_id !== undefined && params.evaluation_id !== null) {\n query['evaluation_id'] = params.evaluation_id;\n }\n if (params.view !== undefined && params.view !== null) {\n query['view'] = params.view;\n }\n if (params.limit !== undefined && params.limit !== null) {\n query['limit'] = params.limit;\n }\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/buyer-risk/evidence`, {\n ...options,\n query,\n });\n }\n\n /**\n * Lift the holds put on an authorized payment when a chargeback prevention\n * alert or an AML hit on the same buyer arrived after it was scored and the\n * shop's `buyer_risk_source_changes` setting asked to hold it. Until then a\n * capture is refused with `IR_16`; after the release the payment can be\n * captured or cancelled as usual. A payment with no hold answers an empty\n * list. A caller scoped to one shop releases only that shop's payments.\n *\n * `POST /payments/{paymentId}/buyer-risk/release`\n */\n async releaseBuyerRiskHold(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<BuyerRiskReleaseResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/buyer-risk/release`,\n options,\n );\n }\n\n /**\n * What the payment's checkout client was, for AI shopping agents: a\n * verified agent (with its operator, protocol and key), an agent signature\n * that did not verify (with the reason), an automated client, or a browser.\n * The hosted checkout's render and the buyer's confirm are both judged, and\n * the strongest observation is kept.\n *\n * A payment never observed answers 404. A caller scoped to one shop reads\n * only that shop's payments.\n *\n * `GET /payments/{paymentId}/agent-signal`\n */\n async agentSignal(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentAgentSignalResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/agent-signal`, options);\n }\n\n /**\n * What a payment made from a Shopify store's cart was for: the cart lines,\n * shipping, discounts and totals as Shopify priced them, the Shopify order\n * made for it, and `order_sync`, where making that order stands. A payment\n * not made from a Shopify storefront answers 404.\n *\n * `GET /payments/{paymentId}/shopify`\n */\n async shopify(paymentId: string, options?: RequestExtras): Promise<PaymentShopifyResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/shopify`, options);\n }\n\n /** Product names and prices as frozen when the payment was created. */\n async productLines(paymentId: string): Promise<PaymentProductLines> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/lines`);\n }\n\n /**\n * List every attempt made on a payment, each with its full failure detail\n * (`error_code` / `error_message`, the Delopay-unified `unified_code` and\n * `unified_message`, and structured `error_details`).\n *\n * Useful for surfacing retries across connectors — e.g. \"attempt 1 stripe →\n * insufficient_funds, attempt 2 adyen → success\".\n *\n * `GET /payments/{paymentId}/attempts`\n *\n * @param paymentId - The payment intent ID whose attempts to list.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns The attempt list — `size` plus a `data` array of attempts.\n * @throws If the payment does not exist or belongs to another merchant (404).\n *\n * @example\n * ```typescript\n * const { size, data } = await delopay.payments.listAttempts('pay_abc123');\n * for (const attempt of data) {\n * console.log(attempt.status, attempt.unified_message ?? attempt.error_message);\n * }\n * ```\n */\n async listAttempts(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentAttemptsListResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/attempts`, options);\n }\n\n /**\n * The status timeline of a payment: every recorded creation / status\n * transition of the intent and its attempts, refunds and disputes, oldest\n * first. `complete: false` marks timelines partially reconstructed from\n * current records (payments created before the status log existed).\n *\n * @param paymentId - The payment intent ID.\n * @returns The ordered status-history events.\n *\n * @example\n * ```typescript\n * const { events, complete } = await delopay.payments.listStatusHistory('pay_abc123');\n * for (const event of events) {\n * console.log(event.timestamp, event.entity_type, event.status);\n * }\n * ```\n */\n async listStatusHistory(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentStatusHistoryResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/status-history`,\n options,\n );\n }\n\n /**\n * The traffic of a payment, oldest first: the requests DeloPay sent to the\n * payment provider, the webhooks the provider sent, and the webhooks DeloPay\n * sent to the shop with every delivery attempt. No payloads; read an entry\n * with {@link getLogConnectorCall}, {@link getLogIncomingWebhook} or\n * {@link getLogOutgoingWebhook}. Dashboard (JWT) only.\n *\n * @param paymentId - The payment intent ID.\n *\n * @example\n * ```typescript\n * const logs = await delopay.payments.listLogs('pay_abc123');\n * if (!logs.psp_traffic_recorded) console.log('provider traffic is not recorded');\n * ```\n */\n async listLogs(paymentId: string, options?: RequestExtras): Promise<PaymentLogsResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/logs`, options);\n }\n\n /** One provider request of a payment, with its masked request, response and error. */\n async getLogConnectorCall(\n paymentId: string,\n callId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogConnectorCallDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/connector-calls/${encodeURIComponent(callId)}`,\n options,\n );\n }\n\n /** One provider webhook of a payment, with its masked headers and body. */\n async getLogIncomingWebhook(\n paymentId: string,\n eventId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/incoming-webhooks/${encodeURIComponent(eventId)}`,\n options,\n );\n }\n\n /** Every delivery attempt of one shop webhook of a payment, with request and response. */\n async getLogOutgoingWebhook(\n paymentId: string,\n initialAttemptId: string,\n options?: RequestExtras,\n ): Promise<PaymentLogOutgoingWebhookDetail> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/logs/outgoing-webhooks/${encodeURIComponent(initialAttemptId)}`,\n options,\n );\n }\n\n /**\n * What the payment's rail says about settling each attempt: whether the\n * money is still `pending` in the rail's hands, `available` in its balance\n * (**not** paid out), `paid_out` to a bank — with the payout's date and\n * reference — or came back as `payout_failed`; and, for the rest, which\n * kind of not-knowing applies (`unavailable`, `unknown`, `not_recorded`).\n * See {@link ConnectorSettlementStatus} for the seven values. The same\n * status for the active attempt rides on every list row and retrieve as\n * `connector_settlement_status`, and the list filters on it.\n *\n * Not the hosted-shop settlement API under `settlement.*`, which is host →\n * shop owner and manual; this is acquirer → merchant bank, per payment.\n *\n * Each attempt also carries what the rail itself took for it —\n * `processor_cost_amount` with its own `processor_cost_currency` and\n * `processor_cost_exponent`, the `processor_cost_source` that says how the\n * figure was obtained, the `processor_cost_basis` behind an estimate, and\n * the `connector_method_code` it was priced under. Recorded for **every**\n * merchant, not only those that host shops. Never present an `estimated`\n * cost as an observation, and read an absent `processor_cost_source` as\n * \"nothing was ever written\", which is not the `unavailable` the rail\n * answers with.\n *\n * `GET /payments/{paymentId}/settlement`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns The attempts this caller may see, oldest first, each with its\n * settlement status.\n * @throws If the payment does not exist (404), or the caller is a\n * profile-scoped (shop) role, who is refused rather than shown a redacted\n * body (403).\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.settlement('pay_abc123');\n * for (const attempt of attempts) {\n * if (attempt.status === 'paid_out') {\n * console.log(attempt.paid_out_at, attempt.payout_reference);\n * }\n * if (attempt.processor_cost_source === 'estimated') {\n * // Label it an estimate — it was derived from a cost schedule.\n * }\n * }\n * ```\n */\n async settlement(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentConnectorSettlementResponse> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/settlement`, options);\n }\n\n /**\n * Update an existing payment intent before it is confirmed.\n *\n * @param paymentId - The payment intent ID to update.\n * @param params - Fields to update (amount, currency, metadata, etc.).\n * @returns The updated payment intent.\n */\n async update(paymentId: string, params: PaymentUpdateRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}`, { body: params });\n }\n\n /**\n * Confirm a payment intent, triggering authorisation with the selected gateway.\n *\n * @param paymentId - The payment intent ID to confirm.\n * @param params - Confirmation parameters (payment method data, return URL, etc.).\n * @returns The updated payment intent.\n *\n * A buyer the merchant's buyer risk model refuses fails before any processor\n * is called, with a `DelopayError` of code `DE_23` (`buyer_risk_refused`,\n * HTTP 422). The error does not say which signal fired; read the evaluation\n * with {@link Payments.buyerRisk}. A shop whose payments are switched off is\n * refused with `DE_21`.\n */\n async confirm(paymentId: string, params: PaymentConfirmRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/confirm`, {\n body: params,\n });\n }\n\n /**\n * Capture a previously authorised payment.\n *\n * @param paymentId - The payment intent ID to capture.\n * @param params - Optional capture parameters (partial capture amount, etc.).\n * @returns The updated payment intent.\n */\n async capture(paymentId: string, params?: PaymentCaptureRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/capture`, {\n body: params,\n });\n }\n\n /**\n * Cancel a payment intent that has not yet been captured.\n *\n * @param paymentId - The payment intent ID to cancel.\n * @param params - Optional cancellation reason.\n * @returns The updated payment intent.\n */\n async cancel(paymentId: string, params?: PaymentCancelRequest): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/cancel`, {\n body: params,\n });\n }\n\n /**\n * Abort a payment nobody has paid. The payment becomes `aborted`: its hosted\n * checkout stops taking payments, a confirm is refused, and it can no longer\n * be reactivated. Every processor object a buyer could still pay is closed\n * where the processor allows it, and a `payment_aborted` webhook is sent.\n *\n * A success the processor confirms later still moves the payment to\n * `succeeded`, so the order can be fulfilled or refunded. Aborting an\n * aborted payment returns it unchanged. A payment that took money, holds an\n * authorisation or awaits a merchant decision is refused with `IR_16`\n * (HTTP 400).\n *\n * `POST /payments/{paymentId}/abort`\n *\n * @param paymentId - The payment intent ID to abort.\n * @param params - Optional `reason`, at most 255 characters, stored as the\n * attempt's cancellation reason (`merchant_aborted` when absent).\n * @returns The payment, with status `aborted`.\n *\n * @example\n * ```typescript\n * const payment = await delopay.payments.abort('pay_123', { reason: 'order_cancelled' });\n * ```\n */\n async abort(paymentId: string, params?: PaymentAbortRequest): Promise<PaymentResponse> {\n // The route requires a JSON body, even an empty one.\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/abort`, {\n body: params ?? {},\n });\n }\n\n /**\n * Mark a payment as an integration test, or remove the mark.\n *\n * A marked payment stays live or test as it was; only analytics leave it\n * out, from their next refresh on. Every change is recorded in the\n * payment's status history with the person who made it. Needs a dashboard\n * JWT with write access to transactions. Asking for the mark the payment\n * already carries changes nothing (`changed: false`).\n *\n * `POST /payments/{paymentId}/integration-test`\n *\n * @example\n * ```typescript\n * const { is_integration_test } = await delopay.payments.setIntegrationTest('pay_123', {\n * is_integration_test: true,\n * });\n * ```\n */\n async setIntegrationTest(\n paymentId: string,\n params: PaymentIntegrationTestRequest,\n ): Promise<PaymentIntegrationTestResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/integration-test`, {\n body: params,\n });\n }\n\n /**\n * List payment intents, optionally filtered by customer, date range or\n * the integrations that created them (`integration_origin`).\n *\n * @param params - Optional filter and pagination parameters.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal` for cancellation.\n * @returns Paginated list of payment intents.\n *\n * @example\n * ```typescript\n * const { data } = await delopay.payments.list({ customer_id: 'cus_123', limit: 25 });\n * ```\n */\n async list(params?: PaymentListParams, options?: RequestExtras): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/list', {\n query: paymentListQuery(params),\n ...options,\n });\n }\n\n /**\n * The status timeline of client/device observations captured while the\n * buyer interacted with the payment (checkout opens, confirms, redirect\n * legs, reported client signals), oldest first.\n *\n * `GET /payments/{paymentId}/client-context`\n */\n async listClientContext(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentClientContextListResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/client-context`,\n options,\n );\n }\n\n /**\n * The routing decision recorded behind each attempt of a payment: which rule\n * matched, which candidates routing produced and which filter removed each,\n * which volume bucket was drawn and what the counters read, which\n * configuration version was live.\n *\n * This is the only truthful account of **how the connector was chosen**.\n * `routing_approach` on the payment is seeded on creation and several paths —\n * mandate, pre-routed and pinned-account among them — return before it is\n * overwritten, so it can still read `default_fallback` on a payment that was\n * routed by a rule. Read {@link RoutingDecision.decision_kind} instead.\n *\n * An attempt with `decision: null` simply has no record: the recorder is\n * best-effort, attempts that never reached routing have nothing to record,\n * and attempts predating the record exist in quantity. It is not an error.\n *\n * `GET /payments/{paymentId}/routing-decisions`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n * @returns Every attempt returned for this payment, with its decision.\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.routingDecisions('pay_abc123');\n * for (const attempt of attempts) {\n * if (!attempt.decision) continue;\n * console.log(attempt.connector, attempt.decision.decision_kind);\n * }\n * ```\n */\n async routingDecisions(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentRoutingDecisionsResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/routing-decisions`,\n options,\n );\n }\n\n /**\n * The statement name and suffix each attempt of a payment asked for and was\n * sent to its provider with. A name the merchant, the shop or the connector\n * account configures replaces the payment's own: `name_ignored` /\n * `suffix_ignored` say the payment's value was not used, and a `null` sent\n * value leaves the provider account's own default.\n *\n * Only attempts with a record are listed: one that carried no name and was\n * sent none, or ran before the record existed, is absent.\n *\n * `GET /payments/{paymentId}/statement-descriptors`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const { attempts } = await delopay.payments.statementDescriptors('pay_abc123');\n * const last = attempts.at(-1);\n * if (last?.name_ignored) console.log(`Sent as ${last.sent_name}`);\n * ```\n */\n async statementDescriptors(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentStatementDescriptorsResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/statement-descriptors`,\n options,\n );\n }\n\n /**\n * Every shipment tracking number added to a payment, oldest first. Cancelled\n * and replaced trackings are included, with `status: 'cancelled'`; a\n * replaced one names its correction in `replaced_by`.\n *\n * `GET /payments/{paymentId}/shipment-tracking`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const { data } = await delopay.payments.listShipmentTracking('pay_abc123');\n * const active = data.filter((t) => t.status === 'shipped');\n * ```\n */\n async listShipmentTracking(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingListResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/shipment-tracking`,\n options,\n );\n }\n\n /**\n * Add a shipment tracking number to a captured PayPal payment. PayPal shows\n * it to the buyer, and emails them when `notify_buyer` is `true`.\n *\n * Safe to retry: the same tracking number on the same payment returns the\n * tracking already added and never adds a second one at PayPal. The same\n * number with a different carrier or items is refused (`HE_01`); change it\n * with {@link Payments.updateShipmentTracking}.\n *\n * Refused with HTTP 400: `IR_06` for invalid input, `IR_16` for a payment\n * PayPal did not process or that is not captured, and a connector error,\n * carrying PayPal's reason, when PayPal refuses the tracking.\n *\n * `POST /payments/{paymentId}/shipment-tracking`\n *\n * @param paymentId - The payment intent ID.\n * @param params - The carrier, tracking number and, optionally, the items.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * const tracking = await delopay.payments.addShipmentTracking('pay_abc123', {\n * carrier: 'UPS',\n * tracking_number: '1Z999AA10123456784',\n * notify_buyer: true,\n * });\n * if (tracking.sync_status === 'failed') console.log(tracking.sync_error);\n * ```\n */\n async addShipmentTracking(\n paymentId: string,\n params: ShipmentTrackingCreateRequest,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/shipment-tracking`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct, replace or cancel a shipment tracking added earlier.\n *\n * A new `tracking_number`, optionally with a new `carrier`, replaces the\n * tracking: a new tracking is added at PayPal and the old one is cancelled\n * there. A new `carrier` alone is refused once PayPal holds the tracking. The answer is then\n * the **new** tracking, with its own `tracking_id`; the old one reads\n * `status: 'cancelled'` with `replaced_by` set. New `items` replace every\n * item at PayPal. `status: 'cancelled'`, sent alone, withdraws the tracking\n * at PayPal. Safe to retry.\n *\n * `POST /payments/{paymentId}/shipment-tracking/{trackingId}`\n *\n * @param paymentId - The payment intent ID.\n * @param trackingId - The `trk_…` ID of the tracking to change.\n * @param params - At least one field to change.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n *\n * @example\n * ```typescript\n * await delopay.payments.updateShipmentTracking('pay_abc123', 'trk_abc', {\n * status: 'cancelled',\n * });\n * ```\n */\n async updateShipmentTracking(\n paymentId: string,\n trackingId: string,\n params: ShipmentTrackingUpdateRequest,\n options?: RequestExtras,\n ): Promise<ShipmentTrackingResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/shipment-tracking/${encodeURIComponent(trackingId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Open a playback of the payment's stored checkout recording: the audited\n * act of watching. Answers the manifest — which slices exist, how long the\n * recording runs, whether a pause in it is expected — and the\n * `playback_id` every {@link Payments.replaySlice} call carries.\n *\n * A payment that was never recorded answers `200` with `slices: []` and\n * `session_id: null` — the ordinary case for every payment made before the\n * checkout started recording — not a `404`. `404` means the payment does not\n * exist. Fetch the slices in `sequence` order; a number missing from the\n * list is a gap, not the end.\n *\n * A `POST`, because it writes one audit row: the SDK retries `GET` on its\n * own, and a lost response must not open three playbacks. Calling this\n * again deliberately opens another playback.\n *\n * Requires the `PaymentReplay` permission on a dashboard session in addition\n * to payment read access.\n *\n * `POST /payments/{paymentId}/replay/playback`\n *\n * @param paymentId - The payment intent ID.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n */\n async openReplayPlayback(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ReplayPlaybackResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/replay/playback`,\n options,\n );\n }\n\n /**\n * One slice of the payment's stored checkout recording, read against an\n * open playback: the rrweb events the checkout recorded under that number.\n * `playbackId` and the numbers come from {@link Payments.openReplayPlayback};\n * a `playbackId` that names no playback of this payment opened by this\n * caller, and a number the manifest does not list, both answer `404`.\n * Not audited per slice — the playback was.\n *\n * `GET /payments/{paymentId}/replay/playback/{playbackId}/slices/{sequence}`\n *\n * @param paymentId - The payment intent ID.\n * @param playbackId - The playback, from `openReplayPlayback`.\n * @param sequence - The slice number, from the playback's manifest.\n * @param options - Optional per-call extras: extra `headers`, a `timeout`\n * override, and an `AbortSignal`.\n */\n async replaySlice(\n paymentId: string,\n playbackId: string,\n sequence: number,\n options?: RequestExtras,\n ): Promise<ReplaySliceResponse> {\n return this.request(\n 'GET',\n `/payments/${encodeURIComponent(paymentId)}/replay/playback/${encodeURIComponent(playbackId)}/slices/${encodeURIComponent(String(sequence))}`,\n options,\n );\n }\n\n /**\n * Soft-delete a payment. Only payments whose status is in the merchant's\n * delete policy (see {@link Payments.getDeletePolicy}) can be deleted;\n * anything else fails with a precondition error.\n *\n * `DELETE /payments/{paymentId}`\n */\n async delete(paymentId: string, options?: RequestExtras): Promise<PaymentsDeleteResponse> {\n return this.request('DELETE', `/payments/${encodeURIComponent(paymentId)}`, options);\n }\n\n /**\n * The effective deletable-status set for the calling merchant — lets a\n * dashboard show the delete action only where it is allowed.\n *\n * `GET /payments/delete-policy`\n */\n async getDeletePolicy(options?: RequestExtras): Promise<PaymentsDeletePolicyResponse> {\n return this.request('GET', '/payments/delete-policy', options);\n }\n\n // --- Advanced operations (Task 3.2) ---\n\n /** Generate session tokens. `POST /payments/session-tokens` */\n async sessionTokens(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payments/session-tokens', { body: params });\n }\n\n /** Retrieve payment with gateway credentials. `POST /payments/sync` */\n async sync(params: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', '/payments/sync', { body: params });\n }\n\n /** Cancel after partial capture. `POST /payments/{paymentId}/cancel-post-capture` */\n async cancelPostCapture(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/cancel-post-capture`, {\n body: params,\n });\n }\n\n /** Incrementally authorize more funds. `POST /payments/{paymentId}/incremental-authorization` */\n async incrementalAuthorization(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request(\n 'POST',\n `/payments/${encodeURIComponent(paymentId)}/incremental-authorization`,\n {\n body: params,\n },\n );\n }\n\n /** Extend authorization window. `POST /payments/{paymentId}/extend-authorization` */\n async extendAuthorization(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/extend-authorization`, {\n body: params,\n });\n }\n\n /** Complete authorization. `POST /payments/{paymentId}/complete-authorize` */\n async completeAuthorize(\n paymentId: string,\n params?: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/complete-authorize`, {\n body: params,\n });\n }\n\n /** Dynamic tax calculation. `POST /payments/{paymentId}/calculate-tax` */\n async calculateTax(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/calculate-tax`, {\n body: params,\n });\n }\n\n /** Update payment metadata. `POST /payments/{paymentId}/update-metadata` */\n async updateMetadata(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/update-metadata`, {\n body: params,\n });\n }\n\n /** Retrieve extended card info. `GET /payments/{paymentId}/extended-card-info` */\n async extendedCardInfo(paymentId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/extended-card-info`);\n }\n\n // --- OLAP extensions (Task 4.2) ---\n\n /** List payments (profile-scoped). `GET /payments/profile/list` */\n async listByProfile(params?: PaymentListParams): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/profile/list', {\n query: paymentListQuery(params),\n });\n }\n\n /** List payments across all shops. `GET /payments/list-all-shops` */\n async listAllShops(params?: PaymentListParams): Promise<PaymentListResponse> {\n return this.request('GET', '/payments/list-all-shops', {\n query: paymentListQuery(params),\n });\n }\n\n /** List payments by filter (POST body). `POST /payments/list` */\n async listByFilter(params: PaymentListFilterConstraints): Promise<PaymentListFilteredResponse> {\n return this.request('POST', '/payments/list', { body: params });\n }\n\n /**\n * List payments by filter, scoped to the caller's profile (the shop-user\n * twin of `listByFilter`). The backend narrows to the profile from the\n * auth context, so `profile_id` / `project_id` must not be sent — and\n * neither may `connector_settlement_status`, which this route refuses\n * (403): a shop-scoped viewer is not shown the settlement state, and the\n * type leaves the key out so it cannot be probed through `total_count`.\n *\n * Not to be confused with {@link Payments.listByProfile}, which is the GET\n * cursor variant and rejects this body.\n *\n * `POST /payments/profile/list`\n */\n async listByProfileFilter(\n params: ProfilePaymentListFilterConstraints,\n options?: RequestExtras,\n ): Promise<PaymentListFilteredResponse> {\n return this.request('POST', '/payments/profile/list', { body: params, ...options });\n }\n\n /** Get payment filter options. `GET /payments/filter` */\n async getFilters(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentListFiltersExt> {\n return this.request('GET', '/payments/filter', { query: params });\n }\n\n /**\n * Get payment filter options, scoped to the caller's profile.\n * `GET /payments/profile/filter`\n */\n async getFiltersByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentListFiltersExt> {\n return this.request('GET', '/payments/profile/filter', { query: params });\n }\n\n /** Get payment aggregates. `GET /payments/aggregate` */\n async aggregate(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/payments/aggregate', { query: params });\n }\n\n /** Get payment aggregates (profile-scoped). `GET /payments/profile/aggregate` */\n async aggregateByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/payments/profile/aggregate', { query: params });\n }\n\n /** Manually update payment status. `PUT /payments/{paymentId}/manual-update` */\n async manualUpdate(paymentId: string, params: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('PUT', `/payments/${encodeURIComponent(paymentId)}/manual-update`, {\n body: params,\n });\n }\n\n /** Approve a payment waiting for review. `POST /payments/{paymentId}/approve` */\n async approve(paymentId: string, params?: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/approve`, {\n body: params,\n });\n }\n\n /** Reject a payment waiting for review. `POST /payments/{paymentId}/reject` */\n async reject(paymentId: string, params?: Record<string, unknown>): Promise<PaymentResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/reject`, {\n body: params,\n });\n }\n\n /** Initiate external 3DS authentication. `POST /payments/{paymentId}/3ds/authentication` */\n async threeDsAuthentication(\n paymentId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/3ds/authentication`, {\n body: params,\n });\n }\n}\n\n/** The GET payment lists' query: `integration_origin` goes comma-separated. */\nfunction paymentListQuery(\n params?: PaymentListParams,\n): Record<string, string | number | null | undefined> | undefined {\n if (!params) return undefined;\n const { integration_origin, ...query } = params;\n return {\n ...query,\n ...(Array.isArray(integration_origin)\n ? integration_origin.length\n ? { integration_origin: integration_origin.join(',') }\n : {}\n : integration_origin != null\n ? { integration_origin }\n : {}),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-V47G7P6L.cjs","../src/listQuery.ts"],"names":[],"mappings":"AAAA;ACSO,SAAS,QAAA,CACd,MAAA,EACA,OAAA,EACyB;AACzB,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,OAAA,EAA4B,OAAA;AAClC,EAAA,MAAM,MAAA,EAAiC,CAAC,CAAA;AACxC,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,KAAK,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,GAAA,CAAI,CAAC,MAAA,CAAO,QAAA,CAAS,GAAG,EAAA,GAAK,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AAClD,MAAA,KAAA,CAAM,GAAG,EAAA,EAAI,KAAA;AAAA,IACf,EAAA,KAAA,GAAA,CAAW,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG;AAC3B,MAAA,KAAA,CAAM,GAAG,EAAA,EAAI,KAAA,CAAM,IAAA,CAAK,GAAG,CAAA;AAAA,IAC7B;AAAA,EACF;AACA,EAAA,OAAO,KAAA;AACT;ADVA;AACA;AACE;AACF,4BAAC","file":"/tmp/publish-sdk-0496/dist/chunk-V47G7P6L.cjs","sourcesContent":[null,"import type { RequestOptions } from './client';\n\n/**\n * The query of a list whose multi-value filters travel as one comma-separated\n * value (`status=open,closed`), not as the transport's repeated keys. Each key\n * in `csvKeys` that holds an array is joined with `,`; an empty array is\n * dropped, so it filters nothing. A single value passes through unchanged, and\n * every other key is copied as it is.\n */\nexport function csvQuery<T extends object>(\n params: T | undefined,\n csvKeys: readonly (keyof T & string)[],\n): RequestOptions['query'] {\n if (!params) return undefined;\n const joined: readonly string[] = csvKeys;\n const query: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(params)) {\n if (!joined.includes(key) || !Array.isArray(value)) {\n query[key] = value;\n } else if (value.length > 0) {\n query[key] = value.join(',');\n }\n }\n return query as RequestOptions['query'];\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-V47G7P6L.cjs","../src/listQuery.ts"],"names":[],"mappings":"AAAA;ACSO,SAAS,QAAA,CACd,MAAA,EACA,OAAA,EACyB;AACzB,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,OAAA,EAA4B,OAAA;AAClC,EAAA,MAAM,MAAA,EAAiC,CAAC,CAAA;AACxC,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,KAAK,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,GAAA,CAAI,CAAC,MAAA,CAAO,QAAA,CAAS,GAAG,EAAA,GAAK,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AAClD,MAAA,KAAA,CAAM,GAAG,EAAA,EAAI,KAAA;AAAA,IACf,EAAA,KAAA,GAAA,CAAW,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG;AAC3B,MAAA,KAAA,CAAM,GAAG,EAAA,EAAI,KAAA,CAAM,IAAA,CAAK,GAAG,CAAA;AAAA,IAC7B;AAAA,EACF;AACA,EAAA,OAAO,KAAA;AACT;ADVA;AACA;AACE;AACF,4BAAC","file":"/tmp/sdk-pub-04970/dist/chunk-V47G7P6L.cjs","sourcesContent":[null,"import type { RequestOptions } from './client';\n\n/**\n * The query of a list whose multi-value filters travel as one comma-separated\n * value (`status=open,closed`), not as the transport's repeated keys. Each key\n * in `csvKeys` that holds an array is joined with `,`; an empty array is\n * dropped, so it filters nothing. A single value passes through unchanged, and\n * every other key is copied as it is.\n */\nexport function csvQuery<T extends object>(\n params: T | undefined,\n csvKeys: readonly (keyof T & string)[],\n): RequestOptions['query'] {\n if (!params) return undefined;\n const joined: readonly string[] = csvKeys;\n const query: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(params)) {\n if (!joined.includes(key) || !Array.isArray(value)) {\n query[key] = value;\n } else if (value.length > 0) {\n query[key] = value.join(',');\n }\n }\n return query as RequestOptions['query'];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-VH5A6SMU.cjs","../src/resources/paypalDisputes.ts"],"names":[],"mappings":"AAAA;ACiBO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAClD,OAAA,CAAQ,MAAA,EAAgB,OAAA,EAAS,CAAA,EAAyC;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,MAAM,CAAC,CAAA,QAAA,CAAA,EAAY;AAAA,MACzF,KAAA,EAAO,EAAE,OAAO;AAAA,IAClB,CAAC,CAAA;AAAA,EACH;AAAA,EACA,QAAA,CAAS,MAAA,EAAgB,WAAA,EAAqD;AAC5E,IAAA,MAAM,KAAA,EAAqC,EAAE,YAAA,EAAc,YAAY,CAAA;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,MAAM,CAAC,CAAA,mBAAA,CAAA;AAAA,MACpD,EAAE,KAAK;AAAA,IACT,CAAA;AAAA,EACF;AAAA,EACA,IAAA,CAAK,MAAA,EAAiE;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B;AAAA,MACnD,KAAA,EAAO;AAAA,IACT,CAAC,CAAA;AAAA,EACH;AAAA,EACA,QAAA,CAAS,MAAA,EAAgB,UAAA,EAAY,KAAA,EAAmC;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AAC9C,MAAA;AAChC,IAAA;AACH,EAAA;AACkE,EAAA;AACe,IAAA;AAC7D,MAAA;AACjB,IAAA;AACH,EAAA;AACiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAI8F,EAAA;AACZ,IAAA;AACxE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADboF;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-VH5A6SMU.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\nimport type {\n PaypalDisputeCase,\n PaypalDisputeListRequest,\n PaypalDisputeImportRequest,\n PaypalDisputeImportResponse,\n PaypalDisputeActionRequest,\n PaypalDisputeActionResponse,\n PaypalDisputeActionRecord,\n PaypalDisputeDocument,\n PaypalDisputeDownloadRequest,\n} from '../types';\n\n/**\n * PayPal seller cases, including external and subscription sales.\n * Every operation honors the caller's connector-account grants.\n */\nexport class PaypalDisputes {\n constructor(private readonly request: RequestFn) {}\n actions(caseId: string, offset = 0): Promise<PaypalDisputeActionRecord[]> {\n return this.request('GET', `/disputes/paypal/cases/${encodeURIComponent(caseId)}/actions`, {\n query: { offset },\n });\n }\n download(caseId: string, documentUrl: string): Promise<PaypalDisputeDocument> {\n const body: PaypalDisputeDownloadRequest = { document_url: documentUrl };\n return this.request(\n 'POST',\n `/disputes/paypal/cases/${encodeURIComponent(caseId)}/documents/download`,\n { body },\n );\n }\n list(params?: PaypalDisputeListRequest): Promise<PaypalDisputeCase[]> {\n return this.request('GET', '/disputes/paypal/cases', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n retrieve(caseId: string, forceSync = false): Promise<PaypalDisputeCase> {\n return this.request('GET', `/disputes/paypal/cases/${encodeURIComponent(caseId)}`, {\n query: { force_sync: forceSync },\n });\n }\n history(caseId: string, offset = 0): Promise<PaypalDisputeCase[]> {\n return this.request('GET', `/disputes/paypal/cases/${encodeURIComponent(caseId)}/history`, {\n query: { offset },\n });\n }\n import(params: PaypalDisputeImportRequest): Promise<PaypalDisputeImportResponse> {\n return this.request('POST', '/disputes/paypal/import', { body: params });\n }\n /** The backend checks current provider permissions and deduplicates request_id.\n * An unknown result requires reconciliation, not a new request ID.\n */\n act(caseId: string, params: PaypalDisputeActionRequest): Promise<PaypalDisputeActionResponse> {\n return this.request('POST', `/disputes/paypal/cases/${encodeURIComponent(caseId)}/actions`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-VH5A6SMU.cjs","../src/resources/paypalDisputes.ts"],"names":[],"mappings":"AAAA;ACiBO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAClD,OAAA,CAAQ,MAAA,EAAgB,OAAA,EAAS,CAAA,EAAyC;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,MAAM,CAAC,CAAA,QAAA,CAAA,EAAY;AAAA,MACzF,KAAA,EAAO,EAAE,OAAO;AAAA,IAClB,CAAC,CAAA;AAAA,EACH;AAAA,EACA,QAAA,CAAS,MAAA,EAAgB,WAAA,EAAqD;AAC5E,IAAA,MAAM,KAAA,EAAqC,EAAE,YAAA,EAAc,YAAY,CAAA;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,MAAM,CAAC,CAAA,mBAAA,CAAA;AAAA,MACpD,EAAE,KAAK;AAAA,IACT,CAAA;AAAA,EACF;AAAA,EACA,IAAA,CAAK,MAAA,EAAiE;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B;AAAA,MACnD,KAAA,EAAO;AAAA,IACT,CAAC,CAAA;AAAA,EACH;AAAA,EACA,QAAA,CAAS,MAAA,EAAgB,UAAA,EAAY,KAAA,EAAmC;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AAC9C,MAAA;AAChC,IAAA;AACH,EAAA;AACkE,EAAA;AACe,IAAA;AAC7D,MAAA;AACjB,IAAA;AACH,EAAA;AACiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAI8F,EAAA;AACZ,IAAA;AACxE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADboF;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-VH5A6SMU.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\nimport type {\n PaypalDisputeCase,\n PaypalDisputeListRequest,\n PaypalDisputeImportRequest,\n PaypalDisputeImportResponse,\n PaypalDisputeActionRequest,\n PaypalDisputeActionResponse,\n PaypalDisputeActionRecord,\n PaypalDisputeDocument,\n PaypalDisputeDownloadRequest,\n} from '../types';\n\n/**\n * PayPal seller cases, including external and subscription sales.\n * Every operation honors the caller's connector-account grants.\n */\nexport class PaypalDisputes {\n constructor(private readonly request: RequestFn) {}\n actions(caseId: string, offset = 0): Promise<PaypalDisputeActionRecord[]> {\n return this.request('GET', `/disputes/paypal/cases/${encodeURIComponent(caseId)}/actions`, {\n query: { offset },\n });\n }\n download(caseId: string, documentUrl: string): Promise<PaypalDisputeDocument> {\n const body: PaypalDisputeDownloadRequest = { document_url: documentUrl };\n return this.request(\n 'POST',\n `/disputes/paypal/cases/${encodeURIComponent(caseId)}/documents/download`,\n { body },\n );\n }\n list(params?: PaypalDisputeListRequest): Promise<PaypalDisputeCase[]> {\n return this.request('GET', '/disputes/paypal/cases', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n retrieve(caseId: string, forceSync = false): Promise<PaypalDisputeCase> {\n return this.request('GET', `/disputes/paypal/cases/${encodeURIComponent(caseId)}`, {\n query: { force_sync: forceSync },\n });\n }\n history(caseId: string, offset = 0): Promise<PaypalDisputeCase[]> {\n return this.request('GET', `/disputes/paypal/cases/${encodeURIComponent(caseId)}/history`, {\n query: { offset },\n });\n }\n import(params: PaypalDisputeImportRequest): Promise<PaypalDisputeImportResponse> {\n return this.request('POST', '/disputes/paypal/import', { body: params });\n }\n /** The backend checks current provider permissions and deduplicates request_id.\n * An unknown result requires reconciliation, not a new request ID.\n */\n act(caseId: string, params: PaypalDisputeActionRequest): Promise<PaypalDisputeActionResponse> {\n return this.request('POST', `/disputes/paypal/cases/${encodeURIComponent(caseId)}/actions`, {\n body: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-VHMH4QMY.cjs","../src/trustedOrigins.ts"],"names":["origins"],"mappings":"AAAA;ACEA,IAAM,eAAA,EAAiB,yBAAA;AACvB,IAAM,YAAA,EAAc,iCAAA;AAGpB,IAAM,SAAA,EAAW,EAAA,EAAI,GAAA,EAAK,GAAA;AAY1B,IAAM,MAAA,kBAAQ,IAAI,GAAA,CAAiE,CAAA;AAO5E,SAAS,sBAAA,CACd,QAAA,EAAyC,CAAC,CAAA,EACd;AAC5B,EAAA,MAAM,KAAA,EAAA,kBAAQ,OAAA,CAAQ,OAAA,UAAA,CAAY,OAAA,CAAQ,QAAA,EAAU,YAAA,EAAc,cAAA,GAAA,CAAA,CAAiB,OAAA;AAAA,IACjF,MAAA;AAAA,IACA;AAAA,EACF,CAAA;AACA,EAAA,MAAM,IAAA,EAAM,KAAA,CAAM,GAAA,CAAI,IAAI,CAAA;AAC1B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,EAAA,EAAI,GAAA,CAAI,GAAA,EAAK,QAAA,EAAU,OAAO,GAAA,CAAI,OAAA;AACtD,EAAA,MAAM,IAAA,mBAAM,OAAA,CAAQ,KAAA,UAAS,OAAA;AAC7B,EAAA,MAAM,QAAA,EAAU,GAAA,CAAI,CAAA,EAAA;AACC,IAAA;AAEN,EAAA;AACO,IAAA;AACE,IAAA;AAGK,IAAA;AACNA,IAAAA;AACD,MAAA;AAClB,IAAA;AACOA,IAAAA;AAEkB,EAAA;AACR,IAAA;AACX,IAAA;AACP,EAAA;AACe,EAAA;AACX,EAAA;AACT;AAmBsB;AAIhB,EAAA;AACY,IAAA;AACR,EAAA;AACC,IAAA;AACT,EAAA;AACF;AAesB;AAGJ,EAAA;AACG,EAAA;AACrB;AAcsB;AAGJ,EAAA;AACK,EAAA;AACvB;AD7EuB;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-VHMH4QMY.cjs","sourcesContent":[null,"import type { TrustedCheckoutOrigins } from './types';\n\nconst PRODUCTION_URL = 'https://api.delopay.net';\nconst SANDBOX_URL = 'https://sandbox.delopay.net/api';\n\n/** How long a fetched list is trusted before it is read again; the API caches it as long. */\nconst CACHE_MS = 5 * 60 * 1000;\n\n/** Where `isTrustedCheckoutOrigin` reads the list of trusted checkout origins. */\nexport interface TrustedCheckoutOriginsOptions {\n /** Read the sandbox list (`https://sandbox.delopay.net/api`). */\n sandbox?: boolean;\n /** Another API base URL, such as a dashboard's own `/api` proxy. Wins over `sandbox`. */\n baseUrl?: string;\n /** A `fetch` to use instead of the global one. */\n fetch?: typeof fetch;\n}\n\nconst cache = new Map<string, { at: number; origins: Promise<readonly string[]> }>();\n\n/**\n * Every origin the hosted checkout may answer from on this deployment:\n * `GET /payment-link/trusted-origins`. Public, no key needed. Cached for\n * five minutes per base URL; a failed read is not cached.\n */\nexport function trustedCheckoutOrigins(\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<readonly string[]> {\n const base = (options.baseUrl ?? (options.sandbox ? SANDBOX_URL : PRODUCTION_URL)).replace(\n /\\/+$/,\n '',\n );\n const hit = cache.get(base);\n if (hit && Date.now() - hit.at < CACHE_MS) return hit.origins;\n const run = options.fetch ?? fetch;\n const origins = run(`${base}/payment-link/trusted-origins`, {\n headers: { Accept: 'application/json' },\n })\n .then(async (response) => {\n if (!response.ok) throw new Error(`trusted origins: HTTP ${response.status}`);\n const body = (await response.json()) as Partial<TrustedCheckoutOrigins> | null;\n // An answer without a list of strings is a failure, never an allowlist\n // cached for five minutes.\n const origins: unknown = body?.origins;\n if (!Array.isArray(origins) || !origins.every((origin) => typeof origin === 'string')) {\n throw new Error('trusted origins: the answer holds no list of origins');\n }\n return origins as string[];\n })\n .catch((error: unknown) => {\n cache.delete(base);\n throw error;\n });\n cache.set(base, { at: Date.now(), origins });\n return origins;\n}\n\n/**\n * Whether a `postMessage` came from DeloPay's hosted checkout. An embedded\n * checkout may move to another of the deployment's checkout origins (for\n * Apple Pay), so a listener checks the message's origin against the whole\n * list rather than one hostname. It also checks that the message came from its\n * own checkout iframe, and then the message type and payment id:\n *\n * window.addEventListener('message', async (event) => {\n * if (event.source !== iframe.contentWindow) return;\n * if (!(await isTrustedCheckoutOrigin(event.origin))) return;\n * if (event.data?.type !== 'payment_status') return;\n * if (event.data.payment_id !== myPaymentId) return;\n * // handle event.data.status\n * });\n *\n * Resolves `false` when the list cannot be read, so a listener fails closed.\n */\nexport async function isTrustedCheckoutOrigin(\n origin: string,\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<boolean> {\n try {\n return (await trustedCheckoutOrigins(options)).includes(origin);\n } catch {\n return false;\n }\n}\n\n/**\n * The `allow` attribute for an iframe that embeds the hosted checkout of a\n * shop that lets its embedded checkout change address (for Apple Pay):\n * `payment` delegated to every trusted checkout origin.\n *\n * iframe.allow = await checkoutIframeAllow();\n * // \"payment https://checkout.example.net https://checkout-a.example.net\"\n *\n * A bare `allow=\"payment\"` delegates only to the origin of the iframe's\n * first `src`, so after the checkout moves to another of its origins the\n * browser blocks Apple Pay there. Rejects when the list cannot be read, so an\n * embed never ships a narrower attribute than it needs without knowing.\n */\nexport async function checkoutIframeAllow(\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<string> {\n const origins = await trustedCheckoutOrigins(options);\n return ['payment', ...origins].join(' ');\n}\n\n/**\n * The `frame-src` directive for the Content Security Policy of a page that\n * embeds the hosted checkout of a shop that lets its embedded checkout change\n * address: every trusted checkout origin. Without it, a page with a CSP blocks\n * the iframe once the checkout moves to another of its origins.\n *\n * // \"frame-src https://checkout.example.net https://checkout-a.example.net\"\n * const directive = await checkoutFrameSrc();\n *\n * Add the origins to an existing `frame-src` (or `child-src`) rather than\n * replacing it. Rejects when the list cannot be read.\n */\nexport async function checkoutFrameSrc(\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<string> {\n const origins = await trustedCheckoutOrigins(options);\n return ['frame-src', ...origins].join(' ');\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-VHMH4QMY.cjs","../src/trustedOrigins.ts"],"names":["origins"],"mappings":"AAAA;ACEA,IAAM,eAAA,EAAiB,yBAAA;AACvB,IAAM,YAAA,EAAc,iCAAA;AAGpB,IAAM,SAAA,EAAW,EAAA,EAAI,GAAA,EAAK,GAAA;AAY1B,IAAM,MAAA,kBAAQ,IAAI,GAAA,CAAiE,CAAA;AAO5E,SAAS,sBAAA,CACd,QAAA,EAAyC,CAAC,CAAA,EACd;AAC5B,EAAA,MAAM,KAAA,EAAA,kBAAQ,OAAA,CAAQ,OAAA,UAAA,CAAY,OAAA,CAAQ,QAAA,EAAU,YAAA,EAAc,cAAA,GAAA,CAAA,CAAiB,OAAA;AAAA,IACjF,MAAA;AAAA,IACA;AAAA,EACF,CAAA;AACA,EAAA,MAAM,IAAA,EAAM,KAAA,CAAM,GAAA,CAAI,IAAI,CAAA;AAC1B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,EAAA,EAAI,GAAA,CAAI,GAAA,EAAK,QAAA,EAAU,OAAO,GAAA,CAAI,OAAA;AACtD,EAAA,MAAM,IAAA,mBAAM,OAAA,CAAQ,KAAA,UAAS,OAAA;AAC7B,EAAA,MAAM,QAAA,EAAU,GAAA,CAAI,CAAA,EAAA;AACC,IAAA;AAEN,EAAA;AACO,IAAA;AACE,IAAA;AAGK,IAAA;AACNA,IAAAA;AACD,MAAA;AAClB,IAAA;AACOA,IAAAA;AAEkB,EAAA;AACR,IAAA;AACX,IAAA;AACP,EAAA;AACe,EAAA;AACX,EAAA;AACT;AAmBsB;AAIhB,EAAA;AACY,IAAA;AACR,EAAA;AACC,IAAA;AACT,EAAA;AACF;AAesB;AAGJ,EAAA;AACG,EAAA;AACrB;AAcsB;AAGJ,EAAA;AACK,EAAA;AACvB;AD7EuB;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-VHMH4QMY.cjs","sourcesContent":[null,"import type { TrustedCheckoutOrigins } from './types';\n\nconst PRODUCTION_URL = 'https://api.delopay.net';\nconst SANDBOX_URL = 'https://sandbox.delopay.net/api';\n\n/** How long a fetched list is trusted before it is read again; the API caches it as long. */\nconst CACHE_MS = 5 * 60 * 1000;\n\n/** Where `isTrustedCheckoutOrigin` reads the list of trusted checkout origins. */\nexport interface TrustedCheckoutOriginsOptions {\n /** Read the sandbox list (`https://sandbox.delopay.net/api`). */\n sandbox?: boolean;\n /** Another API base URL, such as a dashboard's own `/api` proxy. Wins over `sandbox`. */\n baseUrl?: string;\n /** A `fetch` to use instead of the global one. */\n fetch?: typeof fetch;\n}\n\nconst cache = new Map<string, { at: number; origins: Promise<readonly string[]> }>();\n\n/**\n * Every origin the hosted checkout may answer from on this deployment:\n * `GET /payment-link/trusted-origins`. Public, no key needed. Cached for\n * five minutes per base URL; a failed read is not cached.\n */\nexport function trustedCheckoutOrigins(\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<readonly string[]> {\n const base = (options.baseUrl ?? (options.sandbox ? SANDBOX_URL : PRODUCTION_URL)).replace(\n /\\/+$/,\n '',\n );\n const hit = cache.get(base);\n if (hit && Date.now() - hit.at < CACHE_MS) return hit.origins;\n const run = options.fetch ?? fetch;\n const origins = run(`${base}/payment-link/trusted-origins`, {\n headers: { Accept: 'application/json' },\n })\n .then(async (response) => {\n if (!response.ok) throw new Error(`trusted origins: HTTP ${response.status}`);\n const body = (await response.json()) as Partial<TrustedCheckoutOrigins> | null;\n // An answer without a list of strings is a failure, never an allowlist\n // cached for five minutes.\n const origins: unknown = body?.origins;\n if (!Array.isArray(origins) || !origins.every((origin) => typeof origin === 'string')) {\n throw new Error('trusted origins: the answer holds no list of origins');\n }\n return origins as string[];\n })\n .catch((error: unknown) => {\n cache.delete(base);\n throw error;\n });\n cache.set(base, { at: Date.now(), origins });\n return origins;\n}\n\n/**\n * Whether a `postMessage` came from DeloPay's hosted checkout. An embedded\n * checkout may move to another of the deployment's checkout origins (for\n * Apple Pay), so a listener checks the message's origin against the whole\n * list rather than one hostname. It also checks that the message came from its\n * own checkout iframe, and then the message type and payment id:\n *\n * window.addEventListener('message', async (event) => {\n * if (event.source !== iframe.contentWindow) return;\n * if (!(await isTrustedCheckoutOrigin(event.origin))) return;\n * if (event.data?.type !== 'payment_status') return;\n * if (event.data.payment_id !== myPaymentId) return;\n * // handle event.data.status\n * });\n *\n * Resolves `false` when the list cannot be read, so a listener fails closed.\n */\nexport async function isTrustedCheckoutOrigin(\n origin: string,\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<boolean> {\n try {\n return (await trustedCheckoutOrigins(options)).includes(origin);\n } catch {\n return false;\n }\n}\n\n/**\n * The `allow` attribute for an iframe that embeds the hosted checkout of a\n * shop that lets its embedded checkout change address (for Apple Pay):\n * `payment` delegated to every trusted checkout origin.\n *\n * iframe.allow = await checkoutIframeAllow();\n * // \"payment https://checkout.example.net https://checkout-a.example.net\"\n *\n * A bare `allow=\"payment\"` delegates only to the origin of the iframe's\n * first `src`, so after the checkout moves to another of its origins the\n * browser blocks Apple Pay there. Rejects when the list cannot be read, so an\n * embed never ships a narrower attribute than it needs without knowing.\n */\nexport async function checkoutIframeAllow(\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<string> {\n const origins = await trustedCheckoutOrigins(options);\n return ['payment', ...origins].join(' ');\n}\n\n/**\n * The `frame-src` directive for the Content Security Policy of a page that\n * embeds the hosted checkout of a shop that lets its embedded checkout change\n * address: every trusted checkout origin. Without it, a page with a CSP blocks\n * the iframe once the checkout moves to another of its origins.\n *\n * // \"frame-src https://checkout.example.net https://checkout-a.example.net\"\n * const directive = await checkoutFrameSrc();\n *\n * Add the origins to an existing `frame-src` (or `child-src`) rather than\n * replacing it. Rejects when the list cannot be read.\n */\nexport async function checkoutFrameSrc(\n options: TrustedCheckoutOriginsOptions = {},\n): Promise<string> {\n const origins = await trustedCheckoutOrigins(options);\n return ['frame-src', ...origins].join(' ');\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-VYC7WUM5.cjs","../src/resources/whopResolutionCases.ts"],"names":[],"mappings":"AAAA;ACiBO,IAAM,oBAAA,EAAN,MAA0B;AAAA,EAC/B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,IAAA,CAAK,MAAA,EAAwE;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB;AAAA,MACjD,KAAA,EAAO,EAAE,GAAG,OAAO;AAAA,IACrB,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,QAAA,CAAS,MAAA,EAAgB,OAAA,EAAiE;AACxF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,qBAAA,EAAwB,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACvD,MAAA;AACrB,IAAA;AACH,EAAA;AAAA;AAMwC,EAAA;AACuC,IAAA;AACxD,MAAA;AACpB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU6C,EAAA;AACmC,IAAA;AACtE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADvBkF;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-VYC7WUM5.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\nimport type {\n WhopResolutionCase,\n WhopResolutionCaseActionRequest,\n WhopResolutionCaseActionResponse,\n WhopResolutionCaseEventList,\n WhopResolutionCaseEventsRequest,\n WhopResolutionCaseList,\n WhopResolutionCaseListRequest,\n WhopResolutionCaseLocator,\n} from '../types';\n\n/**\n * Whop Resolution Center cases: a buyer's claim before any chargeback. Read\n * and answered live through one Whop connector account and environment.\n * Every operation honors the caller's connector-account grants and shop scope.\n */\nexport class WhopResolutionCases {\n constructor(private readonly request: RequestFn) {}\n\n /** GET /disputes/whop/cases — newest first, one Whop page at a time. */\n list(params: WhopResolutionCaseListRequest): Promise<WhopResolutionCaseList> {\n return this.request('GET', '/disputes/whop/cases', {\n query: { ...params },\n });\n }\n\n /** GET /disputes/whop/cases/{case_id} — the case as Whop reports it now. */\n retrieve(caseId: string, locator: WhopResolutionCaseLocator): Promise<WhopResolutionCase> {\n return this.request('GET', `/disputes/whop/cases/${encodeURIComponent(caseId)}`, {\n query: { ...locator },\n });\n }\n\n /** GET /disputes/whop/cases/{case_id}/events — the case timeline, newest first. */\n events(\n caseId: string,\n params: WhopResolutionCaseEventsRequest,\n ): Promise<WhopResolutionCaseEventList> {\n return this.request('GET', `/disputes/whop/cases/${encodeURIComponent(caseId)}/events`, {\n query: { ...params },\n });\n }\n\n /**\n * POST /disputes/whop/cases/{case_id}/actions — accept, deny, reply or\n * request info. `accept` refunds the payment in full at Whop. An `unknown`\n * outcome is retried with the same `request_id`.\n */\n act(\n caseId: string,\n params: WhopResolutionCaseActionRequest,\n ): Promise<WhopResolutionCaseActionResponse> {\n return this.request('POST', `/disputes/whop/cases/${encodeURIComponent(caseId)}/actions`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-VYC7WUM5.cjs","../src/resources/whopResolutionCases.ts"],"names":[],"mappings":"AAAA;ACiBO,IAAM,oBAAA,EAAN,MAA0B;AAAA,EAC/B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,IAAA,CAAK,MAAA,EAAwE;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB;AAAA,MACjD,KAAA,EAAO,EAAE,GAAG,OAAO;AAAA,IACrB,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,QAAA,CAAS,MAAA,EAAgB,OAAA,EAAiE;AACxF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,qBAAA,EAAwB,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACvD,MAAA;AACrB,IAAA;AACH,EAAA;AAAA;AAMwC,EAAA;AACuC,IAAA;AACxD,MAAA;AACpB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU6C,EAAA;AACmC,IAAA;AACtE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADvBkF;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-VYC7WUM5.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\nimport type {\n WhopResolutionCase,\n WhopResolutionCaseActionRequest,\n WhopResolutionCaseActionResponse,\n WhopResolutionCaseEventList,\n WhopResolutionCaseEventsRequest,\n WhopResolutionCaseList,\n WhopResolutionCaseListRequest,\n WhopResolutionCaseLocator,\n} from '../types';\n\n/**\n * Whop Resolution Center cases: a buyer's claim before any chargeback. Read\n * and answered live through one Whop connector account and environment.\n * Every operation honors the caller's connector-account grants and shop scope.\n */\nexport class WhopResolutionCases {\n constructor(private readonly request: RequestFn) {}\n\n /** GET /disputes/whop/cases — newest first, one Whop page at a time. */\n list(params: WhopResolutionCaseListRequest): Promise<WhopResolutionCaseList> {\n return this.request('GET', '/disputes/whop/cases', {\n query: { ...params },\n });\n }\n\n /** GET /disputes/whop/cases/{case_id} — the case as Whop reports it now. */\n retrieve(caseId: string, locator: WhopResolutionCaseLocator): Promise<WhopResolutionCase> {\n return this.request('GET', `/disputes/whop/cases/${encodeURIComponent(caseId)}`, {\n query: { ...locator },\n });\n }\n\n /** GET /disputes/whop/cases/{case_id}/events — the case timeline, newest first. */\n events(\n caseId: string,\n params: WhopResolutionCaseEventsRequest,\n ): Promise<WhopResolutionCaseEventList> {\n return this.request('GET', `/disputes/whop/cases/${encodeURIComponent(caseId)}/events`, {\n query: { ...params },\n });\n }\n\n /**\n * POST /disputes/whop/cases/{case_id}/actions — accept, deny, reply or\n * request info. `accept` refunds the payment in full at Whop. An `unknown`\n * outcome is retried with the same `request_id`.\n */\n act(\n caseId: string,\n params: WhopResolutionCaseActionRequest,\n ): Promise<WhopResolutionCaseActionResponse> {\n return this.request('POST', `/disputes/whop/cases/${encodeURIComponent(caseId)}/actions`, {\n body: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-W457XUA6.cjs","../src/internal/resources/platformMessageTemplates.ts"],"names":[],"mappings":"AAAA;ACyBO,IAAM,yBAAA,EAAN,MAA+B;AAAA,EACpC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,IAAA,CAAA,EAAqC;AACzC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,UAAA,EAAoD;AACjE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,gCAAA,EAAmC,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AAC9F,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWoC,EAAA;AACtB,IAAA;AACV,MAAA;AAC+E,MAAA;AAC/E,MAAA;AACQ,QAAA;AACR,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWoC,EAAA;AACtB,IAAA;AACV,MAAA;AAC+E,MAAA;AAC/E,MAAA;AACuD,QAAA;AACvD,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAMmC,EAAA;AACrB,IAAA;AACV,MAAA;AACiE,MAAA;AAClD,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUoC,EAAA;AACtB,IAAA;AACV,MAAA;AACiE,MAAA;AAClD,MAAA;AACjB,IAAA;AACF,EAAA;AACF;ADzCiG;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-W457XUA6.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n MessageLanguage,\n MessageTemplateDetail,\n MessageTemplateLanguage,\n MessageTemplateList,\n MessageTemplatePreview,\n PreviewMessageTemplateRequest,\n ResetMessageTemplateLanguageQuery,\n SendTestMessageRequest,\n SendTestMessageResponse,\n UpdateMessageTemplateLanguageRequest,\n} from '../../types';\n\n/**\n * The texts of every message the platform sends, as the operator writes them\n * at the platform scope: dashboard and operator emails, and the platform\n * default of every buyer email. A shop's own text of a buyer email goes\n * before the platform's, and the built-in text applies where neither exists.\n *\n * Reading needs an admin login or API key; writes, resets and test sends need\n * `AccountManage`. Every change is recorded in the audit log\n * (`entity_type: 'message_template'`, `entity_id:\n * 'platform:platform:<channel>:<template_id>:<language>'`).\n */\nexport class PlatformMessageTemplates {\n constructor(private readonly request: RequestFn) {}\n\n /** `GET /admin-portal/message-templates` */\n async list(): Promise<MessageTemplateList> {\n return this.request('GET', '/admin-portal/message-templates');\n }\n\n /** `GET /admin-portal/message-templates/{template_id}` */\n async retrieve(templateId: string): Promise<MessageTemplateDetail> {\n return this.request('GET', `/admin-portal/message-templates/${encodeURIComponent(templateId)}`);\n }\n\n /**\n * Store the platform's text in one language.\n *\n * `PUT /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async updateLanguage(\n templateId: string,\n language: MessageLanguage,\n params: UpdateMessageTemplateLanguageRequest,\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'PUT',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n body: params,\n },\n );\n }\n\n /**\n * Remove the platform's text in one language, so the built-in text applies.\n *\n * `DELETE /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async resetLanguage(\n templateId: string,\n language: MessageLanguage,\n params: ResetMessageTemplateLanguageQuery = {},\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'DELETE',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n query: { expected_revision: params.expected_revision },\n },\n );\n }\n\n /** `POST /admin-portal/message-templates/{template_id}/preview` */\n async preview(\n templateId: string,\n params: PreviewMessageTemplateRequest,\n ): Promise<MessageTemplatePreview> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/preview`,\n { body: params },\n );\n }\n\n /**\n * Send the template to the signed-in admin's own address.\n *\n * `POST /admin-portal/message-templates/{template_id}/test`\n */\n async sendTest(\n templateId: string,\n params: SendTestMessageRequest,\n ): Promise<SendTestMessageResponse> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/test`,\n { body: params },\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-W457XUA6.cjs","../src/internal/resources/platformMessageTemplates.ts"],"names":[],"mappings":"AAAA;ACyBO,IAAM,yBAAA,EAAN,MAA+B;AAAA,EACpC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,IAAA,CAAA,EAAqC;AACzC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,UAAA,EAAoD;AACjE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,gCAAA,EAAmC,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AAC9F,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWoC,EAAA;AACtB,IAAA;AACV,MAAA;AAC+E,MAAA;AAC/E,MAAA;AACQ,QAAA;AACR,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWoC,EAAA;AACtB,IAAA;AACV,MAAA;AAC+E,MAAA;AAC/E,MAAA;AACuD,QAAA;AACvD,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAMmC,EAAA;AACrB,IAAA;AACV,MAAA;AACiE,MAAA;AAClD,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUoC,EAAA;AACtB,IAAA;AACV,MAAA;AACiE,MAAA;AAClD,MAAA;AACjB,IAAA;AACF,EAAA;AACF;ADzCiG;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-W457XUA6.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n MessageLanguage,\n MessageTemplateDetail,\n MessageTemplateLanguage,\n MessageTemplateList,\n MessageTemplatePreview,\n PreviewMessageTemplateRequest,\n ResetMessageTemplateLanguageQuery,\n SendTestMessageRequest,\n SendTestMessageResponse,\n UpdateMessageTemplateLanguageRequest,\n} from '../../types';\n\n/**\n * The texts of every message the platform sends, as the operator writes them\n * at the platform scope: dashboard and operator emails, and the platform\n * default of every buyer email. A shop's own text of a buyer email goes\n * before the platform's, and the built-in text applies where neither exists.\n *\n * Reading needs an admin login or API key; writes, resets and test sends need\n * `AccountManage`. Every change is recorded in the audit log\n * (`entity_type: 'message_template'`, `entity_id:\n * 'platform:platform:<channel>:<template_id>:<language>'`).\n */\nexport class PlatformMessageTemplates {\n constructor(private readonly request: RequestFn) {}\n\n /** `GET /admin-portal/message-templates` */\n async list(): Promise<MessageTemplateList> {\n return this.request('GET', '/admin-portal/message-templates');\n }\n\n /** `GET /admin-portal/message-templates/{template_id}` */\n async retrieve(templateId: string): Promise<MessageTemplateDetail> {\n return this.request('GET', `/admin-portal/message-templates/${encodeURIComponent(templateId)}`);\n }\n\n /**\n * Store the platform's text in one language.\n *\n * `PUT /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async updateLanguage(\n templateId: string,\n language: MessageLanguage,\n params: UpdateMessageTemplateLanguageRequest,\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'PUT',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n body: params,\n },\n );\n }\n\n /**\n * Remove the platform's text in one language, so the built-in text applies.\n *\n * `DELETE /admin-portal/message-templates/{template_id}/languages/{language}`\n */\n async resetLanguage(\n templateId: string,\n language: MessageLanguage,\n params: ResetMessageTemplateLanguageQuery = {},\n ): Promise<MessageTemplateLanguage> {\n return this.request(\n 'DELETE',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/languages/${encodeURIComponent(language)}`,\n {\n query: { expected_revision: params.expected_revision },\n },\n );\n }\n\n /** `POST /admin-portal/message-templates/{template_id}/preview` */\n async preview(\n templateId: string,\n params: PreviewMessageTemplateRequest,\n ): Promise<MessageTemplatePreview> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/preview`,\n { body: params },\n );\n }\n\n /**\n * Send the template to the signed-in admin's own address.\n *\n * `POST /admin-portal/message-templates/{template_id}/test`\n */\n async sendTest(\n templateId: string,\n params: SendTestMessageRequest,\n ): Promise<SendTestMessageResponse> {\n return this.request(\n 'POST',\n `/admin-portal/message-templates/${encodeURIComponent(templateId)}/test`,\n { body: params },\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-WHDI3TMP.cjs","../src/resources/verification.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,uBAAA,CACJ,UAAA,EACA,MAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,MAAA;AACP,IAAA;AACH,EAAA;AAI4C,EAAA;AACsB,IAAA;AACvD,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADVoF;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-WHDI3TMP.cjs","sourcesContent":[null,"import type {\n ApplePayVerificationRequest,\n ApplePayVerificationResponse,\n ApplePayVerifiedDomainsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Verification {\n constructor(private readonly request: RequestFn) {}\n\n async registerApplePayDomains(\n merchantId: string,\n params: ApplePayVerificationRequest,\n ): Promise<ApplePayVerificationResponse> {\n return this.request('POST', `/verify/apple-pay/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n async getApplePayVerifiedDomains(\n params: Record<string, string>,\n ): Promise<ApplePayVerifiedDomainsResponse> {\n return this.request('GET', '/verify/applepay-verified-domains', {\n query: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-WHDI3TMP.cjs","../src/resources/verification.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,uBAAA,CACJ,UAAA,EACA,MAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,MAAA;AACP,IAAA;AACH,EAAA;AAI4C,EAAA;AACsB,IAAA;AACvD,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADVoF;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-WHDI3TMP.cjs","sourcesContent":[null,"import type {\n ApplePayVerificationRequest,\n ApplePayVerificationResponse,\n ApplePayVerifiedDomainsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Verification {\n constructor(private readonly request: RequestFn) {}\n\n async registerApplePayDomains(\n merchantId: string,\n params: ApplePayVerificationRequest,\n ): Promise<ApplePayVerificationResponse> {\n return this.request('POST', `/verify/apple-pay/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n async getApplePayVerifiedDomains(\n params: Record<string, string>,\n ): Promise<ApplePayVerifiedDomainsResponse> {\n return this.request('GET', '/verify/applepay-verified-domains', {\n query: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-WITCPKNL.cjs","../src/internal/resources/cardIssuers.ts"],"names":[],"mappings":"AAAA;ACQO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAA8D;AACzE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,eAAA,EAAiB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC/D;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkB,MAAA,EAA8D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,cAAA,EAAiB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC1E,EAAA;AAE8C,EAAA;AACF,IAAA;AAC5C,EAAA;AACF;ADP6E;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-WITCPKNL.cjs","sourcesContent":[null,"import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-WITCPKNL.cjs","../src/internal/resources/cardIssuers.ts"],"names":[],"mappings":"AAAA;ACQO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAA8D;AACzE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,eAAA,EAAiB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC/D;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkB,MAAA,EAA8D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,cAAA,EAAiB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC1E,EAAA;AAE8C,EAAA;AACF,IAAA;AAC5C,EAAA;AACF;ADP6E;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-WITCPKNL.cjs","sourcesContent":[null,"import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-WX6NP7UU.cjs","../src/resources/threeDsRules.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAA,CAAQ,MAAA,EAAiE;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4BAAA,EAA8B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC5E;AACF,CAAA;ADAA;AACA;AACE;AACF,oCAAC","file":"/tmp/publish-sdk-0496/dist/chunk-WX6NP7UU.cjs","sourcesContent":[null,"import type { ThreeDsRuleExecuteRequest, ThreeDsRuleResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ThreeDsRules {\n constructor(private readonly request: RequestFn) {}\n\n async execute(params: ThreeDsRuleExecuteRequest): Promise<ThreeDsRuleResponse> {\n return this.request('POST', '/three-ds-decision/execute', { body: params });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-WX6NP7UU.cjs","../src/resources/threeDsRules.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAA,CAAQ,MAAA,EAAiE;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4BAAA,EAA8B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC5E;AACF,CAAA;ADAA;AACA;AACE;AACF,oCAAC","file":"/tmp/sdk-pub-04970/dist/chunk-WX6NP7UU.cjs","sourcesContent":[null,"import type { ThreeDsRuleExecuteRequest, ThreeDsRuleResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ThreeDsRules {\n constructor(private readonly request: RequestFn) {}\n\n async execute(params: ThreeDsRuleExecuteRequest): Promise<ThreeDsRuleResponse> {\n return this.request('POST', '/three-ds-decision/execute', { body: params });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/publish-sdk-0496/dist/chunk-XQLRIBVR.cjs","../src/eventStream.ts"],"names":[],"mappings":"AAAA;AC0BA,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,GAAA,EAAK,EAAA;AAGJ,IAAM,kBAAA,EAAN,MAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAe7B,WAAA,CAAY,YAAA,EAAc,EAAA,EAAI;AAd9B,IAAA,IAAA,CAAQ,KAAA,EAAO,EAAA;AAEf;AAAA,IAAA,IAAA,CAAQ,OAAA,EAAS,KAAA;AACjB,IAAA,IAAA,CAAQ,KAAA,EAAO,EAAA;AACf,IAAA,IAAA,CAAQ,QAAA,EAAU,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AA,CAAK,QAAA,EAAU,CAAA,EAAA;AAA2B;AACvC,QAAA;AACf,QAAA;AACG,MAAA;AAC4B,QAAA;AAC/B,QAAA;AACG,MAAA;AACyB,QAAA;AACH,UAAA;AACE,UAAA;AAC3B,QAAA;AACA,QAAA;AACF,MAAA;AAEE,QAAA;AACJ,IAAA;AACF,EAAA;AAEmD,EAAA;AAClB,IAAA;AACF,IAAA;AACjB,IAAA;AACG,IAAA;AACE,IAAA;AACnB,EAAA;AACF;AD/BoC;AACA;AACA;AACA","file":"/tmp/publish-sdk-0496/dist/chunk-XQLRIBVR.cjs","sourcesContent":[null,"/**\n * A `text/event-stream` (server-sent events) parser, after the WHATWG HTML\n * standard's \"event stream interpretation\", for streams read through `fetch`\n * rather than `EventSource` — which cannot send an `Authorization` header.\n *\n * It holds only the line in progress and the event being assembled, never the\n * body read so far: a stream may stay open for half an hour.\n */\n\n/** One dispatch of the stream, in the order the stream made them. */\nexport interface EventStreamDispatch {\n /**\n * The stream's last event id after this dispatch. Every dispatch sets it,\n * one without data too: that is how a keepalive advances the position.\n * `''` when the server reset it, or never sent one.\n */\n lastEventId: string;\n /** The reconnection time the stream last announced (`retry:`), in ms. */\n retry: number | null;\n /**\n * The event, or `null` for a dispatch without data, which carries only\n * the id. `type` is `message` when the stream named none.\n */\n event: { type: string; data: string } | null;\n}\n\nconst LF = 10;\nconst CR = 13;\n\n/** Parses decoded text into dispatches, however the text is split into chunks. */\nexport class EventStreamParser {\n private line = '';\n /** The previous chunk ended in CR: a LF opening the next one belongs to it. */\n private skipLf = false;\n private data = '';\n private hasData = false;\n private eventType = '';\n private idBuffer: string;\n private retry: number | null = null;\n\n /**\n * @param lastEventId - The id the stream resumes after, as `EventSource`\n * carries it into a reconnection: a dispatch before the server names an\n * id keeps this one.\n */\n constructor(lastEventId = '') {\n this.idBuffer = lastEventId;\n }\n\n /** Feed the next piece of decoded text; returns the dispatches it completed. */\n push(text: string): EventStreamDispatch[] {\n const out: EventStreamDispatch[] = [];\n if (text.length === 0) return out;\n let start = 0;\n if (this.skipLf) {\n this.skipLf = false;\n if (text.charCodeAt(0) === LF) start = 1;\n }\n for (let i = start; i < text.length; i++) {\n const c = text.charCodeAt(i);\n if (c !== LF && c !== CR) continue;\n const line = this.line + text.slice(start, i);\n this.line = '';\n this.processLine(line, out);\n if (c === CR) {\n if (i + 1 < text.length) {\n if (text.charCodeAt(i + 1) === LF) i++;\n } else {\n this.skipLf = true;\n }\n }\n start = i + 1;\n }\n this.line += text.slice(start);\n return out;\n }\n\n private processLine(line: string, out: EventStreamDispatch[]): void {\n if (line === '') {\n this.dispatch(out);\n return;\n }\n if (line.charCodeAt(0) === 0x3a /* : */) return; // a comment\n const colon = line.indexOf(':');\n let field: string;\n let value: string;\n if (colon === -1) {\n field = line;\n value = '';\n } else {\n field = line.slice(0, colon);\n value = line.slice(colon + 1);\n if (value.charCodeAt(0) === 0x20 /* space */) value = value.slice(1);\n }\n switch (field) {\n case 'event':\n this.eventType = value;\n break;\n case 'data':\n this.data = this.hasData ? `${this.data}\\n${value}` : value;\n this.hasData = true;\n break;\n case 'id':\n if (!value.includes('\\u0000')) this.idBuffer = value;\n break;\n case 'retry':\n if (/^[0-9]+$/.test(value)) {\n const ms = Number(value);\n if (Number.isSafeInteger(ms)) this.retry = ms;\n }\n break;\n default:\n // Unknown fields are ignored.\n break;\n }\n }\n\n private dispatch(out: EventStreamDispatch[]): void {\n const event = this.hasData ? { type: this.eventType || 'message', data: this.data } : null;\n out.push({ lastEventId: this.idBuffer, retry: this.retry, event });\n this.data = '';\n this.hasData = false;\n this.eventType = '';\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-XQLRIBVR.cjs","../src/eventStream.ts"],"names":[],"mappings":"AAAA;AC0BA,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,GAAA,EAAK,EAAA;AAGJ,IAAM,kBAAA,EAAN,MAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAe7B,WA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AAM,CAAC,CAAA;AAAA,IACrE;AACA,IAAA,OAAA,CAAQ,KAAA,EAAO;AAAA,MACb,KAAK,OAAA;AACH,QAAA,IAAA,CAAK,UAAA,EAAY,KAAA;AACjB,QAAA,KAAA;AAAA,MACF,KAAK,MAAA;AACH,QAAA,IAAA,CAAK,KAAA,EAAO,IAAA,CAAK,QAAA,EAAU,CAAA,EAAA;AAA2B;AACvC,QAAA;AACf,QAAA;AACG,MAAA;AAC4B,QAAA;AAC/B,QAAA;AACG,MAAA;AACyB,QAAA;AACH,UAAA;AACE,UAAA;AAC3B,QAAA;AACA,QAAA;AACF,MAAA;AAEE,QAAA;AACJ,IAAA;AACF,EAAA;AAEmD,EAAA;AAClB,IAAA;AACF,IAAA;AACjB,IAAA;AACG,IAAA;AACE,IAAA;AACnB,EAAA;AACF;AD/BoC;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-XQLRIBVR.cjs","sourcesContent":[null,"/**\n * A `text/event-stream` (server-sent events) parser, after the WHATWG HTML\n * standard's \"event stream interpretation\", for streams read through `fetch`\n * rather than `EventSource` — which cannot send an `Authorization` header.\n *\n * It holds only the line in progress and the event being assembled, never the\n * body read so far: a stream may stay open for half an hour.\n */\n\n/** One dispatch of the stream, in the order the stream made them. */\nexport interface EventStreamDispatch {\n /**\n * The stream's last event id after this dispatch. Every dispatch sets it,\n * one without data too: that is how a keepalive advances the position.\n * `''` when the server reset it, or never sent one.\n */\n lastEventId: string;\n /** The reconnection time the stream last announced (`retry:`), in ms. */\n retry: number | null;\n /**\n * The event, or `null` for a dispatch without data, which carries only\n * the id. `type` is `message` when the stream named none.\n */\n event: { type: string; data: string } | null;\n}\n\nconst LF = 10;\nconst CR = 13;\n\n/** Parses decoded text into dispatches, however the text is split into chunks. */\nexport class EventStreamParser {\n private line = '';\n /** The previous chunk ended in CR: a LF opening the next one belongs to it. */\n private skipLf = false;\n private data = '';\n private hasData = false;\n private eventType = '';\n private idBuffer: string;\n private retry: number | null = null;\n\n /**\n * @param lastEventId - The id the stream resumes after, as `EventSource`\n * carries it into a reconnection: a dispatch before the server names an\n * id keeps this one.\n */\n constructor(lastEventId = '') {\n this.idBuffer = lastEventId;\n }\n\n /** Feed the next piece of decoded text; returns the dispatches it completed. */\n push(text: string): EventStreamDispatch[] {\n const out: EventStreamDispatch[] = [];\n if (text.length === 0) return out;\n let start = 0;\n if (this.skipLf) {\n this.skipLf = false;\n if (text.charCodeAt(0) === LF) start = 1;\n }\n for (let i = start; i < text.length; i++) {\n const c = text.charCodeAt(i);\n if (c !== LF && c !== CR) continue;\n const line = this.line + text.slice(start, i);\n this.line = '';\n this.processLine(line, out);\n if (c === CR) {\n if (i + 1 < text.length) {\n if (text.charCodeAt(i + 1) === LF) i++;\n } else {\n this.skipLf = true;\n }\n }\n start = i + 1;\n }\n this.line += text.slice(start);\n return out;\n }\n\n private processLine(line: string, out: EventStreamDispatch[]): void {\n if (line === '') {\n this.dispatch(out);\n return;\n }\n if (line.charCodeAt(0) === 0x3a /* : */) return; // a comment\n const colon = line.indexOf(':');\n let field: string;\n let value: string;\n if (colon === -1) {\n field = line;\n value = '';\n } else {\n field = line.slice(0, colon);\n value = line.slice(colon + 1);\n if (value.charCodeAt(0) === 0x20 /* space */) value = value.slice(1);\n }\n switch (field) {\n case 'event':\n this.eventType = value;\n break;\n case 'data':\n this.data = this.hasData ? `${this.data}\\n${value}` : value;\n this.hasData = true;\n break;\n case 'id':\n if (!value.includes('\\u0000')) this.idBuffer = value;\n break;\n case 'retry':\n if (/^[0-9]+$/.test(value)) {\n const ms = Number(value);\n if (Number.isSafeInteger(ms)) this.retry = ms;\n }\n break;\n default:\n // Unknown fields are ignored.\n break;\n }\n }\n\n private dispatch(out: EventStreamDispatch[]): void {\n const event = this.hasData ? { type: this.eventType || 'message', data: this.data } : null;\n out.push({ lastEventId: this.idBuffer, retry: this.retry, event });\n this.data = '';\n this.hasData = false;\n this.eventType = '';\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAmF,EAAA;AACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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/publish-sdk-0496/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/sdk-pub-04970/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;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,UAAA,CACJ,KAAA,EACgC;AAEhC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uCAAA,EAAyC;AAAA,MAClE,KAA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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/sdk-pub-04970/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"]}