@delopay/sdk 0.495.0 → 0.497.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/dist/airwallexCard.cjs.map +1 -1
  2. package/dist/branding.cjs.map +1 -1
  3. package/dist/cardFormStyles.cjs.map +1 -1
  4. package/dist/checkoutSession.cjs +2 -2
  5. package/dist/checkoutSession.cjs.map +1 -1
  6. package/dist/checkoutSession.js +1 -1
  7. package/dist/chunk-244VZFFO.cjs.map +1 -1
  8. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  9. package/dist/{chunk-OMQK3CMR.cjs → chunk-2NVGA4G5.cjs} +23 -1
  10. package/dist/chunk-2NVGA4G5.cjs.map +1 -0
  11. package/dist/chunk-34PC72O7.cjs.map +1 -1
  12. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  13. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  14. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  15. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  16. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  17. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  18. package/dist/chunk-5CITBN33.cjs.map +1 -1
  19. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  20. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  21. package/dist/chunk-5QS67SBO.cjs.map +1 -1
  22. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  23. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  24. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  25. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  26. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  27. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  28. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  29. package/dist/{chunk-QG6AD33A.js → chunk-7H2VFIPS.js} +2 -2
  30. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  31. package/dist/chunk-7NKJD5ST.cjs.map +1 -1
  32. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  33. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  34. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  35. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  36. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  37. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  38. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  39. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  40. package/dist/{chunk-MXSUWL6O.js → chunk-BS6MTTT6.js} +13 -1
  41. package/dist/chunk-BS6MTTT6.js.map +1 -0
  42. package/dist/chunk-BT3UAUEV.cjs.map +1 -1
  43. package/dist/{chunk-IM6A64ON.js → chunk-BX2CT7FR.js} +13 -1
  44. package/dist/chunk-BX2CT7FR.js.map +1 -0
  45. package/dist/chunk-CAMALM35.cjs.map +1 -1
  46. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  47. package/dist/{chunk-MOFPVWNN.js → chunk-CQQW5JU7.js} +2 -2
  48. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  49. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  50. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  51. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  52. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  53. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  54. package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
  55. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  56. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  57. package/dist/{chunk-3HUJ7PPJ.js → chunk-F6LZ2YNM.js} +23 -1
  58. package/dist/chunk-F6LZ2YNM.js.map +1 -0
  59. package/dist/chunk-F6QJB4XP.cjs.map +1 -1
  60. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  61. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  62. package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
  63. package/dist/chunk-FYISDU2Y.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-GSQN5EOO.cjs.map +1 -1
  67. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  68. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  69. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  70. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  71. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  72. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  73. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  74. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  75. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  76. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  77. package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
  78. package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
  79. package/dist/{chunk-OFZJ4JAH.cjs → chunk-K3XXGAOR.cjs} +3 -3
  80. package/dist/chunk-K3XXGAOR.cjs.map +1 -0
  81. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  82. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  83. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  84. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  85. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  86. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  87. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  88. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  89. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  90. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  91. package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
  92. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  93. package/dist/{chunk-GLQ7EJAH.cjs → chunk-NULOAF7W.cjs} +13 -1
  94. package/dist/chunk-NULOAF7W.cjs.map +1 -0
  95. package/dist/{chunk-YWN76H2W.cjs → chunk-NX36HDXE.cjs} +13 -1
  96. package/dist/chunk-NX36HDXE.cjs.map +1 -0
  97. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  98. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  99. package/dist/chunk-OAEKP665.cjs.map +1 -1
  100. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  101. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  102. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  103. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  104. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  105. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  106. package/dist/chunk-PYNHK6AP.cjs.map +1 -1
  107. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  108. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  109. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  110. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  111. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  112. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  113. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  114. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  115. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  116. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  117. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  118. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  119. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  120. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  121. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  122. package/dist/chunk-UTCXNBID.cjs.map +1 -1
  123. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  124. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  125. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  126. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  127. package/dist/chunk-W457XUA6.cjs.map +1 -1
  128. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  129. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  130. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  131. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  132. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  133. package/dist/chunk-YFRAI34Y.cjs.map +1 -1
  134. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  135. package/dist/chunk-YW4DVKNT.cjs.map +1 -1
  136. package/dist/chunk-ZGMIHHGL.cjs.map +1 -1
  137. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  138. package/dist/{chunk-XPSN5YYU.cjs → chunk-ZMJT2YPZ.cjs} +3 -3
  139. package/dist/chunk-ZMJT2YPZ.cjs.map +1 -0
  140. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  141. package/dist/client.cjs +2 -2
  142. package/dist/client.cjs.map +1 -1
  143. package/dist/client.js +1 -1
  144. package/dist/core.cjs.map +1 -1
  145. package/dist/currencies.cjs.map +1 -1
  146. package/dist/enigmaCardForm.cjs.map +1 -1
  147. package/dist/error.cjs.map +1 -1
  148. package/dist/eventStream.cjs.map +1 -1
  149. package/dist/exportDownload.cjs.map +1 -1
  150. package/dist/feeProgram.cjs.map +1 -1
  151. package/dist/index.cjs +4 -4
  152. package/dist/index.cjs.map +1 -1
  153. package/dist/index.d.cts +1 -1
  154. package/dist/index.d.ts +1 -1
  155. package/dist/index.js +3 -3
  156. package/dist/internal/resources/admin.cjs.map +1 -1
  157. package/dist/internal/resources/admin.d.cts +1 -1
  158. package/dist/internal/resources/admin.d.ts +1 -1
  159. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  160. package/dist/internal/resources/adminBranding.d.cts +1 -1
  161. package/dist/internal/resources/adminBranding.d.ts +1 -1
  162. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  163. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
  164. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
  165. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  166. package/dist/internal/resources/adminFeePlans.d.cts +1 -1
  167. package/dist/internal/resources/adminFeePlans.d.ts +1 -1
  168. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  169. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  170. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  171. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  172. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  173. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  174. package/dist/internal/resources/adminLive.cjs.map +1 -1
  175. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  176. package/dist/internal/resources/adminNotices.d.cts +1 -1
  177. package/dist/internal/resources/adminNotices.d.ts +1 -1
  178. package/dist/internal/resources/adminPortal.cjs +2 -2
  179. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  180. package/dist/internal/resources/adminPortal.d.cts +9 -2
  181. package/dist/internal/resources/adminPortal.d.ts +9 -2
  182. package/dist/internal/resources/adminPortal.js +1 -1
  183. package/dist/internal/resources/adminPricing.cjs +2 -2
  184. package/dist/internal/resources/adminPricing.cjs.map +1 -1
  185. package/dist/internal/resources/adminPricing.d.cts +11 -1
  186. package/dist/internal/resources/adminPricing.d.ts +11 -1
  187. package/dist/internal/resources/adminPricing.js +1 -1
  188. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  189. package/dist/internal/resources/adminSupport.d.cts +1 -1
  190. package/dist/internal/resources/adminSupport.d.ts +1 -1
  191. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  192. package/dist/internal/resources/auditLogs.d.cts +1 -1
  193. package/dist/internal/resources/auditLogs.d.ts +1 -1
  194. package/dist/internal/resources/cache.cjs.map +1 -1
  195. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  196. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  197. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  198. package/dist/internal/resources/configs.cjs.map +1 -1
  199. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  200. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  201. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  202. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  203. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  204. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  205. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  206. package/dist/internal/resources/diagnostic.d.cts +1 -1
  207. package/dist/internal/resources/diagnostic.d.ts +1 -1
  208. package/dist/internal/resources/gsm.cjs.map +1 -1
  209. package/dist/internal/resources/gsm.d.cts +1 -1
  210. package/dist/internal/resources/gsm.d.ts +1 -1
  211. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  212. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  213. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  214. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  215. package/dist/internal/resources/platformBilling.d.cts +1 -1
  216. package/dist/internal/resources/platformBilling.d.ts +1 -1
  217. package/dist/internal/resources/platformFees.cjs.map +1 -1
  218. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  219. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  220. package/dist/internal/resources/platformSettings.d.cts +1 -1
  221. package/dist/internal/resources/platformSettings.d.ts +1 -1
  222. package/dist/internal.cjs +9 -9
  223. package/dist/internal.cjs.map +1 -1
  224. package/dist/internal.d.cts +2 -2
  225. package/dist/internal.d.ts +2 -2
  226. package/dist/internal.js +5 -5
  227. package/dist/listQuery.cjs.map +1 -1
  228. package/dist/panes.cjs.map +1 -1
  229. package/dist/paymentPresentation.cjs.map +1 -1
  230. package/dist/recordCounter.cjs.map +1 -1
  231. package/dist/resources/aiTools.cjs.map +1 -1
  232. package/dist/resources/analytics.cjs +2 -2
  233. package/dist/resources/analytics.cjs.map +1 -1
  234. package/dist/resources/analytics.d.cts +9 -1
  235. package/dist/resources/analytics.d.ts +9 -1
  236. package/dist/resources/analytics.js +1 -1
  237. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  238. package/dist/resources/apiKeys.cjs.map +1 -1
  239. package/dist/resources/audit.cjs.map +1 -1
  240. package/dist/resources/authentication.cjs.map +1 -1
  241. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  242. package/dist/resources/billing.cjs.map +1 -1
  243. package/dist/resources/buyerAccount.cjs.map +1 -1
  244. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  245. package/dist/resources/buyerConversations.cjs.map +1 -1
  246. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  247. package/dist/resources/buyerPortal.cjs.map +1 -1
  248. package/dist/resources/cards.cjs.map +1 -1
  249. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  250. package/dist/resources/checkoutDomains.cjs.map +1 -1
  251. package/dist/resources/checkoutMethods.cjs.map +1 -1
  252. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  253. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  254. package/dist/resources/connectors.cjs.map +1 -1
  255. package/dist/resources/contentEncryption.cjs.map +1 -1
  256. package/dist/resources/costRules.cjs.map +1 -1
  257. package/dist/resources/customers.cjs.map +1 -1
  258. package/dist/resources/deploymentBranding.cjs.map +1 -1
  259. package/dist/resources/disputes.cjs.map +1 -1
  260. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  261. package/dist/resources/events.cjs.map +1 -1
  262. package/dist/resources/export.cjs.map +1 -1
  263. package/dist/resources/externalRecords.cjs.map +1 -1
  264. package/dist/resources/featureMatrix.cjs.map +1 -1
  265. package/dist/resources/fees.cjs.map +1 -1
  266. package/dist/resources/files.cjs.map +1 -1
  267. package/dist/resources/forex.cjs.map +1 -1
  268. package/dist/resources/identityVerifications.cjs.map +1 -1
  269. package/dist/resources/industries.cjs.map +1 -1
  270. package/dist/resources/invoiceSettings.cjs.map +1 -1
  271. package/dist/resources/invoices.cjs.map +1 -1
  272. package/dist/resources/live.cjs.map +1 -1
  273. package/dist/resources/mandates.cjs.map +1 -1
  274. package/dist/resources/merchantAccounts.cjs.map +1 -1
  275. package/dist/resources/messageTemplates.cjs.map +1 -1
  276. package/dist/resources/notices.cjs.map +1 -1
  277. package/dist/resources/operationLimits.cjs.map +1 -1
  278. package/dist/resources/paymentLinks.cjs.map +1 -1
  279. package/dist/resources/paymentMethods.cjs.map +1 -1
  280. package/dist/resources/payments.cjs.map +1 -1
  281. package/dist/resources/payoutDestinations.cjs.map +1 -1
  282. package/dist/resources/payouts.cjs.map +1 -1
  283. package/dist/resources/paypalDisputes.cjs.map +1 -1
  284. package/dist/resources/persons.cjs.map +1 -1
  285. package/dist/resources/poll.cjs.map +1 -1
  286. package/dist/resources/processorCosts.cjs.map +1 -1
  287. package/dist/resources/processorImports.cjs.map +1 -1
  288. package/dist/resources/products.cjs.map +1 -1
  289. package/dist/resources/profileAcquirers.cjs.map +1 -1
  290. package/dist/resources/profiles.cjs.map +1 -1
  291. package/dist/resources/projects.cjs.map +1 -1
  292. package/dist/resources/refunds.cjs.map +1 -1
  293. package/dist/resources/regions.cjs.map +1 -1
  294. package/dist/resources/relay.cjs.map +1 -1
  295. package/dist/resources/risk.cjs.map +1 -1
  296. package/dist/resources/routing.cjs.map +1 -1
  297. package/dist/resources/search.cjs.map +1 -1
  298. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  299. package/dist/resources/settings.cjs.map +1 -1
  300. package/dist/resources/settlement.cjs.map +1 -1
  301. package/dist/resources/shareLinks.cjs.map +1 -1
  302. package/dist/resources/shopLabels.cjs.map +1 -1
  303. package/dist/resources/shopify.cjs.map +1 -1
  304. package/dist/resources/shops.cjs.map +1 -1
  305. package/dist/resources/stripeConnect.cjs.map +1 -1
  306. package/dist/resources/subscriptions.cjs.map +1 -1
  307. package/dist/resources/support.cjs.map +1 -1
  308. package/dist/resources/threeDsRules.cjs.map +1 -1
  309. package/dist/resources/users.cjs.map +1 -1
  310. package/dist/resources/vatRates.cjs.map +1 -1
  311. package/dist/resources/verification.cjs.map +1 -1
  312. package/dist/resources/webhooks.cjs.map +1 -1
  313. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  314. package/dist/trustedOrigins.cjs.map +1 -1
  315. package/dist/{types-EnPuyp4N.d.ts → types-BxgOWS55.d.ts} +67 -1
  316. package/dist/{types-BWd5W8Eg.d.cts → types-D_Y2A9ny.d.cts} +67 -1
  317. package/dist/types.cjs.map +1 -1
  318. package/dist/types.d.cts +94 -3
  319. package/dist/types.d.ts +94 -3
  320. package/package.json +1 -1
  321. package/dist/chunk-3HUJ7PPJ.js.map +0 -1
  322. package/dist/chunk-GLQ7EJAH.cjs.map +0 -1
  323. package/dist/chunk-IM6A64ON.js.map +0 -1
  324. package/dist/chunk-MXSUWL6O.js.map +0 -1
  325. package/dist/chunk-OFZJ4JAH.cjs.map +0 -1
  326. package/dist/chunk-OMQK3CMR.cjs.map +0 -1
  327. package/dist/chunk-XPSN5YYU.cjs.map +0 -1
  328. package/dist/chunk-YWN76H2W.cjs.map +0 -1
  329. /package/dist/{chunk-QG6AD33A.js.map → chunk-7H2VFIPS.js.map} +0 -0
  330. /package/dist/{chunk-MOFPVWNN.js.map → chunk-CQQW5JU7.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/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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,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":"/tmp/pub0495/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":["/tmp/sdk-pub-04970/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,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAA,EAAG,OAAO,EAAE,IAAA,EAAM,QAAA,EAAU,GAAG,CAAA;AACzD,MAAA,OAAO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;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":"/tmp/sdk-pub-04970/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,6 +1,6 @@
1
1
  import {
2
2
  Delopay
3
- } from "./chunk-QG6AD33A.js";
3
+ } from "./chunk-7H2VFIPS.js";
4
4
  import {
5
5
  DelopayError
6
6
  } from "./chunk-37BJUQ32.js";
@@ -1040,4 +1040,4 @@ var CheckoutSession = class {
1040
1040
  export {
1041
1041
  CheckoutSession
1042
1042
  };
1043
- //# sourceMappingURL=chunk-MOFPVWNN.js.map
1043
+ //# sourceMappingURL=chunk-CQQW5JU7.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-CR3JBTP3.cjs","../src/internal/resources/adminBranding.ts"],"names":[],"mappings":"AAAA;ACYO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,OAAA,EAAyD;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACnF;AACF,CAAA;ADbA;AACA;AACE;AACF,sCAAC","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-CR3JBTP3.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../../client';\nimport type { BrandingAdminResponse, BrandingUpdateRequest } from '../types';\n\n/**\n * The deployment's branding as the platform operator edits it: name, logos,\n * favicon, email font and accent, and the default checkout, status page and\n * redirect page colours.\n *\n * Needs the admin API key or an internal user with permission to change\n * accounts, for reading too. Every change is recorded in the audit log as a\n * change of the setting `deployment.branding` (`entity_type: 'setting'`).\n */\nexport class AdminBranding {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * What is saved, the value in force for each unset field, and the revision\n * to send back on the next update.\n *\n * `GET /admin-portal/branding`\n */\n async retrieve(options?: RequestExtras): Promise<BrandingAdminResponse> {\n return this.request('GET', '/admin-portal/branding', { ...options });\n }\n\n /**\n * Replace the whole branding; all fields `null` clears it. A changed image\n * or font address is fetched first and refused unless it answers with the\n * right kind of file. A stale `expected_revision` is refused and changes\n * nothing.\n *\n * `PUT /admin-portal/branding`\n */\n async update(\n params: BrandingUpdateRequest,\n options?: RequestExtras,\n ): Promise<BrandingAdminResponse> {\n return this.request('PUT', '/admin-portal/branding', { body: params, ...options });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-CR3JBTP3.cjs","../src/internal/resources/adminBranding.ts"],"names":[],"mappings":"AAAA;ACYO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,OAAA,EAAyD;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACnF;AACF,CAAA;ADbA;AACA;AACE;AACF,sCAAC","file":"/tmp/sdk-pub-04970/dist/chunk-CR3JBTP3.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../../client';\nimport type { BrandingAdminResponse, BrandingUpdateRequest } from '../types';\n\n/**\n * The deployment's branding as the platform operator edits it: name, logos,\n * favicon, email font and accent, and the default checkout, status page and\n * redirect page colours.\n *\n * Needs the admin API key or an internal user with permission to change\n * accounts, for reading too. Every change is recorded in the audit log as a\n * change of the setting `deployment.branding` (`entity_type: 'setting'`).\n */\nexport class AdminBranding {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * What is saved, the value in force for each unset field, and the revision\n * to send back on the next update.\n *\n * `GET /admin-portal/branding`\n */\n async retrieve(options?: RequestExtras): Promise<BrandingAdminResponse> {\n return this.request('GET', '/admin-portal/branding', { ...options });\n }\n\n /**\n * Replace the whole branding; all fields `null` clears it. A changed image\n * or font address is fetched first and refused unless it answers with the\n * right kind of file. A stale `expected_revision` is refused and changes\n * nothing.\n *\n * `PUT /admin-portal/branding`\n */\n async update(\n params: BrandingUpdateRequest,\n options?: RequestExtras,\n ): Promise<BrandingAdminResponse> {\n return this.request('PUT', '/admin-portal/branding', { body: params, ...options });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-DJASVBOJ.cjs","../src/resources/shopLabels.ts"],"names":[],"mappings":"AAAA;ACUA,IAAM,WAAA,EAAa,CAAC,UAAA,EAAA,GAClB,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,wBAAA,CAAA;AAcrC,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,IAAA,CAAK,UAAA,EAAkD;AAC3D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,UAAA,CAAW,UAAU,CAAC,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CAAO,UAAA,EAAoB,MAAA,EAA4D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,CAAW,UAAU,CAAA,EAAG,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAA,CACJ,UAAA,EACA,OAAA,EACA,MAAA,EAC4B;AAC5B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,CAAA,EAAA;AACrB,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAMiC,EAAA;AACD,IAAA;AAChC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUE,EAAA;AAGY,IAAA;AACV,MAAA;AACY,MAAA;AACG,MAAA;AACjB,IAAA;AACF,EAAA;AACF;ADjCkC;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-DJASVBOJ.cjs","sourcesContent":[null,"import type {\n ShopLabelCreateRequest,\n ShopLabelDeleteResponse,\n ShopLabelResponse,\n ShopLabelsResponse,\n ShopLabelsSetRequest,\n ShopLabelUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nconst labelsPath = (merchantId: string): string =>\n `/account/${encodeURIComponent(merchantId)}/business-profile/labels`;\n\n/**\n * Shop labels: the merchant's own tags for grouping shops, for example by\n * industry, brand or region. A shop can carry several\n * labels and a label is shared by every shop of the merchant. Labels are\n * separate from projects and change nothing about a shop's project, payments\n * or routing.\n *\n * Reading needs the `Account` area at `Read`; every change needs `Write`.\n * Renaming and deleting change every shop that carries the label, so a caller\n * limited to one shop may not do either; it may create labels and set its own\n * shop's labels. Labels of one merchant are never visible to another.\n */\nexport class ShopLabels {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every label of the merchant, ordered by name, each with the ids of the\n * shops that carry it. A shop with several labels appears under each of\n * them; a shop with none appears under no label. A caller limited to one\n * shop sees every label but only its own shop in `profile_ids`.\n * `GET /account/{merchantId}/business-profile/labels`\n */\n async list(merchantId: string): Promise<ShopLabelResponse[]> {\n return this.request('GET', labelsPath(merchantId));\n }\n\n /**\n * Create a label. The name is trimmed and inner whitespace collapsed; a\n * name that differs from an existing label only in letter case is refused\n * (`IR_38`), so one category is never spelled two ways. A merchant holds at\n * most 200 labels.\n * `POST /account/{merchantId}/business-profile/labels`\n */\n async create(merchantId: string, params: ShopLabelCreateRequest): Promise<ShopLabelResponse> {\n return this.request('POST', labelsPath(merchantId), { body: params });\n }\n\n /**\n * Rename a label on every shop that carries it.\n * `PATCH /account/{merchantId}/business-profile/labels/{labelId}`\n */\n async update(\n merchantId: string,\n labelId: string,\n params: ShopLabelUpdateRequest,\n ): Promise<ShopLabelResponse> {\n return this.request('PATCH', `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a label and remove it from every shop. The shops are unchanged.\n * `DELETE /account/{merchantId}/business-profile/labels/{labelId}`\n */\n async delete(merchantId: string, labelId: string): Promise<ShopLabelDeleteResponse> {\n return this.request('DELETE', `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`);\n }\n\n /**\n * Replace the labels of one shop: `label_ids` is the complete set\n * afterwards, so a label left out is removed from the shop and an empty\n * list removes them all. At most 20 per shop.\n * `PUT /account/{merchantId}/business-profile/{profileId}/labels`\n */\n async setForShop(\n merchantId: string,\n profileId: string,\n params: ShopLabelsSetRequest,\n ): Promise<ShopLabelsResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/labels`,\n { body: params },\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-DJASVBOJ.cjs","../src/resources/shopLabels.ts"],"names":[],"mappings":"AAAA;ACUA,IAAM,WAAA,EAAa,CAAC,UAAA,EAAA,GAClB,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,wBAAA,CAAA;AAcrC,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,IAAA,CAAK,UAAA,EAAkD;AAC3D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,UAAA,CAAW,UAAU,CAAC,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CAAO,UAAA,EAAoB,MAAA,EAA4D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,CAAW,UAAU,CAAA,EAAG,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAA,CACJ,UAAA,EACA,OAAA,EACA,MAAA,EAC4B;AAC5B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,CAAA,EAAA;AACrB,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAMiC,EAAA;AACD,IAAA;AAChC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUE,EAAA;AAGY,IAAA;AACV,MAAA;AACY,MAAA;AACG,MAAA;AACjB,IAAA;AACF,EAAA;AACF;ADjCkC;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-DJASVBOJ.cjs","sourcesContent":[null,"import type {\n ShopLabelCreateRequest,\n ShopLabelDeleteResponse,\n ShopLabelResponse,\n ShopLabelsResponse,\n ShopLabelsSetRequest,\n ShopLabelUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nconst labelsPath = (merchantId: string): string =>\n `/account/${encodeURIComponent(merchantId)}/business-profile/labels`;\n\n/**\n * Shop labels: the merchant's own tags for grouping shops, for example by\n * industry, brand or region. A shop can carry several\n * labels and a label is shared by every shop of the merchant. Labels are\n * separate from projects and change nothing about a shop's project, payments\n * or routing.\n *\n * Reading needs the `Account` area at `Read`; every change needs `Write`.\n * Renaming and deleting change every shop that carries the label, so a caller\n * limited to one shop may not do either; it may create labels and set its own\n * shop's labels. Labels of one merchant are never visible to another.\n */\nexport class ShopLabels {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every label of the merchant, ordered by name, each with the ids of the\n * shops that carry it. A shop with several labels appears under each of\n * them; a shop with none appears under no label. A caller limited to one\n * shop sees every label but only its own shop in `profile_ids`.\n * `GET /account/{merchantId}/business-profile/labels`\n */\n async list(merchantId: string): Promise<ShopLabelResponse[]> {\n return this.request('GET', labelsPath(merchantId));\n }\n\n /**\n * Create a label. The name is trimmed and inner whitespace collapsed; a\n * name that differs from an existing label only in letter case is refused\n * (`IR_38`), so one category is never spelled two ways. A merchant holds at\n * most 200 labels.\n * `POST /account/{merchantId}/business-profile/labels`\n */\n async create(merchantId: string, params: ShopLabelCreateRequest): Promise<ShopLabelResponse> {\n return this.request('POST', labelsPath(merchantId), { body: params });\n }\n\n /**\n * Rename a label on every shop that carries it.\n * `PATCH /account/{merchantId}/business-profile/labels/{labelId}`\n */\n async update(\n merchantId: string,\n labelId: string,\n params: ShopLabelUpdateRequest,\n ): Promise<ShopLabelResponse> {\n return this.request('PATCH', `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a label and remove it from every shop. The shops are unchanged.\n * `DELETE /account/{merchantId}/business-profile/labels/{labelId}`\n */\n async delete(merchantId: string, labelId: string): Promise<ShopLabelDeleteResponse> {\n return this.request('DELETE', `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`);\n }\n\n /**\n * Replace the labels of one shop: `label_ids` is the complete set\n * afterwards, so a label left out is removed from the shop and an empty\n * list removes them all. At most 20 per shop.\n * `PUT /account/{merchantId}/business-profile/{profileId}/labels`\n */\n async setForShop(\n merchantId: string,\n profileId: string,\n params: ShopLabelsSetRequest,\n ): Promise<ShopLabelsResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/labels`,\n { body: params },\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EEB2HDYL.cjs","../src/resources/industries.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAA,EAAoD;AACxD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAsB,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,WAAA,CACJ,MAAA,EACA,OAAA,EACiC;AACjC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB,EAAE,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A;AAEoB,IAAA;AACtB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASyE,EAAA;AAC5C,IAAA;AAC7B,EAAA;AACF;AAEgD;AACvC,EAAA;AACT;AAE6C;AACf,EAAA;AAC9B;AAE6C;AACjB,EAAA;AAC5B;AD1FgC;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EEB2HDYL.cjs","sourcesContent":[null,"import type {\n IndustryApplyQuery,\n IndustryChangeImpact,\n IndustryClassification,\n IndustryImpactQuery,\n IndustrySelectionRequest,\n IndustrySuggestQuery,\n IndustrySuggestions,\n OwnIndustry,\n OwnIndustryCreateRequest,\n OwnIndustryList,\n OwnIndustryRemoveQuery,\n OwnIndustryRemoved,\n OwnIndustryRenameRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * The industry of the caller's merchant, its projects and its shops.\n *\n * One primary industry per merchant, project or shop: an industry or a\n * sub-industry, which implies its industry. A shop without its own selection\n * inherits the nearest one of its project and that project's parents, then the\n * merchant's. A project inherits from its parents, then the merchant. Every\n * call answers the target's `IndustryClassification`: what is stored there,\n * what it inherits, what applies, what can be selected and whether the caller\n * may change it.\n *\n * Classification only: payments, routing, risk policies, the merchant\n * category code and shop labels do not read it, and a change writes none of\n * them. Every change is recorded in the audit log\n * (`entity_type: 'industry_selection'`).\n *\n * A payment counts in the industry its shop had when the payment was created.\n * Every write that changes a shop's industry takes an optional\n * `IndustryApplyQuery`: which of its existing payments follow the change\n * (`all`, the default; from a `from_date`; or from today). The `impact*`\n * methods preview how many would move before writing. Besides DeloPay's\n * industries, a merchant can define its own (`createOwn`), which only it sees\n * and selects.\n *\n * Dashboard (JWT) routes; the merchant comes from the token. Reading needs\n * `MerchantIndustryRead` (merchant, project) or `ProfileIndustryRead` (shop);\n * changing needs `MerchantIndustryWrite`, `MerchantIndustryEdit` or\n * `ProfileIndustryEdit`. A scope the caller may not address answers 403\n * (`IR_22`); a project or shop the merchant does not hold answers 404\n * (`IR_37`); an id that cannot be selected there answers 400 (`IR_16`).\n */\nexport class Industries {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's industry: the default its projects and shops inherit.\n *\n * `GET /industries/merchant`\n */\n async retrieveMerchant(): Promise<IndustryClassification> {\n return this.request('GET', '/industries/merchant');\n }\n\n /**\n * Select the merchant's industry.\n *\n * `PUT /industries/merchant`\n */\n async setMerchant(\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', '/industries/merchant', { body: params, query: { ...options } });\n }\n\n /**\n * Clear the merchant's industry.\n *\n * `DELETE /industries/merchant`\n */\n async clearMerchant(options?: IndustryApplyQuery): Promise<IndustryClassification> {\n return this.request('DELETE', '/industries/merchant', { query: { ...options } });\n }\n\n /**\n * One project's industry.\n *\n * `GET /industries/projects/{projectId}`\n */\n async retrieveProject(projectId: string): Promise<IndustryClassification> {\n return this.request('GET', projectPath(projectId));\n }\n\n /**\n * Select one project's industry.\n *\n * `PUT /industries/projects/{projectId}`\n */\n async setProject(\n projectId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', projectPath(projectId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one project's industry, so it inherits again.\n *\n * `DELETE /industries/projects/{projectId}`\n */\n async clearProject(\n projectId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', projectPath(projectId), { query: { ...options } });\n }\n\n /**\n * One shop's industry.\n *\n * `GET /industries/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<IndustryClassification> {\n return this.request('GET', shopPath(profileId));\n }\n\n /**\n * Select one shop's industry.\n *\n * `PUT /industries/shops/{profileId}`\n */\n async setShop(\n profileId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', shopPath(profileId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one shop's industry, so it inherits again.\n *\n * `DELETE /industries/shops/{profileId}`\n */\n async clearShop(\n profileId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', shopPath(profileId), { query: { ...options } });\n }\n\n /**\n * What selecting `industry_id` for the merchant (or clearing it, when\n * omitted) would move: the shops whose effective industry changes and their\n * payments, test and live, in total, from `from_date` and from today.\n * Writes nothing. Same permission as reading the classification.\n *\n * `GET /industries/merchant/impact`\n */\n async impactMerchant(query: IndustryImpactQuery = {}): Promise<IndustryChangeImpact> {\n return this.request('GET', '/industries/merchant/impact', { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one project's selection.\n *\n * `GET /industries/projects/{projectId}/impact`\n */\n async impactProject(\n projectId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${projectPath(projectId)}/impact`, { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one shop's selection.\n *\n * `GET /industries/shops/{profileId}/impact`\n */\n async impactShop(\n profileId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${shopPath(profileId)}/impact`, { query: { ...query } });\n }\n\n /**\n * The merchant's own industries: the active ones, and those mapped to one of\n * DeloPay's in the last 90 days, with the selections naming each. Needs\n * `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/own`\n */\n async listOwn(): Promise<OwnIndustryList> {\n return this.request('GET', '/industries/own');\n }\n\n /**\n * Define an industry only this merchant sees and selects, optionally under\n * one of DeloPay's industries it can select. It never has sub-industries; at\n * most 100 are active at once (422, `IR_06`). Needs `MerchantIndustryWrite`\n * at merchant level.\n *\n * `POST /industries/own`\n */\n async createOwn(params: OwnIndustryCreateRequest): Promise<OwnIndustry> {\n return this.request('POST', '/industries/own', { body: params });\n }\n\n /**\n * Rename an active own industry. With `apply_to` `from` or `today` the answer\n * is the new own industry that carries the new name (see\n * `OwnIndustryRenameRequest`). Needs `MerchantIndustryWrite`.\n *\n * `PATCH /industries/own/{industryId}`\n */\n async renameOwn(industryId: string, params: OwnIndustryRenameRequest): Promise<OwnIndustry> {\n return this.request('PATCH', ownPath(industryId), { body: params });\n }\n\n /**\n * Archive an active own industry. While a selection names it, `replacement`\n * is required: an industry the merchant can select, which every such\n * selection then names, or `'inherit'`, which clears them. The shops whose\n * industry changes move their payments from `apply_to` on. Needs\n * `MerchantIndustryWrite`.\n *\n * `DELETE /industries/own/{industryId}`\n */\n async removeOwn(\n industryId: string,\n query: OwnIndustryRemoveQuery = {},\n ): Promise<OwnIndustryRemoved> {\n return this.request('DELETE', ownPath(industryId), { query: { ...query } });\n }\n\n /**\n * At most three of DeloPay's industries and sub-industries the merchant can\n * select that are like `name`, closest first: a hint before defining an own\n * industry. Needs `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/suggest`\n */\n async suggest(query: IndustrySuggestQuery): Promise<IndustrySuggestions> {\n return this.request('GET', '/industries/suggest', { query: { ...query } });\n }\n}\n\nfunction projectPath(projectId: string): string {\n return `/industries/projects/${encodeURIComponent(projectId)}`;\n}\n\nfunction shopPath(profileId: string): string {\n return `/industries/shops/${encodeURIComponent(profileId)}`;\n}\n\nfunction ownPath(industryId: string): string {\n return `/industries/own/${encodeURIComponent(industryId)}`;\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-EEB2HDYL.cjs","../src/resources/industries.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAA,EAAoD;AACxD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAsB,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,WAAA,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AAAA;AASoC,EAAA;AACd,IAAA;AACtB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaE,EAAA;AAEoB,IAAA;AACtB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASyE,EAAA;AAC5C,IAAA;AAC7B,EAAA;AACF;AAEgD;AACvC,EAAA;AACT;AAE6C;AACf,EAAA;AAC9B;AAE6C;AACjB,EAAA;AAC5B;AD1FgC;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-EEB2HDYL.cjs","sourcesContent":[null,"import type {\n IndustryApplyQuery,\n IndustryChangeImpact,\n IndustryClassification,\n IndustryImpactQuery,\n IndustrySelectionRequest,\n IndustrySuggestQuery,\n IndustrySuggestions,\n OwnIndustry,\n OwnIndustryCreateRequest,\n OwnIndustryList,\n OwnIndustryRemoveQuery,\n OwnIndustryRemoved,\n OwnIndustryRenameRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * The industry of the caller's merchant, its projects and its shops.\n *\n * One primary industry per merchant, project or shop: an industry or a\n * sub-industry, which implies its industry. A shop without its own selection\n * inherits the nearest one of its project and that project's parents, then the\n * merchant's. A project inherits from its parents, then the merchant. Every\n * call answers the target's `IndustryClassification`: what is stored there,\n * what it inherits, what applies, what can be selected and whether the caller\n * may change it.\n *\n * Classification only: payments, routing, risk policies, the merchant\n * category code and shop labels do not read it, and a change writes none of\n * them. Every change is recorded in the audit log\n * (`entity_type: 'industry_selection'`).\n *\n * A payment counts in the industry its shop had when the payment was created.\n * Every write that changes a shop's industry takes an optional\n * `IndustryApplyQuery`: which of its existing payments follow the change\n * (`all`, the default; from a `from_date`; or from today). The `impact*`\n * methods preview how many would move before writing. Besides DeloPay's\n * industries, a merchant can define its own (`createOwn`), which only it sees\n * and selects.\n *\n * Dashboard (JWT) routes; the merchant comes from the token. Reading needs\n * `MerchantIndustryRead` (merchant, project) or `ProfileIndustryRead` (shop);\n * changing needs `MerchantIndustryWrite`, `MerchantIndustryEdit` or\n * `ProfileIndustryEdit`. A scope the caller may not address answers 403\n * (`IR_22`); a project or shop the merchant does not hold answers 404\n * (`IR_37`); an id that cannot be selected there answers 400 (`IR_16`).\n */\nexport class Industries {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's industry: the default its projects and shops inherit.\n *\n * `GET /industries/merchant`\n */\n async retrieveMerchant(): Promise<IndustryClassification> {\n return this.request('GET', '/industries/merchant');\n }\n\n /**\n * Select the merchant's industry.\n *\n * `PUT /industries/merchant`\n */\n async setMerchant(\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', '/industries/merchant', { body: params, query: { ...options } });\n }\n\n /**\n * Clear the merchant's industry.\n *\n * `DELETE /industries/merchant`\n */\n async clearMerchant(options?: IndustryApplyQuery): Promise<IndustryClassification> {\n return this.request('DELETE', '/industries/merchant', { query: { ...options } });\n }\n\n /**\n * One project's industry.\n *\n * `GET /industries/projects/{projectId}`\n */\n async retrieveProject(projectId: string): Promise<IndustryClassification> {\n return this.request('GET', projectPath(projectId));\n }\n\n /**\n * Select one project's industry.\n *\n * `PUT /industries/projects/{projectId}`\n */\n async setProject(\n projectId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', projectPath(projectId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one project's industry, so it inherits again.\n *\n * `DELETE /industries/projects/{projectId}`\n */\n async clearProject(\n projectId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', projectPath(projectId), { query: { ...options } });\n }\n\n /**\n * One shop's industry.\n *\n * `GET /industries/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<IndustryClassification> {\n return this.request('GET', shopPath(profileId));\n }\n\n /**\n * Select one shop's industry.\n *\n * `PUT /industries/shops/{profileId}`\n */\n async setShop(\n profileId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', shopPath(profileId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one shop's industry, so it inherits again.\n *\n * `DELETE /industries/shops/{profileId}`\n */\n async clearShop(\n profileId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', shopPath(profileId), { query: { ...options } });\n }\n\n /**\n * What selecting `industry_id` for the merchant (or clearing it, when\n * omitted) would move: the shops whose effective industry changes and their\n * payments, test and live, in total, from `from_date` and from today.\n * Writes nothing. Same permission as reading the classification.\n *\n * `GET /industries/merchant/impact`\n */\n async impactMerchant(query: IndustryImpactQuery = {}): Promise<IndustryChangeImpact> {\n return this.request('GET', '/industries/merchant/impact', { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one project's selection.\n *\n * `GET /industries/projects/{projectId}/impact`\n */\n async impactProject(\n projectId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${projectPath(projectId)}/impact`, { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one shop's selection.\n *\n * `GET /industries/shops/{profileId}/impact`\n */\n async impactShop(\n profileId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${shopPath(profileId)}/impact`, { query: { ...query } });\n }\n\n /**\n * The merchant's own industries: the active ones, and those mapped to one of\n * DeloPay's in the last 90 days, with the selections naming each. Needs\n * `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/own`\n */\n async listOwn(): Promise<OwnIndustryList> {\n return this.request('GET', '/industries/own');\n }\n\n /**\n * Define an industry only this merchant sees and selects, optionally under\n * one of DeloPay's industries it can select. It never has sub-industries; at\n * most 100 are active at once (422, `IR_06`). Needs `MerchantIndustryWrite`\n * at merchant level.\n *\n * `POST /industries/own`\n */\n async createOwn(params: OwnIndustryCreateRequest): Promise<OwnIndustry> {\n return this.request('POST', '/industries/own', { body: params });\n }\n\n /**\n * Rename an active own industry. With `apply_to` `from` or `today` the answer\n * is the new own industry that carries the new name (see\n * `OwnIndustryRenameRequest`). Needs `MerchantIndustryWrite`.\n *\n * `PATCH /industries/own/{industryId}`\n */\n async renameOwn(industryId: string, params: OwnIndustryRenameRequest): Promise<OwnIndustry> {\n return this.request('PATCH', ownPath(industryId), { body: params });\n }\n\n /**\n * Archive an active own industry. While a selection names it, `replacement`\n * is required: an industry the merchant can select, which every such\n * selection then names, or `'inherit'`, which clears them. The shops whose\n * industry changes move their payments from `apply_to` on. Needs\n * `MerchantIndustryWrite`.\n *\n * `DELETE /industries/own/{industryId}`\n */\n async removeOwn(\n industryId: string,\n query: OwnIndustryRemoveQuery = {},\n ): Promise<OwnIndustryRemoved> {\n return this.request('DELETE', ownPath(industryId), { query: { ...query } });\n }\n\n /**\n * At most three of DeloPay's industries and sub-industries the merchant can\n * select that are like `name`, closest first: a hint before defining an own\n * industry. Needs `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/suggest`\n */\n async suggest(query: IndustrySuggestQuery): Promise<IndustrySuggestions> {\n return this.request('GET', '/industries/suggest', { query: { ...query } });\n }\n}\n\nfunction projectPath(projectId: string): string {\n return `/industries/projects/${encodeURIComponent(projectId)}`;\n}\n\nfunction shopPath(profileId: string): string {\n return `/industries/shops/${encodeURIComponent(profileId)}`;\n}\n\nfunction ownPath(industryId: string): string {\n return `/industries/own/${encodeURIComponent(industryId)}`;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-ENPSUWTS.cjs","../src/internal/resources/connectorRestrictions.ts"],"names":[],"mappings":"AAAA;ACWO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAO,IAAA,EAAgF;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA,EAEA,MAAM,IAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAA+B,CAAA;AAAA,EAC5D;AAAA,EAEA,MAAM,QAAA,CAAS,aAAA,EAA8D;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,8BAAA,EAAiC,kBAAA,CAAmB,aAAa,CAAC,CAAA;AAAA,IAAA;AACpE,EAAA;AACF;AAAA,EAAA;AAIE,IAAA;AAAY,MAAA;AACV,MAAA;AACkE,IAAA;AACpE,EAAA;AAEJ;ADXA;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-ENPSUWTS.cjs","sourcesContent":[null,"import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-ENPSUWTS.cjs","../src/internal/resources/connectorRestrictions.ts"],"names":[],"mappings":"AAAA;ACWO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAO,IAAA,EAAgF;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA,EAEA,MAAM,IAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAA+B,CAAA;AAAA,EAC5D;AAAA,EAEA,MAAM,QAAA,CAAS,aAAA,EAA8D;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,8BAAA,EAAiC,kBAAA,CAAmB,aAAa,CAAC,CAAA;AAAA,IAAA;AACpE,EAAA;AACF;AAAA,EAAA;AAIE,IAAA;AAAY,MAAA;AACV,MAAA;AACkE,IAAA;AACpE,EAAA;AAEJ;ADXA;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-ENPSUWTS.cjs","sourcesContent":[null,"import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EQ6P6ZND.cjs","../src/feeProgram.ts"],"names":[],"mappings":"AAAA;ACoCO,SAAS,IAAA,CACd,GAAA,EACA,UAAA,EACA,KAAA,EACU;AACV,EAAA,MAAM,OAAA,EACJ,OAAO,MAAA,IAAU,SAAA,EAAW,EAAE,IAAA,EAAM,QAAA,EAAU,MAAM,EAAA,EAAI,EAAE,IAAA,EAAM,cAAA,EAAgB,MAAM,CAAA;AACxF,EAAA,OAAO,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAA,EAAK,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AACxD;AAOO,SAAS,YAAA,CACd,GAAA,EACA,UAAA,EACA,KAAA,EACU;AACV,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,GAAA,EAAK,UAAA;AAAA,IACL,UAAA;AAAA,IACA,KAAA,EAAO,EAAE,IAAA,EAAM,kBAAA,EAAoB,KAAA,EAAO,EAAE,GAAA,EAAK,MAAM,EAAE;AAAA,EAC3D,CAAA;AACF;AAGO,SAAS,KAAA,CA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AA;AAGO,SAAS,UAAA,CAAA,EAAgC;AAC9C,EAAA,OAAO,IAAI,iBAAA,CAAkB,CAAA;AAC/B;AD7MA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6VAAC","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EQ6P6ZND.cjs","sourcesContent":[null,"import type {\n Connector,\n Currency,\n EuclidComparison,\n EuclidComparisonType,\n EuclidIfStatement,\n EuclidValue,\n PaymentMethod,\n PlatformFeeKind,\n PlatformFeeOutput,\n PlatformFeeProgram,\n PlatformFeeRule,\n RuleSchedule,\n} from './types';\n\n/** A single condition leaf in the builder's condition tree. */\nexport interface LeafNode {\n kind: 'leaf';\n lhs: string;\n comparison: EuclidComparisonType;\n value: EuclidValue;\n}\n\n/** An AND (`all`) or OR (`any`) group of condition nodes. */\nexport interface GroupNode {\n kind: 'all' | 'any';\n children: ConditionNode[];\n}\n\nexport type ConditionNode = LeafNode | GroupNode;\n\n/**\n * A condition leaf. Numeric values (amount, merchant_volume) tag as `number`;\n * string values (payment_method, connector, currency, card_network) tag as\n * `enum_variant`.\n */\nexport function leaf(\n lhs: string,\n comparison: EuclidComparisonType,\n value: string | number,\n): LeafNode {\n const tagged: EuclidValue =\n typeof value === 'number' ? { type: 'number', value } : { type: 'enum_variant', value };\n return { kind: 'leaf', lhs, comparison, value: tagged };\n}\n\n/**\n * A condition on one entry of the payment's merchant-supplied metadata (the\n * `routing_parameters` string map). `equal` and `not_equal` compare the\n * stored string with `value`; a payment without the key never matches `equal`.\n */\nexport function metadataLeaf(\n key: string,\n comparison: 'equal' | 'not_equal',\n value: string,\n): LeafNode {\n return {\n kind: 'leaf',\n lhs: 'metadata',\n comparison,\n value: { type: 'metadata_variant', value: { key, value } },\n };\n}\n\n/** AND group — all children must match. */\nexport function allOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'all', children };\n}\n\n/** OR group — any child matching is enough. */\nexport function anyOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'any', children };\n}\n\n/**\n * How a rule (or the default) prices a transaction. `fee_type` is inferred:\n * percentage-only → `percentage`, flat-only → `flat`, both → `combined`.\n */\nexport interface FeeSpecInput {\n /** Percentage fee, e.g. `2.5` means 2.5%. */\n percentage?: number;\n /** Flat fee in minor units. */\n flat?: number;\n /** ISO 4217 currency for the flat fee. */\n flatCurrency?: string;\n /** Clamp floor in minor units. */\n min?: number;\n /** Clamp ceiling in minor units. */\n max?: number;\n}\n\n/**\n * Friendly conditions for a rule. Every provided key becomes one condition and\n * they are ANDed together. For dimensions not covered here (payment-method-type\n * keys like `crypto`/`wallet`, metadata, value arrays) use `rawConditions`.\n */\nexport interface FeeRuleConditions {\n paymentMethod?: PaymentMethod;\n connector?: Connector;\n currency?: Currency;\n cardNetwork?: string;\n /**\n * Customer billing-address country. Must be the exact backend `Country` enum\n * variant (PascalCase full name, e.g. `Germany`/`UnitedStatesOfAmerica`), not\n * an ISO code — the engine lowers `billing_country` via case-sensitive\n * `from_str`.\n */\n billingCountry?: string;\n /** `amount == n` (minor units). */\n amountEquals?: number;\n /** `amount > n` (minor units). */\n amountGreaterThan?: number;\n /** `amount < n` (minor units). */\n amountLessThan?: number;\n /**\n * `merchant_volume == n` — the merchant's previous-month volume snapshot\n * (USD minor units). Combine with any other condition, e.g.\n * `{ paymentMethod: 'crypto', merchantVolumeGreaterThan: 1_000_000 }`.\n */\n merchantVolumeEquals?: number;\n /** `merchant_volume > n` (USD minor units). */\n merchantVolumeGreaterThan?: number;\n /** `merchant_volume < n` (USD minor units). */\n merchantVolumeLessThan?: number;\n}\n\nexport interface FeeRuleInput {\n name: string;\n /** Friendly conditions (ANDed). Omit for an always-matching rule (prefer `otherwise`). */\n when?: FeeRuleConditions;\n /** Extra raw conditions ANDed in, for dimensions `when` does not cover. */\n rawConditions?: EuclidComparison[];\n /** Nested AND/OR condition tree. Mutually exclusive with `when`/`rawConditions`. */\n match?: ConditionNode;\n fee: FeeSpecInput;\n /**\n * A recurring window outside which the rule is skipped and the next rule or\n * `otherwise` applies. Omit for a rule that applies at all times.\n */\n schedule?: RuleSchedule;\n}\n\nfunction toFeeOutput(spec: FeeSpecInput): PlatformFeeOutput {\n const hasPct = spec.percentage != null;\n const hasFlat = spec.flat != null;\n const feeType: PlatformFeeKind = hasPct && hasFlat ? 'combined' : hasFlat ? 'flat' : 'percentage';\n return {\n fee_type: feeType,\n percentage_fee: spec.percentage ?? null,\n flat_fee_amount: spec.flat ?? null,\n flat_fee_currency: spec.flatCurrency ?? null,\n min_fee_amount: spec.min ?? null,\n max_fee_amount: spec.max ?? null,\n };\n}\n\nfunction enumCondition(lhs: string, value: string): EuclidComparison {\n return { lhs, comparison: 'equal', value: { type: 'enum_variant', value }, metadata: {} };\n}\n\nfunction numberCondition(\n lhs: string,\n comparison: EuclidComparisonType,\n value: number,\n): EuclidComparison {\n return { lhs, comparison, value: { type: 'number', value }, metadata: {} };\n}\n\nfunction buildConditions(\n when: FeeRuleConditions = {},\n raw: EuclidComparison[] = [],\n): EuclidComparison[] {\n const out: EuclidComparison[] = [];\n if (when.paymentMethod != null) out.push(enumCondition('payment_method', when.paymentMethod));\n if (when.connector != null) out.push(enumCondition('connector', when.connector));\n if (when.currency != null) out.push(enumCondition('currency', when.currency));\n if (when.cardNetwork != null) out.push(enumCondition('card_network', when.cardNetwork));\n if (when.billingCountry != null) out.push(enumCondition('billing_country', when.billingCountry));\n if (when.amountEquals != null) out.push(numberCondition('amount', 'equal', when.amountEquals));\n if (when.amountGreaterThan != null) {\n out.push(numberCondition('amount', 'greater_than', when.amountGreaterThan));\n }\n if (when.amountLessThan != null) {\n out.push(numberCondition('amount', 'less_than', when.amountLessThan));\n }\n if (when.merchantVolumeEquals != null) {\n out.push(numberCondition('merchant_volume', 'equal', when.merchantVolumeEquals));\n }\n if (when.merchantVolumeGreaterThan != null) {\n out.push(numberCondition('merchant_volume', 'greater_than', when.merchantVolumeGreaterThan));\n }\n if (when.merchantVolumeLessThan != null) {\n out.push(numberCondition('merchant_volume', 'less_than', when.merchantVolumeLessThan));\n }\n out.push(...raw);\n return out;\n}\n\nfunction leafToComparison(node: LeafNode): EuclidComparison {\n return { lhs: node.lhs, comparison: node.comparison, value: node.value, metadata: {} };\n}\n\n/**\n * Flatten associativity (nested all-in-all / any-in-any) and collapse\n * single-child groups, so every group child of an `all` is an `any`.\n * @internal\n */\nexport function normalizeNode(node: ConditionNode): ConditionNode {\n if (node.kind === 'leaf') return node;\n const children = node.children.map(normalizeNode);\n const flat: ConditionNode[] = [];\n for (const c of children) {\n if (c.kind === node.kind) flat.push(...c.children);\n else flat.push(c);\n }\n if (flat.length === 1) return flat[0];\n return { kind: node.kind, children: flat };\n}\n\nfunction toStatement(node: ConditionNode): EuclidIfStatement {\n if (node.kind === 'leaf') return { condition: [leafToComparison(node)], nested: null };\n // Unreachable via current callers (encodeStatements strips top-level any); kept for totality.\n if (node.kind === 'any') {\n return { condition: [], nested: node.children.map(toStatement) };\n }\n // 'all': after normalize, group children are all 'any'.\n const leaves = node.children.filter((c): c is LeafNode => c.kind === 'leaf');\n const groups = node.children.filter((c): c is GroupNode => c.kind !== 'leaf');\n const condition = leaves.map(leafToComparison);\n if (groups.length === 0) return { condition, nested: null };\n const [first, ...rest] = groups;\n // `first` is an OR; AND each of its branches with the remaining OR groups.\n const nested = first.children.map((branch) => toStatement(normalizeNode(allOf(branch, ...rest))));\n return { condition, nested };\n}\n\nfunction assertNoEmptyAnyOf(node: ConditionNode): void {\n if (node.kind === 'leaf') return;\n if (node.kind === 'any' && node.children.length === 0) {\n throw new Error('feeProgram: an anyOf() group must have at least one condition');\n }\n node.children.forEach(assertNoEmptyAnyOf);\n}\n\n/**\n * Encode a rule's match (a condition tree) into the engine's `statements[]`.\n * A top-level OR spreads across statements; anything else is a single statement.\n * @internal\n */\nexport function encodeStatements(match: ConditionNode): EuclidIfStatement[] {\n const m = normalizeNode(match);\n if (m.kind === 'any') return m.children.map(toStatement);\n return [toStatement(m)];\n}\n\nfunction comparisonToLeaf(c: EuclidComparison): LeafNode {\n return { kind: 'leaf', lhs: c.lhs, comparison: c.comparison, value: c.value };\n}\n\nfunction statementToNode(stmt: EuclidIfStatement): ConditionNode {\n const leaves = stmt.condition.map(comparisonToLeaf);\n if (stmt.nested && stmt.nested.length > 0) {\n const orNode = anyOf(...stmt.nested.map(statementToNode));\n if (leaves.length === 0) return orNode;\n return allOf(...leaves, orNode);\n }\n return leaves.length === 1 ? leaves[0] : allOf(...leaves);\n}\n\n/**\n * Decode a rule's `statements[]` back into a condition tree.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function ruleMatchToTree(statements: EuclidIfStatement[]): ConditionNode {\n if (statements.length === 1) return normalizeNode(statementToNode(statements[0]));\n return normalizeNode(anyOf(...statements.map(statementToNode)));\n}\n\n/**\n * Decode a stored program into the builder's editable model.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function programToTree(program: PlatformFeeProgram): {\n rules: {\n name: string;\n match: ConditionNode;\n fee: PlatformFeeOutput | null;\n schedule: RuleSchedule | null;\n }[];\n otherwise: PlatformFeeOutput | null;\n} {\n return {\n rules: program.rules.map((r) => ({\n name: r.name,\n match: ruleMatchToTree(r.statements),\n fee: r.connectorSelection.fee ?? null,\n schedule: r.connectorSelection.schedule ?? null,\n })),\n otherwise: program.defaultSelection.fee ?? null,\n };\n}\n\n/**\n * Fluent builder for a platform fee-rule program. Emits the exact Euclid wire\n * shape (camelCase tree, tagged values, `metadata: {}` everywhere) so callers\n * never hand-write the AST. Rules are evaluated in order; the first match wins,\n * else `otherwise` (the default selection).\n *\n * @example\n * ```ts\n * const algorithm = feeProgram()\n * .rule({ name: 'crypto', when: { paymentMethod: 'crypto' }, fee: { percentage: 1.0 } })\n * .rule({\n * name: 'card_on_cryptomus',\n * when: { paymentMethod: 'card', connector: 'cryptomus' },\n * fee: { percentage: 2.0 },\n * })\n * .otherwise({ percentage: 3.0 })\n * .build();\n *\n * await delopay.fees.rules.upsert({ algorithm }, merchantId);\n * ```\n */\nexport class FeeProgramBuilder {\n private readonly rules: PlatformFeeRule[] = [];\n private defaultFee: PlatformFeeOutput | null = null;\n\n /** Append a rule. Provided `when`/`rawConditions` are ANDed. */\n rule(input: FeeRuleInput): this {\n if (input.match) assertNoEmptyAnyOf(input.match);\n const statements: PlatformFeeRule['statements'] = input.match\n ? encodeStatements(input.match)\n : [{ condition: buildConditions(input.when, input.rawConditions) }];\n const connectorSelection: PlatformFeeRule['connectorSelection'] = {\n fee: toFeeOutput(input.fee),\n };\n if (input.schedule !== undefined) connectorSelection.schedule = input.schedule;\n this.rules.push({ name: input.name, connectorSelection, statements });\n return this;\n }\n\n /** Set the default selection (applied when no rule matches). */\n otherwise(fee: FeeSpecInput): this {\n this.defaultFee = toFeeOutput(fee);\n return this;\n }\n\n /** Produce the wire-ready program. */\n build(): PlatformFeeProgram {\n return {\n defaultSelection: { fee: this.defaultFee },\n rules: this.rules,\n metadata: {},\n };\n }\n}\n\n/** Start building a platform fee-rule program. See {@link FeeProgramBuilder}. */\nexport function feeProgram(): FeeProgramBuilder {\n return new FeeProgramBuilder();\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-EQ6P6ZND.cjs","../src/feeProgram.ts"],"names":[],"mappings":"AAAA;ACoCO,SAAS,IAAA,CACd,GAAA,EACA,UAAA,EACA,KAAA,EACU;AACV,EAAA,MAAM,OAAA,EACJ,OAAO,MAAA,IAAU,SAAA,EAAW,EAAE,IAAA,EAAM,QAAA,EAAU,MAAM,EAAA,EAAI,EAAE,IAAA,EAAM,cAAA,EAAgB,MAAM,CAAA;AACxF,EAAA,OAAO,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAA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AAA,EAAyB;AACjC,IAAA,IAAA,CAAK,WAAA,EAAa,WAAA,CAAY,GAAG,CAAA;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA,EAGA,KAAA,CAAA,EAA4B;AAC1B,IAAA,OAAO;AAAA,MACL,gBAAA,EAAkB,EAAE,GAAA,EAAK,IAAA,CAAK,WAAW,CAAA;AAAA,MACzC,KAAA,EAAO,IAAA,CAAK,KAAA;AAAA,MACZ,QAAA,EAAU,CAAC;AAAA,IACb,CAAA;AAAA,EACF;AACF,CAAA;AAGO,SAAS,UAAA,CAAA,EAAgC;AAC9C,EAAA,OAAO,IAAI,iBAAA,CAAkB,CAAA;AAC/B;AD7MA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6VAAC","file":"/tmp/sdk-pub-04970/dist/chunk-EQ6P6ZND.cjs","sourcesContent":[null,"import type {\n Connector,\n Currency,\n EuclidComparison,\n EuclidComparisonType,\n EuclidIfStatement,\n EuclidValue,\n PaymentMethod,\n PlatformFeeKind,\n PlatformFeeOutput,\n PlatformFeeProgram,\n PlatformFeeRule,\n RuleSchedule,\n} from './types';\n\n/** A single condition leaf in the builder's condition tree. */\nexport interface LeafNode {\n kind: 'leaf';\n lhs: string;\n comparison: EuclidComparisonType;\n value: EuclidValue;\n}\n\n/** An AND (`all`) or OR (`any`) group of condition nodes. */\nexport interface GroupNode {\n kind: 'all' | 'any';\n children: ConditionNode[];\n}\n\nexport type ConditionNode = LeafNode | GroupNode;\n\n/**\n * A condition leaf. Numeric values (amount, merchant_volume) tag as `number`;\n * string values (payment_method, connector, currency, card_network) tag as\n * `enum_variant`.\n */\nexport function leaf(\n lhs: string,\n comparison: EuclidComparisonType,\n value: string | number,\n): LeafNode {\n const tagged: EuclidValue =\n typeof value === 'number' ? { type: 'number', value } : { type: 'enum_variant', value };\n return { kind: 'leaf', lhs, comparison, value: tagged };\n}\n\n/**\n * A condition on one entry of the payment's merchant-supplied metadata (the\n * `routing_parameters` string map). `equal` and `not_equal` compare the\n * stored string with `value`; a payment without the key never matches `equal`.\n */\nexport function metadataLeaf(\n key: string,\n comparison: 'equal' | 'not_equal',\n value: string,\n): LeafNode {\n return {\n kind: 'leaf',\n lhs: 'metadata',\n comparison,\n value: { type: 'metadata_variant', value: { key, value } },\n };\n}\n\n/** AND group — all children must match. */\nexport function allOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'all', children };\n}\n\n/** OR group — any child matching is enough. */\nexport function anyOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'any', children };\n}\n\n/**\n * How a rule (or the default) prices a transaction. `fee_type` is inferred:\n * percentage-only → `percentage`, flat-only → `flat`, both → `combined`.\n */\nexport interface FeeSpecInput {\n /** Percentage fee, e.g. `2.5` means 2.5%. */\n percentage?: number;\n /** Flat fee in minor units. */\n flat?: number;\n /** ISO 4217 currency for the flat fee. */\n flatCurrency?: string;\n /** Clamp floor in minor units. */\n min?: number;\n /** Clamp ceiling in minor units. */\n max?: number;\n}\n\n/**\n * Friendly conditions for a rule. Every provided key becomes one condition and\n * they are ANDed together. For dimensions not covered here (payment-method-type\n * keys like `crypto`/`wallet`, metadata, value arrays) use `rawConditions`.\n */\nexport interface FeeRuleConditions {\n paymentMethod?: PaymentMethod;\n connector?: Connector;\n currency?: Currency;\n cardNetwork?: string;\n /**\n * Customer billing-address country. Must be the exact backend `Country` enum\n * variant (PascalCase full name, e.g. `Germany`/`UnitedStatesOfAmerica`), not\n * an ISO code — the engine lowers `billing_country` via case-sensitive\n * `from_str`.\n */\n billingCountry?: string;\n /** `amount == n` (minor units). */\n amountEquals?: number;\n /** `amount > n` (minor units). */\n amountGreaterThan?: number;\n /** `amount < n` (minor units). */\n amountLessThan?: number;\n /**\n * `merchant_volume == n` — the merchant's previous-month volume snapshot\n * (USD minor units). Combine with any other condition, e.g.\n * `{ paymentMethod: 'crypto', merchantVolumeGreaterThan: 1_000_000 }`.\n */\n merchantVolumeEquals?: number;\n /** `merchant_volume > n` (USD minor units). */\n merchantVolumeGreaterThan?: number;\n /** `merchant_volume < n` (USD minor units). */\n merchantVolumeLessThan?: number;\n}\n\nexport interface FeeRuleInput {\n name: string;\n /** Friendly conditions (ANDed). Omit for an always-matching rule (prefer `otherwise`). */\n when?: FeeRuleConditions;\n /** Extra raw conditions ANDed in, for dimensions `when` does not cover. */\n rawConditions?: EuclidComparison[];\n /** Nested AND/OR condition tree. Mutually exclusive with `when`/`rawConditions`. */\n match?: ConditionNode;\n fee: FeeSpecInput;\n /**\n * A recurring window outside which the rule is skipped and the next rule or\n * `otherwise` applies. Omit for a rule that applies at all times.\n */\n schedule?: RuleSchedule;\n}\n\nfunction toFeeOutput(spec: FeeSpecInput): PlatformFeeOutput {\n const hasPct = spec.percentage != null;\n const hasFlat = spec.flat != null;\n const feeType: PlatformFeeKind = hasPct && hasFlat ? 'combined' : hasFlat ? 'flat' : 'percentage';\n return {\n fee_type: feeType,\n percentage_fee: spec.percentage ?? null,\n flat_fee_amount: spec.flat ?? null,\n flat_fee_currency: spec.flatCurrency ?? null,\n min_fee_amount: spec.min ?? null,\n max_fee_amount: spec.max ?? null,\n };\n}\n\nfunction enumCondition(lhs: string, value: string): EuclidComparison {\n return { lhs, comparison: 'equal', value: { type: 'enum_variant', value }, metadata: {} };\n}\n\nfunction numberCondition(\n lhs: string,\n comparison: EuclidComparisonType,\n value: number,\n): EuclidComparison {\n return { lhs, comparison, value: { type: 'number', value }, metadata: {} };\n}\n\nfunction buildConditions(\n when: FeeRuleConditions = {},\n raw: EuclidComparison[] = [],\n): EuclidComparison[] {\n const out: EuclidComparison[] = [];\n if (when.paymentMethod != null) out.push(enumCondition('payment_method', when.paymentMethod));\n if (when.connector != null) out.push(enumCondition('connector', when.connector));\n if (when.currency != null) out.push(enumCondition('currency', when.currency));\n if (when.cardNetwork != null) out.push(enumCondition('card_network', when.cardNetwork));\n if (when.billingCountry != null) out.push(enumCondition('billing_country', when.billingCountry));\n if (when.amountEquals != null) out.push(numberCondition('amount', 'equal', when.amountEquals));\n if (when.amountGreaterThan != null) {\n out.push(numberCondition('amount', 'greater_than', when.amountGreaterThan));\n }\n if (when.amountLessThan != null) {\n out.push(numberCondition('amount', 'less_than', when.amountLessThan));\n }\n if (when.merchantVolumeEquals != null) {\n out.push(numberCondition('merchant_volume', 'equal', when.merchantVolumeEquals));\n }\n if (when.merchantVolumeGreaterThan != null) {\n out.push(numberCondition('merchant_volume', 'greater_than', when.merchantVolumeGreaterThan));\n }\n if (when.merchantVolumeLessThan != null) {\n out.push(numberCondition('merchant_volume', 'less_than', when.merchantVolumeLessThan));\n }\n out.push(...raw);\n return out;\n}\n\nfunction leafToComparison(node: LeafNode): EuclidComparison {\n return { lhs: node.lhs, comparison: node.comparison, value: node.value, metadata: {} };\n}\n\n/**\n * Flatten associativity (nested all-in-all / any-in-any) and collapse\n * single-child groups, so every group child of an `all` is an `any`.\n * @internal\n */\nexport function normalizeNode(node: ConditionNode): ConditionNode {\n if (node.kind === 'leaf') return node;\n const children = node.children.map(normalizeNode);\n const flat: ConditionNode[] = [];\n for (const c of children) {\n if (c.kind === node.kind) flat.push(...c.children);\n else flat.push(c);\n }\n if (flat.length === 1) return flat[0];\n return { kind: node.kind, children: flat };\n}\n\nfunction toStatement(node: ConditionNode): EuclidIfStatement {\n if (node.kind === 'leaf') return { condition: [leafToComparison(node)], nested: null };\n // Unreachable via current callers (encodeStatements strips top-level any); kept for totality.\n if (node.kind === 'any') {\n return { condition: [], nested: node.children.map(toStatement) };\n }\n // 'all': after normalize, group children are all 'any'.\n const leaves = node.children.filter((c): c is LeafNode => c.kind === 'leaf');\n const groups = node.children.filter((c): c is GroupNode => c.kind !== 'leaf');\n const condition = leaves.map(leafToComparison);\n if (groups.length === 0) return { condition, nested: null };\n const [first, ...rest] = groups;\n // `first` is an OR; AND each of its branches with the remaining OR groups.\n const nested = first.children.map((branch) => toStatement(normalizeNode(allOf(branch, ...rest))));\n return { condition, nested };\n}\n\nfunction assertNoEmptyAnyOf(node: ConditionNode): void {\n if (node.kind === 'leaf') return;\n if (node.kind === 'any' && node.children.length === 0) {\n throw new Error('feeProgram: an anyOf() group must have at least one condition');\n }\n node.children.forEach(assertNoEmptyAnyOf);\n}\n\n/**\n * Encode a rule's match (a condition tree) into the engine's `statements[]`.\n * A top-level OR spreads across statements; anything else is a single statement.\n * @internal\n */\nexport function encodeStatements(match: ConditionNode): EuclidIfStatement[] {\n const m = normalizeNode(match);\n if (m.kind === 'any') return m.children.map(toStatement);\n return [toStatement(m)];\n}\n\nfunction comparisonToLeaf(c: EuclidComparison): LeafNode {\n return { kind: 'leaf', lhs: c.lhs, comparison: c.comparison, value: c.value };\n}\n\nfunction statementToNode(stmt: EuclidIfStatement): ConditionNode {\n const leaves = stmt.condition.map(comparisonToLeaf);\n if (stmt.nested && stmt.nested.length > 0) {\n const orNode = anyOf(...stmt.nested.map(statementToNode));\n if (leaves.length === 0) return orNode;\n return allOf(...leaves, orNode);\n }\n return leaves.length === 1 ? leaves[0] : allOf(...leaves);\n}\n\n/**\n * Decode a rule's `statements[]` back into a condition tree.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function ruleMatchToTree(statements: EuclidIfStatement[]): ConditionNode {\n if (statements.length === 1) return normalizeNode(statementToNode(statements[0]));\n return normalizeNode(anyOf(...statements.map(statementToNode)));\n}\n\n/**\n * Decode a stored program into the builder's editable model.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function programToTree(program: PlatformFeeProgram): {\n rules: {\n name: string;\n match: ConditionNode;\n fee: PlatformFeeOutput | null;\n schedule: RuleSchedule | null;\n }[];\n otherwise: PlatformFeeOutput | null;\n} {\n return {\n rules: program.rules.map((r) => ({\n name: r.name,\n match: ruleMatchToTree(r.statements),\n fee: r.connectorSelection.fee ?? null,\n schedule: r.connectorSelection.schedule ?? null,\n })),\n otherwise: program.defaultSelection.fee ?? null,\n };\n}\n\n/**\n * Fluent builder for a platform fee-rule program. Emits the exact Euclid wire\n * shape (camelCase tree, tagged values, `metadata: {}` everywhere) so callers\n * never hand-write the AST. Rules are evaluated in order; the first match wins,\n * else `otherwise` (the default selection).\n *\n * @example\n * ```ts\n * const algorithm = feeProgram()\n * .rule({ name: 'crypto', when: { paymentMethod: 'crypto' }, fee: { percentage: 1.0 } })\n * .rule({\n * name: 'card_on_cryptomus',\n * when: { paymentMethod: 'card', connector: 'cryptomus' },\n * fee: { percentage: 2.0 },\n * })\n * .otherwise({ percentage: 3.0 })\n * .build();\n *\n * await delopay.fees.rules.upsert({ algorithm }, merchantId);\n * ```\n */\nexport class FeeProgramBuilder {\n private readonly rules: PlatformFeeRule[] = [];\n private defaultFee: PlatformFeeOutput | null = null;\n\n /** Append a rule. Provided `when`/`rawConditions` are ANDed. */\n rule(input: FeeRuleInput): this {\n if (input.match) assertNoEmptyAnyOf(input.match);\n const statements: PlatformFeeRule['statements'] = input.match\n ? encodeStatements(input.match)\n : [{ condition: buildConditions(input.when, input.rawConditions) }];\n const connectorSelection: PlatformFeeRule['connectorSelection'] = {\n fee: toFeeOutput(input.fee),\n };\n if (input.schedule !== undefined) connectorSelection.schedule = input.schedule;\n this.rules.push({ name: input.name, connectorSelection, statements });\n return this;\n }\n\n /** Set the default selection (applied when no rule matches). */\n otherwise(fee: FeeSpecInput): this {\n this.defaultFee = toFeeOutput(fee);\n return this;\n }\n\n /** Produce the wire-ready program. */\n build(): PlatformFeeProgram {\n return {\n defaultSelection: { fee: this.defaultFee },\n rules: this.rules,\n metadata: {},\n };\n }\n}\n\n/** Start building a platform fee-rule program. See {@link FeeProgramBuilder}. */\nexport function feeProgram(): FeeProgramBuilder {\n return new FeeProgramBuilder();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EXPWQBI3.cjs","../src/resources/files.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,MAAA,CAAO,MAAA,EAAmE;AAC9E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,QAAA,EAAU,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACxD;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,MAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,OAAA,EAAU,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACjE,EAAA;AAAA;AAG+D,EAAA;AACF,IAAA;AAC7D,EAAA;AACF;ADDoE;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EXPWQBI3.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\n\nexport class Files {\n constructor(private readonly request: RequestFn) {}\n\n /** Upload a file. `POST /files` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/files', { body: params });\n }\n\n /** Retrieve/download a file. `GET /files/{fileId}` */\n async retrieve(fileId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/files/${encodeURIComponent(fileId)}`);\n }\n\n /** Delete a file. `DELETE /files/{fileId}` */\n async delete(fileId: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/files/${encodeURIComponent(fileId)}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-EXPWQBI3.cjs","../src/resources/files.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,MAAA,CAAO,MAAA,EAAmE;AAC9E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,QAAA,EAAU,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACxD;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,MAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,OAAA,EAAU,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACjE,EAAA;AAAA;AAG+D,EAAA;AACF,IAAA;AAC7D,EAAA;AACF;ADDoE;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-EXPWQBI3.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\n\nexport class Files {\n constructor(private readonly request: RequestFn) {}\n\n /** Upload a file. `POST /files` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/files', { body: params });\n }\n\n /** Retrieve/download a file. `GET /files/{fileId}` */\n async retrieve(fileId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/files/${encodeURIComponent(fileId)}`);\n }\n\n /** Delete a file. `DELETE /files/{fileId}` */\n async delete(fileId: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/files/${encodeURIComponent(fileId)}`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-EYHSXJMJ.cjs","../src/resources/persons.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACwCO,IAAM,QAAA,EAAN,MAAc;AAAA,EACnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,E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sourcesContent":[null,"import type {\n MerchantFlaggedPersonList,\n MerchantFlaggedPersonListParams,\n MerchantPersonFlagCreate,\n MerchantPersonFlagList,\n MerchantPersonFlagUpdate,\n MerchantPersonFlagView,\n PaymentPersonResponse,\n PersonListParams,\n PersonListResponse,\n PersonResponse,\n PersonScopeParams,\n RelatedPersonsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Persons: the payments of one merchant that belong to the same person,\n * joined by a shared customer id, email, device id or card. Two payments\n * that share one of them are one person, also through a chain of payments.\n * An IP address is shown and never joins. An identifier seen with too many\n * different persons is marked `common` and joins nothing.\n *\n * A payment gets its person a few minutes after it was created or changed;\n * until then it has none. When two persons turn out to be one, the older\n * `person_id` stays and the other id keeps resolving to it.\n *\n * Every route takes an API key or a dashboard session. A full secret key\n * reads; a restricted key needs the `persons_view` permission group; a\n * dashboard session needs the persons permission in its role. A credential\n * bound to one shop reads that shop's persons, with every figure counted\n * there. A caller that sees only part of a shop's payments is refused with\n * `403`.\n *\n * The merchant's own flags on its persons (`listFlags`, `flag`, `updateFlag`,\n * `removeFlag`, `listFlagged`) take a dashboard session only, never an API\n * key. Reading them needs the persons permission; setting, changing and\n * removing them needs the persons manage permission. A flag marks a person as\n * suspicious for the merchant's own team: it changes no payment, and no other\n * merchant sees it.\n */\nexport class Persons {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of persons, by default the most recent payment first, with the\n * number of persons the request matches.\n * `GET /persons`\n */\n async list(params?: PersonListParams): Promise<PersonListResponse> {\n return this.request('GET', '/persons', {\n query: csvQuery(params, ['buyer_risk_band', 'industry']),\n });\n }\n\n /**\n * One person: its figures, the identifiers and IP addresses its payments\n * carry, and its payments by status, shop, payment method, risk band and\n * environment. The id of a person that was merged into another returns\n * that person, with `merged_from` naming the id asked for. A person with\n * no payment in the scope is not found (`404`).\n * `GET /persons/{person_id}`\n */\n async retrieve(personId: string, params?: PersonScopeParams): Promise<PersonResponse> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Other persons of the merchant that may be the same person, the likeliest\n * first, at most 20. An estimate from the devices the persons paid with;\n * related persons stay separate persons.\n * `GET /persons/{person_id}/related`\n */\n async related(personId: string, params?: PersonScopeParams): Promise<RelatedPersonsResponse> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}/related`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * The person of one payment, with how many payments the person has and\n * which kinds of identifier tie this payment to the others. `404` while\n * the payment has no person yet.\n * `GET /persons/payment/{payment_id}`\n */\n async ofPayment(paymentId: string, params?: PersonScopeParams): Promise<PaymentPersonResponse> {\n return this.request('GET', `/persons/payment/${encodeURIComponent(paymentId)}`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Every flag the merchant's team set on the person, active and removed,\n * newest first, with those of the persons merged into it. A merged person\n * reads as the person it merged into. A person with no payment in the\n * scope, or another merchant's, is not found (`404`).\n * `GET /persons/{person_id}/flags`\n */\n async listFlags(personId: string, params?: PersonScopeParams): Promise<MerchantPersonFlagList> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}/flags`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Flags the person for the merchant's team, with a reason and an optional\n * note. A merged person's flag goes on the person it merged into. A person\n * already flagged is refused with `IR_38` (400).\n * `POST /persons/{person_id}/flags`\n */\n async flag(\n personId: string,\n body: MerchantPersonFlagCreate,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request('POST', `/persons/${encodeURIComponent(personId)}/flags`, {\n body,\n query: params as Query | undefined,\n });\n }\n\n /**\n * Replaces an active flag's reason and note at the `version` read. A\n * colleague's newer change, or a removal, since that read is refused with\n * `IR_16` (400) rather than overwritten.\n * `PUT /persons/{person_id}/flags/{flag_id}`\n */\n async updateFlag(\n personId: string,\n flagId: string,\n body: MerchantPersonFlagUpdate,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request(\n 'PUT',\n `/persons/${encodeURIComponent(personId)}/flags/${encodeURIComponent(flagId)}`,\n { body, query: params as Query | undefined },\n );\n }\n\n /**\n * Removes a flag at the `version` read: the flag stops and stays in the\n * history with who removed it and when, which is what this answers. A\n * colleague's change since that read is refused with `IR_16` (400).\n * `DELETE /persons/{person_id}/flags/{flag_id}?version=`\n */\n async removeFlag(\n personId: string,\n flagId: string,\n version: number,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request(\n 'DELETE',\n `/persons/${encodeURIComponent(personId)}/flags/${encodeURIComponent(flagId)}`,\n { query: { ...(params as Query | undefined), version } },\n );\n }\n\n /**\n * One page of the persons in scope with an active flag of the merchant,\n * each once with its newest active flag, newest flag first, and how many\n * there are over every page. A `limit` outside 1 to 100 is a `400`.\n * `GET /persons/flagged`\n */\n async listFlagged(params?: MerchantFlaggedPersonListParams): Promise<MerchantFlaggedPersonList> {\n return this.request('GET', '/persons/flagged', { query: params as Query | undefined });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-EYHSXJMJ.cjs","../src/resources/persons.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACwCO,IAAM,QAAA,EAAN,MAAc;AAAA,EACnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,EAAwD;AACjE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,UAAA,EAAY;AAAA,MACrC,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,iBAAA,EAAmB,UAAU,CAAC;AAAA,IACzD,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,QAAA,CAAS,QAAA,EAAkB,MAAA,EAAqD;AACpF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC1D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ6F,EAAA;AACxB,IAAA;AAC1D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ+F,EAAA;AAC3B,IAAA;AACzD,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS+F,EAAA;AAC1B,IAAA;AAC1D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYmC,EAAA;AACmC,IAAA;AAClE,MAAA;AACO,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACrB,IAAA;AACV,MAAA;AACkD,MAAA;AACP,MAAA;AAC7C,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACrB,IAAA;AACV,MAAA;AACkD,MAAA;AACK,MAAA;AACzD,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQgG,EAAA;AACT,IAAA;AACvF,EAAA;AACF;AD3DwE;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-EYHSXJMJ.cjs","sourcesContent":[null,"import type {\n MerchantFlaggedPersonList,\n MerchantFlaggedPersonListParams,\n MerchantPersonFlagCreate,\n MerchantPersonFlagList,\n MerchantPersonFlagUpdate,\n MerchantPersonFlagView,\n PaymentPersonResponse,\n PersonListParams,\n PersonListResponse,\n PersonResponse,\n PersonScopeParams,\n RelatedPersonsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Persons: the payments of one merchant that belong to the same person,\n * joined by a shared customer id, email, device id or card. Two payments\n * that share one of them are one person, also through a chain of payments.\n * An IP address is shown and never joins. An identifier seen with too many\n * different persons is marked `common` and joins nothing.\n *\n * A payment gets its person a few minutes after it was created or changed;\n * until then it has none. When two persons turn out to be one, the older\n * `person_id` stays and the other id keeps resolving to it.\n *\n * Every route takes an API key or a dashboard session. A full secret key\n * reads; a restricted key needs the `persons_view` permission group; a\n * dashboard session needs the persons permission in its role. A credential\n * bound to one shop reads that shop's persons, with every figure counted\n * there. A caller that sees only part of a shop's payments is refused with\n * `403`.\n *\n * The merchant's own flags on its persons (`listFlags`, `flag`, `updateFlag`,\n * `removeFlag`, `listFlagged`) take a dashboard session only, never an API\n * key. Reading them needs the persons permission; setting, changing and\n * removing them needs the persons manage permission. A flag marks a person as\n * suspicious for the merchant's own team: it changes no payment, and no other\n * merchant sees it.\n */\nexport class Persons {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of persons, by default the most recent payment first, with the\n * number of persons the request matches.\n * `GET /persons`\n */\n async list(params?: PersonListParams): Promise<PersonListResponse> {\n return this.request('GET', '/persons', {\n query: csvQuery(params, ['buyer_risk_band', 'industry']),\n });\n }\n\n /**\n * One person: its figures, the identifiers and IP addresses its payments\n * carry, and its payments by status, shop, payment method, risk band and\n * environment. The id of a person that was merged into another returns\n * that person, with `merged_from` naming the id asked for. A person with\n * no payment in the scope is not found (`404`).\n * `GET /persons/{person_id}`\n */\n async retrieve(personId: string, params?: PersonScopeParams): Promise<PersonResponse> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Other persons of the merchant that may be the same person, the likeliest\n * first, at most 20. An estimate from the devices the persons paid with;\n * related persons stay separate persons.\n * `GET /persons/{person_id}/related`\n */\n async related(personId: string, params?: PersonScopeParams): Promise<RelatedPersonsResponse> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}/related`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * The person of one payment, with how many payments the person has and\n * which kinds of identifier tie this payment to the others. `404` while\n * the payment has no person yet.\n * `GET /persons/payment/{payment_id}`\n */\n async ofPayment(paymentId: string, params?: PersonScopeParams): Promise<PaymentPersonResponse> {\n return this.request('GET', `/persons/payment/${encodeURIComponent(paymentId)}`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Every flag the merchant's team set on the person, active and removed,\n * newest first, with those of the persons merged into it. A merged person\n * reads as the person it merged into. A person with no payment in the\n * scope, or another merchant's, is not found (`404`).\n * `GET /persons/{person_id}/flags`\n */\n async listFlags(personId: string, params?: PersonScopeParams): Promise<MerchantPersonFlagList> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}/flags`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Flags the person for the merchant's team, with a reason and an optional\n * note. A merged person's flag goes on the person it merged into. A person\n * already flagged is refused with `IR_38` (400).\n * `POST /persons/{person_id}/flags`\n */\n async flag(\n personId: string,\n body: MerchantPersonFlagCreate,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request('POST', `/persons/${encodeURIComponent(personId)}/flags`, {\n body,\n query: params as Query | undefined,\n });\n }\n\n /**\n * Replaces an active flag's reason and note at the `version` read. A\n * colleague's newer change, or a removal, since that read is refused with\n * `IR_16` (400) rather than overwritten.\n * `PUT /persons/{person_id}/flags/{flag_id}`\n */\n async updateFlag(\n personId: string,\n flagId: string,\n body: MerchantPersonFlagUpdate,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request(\n 'PUT',\n `/persons/${encodeURIComponent(personId)}/flags/${encodeURIComponent(flagId)}`,\n { body, query: params as Query | undefined },\n );\n }\n\n /**\n * Removes a flag at the `version` read: the flag stops and stays in the\n * history with who removed it and when, which is what this answers. A\n * colleague's change since that read is refused with `IR_16` (400).\n * `DELETE /persons/{person_id}/flags/{flag_id}?version=`\n */\n async removeFlag(\n personId: string,\n flagId: string,\n version: number,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request(\n 'DELETE',\n `/persons/${encodeURIComponent(personId)}/flags/${encodeURIComponent(flagId)}`,\n { query: { ...(params as Query | undefined), version } },\n );\n }\n\n /**\n * One page of the persons in scope with an active flag of the merchant,\n * each once with its newest active flag, newest flag first, and how many\n * there are over every page. A `limit` outside 1 to 100 is a `400`.\n * `GET /persons/flagged`\n */\n async listFlagged(params?: MerchantFlaggedPersonListParams): Promise<MerchantFlaggedPersonList> {\n return this.request('GET', '/persons/flagged', { query: params as Query | undefined });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-F3I5DOWV.cjs","../src/resources/poll.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,KAAA,EAAN,MAAW;AAAA,EAChB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,SAAA,CAAU,MAAA,EAA6C;AAC3D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,aAAA,EAAgB,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACvE,EAAA;AACF;ADA0E;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-F3I5DOWV.cjs","sourcesContent":[null,"import type { PollStatusResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Poll {\n constructor(private readonly request: RequestFn) {}\n\n async getStatus(pollId: string): Promise<PollStatusResponse> {\n return this.request('GET', `/poll/status/${encodeURIComponent(pollId)}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-F3I5DOWV.cjs","../src/resources/poll.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,KAAA,EAAN,MAAW;AAAA,EAChB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,SAAA,CAAU,MAAA,EAA6C;AAC3D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,aAAA,EAAgB,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACvE,EAAA;AACF;ADA0E;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-F3I5DOWV.cjs","sourcesContent":[null,"import type { PollStatusResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Poll {\n constructor(private readonly request: RequestFn) {}\n\n async getStatus(pollId: string): Promise<PollStatusResponse> {\n return this.request('GET', `/poll/status/${encodeURIComponent(pollId)}`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-F46K5H3U.cjs","../src/internal/resources/adminNotices.ts"],"names":[],"mappings":"AAAA;ACcA,IAAM,KAAA,EAAO,uBAAA;AACb,IAAM,KAAA,EAAO,CAAC,QAAA,EAAA,GAA6B,CAAA,EAAA;AASjB;AACyB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGF,EAAA;AAC1B,IAAA;AACtB,EAAA;AAAA;AAGgF,EAAA;AAC1D,IAAA;AACtB,EAAA;AAAA;AAG0E,EAAA;AACpD,IAAA;AACtB,EAAA;AAAA;AAG2E,EAAA;AACrD,IAAA;AACtB,EAAA;AAAA;AAGe,EAAA;AACO,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGiB,EAAA;AACK,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGe,EAAA;AACO,IAAA;AACtB,EAAA;AAAA;AAGgC,EAAA;AACV,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGsB,EAAA;AACA,IAAA;AACC,MAAA;AACpB,IAAA;AACH,EAAA;AACF;AD9B0B;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-F46K5H3U.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type { NoticeList, NoticeListParams } from '../../types';\nimport type {\n PlatformNotice,\n PlatformNoticeAudience,\n PlatformNoticeCreateParams,\n PlatformNoticeDetail,\n PlatformNoticeList,\n PlatformNoticeListParams,\n PlatformNoticeOptions,\n PlatformNoticePreview,\n PlatformNoticeUpdateParams,\n} from '../types';\n\nconst BASE = '/admin-portal/notices';\nconst path = (noticeId: string): string => `${BASE}/${encodeURIComponent(noticeId)}`;\n\n/**\n * Notices staff send to the people of merchants and to colleagues. What the\n * caller may send follows their staff actions; an employee limited to\n * selected merchants reaches only those. A notice to every merchant can wait\n * for a second member of staff (`pending_approval`), never its author or\n * whoever last changed it, for 72 hours.\n */\nexport class AdminNotices {\n constructor(private readonly request: RequestFn) {}\n\n /** What the caller may send, and the staff roles, colleagues and merchant roles. `GET /admin-portal/notices/options` */\n async options(): Promise<PlatformNoticeOptions> {\n return this.request('GET', `${BASE}/options`);\n }\n\n /** How many people, at how many merchants, an audience reaches right now. `POST /admin-portal/notices/preview` */\n async preview(audience: PlatformNoticeAudience): Promise<PlatformNoticePreview> {\n return this.request('POST', `${BASE}/preview`, { body: { audience } });\n }\n\n /** Send now, at `send_at`, or keep as a draft; or wait for approval. `POST /admin-portal/notices` */\n async create(params: PlatformNoticeCreateParams): Promise<PlatformNotice> {\n return this.request('POST', BASE, { body: params });\n }\n\n /** What staff sent, newest first: sent and withdrawn by default. `GET /admin-portal/notices` */\n async list(params?: PlatformNoticeListParams): Promise<PlatformNoticeList> {\n return this.request('GET', BASE, { query: { ...params } });\n }\n\n /** One notice with its recipients and their merchant. `GET /admin-portal/notices/{noticeId}` */\n async retrieve(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('GET', path(noticeId));\n }\n\n /** Change a notice not sent yet, at the version read. `PUT /admin-portal/notices/{noticeId}` */\n async update(noticeId: string, params: PlatformNoticeUpdateParams): Promise<PlatformNotice> {\n return this.request('PUT', path(noticeId), { body: params });\n }\n\n /** Send a draft or a scheduled notice now. `POST /admin-portal/notices/{noticeId}/send` */\n async sendStored(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('POST', `${path(noticeId)}/send`, { body: { version } });\n }\n\n /** Delete a notice not sent yet. `DELETE /admin-portal/notices/{noticeId}` */\n async delete(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('DELETE', path(noticeId), { query: { version } });\n }\n\n /** Take a sent notice back from everyone it reached. `POST /admin-portal/notices/{noticeId}/withdraw` */\n async withdraw(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/withdraw`);\n }\n\n /** Approve a notice to every merchant another member of staff wrote. `POST /admin-portal/notices/{noticeId}/approve` */\n async approve(noticeId: string, version: number): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/approve`, { body: { version } });\n }\n\n /** Refuse a notice to every merchant, saying why. `POST /admin-portal/notices/{noticeId}/refuse` */\n async refuse(noticeId: string, version: number, note: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/refuse`, { body: { version, note } });\n }\n\n /** The notices one merchant's people sent each other, read-only. `GET /admin-portal/notices/merchants/{merchantId}` */\n async merchantNotices(merchantId: string, params?: NoticeListParams): Promise<NoticeList> {\n return this.request('GET', `${BASE}/merchants/${encodeURIComponent(merchantId)}`, {\n query: { ...params },\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-F46K5H3U.cjs","../src/internal/resources/adminNotices.ts"],"names":[],"mappings":"AAAA;ACcA,IAAM,KAAA,EAAO,uBAAA;AACb,IAAM,KAAA,EAAO,CAAC,QAAA,EAAA,GAA6B,CAAA,EAAA;AASjB;AACyB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGF,EAAA;AAC1B,IAAA;AACtB,EAAA;AAAA;AAGgF,EAAA;AAC1D,IAAA;AACtB,EAAA;AAAA;AAG0E,EAAA;AACpD,IAAA;AACtB,EAAA;AAAA;AAG2E,EAAA;AACrD,IAAA;AACtB,EAAA;AAAA;AAGe,EAAA;AACO,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGiB,EAAA;AACK,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGe,EAAA;AACO,IAAA;AACtB,EAAA;AAAA;AAGgC,EAAA;AACV,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGsB,EAAA;AACA,IAAA;AACC,MAAA;AACpB,IAAA;AACH,EAAA;AACF;AD9B0B;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-F46K5H3U.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type { NoticeList, NoticeListParams } from '../../types';\nimport type {\n PlatformNotice,\n PlatformNoticeAudience,\n PlatformNoticeCreateParams,\n PlatformNoticeDetail,\n PlatformNoticeList,\n PlatformNoticeListParams,\n PlatformNoticeOptions,\n PlatformNoticePreview,\n PlatformNoticeUpdateParams,\n} from '../types';\n\nconst BASE = '/admin-portal/notices';\nconst path = (noticeId: string): string => `${BASE}/${encodeURIComponent(noticeId)}`;\n\n/**\n * Notices staff send to the people of merchants and to colleagues. What the\n * caller may send follows their staff actions; an employee limited to\n * selected merchants reaches only those. A notice to every merchant can wait\n * for a second member of staff (`pending_approval`), never its author or\n * whoever last changed it, for 72 hours.\n */\nexport class AdminNotices {\n constructor(private readonly request: RequestFn) {}\n\n /** What the caller may send, and the staff roles, colleagues and merchant roles. `GET /admin-portal/notices/options` */\n async options(): Promise<PlatformNoticeOptions> {\n return this.request('GET', `${BASE}/options`);\n }\n\n /** How many people, at how many merchants, an audience reaches right now. `POST /admin-portal/notices/preview` */\n async preview(audience: PlatformNoticeAudience): Promise<PlatformNoticePreview> {\n return this.request('POST', `${BASE}/preview`, { body: { audience } });\n }\n\n /** Send now, at `send_at`, or keep as a draft; or wait for approval. `POST /admin-portal/notices` */\n async create(params: PlatformNoticeCreateParams): Promise<PlatformNotice> {\n return this.request('POST', BASE, { body: params });\n }\n\n /** What staff sent, newest first: sent and withdrawn by default. `GET /admin-portal/notices` */\n async list(params?: PlatformNoticeListParams): Promise<PlatformNoticeList> {\n return this.request('GET', BASE, { query: { ...params } });\n }\n\n /** One notice with its recipients and their merchant. `GET /admin-portal/notices/{noticeId}` */\n async retrieve(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('GET', path(noticeId));\n }\n\n /** Change a notice not sent yet, at the version read. `PUT /admin-portal/notices/{noticeId}` */\n async update(noticeId: string, params: PlatformNoticeUpdateParams): Promise<PlatformNotice> {\n return this.request('PUT', path(noticeId), { body: params });\n }\n\n /** Send a draft or a scheduled notice now. `POST /admin-portal/notices/{noticeId}/send` */\n async sendStored(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('POST', `${path(noticeId)}/send`, { body: { version } });\n }\n\n /** Delete a notice not sent yet. `DELETE /admin-portal/notices/{noticeId}` */\n async delete(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('DELETE', path(noticeId), { query: { version } });\n }\n\n /** Take a sent notice back from everyone it reached. `POST /admin-portal/notices/{noticeId}/withdraw` */\n async withdraw(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/withdraw`);\n }\n\n /** Approve a notice to every merchant another member of staff wrote. `POST /admin-portal/notices/{noticeId}/approve` */\n async approve(noticeId: string, version: number): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/approve`, { body: { version } });\n }\n\n /** Refuse a notice to every merchant, saying why. `POST /admin-portal/notices/{noticeId}/refuse` */\n async refuse(noticeId: string, version: number, note: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/refuse`, { body: { version, note } });\n }\n\n /** The notices one merchant's people sent each other, read-only. `GET /admin-portal/notices/merchants/{merchantId}` */\n async merchantNotices(merchantId: string, params?: NoticeListParams): Promise<NoticeList> {\n return this.request('GET', `${BASE}/merchants/${encodeURIComponent(merchantId)}`, {\n query: { ...params },\n });\n }\n}\n"]}
@@ -268,9 +268,31 @@ var AdminPricing = class {
268
268
  body: params
269
269
  });
270
270
  }
271
+ /**
272
+ * Preview (`dry_run: true`) or execute (`dry_run: false`) monthly recurring,
273
+ * setup, and monthly-minimum fee charging. Only an explicit `dry_run: false`
274
+ * posts live charges; omitted arguments or an omitted `dry_run` field default
275
+ * to preview mode (`dry_run: true`).
276
+ * `POST /admin-portal/pricing/recurring-fees/run`
277
+ */
278
+ async runRecurringFees(params) {
279
+ const dry_run = params?.dry_run === false ? false : true;
280
+ return this.request("POST", `${BASE}/recurring-fees/run`, {
281
+ body: {
282
+ ...params,
283
+ dry_run
284
+ }
285
+ });
286
+ }
287
+ /** List recorded monthly recurring, setup, and monthly-minimum fee charges. `GET /admin-portal/pricing/recurring-fees` */
288
+ async listRecurringFees(params) {
289
+ return this.request("GET", `${BASE}/recurring-fees`, {
290
+ query: params
291
+ });
292
+ }
271
293
  };
272
294
 
273
295
  export {
274
296
  AdminPricing
275
297
  };
276
- //# sourceMappingURL=chunk-3HUJ7PPJ.js.map
298
+ //# sourceMappingURL=chunk-F6LZ2YNM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/internal/resources/adminPricing.ts"],"sourcesContent":["import type { RequestFn } from '../../client';\nimport type { MerchantPricingViewResponse, PricingFeeType } from '../../types';\nimport type {\n AdminEventFeeListQuery,\n AdminEventFeeListResponse,\n AdminEventFeeRecord,\n AdminServiceUsageListQuery,\n AdminServiceUsageListResponse,\n AdminServiceUsageRecord,\n EffectivePricingQuery,\n EffectivePricingResponse,\n EventFeePreviewRequest,\n EventFeePreviewResponse,\n EventFeeRecordRequest,\n MerchantPricingBrandResponse,\n PricingBrand,\n PricingOverview,\n PricingOverviewQuery,\n PricingSaveRequest,\n PricingScope,\n PricingScopeView,\n RecurringFeeChargeListQuery,\n RecurringFeeChargeListResponse,\n RecurringFeeRunRequest,\n RecurringFeeRunResponse,\n ServiceUsagePreviewRequest,\n ServiceUsagePreviewResponse,\n ServiceUsageRecordRequest,\n} from '../types';\n\nconst BASE = '/admin-portal/pricing';\nconst brandPath = (brand: PricingBrand, feeType: PricingFeeType): string =>\n `${BASE}/brands/${encodeURIComponent(brand)}/${encodeURIComponent(feeType)}`;\nconst merchantBasePath = (merchantId: string): string =>\n `${BASE}/merchants/${encodeURIComponent(merchantId)}`;\nconst merchantFeePath = (merchantId: string, feeType: PricingFeeType): string =>\n `${merchantBasePath(merchantId)}/${encodeURIComponent(feeType)}`;\nconst projectFeePath = (merchantId: string, projectId: string, feeType: PricingFeeType): string =>\n `${merchantBasePath(merchantId)}/projects/${encodeURIComponent(projectId)}/${encodeURIComponent(feeType)}`;\nconst shopFeePath = (merchantId: string, profileId: string, feeType: PricingFeeType): string =>\n `${merchantBasePath(merchantId)}/shops/${encodeURIComponent(profileId)}/${encodeURIComponent(feeType)}`;\n\nconst UNICODE_EDGE_WHITESPACE = /^\\p{White_Space}+|\\p{White_Space}+$/gu;\n\nfunction trimUnicodeWhitespace(value: string): string {\n return value.replace(UNICODE_EDGE_WHITESPACE, '');\n}\n\nfunction assertOptionalProviderSlug(provider: string | null | undefined): string | undefined {\n if (provider === undefined || provider === null) {\n return undefined;\n }\n const trimmed = trimUnicodeWhitespace(provider);\n if (!trimmed) {\n throw new TypeError(\n 'Provider slug cannot be empty or whitespace; omit provider (or pass null when saving) for a service-wide rule.',\n );\n }\n return trimmed;\n}\n\nfunction validateSaveRequest(params: PricingSaveRequest): PricingSaveRequest {\n if (params.provider === undefined || params.provider === null) {\n return params;\n }\n const provider = assertOptionalProviderSlug(params.provider);\n return provider === params.provider ? params : { ...params, provider };\n}\n\nfunction scopeCancelQuery(scope: PricingScope): Record<string, string> {\n switch (scope.level) {\n case 'brand_default':\n if (!scope.brand) {\n throw new TypeError('Brand default scope requires brand.');\n }\n return { brand: scope.brand };\n case 'merchant':\n if (!scope.merchant_id) {\n throw new TypeError('Merchant scope requires merchant_id.');\n }\n return { merchant_id: scope.merchant_id };\n case 'project':\n if (!scope.merchant_id || !scope.project_id) {\n throw new TypeError('Project scope requires merchant_id and project_id.');\n }\n return { merchant_id: scope.merchant_id, project_id: scope.project_id };\n case 'shop':\n if (!scope.merchant_id || !scope.profile_id) {\n throw new TypeError('Shop scope requires merchant_id and profile_id.');\n }\n return { merchant_id: scope.merchant_id, profile_id: scope.profile_id };\n }\n}\n\n/**\n * Unified platform pricing hierarchy across every fee type: brand default\n * (`delopay` / `spicepay`), merchant, project, and shop, plus the Effective\n * Price View showing where every price comes from.\n *\n * Every write carries the scope's optimistic `expected_revision` token; a write\n * against an older revision is refused with `412 Precondition Failed`.\n */\nexport class AdminPricing {\n constructor(private readonly request: RequestFn) {}\n\n /** Brand defaults, active/scheduled exceptions, and older setups. `GET /admin-portal/pricing` */\n async overview(params?: PricingOverviewQuery): Promise<PricingOverview> {\n return this.request('GET', BASE, {\n query: {\n merchant_id: params?.merchant_id,\n fee_type: params?.fee_type,\n provider: params?.provider,\n },\n });\n }\n\n /** Effective price view naming the exact source of every fee type. `GET /admin-portal/pricing/effective` */\n async effective(params: EffectivePricingQuery): Promise<EffectivePricingResponse> {\n return this.request('GET', `${BASE}/effective`, {\n query: {\n merchant_id: params.merchant_id,\n project_id: params.project_id,\n profile_id: params.profile_id,\n provider: params.provider,\n at: params.at,\n },\n });\n }\n\n /** Save a brand default price (service-wide or for one provider). `PUT /admin-portal/pricing/brands/{brand}/{fee_type}` */\n async saveBrand(\n brand: PricingBrand,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', brandPath(brand, feeType), { body: validateSaveRequest(params) });\n }\n\n /** Remove a provider-specific brand default override. Service-wide brand defaults cannot be removed. `DELETE /admin-portal/pricing/brands/{brand}/{fee_type}` */\n async removeBrand(\n brand: PricingBrand,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider: string,\n ): Promise<PricingScopeView> {\n const trimmed = trimUnicodeWhitespace(provider);\n if (!trimmed) {\n throw new TypeError(\n 'Removing a brand pricing rule requires a provider slug; service-wide brand defaults cannot be removed.',\n );\n }\n return this.request('DELETE', brandPath(brand, feeType), {\n query: { expected_revision: expectedRevision, provider: trimmed },\n });\n }\n\n /** Save a merchant exception. `PUT /admin-portal/pricing/merchants/{merchant_id}/{fee_type}` */\n async saveMerchant(\n merchantId: string,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', merchantFeePath(merchantId, feeType), {\n body: validateSaveRequest(params),\n });\n }\n\n /** Remove a merchant exception (service-wide or for one provider). `DELETE /admin-portal/pricing/merchants/{merchant_id}/{fee_type}` */\n async removeMerchant(\n merchantId: string,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', merchantFeePath(merchantId, feeType), {\n query: { expected_revision: expectedRevision, provider: validatedProvider },\n });\n }\n\n /** Save a project exception. `PUT /admin-portal/pricing/merchants/{merchant_id}/projects/{project_id}/{fee_type}` */\n async saveProject(\n merchantId: string,\n projectId: string,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', projectFeePath(merchantId, projectId, feeType), {\n body: validateSaveRequest(params),\n });\n }\n\n /** Remove a project exception (service-wide or for one provider). `DELETE /admin-portal/pricing/merchants/{merchant_id}/projects/{project_id}/{fee_type}` */\n async removeProject(\n merchantId: string,\n projectId: string,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', projectFeePath(merchantId, projectId, feeType), {\n query: { expected_revision: expectedRevision, provider: validatedProvider },\n });\n }\n\n /** Save a shop exception. `PUT /admin-portal/pricing/merchants/{merchant_id}/shops/{profile_id}/{fee_type}` */\n async saveShop(\n merchantId: string,\n profileId: string,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n return this.request('PUT', shopFeePath(merchantId, profileId, feeType), {\n body: validateSaveRequest(params),\n });\n }\n\n /** Remove a shop exception (service-wide or for one provider). `DELETE /admin-portal/pricing/merchants/{merchant_id}/shops/{profile_id}/{fee_type}` */\n async removeShop(\n merchantId: string,\n profileId: string,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', shopFeePath(merchantId, profileId, feeType), {\n query: { expected_revision: expectedRevision, provider: validatedProvider },\n });\n }\n\n /** Save a price at any scope in the hierarchy (brand default, merchant, project, or shop). */\n async save(\n scope: PricingScope,\n feeType: PricingFeeType,\n params: PricingSaveRequest,\n ): Promise<PricingScopeView> {\n switch (scope.level) {\n case 'brand_default':\n if (!scope.brand) {\n throw new TypeError('Brand default scope requires brand.');\n }\n return this.saveBrand(scope.brand, feeType, params);\n case 'merchant':\n if (!scope.merchant_id) {\n throw new TypeError('Merchant scope requires merchant_id.');\n }\n return this.saveMerchant(scope.merchant_id, feeType, params);\n case 'project':\n if (!scope.merchant_id || !scope.project_id) {\n throw new TypeError('Project scope requires merchant_id and project_id.');\n }\n return this.saveProject(scope.merchant_id, scope.project_id, feeType, params);\n case 'shop':\n if (!scope.merchant_id || !scope.profile_id) {\n throw new TypeError('Shop scope requires merchant_id and profile_id.');\n }\n return this.saveShop(scope.merchant_id, scope.profile_id, feeType, params);\n }\n }\n\n /** Remove an exception scope or a provider-specific brand override; service-wide brand defaults cannot be removed. */\n async remove(\n scope: PricingScope,\n feeType: PricingFeeType,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n switch (scope.level) {\n case 'brand_default':\n if (!scope.brand) {\n throw new TypeError('Brand default scope requires brand.');\n }\n if (!provider || !trimUnicodeWhitespace(provider)) {\n throw new TypeError('A brand default price cannot be removed without a provider.');\n }\n return this.removeBrand(scope.brand, feeType, expectedRevision, provider);\n case 'merchant':\n if (!scope.merchant_id) {\n throw new TypeError('Merchant scope requires merchant_id.');\n }\n return this.removeMerchant(scope.merchant_id, feeType, expectedRevision, provider);\n case 'project':\n if (!scope.merchant_id || !scope.project_id) {\n throw new TypeError('Project scope requires merchant_id and project_id.');\n }\n return this.removeProject(\n scope.merchant_id,\n scope.project_id,\n feeType,\n expectedRevision,\n provider,\n );\n case 'shop':\n if (!scope.merchant_id || !scope.profile_id) {\n throw new TypeError('Shop scope requires merchant_id and profile_id.');\n }\n return this.removeShop(\n scope.merchant_id,\n scope.profile_id,\n feeType,\n expectedRevision,\n provider,\n );\n }\n }\n\n /** Cancel a future scheduled version. `DELETE /admin-portal/pricing/versions/{version_id}` */\n async cancelVersion(\n versionId: string,\n feeType: PricingFeeType,\n scope: PricingScope,\n expectedRevision: string,\n provider?: string,\n ): Promise<PricingScopeView> {\n const scopeQuery = scopeCancelQuery(scope);\n const validatedProvider = assertOptionalProviderSlug(provider);\n return this.request('DELETE', `${BASE}/versions/${encodeURIComponent(versionId)}`, {\n query: {\n fee_type: feeType,\n provider: validatedProvider,\n ...scopeQuery,\n expected_revision: expectedRevision,\n },\n });\n }\n\n /** Read a merchant's effective and explicit pricing brand. `GET /admin-portal/pricing/merchants/{merchant_id}/brand` */\n async getMerchantBrand(merchantId: string): Promise<MerchantPricingBrandResponse> {\n return this.request('GET', `${merchantBasePath(merchantId)}/brand`);\n }\n\n /** Read the exact Pricing page view a merchant sees (read-only staff mirror). `GET /admin-portal/pricing/merchants/{merchant_id}/view` */\n async getMerchantView(merchantId: string): Promise<MerchantPricingViewResponse> {\n return this.request('GET', `${merchantBasePath(merchantId)}/view`);\n }\n\n /** Assign a merchant's pricing brand (`'delopay'` / `'spicepay'`), or `null` to inherit the deployment brand. `PUT /admin-portal/pricing/merchants/{merchant_id}/brand` */\n async setMerchantBrand(\n merchantId: string,\n brand: PricingBrand | null,\n ): Promise<MerchantPricingBrandResponse> {\n return this.request('PUT', `${merchantBasePath(merchantId)}/brand`, {\n body: { brand },\n });\n }\n\n /** List recorded third-party service uses across merchants with separate provider cost and markup. `GET /admin-portal/pricing/service-usages` */\n async listServiceUsages(\n params?: AdminServiceUsageListQuery,\n ): Promise<AdminServiceUsageListResponse> {\n return this.request('GET', `${BASE}/service-usages`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /** Dry-run calculate the provider cost, platform markup, and total charge for a third-party service use. `POST /admin-portal/pricing/service-usages/preview` */\n async previewServiceUsage(\n params: ServiceUsagePreviewRequest,\n ): Promise<ServiceUsagePreviewResponse> {\n return this.request('POST', `${BASE}/service-usages/preview`, {\n body: params,\n });\n }\n\n /** Record and settle one third-party service use idempotently by `reference_id`. `POST /admin-portal/pricing/service-usages` */\n async recordServiceUsage(params: ServiceUsageRecordRequest): Promise<AdminServiceUsageRecord> {\n return this.request('POST', `${BASE}/service-usages`, {\n body: params,\n });\n }\n\n /** List recorded platform event fees across merchants. `GET /admin-portal/pricing/event-fees` */\n async listEventFees(params?: AdminEventFeeListQuery): Promise<AdminEventFeeListResponse> {\n return this.request('GET', `${BASE}/event-fees`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /** Dry-run calculate the platform event fee and effective FX rate for a hypothetical event. `POST /admin-portal/pricing/event-fees/preview` */\n async previewEventFee(params: EventFeePreviewRequest): Promise<EventFeePreviewResponse> {\n return this.request('POST', `${BASE}/event-fees/preview`, {\n body: params,\n });\n }\n\n /**\n * Record and settle one operator-recorded platform event fee. `POST /admin-portal/pricing/event-fees`\n *\n * Deduplicated by `(merchant_id, fee_type, reference_id)` (trimmed `reference_id`, without a\n * `test_mode` dimension). Retrying with a different `fee_type` bypasses deduplication and can\n * create a separate debit depending on `charge_status`; callers must use distinct `reference_id`\n * values for test and live records so a completed test write is never replayed as a live charge.\n */\n async recordEventFee(params: EventFeeRecordRequest): Promise<AdminEventFeeRecord> {\n return this.request('POST', `${BASE}/event-fees`, {\n body: params,\n });\n }\n\n /**\n * Preview (`dry_run: true`) or execute (`dry_run: false`) monthly recurring,\n * setup, and monthly-minimum fee charging. Only an explicit `dry_run: false`\n * posts live charges; omitted arguments or an omitted `dry_run` field default\n * to preview mode (`dry_run: true`).\n * `POST /admin-portal/pricing/recurring-fees/run`\n */\n async runRecurringFees(params: RecurringFeeRunRequest): Promise<RecurringFeeRunResponse> {\n const dry_run = params?.dry_run === false ? false : true;\n return this.request('POST', `${BASE}/recurring-fees/run`, {\n body: {\n ...params,\n dry_run,\n },\n });\n }\n\n /** List recorded monthly recurring, setup, and monthly-minimum fee charges. `GET /admin-portal/pricing/recurring-fees` */\n async listRecurringFees(\n params?: RecurringFeeChargeListQuery,\n ): Promise<RecurringFeeChargeListResponse> {\n return this.request('GET', `${BASE}/recurring-fees`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n}\n"],"mappings":";AA8BA,IAAM,OAAO;AACb,IAAM,YAAY,CAAC,OAAqB,YACtC,GAAG,IAAI,WAAW,mBAAmB,KAAK,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAC5E,IAAM,mBAAmB,CAAC,eACxB,GAAG,IAAI,cAAc,mBAAmB,UAAU,CAAC;AACrD,IAAM,kBAAkB,CAAC,YAAoB,YAC3C,GAAG,iBAAiB,UAAU,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAChE,IAAM,iBAAiB,CAAC,YAAoB,WAAmB,YAC7D,GAAG,iBAAiB,UAAU,CAAC,aAAa,mBAAmB,SAAS,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAC1G,IAAM,cAAc,CAAC,YAAoB,WAAmB,YAC1D,GAAG,iBAAiB,UAAU,CAAC,UAAU,mBAAmB,SAAS,CAAC,IAAI,mBAAmB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p/pub0495/delopay-typescript-sdk/dist/chunk-F6QJB4XP.cjs","sourcesContent":[null,"import type {\n BillingProfileResponse,\n BillingSetupRequest,\n BillingSetupResponse,\n BillingCompleteSetupRequest,\n TopupRequest,\n TopupResponse,\n LedgerResponse,\n LedgerListParams,\n BlockedAttemptListResponse,\n BlockedAttemptListParams,\n AutoRechargeUpdateRequest,\n AllocationTransferRequest,\n AllocationTransferResponse,\n AllocationListResponse,\n AllocationResponse,\n ServiceUsageListParams,\n ServiceUsageListResponse,\n MerchantPricingViewResponse,\n AcceptPricingChangeResponse,\n BillingStatementParams,\n BillingStatementResponse,\n EventFeeListParams,\n EventFeeListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** Manage per-shop prepaid balance allocations transferred from the host merchant treasury. */\nclass BillingAllocations {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transfer funds from the host merchant treasury into a shop's allocation.\n *\n * @param merchantId - The host merchant account ID.\n * @param params - Transfer details (amount, target profile/shop ID).\n * @returns The allocation transfer result.\n */\n async transferIn(\n merchantId: string,\n params: AllocationTransferRequest,\n ): Promise<AllocationTransferResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/allocations/transfer-in`,\n { body: params },\n );\n }\n\n /**\n * Transfer funds from a shop's allocation back to the host merchant treasury.\n *\n * @param merchantId - The host merchant account ID.\n * @param params - Transfer details (amount, source profile/shop ID).\n * @returns The allocation transfer result.\n */\n async transferOut(\n merchantId: string,\n params: AllocationTransferRequest,\n ): Promise<AllocationTransferResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/allocations/transfer-out`,\n {\n body: params,\n },\n );\n }\n\n /**\n * List all shop balance allocations for a merchant.\n *\n * @param merchantId - The merchant account ID.\n * @returns List of shop allocations.\n */\n async list(merchantId: string): Promise<AllocationListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/allocations`);\n }\n\n /**\n * Get the balance allocation for a specific shop.\n *\n * @param merchantId - The merchant account ID.\n * @param profileId - The shop (business profile) ID.\n * @returns The shop's balance allocation.\n */\n async get(merchantId: string, profileId: string): Promise<AllocationResponse> {\n return this.request(\n 'GET',\n `/billing/${encodeURIComponent(merchantId)}/allocations/${encodeURIComponent(profileId)}`,\n );\n }\n}\n\n/**\n * Manage prepaid billing balances — top-ups, card setup, auto-recharge, and the balance ledger.\n *\n * Delopay deducts a platform fee from the merchant's prepaid balance on every successful payment.\n * Use these endpoints to fund and monitor that balance.\n */\nexport class Billing {\n /** Per-shop balance allocation management for host merchants. */\n readonly allocations: BillingAllocations;\n\n constructor(private readonly request: RequestFn) {\n this.allocations = new BillingAllocations(request);\n }\n\n /**\n * Retrieve a merchant's billing profile (balance, status, auto-recharge config).\n *\n * @param merchantId - The merchant account ID.\n * @returns The billing profile.\n *\n * @example\n * ```typescript\n * const profile = await delopay.billing.getProfile('merch_123');\n * console.log(profile.balance, profile.status);\n * ```\n */\n async getProfile(merchantId: string): Promise<BillingProfileResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Start a Stripe SetupIntent flow to collect a payment card for auto-recharge.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional setup parameters.\n * @returns The Stripe client secret needed to render the card element.\n */\n async setup(merchantId: string, params?: BillingSetupRequest): Promise<BillingSetupResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/setup`, {\n body: params,\n });\n }\n\n /**\n * Confirm card setup after the Stripe SetupIntent completes on the frontend.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The Stripe SetupIntent ID to confirm.\n * @returns The updated billing profile.\n */\n async completeSetup(\n merchantId: string,\n params: BillingCompleteSetupRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/setup/complete`, {\n body: params,\n });\n }\n\n /**\n * Manually top up a merchant's prepaid balance by charging their saved card.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Top-up amount and currency.\n * @returns The top-up result.\n */\n async topup(merchantId: string, params: TopupRequest): Promise<TopupResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/topup`, {\n body: params,\n });\n }\n\n /**\n * List the balance ledger (credits and debits) for a merchant, the newest\n * entry first unless `sort_by` says otherwise.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional pagination, filters (entry types, a creation\n * window) and sort.\n * @returns The ledger entries.\n */\n async listLedger(merchantId: string, params?: LedgerListParams): Promise<LedgerResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/ledger`, {\n query: csvQuery(params, ['entry_type']),\n });\n }\n\n /**\n * List recorded third-party service uses for a merchant with separate\n * provider cost, platform fee markup, and charged total in the merchant's\n * billing currency.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional shop, service type, provider, charge status,\n * test-mode, date window, and pagination filters.\n * @returns Paginated service usage records.\n */\n async listServiceUsages(\n merchantId: string,\n params?: ServiceUsageListParams,\n ): Promise<ServiceUsageListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/service-usages`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * List recorded platform event fees (disputes, refunds, declined attempts,\n * 3-D Secure attempts, currency conversion markups, international card\n * surcharges, and payouts) for a merchant.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional shop, event fee type, entity ID, charge status,\n * test-mode, date window, and pagination filters.\n * @returns Paginated platform event fee records.\n */\n async listEventFees(\n merchantId: string,\n params?: EventFeeListParams,\n ): Promise<EventFeeListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/event-fees`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * List payment attempts that were blocked by the billing suspension gate\n * (account suspended, setup incomplete, or shop allocation suspended).\n *\n * These attempts never created a payment, so they do not appear in the\n * payments list — this is the only way to retrieve them.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional filters (profile, reason, date range) and pagination.\n * @returns The blocked-attempt entries with a total count.\n */\n async listBlockedAttempts(\n merchantId: string,\n params?: BlockedAttemptListParams,\n ): Promise<BlockedAttemptListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/blocked-attempts`, {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * Update auto-recharge configuration (threshold, top-up amount, enabled flag).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Auto-recharge settings to update.\n * @returns The updated billing profile.\n */\n async updateAutoRecharge(\n merchantId: string,\n params: AutoRechargeUpdateRequest,\n options?: RequestExtras,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/auto-recharge`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Retrieve the merchant-facing Pricing page payload: effective merchant baseline\n * prices, project and shop exceptions side by side with the merchant baseline,\n * upcoming scheduled or pending-acceptance price changes, and recorded acceptances.\n *\n * @param merchantId - The merchant account ID.\n * @returns The merchant pricing view.\n */\n async getPricing(merchantId: string): Promise<MerchantPricingViewResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/pricing`);\n }\n\n /**\n * Record the merchant's acceptance of a pending price change.\n *\n * Must be called directly by an authorized merchant user (staff support-switch\n * and act-as sessions are refused with `403`).\n *\n * @param merchantId - The merchant account ID.\n * @param versionId - The pending pricing version ID to accept.\n * @returns The immutable acceptance record and whether the price took effect immediately.\n */\n async acceptPricingChange(\n merchantId: string,\n versionId: string,\n ): Promise<AcceptPricingChangeResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/pricing/versions/${encodeURIComponent(versionId)}/accept`,\n );\n }\n\n /**\n * Retrieve a monthly platform billing statement grouped by fee type so the groups\n * reconcile to the total platform fees of the period.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional UTC calendar month (`YYYY-MM`) and shop (`profile_id`) filter.\n * @returns The per-currency grouped monthly statement.\n */\n async getStatement(\n merchantId: string,\n params?: BillingStatementParams,\n ): Promise<BillingStatementResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/statement`, {\n query: params as Record<string, string | undefined>,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-F6QJB4XP.cjs","../src/resources/billing.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACyBA,IAAM,mBAAA,EAAN,MAAyB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,UAAA,CACJ,UAAA,EACA,MAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,wBAAA,CAAA;AAAA,MAC1C,EAAE,IAAA,EAAM,OAAO;AAAA,IACjB,CAAA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,WAAA,CACJ,UAAA,EACA,MAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,yBAAA,CAAA;AAAA,MAC1C;AAAA,QACE,IAAA,EAAM;AAAA,MACR;AAAA,IACF,CAAA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAA,CAAK,UAAA,EAAqD;AAC9D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,YAAA,CAAc,CAAA;AAAA,EACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,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AAAA,EAAA;AAcE,IAAA;AAAyF,MAAA;AACjF,MAAA;AACH,IAAA;AACJ,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAA+E,EAAA;AACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAY,MAAA;AACV,MAAA;AAC4F,IAAA;AAC9F,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAcE,IAAA;AAAmF,MAAA;AAC1E,IAAA;AACR,EAAA;AAEL;AD1EA;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-F6QJB4XP.cjs","sourcesContent":[null,"import type {\n BillingProfileResponse,\n BillingSetupRequest,\n BillingSetupResponse,\n BillingCompleteSetupRequest,\n TopupRequest,\n TopupResponse,\n LedgerResponse,\n LedgerListParams,\n BlockedAttemptListResponse,\n BlockedAttemptListParams,\n AutoRechargeUpdateRequest,\n AllocationTransferRequest,\n AllocationTransferResponse,\n AllocationListResponse,\n AllocationResponse,\n ServiceUsageListParams,\n ServiceUsageListResponse,\n MerchantPricingViewResponse,\n AcceptPricingChangeResponse,\n BillingStatementParams,\n BillingStatementResponse,\n EventFeeListParams,\n EventFeeListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** Manage per-shop prepaid balance allocations transferred from the host merchant treasury. */\nclass BillingAllocations {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transfer funds from the host merchant treasury into a shop's allocation.\n *\n * @param merchantId - The host merchant account ID.\n * @param params - Transfer details (amount, target profile/shop ID).\n * @returns The allocation transfer result.\n */\n async transferIn(\n merchantId: string,\n params: AllocationTransferRequest,\n ): Promise<AllocationTransferResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/allocations/transfer-in`,\n { body: params },\n );\n }\n\n /**\n * Transfer funds from a shop's allocation back to the host merchant treasury.\n *\n * @param merchantId - The host merchant account ID.\n * @param params - Transfer details (amount, source profile/shop ID).\n * @returns The allocation transfer result.\n */\n async transferOut(\n merchantId: string,\n params: AllocationTransferRequest,\n ): Promise<AllocationTransferResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/allocations/transfer-out`,\n {\n body: params,\n },\n );\n }\n\n /**\n * List all shop balance allocations for a merchant.\n *\n * @param merchantId - The merchant account ID.\n * @returns List of shop allocations.\n */\n async list(merchantId: string): Promise<AllocationListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/allocations`);\n }\n\n /**\n * Get the balance allocation for a specific shop.\n *\n * @param merchantId - The merchant account ID.\n * @param profileId - The shop (business profile) ID.\n * @returns The shop's balance allocation.\n */\n async get(merchantId: string, profileId: string): Promise<AllocationResponse> {\n return this.request(\n 'GET',\n `/billing/${encodeURIComponent(merchantId)}/allocations/${encodeURIComponent(profileId)}`,\n );\n }\n}\n\n/**\n * Manage prepaid billing balances — top-ups, card setup, auto-recharge, and the balance ledger.\n *\n * Delopay deducts a platform fee from the merchant's prepaid balance on every successful payment.\n * Use these endpoints to fund and monitor that balance.\n */\nexport class Billing {\n /** Per-shop balance allocation management for host merchants. */\n readonly allocations: BillingAllocations;\n\n constructor(private readonly request: RequestFn) {\n this.allocations = new BillingAllocations(request);\n }\n\n /**\n * Retrieve a merchant's billing profile (balance, status, auto-recharge config).\n *\n * @param merchantId - The merchant account ID.\n * @returns The billing profile.\n *\n * @example\n * ```typescript\n * const profile = await delopay.billing.getProfile('merch_123');\n * console.log(profile.balance, profile.status);\n * ```\n */\n async getProfile(merchantId: string): Promise<BillingProfileResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Start a Stripe SetupIntent flow to collect a payment card for auto-recharge.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional setup parameters.\n * @returns The Stripe client secret needed to render the card element.\n */\n async setup(merchantId: string, params?: BillingSetupRequest): Promise<BillingSetupResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/setup`, {\n body: params,\n });\n }\n\n /**\n * Confirm card setup after the Stripe SetupIntent completes on the frontend.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The Stripe SetupIntent ID to confirm.\n * @returns The updated billing profile.\n */\n async completeSetup(\n merchantId: string,\n params: BillingCompleteSetupRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/setup/complete`, {\n body: params,\n });\n }\n\n /**\n * Manually top up a merchant's prepaid balance by charging their saved card.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Top-up amount and currency.\n * @returns The top-up result.\n */\n async topup(merchantId: string, params: TopupRequest): Promise<TopupResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/topup`, {\n body: params,\n });\n }\n\n /**\n * List the balance ledger (credits and debits) for a merchant, the newest\n * entry first unless `sort_by` says otherwise.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional pagination, filters (entry types, a creation\n * window) and sort.\n * @returns The ledger entries.\n */\n async listLedger(merchantId: string, params?: LedgerListParams): Promise<LedgerResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/ledger`, {\n query: csvQuery(params, ['entry_type']),\n });\n }\n\n /**\n * List recorded third-party service uses for a merchant with separate\n * provider cost, platform fee markup, and charged total in the merchant's\n * billing currency.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional shop, service type, provider, charge status,\n * test-mode, date window, and pagination filters.\n * @returns Paginated service usage records.\n */\n async listServiceUsages(\n merchantId: string,\n params?: ServiceUsageListParams,\n ): Promise<ServiceUsageListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/service-usages`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * List recorded platform event fees (disputes, refunds, declined attempts,\n * 3-D Secure attempts, currency conversion markups, international card\n * surcharges, and payouts) for a merchant.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional shop, event fee type, entity ID, charge status,\n * test-mode, date window, and pagination filters.\n * @returns Paginated platform event fee records.\n */\n async listEventFees(\n merchantId: string,\n params?: EventFeeListParams,\n ): Promise<EventFeeListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/event-fees`, {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * List payment attempts that were blocked by the billing suspension gate\n * (account suspended, setup incomplete, or shop allocation suspended).\n *\n * These attempts never created a payment, so they do not appear in the\n * payments list — this is the only way to retrieve them.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional filters (profile, reason, date range) and pagination.\n * @returns The blocked-attempt entries with a total count.\n */\n async listBlockedAttempts(\n merchantId: string,\n params?: BlockedAttemptListParams,\n ): Promise<BlockedAttemptListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/blocked-attempts`, {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * Update auto-recharge configuration (threshold, top-up amount, enabled flag).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Auto-recharge settings to update.\n * @returns The updated billing profile.\n */\n async updateAutoRecharge(\n merchantId: string,\n params: AutoRechargeUpdateRequest,\n options?: RequestExtras,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/auto-recharge`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Retrieve the merchant-facing Pricing page payload: effective merchant baseline\n * prices, project and shop exceptions side by side with the merchant baseline,\n * upcoming scheduled or pending-acceptance price changes, and recorded acceptances.\n *\n * @param merchantId - The merchant account ID.\n * @returns The merchant pricing view.\n */\n async getPricing(merchantId: string): Promise<MerchantPricingViewResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/pricing`);\n }\n\n /**\n * Record the merchant's acceptance of a pending price change.\n *\n * Must be called directly by an authorized merchant user (staff support-switch\n * and act-as sessions are refused with `403`).\n *\n * @param merchantId - The merchant account ID.\n * @param versionId - The pending pricing version ID to accept.\n * @returns The immutable acceptance record and whether the price took effect immediately.\n */\n async acceptPricingChange(\n merchantId: string,\n versionId: string,\n ): Promise<AcceptPricingChangeResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/pricing/versions/${encodeURIComponent(versionId)}/accept`,\n );\n }\n\n /**\n * Retrieve a monthly platform billing statement grouped by fee type so the groups\n * reconcile to the total platform fees of the period.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional UTC calendar month (`YYYY-MM`) and shop (`profile_id`) filter.\n * @returns The per-currency grouped monthly statement.\n */\n async getStatement(\n merchantId: string,\n params?: BillingStatementParams,\n ): Promise<BillingStatementResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/statement`, {\n query: params as Record<string, string | undefined>,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/pub0495/delopay-typescript-sdk/dist/chunk-F6S3WCCB.cjs","../src/resources/mandates.ts"],"names":[],"mappings":"AAAA;ACIO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,SAAA,EAA6C;AAC1D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,UAAA,EAAa,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQiE,EAAA;AACI,IAAA;AACrE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQmE,EAAA;AACpB,IAAA;AACpC,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADH0E;AACA;AACA;AACA","file":"/tmp/pub0495/delopay-typescript-sdk/dist/chunk-F6S3WCCB.cjs","sourcesContent":[null,"import type { MandateResponse, MandateRevokedResponse, MandateListParams } from '../types';\nimport type { RequestFn } from '../client';\n\n/** View and revoke recurring payment mandates. */\nexport class Mandates {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Retrieve a mandate by its ID.\n *\n * @param mandateId - The unique mandate ID.\n * @returns The mandate.\n */\n async retrieve(mandateId: string): Promise<MandateResponse> {\n return this.request('GET', `/mandates/${encodeURIComponent(mandateId)}`);\n }\n\n /**\n * Revoke an active mandate, preventing future charges.\n *\n * @param mandateId - The mandate ID to revoke.\n * @returns Revocation confirmation.\n */\n async revoke(mandateId: string): Promise<MandateRevokedResponse> {\n return this.request('POST', `/mandates/revoke/${encodeURIComponent(mandateId)}`);\n }\n\n /**\n * List mandates, optionally filtered by customer or status.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of mandates.\n */\n async list(params?: MandateListParams): Promise<MandateResponse[]> {\n return this.request('GET', '/mandates/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/sdk-pub-04970/dist/chunk-F6S3WCCB.cjs","../src/resources/mandates.ts"],"names":[],"mappings":"AAAA;ACIO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,SAAA,EAA6C;AAC1D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,UAAA,EAAa,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQiE,EAAA;AACI,IAAA;AACrE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQmE,EAAA;AACpB,IAAA;AACpC,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADH0E;AACA;AACA;AACA","file":"/tmp/sdk-pub-04970/dist/chunk-F6S3WCCB.cjs","sourcesContent":[null,"import type { MandateResponse, MandateRevokedResponse, MandateListParams } from '../types';\nimport type { RequestFn } from '../client';\n\n/** View and revoke recurring payment mandates. */\nexport class Mandates {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Retrieve a mandate by its ID.\n *\n * @param mandateId - The unique mandate ID.\n * @returns The mandate.\n */\n async retrieve(mandateId: string): Promise<MandateResponse> {\n return this.request('GET', `/mandates/${encodeURIComponent(mandateId)}`);\n }\n\n /**\n * Revoke an active mandate, preventing future charges.\n *\n * @param mandateId - The mandate ID to revoke.\n * @returns Revocation confirmation.\n */\n async revoke(mandateId: string): Promise<MandateRevokedResponse> {\n return this.request('POST', `/mandates/revoke/${encodeURIComponent(mandateId)}`);\n }\n\n /**\n * List mandates, optionally filtered by customer or status.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of mandates.\n */\n async list(params?: MandateListParams): Promise<MandateResponse[]> {\n return this.request('GET', '/mandates/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n}\n"]}