@delopay/sdk 0.490.0 → 0.492.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/airwallexCard.cjs.map +1 -1
  2. package/dist/branding.cjs.map +1 -1
  3. package/dist/cardFormStyles.cjs.map +1 -1
  4. package/dist/checkoutSession.cjs.map +1 -1
  5. package/dist/chunk-244VZFFO.cjs.map +1 -1
  6. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  7. package/dist/chunk-34PC72O7.cjs.map +1 -1
  8. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  9. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  10. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  11. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  12. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  13. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  14. package/dist/chunk-4T7BJFY2.cjs.map +1 -1
  15. package/dist/chunk-5CITBN33.cjs.map +1 -1
  16. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  17. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  18. package/dist/chunk-5QS67SBO.cjs.map +1 -1
  19. package/dist/chunk-6BFZS4YP.cjs.map +1 -1
  20. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  21. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  22. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  23. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  24. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  25. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  26. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  27. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  28. package/dist/chunk-7NKJD5ST.cjs.map +1 -1
  29. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  30. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  31. package/dist/chunk-ABWAYMN5.cjs.map +1 -1
  32. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  33. package/dist/chunk-ANQRR2BG.cjs.map +1 -1
  34. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  35. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  36. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  37. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  38. package/dist/chunk-BT3UAUEV.cjs.map +1 -1
  39. package/dist/chunk-CAMALM35.cjs.map +1 -1
  40. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  41. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  42. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  43. package/dist/chunk-DQHT4FGI.cjs.map +1 -1
  44. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  45. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  46. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  47. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  48. package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
  49. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  50. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  51. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  52. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  53. package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
  54. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  55. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  56. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  57. package/dist/{chunk-R3WHKS5S.cjs → chunk-GLQ7EJAH.cjs} +2 -2
  58. package/dist/chunk-GLQ7EJAH.cjs.map +1 -0
  59. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  60. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  61. package/dist/chunk-GWSVQXEY.cjs.map +1 -1
  62. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  63. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  64. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  65. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  66. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  67. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  68. package/dist/{chunk-7AELDJXA.js → chunk-IM6A64ON.js} +2 -2
  69. package/dist/chunk-IM6A64ON.js.map +1 -0
  70. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  71. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  72. package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
  73. package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
  74. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  75. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  76. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  77. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  78. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  79. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  80. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  81. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  82. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  83. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  84. package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
  85. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  86. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  87. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  88. package/dist/chunk-OAEKP665.cjs.map +1 -1
  89. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  90. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  91. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  92. package/dist/chunk-P4UILJVU.cjs.map +1 -1
  93. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  94. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  95. package/dist/chunk-PYNHK6AP.cjs.map +1 -1
  96. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  97. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  98. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  99. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  100. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  101. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  102. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  103. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  104. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  105. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  106. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  107. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  108. package/dist/chunk-U3JK7NBG.cjs.map +1 -1
  109. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  110. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  111. package/dist/chunk-UTCXNBID.cjs.map +1 -1
  112. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  113. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  114. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  115. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  116. package/dist/chunk-W457XUA6.cjs.map +1 -1
  117. package/dist/chunk-W7NMENTT.cjs.map +1 -1
  118. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  119. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  120. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  121. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  122. package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
  123. package/dist/chunk-YFRAI34Y.cjs.map +1 -1
  124. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  125. package/dist/chunk-YW4DVKNT.cjs.map +1 -1
  126. package/dist/chunk-YWN76H2W.cjs.map +1 -1
  127. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  128. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  129. package/dist/client.cjs.map +1 -1
  130. package/dist/core.cjs.map +1 -1
  131. package/dist/currencies.cjs.map +1 -1
  132. package/dist/enigmaCardForm.cjs.map +1 -1
  133. package/dist/error.cjs.map +1 -1
  134. package/dist/eventStream.cjs.map +1 -1
  135. package/dist/exportDownload.cjs.map +1 -1
  136. package/dist/feeProgram.cjs.map +1 -1
  137. package/dist/index.cjs.map +1 -1
  138. package/dist/index.d.cts +1 -1
  139. package/dist/index.d.ts +1 -1
  140. package/dist/internal/resources/admin.cjs.map +1 -1
  141. package/dist/internal/resources/admin.d.cts +1 -1
  142. package/dist/internal/resources/admin.d.ts +1 -1
  143. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  144. package/dist/internal/resources/adminBranding.d.cts +1 -1
  145. package/dist/internal/resources/adminBranding.d.ts +1 -1
  146. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  147. package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
  148. package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
  149. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  150. package/dist/internal/resources/adminFeePlans.d.cts +1 -1
  151. package/dist/internal/resources/adminFeePlans.d.ts +1 -1
  152. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  153. package/dist/internal/resources/adminFileScans.d.cts +1 -1
  154. package/dist/internal/resources/adminFileScans.d.ts +1 -1
  155. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  156. package/dist/internal/resources/adminIndustries.d.cts +1 -1
  157. package/dist/internal/resources/adminIndustries.d.ts +1 -1
  158. package/dist/internal/resources/adminLive.cjs.map +1 -1
  159. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  160. package/dist/internal/resources/adminNotices.d.cts +1 -1
  161. package/dist/internal/resources/adminNotices.d.ts +1 -1
  162. package/dist/internal/resources/adminPortal.cjs +2 -2
  163. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  164. package/dist/internal/resources/adminPortal.d.cts +1 -1
  165. package/dist/internal/resources/adminPortal.d.ts +1 -1
  166. package/dist/internal/resources/adminPortal.js +1 -1
  167. package/dist/internal/resources/adminPricing.cjs.map +1 -1
  168. package/dist/internal/resources/adminPricing.d.cts +1 -1
  169. package/dist/internal/resources/adminPricing.d.ts +1 -1
  170. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  171. package/dist/internal/resources/adminSupport.d.cts +1 -1
  172. package/dist/internal/resources/adminSupport.d.ts +1 -1
  173. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  174. package/dist/internal/resources/auditLogs.d.cts +1 -1
  175. package/dist/internal/resources/auditLogs.d.ts +1 -1
  176. package/dist/internal/resources/cache.cjs.map +1 -1
  177. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  178. package/dist/internal/resources/cardIssuers.d.cts +1 -1
  179. package/dist/internal/resources/cardIssuers.d.ts +1 -1
  180. package/dist/internal/resources/configs.cjs.map +1 -1
  181. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  182. package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
  183. package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
  184. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  185. package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
  186. package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
  187. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  188. package/dist/internal/resources/diagnostic.d.cts +1 -1
  189. package/dist/internal/resources/diagnostic.d.ts +1 -1
  190. package/dist/internal/resources/gsm.cjs.map +1 -1
  191. package/dist/internal/resources/gsm.d.cts +1 -1
  192. package/dist/internal/resources/gsm.d.ts +1 -1
  193. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  194. package/dist/internal/resources/nativeRenewals.d.cts +1 -1
  195. package/dist/internal/resources/nativeRenewals.d.ts +1 -1
  196. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  197. package/dist/internal/resources/platformBilling.d.cts +1 -1
  198. package/dist/internal/resources/platformBilling.d.ts +1 -1
  199. package/dist/internal/resources/platformFees.cjs.map +1 -1
  200. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  201. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  202. package/dist/internal/resources/platformSettings.d.cts +1 -1
  203. package/dist/internal/resources/platformSettings.d.ts +1 -1
  204. package/dist/internal.cjs +3 -3
  205. package/dist/internal.cjs.map +1 -1
  206. package/dist/internal.d.cts +2 -2
  207. package/dist/internal.d.ts +2 -2
  208. package/dist/internal.js +1 -1
  209. package/dist/listQuery.cjs.map +1 -1
  210. package/dist/panes.cjs.map +1 -1
  211. package/dist/paymentPresentation.cjs.map +1 -1
  212. package/dist/recordCounter.cjs.map +1 -1
  213. package/dist/resources/aiTools.cjs.map +1 -1
  214. package/dist/resources/analytics.cjs.map +1 -1
  215. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  216. package/dist/resources/apiKeys.cjs.map +1 -1
  217. package/dist/resources/audit.cjs.map +1 -1
  218. package/dist/resources/authentication.cjs.map +1 -1
  219. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  220. package/dist/resources/billing.cjs.map +1 -1
  221. package/dist/resources/buyerAccount.cjs.map +1 -1
  222. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  223. package/dist/resources/buyerConversations.cjs.map +1 -1
  224. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  225. package/dist/resources/buyerPortal.cjs.map +1 -1
  226. package/dist/resources/cards.cjs.map +1 -1
  227. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  228. package/dist/resources/checkoutDomains.cjs.map +1 -1
  229. package/dist/resources/checkoutMethods.cjs.map +1 -1
  230. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  231. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  232. package/dist/resources/connectors.cjs.map +1 -1
  233. package/dist/resources/contentEncryption.cjs.map +1 -1
  234. package/dist/resources/costRules.cjs.map +1 -1
  235. package/dist/resources/customers.cjs.map +1 -1
  236. package/dist/resources/deploymentBranding.cjs.map +1 -1
  237. package/dist/resources/disputes.cjs.map +1 -1
  238. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  239. package/dist/resources/events.cjs.map +1 -1
  240. package/dist/resources/export.cjs.map +1 -1
  241. package/dist/resources/externalRecords.cjs.map +1 -1
  242. package/dist/resources/featureMatrix.cjs.map +1 -1
  243. package/dist/resources/fees.cjs.map +1 -1
  244. package/dist/resources/files.cjs.map +1 -1
  245. package/dist/resources/forex.cjs.map +1 -1
  246. package/dist/resources/identityVerifications.cjs.map +1 -1
  247. package/dist/resources/industries.cjs.map +1 -1
  248. package/dist/resources/invoiceSettings.cjs.map +1 -1
  249. package/dist/resources/invoices.cjs.map +1 -1
  250. package/dist/resources/live.cjs.map +1 -1
  251. package/dist/resources/mandates.cjs.map +1 -1
  252. package/dist/resources/merchantAccounts.cjs.map +1 -1
  253. package/dist/resources/messageTemplates.cjs.map +1 -1
  254. package/dist/resources/notices.cjs.map +1 -1
  255. package/dist/resources/operationLimits.cjs.map +1 -1
  256. package/dist/resources/paymentLinks.cjs.map +1 -1
  257. package/dist/resources/paymentMethods.cjs.map +1 -1
  258. package/dist/resources/payments.cjs.map +1 -1
  259. package/dist/resources/payoutDestinations.cjs.map +1 -1
  260. package/dist/resources/payouts.cjs.map +1 -1
  261. package/dist/resources/paypalDisputes.cjs.map +1 -1
  262. package/dist/resources/persons.cjs.map +1 -1
  263. package/dist/resources/poll.cjs.map +1 -1
  264. package/dist/resources/processorCosts.cjs.map +1 -1
  265. package/dist/resources/processorImports.cjs.map +1 -1
  266. package/dist/resources/products.cjs.map +1 -1
  267. package/dist/resources/profileAcquirers.cjs.map +1 -1
  268. package/dist/resources/profiles.cjs.map +1 -1
  269. package/dist/resources/projects.cjs.map +1 -1
  270. package/dist/resources/refunds.cjs.map +1 -1
  271. package/dist/resources/regions.cjs.map +1 -1
  272. package/dist/resources/relay.cjs.map +1 -1
  273. package/dist/resources/risk.cjs.map +1 -1
  274. package/dist/resources/routing.cjs.map +1 -1
  275. package/dist/resources/search.cjs.map +1 -1
  276. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  277. package/dist/resources/settings.cjs.map +1 -1
  278. package/dist/resources/settlement.cjs.map +1 -1
  279. package/dist/resources/shareLinks.cjs.map +1 -1
  280. package/dist/resources/shopLabels.cjs.map +1 -1
  281. package/dist/resources/shopify.cjs.map +1 -1
  282. package/dist/resources/shops.cjs.map +1 -1
  283. package/dist/resources/stripeConnect.cjs.map +1 -1
  284. package/dist/resources/subscriptions.cjs.map +1 -1
  285. package/dist/resources/support.cjs.map +1 -1
  286. package/dist/resources/threeDsRules.cjs.map +1 -1
  287. package/dist/resources/users.cjs.map +1 -1
  288. package/dist/resources/vatRates.cjs.map +1 -1
  289. package/dist/resources/verification.cjs.map +1 -1
  290. package/dist/resources/webhooks.cjs.map +1 -1
  291. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  292. package/dist/trustedOrigins.cjs.map +1 -1
  293. package/dist/{types-D9ygoAbt.d.ts → types-C6zTmzk0.d.ts} +7 -0
  294. package/dist/{types-4T8JSWuZ.d.cts → types-CPwF4xMA.d.cts} +7 -0
  295. package/dist/types.cjs.map +1 -1
  296. package/dist/types.d.cts +79 -8
  297. package/dist/types.d.ts +79 -8
  298. package/package.json +1 -1
  299. package/dist/chunk-7AELDJXA.js.map +0 -1
  300. package/dist/chunk-R3WHKS5S.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA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A;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0492/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA,EAIA,MAAM,WAAA,CACJ,IAAA,EACA,SAAA,EACA,OAAA,EACqC;AACrC,IAAA,MAAM,KAAA,EAAO,IAAI,QAAA,CAAS,CAAA;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,IAAI,CAAA;AACxB,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB;AAAA,MAC9C,IAAA,EAAM,IAAA;AAAA,MACN,GAAG,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,OAAO;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,MAAA,EACA,SAAA,EACA,OAAA,EAC0B;AAC1B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,WAAA,EAAa;AAAA,MACvC,IAAA,EAAM,MAAA;AAAA,MACN,GAAG,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,OAAO;AAAA,IACn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AClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0492/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-YW4DVKNT.cjs","../src/resources/customers.ts"],"names":[],"mappings":"AAAA;ACiCA,SAAS,OAAA,CACP,MAAA,EACmE;AACnE,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,EAAE,WAAA,EAAa,QAAA,EAAU,GAAG,KAAK,EAAA,EAAI,MAAA;AAC3C,EAAA,MAAM,MAAA,EAAQ,IAAA;AAGd,EAAA,GAAA,CAAI,YAAA,GAAe,WAAA,CAAY,OAAA,EAAS,CAAA,EAAG;AACzC,IAAA,KAAA,CAAM,YAAA,EAAc,WAAA,CAAY,IAAA,CAAK,GAAG,CAAA;AAAA,EAC1C;AACA,EAAA,GAAA,CAAI,SAAA,GAAY,QAAA,CAAS,OAAA,EAAS,CAAA,EAAG;AACnC,IAAA,KAAA,CAAM,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,EACpC;AACA,EAAA,OAAO,KAAA;AACT;AAGO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAAp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YgF,EAAA;AACZ,IAAA;AACpE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB6B,EAAA;AACyD,IAAA;AAC5E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG2E,EAAA;AACS,IAAA;AACpF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASoF,EAAA;AACQ,IAAA;AAC5F,EAAA;AACF;ADtG+F;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-YW4DVKNT.cjs","sourcesContent":[null,"import type {\n BuyerInvoiceLink,\n BuyerInvoiceLinkRequest,\n BuyerPortalLinkPage,\n BuyerPortalPageQuery,\n CustomerCreateRequest,\n CustomerIdentityHistoryRequest,\n CustomerIdentityHistoryResponse,\n CustomerIdentityHistorySearchRequest,\n CustomerIdentityImportPreviewRequest,\n CustomerIdentityImportPreviewResponse,\n CustomerIdentityImportRequest,\n CustomerIdentityImportResponse,\n CustomerResponse,\n CustomerShopBulkPlacementRequest,\n CustomerShopBulkPlacementResponse,\n CustomerShopPlacementResponse,\n CustomerUpdateRequest,\n CustomerListParams,\n CustomerListResponse,\n CustomerListWithCountParams,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Flatten list params for the query string.\n *\n * `profile_ids` must go out as ONE comma-separated value. The client\n * serializes arrays as repeated keys (`?profile_ids=a&profile_ids=b`), and the\n * customers endpoints cannot parse that — the whole request fails, rather than\n * the second id being ignored. So the join happens here, once, instead of at\n * four call sites.\n */\nfunction toQuery(\n params?: CustomerListParams,\n): Record<string, string | number | boolean | undefined> | undefined {\n if (!params) return undefined;\n const { profile_ids, industry, ...rest } = params;\n const query = rest as Record<string, string | number | boolean | undefined>;\n // An empty array means \"no shop filter\", which is the absent key — sending\n // `profile_ids=` would work too, but omitting it keeps the URL honest.\n if (profile_ids && profile_ids.length > 0) {\n query.profile_ids = profile_ids.join(',');\n }\n if (industry && industry.length > 0) {\n query.industry = industry.join(',');\n }\n return query;\n}\n\n/** Create and manage customer profiles. */\nexport class Customers {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Check identity import rows (email addresses, names, handles) and say what an import would do\n * with each. Writes nothing. Merchant-wide callers only.\n */\n async previewIdentityImport(\n params: CustomerIdentityImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportPreviewResponse> {\n return this.request('POST', '/customers/identity-history/import/preview', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Record identity import rows in the customers' identity history, apart from their current\n * details. Idempotent per `idempotency_key`; the same key with different rows is refused (400, `IR_38`).\n * A transient failure is retried with the unchanged key when client retries are enabled.\n */\n async importIdentityHistory(\n params: CustomerIdentityImportRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('POST', '/customers/identity-history/import', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /** Read an identity import back: its rows and the history entries they map to. */\n async retrieveIdentityImport(\n runId: string,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('GET', `/customers/identity-history/import/${encodeURIComponent(runId)}`, {\n ...options,\n });\n }\n\n /** The identity history of up to 1,000 customers. */\n async listIdentityHistory(\n params: CustomerIdentityHistoryRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/list', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Search the merchant's identity history for email addresses, names and handles containing a\n * text of at least three characters. The text travels in the body, never in the URL.\n */\n async searchIdentityHistory(\n params: CustomerIdentityHistorySearchRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/search', {\n body: params,\n ...options,\n });\n }\n\n /** Issue a shop-scoped buyer portal link for this customer. */\n async createPortalLink(\n customerId: string,\n params: BuyerInvoiceLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerInvoiceLink> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n body: params,\n ...options,\n });\n }\n\n /** List issued grants without disclosing their secret URLs. */\n async listPortalLinks(\n customerId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalLinkPage> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async revokePortalLink(\n customerId: string,\n linkId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,\n { ...options },\n );\n }\n\n /**\n * Create a new customer.\n *\n * @param params - Customer creation parameters (name, email, phone, address, etc.).\n * @returns The created customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.create({\n * email: 'alice@example.com',\n * name: 'Alice Smith',\n * });\n * ```\n */\n async create(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers', { body: params });\n }\n\n /**\n * Retrieve a customer by their ID.\n *\n * @param customerId - The unique customer ID.\n * @returns The customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.retrieve('cus_abc123');\n * ```\n */\n async retrieve(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Place an existing customer in a shop of the merchant, so the shop's API keys and team members\n * find the customer before any payment. The customer keeps the shops they already belong to;\n * placing one already in the shop changes nothing (`already_in_shop`). Needs a merchant-wide key:\n * a key bound to one shop is refused. An unknown customer answers `CustomerNotFound` (404).\n * `POST /customers/{customer_id}/shops`\n *\n * @param customerId - The customer to place.\n * @param profileId - The shop. It must belong to the merchant.\n */\n async placeInShop(\n customerId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<CustomerShopPlacementResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/shops`, {\n body: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Place up to 500 existing customers in one shop of the merchant, for example after an import.\n * The answer lists every distinct customer in request order with what happened: `placed`,\n * `already_in_shop` or `not_found`. Needs a merchant-wide key. `POST /customers/shops/place`\n */\n async placeManyInShop(\n params: CustomerShopBulkPlacementRequest,\n options?: RequestExtras,\n ): Promise<CustomerShopBulkPlacementResponse> {\n return this.request('POST', '/customers/shops/place', { body: params, ...options });\n }\n\n /**\n * Update an existing customer's details.\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update (name, email, address, metadata, etc.).\n * @returns The updated customer.\n */\n async update(\n customerId: string,\n params: CustomerUpdateRequest,\n options?: RequestExtras,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a customer and all their saved payment methods.\n *\n * @param customerId - The customer ID to delete.\n * @returns The deleted customer object.\n */\n async delete(customerId: string): Promise<CustomerResponse> {\n return this.request('DELETE', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * List customers, optionally filtered by customer id/name/email prefix,\n * shop (`profile_id`), or project (`project_id`).\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n *\n * @example\n * ```typescript\n * // Customers who have transacted in a specific shop.\n * const customers = await delopay.customers.list({ profile_id: 'pro_abc123' });\n *\n * // Several shops at once (unions with profile_id / project_id).\n * const many = await delopay.customers.list({\n * profile_ids: ['pro_abc123', 'pro_def456'],\n * });\n * ```\n */\n async list(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/list', {\n query: toQuery(params),\n });\n }\n\n // --- OLAP extensions (Task 4.6) ---\n\n /**\n * List customers with count. Supports the same `profile_id` / `project_id`\n * shop filters as {@link list}. `GET /customers/list-with-count`\n */\n async listWithCount(params?: CustomerListWithCountParams): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * List customers scoped to the authenticated dashboard user's shop\n * (business profile). The JWT auto-scopes to its own `profile`; an explicit\n * `profile_id` / `project_id` outside that scope is rejected with\n * `AccessForbidden`. `GET /customers/profile/list`\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n */\n async listByProfile(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/profile/list', {\n query: toQuery(params),\n });\n }\n\n /**\n * Profile-scoped variant of {@link listWithCount}.\n * `GET /customers/profile/list-with-count`\n */\n async listByProfileWithCount(\n params?: CustomerListWithCountParams,\n ): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/profile/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * Retrieve one customer, scoped to the authenticated dashboard user's shop\n * (business profile). The shop-scoped counterpart of {@link retrieve}, and\n * what makes a shop's own customer list clickable: the list is\n * `ProfileCustomerRead` while {@link retrieve} is merchant-level, so a shop\n * member could see a customer they could not open.\n *\n * A customer belonging to a sibling shop answers `CustomerNotFound` — the\n * same answer as a customer that does not exist, deliberately, so one shop\n * cannot enumerate another's customer ids.\n *\n * `GET /customers/profile/{customerId}`\n *\n * @param customerId - The unique customer ID.\n * @returns The customer, with `profile_ids` narrowed to the caller's own shop.\n */\n async retrieveByProfile(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Create a customer from a shop, recording that it belongs to that shop so\n * the shop can see the customer it just created. The shop is taken from the\n * credential; a caller-chosen `customer_id` is rejected.\n *\n * `POST /customers/profile`\n *\n * @param params - The customer to create.\n * @returns The created customer.\n */\n async createByProfile(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers/profile', { body: params });\n }\n\n /**\n * Update a customer from a shop, if the customer belongs to that shop.\n * A sibling shop's customer answers `CustomerNotFound`, as with\n * {@link retrieveByProfile}.\n *\n * `POST /customers/profile/{customerId}`\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update.\n * @returns The updated customer.\n */\n async updateByProfile(\n customerId: string,\n params: CustomerUpdateRequest,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/profile/${encodeURIComponent(customerId)}`, {\n body: params,\n });\n }\n\n /** List mandates for a customer. `GET /customers/{customerId}/mandates` */\n async listMandates(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/mandates`);\n }\n\n /**\n * List one customer's mandates, scoped to the caller's shop. Same membership\n * rule as {@link retrieveByProfile}: a sibling shop's customer answers\n * `CustomerNotFound` before any mandate is read.\n *\n * `GET /customers/profile/{customerId}/mandates`\n */\n async listMandatesByProfile(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}/mandates`);\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w2-sdk-publish-0492/dist/chunk-YW4DVKNT.cjs","../src/resources/customers.ts"],"names":[],"mappings":"AAAA;ACiCA,SAAS,OAAA,CACP,MAAA,EACmE;AACnE,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,EAAE,WAAA,EAAa,QAAA,EAAU,GAAG,KAAK,EAAA,EAAI,MAAA;AAC3C,EAAA,MAAM,MAAA,EAAQ,IAAA;AAGd,EAAA,GAAA,CAAI,YAAA,GAAe,WAAA,CAAY,OAAA,EAAS,CAAA,EAAG;AACzC,IAAA,KAAA,CAAM,YAAA,EAAc,WAAA,CAAY,IAAA,CAAK,GAAG,CAAA;AAAA,EAC1C;AACA,EAAA,GAAA,CAAI,SAAA,GAAY,QAAA,CAAS,OAAA,EAAS,CAAA,EAAG;AACnC,IAAA,KAAA,CAAM,SAAA,EAAW,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA;AAAA,EACpC;AACA,EAAA,OAAO,KAAA;AACT;AAGO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,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A;AACpE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB6B,EAAA;AACyD,IAAA;AAC5E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG2E,EAAA;AACS,IAAA;AACpF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASoF,EAAA;AACQ,IAAA;AAC5F,EAAA;AACF;ADtG+F;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0492/dist/chunk-YW4DVKNT.cjs","sourcesContent":[null,"import type {\n BuyerInvoiceLink,\n BuyerInvoiceLinkRequest,\n BuyerPortalLinkPage,\n BuyerPortalPageQuery,\n CustomerCreateRequest,\n CustomerIdentityHistoryRequest,\n CustomerIdentityHistoryResponse,\n CustomerIdentityHistorySearchRequest,\n CustomerIdentityImportPreviewRequest,\n CustomerIdentityImportPreviewResponse,\n CustomerIdentityImportRequest,\n CustomerIdentityImportResponse,\n CustomerResponse,\n CustomerShopBulkPlacementRequest,\n CustomerShopBulkPlacementResponse,\n CustomerShopPlacementResponse,\n CustomerUpdateRequest,\n CustomerListParams,\n CustomerListResponse,\n CustomerListWithCountParams,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Flatten list params for the query string.\n *\n * `profile_ids` must go out as ONE comma-separated value. The client\n * serializes arrays as repeated keys (`?profile_ids=a&profile_ids=b`), and the\n * customers endpoints cannot parse that — the whole request fails, rather than\n * the second id being ignored. So the join happens here, once, instead of at\n * four call sites.\n */\nfunction toQuery(\n params?: CustomerListParams,\n): Record<string, string | number | boolean | undefined> | undefined {\n if (!params) return undefined;\n const { profile_ids, industry, ...rest } = params;\n const query = rest as Record<string, string | number | boolean | undefined>;\n // An empty array means \"no shop filter\", which is the absent key — sending\n // `profile_ids=` would work too, but omitting it keeps the URL honest.\n if (profile_ids && profile_ids.length > 0) {\n query.profile_ids = profile_ids.join(',');\n }\n if (industry && industry.length > 0) {\n query.industry = industry.join(',');\n }\n return query;\n}\n\n/** Create and manage customer profiles. */\nexport class Customers {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Check identity import rows (email addresses, names, handles) and say what an import would do\n * with each. Writes nothing. Merchant-wide callers only.\n */\n async previewIdentityImport(\n params: CustomerIdentityImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportPreviewResponse> {\n return this.request('POST', '/customers/identity-history/import/preview', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Record identity import rows in the customers' identity history, apart from their current\n * details. Idempotent per `idempotency_key`; the same key with different rows is refused (400, `IR_38`).\n * A transient failure is retried with the unchanged key when client retries are enabled.\n */\n async importIdentityHistory(\n params: CustomerIdentityImportRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('POST', '/customers/identity-history/import', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /** Read an identity import back: its rows and the history entries they map to. */\n async retrieveIdentityImport(\n runId: string,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('GET', `/customers/identity-history/import/${encodeURIComponent(runId)}`, {\n ...options,\n });\n }\n\n /** The identity history of up to 1,000 customers. */\n async listIdentityHistory(\n params: CustomerIdentityHistoryRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/list', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Search the merchant's identity history for email addresses, names and handles containing a\n * text of at least three characters. The text travels in the body, never in the URL.\n */\n async searchIdentityHistory(\n params: CustomerIdentityHistorySearchRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/search', {\n body: params,\n ...options,\n });\n }\n\n /** Issue a shop-scoped buyer portal link for this customer. */\n async createPortalLink(\n customerId: string,\n params: BuyerInvoiceLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerInvoiceLink> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n body: params,\n ...options,\n });\n }\n\n /** List issued grants without disclosing their secret URLs. */\n async listPortalLinks(\n customerId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalLinkPage> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async revokePortalLink(\n customerId: string,\n linkId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,\n { ...options },\n );\n }\n\n /**\n * Create a new customer.\n *\n * @param params - Customer creation parameters (name, email, phone, address, etc.).\n * @returns The created customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.create({\n * email: 'alice@example.com',\n * name: 'Alice Smith',\n * });\n * ```\n */\n async create(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers', { body: params });\n }\n\n /**\n * Retrieve a customer by their ID.\n *\n * @param customerId - The unique customer ID.\n * @returns The customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.retrieve('cus_abc123');\n * ```\n */\n async retrieve(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Place an existing customer in a shop of the merchant, so the shop's API keys and team members\n * find the customer before any payment. The customer keeps the shops they already belong to;\n * placing one already in the shop changes nothing (`already_in_shop`). Needs a merchant-wide key:\n * a key bound to one shop is refused. An unknown customer answers `CustomerNotFound` (404).\n * `POST /customers/{customer_id}/shops`\n *\n * @param customerId - The customer to place.\n * @param profileId - The shop. It must belong to the merchant.\n */\n async placeInShop(\n customerId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<CustomerShopPlacementResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/shops`, {\n body: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Place up to 500 existing customers in one shop of the merchant, for example after an import.\n * The answer lists every distinct customer in request order with what happened: `placed`,\n * `already_in_shop` or `not_found`. Needs a merchant-wide key. `POST /customers/shops/place`\n */\n async placeManyInShop(\n params: CustomerShopBulkPlacementRequest,\n options?: RequestExtras,\n ): Promise<CustomerShopBulkPlacementResponse> {\n return this.request('POST', '/customers/shops/place', { body: params, ...options });\n }\n\n /**\n * Update an existing customer's details.\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update (name, email, address, metadata, etc.).\n * @returns The updated customer.\n */\n async update(\n customerId: string,\n params: CustomerUpdateRequest,\n options?: RequestExtras,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a customer and all their saved payment methods.\n *\n * @param customerId - The customer ID to delete.\n * @returns The deleted customer object.\n */\n async delete(customerId: string): Promise<CustomerResponse> {\n return this.request('DELETE', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * List customers, optionally filtered by customer id/name/email prefix,\n * shop (`profile_id`), or project (`project_id`).\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n *\n * @example\n * ```typescript\n * // Customers who have transacted in a specific shop.\n * const customers = await delopay.customers.list({ profile_id: 'pro_abc123' });\n *\n * // Several shops at once (unions with profile_id / project_id).\n * const many = await delopay.customers.list({\n * profile_ids: ['pro_abc123', 'pro_def456'],\n * });\n * ```\n */\n async list(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/list', {\n query: toQuery(params),\n });\n }\n\n // --- OLAP extensions (Task 4.6) ---\n\n /**\n * List customers with count. Supports the same `profile_id` / `project_id`\n * shop filters as {@link list}. `GET /customers/list-with-count`\n */\n async listWithCount(params?: CustomerListWithCountParams): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * List customers scoped to the authenticated dashboard user's shop\n * (business profile). The JWT auto-scopes to its own `profile`; an explicit\n * `profile_id` / `project_id` outside that scope is rejected with\n * `AccessForbidden`. `GET /customers/profile/list`\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n */\n async listByProfile(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/profile/list', {\n query: toQuery(params),\n });\n }\n\n /**\n * Profile-scoped variant of {@link listWithCount}.\n * `GET /customers/profile/list-with-count`\n */\n async listByProfileWithCount(\n params?: CustomerListWithCountParams,\n ): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/profile/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * Retrieve one customer, scoped to the authenticated dashboard user's shop\n * (business profile). The shop-scoped counterpart of {@link retrieve}, and\n * what makes a shop's own customer list clickable: the list is\n * `ProfileCustomerRead` while {@link retrieve} is merchant-level, so a shop\n * member could see a customer they could not open.\n *\n * A customer belonging to a sibling shop answers `CustomerNotFound` — the\n * same answer as a customer that does not exist, deliberately, so one shop\n * cannot enumerate another's customer ids.\n *\n * `GET /customers/profile/{customerId}`\n *\n * @param customerId - The unique customer ID.\n * @returns The customer, with `profile_ids` narrowed to the caller's own shop.\n */\n async retrieveByProfile(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Create a customer from a shop, recording that it belongs to that shop so\n * the shop can see the customer it just created. The shop is taken from the\n * credential; a caller-chosen `customer_id` is rejected.\n *\n * `POST /customers/profile`\n *\n * @param params - The customer to create.\n * @returns The created customer.\n */\n async createByProfile(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers/profile', { body: params });\n }\n\n /**\n * Update a customer from a shop, if the customer belongs to that shop.\n * A sibling shop's customer answers `CustomerNotFound`, as with\n * {@link retrieveByProfile}.\n *\n * `POST /customers/profile/{customerId}`\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update.\n * @returns The updated customer.\n */\n async updateByProfile(\n customerId: string,\n params: CustomerUpdateRequest,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/profile/${encodeURIComponent(customerId)}`, {\n body: params,\n });\n }\n\n /** List mandates for a customer. `GET /customers/{customerId}/mandates` */\n async listMandates(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/mandates`);\n }\n\n /**\n * List one customer's mandates, scoped to the caller's shop. Same membership\n * rule as {@link retrieveByProfile}: a sibling shop's customer answers\n * `CustomerNotFound` before any mandate is read.\n *\n * `GET /customers/profile/{customerId}/mandates`\n */\n async listMandatesByProfile(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}/mandates`);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-YWN76H2W.cjs","../src/resources/analytics.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACsBO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalD,MAAM,KAAA,CAAM,MAAA,EAAiE;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,kBAAA,EAAoB;AAAA,MAC7C,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,UAAU,CAAC;AAAA,IACtC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,OAAA,CAAQ,MAAA,EAAiE;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,oBAAA,EAAsB;AAAA,MAC/C,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC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AAA;AACX,IAAA;AAC3E,EAAA;AAAA;AAKoC,EAAA;AACqC,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcoC,EAAA;AACmC,IAAA;AACvE,EAAA;AAAA;AAKoC,EAAA;AACqC,IAAA;AACzE,EAAA;AACF;AD3D+E;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-YWN76H2W.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\nimport type {\n AnalyticsScopeRequest,\n AnalyticsScopeResponse,\n AnalyticsShopsRequest,\n AnalyticsShopsResponse,\n AnalyticsConnectorsRequest,\n AnalyticsConnectorsResponse,\n ClientAnalyticsRequest,\n IndustryAnalytics,\n IndustryAnalyticsRequest,\n DevicesAnalyticsResponse,\n GeoAnalyticsResponse,\n DeviceDrillRequest,\n GeoDrillRequest,\n DrillResponse,\n SubscriptionAnalyticsRequest,\n SubscriptionAnalyticsResponse,\n SubscriptionDrillRequest,\n ScopeDrillRequest,\n AnalyticsExclusionRequest,\n AnalyticsExclusionResponse,\n AnalyticsExclusionsResponse,\n} from '../types';\n\nexport class Analytics {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Scoped, drill-level analytics dashboard for the authenticated merchant\n * (the same engine as the admin portal, pinned server-side to your own\n * merchant). The server ignores `merchant_id` — it always scopes to your\n * merchant, and to your single shop for profile-scoped users — so pass only\n * `project_id` / `shop_id` to drill and the window / `sections` fields.\n * Returns one drill level: the scope's daily series + previous window,\n * processor mix and direct children. Accepts a dashboard session or an API\n * key, including a `statistics_read` key; a shop-bound key reads only its\n * shop. `GET /analytics/scope`\n */\n async scope(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/analytics/scope', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Period Reports: the scoped daily series, pinned exactly like `scope`, but\n * gated on the Period Reports permission area instead of Payment\n * Performance. Pass `timezone` and each day bucket is a local calendar day,\n * which sums exactly into calendar weeks and months. Answers only the\n * `series`, `previous` and `children` blocks and ignores country and device\n * filters. Accepts a dashboard session or an API key, including a\n * `statistics_read` key. `GET /analytics/reports`\n */\n async reports(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/analytics/reports', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Shop comparison: one series per shop over one window, with whole-window\n * and previous-window totals, so shops can be drawn side by side. Pinned\n * server-side to your own merchant (`merchant_id` is ignored), and to your\n * single shop for a shop-scoped user; `project_id` / `shop_id` narrow it.\n * Shops without activity are included, sorted by name. Hourly buckets are\n * refused for windows over 7 days. Accepts an API key like `scope`.\n * `GET /analytics/shops`\n */\n async shops(params?: AnalyticsShopsRequest): Promise<AnalyticsShopsResponse> {\n return this.request('GET', '/analytics/shops', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * PSP analytics: routed payments, outcomes, volume and payment sizes per\n * connector and per connector account over one window, with the breakdown\n * by project and shop. Pinned server-side to your own merchant\n * (`merchant_id` is ignored) and to your shop for a shop-scoped user. Live\n * payments unless `test_mode` is `true`. Amounts are in USD unless\n * `currency` names one. Pass `sections` to compute only some blocks.\n * A role that may see no processor gets a 403.\n * `GET /analytics/connectors`\n */\n async connectors(params?: AnalyticsConnectorsRequest): Promise<AnalyticsConnectorsResponse> {\n return this.request('GET', '/analytics/connectors', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Industry analytics: payments, volume, outcomes, refunds and disputes by\n * the industry each shop had on the UTC day a payment was created, as a tree\n * of industries, sub-industries, the merchant's own industries and the\n * shops without one, each with the previous window, a series, the processor\n * and country split and the largest shops. Pinned server-side to your own\n * merchant (`merchant_id` is ignored). Needs the `IndustryAnalytics` area,\n * which no other analytics grant implies, at merchant level: a shop-scoped\n * role or a shop-bound key gets a 403 (`IR_22`). Live payments unless\n * `test_mode` is `true`; amounts in USD unless `currency` names one.\n * `GET /analytics/industries`\n */\n async industries(params?: IndustryAnalyticsRequest): Promise<IndustryAnalytics> {\n return this.request('GET', '/analytics/industries', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Device analytics over the canonical client-context observation per\n * payment (browser/platform families, device classes and models, checkout\n * channel mix, time-to-pay), pinned server-side to your own merchant and\n * drillable via `project_id` / `shop_id` exactly like `scope`. Gated on the\n * client-context optimisation-use switch: when it is off the server answers\n * 200 with `enabled: false` and a caveat naming the switch. Accepts an API\n * key like `scope`. `GET /analytics/devices`\n */\n async devices(params?: ClientAnalyticsRequest): Promise<DevicesAnalyticsResponse> {\n return this.request('GET', '/analytics/devices', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Geo analytics over the canonical client-context observation per payment:\n * country totals, city bubbles (IP mode), buyer languages, buyer-local\n * purchase hours and the IP-vs-billing mismatch share. `mode` selects the\n * location claim (`ip` default, `billing`); the two are never coalesced.\n * Same drill, window, gating and API-key contract as `devices`.\n * `GET /analytics/geo`\n */\n async geo(params?: ClientAnalyticsRequest): Promise<GeoAnalyticsResponse> {\n return this.request('GET', '/analytics/geo', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The recent payments behind one clicked geo target: a map country (in the\n * active claim mode), optionally narrowed to an IP-resolved city, or one\n * buyer-local heatmap cell (`dow` + `hour`, paid sessions only). Same\n * window/scope/filter and gating contract as `geo`; capped at 50 rows,\n * newest first, with the full match count alongside.\n * `GET /analytics/geo/transactions`\n */\n async geoTransactions(params: GeoDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/geo/transactions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The recent payments behind one clicked device target: exactly one of a\n * browser family, a platform family, an identified device-model label, or\n * a device class. Family/model targets are resolved server-side with the\n * same classifiers the cards use. Same window/scope/filter and gating\n * contract as `devices`; 50 rows per page (`offset` for the next page),\n * newest first, with the full match count alongside.\n * `GET /analytics/devices/transactions`\n */\n async deviceTransactions(params: DeviceDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/devices/transactions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The payments behind one clicked element of the payments dashboard: a\n * processor-donut slice, a payment-method slice, an outcome segment of a\n * series bar, a series bucket, or a breakdown row — combinable, with\n * `target_bucket` narrowing every other target. The outcome mapping is the\n * one the series and donuts are folded with, expanded server-side, so the\n * list is what the clicked number was made of. Rows and the whole-match\n * `summary` carry USD figures converted with the dashboard's own rates.\n * Same window/scope/chip contract as `scope`; sorted per `sort_on` /\n * `sort_by`, `limit` rows (default 50) per page, `offset` for the next.\n * `GET /analytics/scope/transactions`\n */\n async scopeTransactions(params: ScopeDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/scope/transactions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Subscription analytics over `subscription` and `invoice`: estimated\n * recurring volume, the invoice funnel, movement (new / expansion /\n * contraction / churn), both processor axes, plan mix and the breakdown one\n * level below the scope. Pinned server-side to your own merchant and\n * drillable via `project_id` / `shop_id` exactly like `scope`.\n *\n * Half the figures are **stocks** — a snapshot at the window's end rather\n * than a sum over it — so `est_monthly_volume_usd` and `active` can match\n * across a 7-day and a 30-day window while `billed_volume_usd` does not.\n * Day granularity only. Accepts an API key like `scope`.\n * `GET /analytics/subscriptions`\n */\n async subscriptions(\n params?: SubscriptionAnalyticsRequest,\n ): Promise<SubscriptionAnalyticsResponse> {\n return this.request('GET', '/analytics/subscriptions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The billing cycles behind one clicked element of the subscription\n * dashboard: an invoice outcome, a processor slice on either axis, a plan\n * row, a subscription status, a movement component, a series bucket or a\n * breakdown row. Same window/scope/filter contract as `subscriptions`; 50\n * rows per page (`offset` for the next), newest first, with the full match\n * count alongside.\n *\n * A cycle that never reached a payment is listed too — that is what \"still\n * unpaid\" means — and carries its invoice id as `payment_id` with\n * `invoice_id` set to the same value, so you can always tell which you got.\n * `GET /analytics/subscriptions/list`\n */\n async subscriptionsList(params: SubscriptionDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/subscriptions/list', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Every analytics exclusion of the merchant, with the payments each one\n * matched in the lookback window.\n *\n * These rules change what the merchant's own dashboards count. Financial\n * records and transaction lists are never filtered by them.\n *\n * `matched_payments` counts overlap between rules: a payment matched by\n * three rules is counted once by each, so the values are not additive. The\n * envelope's `best_effort` and `lookback_days` apply to every row — matching\n * runs on client signals that may be absent or expired, within that window.\n * `GET /analytics/exclusions`\n */\n async listExclusions(): Promise<AnalyticsExclusionsResponse> {\n return this.request('GET', '/analytics/exclusions');\n }\n\n /**\n * Write a new exclusion. A shop-scoped user must name their own shop in\n * `profile_id`; omitting it applies the rule to every shop of the merchant.\n * Omitting `surfaces` means **all five**, not none.\n * `POST /analytics/exclusions`\n */\n async createExclusion(rule: AnalyticsExclusionRequest): Promise<AnalyticsExclusionResponse> {\n return this.request('POST', '/analytics/exclusions', { body: rule });\n }\n\n /**\n * Replace a stored exclusion **completely**. This is not a patch: every\n * field you leave out reverts to its default rather than keeping its stored\n * value, so send the whole rule — including an explicit `null` for a\n * `profile_id`, `value`, `valid_from`, `valid_until` or `note` you mean to\n * clear, and the full `surfaces` list you mean to keep.\n * `PUT /analytics/exclusions/{id}`\n */\n async updateExclusion(\n id: string,\n rule: AnalyticsExclusionRequest,\n options?: RequestExtras,\n ): Promise<AnalyticsExclusionResponse> {\n return this.request('PUT', `/analytics/exclusions/${encodeURIComponent(id)}`, {\n body: rule,\n ...options,\n });\n }\n\n /**\n * Delete a stored exclusion. Returns the rule as it was, so a caller can\n * say what it removed. `DELETE /analytics/exclusions/{id}`\n */\n async deleteExclusion(id: string): Promise<AnalyticsExclusionResponse> {\n return this.request('DELETE', `/analytics/exclusions/${encodeURIComponent(id)}`);\n }\n\n /** Global search. `POST /analytics/search` */\n async search(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/analytics/search', { body: params });\n }\n\n /** Domain-specific search. `POST /analytics/search/{domain}` */\n async searchDomain(\n domain: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/analytics/search/${encodeURIComponent(domain)}`, {\n body: params,\n });\n }\n\n /** Get analytics info. `GET /analytics/{domain}/info` */\n async getInfo(domain: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/analytics/${encodeURIComponent(domain)}/info`);\n }\n\n /** Get API event logs. `GET /analytics/api-event-logs` */\n async apiEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/api-event-logs', { query: params });\n }\n\n /** Get SDK event logs. `POST /analytics/sdk-event-logs` */\n async sdkEventLogs(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/analytics/sdk-event-logs', { body: params });\n }\n\n /** Get connector event logs. `GET /analytics/connector-event-logs` */\n async connectorEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/connector-event-logs', { query: params });\n }\n\n /**\n * Get routing event logs. `GET /analytics/routing-event-logs`\n *\n * @deprecated The service answers this only from a ClickHouse analytics\n * store; with SQL analytics, the default configuration, it answers an\n * error. To learn why a payment used a connector, read\n * `payments.routingDecisions(paymentId)`,\n * the routing decision recorded behind each attempt. This method stays for\n * compatibility and still sends the same request.\n */\n async routingEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/routing-event-logs', { query: params });\n }\n\n /** Get outgoing webhook event logs. `GET /analytics/outgoing-webhook-event-logs` */\n async outgoingWebhookEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/outgoing-webhook-event-logs', { query: params });\n }\n}\n"]}
1
+ {"version":3,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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,eAAA,CAAgB,IAAA,EAAsE;AAC1F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,uBAAA,EAAyB,EAAE,IAAA,EAAM,KAAK,CAAC,CAAA;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,eAAA,CACJ,EAAA,EACA,IAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,sBAAA,EAAyB,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAClE,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAMuE,EAAA;AACK,IAAA;AAC5E,EAAA;AAAA;AAGgF,EAAA;AACb,IAAA;AACnE,EAAA;AAAA;AAMoC,EAAA;AACyC,IAAA;AACnE,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAGgE,EAAA;AACY,IAAA;AAC5E,EAAA;AAAA;AAKoC,EAAA;AACuC,IAAA;AAC3E,EAAA;AAAA;AAGsF,EAAA;AACX,IAAA;AAC3E,EAAA;AAAA;AAKoC,EAAA;AACqC,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcoC,EAAA;AACmC,IAAA;AACvE,EAAA;AAAA;AAKoC,EAAA;AACqC,IAAA;AACzE,EAAA;AACF;AD3D+E;AACA;AACA;AACA","file":"/tmp/w2-sdk-publish-0492/dist/chunk-YWN76H2W.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\nimport type {\n AnalyticsScopeRequest,\n AnalyticsScopeResponse,\n AnalyticsShopsRequest,\n AnalyticsShopsResponse,\n AnalyticsConnectorsRequest,\n AnalyticsConnectorsResponse,\n ClientAnalyticsRequest,\n IndustryAnalytics,\n IndustryAnalyticsRequest,\n DevicesAnalyticsResponse,\n GeoAnalyticsResponse,\n DeviceDrillRequest,\n GeoDrillRequest,\n DrillResponse,\n SubscriptionAnalyticsRequest,\n SubscriptionAnalyticsResponse,\n SubscriptionDrillRequest,\n ScopeDrillRequest,\n AnalyticsExclusionRequest,\n AnalyticsExclusionResponse,\n AnalyticsExclusionsResponse,\n} from '../types';\n\nexport class Analytics {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Scoped, drill-level analytics dashboard for the authenticated merchant\n * (the same engine as the admin portal, pinned server-side to your own\n * merchant). The server ignores `merchant_id` — it always scopes to your\n * merchant, and to your single shop for profile-scoped users — so pass only\n * `project_id` / `shop_id` to drill and the window / `sections` fields.\n * Returns one drill level: the scope's daily series + previous window,\n * processor mix and direct children. Accepts a dashboard session or an API\n * key, including a `statistics_read` key; a shop-bound key reads only its\n * shop. `GET /analytics/scope`\n */\n async scope(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/analytics/scope', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Period Reports: the scoped daily series, pinned exactly like `scope`, but\n * gated on the Period Reports permission area instead of Payment\n * Performance. Pass `timezone` and each day bucket is a local calendar day,\n * which sums exactly into calendar weeks and months. Answers only the\n * `series`, `previous` and `children` blocks and ignores country and device\n * filters. Accepts a dashboard session or an API key, including a\n * `statistics_read` key. `GET /analytics/reports`\n */\n async reports(params?: AnalyticsScopeRequest): Promise<AnalyticsScopeResponse> {\n return this.request('GET', '/analytics/reports', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Shop comparison: one series per shop over one window, with whole-window\n * and previous-window totals, so shops can be drawn side by side. Pinned\n * server-side to your own merchant (`merchant_id` is ignored), and to your\n * single shop for a shop-scoped user; `project_id` / `shop_id` narrow it.\n * Shops without activity are included, sorted by name. Hourly buckets are\n * refused for windows over 7 days. Accepts an API key like `scope`.\n * `GET /analytics/shops`\n */\n async shops(params?: AnalyticsShopsRequest): Promise<AnalyticsShopsResponse> {\n return this.request('GET', '/analytics/shops', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * PSP analytics: routed payments, outcomes, volume and payment sizes per\n * connector and per connector account over one window, with the breakdown\n * by project and shop. Pinned server-side to your own merchant\n * (`merchant_id` is ignored) and to your shop for a shop-scoped user. Live\n * payments unless `test_mode` is `true`. Amounts are in USD unless\n * `currency` names one. Pass `sections` to compute only some blocks.\n * A role that may see no processor gets a 403.\n * `GET /analytics/connectors`\n */\n async connectors(params?: AnalyticsConnectorsRequest): Promise<AnalyticsConnectorsResponse> {\n return this.request('GET', '/analytics/connectors', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Industry analytics: payments, volume, outcomes, refunds and disputes by\n * the industry each shop had on the UTC day a payment was created, as a tree\n * of industries, sub-industries, the merchant's own industries and the\n * shops without one, each with the previous window, a series, the processor\n * and country split and the largest shops. Pinned server-side to your own\n * merchant (`merchant_id` is ignored). Needs the `IndustryAnalytics` area,\n * which no other analytics grant implies, at merchant level: a shop-scoped\n * role or a shop-bound key gets a 403 (`IR_22`). Live payments unless\n * `test_mode` is `true`; amounts in USD unless `currency` names one.\n * `GET /analytics/industries`\n */\n async industries(params?: IndustryAnalyticsRequest): Promise<IndustryAnalytics> {\n return this.request('GET', '/analytics/industries', {\n query: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Device analytics over the canonical client-context observation per\n * payment (browser/platform families, device classes and models, checkout\n * channel mix, time-to-pay), pinned server-side to your own merchant and\n * drillable via `project_id` / `shop_id` exactly like `scope`. Gated on the\n * client-context optimisation-use switch: when it is off the server answers\n * 200 with `enabled: false` and a caveat naming the switch. Accepts an API\n * key like `scope`. `GET /analytics/devices`\n */\n async devices(params?: ClientAnalyticsRequest): Promise<DevicesAnalyticsResponse> {\n return this.request('GET', '/analytics/devices', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Geo analytics over the canonical client-context observation per payment:\n * country totals, city bubbles (IP mode), buyer languages, buyer-local\n * purchase hours and the IP-vs-billing mismatch share. `mode` selects the\n * location claim (`ip` default, `billing`); the two are never coalesced.\n * Same drill, window, gating and API-key contract as `devices`.\n * `GET /analytics/geo`\n */\n async geo(params?: ClientAnalyticsRequest): Promise<GeoAnalyticsResponse> {\n return this.request('GET', '/analytics/geo', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The recent payments behind one clicked geo target: a map country (in the\n * active claim mode), optionally narrowed to an IP-resolved city, or one\n * buyer-local heatmap cell (`dow` + `hour`, paid sessions only). Same\n * window/scope/filter and gating contract as `geo`; capped at 50 rows,\n * newest first, with the full match count alongside.\n * `GET /analytics/geo/transactions`\n */\n async geoTransactions(params: GeoDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/geo/transactions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The recent payments behind one clicked device target: exactly one of a\n * browser family, a platform family, an identified device-model label, or\n * a device class. Family/model targets are resolved server-side with the\n * same classifiers the cards use. Same window/scope/filter and gating\n * contract as `devices`; 50 rows per page (`offset` for the next page),\n * newest first, with the full match count alongside.\n * `GET /analytics/devices/transactions`\n */\n async deviceTransactions(params: DeviceDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/devices/transactions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The payments behind one clicked element of the payments dashboard: a\n * processor-donut slice, a payment-method slice, an outcome segment of a\n * series bar, a series bucket, or a breakdown row — combinable, with\n * `target_bucket` narrowing every other target. The outcome mapping is the\n * one the series and donuts are folded with, expanded server-side, so the\n * list is what the clicked number was made of. Rows and the whole-match\n * `summary` carry USD figures converted with the dashboard's own rates.\n * Same window/scope/chip contract as `scope`; sorted per `sort_on` /\n * `sort_by`, `limit` rows (default 50) per page, `offset` for the next.\n * `GET /analytics/scope/transactions`\n */\n async scopeTransactions(params: ScopeDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/scope/transactions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Subscription analytics over `subscription` and `invoice`: estimated\n * recurring volume, the invoice funnel, movement (new / expansion /\n * contraction / churn), both processor axes, plan mix and the breakdown one\n * level below the scope. Pinned server-side to your own merchant and\n * drillable via `project_id` / `shop_id` exactly like `scope`.\n *\n * Half the figures are **stocks** — a snapshot at the window's end rather\n * than a sum over it — so `est_monthly_volume_usd` and `active` can match\n * across a 7-day and a 30-day window while `billed_volume_usd` does not.\n * Day granularity only. Accepts an API key like `scope`.\n * `GET /analytics/subscriptions`\n */\n async subscriptions(\n params?: SubscriptionAnalyticsRequest,\n ): Promise<SubscriptionAnalyticsResponse> {\n return this.request('GET', '/analytics/subscriptions', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * The billing cycles behind one clicked element of the subscription\n * dashboard: an invoice outcome, a processor slice on either axis, a plan\n * row, a subscription status, a movement component, a series bucket or a\n * breakdown row. Same window/scope/filter contract as `subscriptions`; 50\n * rows per page (`offset` for the next), newest first, with the full match\n * count alongside.\n *\n * A cycle that never reached a payment is listed too — that is what \"still\n * unpaid\" means — and carries its invoice id as `payment_id` with\n * `invoice_id` set to the same value, so you can always tell which you got.\n * `GET /analytics/subscriptions/list`\n */\n async subscriptionsList(params: SubscriptionDrillRequest): Promise<DrillResponse> {\n return this.request('GET', '/analytics/subscriptions/list', {\n query: csvQuery(params, ['shop_ids']),\n });\n }\n\n /**\n * Every analytics exclusion of the merchant, with the payments each one\n * matched in the lookback window.\n *\n * These rules change what the merchant's own dashboards count. Financial\n * records and transaction lists are never filtered by them.\n *\n * `matched_payments` counts overlap between rules: a payment matched by\n * three rules is counted once by each, so the values are not additive. The\n * envelope's `best_effort` and `lookback_days` apply to every row — matching\n * runs on client signals that may be absent or expired, within that window.\n * `GET /analytics/exclusions`\n */\n async listExclusions(): Promise<AnalyticsExclusionsResponse> {\n return this.request('GET', '/analytics/exclusions');\n }\n\n /**\n * Write a new exclusion. A shop-scoped user must name their own shop in\n * `profile_id`; omitting it applies the rule to every shop of the merchant.\n * Omitting `surfaces` means **all five**, not none.\n * `POST /analytics/exclusions`\n */\n async createExclusion(rule: AnalyticsExclusionRequest): Promise<AnalyticsExclusionResponse> {\n return this.request('POST', '/analytics/exclusions', { body: rule });\n }\n\n /**\n * Replace a stored exclusion **completely**. This is not a patch: every\n * field you leave out reverts to its default rather than keeping its stored\n * value, so send the whole rule — including an explicit `null` for a\n * `profile_id`, `value`, `valid_from`, `valid_until` or `note` you mean to\n * clear, and the full `surfaces` list you mean to keep.\n * `PUT /analytics/exclusions/{id}`\n */\n async updateExclusion(\n id: string,\n rule: AnalyticsExclusionRequest,\n options?: RequestExtras,\n ): Promise<AnalyticsExclusionResponse> {\n return this.request('PUT', `/analytics/exclusions/${encodeURIComponent(id)}`, {\n body: rule,\n ...options,\n });\n }\n\n /**\n * Delete a stored exclusion. Returns the rule as it was, so a caller can\n * say what it removed. `DELETE /analytics/exclusions/{id}`\n */\n async deleteExclusion(id: string): Promise<AnalyticsExclusionResponse> {\n return this.request('DELETE', `/analytics/exclusions/${encodeURIComponent(id)}`);\n }\n\n /** Global search. `POST /analytics/search` */\n async search(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/analytics/search', { body: params });\n }\n\n /** Domain-specific search. `POST /analytics/search/{domain}` */\n async searchDomain(\n domain: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/analytics/search/${encodeURIComponent(domain)}`, {\n body: params,\n });\n }\n\n /** Get analytics info. `GET /analytics/{domain}/info` */\n async getInfo(domain: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/analytics/${encodeURIComponent(domain)}/info`);\n }\n\n /** Get API event logs. `GET /analytics/api-event-logs` */\n async apiEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/api-event-logs', { query: params });\n }\n\n /** Get SDK event logs. `POST /analytics/sdk-event-logs` */\n async sdkEventLogs(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/analytics/sdk-event-logs', { body: params });\n }\n\n /** Get connector event logs. `GET /analytics/connector-event-logs` */\n async connectorEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/connector-event-logs', { query: params });\n }\n\n /**\n * Get routing event logs. `GET /analytics/routing-event-logs`\n *\n * @deprecated The service answers this only from a ClickHouse analytics\n * store; with SQL analytics, the default configuration, it answers an\n * error. To learn why a payment used a connector, read\n * `payments.routingDecisions(paymentId)`,\n * the routing decision recorded behind each attempt. This method stays for\n * compatibility and still sends the same request.\n */\n async routingEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/routing-event-logs', { query: params });\n }\n\n /** Get outgoing webhook event logs. `GET /analytics/outgoing-webhook-event-logs` */\n async outgoingWebhookEventLogs(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics/outgoing-webhook-event-logs', { query: params });\n }\n}\n"]}