@delopay/sdk 0.470.0 → 0.472.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 (280) 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-7M2KEERO.js → chunk-2I66YLFQ.js} +61 -1
  9. package/dist/chunk-2I66YLFQ.js.map +1 -0
  10. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  11. package/dist/chunk-34PC72O7.cjs.map +1 -1
  12. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  13. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  14. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  15. package/dist/chunk-4B7XO52S.cjs.map +1 -1
  16. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  17. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  18. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  19. package/dist/chunk-5CITBN33.cjs.map +1 -1
  20. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  21. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  22. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  23. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  24. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  25. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  26. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  27. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  28. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  29. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  30. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  31. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  32. package/dist/chunk-7WAQX26D.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-C7GTTBHC.cjs → chunk-AH5ODOQK.cjs} +5 -5
  36. package/dist/{chunk-C7GTTBHC.cjs.map → chunk-AH5ODOQK.cjs.map} +1 -1
  37. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  38. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  39. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  40. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  41. package/dist/chunk-CAMALM35.cjs.map +1 -1
  42. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  43. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  44. package/dist/{chunk-CKKNFFKP.cjs → chunk-CYDHHARQ.cjs} +61 -1
  45. package/dist/chunk-CYDHHARQ.cjs.map +1 -0
  46. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  47. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  48. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  49. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  50. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  51. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  52. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  53. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  54. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  55. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  56. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  57. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  58. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  59. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  60. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  61. package/dist/chunk-HLHML5ES.cjs.map +1 -1
  62. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  63. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  64. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  65. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  66. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  67. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  68. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  69. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  70. package/dist/{chunk-R4FE6K43.cjs → chunk-JPPRDMTJ.cjs} +7 -2
  71. package/dist/chunk-JPPRDMTJ.cjs.map +1 -0
  72. package/dist/chunk-JPRSNCYP.cjs.map +1 -1
  73. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  74. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  75. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  76. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  77. package/dist/chunk-KOB6MOAV.cjs.map +1 -1
  78. package/dist/{chunk-3TUW4OYE.cjs → chunk-KRQGPBJS.cjs} +3 -3
  79. package/dist/{chunk-3TUW4OYE.cjs.map → chunk-KRQGPBJS.cjs.map} +1 -1
  80. package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
  81. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  82. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  83. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  84. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  85. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  86. package/dist/{chunk-UDEIFKUZ.js → chunk-MAHLGVYT.js} +3 -3
  87. package/dist/chunk-MCNDMK7F.cjs.map +1 -1
  88. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  89. package/dist/chunk-NAHX6XYV.cjs.map +1 -1
  90. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  91. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  92. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  93. package/dist/chunk-OAEKP665.cjs.map +1 -1
  94. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  95. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  96. package/dist/chunk-ORCK5GQ3.cjs.map +1 -1
  97. package/dist/chunk-OWP7XBY2.cjs.map +1 -1
  98. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  99. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  100. package/dist/chunk-P6JLNQ6L.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-Q7M7DO7M.cjs.map +1 -1
  104. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  105. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  106. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  107. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  108. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  109. package/dist/{chunk-REC24R2S.js → chunk-RDG7QBXP.js} +2 -2
  110. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  111. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  112. package/dist/chunk-RSVLVW4L.cjs.map +1 -1
  113. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  114. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  115. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  116. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  117. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  118. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  119. package/dist/chunk-UKLZAOLW.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-2JSBGTTW.js → chunk-VS5LE5K4.js} +6 -1
  124. package/dist/chunk-VS5LE5K4.js.map +1 -0
  125. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  126. package/dist/chunk-VZ3BSIVU.cjs.map +1 -1
  127. package/dist/chunk-W457XUA6.cjs.map +1 -1
  128. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  129. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  130. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  131. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  132. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  133. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  134. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  135. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  136. package/dist/client.cjs +2 -2
  137. package/dist/client.cjs.map +1 -1
  138. package/dist/client.js +1 -1
  139. package/dist/core.cjs.map +1 -1
  140. package/dist/currencies.cjs.map +1 -1
  141. package/dist/enigmaCardForm.cjs.map +1 -1
  142. package/dist/error.cjs.map +1 -1
  143. package/dist/eventStream.cjs.map +1 -1
  144. package/dist/exportDownload.cjs.map +1 -1
  145. package/dist/feeProgram.cjs.map +1 -1
  146. package/dist/index.cjs +7 -5
  147. package/dist/index.cjs.map +1 -1
  148. package/dist/index.d.cts +2 -2
  149. package/dist/index.d.ts +2 -2
  150. package/dist/index.js +6 -4
  151. package/dist/internal/resources/admin.cjs.map +1 -1
  152. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  153. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  154. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  155. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  156. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  157. package/dist/internal/resources/adminLive.cjs.map +1 -1
  158. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  159. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  160. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  161. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  162. package/dist/internal/resources/cache.cjs.map +1 -1
  163. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  164. package/dist/internal/resources/configs.cjs.map +1 -1
  165. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  166. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  167. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  168. package/dist/internal/resources/gsm.cjs.map +1 -1
  169. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  170. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  171. package/dist/internal/resources/platformFees.cjs.map +1 -1
  172. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  173. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  174. package/dist/internal.cjs +8 -6
  175. package/dist/internal.cjs.map +1 -1
  176. package/dist/internal.d.cts +2 -2
  177. package/dist/internal.d.ts +2 -2
  178. package/dist/internal.js +6 -4
  179. package/dist/internal.js.map +1 -1
  180. package/dist/listQuery.cjs.map +1 -1
  181. package/dist/panes.cjs.map +1 -1
  182. package/dist/paymentPresentation.cjs.map +1 -1
  183. package/dist/recordCounter.cjs.map +1 -1
  184. package/dist/resources/aiTools.cjs.map +1 -1
  185. package/dist/resources/analytics.cjs.map +1 -1
  186. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  187. package/dist/resources/apiKeys.cjs.map +1 -1
  188. package/dist/resources/audit.cjs.map +1 -1
  189. package/dist/resources/authentication.cjs.map +1 -1
  190. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  191. package/dist/resources/billing.cjs.map +1 -1
  192. package/dist/resources/buyerAccount.cjs.map +1 -1
  193. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  194. package/dist/resources/buyerConversations.cjs.map +1 -1
  195. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  196. package/dist/resources/buyerPortal.cjs.map +1 -1
  197. package/dist/resources/cards.cjs.map +1 -1
  198. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  199. package/dist/resources/checkoutDomains.cjs.map +1 -1
  200. package/dist/resources/checkoutMethods.cjs.map +1 -1
  201. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  202. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  203. package/dist/resources/connectors.cjs.map +1 -1
  204. package/dist/resources/contentEncryption.cjs.map +1 -1
  205. package/dist/resources/costRules.cjs.map +1 -1
  206. package/dist/resources/customers.cjs.map +1 -1
  207. package/dist/resources/deploymentBranding.cjs.map +1 -1
  208. package/dist/resources/disputes.cjs.map +1 -1
  209. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  210. package/dist/resources/events.cjs.map +1 -1
  211. package/dist/resources/export.cjs.map +1 -1
  212. package/dist/resources/externalRecords.cjs.map +1 -1
  213. package/dist/resources/featureMatrix.cjs.map +1 -1
  214. package/dist/resources/fees.cjs.map +1 -1
  215. package/dist/resources/files.cjs.map +1 -1
  216. package/dist/resources/forex.cjs.map +1 -1
  217. package/dist/resources/identityVerifications.cjs.map +1 -1
  218. package/dist/resources/industries.cjs.map +1 -1
  219. package/dist/resources/invoiceSettings.cjs.map +1 -1
  220. package/dist/resources/invoices.cjs.map +1 -1
  221. package/dist/resources/live.cjs.map +1 -1
  222. package/dist/resources/mandates.cjs.map +1 -1
  223. package/dist/resources/merchantAccounts.cjs.map +1 -1
  224. package/dist/resources/messageTemplates.cjs.map +1 -1
  225. package/dist/resources/notices.cjs.map +1 -1
  226. package/dist/resources/operationLimits.cjs.map +1 -1
  227. package/dist/resources/paymentLinks.cjs.map +1 -1
  228. package/dist/resources/paymentMethods.cjs.map +1 -1
  229. package/dist/resources/payments.cjs.map +1 -1
  230. package/dist/resources/payoutDestinations.cjs.map +1 -1
  231. package/dist/resources/payouts.cjs.map +1 -1
  232. package/dist/resources/paypalDisputes.cjs.map +1 -1
  233. package/dist/resources/persons.cjs.map +1 -1
  234. package/dist/resources/poll.cjs.map +1 -1
  235. package/dist/resources/processorCosts.cjs.map +1 -1
  236. package/dist/resources/processorImports.cjs.map +1 -1
  237. package/dist/resources/products.cjs.map +1 -1
  238. package/dist/resources/profileAcquirers.cjs.map +1 -1
  239. package/dist/resources/profiles.cjs.map +1 -1
  240. package/dist/resources/projects.cjs.map +1 -1
  241. package/dist/resources/refunds.cjs.map +1 -1
  242. package/dist/resources/regions.cjs.map +1 -1
  243. package/dist/resources/relay.cjs.map +1 -1
  244. package/dist/resources/risk.cjs.map +1 -1
  245. package/dist/resources/routing.cjs.map +1 -1
  246. package/dist/resources/search.cjs.map +1 -1
  247. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  248. package/dist/resources/settings.cjs.map +1 -1
  249. package/dist/resources/settlement.cjs.map +1 -1
  250. package/dist/resources/shopLabels.cjs.map +1 -1
  251. package/dist/resources/shopify.cjs.map +1 -1
  252. package/dist/resources/shops.cjs.map +1 -1
  253. package/dist/resources/stripeConnect.cjs.map +1 -1
  254. package/dist/resources/subscriptions.cjs +2 -2
  255. package/dist/resources/subscriptions.cjs.map +1 -1
  256. package/dist/resources/subscriptions.d.cts +43 -1
  257. package/dist/resources/subscriptions.d.ts +43 -1
  258. package/dist/resources/subscriptions.js +1 -1
  259. package/dist/resources/support.cjs.map +1 -1
  260. package/dist/resources/threeDsRules.cjs.map +1 -1
  261. package/dist/resources/users.cjs.map +1 -1
  262. package/dist/resources/vatRates.cjs.map +1 -1
  263. package/dist/resources/verification.cjs.map +1 -1
  264. package/dist/resources/webhooks.cjs +4 -2
  265. package/dist/resources/webhooks.cjs.map +1 -1
  266. package/dist/resources/webhooks.d.cts +13 -2
  267. package/dist/resources/webhooks.d.ts +13 -2
  268. package/dist/resources/webhooks.js +3 -1
  269. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  270. package/dist/trustedOrigins.cjs.map +1 -1
  271. package/dist/types.cjs.map +1 -1
  272. package/dist/types.d.cts +146 -5
  273. package/dist/types.d.ts +146 -5
  274. package/package.json +1 -1
  275. package/dist/chunk-2JSBGTTW.js.map +0 -1
  276. package/dist/chunk-7M2KEERO.js.map +0 -1
  277. package/dist/chunk-CKKNFFKP.cjs.map +0 -1
  278. package/dist/chunk-R4FE6K43.cjs.map +0 -1
  279. /package/dist/{chunk-UDEIFKUZ.js.map → chunk-MAHLGVYT.js.map} +0 -0
  280. /package/dist/{chunk-REC24R2S.js.map → chunk-RDG7QBXP.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-P4UILJVU.cjs","../src/resources/payoutDestinations.ts"],"names":[],"mappings":"AAAA;ACoCO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,QAAA,CAAA,EAA0C;AAC9C,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,yBAAyB,CAAA;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,UAAA,CAAW,MAAA,EAAmE;AAClF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,yBAAA,EAA2B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,UAAA,CACJ,aAAA,EACA,MAAA,EAC4B;AAC5B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,wBAAA,EAA2B,kBAAA,CAAmB,aAAa,CAAC,CAAA,CAAA;AAC/E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqF,EAAA;AACvE,IAAA;AACV,MAAA;AAC4D,MAAA;AACxC,MAAA;AACtB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQwE,EAAA;AACkB,IAAA;AACrE,MAAA;AAClB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO4E,EAAA;AAC9D,IAAA;AACV,MAAA;AAC4D,MAAA;AAC9D,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsD,EAAA;AACK,IAAA;AAC3D,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUmC,EAAA;AACmC,IAAA;AAC3D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOiG,EAAA;AACX,IAAA;AACtF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASuF,EAAA;AACI,IAAA;AAC3F,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ4E,EAAA;AACW,IAAA;AACvF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8F,EAAA;AAChF,IAAA;AACV,MAAA;AACyD,MAAA;AACrC,MAAA;AACtB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW+B,EAAA;AACqD,IAAA;AACxD,MAAA;AACzB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQiF,EAAA;AACzB,IAAA;AACnB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsD,EAAA;AACH,IAAA;AACnD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU8C,EAAA;AACqB,IAAA;AACxD,MAAA;AACR,IAAA;AACH,EAAA;AACF;AD1D4F;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-P4UILJVU.cjs","sourcesContent":[null,"import type {\n MyPayoutDestinations,\n MyRevenueShares,\n OfferedMethodsSettings,\n OfferedMethodsSettingsParams,\n OfferedMethodsUpdateParams,\n OfferedPayoutMethods,\n PayoutDestination,\n PayoutDestinationCreateParams,\n PayoutDestinationUpdateParams,\n RevealedPayoutDestination,\n RevenueShareDistributionsParams,\n RevenueShareDistributionsResponse,\n RevenueShareHolder,\n TeamPayoutDestination,\n TeamPayoutDestinations,\n TeamPayoutDestinationsParams,\n} from '../types';\nimport type { RequestFn } from '../client';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Payouts: how a merchant's team members want to be paid, and which methods\n * the merchant offers them. Nothing here moves money.\n *\n * Dashboard (JWT) routes only; no API key reaches them. The merchant, the\n * member and the shop come from the token. Keeping one's own details needs\n * the Payouts view permission (`ProfilePayoutDestinationRead`); the team's\n * details and the offered methods need Payouts manage\n * (`ProfilePayoutDestinationWrite`, `MerchantPayoutDestinationWrite` for the\n * merchant's list). A session acting as someone else (act-as, a support\n * switch) may read and may not change or reveal anything (403, `IR_22`). A\n * stale `version` or `expected_revision` answers 400 with `code` `IR_16` and\n * `data.reason: 'changed_elsewhere'`.\n */\nexport class PayoutDestinations {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The caller's own destinations, masked, and the methods offered to them.\n *\n * `GET /payout-destinations/me`\n */\n async listMine(): Promise<MyPayoutDestinations> {\n return this.request('GET', '/payout-destinations/me');\n }\n\n /**\n * Save a destination. The method must be offered; at most 20 per member.\n *\n * `POST /payout-destinations/me`\n */\n async createMine(params: PayoutDestinationCreateParams): Promise<PayoutDestination> {\n return this.request('POST', '/payout-destinations/me', { body: params });\n }\n\n /**\n * Replace a destination's details at the version read.\n *\n * `PUT /payout-destinations/me/{destinationId}`\n */\n async updateMine(\n destinationId: string,\n params: PayoutDestinationUpdateParams,\n ): Promise<PayoutDestination> {\n return this.request('PUT', `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {\n body: params,\n });\n }\n\n /**\n * Make a destination the preferred one; the others lose it.\n *\n * `POST /payout-destinations/me/{destinationId}/preferred`\n */\n async preferMine(destinationId: string, version: number): Promise<PayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/me/${encodeURIComponent(destinationId)}/preferred`,\n { body: { version } },\n );\n }\n\n /**\n * Delete a destination. Final: the history keeps who, when and which\n * fields, never a value.\n *\n * `DELETE /payout-destinations/me/{destinationId}?version=`\n */\n async deleteMine(destinationId: string, version: number): Promise<void> {\n await this.request('DELETE', `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {\n query: { version },\n });\n }\n\n /**\n * One's own destination in plain text. Recorded in the history first.\n *\n * `POST /payout-destinations/me/{destinationId}/reveal`\n */\n async revealMine(destinationId: string): Promise<RevealedPayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/me/${encodeURIComponent(destinationId)}/reveal`,\n );\n }\n\n /**\n * The methods offered to the caller.\n *\n * `GET /payout-destinations/methods`\n */\n async offeredMethods(): Promise<OfferedPayoutMethods> {\n return this.request('GET', '/payout-destinations/methods');\n }\n\n /**\n * The merchant's list and, with `shop_id`, one shop's. A shop role reads\n * its own shop only.\n *\n * `GET /payout-destinations/methods/settings`\n */\n async retrieveMethodsSettings(\n params?: OfferedMethodsSettingsParams,\n ): Promise<OfferedMethodsSettings> {\n return this.request('GET', '/payout-destinations/methods/settings', {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Set the methods offered at the merchant or at one shop.\n *\n * `PUT /payout-destinations/methods/settings`\n */\n async updateMethodsSettings(params: OfferedMethodsUpdateParams): Promise<OfferedMethodsSettings> {\n return this.request('PUT', '/payout-destinations/methods/settings', { body: params });\n }\n\n /**\n * The team's destinations the caller manages, masked: every member for a\n * merchant-level role, the members reaching the caller's shop for a shop\n * role.\n *\n * `GET /payout-destinations`\n */\n async listTeam(params?: TeamPayoutDestinationsParams): Promise<TeamPayoutDestinations> {\n return this.request('GET', '/payout-destinations', { query: params as Query | undefined });\n }\n\n /**\n * A managed member's destination in plain text. Recorded in the history\n * first.\n *\n * `POST /payout-destinations/{destinationId}/reveal`\n */\n async revealTeam(destinationId: string): Promise<RevealedPayoutDestination> {\n return this.request('POST', `/payout-destinations/${encodeURIComponent(destinationId)}/reveal`);\n }\n\n /**\n * Confirm a changed destination was seen, at the version read.\n *\n * `POST /payout-destinations/{destinationId}/acknowledge`\n */\n async acknowledgeTeam(destinationId: string, version: number): Promise<TeamPayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/${encodeURIComponent(destinationId)}/acknowledge`,\n { body: { version } },\n );\n }\n\n /**\n * Link a revenue-share holder to a team member, or unlink it (`null`). The\n * member must be an active member of the merchant whose role reads Payouts.\n *\n * `PUT /revenue-shares/holders/{holderId}/member`\n */\n async linkRevenueShareHolder(\n holderId: string,\n userId: string | null,\n ): Promise<RevenueShareHolder> {\n return this.request('PUT', `/revenue-shares/holders/${encodeURIComponent(holderId)}/member`, {\n body: { user_id: userId },\n });\n }\n\n /**\n * The merchant's revenue-share holders, each with the team member it is\n * linked to, if any.\n *\n * `GET /revenue-shares/holders?merchant_id={merchantId}`\n */\n async listRevenueShareHolders(merchantId: string): Promise<RevenueShareHolder[]> {\n return this.request('GET', '/revenue-shares/holders', {\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * The share terms of the holders linked to the caller. Read-only.\n *\n * `GET /revenue-shares/mine`\n */\n async listMyRevenueShares(): Promise<MyRevenueShares> {\n return this.request('GET', '/revenue-shares/mine');\n }\n\n /**\n * Frozen period-report distributions and open carry-over for the holders\n * linked to the caller. Live by default; read-only.\n *\n * `GET /revenue-shares/mine/distributions`\n */\n async listMyRevenueShareDistributions(\n params?: RevenueShareDistributionsParams,\n ): Promise<RevenueShareDistributionsResponse> {\n return this.request('GET', '/revenue-shares/mine/distributions', {\n query: params as Query | undefined,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-P4UILJVU.cjs","../src/resources/payoutDestinations.ts"],"names":[],"mappings":"AAAA;ACoCO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAA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3F,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ4E,EAAA;AACW,IAAA;AACvF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8F,EAAA;AAChF,IAAA;AACV,MAAA;AACyD,MAAA;AACrC,MAAA;AACtB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW+B,EAAA;AACqD,IAAA;AACxD,MAAA;AACzB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQiF,EAAA;AACzB,IAAA;AACnB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsD,EAAA;AACH,IAAA;AACnD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU8C,EAAA;AACqB,IAAA;AACxD,MAAA;AACR,IAAA;AACH,EAAA;AACF;AD1D4F;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-P4UILJVU.cjs","sourcesContent":[null,"import type {\n MyPayoutDestinations,\n MyRevenueShares,\n OfferedMethodsSettings,\n OfferedMethodsSettingsParams,\n OfferedMethodsUpdateParams,\n OfferedPayoutMethods,\n PayoutDestination,\n PayoutDestinationCreateParams,\n PayoutDestinationUpdateParams,\n RevealedPayoutDestination,\n RevenueShareDistributionsParams,\n RevenueShareDistributionsResponse,\n RevenueShareHolder,\n TeamPayoutDestination,\n TeamPayoutDestinations,\n TeamPayoutDestinationsParams,\n} from '../types';\nimport type { RequestFn } from '../client';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Payouts: how a merchant's team members want to be paid, and which methods\n * the merchant offers them. Nothing here moves money.\n *\n * Dashboard (JWT) routes only; no API key reaches them. The merchant, the\n * member and the shop come from the token. Keeping one's own details needs\n * the Payouts view permission (`ProfilePayoutDestinationRead`); the team's\n * details and the offered methods need Payouts manage\n * (`ProfilePayoutDestinationWrite`, `MerchantPayoutDestinationWrite` for the\n * merchant's list). A session acting as someone else (act-as, a support\n * switch) may read and may not change or reveal anything (403, `IR_22`). A\n * stale `version` or `expected_revision` answers 400 with `code` `IR_16` and\n * `data.reason: 'changed_elsewhere'`.\n */\nexport class PayoutDestinations {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The caller's own destinations, masked, and the methods offered to them.\n *\n * `GET /payout-destinations/me`\n */\n async listMine(): Promise<MyPayoutDestinations> {\n return this.request('GET', '/payout-destinations/me');\n }\n\n /**\n * Save a destination. The method must be offered; at most 20 per member.\n *\n * `POST /payout-destinations/me`\n */\n async createMine(params: PayoutDestinationCreateParams): Promise<PayoutDestination> {\n return this.request('POST', '/payout-destinations/me', { body: params });\n }\n\n /**\n * Replace a destination's details at the version read.\n *\n * `PUT /payout-destinations/me/{destinationId}`\n */\n async updateMine(\n destinationId: string,\n params: PayoutDestinationUpdateParams,\n ): Promise<PayoutDestination> {\n return this.request('PUT', `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {\n body: params,\n });\n }\n\n /**\n * Make a destination the preferred one; the others lose it.\n *\n * `POST /payout-destinations/me/{destinationId}/preferred`\n */\n async preferMine(destinationId: string, version: number): Promise<PayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/me/${encodeURIComponent(destinationId)}/preferred`,\n { body: { version } },\n );\n }\n\n /**\n * Delete a destination. Final: the history keeps who, when and which\n * fields, never a value.\n *\n * `DELETE /payout-destinations/me/{destinationId}?version=`\n */\n async deleteMine(destinationId: string, version: number): Promise<void> {\n await this.request('DELETE', `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {\n query: { version },\n });\n }\n\n /**\n * One's own destination in plain text. Recorded in the history first.\n *\n * `POST /payout-destinations/me/{destinationId}/reveal`\n */\n async revealMine(destinationId: string): Promise<RevealedPayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/me/${encodeURIComponent(destinationId)}/reveal`,\n );\n }\n\n /**\n * The methods offered to the caller.\n *\n * `GET /payout-destinations/methods`\n */\n async offeredMethods(): Promise<OfferedPayoutMethods> {\n return this.request('GET', '/payout-destinations/methods');\n }\n\n /**\n * The merchant's list and, with `shop_id`, one shop's. A shop role reads\n * its own shop only.\n *\n * `GET /payout-destinations/methods/settings`\n */\n async retrieveMethodsSettings(\n params?: OfferedMethodsSettingsParams,\n ): Promise<OfferedMethodsSettings> {\n return this.request('GET', '/payout-destinations/methods/settings', {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Set the methods offered at the merchant or at one shop.\n *\n * `PUT /payout-destinations/methods/settings`\n */\n async updateMethodsSettings(params: OfferedMethodsUpdateParams): Promise<OfferedMethodsSettings> {\n return this.request('PUT', '/payout-destinations/methods/settings', { body: params });\n }\n\n /**\n * The team's destinations the caller manages, masked: every member for a\n * merchant-level role, the members reaching the caller's shop for a shop\n * role.\n *\n * `GET /payout-destinations`\n */\n async listTeam(params?: TeamPayoutDestinationsParams): Promise<TeamPayoutDestinations> {\n return this.request('GET', '/payout-destinations', { query: params as Query | undefined });\n }\n\n /**\n * A managed member's destination in plain text. Recorded in the history\n * first.\n *\n * `POST /payout-destinations/{destinationId}/reveal`\n */\n async revealTeam(destinationId: string): Promise<RevealedPayoutDestination> {\n return this.request('POST', `/payout-destinations/${encodeURIComponent(destinationId)}/reveal`);\n }\n\n /**\n * Confirm a changed destination was seen, at the version read.\n *\n * `POST /payout-destinations/{destinationId}/acknowledge`\n */\n async acknowledgeTeam(destinationId: string, version: number): Promise<TeamPayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/${encodeURIComponent(destinationId)}/acknowledge`,\n { body: { version } },\n );\n }\n\n /**\n * Link a revenue-share holder to a team member, or unlink it (`null`). The\n * member must be an active member of the merchant whose role reads Payouts.\n *\n * `PUT /revenue-shares/holders/{holderId}/member`\n */\n async linkRevenueShareHolder(\n holderId: string,\n userId: string | null,\n ): Promise<RevenueShareHolder> {\n return this.request('PUT', `/revenue-shares/holders/${encodeURIComponent(holderId)}/member`, {\n body: { user_id: userId },\n });\n }\n\n /**\n * The merchant's revenue-share holders, each with the team member it is\n * linked to, if any.\n *\n * `GET /revenue-shares/holders?merchant_id={merchantId}`\n */\n async listRevenueShareHolders(merchantId: string): Promise<RevenueShareHolder[]> {\n return this.request('GET', '/revenue-shares/holders', {\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * The share terms of the holders linked to the caller. Read-only.\n *\n * `GET /revenue-shares/mine`\n */\n async listMyRevenueShares(): Promise<MyRevenueShares> {\n return this.request('GET', '/revenue-shares/mine');\n }\n\n /**\n * Frozen period-report distributions and open carry-over for the holders\n * linked to the caller. Live by default; read-only.\n *\n * `GET /revenue-shares/mine/distributions`\n */\n async listMyRevenueShareDistributions(\n params?: RevenueShareDistributionsParams,\n ): Promise<RevenueShareDistributionsResponse> {\n return this.request('GET', '/revenue-shares/mine/distributions', {\n query: params as Query | undefined,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-P6JLNQ6L.cjs","../src/resources/export.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACsDO,IAAM,OAAA,EAAN,MAAa;AAAA,EAClB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAsBlD,MAAM,YAAA,CACJ,MAAA,EACA,OAAA,EACyD;AACzD,IAAA,OAAO,yCAAA,IAAU,CAAK,OAAA,EAAS,MAAA,EAAQ,sBAAA,EAAwB,EAAE,IAAA,mBAAM,MAAA,UAAU,CAAC,IAAE,CAAA,EAAG,OAAO,CAAA;AAAA,EAChG;AAAA,EAwBA,MAAM,sBAAA,CACJ,MAAA,EACA,OAAA,EACyD;AACzD,IAAA,OAAO,yCAAA;AAAA,MACL,IAAA,CAAK,OAAA;AAAA,MACL,MAAA;AAAA,MACA,8BAAA;AAAA,MACA,EAAE,IAAA,mBAAM,MAAA,UAAU,CAAC,IAAE,CAA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AM,QAAA,CACJ,MAAA,EACA,OAAA,EAC8D;AAC9D,IAAA,OAAO,yCAAA;AAAA,MACL,IAAA,CAAK,OAAA;AAAA,MACL,KAAA;AAAA,MACA,eAAA;AAAA,MACA,EAAE,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,YAAA,EAAc,QAAA,EAAU,aAAa,CAAC,EAAE,CAAA;AAAA,MACnE;AAAA,IACF,CAAA;AAAA,EACF;AACF,CAAA;AAGA,SAAS,OAAA,CAAQ,MAAA,EAAiB,OAAA,EAAkD;AAClF,EAAA,OAAO,EAAE,KAAA,mBAAQ,MAAA,UAAU,CAAC,GAAA,EAAa,GAAI,QAAA,EAAU,EAAE,QAAQ,EAAA,EAAI,CAAC,EAAG,CAAA;AAC3E;AD7VA;AACA;AACE;AACF,wBAAC","file":"/tmp/w1-pub-0470/sdk/dist/chunk-P6JLNQ6L.cjs","sourcesContent":[null,"import type {\n DisputeExportRecord,\n DisputeListParams,\n ExportEnvelope,\n BinaryExportOptions,\n CsvExportOptions,\n DynamicLineExportOptions,\n ExportOptions,\n JsonExportOptions,\n MerchantAuditLogExportRecord,\n MerchantAuditLogListParams,\n PayoutExportRecord,\n PayoutListParams,\n RefundExportRecord,\n RefundListParams,\n PaymentListFilterConstraints,\n ProfilePaymentListFilterConstraints,\n SubscriptionExportRecord,\n SubscriptionListParams,\n TransactionExportRecord,\n TransactionLineExportRecord,\n VatReportParams,\n VatReportRecord,\n} from '../types';\nimport type { RequestFn, RequestOptions } from '../client';\nimport { runExport } from '../exportDownload';\nimport { csvQuery } from '../listQuery';\n\n/** Query value shape `RequestOptions.query` accepts. */\ntype Query = NonNullable<RequestOptions['query']>;\n\n/**\n * Emit a list as a file.\n *\n * Every method here mirrors one list endpoint and takes **that list's own\n * filters**, unchanged — there is no second filter vocabulary for exports. The\n * shop scope is resolved the same way too, so an export cannot show a shop its\n * list would not: a shop-scoped token exports its own shop, and naming another\n * is refused rather than ignored.\n *\n * Every export is **one read**, not a paged walk, and is bounded at 25,000\n * rows (500 for `pdf`, which is a document rather than a data feed). Over the\n * bound the request is refused with `DE_07 export_row_limit_exceeded` carrying\n * `{entity, max_rows}` — a truncated finance file that reports success is the\n * thing these endpoints exist not to produce. When too many exports are\n * already running the server answers `429` `IR_52` (`export_capacity_busy`);\n * a `GET` export is retried after its `Retry-After` like any other `429`.\n *\n * `csv` and `json` are **streamed**: the server counts the match set, sends\n * that count in `X-Delopay-Record-Count` before the first byte, and writes the\n * rows as it reads them. Each method holds the finished body to that count and\n * rejects with `EXPORT_INCOMPLETE` rather than resolve to a file missing rows —\n * see {@link ExportTransferOptions}, which also carries the download's\n * `onProgress`, `signal` and (idle) `timeout`. `pdf` stays a buffered body.\n *\n * `format` selects an `Accept` header, never a request field: an export reuses\n * its list's filter model as literally the same type, and several of those are\n * `deny_unknown_fields`, so a `format` key would be a 400. It defaults to\n * `json`, which resolves to a typed {@link ExportEnvelope}; `csv` and `pdf`\n * resolve to a `Blob`.\n */\nexport class Export {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transactions. `POST /export/transactions`\n *\n * The payments `payments.listByFilter` would list for the same body, over the\n * whole match set: same filters, same order, same scope. `limit` and\n * `offset` are ignored — the page is what an export does away with. No time\n * window is required; the row bound refuses an export that matches too much.\n */\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/export/transactions', { body: params ?? {} }, options);\n }\n\n /**\n * The caller's own shop's transactions.\n * `POST /export/profile/transactions`\n *\n * The shop-scoped twin of {@link Export.transactions}, taking the body\n * `payments.listByProfileFilter` sends and scoped exactly as that list is: to\n * the shop on the token. Gated on the profile-level payment permission, which\n * a shop-scoped role can hold where the merchant-level one cannot. Its rows\n * carry no `connector_settlement_status`, which a shop viewer is not shown.\n */\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * Transactions, one row per product line. `POST /export/transactions/lines`\n *\n * The payments {@link Export.transactions} would export for the same body,\n * one row per product line they recorded, plus one `row_kind: 'no_lines'`\n * row for each payment that recorded none — see\n * {@link TransactionLineExportRecord} for how the file reconciles with the\n * per-payment one. `csv` or `json` only: a line export has no PDF form, and\n * the server refuses one with `422`. The row bound applies to the rows.\n */\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * The caller's own shop's transactions, one row per product line.\n * `POST /export/profile/transactions/lines`\n *\n * The shop-scoped twin of {@link Export.transactionLines}, scoped as\n * {@link Export.transactionsForProfile} is: to the shop on the token.\n */\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Refunds. `POST /refunds/list/export` */\n async refunds(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refunds(params: RefundListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async refunds(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refunds(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/refunds/list/export', { body: params ?? {} }, options);\n }\n\n /** The caller's own shop's refunds. `POST /refunds/profile/list/export` */\n async refundsForProfile(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refundsForProfile(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/refunds/profile/list/export',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Disputes. `GET /disputes/list/export` */\n async disputes(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputes(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputes(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputes(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(this.request, 'GET', '/disputes/list/export', queried(params), options);\n }\n\n /** The caller's own shop's disputes. `GET /disputes/profile/list/export` */\n async disputesForProfile(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputesForProfile(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/disputes/profile/list/export',\n queried(params),\n options,\n );\n }\n\n /** Payouts. `POST /payouts/list/export` */\n async payouts(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payouts(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payouts(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payouts(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/payouts/list/export', { body: params }, options);\n }\n\n /** The caller's own shop's payouts. `POST /payouts/profile/list/export` */\n async payoutsForProfile(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payoutsForProfile(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/payouts/profile/list/export',\n { body: params },\n options,\n );\n }\n\n /**\n * Subscriptions. `GET /subscriptions/list/export`\n *\n * `profileId` becomes the `X-Profile-Id` header, exactly as on the list. A\n * shop-scoped token exports its own shop whatever this says.\n */\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord>>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob>;\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/subscriptions/list/export',\n queried(params, { 'X-Profile-Id': profileId }),\n options,\n );\n }\n\n /**\n * The one-stop-shop VAT report of a quarter. `GET /export/vat-report`\n *\n * The quarter's sales and VAT per country, rate, reverse-charge mark and\n * currency, for the one-stop-shop return. It is built from the VAT DeloPay\n * determined and recorded on each payment; a payment without one is not in\n * it. The quarter's refunds and lost disputes reduce it by their share of\n * the payment's VAT, in the quarter they happened. Sales a provider made as\n * seller of record are left out: the provider taxed and declares them. See\n * {@link VatReportRecord}.\n *\n * `csv` or `json` only. The server answers `422` `IR_06` for an invalid year\n * or quarter, for `pdf`, and, rather than return the report incomplete,\n * when the quarter holds more than 100,000 payments or returns (ask for one\n * shop at a time). It answers `400` `IR_16` when a payment's recorded VAT\n * does not add up. A role that may see only some processors or payments is\n * refused with `403`.\n */\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReport(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReport(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/vat-report', queried(params), options);\n }\n\n /**\n * The caller's own shop's VAT report of a quarter.\n * `GET /export/profile/vat-report`\n *\n * The shop-scoped twin of {@link Export.vatReport}, gated on the\n * profile-level payment permission and confined to the shop on the token;\n * `profile_id` is ignored.\n */\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReportForProfile(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/profile/vat-report', queried(params), options);\n }\n\n /** Settlement statements. `GET /settlement/statements/export` */\n\n /** One period's settlement lines. `GET /settlement/lines/export` */\n\n /**\n * The merchant's own audit log. `GET /audit/export`\n *\n * Requires a dashboard JWT whose role holds the merchant-level `AuditLog`\n * permission — a shop-scoped role cannot hold it. There is no `merchant_id`\n * parameter: the scope comes from the token.\n */\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord>>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob>;\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/audit/export',\n { query: csvQuery(params, ['profile_id', 'action', 'entity_type']) },\n options,\n );\n }\n}\n\n/** Request options for an export whose filters travel in the query. */\nfunction queried(params: unknown, headers?: Record<string, string>): RequestOptions {\n return { query: (params ?? {}) as Query, ...(headers ? { headers } : {}) };\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-P6JLNQ6L.cjs","../src/resources/export.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACsDO,IAAM,OAAA,EAAN,MAAa;AAAA,EAClB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAsBlD,MAAM,YAAA,CACJ,MAAA,EACA,OAAA,EACyD;AACzD,IAAA,OAAO,yCAAA,IAAU,CAAK,OAAA,EAAS,MAAA,EAAQ,sBAAA,EAAwB,EAAE,IAAA,mBAAM,MAAA,UAAU,CAAC,IAAE,CAAA,EAAG,OAAO,CAAA;AAAA,EAChG;AAAA,EAwBA,MAAM,sBAAA,CACJ,MAAA,EACA,OAAA,EACyD;AACzD,IAAA,OAAO,yCAAA;AAAA,MACL,IAAA,CAAK,OAAA;AAAA,MACL,MAAA;AAAA,MACA,8BAAA;AAAA,MACA,EAA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G,OAAO,CAAA;AAAA,EAC9F;AAAA,EAyBA,MAAM,QAAA,CACJ,MAAA,EACA,OAAA,EAC8D;AAC9D,IAAA,OAAO,yCAAA;AAAA,MACL,IAAA,CAAK,OAAA;AAAA,MACL,KAAA;AAAA,MACA,eAAA;AAAA,MACA,EAAE,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,YAAA,EAAc,QAAA,EAAU,aAAa,CAAC,EAAE,CAAA;AAAA,MACnE;AAAA,IACF,CAAA;AAAA,EACF;AACF,CAAA;AAGA,SAAS,OAAA,CAAQ,MAAA,EAAiB,OAAA,EAAkD;AAClF,EAAA,OAAO,EAAE,KAAA,mBAAQ,MAAA,UAAU,CAAC,GAAA,EAAa,GAAI,QAAA,EAAU,EAAE,QAAQ,EAAA,EAAI,CAAC,EAAG,CAAA;AAC3E;AD7VA;AACA;AACE;AACF,wBAAC","file":"/tmp/w4-publish-0472/dist/chunk-P6JLNQ6L.cjs","sourcesContent":[null,"import type {\n DisputeExportRecord,\n DisputeListParams,\n ExportEnvelope,\n BinaryExportOptions,\n CsvExportOptions,\n DynamicLineExportOptions,\n ExportOptions,\n JsonExportOptions,\n MerchantAuditLogExportRecord,\n MerchantAuditLogListParams,\n PayoutExportRecord,\n PayoutListParams,\n RefundExportRecord,\n RefundListParams,\n PaymentListFilterConstraints,\n ProfilePaymentListFilterConstraints,\n SubscriptionExportRecord,\n SubscriptionListParams,\n TransactionExportRecord,\n TransactionLineExportRecord,\n VatReportParams,\n VatReportRecord,\n} from '../types';\nimport type { RequestFn, RequestOptions } from '../client';\nimport { runExport } from '../exportDownload';\nimport { csvQuery } from '../listQuery';\n\n/** Query value shape `RequestOptions.query` accepts. */\ntype Query = NonNullable<RequestOptions['query']>;\n\n/**\n * Emit a list as a file.\n *\n * Every method here mirrors one list endpoint and takes **that list's own\n * filters**, unchanged — there is no second filter vocabulary for exports. The\n * shop scope is resolved the same way too, so an export cannot show a shop its\n * list would not: a shop-scoped token exports its own shop, and naming another\n * is refused rather than ignored.\n *\n * Every export is **one read**, not a paged walk, and is bounded at 25,000\n * rows (500 for `pdf`, which is a document rather than a data feed). Over the\n * bound the request is refused with `DE_07 export_row_limit_exceeded` carrying\n * `{entity, max_rows}` — a truncated finance file that reports success is the\n * thing these endpoints exist not to produce. When too many exports are\n * already running the server answers `429` `IR_52` (`export_capacity_busy`);\n * a `GET` export is retried after its `Retry-After` like any other `429`.\n *\n * `csv` and `json` are **streamed**: the server counts the match set, sends\n * that count in `X-Delopay-Record-Count` before the first byte, and writes the\n * rows as it reads them. Each method holds the finished body to that count and\n * rejects with `EXPORT_INCOMPLETE` rather than resolve to a file missing rows —\n * see {@link ExportTransferOptions}, which also carries the download's\n * `onProgress`, `signal` and (idle) `timeout`. `pdf` stays a buffered body.\n *\n * `format` selects an `Accept` header, never a request field: an export reuses\n * its list's filter model as literally the same type, and several of those are\n * `deny_unknown_fields`, so a `format` key would be a 400. It defaults to\n * `json`, which resolves to a typed {@link ExportEnvelope}; `csv` and `pdf`\n * resolve to a `Blob`.\n */\nexport class Export {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transactions. `POST /export/transactions`\n *\n * The payments `payments.listByFilter` would list for the same body, over the\n * whole match set: same filters, same order, same scope. `limit` and\n * `offset` are ignored — the page is what an export does away with. No time\n * window is required; the row bound refuses an export that matches too much.\n */\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/export/transactions', { body: params ?? {} }, options);\n }\n\n /**\n * The caller's own shop's transactions.\n * `POST /export/profile/transactions`\n *\n * The shop-scoped twin of {@link Export.transactions}, taking the body\n * `payments.listByProfileFilter` sends and scoped exactly as that list is: to\n * the shop on the token. Gated on the profile-level payment permission, which\n * a shop-scoped role can hold where the merchant-level one cannot. Its rows\n * carry no `connector_settlement_status`, which a shop viewer is not shown.\n */\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * Transactions, one row per product line. `POST /export/transactions/lines`\n *\n * The payments {@link Export.transactions} would export for the same body,\n * one row per product line they recorded, plus one `row_kind: 'no_lines'`\n * row for each payment that recorded none — see\n * {@link TransactionLineExportRecord} for how the file reconciles with the\n * per-payment one. `csv` or `json` only: a line export has no PDF form, and\n * the server refuses one with `422`. The row bound applies to the rows.\n */\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * The caller's own shop's transactions, one row per product line.\n * `POST /export/profile/transactions/lines`\n *\n * The shop-scoped twin of {@link Export.transactionLines}, scoped as\n * {@link Export.transactionsForProfile} is: to the shop on the token.\n */\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Refunds. `POST /refunds/list/export` */\n async refunds(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refunds(params: RefundListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async refunds(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refunds(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/refunds/list/export', { body: params ?? {} }, options);\n }\n\n /** The caller's own shop's refunds. `POST /refunds/profile/list/export` */\n async refundsForProfile(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refundsForProfile(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/refunds/profile/list/export',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Disputes. `GET /disputes/list/export` */\n async disputes(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputes(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputes(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputes(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(this.request, 'GET', '/disputes/list/export', queried(params), options);\n }\n\n /** The caller's own shop's disputes. `GET /disputes/profile/list/export` */\n async disputesForProfile(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputesForProfile(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/disputes/profile/list/export',\n queried(params),\n options,\n );\n }\n\n /** Payouts. `POST /payouts/list/export` */\n async payouts(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payouts(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payouts(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payouts(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/payouts/list/export', { body: params }, options);\n }\n\n /** The caller's own shop's payouts. `POST /payouts/profile/list/export` */\n async payoutsForProfile(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payoutsForProfile(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/payouts/profile/list/export',\n { body: params },\n options,\n );\n }\n\n /**\n * Subscriptions. `GET /subscriptions/list/export`\n *\n * `profileId` becomes the `X-Profile-Id` header, exactly as on the list. A\n * shop-scoped token exports its own shop whatever this says.\n */\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord>>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob>;\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/subscriptions/list/export',\n queried(params, { 'X-Profile-Id': profileId }),\n options,\n );\n }\n\n /**\n * The one-stop-shop VAT report of a quarter. `GET /export/vat-report`\n *\n * The quarter's sales and VAT per country, rate, reverse-charge mark and\n * currency, for the one-stop-shop return. It is built from the VAT DeloPay\n * determined and recorded on each payment; a payment without one is not in\n * it. The quarter's refunds and lost disputes reduce it by their share of\n * the payment's VAT, in the quarter they happened. Sales a provider made as\n * seller of record are left out: the provider taxed and declares them. See\n * {@link VatReportRecord}.\n *\n * `csv` or `json` only. The server answers `422` `IR_06` for an invalid year\n * or quarter, for `pdf`, and, rather than return the report incomplete,\n * when the quarter holds more than 100,000 payments or returns (ask for one\n * shop at a time). It answers `400` `IR_16` when a payment's recorded VAT\n * does not add up. A role that may see only some processors or payments is\n * refused with `403`.\n */\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReport(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReport(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/vat-report', queried(params), options);\n }\n\n /**\n * The caller's own shop's VAT report of a quarter.\n * `GET /export/profile/vat-report`\n *\n * The shop-scoped twin of {@link Export.vatReport}, gated on the\n * profile-level payment permission and confined to the shop on the token;\n * `profile_id` is ignored.\n */\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReportForProfile(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/profile/vat-report', queried(params), options);\n }\n\n /** Settlement statements. `GET /settlement/statements/export` */\n\n /** One period's settlement lines. `GET /settlement/lines/export` */\n\n /**\n * The merchant's own audit log. `GET /audit/export`\n *\n * Requires a dashboard JWT whose role holds the merchant-level `AuditLog`\n * permission — a shop-scoped role cannot hold it. There is no `merchant_id`\n * parameter: the scope comes from the token.\n */\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord>>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob>;\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/audit/export',\n { query: csvQuery(params, ['profile_id', 'action', 'entity_type']) },\n options,\n );\n }\n}\n\n/** Request options for an export whose filters travel in the query. */\nfunction queried(params: unknown, headers?: Record<string, string>): RequestOptions {\n return { query: (params ?? {}) as Query, ...(headers ? { headers } : {}) };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-P7DYLUUI.cjs","../src/currencies.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,mBAAA,EAAqB;AAAA,EAChC,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAA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AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA;ADLA;AACA;AACE;AACF,gDAAC","file":"/tmp/w1-pub-0470/sdk/dist/chunk-P7DYLUUI.cjs","sourcesContent":[null,"import type { Currency } from './types';\n\n/**\n * Every currency the API accepts, in the order the API lists them. The same\n * set as the `Currency` type, for code that needs the list at runtime: a\n * currency picker, a condition builder, input validation.\n */\nexport const PAYMENT_CURRENCIES = [\n 'AED',\n 'AFN',\n 'ALL',\n 'AMD',\n 'ANG',\n 'AOA',\n 'ARS',\n 'AUD',\n 'AWG',\n 'AZN',\n 'BAM',\n 'BBD',\n 'BDT',\n 'BGN',\n 'BHD',\n 'BIF',\n 'BMD',\n 'BND',\n 'BOB',\n 'BRL',\n 'BSD',\n 'BTN',\n 'BWP',\n 'BYN',\n 'BZD',\n 'CAD',\n 'CDF',\n 'CHF',\n 'CLF',\n 'CLP',\n 'CNY',\n 'COP',\n 'CRC',\n 'CUC',\n 'CUP',\n 'CVE',\n 'CZK',\n 'DJF',\n 'DKK',\n 'DOP',\n 'DZD',\n 'EGP',\n 'ERN',\n 'ETB',\n 'EUR',\n 'FJD',\n 'FKP',\n 'GBP',\n 'GEL',\n 'GHS',\n 'GIP',\n 'GMD',\n 'GNF',\n 'GTQ',\n 'GYD',\n 'HKD',\n 'HNL',\n 'HRK',\n 'HTG',\n 'HUF',\n 'IDR',\n 'ILS',\n 'INR',\n 'IQD',\n 'IRR',\n 'ISK',\n 'JMD',\n 'JOD',\n 'JPY',\n 'KES',\n 'KGS',\n 'KHR',\n 'KMF',\n 'KPW',\n 'KRW',\n 'KWD',\n 'KYD',\n 'KZT',\n 'LAK',\n 'LBP',\n 'LKR',\n 'LRD',\n 'LSL',\n 'LYD',\n 'MAD',\n 'MDL',\n 'MGA',\n 'MKD',\n 'MMK',\n 'MNT',\n 'MOP',\n 'MRU',\n 'MUR',\n 'MVR',\n 'MWK',\n 'MXN',\n 'MYR',\n 'MZN',\n 'NAD',\n 'NGN',\n 'NIO',\n 'NOK',\n 'NPR',\n 'NZD',\n 'OMR',\n 'PAB',\n 'PEN',\n 'PGK',\n 'PHP',\n 'PKR',\n 'PLN',\n 'PYG',\n 'QAR',\n 'RON',\n 'RSD',\n 'RUB',\n 'RWF',\n 'SAR',\n 'SBD',\n 'SCR',\n 'SDG',\n 'SEK',\n 'SGD',\n 'SHP',\n 'SLE',\n 'SLL',\n 'SOS',\n 'SRD',\n 'SSP',\n 'STD',\n 'STN',\n 'SVC',\n 'SYP',\n 'SZL',\n 'THB',\n 'TJS',\n 'TMT',\n 'TND',\n 'TOP',\n 'TRY',\n 'TTD',\n 'TWD',\n 'TZS',\n 'UAH',\n 'UGX',\n 'USD',\n 'UYU',\n 'UZS',\n 'VES',\n 'VND',\n 'VUV',\n 'WST',\n 'XAF',\n 'XCD',\n 'XOF',\n 'XPF',\n 'YER',\n 'ZAR',\n 'ZMW',\n 'ZWL',\n] as const satisfies readonly Currency[];\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-P7DYLUUI.cjs","../src/currencies.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,mBAAA,EAAqB;AAAA,EAChC,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,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AA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA;ADLA;AACA;AACE;AACF,gDAAC","file":"/tmp/w4-publish-0472/dist/chunk-P7DYLUUI.cjs","sourcesContent":[null,"import type { Currency } from './types';\n\n/**\n * Every currency the API accepts, in the order the API lists them. The same\n * set as the `Currency` type, for code that needs the list at runtime: a\n * currency picker, a condition builder, input validation.\n */\nexport const PAYMENT_CURRENCIES = [\n 'AED',\n 'AFN',\n 'ALL',\n 'AMD',\n 'ANG',\n 'AOA',\n 'ARS',\n 'AUD',\n 'AWG',\n 'AZN',\n 'BAM',\n 'BBD',\n 'BDT',\n 'BGN',\n 'BHD',\n 'BIF',\n 'BMD',\n 'BND',\n 'BOB',\n 'BRL',\n 'BSD',\n 'BTN',\n 'BWP',\n 'BYN',\n 'BZD',\n 'CAD',\n 'CDF',\n 'CHF',\n 'CLF',\n 'CLP',\n 'CNY',\n 'COP',\n 'CRC',\n 'CUC',\n 'CUP',\n 'CVE',\n 'CZK',\n 'DJF',\n 'DKK',\n 'DOP',\n 'DZD',\n 'EGP',\n 'ERN',\n 'ETB',\n 'EUR',\n 'FJD',\n 'FKP',\n 'GBP',\n 'GEL',\n 'GHS',\n 'GIP',\n 'GMD',\n 'GNF',\n 'GTQ',\n 'GYD',\n 'HKD',\n 'HNL',\n 'HRK',\n 'HTG',\n 'HUF',\n 'IDR',\n 'ILS',\n 'INR',\n 'IQD',\n 'IRR',\n 'ISK',\n 'JMD',\n 'JOD',\n 'JPY',\n 'KES',\n 'KGS',\n 'KHR',\n 'KMF',\n 'KPW',\n 'KRW',\n 'KWD',\n 'KYD',\n 'KZT',\n 'LAK',\n 'LBP',\n 'LKR',\n 'LRD',\n 'LSL',\n 'LYD',\n 'MAD',\n 'MDL',\n 'MGA',\n 'MKD',\n 'MMK',\n 'MNT',\n 'MOP',\n 'MRU',\n 'MUR',\n 'MVR',\n 'MWK',\n 'MXN',\n 'MYR',\n 'MZN',\n 'NAD',\n 'NGN',\n 'NIO',\n 'NOK',\n 'NPR',\n 'NZD',\n 'OMR',\n 'PAB',\n 'PEN',\n 'PGK',\n 'PHP',\n 'PKR',\n 'PLN',\n 'PYG',\n 'QAR',\n 'RON',\n 'RSD',\n 'RUB',\n 'RWF',\n 'SAR',\n 'SBD',\n 'SCR',\n 'SDG',\n 'SEK',\n 'SGD',\n 'SHP',\n 'SLE',\n 'SLL',\n 'SOS',\n 'SRD',\n 'SSP',\n 'STD',\n 'STN',\n 'SVC',\n 'SYP',\n 'SZL',\n 'THB',\n 'TJS',\n 'TMT',\n 'TND',\n 'TOP',\n 'TRY',\n 'TTD',\n 'TWD',\n 'TZS',\n 'UAH',\n 'UGX',\n 'USD',\n 'UYU',\n 'UZS',\n 'VES',\n 'VND',\n 'VUV',\n 'WST',\n 'XAF',\n 'XCD',\n 'XOF',\n 'XPF',\n 'YER',\n 'ZAR',\n 'ZMW',\n 'ZWL',\n] as const satisfies readonly Currency[];\n"]}
@@ -1 +1 @@
1
- {"version":3,"s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EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAiF,EAAA;AACnF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAqF,EAAA;AACvF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAA6E,MAAA;AAC5D,IAAA;AAChB,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAiBE,IAAA;AAAY,MAAA;AACV,MAAA;AACkE,IAAA;AACpE,EAAA;AACF;AAAA,EAAA;AAIE,IAAA;AAAmF,EAAA;AACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAoE,EAAA;AACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAoE,EAAA;AACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAA4D,EAAA;AAC9D;AAAA,EAAA;AAIE,IAAA;AAAoF,EAAA;AACtF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAuF,EAAA;AACzF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAqF,EAAA;AACvF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAaE,IAAA;AAAuE,EAAA;AAE3E;ADxFA;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-PKAE6AQT.cjs","sourcesContent":[null,"import type {\n DiagnosticAttentionBoard,\n DiagnosticAttentionParams,\n DiagnosticChange,\n DiagnosticChangeListParams,\n DiagnosticConnectorCall,\n DiagnosticConnectorCallListParams,\n DiagnosticErrorCodeCount,\n DiagnosticFiringAlert,\n DiagnosticIncomingWebhook,\n DiagnosticIncomingWebhookDetail,\n DiagnosticIncomingWebhookListParams,\n DiagnosticInfrastructure,\n DiagnosticList,\n DiagnosticOutgoingWebhook,\n DiagnosticOutgoingWebhookListParams,\n DiagnosticOutgoingWebhookSummary,\n DiagnosticPanel,\n DiagnosticPayment,\n DiagnosticPaymentListParams,\n DiagnosticQueueItem,\n DiagnosticQueueListParams,\n DiagnosticQueueSummary,\n DiagnosticResolvedId,\n DiagnosticRevealRequest,\n DiagnosticRevealResponse,\n DiagnosticRouterLog,\n DiagnosticRouterLogParams,\n DiagnosticTrace,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * The diagnostic console — everything the router did, without a\n * shell.\n *\n * Cross-merchant by construction: one call answers across every merchant on the\n * deployment. The backend gates that on the `Diagnostic` permission, which is\n * granted to DeloPay's internal staff roles alone, which is why this lives in\n * `@delopay/sdk/internal` and never on the merchant-facing client.\n *\n * ## Two shapes worth knowing before you call anything\n *\n * **Lists answer {@link DiagnosticList}**, which carries `hidden_by_environment`\n * beside the rows. That number is what lets a UI say \"612 test-mode rows are\n * hidden\" rather than leaving an operator unable to tell an empty tab from a\n * filtered one.\n *\n * **Two reads answer {@link DiagnosticPanel} instead** — {@link routerLogs} and\n * {@link alerts} — because their sources can be down independently of the\n * router. A panel is `available` with data or `unavailable` with a reason, and\n * that distinction is the whole point: **an unreachable log store must never be\n * rendered as \"no errors found\"**, and a `T[]` gives a caller no way to tell the\n * two apart.\n *\n * ## The environment filter\n *\n * Every list takes `environment`. Omitting it is read by the backend as\n * `'live'`, never as `'all'` — a caller that forgot to say gets the safer of the\n * two, and a test payment never appears in a view that reads as live.\n */\nexport class Diagnostic {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The ranked attention board — the page's landing state, with nothing typed.\n *\n * Always carries `checks_run` and `vitals`, so an empty `items` reads as\n * \"checked these things at 14:02, all clear\" rather than as a panel that\n * failed to load. A check that could not run is **absent** from `checks_run`\n * rather than silently counted as clear.\n */\n async attention(body?: DiagnosticAttentionParams): Promise<DiagnosticAttentionBoard> {\n return this.request('POST', '/admin-portal/diagnostic/attention', { body: body ?? {} });\n }\n\n /**\n * Provider webhooks received, across every merchant.\n *\n * `source_verified: false` selects rows that failed verification **or** never\n * reached it — the deliveries that failed before verification was attempted\n * are exactly the ones an operator opens this tab for.\n */\n async listIncomingWebhooks(\n body?: DiagnosticIncomingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticIncomingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/incoming', {\n body: body ?? {},\n });\n }\n\n /**\n * One delivery in full: masked headers and body, the verification verdict,\n * and the router log lines for its request id.\n *\n * `router_logs` is `null` — not `[]` — when the log store is unreachable, and\n * `router_logs_unavailable` then says why. Render the first as *unavailable*,\n * never as \"the router logged nothing\".\n */\n async getIncomingWebhook(eventId: string): Promise<DiagnosticIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */\n async listOutgoingWebhooks(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticOutgoingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing', {\n body: body ?? {},\n });\n }\n\n /**\n * The four tiles above the shop-webhooks table.\n *\n * Counted under the same window and environment as the table but **without**\n * its delivery filter — the tiles say what the window holds, and applying the\n * filter would make every tile agree with whichever one is selected.\n */\n async outgoingWebhookSummary(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticOutgoingWebhookSummary> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing/summary', {\n body: body ?? {},\n });\n }\n\n /**\n * Connector calls the router made.\n *\n * List rows carry no payload. Fetch one with {@link getConnectorCall} for the\n * masked request and response.\n */\n async listConnectorCalls(\n body?: DiagnosticConnectorCallListParams,\n ): Promise<DiagnosticList<DiagnosticConnectorCall>> {\n return this.request('POST', '/admin-portal/diagnostic/connector-calls', { body: body ?? {} });\n }\n\n /** One connector call, with its masked payloads. */\n async getConnectorCall(id: string): Promise<DiagnosticConnectorCall> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`,\n );\n }\n\n /**\n * Router logs, proxied from the deployment's log store.\n *\n * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:\n * `'unavailable'` means the store did not answer, which is the opposite of\n * \"there were no errors\" and must be rendered as such.\n */\n async routerLogs(\n body?: DiagnosticRouterLogParams,\n ): Promise<DiagnosticPanel<DiagnosticList<DiagnosticRouterLog>>> {\n return this.request('POST', '/admin-portal/diagnostic/logs', { body: body ?? {} });\n }\n\n /**\n * Payments that are stuck or failed.\n *\n * Stuck means non-terminal for longer than `stuck_minutes`; failed means it\n * ended without succeeding inside the window. Omitting `stuck_minutes` turns\n * the first arm off rather than widening it.\n */\n async listPayments(\n body?: DiagnosticPaymentListParams,\n ): Promise<DiagnosticList<DiagnosticPayment>> {\n return this.request('POST', '/admin-portal/diagnostic/payments', { body: body ?? {} });\n }\n\n /**\n * The error codes in this window, each with its count in the previous window\n * of equal length.\n *\n * `previous_count: null` means the code did not appear before — render it as\n * \"new\" rather than as a fall to zero.\n */\n async paymentErrorCodes(body?: DiagnosticPaymentListParams): Promise<DiagnosticErrorCodeCount[]> {\n return this.request('POST', '/admin-portal/diagnostic/payments/error-codes', {\n body: body ?? {},\n });\n }\n\n /**\n * Everything about one payment, in one call: the payment, its attempts, its\n * status history, its client context, and what it produced — connector calls,\n * webhooks both ways, and scheduler jobs.\n *\n * Read `diagnostic_capture` before rendering an empty section. A payment with\n * no connector calls and a deployment that never recorded any are different\n * facts, and the second must not read as the first.\n *\n * Typed loosely on purpose: the payment, attempts, status-history and\n * client-context halves are the merchant-facing shapes this package already\n * exports, and re-declaring them here would give consumers two names for one\n * thing that could then drift apart.\n */\n async getPayment(paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Scheduler tasks, most overdue first. */\n async listQueues(body?: DiagnosticQueueListParams): Promise<DiagnosticList<DiagnosticQueueItem>> {\n return this.request('POST', '/admin-portal/diagnostic/queues', { body: body ?? {} });\n }\n\n /**\n * The four tiles above the queues table, plus the approvals count.\n *\n * `pending_approvals` is a **different** queue from `pending_count`: a stalled\n * scheduler needs a consumer, a full approvals queue needs a person, and\n * folding them into one number would point an operator at the wrong fix.\n */\n async queueSummary(): Promise<DiagnosticQueueSummary> {\n return this.request('GET', '/admin-portal/diagnostic/queues/summary');\n }\n\n /**\n * Replicas and their dependencies.\n *\n * `build_mismatch` is computed server-side rather than left for a caller to\n * notice by comparing strings: one replica in four answering differently\n * explains a whole class of \"it only fails sometimes\" incident, and is\n * invisible unless something says it out loud.\n */\n async infrastructure(): Promise<DiagnosticInfrastructure> {\n return this.request('GET', '/admin-portal/diagnostic/infrastructure');\n }\n\n /**\n * Firing alerts, proxied from Alertmanager.\n *\n * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}\n * does: a strip that renders empty because Alertmanager is down says \"nothing\n * is firing\", which is the most dangerous sentence this page could print.\n */\n async alerts(): Promise<DiagnosticPanel<DiagnosticFiringAlert[]>> {\n return this.request('GET', '/admin-portal/diagnostic/alerts');\n }\n\n /** Config edits and admin actions inside the window. */\n async listChanges(body?: DiagnosticChangeListParams): Promise<DiagnosticList<DiagnosticChange>> {\n return this.request('POST', '/admin-portal/diagnostic/changes', { body: body ?? {} });\n }\n\n /**\n * What a pasted id is, and whether we hold it.\n *\n * `kind` and `found` are separate answers on purpose. A well-shaped id that\n * matches nothing comes back `found: false` with the three `reasons` and\n * their fixes — render that, never an empty table, which reads as \"no such\n * payment\" when the real answer is \"outside the window\" or \"it is a test\n * payment\".\n */\n async resolveId(id: string): Promise<DiagnosticResolvedId> {\n return this.request('GET', `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);\n }\n\n /**\n * One id across every source, as an ordered span list.\n *\n * Accepts a payment, attempt, event or request id. Sources that could not be\n * read are named in `unavailable_sources` rather than left out: a waterfall\n * with an unexplained gap reads as a period when nothing happened.\n */\n async trace(id: string): Promise<DiagnosticTrace> {\n return this.request('GET', `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);\n }\n\n /**\n * Unmask one field of one object.\n *\n * **Writes an audit row** naming the operator, the field and the object,\n * before the value is returned — a reveal that could not be audited does not\n * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key\n * cannot call it, because an API key names no person.\n *\n * `reason` is required and is stored verbatim.\n */\n async reveal(body: DiagnosticRevealRequest): Promise<DiagnosticRevealResponse> {\n return this.request('POST', '/admin-portal/diagnostic/reveal', { body });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-PKAE6AQT.cjs","../src/internal/resources/diagnostic.ts"],"names":[],"mappings":"AAAA;AC6DO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,SAAA,CAAU,IAAA,EAAqE;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,oCAAA,EAAsC,EAAE,IAAA,mBAAM,IAAA,UAAQ,CAAC,IAAE,CAAC,CAAA;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,oBAAA,CACJ,IAAA,EACoD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4CAAA,EAA8C;AAAA,MACxE,IAAA,mBAAM,IAAA,UAAQ,CAAC;AAAA,IACjB,CAAC,CAAA;AAAA,EACH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;AAUE,IAAA;AAA4D,EAAA;AAC9D;AAAA,EAAA;AAIE,IAAA;AAAoF,EAAA;AACtF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAuF,EAAA;AACzF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAqF,EAAA;AACvF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAaE,IAAA;AAAuE,EAAA;AAE3E;ADxFA;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-PKAE6AQT.cjs","sourcesContent":[null,"import type {\n DiagnosticAttentionBoard,\n DiagnosticAttentionParams,\n DiagnosticChange,\n DiagnosticChangeListParams,\n DiagnosticConnectorCall,\n DiagnosticConnectorCallListParams,\n DiagnosticErrorCodeCount,\n DiagnosticFiringAlert,\n DiagnosticIncomingWebhook,\n DiagnosticIncomingWebhookDetail,\n DiagnosticIncomingWebhookListParams,\n DiagnosticInfrastructure,\n DiagnosticList,\n DiagnosticOutgoingWebhook,\n DiagnosticOutgoingWebhookListParams,\n DiagnosticOutgoingWebhookSummary,\n DiagnosticPanel,\n DiagnosticPayment,\n DiagnosticPaymentListParams,\n DiagnosticQueueItem,\n DiagnosticQueueListParams,\n DiagnosticQueueSummary,\n DiagnosticResolvedId,\n DiagnosticRevealRequest,\n DiagnosticRevealResponse,\n DiagnosticRouterLog,\n DiagnosticRouterLogParams,\n DiagnosticTrace,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * The diagnostic console — everything the router did, without a\n * shell.\n *\n * Cross-merchant by construction: one call answers across every merchant on the\n * deployment. The backend gates that on the `Diagnostic` permission, which is\n * granted to DeloPay's internal staff roles alone, which is why this lives in\n * `@delopay/sdk/internal` and never on the merchant-facing client.\n *\n * ## Two shapes worth knowing before you call anything\n *\n * **Lists answer {@link DiagnosticList}**, which carries `hidden_by_environment`\n * beside the rows. That number is what lets a UI say \"612 test-mode rows are\n * hidden\" rather than leaving an operator unable to tell an empty tab from a\n * filtered one.\n *\n * **Two reads answer {@link DiagnosticPanel} instead** — {@link routerLogs} and\n * {@link alerts} — because their sources can be down independently of the\n * router. A panel is `available` with data or `unavailable` with a reason, and\n * that distinction is the whole point: **an unreachable log store must never be\n * rendered as \"no errors found\"**, and a `T[]` gives a caller no way to tell the\n * two apart.\n *\n * ## The environment filter\n *\n * Every list takes `environment`. Omitting it is read by the backend as\n * `'live'`, never as `'all'` — a caller that forgot to say gets the safer of the\n * two, and a test payment never appears in a view that reads as live.\n */\nexport class Diagnostic {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The ranked attention board — the page's landing state, with nothing typed.\n *\n * Always carries `checks_run` and `vitals`, so an empty `items` reads as\n * \"checked these things at 14:02, all clear\" rather than as a panel that\n * failed to load. A check that could not run is **absent** from `checks_run`\n * rather than silently counted as clear.\n */\n async attention(body?: DiagnosticAttentionParams): Promise<DiagnosticAttentionBoard> {\n return this.request('POST', '/admin-portal/diagnostic/attention', { body: body ?? {} });\n }\n\n /**\n * Provider webhooks received, across every merchant.\n *\n * `source_verified: false` selects rows that failed verification **or** never\n * reached it — the deliveries that failed before verification was attempted\n * are exactly the ones an operator opens this tab for.\n */\n async listIncomingWebhooks(\n body?: DiagnosticIncomingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticIncomingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/incoming', {\n body: body ?? {},\n });\n }\n\n /**\n * One delivery in full: masked headers and body, the verification verdict,\n * and the router log lines for its request id.\n *\n * `router_logs` is `null` — not `[]` — when the log store is unreachable, and\n * `router_logs_unavailable` then says why. Render the first as *unavailable*,\n * never as \"the router logged nothing\".\n */\n async getIncomingWebhook(eventId: string): Promise<DiagnosticIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */\n async listOutgoingWebhooks(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticOutgoingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing', {\n body: body ?? {},\n });\n }\n\n /**\n * The four tiles above the shop-webhooks table.\n *\n * Counted under the same window and environment as the table but **without**\n * its delivery filter — the tiles say what the window holds, and applying the\n * filter would make every tile agree with whichever one is selected.\n */\n async outgoingWebhookSummary(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticOutgoingWebhookSummary> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing/summary', {\n body: body ?? {},\n });\n }\n\n /**\n * Connector calls the router made.\n *\n * List rows carry no payload. Fetch one with {@link getConnectorCall} for the\n * masked request and response.\n */\n async listConnectorCalls(\n body?: DiagnosticConnectorCallListParams,\n ): Promise<DiagnosticList<DiagnosticConnectorCall>> {\n return this.request('POST', '/admin-portal/diagnostic/connector-calls', { body: body ?? {} });\n }\n\n /** One connector call, with its masked payloads. */\n async getConnectorCall(id: string): Promise<DiagnosticConnectorCall> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`,\n );\n }\n\n /**\n * Router logs, proxied from the deployment's log store.\n *\n * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:\n * `'unavailable'` means the store did not answer, which is the opposite of\n * \"there were no errors\" and must be rendered as such.\n */\n async routerLogs(\n body?: DiagnosticRouterLogParams,\n ): Promise<DiagnosticPanel<DiagnosticList<DiagnosticRouterLog>>> {\n return this.request('POST', '/admin-portal/diagnostic/logs', { body: body ?? {} });\n }\n\n /**\n * Payments that are stuck or failed.\n *\n * Stuck means non-terminal for longer than `stuck_minutes`; failed means it\n * ended without succeeding inside the window. Omitting `stuck_minutes` turns\n * the first arm off rather than widening it.\n */\n async listPayments(\n body?: DiagnosticPaymentListParams,\n ): Promise<DiagnosticList<DiagnosticPayment>> {\n return this.request('POST', '/admin-portal/diagnostic/payments', { body: body ?? {} });\n }\n\n /**\n * The error codes in this window, each with its count in the previous window\n * of equal length.\n *\n * `previous_count: null` means the code did not appear before — render it as\n * \"new\" rather than as a fall to zero.\n */\n async paymentErrorCodes(body?: DiagnosticPaymentListParams): Promise<DiagnosticErrorCodeCount[]> {\n return this.request('POST', '/admin-portal/diagnostic/payments/error-codes', {\n body: body ?? {},\n });\n }\n\n /**\n * Everything about one payment, in one call: the payment, its attempts, its\n * status history, its client context, and what it produced — connector calls,\n * webhooks both ways, and scheduler jobs.\n *\n * Read `diagnostic_capture` before rendering an empty section. A payment with\n * no connector calls and a deployment that never recorded any are different\n * facts, and the second must not read as the first.\n *\n * Typed loosely on purpose: the payment, attempts, status-history and\n * client-context halves are the merchant-facing shapes this package already\n * exports, and re-declaring them here would give consumers two names for one\n * thing that could then drift apart.\n */\n async getPayment(paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Scheduler tasks, most overdue first. */\n async listQueues(body?: DiagnosticQueueListParams): Promise<DiagnosticList<DiagnosticQueueItem>> {\n return this.request('POST', '/admin-portal/diagnostic/queues', { body: body ?? {} });\n }\n\n /**\n * The four tiles above the queues table, plus the approvals count.\n *\n * `pending_approvals` is a **different** queue from `pending_count`: a stalled\n * scheduler needs a consumer, a full approvals queue needs a person, and\n * folding them into one number would point an operator at the wrong fix.\n */\n async queueSummary(): Promise<DiagnosticQueueSummary> {\n return this.request('GET', '/admin-portal/diagnostic/queues/summary');\n }\n\n /**\n * Replicas and their dependencies.\n *\n * `build_mismatch` is computed server-side rather than left for a caller to\n * notice by comparing strings: one replica in four answering differently\n * explains a whole class of \"it only fails sometimes\" incident, and is\n * invisible unless something says it out loud.\n */\n async infrastructure(): Promise<DiagnosticInfrastructure> {\n return this.request('GET', '/admin-portal/diagnostic/infrastructure');\n }\n\n /**\n * Firing alerts, proxied from Alertmanager.\n *\n * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}\n * does: a strip that renders empty because Alertmanager is down says \"nothing\n * is firing\", which is the most dangerous sentence this page could print.\n */\n async alerts(): Promise<DiagnosticPanel<DiagnosticFiringAlert[]>> {\n return this.request('GET', '/admin-portal/diagnostic/alerts');\n }\n\n /** Config edits and admin actions inside the window. */\n async listChanges(body?: DiagnosticChangeListParams): Promise<DiagnosticList<DiagnosticChange>> {\n return this.request('POST', '/admin-portal/diagnostic/changes', { body: body ?? {} });\n }\n\n /**\n * What a pasted id is, and whether we hold it.\n *\n * `kind` and `found` are separate answers on purpose. A well-shaped id that\n * matches nothing comes back `found: false` with the three `reasons` and\n * their fixes — render that, never an empty table, which reads as \"no such\n * payment\" when the real answer is \"outside the window\" or \"it is a test\n * payment\".\n */\n async resolveId(id: string): Promise<DiagnosticResolvedId> {\n return this.request('GET', `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);\n }\n\n /**\n * One id across every source, as an ordered span list.\n *\n * Accepts a payment, attempt, event or request id. Sources that could not be\n * read are named in `unavailable_sources` rather than left out: a waterfall\n * with an unexplained gap reads as a period when nothing happened.\n */\n async trace(id: string): Promise<DiagnosticTrace> {\n return this.request('GET', `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);\n }\n\n /**\n * Unmask one field of one object.\n *\n * **Writes an audit row** naming the operator, the field and the object,\n * before the value is returned — a reveal that could not be audited does not\n * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key\n * cannot call it, because an API key names no person.\n *\n * `reason` is required and is stored verbatim.\n */\n async reveal(body: DiagnosticRevealRequest): Promise<DiagnosticRevealResponse> {\n return this.request('POST', '/admin-portal/diagnostic/reveal', { body });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-Q7M7DO7M.cjs","../src/paymentPresentation.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACi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AAA;AACG,uBAAA;AACF,uBAAA;AACV,uBAAA;AACR,IAAA;AACH,EAAA;AAEgF,EAAA;AAC7B,IAAA;AAC5C,MAAA;AACe,MAAA;AACpB,IAAA;AACY,IAAA;AACS,MAAA;AACrB,IAAA;AACY,IAAA;AACM,IAAA;AACG,IAAA;AACH,IAAA;AACG,MAAA;AACrB,IAAA;AACI,IAAA;AACe,MAAA;AACf,QAAA;AACkB,QAAA;AACpB,MAAA;AACgB,MAAA;AACG,MAAA;AACL,IAAA;AACF,MAAA;AACM,QAAA;AACP,QAAA;AACX,MAAA;AACe,MAAA;AACK,MAAA;AAIR,MAAA;AACD,QAAA;AACX,MAAA;AAGY,MAAA;AACN,MAAA;AACR,IAAA;AACF,EAAA;AAAA;AAGc,EAAA;AACK,IAAA;AACnB,EAAA;AAEwE,EAAA;AACnD,IAAA;AACC,MAAA;AAClB,MAAA;AACF,IAAA;AACqB,IAAA;AACC,IAAA;AACJ,IAAA;AACI,MAAA;AACL,MAAA;AACG,MAAA;AACpB,IAAA;AACF,EAAA;AACF;AAO4C;AAEvB,EAAA;AAKrB;AAEuB;AACE,EAAA;AACC,EAAA;AAC1B;ADrJ0B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-Q7M7DO7M.cjs","sourcesContent":[null,"/**\n * Helpers for rendering a shop's payment buttons on the merchant's own site\n * from `GET /account/payment-methods/presentation`: DeloPay's\n * built-in glyphs, icon resolution with a fallback, grouping by tier, and a\n * cache for the merchant's server that honours the response's own policy.\n *\n * Nothing here decides which methods a payment can be confirmed with. The\n * payment is confirmed against the shop's current configuration, whatever a\n * cached or displayed list says.\n */\nimport { DelopayError } from './error';\nimport type {\n PaymentMethodPresentationEntry,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n PresentationChild,\n PresentationIcon,\n} from './types';\nimport type { RequestExtras } from './client';\n\n/** The response contract these helpers read. */\nexport const PRESENTATION_CONTRACT_VERSION = 1;\n\n/** The built-in glyph keys a presentation names in `icon.key` and `fallback_icon`. */\nexport const BUILTIN_PAYMENT_ICON_KEYS = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n 'paypal',\n 'klarna',\n 'crypto',\n] as const;\n\nexport type BuiltinPaymentIconKey = (typeof BUILTIN_PAYMENT_ICON_KEYS)[number];\n\nconst SVG_OPEN = '<svg xmlns=\"http://www.w3.org/2000/svg\"';\n\n/**\n * The glyphs DeloPay's hosted checkout draws, as standalone SVG documents.\n * Line glyphs and Apple's mark take `color`; the other brand marks keep their\n * brand colours.\n */\nfunction glyph(key: BuiltinPaymentIconKey, color: string): string {\n const line = (body: string) =>\n `${SVG_OPEN} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"${color}\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${body}</svg>`;\n switch (key) {\n case 'card':\n return line('<rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\"/><path d=\"M2 10h20\"/>');\n case 'bank':\n return line(\n '<path d=\"M3 10h18\"/><path d=\"m12 3 9 5H3l9-5Z\"/><path d=\"M6 10v7M10 10v7M14 10v7M18 10v7\"/><path d=\"M3 20h18\"/>',\n );\n case 'bnpl':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><path d=\"M6 12h4\"/><path d=\"M14 10v4\"/><path d=\"M18 10v4\"/>',\n );\n case 'cash':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M6 12h.01M18 12h.01\"/>',\n );\n case 'apple':\n return `${SVG_OPEN} viewBox=\"0 0 384 512\" fill=\"${color}\"><path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\"/></svg>`;\n case 'google':\n return `${SVG_OPEN} viewBox=\"0 0 48 48\"><path fill=\"#4285F4\" d=\"M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z\"/><path fill=\"#34A853\" d=\"M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z\"/><path fill=\"#FBBC05\" d=\"M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24s.85 6.91 2.34 9.88l7.35-5.7z\"/><path fill=\"#EA4335\" d=\"M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z\"/></svg>`;\n case 'paypal':\n return `${SVG_OPEN} viewBox=\"0 0 32 32\"><path d=\"M9 4h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L10.4 23H6.7L9 4z\" fill=\"#003087\"/><path d=\"M13 8.5h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L14.4 27.5H10.7L13 8.5z\" fill=\"#009cde\"/></svg>`;\n case 'klarna':\n return `${SVG_OPEN} viewBox=\"0 0 24 24\"><rect width=\"24\" height=\"24\" rx=\"6\" fill=\"#FFA8CD\"/><path fill=\"#0B051D\" d=\"M8 6h2.7v12H8V6zm6.5 0h2.5c-.4 2.7-1.5 5-3 6.6 1.6 1.6 2.7 3.6 3.2 5.4h-2.7c-.5-1.6-1.4-3-2.7-4.2v4.2H10V12c2.1-1 3.8-3.2 4.5-6z\"/></svg>`;\n case 'crypto':\n return `${SVG_OPEN} viewBox=\"0 0 64 64\"><path fill=\"#F7931A\" d=\"m63.033,39.744c-4.274,17.143-21.637,27.576-38.782,23.301-17.138-4.274-27.571-21.638-23.295-38.78,4.272-17.145,21.635-27.579,38.775-23.305,17.144,4.274,27.576,21.64,23.302,38.784z\"/><path fill=\"#FFF\" d=\"m46.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z\"/></svg>`;\n case 'wallet':\n return line(\n '<path d=\"M3 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2\"/><rect x=\"3\" y=\"7\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M16 13h3\"/>',\n );\n }\n}\n\nfunction isBuiltinKey(key: string): key is BuiltinPaymentIconKey {\n return (BUILTIN_PAYMENT_ICON_KEYS as readonly string[]).includes(key);\n}\n\n/**\n * The SVG document of a built-in glyph. An unknown key — one a newer API\n * added — draws the neutral `wallet` glyph rather than nothing.\n *\n * @param color - What line glyphs and Apple's mark are drawn in. Defaults to\n * a dark grey that reads on a light button.\n */\nexport function builtinPaymentIconSvg(key: string, color = '#1f2937'): string {\n return glyph(isBuiltinKey(key) ? key : 'wallet', color);\n}\n\n/** {@link builtinPaymentIconSvg} as a `data:` URI for an image element's `src`. */\nexport function builtinPaymentIconDataUri(key: string, color?: string): string {\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(builtinPaymentIconSvg(key, color))}`;\n}\n\n/**\n * The image `src` for an icon: an SVG icon's own `data_uri`, a built-in\n * glyph's document otherwise. Use it with an image element, which renders the\n * artwork without running anything in it.\n */\nexport function presentationIconDataUri(icon: PresentationIcon, color?: string): string {\n return icon.type === 'svg' ? icon.data_uri : builtinPaymentIconDataUri(icon.key, color);\n}\n\n/**\n * The image `src` to draw for an entry: its icon, else its fallback glyph.\n * `null` only for a heading, which has no artwork. Pair it with an `onerror`\n * that swaps to `builtinPaymentIconDataUri(entry.fallback_icon)` if you load\n * artwork from anywhere that can fail.\n */\nexport function presentationIconSrc(\n entry: PaymentMethodPresentationEntry,\n color?: string,\n): string | null {\n if (entry.icon) return presentationIconDataUri(entry.icon, color);\n if (entry.fallback_icon) return builtinPaymentIconDataUri(entry.fallback_icon, color);\n return null;\n}\n\n/**\n * Whether DeloPay confirmed a badge: from the provider's answer for the\n * account, or the account's own settings. A `merchant` badge is the shop's\n * own statement for a provider DeloPay cannot ask; draw it, if at all, so a\n * buyer can tell it apart.\n */\nexport function isConfirmedChild(child: Pick<PresentationChild, 'source'>): boolean {\n return child.source !== 'merchant';\n}\n\n/** Whether these helpers understand a response. A different `contract_version` is not read. */\nexport function isSupportedPresentation(\n response: Pick<PaymentMethodPresentationResponse, 'contract_version'>,\n): boolean {\n return response.contract_version === PRESENTATION_CONTRACT_VERSION;\n}\n\n/** A presentation's entries by tier, express rows kept apart, in checkout order. */\nexport interface PresentationTiers {\n express: PaymentMethodPresentationEntry[][];\n normal: PaymentMethodPresentationEntry[];\n alternative: PaymentMethodPresentationEntry[];\n}\n\n/** Group a presentation's entries the way the hosted checkout lays them out. */\nexport function presentationTiers(response: PaymentMethodPresentationResponse): PresentationTiers {\n const out: PresentationTiers = { express: [], normal: [], alternative: [] };\n for (const entry of response.entries) {\n if (entry.tier === 'express') {\n const row = entry.row ?? 0;\n while (out.express.length <= row) out.express.push([]);\n out.express[row]?.push(entry);\n } else {\n out[entry.tier].push(entry);\n }\n }\n out.express = out.express.filter((row) => row.length > 0);\n return out;\n}\n\n/** The entries a buyer can select, in order: everything but headings. */\nexport function selectableEntries(\n response: PaymentMethodPresentationResponse,\n): PaymentMethodPresentationEntry[] {\n return response.entries.filter((entry) => entry.action !== undefined);\n}\n\n/** What {@link PresentationCache.get} answers. */\nexport interface CachedPresentation {\n response: PaymentMethodPresentationResponse;\n /**\n * `true` when DeloPay could not be reached and this is the last answer,\n * still inside its `stale_if_error_seconds`. Display only.\n */\n stale: boolean;\n}\n\n/** How {@link PresentationCache} asks DeloPay. */\nexport type PresentationLoader = (\n params: PaymentMethodPresentationParams,\n options: RequestExtras,\n) => Promise<PaymentMethodPresentationResponse>;\n\nexport interface PresentationCacheOptions {\n /** Usually `(params, options) => delopay.paymentMethods.presentation(params, options)`. */\n load: PresentationLoader;\n /** Milliseconds since the epoch. Defaults to `Date.now`. */\n now?: () => number;\n /** At most this many contexts are kept; the least recently fetched goes first. Default 500. */\n maxEntries?: number;\n}\n\ninterface CacheSlot {\n response: PaymentMethodPresentationResponse;\n fetchedAt: number;\n}\n\n/**\n * A cache for the merchant's server in front of\n * `GET /account/payment-methods/presentation`, keyed by everything that\n * changes the answer: shop, environment, locale, country, currency and amount.\n *\n * - Reuses an answer for its `cache.max_age_seconds`, then revalidates with\n * `If-None-Match`; an unchanged revision costs no body.\n * - While DeloPay cannot be reached it keeps serving the last answer for\n * `cache.stale_if_error_seconds` more, marked `stale`, then rethrows.\n * - Never caches a payment's answer (`client_secret`): those are asked every\n * time, since a cart change needs a new answer.\n *\n * One instance per secret key: an answer is the authenticated merchant's and\n * must not be shared with another merchant's requests.\n */\nexport class PresentationCache {\n private readonly slots = new Map<string, CacheSlot>();\n private readonly load: PresentationLoader;\n private readonly now: () => number;\n private readonly maxEntries: number;\n\n constructor(options: PresentationCacheOptions) {\n this.load = options.load;\n this.now = options.now ?? Date.now;\n this.maxEntries = options.maxEntries ?? 500;\n }\n\n /** The key two requests share exactly when DeloPay would answer them alike. */\n static keyOf(params: PaymentMethodPresentationParams): string {\n return JSON.stringify([\n params.profile_id ?? null,\n params.environment ?? 'live',\n params.locale?.toLowerCase() ?? null,\n params.country?.toUpperCase() ?? null,\n params.currency ?? null,\n params.amount ?? null,\n params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n ]);\n }\n\n async get(params: PaymentMethodPresentationParams): Promise<CachedPresentation> {\n const request: PaymentMethodPresentationParams = {\n ...params,\n contract_version: params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n };\n if (request.client_secret) {\n return { response: await this.load(request, {}), stale: false };\n }\n const key = PresentationCache.keyOf(request);\n const slot = this.slots.get(key);\n const now = this.now();\n if (slot && now - slot.fetchedAt < slot.response.cache.max_age_seconds * 1000) {\n return { response: slot.response, stale: false };\n }\n try {\n const response = await this.load(\n request,\n slot ? { headers: { 'If-None-Match': `\"${slot.response.revision}\"` } } : {},\n );\n this.store(key, response, now);\n return { response, stale: false };\n } catch (error) {\n if (slot && error instanceof DelopayError && error.status === 304) {\n this.store(key, slot.response, now);\n return { response: slot.response, stale: false };\n }\n const policy = slot?.response.cache;\n const usableUntil = slot\n ? slot.fetchedAt +\n ((policy?.max_age_seconds ?? 0) + (policy?.stale_if_error_seconds ?? 0)) * 1000\n : 0;\n if (slot && isUnavailable(error) && now < usableUntil) {\n return { response: slot.response, stale: true };\n }\n // A definitive refusal (a shop that is gone, a revoked key) retires the\n // answer: a later outage must not bring it back as a stale copy.\n if (slot && isRefusal(error)) this.slots.delete(key);\n throw error;\n }\n }\n\n /** Forget every answer, e.g. after the merchant changes the checkout editor. */\n clear(): void {\n this.slots.clear();\n }\n\n private store(key: string, response: PaymentMethodPresentationResponse, now: number): void {\n if (response.cache.max_age_seconds <= 0) {\n this.slots.delete(key);\n return;\n }\n this.slots.delete(key);\n this.slots.set(key, { response, fetchedAt: now });\n while (this.slots.size > this.maxEntries) {\n const oldest = this.slots.keys().next().value;\n if (oldest === undefined) break;\n this.slots.delete(oldest);\n }\n }\n}\n\n/**\n * DeloPay could not answer: the network, a timeout, a rate limit or a server\n * error. A 4xx (a refused key, a shop that is not there) is an answer, and is\n * never papered over with an older one.\n */\nfunction isRefusal(error: unknown): boolean {\n return (\n error instanceof DelopayError &&\n error.status >= 400 &&\n error.status < 500 &&\n error.status !== 429\n );\n}\n\nfunction isUnavailable(error: unknown): boolean {\n if (!(error instanceof DelopayError)) return false;\n return error.status === 0 || error.status === 429 || error.status >= 500;\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-Q7M7DO7M.cjs","../src/paymentPresentation.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBO,IAAM,8BAAA,EAAgC,CAAA;AAGtC,IAAM,0BAAA,EAA4B;AAAA,EACvC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EAC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AACG,MAAA;AACrB,IAAA;AACI,IAAA;AACe,MAAA;AACf,QAAA;AACkB,QAAA;AACpB,MAAA;AACgB,MAAA;AACG,MAAA;AACL,IAAA;AACF,MAAA;AACM,QAAA;AACP,QAAA;AACX,MAAA;AACe,MAAA;AACK,MAAA;AAIR,MAAA;AACD,QAAA;AACX,MAAA;AAGY,MAAA;AACN,MAAA;AACR,IAAA;AACF,EAAA;AAAA;AAGc,EAAA;AACK,IAAA;AACnB,EAAA;AAEwE,EAAA;AACnD,IAAA;AACC,MAAA;AAClB,MAAA;AACF,IAAA;AACqB,IAAA;AACC,IAAA;AACJ,IAAA;AACI,MAAA;AACL,MAAA;AACG,MAAA;AACpB,IAAA;AACF,EAAA;AACF;AAO4C;AAEvB,EAAA;AAKrB;AAEuB;AACE,EAAA;AACC,EAAA;AAC1B;ADrJ0B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-Q7M7DO7M.cjs","sourcesContent":[null,"/**\n * Helpers for rendering a shop's payment buttons on the merchant's own site\n * from `GET /account/payment-methods/presentation`: DeloPay's\n * built-in glyphs, icon resolution with a fallback, grouping by tier, and a\n * cache for the merchant's server that honours the response's own policy.\n *\n * Nothing here decides which methods a payment can be confirmed with. The\n * payment is confirmed against the shop's current configuration, whatever a\n * cached or displayed list says.\n */\nimport { DelopayError } from './error';\nimport type {\n PaymentMethodPresentationEntry,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n PresentationChild,\n PresentationIcon,\n} from './types';\nimport type { RequestExtras } from './client';\n\n/** The response contract these helpers read. */\nexport const PRESENTATION_CONTRACT_VERSION = 1;\n\n/** The built-in glyph keys a presentation names in `icon.key` and `fallback_icon`. */\nexport const BUILTIN_PAYMENT_ICON_KEYS = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n 'paypal',\n 'klarna',\n 'crypto',\n] as const;\n\nexport type BuiltinPaymentIconKey = (typeof BUILTIN_PAYMENT_ICON_KEYS)[number];\n\nconst SVG_OPEN = '<svg xmlns=\"http://www.w3.org/2000/svg\"';\n\n/**\n * The glyphs DeloPay's hosted checkout draws, as standalone SVG documents.\n * Line glyphs and Apple's mark take `color`; the other brand marks keep their\n * brand colours.\n */\nfunction glyph(key: BuiltinPaymentIconKey, color: string): string {\n const line = (body: string) =>\n `${SVG_OPEN} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"${color}\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${body}</svg>`;\n switch (key) {\n case 'card':\n return line('<rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\"/><path d=\"M2 10h20\"/>');\n case 'bank':\n return line(\n '<path d=\"M3 10h18\"/><path d=\"m12 3 9 5H3l9-5Z\"/><path d=\"M6 10v7M10 10v7M14 10v7M18 10v7\"/><path d=\"M3 20h18\"/>',\n );\n case 'bnpl':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><path d=\"M6 12h4\"/><path d=\"M14 10v4\"/><path d=\"M18 10v4\"/>',\n );\n case 'cash':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M6 12h.01M18 12h.01\"/>',\n );\n case 'apple':\n return `${SVG_OPEN} viewBox=\"0 0 384 512\" fill=\"${color}\"><path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\"/></svg>`;\n case 'google':\n return `${SVG_OPEN} viewBox=\"0 0 48 48\"><path fill=\"#4285F4\" d=\"M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z\"/><path fill=\"#34A853\" d=\"M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z\"/><path fill=\"#FBBC05\" d=\"M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24s.85 6.91 2.34 9.88l7.35-5.7z\"/><path fill=\"#EA4335\" d=\"M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z\"/></svg>`;\n case 'paypal':\n return `${SVG_OPEN} viewBox=\"0 0 32 32\"><path d=\"M9 4h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L10.4 23H6.7L9 4z\" fill=\"#003087\"/><path d=\"M13 8.5h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L14.4 27.5H10.7L13 8.5z\" fill=\"#009cde\"/></svg>`;\n case 'klarna':\n return `${SVG_OPEN} viewBox=\"0 0 24 24\"><rect width=\"24\" height=\"24\" rx=\"6\" fill=\"#FFA8CD\"/><path fill=\"#0B051D\" d=\"M8 6h2.7v12H8V6zm6.5 0h2.5c-.4 2.7-1.5 5-3 6.6 1.6 1.6 2.7 3.6 3.2 5.4h-2.7c-.5-1.6-1.4-3-2.7-4.2v4.2H10V12c2.1-1 3.8-3.2 4.5-6z\"/></svg>`;\n case 'crypto':\n return `${SVG_OPEN} viewBox=\"0 0 64 64\"><path fill=\"#F7931A\" d=\"m63.033,39.744c-4.274,17.143-21.637,27.576-38.782,23.301-17.138-4.274-27.571-21.638-23.295-38.78,4.272-17.145,21.635-27.579,38.775-23.305,17.144,4.274,27.576,21.64,23.302,38.784z\"/><path fill=\"#FFF\" d=\"m46.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z\"/></svg>`;\n case 'wallet':\n return line(\n '<path d=\"M3 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2\"/><rect x=\"3\" y=\"7\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M16 13h3\"/>',\n );\n }\n}\n\nfunction isBuiltinKey(key: string): key is BuiltinPaymentIconKey {\n return (BUILTIN_PAYMENT_ICON_KEYS as readonly string[]).includes(key);\n}\n\n/**\n * The SVG document of a built-in glyph. An unknown key — one a newer API\n * added — draws the neutral `wallet` glyph rather than nothing.\n *\n * @param color - What line glyphs and Apple's mark are drawn in. Defaults to\n * a dark grey that reads on a light button.\n */\nexport function builtinPaymentIconSvg(key: string, color = '#1f2937'): string {\n return glyph(isBuiltinKey(key) ? key : 'wallet', color);\n}\n\n/** {@link builtinPaymentIconSvg} as a `data:` URI for an image element's `src`. */\nexport function builtinPaymentIconDataUri(key: string, color?: string): string {\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(builtinPaymentIconSvg(key, color))}`;\n}\n\n/**\n * The image `src` for an icon: an SVG icon's own `data_uri`, a built-in\n * glyph's document otherwise. Use it with an image element, which renders the\n * artwork without running anything in it.\n */\nexport function presentationIconDataUri(icon: PresentationIcon, color?: string): string {\n return icon.type === 'svg' ? icon.data_uri : builtinPaymentIconDataUri(icon.key, color);\n}\n\n/**\n * The image `src` to draw for an entry: its icon, else its fallback glyph.\n * `null` only for a heading, which has no artwork. Pair it with an `onerror`\n * that swaps to `builtinPaymentIconDataUri(entry.fallback_icon)` if you load\n * artwork from anywhere that can fail.\n */\nexport function presentationIconSrc(\n entry: PaymentMethodPresentationEntry,\n color?: string,\n): string | null {\n if (entry.icon) return presentationIconDataUri(entry.icon, color);\n if (entry.fallback_icon) return builtinPaymentIconDataUri(entry.fallback_icon, color);\n return null;\n}\n\n/**\n * Whether DeloPay confirmed a badge: from the provider's answer for the\n * account, or the account's own settings. A `merchant` badge is the shop's\n * own statement for a provider DeloPay cannot ask; draw it, if at all, so a\n * buyer can tell it apart.\n */\nexport function isConfirmedChild(child: Pick<PresentationChild, 'source'>): boolean {\n return child.source !== 'merchant';\n}\n\n/** Whether these helpers understand a response. A different `contract_version` is not read. */\nexport function isSupportedPresentation(\n response: Pick<PaymentMethodPresentationResponse, 'contract_version'>,\n): boolean {\n return response.contract_version === PRESENTATION_CONTRACT_VERSION;\n}\n\n/** A presentation's entries by tier, express rows kept apart, in checkout order. */\nexport interface PresentationTiers {\n express: PaymentMethodPresentationEntry[][];\n normal: PaymentMethodPresentationEntry[];\n alternative: PaymentMethodPresentationEntry[];\n}\n\n/** Group a presentation's entries the way the hosted checkout lays them out. */\nexport function presentationTiers(response: PaymentMethodPresentationResponse): PresentationTiers {\n const out: PresentationTiers = { express: [], normal: [], alternative: [] };\n for (const entry of response.entries) {\n if (entry.tier === 'express') {\n const row = entry.row ?? 0;\n while (out.express.length <= row) out.express.push([]);\n out.express[row]?.push(entry);\n } else {\n out[entry.tier].push(entry);\n }\n }\n out.express = out.express.filter((row) => row.length > 0);\n return out;\n}\n\n/** The entries a buyer can select, in order: everything but headings. */\nexport function selectableEntries(\n response: PaymentMethodPresentationResponse,\n): PaymentMethodPresentationEntry[] {\n return response.entries.filter((entry) => entry.action !== undefined);\n}\n\n/** What {@link PresentationCache.get} answers. */\nexport interface CachedPresentation {\n response: PaymentMethodPresentationResponse;\n /**\n * `true` when DeloPay could not be reached and this is the last answer,\n * still inside its `stale_if_error_seconds`. Display only.\n */\n stale: boolean;\n}\n\n/** How {@link PresentationCache} asks DeloPay. */\nexport type PresentationLoader = (\n params: PaymentMethodPresentationParams,\n options: RequestExtras,\n) => Promise<PaymentMethodPresentationResponse>;\n\nexport interface PresentationCacheOptions {\n /** Usually `(params, options) => delopay.paymentMethods.presentation(params, options)`. */\n load: PresentationLoader;\n /** Milliseconds since the epoch. Defaults to `Date.now`. */\n now?: () => number;\n /** At most this many contexts are kept; the least recently fetched goes first. Default 500. */\n maxEntries?: number;\n}\n\ninterface CacheSlot {\n response: PaymentMethodPresentationResponse;\n fetchedAt: number;\n}\n\n/**\n * A cache for the merchant's server in front of\n * `GET /account/payment-methods/presentation`, keyed by everything that\n * changes the answer: shop, environment, locale, country, currency and amount.\n *\n * - Reuses an answer for its `cache.max_age_seconds`, then revalidates with\n * `If-None-Match`; an unchanged revision costs no body.\n * - While DeloPay cannot be reached it keeps serving the last answer for\n * `cache.stale_if_error_seconds` more, marked `stale`, then rethrows.\n * - Never caches a payment's answer (`client_secret`): those are asked every\n * time, since a cart change needs a new answer.\n *\n * One instance per secret key: an answer is the authenticated merchant's and\n * must not be shared with another merchant's requests.\n */\nexport class PresentationCache {\n private readonly slots = new Map<string, CacheSlot>();\n private readonly load: PresentationLoader;\n private readonly now: () => number;\n private readonly maxEntries: number;\n\n constructor(options: PresentationCacheOptions) {\n this.load = options.load;\n this.now = options.now ?? Date.now;\n this.maxEntries = options.maxEntries ?? 500;\n }\n\n /** The key two requests share exactly when DeloPay would answer them alike. */\n static keyOf(params: PaymentMethodPresentationParams): string {\n return JSON.stringify([\n params.profile_id ?? null,\n params.environment ?? 'live',\n params.locale?.toLowerCase() ?? null,\n params.country?.toUpperCase() ?? null,\n params.currency ?? null,\n params.amount ?? null,\n params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n ]);\n }\n\n async get(params: PaymentMethodPresentationParams): Promise<CachedPresentation> {\n const request: PaymentMethodPresentationParams = {\n ...params,\n contract_version: params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n };\n if (request.client_secret) {\n return { response: await this.load(request, {}), stale: false };\n }\n const key = PresentationCache.keyOf(request);\n const slot = this.slots.get(key);\n const now = this.now();\n if (slot && now - slot.fetchedAt < slot.response.cache.max_age_seconds * 1000) {\n return { response: slot.response, stale: false };\n }\n try {\n const response = await this.load(\n request,\n slot ? { headers: { 'If-None-Match': `\"${slot.response.revision}\"` } } : {},\n );\n this.store(key, response, now);\n return { response, stale: false };\n } catch (error) {\n if (slot && error instanceof DelopayError && error.status === 304) {\n this.store(key, slot.response, now);\n return { response: slot.response, stale: false };\n }\n const policy = slot?.response.cache;\n const usableUntil = slot\n ? slot.fetchedAt +\n ((policy?.max_age_seconds ?? 0) + (policy?.stale_if_error_seconds ?? 0)) * 1000\n : 0;\n if (slot && isUnavailable(error) && now < usableUntil) {\n return { response: slot.response, stale: true };\n }\n // A definitive refusal (a shop that is gone, a revoked key) retires the\n // answer: a later outage must not bring it back as a stale copy.\n if (slot && isRefusal(error)) this.slots.delete(key);\n throw error;\n }\n }\n\n /** Forget every answer, e.g. after the merchant changes the checkout editor. */\n clear(): void {\n this.slots.clear();\n }\n\n private store(key: string, response: PaymentMethodPresentationResponse, now: number): void {\n if (response.cache.max_age_seconds <= 0) {\n this.slots.delete(key);\n return;\n }\n this.slots.delete(key);\n this.slots.set(key, { response, fetchedAt: now });\n while (this.slots.size > this.maxEntries) {\n const oldest = this.slots.keys().next().value;\n if (oldest === undefined) break;\n this.slots.delete(oldest);\n }\n }\n}\n\n/**\n * DeloPay could not answer: the network, a timeout, a rate limit or a server\n * error. A 4xx (a refused key, a shop that is not there) is an answer, and is\n * never papered over with an older one.\n */\nfunction isRefusal(error: unknown): boolean {\n return (\n error instanceof DelopayError &&\n error.status >= 400 &&\n error.status < 500 &&\n error.status !== 429\n );\n}\n\nfunction isUnavailable(error: unknown): boolean {\n if (!(error instanceof DelopayError)) return false;\n return error.status === 0 || error.status === 429 || error.status >= 500;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-QKUWFMZP.cjs","../src/internal/resources/adminFeePlans.ts"],"names":[],"mappings":"AAAA;ACWA,IAAM,KAAA,EAAO,yBAAA;AACb,IAAM,aAAA,EAAe,CAAC,UAAA,EAAA,GACpB,CAAA,EAAA;AACoC;AASX;AACwB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGY,EAAA;AACjC,IAAA;AAC7B,EAAA;AAAA;AAGyE,EAAA;AACzC,IAAA;AAChC,EAAA;AAAA;AAGuC,EAAA;AACV,IAAA;AAC7B,EAAA;AAAA;AAKE,EAAA;AAG2B,IAAA;AAC7B,EAAA;AAAA;AAGuF,EAAA;AACtD,IAAA;AACD,IAAA;AACH,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAMkC,EAAA;AACR,IAAA;AACF,MAAA;AACtB,IAAA;AAEI,IAAA;AAE0B,IAAA;AAChC,EAAA;AAAA;AAKE,EAAA;AAG8B,IAAA;AACrB,MAAA;AACc,QAAA;AACD,QAAA;AACC,QAAA;AACrB,MAAA;AACD,IAAA;AACH,EAAA;AAAA;AAGwB,EAAA;AACE,IAAA;AACtB,MAAA;AAC2B,MAAA;AAC7B,IAAA;AACY,IAAA;AACd,EAAA;AAAA;AAG8E,EAAA;AAC7C,IAAA;AACjC,EAAA;AACF;ADnCoC;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-QKUWFMZP.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n FeePlanConnectorAccount,\n FeePlanOverview,\n FeePlanPreviewRequest,\n FeePlanPreviewResponse,\n FeePlanSaveRequest,\n FeePlanScope,\n FeePlanScopeView,\n} from '../types';\n\nconst BASE = '/admin-portal/fee-plans';\nconst merchantPath = (merchantId: string): string =>\n `${BASE}/merchants/${encodeURIComponent(merchantId)}`;\nconst shopPath = (merchantId: string, profileId: string): string =>\n `${merchantPath(merchantId)}/shops/${encodeURIComponent(profileId)}`;\n\n/**\n * Platform fee plans: the default plan every merchant pays, and exceptions for\n * one merchant or one shop. Every write names the scope's `revision` as read,\n * and one against an older revision is refused, so two editors never\n * overwrite each other.\n */\nexport class AdminFeePlans {\n constructor(private readonly request: RequestFn) {}\n\n /** The default plan and every exception, or one merchant's. `GET /admin-portal/fee-plans` */\n async overview(merchantId?: string): Promise<FeePlanOverview> {\n return this.request('GET', BASE, { query: { merchant_id: merchantId } });\n }\n\n /** A new version of the default plan. `PUT /admin-portal/fee-plans/default` */\n async saveDefault(params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n return this.request('PUT', `${BASE}/default`, { body: params });\n }\n\n /** A new version of a merchant exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}` */\n async saveMerchant(merchantId: string, params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n return this.request('PUT', merchantPath(merchantId), { body: params });\n }\n\n /** A new version of a shop exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}/shops/{profile_id}` */\n async saveShop(\n merchantId: string,\n profileId: string,\n params: FeePlanSaveRequest,\n ): Promise<FeePlanScopeView> {\n return this.request('PUT', shopPath(merchantId, profileId), { body: params });\n }\n\n /** Save the plan of any scope: the default, a merchant or a shop. */\n async save(scope: FeePlanScope, params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n if (!scope.merchant_id) return this.saveDefault(params);\n if (!scope.profile_id) return this.saveMerchant(scope.merchant_id, params);\n return this.saveShop(scope.merchant_id, scope.profile_id, params);\n }\n\n /**\n * Remove an exception with every scheduled version; the plan above it\n * applies. The default plan cannot be removed.\n */\n async remove(scope: FeePlanScope, expectedRevision: string): Promise<FeePlanScopeView> {\n if (!scope.merchant_id) {\n throw new TypeError('The default plan cannot be removed.');\n }\n const path = scope.profile_id\n ? shopPath(scope.merchant_id, scope.profile_id)\n : merchantPath(scope.merchant_id);\n return this.request('DELETE', path, { query: { expected_revision: expectedRevision } });\n }\n\n /** Cancel a version that has not started yet. `DELETE /admin-portal/fee-plans/versions/{version_id}` */\n async cancelVersion(\n versionId: string,\n scope: FeePlanScope,\n expectedRevision: string,\n ): Promise<FeePlanScopeView> {\n return this.request('DELETE', `${BASE}/versions/${encodeURIComponent(versionId)}`, {\n query: {\n merchant_id: scope.merchant_id,\n profile_id: scope.profile_id,\n expected_revision: expectedRevision,\n },\n });\n }\n\n /** A merchant's connector accounts, for an override that names one. `GET /admin-portal/fee-plans/merchants/{merchant_id}/connector-accounts` */\n async connectorAccounts(merchantId: string): Promise<FeePlanConnectorAccount[]> {\n const body = await this.request<{ accounts: FeePlanConnectorAccount[] }>(\n 'GET',\n `${merchantPath(merchantId)}/connector-accounts`,\n );\n return body.accounts;\n }\n\n /** What a sample payment would be charged under a plan, without saving it. `POST /admin-portal/fee-plans/preview` */\n async preview(params: FeePlanPreviewRequest): Promise<FeePlanPreviewResponse> {\n return this.request('POST', `${BASE}/preview`, { body: params });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-QKUWFMZP.cjs","../src/internal/resources/adminFeePlans.ts"],"names":[],"mappings":"AAAA;ACWA,IAAM,KAAA,EAAO,yBAAA;AACb,IAAM,aAAA,EAAe,CAAC,UAAA,EAAA,GACpB,CAAA,EAAA;AACoC;AASX;AACwB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGY,EAAA;AACjC,IAAA;AAC7B,EAAA;AAAA;AAGyE,EAAA;AACzC,IAAA;AAChC,EAAA;AAAA;AAGuC,EAAA;AACV,IAAA;AAC7B,EAAA;AAAA;AAKE,EAAA;AAG2B,IAAA;AAC7B,EAAA;AAAA;AAGuF,EAAA;AACtD,IAAA;AACD,IAAA;AACH,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAMkC,EAAA;AACR,IAAA;AACF,MAAA;AACtB,IAAA;AAEI,IAAA;AAE0B,IAAA;AAChC,EAAA;AAAA;AAKE,EAAA;AAG8B,IAAA;AACrB,MAAA;AACc,QAAA;AACD,QAAA;AACC,QAAA;AACrB,MAAA;AACD,IAAA;AACH,EAAA;AAAA;AAGwB,EAAA;AACE,IAAA;AACtB,MAAA;AAC2B,MAAA;AAC7B,IAAA;AACY,IAAA;AACd,EAAA;AAAA;AAG8E,EAAA;AAC7C,IAAA;AACjC,EAAA;AACF;ADnCoC;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-QKUWFMZP.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n FeePlanConnectorAccount,\n FeePlanOverview,\n FeePlanPreviewRequest,\n FeePlanPreviewResponse,\n FeePlanSaveRequest,\n FeePlanScope,\n FeePlanScopeView,\n} from '../types';\n\nconst BASE = '/admin-portal/fee-plans';\nconst merchantPath = (merchantId: string): string =>\n `${BASE}/merchants/${encodeURIComponent(merchantId)}`;\nconst shopPath = (merchantId: string, profileId: string): string =>\n `${merchantPath(merchantId)}/shops/${encodeURIComponent(profileId)}`;\n\n/**\n * Platform fee plans: the default plan every merchant pays, and exceptions for\n * one merchant or one shop. Every write names the scope's `revision` as read,\n * and one against an older revision is refused, so two editors never\n * overwrite each other.\n */\nexport class AdminFeePlans {\n constructor(private readonly request: RequestFn) {}\n\n /** The default plan and every exception, or one merchant's. `GET /admin-portal/fee-plans` */\n async overview(merchantId?: string): Promise<FeePlanOverview> {\n return this.request('GET', BASE, { query: { merchant_id: merchantId } });\n }\n\n /** A new version of the default plan. `PUT /admin-portal/fee-plans/default` */\n async saveDefault(params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n return this.request('PUT', `${BASE}/default`, { body: params });\n }\n\n /** A new version of a merchant exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}` */\n async saveMerchant(merchantId: string, params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n return this.request('PUT', merchantPath(merchantId), { body: params });\n }\n\n /** A new version of a shop exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}/shops/{profile_id}` */\n async saveShop(\n merchantId: string,\n profileId: string,\n params: FeePlanSaveRequest,\n ): Promise<FeePlanScopeView> {\n return this.request('PUT', shopPath(merchantId, profileId), { body: params });\n }\n\n /** Save the plan of any scope: the default, a merchant or a shop. */\n async save(scope: FeePlanScope, params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n if (!scope.merchant_id) return this.saveDefault(params);\n if (!scope.profile_id) return this.saveMerchant(scope.merchant_id, params);\n return this.saveShop(scope.merchant_id, scope.profile_id, params);\n }\n\n /**\n * Remove an exception with every scheduled version; the plan above it\n * applies. The default plan cannot be removed.\n */\n async remove(scope: FeePlanScope, expectedRevision: string): Promise<FeePlanScopeView> {\n if (!scope.merchant_id) {\n throw new TypeError('The default plan cannot be removed.');\n }\n const path = scope.profile_id\n ? shopPath(scope.merchant_id, scope.profile_id)\n : merchantPath(scope.merchant_id);\n return this.request('DELETE', path, { query: { expected_revision: expectedRevision } });\n }\n\n /** Cancel a version that has not started yet. `DELETE /admin-portal/fee-plans/versions/{version_id}` */\n async cancelVersion(\n versionId: string,\n scope: FeePlanScope,\n expectedRevision: string,\n ): Promise<FeePlanScopeView> {\n return this.request('DELETE', `${BASE}/versions/${encodeURIComponent(versionId)}`, {\n query: {\n merchant_id: scope.merchant_id,\n profile_id: scope.profile_id,\n expected_revision: expectedRevision,\n },\n });\n }\n\n /** A merchant's connector accounts, for an override that names one. `GET /admin-portal/fee-plans/merchants/{merchant_id}/connector-accounts` */\n async connectorAccounts(merchantId: string): Promise<FeePlanConnectorAccount[]> {\n const body = await this.request<{ accounts: FeePlanConnectorAccount[] }>(\n 'GET',\n `${merchantPath(merchantId)}/connector-accounts`,\n );\n return body.accounts;\n }\n\n /** What a sample payment would be charged under a plan, without saving it. `POST /admin-portal/fee-plans/preview` */\n async preview(params: FeePlanPreviewRequest): Promise<FeePlanPreviewResponse> {\n return this.request('POST', `${BASE}/preview`, { body: params });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-QRSA72B3.cjs","../src/resources/deploymentBranding.ts"],"names":[],"mappings":"AAAA;ACgBO,SAAS,iBAAA,CAAkB,KAAA,EAAsB,OAAA,EAAiC;AACvF,EAAA,MAAM,KAAA,EAAO,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AACD,EAAA;AAC3D;AAQsB;AAIlB,EAAA;AAFiB,IAAA;AACA,IAAA;AAChB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY8D,EAAA;AACT,IAAA;AACxD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASgE,EAAA;AACL,IAAA;AAC3D,EAAA;AACF;ADvB6D;AACA;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-QRSA72B3.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type { BrandingAsset, PublicBranding } from '../types';\n\n/**\n * The path of one branding image or font file, relative to the API base URL:\n * `/branding/assets/{asset}`, with `?v={version}` when a version is given.\n *\n * The router serves the file in force from this path: the address the\n * operator saved, else the router's own environment value (only `logo` and\n * `email_font` have one). It answers 404 only when neither applies. A page\n * whose content security policy allows only same-origin images and fonts can\n * load it through its same-origin API prefix.\n *\n * So a `null` field from `branding.retrieve()` does not mean this path 404s:\n * `logo` and `email_font` may still serve the router's default.\n */\nexport function brandingAssetPath(asset: BrandingAsset, version?: string | null): string {\n const path = `/branding/assets/${encodeURIComponent(asset)}`;\n return version ? `${path}?v=${encodeURIComponent(version)}` : path;\n}\n\n/**\n * The deployment's branding (name, logos, favicon, default checkout colours)\n * as the platform operator saved it. Public: no credential is needed.\n *\n * The operator edits it through `adminBranding` on `DelopayInternal`.\n */\nexport class Branding {\n constructor(\n private readonly request: RequestFn,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * The saved branding. A `null` field means \"keep your own default\".\n *\n * Branding is cosmetic, so treat any failure as \"nothing saved\": routers\n * from before this route answer 404, and a page must never wait long for\n * it. Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call\n * including its retries; a `timeout` alone applies to each attempt.\n *\n * `GET /branding`\n */\n async retrieve(options?: RequestExtras): Promise<PublicBranding> {\n return this.request('GET', '/branding', { ...options });\n }\n\n /**\n * The address of one branding image or font file on this client's base\n * URL, for an `<img src>` or a `@font-face` `src`. See\n * {@link brandingAssetPath}.\n *\n * `GET /branding/assets/{asset}`\n */\n assetUrl(asset: BrandingAsset, version?: string | null): string {\n return `${this.baseUrl}${brandingAssetPath(asset, version)}`;\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-QRSA72B3.cjs","../src/resources/deploymentBranding.ts"],"names":[],"mappings":"AAAA;ACgBO,SAAS,iBAAA,CAAkB,KAAA,EAAsB,OAAA,EAAiC;AACvF,EAAA,MAAM,KAAA,EAAO,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AACD,EAAA;AAC3D;AAQsB;AAIlB,EAAA;AAFiB,IAAA;AACA,IAAA;AAChB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY8D,EAAA;AACT,IAAA;AACxD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASgE,EAAA;AACL,IAAA;AAC3D,EAAA;AACF;ADvB6D;AACA;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-QRSA72B3.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type { BrandingAsset, PublicBranding } from '../types';\n\n/**\n * The path of one branding image or font file, relative to the API base URL:\n * `/branding/assets/{asset}`, with `?v={version}` when a version is given.\n *\n * The router serves the file in force from this path: the address the\n * operator saved, else the router's own environment value (only `logo` and\n * `email_font` have one). It answers 404 only when neither applies. A page\n * whose content security policy allows only same-origin images and fonts can\n * load it through its same-origin API prefix.\n *\n * So a `null` field from `branding.retrieve()` does not mean this path 404s:\n * `logo` and `email_font` may still serve the router's default.\n */\nexport function brandingAssetPath(asset: BrandingAsset, version?: string | null): string {\n const path = `/branding/assets/${encodeURIComponent(asset)}`;\n return version ? `${path}?v=${encodeURIComponent(version)}` : path;\n}\n\n/**\n * The deployment's branding (name, logos, favicon, default checkout colours)\n * as the platform operator saved it. Public: no credential is needed.\n *\n * The operator edits it through `adminBranding` on `DelopayInternal`.\n */\nexport class Branding {\n constructor(\n private readonly request: RequestFn,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * The saved branding. A `null` field means \"keep your own default\".\n *\n * Branding is cosmetic, so treat any failure as \"nothing saved\": routers\n * from before this route answer 404, and a page must never wait long for\n * it. Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call\n * including its retries; a `timeout` alone applies to each attempt.\n *\n * `GET /branding`\n */\n async retrieve(options?: RequestExtras): Promise<PublicBranding> {\n return this.request('GET', '/branding', { ...options });\n }\n\n /**\n * The address of one branding image or font file on this client's base\n * URL, for an `<img src>` or a `@font-face` `src`. See\n * {@link brandingAssetPath}.\n *\n * `GET /branding/assets/{asset}`\n */\n assetUrl(asset: BrandingAsset, version?: string | null): string {\n return `${this.baseUrl}${brandingAssetPath(asset, version)}`;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-QYNRNDIY.cjs","../src/resources/invoiceSettings.ts"],"names":[],"mappings":"AAAA;ACkCO,IAAM,wBAAA,EAAN,MAA8B;AAAA,EACnC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,OAAA,EAAmD;AAChE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,mBAAA,EAAqB,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAA,CAAO,QAAA,EAA2B,OAAA,EAAmD;AACzF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,mBAAA,EAAqB,EAAE,IAAA,EAAM,QAAA,EAAU,GAAG,QAAQ,CAAC,CAAA;AAAA,EAChF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,eAAA,CAAgB,SAAA,EAAmB,OAAA,EAAmD;AAC1F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,2BAAA,EAA8B,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AACjF,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAU4B,EAAA;AAC4D,IAAA;AAC9E,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;A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AAA;AACiC,IAAA;AAC5D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AACF;AD9E2F;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-QYNRNDIY.cjs","sourcesContent":[null,"import type {\n EffectiveInvoiceSettings,\n InvoiceLogoRequest,\n InvoicePreviewRequest,\n InvoiceSettings,\n InvoiceTaxRuleEvaluateRequest,\n InvoiceTaxRuleEvaluation,\n InvoiceTaxRules,\n InvoiceTaxRulesRequest,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * How the merchant's invoices look and are taxed: the merchant default, and\n * each shop's override of it.\n *\n * Every setting resolves shop → merchant default → built-in fallback, and\n * `retrieveEffective` shows the result for one shop with where each value came\n * from. The same two levels hold the tax rules: a shop either inherits the\n * merchant's list or has one of its own that replaces it.\n *\n * **The merchant-level methods need a merchant-level grant** (no shop role\n * holds one), so a shop user may style its own shop and give it tax rules of\n * its own but never change what every shop inherits. The `…ForShop` methods\n * need the `Invoice` area's grant on that shop.\n *\n * Exported as `InvoiceSettingsResource` so the class never shadows the\n * `InvoiceSettings` data type of the same package.\n *\n * An update **replaces every field but the logo**: read, change, and send the\n * whole object back. A field left out is cleared — on a shop that means\n * \"inherit\", on the merchant default \"use the built-in fallback\". The logo has\n * its own methods.\n */\nexport class InvoiceSettingsResource {\n constructor(private readonly request: RequestFn) {}\n\n // --- Settings -------------------------------------------------------------\n\n /**\n * The merchant default.\n * `GET /invoice-settings`\n */\n async retrieve(options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('GET', '/invoice-settings', { ...options });\n }\n\n /**\n * Replace the merchant default (every field but the logo).\n * `PUT /invoice-settings`\n */\n async update(settings: InvoiceSettings, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('PUT', '/invoice-settings', { body: settings, ...options });\n }\n\n /**\n * One shop's override. A `null` field inherits the merchant default.\n * `GET /invoice-settings/profiles/{profile_id}`\n */\n async retrieveForShop(profileId: string, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('GET', `/invoice-settings/profiles/${encodeURIComponent(profileId)}`, {\n ...options,\n });\n }\n\n /**\n * Replace one shop's override (every field but the logo).\n * `PUT /invoice-settings/profiles/{profile_id}`\n */\n async updateForShop(\n profileId: string,\n settings: InvoiceSettings,\n options?: RequestExtras,\n ): Promise<InvoiceSettings> {\n return this.request('PUT', `/invoice-settings/profiles/${encodeURIComponent(profileId)}`, {\n body: settings,\n ...options,\n });\n }\n\n /**\n * The settings a shop's next document is finalised with, and where each\n * value came from (`shop`, `merchant` or `default`).\n * `GET /invoice-settings/profiles/{profile_id}/effective`\n */\n async retrieveEffective(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveInvoiceSettings> {\n return this.request(\n 'GET',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/effective`,\n { ...options },\n );\n }\n\n /**\n * A sample invoice PDF rendered from the effective settings with unsaved\n * values laid over them, so a form can show what saving would produce.\n * Writes nothing.\n * `POST /invoice-settings/preview`\n */\n async preview(params: InvoicePreviewRequest, options?: RequestExtras): Promise<Blob> {\n return this.request('POST', '/invoice-settings/preview', {\n body: params,\n responseType: 'blob',\n ...options,\n });\n }\n\n // --- Logo -----------------------------------------------------------------\n\n /**\n * The merchant default's logo image.\n * `GET /invoice-settings/logo`\n */\n async retrieveLogo(options?: RequestExtras): Promise<Blob> {\n return this.request('GET', '/invoice-settings/logo', { responseType: 'blob', ...options });\n }\n\n /**\n * Set the merchant default's logo: PNG or JPEG, at most 1 MB, as base64.\n * `PUT /invoice-settings/logo`\n */\n async updateLogo(params: InvoiceLogoRequest, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('PUT', '/invoice-settings/logo', { body: params, ...options });\n }\n\n /**\n * Remove the merchant default's logo.\n * `DELETE /invoice-settings/logo`\n */\n async deleteLogo(options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('DELETE', '/invoice-settings/logo', { ...options });\n }\n\n /**\n * One shop's own logo image.\n * `GET /invoice-settings/profiles/{profile_id}/logo`\n */\n async retrieveLogoForShop(profileId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/invoice-settings/profiles/${encodeURIComponent(profileId)}/logo`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * Set one shop's own logo: PNG or JPEG, at most 1 MB, as base64.\n * `PUT /invoice-settings/profiles/{profile_id}/logo`\n */\n async updateLogoForShop(\n profileId: string,\n params: InvoiceLogoRequest,\n options?: RequestExtras,\n ): Promise<InvoiceSettings> {\n return this.request('PUT', `/invoice-settings/profiles/${encodeURIComponent(profileId)}/logo`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's own logo; the shop then inherits the merchant default's.\n * `DELETE /invoice-settings/profiles/{profile_id}/logo`\n */\n async deleteLogoForShop(profileId: string, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request(\n 'DELETE',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/logo`,\n { ...options },\n );\n }\n\n // --- Tax rules ------------------------------------------------------------\n\n /**\n * The merchant's tax rules, which every shop without a list of its own uses.\n * `GET /invoice-settings/tax-rules`\n */\n async retrieveTaxRules(options?: RequestExtras): Promise<InvoiceTaxRules> {\n return this.request('GET', '/invoice-settings/tax-rules', { ...options });\n }\n\n /**\n * Replace the merchant's whole rule list; the order is the priority.\n * `PUT /invoice-settings/tax-rules`\n */\n async updateTaxRules(\n params: InvoiceTaxRulesRequest,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request('PUT', '/invoice-settings/tax-rules', { body: params, ...options });\n }\n\n /**\n * The rules one shop uses: its own list, or the merchant's it inherits, as\n * `own_rules` says.\n * `GET /invoice-settings/profiles/{profile_id}/tax-rules`\n */\n async retrieveTaxRulesForShop(\n profileId: string,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request(\n 'GET',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/tax-rules`,\n { ...options },\n );\n }\n\n /**\n * Give one shop a list of its own, replacing the merchant's for that shop —\n * even when empty, which leaves every line of the shop to the settings'\n * default rate.\n * `PUT /invoice-settings/profiles/{profile_id}/tax-rules`\n */\n async updateTaxRulesForShop(\n profileId: string,\n params: InvoiceTaxRulesRequest,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request(\n 'PUT',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/tax-rules`,\n { body: params, ...options },\n );\n }\n\n /**\n * Drop one shop's own list, so it inherits the merchant's again. Returns\n * the list the shop now uses.\n * `DELETE /invoice-settings/profiles/{profile_id}/tax-rules`\n */\n async deleteTaxRulesForShop(\n profileId: string,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request(\n 'DELETE',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/tax-rules`,\n { ...options },\n );\n }\n\n /**\n * Which saved rule a buyer and a product tax category would meet, and what\n * the line would be taxed at. Writes nothing.\n * `POST /invoice-settings/tax-rules/evaluate`\n */\n async evaluateTaxRules(\n params: InvoiceTaxRuleEvaluateRequest,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRuleEvaluation> {\n return this.request('POST', '/invoice-settings/tax-rules/evaluate', {\n body: params,\n ...options,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-QYNRNDIY.cjs","../src/resources/invoiceSettings.ts"],"names":[],"mappings":"AAAA;ACkCO,IAAM,wBAAA,EAAN,MAA8B;AAAA,EACnC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,OAAA,EAAmD;AAChE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,mBAAA,EAAqB,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM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AA;AAAA;AAAA;AAAA;AAAA;AAQ0E,EAAA;AACA,IAAA;AAC1E,EAAA;AAAA;AAAA;AAAA;AAAA;AAS4B,EAAA;AAC4D,IAAA;AACxF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU4B,EAAA;AACd,IAAA;AACV,MAAA;AAC2D,MAAA;AAC9C,MAAA;AACf,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY4B,EAAA;AACd,IAAA;AACV,MAAA;AAC2D,MAAA;AAChC,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU4B,EAAA;AACd,IAAA;AACV,MAAA;AAC2D,MAAA;AAC9C,MAAA;AACf,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUqC,EAAA;AACiC,IAAA;AAC5D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AACF;AD9E2F;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-QYNRNDIY.cjs","sourcesContent":[null,"import type {\n EffectiveInvoiceSettings,\n InvoiceLogoRequest,\n InvoicePreviewRequest,\n InvoiceSettings,\n InvoiceTaxRuleEvaluateRequest,\n InvoiceTaxRuleEvaluation,\n InvoiceTaxRules,\n InvoiceTaxRulesRequest,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * How the merchant's invoices look and are taxed: the merchant default, and\n * each shop's override of it.\n *\n * Every setting resolves shop → merchant default → built-in fallback, and\n * `retrieveEffective` shows the result for one shop with where each value came\n * from. The same two levels hold the tax rules: a shop either inherits the\n * merchant's list or has one of its own that replaces it.\n *\n * **The merchant-level methods need a merchant-level grant** (no shop role\n * holds one), so a shop user may style its own shop and give it tax rules of\n * its own but never change what every shop inherits. The `…ForShop` methods\n * need the `Invoice` area's grant on that shop.\n *\n * Exported as `InvoiceSettingsResource` so the class never shadows the\n * `InvoiceSettings` data type of the same package.\n *\n * An update **replaces every field but the logo**: read, change, and send the\n * whole object back. A field left out is cleared — on a shop that means\n * \"inherit\", on the merchant default \"use the built-in fallback\". The logo has\n * its own methods.\n */\nexport class InvoiceSettingsResource {\n constructor(private readonly request: RequestFn) {}\n\n // --- Settings -------------------------------------------------------------\n\n /**\n * The merchant default.\n * `GET /invoice-settings`\n */\n async retrieve(options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('GET', '/invoice-settings', { ...options });\n }\n\n /**\n * Replace the merchant default (every field but the logo).\n * `PUT /invoice-settings`\n */\n async update(settings: InvoiceSettings, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('PUT', '/invoice-settings', { body: settings, ...options });\n }\n\n /**\n * One shop's override. A `null` field inherits the merchant default.\n * `GET /invoice-settings/profiles/{profile_id}`\n */\n async retrieveForShop(profileId: string, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('GET', `/invoice-settings/profiles/${encodeURIComponent(profileId)}`, {\n ...options,\n });\n }\n\n /**\n * Replace one shop's override (every field but the logo).\n * `PUT /invoice-settings/profiles/{profile_id}`\n */\n async updateForShop(\n profileId: string,\n settings: InvoiceSettings,\n options?: RequestExtras,\n ): Promise<InvoiceSettings> {\n return this.request('PUT', `/invoice-settings/profiles/${encodeURIComponent(profileId)}`, {\n body: settings,\n ...options,\n });\n }\n\n /**\n * The settings a shop's next document is finalised with, and where each\n * value came from (`shop`, `merchant` or `default`).\n * `GET /invoice-settings/profiles/{profile_id}/effective`\n */\n async retrieveEffective(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveInvoiceSettings> {\n return this.request(\n 'GET',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/effective`,\n { ...options },\n );\n }\n\n /**\n * A sample invoice PDF rendered from the effective settings with unsaved\n * values laid over them, so a form can show what saving would produce.\n * Writes nothing.\n * `POST /invoice-settings/preview`\n */\n async preview(params: InvoicePreviewRequest, options?: RequestExtras): Promise<Blob> {\n return this.request('POST', '/invoice-settings/preview', {\n body: params,\n responseType: 'blob',\n ...options,\n });\n }\n\n // --- Logo -----------------------------------------------------------------\n\n /**\n * The merchant default's logo image.\n * `GET /invoice-settings/logo`\n */\n async retrieveLogo(options?: RequestExtras): Promise<Blob> {\n return this.request('GET', '/invoice-settings/logo', { responseType: 'blob', ...options });\n }\n\n /**\n * Set the merchant default's logo: PNG or JPEG, at most 1 MB, as base64.\n * `PUT /invoice-settings/logo`\n */\n async updateLogo(params: InvoiceLogoRequest, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('PUT', '/invoice-settings/logo', { body: params, ...options });\n }\n\n /**\n * Remove the merchant default's logo.\n * `DELETE /invoice-settings/logo`\n */\n async deleteLogo(options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request('DELETE', '/invoice-settings/logo', { ...options });\n }\n\n /**\n * One shop's own logo image.\n * `GET /invoice-settings/profiles/{profile_id}/logo`\n */\n async retrieveLogoForShop(profileId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/invoice-settings/profiles/${encodeURIComponent(profileId)}/logo`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * Set one shop's own logo: PNG or JPEG, at most 1 MB, as base64.\n * `PUT /invoice-settings/profiles/{profile_id}/logo`\n */\n async updateLogoForShop(\n profileId: string,\n params: InvoiceLogoRequest,\n options?: RequestExtras,\n ): Promise<InvoiceSettings> {\n return this.request('PUT', `/invoice-settings/profiles/${encodeURIComponent(profileId)}/logo`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's own logo; the shop then inherits the merchant default's.\n * `DELETE /invoice-settings/profiles/{profile_id}/logo`\n */\n async deleteLogoForShop(profileId: string, options?: RequestExtras): Promise<InvoiceSettings> {\n return this.request(\n 'DELETE',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/logo`,\n { ...options },\n );\n }\n\n // --- Tax rules ------------------------------------------------------------\n\n /**\n * The merchant's tax rules, which every shop without a list of its own uses.\n * `GET /invoice-settings/tax-rules`\n */\n async retrieveTaxRules(options?: RequestExtras): Promise<InvoiceTaxRules> {\n return this.request('GET', '/invoice-settings/tax-rules', { ...options });\n }\n\n /**\n * Replace the merchant's whole rule list; the order is the priority.\n * `PUT /invoice-settings/tax-rules`\n */\n async updateTaxRules(\n params: InvoiceTaxRulesRequest,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request('PUT', '/invoice-settings/tax-rules', { body: params, ...options });\n }\n\n /**\n * The rules one shop uses: its own list, or the merchant's it inherits, as\n * `own_rules` says.\n * `GET /invoice-settings/profiles/{profile_id}/tax-rules`\n */\n async retrieveTaxRulesForShop(\n profileId: string,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request(\n 'GET',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/tax-rules`,\n { ...options },\n );\n }\n\n /**\n * Give one shop a list of its own, replacing the merchant's for that shop —\n * even when empty, which leaves every line of the shop to the settings'\n * default rate.\n * `PUT /invoice-settings/profiles/{profile_id}/tax-rules`\n */\n async updateTaxRulesForShop(\n profileId: string,\n params: InvoiceTaxRulesRequest,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request(\n 'PUT',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/tax-rules`,\n { body: params, ...options },\n );\n }\n\n /**\n * Drop one shop's own list, so it inherits the merchant's again. Returns\n * the list the shop now uses.\n * `DELETE /invoice-settings/profiles/{profile_id}/tax-rules`\n */\n async deleteTaxRulesForShop(\n profileId: string,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRules> {\n return this.request(\n 'DELETE',\n `/invoice-settings/profiles/${encodeURIComponent(profileId)}/tax-rules`,\n { ...options },\n );\n }\n\n /**\n * Which saved rule a buyer and a product tax category would meet, and what\n * the line would be taxed at. Writes nothing.\n * `POST /invoice-settings/tax-rules/evaluate`\n */\n async evaluateTaxRules(\n params: InvoiceTaxRuleEvaluateRequest,\n options?: RequestExtras,\n ): Promise<InvoiceTaxRuleEvaluation> {\n return this.request('POST', '/invoice-settings/tax-rules/evaluate', {\n body: params,\n ...options,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-R4GA6BVP.cjs","../src/internal/resources/auditLogs.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACUO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,EAA4D;AACrE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,qBAAA,EAAuB;AAAA,MAChD,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,QAAA,EAAU,aAAa,CAAC;AAAA,IACnD,CAAC,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,QAAA,CAAS,KAAA,EAA0C;AACvD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,oBAAA,EAAuB,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYqF,EAAA;AACvE,IAAA;AACV,MAAA;AACwD,MAAA;AAC1D,IAAA;AACF,EAAA;AA6B6D,EAAA;AACpD,IAAA;AACA,MAAA;AACL,MAAA;AACA,MAAA;AAAA;AAAA;AAAA;AAIqD,MAAA;AACrD,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADrCgF;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-R4GA6BVP.cjs","sourcesContent":[null,"import type {\n AuditLogListParams,\n AuditLogListResponse,\n AuditLogResponse,\n ShopCheckoutStateListResponse,\n} from '../types';\nimport type { AdminAuditLogExportRecord } from '../types';\nimport type {\n BinaryExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n} from '../../types';\nimport type { RequestFn } from '../../client';\nimport { runExport } from '../../exportDownload';\nimport { csvQuery } from '../../listQuery';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of the platform audit log, the newest entry first unless\n * `sort_by` says otherwise. Several `action` or `entity_type` values match\n * an entry with any of them.\n */\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: csvQuery(params, ['action', 'entity_type']),\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n\n /**\n * What each shop of a merchant can take at its Live and its Test checkout\n * now. `GET /admin-portal/accounts/{merchant_id}/checkout-state`\n *\n * Every shop of the merchant is listed, with the number of accounts that\n * can take a payment at each checkout. For an account a checkout does not\n * use, `blocks` names who hid it or switched it off in the shop and why;\n * `idle_accounts` names the accounts that take no payments for a reason of\n * their own, such as missing credentials for that environment.\n */\n async shopCheckoutStates(merchantId: string): Promise<ShopCheckoutStateListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/checkout-state`,\n );\n }\n\n /**\n * The platform audit log as a file. `GET /admin-portal/audit/export`\n *\n * Takes the same filters as {@link AuditLogs.list}, and returns the whole\n * match set rather than a page — bounded at 25,000 rows (500 for `pdf`), and\n * refused past that with `DE_07` rather than truncated. `csv` and `json` are\n * streamed and held to their `X-Delopay-Record-Count`; see\n * {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check.\n *\n * Columns answer the question an audit asks rather than mirroring the\n * dashboard table: the actor, the real actor behind an impersonation, the\n * action, its target, when, and from where. `details` is deliberately absent —\n * an unbounded per-action blob is unreadable in a spreadsheet cell.\n */\n async export(\n params?: AuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord>>;\n async export(params: AuditLogListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async export(\n params: AuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob>;\n async export(\n params?: AuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/audit/export',\n // The format is negotiated by `Accept`, never a query field: the query\n // here is the list's own filter model, and adding a key to it would fork\n // the filter vocabulary the export exists to reuse.\n { query: csvQuery(params, ['action', 'entity_type']) },\n options,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-R4GA6BVP.cjs","../src/internal/resources/auditLogs.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACUO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,EAA4D;AACrE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,qBAAA,EAAuB;AAAA,MAChD,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,QAAA,EAAU,aAAa,CAAC;AAAA,IACnD,CAAC,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,QAAA,CAAS,KAAA,EAA0C;AACvD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,oBAAA,EAAuB,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYqF,EAAA;AACvE,IAAA;AACV,MAAA;AACwD,MAAA;AAC1D,IAAA;AACF,EAAA;AA6B6D,EAAA;AACpD,IAAA;AACA,MAAA;AACL,MAAA;AACA,MAAA;AAAA;AAAA;AAAA;AAIqD,MAAA;AACrD,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADrCgF;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-R4GA6BVP.cjs","sourcesContent":[null,"import type {\n AuditLogListParams,\n AuditLogListResponse,\n AuditLogResponse,\n ShopCheckoutStateListResponse,\n} from '../types';\nimport type { AdminAuditLogExportRecord } from '../types';\nimport type {\n BinaryExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n} from '../../types';\nimport type { RequestFn } from '../../client';\nimport { runExport } from '../../exportDownload';\nimport { csvQuery } from '../../listQuery';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of the platform audit log, the newest entry first unless\n * `sort_by` says otherwise. Several `action` or `entity_type` values match\n * an entry with any of them.\n */\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: csvQuery(params, ['action', 'entity_type']),\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n\n /**\n * What each shop of a merchant can take at its Live and its Test checkout\n * now. `GET /admin-portal/accounts/{merchant_id}/checkout-state`\n *\n * Every shop of the merchant is listed, with the number of accounts that\n * can take a payment at each checkout. For an account a checkout does not\n * use, `blocks` names who hid it or switched it off in the shop and why;\n * `idle_accounts` names the accounts that take no payments for a reason of\n * their own, such as missing credentials for that environment.\n */\n async shopCheckoutStates(merchantId: string): Promise<ShopCheckoutStateListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/checkout-state`,\n );\n }\n\n /**\n * The platform audit log as a file. `GET /admin-portal/audit/export`\n *\n * Takes the same filters as {@link AuditLogs.list}, and returns the whole\n * match set rather than a page — bounded at 25,000 rows (500 for `pdf`), and\n * refused past that with `DE_07` rather than truncated. `csv` and `json` are\n * streamed and held to their `X-Delopay-Record-Count`; see\n * {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check.\n *\n * Columns answer the question an audit asks rather than mirroring the\n * dashboard table: the actor, the real actor behind an impersonation, the\n * action, its target, when, and from where. `details` is deliberately absent —\n * an unbounded per-action blob is unreadable in a spreadsheet cell.\n */\n async export(\n params?: AuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord>>;\n async export(params: AuditLogListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async export(\n params: AuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob>;\n async export(\n params?: AuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/audit/export',\n // The format is negotiated by `Accept`, never a query field: the query\n // here is the list's own filter model, and adding a key to it would fork\n // the filter vocabulary the export exists to reuse.\n { query: csvQuery(params, ['action', 'entity_type']) },\n options,\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-R5VYSZ3Q.cjs","../src/resources/events.ts"],"names":[],"mappings":"AAAA;ACSO,IAAM,OAAA,EAAN,MAAa;AAAA,EAClB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,IAAA,CAAK,UAAA,EAAoB,MAAA,EAAsD;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,QAAA,EAAW,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUgG,EAAA;AAClF,IAAA;AACV,MAAA;AACgE,MAAA;AAClE,IAAA;AACF,EAAA;AAEuF,EAAA;AACzE,IAAA;AACV,MAAA;AACgE,MAAA;AAClE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACgC,IAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW0E,EAAA;AACJ,IAAA;AACtE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS6F,EAAA;AAC5B,IAAA;AACjE,EAAA;AACF;ADf0E;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-R5VYSZ3Q.cjs","sourcesContent":[null,"import type {\n EventListParams,\n EventListResponse,\n EventDetailResponse,\n EventManualTriggerRequest,\n EventManualTriggerResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Events {\n constructor(private readonly request: RequestFn) {}\n\n async list(merchantId: string, params?: EventListParams): Promise<EventListResponse> {\n return this.request('POST', `/events/${encodeURIComponent(merchantId)}`, { body: params });\n }\n\n /**\n * Every delivery attempt of one event, initial attempt first.\n * `GET /events/{merchant_id}/{event_id}/attempts`\n *\n * Each entry describes one attempt: `attempt_delivered` is that attempt's own\n * result, while `is_delivery_successful` and `delivery_terminal_reason` are\n * the event's and read the same on every entry.\n */\n async listDeliveryAttempts(merchantId: string, eventId: string): Promise<EventDetailResponse[]> {\n return this.request(\n 'GET',\n `/events/${encodeURIComponent(merchantId)}/${encodeURIComponent(eventId)}/attempts`,\n );\n }\n\n async retryDelivery(merchantId: string, eventId: string): Promise<EventDetailResponse> {\n return this.request(\n 'POST',\n `/events/${encodeURIComponent(merchantId)}/${encodeURIComponent(eventId)}/retry`,\n );\n }\n\n /**\n * Fire an outgoing webhook event by hand for one object.\n * `POST /events/{merchant_id}/trigger`\n *\n * Not a replay — see {@link EventManualTriggerRequest}. Needs the\n * `WebhookEventTrigger` permission, which is separate from the one that\n * authorizes {@link retryDelivery}, and is JWT-only: a forged payload must\n * be attributable to a person.\n */\n async trigger(\n merchantId: string,\n body: EventManualTriggerRequest,\n ): Promise<EventManualTriggerResponse> {\n return this.request('POST', `/events/${encodeURIComponent(merchantId)}/trigger`, { body });\n }\n\n // --- Profile-scoped listing (Task 4.12) ---\n\n /**\n * List events (profile-scoped). `POST /events/profile/list`\n *\n * Takes the same constraints as {@link list} — it is the same endpoint\n * narrowed to the caller's own shop, so `profile_id` is redundant and\n * ignored there.\n */\n async listByProfile(params?: EventListParams): Promise<EventListResponse> {\n return this.request('POST', '/events/profile/list', { body: params });\n }\n\n /**\n * Fire an outgoing webhook event by hand (profile-scoped).\n * `POST /events/profile/trigger`\n *\n * The shop-user twin of {@link trigger}; the shop is taken from the auth\n * context, so `profile_id` on the body is ignored.\n */\n async triggerByProfile(body: EventManualTriggerRequest): Promise<EventManualTriggerResponse> {\n return this.request('POST', '/events/profile/trigger', { body });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-R5VYSZ3Q.cjs","../src/resources/events.ts"],"names":[],"mappings":"AAAA;ACSO,IAAM,OAAA,EAAN,MAAa;AAAA,EAClB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,IAAA,CAAK,UAAA,EAAoB,MAAA,EAAsD;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,QAAA,EAAW,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUgG,EAAA;AAClF,IAAA;AACV,MAAA;AACgE,MAAA;AAClE,IAAA;AACF,EAAA;AAEuF,EAAA;AACzE,IAAA;AACV,MAAA;AACgE,MAAA;AAClE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACgC,IAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW0E,EAAA;AACJ,IAAA;AACtE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS6F,EAAA;AAC5B,IAAA;AACjE,EAAA;AACF;ADf0E;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-R5VYSZ3Q.cjs","sourcesContent":[null,"import type {\n EventListParams,\n EventListResponse,\n EventDetailResponse,\n EventManualTriggerRequest,\n EventManualTriggerResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Events {\n constructor(private readonly request: RequestFn) {}\n\n async list(merchantId: string, params?: EventListParams): Promise<EventListResponse> {\n return this.request('POST', `/events/${encodeURIComponent(merchantId)}`, { body: params });\n }\n\n /**\n * Every delivery attempt of one event, initial attempt first.\n * `GET /events/{merchant_id}/{event_id}/attempts`\n *\n * Each entry describes one attempt: `attempt_delivered` is that attempt's own\n * result, while `is_delivery_successful` and `delivery_terminal_reason` are\n * the event's and read the same on every entry.\n */\n async listDeliveryAttempts(merchantId: string, eventId: string): Promise<EventDetailResponse[]> {\n return this.request(\n 'GET',\n `/events/${encodeURIComponent(merchantId)}/${encodeURIComponent(eventId)}/attempts`,\n );\n }\n\n async retryDelivery(merchantId: string, eventId: string): Promise<EventDetailResponse> {\n return this.request(\n 'POST',\n `/events/${encodeURIComponent(merchantId)}/${encodeURIComponent(eventId)}/retry`,\n );\n }\n\n /**\n * Fire an outgoing webhook event by hand for one object.\n * `POST /events/{merchant_id}/trigger`\n *\n * Not a replay — see {@link EventManualTriggerRequest}. Needs the\n * `WebhookEventTrigger` permission, which is separate from the one that\n * authorizes {@link retryDelivery}, and is JWT-only: a forged payload must\n * be attributable to a person.\n */\n async trigger(\n merchantId: string,\n body: EventManualTriggerRequest,\n ): Promise<EventManualTriggerResponse> {\n return this.request('POST', `/events/${encodeURIComponent(merchantId)}/trigger`, { body });\n }\n\n // --- Profile-scoped listing (Task 4.12) ---\n\n /**\n * List events (profile-scoped). `POST /events/profile/list`\n *\n * Takes the same constraints as {@link list} — it is the same endpoint\n * narrowed to the caller's own shop, so `profile_id` is redundant and\n * ignored there.\n */\n async listByProfile(params?: EventListParams): Promise<EventListResponse> {\n return this.request('POST', '/events/profile/list', { body: params });\n }\n\n /**\n * Fire an outgoing webhook event by hand (profile-scoped).\n * `POST /events/profile/trigger`\n *\n * The shop-user twin of {@link trigger}; the shop is taken from the auth\n * context, so `profile_id` on the body is ignored.\n */\n async triggerByProfile(body: EventManualTriggerRequest): Promise<EventManualTriggerResponse> {\n return this.request('POST', '/events/profile/trigger', { body });\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Delopay
3
- } from "./chunk-UDEIFKUZ.js";
3
+ } from "./chunk-MAHLGVYT.js";
4
4
  import {
5
5
  DelopayError
6
6
  } from "./chunk-37BJUQ32.js";
@@ -1035,4 +1035,4 @@ var CheckoutSession = class {
1035
1035
  export {
1036
1036
  CheckoutSession
1037
1037
  };
1038
- //# sourceMappingURL=chunk-REC24R2S.js.map
1038
+ //# sourceMappingURL=chunk-RDG7QBXP.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-RHFUXHQN.cjs","../src/resources/aiTools.ts"],"names":[],"mappings":"AAAA;ACQA,IAAM,iBAAA,EAAmB,CAAC,cAAA,EAAwB,QAAA,EAAA,GAChD,CAAA,2BAAA,EAA8B,kBAAA,CAAmB,cAAc,CAAC,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAA;AAgBzD;AAC8B,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUV,EAAA;AACmB,IAAA;AACH,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO4D,EAAA;AACL,IAAA;AACvD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQuD,EAAA;AACkC,IAAA;AACzF,EAAA;AACF;AD3BkI;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-RHFUXHQN.cjs","sourcesContent":[null,"import type {\n McpConfirmationEntry,\n McpConfirmationListParams,\n McpConfirmationListResponse,\n McpConnectionListResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nconst confirmationPath = (confirmationId: string, decision: 'approve' | 'decline'): string =>\n `/account/mcp/confirmations/${encodeURIComponent(confirmationId)}/${decision}`;\n\n/**\n * AI tools that work in the merchant account through the MCP server: the\n * confirmations they ask for, and the tools connected by signing in.\n *\n * A sensitive change an AI tool makes, such as a refund, a deletion or an\n * access change, waits for a person's confirmation. When the tool cannot ask\n * in the agent, the confirmation waits here for a decision.\n *\n * Every method needs a signed-in dashboard user and acts on the merchant of\n * that sign-in. A user sees the confirmations of their own sign-ins and their\n * own connected tools; a user whose role may manage API keys sees every one of\n * the merchant's. A sign-in's confirmation is decided only by the user who\n * signed in, an API key's by a user whose role may manage API keys.\n */\nexport class AiTools {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The confirmations this user may see, newest first: by default those\n * waiting for a decision and not expired, or every one with\n * `{ status: 'all' }`.\n * `GET /account/mcp/confirmations`\n */\n async listConfirmations(\n params: McpConfirmationListParams = {},\n ): Promise<McpConfirmationListResponse> {\n return this.request('GET', '/account/mcp/confirmations', {\n query: params.status ? { status: params.status } : {},\n });\n }\n\n /**\n * Approve a pending confirmation. The AI tool can then make the confirmed\n * change once, for the same request, before the confirmation expires.\n * Refused with 400 when it is no longer pending, 403 when this user may not\n * decide it, and 404 for an unknown confirmation.\n * `POST /account/mcp/confirmations/{confirmationId}/approve`\n */\n async approveConfirmation(confirmationId: string): Promise<McpConfirmationEntry> {\n return this.request('POST', confirmationPath(confirmationId, 'approve'));\n }\n\n /**\n * Decline a pending confirmation; the change is not made. Refused like\n * {@link AiTools.approveConfirmation}.\n * `POST /account/mcp/confirmations/{confirmationId}/decline`\n */\n async declineConfirmation(confirmationId: string): Promise<McpConfirmationEntry> {\n return this.request('POST', confirmationPath(confirmationId, 'decline'));\n }\n\n /**\n * The AI tools connected to the merchant by signing in, newest first: this\n * user's own, or every user's for a role that may manage API keys.\n * `GET /account/mcp/connections`\n */\n async listConnections(): Promise<McpConnectionListResponse> {\n return this.request('GET', '/account/mcp/connections');\n }\n\n /**\n * Remove a connected AI tool by revoking its sign-in; its next request is\n * refused. Refused with 403 when it is neither this user's tool nor the role\n * may manage API keys, and 404 for an unknown one.\n * `DELETE /account/mcp/connections/{grantId}`\n */\n async removeConnection(grantId: string): Promise<void> {\n return this.request('DELETE', `/account/mcp/connections/${encodeURIComponent(grantId)}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-RHFUXHQN.cjs","../src/resources/aiTools.ts"],"names":[],"mappings":"AAAA;ACQA,IAAM,iBAAA,EAAmB,CAAC,cAAA,EAAwB,QAAA,EAAA,GAChD,CAAA,2BAAA,EAA8B,kBAAA,CAAmB,cAAc,CAAC,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAA;AAgBzD;AAC8B,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUV,EAAA;AACmB,IAAA;AACH,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO4D,EAAA;AACL,IAAA;AACvD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQuD,EAAA;AACkC,IAAA;AACzF,EAAA;AACF;AD3BkI;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-RHFUXHQN.cjs","sourcesContent":[null,"import type {\n McpConfirmationEntry,\n McpConfirmationListParams,\n McpConfirmationListResponse,\n McpConnectionListResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nconst confirmationPath = (confirmationId: string, decision: 'approve' | 'decline'): string =>\n `/account/mcp/confirmations/${encodeURIComponent(confirmationId)}/${decision}`;\n\n/**\n * AI tools that work in the merchant account through the MCP server: the\n * confirmations they ask for, and the tools connected by signing in.\n *\n * A sensitive change an AI tool makes, such as a refund, a deletion or an\n * access change, waits for a person's confirmation. When the tool cannot ask\n * in the agent, the confirmation waits here for a decision.\n *\n * Every method needs a signed-in dashboard user and acts on the merchant of\n * that sign-in. A user sees the confirmations of their own sign-ins and their\n * own connected tools; a user whose role may manage API keys sees every one of\n * the merchant's. A sign-in's confirmation is decided only by the user who\n * signed in, an API key's by a user whose role may manage API keys.\n */\nexport class AiTools {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The confirmations this user may see, newest first: by default those\n * waiting for a decision and not expired, or every one with\n * `{ status: 'all' }`.\n * `GET /account/mcp/confirmations`\n */\n async listConfirmations(\n params: McpConfirmationListParams = {},\n ): Promise<McpConfirmationListResponse> {\n return this.request('GET', '/account/mcp/confirmations', {\n query: params.status ? { status: params.status } : {},\n });\n }\n\n /**\n * Approve a pending confirmation. The AI tool can then make the confirmed\n * change once, for the same request, before the confirmation expires.\n * Refused with 400 when it is no longer pending, 403 when this user may not\n * decide it, and 404 for an unknown confirmation.\n * `POST /account/mcp/confirmations/{confirmationId}/approve`\n */\n async approveConfirmation(confirmationId: string): Promise<McpConfirmationEntry> {\n return this.request('POST', confirmationPath(confirmationId, 'approve'));\n }\n\n /**\n * Decline a pending confirmation; the change is not made. Refused like\n * {@link AiTools.approveConfirmation}.\n * `POST /account/mcp/confirmations/{confirmationId}/decline`\n */\n async declineConfirmation(confirmationId: string): Promise<McpConfirmationEntry> {\n return this.request('POST', confirmationPath(confirmationId, 'decline'));\n }\n\n /**\n * The AI tools connected to the merchant by signing in, newest first: this\n * user's own, or every user's for a role that may manage API keys.\n * `GET /account/mcp/connections`\n */\n async listConnections(): Promise<McpConnectionListResponse> {\n return this.request('GET', '/account/mcp/connections');\n }\n\n /**\n * Remove a connected AI tool by revoking its sign-in; its next request is\n * refused. Refused with 403 when it is neither this user's tool nor the role\n * may manage API keys, and 404 for an unknown one.\n * `DELETE /account/mcp/connections/{grantId}`\n */\n async removeConnection(grantId: string): Promise<void> {\n return this.request('DELETE', `/account/mcp/connections/${encodeURIComponent(grantId)}`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w1-pub-0470/sdk/dist/chunk-RI42IDRR.cjs","../src/resources/profileAcquirers.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,iBAAA,EAAN,MAAuB;AAAA,EAC5B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAAwE;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,mBAAA,EAAqB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACnE;AAAA,EAEA,MAAM,MAAA,CACJ,SAAA,EACA,iBAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA,EAAI,kBAAA,CAAmB,iBAAiB,CAAC,CAAA,CAAA;AAC3F,MAAA;AACQ,QAAA;AACR,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADTkG;AACA;AACA;AACA","file":"/tmp/w1-pub-0470/sdk/dist/chunk-RI42IDRR.cjs","sourcesContent":[null,"import type {\n ProfileAcquirerCreateRequest,\n ProfileAcquirerResponse,\n ProfileAcquirerUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ProfileAcquirers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: ProfileAcquirerCreateRequest): Promise<ProfileAcquirerResponse> {\n return this.request('POST', '/profile-acquirer', { body: params });\n }\n\n async update(\n profileId: string,\n profileAcquirerId: string,\n params: ProfileAcquirerUpdateRequest,\n ): Promise<ProfileAcquirerResponse> {\n return this.request(\n 'POST',\n `/profile-acquirer/${encodeURIComponent(profileId)}/${encodeURIComponent(profileAcquirerId)}`,\n {\n body: params,\n },\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w4-publish-0472/dist/chunk-RI42IDRR.cjs","../src/resources/profileAcquirers.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,iBAAA,EAAN,MAAuB;AAAA,EAC5B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAAwE;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,mBAAA,EAAqB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACnE;AAAA,EAEA,MAAM,MAAA,CACJ,SAAA,EACA,iBAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA,EAAI,kBAAA,CAAmB,iBAAiB,CAAC,CAAA,CAAA;AAC3F,MAAA;AACQ,QAAA;AACR,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADTkG;AACA;AACA;AACA","file":"/tmp/w4-publish-0472/dist/chunk-RI42IDRR.cjs","sourcesContent":[null,"import type {\n ProfileAcquirerCreateRequest,\n ProfileAcquirerResponse,\n ProfileAcquirerUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ProfileAcquirers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: ProfileAcquirerCreateRequest): Promise<ProfileAcquirerResponse> {\n return this.request('POST', '/profile-acquirer', { body: params });\n }\n\n async update(\n profileId: string,\n profileAcquirerId: string,\n params: ProfileAcquirerUpdateRequest,\n ): Promise<ProfileAcquirerResponse> {\n return this.request(\n 'POST',\n `/profile-acquirer/${encodeURIComponent(profileId)}/${encodeURIComponent(profileAcquirerId)}`,\n {\n body: params,\n },\n );\n }\n}\n"]}