@delopay/sdk 0.451.0 → 0.456.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 (500) hide show
  1. package/dist/airwallexCard.cjs.map +1 -1
  2. package/dist/branding.cjs.map +1 -1
  3. package/dist/branding.d.cts +1 -0
  4. package/dist/branding.d.ts +1 -0
  5. package/dist/cardFormStyles.cjs.map +1 -1
  6. package/dist/checkoutSession.cjs +2 -2
  7. package/dist/checkoutSession.cjs.map +1 -1
  8. package/dist/checkoutSession.d.cts +1 -0
  9. package/dist/checkoutSession.d.ts +1 -0
  10. package/dist/checkoutSession.js +1 -1
  11. package/dist/{chunk-WYR27JGG.js → chunk-222YMG36.js} +31 -2
  12. package/dist/chunk-222YMG36.js.map +1 -0
  13. package/dist/chunk-244VZFFO.cjs.map +1 -1
  14. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  15. package/dist/chunk-34PC72O7.cjs.map +1 -1
  16. package/dist/{chunk-EBA6DJKI.js → chunk-3CR7RX65.js} +2 -2
  17. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  18. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  19. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  20. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  21. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  22. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  23. package/dist/{chunk-BY3BENXH.js → chunk-57S5IX5S.js} +17 -1
  24. package/dist/chunk-57S5IX5S.js.map +1 -0
  25. package/dist/chunk-5CITBN33.cjs.map +1 -1
  26. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  27. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  28. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  29. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  30. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  31. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  32. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  33. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  34. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  35. package/dist/{chunk-OKFOU6F7.cjs → chunk-7JBRZUZX.cjs} +5 -5
  36. package/dist/chunk-7JBRZUZX.cjs.map +1 -0
  37. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  38. package/dist/{chunk-KT2WXUWG.cjs → chunk-7QYHQL3L.cjs} +17 -1
  39. package/dist/chunk-7QYHQL3L.cjs.map +1 -0
  40. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  41. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  42. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  43. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  44. package/dist/chunk-AVR2GPXU.cjs.map +1 -1
  45. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  46. package/dist/{chunk-OOC7ZT4T.js → chunk-BA6BTB56.js} +3 -3
  47. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  48. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  49. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  50. package/dist/chunk-CAMALM35.cjs.map +1 -1
  51. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  52. package/dist/chunk-CKKNFFKP.cjs.map +1 -1
  53. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  54. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  55. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  56. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  57. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  58. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  59. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  60. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  61. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  62. package/dist/chunk-FG7YBXJQ.cjs.map +1 -1
  63. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  64. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  65. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  66. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  67. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  68. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  69. package/dist/chunk-HLHML5ES.cjs.map +1 -1
  70. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  71. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  72. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  73. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  74. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  75. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  76. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  77. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  78. package/dist/chunk-JPRSNCYP.cjs.map +1 -1
  79. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  80. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  81. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  82. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  83. package/dist/chunk-KOB6MOAV.cjs.map +1 -1
  84. package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
  85. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  86. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  87. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  88. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  89. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  90. package/dist/chunk-MCNDMK7F.cjs.map +1 -1
  91. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  92. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  93. package/dist/chunk-NKDUQ2BI.cjs.map +1 -1
  94. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  95. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  96. package/dist/chunk-OAEKP665.cjs.map +1 -1
  97. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  98. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  99. package/dist/chunk-OWP7XBY2.cjs.map +1 -1
  100. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  101. package/dist/{chunk-WCAIY7DR.cjs → chunk-P4UILJVU.cjs} +12 -1
  102. package/dist/chunk-P4UILJVU.cjs.map +1 -0
  103. package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
  104. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  105. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  106. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  107. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  108. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  109. package/dist/{chunk-R46A6AGY.cjs → chunk-QTS4QGW4.cjs} +3 -3
  110. package/dist/chunk-QTS4QGW4.cjs.map +1 -0
  111. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  112. package/dist/chunk-R4FE6K43.cjs.map +1 -1
  113. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  114. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  115. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  116. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  117. package/dist/chunk-RSVLVW4L.cjs.map +1 -1
  118. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  119. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  120. package/dist/{chunk-Z5MEER63.js → chunk-T6INFOU2.js} +12 -1
  121. package/dist/chunk-T6INFOU2.js.map +1 -0
  122. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  123. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  124. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  125. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  126. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  127. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  128. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  129. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  130. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  131. package/dist/{chunk-KZHLKMVX.cjs → chunk-W3MSASG4.cjs} +32 -3
  132. package/dist/chunk-W3MSASG4.cjs.map +1 -0
  133. package/dist/chunk-W457XUA6.cjs.map +1 -1
  134. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  135. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  136. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  137. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  138. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  139. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  140. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  141. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  142. package/dist/client.cjs +2 -2
  143. package/dist/client.cjs.map +1 -1
  144. package/dist/client.d.cts +1 -0
  145. package/dist/client.d.ts +1 -0
  146. package/dist/client.js +1 -1
  147. package/dist/core.cjs.map +1 -1
  148. package/dist/core.d.cts +1 -0
  149. package/dist/core.d.ts +1 -0
  150. package/dist/currencies.cjs.map +1 -1
  151. package/dist/enigmaCardForm.cjs.map +1 -1
  152. package/dist/error.cjs.map +1 -1
  153. package/dist/eventStream.cjs.map +1 -1
  154. package/dist/exportDownload.cjs.map +1 -1
  155. package/dist/exportDownload.d.cts +1 -0
  156. package/dist/exportDownload.d.ts +1 -0
  157. package/dist/feeProgram.cjs.map +1 -1
  158. package/dist/feeProgram.d.cts +1 -0
  159. package/dist/feeProgram.d.ts +1 -0
  160. package/dist/index.cjs +5 -5
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +1 -1
  163. package/dist/index.d.ts +1 -1
  164. package/dist/index.js +4 -4
  165. package/dist/internal/resources/admin.cjs.map +1 -1
  166. package/dist/internal/resources/admin.d.cts +1 -0
  167. package/dist/internal/resources/admin.d.ts +1 -0
  168. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  169. package/dist/internal/resources/adminBranding.d.cts +1 -0
  170. package/dist/internal/resources/adminBranding.d.ts +1 -0
  171. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  172. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -0
  173. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -0
  174. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  175. package/dist/internal/resources/adminFeePlans.d.cts +1 -0
  176. package/dist/internal/resources/adminFeePlans.d.ts +1 -0
  177. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  178. package/dist/internal/resources/adminFileScans.d.cts +1 -0
  179. package/dist/internal/resources/adminFileScans.d.ts +1 -0
  180. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  181. package/dist/internal/resources/adminIndustries.d.cts +1 -0
  182. package/dist/internal/resources/adminIndustries.d.ts +1 -0
  183. package/dist/internal/resources/adminLive.cjs.map +1 -1
  184. package/dist/internal/resources/adminLive.d.cts +1 -0
  185. package/dist/internal/resources/adminLive.d.ts +1 -0
  186. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  187. package/dist/internal/resources/adminNotices.d.cts +1 -0
  188. package/dist/internal/resources/adminNotices.d.ts +1 -0
  189. package/dist/internal/resources/adminPortal.cjs +2 -2
  190. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  191. package/dist/internal/resources/adminPortal.d.cts +19 -1
  192. package/dist/internal/resources/adminPortal.d.ts +19 -1
  193. package/dist/internal/resources/adminPortal.js +1 -1
  194. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  195. package/dist/internal/resources/adminSupport.d.cts +1 -0
  196. package/dist/internal/resources/adminSupport.d.ts +1 -0
  197. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  198. package/dist/internal/resources/auditLogs.d.cts +1 -0
  199. package/dist/internal/resources/auditLogs.d.ts +1 -0
  200. package/dist/internal/resources/cache.cjs.map +1 -1
  201. package/dist/internal/resources/cache.d.cts +1 -0
  202. package/dist/internal/resources/cache.d.ts +1 -0
  203. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  204. package/dist/internal/resources/cardIssuers.d.cts +1 -0
  205. package/dist/internal/resources/cardIssuers.d.ts +1 -0
  206. package/dist/internal/resources/configs.cjs.map +1 -1
  207. package/dist/internal/resources/configs.d.cts +1 -0
  208. package/dist/internal/resources/configs.d.ts +1 -0
  209. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  210. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -0
  211. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -0
  212. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  213. package/dist/internal/resources/connectorRestrictions.d.cts +1 -0
  214. package/dist/internal/resources/connectorRestrictions.d.ts +1 -0
  215. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  216. package/dist/internal/resources/diagnostic.d.cts +1 -0
  217. package/dist/internal/resources/diagnostic.d.ts +1 -0
  218. package/dist/internal/resources/gsm.cjs.map +1 -1
  219. package/dist/internal/resources/gsm.d.cts +1 -0
  220. package/dist/internal/resources/gsm.d.ts +1 -0
  221. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  222. package/dist/internal/resources/nativeRenewals.d.cts +1 -0
  223. package/dist/internal/resources/nativeRenewals.d.ts +1 -0
  224. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  225. package/dist/internal/resources/platformBilling.d.cts +1 -0
  226. package/dist/internal/resources/platformBilling.d.ts +1 -0
  227. package/dist/internal/resources/platformFees.cjs.map +1 -1
  228. package/dist/internal/resources/platformFees.d.cts +1 -0
  229. package/dist/internal/resources/platformFees.d.ts +1 -0
  230. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  231. package/dist/internal/resources/platformMessageTemplates.d.cts +1 -0
  232. package/dist/internal/resources/platformMessageTemplates.d.ts +1 -0
  233. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  234. package/dist/internal/resources/platformSettings.d.cts +1 -0
  235. package/dist/internal/resources/platformSettings.d.ts +1 -0
  236. package/dist/internal.cjs +8 -8
  237. package/dist/internal.cjs.map +1 -1
  238. package/dist/internal.d.cts +1 -1
  239. package/dist/internal.d.ts +1 -1
  240. package/dist/internal.js +5 -5
  241. package/dist/listQuery.cjs.map +1 -1
  242. package/dist/listQuery.d.cts +1 -0
  243. package/dist/listQuery.d.ts +1 -0
  244. package/dist/panes.cjs.map +1 -1
  245. package/dist/panes.d.cts +1 -0
  246. package/dist/panes.d.ts +1 -0
  247. package/dist/paymentPresentation.cjs.map +1 -1
  248. package/dist/paymentPresentation.d.cts +1 -0
  249. package/dist/paymentPresentation.d.ts +1 -0
  250. package/dist/recordCounter.cjs.map +1 -1
  251. package/dist/resources/aiTools.cjs.map +1 -1
  252. package/dist/resources/aiTools.d.cts +1 -0
  253. package/dist/resources/aiTools.d.ts +1 -0
  254. package/dist/resources/analytics.cjs.map +1 -1
  255. package/dist/resources/analytics.d.cts +1 -0
  256. package/dist/resources/analytics.d.ts +1 -0
  257. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  258. package/dist/resources/analyticsDashboard.d.cts +1 -0
  259. package/dist/resources/analyticsDashboard.d.ts +1 -0
  260. package/dist/resources/apiKeys.cjs.map +1 -1
  261. package/dist/resources/apiKeys.d.cts +1 -0
  262. package/dist/resources/apiKeys.d.ts +1 -0
  263. package/dist/resources/audit.cjs.map +1 -1
  264. package/dist/resources/audit.d.cts +1 -0
  265. package/dist/resources/audit.d.ts +1 -0
  266. package/dist/resources/authentication.cjs.map +1 -1
  267. package/dist/resources/authentication.d.cts +1 -0
  268. package/dist/resources/authentication.d.ts +1 -0
  269. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  270. package/dist/resources/availabilityOverrides.d.cts +1 -0
  271. package/dist/resources/availabilityOverrides.d.ts +1 -0
  272. package/dist/resources/billing.cjs.map +1 -1
  273. package/dist/resources/billing.d.cts +1 -0
  274. package/dist/resources/billing.d.ts +1 -0
  275. package/dist/resources/buyerAccount.cjs.map +1 -1
  276. package/dist/resources/buyerAccount.d.cts +1 -0
  277. package/dist/resources/buyerAccount.d.ts +1 -0
  278. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  279. package/dist/resources/buyerBlocklist.d.cts +1 -0
  280. package/dist/resources/buyerBlocklist.d.ts +1 -0
  281. package/dist/resources/buyerConversations.cjs.map +1 -1
  282. package/dist/resources/buyerConversations.d.cts +1 -0
  283. package/dist/resources/buyerConversations.d.ts +1 -0
  284. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  285. package/dist/resources/buyerEvidenceReviews.d.cts +1 -0
  286. package/dist/resources/buyerEvidenceReviews.d.ts +1 -0
  287. package/dist/resources/buyerPortal.cjs.map +1 -1
  288. package/dist/resources/buyerPortal.d.cts +1 -0
  289. package/dist/resources/buyerPortal.d.ts +1 -0
  290. package/dist/resources/cards.cjs.map +1 -1
  291. package/dist/resources/cards.d.cts +1 -0
  292. package/dist/resources/cards.d.ts +1 -0
  293. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  294. package/dist/resources/chargebackPrevention.d.cts +1 -0
  295. package/dist/resources/chargebackPrevention.d.ts +1 -0
  296. package/dist/resources/checkoutDomains.cjs.map +1 -1
  297. package/dist/resources/checkoutDomains.d.cts +1 -0
  298. package/dist/resources/checkoutDomains.d.ts +1 -0
  299. package/dist/resources/checkoutMethods.cjs.map +1 -1
  300. package/dist/resources/checkoutMethods.d.cts +1 -0
  301. package/dist/resources/checkoutMethods.d.ts +1 -0
  302. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  303. package/dist/resources/checkoutRecovery.d.cts +1 -0
  304. package/dist/resources/checkoutRecovery.d.ts +1 -0
  305. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  306. package/dist/resources/checkoutTemplates.d.cts +1 -0
  307. package/dist/resources/checkoutTemplates.d.ts +1 -0
  308. package/dist/resources/connectors.cjs.map +1 -1
  309. package/dist/resources/connectors.d.cts +1 -0
  310. package/dist/resources/connectors.d.ts +1 -0
  311. package/dist/resources/contentEncryption.cjs.map +1 -1
  312. package/dist/resources/contentEncryption.d.cts +1 -0
  313. package/dist/resources/contentEncryption.d.ts +1 -0
  314. package/dist/resources/costRules.cjs.map +1 -1
  315. package/dist/resources/costRules.d.cts +1 -0
  316. package/dist/resources/costRules.d.ts +1 -0
  317. package/dist/resources/customers.cjs.map +1 -1
  318. package/dist/resources/customers.d.cts +1 -0
  319. package/dist/resources/customers.d.ts +1 -0
  320. package/dist/resources/deploymentBranding.cjs.map +1 -1
  321. package/dist/resources/deploymentBranding.d.cts +1 -0
  322. package/dist/resources/deploymentBranding.d.ts +1 -0
  323. package/dist/resources/disputes.cjs.map +1 -1
  324. package/dist/resources/disputes.d.cts +1 -0
  325. package/dist/resources/disputes.d.ts +1 -0
  326. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  327. package/dist/resources/ephemeralKeys.d.cts +1 -0
  328. package/dist/resources/ephemeralKeys.d.ts +1 -0
  329. package/dist/resources/events.cjs.map +1 -1
  330. package/dist/resources/events.d.cts +1 -0
  331. package/dist/resources/events.d.ts +1 -0
  332. package/dist/resources/export.cjs.map +1 -1
  333. package/dist/resources/export.d.cts +1 -0
  334. package/dist/resources/export.d.ts +1 -0
  335. package/dist/resources/externalRecords.cjs.map +1 -1
  336. package/dist/resources/externalRecords.d.cts +1 -0
  337. package/dist/resources/externalRecords.d.ts +1 -0
  338. package/dist/resources/featureMatrix.cjs.map +1 -1
  339. package/dist/resources/featureMatrix.d.cts +1 -0
  340. package/dist/resources/featureMatrix.d.ts +1 -0
  341. package/dist/resources/fees.cjs.map +1 -1
  342. package/dist/resources/fees.d.cts +1 -0
  343. package/dist/resources/fees.d.ts +1 -0
  344. package/dist/resources/files.cjs.map +1 -1
  345. package/dist/resources/files.d.cts +1 -0
  346. package/dist/resources/files.d.ts +1 -0
  347. package/dist/resources/forex.cjs.map +1 -1
  348. package/dist/resources/forex.d.cts +1 -0
  349. package/dist/resources/forex.d.ts +1 -0
  350. package/dist/resources/identityVerifications.cjs.map +1 -1
  351. package/dist/resources/identityVerifications.d.cts +1 -0
  352. package/dist/resources/identityVerifications.d.ts +1 -0
  353. package/dist/resources/industries.cjs.map +1 -1
  354. package/dist/resources/industries.d.cts +1 -0
  355. package/dist/resources/industries.d.ts +1 -0
  356. package/dist/resources/invoiceSettings.cjs.map +1 -1
  357. package/dist/resources/invoiceSettings.d.cts +1 -0
  358. package/dist/resources/invoiceSettings.d.ts +1 -0
  359. package/dist/resources/invoices.cjs.map +1 -1
  360. package/dist/resources/invoices.d.cts +1 -0
  361. package/dist/resources/invoices.d.ts +1 -0
  362. package/dist/resources/live.cjs.map +1 -1
  363. package/dist/resources/live.d.cts +1 -0
  364. package/dist/resources/live.d.ts +1 -0
  365. package/dist/resources/mandates.cjs.map +1 -1
  366. package/dist/resources/mandates.d.cts +1 -0
  367. package/dist/resources/mandates.d.ts +1 -0
  368. package/dist/resources/merchantAccounts.cjs.map +1 -1
  369. package/dist/resources/merchantAccounts.d.cts +1 -0
  370. package/dist/resources/merchantAccounts.d.ts +1 -0
  371. package/dist/resources/messageTemplates.cjs.map +1 -1
  372. package/dist/resources/messageTemplates.d.cts +1 -0
  373. package/dist/resources/messageTemplates.d.ts +1 -0
  374. package/dist/resources/notices.cjs.map +1 -1
  375. package/dist/resources/notices.d.cts +1 -0
  376. package/dist/resources/notices.d.ts +1 -0
  377. package/dist/resources/operationLimits.cjs.map +1 -1
  378. package/dist/resources/operationLimits.d.cts +1 -0
  379. package/dist/resources/operationLimits.d.ts +1 -0
  380. package/dist/resources/paymentLinks.cjs.map +1 -1
  381. package/dist/resources/paymentLinks.d.cts +1 -0
  382. package/dist/resources/paymentLinks.d.ts +1 -0
  383. package/dist/resources/paymentMethods.cjs.map +1 -1
  384. package/dist/resources/paymentMethods.d.cts +1 -0
  385. package/dist/resources/paymentMethods.d.ts +1 -0
  386. package/dist/resources/payments.cjs.map +1 -1
  387. package/dist/resources/payments.d.cts +1 -0
  388. package/dist/resources/payments.d.ts +1 -0
  389. package/dist/resources/payoutDestinations.cjs +2 -2
  390. package/dist/resources/payoutDestinations.cjs.map +1 -1
  391. package/dist/resources/payoutDestinations.d.cts +9 -1
  392. package/dist/resources/payoutDestinations.d.ts +9 -1
  393. package/dist/resources/payoutDestinations.js +1 -1
  394. package/dist/resources/payouts.cjs.map +1 -1
  395. package/dist/resources/payouts.d.cts +1 -0
  396. package/dist/resources/payouts.d.ts +1 -0
  397. package/dist/resources/paypalDisputes.cjs.map +1 -1
  398. package/dist/resources/paypalDisputes.d.cts +1 -0
  399. package/dist/resources/paypalDisputes.d.ts +1 -0
  400. package/dist/resources/persons.cjs.map +1 -1
  401. package/dist/resources/persons.d.cts +1 -0
  402. package/dist/resources/persons.d.ts +1 -0
  403. package/dist/resources/poll.cjs.map +1 -1
  404. package/dist/resources/poll.d.cts +1 -0
  405. package/dist/resources/poll.d.ts +1 -0
  406. package/dist/resources/processorCosts.cjs.map +1 -1
  407. package/dist/resources/processorCosts.d.cts +1 -0
  408. package/dist/resources/processorCosts.d.ts +1 -0
  409. package/dist/resources/processorImports.cjs.map +1 -1
  410. package/dist/resources/processorImports.d.cts +1 -0
  411. package/dist/resources/processorImports.d.ts +1 -0
  412. package/dist/resources/products.cjs.map +1 -1
  413. package/dist/resources/products.d.cts +1 -0
  414. package/dist/resources/products.d.ts +1 -0
  415. package/dist/resources/profileAcquirers.cjs.map +1 -1
  416. package/dist/resources/profileAcquirers.d.cts +1 -0
  417. package/dist/resources/profileAcquirers.d.ts +1 -0
  418. package/dist/resources/profiles.cjs.map +1 -1
  419. package/dist/resources/profiles.d.cts +1 -0
  420. package/dist/resources/profiles.d.ts +1 -0
  421. package/dist/resources/projects.cjs.map +1 -1
  422. package/dist/resources/projects.d.cts +1 -0
  423. package/dist/resources/projects.d.ts +1 -0
  424. package/dist/resources/refunds.cjs.map +1 -1
  425. package/dist/resources/refunds.d.cts +1 -0
  426. package/dist/resources/refunds.d.ts +1 -0
  427. package/dist/resources/regions.cjs.map +1 -1
  428. package/dist/resources/regions.d.cts +1 -0
  429. package/dist/resources/regions.d.ts +1 -0
  430. package/dist/resources/relay.cjs.map +1 -1
  431. package/dist/resources/relay.d.cts +1 -0
  432. package/dist/resources/relay.d.ts +1 -0
  433. package/dist/resources/risk.cjs.map +1 -1
  434. package/dist/resources/risk.d.cts +1 -0
  435. package/dist/resources/risk.d.ts +1 -0
  436. package/dist/resources/routing.cjs.map +1 -1
  437. package/dist/resources/routing.d.cts +1 -0
  438. package/dist/resources/routing.d.ts +1 -0
  439. package/dist/resources/search.cjs.map +1 -1
  440. package/dist/resources/search.d.cts +1 -0
  441. package/dist/resources/search.d.ts +1 -0
  442. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  443. package/dist/resources/sellToRestrictions.d.cts +1 -0
  444. package/dist/resources/sellToRestrictions.d.ts +1 -0
  445. package/dist/resources/settings.cjs.map +1 -1
  446. package/dist/resources/settings.d.cts +1 -0
  447. package/dist/resources/settings.d.ts +1 -0
  448. package/dist/resources/settlement.cjs +2 -2
  449. package/dist/resources/settlement.cjs.map +1 -1
  450. package/dist/resources/settlement.d.cts +13 -1
  451. package/dist/resources/settlement.d.ts +13 -1
  452. package/dist/resources/settlement.js +1 -1
  453. package/dist/resources/shopLabels.cjs.map +1 -1
  454. package/dist/resources/shopLabels.d.cts +1 -0
  455. package/dist/resources/shopLabels.d.ts +1 -0
  456. package/dist/resources/shops.cjs.map +1 -1
  457. package/dist/resources/shops.d.cts +1 -0
  458. package/dist/resources/shops.d.ts +1 -0
  459. package/dist/resources/stripeConnect.cjs.map +1 -1
  460. package/dist/resources/stripeConnect.d.cts +1 -0
  461. package/dist/resources/stripeConnect.d.ts +1 -0
  462. package/dist/resources/subscriptions.cjs.map +1 -1
  463. package/dist/resources/subscriptions.d.cts +1 -0
  464. package/dist/resources/subscriptions.d.ts +1 -0
  465. package/dist/resources/support.cjs.map +1 -1
  466. package/dist/resources/support.d.cts +1 -0
  467. package/dist/resources/support.d.ts +1 -0
  468. package/dist/resources/threeDsRules.cjs.map +1 -1
  469. package/dist/resources/threeDsRules.d.cts +1 -0
  470. package/dist/resources/threeDsRules.d.ts +1 -0
  471. package/dist/resources/users.cjs.map +1 -1
  472. package/dist/resources/users.d.cts +1 -0
  473. package/dist/resources/users.d.ts +1 -0
  474. package/dist/resources/vatRates.cjs.map +1 -1
  475. package/dist/resources/vatRates.d.cts +1 -0
  476. package/dist/resources/vatRates.d.ts +1 -0
  477. package/dist/resources/verification.cjs.map +1 -1
  478. package/dist/resources/verification.d.cts +1 -0
  479. package/dist/resources/verification.d.ts +1 -0
  480. package/dist/resources/webhooks.cjs.map +1 -1
  481. package/dist/resources/webhooks.d.cts +1 -0
  482. package/dist/resources/webhooks.d.ts +1 -0
  483. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  484. package/dist/resources/whopResolutionCases.d.cts +1 -0
  485. package/dist/resources/whopResolutionCases.d.ts +1 -0
  486. package/dist/trustedOrigins.cjs.map +1 -1
  487. package/dist/types.cjs.map +1 -1
  488. package/dist/types.d.cts +92 -3
  489. package/dist/types.d.ts +92 -3
  490. package/package.json +19 -17
  491. package/dist/chunk-BY3BENXH.js.map +0 -1
  492. package/dist/chunk-KT2WXUWG.cjs.map +0 -1
  493. package/dist/chunk-KZHLKMVX.cjs.map +0 -1
  494. package/dist/chunk-OKFOU6F7.cjs.map +0 -1
  495. package/dist/chunk-R46A6AGY.cjs.map +0 -1
  496. package/dist/chunk-WCAIY7DR.cjs.map +0 -1
  497. package/dist/chunk-WYR27JGG.js.map +0 -1
  498. package/dist/chunk-Z5MEER63.js.map +0 -1
  499. /package/dist/{chunk-EBA6DJKI.js.map → chunk-3CR7RX65.js.map} +0 -0
  500. /package/dist/{chunk-OOC7ZT4T.js.map → chunk-BA6BTB56.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","../src/resources/sellToRestrictions.ts"],"names":[],"mappings":"AAAA;ACsBO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,QAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAA,CACJ,MAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gCAAA,EAAkC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAA,CACJ,SAAA,EACA,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,4BAAA,EAA+B,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC/E,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUkC,EAAA;AACpB,IAAA;AACV,MAAA;AAC4D,MAAA;AAC5D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAM4E,EAAA;AACM,IAAA;AAClF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaqC,EAAA;AAC6C,IAAA;AACxE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC+D,MAAA;AAC/D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQgG,EAAA;AAClF,IAAA;AACV,MAAA;AAC2E,MAAA;AAC7E,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAChD,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAC3E,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqE,EAAA;AACJ,IAAA;AACjE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOoF,EAAA;AACtE,IAAA;AACV,MAAA;AAC+D,MAAA;AACjE,IAAA;AACF,EAAA;AACF;ADtD4F;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-ACZ2R47X.cjs","sourcesContent":[null,"import type {\n ConnectorSellToRestriction,\n ProjectSellToRestriction,\n SellToRestrictionCapabilitiesResponse,\n SellToRestrictionDecisionsResponse,\n SellToRestrictionPolicyRequest,\n SellToRestrictionsResponse,\n ShopSellToRestriction,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Sell-to restrictions: the buyer countries a merchant refuses to sell to,\n * merchant-wide, per project and per shop. A refused payment fails with error\n * code `DE_10`.\n *\n * Every route needs a dashboard session. Reading needs the `SellToRestrictions`\n * area at `Read`, overriding a shop needs `Edit` (a shop-scoped role may\n * override only its own shop), a project's policy needs `Edit` at merchant\n * level (no shop-scoped role, project members included), and changing the\n * merchant-wide policy needs `Write`.\n */\nexport class SellToRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant-wide policy and every shop's effective policy. A caller\n * scoped to one shop receives that shop alone, and no merchant-wide policy.\n * `GET /sell-to-restrictions`\n */\n async retrieve(): Promise<SellToRestrictionsResponse> {\n return this.request('GET', '/sell-to-restrictions');\n }\n\n /**\n * Replace the merchant-wide policy every shop without an override inherits.\n * The change is recorded in the audit log before it is made.\n * `PUT /sell-to-restrictions/merchant`\n */\n async updateMerchantPolicy(\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<SellToRestrictionsResponse> {\n return this.request('PUT', '/sell-to-restrictions/merchant', { body: params, ...options });\n }\n\n /**\n * Give one shop its own policy, replacing the merchant-wide policy for that\n * shop. An empty `blocked_countries` lifts every restriction for it.\n * `PUT /sell-to-restrictions/shops/{profile_id}`\n */\n async updateShopOverride(\n profileId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's override, so it inherits the merchant-wide policy again.\n * Removing an override the shop does not have changes nothing.\n * `DELETE /sell-to-restrictions/shops/{profile_id}`\n */\n async deleteShopOverride(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,\n options,\n );\n }\n\n /**\n * One project's own policy, if it has one.\n * `GET /sell-to-restrictions/projects/{project_id}`\n */\n async retrieveProject(projectId: string): Promise<ProjectSellToRestriction> {\n return this.request('GET', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`);\n }\n\n /**\n * Give one project its own policy. It replaces the merchant-wide policy for\n * every shop of the project's subtree without an override or a nearer\n * project policy, from their next payment on. An empty `blocked_countries`\n * lifts every restriction for them. Recorded in the audit log first.\n * `PUT /sell-to-restrictions/projects/{project_id}`\n */\n async updateProjectPolicy(\n projectId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one project's policy, so its subtree inherits from above again.\n * Removing a policy the project does not have changes nothing.\n * `DELETE /sell-to-restrictions/projects/{project_id}`\n */\n async deleteProjectPolicy(\n projectId: string,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`,\n options,\n );\n }\n\n /**\n * One payment connector account's own policy, and which buyer\n * signals its payments can be judged on. Needs the merchant-level `Read`\n * rung; a shop-scoped role is refused.\n * `GET /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async retrieveConnectorPolicy(merchantConnectorId: string): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Give one payment connector account its own policy. It applies on top of\n * each shop's policy, in every shop the account serves, from the next\n * payment on: a buyer it refuses is routed to another account of the shop.\n * Needs the merchant-wide `Write` rung and write visibility for the\n * processor; recorded in the audit log first.\n * `PUT /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async updateConnectorPolicy(\n merchantConnectorId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'PUT',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Remove one connector account's own policy; each shop's policy still\n * applies. Removing a policy the account does not have changes nothing.\n * `DELETE /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async deleteConnectorPolicy(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n options,\n );\n }\n\n /**\n * Which checks each payment path performs, and how this deployment resolves\n * a buyer's country — read before relying on a restriction for a path.\n * `GET /sell-to-restrictions/capabilities`\n */\n async capabilities(): Promise<SellToRestrictionCapabilitiesResponse> {\n return this.request('GET', '/sell-to-restrictions/capabilities');\n }\n\n /**\n * Why a payment was refused: where, by which signal, for which country and\n * under which policy. A shop-scoped caller sees only refusals in its shop.\n * `GET /sell-to-restrictions/payments/{payment_id}/decisions`\n */\n async listDecisions(paymentId: string): Promise<SellToRestrictionDecisionsResponse> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`,\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-ACZ2R47X.cjs","../src/resources/sellToRestrictions.ts"],"names":[],"mappings":"AAAA;ACsBO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,QAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uBAAuB,CAAA;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAA,CACJ,MAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gCAAA,EAAkC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAA,CACJ,SAAA,EACA,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,4BAAA,EAA+B,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC/E,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUkC,EAAA;AACpB,IAAA;AACV,MAAA;AAC4D,MAAA;AAC5D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAM4E,EAAA;AACM,IAAA;AAClF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaqC,EAAA;AAC6C,IAAA;AACxE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC+D,MAAA;AAC/D,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQgG,EAAA;AAClF,IAAA;AACV,MAAA;AAC2E,MAAA;AAC7E,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAChD,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUuC,EAAA;AACzB,IAAA;AACV,MAAA;AAC2E,MAAA;AAC3E,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqE,EAAA;AACJ,IAAA;AACjE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOoF,EAAA;AACtE,IAAA;AACV,MAAA;AAC+D,MAAA;AACjE,IAAA;AACF,EAAA;AACF;ADtD4F;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-ACZ2R47X.cjs","sourcesContent":[null,"import type {\n ConnectorSellToRestriction,\n ProjectSellToRestriction,\n SellToRestrictionCapabilitiesResponse,\n SellToRestrictionDecisionsResponse,\n SellToRestrictionPolicyRequest,\n SellToRestrictionsResponse,\n ShopSellToRestriction,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Sell-to restrictions: the buyer countries a merchant refuses to sell to,\n * merchant-wide, per project and per shop. A refused payment fails with error\n * code `DE_10`.\n *\n * Every route needs a dashboard session. Reading needs the `SellToRestrictions`\n * area at `Read`, overriding a shop needs `Edit` (a shop-scoped role may\n * override only its own shop), a project's policy needs `Edit` at merchant\n * level (no shop-scoped role, project members included), and changing the\n * merchant-wide policy needs `Write`.\n */\nexport class SellToRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant-wide policy and every shop's effective policy. A caller\n * scoped to one shop receives that shop alone, and no merchant-wide policy.\n * `GET /sell-to-restrictions`\n */\n async retrieve(): Promise<SellToRestrictionsResponse> {\n return this.request('GET', '/sell-to-restrictions');\n }\n\n /**\n * Replace the merchant-wide policy every shop without an override inherits.\n * The change is recorded in the audit log before it is made.\n * `PUT /sell-to-restrictions/merchant`\n */\n async updateMerchantPolicy(\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<SellToRestrictionsResponse> {\n return this.request('PUT', '/sell-to-restrictions/merchant', { body: params, ...options });\n }\n\n /**\n * Give one shop its own policy, replacing the merchant-wide policy for that\n * shop. An empty `blocked_countries` lifts every restriction for it.\n * `PUT /sell-to-restrictions/shops/{profile_id}`\n */\n async updateShopOverride(\n profileId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one shop's override, so it inherits the merchant-wide policy again.\n * Removing an override the shop does not have changes nothing.\n * `DELETE /sell-to-restrictions/shops/{profile_id}`\n */\n async deleteShopOverride(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ShopSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/shops/${encodeURIComponent(profileId)}`,\n options,\n );\n }\n\n /**\n * One project's own policy, if it has one.\n * `GET /sell-to-restrictions/projects/{project_id}`\n */\n async retrieveProject(projectId: string): Promise<ProjectSellToRestriction> {\n return this.request('GET', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`);\n }\n\n /**\n * Give one project its own policy. It replaces the merchant-wide policy for\n * every shop of the project's subtree without an override or a nearer\n * project policy, from their next payment on. An empty `blocked_countries`\n * lifts every restriction for them. Recorded in the audit log first.\n * `PUT /sell-to-restrictions/projects/{project_id}`\n */\n async updateProjectPolicy(\n projectId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request('PUT', `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Remove one project's policy, so its subtree inherits from above again.\n * Removing a policy the project does not have changes nothing.\n * `DELETE /sell-to-restrictions/projects/{project_id}`\n */\n async deleteProjectPolicy(\n projectId: string,\n options?: RequestExtras,\n ): Promise<ProjectSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/projects/${encodeURIComponent(projectId)}`,\n options,\n );\n }\n\n /**\n * One payment connector account's own policy, and which buyer\n * signals its payments can be judged on. Needs the merchant-level `Read`\n * rung; a shop-scoped role is refused.\n * `GET /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async retrieveConnectorPolicy(merchantConnectorId: string): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Give one payment connector account its own policy. It applies on top of\n * each shop's policy, in every shop the account serves, from the next\n * payment on: a buyer it refuses is routed to another account of the shop.\n * Needs the merchant-wide `Write` rung and write visibility for the\n * processor; recorded in the audit log first.\n * `PUT /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async updateConnectorPolicy(\n merchantConnectorId: string,\n params: SellToRestrictionPolicyRequest,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'PUT',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n { body: params, ...options },\n );\n }\n\n /**\n * Remove one connector account's own policy; each shop's policy still\n * applies. Removing a policy the account does not have changes nothing.\n * `DELETE /sell-to-restrictions/connectors/{merchant_connector_id}`\n */\n async deleteConnectorPolicy(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectorSellToRestriction> {\n return this.request(\n 'DELETE',\n `/sell-to-restrictions/connectors/${encodeURIComponent(merchantConnectorId)}`,\n options,\n );\n }\n\n /**\n * Which checks each payment path performs, and how this deployment resolves\n * a buyer's country — read before relying on a restriction for a path.\n * `GET /sell-to-restrictions/capabilities`\n */\n async capabilities(): Promise<SellToRestrictionCapabilitiesResponse> {\n return this.request('GET', '/sell-to-restrictions/capabilities');\n }\n\n /**\n * Why a payment was refused: where, by which signal, for which country and\n * under which policy. A shop-scoped caller sees only refusals in its shop.\n * `GET /sell-to-restrictions/payments/{payment_id}/decisions`\n */\n async listDecisions(paymentId: string): Promise<SellToRestrictionDecisionsResponse> {\n return this.request(\n 'GET',\n `/sell-to-restrictions/payments/${encodeURIComponent(paymentId)}/decisions`,\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-AVR2GPXU.cjs","../src/resources/identityVerifications.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACwCO,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;AAAA;AAAA;AAAA,EAUlD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,yBAAA,EAA2B,EAAE,IAAA,EAAM,MAAA,EA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AA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeqC,EAAA;AACvB,IAAA;AACV,MAAA;AAC0E,MAAA;AAC1E,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBoD,EAAA;AACiB,IAAA;AAC3D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWwD,EAAA;AACoB,IAAA;AAC5E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW0D,EAAA;AACc,IAAA;AACpE,MAAA;AACG,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWyC,EAAA;AACsC,IAAA;AAC5C,MAAA;AAC5B,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYiD,EAAA;AACnC,IAAA;AACV,MAAA;AAC8E,MAAA;AAC9E,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADhI6F;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-AVR2GPXU.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n AmlEventListResponse,\n AmlMonitoringRequest,\n ConnectionCheckSettingRequest,\n ConnectionCheckSettingResponse,\n ConnectionChecksResponse,\n IdentityVerificationCreateRequest,\n IdentityVerificationFlowsQuery,\n IdentityVerificationFlowsResponse,\n IdentityVerificationListQuery,\n IdentityVerificationListResponse,\n IdentityVerificationResponse,\n IdentityVerificationRetrieveQuery,\n DeviceIntelligenceSettingRequest,\n DeviceIntelligenceSettingResponse,\n DeviceSignalResponse,\n EffectiveRequirementResponse,\n IdentityVerificationDecisionResponse,\n IdentityVerificationRequirementDeleteQuery,\n IdentityVerificationRequirementDeleteResponse,\n IdentityVerificationRequirementListResponse,\n IdentityVerificationRequirementRequest,\n IdentityVerificationRequirementResponse,\n OperationScreeningResponse,\n PaymentScreeningResponse,\n PaymentScreeningSettingRequest,\n PaymentScreeningSettingResponse,\n SubjectVerificationQuery,\n SubjectVerificationResponse,\n} from '../types';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Identity verification (KYC, KYB, AML screening, age, proof of address)\n * through a connected identity verification provider account, such as Didit.\n *\n * The provider account is a connector account of type `fiz_operations`. A test\n * verification runs on the account's test credentials only, a live one on its\n * live credentials only. Reading needs permission to read customers; starting\n * a verification needs permission to edit them.\n */\nexport class IdentityVerifications {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Start a verification of a person or a business. The provider-side\n * workflow decides the checks. With a `return_url`, the provider's session\n * is created at once and its page returned in `verification_url`. With a\n * `payment_id` and no `return_url`, the payment's checkout starts it.\n *\n * `POST /identity-verifications`\n */\n async create(\n params: IdentityVerificationCreateRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('POST', '/identity-verifications', { body: params, ...options });\n }\n\n /**\n * The merchant's verifications, newest first unless `sort_by` says\n * otherwise. A caller limited to one shop sees that shop's only. Several\n * `outcome`, `kind` or `merchant_connector_id` values match a verification\n * with any of them.\n *\n * `GET /identity-verifications`\n */\n async list(\n query?: IdentityVerificationListQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationListResponse> {\n return this.request('GET', '/identity-verifications', {\n query: csvQuery(query, ['outcome', 'kind', 'merchant_connector_id']),\n ...options,\n });\n }\n\n /**\n * One verification. With `force_sync: true`, a verification the provider\n * can still change (pending or in review, or a subject under ongoing AML\n * monitoring) is read from the provider first.\n *\n * `GET /identity-verifications/{verification_id}`\n */\n async retrieve(\n verificationId: string,\n query?: IdentityVerificationRetrieveQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('GET', `/identity-verifications/${encodeURIComponent(verificationId)}`, {\n query: query as Query | undefined,\n ...options,\n });\n }\n\n /**\n * A subject's latest verification in one environment (live unless\n * `test_mode: true`), with its checks, and the subject's verification under\n * ongoing AML monitoring. This is what risk rules read. `verification` and\n * `aml_monitoring` are `null` when the subject has none.\n *\n * `GET /identity-verifications/subjects/{subject_reference}`\n */\n async subject(\n subjectReference: string,\n query?: SubjectVerificationQuery,\n options?: RequestExtras,\n ): Promise<SubjectVerificationResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/subjects/${encodeURIComponent(subjectReference)}`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * The provider-side workflows an account can run in one environment, read\n * from the provider with that environment's credentials. Pass a `flow_id`\n * as `provider_flow_id` to {@link IdentityVerifications.create}.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/flows`\n */\n async flows(\n merchantConnectorId: string,\n query?: IdentityVerificationFlowsQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationFlowsResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/flows`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * Switch ongoing AML monitoring of a verification's subject. The provider\n * then keeps re-screening the subject against sanctions, PEP and\n * adverse-media lists, and every change it reports is recorded. Only a\n * verified person or business can be enrolled; monitoring can be switched\n * off at any time. Needs permission to edit customers.\n *\n * `POST /identity-verifications/{verification_id}/aml-monitoring`\n */\n async setAmlMonitoring(\n verificationId: string,\n params: AmlMonitoringRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request(\n 'POST',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,\n { body: params, ...options },\n );\n }\n\n /**\n * Every change of the subject's AML result the provider reported while the\n * subject was monitored, newest first, at most 100.\n *\n * `GET /identity-verifications/{verification_id}/aml-events`\n */\n async amlEvents(verificationId: string, options?: RequestExtras): Promise<AmlEventListResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,\n options,\n );\n }\n\n /**\n * A payment's screening by the transaction monitoring of the shop's\n * screening account. Recorded only: it never holds or refuses the payment.\n * Answers 404 when the payment has no screening. Needs permission to read\n * payments.\n *\n * `GET /identity-verifications/payment-screenings/{payment_id}`\n */\n async paymentScreening(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account screens its shop's payments. Needs permission to read\n * connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async paymentScreeningSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n options,\n );\n }\n\n /**\n * Switch screening of the account's shop's payments. Switched on, every\n * payment of the shop that succeeds from then on is screened shortly after,\n * in the payment's own environment. A shop has at most one screening\n * account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async updatePaymentScreeningSetting(\n merchantConnectorId: string,\n params: PaymentScreeningSettingRequest,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n { body: params, ...options },\n );\n }\n\n /**\n * A refund's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens refunds. Recorded only: it\n * never holds or reverses the refund. Answers 404 when the refund has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/refund-screenings/{refund_id}`\n */\n async refundScreening(\n refundId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/refund-screenings/${encodeURIComponent(refundId)}`,\n options,\n );\n }\n\n /**\n * A payout's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens payouts. Recorded only: it\n * never holds or reverses the payout. Answers 404 when the payout has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/payout-screenings/{payout_id}`\n */\n async payoutScreening(\n payoutId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payout-screenings/${encodeURIComponent(payoutId)}`,\n options,\n );\n }\n\n /**\n * Whether an account assesses its shop's checkout devices. Needs permission\n * to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async deviceIntelligenceSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n options,\n );\n }\n\n /**\n * Switch device intelligence of the account's shop. Switched on, every\n * checkout of the shop assesses the buyer's device and records the\n * provider's signal on the payment; it never holds or refuses a payment.\n * Switching on is refused when the provider has not switched the feature on\n * for the account. A shop has at most one device intelligence account.\n * Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async updateDeviceIntelligenceSetting(\n merchantConnectorId: string,\n params: DeviceIntelligenceSettingRequest,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's device signal from its checkout's device assessment. Recorded\n * only: it never holds or refuses the payment. Answers 404 when the payment's\n * checkout was not assessed. Needs permission to read payments.\n *\n * `GET /identity-verifications/device-signals/{payment_id}`\n */\n async deviceSignal(paymentId: string, options?: RequestExtras): Promise<DeviceSignalResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/device-signals/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account rates the buyer addresses of its shop's payments.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async connectionCheckSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n options,\n );\n }\n\n /**\n * Switch the connection check of the account's shop. Switched on, the\n * buyer address of every payment the shop confirms is rated by the\n * provider, once per payment and address, before authorization. A\n * provider that classifies addresses reports the network classes it found\n * (hosting, Tor, VPN, proxy, residential proxy), and each counts as that\n * network class in the buyer risk score and the buyer blocklist. For a\n * provider that only rates, a `high` or `very_high` rating counts as the\n * `proxy` class. A check never holds or refuses a payment by itself. Switching on asks the\n * provider nothing, since every check is billed. A shop has at most one\n * connection check account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async updateConnectionCheckSetting(\n merchantConnectorId: string,\n params: ConnectionCheckSettingRequest,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's connection checks, newest first; empty when none ran. Each\n * check carries the network classes it counts as, and, from a provider that\n * classifies addresses, the services, infrastructure and risk tags it\n * named. `email_checks` lists the recorded email checks of the payment's\n * buyer: rating, flags and times, never the address; reading them starts no\n * check. Needs permission to read payments.\n *\n * `GET /identity-verifications/connection-checks/{payment_id}`\n */\n async connectionChecks(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ConnectionChecksResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/connection-checks/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Set which payments need an identity verification at one level: the\n * merchant, a project, a shop, a checkout template or one payment. `off`\n * lifts a wider requirement. Without `payment_method_types` or\n * `merchant_connector_ids` the checkout shows the identity step before any\n * payment option; with them, only when the buyer picks a matching method.\n * A payment is decided once, so a later change does not change it.\n * Merchant, project and checkout template requirements need a\n * merchant-level caller; a shop on a checkout template takes its\n * requirement from the template. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/requirements`\n */\n async putRequirement(\n params: IdentityVerificationRequirementRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementResponse> {\n return this.request('PUT', '/identity-verifications/requirements', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Every requirement of the merchant. A caller limited to one shop sees the\n * merchant's and projects' requirements and its own shop's and payments'.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements`\n */\n async listRequirements(\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementListResponse> {\n return this.request('GET', '/identity-verifications/requirements', options);\n }\n\n /**\n * The level inherits again. Payments already decided keep their decision.\n * Needs permission to edit connectors.\n *\n * `DELETE /identity-verifications/requirements`\n */\n async deleteRequirement(\n query: IdentityVerificationRequirementDeleteQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementDeleteResponse> {\n return this.request('DELETE', '/identity-verifications/requirements', {\n query: query as unknown as Query,\n ...options,\n });\n }\n\n /**\n * The requirement a new payment of the shop meets and the level it comes\n * from. Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements/effective`\n */\n async effectiveRequirement(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveRequirementResponse> {\n return this.request('GET', '/identity-verifications/requirements/effective', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Whether the payment needs an identity verification, as decided the first\n * time its checkout was drawn or it was confirmed. Not found until then.\n * Needs permission to read payments.\n *\n * `GET /identity-verifications/requirements/payments/{payment_id}`\n */\n async paymentDecision(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<IdentityVerificationDecisionResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/requirements/payments/${encodeURIComponent(paymentId)}`,\n options,\n );\n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A;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-AVR2GPXU.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n AmlEventListResponse,\n AmlMonitoringRequest,\n ConnectionCheckSettingRequest,\n ConnectionCheckSettingResponse,\n ConnectionChecksResponse,\n IdentityVerificationCreateRequest,\n IdentityVerificationFlowsQuery,\n IdentityVerificationFlowsResponse,\n IdentityVerificationListQuery,\n IdentityVerificationListResponse,\n IdentityVerificationResponse,\n IdentityVerificationRetrieveQuery,\n DeviceIntelligenceSettingRequest,\n DeviceIntelligenceSettingResponse,\n DeviceSignalResponse,\n EffectiveRequirementResponse,\n IdentityVerificationDecisionResponse,\n IdentityVerificationRequirementDeleteQuery,\n IdentityVerificationRequirementDeleteResponse,\n IdentityVerificationRequirementListResponse,\n IdentityVerificationRequirementRequest,\n IdentityVerificationRequirementResponse,\n OperationScreeningResponse,\n PaymentScreeningResponse,\n PaymentScreeningSettingRequest,\n PaymentScreeningSettingResponse,\n SubjectVerificationQuery,\n SubjectVerificationResponse,\n} from '../types';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Identity verification (KYC, KYB, AML screening, age, proof of address)\n * through a connected identity verification provider account, such as Didit.\n *\n * The provider account is a connector account of type `fiz_operations`. A test\n * verification runs on the account's test credentials only, a live one on its\n * live credentials only. Reading needs permission to read customers; starting\n * a verification needs permission to edit them.\n */\nexport class IdentityVerifications {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Start a verification of a person or a business. The provider-side\n * workflow decides the checks. With a `return_url`, the provider's session\n * is created at once and its page returned in `verification_url`. With a\n * `payment_id` and no `return_url`, the payment's checkout starts it.\n *\n * `POST /identity-verifications`\n */\n async create(\n params: IdentityVerificationCreateRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('POST', '/identity-verifications', { body: params, ...options });\n }\n\n /**\n * The merchant's verifications, newest first unless `sort_by` says\n * otherwise. A caller limited to one shop sees that shop's only. Several\n * `outcome`, `kind` or `merchant_connector_id` values match a verification\n * with any of them.\n *\n * `GET /identity-verifications`\n */\n async list(\n query?: IdentityVerificationListQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationListResponse> {\n return this.request('GET', '/identity-verifications', {\n query: csvQuery(query, ['outcome', 'kind', 'merchant_connector_id']),\n ...options,\n });\n }\n\n /**\n * One verification. With `force_sync: true`, a verification the provider\n * can still change (pending or in review, or a subject under ongoing AML\n * monitoring) is read from the provider first.\n *\n * `GET /identity-verifications/{verification_id}`\n */\n async retrieve(\n verificationId: string,\n query?: IdentityVerificationRetrieveQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('GET', `/identity-verifications/${encodeURIComponent(verificationId)}`, {\n query: query as Query | undefined,\n ...options,\n });\n }\n\n /**\n * A subject's latest verification in one environment (live unless\n * `test_mode: true`), with its checks, and the subject's verification under\n * ongoing AML monitoring. This is what risk rules read. `verification` and\n * `aml_monitoring` are `null` when the subject has none.\n *\n * `GET /identity-verifications/subjects/{subject_reference}`\n */\n async subject(\n subjectReference: string,\n query?: SubjectVerificationQuery,\n options?: RequestExtras,\n ): Promise<SubjectVerificationResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/subjects/${encodeURIComponent(subjectReference)}`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * The provider-side workflows an account can run in one environment, read\n * from the provider with that environment's credentials. Pass a `flow_id`\n * as `provider_flow_id` to {@link IdentityVerifications.create}.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/flows`\n */\n async flows(\n merchantConnectorId: string,\n query?: IdentityVerificationFlowsQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationFlowsResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/flows`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * Switch ongoing AML monitoring of a verification's subject. The provider\n * then keeps re-screening the subject against sanctions, PEP and\n * adverse-media lists, and every change it reports is recorded. Only a\n * verified person or business can be enrolled; monitoring can be switched\n * off at any time. Needs permission to edit customers.\n *\n * `POST /identity-verifications/{verification_id}/aml-monitoring`\n */\n async setAmlMonitoring(\n verificationId: string,\n params: AmlMonitoringRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request(\n 'POST',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,\n { body: params, ...options },\n );\n }\n\n /**\n * Every change of the subject's AML result the provider reported while the\n * subject was monitored, newest first, at most 100.\n *\n * `GET /identity-verifications/{verification_id}/aml-events`\n */\n async amlEvents(verificationId: string, options?: RequestExtras): Promise<AmlEventListResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,\n options,\n );\n }\n\n /**\n * A payment's screening by the transaction monitoring of the shop's\n * screening account. Recorded only: it never holds or refuses the payment.\n * Answers 404 when the payment has no screening. Needs permission to read\n * payments.\n *\n * `GET /identity-verifications/payment-screenings/{payment_id}`\n */\n async paymentScreening(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account screens its shop's payments. Needs permission to read\n * connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async paymentScreeningSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n options,\n );\n }\n\n /**\n * Switch screening of the account's shop's payments. Switched on, every\n * payment of the shop that succeeds from then on is screened shortly after,\n * in the payment's own environment. A shop has at most one screening\n * account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async updatePaymentScreeningSetting(\n merchantConnectorId: string,\n params: PaymentScreeningSettingRequest,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n { body: params, ...options },\n );\n }\n\n /**\n * A refund's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens refunds. Recorded only: it\n * never holds or reverses the refund. Answers 404 when the refund has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/refund-screenings/{refund_id}`\n */\n async refundScreening(\n refundId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/refund-screenings/${encodeURIComponent(refundId)}`,\n options,\n );\n }\n\n /**\n * A payout's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens payouts. Recorded only: it\n * never holds or reverses the payout. Answers 404 when the payout has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/payout-screenings/{payout_id}`\n */\n async payoutScreening(\n payoutId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payout-screenings/${encodeURIComponent(payoutId)}`,\n options,\n );\n }\n\n /**\n * Whether an account assesses its shop's checkout devices. Needs permission\n * to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async deviceIntelligenceSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n options,\n );\n }\n\n /**\n * Switch device intelligence of the account's shop. Switched on, every\n * checkout of the shop assesses the buyer's device and records the\n * provider's signal on the payment; it never holds or refuses a payment.\n * Switching on is refused when the provider has not switched the feature on\n * for the account. A shop has at most one device intelligence account.\n * Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async updateDeviceIntelligenceSetting(\n merchantConnectorId: string,\n params: DeviceIntelligenceSettingRequest,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's device signal from its checkout's device assessment. Recorded\n * only: it never holds or refuses the payment. Answers 404 when the payment's\n * checkout was not assessed. Needs permission to read payments.\n *\n * `GET /identity-verifications/device-signals/{payment_id}`\n */\n async deviceSignal(paymentId: string, options?: RequestExtras): Promise<DeviceSignalResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/device-signals/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account rates the buyer addresses of its shop's payments.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async connectionCheckSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n options,\n );\n }\n\n /**\n * Switch the connection check of the account's shop. Switched on, the\n * buyer address of every payment the shop confirms is rated by the\n * provider, once per payment and address, before authorization. A\n * provider that classifies addresses reports the network classes it found\n * (hosting, Tor, VPN, proxy, residential proxy), and each counts as that\n * network class in the buyer risk score and the buyer blocklist. For a\n * provider that only rates, a `high` or `very_high` rating counts as the\n * `proxy` class. A check never holds or refuses a payment by itself. Switching on asks the\n * provider nothing, since every check is billed. A shop has at most one\n * connection check account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async updateConnectionCheckSetting(\n merchantConnectorId: string,\n params: ConnectionCheckSettingRequest,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's connection checks, newest first; empty when none ran. Each\n * check carries the network classes it counts as, and, from a provider that\n * classifies addresses, the services, infrastructure and risk tags it\n * named. `email_checks` lists the recorded email checks of the payment's\n * buyer: rating, flags and times, never the address; reading them starts no\n * check. Needs permission to read payments.\n *\n * `GET /identity-verifications/connection-checks/{payment_id}`\n */\n async connectionChecks(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ConnectionChecksResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/connection-checks/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Set which payments need an identity verification at one level: the\n * merchant, a project, a shop, a checkout template or one payment. `off`\n * lifts a wider requirement. Without `payment_method_types` or\n * `merchant_connector_ids` the checkout shows the identity step before any\n * payment option; with them, only when the buyer picks a matching method.\n * A payment is decided once, so a later change does not change it.\n * Merchant, project and checkout template requirements need a\n * merchant-level caller; a shop on a checkout template takes its\n * requirement from the template. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/requirements`\n */\n async putRequirement(\n params: IdentityVerificationRequirementRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementResponse> {\n return this.request('PUT', '/identity-verifications/requirements', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Every requirement of the merchant. A caller limited to one shop sees the\n * merchant's and projects' requirements and its own shop's and payments'.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements`\n */\n async listRequirements(\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementListResponse> {\n return this.request('GET', '/identity-verifications/requirements', options);\n }\n\n /**\n * The level inherits again. Payments already decided keep their decision.\n * Needs permission to edit connectors.\n *\n * `DELETE /identity-verifications/requirements`\n */\n async deleteRequirement(\n query: IdentityVerificationRequirementDeleteQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementDeleteResponse> {\n return this.request('DELETE', '/identity-verifications/requirements', {\n query: query as unknown as Query,\n ...options,\n });\n }\n\n /**\n * The requirement a new payment of the shop meets and the level it comes\n * from. Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements/effective`\n */\n async effectiveRequirement(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveRequirementResponse> {\n return this.request('GET', '/identity-verifications/requirements/effective', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Whether the payment needs an identity verification, as decided the first\n * time its checkout was drawn or it was confirmed. Not found until then.\n * Needs permission to read payments.\n *\n * `GET /identity-verifications/requirements/payments/{payment_id}`\n */\n async paymentDecision(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<IdentityVerificationDecisionResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/requirements/payments/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","../src/internal/resources/adminFileScans.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACYO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAA,EAAkC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,KAAA,EAA+B,CAAC,CAAA,EAA8B;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAA,CAAQ,MAAA,EAA0B,CAAC,CAAA,EAA6B;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kCAAA,EAAoC;AAAA,MAC7D,KAAA,EAAO,wCAAA,KAAS,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAC;AAAA,IACzC,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADXA;AACA;AACE;AACF,wCAAC","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-AYUYJO3I.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n BlockedFileList,\n BlockedFileQuery,\n FileScannerCheck,\n FileScannerTestRequest,\n FileScanStatus,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\n/**\n * Malware scanning of uploaded files: buyer evidence, buyer conversation\n * attachments and support attachments. The scanner's status and its test\n * need an operator who may change operations settings; the list of blocked\n * files takes any internal platform-operator role (`403` otherwise).\n */\nexport class AdminFileScans {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The scanner settings in force and where they come from, a check of the\n * scanner made for this answer, when it last finished a file and how many\n * files wait for their scan. `GET /admin-portal/file-scans/status`\n */\n async status(): Promise<FileScanStatus> {\n return this.request('GET', '/admin-portal/file-scans/status');\n }\n\n /**\n * Ask a scanner whether it answers, before it is saved. Only the connection\n * is tested: no file content is sent. A field left out takes the value in\n * force. An address outside the deployment's private network is refused\n * without a connection (`problem: 'public_address'`).\n * `POST /admin-portal/file-scans/test`\n */\n async test(body: FileScannerTestRequest = {}): Promise<FileScannerCheck> {\n return this.request('POST', '/admin-portal/file-scans/test', { body });\n }\n\n /**\n * Uploaded files their scan blocked, of every kind, latest result first\n * unless `sort_by` says otherwise, with what the scanner found. Several\n * `kind` or `side` values match a file with any of them. A blocked file's\n * content is never handed out. `GET /admin-portal/file-scans/blocked`\n */\n async blocked(query: BlockedFileQuery = {}): Promise<BlockedFileList> {\n return this.request('GET', '/admin-portal/file-scans/blocked', {\n query: csvQuery(query, ['kind', 'side']),\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-AYUYJO3I.cjs","../src/internal/resources/adminFileScans.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACYO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAA,EAAkC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iCAAiC,CAAA;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,KAAA,EAA+B,CAAC,CAAA,EAA8B;AACvE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,OAAA,CAAQ,MAAA,EAA0B,CAAC,CAAA,EAA6B;AACpE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kCAAA,EAAoC;AAAA,MAC7D,KAAA,EAAO,wCAAA,KAAS,EAAO,CAAC,MAAA,EAAQ,MAAM,CAAC;AAAA,IACzC,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADXA;AACA;AACE;AACF,wCAAC","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-AYUYJO3I.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n BlockedFileList,\n BlockedFileQuery,\n FileScannerCheck,\n FileScannerTestRequest,\n FileScanStatus,\n} from '../types';\nimport { csvQuery } from '../../listQuery';\n\n/**\n * Malware scanning of uploaded files: buyer evidence, buyer conversation\n * attachments and support attachments. The scanner's status and its test\n * need an operator who may change operations settings; the list of blocked\n * files takes any internal platform-operator role (`403` otherwise).\n */\nexport class AdminFileScans {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The scanner settings in force and where they come from, a check of the\n * scanner made for this answer, when it last finished a file and how many\n * files wait for their scan. `GET /admin-portal/file-scans/status`\n */\n async status(): Promise<FileScanStatus> {\n return this.request('GET', '/admin-portal/file-scans/status');\n }\n\n /**\n * Ask a scanner whether it answers, before it is saved. Only the connection\n * is tested: no file content is sent. A field left out takes the value in\n * force. An address outside the deployment's private network is refused\n * without a connection (`problem: 'public_address'`).\n * `POST /admin-portal/file-scans/test`\n */\n async test(body: FileScannerTestRequest = {}): Promise<FileScannerCheck> {\n return this.request('POST', '/admin-portal/file-scans/test', { body });\n }\n\n /**\n * Uploaded files their scan blocked, of every kind, latest result first\n * unless `sort_by` says otherwise, with what the scanner found. Several\n * `kind` or `side` values match a file with any of them. A blocked file's\n * content is never handed out. `GET /admin-portal/file-scans/blocked`\n */\n async blocked(query: BlockedFileQuery = {}): Promise<BlockedFileList> {\n return this.request('GET', '/admin-portal/file-scans/blocked', {\n query: csvQuery(query, ['kind', 'side']),\n });\n }\n}\n"]}
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-LG7XHNAY.js";
43
43
  import {
44
44
  Settlement
45
- } from "./chunk-BY3BENXH.js";
45
+ } from "./chunk-57S5IX5S.js";
46
46
  import {
47
47
  ShopLabels
48
48
  } from "./chunk-UH2A7ZDK.js";
@@ -81,7 +81,7 @@ import {
81
81
  } from "./chunk-MCBBXUKA.js";
82
82
  import {
83
83
  PayoutDestinations
84
- } from "./chunk-Z5MEER63.js";
84
+ } from "./chunk-T6INFOU2.js";
85
85
  import {
86
86
  Payouts
87
87
  } from "./chunk-DO2DYNFW.js";
@@ -329,4 +329,4 @@ Delopay.webhooks = Webhooks;
329
329
  export {
330
330
  Delopay
331
331
  };
332
- //# sourceMappingURL=chunk-OOC7ZT4T.js.map
332
+ //# sourceMappingURL=chunk-BA6BTB56.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-BCA3TCGS.cjs","../src/internal/resources/platformBilling.ts"],"names":[],"mappings":"AAAA;ACuBO,IAAM,gBAAA,EAAN,MAAsB;AAAA,EAC3B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,MAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,aAAA,CAAA,EAAiB;AAAA,MACrF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,KAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,YAAA,CAAA,EAAgB;AAAA,MACpF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,eAAA,CACJ,UAAA,EACA,QAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,OAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,cAAA,EAAiB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AACxE,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASgG,EAAA;AAClF,IAAA;AACV,MAAA;AACuF,MAAA;AACzF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWgG,EAAA;AACN,IAAA;AAChF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcmC,EAAA;AACyD,IAAA;AAClF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcmC,EAAA;AACwD,IAAA;AACjF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBmC,EAAA;AACsC,IAAA;AAC/D,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAegG,EAAA;AACR,IAAA;AAC9E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBqC,EAAA;AACsD,IAAA;AACjF,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBsC,EAAA;AACmD,IAAA;AAC/E,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADvD8F;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-BCA3TCGS.cjs","sourcesContent":[null,"import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminCreateLedgerRequest,\n AdminCreateLedgerResponse,\n AdminResetLedgerRequest,\n AdminResetLedgerResponse,\n AdminSetFreeRequest,\n AdminSetHardFloorRequest,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n UpdateLedgerEntryRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Edit a single ledger entry (amount and/or description), keeping the\n * merchant balance consistent: when `amount` changes, the balance is\n * atomically adjusted by the difference. Returns the entry id and new\n * balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to edit.\n * @param params - New amount / description (either optional).\n */\n async editLedgerEntry(\n merchantId: string,\n ledgerId: string,\n params: UpdateLedgerEntryRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'PATCH',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete a single ledger entry, reversing its amount from the merchant\n * balance. Returns the deleted entry id and the new balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to delete.\n */\n async deleteLedgerEntry(merchantId: string, ledgerId: string): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'DELETE',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n );\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n\n /**\n * Set the merchant's hard floor — the balance at or below which the\n * merchant stops being active. A negative value grants a credit line; zero\n * means no negative balance at all. This moves the suspension line, it does\n * not remove it. The value and the caller are written to the audit log\n * before the floor changes, so the change is always attributable.\n *\n * Refused (412) for a positive amount, for a floor beyond the maximum\n * credit line of 10,000,000 minor units, or for an empty `reason`.\n *\n * Requires a router that serves the hard-floor admin route; older ones\n * answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The new floor (zero or negative) and the audit reason.\n * @returns The updated billing profile.\n */\n async setHardFloor(\n merchantId: string,\n params: AdminSetHardFloorRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/hard-floor`, {\n body: params,\n });\n }\n\n /**\n * Mark a merchant free (not billed), or put it back on the prepaid model.\n * While free, no platform fee is deducted, the payment gate never blocks on\n * billing status, top-ups are refused and auto-recharge is inert. Marking\n * free needs a `reason` and is refused (412) while an admin suspension is in\n * force — lift that first.\n *\n * Requires a router that supports the free flag; older ones answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired free state and, when marking free, the reason.\n * @returns The updated billing profile.\n */\n async setFree(merchantId: string, params: AdminSetFreeRequest): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/free`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant's **entire** ledger. Every live entry is soft-deleted —\n * kept, so a replayed fee deduction or top-up webhook still no-ops — the\n * balance is set to zero and the status re-derived (`active` for a free\n * merchant; an active paying merchant lands in `delinquent`). Refused (412)\n * while the merchant has shop allocations. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The reason, required for audit.\n * @returns What was removed and the post-reset profile.\n */\n async resetLedger(\n merchantId: string,\n params: AdminResetLedgerRequest,\n ): Promise<AdminResetLedgerResponse> {\n return this.request('DELETE', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n\n /**\n * (Re)create a merchant's ledger, optionally seeded with an opening\n * balance. Ensures the billing profile exists (created without the welcome\n * promo credit) and, when `opening_balance` is set, writes one\n * `opening_balance` entry through the same atomic helper an admin credit\n * uses. Refused (412) while live entries or a non-zero balance remain —\n * reset first. Does not clear the free flag. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Opening balance (minor units), currency for a new profile, and the reason.\n * @returns The opening entry id (if one was written) and the profile.\n */\n async createLedger(\n merchantId: string,\n params: AdminCreateLedgerRequest,\n ): Promise<AdminCreateLedgerResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-BCA3TCGS.cjs","../src/internal/resources/platformBilling.ts"],"names":[],"mappings":"AAAA;ACuBO,IAAM,gBAAA,EAAN,MAAsB;AAAA,EAC3B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,MAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,aAAA,CAAA,EAAiB;AAAA,MACrF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,KAAA,CACJ,UAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,YAAA,CAAA,EAAgB;AAAA,MACpF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,eAAA,CACJ,UAAA,EACA,QAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,OAAA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es/delo-payment/sdk-publish-w2/dist/chunk-BCA3TCGS.cjs","sourcesContent":[null,"import type {\n AdminAdjustmentRequest,\n AdminAdjustmentResponse,\n AdminCreateLedgerRequest,\n AdminCreateLedgerResponse,\n AdminResetLedgerRequest,\n AdminResetLedgerResponse,\n AdminSetFreeRequest,\n AdminSetHardFloorRequest,\n AdminSuspendRequest,\n AdminUnsuspendRequest,\n AdminSetTrustedRequest,\n UpdateLedgerEntryRequest,\n} from '../types';\nimport type { BillingProfileResponse } from '../../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Platform-level ledger adjustments on a merchant's balance. Admin-only\n * routes under `/billing/{merchantId}/admin/credit|debit`. Exposed only\n * via `'@delopay/sdk/internal'` so the public merchant SDK doesn't\n * advertise the admin adjustment path in autocomplete.\n */\nexport class PlatformBilling {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Manually credit a merchant's balance (e.g. promotional credit,\n * dispute reversal, manual correction).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Credit amount and reason.\n */\n async credit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {\n body: params,\n });\n }\n\n /**\n * Manually debit a merchant's balance.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Debit amount and reason.\n */\n async debit(\n merchantId: string,\n params: AdminAdjustmentRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {\n body: params,\n });\n }\n\n /**\n * Edit a single ledger entry (amount and/or description), keeping the\n * merchant balance consistent: when `amount` changes, the balance is\n * atomically adjusted by the difference. Returns the entry id and new\n * balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to edit.\n * @param params - New amount / description (either optional).\n */\n async editLedgerEntry(\n merchantId: string,\n ledgerId: string,\n params: UpdateLedgerEntryRequest,\n ): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'PATCH',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete a single ledger entry, reversing its amount from the merchant\n * balance. Returns the deleted entry id and the new balance.\n *\n * @param merchantId - The merchant account ID.\n * @param ledgerId - The ledger entry id to delete.\n */\n async deleteLedgerEntry(merchantId: string, ledgerId: string): Promise<AdminAdjustmentResponse> {\n return this.request(\n 'DELETE',\n `/billing/${encodeURIComponent(merchantId)}/admin/ledger/${encodeURIComponent(ledgerId)}`,\n );\n }\n\n /**\n * Manually suspend a merchant (e.g. confirmed fraud or ToS violation),\n * independent of balance. A `reason` is required for audit. Throws 412 if\n * the merchant is trusted (clear the flag first) or already suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Suspension reason.\n * @returns The updated billing profile.\n */\n async suspend(merchantId: string, params: AdminSuspendRequest): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/suspend`, {\n body: params,\n });\n }\n\n /**\n * Lift a suspension. Restores the merchant to `active` (or `delinquent` if\n * the balance is at/below the hard floor) and resets the recharge-failure\n * counter. Throws 412 if the merchant is not suspended.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional audit note.\n * @returns The updated billing profile.\n */\n async unsuspend(\n merchantId: string,\n params: AdminUnsuspendRequest = {},\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/unsuspend`, {\n body: params,\n });\n }\n\n /**\n * Set or clear the trusted (suspension-exempt) flag. Trusted merchants\n * cannot be suspended automatically or manually. Does not lift an existing\n * suspension — use {@link PlatformBilling.unsuspend} for that.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired trusted state.\n * @returns The updated billing profile.\n */\n async setTrusted(\n merchantId: string,\n params: AdminSetTrustedRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/trusted`, {\n body: params,\n });\n }\n\n /**\n * Set the merchant's hard floor — the balance at or below which the\n * merchant stops being active. A negative value grants a credit line; zero\n * means no negative balance at all. This moves the suspension line, it does\n * not remove it. The value and the caller are written to the audit log\n * before the floor changes, so the change is always attributable.\n *\n * Refused (412) for a positive amount, for a floor beyond the maximum\n * credit line of 10,000,000 minor units, or for an empty `reason`.\n *\n * Requires a router that serves the hard-floor admin route; older ones\n * answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The new floor (zero or negative) and the audit reason.\n * @returns The updated billing profile.\n */\n async setHardFloor(\n merchantId: string,\n params: AdminSetHardFloorRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/hard-floor`, {\n body: params,\n });\n }\n\n /**\n * Mark a merchant free (not billed), or put it back on the prepaid model.\n * While free, no platform fee is deducted, the payment gate never blocks on\n * billing status, top-ups are refused and auto-recharge is inert. Marking\n * free needs a `reason` and is refused (412) while an admin suspension is in\n * force — lift that first.\n *\n * Requires a router that supports the free flag; older ones answer `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The desired free state and, when marking free, the reason.\n * @returns The updated billing profile.\n */\n async setFree(merchantId: string, params: AdminSetFreeRequest): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/admin/free`, {\n body: params,\n });\n }\n\n /**\n * Delete a merchant's **entire** ledger. Every live entry is soft-deleted —\n * kept, so a replayed fee deduction or top-up webhook still no-ops — the\n * balance is set to zero and the status re-derived (`active` for a free\n * merchant; an active paying merchant lands in `delinquent`). Refused (412)\n * while the merchant has shop allocations. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The reason, required for audit.\n * @returns What was removed and the post-reset profile.\n */\n async resetLedger(\n merchantId: string,\n params: AdminResetLedgerRequest,\n ): Promise<AdminResetLedgerResponse> {\n return this.request('DELETE', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n\n /**\n * (Re)create a merchant's ledger, optionally seeded with an opening\n * balance. Ensures the billing profile exists (created without the welcome\n * promo credit) and, when `opening_balance` is set, writes one\n * `opening_balance` entry through the same atomic helper an admin credit\n * uses. Refused (412) while live entries or a non-zero balance remain —\n * reset first. Does not clear the free flag. Audited.\n *\n * Requires a router that serves the ledger admin routes; older ones answer\n * `404`.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Opening balance (minor units), currency for a new profile, and the reason.\n * @returns The opening entry id (if one was written) and the profile.\n */\n async createLedger(\n merchantId: string,\n params: AdminCreateLedgerRequest,\n ): Promise<AdminCreateLedgerResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {\n body: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-BP6KDQ6I.cjs","../src/resources/settings.ts"],"names":[],"mappings":"AAAA;ACqBA,SAAS,YAAA,CAAa,KAAA,EAAsD;AAC1E,EAAA,OAAO,KAAA,CAAM,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA,CAAM,WAAW,EAAA,EAAI,CAAC,CAAA;AAChE;AAEO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAiB,MAAA,EAA+B,CAAC,CAAA,EAA8B;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAA,EAAsB,EAAE,KAAA,EAAO,YAAA,CAAa,KAAK,EAAE,CAAC,CAAA;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,cAAA,CACJ,MAAA,EACA,MAAA,EAA+B,CAAC,CAAA,EACL;AAC3B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,oBAAA,EAAsB;AAAA,MACjD,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,YAAA,CAAa,KAAK;AAAA,IAC3B,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,YAAA,CAAa,SAAA,EAA8C;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8F,EAAA;AAChB,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADzBgF;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-BP6KDQ6I.cjs","sourcesContent":[null,"import type { MerchantSettingsQuery, SettingsResponse, UpdateSettingsRequest } from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Settings of the caller's merchant, its projects and its shops.\n *\n * One resource for every setting: each is a key with a JSON value, listed with\n * its default, whether a value is stored, its revision and who changed it last.\n * A merchant changes only its own values; values the platform operator sets at\n * the same scope are listed beside them (`authority: 'operator'`) and are\n * read-only here.\n *\n * Every change is recorded in the audit log with the previous and the new\n * value (`entity_type: 'setting'`), so one setting's history is\n * `audit.list({ entity_type: 'setting', entity_id })`.\n *\n * Dashboard (JWT) routes. Reading the merchant's settings needs\n * `MerchantAccountRead`, a shop's `ProfileAccountRead`; each change needs the\n * permission its setting names.\n */\n/** The query string of a merchant-scope call; a null project is omitted. */\nfunction projectQuery(query: MerchantSettingsQuery): Record<string, string> {\n return query.project_id ? { project_id: query.project_id } : {};\n}\n\nexport class Settings {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's settings, or one project's.\n *\n * `GET /settings/merchant`\n */\n async retrieveMerchant(query: MerchantSettingsQuery = {}): Promise<SettingsResponse> {\n return this.request('GET', '/settings/merchant', { query: projectQuery(query) });\n }\n\n /**\n * Change the merchant's own settings, or one project's. All changes are\n * applied or none is.\n *\n * `PATCH /settings/merchant`\n */\n async updateMerchant(\n params: UpdateSettingsRequest,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request('PATCH', '/settings/merchant', {\n body: params,\n query: projectQuery(query),\n });\n }\n\n /**\n * One shop's settings.\n *\n * `GET /settings/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<SettingsResponse> {\n return this.request('GET', `/settings/shops/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Change one shop's own settings.\n *\n * `PATCH /settings/shops/{profileId}`\n */\n async updateShop(profileId: string, params: UpdateSettingsRequest): Promise<SettingsResponse> {\n return this.request('PATCH', `/settings/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-BP6KDQ6I.cjs","../src/resources/settings.ts"],"names":[],"mappings":"AAAA;ACqBA,SAAS,YAAA,CAAa,KAAA,EAAsD;AAC1E,EAAA,OAAO,KAAA,CAAM,WAAA,EAAa,EAAE,UAAA,EAAY,KAAA,CAAM,WAAW,EAAA,EAAI,CAAC,CAAA;AAChE;AAEO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAiB,MAAA,EAA+B,CAAC,CAAA,EAA8B;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAA,EAAsB,EAAE,KAAA,EAAO,YAAA,CAAa,KAAK,EAAE,CAAC,CAAA;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,cAAA,CACJ,MAAA,EACA,MAAA,EAA+B,CAAC,CAAA,EACL;AAC3B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,oBAAA,EAAsB;AAAA,MACjD,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,YAAA,CAAa,KAAK;AAAA,IAC3B,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,YAAA,CAAa,SAAA,EAA8C;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,gBAAA,EAAmB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8F,EAAA;AAChB,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADzBgF;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-BP6KDQ6I.cjs","sourcesContent":[null,"import type { MerchantSettingsQuery, SettingsResponse, UpdateSettingsRequest } from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Settings of the caller's merchant, its projects and its shops.\n *\n * One resource for every setting: each is a key with a JSON value, listed with\n * its default, whether a value is stored, its revision and who changed it last.\n * A merchant changes only its own values; values the platform operator sets at\n * the same scope are listed beside them (`authority: 'operator'`) and are\n * read-only here.\n *\n * Every change is recorded in the audit log with the previous and the new\n * value (`entity_type: 'setting'`), so one setting's history is\n * `audit.list({ entity_type: 'setting', entity_id })`.\n *\n * Dashboard (JWT) routes. Reading the merchant's settings needs\n * `MerchantAccountRead`, a shop's `ProfileAccountRead`; each change needs the\n * permission its setting names.\n */\n/** The query string of a merchant-scope call; a null project is omitted. */\nfunction projectQuery(query: MerchantSettingsQuery): Record<string, string> {\n return query.project_id ? { project_id: query.project_id } : {};\n}\n\nexport class Settings {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's settings, or one project's.\n *\n * `GET /settings/merchant`\n */\n async retrieveMerchant(query: MerchantSettingsQuery = {}): Promise<SettingsResponse> {\n return this.request('GET', '/settings/merchant', { query: projectQuery(query) });\n }\n\n /**\n * Change the merchant's own settings, or one project's. All changes are\n * applied or none is.\n *\n * `PATCH /settings/merchant`\n */\n async updateMerchant(\n params: UpdateSettingsRequest,\n query: MerchantSettingsQuery = {},\n ): Promise<SettingsResponse> {\n return this.request('PATCH', '/settings/merchant', {\n body: params,\n query: projectQuery(query),\n });\n }\n\n /**\n * One shop's settings.\n *\n * `GET /settings/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<SettingsResponse> {\n return this.request('GET', `/settings/shops/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Change one shop's own settings.\n *\n * `PATCH /settings/shops/{profileId}`\n */\n async updateShop(profileId: string, params: UpdateSettingsRequest): Promise<SettingsResponse> {\n return this.request('PATCH', `/settings/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-BRY3W7N3.cjs","../src/internal/resources/adminLive.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CACmB,OAAA,EACA,UAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,8CAAA,IAAe,CAAK,UAAA,EAAY,2BAAA,EAA6B,OAAO,CAAA;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,QAAA,CACJ,UAAA,EACA,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,6BAAA,EAA+B;AAAA,MACxD,KAAA,EAAO;AAAA,QACL,WAAA,EAAa,UAAA;AAAA,QACb,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADVA;AACA;AACE;AACF,8BAAC","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-BRY3W7N3.cjs","sourcesContent":[null,"import type { LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse } from '../../types';\nimport type { EventStreamFn, RequestExtras, RequestFn } from '../../client';\nimport { openLiveStream } from '../../resources/live';\nimport type { LiveEventStream } from '../../resources/live';\n\n/**\n * Live updates of the admin dashboard: the same events as\n * the merchant dashboard's `live`, for every merchant, and the versions an\n * admin editor names in `If-Match`. Needs an internal platform-operator JWT.\n */\nexport class AdminLive {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Open the stream of what changed in every merchant. Each change names its\n * `merchant_id`. The SDK does not reconnect — see `LiveEventStream`.\n *\n * `GET /admin-portal/live/stream`\n */\n async stream(options?: LiveStreamOptions): Promise<LiveEventStream> {\n return openLiveStream(this.openStream, '/admin-portal/live/stream', options);\n }\n\n /**\n * The versions an admin editor of `merchantId` names in `If-Match`. A save\n * over a newer version is refused with `IR_16` (400), `error.data` a\n * `LiveChangedElsewhere`.\n *\n * `GET /admin-portal/live/versions`\n */\n async versions(\n merchantId: string,\n params: LiveVersionsParams,\n options?: RequestExtras,\n ): Promise<LiveVersionsResponse> {\n return this.request('GET', '/admin-portal/live/versions', {\n query: {\n merchant_id: merchantId,\n entities: params.entities.join(','),\n profile_id: params.profile_id,\n record_id: params.record_id,\n },\n ...options,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-BRY3W7N3.cjs","../src/internal/resources/adminLive.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CACmB,OAAA,EACA,UAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,8CAAA,IAAe,CAAK,UAAA,EAAY,2BAAA,EAA6B,OAAO,CAAA;AAAA,EAC7E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,QAAA,CACJ,UAAA,EACA,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,6BAAA,EAA+B;AAAA,MACxD,KAAA,EAAO;AAAA,QACL,WAAA,EAAa,UAAA;AAAA,QACb,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADVA;AACA;AACE;AACF,8BAAC","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-BRY3W7N3.cjs","sourcesContent":[null,"import type { LiveStreamOptions, LiveVersionsParams, LiveVersionsResponse } from '../../types';\nimport type { EventStreamFn, RequestExtras, RequestFn } from '../../client';\nimport { openLiveStream } from '../../resources/live';\nimport type { LiveEventStream } from '../../resources/live';\n\n/**\n * Live updates of the admin dashboard: the same events as\n * the merchant dashboard's `live`, for every merchant, and the versions an\n * admin editor names in `If-Match`. Needs an internal platform-operator JWT.\n */\nexport class AdminLive {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Open the stream of what changed in every merchant. Each change names its\n * `merchant_id`. The SDK does not reconnect — see `LiveEventStream`.\n *\n * `GET /admin-portal/live/stream`\n */\n async stream(options?: LiveStreamOptions): Promise<LiveEventStream> {\n return openLiveStream(this.openStream, '/admin-portal/live/stream', options);\n }\n\n /**\n * The versions an admin editor of `merchantId` names in `If-Match`. A save\n * over a newer version is refused with `IR_16` (400), `error.data` a\n * `LiveChangedElsewhere`.\n *\n * `GET /admin-portal/live/versions`\n */\n async versions(\n merchantId: string,\n params: LiveVersionsParams,\n options?: RequestExtras,\n ): Promise<LiveVersionsResponse> {\n return this.request('GET', '/admin-portal/live/versions', {\n query: {\n merchant_id: merchantId,\n entities: params.entities.join(','),\n profile_id: params.profile_id,\n record_id: params.record_id,\n },\n ...options,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/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,EAAO,qBAAA,EAAuB,EAAE,GA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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":["/home/anes/delo-payment/sdk-publish-w2/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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A;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":"/home/anes/delo-payment/sdk-publish-w2/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/jonathan/Desktop/DeloPay/dev1/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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,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAwBH,MAAM,MAAA,CAAO,OAAA,EAAuD;AAClE,IAAA,OAAO,cAAA,CAAe,IAAA,CAAK,UAAA,EAAY,cAAA,EAAgB,OAAO,CAAA;AAAA,EAChE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,QAAA,CACJ,MAAA,EACA,OAAA,EAC+B;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gBAAA,EAAkB;AAAA,MAC3C,KAAA,EAAO;AAAA,QACL,QAAA,EAAU,MAAA,CAAO,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,QAClC,UAAA,EAAY,MAAA,CAAO,UAAA;AAAA,QACnB,SAAA,EAAW,MAAA,CAAO;AAAA,MACpB,CAAA;AAAA,MACA,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AD7DA;AACA;AACE;AACA;AACA;AACA;AACF,uJAAC","file":"/home/jonathan/Desktop/DeloPay/dev1/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":["/home/anes/delo-payment/sdk-publish-w2/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,EAA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reamEvent,\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 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-CKKNFFKP.cjs","../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA;AC+CO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,eAAA,CAAgB,OAAA,EAA4D;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,8BAAA,EAAgC,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3E;AAAA;AAAA,EAGA,MAAM,kBAAA,CACJ,MAAA,EACA,OAAA,EACmC;AACnC,IAAA,OAAO,IAAA,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DeloPay/dev1/delopay-typescript-sdk/dist/chunk-CKKNFFKP.cjs","sourcesContent":[null,"import type {\n BuyerPortalSubscriptionCapabilities,\n NativeShopConfigRequest,\n NativeShopConfigResponse,\n NativeDunningConfigRequest,\n NativeDunningConfigResponse,\n AdoptSubscriptionRequest,\n AdoptSubscriptionResponse,\n CreateSubscriptionRequest,\n CreateAndConfirmSubscriptionRequest,\n ConfirmSubscriptionRequest,\n UpdateSubscriptionRequest,\n PauseSubscriptionRequest,\n ResumeSubscriptionRequest,\n CancelSubscriptionRequest,\n SubscriptionResponse,\n ConfirmSubscriptionResponse,\n PauseSubscriptionResponse,\n ResumeSubscriptionResponse,\n CancelSubscriptionResponse,\n GetSubscriptionItemsResponse,\n GetSubscriptionItemsParams,\n SubscriptionEstimateResponse,\n SubscriptionEstimateParams,\n SubscriptionListParams,\n SubscriptionPaymentLookupRequest,\n SubscriptionPaymentLookupResponse,\n SubscriptionInvoiceListParams,\n SubscriptionInvoiceListResponse,\n SubscriptionBillingProcessorResponse,\n SubscriptionImportApplyRequest,\n SubscriptionImportApplyResponse,\n SubscriptionImportPreviewRequest,\n SubscriptionImportPreviewResponse,\n SubscriptionItemsPage,\n SubscriptionSyncRequest,\n SubscriptionSyncResponse,\n SubscriptionSyncResult,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Subscription endpoints are profile-scoped: the backend requires an\n * `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`\n * otherwise). Pass it through the per-call `options.headers`, e.g.\n * `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.\n */\nexport class Subscriptions {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */\n async getNativeConfig(options?: RequestExtras): Promise<NativeShopConfigResponse> {\n return this.request('GET', '/subscriptions/native/config', { ...options });\n }\n\n /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */\n async updateNativeConfig(\n params: NativeShopConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeShopConfigResponse> {\n return this.request('PUT', '/subscriptions/native/config', { body: params, ...options });\n }\n\n /** Read merchant-wide renewal recovery settings. */\n async getNativeDunning(options?: RequestExtras): Promise<NativeDunningConfigResponse> {\n return this.request('GET', '/subscriptions/native/dunning', { ...options });\n }\n\n async updateNativeDunning(\n params: NativeDunningConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeDunningConfigResponse> {\n return this.request('PUT', '/subscriptions/native/dunning', { body: params, ...options });\n }\n\n /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */\n async getCapabilities(\n subscriptionId: string,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionCapabilities> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,\n { ...options },\n );\n }\n\n /**\n * Create and immediately confirm a subscription. `POST /subscriptions`\n *\n * For billing processors that require buyer approval (e.g. PayPal), the\n * response carries a `redirect_url` the customer must be sent to.\n */\n async createAndConfirm(\n params: CreateAndConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', '/subscriptions', { body: params, ...options });\n }\n\n /** Create a subscription without confirming it. `POST /subscriptions/create` */\n async create(\n params: CreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('POST', '/subscriptions/create', { body: params, ...options });\n }\n\n /**\n * Adopt an existing Creem subscription. `POST /subscriptions/adopt`\n *\n * Requires adoption to be enabled on the deployment and `X-Profile-Id` in\n * options.headers. Adoption charges nothing and emits no invoice or webhook.\n * Repeating the processor subscription ID returns the existing DeloPay ID.\n * Retry when handoff_confirmed is false. That flag confirms persistence,\n * not the merchant's external switch-over: stop processing Creem events in\n * your own integration when handing subsequent events to DeloPay.\n */\n async adopt(\n params: AdoptSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<AdoptSubscriptionResponse> {\n return this.request('POST', '/subscriptions/adopt', { body: params, ...options });\n }\n\n /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */\n async retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}`, {\n ...options,\n });\n }\n\n /**\n * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`\n *\n * Like {@link createAndConfirm}, the response may carry a `redirect_url` for\n * processors that require buyer approval.\n */\n async confirm(\n subscriptionId: string,\n params: ConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async update(\n subscriptionId: string,\n params: UpdateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('PUT', `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List subscriptions for the profile, or one customer's with `customer_id`.\n * `GET /subscriptions/list`\n */\n async list(\n params?: SubscriptionListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse[]> {\n return this.request('GET', '/subscriptions/list', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */\n async getEstimate(\n params: SubscriptionEstimateParams,\n options?: RequestExtras,\n ): Promise<SubscriptionEstimateResponse> {\n return this.request('GET', '/subscriptions/estimate', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */\n async getItems(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/subscriptions/items', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * {@link getItems}, with whether the list is only the first part of what the\n * processor holds. `GET /subscriptions/items`\n *\n * The backend states that in the `X-Delopay-Items-Truncated` response\n * header (Stripe Billing lists its first 100 products), which the plain\n * {@link getItems} cannot return. Without `limit` and `offset` every item\n * the billing account offers is listed, up to 500.\n */\n async getItemsPage(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<SubscriptionItemsPage> {\n let truncated = false;\n const items = await this.request<GetSubscriptionItemsResponse[]>(\n 'GET',\n '/subscriptions/items',\n {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n onDownloadProgress: (event) => {\n // The headers arrive with the first event; a retried request reports\n // them again, and the last attempt is the one the items come from.\n truncated = event.headers.get('x-delopay-items-truncated')?.toLowerCase() === 'true';\n options?.onDownloadProgress?.(event);\n },\n },\n );\n return { items, truncated };\n }\n\n /**\n * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n *\n * The body defaults to `{}` so the request still carries\n * `Content-Type: application/json` even when no params are passed — the\n * backend rejects the POST otherwise (\"Unsupported content type\").\n */\n async pause(\n subscriptionId: string,\n params?: PauseSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<PauseSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async resume(\n subscriptionId: string,\n params?: ResumeSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ResumeSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel`\n *\n * A subscription in a state it cannot be cancelled from is refused with\n * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async cancel(\n subscriptionId: string,\n params?: CancelSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<CancelSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Read 1 to 50 subscriptions back from their billing processor and mirror\n * what it reports. `POST /subscriptions/sync`\n *\n * Nothing is written at the processor. A status is mirrored only with the\n * time the processor stamped it with, and never over a newer event already\n * recorded; a plan only with its own stamp. One result per id, in request\n * order; one that fails does not stop the others.\n */\n async sync(\n params: SubscriptionSyncRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionSyncResponse> {\n return this.request('POST', '/subscriptions/sync', { body: params, ...options });\n }\n\n /**\n * Read one subscription back from its billing processor and mirror what it\n * reports, as {@link sync} does, with what the processor reported beside\n * what the mirror now holds. `POST /subscriptions/{subscriptionId}/sync`\n */\n async syncOne(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionSyncResult> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/sync`, {\n ...options,\n });\n }\n\n /**\n * List the subscriptions a billing account holds at its processor, and how\n * each relates to DeloPay's: already held, new (its buyer is a DeloPay\n * customer), needing a customer, ended, or not adoptable here.\n * `POST /subscriptions/import/preview`\n *\n * Reads only; nothing is written here or at the processor. Creem and\n * Stripe Billing can be listed; PayPal cannot, which `capabilities` states\n * (`reason_code: 'listing_unsupported'`).\n */\n async importPreview(\n params: SubscriptionImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportPreviewResponse> {\n return this.request('POST', '/subscriptions/import/preview', { body: params, ...options });\n }\n\n /**\n * Take 1 to 25 processor subscriptions over, each through {@link adopt}\n * with every one of its checks, one after another.\n * `POST /subscriptions/import/apply`\n *\n * One result per selection, in request order; one refused does not stop\n * the others.\n */\n async importApply(\n params: SubscriptionImportApplyRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportApplyResponse> {\n return this.request('POST', '/subscriptions/import/apply', { body: params, ...options });\n }\n\n /**\n * Resolve which of the given payments were raised by a subscription.\n * `POST /subscriptions/payments/lookup`\n *\n * The linkage exists in one direction only — an invoice points at the payment\n * it settled, and nothing is stamped on the payment — so this is the only way\n * to tell a subscription charge from a one-off one when you are holding a\n * page of payments. In particular, do not use `off_session` or the presence\n * of a mandate: an ordinary saved-card charge sets those identically.\n *\n * Ids that belong to no subscription are **absent** from `links` rather than\n * returned as an error, so match on presence:\n *\n * ```ts\n * const { links } = await subscriptions.lookupPayments(\n * { payment_ids: page.map((p) => p.payment_id) },\n * { headers: { 'X-Profile-Id': profileId } },\n * );\n * const bySubscription = new Map(links.map((l) => [l.payment_id, l]));\n * ```\n *\n * Profile-scoped like every other subscription route, and that matters more\n * here than elsewhere: a `payment_id` is merchant-supplied and only unique\n * within a merchant, so the shop is part of the question, not an\n * optimisation. Pass the profile that owns **the payments** — for a list\n * spanning several shops, group the ids by shop and call once per group.\n *\n * At most 200 ids per call.\n */\n async lookupPayments(\n params: SubscriptionPaymentLookupRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionPaymentLookupResponse> {\n return this.request('POST', '/subscriptions/payments/lookup', { body: params, ...options });\n }\n\n /**\n * One subscription's billing history, newest cycle first.\n * `GET /subscriptions/{subscriptionId}/invoices`\n *\n * {@link retrieve} carries only the *latest* invoice, which is the current\n * cycle — a subscription that has renewed monthly for a year has one of those\n * and twelve of these. Use this wherever a merchant needs to see what a\n * subscription has actually billed, in particular on self-charging processors\n * (Creem, PayPal) where each renewal is charged by the processor and mirrored\n * here rather than raised as a DeloPay payment.\n *\n * Two things to render honestly, both decided rather than incidental:\n *\n * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net\n * them: the difference between the two is not a smaller charge.\n * - A `refunded_amount` of `null` is \"not reported\" and must not render as\n * `0`. Likewise a processor-hosted origination records a bootstrap invoice\n * at `0` before the buyer has paid anything, so a zero amount on such a\n * subscription is a placeholder rather than a free cycle.\n *\n * Profile-scoped like every other subscription route.\n */\n async listInvoices(\n subscriptionId: string,\n params?: SubscriptionInvoiceListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceListResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * Which billing processor this shop's subscriptions run on.\n * `GET /subscriptions/billing_processor`\n *\n * The same mapping is derivable from the connector inventory\n * (`GET /account/{merchant_id}/connectors`), but that route is gated by a\n * connector-read permission granted independently of subscriptions — so a\n * role authorised to create subscriptions could be unable to learn which\n * processor it was creating them on. This answers under the same\n * authorization as the rest of the subscription API.\n *\n * Reach for it when the client must branch on the processor *before* calling\n * — origination differs by processor, and guessing is destructive. Resolve\n * the shop's `billing_processor_id` first: a shop that runs no subscriptions\n * has none assigned, and this route has no identity to report for it.\n */\n async getBillingProcessor(\n options?: RequestExtras,\n ): Promise<SubscriptionBillingProcessorResponse> {\n return this.request('GET', '/subscriptions/billing_processor', { ...options });\n }\n}\n"]}
1
+ {"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-CKKNFFKP.cjs","../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA;AC+CO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,eAAA,CAAgB,OAAA,EAA4D;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA,CA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBiD,EAAA;AAC8B,IAAA;AAC/E,EAAA;AACF;AD1IoF;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-CKKNFFKP.cjs","sourcesContent":[null,"import type {\n BuyerPortalSubscriptionCapabilities,\n NativeShopConfigRequest,\n NativeShopConfigResponse,\n NativeDunningConfigRequest,\n NativeDunningConfigResponse,\n AdoptSubscriptionRequest,\n AdoptSubscriptionResponse,\n CreateSubscriptionRequest,\n CreateAndConfirmSubscriptionRequest,\n ConfirmSubscriptionRequest,\n UpdateSubscriptionRequest,\n PauseSubscriptionRequest,\n ResumeSubscriptionRequest,\n CancelSubscriptionRequest,\n SubscriptionResponse,\n ConfirmSubscriptionResponse,\n PauseSubscriptionResponse,\n ResumeSubscriptionResponse,\n CancelSubscriptionResponse,\n GetSubscriptionItemsResponse,\n GetSubscriptionItemsParams,\n SubscriptionEstimateResponse,\n SubscriptionEstimateParams,\n SubscriptionListParams,\n SubscriptionPaymentLookupRequest,\n SubscriptionPaymentLookupResponse,\n SubscriptionInvoiceListParams,\n SubscriptionInvoiceListResponse,\n SubscriptionBillingProcessorResponse,\n SubscriptionImportApplyRequest,\n SubscriptionImportApplyResponse,\n SubscriptionImportPreviewRequest,\n SubscriptionImportPreviewResponse,\n SubscriptionItemsPage,\n SubscriptionSyncRequest,\n SubscriptionSyncResponse,\n SubscriptionSyncResult,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Subscription endpoints are profile-scoped: the backend requires an\n * `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`\n * otherwise). Pass it through the per-call `options.headers`, e.g.\n * `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.\n */\nexport class Subscriptions {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */\n async getNativeConfig(options?: RequestExtras): Promise<NativeShopConfigResponse> {\n return this.request('GET', '/subscriptions/native/config', { ...options });\n }\n\n /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */\n async updateNativeConfig(\n params: NativeShopConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeShopConfigResponse> {\n return this.request('PUT', '/subscriptions/native/config', { body: params, ...options });\n }\n\n /** Read merchant-wide renewal recovery settings. */\n async getNativeDunning(options?: RequestExtras): Promise<NativeDunningConfigResponse> {\n return this.request('GET', '/subscriptions/native/dunning', { ...options });\n }\n\n async updateNativeDunning(\n params: NativeDunningConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeDunningConfigResponse> {\n return this.request('PUT', '/subscriptions/native/dunning', { body: params, ...options });\n }\n\n /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */\n async getCapabilities(\n subscriptionId: string,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionCapabilities> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,\n { ...options },\n );\n }\n\n /**\n * Create and immediately confirm a subscription. `POST /subscriptions`\n *\n * For billing processors that require buyer approval (e.g. PayPal), the\n * response carries a `redirect_url` the customer must be sent to.\n */\n async createAndConfirm(\n params: CreateAndConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', '/subscriptions', { body: params, ...options });\n }\n\n /** Create a subscription without confirming it. `POST /subscriptions/create` */\n async create(\n params: CreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('POST', '/subscriptions/create', { body: params, ...options });\n }\n\n /**\n * Adopt an existing Creem subscription. `POST /subscriptions/adopt`\n *\n * Requires adoption to be enabled on the deployment and `X-Profile-Id` in\n * options.headers. Adoption charges nothing and emits no invoice or webhook.\n * Repeating the processor subscription ID returns the existing DeloPay ID.\n * Retry when handoff_confirmed is false. That flag confirms persistence,\n * not the merchant's external switch-over: stop processing Creem events in\n * your own integration when handing subsequent events to DeloPay.\n */\n async adopt(\n params: AdoptSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<AdoptSubscriptionResponse> {\n return this.request('POST', '/subscriptions/adopt', { body: params, ...options });\n }\n\n /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */\n async retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}`, {\n ...options,\n });\n }\n\n /**\n * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`\n *\n * Like {@link createAndConfirm}, the response may carry a `redirect_url` for\n * processors that require buyer approval.\n */\n async confirm(\n subscriptionId: string,\n params: ConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async update(\n subscriptionId: string,\n params: UpdateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('PUT', `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List subscriptions for the profile, or one customer's with `customer_id`.\n * `GET /subscriptions/list`\n */\n async list(\n params?: SubscriptionListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse[]> {\n return this.request('GET', '/subscriptions/list', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */\n async getEstimate(\n params: SubscriptionEstimateParams,\n options?: RequestExtras,\n ): Promise<SubscriptionEstimateResponse> {\n return this.request('GET', '/subscriptions/estimate', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */\n async getItems(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/subscriptions/items', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * {@link getItems}, with whether the list is only the first part of what the\n * processor holds. `GET /subscriptions/items`\n *\n * The backend states that in the `X-Delopay-Items-Truncated` response\n * header (Stripe Billing lists its first 100 products), which the plain\n * {@link getItems} cannot return. Without `limit` and `offset` every item\n * the billing account offers is listed, up to 500.\n */\n async getItemsPage(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<SubscriptionItemsPage> {\n let truncated = false;\n const items = await this.request<GetSubscriptionItemsResponse[]>(\n 'GET',\n '/subscriptions/items',\n {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n onDownloadProgress: (event) => {\n // The headers arrive with the first event; a retried request reports\n // them again, and the last attempt is the one the items come from.\n truncated = event.headers.get('x-delopay-items-truncated')?.toLowerCase() === 'true';\n options?.onDownloadProgress?.(event);\n },\n },\n );\n return { items, truncated };\n }\n\n /**\n * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n *\n * The body defaults to `{}` so the request still carries\n * `Content-Type: application/json` even when no params are passed — the\n * backend rejects the POST otherwise (\"Unsupported content type\").\n */\n async pause(\n subscriptionId: string,\n params?: PauseSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<PauseSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async resume(\n subscriptionId: string,\n params?: ResumeSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ResumeSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel`\n *\n * A subscription in a state it cannot be cancelled from is refused with\n * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async cancel(\n subscriptionId: string,\n params?: CancelSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<CancelSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Read 1 to 50 subscriptions back from their billing processor and mirror\n * what it reports. `POST /subscriptions/sync`\n *\n * Nothing is written at the processor. A status is mirrored only with the\n * time the processor stamped it with, and never over a newer event already\n * recorded; a plan only with its own stamp. One result per id, in request\n * order; one that fails does not stop the others.\n */\n async sync(\n params: SubscriptionSyncRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionSyncResponse> {\n return this.request('POST', '/subscriptions/sync', { body: params, ...options });\n }\n\n /**\n * Read one subscription back from its billing processor and mirror what it\n * reports, as {@link sync} does, with what the processor reported beside\n * what the mirror now holds. `POST /subscriptions/{subscriptionId}/sync`\n */\n async syncOne(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionSyncResult> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/sync`, {\n ...options,\n });\n }\n\n /**\n * List the subscriptions a billing account holds at its processor, and how\n * each relates to DeloPay's: already held, new (its buyer is a DeloPay\n * customer), needing a customer, ended, or not adoptable here.\n * `POST /subscriptions/import/preview`\n *\n * Reads only; nothing is written here or at the processor. Creem and\n * Stripe Billing can be listed; PayPal cannot, which `capabilities` states\n * (`reason_code: 'listing_unsupported'`).\n */\n async importPreview(\n params: SubscriptionImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportPreviewResponse> {\n return this.request('POST', '/subscriptions/import/preview', { body: params, ...options });\n }\n\n /**\n * Take 1 to 25 processor subscriptions over, each through {@link adopt}\n * with every one of its checks, one after another.\n * `POST /subscriptions/import/apply`\n *\n * One result per selection, in request order; one refused does not stop\n * the others.\n */\n async importApply(\n params: SubscriptionImportApplyRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportApplyResponse> {\n return this.request('POST', '/subscriptions/import/apply', { body: params, ...options });\n }\n\n /**\n * Resolve which of the given payments were raised by a subscription.\n * `POST /subscriptions/payments/lookup`\n *\n * The linkage exists in one direction only — an invoice points at the payment\n * it settled, and nothing is stamped on the payment — so this is the only way\n * to tell a subscription charge from a one-off one when you are holding a\n * page of payments. In particular, do not use `off_session` or the presence\n * of a mandate: an ordinary saved-card charge sets those identically.\n *\n * Ids that belong to no subscription are **absent** from `links` rather than\n * returned as an error, so match on presence:\n *\n * ```ts\n * const { links } = await subscriptions.lookupPayments(\n * { payment_ids: page.map((p) => p.payment_id) },\n * { headers: { 'X-Profile-Id': profileId } },\n * );\n * const bySubscription = new Map(links.map((l) => [l.payment_id, l]));\n * ```\n *\n * Profile-scoped like every other subscription route, and that matters more\n * here than elsewhere: a `payment_id` is merchant-supplied and only unique\n * within a merchant, so the shop is part of the question, not an\n * optimisation. Pass the profile that owns **the payments** — for a list\n * spanning several shops, group the ids by shop and call once per group.\n *\n * At most 200 ids per call.\n */\n async lookupPayments(\n params: SubscriptionPaymentLookupRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionPaymentLookupResponse> {\n return this.request('POST', '/subscriptions/payments/lookup', { body: params, ...options });\n }\n\n /**\n * One subscription's billing history, newest cycle first.\n * `GET /subscriptions/{subscriptionId}/invoices`\n *\n * {@link retrieve} carries only the *latest* invoice, which is the current\n * cycle — a subscription that has renewed monthly for a year has one of those\n * and twelve of these. Use this wherever a merchant needs to see what a\n * subscription has actually billed, in particular on self-charging processors\n * (Creem, PayPal) where each renewal is charged by the processor and mirrored\n * here rather than raised as a DeloPay payment.\n *\n * Two things to render honestly, both decided rather than incidental:\n *\n * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net\n * them: the difference between the two is not a smaller charge.\n * - A `refunded_amount` of `null` is \"not reported\" and must not render as\n * `0`. Likewise a processor-hosted origination records a bootstrap invoice\n * at `0` before the buyer has paid anything, so a zero amount on such a\n * subscription is a placeholder rather than a free cycle.\n *\n * Profile-scoped like every other subscription route.\n */\n async listInvoices(\n subscriptionId: string,\n params?: SubscriptionInvoiceListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceListResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * Which billing processor this shop's subscriptions run on.\n * `GET /subscriptions/billing_processor`\n *\n * The same mapping is derivable from the connector inventory\n * (`GET /account/{merchant_id}/connectors`), but that route is gated by a\n * connector-read permission granted independently of subscriptions — so a\n * role authorised to create subscriptions could be unable to learn which\n * processor it was creating them on. This answers under the same\n * authorization as the rest of the subscription API.\n *\n * Reach for it when the client must branch on the processor *before* calling\n * — origination differs by processor, and guessing is destructive. Resolve\n * the shop's `billing_processor_id` first: a shop that runs no subscriptions\n * has none assigned, and this route has no identity to report for it.\n */\n async getBillingProcessor(\n options?: RequestExtras,\n ): Promise<SubscriptionBillingProcessorResponse> {\n return this.request('GET', '/subscriptions/billing_processor', { ...options });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/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/jonathan/Desktop/DeloPay/dev1/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":["/home/anes/delo-payment/sdk-publish-w2/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/sdk-publish-w2/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"]}