@delopay/sdk 0.491.0 → 0.492.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 (296) 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.map +1 -1
  5. package/dist/chunk-244VZFFO.cjs.map +1 -1
  6. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  7. package/dist/chunk-34PC72O7.cjs.map +1 -1
  8. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  9. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  10. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  11. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  12. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  13. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  14. package/dist/chunk-4T7BJFY2.cjs.map +1 -1
  15. package/dist/chunk-5CITBN33.cjs.map +1 -1
  16. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  17. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  18. package/dist/chunk-5QS67SBO.cjs.map +1 -1
  19. package/dist/chunk-6BFZS4YP.cjs.map +1 -1
  20. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  21. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  22. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  23. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  24. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  25. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  26. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  27. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  28. package/dist/chunk-7NKJD5ST.cjs.map +1 -1
  29. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  30. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  31. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  32. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  33. package/dist/chunk-ANQRR2BG.cjs.map +1 -1
  34. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  35. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  36. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  37. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  38. package/dist/chunk-BT3UAUEV.cjs.map +1 -1
  39. package/dist/chunk-CAMALM35.cjs.map +1 -1
  40. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  41. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  42. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  43. package/dist/chunk-DQHT4FGI.cjs.map +1 -1
  44. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  45. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  46. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  47. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  48. package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
  49. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  50. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  51. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  52. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  53. package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
  54. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  55. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  56. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  57. package/dist/{chunk-R3WHKS5S.cjs → chunk-GLQ7EJAH.cjs} +2 -2
  58. package/dist/chunk-GLQ7EJAH.cjs.map +1 -0
  59. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  60. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  61. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  62. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  63. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  64. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  65. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  66. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  67. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  68. package/dist/{chunk-7AELDJXA.js → chunk-IM6A64ON.js} +2 -2
  69. package/dist/chunk-IM6A64ON.js.map +1 -0
  70. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  71. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  72. package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
  73. package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
  74. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  75. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  76. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  77. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  78. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  79. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  80. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  81. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  82. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  83. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  84. package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
  85. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  86. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  87. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  88. package/dist/chunk-OAEKP665.cjs.map +1 -1
  89. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  90. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  91. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  92. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  93. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  94. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  95. package/dist/chunk-PYNHK6AP.cjs.map +1 -1
  96. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  97. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  98. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  99. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  100. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  101. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  102. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  103. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  104. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  105. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  106. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  107. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  108. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  109. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  110. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  111. package/dist/chunk-UTCXNBID.cjs.map +1 -1
  112. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  113. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  114. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  115. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  116. package/dist/chunk-W457XUA6.cjs.map +1 -1
  117. package/dist/chunk-W7NMENTT.cjs.map +1 -1
  118. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  119. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  120. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  121. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  122. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  123. package/dist/chunk-YFRAI34Y.cjs.map +1 -1
  124. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  125. package/dist/chunk-YW4DVKNT.cjs.map +1 -1
  126. package/dist/chunk-YWN76H2W.cjs.map +1 -1
  127. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  128. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  129. package/dist/client.cjs.map +1 -1
  130. package/dist/core.cjs.map +1 -1
  131. package/dist/currencies.cjs.map +1 -1
  132. package/dist/enigmaCardForm.cjs.map +1 -1
  133. package/dist/error.cjs.map +1 -1
  134. package/dist/eventStream.cjs.map +1 -1
  135. package/dist/exportDownload.cjs.map +1 -1
  136. package/dist/feeProgram.cjs.map +1 -1
  137. package/dist/index.cjs.map +1 -1
  138. package/dist/internal/resources/admin.cjs.map +1 -1
  139. package/dist/internal/resources/admin.d.cts +1 -1
  140. package/dist/internal/resources/admin.d.ts +1 -1
  141. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  142. package/dist/internal/resources/adminBranding.d.cts +1 -1
  143. package/dist/internal/resources/adminBranding.d.ts +1 -1
  144. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  145. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
  146. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
  147. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  148. package/dist/internal/resources/adminFeePlans.d.cts +1 -1
  149. package/dist/internal/resources/adminFeePlans.d.ts +1 -1
  150. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  151. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  152. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  153. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  154. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  155. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  156. package/dist/internal/resources/adminLive.cjs.map +1 -1
  157. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  158. package/dist/internal/resources/adminNotices.d.cts +1 -1
  159. package/dist/internal/resources/adminNotices.d.ts +1 -1
  160. package/dist/internal/resources/adminPortal.cjs +2 -2
  161. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  162. package/dist/internal/resources/adminPortal.d.cts +1 -1
  163. package/dist/internal/resources/adminPortal.d.ts +1 -1
  164. package/dist/internal/resources/adminPortal.js +1 -1
  165. package/dist/internal/resources/adminPricing.cjs.map +1 -1
  166. package/dist/internal/resources/adminPricing.d.cts +1 -1
  167. package/dist/internal/resources/adminPricing.d.ts +1 -1
  168. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  169. package/dist/internal/resources/adminSupport.d.cts +1 -1
  170. package/dist/internal/resources/adminSupport.d.ts +1 -1
  171. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  172. package/dist/internal/resources/auditLogs.d.cts +1 -1
  173. package/dist/internal/resources/auditLogs.d.ts +1 -1
  174. package/dist/internal/resources/cache.cjs.map +1 -1
  175. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  176. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  177. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  178. package/dist/internal/resources/configs.cjs.map +1 -1
  179. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  180. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  181. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  182. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  183. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  184. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  185. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  186. package/dist/internal/resources/diagnostic.d.cts +1 -1
  187. package/dist/internal/resources/diagnostic.d.ts +1 -1
  188. package/dist/internal/resources/gsm.cjs.map +1 -1
  189. package/dist/internal/resources/gsm.d.cts +1 -1
  190. package/dist/internal/resources/gsm.d.ts +1 -1
  191. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  192. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  193. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  194. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  195. package/dist/internal/resources/platformBilling.d.cts +1 -1
  196. package/dist/internal/resources/platformBilling.d.ts +1 -1
  197. package/dist/internal/resources/platformFees.cjs.map +1 -1
  198. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  199. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  200. package/dist/internal/resources/platformSettings.d.cts +1 -1
  201. package/dist/internal/resources/platformSettings.d.ts +1 -1
  202. package/dist/internal.cjs +3 -3
  203. package/dist/internal.cjs.map +1 -1
  204. package/dist/internal.d.cts +1 -1
  205. package/dist/internal.d.ts +1 -1
  206. package/dist/internal.js +1 -1
  207. package/dist/listQuery.cjs.map +1 -1
  208. package/dist/panes.cjs.map +1 -1
  209. package/dist/paymentPresentation.cjs.map +1 -1
  210. package/dist/recordCounter.cjs.map +1 -1
  211. package/dist/resources/aiTools.cjs.map +1 -1
  212. package/dist/resources/analytics.cjs.map +1 -1
  213. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  214. package/dist/resources/apiKeys.cjs.map +1 -1
  215. package/dist/resources/audit.cjs.map +1 -1
  216. package/dist/resources/authentication.cjs.map +1 -1
  217. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  218. package/dist/resources/billing.cjs.map +1 -1
  219. package/dist/resources/buyerAccount.cjs.map +1 -1
  220. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  221. package/dist/resources/buyerConversations.cjs.map +1 -1
  222. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  223. package/dist/resources/buyerPortal.cjs.map +1 -1
  224. package/dist/resources/cards.cjs.map +1 -1
  225. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  226. package/dist/resources/checkoutDomains.cjs.map +1 -1
  227. package/dist/resources/checkoutMethods.cjs.map +1 -1
  228. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  229. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  230. package/dist/resources/connectors.cjs.map +1 -1
  231. package/dist/resources/contentEncryption.cjs.map +1 -1
  232. package/dist/resources/costRules.cjs.map +1 -1
  233. package/dist/resources/customers.cjs.map +1 -1
  234. package/dist/resources/deploymentBranding.cjs.map +1 -1
  235. package/dist/resources/disputes.cjs.map +1 -1
  236. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  237. package/dist/resources/events.cjs.map +1 -1
  238. package/dist/resources/export.cjs.map +1 -1
  239. package/dist/resources/externalRecords.cjs.map +1 -1
  240. package/dist/resources/featureMatrix.cjs.map +1 -1
  241. package/dist/resources/fees.cjs.map +1 -1
  242. package/dist/resources/files.cjs.map +1 -1
  243. package/dist/resources/forex.cjs.map +1 -1
  244. package/dist/resources/identityVerifications.cjs.map +1 -1
  245. package/dist/resources/industries.cjs.map +1 -1
  246. package/dist/resources/invoiceSettings.cjs.map +1 -1
  247. package/dist/resources/invoices.cjs.map +1 -1
  248. package/dist/resources/live.cjs.map +1 -1
  249. package/dist/resources/mandates.cjs.map +1 -1
  250. package/dist/resources/merchantAccounts.cjs.map +1 -1
  251. package/dist/resources/messageTemplates.cjs.map +1 -1
  252. package/dist/resources/notices.cjs.map +1 -1
  253. package/dist/resources/operationLimits.cjs.map +1 -1
  254. package/dist/resources/paymentLinks.cjs.map +1 -1
  255. package/dist/resources/paymentMethods.cjs.map +1 -1
  256. package/dist/resources/payments.cjs.map +1 -1
  257. package/dist/resources/payoutDestinations.cjs.map +1 -1
  258. package/dist/resources/payouts.cjs.map +1 -1
  259. package/dist/resources/paypalDisputes.cjs.map +1 -1
  260. package/dist/resources/persons.cjs.map +1 -1
  261. package/dist/resources/poll.cjs.map +1 -1
  262. package/dist/resources/processorCosts.cjs.map +1 -1
  263. package/dist/resources/processorImports.cjs.map +1 -1
  264. package/dist/resources/products.cjs.map +1 -1
  265. package/dist/resources/profileAcquirers.cjs.map +1 -1
  266. package/dist/resources/profiles.cjs.map +1 -1
  267. package/dist/resources/projects.cjs.map +1 -1
  268. package/dist/resources/refunds.cjs.map +1 -1
  269. package/dist/resources/regions.cjs.map +1 -1
  270. package/dist/resources/relay.cjs.map +1 -1
  271. package/dist/resources/risk.cjs.map +1 -1
  272. package/dist/resources/routing.cjs.map +1 -1
  273. package/dist/resources/search.cjs.map +1 -1
  274. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  275. package/dist/resources/settings.cjs.map +1 -1
  276. package/dist/resources/settlement.cjs.map +1 -1
  277. package/dist/resources/shareLinks.cjs.map +1 -1
  278. package/dist/resources/shopLabels.cjs.map +1 -1
  279. package/dist/resources/shopify.cjs.map +1 -1
  280. package/dist/resources/shops.cjs.map +1 -1
  281. package/dist/resources/stripeConnect.cjs.map +1 -1
  282. package/dist/resources/subscriptions.cjs.map +1 -1
  283. package/dist/resources/support.cjs.map +1 -1
  284. package/dist/resources/threeDsRules.cjs.map +1 -1
  285. package/dist/resources/users.cjs.map +1 -1
  286. package/dist/resources/vatRates.cjs.map +1 -1
  287. package/dist/resources/verification.cjs.map +1 -1
  288. package/dist/resources/webhooks.cjs.map +1 -1
  289. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  290. package/dist/trustedOrigins.cjs.map +1 -1
  291. package/dist/{types-D9ygoAbt.d.ts → types-C6zTmzk0.d.ts} +7 -0
  292. package/dist/{types-4T8JSWuZ.d.cts → types-CPwF4xMA.d.cts} +7 -0
  293. package/dist/types.cjs.map +1 -1
  294. package/package.json +1 -1
  295. package/dist/chunk-7AELDJXA.js.map +0 -1
  296. package/dist/chunk-R3WHKS5S.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/anes/delo-payment/delopay-typescript-sdk/dist/chunk-BT3UAUEV.cjs","../src/resources/buyerBlocklist.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACkCO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA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AA;AACsE,MAAA;AACxE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUsC,EAAA;AACxB,IAAA;AACV,MAAA;AACsE,MAAA;AACvD,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOwF,EAAA;AAC1E,IAAA;AACV,MAAA;AACsE,MAAA;AACxE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ4E,EAAA;AACb,IAAA;AAC/D,EAAA;AACF;ADxDkF;AACA;AACA;AACA","file":"/home/anes/delo-payment/delopay-typescript-sdk/dist/chunk-BT3UAUEV.cjs","sourcesContent":[null,"import type {\n BuyerBlocklistCapabilitiesResponse,\n BuyerBlocklistEntryCreateRequest,\n BuyerBlocklistEntryDeleteRequest,\n BuyerBlocklistEntryResponse,\n BuyerBlocklistEventsQuery,\n BuyerBlocklistEventsResponse,\n BuyerBlocklistFromPaymentPreviewRequest,\n BuyerBlocklistFromPaymentPreviewResponse,\n BuyerBlocklistFromPaymentRequest,\n BuyerBlocklistListQuery,\n BuyerBlocklistListResponse,\n PaymentFraudSignalsResponse,\n RadarSyncSettingsListResponse,\n RadarSyncSettingsResponse,\n RadarSyncSettingsUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/**\n * Buyer blocklist: the buyers a merchant refuses to sell to again, in every\n * shop of the merchant or in one shop. One entry names the buyer by email\n * address, IP address, IP range, customer id, device id, Stripe card\n * fingerprint and card BIN, at most one of each and at least one in total,\n * and blocks a payment when any one of them matches. An entry can instead\n * block a class of network (hosting, VPN or proxy, Tor, residential proxy) on its own. A blocked buyer's hosted checkout\n * and confirms fail with error code `DE_14`, and the payments create\n * response marks the buyer with `buyer_blocked` and the entry's\n * `buyer_block_note`. Card fingerprints, emails, IPs and BINs can also be\n * copied to Stripe Radar value lists per Stripe connection; a Radar list\n * blocks only once its rule is added in Stripe (`rule_needed`).\n *\n * Every route needs a dashboard session. Reading needs the `BuyerBlocklist`\n * area at `Read`, adding and removing needs `Write`. A caller scoped to one\n * shop lists, adds and removes that shop's entries only, and never an entry\n * that blocks in every shop.\n */\nexport class BuyerBlocklist {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of blocked buyers, newest first unless `sort_by` says otherwise,\n * filtered by scope, by `kind` (the entries that include an identifier of\n * that kind, or of any of several) and by a search over every identifier\n * and the note. Expired entries are not listed.\n * `GET /buyer-blocklist`\n */\n async list(params?: BuyerBlocklistListQuery): Promise<BuyerBlocklistListResponse> {\n return this.request('GET', '/buyer-blocklist', {\n query: csvQuery(params, ['kind', 'profile_ids', 'industry']),\n });\n }\n\n /**\n * Block a buyer in one shop or, without `profile_id`, in every shop of the\n * merchant, named by one or more of `email`, `ip`, `customer_id` and\n * `device_id`. Each identifier is normalised as it is matched; an\n * identifier another entry already names in that scope is refused. The\n * change is recorded in the audit log before it is made.\n * `POST /buyer-blocklist`\n */\n async create(params: BuyerBlocklistEntryCreateRequest): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', '/buyer-blocklist', { body: params });\n }\n\n /**\n * Remove an entry, so the buyer can pay again. Payments the entry already\n * refused keep their status. The removal and the optional `reason` are\n * recorded in the audit log before it is made. The route requires a body,\n * so `{}` is sent when no reason is given.\n * `DELETE /buyer-blocklist/{entry_id}`\n */\n async delete(\n entryId: string,\n params?: BuyerBlocklistEntryDeleteRequest,\n ): Promise<BuyerBlocklistEntryResponse> {\n return this.request('DELETE', `/buyer-blocklist/${encodeURIComponent(entryId)}`, {\n body: params ?? {},\n });\n }\n\n /**\n * Block the buyer of a payment by the identifiers the payment carries:\n * its card (the Stripe fingerprint), email, IP, device or customer, in the\n * payment's shop or in every shop. With `all_ips`, also every address the\n * buyer was seen paying from, one entry each, grouped under one\n * `group_id`; the answer then carries `ip_snapshot`.\n * `POST /buyer-blocklist/from-payment`\n */\n async createFromPayment(\n params: BuyerBlocklistFromPaymentRequest,\n ): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', '/buyer-blocklist/from-payment', { body: params });\n }\n\n /**\n * The addresses an \"all IPs\" block of a payment's buyer would take: the\n * payment's own, then those its device, email or card were seen at in the\n * last 90 days, newest first, at most 20. An address shared with two or\n * more other buyers is offered but not preselected. Writes nothing; needs\n * the same permissions as the block.\n * `POST /buyer-blocklist/from-payment/preview`\n */\n async previewFromPayment(\n params: BuyerBlocklistFromPaymentPreviewRequest,\n ): Promise<BuyerBlocklistFromPaymentPreviewResponse> {\n return this.request('POST', '/buyer-blocklist/from-payment/preview', { body: params });\n }\n\n /**\n * An entry's recorded refusals, newest first, with where each happened and\n * which identifier matched. A caller scoped to one shop reaches only its own\n * shop's entries.\n * `GET /buyer-blocklist/{entry_id}/events`\n */\n async listEvents(\n entryId: string,\n params?: BuyerBlocklistEventsQuery,\n ): Promise<BuyerBlocklistEventsResponse> {\n return this.request('GET', `/buyer-blocklist/${encodeURIComponent(entryId)}/events`, {\n query: params as Record<string, string | number | null | undefined>,\n });\n }\n\n /**\n * Which classes of network an `ip_class` entry can be judged by on this\n * deployment now, and by which sources.\n * `GET /buyer-blocklist/capabilities`\n */\n async capabilities(): Promise<BuyerBlocklistCapabilitiesResponse> {\n return this.request('GET', '/buyer-blocklist/capabilities');\n }\n\n /**\n * Retry now every failed or pending Radar sync of an entry.\n * `POST /buyer-blocklist/{entry_id}/sync/retry`\n */\n async retrySync(entryId: string): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', `/buyer-blocklist/${encodeURIComponent(entryId)}/sync/retry`);\n }\n\n /**\n * The Radar sync settings of every Stripe connection the caller sees. A\n * role that hides processor names is refused (403).\n * `GET /buyer-blocklist/radar-sync`\n */\n async listRadarSync(): Promise<RadarSyncSettingsListResponse> {\n return this.request('GET', '/buyer-blocklist/radar-sync');\n }\n\n /**\n * The Radar sync settings of one Stripe connection.\n * `GET /buyer-blocklist/radar-sync/{merchant_connector_id}`\n */\n async retrieveRadarSync(merchantConnectorId: string): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'GET',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Turn Radar sync on or off for one Stripe connection and set what an\n * early fraud warning or a review does.\n * `PUT /buyer-blocklist/radar-sync/{merchant_connector_id}`\n */\n async updateRadarSync(\n merchantConnectorId: string,\n params: RadarSyncSettingsUpdateRequest,\n ): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'PUT',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove every item DeloPay synced from this connection's Radar lists. The\n * lists themselves are kept.\n * `POST /buyer-blocklist/radar-sync/{merchant_connector_id}/remove-items`\n */\n async removeRadarItems(merchantConnectorId: string): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'POST',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}/remove-items`,\n );\n }\n\n /**\n * Stripe's fraud signals on a payment (risk, early fraud warnings,\n * reviews), what of its buyer can be blocked, and the entries that\n * already match it.\n * `GET /buyer-blocklist/fraud-signals/{payment_id}`\n */\n async fraudSignals(paymentId: string): Promise<PaymentFraudSignalsResponse> {\n return this.request('GET', `/buyer-blocklist/fraud-signals/${encodeURIComponent(paymentId)}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0492/dist/chunk-BT3UAUEV.cjs","../src/resources/buyerBlocklist.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACkCO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,IAAA,CAAK,MAAA,EAAuE;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kB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A;AACvD,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOwF,EAAA;AAC1E,IAAA;AACV,MAAA;AACsE,MAAA;AACxE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ4E,EAAA;AACb,IAAA;AAC/D,EAAA;AACF;ADxDkF;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0492/dist/chunk-BT3UAUEV.cjs","sourcesContent":[null,"import type {\n BuyerBlocklistCapabilitiesResponse,\n BuyerBlocklistEntryCreateRequest,\n BuyerBlocklistEntryDeleteRequest,\n BuyerBlocklistEntryResponse,\n BuyerBlocklistEventsQuery,\n BuyerBlocklistEventsResponse,\n BuyerBlocklistFromPaymentPreviewRequest,\n BuyerBlocklistFromPaymentPreviewResponse,\n BuyerBlocklistFromPaymentRequest,\n BuyerBlocklistListQuery,\n BuyerBlocklistListResponse,\n PaymentFraudSignalsResponse,\n RadarSyncSettingsListResponse,\n RadarSyncSettingsResponse,\n RadarSyncSettingsUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/**\n * Buyer blocklist: the buyers a merchant refuses to sell to again, in every\n * shop of the merchant or in one shop. One entry names the buyer by email\n * address, IP address, IP range, customer id, device id, Stripe card\n * fingerprint and card BIN, at most one of each and at least one in total,\n * and blocks a payment when any one of them matches. An entry can instead\n * block a class of network (hosting, VPN or proxy, Tor, residential proxy) on its own. A blocked buyer's hosted checkout\n * and confirms fail with error code `DE_14`, and the payments create\n * response marks the buyer with `buyer_blocked` and the entry's\n * `buyer_block_note`. Card fingerprints, emails, IPs and BINs can also be\n * copied to Stripe Radar value lists per Stripe connection; a Radar list\n * blocks only once its rule is added in Stripe (`rule_needed`).\n *\n * Every route needs a dashboard session. Reading needs the `BuyerBlocklist`\n * area at `Read`, adding and removing needs `Write`. A caller scoped to one\n * shop lists, adds and removes that shop's entries only, and never an entry\n * that blocks in every shop.\n */\nexport class BuyerBlocklist {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of blocked buyers, newest first unless `sort_by` says otherwise,\n * filtered by scope, by `kind` (the entries that include an identifier of\n * that kind, or of any of several) and by a search over every identifier\n * and the note. Expired entries are not listed.\n * `GET /buyer-blocklist`\n */\n async list(params?: BuyerBlocklistListQuery): Promise<BuyerBlocklistListResponse> {\n return this.request('GET', '/buyer-blocklist', {\n query: csvQuery(params, ['kind', 'profile_ids', 'industry']),\n });\n }\n\n /**\n * Block a buyer in one shop or, without `profile_id`, in every shop of the\n * merchant, named by one or more of `email`, `ip`, `customer_id` and\n * `device_id`. Each identifier is normalised as it is matched; an\n * identifier another entry already names in that scope is refused. The\n * change is recorded in the audit log before it is made.\n * `POST /buyer-blocklist`\n */\n async create(params: BuyerBlocklistEntryCreateRequest): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', '/buyer-blocklist', { body: params });\n }\n\n /**\n * Remove an entry, so the buyer can pay again. Payments the entry already\n * refused keep their status. The removal and the optional `reason` are\n * recorded in the audit log before it is made. The route requires a body,\n * so `{}` is sent when no reason is given.\n * `DELETE /buyer-blocklist/{entry_id}`\n */\n async delete(\n entryId: string,\n params?: BuyerBlocklistEntryDeleteRequest,\n ): Promise<BuyerBlocklistEntryResponse> {\n return this.request('DELETE', `/buyer-blocklist/${encodeURIComponent(entryId)}`, {\n body: params ?? {},\n });\n }\n\n /**\n * Block the buyer of a payment by the identifiers the payment carries:\n * its card (the Stripe fingerprint), email, IP, device or customer, in the\n * payment's shop or in every shop. With `all_ips`, also every address the\n * buyer was seen paying from, one entry each, grouped under one\n * `group_id`; the answer then carries `ip_snapshot`.\n * `POST /buyer-blocklist/from-payment`\n */\n async createFromPayment(\n params: BuyerBlocklistFromPaymentRequest,\n ): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', '/buyer-blocklist/from-payment', { body: params });\n }\n\n /**\n * The addresses an \"all IPs\" block of a payment's buyer would take: the\n * payment's own, then those its device, email or card were seen at in the\n * last 90 days, newest first, at most 20. An address shared with two or\n * more other buyers is offered but not preselected. Writes nothing; needs\n * the same permissions as the block.\n * `POST /buyer-blocklist/from-payment/preview`\n */\n async previewFromPayment(\n params: BuyerBlocklistFromPaymentPreviewRequest,\n ): Promise<BuyerBlocklistFromPaymentPreviewResponse> {\n return this.request('POST', '/buyer-blocklist/from-payment/preview', { body: params });\n }\n\n /**\n * An entry's recorded refusals, newest first, with where each happened and\n * which identifier matched. A caller scoped to one shop reaches only its own\n * shop's entries.\n * `GET /buyer-blocklist/{entry_id}/events`\n */\n async listEvents(\n entryId: string,\n params?: BuyerBlocklistEventsQuery,\n ): Promise<BuyerBlocklistEventsResponse> {\n return this.request('GET', `/buyer-blocklist/${encodeURIComponent(entryId)}/events`, {\n query: params as Record<string, string | number | null | undefined>,\n });\n }\n\n /**\n * Which classes of network an `ip_class` entry can be judged by on this\n * deployment now, and by which sources.\n * `GET /buyer-blocklist/capabilities`\n */\n async capabilities(): Promise<BuyerBlocklistCapabilitiesResponse> {\n return this.request('GET', '/buyer-blocklist/capabilities');\n }\n\n /**\n * Retry now every failed or pending Radar sync of an entry.\n * `POST /buyer-blocklist/{entry_id}/sync/retry`\n */\n async retrySync(entryId: string): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', `/buyer-blocklist/${encodeURIComponent(entryId)}/sync/retry`);\n }\n\n /**\n * The Radar sync settings of every Stripe connection the caller sees. A\n * role that hides processor names is refused (403).\n * `GET /buyer-blocklist/radar-sync`\n */\n async listRadarSync(): Promise<RadarSyncSettingsListResponse> {\n return this.request('GET', '/buyer-blocklist/radar-sync');\n }\n\n /**\n * The Radar sync settings of one Stripe connection.\n * `GET /buyer-blocklist/radar-sync/{merchant_connector_id}`\n */\n async retrieveRadarSync(merchantConnectorId: string): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'GET',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Turn Radar sync on or off for one Stripe connection and set what an\n * early fraud warning or a review does.\n * `PUT /buyer-blocklist/radar-sync/{merchant_connector_id}`\n */\n async updateRadarSync(\n merchantConnectorId: string,\n params: RadarSyncSettingsUpdateRequest,\n ): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'PUT',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove every item DeloPay synced from this connection's Radar lists. The\n * lists themselves are kept.\n * `POST /buyer-blocklist/radar-sync/{merchant_connector_id}/remove-items`\n */\n async removeRadarItems(merchantConnectorId: string): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'POST',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}/remove-items`,\n );\n }\n\n /**\n * Stripe's fraud signals on a payment (risk, early fraud warnings,\n * reviews), what of its buyer can be blocked, and the entries that\n * already match it.\n * `GET /buyer-blocklist/fraud-signals/{payment_id}`\n */\n async fraudSignals(paymentId: string): Promise<PaymentFraudSignalsResponse> {\n return this.request('GET', `/buyer-blocklist/fraud-signals/${encodeURIComponent(paymentId)}`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/anes/delo-payment/delopay-typescript-sdk/dist/chunk-CAMALM35.cjs","../src/resources/buyerPortal.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,UAAA,CAAW,OAAA,EAAsD;AACrE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAA,EAAyB,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EACpE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,SAAA,CAAU,OAAA,EAAiD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,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.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n BuyerCaseList,\n BuyerConversationAttachment,\n BuyerPortalAttachmentQuery,\n BuyerPortalContactEmailCommand,\n BuyerPortalContactEmailOutcome,\n BuyerPortalConversationList,\n BuyerPortalConversationQuery,\n BuyerPortalMessage,\n BuyerPortalMessageCreate,\n BuyerPortalMessagePage,\n BuyerInvoiceListQuery,\n BuyerPortalInvoice,\n BuyerPortalInvoicePage,\n BuyerPortalPageQuery,\n BuyerPortalProfile,\n BuyerPortalProfileUpdate,\n BuyerPortalPurchasePage,\n BuyerPortalRefundRequest,\n BuyerPortalRefundRequestCreate,\n BuyerPortalSession,\n BuyerPortalSubscriptionPage,\n BuyerPortalSubscription,\n BuyerPortalSubscriptionActionRequest,\n BuyerPortalPlanPage,\n BuyerPortalPlanChangeRequest,\n NativeCreateSubscriptionRequest,\n NativeEnrollmentResponse,\n NativeEnrollmentStatusQuery,\n NativeEnrollmentAbandonResponse,\n BuyerEvidence,\n BuyerEvidenceEntry,\n BuyerEvidenceExtensionRequest,\n BuyerEvidenceFile,\n BuyerEvidenceSubmit,\n} from '../types';\n\n/**\n * Buyer access using a customer portal grant, sent in the api-key header.\n * Use a separate client constructed with the portal token, not a merchant secret\n * key or dashboard JWT. The grant determines buyer identity and permitted shops.\n */\nexport class BuyerPortal {\n constructor(private readonly request: RequestFn) {}\n\n async getSession(options?: RequestExtras): Promise<BuyerPortalSession> {\n return this.request('GET', '/buyer-portal/session', { ...options });\n }\n\n /**\n * The buyer's cases at the shop: the refund requests they sent and the\n * disputes about their purchases, newest first, with where each stands, who\n * acts next, the outcome and the recorded steps.\n */\n async listCases(options?: RequestExtras): Promise<BuyerCaseList> {\n return this.request('GET', '/buyer-portal/cases', { ...options });\n }\n\n /**\n * A case's evidence: what may be handed in and by when, the files saved\n * and handed in, and what the reviewer said. Opened on the first read\n * while the case still waits.\n */\n async caseEvidence(caseId: string, options?: RequestExtras): Promise<BuyerEvidence> {\n return this.request('GET', `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {\n ...options,\n });\n }\n\n /**\n * Upload a file for a case. It is saved, not handed in, until a\n * submission takes it. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored, also after the cut-off.\n */\n async uploadEvidenceFile(\n caseId: string,\n file: Blob,\n clientUploadId: string,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerEvidenceFile> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,\n { body: form, ...extras },\n );\n }\n\n /** Download a file of the case's evidence. */\n async downloadEvidenceFile(\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a saved file. A file a submission took stays. */\n async removeEvidenceFile(caseId: string, fileId: string, options?: RequestExtras): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n ...options,\n },\n );\n }\n\n /**\n * Hand in an explanation, saved files or both, while the buyer's window\n * is open. Sending again with the same `client_submission_id` returns the\n * submission the first send stored.\n */\n async submitEvidence(\n caseId: string,\n params: BuyerEvidenceSubmit,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,\n { body: params, ...options },\n );\n }\n\n /** Ask for more time, once until the cut-off is next set. */\n async requestEvidenceExtension(\n caseId: string,\n params: BuyerEvidenceExtensionRequest,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,\n { body: params, ...options },\n );\n }\n\n /**\n * The buyer's conversations with the shop, the latest message first. A\n * portal link for the whole merchant lists one per shop and mode.\n */\n async listConversations(options?: RequestExtras): Promise<BuyerPortalConversationList> {\n return this.request('GET', '/buyer-portal/conversations', { ...options });\n }\n\n /**\n * The conversation with one shop and its newest messages, oldest first;\n * `before` pages back. A link issued for one shop may leave `shop` out.\n */\n async listMessages(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessagePage> {\n return this.request('GET', '/buyer-portal/messages', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * A message to the shop. A message to a closed conversation reopens it.\n * Sending again with the same `client_message_id` returns the message the\n * first send stored.\n */\n async sendMessage(\n message: BuyerPortalMessageCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessage> {\n return this.request('POST', '/buyer-portal/messages', { body: message, ...options });\n }\n\n /**\n * The buyer has read the conversation with the shop up to its last accepted\n * message. Answers with the buyer's conversations as they now stand.\n */\n async markMessagesRead(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request('POST', '/buyer-portal/messages/read', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * Upload a file for the buyer's next message to one shop, under the shop's\n * attachment rules (`attachment_rules` on the message page). It belongs to\n * the buyer until a message names it in `attachments`; one no message took\n * within a day is cleared. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored.\n */\n async uploadMessageFile(\n file: Blob,\n clientUploadId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerConversationAttachment> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', '/buyer-portal/messages/files', {\n body: form,\n query: query as Record<string, string | boolean | null | undefined>,\n ...extras,\n });\n }\n\n /** Download a file a message of the buyer's conversation with one shop carries. */\n async downloadMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request('GET', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n responseType: 'blob',\n ...options,\n });\n }\n\n /** Remove a file the buyer uploaded that no message took. */\n async removeMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request('DELETE', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n ...options,\n });\n }\n\n /** The buyer's contact and billing details, and what they may change. */\n async getProfile(options?: RequestExtras): Promise<BuyerPortalProfile> {\n return this.request('GET', '/buyer-portal/profile', { ...options });\n }\n\n /**\n * Change the buyer's contact and billing details. Fields left out stay as\n * they are; the merchant decides whether buyers may change them at all.\n */\n async updateProfile(\n params: BuyerPortalProfileUpdate,\n options?: RequestExtras,\n ): Promise<BuyerPortalProfile> {\n return this.request('POST', '/buyer-portal/profile', { body: params, ...options });\n }\n\n /**\n * Change the buyer's email address, as the profile's `email_policy` allows:\n * `request` names the new address, and under a `confirm_new` policy\n * `confirm` completes it with the proof sent there. A refusal comes back as\n * an outcome with `status: 'refused'`; a 403 means the policy does not let\n * the buyer change the address at all, and a 429 that the request limit was\n * reached.\n * `POST /buyer-portal/profile/contact-email`\n */\n async changeContactEmail(\n command: BuyerPortalContactEmailCommand,\n options?: RequestExtras,\n ): Promise<BuyerPortalContactEmailOutcome> {\n return this.request('POST', '/buyer-portal/profile/contact-email', {\n body: command,\n ...options,\n });\n }\n\n /**\n * Ask the shop for a refund of one of the buyer's purchases, named by its\n * `id` from `listPurchases()`. Nothing is refunded until the shop approves\n * the request with a refund.\n */\n async createRefundRequest(\n purchaseId: string,\n params: BuyerPortalRefundRequestCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalRefundRequest> {\n return this.request(\n 'POST',\n `/buyer-portal/purchases/${encodeURIComponent(purchaseId)}/refund-requests`,\n { body: params, ...options },\n );\n }\n\n async listInvoices(\n params?: BuyerInvoiceListQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalInvoicePage> {\n return this.request('GET', '/buyer-portal/invoices', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async retrieveInvoice(invoiceId: string, options?: RequestExtras): Promise<BuyerPortalInvoice> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {\n ...options,\n });\n }\n\n /** Download the owned, published invoice as PDF bytes. */\n async downloadInvoicePdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n async listPurchases(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPurchasePage> {\n return this.request('GET', '/buyer-portal/purchases', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async listSubscriptions(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionPage> {\n return this.request('GET', '/buyer-portal/subscriptions', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n /** Apply an action allowed by the subscription capabilities and portal grant. */\n async actOnSubscription(\n subscriptionId: string,\n params: BuyerPortalSubscriptionActionRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,\n { body: params, ...options },\n );\n }\n\n async listSubscriptionPlans(\n subscriptionId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n async changeSubscriptionPlan(\n subscriptionId: string,\n params: BuyerPortalPlanChangeRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,\n { body: params, ...options },\n );\n }\n\n async listNativePlans(\n profileId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n /** Retry with the same subscription ID and accepted terms after a lost response. */\n async enrollNative(\n params: NativeCreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request('POST', '/buyer-portal/subscriptions/native/enroll', {\n body: params,\n ...options,\n });\n }\n\n async getNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n\n async abandonNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentAbandonResponse> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0492/dist/chunk-CAMALM35.cjs","../src/resources/buyerPortal.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;A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;AACjE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAMqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC+E,MAAA;AACxB,MAAA;AACzD,IAAA;AACF,EAAA;AAM4C,EAAA;AAC9B,IAAA;AACV,MAAA;AAC+E,MAAA;AACxB,MAAA;AACzD,IAAA;AACF,EAAA;AACF;AD3JqG;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0492/dist/chunk-CAMALM35.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n BuyerCaseList,\n BuyerConversationAttachment,\n BuyerPortalAttachmentQuery,\n BuyerPortalContactEmailCommand,\n BuyerPortalContactEmailOutcome,\n BuyerPortalConversationList,\n BuyerPortalConversationQuery,\n BuyerPortalMessage,\n BuyerPortalMessageCreate,\n BuyerPortalMessagePage,\n BuyerInvoiceListQuery,\n BuyerPortalInvoice,\n BuyerPortalInvoicePage,\n BuyerPortalPageQuery,\n BuyerPortalProfile,\n BuyerPortalProfileUpdate,\n BuyerPortalPurchasePage,\n BuyerPortalRefundRequest,\n BuyerPortalRefundRequestCreate,\n BuyerPortalSession,\n BuyerPortalSubscriptionPage,\n BuyerPortalSubscription,\n BuyerPortalSubscriptionActionRequest,\n BuyerPortalPlanPage,\n BuyerPortalPlanChangeRequest,\n NativeCreateSubscriptionRequest,\n NativeEnrollmentResponse,\n NativeEnrollmentStatusQuery,\n NativeEnrollmentAbandonResponse,\n BuyerEvidence,\n BuyerEvidenceEntry,\n BuyerEvidenceExtensionRequest,\n BuyerEvidenceFile,\n BuyerEvidenceSubmit,\n} from '../types';\n\n/**\n * Buyer access using a customer portal grant, sent in the api-key header.\n * Use a separate client constructed with the portal token, not a merchant secret\n * key or dashboard JWT. The grant determines buyer identity and permitted shops.\n */\nexport class BuyerPortal {\n constructor(private readonly request: RequestFn) {}\n\n async getSession(options?: RequestExtras): Promise<BuyerPortalSession> {\n return this.request('GET', '/buyer-portal/session', { ...options });\n }\n\n /**\n * The buyer's cases at the shop: the refund requests they sent and the\n * disputes about their purchases, newest first, with where each stands, who\n * acts next, the outcome and the recorded steps.\n */\n async listCases(options?: RequestExtras): Promise<BuyerCaseList> {\n return this.request('GET', '/buyer-portal/cases', { ...options });\n }\n\n /**\n * A case's evidence: what may be handed in and by when, the files saved\n * and handed in, and what the reviewer said. Opened on the first read\n * while the case still waits.\n */\n async caseEvidence(caseId: string, options?: RequestExtras): Promise<BuyerEvidence> {\n return this.request('GET', `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence`, {\n ...options,\n });\n }\n\n /**\n * Upload a file for a case. It is saved, not handed in, until a\n * submission takes it. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored, also after the cut-off.\n */\n async uploadEvidenceFile(\n caseId: string,\n file: Blob,\n clientUploadId: string,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerEvidenceFile> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files`,\n { body: form, ...extras },\n );\n }\n\n /** Download a file of the case's evidence. */\n async downloadEvidenceFile(\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a saved file. A file a submission took stays. */\n async removeEvidenceFile(caseId: string, fileId: string, options?: RequestExtras): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n ...options,\n },\n );\n }\n\n /**\n * Hand in an explanation, saved files or both, while the buyer's window\n * is open. Sending again with the same `client_submission_id` returns the\n * submission the first send stored.\n */\n async submitEvidence(\n caseId: string,\n params: BuyerEvidenceSubmit,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/submissions`,\n { body: params, ...options },\n );\n }\n\n /** Ask for more time, once until the cut-off is next set. */\n async requestEvidenceExtension(\n caseId: string,\n params: BuyerEvidenceExtensionRequest,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-portal/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,\n { body: params, ...options },\n );\n }\n\n /**\n * The buyer's conversations with the shop, the latest message first. A\n * portal link for the whole merchant lists one per shop and mode.\n */\n async listConversations(options?: RequestExtras): Promise<BuyerPortalConversationList> {\n return this.request('GET', '/buyer-portal/conversations', { ...options });\n }\n\n /**\n * The conversation with one shop and its newest messages, oldest first;\n * `before` pages back. A link issued for one shop may leave `shop` out.\n */\n async listMessages(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessagePage> {\n return this.request('GET', '/buyer-portal/messages', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * A message to the shop. A message to a closed conversation reopens it.\n * Sending again with the same `client_message_id` returns the message the\n * first send stored.\n */\n async sendMessage(\n message: BuyerPortalMessageCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessage> {\n return this.request('POST', '/buyer-portal/messages', { body: message, ...options });\n }\n\n /**\n * The buyer has read the conversation with the shop up to its last accepted\n * message. Answers with the buyer's conversations as they now stand.\n */\n async markMessagesRead(\n query?: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request('POST', '/buyer-portal/messages/read', {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * Upload a file for the buyer's next message to one shop, under the shop's\n * attachment rules (`attachment_rules` on the message page). It belongs to\n * the buyer until a message names it in `attachments`; one no message took\n * within a day is cleared. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored.\n */\n async uploadMessageFile(\n file: Blob,\n clientUploadId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerConversationAttachment> {\n const { fileName, ...extras } = options ?? {};\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', '/buyer-portal/messages/files', {\n body: form,\n query: query as Record<string, string | boolean | null | undefined>,\n ...extras,\n });\n }\n\n /** Download a file a message of the buyer's conversation with one shop carries. */\n async downloadMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request('GET', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n responseType: 'blob',\n ...options,\n });\n }\n\n /** Remove a file the buyer uploaded that no message took. */\n async removeMessageFile(\n fileId: string,\n query?: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request('DELETE', `/buyer-portal/messages/files/${encodeURIComponent(fileId)}`, {\n query: query as Record<string, string | boolean | null | undefined>,\n ...options,\n });\n }\n\n /** The buyer's contact and billing details, and what they may change. */\n async getProfile(options?: RequestExtras): Promise<BuyerPortalProfile> {\n return this.request('GET', '/buyer-portal/profile', { ...options });\n }\n\n /**\n * Change the buyer's contact and billing details. Fields left out stay as\n * they are; the merchant decides whether buyers may change them at all.\n */\n async updateProfile(\n params: BuyerPortalProfileUpdate,\n options?: RequestExtras,\n ): Promise<BuyerPortalProfile> {\n return this.request('POST', '/buyer-portal/profile', { body: params, ...options });\n }\n\n /**\n * Change the buyer's email address, as the profile's `email_policy` allows:\n * `request` names the new address, and under a `confirm_new` policy\n * `confirm` completes it with the proof sent there. A refusal comes back as\n * an outcome with `status: 'refused'`; a 403 means the policy does not let\n * the buyer change the address at all, and a 429 that the request limit was\n * reached.\n * `POST /buyer-portal/profile/contact-email`\n */\n async changeContactEmail(\n command: BuyerPortalContactEmailCommand,\n options?: RequestExtras,\n ): Promise<BuyerPortalContactEmailOutcome> {\n return this.request('POST', '/buyer-portal/profile/contact-email', {\n body: command,\n ...options,\n });\n }\n\n /**\n * Ask the shop for a refund of one of the buyer's purchases, named by its\n * `id` from `listPurchases()`. Nothing is refunded until the shop approves\n * the request with a refund.\n */\n async createRefundRequest(\n purchaseId: string,\n params: BuyerPortalRefundRequestCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalRefundRequest> {\n return this.request(\n 'POST',\n `/buyer-portal/purchases/${encodeURIComponent(purchaseId)}/refund-requests`,\n { body: params, ...options },\n );\n }\n\n async listInvoices(\n params?: BuyerInvoiceListQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalInvoicePage> {\n return this.request('GET', '/buyer-portal/invoices', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async retrieveInvoice(invoiceId: string, options?: RequestExtras): Promise<BuyerPortalInvoice> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}`, {\n ...options,\n });\n }\n\n /** Download the owned, published invoice as PDF bytes. */\n async downloadInvoicePdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/buyer-portal/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n async listPurchases(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPurchasePage> {\n return this.request('GET', '/buyer-portal/purchases', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async listSubscriptions(\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionPage> {\n return this.request('GET', '/buyer-portal/subscriptions', {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n /** Apply an action allowed by the subscription capabilities and portal grant. */\n async actOnSubscription(\n subscriptionId: string,\n params: BuyerPortalSubscriptionActionRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/actions`,\n { body: params, ...options },\n );\n }\n\n async listSubscriptionPlans(\n subscriptionId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/plans`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n async changeSubscriptionPlan(\n subscriptionId: string,\n params: BuyerPortalPlanChangeRequest,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscription> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/${encodeURIComponent(subscriptionId)}/change-plan`,\n { body: params, ...options },\n );\n }\n\n async listNativePlans(\n profileId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalPlanPage> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/plans/${encodeURIComponent(profileId)}`,\n { query: params as Record<string, number | null | undefined>, ...options },\n );\n }\n\n /** Retry with the same subscription ID and accepted terms after a lost response. */\n async enrollNative(\n params: NativeCreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request('POST', '/buyer-portal/subscriptions/native/enroll', {\n body: params,\n ...options,\n });\n }\n\n async getNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentResponse> {\n return this.request(\n 'GET',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n\n async abandonNativeEnrollment(\n subscriptionId: string,\n params: NativeEnrollmentStatusQuery,\n options?: RequestExtras,\n ): Promise<NativeEnrollmentAbandonResponse> {\n return this.request(\n 'POST',\n `/buyer-portal/subscriptions/native/enroll/${encodeURIComponent(subscriptionId)}/abandon`,\n { query: { profile_id: params.profile_id }, ...options },\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/anes/delo-payment/delopay-typescript-sdk/dist/chunk-CCN44NZJ.cjs","../src/resources/live.ts"],"names":[],"mappings":"AAAA;ACWA,SAAS,SAAA,CAAU,IAAA,EAAc,GAAA,EAAsB;AACrD,EAAA,IAAI,KAAA;AACJ,EAAA,IAAI;AACF,IAAA,MAAA,EAAQ,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA;AAAA,EACzB,EAAA,UAAQ;AACN,IAAA,OAAO,KAAA,CAAA;AAAA,EACT;AACA,EAAA,GAAA,CAAI,MAAA,IAAU,KAAA,GAAQ,OAAO,MAAA,IAAU,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG,OAAO,KAAA,CAAA;AAChF,EAAA,uBAAO,MAAA,mBAAO,wBAAA,mBAAyB,KAAA,EAAO,GAAG,CAAA,6BAAG,OAAA;AACtD;AAGO,SAAS,iBAAA,CACd,KAAA,EACA,EAAA,EACA,KAAA,EACwB;AACxB,EAAA,OAAA,CAAQ,KAAA,CAAM,IAAA,EAAM;AAAA,IAClB,KAAK,OAAA,EAAS;AACZ,MAAA,MAAM,QAAA,EAAU,SAAA,CAAU,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAC/C,MAAA,OAAO,EAAE,IAAA,EAAM,OAAA,EAAS,EAAA,EAAI,KAAA,EAAO,OAAA,EAAS,OAAO,QAAA,IAAY,UAAA,EAAY,QAAA,EAAU,KAAK,CAAA;AAAA,IAC5F;AAAA,IACA,KAAK,QAAA,EAAU;AACb,MAAA,MAAM,QAAA,EAAU,SAAA,CAAU,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAG/C,MAAA,GAAA,CAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAA,EAAG,OAAO,EAAE,IAAA,EAAM,QAAA,EAAU,GAAG,CAAA;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QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,cAAA,CAAe,IAAA,CAAK,UAAA,EAAY,cAAA,EAAgB,OAAO,CAAA;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,QAAA,CACJ,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gBAAA,EAAkB;AAAA,MAC3C,KAAA,EAAO;AAAA,QACL,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AD7DA;AACA;AACE;AACA;AACA;AACA;AACF,uJAAC","file":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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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ionsParams,\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 +1 @@
1
- {"version":3,"sources":["/home/anes/delo-payment/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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/delopay-typescript-sdk/dist/chunk-DQHT4FGI.cjs","../src/resources/billing.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACuBA,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,MAC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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAgF,MAAA;AACxE,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAgF,MAAA;AACxC,IAAA;AACvC,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAwF,MAAA;AAC/E,IAAA;AACR,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAiBE,IAAA;AAA0F,MAAA;AACjF,IAAA;AACR,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;ADpEA;AACA;AACA;AACA","file":"/home/anes/delo-payment/delopay-typescript-sdk/dist/chunk-DQHT4FGI.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} 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 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/w2-sdk-publish-0492/dist/chunk-DQHT4FGI.cjs","../src/resources/billing.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACuBA,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;AA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;AAUE,IAAA;AAAgF,MAAA;AACxE,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAgF,MAAA;AACxC,IAAA;AACvC,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAwF,MAAA;AAC/E,IAAA;AACR,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAiBE,IAAA;AAA0F,MAAA;AACjF,IAAA;AACR,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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;ADpEA;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0492/dist/chunk-DQHT4FGI.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} 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 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":["/home/anes/delo-payment/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,IAAA,EAAM,MAAA,EAAQ,KAAA,EAAO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AA;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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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;A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ACtB,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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/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,CAAA,GAAS,QA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AS,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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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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AAyB;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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/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,C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HSXJMJ.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
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0492/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/w2-sdk-publish-0492/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":["/home/anes/delo-payment/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":"/home/anes/delo-payment/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/w2-sdk-publish-0492/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/w2-sdk-publish-0492/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"]}