@delopay/sdk 0.428.0 → 0.437.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 (364) hide show
  1. package/README.md +5 -5
  2. package/dist/airwallexCard.cjs.map +1 -1
  3. package/dist/branding.cjs.map +1 -1
  4. package/dist/cardFormStyles.cjs.map +1 -1
  5. package/dist/checkoutSession.cjs +2 -2
  6. package/dist/checkoutSession.cjs.map +1 -1
  7. package/dist/checkoutSession.js +1 -1
  8. package/dist/chunk-244VZFFO.cjs.map +1 -1
  9. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  10. package/dist/{chunk-5JJ65Z7J.cjs → chunk-2QULWFRR.cjs} +33 -25
  11. package/dist/chunk-2QULWFRR.cjs.map +1 -0
  12. package/dist/chunk-34PC72O7.cjs.map +1 -1
  13. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  14. package/dist/chunk-3MS2HPSJ.js +25 -0
  15. package/dist/chunk-3MS2HPSJ.js.map +1 -0
  16. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  17. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  18. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  19. package/dist/chunk-4FOFD2A3.js +63 -0
  20. package/dist/chunk-4FOFD2A3.js.map +1 -0
  21. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  22. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  23. package/dist/{chunk-MFZ5FBS7.cjs → chunk-4XURI7WM.cjs} +3 -3
  24. package/dist/chunk-4XURI7WM.cjs.map +1 -0
  25. package/dist/{chunk-BEND2MZX.js → chunk-4Y3NBXOF.js} +11 -3
  26. package/dist/chunk-4Y3NBXOF.js.map +1 -0
  27. package/dist/chunk-5CITBN33.cjs.map +1 -1
  28. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  29. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  30. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  31. package/dist/{chunk-7ITPMVDB.cjs → chunk-6LFOM6HV.cjs} +11 -3
  32. package/dist/chunk-6LFOM6HV.cjs.map +1 -0
  33. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  34. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  35. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  36. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  37. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  38. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  39. package/dist/{chunk-UZ5V4N7M.js → chunk-7M32LYPT.js} +38 -30
  40. package/dist/chunk-7M32LYPT.js.map +1 -0
  41. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  42. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  43. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  44. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  45. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  46. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  47. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  48. package/dist/chunk-CAMALM35.cjs.map +1 -1
  49. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  50. package/dist/chunk-CKKNFFKP.cjs.map +1 -1
  51. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  52. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  53. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  54. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  55. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  56. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  57. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  58. package/dist/chunk-F46K5H3U.cjs +63 -0
  59. package/dist/chunk-F46K5H3U.cjs.map +1 -0
  60. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  61. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  62. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  63. package/dist/chunk-GA3KXPIF.cjs.map +1 -1
  64. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  65. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  66. package/dist/{chunk-FELTF5FF.js → chunk-GQYWT7BY.js} +2 -2
  67. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  68. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  69. package/dist/chunk-GWJ33GOK.cjs +63 -0
  70. package/dist/chunk-GWJ33GOK.cjs.map +1 -0
  71. package/dist/chunk-HBBEQWDU.cjs +1 -0
  72. package/dist/chunk-HBBEQWDU.cjs.map +1 -0
  73. package/dist/chunk-HLHML5ES.cjs.map +1 -1
  74. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  75. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  76. package/dist/{chunk-GU3VNMQ5.js → chunk-I23IC3T4.js} +20 -2
  77. package/dist/chunk-I23IC3T4.js.map +1 -0
  78. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  79. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  80. package/dist/chunk-I65QS3YQ.cjs.map +1 -1
  81. package/dist/{chunk-QMLU5DST.cjs → chunk-IH4OVCKM.cjs} +2 -2
  82. package/dist/chunk-IH4OVCKM.cjs.map +1 -0
  83. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  84. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  85. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  86. package/dist/{chunk-424542L2.cjs → chunk-K36XUB3A.cjs} +31 -5
  87. package/dist/chunk-K36XUB3A.cjs.map +1 -0
  88. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  89. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  90. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  91. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  92. package/dist/chunk-KOB6MOAV.cjs.map +1 -1
  93. package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
  94. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  95. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  96. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  97. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  98. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  99. package/dist/chunk-MCNDMK7F.cjs.map +1 -1
  100. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  101. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  102. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  103. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  104. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  105. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  106. package/dist/chunk-OWP7XBY2.cjs.map +1 -1
  107. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  108. package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
  109. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  110. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  111. package/dist/chunk-PWDY5D5S.cjs.map +1 -1
  112. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  113. package/dist/chunk-QKJZY32F.js +63 -0
  114. package/dist/chunk-QKJZY32F.js.map +1 -0
  115. package/dist/chunk-QKUWFMZP.cjs +69 -0
  116. package/dist/chunk-QKUWFMZP.cjs.map +1 -0
  117. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  118. package/dist/{chunk-WR6Z4I52.cjs → chunk-QXVMSF3D.cjs} +21 -3
  119. package/dist/chunk-QXVMSF3D.cjs.map +1 -0
  120. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  121. package/dist/chunk-R4FE6K43.cjs.map +1 -1
  122. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  123. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  124. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  125. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  126. package/dist/chunk-RSVLVW4L.cjs.map +1 -1
  127. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  128. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  129. package/dist/chunk-SQELICSX.cjs.map +1 -1
  130. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  131. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  132. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  133. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  134. package/dist/{chunk-K74UMEU4.js → chunk-UQDXXLLT.js} +27 -1
  135. package/dist/chunk-UQDXXLLT.js.map +1 -0
  136. package/dist/{chunk-H2NGR5JG.js → chunk-UUZ5TSEX.js} +2 -2
  137. package/dist/chunk-UUZ5TSEX.js.map +1 -0
  138. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  139. package/dist/chunk-VFPQUIEP.js +69 -0
  140. package/dist/chunk-VFPQUIEP.js.map +1 -0
  141. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  142. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  143. package/dist/chunk-W457XUA6.cjs.map +1 -1
  144. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  145. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  146. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  147. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  148. package/dist/chunk-XW7LMBMD.js +1 -0
  149. package/dist/chunk-YJQPKT6W.cjs.map +1 -1
  150. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  151. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  152. package/dist/chunk-ZUULK36E.cjs +25 -0
  153. package/dist/chunk-ZUULK36E.cjs.map +1 -0
  154. package/dist/client.cjs +3 -3
  155. package/dist/client.cjs.map +1 -1
  156. package/dist/client.d.cts +9 -0
  157. package/dist/client.d.ts +9 -0
  158. package/dist/client.js +2 -2
  159. package/dist/core.cjs +2 -2
  160. package/dist/core.cjs.map +1 -1
  161. package/dist/core.d.cts +5 -1
  162. package/dist/core.d.ts +5 -1
  163. package/dist/core.js +1 -1
  164. package/dist/currencies.cjs.map +1 -1
  165. package/dist/enigmaCardForm.cjs.map +1 -1
  166. package/dist/error.cjs.map +1 -1
  167. package/dist/eventStream.cjs.map +1 -1
  168. package/dist/exportDownload.cjs.map +1 -1
  169. package/dist/feeProgram.cjs.map +1 -1
  170. package/dist/index.cjs +33 -25
  171. package/dist/index.cjs.map +1 -1
  172. package/dist/index.d.cts +3 -1
  173. package/dist/index.d.ts +3 -1
  174. package/dist/index.js +40 -32
  175. package/dist/internal/resources/admin.cjs.map +1 -1
  176. package/dist/internal/resources/admin.d.cts +1 -1
  177. package/dist/internal/resources/admin.d.ts +1 -1
  178. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  179. package/dist/internal/resources/adminBranding.d.cts +1 -1
  180. package/dist/internal/resources/adminBranding.d.ts +1 -1
  181. package/dist/internal/resources/adminFeePlans.cjs +7 -0
  182. package/dist/internal/resources/adminFeePlans.cjs.map +1 -0
  183. package/dist/internal/resources/adminFeePlans.d.cts +39 -0
  184. package/dist/internal/resources/adminFeePlans.d.ts +39 -0
  185. package/dist/internal/resources/adminFeePlans.js +7 -0
  186. package/dist/internal/resources/adminFeePlans.js.map +1 -0
  187. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  188. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  189. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  190. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  191. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  192. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  193. package/dist/internal/resources/adminLive.cjs.map +1 -1
  194. package/dist/internal/resources/adminNotices.cjs +7 -0
  195. package/dist/internal/resources/adminNotices.cjs.map +1 -0
  196. package/dist/internal/resources/adminNotices.d.cts +43 -0
  197. package/dist/internal/resources/adminNotices.d.ts +43 -0
  198. package/dist/internal/resources/adminNotices.js +7 -0
  199. package/dist/internal/resources/adminNotices.js.map +1 -0
  200. package/dist/internal/resources/adminPortal.cjs +2 -2
  201. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  202. package/dist/internal/resources/adminPortal.d.cts +18 -2
  203. package/dist/internal/resources/adminPortal.d.ts +18 -2
  204. package/dist/internal/resources/adminPortal.js +1 -1
  205. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  206. package/dist/internal/resources/adminSupport.d.cts +1 -1
  207. package/dist/internal/resources/adminSupport.d.ts +1 -1
  208. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  209. package/dist/internal/resources/auditLogs.d.cts +1 -1
  210. package/dist/internal/resources/auditLogs.d.ts +1 -1
  211. package/dist/internal/resources/cache.cjs.map +1 -1
  212. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  213. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  214. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  215. package/dist/internal/resources/configs.cjs.map +1 -1
  216. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  217. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  218. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  219. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  220. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  221. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  222. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  223. package/dist/internal/resources/diagnostic.d.cts +1 -1
  224. package/dist/internal/resources/diagnostic.d.ts +1 -1
  225. package/dist/internal/resources/gsm.cjs.map +1 -1
  226. package/dist/internal/resources/gsm.d.cts +1 -1
  227. package/dist/internal/resources/gsm.d.ts +1 -1
  228. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  229. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  230. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  231. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  232. package/dist/internal/resources/platformBilling.d.cts +1 -1
  233. package/dist/internal/resources/platformBilling.d.ts +1 -1
  234. package/dist/internal/resources/platformFees.cjs.map +1 -1
  235. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  236. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  237. package/dist/internal/resources/platformSettings.d.cts +1 -1
  238. package/dist/internal/resources/platformSettings.d.ts +1 -1
  239. package/dist/internal.cjs +64 -46
  240. package/dist/internal.cjs.map +1 -1
  241. package/dist/internal.d.cts +10 -3
  242. package/dist/internal.d.ts +10 -3
  243. package/dist/internal.js +78 -60
  244. package/dist/internal.js.map +1 -1
  245. package/dist/listQuery.cjs.map +1 -1
  246. package/dist/panes.cjs.map +1 -1
  247. package/dist/paymentPresentation.cjs.map +1 -1
  248. package/dist/recordCounter.cjs.map +1 -1
  249. package/dist/resources/aiTools.cjs.map +1 -1
  250. package/dist/resources/analytics.cjs.map +1 -1
  251. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  252. package/dist/resources/apiKeys.cjs.map +1 -1
  253. package/dist/resources/audit.cjs.map +1 -1
  254. package/dist/resources/authentication.cjs.map +1 -1
  255. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  256. package/dist/resources/billing.cjs.map +1 -1
  257. package/dist/resources/buyerAccount.cjs.map +1 -1
  258. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  259. package/dist/resources/buyerConversations.cjs.map +1 -1
  260. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  261. package/dist/resources/buyerPortal.cjs.map +1 -1
  262. package/dist/resources/cards.cjs.map +1 -1
  263. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  264. package/dist/resources/checkoutMethods.cjs.map +1 -1
  265. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  266. package/dist/resources/checkoutTemplates.cjs +2 -2
  267. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  268. package/dist/resources/checkoutTemplates.d.cts +8 -2
  269. package/dist/resources/checkoutTemplates.d.ts +8 -2
  270. package/dist/resources/checkoutTemplates.js +1 -1
  271. package/dist/resources/connectors.cjs.map +1 -1
  272. package/dist/resources/contentEncryption.cjs +7 -0
  273. package/dist/resources/contentEncryption.cjs.map +1 -0
  274. package/dist/resources/contentEncryption.d.cts +31 -0
  275. package/dist/resources/contentEncryption.d.ts +31 -0
  276. package/dist/resources/contentEncryption.js +7 -0
  277. package/dist/resources/contentEncryption.js.map +1 -0
  278. package/dist/resources/costRules.cjs.map +1 -1
  279. package/dist/resources/customers.cjs.map +1 -1
  280. package/dist/resources/deploymentBranding.cjs.map +1 -1
  281. package/dist/resources/disputes.cjs.map +1 -1
  282. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  283. package/dist/resources/events.cjs.map +1 -1
  284. package/dist/resources/export.cjs.map +1 -1
  285. package/dist/resources/externalRecords.cjs.map +1 -1
  286. package/dist/resources/featureMatrix.cjs.map +1 -1
  287. package/dist/resources/fees.cjs.map +1 -1
  288. package/dist/resources/files.cjs.map +1 -1
  289. package/dist/resources/forex.cjs.map +1 -1
  290. package/dist/resources/identityVerifications.cjs.map +1 -1
  291. package/dist/resources/industries.cjs.map +1 -1
  292. package/dist/resources/invoiceSettings.cjs.map +1 -1
  293. package/dist/resources/invoices.cjs.map +1 -1
  294. package/dist/resources/live.cjs.map +1 -1
  295. package/dist/resources/mandates.cjs.map +1 -1
  296. package/dist/resources/merchantAccounts.cjs.map +1 -1
  297. package/dist/resources/messageTemplates.cjs.map +1 -1
  298. package/dist/resources/notices.cjs +7 -0
  299. package/dist/resources/notices.cjs.map +1 -0
  300. package/dist/resources/notices.d.cts +56 -0
  301. package/dist/resources/notices.d.ts +56 -0
  302. package/dist/resources/notices.js +7 -0
  303. package/dist/resources/notices.js.map +1 -0
  304. package/dist/resources/operationLimits.cjs.map +1 -1
  305. package/dist/resources/paymentLinks.cjs.map +1 -1
  306. package/dist/resources/paymentMethods.cjs.map +1 -1
  307. package/dist/resources/payments.cjs.map +1 -1
  308. package/dist/resources/payoutDestinations.cjs.map +1 -1
  309. package/dist/resources/payouts.cjs.map +1 -1
  310. package/dist/resources/paypalDisputes.cjs.map +1 -1
  311. package/dist/resources/persons.cjs.map +1 -1
  312. package/dist/resources/poll.cjs.map +1 -1
  313. package/dist/resources/processorCosts.cjs.map +1 -1
  314. package/dist/resources/processorImports.cjs.map +1 -1
  315. package/dist/resources/products.cjs.map +1 -1
  316. package/dist/resources/profileAcquirers.cjs.map +1 -1
  317. package/dist/resources/profiles.cjs.map +1 -1
  318. package/dist/resources/projects.cjs.map +1 -1
  319. package/dist/resources/refunds.cjs.map +1 -1
  320. package/dist/resources/regions.cjs.map +1 -1
  321. package/dist/resources/relay.cjs.map +1 -1
  322. package/dist/resources/risk.cjs.map +1 -1
  323. package/dist/resources/routing.cjs.map +1 -1
  324. package/dist/resources/search.cjs.map +1 -1
  325. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  326. package/dist/resources/settings.cjs.map +1 -1
  327. package/dist/resources/settlement.cjs +2 -2
  328. package/dist/resources/settlement.cjs.map +1 -1
  329. package/dist/resources/settlement.d.cts +17 -1
  330. package/dist/resources/settlement.d.ts +17 -1
  331. package/dist/resources/settlement.js +1 -1
  332. package/dist/resources/shopLabels.cjs.map +1 -1
  333. package/dist/resources/shops.cjs.map +1 -1
  334. package/dist/resources/stripeConnect.cjs.map +1 -1
  335. package/dist/resources/subscriptions.cjs.map +1 -1
  336. package/dist/resources/support.cjs.map +1 -1
  337. package/dist/resources/threeDsRules.cjs.map +1 -1
  338. package/dist/resources/users.cjs.map +1 -1
  339. package/dist/resources/vatRates.cjs.map +1 -1
  340. package/dist/resources/verification.cjs.map +1 -1
  341. package/dist/resources/webhooks.cjs.map +1 -1
  342. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  343. package/dist/{types-CAF6Fg1O.d.ts → types-B82KRgid.d.cts} +267 -3
  344. package/dist/{types-gi0y0Jy7.d.cts → types-CVKMSviB.d.ts} +267 -3
  345. package/dist/types.cjs.map +1 -1
  346. package/dist/types.d.cts +462 -5
  347. package/dist/types.d.ts +462 -5
  348. package/package.json +1 -1
  349. package/dist/chunk-424542L2.cjs.map +0 -1
  350. package/dist/chunk-5JJ65Z7J.cjs.map +0 -1
  351. package/dist/chunk-7ITPMVDB.cjs.map +0 -1
  352. package/dist/chunk-A4UPU5UE.js +0 -1
  353. package/dist/chunk-BEND2MZX.js.map +0 -1
  354. package/dist/chunk-GU3VNMQ5.js.map +0 -1
  355. package/dist/chunk-H2NGR5JG.js.map +0 -1
  356. package/dist/chunk-K74UMEU4.js.map +0 -1
  357. package/dist/chunk-MFZ5FBS7.cjs.map +0 -1
  358. package/dist/chunk-QMLU5DST.cjs.map +0 -1
  359. package/dist/chunk-UZ5V4N7M.js.map +0 -1
  360. package/dist/chunk-VHHQX52U.cjs +0 -1
  361. package/dist/chunk-VHHQX52U.cjs.map +0 -1
  362. package/dist/chunk-WR6Z4I52.cjs.map +0 -1
  363. /package/dist/{chunk-FELTF5FF.js.map → chunk-GQYWT7BY.js.map} +0 -0
  364. /package/dist/{chunk-A4UPU5UE.js.map → chunk-XW7LMBMD.js.map} +0 -0
@@ -1,3 +1,9 @@
1
+ import {
2
+ Support
3
+ } from "./chunk-WZK3BIHG.js";
4
+ import {
5
+ ThreeDsRules
6
+ } from "./chunk-HJL32HDH.js";
1
7
  import {
2
8
  Users
3
9
  } from "./chunk-3NKFPZRS.js";
@@ -13,12 +19,18 @@ import {
13
19
  import {
14
20
  WhopResolutionCases
15
21
  } from "./chunk-OMGDHJYX.js";
22
+ import {
23
+ Search
24
+ } from "./chunk-UU3YQJT6.js";
25
+ import {
26
+ SellToRestrictions
27
+ } from "./chunk-G7FHCGT5.js";
16
28
  import {
17
29
  Settings
18
30
  } from "./chunk-LG7XHNAY.js";
19
31
  import {
20
32
  Settlement
21
- } from "./chunk-K74UMEU4.js";
33
+ } from "./chunk-UQDXXLLT.js";
22
34
  import {
23
35
  ShopLabels
24
36
  } from "./chunk-UH2A7ZDK.js";
@@ -32,11 +44,11 @@ import {
32
44
  Subscriptions
33
45
  } from "./chunk-7M2KEERO.js";
34
46
  import {
35
- Support
36
- } from "./chunk-WZK3BIHG.js";
47
+ ProfileAcquirers
48
+ } from "./chunk-VJ2L2GOF.js";
37
49
  import {
38
- ThreeDsRules
39
- } from "./chunk-HJL32HDH.js";
50
+ Profiles
51
+ } from "./chunk-DFC4T6FA.js";
40
52
  import {
41
53
  Projects
42
54
  } from "./chunk-QF3Q3TPV.js";
@@ -56,11 +68,11 @@ import {
56
68
  Routing
57
69
  } from "./chunk-B72YNBLS.js";
58
70
  import {
59
- Search
60
- } from "./chunk-UU3YQJT6.js";
71
+ PayoutDestinations
72
+ } from "./chunk-ZYWW275O.js";
61
73
  import {
62
- SellToRestrictions
63
- } from "./chunk-G7FHCGT5.js";
74
+ Payouts
75
+ } from "./chunk-DO2DYNFW.js";
64
76
  import {
65
77
  PaypalDisputes
66
78
  } from "./chunk-US6R4TM4.js";
@@ -80,17 +92,17 @@ import {
80
92
  Products
81
93
  } from "./chunk-HO3SKXCG.js";
82
94
  import {
83
- ProfileAcquirers
84
- } from "./chunk-VJ2L2GOF.js";
85
- import {
86
- Profiles
87
- } from "./chunk-DFC4T6FA.js";
95
+ Mandates
96
+ } from "./chunk-KKKEARPT.js";
88
97
  import {
89
98
  MerchantAccounts
90
99
  } from "./chunk-THPCSJUP.js";
91
100
  import {
92
101
  MessageTemplates
93
102
  } from "./chunk-V3PCNGDH.js";
103
+ import {
104
+ Notices
105
+ } from "./chunk-4FOFD2A3.js";
94
106
  import {
95
107
  OperationLimits
96
108
  } from "./chunk-KAKDDX4L.js";
@@ -104,11 +116,8 @@ import {
104
116
  Payments
105
117
  } from "./chunk-CSY3IZOC.js";
106
118
  import {
107
- PayoutDestinations
108
- } from "./chunk-ZYWW275O.js";
109
- import {
110
- Payouts
111
- } from "./chunk-DO2DYNFW.js";
119
+ Fees
120
+ } from "./chunk-4T3MXBO2.js";
112
121
  import {
113
122
  Files
114
123
  } from "./chunk-ZX4JTR2J.js";
@@ -131,8 +140,8 @@ import {
131
140
  Live
132
141
  } from "./chunk-7QGASY6O.js";
133
142
  import {
134
- Mandates
135
- } from "./chunk-KKKEARPT.js";
143
+ Customers
144
+ } from "./chunk-LZUHCGJ3.js";
136
145
  import {
137
146
  Branding
138
147
  } from "./chunk-Q6HI2G7W.js";
@@ -154,9 +163,6 @@ import {
154
163
  import {
155
164
  FeatureMatrix
156
165
  } from "./chunk-OEKPQXXM.js";
157
- import {
158
- Fees
159
- } from "./chunk-4T3MXBO2.js";
160
166
  import {
161
167
  Cards
162
168
  } from "./chunk-55XO7BFC.js";
@@ -171,16 +177,16 @@ import {
171
177
  } from "./chunk-GEYCGYAN.js";
172
178
  import {
173
179
  CheckoutTemplates
174
- } from "./chunk-BEND2MZX.js";
180
+ } from "./chunk-4Y3NBXOF.js";
175
181
  import {
176
182
  Connectors
177
183
  } from "./chunk-F6JABQLJ.js";
184
+ import {
185
+ ContentEncryption
186
+ } from "./chunk-3MS2HPSJ.js";
178
187
  import {
179
188
  CostRules
180
189
  } from "./chunk-FZYEZLTM.js";
181
- import {
182
- Customers
183
- } from "./chunk-LZUHCGJ3.js";
184
190
  import {
185
191
  Authentication
186
192
  } from "./chunk-JPVR2NHV.js";
@@ -222,7 +228,7 @@ import {
222
228
  } from "./chunk-DECN4QU3.js";
223
229
  import {
224
230
  DelopayCore
225
- } from "./chunk-H2NGR5JG.js";
231
+ } from "./chunk-UUZ5TSEX.js";
226
232
 
227
233
  // src/client.ts
228
234
  var Delopay = class extends DelopayCore {
@@ -276,6 +282,7 @@ var Delopay = class extends DelopayCore {
276
282
  this.live = new Live(request, openStream);
277
283
  this.processorImports = new ProcessorImports(request, openStream);
278
284
  this.branding = new Branding(request, this.baseUrl);
285
+ this.contentEncryption = new ContentEncryption(request);
279
286
  this.subscriptions = new Subscriptions(request);
280
287
  this.buyerPortal = new BuyerPortal(request);
281
288
  this.buyerAccount = new BuyerAccount(request);
@@ -291,6 +298,7 @@ var Delopay = class extends DelopayCore {
291
298
  this.shopLabels = new ShopLabels(request);
292
299
  this.industries = new Industries(request);
293
300
  this.payoutDestinations = new PayoutDestinations(request);
301
+ this.notices = new Notices(request);
294
302
  this.checkoutTemplates = new CheckoutTemplates(request);
295
303
  this.buyerConversations = new BuyerConversations(request);
296
304
  this.buyerEvidence = new BuyerEvidenceReviews(request);
@@ -317,4 +325,4 @@ Delopay.webhooks = Webhooks;
317
325
  export {
318
326
  Delopay
319
327
  };
320
- //# sourceMappingURL=chunk-UZ5V4N7M.js.map
328
+ //# sourceMappingURL=chunk-7M32LYPT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client.ts"],"sourcesContent":["import { DelopayCore } from './core';\nimport type { DelopayOptions } from './core';\nimport { ApiKeys } from './resources/apiKeys';\nimport { Authentication } from './resources/authentication';\nimport { Billing } from './resources/billing';\nimport { Connectors } from './resources/connectors';\nimport { Customers } from './resources/customers';\nimport { Disputes } from './resources/disputes';\nimport { ChargebackPrevention } from './resources/chargebackPrevention';\nimport { PaypalDisputes } from './resources/paypalDisputes';\nimport { WhopResolutionCases } from './resources/whopResolutionCases';\nimport { EphemeralKeys } from './resources/ephemeralKeys';\nimport { Events } from './resources/events';\nimport { Fees } from './resources/fees';\nimport { Mandates } from './resources/mandates';\nimport { MerchantAccounts } from './resources/merchantAccounts';\nimport { PaymentLinks } from './resources/paymentLinks';\nimport { PaymentMethods } from './resources/paymentMethods';\nimport { Payments } from './resources/payments';\nimport { Payouts } from './resources/payouts';\nimport { Poll } from './resources/poll';\nimport { ProfileAcquirers } from './resources/profileAcquirers';\nimport { Profiles } from './resources/profiles';\nimport { Projects } from './resources/projects';\nimport { Refunds } from './resources/refunds';\nimport { Relay } from './resources/relay';\nimport { Routing } from './resources/routing';\nimport { Search } from './resources/search';\nimport { AiTools } from './resources/aiTools';\nimport { Shops } from './resources/shops';\nimport { StripeConnect } from './resources/stripeConnect';\nimport { ThreeDsRules } from './resources/threeDsRules';\nimport { Users } from './resources/users';\nimport { Verification } from './resources/verification';\nimport { IdentityVerifications } from './resources/identityVerifications';\nimport { Webhooks } from './resources/webhooks';\nimport { Analytics } from './resources/analytics';\nimport { AnalyticsDashboard } from './resources/analyticsDashboard';\nimport { Cards } from './resources/cards';\nimport { Export } from './resources/export';\nimport { FeatureMatrix } from './resources/featureMatrix';\nimport { Files } from './resources/files';\nimport { Forex } from './resources/forex';\nimport { Regions } from './resources/regions';\nimport { AvailabilityOverrides } from './resources/availabilityOverrides';\nimport { SellToRestrictions } from './resources/sellToRestrictions';\nimport { VatRates } from './resources/vatRates';\nimport { BuyerBlocklist } from './resources/buyerBlocklist';\nimport { Persons } from './resources/persons';\nimport { ShopLabels } from './resources/shopLabels';\nimport { Industries } from './resources/industries';\nimport { PayoutDestinations } from './resources/payoutDestinations';\nimport { Notices } from './resources/notices';\nimport { CheckoutTemplates } from './resources/checkoutTemplates';\nimport { BuyerConversations } from './resources/buyerConversations';\nimport { BuyerEvidenceReviews } from './resources/buyerEvidenceReviews';\nimport { CheckoutRecovery } from './resources/checkoutRecovery';\nimport { CostRules } from './resources/costRules';\nimport { ExternalRecords } from './resources/externalRecords';\nimport { Products } from './resources/products';\nimport { Support } from './resources/support';\nimport { Invoices } from './resources/invoices';\nimport { InvoiceSettingsResource } from './resources/invoiceSettings';\nimport { ProcessorCosts } from './resources/processorCosts';\nimport { CheckoutMethods } from './resources/checkoutMethods';\nimport { Subscriptions } from './resources/subscriptions';\nimport { BuyerAccount } from './resources/buyerAccount';\nimport { BuyerPortal } from './resources/buyerPortal';\nimport { Audit } from './resources/audit';\nimport { Settlement } from './resources/settlement';\nimport { OperationLimits } from './resources/operationLimits';\nimport { Settings } from './resources/settings';\nimport { MessageTemplates } from './resources/messageTemplates';\nimport { Risk } from './resources/risk';\nimport { Live } from './resources/live';\nimport { ProcessorImports } from './resources/processorImports';\nimport { Branding } from './resources/deploymentBranding';\nimport { ContentEncryption } from './resources/contentEncryption';\n\nexport * from './core';\n\n/**\n * Delopay API client.\n *\n * Instantiate once with your API key and reuse across your application.\n * All resource sub-clients (payments, refunds, customers, …) are exposed\n * as properties on the instance.\n *\n * Every resource is in the bundle of an application that uses this class. A\n * browser application that wants only the resources it calls uses\n * {@link DelopayCore} instead.\n *\n * @example\n * ```typescript\n * const delopay = new Delopay('prd_...', { sandbox: false });\n * const payment = await delopay.payments.create({ amount: 5000, currency: 'EUR' });\n * ```\n */\nexport class Delopay extends DelopayCore {\n /** Utility for verifying incoming webhook signatures (static, no instance needed). */\n static webhooks = Webhooks;\n\n // Merchant-facing\n readonly payments: Payments;\n readonly refunds: Refunds;\n readonly customers: Customers;\n readonly paymentMethods: PaymentMethods;\n readonly paymentLinks: PaymentLinks;\n readonly mandates: Mandates;\n readonly disputes: Disputes;\n readonly chargebackPrevention: ChargebackPrevention;\n readonly paypalDisputes: PaypalDisputes;\n readonly whopResolutionCases: WhopResolutionCases;\n /** Import refunds and disputes from connected processor accounts. */\n readonly processorImports: ProcessorImports;\n readonly payouts: Payouts;\n readonly ephemeralKeys: EphemeralKeys;\n readonly events: Events;\n readonly poll: Poll;\n\n // Connector / routing\n readonly connectors: Connectors;\n readonly routing: Routing;\n readonly profiles: Profiles;\n readonly shops: Shops;\n readonly profileAcquirers: ProfileAcquirers;\n\n // Authentication & verification\n readonly authentication: Authentication;\n readonly verification: Verification;\n readonly identityVerifications: IdentityVerifications;\n\n // Dashboard / internal\n readonly users: Users;\n readonly apiKeys: ApiKeys;\n readonly billing: Billing;\n readonly fees: Fees;\n readonly merchantAccounts: MerchantAccounts;\n readonly projects: Projects;\n readonly relay: Relay;\n readonly stripeConnect: StripeConnect;\n readonly threeDsRules: ThreeDsRules;\n /**\n * A merchant's own audit log. Needs a dashboard JWT, not an API key —\n * see {@link Audit}.\n */\n readonly audit: Audit;\n readonly settlement: Settlement;\n readonly operationLimits: OperationLimits;\n /** Every setting of the merchant, its projects and its shops, audited per change. */\n readonly settings: Settings;\n /** A shop's own texts of the emails it sends its buyers. */\n readonly messageTemplates: MessageTemplates;\n readonly risk: Risk;\n /**\n * Live updates of the dashboard: the stream of what changed and the\n * versions a save names in `If-Match`. Needs a dashboard JWT — see\n * {@link Live}.\n */\n readonly live: Live;\n /**\n * The deployment's branding (name, logos, favicon, default checkout\n * colours) as the operator saved it. Public: no credential is needed.\n */\n readonly branding: Branding;\n /**\n * Whether the deployment stores new messages and uploaded files encrypted\n * with its own key. Public: no credential is needed.\n */\n readonly contentEncryption: ContentEncryption;\n\n // New resources (Phases 3-4)\n readonly subscriptions: Subscriptions;\n /** Buyer portal grant access. Construct a separate client with the portal token. */\n readonly buyerPortal: BuyerPortal;\n /**\n * The buyer account: email sign-in, and purchases across merchants.\n * Construct a separate client with the buyer account session token for\n * everything after the sign-in.\n */\n readonly buyerAccount: BuyerAccount;\n readonly files: Files;\n readonly export: Export;\n readonly forex: Forex;\n readonly regions: Regions;\n readonly availabilityOverrides: AvailabilityOverrides;\n readonly sellToRestrictions: SellToRestrictions;\n /** The platform VAT rate table buyer tax charges from, read-only. */\n readonly vatRates: VatRates;\n /** Buyers the merchant refuses to sell to again (email, IP, customer, device, card, BIN), with Stripe Radar sync. */\n readonly buyerBlocklist: BuyerBlocklist;\n /** The merchant's payments grouped by the person behind them. */\n readonly persons: Persons;\n /** The merchant's labels for grouping shops, several per shop. */\n readonly shopLabels: ShopLabels;\n /** The industry of the merchant, its projects and its shops, with what each inherits. */\n readonly industries: Industries;\n /** Payouts: how team members want to be paid. Moves no money. */\n readonly payoutDestinations: PayoutDestinations;\n /** Notices a merchant's people send each other. */\n readonly notices: Notices;\n /** Payment methods, behaviour and smart routing defined once and used in many shops. */\n readonly checkoutTemplates: CheckoutTemplates;\n /** Conversations between buyers and the shop's team: the team inbox. */\n readonly buyerConversations: BuyerConversations;\n /** The evidence buyers hand in for the shop's cases, as the shop's team reviews it. */\n readonly buyerEvidence: BuyerEvidenceReviews;\n readonly checkoutRecovery: CheckoutRecovery;\n readonly costRules: CostRules;\n\n /** Out-of-band transitions a PSP made that DeloPay never observed. */\n readonly externalRecords: ExternalRecords;\n\n /** A shop's product catalogue: what it sells, and at which prices. */\n readonly products: Products;\n /** Conversations with DeloPay's support team. */\n readonly support: Support;\n /** The invoices and credit notes the merchant issues to its buyers. */\n readonly invoices: Invoices;\n /** How those invoices look and are taxed: the merchant default and each shop's override. */\n readonly invoiceSettings: InvoiceSettingsResource;\n /** What the merchant's own processor charges it — see {@link ProcessorCosts}. */\n readonly processorCosts: ProcessorCosts;\n readonly checkoutMethods: CheckoutMethods;\n readonly analytics: Analytics;\n readonly analyticsDashboard: AnalyticsDashboard;\n readonly featureMatrix: FeatureMatrix;\n readonly cards: Cards;\n readonly search: Search;\n /** AI tools working in the account through the MCP server: their confirmations and connections. */\n readonly aiTools: AiTools;\n\n /**\n * Create a new Delopay client.\n *\n * @param apiKey - Your Delopay API key (e.g. `prd_...` or `snd_...`).\n * Pass an empty string or omit for JWT-only usage (e.g. dashboard apps).\n * @param options - Optional configuration (sandbox mode, base URL override, timeout).\n */\n constructor(apiKey?: string, options?: DelopayOptions) {\n super(apiKey, options);\n const { request, openStream } = this.transport;\n\n // Merchant-facing\n this.payments = new Payments(request);\n this.refunds = new Refunds(request);\n this.customers = new Customers(request);\n this.paymentMethods = new PaymentMethods(request);\n this.paymentLinks = new PaymentLinks(request);\n this.mandates = new Mandates(request);\n this.disputes = new Disputes(request);\n this.chargebackPrevention = new ChargebackPrevention(request);\n this.paypalDisputes = new PaypalDisputes(request);\n this.whopResolutionCases = new WhopResolutionCases(request);\n this.payouts = new Payouts(request);\n this.ephemeralKeys = new EphemeralKeys(request);\n this.events = new Events(request);\n this.poll = new Poll(request);\n\n // Connector / routing\n this.connectors = new Connectors(request);\n this.routing = new Routing(request);\n this.profiles = new Profiles(request);\n this.shops = new Shops(request);\n this.profileAcquirers = new ProfileAcquirers(request);\n\n // Authentication & verification\n this.authentication = new Authentication(request);\n this.verification = new Verification(request);\n this.identityVerifications = new IdentityVerifications(request);\n\n // Dashboard / internal\n this.users = new Users(request);\n this.apiKeys = new ApiKeys(request);\n this.billing = new Billing(request);\n this.fees = new Fees(request);\n this.merchantAccounts = new MerchantAccounts(request);\n this.projects = new Projects(request);\n this.relay = new Relay(request);\n this.stripeConnect = new StripeConnect(request);\n this.threeDsRules = new ThreeDsRules(request);\n this.audit = new Audit(request);\n this.settlement = new Settlement(request);\n this.operationLimits = new OperationLimits(request);\n this.settings = new Settings(request);\n this.messageTemplates = new MessageTemplates(request);\n this.risk = new Risk(request);\n this.live = new Live(request, openStream);\n this.processorImports = new ProcessorImports(request, openStream);\n this.branding = new Branding(request, this.baseUrl);\n this.contentEncryption = new ContentEncryption(request);\n\n // New resources (Phases 3-4)\n this.subscriptions = new Subscriptions(request);\n this.buyerPortal = new BuyerPortal(request);\n this.buyerAccount = new BuyerAccount(request);\n this.files = new Files(request);\n this.export = new Export(request);\n this.forex = new Forex(request);\n this.regions = new Regions(request);\n this.availabilityOverrides = new AvailabilityOverrides(request);\n this.sellToRestrictions = new SellToRestrictions(request);\n this.vatRates = new VatRates(request);\n this.buyerBlocklist = new BuyerBlocklist(request);\n this.persons = new Persons(request);\n this.shopLabels = new ShopLabels(request);\n this.industries = new Industries(request);\n this.payoutDestinations = new PayoutDestinations(request);\n this.notices = new Notices(request);\n this.checkoutTemplates = new CheckoutTemplates(request);\n this.buyerConversations = new BuyerConversations(request);\n this.buyerEvidence = new BuyerEvidenceReviews(request);\n this.checkoutRecovery = new CheckoutRecovery(request);\n this.costRules = new CostRules(request);\n this.externalRecords = new ExternalRecords(request);\n this.products = new Products(request);\n this.support = new Support(request);\n this.invoices = new Invoices(request);\n this.invoiceSettings = new InvoiceSettingsResource(request);\n this.processorCosts = new ProcessorCosts(request);\n this.checkoutMethods = new CheckoutMethods(request);\n this.analytics = new Analytics(request);\n this.analyticsDashboard = new AnalyticsDashboard(request);\n this.featureMatrix = new FeatureMatrix(request);\n this.cards = new Cards(request);\n this.search = new Search(request);\n this.aiTools = new AiTools(request);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGO,IAAM,UAAN,cAAsB,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA6IvC,YAAY,QAAiB,SAA0B;AACrD,UAAM,QAAQ,OAAO;AACrB,UAAM,EAAE,SAAS,WAAW,IAAI,KAAK;AAGrC,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,YAAY,IAAI,UAAU,OAAO;AACtC,SAAK,iBAAiB,IAAI,eAAe,OAAO;AAChD,SAAK,eAAe,IAAI,aAAa,OAAO;AAC5C,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,uBAAuB,IAAI,qBAAqB,OAAO;AAC5D,SAAK,iBAAiB,IAAI,eAAe,OAAO;AAChD,SAAK,sBAAsB,IAAI,oBAAoB,OAAO;AAC1D,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,gBAAgB,IAAI,cAAc,OAAO;AAC9C,SAAK,SAAS,IAAI,OAAO,OAAO;AAChC,SAAK,OAAO,IAAI,KAAK,OAAO;AAG5B,SAAK,aAAa,IAAI,WAAW,OAAO;AACxC,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9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qB,IAAI,mBAAmB,OAAO;AACxD,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,iBAAiB,IAAI,eAAe,OAAO;AAChD,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,aAAa,IAAI,WAAW,OAAO;AACxC,SAAK,aAAa,IAAI,WAAW,OAAO;AACxC,SAAK,qBAAqB,IAAI,mBAAmB,OAAO;AACxD,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,oBAAoB,IAAI,kBAAkB,OAAO;AACtD,SAAK,qBAAqB,IAAI,mBAAmB,OAAO;AACxD,SAAK,gBAAgB,IAAI,qBAAqB,OAAO;AACrD,SAAK,mBAAmB,IAAI,iBAAiB,OAAO;AACpD,SAAK,YAAY,IAAI,UAAU,OAAO;AACtC,SAAK,kBAAkB,IAAI,gBAAgB,OAAO;AAClD,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,UAAU,IAAI,QAAQ,OAAO;AAClC,SAAK,WAAW,IAAI,SAAS,OAAO;AACpC,SAAK,kBAAkB,IAAI,wBAAwB,OAAO;AAC1D,SAAK,iBAAiB,IAAI,eAAe,OAAO;AAChD,SAAK,kBAAkB,IAAI,gBAAgB,OAAO;AAClD,SAAK,YAAY,IAAI,UAAU,OAAO;AACtC,SAAK,qBAAqB,IAAI,mBAAmB,OAAO;AACxD,SAAK,gBAAgB,IAAI,cAAc,OAAO;AAC9C,SAAK,QAAQ,IAAI,MAAM,OAAO;AAC9B,SAAK,SAAS,IAAI,OAAO,OAAO;AAChC,SAAK,UAAU,IAAI,QAAQ,OAAO;AAAA,EACpC;AACF;AAAA;AAtOa,QAEJ,WAAW;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-7QZCUXWB.cjs","../src/internal/resources/cache.ts"],"names":[],"mappings":"AAAA;ACEO,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,UAAA,CAAW,GAAA,EAA+C;AAC9D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,GAAG,CAAC,CAAA,CAAA;AAC1E,EAAA;AACF;ADC6E;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-7QZCUXWB.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-7QZCUXWB.cjs","../src/internal/resources/cache.ts"],"names":[],"mappings":"AAAA;ACEO,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,UAAA,CAAW,GAAA,EAA+C;AAC9D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,GAAG,CAAC,CAAA,CAAA;AAC1E,EAAA;AACF;ADC6E;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-7QZCUXWB.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\n\nexport class Cache {\n constructor(private readonly request: RequestFn) {}\n\n /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */\n async invalidate(key: string): Promise<Record<string, unknown>> {\n return this.request('POST', `/cache/invalidate/${encodeURIComponent(key)}`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-7VXF5D67.cjs","../src/internal/resources/gsm.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,IAAA,EAAN,MAAU;AAAA,EACf,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAAwD;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,MAAA,EAAQ,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtD;AAAA,EAEA,MAAM,QAAA,CAAS,MAAA,EAA2D;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,EAAY,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC1D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAAwD;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC7D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAA2D;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC7D;AACF,CAAA;ADHA;AACA;AACE;AACF,kBAAC","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-7VXF5D67.cjs","sourcesContent":[null,"import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-7VXF5D67.cjs","../src/internal/resources/gsm.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,IAAA,EAAN,MAAU;AAAA,EACf,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAAwD;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,MAAA,EAAQ,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtD;AAAA,EAEA,MAAM,QAAA,CAAS,MAAA,EAA2D;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,EAAY,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC1D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAAwD;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC7D;AAAA,EAEA,MAAM,MAAA,CAAO,MAAA,EAA2D;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC7D;AACF,CAAA;ADHA;AACA;AACE;AACF,kBAAC","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-7VXF5D67.cjs","sourcesContent":[null,"import type { GsmRuleCreateRequest, GsmRuleResponse, GsmRuleUpdateRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class Gsm {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: GsmRuleCreateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm', { body: params });\n }\n\n async retrieve(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/get', { body: params });\n }\n\n async update(params: GsmRuleUpdateRequest): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/update', { body: params });\n }\n\n async delete(params: Record<string, unknown>): Promise<GsmRuleResponse> {\n return this.request('POST', '/gsm/delete', { body: params });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","../src/resources/sellToRestrictions.ts"],"names":[],"mappings":"AAAA;ACsBO,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,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAA,CACJ,MAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gCAAA,EAAkC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAA,CACJ,SAAA,EACA,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,4BAAA,EAA+B,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC/E,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUkC,EAAA;AACpB,IAAA;AACV,MAAA;AAC4D,MAAA;AAC5D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAM4E,EAAA;AACM,IAAA;AAClF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaqC,EAAA;AAC6C,IAAA;AACxE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC+D,MAAA;AAC/D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQgG,EAAA;AAClF,IAAA;AACV,MAAA;AAC2E,MAAA;AAC7E,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAChD,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAC3E,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqE,EAAA;AACJ,IAAA;AACjE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOoF,EAAA;AACtE,IAAA;AACV,MAAA;AAC+D,MAAA;AACjE,IAAA;AACF,EAAA;AACF;ADtD4F;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","sourcesContent":[null,"import type {\n ConnectorSellToRestriction,\n ProjectSellToRestriction,\n SellToRestrictionCapabilitiesResponse,\n SellToRestrictionDecisionsResponse,\n SellToRestrictionPolicyRequest,\n SellToRestrictionsResponse,\n ShopSellToRestriction,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Sell-to restrictions: the buyer countries a merchant refuses to sell to,\n * merchant-wide, per project and per shop. A refused payment fails with error\n * code `DE_10`.\n *\n * Every route needs a dashboard session. Reading needs the `SellToRestrictions`\n * area at `Read`, overriding a shop needs `Edit` (a shop-scoped role may\n * override only its own shop), a project's policy needs `Edit` at merchant\n * level (no shop-scoped role, project members included), and changing the\n * merchant-wide policy needs `Write`.\n */\nexport class SellToRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant-wide policy and every shop's effective policy. A caller\n * scoped to one shop receives that shop alone, and no merchant-wide policy.\n * `GET /sell-to-restrictions`\n */\n async retrieve(): Promise<SellToRestrictionsResponse> {\n return this.request('GET', '/sell-to-restrictions');\n }\n\n /**\n * Replace the merchant-wide policy every shop without an override inherits.\n * The change is recorded in the audit log before it is made.\n * `PUT /sell-to-restrictions/merchant`\n */\n async updateMerchantPolicy(\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<SellToRestrictionsResponse> {\n return this.request('PUT', '/sell-to-restrictions/merchant', { body: params, ...options });\n }\n\n /**\n * Give one shop its own policy, replacing the merchant-wide policy for that\n * shop. An empty `blocked_countries` lifts every restriction for it.\n * `PUT /sell-to-restrictions/shops/{profile_id}`\n */\n async updateShopOverride(\n profileId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's override, so it inherits the merchant-wide policy again.\n * Removing an override the shop does not have changes nothing.\n * `DELETE /sell-to-restrictions/shops/{profile_id}`\n */\n async deleteShopOverride(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,\n options,\n );\n }\n\n /**\n * One project's own policy, if it has one.\n * `GET /sell-to-restrictions/projects/{project_id}`\n */\n async retrieveProject(projectId: string): Promise<ProjectSellToRestriction> {\n return this.request('GET', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`);\n }\n\n /**\n * Give one project its own policy. It replaces the merchant-wide policy for\n * every shop of the project's subtree without an override or a nearer\n * project policy, from their next payment on. An empty `blocked_countries`\n * lifts every restriction for them. Recorded in the audit log first.\n * `PUT /sell-to-restrictions/projects/{project_id}`\n */\n async updateProjectPolicy(\n projectId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one project's policy, so its subtree inherits from above again.\n * Removing a policy the project does not have changes nothing.\n * `DELETE /sell-to-restrictions/projects/{project_id}`\n */\n async deleteProjectPolicy(\n projectId: string,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`,\n options,\n );\n }\n\n /**\n * One payment connector account's own policy, and which buyer\n * signals its payments can be judged on. Needs the merchant-level `Read`\n * rung; a shop-scoped role is refused.\n * `GET /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async retrieveConnectorPolicy(merchantConnectorId: string): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Give one payment connector account its own policy. It applies on top of\n * each shop's policy, in every shop the account serves, from the next\n * payment on: a buyer it refuses is routed to another account of the shop.\n * Needs the merchant-wide `Write` rung and write visibility for the\n * processor; recorded in the audit log first.\n * `PUT /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async updateConnectorPolicy(\n merchantConnectorId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'PUT',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Remove one connector account's own policy; each shop's policy still\n * applies. Removing a policy the account does not have changes nothing.\n * `DELETE /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async deleteConnectorPolicy(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n options,\n );\n }\n\n /**\n * Which checks each payment path performs, and how this deployment resolves\n * a buyer's country — read before relying on a restriction for a path.\n * `GET /sell-to-restrictions/capabilities`\n */\n async capabilities(): Promise<SellToRestrictionCapabilitiesResponse> {\n return this.request('GET', '/sell-to-restrictions/capabilities');\n }\n\n /**\n * Why a payment was refused: where, by which signal, for which country and\n * under which policy. A shop-scoped caller sees only refusals in its shop.\n * `GET /sell-to-restrictions/payments/{payment_id}/decisions`\n */\n async listDecisions(paymentId: string): Promise<SellToRestrictionDecisionsResponse> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","../src/resources/sellToRestrictions.ts"],"names":[],"mappings":"AAAA;ACsBO,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,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAA,CACJ,MAAA,EACA,OAAA,EACqC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AAA;AAAA;AAAA;AAAA;AAOoF,EAAA;AACtE,IAAA;AACV,MAAA;AAC+D,MAAA;AACjE,IAAA;AACF,EAAA;AACF;ADtD4F;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","sourcesContent":[null,"import type {\n ConnectorSellToRestriction,\n ProjectSellToRestriction,\n SellToRestrictionCapabilitiesResponse,\n SellToRestrictionDecisionsResponse,\n SellToRestrictionPolicyRequest,\n SellToRestrictionsResponse,\n ShopSellToRestriction,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Sell-to restrictions: the buyer countries a merchant refuses to sell to,\n * merchant-wide, per project and per shop. A refused payment fails with error\n * code `DE_10`.\n *\n * Every route needs a dashboard session. Reading needs the `SellToRestrictions`\n * area at `Read`, overriding a shop needs `Edit` (a shop-scoped role may\n * override only its own shop), a project's policy needs `Edit` at merchant\n * level (no shop-scoped role, project members included), and changing the\n * merchant-wide policy needs `Write`.\n */\nexport class SellToRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant-wide policy and every shop's effective policy. A caller\n * scoped to one shop receives that shop alone, and no merchant-wide policy.\n * `GET /sell-to-restrictions`\n */\n async retrieve(): Promise<SellToRestrictionsResponse> {\n return this.request('GET', '/sell-to-restrictions');\n }\n\n /**\n * Replace the merchant-wide policy every shop without an override inherits.\n * The change is recorded in the audit log before it is made.\n * `PUT /sell-to-restrictions/merchant`\n */\n async updateMerchantPolicy(\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<SellToRestrictionsResponse> {\n return this.request('PUT', '/sell-to-restrictions/merchant', { body: params, ...options });\n }\n\n /**\n * Give one shop its own policy, replacing the merchant-wide policy for that\n * shop. An empty `blocked_countries` lifts every restriction for it.\n * `PUT /sell-to-restrictions/shops/{profile_id}`\n */\n async updateShopOverride(\n profileId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's override, so it inherits the merchant-wide policy again.\n * Removing an override the shop does not have changes nothing.\n * `DELETE /sell-to-restrictions/shops/{profile_id}`\n */\n async deleteShopOverride(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,\n options,\n );\n }\n\n /**\n * One project's own policy, if it has one.\n * `GET /sell-to-restrictions/projects/{project_id}`\n */\n async retrieveProject(projectId: string): Promise<ProjectSellToRestriction> {\n return this.request('GET', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`);\n }\n\n /**\n * Give one project its own policy. It replaces the merchant-wide policy for\n * every shop of the project's subtree without an override or a nearer\n * project policy, from their next payment on. An empty `blocked_countries`\n * lifts every restriction for them. Recorded in the audit log first.\n * `PUT /sell-to-restrictions/projects/{project_id}`\n */\n async updateProjectPolicy(\n projectId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one project's policy, so its subtree inherits from above again.\n * Removing a policy the project does not have changes nothing.\n * `DELETE /sell-to-restrictions/projects/{project_id}`\n */\n async deleteProjectPolicy(\n projectId: string,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`,\n options,\n );\n }\n\n /**\n * One payment connector account's own policy, and which buyer\n * signals its payments can be judged on. Needs the merchant-level `Read`\n * rung; a shop-scoped role is refused.\n * `GET /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async retrieveConnectorPolicy(merchantConnectorId: string): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Give one payment connector account its own policy. It applies on top of\n * each shop's policy, in every shop the account serves, from the next\n * payment on: a buyer it refuses is routed to another account of the shop.\n * Needs the merchant-wide `Write` rung and write visibility for the\n * processor; recorded in the audit log first.\n * `PUT /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async updateConnectorPolicy(\n merchantConnectorId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'PUT',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Remove one connector account's own policy; each shop's policy still\n * applies. Removing a policy the account does not have changes nothing.\n * `DELETE /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async deleteConnectorPolicy(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n options,\n );\n }\n\n /**\n * Which checks each payment path performs, and how this deployment resolves\n * a buyer's country — read before relying on a restriction for a path.\n * `GET /sell-to-restrictions/capabilities`\n */\n async capabilities(): Promise<SellToRestrictionCapabilitiesResponse> {\n return this.request('GET', '/sell-to-restrictions/capabilities');\n }\n\n /**\n * Why a payment was refused: where, by which signal, for which country and\n * under which policy. A shop-scoped caller sees only refusals in its shop.\n * `GET /sell-to-restrictions/payments/{payment_id}/decisions`\n */\n async listDecisions(paymentId: string): Promise<SellToRestrictionDecisionsResponse> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`,\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","../src/internal/resources/adminFileScans.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACYO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAA,EAAkC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,KAAA,EAA+B,CAAC,CAAA,EAA8B;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAA,CAAQ,MAAA,EAA0B,CAAC,CAAA,EAA6B;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kCAAA,EAAoC;AAAA,MAC7D,KAAA,EAAO,wCAAA,KAAS,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAC;AAAA,IACzC,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADXA;AACA;AACE;AACF,wCAAC","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n BlockedFileList,\n BlockedFileQuery,\n FileScannerCheck,\n FileScannerTestRequest,\n FileScanStatus,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\n/**\n * Malware scanning of uploaded files: buyer evidence, buyer conversation\n * attachments and support attachments. The scanner's status and its test\n * need an operator who may change operations settings; the list of blocked\n * files takes any internal platform-operator role (`403` otherwise).\n */\nexport class AdminFileScans {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The scanner settings in force and where they come from, a check of the\n * scanner made for this answer, when it last finished a file and how many\n * files wait for their scan. `GET /admin-portal/file-scans/status`\n */\n async status(): Promise<FileScanStatus> {\n return this.request('GET', '/admin-portal/file-scans/status');\n }\n\n /**\n * Ask a scanner whether it answers, before it is saved. Only the connection\n * is tested: no file content is sent. A field left out takes the value in\n * force. An address outside the deployment's private network is refused\n * without a connection (`problem: 'public_address'`).\n * `POST /admin-portal/file-scans/test`\n */\n async test(body: FileScannerTestRequest = {}): Promise<FileScannerCheck> {\n return this.request('POST', '/admin-portal/file-scans/test', { body });\n }\n\n /**\n * Uploaded files their scan blocked, of every kind, latest result first\n * unless `sort_by` says otherwise, with what the scanner found. Several\n * `kind` or `side` values match a file with any of them. A blocked file's\n * content is never handed out. `GET /admin-portal/file-scans/blocked`\n */\n async blocked(query: BlockedFileQuery = {}): Promise<BlockedFileList> {\n return this.request('GET', '/admin-portal/file-scans/blocked', {\n query: csvQuery(query, ['kind', 'side']),\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","../src/internal/resources/adminFileScans.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACYO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAA,EAAkC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,KAAA,EAA+B,CAAC,CAAA,EAA8B;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAA,CAAQ,MAAA,EAA0B,CAAC,CAAA,EAA6B;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kCAAA,EAAoC;AAAA,MAC7D,KAAA,EAAO,wCAAA,KAAS,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAC;AAAA,IACzC,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADXA;AACA;AACE;AACF,wCAAC","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n BlockedFileList,\n BlockedFileQuery,\n FileScannerCheck,\n FileScannerTestRequest,\n FileScanStatus,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\n/**\n * Malware scanning of uploaded files: buyer evidence, buyer conversation\n * attachments and support attachments. The scanner's status and its test\n * need an operator who may change operations settings; the list of blocked\n * files takes any internal platform-operator role (`403` otherwise).\n */\nexport class AdminFileScans {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The scanner settings in force and where they come from, a check of the\n * scanner made for this answer, when it last finished a file and how many\n * files wait for their scan. `GET /admin-portal/file-scans/status`\n */\n async status(): Promise<FileScanStatus> {\n return this.request('GET', '/admin-portal/file-scans/status');\n }\n\n /**\n * Ask a scanner whether it answers, before it is saved. Only the connection\n * is tested: no file content is sent. A field left out takes the value in\n * force. An address outside the deployment's private network is refused\n * without a connection (`problem: 'public_address'`).\n * `POST /admin-portal/file-scans/test`\n */\n async test(body: FileScannerTestRequest = {}): Promise<FileScannerCheck> {\n return this.request('POST', '/admin-portal/file-scans/test', { body });\n }\n\n /**\n * Uploaded files their scan blocked, of every kind, latest result first\n * unless `sort_by` says otherwise, with what the scanner found. Several\n * `kind` or `side` values match a file with any of them. A blocked file's\n * content is never handed out. `GET /admin-portal/file-scans/blocked`\n */\n async blocked(query: BlockedFileQuery = {}): Promise<BlockedFileList> {\n return this.request('GET', '/admin-portal/file-scans/blocked', {\n query: csvQuery(query, ['kind', 'side']),\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-BCA3TCGS.cjs","../src/internal/resources/platformBilling.ts"],"names":[],"mappings":"AAAA;ACuBO,IAAM,gBAAA,EAAN,MAAsB;AAAA,EAC3B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,MAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,aAAA,CAAA,EAAiB;AAAA,MACrF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,KAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,YAAA,CAAA,EAAgB;AAAA,MACpF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,eAAA,CACJ,UAAA,EACA,QAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,OAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,cAAA,EAAiB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AACxE,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASgG,EAAA;AAClF,IAAA;AACV,MAAA;AACuF,MAAA;AACzF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWgG,EAAA;AACN,IAAA;AAChF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcmC,EAAA;AACyD,IAAA;AAClF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcmC,EAAA;AACwD,IAAA;AACjF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBmC,EAAA;AACsC,IAAA;AAC/D,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAegG,EAAA;AACR,IAAA;AAC9E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBqC,EAAA;AACsD,IAAA;AACjF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBsC,EAAA;AACmD,IAAA;AAC/E,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADvD8F;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-BCA3TCGS.cjs","sourcesContent":[null,"import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminCreateLedgerRequest,\n AdminCreateLedgerResponse,\n AdminResetLedgerRequest,\n AdminResetLedgerResponse,\n AdminSetFreeRequest,\n AdminSetHardFloorRequest,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n UpdateLedgerEntryRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Edit a single ledger entry (amount and/or description), keeping the\n * merchant balance consistent: when `amount` changes, the balance is\n * atomically adjusted by the difference. Returns the entry id and new\n * balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to edit.\n * @param params - New amount / description (either optional).\n */\n async editLedgerEntry(\n merchantId: string,\n ledgerId: string,\n params: UpdateLedgerEntryRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'PATCH',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete a single ledger entry, reversing its amount from the merchant\n * balance. Returns the deleted entry id and the new balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to delete.\n */\n async deleteLedgerEntry(merchantId: string, ledgerId: string): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'DELETE',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n );\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n\n /**\n * Set the merchant's hard floor — the balance at or below which the\n * merchant stops being active. A negative value grants a credit line; zero\n * means no negative balance at all. This moves the suspension line, it does\n * not remove it. The value and the caller are written to the audit log\n * before the floor changes, so the change is always attributable.\n *\n * Refused (412) for a positive amount, for a floor beyond the maximum\n * credit line of 10,000,000 minor units, or for an empty `reason`.\n *\n * Requires a router that serves the hard-floor admin route; older ones\n * answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The new floor (zero or negative) and the audit reason.\n * @returns The updated billing profile.\n */\n async setHardFloor(\n merchantId: string,\n params: AdminSetHardFloorRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/hard-floor`, {\n body: params,\n });\n }\n\n /**\n * Mark a merchant free (not billed), or put it back on the prepaid model.\n * While free, no platform fee is deducted, the payment gate never blocks on\n * billing status, top-ups are refused and auto-recharge is inert. Marking\n * free needs a `reason` and is refused (412) while an admin suspension is in\n * force — lift that first.\n *\n * Requires a router that supports the free flag; older ones answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired free state and, when marking free, the reason.\n * @returns The updated billing profile.\n */\n async setFree(merchantId: string, params: AdminSetFreeRequest): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/free`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant's **entire** ledger. Every live entry is soft-deleted —\n * kept, so a replayed fee deduction or top-up webhook still no-ops — the\n * balance is set to zero and the status re-derived (`active` for a free\n * merchant; an active paying merchant lands in `delinquent`). Refused (412)\n * while the merchant has shop allocations. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The reason, required for audit.\n * @returns What was removed and the post-reset profile.\n */\n async resetLedger(\n merchantId: string,\n params: AdminResetLedgerRequest,\n ): Promise<AdminResetLedgerResponse> {\n return this.request('DELETE', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n\n /**\n * (Re)create a merchant's ledger, optionally seeded with an opening\n * balance. Ensures the billing profile exists (created without the welcome\n * promo credit) and, when `opening_balance` is set, writes one\n * `opening_balance` entry through the same atomic helper an admin credit\n * uses. Refused (412) while live entries or a non-zero balance remain —\n * reset first. Does not clear the free flag. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Opening balance (minor units), currency for a new profile, and the reason.\n * @returns The opening entry id (if one was written) and the profile.\n */\n async createLedger(\n merchantId: string,\n params: AdminCreateLedgerRequest,\n ): Promise<AdminCreateLedgerResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-BCA3TCGS.cjs","../src/internal/resources/platformBilling.ts"],"names":[],"mappings":"AAAA;ACuBO,IAAM,gBAAA,EAAN,MAAsB;AAAA,EAC3B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,MAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,aAAA,CAAA,EAAiB;AAAA,MACrF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,KAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,YAAA,CAAA,EAAgB;AAAA,MACpF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,e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AoBsC,EAAA;AACmD,IAAA;AAC/E,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADvD8F;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-BCA3TCGS.cjs","sourcesContent":[null,"import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminCreateLedgerRequest,\n AdminCreateLedgerResponse,\n AdminResetLedgerRequest,\n AdminResetLedgerResponse,\n AdminSetFreeRequest,\n AdminSetHardFloorRequest,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n UpdateLedgerEntryRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Edit a single ledger entry (amount and/or description), keeping the\n * merchant balance consistent: when `amount` changes, the balance is\n * atomically adjusted by the difference. Returns the entry id and new\n * balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to edit.\n * @param params - New amount / description (either optional).\n */\n async editLedgerEntry(\n merchantId: string,\n ledgerId: string,\n params: UpdateLedgerEntryRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'PATCH',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete a single ledger entry, reversing its amount from the merchant\n * balance. Returns the deleted entry id and the new balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to delete.\n */\n async deleteLedgerEntry(merchantId: string, ledgerId: string): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'DELETE',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n );\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n\n /**\n * Set the merchant's hard floor — the balance at or below which the\n * merchant stops being active. A negative value grants a credit line; zero\n * means no negative balance at all. This moves the suspension line, it does\n * not remove it. The value and the caller are written to the audit log\n * before the floor changes, so the change is always attributable.\n *\n * Refused (412) for a positive amount, for a floor beyond the maximum\n * credit line of 10,000,000 minor units, or for an empty `reason`.\n *\n * Requires a router that serves the hard-floor admin route; older ones\n * answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The new floor (zero or negative) and the audit reason.\n * @returns The updated billing profile.\n */\n async setHardFloor(\n merchantId: string,\n params: AdminSetHardFloorRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/hard-floor`, {\n body: params,\n });\n }\n\n /**\n * Mark a merchant free (not billed), or put it back on the prepaid model.\n * While free, no platform fee is deducted, the payment gate never blocks on\n * billing status, top-ups are refused and auto-recharge is inert. Marking\n * free needs a `reason` and is refused (412) while an admin suspension is in\n * force — lift that first.\n *\n * Requires a router that supports the free flag; older ones answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired free state and, when marking free, the reason.\n * @returns The updated billing profile.\n */\n async setFree(merchantId: string, params: AdminSetFreeRequest): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/free`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant's **entire** ledger. Every live entry is soft-deleted —\n * kept, so a replayed fee deduction or top-up webhook still no-ops — the\n * balance is set to zero and the status re-derived (`active` for a free\n * merchant; an active paying merchant lands in `delinquent`). Refused (412)\n * while the merchant has shop allocations. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The reason, required for audit.\n * @returns What was removed and the post-reset profile.\n */\n async resetLedger(\n merchantId: string,\n params: AdminResetLedgerRequest,\n ): Promise<AdminResetLedgerResponse> {\n return this.request('DELETE', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n\n /**\n * (Re)create a merchant's ledger, optionally seeded with an opening\n * balance. Ensures the billing profile exists (created without the welcome\n * promo credit) and, when `opening_balance` is set, writes one\n * `opening_balance` entry through the same atomic helper an admin credit\n * uses. Refused (412) while live entries or a non-zero balance remain —\n * reset first. Does not clear the free flag. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Opening balance (minor units), currency for a new profile, and the reason.\n * @returns The opening entry id (if one was written) and the profile.\n */\n async createLedger(\n merchantId: string,\n params: AdminCreateLedgerRequest,\n ): Promise<AdminCreateLedgerResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-BP6KDQ6I.cjs","../src/resources/settings.ts"],"names":[],"mappings":"AAAA;ACqBA,SAAS,YAAA,CAAa,KAAA,EAAsD;AAC1E,EAAA,OAAO,KAAA,CAAM,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA,CAAM,WAAW,EAAA,EAAI,CAAC,CAAA;AAChE;AAEO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAiB,MAAA,EAA+B,CAAC,CAAA,EAA8B;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAA,EAAsB,EAAE,KAAA,EAAO,YAAA,CAAa,KAAK,EAAE,CAAC,CAAA;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,cAAA,CACJ,MAAA,EACA,MAAA,EAA+B,CAAC,CAAA,EACL;AAC3B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,oBAAA,EAAsB;AAAA,MACjD,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,YAAA,CAAa,KAAK;AAAA,IAC3B,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,YAAA,CAAa,SAAA,EAA8C;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8F,EAAA;AAChB,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADzBgF;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-BP6KDQ6I.cjs","sourcesContent":[null,"import type { MerchantSettingsQuery, SettingsResponse, UpdateSettingsRequest } from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Settings of the caller's merchant, its projects and its shops.\n *\n * One resource for every setting: each is a key with a JSON value, listed with\n * its default, whether a value is stored, its revision and who changed it last.\n * A merchant changes only its own values; values the platform operator sets at\n * the same scope are listed beside them (`authority: 'operator'`) and are\n * read-only here.\n *\n * Every change is recorded in the audit log with the previous and the new\n * value (`entity_type: 'setting'`), so one setting's history is\n * `audit.list({ entity_type: 'setting', entity_id })`.\n *\n * Dashboard (JWT) routes. Reading the merchant's settings needs\n * `MerchantAccountRead`, a shop's `ProfileAccountRead`; each change needs the\n * permission its setting names.\n */\n/** The query string of a merchant-scope call; a null project is omitted. */\nfunction projectQuery(query: MerchantSettingsQuery): Record<string, string> {\n return query.project_id ? { project_id: query.project_id } : {};\n}\n\nexport class Settings {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's settings, or one project's.\n *\n * `GET /settings/merchant`\n */\n async retrieveMerchant(query: MerchantSettingsQuery = {}): Promise<SettingsResponse> {\n return this.request('GET', '/settings/merchant', { query: projectQuery(query) });\n }\n\n /**\n * Change the merchant's own settings, or one project's. All changes are\n * applied or none is.\n *\n * `PATCH /settings/merchant`\n */\n async updateMerchant(\n params: UpdateSettingsRequest,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request('PATCH', '/settings/merchant', {\n body: params,\n query: projectQuery(query),\n });\n }\n\n /**\n * One shop's settings.\n *\n * `GET /settings/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<SettingsResponse> {\n return this.request('GET', `/settings/shops/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Change one shop's own settings.\n *\n * `PATCH /settings/shops/{profileId}`\n */\n async updateShop(profileId: string, params: UpdateSettingsRequest): Promise<SettingsResponse> {\n return this.request('PATCH', `/settings/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-BP6KDQ6I.cjs","../src/resources/settings.ts"],"names":[],"mappings":"AAAA;ACqBA,SAAS,YAAA,CAAa,KAAA,EAAsD;AAC1E,EAAA,OAAO,KAAA,CAAM,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA,CAAM,WAAW,EAAA,EAAI,CAAC,CAAA;AAChE;AAEO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAiB,MAAA,EAA+B,CAAC,CAAA,EAA8B;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAA,EAAsB,EAAE,KAAA,EAAO,YAAA,CAAa,KAAK,EAAE,CAAC,CAAA;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,cAAA,CACJ,MAAA,EACA,MAAA,EAA+B,CAAC,CAAA,EACL;AAC3B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,oBAAA,EAAsB;AAAA,MACjD,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,YAAA,CAAa,KAAK;AAAA,IAC3B,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,YAAA,CAAa,SAAA,EAA8C;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8F,EAAA;AAChB,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADzBgF;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-BP6KDQ6I.cjs","sourcesContent":[null,"import type { MerchantSettingsQuery, SettingsResponse, UpdateSettingsRequest } from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Settings of the caller's merchant, its projects and its shops.\n *\n * One resource for every setting: each is a key with a JSON value, listed with\n * its default, whether a value is stored, its revision and who changed it last.\n * A merchant changes only its own values; values the platform operator sets at\n * the same scope are listed beside them (`authority: 'operator'`) and are\n * read-only here.\n *\n * Every change is recorded in the audit log with the previous and the new\n * value (`entity_type: 'setting'`), so one setting's history is\n * `audit.list({ entity_type: 'setting', entity_id })`.\n *\n * Dashboard (JWT) routes. Reading the merchant's settings needs\n * `MerchantAccountRead`, a shop's `ProfileAccountRead`; each change needs the\n * permission its setting names.\n */\n/** The query string of a merchant-scope call; a null project is omitted. */\nfunction projectQuery(query: MerchantSettingsQuery): Record<string, string> {\n return query.project_id ? { project_id: query.project_id } : {};\n}\n\nexport class Settings {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's settings, or one project's.\n *\n * `GET /settings/merchant`\n */\n async retrieveMerchant(query: MerchantSettingsQuery = {}): Promise<SettingsResponse> {\n return this.request('GET', '/settings/merchant', { query: projectQuery(query) });\n }\n\n /**\n * Change the merchant's own settings, or one project's. All changes are\n * applied or none is.\n *\n * `PATCH /settings/merchant`\n */\n async updateMerchant(\n params: UpdateSettingsRequest,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request('PATCH', '/settings/merchant', {\n body: params,\n query: projectQuery(query),\n });\n }\n\n /**\n * One shop's settings.\n *\n * `GET /settings/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<SettingsResponse> {\n return this.request('GET', `/settings/shops/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Change one shop's own settings.\n *\n * `PATCH /settings/shops/{profileId}`\n */\n async updateShop(profileId: string, params: UpdateSettingsRequest): Promise<SettingsResponse> {\n return this.request('PATCH', `/settings/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-BRY3W7N3.cjs","../src/internal/resources/adminLive.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CACmB,OAAA,EACA,UAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,8CAAA,IAAe,CAAK,UAAA,EAAY,2BAAA,EAA6B,OAAO,CAAA;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,QAAA,CACJ,UAAA,EACA,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,6BAAA,EAA+B;AAAA,MACxD,KAAA,EAAO;AAAA,QACL,WAAA,EAAa,UAAA;AAAA,QACb,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADVA;AACA;AACE;AACF,8BAAC","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-BRY3W7N3.cjs","sourcesContent":[null,"import type { LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse } from '../../types';\nimport type { EventStreamFn, RequestExtras, RequestFn } from '../../client';\nimport { openLiveStream } from '../../resources/live';\nimport type { LiveEventStream } from '../../resources/live';\n\n/**\n * Live updates of the admin dashboard: the same events as\n * the merchant dashboard's `live`, for every merchant, and the versions an\n * admin editor names in `If-Match`. Needs an internal platform-operator JWT.\n */\nexport class AdminLive {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Open the stream of what changed in every merchant. Each change names its\n * `merchant_id`. The SDK does not reconnect — see `LiveEventStream`.\n *\n * `GET /admin-portal/live/stream`\n */\n async stream(options?: LiveStreamOptions): Promise<LiveEventStream> {\n return openLiveStream(this.openStream, '/admin-portal/live/stream', options);\n }\n\n /**\n * The versions an admin editor of `merchantId` names in `If-Match`. A save\n * over a newer version is refused with `IR_16` (400), `error.data` a\n * `LiveChangedElsewhere`.\n *\n * `GET /admin-portal/live/versions`\n */\n async versions(\n merchantId: string,\n params: LiveVersionsParams,\n options?: RequestExtras,\n ): Promise<LiveVersionsResponse> {\n return this.request('GET', '/admin-portal/live/versions', {\n query: {\n merchant_id: merchantId,\n entities: params.entities.join(','),\n profile_id: params.profile_id,\n record_id: params.record_id,\n },\n ...options,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-BRY3W7N3.cjs","../src/internal/resources/adminLive.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CACmB,OAAA,EACA,UAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,8CAAA,IAAe,CAAK,UAAA,EAAY,2BAAA,EAA6B,OAAO,CAAA;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,QAAA,CACJ,UAAA,EACA,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,6BAAA,EAA+B;AAAA,MACxD,KAAA,EAAO;AAAA,QACL,WAAA,EAAa,UAAA;AAAA,QACb,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADVA;AACA;AACE;AACF,8BAAC","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-BRY3W7N3.cjs","sourcesContent":[null,"import type { LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse } from '../../types';\nimport type { EventStreamFn, RequestExtras, RequestFn } from '../../client';\nimport { openLiveStream } from '../../resources/live';\nimport type { LiveEventStream } from '../../resources/live';\n\n/**\n * Live updates of the admin dashboard: the same events as\n * the merchant dashboard's `live`, for every merchant, and the versions an\n * admin editor names in `If-Match`. Needs an internal platform-operator JWT.\n */\nexport class AdminLive {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Open the stream of what changed in every merchant. Each change names its\n * `merchant_id`. The SDK does not reconnect — see `LiveEventStream`.\n *\n * `GET /admin-portal/live/stream`\n */\n async stream(options?: LiveStreamOptions): Promise<LiveEventStream> {\n return openLiveStream(this.openStream, '/admin-portal/live/stream', options);\n }\n\n /**\n * The versions an admin editor of `merchantId` names in `If-Match`. A save\n * over a newer version is refused with `IR_16` (400), `error.data` a\n * `LiveChangedElsewhere`.\n *\n * `GET /admin-portal/live/versions`\n */\n async versions(\n merchantId: string,\n params: LiveVersionsParams,\n options?: RequestExtras,\n ): Promise<LiveVersionsResponse> {\n return this.request('GET', '/admin-portal/live/versions', {\n query: {\n merchant_id: merchantId,\n entities: params.entities.join(','),\n profile_id: params.profile_id,\n record_id: params.record_id,\n },\n ...options,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-CAMALM35.cjs","../src/resources/buyerPortal.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,UAAA,CAAW,OAAA,EAAsD;AACrE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAA,EAAyB,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,SAAA,CA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JqG;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-CAMALM35.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n BuyerCaseList,\n BuyerConversationAttachment,\n BuyerPortalAttachmentQuery,\n BuyerPortalContactEmailCommand,\n BuyerPortalContactEmailOutcome,\n BuyerPortalConversationList,\n BuyerPortalConversationQuery,\n BuyerPortalMessage,\n BuyerPortalMessageCreate,\n BuyerPortalMessagePage,\n BuyerInvoiceListQuery,\n BuyerPortalInvoice,\n BuyerPortalInvoicePage,\n BuyerPortalPageQuery,\n BuyerPortalProfile,\n BuyerPortalProfileUpdate,\n BuyerPortalPurchasePage,\n BuyerPortalRefundRequest,\n BuyerPortalRefundRequestCreate,\n BuyerPortalSession,\n BuyerPortalSubscriptionPage,\n BuyerPortalSubscription,\n BuyerPortalSubscriptionActionRequest,\n BuyerPortalPlanPage,\n BuyerPortalPlanChangeRequest,\n NativeCreateSubscriptionRequest,\n NativeEnrollmentResponse,\n NativeEnrollmentStatusQuery,\n NativeEnrollmentAbandonResponse,\n BuyerEvidence,\n BuyerEvidenceEntry,\n BuyerEvidenceExtensionRequest,\n BuyerEvidenceFile,\n BuyerEvidenceSubmit,\n} from '../types';\n\n/**\n * Buyer access using a customer portal grant, sent in the api-key header.\n * Use a separate client constructed with the portal token, not a merchant secret\n * key or dashboard JWT. The grant determines buyer identity and permitted shops.\n */\nexport class BuyerPortal {\n constructor(private readonly request: RequestFn) {}\n\n async getSession(options?: RequestExtras): Promise<BuyerPortalSession> {\n return this.request('GET', '/buyer-portal/session', { ...options });\n }\n\n /**\n * The buyer's cases at the shop: the refund requests they sent and the\n * disputes about their purchases, newest first, with where each stands, who\n * acts next, the outcome and the recorded steps.\n */\n async listCases(options?: RequestExtras): Promise<BuyerCaseList> {\n return this.request('GET', '/buyer-portal/cases', { ...options });\n }\n\n /**\n * A case's evidence: what may be handed in and by when, the files saved\n * and handed in, and what the reviewer said. Opened on the first read\n * while the case still waits.\n */\n async caseEvidence(caseId: string, options?: RequestExtras): Promise<BuyerEvidence> {\n return this.request('GET', `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {\n ...options,\n });\n }\n\n /**\n * Upload a file for a case. It is saved, not handed in, until a\n * submission takes it. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored, also after the cut-off.\n */\n async uploadEvidenceFile(\n caseId: string,\n file: Blob,\n clientUploadId: string,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerEvidenceFile> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,\n { body: form, ...extras },\n );\n }\n\n /** Download a file of the case's evidence. */\n async downloadEvidenceFile(\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a saved file. A file a submission took stays. */\n async removeEvidenceFile(caseId: string, fileId: string, options?: RequestExtras): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n ...options,\n },\n );\n }\n\n /**\n * Hand in an explanation, saved files or both, while the buyer's window\n * is open. Sending again with the same `client_submission_id` returns the\n * submission the first send stored.\n */\n async submitEvidence(\n caseId: string,\n params: BuyerEvidenceSubmit,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,\n { body: params, ...options },\n );\n }\n\n /** Ask for more time, once until the cut-off is next set. */\n async requestEvidenceExtension(\n caseId: string,\n params: BuyerEvidenceExtensionRequest,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,\n { body: params, ...options },\n );\n }\n\n /**\n * The buyer's conversations with the shop, the latest message first. A\n * portal link for the whole merchant lists one per shop and mode.\n */\n async listConversations(options?: RequestExtras): Promise<BuyerPortalConversationList> {\n return this.request('GET', '/buyer-portal/conversations', { ...options });\n }\n\n /**\n * The conversation with one shop and its newest messages, oldest first;\n * `before` pages back. A link issued for one shop may leave `shop` out.\n */\n async listMessages(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessagePage> {\n return this.request('GET', '/buyer-portal/messages', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * A message to the shop. A message to a closed conversation reopens it.\n * Sending again with the same `client_message_id` returns the message the\n * first send stored.\n */\n async sendMessage(\n message: BuyerPortalMessageCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessage> {\n return this.request('POST', '/buyer-portal/messages', { body: message, ...options });\n }\n\n /**\n * The buyer has read the conversation with the shop up to its last accepted\n * message. Answers with the buyer's conversations as they now stand.\n */\n async markMessagesRead(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request('POST', '/buyer-portal/messages/read', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * Upload a file for the buyer's next message to one shop, under the shop's\n * attachment rules (`attachment_rules` on the message page). It belongs to\n * the buyer until a message names it in `attachments`; one no message took\n * within a day is cleared. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored.\n */\n async uploadMessageFile(\n file: Blob,\n clientUploadId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerConversationAttachment> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', '/buyer-portal/messages/files', {\n body: form,\n query: query as Record<string, string | boolean | null | undefined>,\n ...extras,\n });\n }\n\n /** Download a file a message of the buyer's conversation with one shop carries. */\n async downloadMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request('GET', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n responseType: 'blob',\n ...options,\n });\n }\n\n /** Remove a file the buyer uploaded that no message took. */\n async removeMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request('DELETE', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n ...options,\n });\n }\n\n /** The buyer's contact and billing details, and what they may change. */\n async getProfile(options?: RequestExtras): Promise<BuyerPortalProfile> {\n return this.request('GET', '/buyer-portal/profile', { ...options });\n }\n\n /**\n * Change the buyer's contact and billing details. Fields left out stay as\n * they are; the merchant decides whether buyers may change them at all.\n */\n async updateProfile(\n params: BuyerPortalProfileUpdate,\n options?: RequestExtras,\n ): Promise<BuyerPortalProfile> {\n return this.request('POST', '/buyer-portal/profile', { body: params, ...options });\n }\n\n /**\n * Change the buyer's email address, as the profile's `email_policy` allows:\n * `request` names the new address, and under a `confirm_new` policy\n * `confirm` completes it with the proof sent there. A refusal comes back as\n * an outcome with `status: 'refused'`; a 403 means the policy does not let\n * the buyer change the address at all, and a 429 that the request limit was\n * reached.\n * `POST /buyer-portal/profile/contact-email`\n */\n async changeContactEmail(\n command: BuyerPortalContactEmailCommand,\n options?: RequestExtras,\n ): Promise<BuyerPortalContactEmailOutcome> {\n return this.request('POST', '/buyer-portal/profile/contact-email', {\n body: command,\n ...options,\n });\n }\n\n /**\n * Ask the shop for a refund of one of the buyer's purchases, named by its\n * `id` from `listPurchases()`. Nothing is refunded until the shop approves\n * the request with a refund.\n */\n async createRefundRequest(\n purchaseId: string,\n params: BuyerPortalRefundRequestCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalRefundRequest> {\n return this.request(\n 'POST',\n `/buyer-portal/purchases/${encodeURIComponent(purchaseId)}/refund-requests`,\n { body: params, ...options },\n );\n }\n\n async listInvoices(\n params?: BuyerInvoiceListQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalInvoicePage> {\n return this.request('GET', '/buyer-portal/invoices', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async retrieveInvoice(invoiceId: string, options?: RequestExtras): Promise<BuyerPortalInvoice> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {\n ...options,\n });\n }\n\n /** Download the owned, published invoice as PDF bytes. */\n async downloadInvoicePdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n async listPurchases(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPurchasePage> {\n return this.request('GET', '/buyer-portal/purchases', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async listSubscriptions(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionPage> {\n return this.request('GET', '/buyer-portal/subscriptions', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n /** Apply an action allowed by the subscription capabilities and portal grant. */\n async actOnSubscription(\n subscriptionId: string,\n params: BuyerPortalSubscriptionActionRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,\n { body: params, ...options },\n );\n }\n\n async listSubscriptionPlans(\n subscriptionId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n async changeSubscriptionPlan(\n subscriptionId: string,\n params: BuyerPortalPlanChangeRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,\n { body: params, ...options },\n );\n }\n\n async listNativePlans(\n profileId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n /** Retry with the same subscription ID and accepted terms after a lost response. */\n async enrollNative(\n params: NativeCreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request('POST', '/buyer-portal/subscriptions/native/enroll', {\n body: params,\n ...options,\n });\n }\n\n async getNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n\n async abandonNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentAbandonResponse> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-CAMALM35.cjs","../src/resources/buyerPortal.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,YAAA,EAAN,MAA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V,MAAA;AACyE,MAAA;AACA,MAAA;AAC3E,IAAA;AACF,EAAA;AAAA;AAMqC,EAAA;AACsC,IAAA;AACjE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAMqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC+E,MAAA;AACxB,MAAA;AACzD,IAAA;AACF,EAAA;AAM4C,EAAA;AAC9B,IAAA;AACV,MAAA;AAC+E,MAAA;AACxB,MAAA;AACzD,IAAA;AACF,EAAA;AACF;AD3JqG;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-CAMALM35.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n BuyerCaseList,\n BuyerConversationAttachment,\n BuyerPortalAttachmentQuery,\n BuyerPortalContactEmailCommand,\n BuyerPortalContactEmailOutcome,\n BuyerPortalConversationList,\n BuyerPortalConversationQuery,\n BuyerPortalMessage,\n BuyerPortalMessageCreate,\n BuyerPortalMessagePage,\n BuyerInvoiceListQuery,\n BuyerPortalInvoice,\n BuyerPortalInvoicePage,\n BuyerPortalPageQuery,\n BuyerPortalProfile,\n BuyerPortalProfileUpdate,\n BuyerPortalPurchasePage,\n BuyerPortalRefundRequest,\n BuyerPortalRefundRequestCreate,\n BuyerPortalSession,\n BuyerPortalSubscriptionPage,\n BuyerPortalSubscription,\n BuyerPortalSubscriptionActionRequest,\n BuyerPortalPlanPage,\n BuyerPortalPlanChangeRequest,\n NativeCreateSubscriptionRequest,\n NativeEnrollmentResponse,\n NativeEnrollmentStatusQuery,\n NativeEnrollmentAbandonResponse,\n BuyerEvidence,\n BuyerEvidenceEntry,\n BuyerEvidenceExtensionRequest,\n BuyerEvidenceFile,\n BuyerEvidenceSubmit,\n} from '../types';\n\n/**\n * Buyer access using a customer portal grant, sent in the api-key header.\n * Use a separate client constructed with the portal token, not a merchant secret\n * key or dashboard JWT. The grant determines buyer identity and permitted shops.\n */\nexport class BuyerPortal {\n constructor(private readonly request: RequestFn) {}\n\n async getSession(options?: RequestExtras): Promise<BuyerPortalSession> {\n return this.request('GET', '/buyer-portal/session', { ...options });\n }\n\n /**\n * The buyer's cases at the shop: the refund requests they sent and the\n * disputes about their purchases, newest first, with where each stands, who\n * acts next, the outcome and the recorded steps.\n */\n async listCases(options?: RequestExtras): Promise<BuyerCaseList> {\n return this.request('GET', '/buyer-portal/cases', { ...options });\n }\n\n /**\n * A case's evidence: what may be handed in and by when, the files saved\n * and handed in, and what the reviewer said. Opened on the first read\n * while the case still waits.\n */\n async caseEvidence(caseId: string, options?: RequestExtras): Promise<BuyerEvidence> {\n return this.request('GET', `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {\n ...options,\n });\n }\n\n /**\n * Upload a file for a case. It is saved, not handed in, until a\n * submission takes it. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored, also after the cut-off.\n */\n async uploadEvidenceFile(\n caseId: string,\n file: Blob,\n clientUploadId: string,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerEvidenceFile> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,\n { body: form, ...extras },\n );\n }\n\n /** Download a file of the case's evidence. */\n async downloadEvidenceFile(\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a saved file. A file a submission took stays. */\n async removeEvidenceFile(caseId: string, fileId: string, options?: RequestExtras): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n ...options,\n },\n );\n }\n\n /**\n * Hand in an explanation, saved files or both, while the buyer's window\n * is open. Sending again with the same `client_submission_id` returns the\n * submission the first send stored.\n */\n async submitEvidence(\n caseId: string,\n params: BuyerEvidenceSubmit,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,\n { body: params, ...options },\n );\n }\n\n /** Ask for more time, once until the cut-off is next set. */\n async requestEvidenceExtension(\n caseId: string,\n params: BuyerEvidenceExtensionRequest,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,\n { body: params, ...options },\n );\n }\n\n /**\n * The buyer's conversations with the shop, the latest message first. A\n * portal link for the whole merchant lists one per shop and mode.\n */\n async listConversations(options?: RequestExtras): Promise<BuyerPortalConversationList> {\n return this.request('GET', '/buyer-portal/conversations', { ...options });\n }\n\n /**\n * The conversation with one shop and its newest messages, oldest first;\n * `before` pages back. A link issued for one shop may leave `shop` out.\n */\n async listMessages(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessagePage> {\n return this.request('GET', '/buyer-portal/messages', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * A message to the shop. A message to a closed conversation reopens it.\n * Sending again with the same `client_message_id` returns the message the\n * first send stored.\n */\n async sendMessage(\n message: BuyerPortalMessageCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessage> {\n return this.request('POST', '/buyer-portal/messages', { body: message, ...options });\n }\n\n /**\n * The buyer has read the conversation with the shop up to its last accepted\n * message. Answers with the buyer's conversations as they now stand.\n */\n async markMessagesRead(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request('POST', '/buyer-portal/messages/read', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * Upload a file for the buyer's next message to one shop, under the shop's\n * attachment rules (`attachment_rules` on the message page). It belongs to\n * the buyer until a message names it in `attachments`; one no message took\n * within a day is cleared. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored.\n */\n async uploadMessageFile(\n file: Blob,\n clientUploadId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerConversationAttachment> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', '/buyer-portal/messages/files', {\n body: form,\n query: query as Record<string, string | boolean | null | undefined>,\n ...extras,\n });\n }\n\n /** Download a file a message of the buyer's conversation with one shop carries. */\n async downloadMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request('GET', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n responseType: 'blob',\n ...options,\n });\n }\n\n /** Remove a file the buyer uploaded that no message took. */\n async removeMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request('DELETE', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n ...options,\n });\n }\n\n /** The buyer's contact and billing details, and what they may change. */\n async getProfile(options?: RequestExtras): Promise<BuyerPortalProfile> {\n return this.request('GET', '/buyer-portal/profile', { ...options });\n }\n\n /**\n * Change the buyer's contact and billing details. Fields left out stay as\n * they are; the merchant decides whether buyers may change them at all.\n */\n async updateProfile(\n params: BuyerPortalProfileUpdate,\n options?: RequestExtras,\n ): Promise<BuyerPortalProfile> {\n return this.request('POST', '/buyer-portal/profile', { body: params, ...options });\n }\n\n /**\n * Change the buyer's email address, as the profile's `email_policy` allows:\n * `request` names the new address, and under a `confirm_new` policy\n * `confirm` completes it with the proof sent there. A refusal comes back as\n * an outcome with `status: 'refused'`; a 403 means the policy does not let\n * the buyer change the address at all, and a 429 that the request limit was\n * reached.\n * `POST /buyer-portal/profile/contact-email`\n */\n async changeContactEmail(\n command: BuyerPortalContactEmailCommand,\n options?: RequestExtras,\n ): Promise<BuyerPortalContactEmailOutcome> {\n return this.request('POST', '/buyer-portal/profile/contact-email', {\n body: command,\n ...options,\n });\n }\n\n /**\n * Ask the shop for a refund of one of the buyer's purchases, named by its\n * `id` from `listPurchases()`. Nothing is refunded until the shop approves\n * the request with a refund.\n */\n async createRefundRequest(\n purchaseId: string,\n params: BuyerPortalRefundRequestCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalRefundRequest> {\n return this.request(\n 'POST',\n `/buyer-portal/purchases/${encodeURIComponent(purchaseId)}/refund-requests`,\n { body: params, ...options },\n );\n }\n\n async listInvoices(\n params?: BuyerInvoiceListQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalInvoicePage> {\n return this.request('GET', '/buyer-portal/invoices', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async retrieveInvoice(invoiceId: string, options?: RequestExtras): Promise<BuyerPortalInvoice> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {\n ...options,\n });\n }\n\n /** Download the owned, published invoice as PDF bytes. */\n async downloadInvoicePdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n async listPurchases(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPurchasePage> {\n return this.request('GET', '/buyer-portal/purchases', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async listSubscriptions(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionPage> {\n return this.request('GET', '/buyer-portal/subscriptions', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n /** Apply an action allowed by the subscription capabilities and portal grant. */\n async actOnSubscription(\n subscriptionId: string,\n params: BuyerPortalSubscriptionActionRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,\n { body: params, ...options },\n );\n }\n\n async listSubscriptionPlans(\n subscriptionId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n async changeSubscriptionPlan(\n subscriptionId: string,\n params: BuyerPortalPlanChangeRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,\n { body: params, ...options },\n );\n }\n\n async listNativePlans(\n profileId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n /** Retry with the same subscription ID and accepted terms after a lost response. */\n async enrollNative(\n params: NativeCreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request('POST', '/buyer-portal/subscriptions/native/enroll', {\n body: params,\n ...options,\n });\n }\n\n async getNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n\n async abandonNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentAbandonResponse> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-CCN44NZJ.cjs","../src/resources/live.ts"],"names":[],"mappings":"AAAA;ACWA,SAAS,SAAA,CAAU,IAAA,EAAc,GAAA,EAAsB;AACrD,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI;AACF,IAAA,MAAA,EAAQ,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA;AAAA,EACzB,EAAA,UAAQ;AACN,IAAA,OAAO,KAAA,CAAA;AAAA,EACT;AACA,EAAA,GAAA,CAAI,MAAA,IAAU,KAAA,GAAQ,OAAO,MAAA,IAAU,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG,OAAO,KAAA,CAAA;AAChF,EAAA,uBAAO,MAAA,mBAAO,wBAAA,mBAAyB,KAAA,EAAO,GAAG,CAAA,6BAAG,OAAA;AACtD;AAGO,SAAS,iBAAA,CACd,KAAA,EACA,EAAA,EACA,KAAA,EACwB;AACxB,EAAA,OAAA,CAAQ,KAAA,CAAM,IAAA,EAAM;AAAA,IAClB,KAAK,OAAA,EAAS;AACZ,MAAA,MAAM,QAAA,EAAU,SAAA,CAAU,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAC/C,MAAA,OAAO,EAAE,IAAA,EAAM,OAAA,EAAS,EAAA,EAAI,KAAA,EAAO,OAAA,EAAS,OAAO,QAAA,IAAY,UAAA,EAAY,QAAA,EAAU,KAAK,CAAA;AAAA,IAC5F;AAAA,IACA,KAAK,QAAA,EAAU;AACb,MAAA,MAAM,QAAA,EAAU,SAAA,CAAU,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAG/C,MAAA,GAAA,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;AAQO,IAAM,KAAA,EAAN,MAAW;AAAA,EAChB,WAAA,CACmB,OAAA,EACA,UAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,cAAA,CAAe,IAAA,CAAK,UAAA,EAAY,cAAA,EAAgB,OAAO,CAAA;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,QAAA,CACJ,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gBAAA,EAAkB;AAAA,MAC3C,KAAA,EAAO;AAAA,QACL,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AD7DA;AACA;AACE;AACA;AACA;AACA;AACF,uJAAC","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-CCN44NZJ.cjs","sourcesContent":[null,"import type {\n LiveChange,\n LiveStreamEvent,\n LiveStreamOptions,\n LiveVersionsParams,\n LiveVersionsResponse,\n} from '../types';\nimport type { EventStreamConnection, EventStreamFn, RequestExtras, RequestFn } from '../client';\nimport type { EventStreamDispatch } from '../eventStream';\n\n/** `key` of the JSON object `data` holds; `undefined` when it holds none. */\nfunction readField(data: string, key: string): unknown {\n let value: unknown;\n try {\n value = JSON.parse(data);\n } catch {\n return undefined;\n }\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined;\n return Object.getOwnPropertyDescriptor(value, key)?.value as unknown;\n}\n\n/** The typed event a dispatch carries, or `null` for a kind the SDK does not know. */\nexport function toLiveStreamEvent(\n event: { type: string; data: string },\n id: string | null,\n retry: number | null,\n): LiveStreamEvent | null {\n switch (event.type) {\n case 'ready': {\n const resumed = readField(event.data, 'resumed');\n return { type: 'ready', id, retry, resumed: typeof resumed === 'boolean' ? resumed : null };\n }\n case 'change': {\n const changes = readField(event.data, 'changes');\n // A change the SDK cannot read still says that something changed: the\n // dashboard reads everything again rather than miss it.\n if (!Array.isArray(changes)) return { type: 'resync', id };\n return { type: 'change', id, changes: changes as LiveChange[] };\n }\n case 'resync':\n return { type: 'resync', id };\n default:\n return null;\n }\n}\n\n/**\n * An open live stream: iterate it with `for await` for its events.\n *\n * It is not reconnected. The iteration ends without an error when the server\n * ends the stream (the session expired, 30 minutes passed, the server\n * restarted) and when the stream is aborted or closed; the dashboard then\n * opens a new one after {@link LiveEventStream.retry}, passing\n * {@link LiveEventStream.lastEventId}. It throws a `DelopayError` with code\n * `TIMEOUT` when the stream stays silent past `idleTimeoutMs` and `NETWORK`\n * when the connection fails; reconnect on those too.\n *\n * Iterate it once. Call {@link LiveEventStream.close} (or abort the signal)\n * to release a stream that is not iterated to its end.\n */\nexport class LiveEventStream implements AsyncIterable<LiveStreamEvent> {\n private _lastEventId: string | null;\n private _retry: number | null = null;\n private iterator?: AsyncGenerator<LiveStreamEvent, void, undefined>;\n\n constructor(\n private readonly connection: EventStreamConnection,\n lastEventId: string | null = null,\n ) {\n this._lastEventId = lastEventId || null;\n }\n\n /**\n * The position to resume after: the id of the last event read, advanced by\n * keepalives too. `null` before the server named one. Send it as\n * `lastEventId` when reconnecting.\n */\n get lastEventId(): string | null {\n return this._lastEventId;\n }\n\n /** The wait before reconnecting the server asked for, in ms; `null` until it says. */\n get retry(): number | null {\n return this._retry;\n }\n\n /** Close the stream; the iteration ends without an error. */\n close(): void {\n this.connection.close();\n }\n\n [Symbol.asyncIterator](): AsyncGenerator<LiveStreamEvent, void, undefined> {\n this.iterator ??= this.events();\n return this.iterator;\n }\n\n private async *events(): AsyncGenerator<LiveStreamEvent, void, undefined> {\n for await (const dispatch of this.connection.dispatches) {\n const event = this.read(dispatch);\n if (event) yield event;\n }\n }\n\n private read(dispatch: EventStreamDispatch): LiveStreamEvent | null {\n this._lastEventId = dispatch.lastEventId || null;\n if (dispatch.retry !== null) this._retry = dispatch.retry;\n if (!dispatch.event) return null;\n return toLiveStreamEvent(dispatch.event, this._lastEventId, this._retry);\n }\n}\n\n/** Open a live stream at `path`. */\nexport async function openLiveStream(\n openStream: EventStreamFn,\n path: string,\n options: LiveStreamOptions = {},\n): Promise<LiveEventStream> {\n const connection = await openStream(path, {\n ...(options.lastEventId ? { lastEventId: options.lastEventId } : {}),\n ...(options.signal ? { signal: options.signal } : {}),\n ...(options.idleTimeoutMs !== undefined ? { idleTimeoutMs: options.idleTimeoutMs } : {}),\n ...(options.headers ? { headers: options.headers } : {}),\n });\n return new LiveEventStream(connection, options.lastEventId ?? null);\n}\n\n/**\n * Live updates of the merchant dashboard: a stream that\n * says what kind of record changed, and the versions an editor names in\n * `If-Match` so a save never overwrites a newer change. Both need a dashboard\n * JWT (`setJwtToken`), not an API key.\n */\nexport class Live {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Open the stream of what changed in the caller's merchant, as their role\n * may read it. Resolves once the server answered; a `401` rejects with\n * `DelopayAuthenticationError`.\n *\n * The first event is `ready`. `change` names the kinds of record and, when\n * few, the ids that changed: read them again through the usual endpoints.\n * `resync`, and `ready` with `resumed: false`, mean read everything again.\n * The SDK does not reconnect — see {@link LiveEventStream}.\n *\n * `GET /live/stream`\n *\n * @example\n * ```typescript\n * const stream = await delopay.live.stream({ lastEventId, signal });\n * for await (const event of stream) {\n * if (event.type === 'change') refresh(event.changes);\n * else if (event.type === 'resync' || event.resumed === false) refreshAll();\n * }\n * lastEventId = stream.lastEventId; // reconnect after stream.retry\n * ```\n */\n async stream(options?: LiveStreamOptions): Promise<LiveEventStream> {\n return openLiveStream(this.openStream, '/live/stream', options);\n }\n\n /**\n * The current version of each kind of record named, in the caller's\n * merchant and shop. Read it before the record and send the entry's\n * `if_match` in the `If-Match` header of the save: a save over a newer\n * version is refused with `IR_16` (400), `error.data` a\n * `LiveChangedElsewhere` naming who made the change.\n *\n * `GET /live/versions`\n */\n async versions(\n params: LiveVersionsParams,\n options?: RequestExtras,\n ): Promise<LiveVersionsResponse> {\n return this.request('GET', '/live/versions', {\n query: {\n entities: params.entities.join(','),\n profile_id: params.profile_id,\n record_id: params.record_id,\n },\n ...options,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-CCN44NZJ.cjs","../src/resources/live.ts"],"names":[],"mappings":"AAAA;ACWA,SAAS,SAAA,CAAU,IAAA,EAAc,GAAA,EAAsB;AACrD,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI;AACF,IAAA,MAAA,EAAQ,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA;AAAA,EACzB,EAAA,UAAQ;AACN,IAAA,OAAO,KAAA,CAAA;AAAA,EACT;AACA,EAAA,GAAA,CAAI,MAAA,IAAU,KAAA,GAAQ,OAAO,MAAA,IAAU,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG,OAAO,KAAA,CAAA;AAChF,EAAA,uBAAO,MAAA,mBAAO,wBAAA,mBAAyB,KAAA,EAAO,GAAG,CAAA,6BAAG,OAAA;AACtD;AAGO,SAAS,iBAAA,CACd,KAAA,EACA,EAAA,EACA,KAAA,EACwB;AACxB,EAAA,OAAA,CAAQ,KAAA,CAAM,IAAA,EAAM;AAAA,IAClB,KAAK,OAAA,EAAS;AACZ,MAAA,MAAM,QAAA,EAAU,SAAA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,uJAAC","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-CCN44NZJ.cjs","sourcesContent":[null,"import type {\n LiveChange,\n LiveStreamEvent,\n LiveStreamOptions,\n LiveVersionsParams,\n LiveVersionsResponse,\n} from '../types';\nimport type { EventStreamConnection, EventStreamFn, RequestExtras, RequestFn } from '../client';\nimport type { EventStreamDispatch } from '../eventStream';\n\n/** `key` of the JSON object `data` holds; `undefined` when it holds none. */\nfunction readField(data: string, key: string): unknown {\n let value: unknown;\n try {\n value = JSON.parse(data);\n } catch {\n return undefined;\n }\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined;\n return Object.getOwnPropertyDescriptor(value, key)?.value as unknown;\n}\n\n/** The typed event a dispatch carries, or `null` for a kind the SDK does not know. */\nexport function toLiveStreamEvent(\n event: { type: string; data: string },\n id: string | null,\n retry: number | null,\n): LiveStreamEvent | null {\n switch (event.type) {\n case 'ready': {\n const resumed = readField(event.data, 'resumed');\n return { type: 'ready', id, retry, resumed: typeof resumed === 'boolean' ? resumed : null };\n }\n case 'change': {\n const changes = readField(event.data, 'changes');\n // A change the SDK cannot read still says that something changed: the\n // dashboard reads everything again rather than miss it.\n if (!Array.isArray(changes)) return { type: 'resync', id };\n return { type: 'change', id, changes: changes as LiveChange[] };\n }\n case 'resync':\n return { type: 'resync', id };\n default:\n return null;\n }\n}\n\n/**\n * An open live stream: iterate it with `for await` for its events.\n *\n * It is not reconnected. The iteration ends without an error when the server\n * ends the stream (the session expired, 30 minutes passed, the server\n * restarted) and when the stream is aborted or closed; the dashboard then\n * opens a new one after {@link LiveEventStream.retry}, passing\n * {@link LiveEventStream.lastEventId}. It throws a `DelopayError` with code\n * `TIMEOUT` when the stream stays silent past `idleTimeoutMs` and `NETWORK`\n * when the connection fails; reconnect on those too.\n *\n * Iterate it once. Call {@link LiveEventStream.close} (or abort the signal)\n * to release a stream that is not iterated to its end.\n */\nexport class LiveEventStream implements AsyncIterable<LiveStreamEvent> {\n private _lastEventId: string | null;\n private _retry: number | null = null;\n private iterator?: AsyncGenerator<LiveStreamEvent, void, undefined>;\n\n constructor(\n private readonly connection: EventStreamConnection,\n lastEventId: string | null = null,\n ) {\n this._lastEventId = lastEventId || null;\n }\n\n /**\n * The position to resume after: the id of the last event read, advanced by\n * keepalives too. `null` before the server named one. Send it as\n * `lastEventId` when reconnecting.\n */\n get lastEventId(): string | null {\n return this._lastEventId;\n }\n\n /** The wait before reconnecting the server asked for, in ms; `null` until it says. */\n get retry(): number | null {\n return this._retry;\n }\n\n /** Close the stream; the iteration ends without an error. */\n close(): void {\n this.connection.close();\n }\n\n [Symbol.asyncIterator](): AsyncGenerator<LiveStreamEvent, void, undefined> {\n this.iterator ??= this.events();\n return this.iterator;\n }\n\n private async *events(): AsyncGenerator<LiveStreamEvent, void, undefined> {\n for await (const dispatch of this.connection.dispatches) {\n const event = this.read(dispatch);\n if (event) yield event;\n }\n }\n\n private read(dispatch: EventStreamDispatch): LiveStreamEvent | null {\n this._lastEventId = dispatch.lastEventId || null;\n if (dispatch.retry !== null) this._retry = dispatch.retry;\n if (!dispatch.event) return null;\n return toLiveStreamEvent(dispatch.event, this._lastEventId, this._retry);\n }\n}\n\n/** Open a live stream at `path`. */\nexport async function openLiveStream(\n openStream: EventStreamFn,\n path: string,\n options: LiveStreamOptions = {},\n): Promise<LiveEventStream> {\n const connection = await openStream(path, {\n ...(options.lastEventId ? { lastEventId: options.lastEventId } : {}),\n ...(options.signal ? { signal: options.signal } : {}),\n ...(options.idleTimeoutMs !== undefined ? { idleTimeoutMs: options.idleTimeoutMs } : {}),\n ...(options.headers ? { headers: options.headers } : {}),\n });\n return new LiveEventStream(connection, options.lastEventId ?? null);\n}\n\n/**\n * Live updates of the merchant dashboard: a stream that\n * says what kind of record changed, and the versions an editor names in\n * `If-Match` so a save never overwrites a newer change. Both need a dashboard\n * JWT (`setJwtToken`), not an API key.\n */\nexport class Live {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Open the stream of what changed in the caller's merchant, as their role\n * may read it. Resolves once the server answered; a `401` rejects with\n * `DelopayAuthenticationError`.\n *\n * The first event is `ready`. `change` names the kinds of record and, when\n * few, the ids that changed: read them again through the usual endpoints.\n * `resync`, and `ready` with `resumed: false`, mean read everything again.\n * The SDK does not reconnect — see {@link LiveEventStream}.\n *\n * `GET /live/stream`\n *\n * @example\n * ```typescript\n * const stream = await delopay.live.stream({ lastEventId, signal });\n * for await (const event of stream) {\n * if (event.type === 'change') refresh(event.changes);\n * else if (event.type === 'resync' || event.resumed === false) refreshAll();\n * }\n * lastEventId = stream.lastEventId; // reconnect after stream.retry\n * ```\n */\n async stream(options?: LiveStreamOptions): Promise<LiveEventStream> {\n return openLiveStream(this.openStream, '/live/stream', options);\n }\n\n /**\n * The current version of each kind of record named, in the caller's\n * merchant and shop. Read it before the record and send the entry's\n * `if_match` in the `If-Match` header of the save: a save over a newer\n * version is refused with `IR_16` (400), `error.data` a\n * `LiveChangedElsewhere` naming who made the change.\n *\n * `GET /live/versions`\n */\n async versions(\n params: LiveVersionsParams,\n options?: RequestExtras,\n ): Promise<LiveVersionsResponse> {\n return this.request('GET', '/live/versions', {\n query: {\n entities: params.entities.join(','),\n profile_id: params.profile_id,\n record_id: params.record_id,\n },\n ...options,\n });\n }\n}\n"]}