@delopay/sdk 0.484.0 → 0.486.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.
- package/dist/airwallexCard.cjs.map +1 -1
- package/dist/branding.cjs.map +1 -1
- package/dist/cardFormStyles.cjs.map +1 -1
- package/dist/checkoutSession.cjs +2 -2
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/checkoutSession.js +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-44QBWVRS.cjs.map +1 -1
- package/dist/chunk-4EKAWNYI.cjs.map +1 -1
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/{chunk-R3LVDOE2.js → chunk-4SGHTO6G.js} +2 -2
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-5QS67SBO.cjs.map +1 -1
- package/dist/chunk-6BFZS4YP.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.cjs.map +1 -1
- package/dist/chunk-6LFOM6HV.cjs.map +1 -1
- package/dist/chunk-6LOWE2YI.cjs.map +1 -1
- package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
- package/dist/chunk-6SU2MTN2.cjs.map +1 -1
- package/dist/chunk-6YCDLSIU.cjs.map +1 -1
- package/dist/chunk-75E5WNJG.cjs.map +1 -1
- package/dist/chunk-7JV6VVO7.cjs.map +1 -1
- package/dist/chunk-7NKJD5ST.cjs.map +1 -1
- package/dist/chunk-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- package/dist/{chunk-W4EASI7R.js → chunk-A767G7YE.js} +32 -1
- package/dist/chunk-A767G7YE.js.map +1 -0
- package/dist/chunk-ABWAYMN5.cjs.map +1 -1
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
- package/dist/chunk-BRY3W7N3.cjs.map +1 -1
- package/dist/chunk-BT3UAUEV.cjs.map +1 -1
- package/dist/chunk-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CR3JBTP3.cjs.map +1 -1
- package/dist/chunk-DJASVBOJ.cjs.map +1 -1
- package/dist/chunk-EEB2HDYL.cjs.map +1 -1
- package/dist/chunk-ENPSUWTS.cjs.map +1 -1
- package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
- package/dist/chunk-EXPWQBI3.cjs.map +1 -1
- package/dist/chunk-EYHSXJMJ.cjs.map +1 -1
- package/dist/chunk-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F46K5H3U.cjs.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/{chunk-36EJUE7E.cjs → chunk-FKAFTANS.cjs} +5 -5
- package/dist/chunk-FKAFTANS.cjs.map +1 -0
- package/dist/chunk-FQRC4NJG.cjs.map +1 -1
- package/dist/chunk-FTWGI7UZ.cjs.map +1 -1
- package/dist/chunk-FYISDU2Y.cjs.map +1 -1
- package/dist/chunk-GG52SAHA.cjs.map +1 -1
- package/dist/chunk-GK5FWN4H.cjs.map +1 -1
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/chunk-GWSVQXEY.cjs.map +1 -1
- package/dist/{chunk-TZ6JAOOB.js → chunk-HDVND42A.js} +3 -3
- package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
- package/dist/chunk-HLYGHP6F.cjs.map +1 -1
- package/dist/chunk-HSJABE7X.cjs.map +1 -1
- package/dist/chunk-HXKNTSTZ.cjs.map +1 -1
- package/dist/chunk-I2W7AO4B.cjs.map +1 -1
- package/dist/chunk-I2XGNALG.cjs.map +1 -1
- package/dist/chunk-IEVJVKC7.cjs.map +1 -1
- package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
- package/dist/chunk-IR2LFKKA.cjs.map +1 -1
- package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
- package/dist/chunk-J5RPSRBQ.cjs.map +1 -1
- package/dist/chunk-JPPRDMTJ.cjs.map +1 -1
- package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
- package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
- package/dist/chunk-KJDMNF2T.cjs.map +1 -1
- package/dist/chunk-KLONGJCL.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/{chunk-TVBMXXGA.cjs → chunk-MWERDHA6.cjs} +27 -1
- package/dist/chunk-MWERDHA6.cjs.map +1 -0
- package/dist/chunk-MYAXAWBQ.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/chunk-OAEKP665.cjs.map +1 -1
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/{chunk-DM75PLU4.js → chunk-OEREK6NU.js} +36 -1
- package/dist/chunk-OEREK6NU.js.map +1 -0
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.cjs.map +1 -1
- package/dist/chunk-P4UILJVU.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.cjs.map +1 -1
- package/dist/chunk-PYNHK6AP.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QKUWFMZP.cjs.map +1 -1
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R2AKKQ35.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RHFUXHQN.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-S77LQWYC.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/chunk-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/chunk-U3JK7NBG.cjs.map +1 -1
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/{chunk-VZ3BSIVU.cjs → chunk-UTCXNBID.cjs} +32 -1
- package/dist/chunk-UTCXNBID.cjs.map +1 -0
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHMH4QMY.cjs.map +1 -1
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/chunk-WHDI3TMP.cjs.map +1 -1
- package/dist/{chunk-35U6FHUL.js → chunk-WI3ARWTF.js} +27 -1
- package/dist/chunk-WI3ARWTF.js.map +1 -0
- package/dist/chunk-WITCPKNL.cjs.map +1 -1
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/{chunk-CIMLGIXJ.cjs → chunk-XZ4PEZXL.cjs} +3 -3
- package/dist/chunk-XZ4PEZXL.cjs.map +1 -0
- package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
- package/dist/{chunk-IGHAJNC6.cjs → chunk-YFRAI34Y.cjs} +36 -1
- package/dist/chunk-YFRAI34Y.cjs.map +1 -0
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- package/dist/chunk-YW4DVKNT.cjs.map +1 -1
- package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
- package/dist/chunk-ZUULK36E.cjs.map +1 -1
- package/dist/client.cjs +2 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/currencies.cjs.map +1 -1
- package/dist/enigmaCardForm.cjs.map +1 -1
- package/dist/error.cjs.map +1 -1
- package/dist/eventStream.cjs.map +1 -1
- package/dist/exportDownload.cjs.map +1 -1
- package/dist/feeProgram.cjs.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/resources/admin.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.cjs +2 -2
- package/dist/internal/resources/adminPortal.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.d.cts +11 -1
- package/dist/internal/resources/adminPortal.d.ts +11 -1
- package/dist/internal/resources/adminPortal.js +1 -1
- package/dist/internal/resources/adminPricing.cjs.map +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformFees.cjs.map +1 -1
- package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.cjs.map +1 -1
- package/dist/internal.cjs +8 -8
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +5 -5
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs.map +1 -1
- package/dist/paymentPresentation.cjs.map +1 -1
- package/dist/recordCounter.cjs.map +1 -1
- package/dist/resources/aiTools.cjs.map +1 -1
- package/dist/resources/analytics.cjs.map +1 -1
- package/dist/resources/analyticsDashboard.cjs.map +1 -1
- package/dist/resources/apiKeys.cjs.map +1 -1
- package/dist/resources/audit.cjs.map +1 -1
- package/dist/resources/authentication.cjs.map +1 -1
- package/dist/resources/availabilityOverrides.cjs.map +1 -1
- package/dist/resources/billing.cjs.map +1 -1
- package/dist/resources/buyerAccount.cjs.map +1 -1
- package/dist/resources/buyerBlocklist.cjs.map +1 -1
- package/dist/resources/buyerConversations.cjs.map +1 -1
- package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
- package/dist/resources/buyerPortal.cjs.map +1 -1
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/chargebackPrevention.cjs.map +1 -1
- package/dist/resources/checkoutDomains.cjs.map +1 -1
- package/dist/resources/checkoutMethods.cjs.map +1 -1
- package/dist/resources/checkoutRecovery.cjs.map +1 -1
- package/dist/resources/checkoutTemplates.cjs.map +1 -1
- package/dist/resources/connectors.cjs.map +1 -1
- package/dist/resources/contentEncryption.cjs.map +1 -1
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/notices.cjs.map +1 -1
- package/dist/resources/operationLimits.cjs.map +1 -1
- package/dist/resources/paymentLinks.cjs.map +1 -1
- package/dist/resources/paymentMethods.cjs.map +1 -1
- package/dist/resources/payments.cjs +2 -2
- package/dist/resources/payments.cjs.map +1 -1
- package/dist/resources/payments.d.cts +17 -1
- package/dist/resources/payments.d.ts +17 -1
- package/dist/resources/payments.js +1 -1
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payouts.cjs.map +1 -1
- package/dist/resources/paypalDisputes.cjs.map +1 -1
- package/dist/resources/persons.cjs.map +1 -1
- package/dist/resources/poll.cjs.map +1 -1
- package/dist/resources/processorCosts.cjs.map +1 -1
- package/dist/resources/processorImports.cjs.map +1 -1
- package/dist/resources/products.cjs.map +1 -1
- package/dist/resources/profileAcquirers.cjs.map +1 -1
- package/dist/resources/profiles.cjs.map +1 -1
- package/dist/resources/projects.cjs.map +1 -1
- package/dist/resources/refunds.cjs.map +1 -1
- package/dist/resources/regions.cjs.map +1 -1
- package/dist/resources/relay.cjs.map +1 -1
- package/dist/resources/risk.cjs.map +1 -1
- package/dist/resources/routing.cjs.map +1 -1
- package/dist/resources/search.cjs.map +1 -1
- package/dist/resources/sellToRestrictions.cjs.map +1 -1
- package/dist/resources/settings.cjs.map +1 -1
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/shareLinks.cjs.map +1 -1
- package/dist/resources/shopLabels.cjs.map +1 -1
- package/dist/resources/shopify.cjs +2 -2
- package/dist/resources/shopify.cjs.map +1 -1
- package/dist/resources/shopify.d.cts +31 -4
- package/dist/resources/shopify.d.ts +31 -4
- package/dist/resources/shopify.js +1 -1
- package/dist/resources/shops.cjs.map +1 -1
- package/dist/resources/stripeConnect.cjs.map +1 -1
- package/dist/resources/subscriptions.cjs.map +1 -1
- package/dist/resources/support.cjs.map +1 -1
- package/dist/resources/threeDsRules.cjs.map +1 -1
- package/dist/resources/users.cjs.map +1 -1
- package/dist/resources/vatRates.cjs.map +1 -1
- package/dist/resources/verification.cjs.map +1 -1
- package/dist/resources/webhooks.cjs.map +1 -1
- package/dist/resources/whopResolutionCases.cjs.map +1 -1
- package/dist/trustedOrigins.cjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +274 -1
- package/dist/types.d.ts +274 -1
- package/package.json +19 -17
- package/dist/chunk-35U6FHUL.js.map +0 -1
- package/dist/chunk-36EJUE7E.cjs.map +0 -1
- package/dist/chunk-CIMLGIXJ.cjs.map +0 -1
- package/dist/chunk-DM75PLU4.js.map +0 -1
- package/dist/chunk-IGHAJNC6.cjs.map +0 -1
- package/dist/chunk-TVBMXXGA.cjs.map +0 -1
- package/dist/chunk-VZ3BSIVU.cjs.map +0 -1
- package/dist/chunk-W4EASI7R.js.map +0 -1
- /package/dist/{chunk-R3LVDOE2.js.map → chunk-4SGHTO6G.js.map} +0 -0
- /package/dist/{chunk-TZ6JAOOB.js.map → chunk-HDVND42A.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-O4AYHLQX.cjs","../src/resources/processorImports.ts"],"names":[],"mappings":"AAAA;ACeO,SAAS,sBAAA,CAAuB,KAAA,EAGP;AAC9B,EAAA,OAAA,CAAQ,KAAA,CAAM,IAAA,EAAM;AAAA,IAClB,KAAK,UAAA,EAAY;AACf,MAAA,IAAI,GAAA;AACJ,MAAA,IAAI;AACF,QAAA,IAAA,EAAM,IAAA,CAAK,KAAA,CAAM,KAAA,CAAM,IAAI,CAAA;AAAA,MAC7B,EAAA,UAAQ;AACN,QAAA,OAAO,IAAA;AAAA,MACT;AACA,MAAA,GAAA,CAAI,IAAA,IAAQ,KAAA,GAAQ,OAAO,IAAA,IAAQ,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,GAAG,CAAA,EAAG,OAAO,IAAA;AAC1E,MAAA,OAAO,EAAE,IAAA,EAAM,UAAA,EAAY,IAAiC,CAAA;AAAA,IAC9D;AAAA,IACA,KAAK,MAAA;AACH,MAAA,OAAO,EAAE,IAAA,EAAM,OAAO,CAAA;AAAA,IACxB,OAAA;AACE,MAAA,OAAO,IAAA;AAAA,EACX;AACF;AAaO,IAAM,qBAAA,EAAN,MAA0E;AAAA,EAG/E,WAAA,CAA6B,UAAA,EAAmC;AAAnC,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAAoC;AAAA;AAAA,EAGjE,KAAA,CAAA,EAAc;AACZ,IAAA,IAAA,CAAK,UAAA,CAAW,KAAA,CAAM,CAAA;AAAA,EACxB;AAAA,EAEA,CAAC,MAAA,CAAO,aAAa,CAAA,CAAA,EAA2D;AAC9E,qBAAA,IAAA,CAAK,QAAA,UAAA,CAAL,IAAA,CAAK,SAAA,EAAa,IAAA,CAAK,MA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,MAAA,CAAO,UAAU;AAAA,IACvC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,EAAA,EAA2C;AACxD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,0BAAA,EAA6B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO4F,EAAA;AACZ,IAAA;AACtB,MAAA;AACvD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQwD,EAAA;AACyB,IAAA;AACjF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB8F,EAAA;AAC9D,IAAA;AACuB,MAAA;AACnD,MAAA;AACqD,QAAA;AACgB,QAAA;AACb,QAAA;AACxD,MAAA;AACF,IAAA;AAC0C,IAAA;AAC5C,EAAA;AACF;AD9CmF;AACA;AACA;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-O4AYHLQX.cjs","sourcesContent":[null,"import type {\n PspImportCreateRequest,\n PspImportIssuesRequest,\n PspImportIssuesResponse,\n PspImportLatestRequest,\n PspImportLatestResponse,\n PspImportRunResponse,\n PspImportSourcesRequest,\n PspImportSourcesResponse,\n PspImportStreamEvent,\n PspImportStreamOptions,\n} from '../types';\nimport type { EventStreamConnection, EventStreamFn, RequestFn } from '../client';\n\n/** The typed event a dispatch carries, or `null` for one the SDK does not know. */\nexport function toPspImportStreamEvent(event: {\n type: string;\n data: string;\n}): PspImportStreamEvent | null {\n switch (event.type) {\n case 'progress': {\n let run: unknown;\n try {\n run = JSON.parse(event.data);\n } catch {\n return null;\n }\n if (run === null || typeof run !== 'object' || Array.isArray(run)) return null;\n return { type: 'progress', run: run as PspImportRunResponse };\n }\n case 'done':\n return { type: 'done' };\n default:\n return null;\n }\n}\n\n/**\n * An open progress stream of one import: iterate it with `for await`.\n *\n * Each `progress` event carries the whole run, so a missed one loses nothing.\n * The iteration ends after `done`, when the server ends the stream (the\n * session ended, or the stream reached its lifetime), and when it is aborted\n * or closed. The SDK does not reconnect: read the run again with\n * `processorImports.retrieve()` and open a new stream while it is running. It\n * throws a `DelopayError` with code `TIMEOUT` when the stream stays silent too\n * long and `NETWORK` when the connection fails.\n */\nexport class PspImportEventStream implements AsyncIterable<PspImportStreamEvent> {\n private iterator?: AsyncGenerator<PspImportStreamEvent, void, undefined>;\n\n constructor(private readonly connection: EventStreamConnection) {}\n\n /** Close the stream; the iteration ends without an error. */\n close(): void {\n this.connection.close();\n }\n\n [Symbol.asyncIterator](): AsyncGenerator<PspImportStreamEvent, void, undefined> {\n this.iterator ??= this.events();\n return this.iterator;\n }\n\n private async *events(): AsyncGenerator<PspImportStreamEvent, void, undefined> {\n for await (const dispatch of this.connection.dispatches) {\n if (!dispatch.event) continue;\n const event = toPspImportStreamEvent(dispatch.event);\n if (event) yield event;\n }\n }\n}\n\n/**\n * Import refunds and disputes from the merchant's connected processor\n * accounts, in the background. An import only reads from the processor and\n * records what it already holds: it never answers a dispute, moves money or\n * changes a payment. A record DeloPay already holds is counted as already\n * present. Every method needs a dashboard JWT (`setJwtToken`).\n */\nexport class ProcessorImports {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Every connected processor account the caller may see, with what each can\n * provide in the environment: listed, read payment by payment, or\n * unavailable with a reason.\n *\n * `GET /refunds-disputes/imports/sources`\n */\n async sources(params: PspImportSourcesRequest): Promise<PspImportSourcesResponse> {\n return this.request('GET', '/refunds-disputes/imports/sources', {\n query: { test_mode: params.test_mode },\n });\n }\n\n /**\n * Start an import. A source a processor cannot provide is stored as\n * `unavailable` with its reason. Refused while another import of the\n * merchant runs in the same environment.\n *\n * `POST /refunds-disputes/imports`\n */\n async create(request: PspImportCreateRequest): Promise<PspImportRunResponse> {\n return this.request('POST', '/refunds-disputes/imports', { body: request });\n }\n\n /**\n * The newest import in the environment, running or finished.\n *\n * `GET /refunds-disputes/imports/latest`\n */\n async latest(params: PspImportLatestRequest): Promise<PspImportLatestResponse> {\n return this.request('GET', '/refunds-disputes/imports/latest', {\n query: { test_mode: params.test_mode },\n });\n }\n\n /** `GET /refunds-disputes/imports/{id}` */\n async retrieve(id: string): Promise<PspImportRunResponse> {\n return this.request('GET', `/refunds-disputes/imports/${encodeURIComponent(id)}`);\n }\n\n /**\n * The records an import left out or could not record, each with its reason.\n *\n * `GET /refunds-disputes/imports/{id}/issues`\n */\n async issues(id: string, params?: PspImportIssuesRequest): Promise<PspImportIssuesResponse> {\n return this.request('GET', `/refunds-disputes/imports/${encodeURIComponent(id)}/issues`, {\n query: { limit: params?.limit, offset: params?.offset },\n });\n }\n\n /**\n * Ask a running import to stop. It stops after the page it is reading;\n * what it recorded stays recorded.\n *\n * `POST /refunds-disputes/imports/{id}/cancel`\n */\n async cancel(id: string): Promise<PspImportRunResponse> {\n return this.request('POST', `/refunds-disputes/imports/${encodeURIComponent(id)}/cancel`);\n }\n\n /**\n * Open the progress stream of an import. Resolves once the server answered;\n * a `401` rejects with `DelopayAuthenticationError`.\n *\n * `GET /refunds-disputes/imports/{id}/stream`\n *\n * @example\n * ```typescript\n * const stream = await delopay.processorImports.stream(run.id, { signal });\n * for await (const event of stream) {\n * if (event.type === 'progress') render(event.run);\n * }\n * ```\n */\n async stream(id: string, options: PspImportStreamOptions = {}): Promise<PspImportEventStream> {\n const connection = await this.openStream(\n `/refunds-disputes/imports/${encodeURIComponent(id)}/stream`,\n {\n ...(options.signal ? { signal: options.signal } : {}),\n ...(options.idleTimeoutMs !== undefined ? { idleTimeoutMs: options.idleTimeoutMs } : {}),\n ...(options.headers ? { headers: options.headers } : {}),\n },\n );\n return new PspImportEventStream(connection);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/pub0484/delopay-typescript-sdk/dist/chunk-OAEKP665.c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AA;AACnB,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ8C,EAAA;AACS,IAAA;AACvD,EAAA;AAAA;AAAA;AAAA;AAAA;AAMgF,EAAA;AACnD,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsD,EAAA;AACzB,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWiC,EAAA;AACc,IAAA;AAC/C,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY0E,EAAA;AAC3B,IAAA;AAC/C,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkB4F,EAAA;AAC9D,IAAA;AAC9B,EAAA;AAAA;AAAA;AAAA;AAAA;AAMgE,EAAA;AAClD,IAAA;AACV,MAAA;AACmD,MAAA;AACrD,IAAA;AACF,EAAA;AACF;AD7DyD;AACA;AACA;AACA","file":"/tmp/pub0484/delopay-typescript-sdk/dist/chunk-OAEKP665.cjs","sourcesContent":[null,"import type {\n CheckoutDomainAlerts,\n CheckoutDomainAvailabilityQuery,\n CheckoutDomainAvailabilityResponse,\n CheckoutHostPauseRequest,\n CheckoutHostPreview,\n CheckoutHostUpdateRequest,\n CheckoutHostVerification,\n CloudflareOAuthCallback,\n CloudflareOAuthStart,\n MerchantApplePayFiles,\n MerchantCheckoutDomains,\n MerchantCheckoutHost,\n MerchantCheckoutHostCreate,\n MerchantCloudflareConnect,\n MerchantHostHealth,\n MerchantHostShopsRequest,\n RemovedCheckoutHost,\n ShopCheckoutHost,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nfunction hostPath(hostId: string, rest = ''): string {\n return `/checkout-domains/${encodeURIComponent(hostId)}${rest}`;\n}\n\n/**\n * Checkout domains: the addresses a merchant's hosted checkout answers on\n * besides the platform's default one. An address is a name on the platform's\n * domain (`checkout-yourshop.example.net`) or a subdomain of the merchant's\n * own domain (`checkout.yourshop.com`, set up with DNS records or a\n * Cloudflare token). Shops are assigned to an address; their new payment\n * links open there once it is ready.\n *\n * Every route needs a dashboard session. Reading needs the checkout domains\n * area at `Read`; adding, changing and removing need `Write`, which only a\n * merchant-level role holds. DeloPay turns the feature on per merchant, with\n * a limit (`entitlement` on `list()`).\n */\nexport class CheckoutDomains {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The entitlement, every address with its setup and health, how new\n * subdomains are spelled, where own domains point, the default origin, and\n * the merchant's Cloudflare connections.\n * `GET /checkout-domains`\n */\n async list(): Promise<MerchantCheckoutDomains> {\n return this.request('GET', '/checkout-domains');\n }\n\n /**\n * Whether an address can be added. Reserves nothing; the answer also names\n * a free platform name like the one asked for, and the DNS provider read\n * from an own domain's nameservers.\n * `GET /checkout-domains/availability`\n */\n async availability(\n query: CheckoutDomainAvailabilityQuery,\n ): Promise<CheckoutDomainAvailabilityResponse> {\n return this.request('GET', '/checkout-domains/availability', { query });\n }\n\n /**\n * Add an address. It starts `setting_up`; a repeat for an address the\n * merchant already has answers with that address.\n * `POST /checkout-domains`\n */\n async create(params: MerchantCheckoutHostCreate): Promise<MerchantCheckoutHost> {\n return this.request('POST', '/checkout-domains', { body: params });\n }\n\n /** One address. Another merchant's id answers 404. `GET /checkout-domains/{hostId}` */\n async retrieve(hostId: string): Promise<MerchantCheckoutHost> {\n return this.request('GET', hostPath(hostId));\n }\n\n /**\n * Change an address: the Apple Pay file it serves (`null` serves none) and\n * whether new links fall back to the default address while it is down.\n * What is left out stays as it is. Refusal: `file_unknown`.\n * `PATCH /checkout-domains/{hostId}`\n */\n async update(hostId: string, params: CheckoutHostUpdateRequest): Promise<MerchantCheckoutHost> {\n return this.request('PATCH', hostPath(hostId), { body: params });\n }\n\n /**\n * Remove an address; its shops go back to the default address for new\n * links. A platform subdomain becomes `retiring`: it takes no new links,\n * keeps serving links already sent until `retire_after`, then frees its\n * name. An own domain is removed in two steps: it must stop taking traffic\n * first (pause it; `removable_after` on the address says when the drain is\n * over), and links already sent stop working once its DNS points elsewhere.\n * Refusals (`code` `IR_16`, `data.reason`): `host_takes_traffic` (still takes new\n * traffic; pause it first), `host_draining` (stopped moments ago;\n * `retry_after_seconds`), `host_in_use` (`payment_ids` of open payments that\n * can still come back to it) and `host_changed` (it changed while being\n * removed; read it again).\n * `DELETE /checkout-domains/{hostId}`\n */\n async remove(hostId: string): Promise<RemovedCheckoutHost> {\n return this.request('DELETE', hostPath(hostId));\n }\n\n /**\n * The address's health page: uptime, days, incidents, the latest\n * transitions, usage, and who was told about its events.\n * `GET /checkout-domains/{hostId}/health`\n */\n async health(hostId: string): Promise<MerchantHostHealth> {\n return this.request('GET', hostPath(hostId, '/health'));\n }\n\n /**\n * A signed link that renders a sample checkout on the address, without a\n * payment. Valid for ten minutes.\n * `POST /checkout-domains/{hostId}/preview`\n */\n async preview(hostId: string): Promise<CheckoutHostPreview> {\n return this.request('POST', hostPath(hostId, '/preview'));\n }\n\n /**\n * Pause the address: new links fall back to the default address, open\n * payments keep loading, and no alerts are sent. It resumes at `resume_at`,\n * or when resumed. Refusals: `pause_note_invalid`, `resume_at_past`.\n * `POST /checkout-domains/{hostId}/pause`\n */\n async pause(\n hostId: string,\n params: CheckoutHostPauseRequest = {},\n ): Promise<MerchantCheckoutHost> {\n return this.request('POST', hostPath(hostId, '/pause'), { body: params });\n }\n\n /**\n * Resume a paused address.\n * `DELETE /checkout-domains/{hostId}/pause`\n */\n async resume(hostId: string): Promise<MerchantCheckoutHost> {\n return this.request('DELETE', hostPath(hostId, '/pause'));\n }\n\n /**\n * The DNS records an own domain needs (where it points, and the TXT record\n * proving the domain), whether each was found, and what the hostname\n * resolves to today.\n * `GET /checkout-domains/{hostId}/verification`\n */\n async verification(hostId: string): Promise<CheckoutHostVerification> {\n return this.request('GET', hostPath(hostId, '/verification'));\n }\n\n /**\n * Run the address's check now instead of waiting for the next one.\n * Rate-limited per address.\n * `POST /checkout-domains/{hostId}/check`\n */\n async check(hostId: string): Promise<MerchantCheckoutHost> {\n return this.request('POST', hostPath(hostId, '/check'));\n }\n\n /**\n * The whole list of shops whose new links use the address. A shop uses one\n * address at a time, so a listed shop moves off any other address of the\n * merchant. An address still setting up may take shops; their links switch\n * once it is ready.\n * `PUT /checkout-domains/{hostId}/shops`\n */\n async setShops(hostId: string, params: MerchantHostShopsRequest): Promise<MerchantCheckoutHost> {\n return this.request('PUT', hostPath(hostId, '/shops'), { body: params });\n }\n\n /**\n * Which address one shop's new links use; `host_id: null` puts the shop\n * back on the default address. Links switch once the address is ready.\n * `PUT /checkout-domains/shops/{profileId}`\n */\n async setShopHost(profileId: string, params: ShopCheckoutHost): Promise<ShopCheckoutHost> {\n return this.request('PUT', `/checkout-domains/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n\n /**\n * How checkout address events are told: each event with bell and email,\n * the recipients (members who may manage checkout domains, or chosen\n * members) and the addresses (all or chosen). Suspensions are always told.\n * `GET /checkout-domains/alerts`\n */\n async alerts(): Promise<CheckoutDomainAlerts> {\n return this.request('GET', '/checkout-domains/alerts');\n }\n\n /**\n * Save how checkout address events are told.\n * `PUT /checkout-domains/alerts`\n */\n async updateAlerts(params: CheckoutDomainAlerts): Promise<CheckoutDomainAlerts> {\n return this.request('PUT', '/checkout-domains/alerts', { body: params });\n }\n\n /**\n * The Apple Pay verification files an address may serve: the built-in ones\n * and the platform's uploads.\n * `GET /checkout-domains/apple-pay-files`\n */\n async applePayFiles(): Promise<MerchantApplePayFiles> {\n return this.request('GET', '/checkout-domains/apple-pay-files');\n }\n\n /**\n * Connect the merchant's Cloudflare to an own domain: the token must reach\n * exactly that domain's zone, with DNS edit. The records are created\n * through it; the token is stored encrypted and never returned.\n * `POST /checkout-domains/{hostId}/cloudflare`\n */\n async connectCloudflare(\n hostId: string,\n params: MerchantCloudflareConnect,\n ): Promise<MerchantCheckoutHost> {\n return this.request('POST', hostPath(hostId, '/cloudflare'), { body: params });\n }\n\n /**\n * Start \"Connect with Cloudflare\" (OAuth) for an own domain, instead of\n * pasting a token. Send the person to `authorize_url`; Cloudflare sends\n * them back to the deployment's redirect URI with `code` and `state`,\n * which go to {@link finishCloudflareOAuth} before `expires_at`. Offered\n * only while `list()` says `cloudflare_oauth_available`; otherwise refused\n * with `cloudflare_oauth_unavailable`. Also how a connection in `needs_reconnect`, or\n * a pending cleanup that needs one, is authorized again.\n * `POST /checkout-domains/{hostId}/cloudflare/oauth/start`\n */\n async startCloudflareOAuth(hostId: string): Promise<CloudflareOAuthStart> {\n return this.request('POST', hostPath(hostId, '/cloudflare/oauth/start'));\n }\n\n /**\n * Finish \"Connect with Cloudflare\": pass the `code` and `state` from the\n * redirect unchanged. The grant is checked and the records are made in\n * the granted zone that holds the address; the answer is that address.\n * The same person who started it must finish it, and a `state` works\n * once.\n *\n * A refusal throws a `DelopayError` with `code` `IR_16` and the\n * reason in `data.reason` (`error.data?.reason`), among them\n * `cloudflare_oauth_state_invalid` (unknown, used, expired or another\n * person's: start again), `cloudflare_oauth_rejected`,\n * `cloudflare_oauth_misconfigured`, `cloudflare_scopes_missing`\n * (`data.missing` lists them), `cloudflare_zone_mismatch` and\n * `cloudflare_connect_in_progress`.\n * `POST /checkout-domains/cloudflare/oauth/callback`\n */\n async finishCloudflareOAuth(params: CloudflareOAuthCallback): Promise<MerchantCheckoutHost> {\n return this.request('POST', '/checkout-domains/cloudflare/oauth/callback', { body: params });\n }\n\n /**\n * Forget a Cloudflare connection. The records it made stay in the zone.\n * `DELETE /checkout-domains/cloudflare/{connectionId}`\n */\n async disconnectCloudflare(connectionId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/checkout-domains/cloudflare/${encodeURIComponent(connectionId)}`,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-OAEKP665.cjs","../src/resources/checkoutDomains.ts"],"names":[],"mappings":"AAAA;ACsBA,SA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;AAAA;AAAA;AAAA;AAQ8C,EAAA;AACS,IAAA;AACvD,EAAA;AAAA;AAAA;AAAA;AAAA;AAMgF,EAAA;AACnD,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsD,EAAA;AACzB,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWiC,EAAA;AACc,IAAA;AAC/C,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY0E,EAAA;AAC3B,IAAA;AAC/C,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkB4F,EAAA;AAC9D,IAAA;AAC9B,EAAA;AAAA;AAAA;AAAA;AAAA;AAMgE,EAAA;AAClD,IAAA;AACV,MAAA;AACmD,MAAA;AACrD,IAAA;AACF,EAAA;AACF;AD7DyD;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-OAEKP665.cjs","sourcesContent":[null,"import type {\n CheckoutDomainAlerts,\n CheckoutDomainAvailabilityQuery,\n CheckoutDomainAvailabilityResponse,\n CheckoutHostPauseRequest,\n CheckoutHostPreview,\n CheckoutHostUpdateRequest,\n CheckoutHostVerification,\n CloudflareOAuthCallback,\n CloudflareOAuthStart,\n MerchantApplePayFiles,\n MerchantCheckoutDomains,\n MerchantCheckoutHost,\n MerchantCheckoutHostCreate,\n MerchantCloudflareConnect,\n MerchantHostHealth,\n MerchantHostShopsRequest,\n RemovedCheckoutHost,\n ShopCheckoutHost,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nfunction hostPath(hostId: string, rest = ''): string {\n return `/checkout-domains/${encodeURIComponent(hostId)}${rest}`;\n}\n\n/**\n * Checkout domains: the addresses a merchant's hosted checkout answers on\n * besides the platform's default one. An address is a name on the platform's\n * domain (`checkout-yourshop.example.net`) or a subdomain of the merchant's\n * own domain (`checkout.yourshop.com`, set up with DNS records or a\n * Cloudflare token). Shops are assigned to an address; their new payment\n * links open there once it is ready.\n *\n * Every route needs a dashboard session. Reading needs the checkout domains\n * area at `Read`; adding, changing and removing need `Write`, which only a\n * merchant-level role holds. DeloPay turns the feature on per merchant, with\n * a limit (`entitlement` on `list()`).\n */\nexport class CheckoutDomains {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The entitlement, every address with its setup and health, how new\n * subdomains are spelled, where own domains point, the default origin, and\n * the merchant's Cloudflare connections.\n * `GET /checkout-domains`\n */\n async list(): Promise<MerchantCheckoutDomains> {\n return this.request('GET', '/checkout-domains');\n }\n\n /**\n * Whether an address can be added. Reserves nothing; the answer also names\n * a free platform name like the one asked for, and the DNS provider read\n * from an own domain's nameservers.\n * `GET /checkout-domains/availability`\n */\n async availability(\n query: CheckoutDomainAvailabilityQuery,\n ): Promise<CheckoutDomainAvailabilityResponse> {\n return this.request('GET', '/checkout-domains/availability', { query });\n }\n\n /**\n * Add an address. It starts `setting_up`; a repeat for an address the\n * merchant already has answers with that address.\n * `POST /checkout-domains`\n */\n async create(params: MerchantCheckoutHostCreate): Promise<MerchantCheckoutHost> {\n return this.request('POST', '/checkout-domains', { body: params });\n }\n\n /** One address. Another merchant's id answers 404. `GET /checkout-domains/{hostId}` */\n async retrieve(hostId: string): Promise<MerchantCheckoutHost> {\n return this.request('GET', hostPath(hostId));\n }\n\n /**\n * Change an address: the Apple Pay file it serves (`null` serves none) and\n * whether new links fall back to the default address while it is down.\n * What is left out stays as it is. Refusal: `file_unknown`.\n * `PATCH /checkout-domains/{hostId}`\n */\n async update(hostId: string, params: CheckoutHostUpdateRequest): Promise<MerchantCheckoutHost> {\n return this.request('PATCH', hostPath(hostId), { body: params });\n }\n\n /**\n * Remove an address; its shops go back to the default address for new\n * links. A platform subdomain becomes `retiring`: it takes no new links,\n * keeps serving links already sent until `retire_after`, then frees its\n * name. An own domain is removed in two steps: it must stop taking traffic\n * first (pause it; `removable_after` on the address says when the drain is\n * over), and links already sent stop working once its DNS points elsewhere.\n * Refusals (`code` `IR_16`, `data.reason`): `host_takes_traffic` (still takes new\n * traffic; pause it first), `host_draining` (stopped moments ago;\n * `retry_after_seconds`), `host_in_use` (`payment_ids` of open payments that\n * can still come back to it) and `host_changed` (it changed while being\n * removed; read it again).\n * `DELETE /checkout-domains/{hostId}`\n */\n async remove(hostId: string): Promise<RemovedCheckoutHost> {\n return this.request('DELETE', hostPath(hostId));\n }\n\n /**\n * The address's health page: uptime, days, incidents, the latest\n * transitions, usage, and who was told about its events.\n * `GET /checkout-domains/{hostId}/health`\n */\n async health(hostId: string): Promise<MerchantHostHealth> {\n return this.request('GET', hostPath(hostId, '/health'));\n }\n\n /**\n * A signed link that renders a sample checkout on the address, without a\n * payment. Valid for ten minutes.\n * `POST /checkout-domains/{hostId}/preview`\n */\n async preview(hostId: string): Promise<CheckoutHostPreview> {\n return this.request('POST', hostPath(hostId, '/preview'));\n }\n\n /**\n * Pause the address: new links fall back to the default address, open\n * payments keep loading, and no alerts are sent. It resumes at `resume_at`,\n * or when resumed. Refusals: `pause_note_invalid`, `resume_at_past`.\n * `POST /checkout-domains/{hostId}/pause`\n */\n async pause(\n hostId: string,\n params: CheckoutHostPauseRequest = {},\n ): Promise<MerchantCheckoutHost> {\n return this.request('POST', hostPath(hostId, '/pause'), { body: params });\n }\n\n /**\n * Resume a paused address.\n * `DELETE /checkout-domains/{hostId}/pause`\n */\n async resume(hostId: string): Promise<MerchantCheckoutHost> {\n return this.request('DELETE', hostPath(hostId, '/pause'));\n }\n\n /**\n * The DNS records an own domain needs (where it points, and the TXT record\n * proving the domain), whether each was found, and what the hostname\n * resolves to today.\n * `GET /checkout-domains/{hostId}/verification`\n */\n async verification(hostId: string): Promise<CheckoutHostVerification> {\n return this.request('GET', hostPath(hostId, '/verification'));\n }\n\n /**\n * Run the address's check now instead of waiting for the next one.\n * Rate-limited per address.\n * `POST /checkout-domains/{hostId}/check`\n */\n async check(hostId: string): Promise<MerchantCheckoutHost> {\n return this.request('POST', hostPath(hostId, '/check'));\n }\n\n /**\n * The whole list of shops whose new links use the address. A shop uses one\n * address at a time, so a listed shop moves off any other address of the\n * merchant. An address still setting up may take shops; their links switch\n * once it is ready.\n * `PUT /checkout-domains/{hostId}/shops`\n */\n async setShops(hostId: string, params: MerchantHostShopsRequest): Promise<MerchantCheckoutHost> {\n return this.request('PUT', hostPath(hostId, '/shops'), { body: params });\n }\n\n /**\n * Which address one shop's new links use; `host_id: null` puts the shop\n * back on the default address. Links switch once the address is ready.\n * `PUT /checkout-domains/shops/{profileId}`\n */\n async setShopHost(profileId: string, params: ShopCheckoutHost): Promise<ShopCheckoutHost> {\n return this.request('PUT', `/checkout-domains/shops/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n\n /**\n * How checkout address events are told: each event with bell and email,\n * the recipients (members who may manage checkout domains, or chosen\n * members) and the addresses (all or chosen). Suspensions are always told.\n * `GET /checkout-domains/alerts`\n */\n async alerts(): Promise<CheckoutDomainAlerts> {\n return this.request('GET', '/checkout-domains/alerts');\n }\n\n /**\n * Save how checkout address events are told.\n * `PUT /checkout-domains/alerts`\n */\n async updateAlerts(params: CheckoutDomainAlerts): Promise<CheckoutDomainAlerts> {\n return this.request('PUT', '/checkout-domains/alerts', { body: params });\n }\n\n /**\n * The Apple Pay verification files an address may serve: the built-in ones\n * and the platform's uploads.\n * `GET /checkout-domains/apple-pay-files`\n */\n async applePayFiles(): Promise<MerchantApplePayFiles> {\n return this.request('GET', '/checkout-domains/apple-pay-files');\n }\n\n /**\n * Connect the merchant's Cloudflare to an own domain: the token must reach\n * exactly that domain's zone, with DNS edit. The records are created\n * through it; the token is stored encrypted and never returned.\n * `POST /checkout-domains/{hostId}/cloudflare`\n */\n async connectCloudflare(\n hostId: string,\n params: MerchantCloudflareConnect,\n ): Promise<MerchantCheckoutHost> {\n return this.request('POST', hostPath(hostId, '/cloudflare'), { body: params });\n }\n\n /**\n * Start \"Connect with Cloudflare\" (OAuth) for an own domain, instead of\n * pasting a token. Send the person to `authorize_url`; Cloudflare sends\n * them back to the deployment's redirect URI with `code` and `state`,\n * which go to {@link finishCloudflareOAuth} before `expires_at`. Offered\n * only while `list()` says `cloudflare_oauth_available`; otherwise refused\n * with `cloudflare_oauth_unavailable`. Also how a connection in `needs_reconnect`, or\n * a pending cleanup that needs one, is authorized again.\n * `POST /checkout-domains/{hostId}/cloudflare/oauth/start`\n */\n async startCloudflareOAuth(hostId: string): Promise<CloudflareOAuthStart> {\n return this.request('POST', hostPath(hostId, '/cloudflare/oauth/start'));\n }\n\n /**\n * Finish \"Connect with Cloudflare\": pass the `code` and `state` from the\n * redirect unchanged. The grant is checked and the records are made in\n * the granted zone that holds the address; the answer is that address.\n * The same person who started it must finish it, and a `state` works\n * once.\n *\n * A refusal throws a `DelopayError` with `code` `IR_16` and the\n * reason in `data.reason` (`error.data?.reason`), among them\n * `cloudflare_oauth_state_invalid` (unknown, used, expired or another\n * person's: start again), `cloudflare_oauth_rejected`,\n * `cloudflare_oauth_misconfigured`, `cloudflare_scopes_missing`\n * (`data.missing` lists them), `cloudflare_zone_mismatch` and\n * `cloudflare_connect_in_progress`.\n * `POST /checkout-domains/cloudflare/oauth/callback`\n */\n async finishCloudflareOAuth(params: CloudflareOAuthCallback): Promise<MerchantCheckoutHost> {\n return this.request('POST', '/checkout-domains/cloudflare/oauth/callback', { body: params });\n }\n\n /**\n * Forget a Cloudflare connection. The records it made stay in the zone.\n * `DELETE /checkout-domains/cloudflare/{connectionId}`\n */\n async disconnectCloudflare(connectionId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/checkout-domains/cloudflare/${encodeURIComponent(connectionId)}`,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-ODPNVNYE.cjs","../src/resources/support.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACUA,IAAM,KAAA,EAAO,CAAC,EAAA,EAAA,GAAuB,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAShE;AAC8B,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAG8B,EAAA;AAChB,IAAA;AAChE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOuE,EAAA;AAChB,IAAA;AACE,MAAA;AACtD,IAAA;AACH,EAAA;AAAA;AAG6D,EAAA;AACxB,IAAA;AACrC,EAAA;AAAA;AAGsF,EAAA;AACjC,IAAA;AACG,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAGiF,EAAA;AACnB,IAAA;AAC9D,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAakC,EAAA;AACN,IAAA;AACoB,IAAA;AACM,IAAA;AACb,IAAA;AACwB,IAAA;AACjE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOoE,EAAA;AACZ,IAAA;AACtC,MAAA;AACf,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO6D,EAAA;AACb,IAAA;AAChD,EAAA;AACF;AD3BoE;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-ODPNVNYE.cjs","sourcesContent":[null,"import type {\n SupportAttachmentView,\n SupportConversationCreate,\n SupportConversationList,\n SupportConversationView,\n SupportListQuery,\n SupportMessageCreate,\n SupportMessageList,\n SupportMessagesQuery,\n SupportMessageView,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\nconst path = (id: string): string => `/support/conversations/${encodeURIComponent(id)}`;\n\n/**\n * Conversations between a merchant and DeloPay's support team.\n *\n * Every route answers 404 while support is not available on the deployment, so\n * a 404 on {@link Support.list} means there is nothing to show. A member of a\n * shop reads the conversations they started and those linked to their shop.\n */\nexport class Support {\n constructor(private readonly request: RequestFn) {}\n\n /** Start a conversation with its first message. `POST /support/conversations` */\n async create(body: SupportConversationCreate): Promise<SupportConversationView> {\n return this.request('POST', '/support/conversations', { body });\n }\n\n /**\n * The conversations the caller may read, the latest message first unless\n * `sort_by` says otherwise. Several `kind`, `category` or `status` values\n * match a conversation with any of them. `GET /support/conversations`\n */\n async list(query?: SupportListQuery): Promise<SupportConversationList> {\n return this.request('GET', '/support/conversations', {\n query: csvQuery(query, ['kind', 'category', 'status']),\n });\n }\n\n /** One conversation. `GET /support/conversations/{id}` */\n async retrieve(id: string): Promise<SupportConversationView> {\n return this.request('GET', path(id));\n }\n\n /** A conversation's messages. `GET /support/conversations/{id}/messages` */\n async messages(id: string, query?: SupportMessagesQuery): Promise<SupportMessageList> {\n return this.request('GET', `${path(id)}/messages`, {\n query: query === undefined ? undefined : { ...query },\n });\n }\n\n /** Answer in a conversation. `POST /support/conversations/{id}/messages` */\n async reply(id: string, body: SupportMessageCreate): Promise<SupportMessageView> {\n return this.request('POST', `${path(id)}/messages`, { body });\n }\n\n /**\n * Upload a file for a message. PNG, JPEG, WebP, PDF, text, MP4 or WebM, read from the\n * content; 10 MB, a video 25 MB. It belongs to the caller until a message names it in\n * `attachments`. Uploading again with the same `clientUploadId` returns the same file.\n * `POST /support/conversations/{id}/attachments`\n */\n async uploadAttachment(\n id: string,\n file: Blob,\n clientUploadId: string,\n fileName?: string,\n ): Promise<SupportAttachmentView> {\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', `${path(id)}/attachments`, { body: form });\n }\n\n /**\n * Fetch a file once its scan is clean. Refused with `support_attachment_checking` while\n * the scan runs, and `support_attachment_blocked` after a block.\n * `GET /support/conversations/{id}/attachments/{fileId}`\n */\n async downloadAttachment(id: string, fileId: string): Promise<Blob> {\n return this.request('GET', `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {\n responseType: 'blob',\n });\n }\n\n /**\n * Clear the merchant's unread mark and read the conversation as it is now.\n * Someone acting as somebody else leaves the mark in place.\n * `POST /support/conversations/{id}/read`\n */\n async markRead(id: string): Promise<SupportConversationView> {\n return this.request('POST', `${path(id)}/read`);\n }\n}\n"]}
|
|
@@ -15,6 +15,41 @@ var Shopify = class {
|
|
|
15
15
|
async retrieveConnection(profileId, options) {
|
|
16
16
|
return this.request("GET", `/shopify/connections/${encodeURIComponent(profileId)}`, options);
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The caller's stores with their payment mode: one per shop at most, and
|
|
20
|
+
* only its own shop's for a shop-bound key or a shop-scoped role. Never
|
|
21
|
+
* returns a secret or a token.
|
|
22
|
+
*
|
|
23
|
+
* `GET /shopify/connections`
|
|
24
|
+
*/
|
|
25
|
+
async listConnections(options) {
|
|
26
|
+
return this.request("GET", "/shopify/connections", options);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Switch the store between live and test payments. To `test`,
|
|
30
|
+
* `confirm_shop_domain` must be the store's address exactly as the
|
|
31
|
+
* connection shows it, and a payment provider of the shop must be able to
|
|
32
|
+
* take a test payment (`test_payments_available`; 422 otherwise). In test,
|
|
33
|
+
* storefront checkouts started from then on make test payments, and their
|
|
34
|
+
* Shopify orders are tagged `<brand> TEST` (such as `DeloPay TEST`) and
|
|
35
|
+
* must not be fulfilled. That holds only once the whole deployment serves
|
|
36
|
+
* test mode (every API server, the storefront script and the order sync):
|
|
37
|
+
* a deployment still mid-rollout can make a live payment or an untagged
|
|
38
|
+
* order, so switch only once the deployment has finished rolling it out.
|
|
39
|
+
* Back to `live` needs no typed address. Asking for the mode the store is
|
|
40
|
+
* already in changes nothing. A switch made by someone else meanwhile is
|
|
41
|
+
* refused with 412. A storefront checkout already started keeps the mode it
|
|
42
|
+
* began in; the storefront shows the change within about a minute.
|
|
43
|
+
*
|
|
44
|
+
* `POST /shopify/connections/{profileId}/payment_mode`
|
|
45
|
+
*/
|
|
46
|
+
async updatePaymentMode(profileId, params, options) {
|
|
47
|
+
return this.request(
|
|
48
|
+
"POST",
|
|
49
|
+
`/shopify/connections/${encodeURIComponent(profileId)}/payment_mode`,
|
|
50
|
+
{ ...options, body: params }
|
|
51
|
+
);
|
|
52
|
+
}
|
|
18
53
|
/**
|
|
19
54
|
* Save the app's keys and get the Shopify page the merchant approves the app
|
|
20
55
|
* on. Refused while the shop is connected (412), except to approve again in
|
|
@@ -100,4 +135,4 @@ var Shopify = class {
|
|
|
100
135
|
export {
|
|
101
136
|
Shopify
|
|
102
137
|
};
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
138
|
+
//# sourceMappingURL=chunk-OEREK6NU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/resources/shopify.ts"],"sourcesContent":["import type {\n ShopifyConnectRequest,\n ShopifyConnectResponse,\n ShopifyConnection,\n ShopifyConnectionList,\n ShopifyConnectionResponse,\n ShopifyPaymentModeUpdate,\n ShopifySettingsUpdate,\n ShopifySyncEvent,\n ShopifySyncEventsQuery,\n ShopifySyncEventsResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's link to the merchant's Shopify store: the merchant creates an app\n * in their own Shopify account, saves its keys here, approves it in Shopify,\n * and the storefront script sends the store's buyers to this shop's hosted\n * checkout. Every route names the shop by its profile id.\n *\n * Reading the connections, the sync log and its retry, and switching the\n * payment mode, take an API key or a dashboard session; a session needs the\n * shop's Read permission to read and its Write to retry or switch. Connecting, changing the settings and disconnecting take\n * a signed-in dashboard session only, never an API key, with the shop's Write\n * permission. A key or role pinned to another shop, or a checkout template's\n * profile, is refused as unknown (404). No answer carries the app's client\n * secret or the store's access token.\n */\nexport class Shopify {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The shop's connection, if any, with the storefront's last reports, and\n * what the merchant's app must list (redirect URL, access scopes). Takes an\n * API key or a dashboard session with the shop's Read permission; a server\n * that predates API-key access refuses a key with 401. Read-only: never\n * returns a secret or a token.\n *\n * `GET /shopify/connections/{profileId}`\n */\n async retrieveConnection(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ShopifyConnectionResponse> {\n return this.request('GET', `/shopify/connections/${encodeURIComponent(profileId)}`, options);\n }\n\n /**\n * The caller's stores with their payment mode: one per shop at most, and\n * only its own shop's for a shop-bound key or a shop-scoped role. Never\n * returns a secret or a token.\n *\n * `GET /shopify/connections`\n */\n async listConnections(options?: RequestExtras): Promise<ShopifyConnectionList> {\n return this.request('GET', '/shopify/connections', options);\n }\n\n /**\n * Switch the store between live and test payments. To `test`,\n * `confirm_shop_domain` must be the store's address exactly as the\n * connection shows it, and a payment provider of the shop must be able to\n * take a test payment (`test_payments_available`; 422 otherwise). In test,\n * storefront checkouts started from then on make test payments, and their\n * Shopify orders are tagged `<brand> TEST` (such as `DeloPay TEST`) and\n * must not be fulfilled. That holds only once the whole deployment serves\n * test mode (every API server, the storefront script and the order sync):\n * a deployment still mid-rollout can make a live payment or an untagged\n * order, so switch only once the deployment has finished rolling it out.\n * Back to `live` needs no typed address. Asking for the mode the store is\n * already in changes nothing. A switch made by someone else meanwhile is\n * refused with 412. A storefront checkout already started keeps the mode it\n * began in; the storefront shows the change within about a minute.\n *\n * `POST /shopify/connections/{profileId}/payment_mode`\n */\n async updatePaymentMode(\n profileId: string,\n params: ShopifyPaymentModeUpdate,\n options?: RequestExtras,\n ): Promise<ShopifyConnection> {\n return this.request(\n 'POST',\n `/shopify/connections/${encodeURIComponent(profileId)}/payment_mode`,\n { ...options, body: params },\n );\n }\n\n /**\n * Save the app's keys and get the Shopify page the merchant approves the app\n * on. Refused while the shop is connected (412), except to approve again in\n * place: when the connection's `authorization_expired` is `true`, saving the\n * same store's keys for the same app (same `shop_domain` and `client_id`)\n * starts a new approval while the store stays connected with its settings\n * and script. Saving the keys renews nothing by itself: the merchant must\n * open the returned `authorize_url` and approve the app again, so neither a\n * successful call nor the `connected` status proves the approval is done;\n * `authorization_expired` turns `false` once it is. Refused when the store\n * is connected to another shop (409).\n *\n * `PUT /shopify/connections/{profileId}`\n */\n async connect(\n profileId: string,\n params: ShopifyConnectRequest,\n options?: RequestExtras,\n ): Promise<ShopifyConnectResponse> {\n return this.request('PUT', `/shopify/connections/${encodeURIComponent(profileId)}`, {\n ...options,\n body: params,\n });\n }\n\n /**\n * Change the storefront settings: the takeover switch, the mode, the\n * appearance, the accepted terms. Switching the takeover on needs an\n * approved connection, and in `skip_checkout` mode the accepted terms\n * (412 otherwise).\n *\n * `PATCH /shopify/connections/{profileId}`\n */\n async updateSettings(\n profileId: string,\n params: ShopifySettingsUpdate,\n options?: RequestExtras,\n ): Promise<ShopifyConnection> {\n return this.request('PATCH', `/shopify/connections/${encodeURIComponent(profileId)}`, {\n ...options,\n body: params,\n });\n }\n\n /**\n * Disconnect the store. Buyers go back to Shopify checkout at once, and the\n * stored keys are wiped.\n *\n * `DELETE /shopify/connections/{profileId}`\n */\n async disconnect(profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/shopify/connections/${encodeURIComponent(profileId)}`, options);\n }\n\n /**\n * The shop's recent syncs with its store, newest first: the order of each\n * paid storefront payment, refunds in both directions, dispute flags and\n * webhook registrations. A `held` or `failed` entry was told to the\n * merchant; a `pending` one with a `reason` is retrying by itself. For the\n * next page, pass the answer's `next_cursor` as `cursor` with the same\n * filters; it is set on every full page and absent on a short one. Never\n * page by the oldest `created_at` as `before`: that skips entries sharing\n * its time.\n *\n * `GET /shopify/connections/{profileId}/sync_events`\n */\n async listSyncEvents(\n profileId: string,\n query?: ShopifySyncEventsQuery,\n options?: RequestExtras,\n ): Promise<ShopifySyncEventsResponse> {\n return this.request(\n 'GET',\n `/shopify/connections/${encodeURIComponent(profileId)}/sync_events`,\n {\n ...options,\n query: { ...query },\n },\n );\n }\n\n /**\n * Run a failed, held or waiting sync again within a minute, as a first\n * attempt would: a held order whose total still differs from what was paid\n * is held again. Never makes a second order or a second refund. An entry\n * that cannot be retried answers 404.\n *\n * `POST /shopify/connections/{profileId}/sync_events/{eventId}/retry`\n */\n async retrySyncEvent(\n profileId: string,\n eventId: string,\n options?: RequestExtras,\n ): Promise<ShopifySyncEvent> {\n return this.request(\n 'POST',\n `/shopify/connections/${encodeURIComponent(profileId)}/sync_events/${encodeURIComponent(eventId)}/retry`,\n options,\n );\n }\n}\n"],"mappings":";AA4BO,IAAM,UAAN,MAAc;AAAA,EACnB,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWlD,MAAM,mBACJ,WACA,SACoC;AACpC,WAAO,KAAK,QAAQ,OAAO,wBAAwB,mBAAmB,SAAS,CAAC,IAAI,OAAO;AAAA,EAC7F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,gBAAgB,SAAyD;AAC7E,WAAO,KAAK,QAAQ,OAAO,wBAAwB,OAAO;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBA,MAAM,kBACJ,WACA,QACA,SAC4B;AAC5B,WAAO,KAAK;AAAA,MACV;AAAA,MACA,wBAAwB,mBAAmB,SAAS,CAAC;AAAA,MACrD,EAAE,GAAG,SAAS,MAAM,OAAO;AAAA,IAC7B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,MAAM,QACJ,WACA,QACA,SACiC;AACjC,WAAO,KAAK,QAAQ,OAAO,wBAAwB,mBAAmB,SAAS,CAAC,IAAI;AAAA,MAClF,GAAG;AAAA,MACH,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,eACJ,WACA,QACA,SAC4B;AAC5B,WAAO,KAAK,QAAQ,SAAS,wBAAwB,mBAAmB,SAAS,CAAC,IAAI;AAAA,MACpF,GAAG;AAAA,MACH,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,WAAW,WAAmB,SAAwC;AAC1E,WAAO,KAAK,QAAQ,UAAU,wBAAwB,mBAAmB,SAAS,CAAC,IAAI,OAAO;AAAA,EAChG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,eACJ,WACA,OACA,SACoC;AACpC,WAAO,KAAK;AAAA,MACV;AAAA,MACA,wBAAwB,mBAAmB,SAAS,CAAC;AAAA,MACrD;AAAA,QACE,GAAG;AAAA,QACH,OAAO,EAAE,GAAG,MAAM;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,eACJ,WACA,SACA,SAC2B;AAC3B,WAAO,KAAK;AAAA,MACV;AAAA,MACA,wBAAwB,mBAAmB,SAAS,CAAC,gBAAgB,mBAAmB,OAAO,CAAC;AAAA,MAChG;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-OG2KJAYD.cjs","../src/resources/availabilityOverrides.ts"],"names":[],"mappings":"AAAA;ACaO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,MAAA,CAAO,MAAA,EAAkF;AAC7F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,yBAAA,EAA2B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACzE;AAAA;AAAA,EAGA,MAAM,IAAA,CAAK,UAAA,EAA6D;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,yBAAA,EAA2B;AAAA,MACpD,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,MAAA,CAAO,EAAA,EAA8B;AACzC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,QAAA,EAAU,CAAA,wBAAA,EAA2B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AACjF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASuF,EAAA;AACvB,IAAA;AACrD,MAAA;AACe,QAAA;AACD,QAAA;AACiC,QAAA;AAAA;AAEW,QAAA;AACR,QAAA;AACzD,MAAA;AACD,IAAA;AACH,EAAA;AACF;ADboF;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-OG2KJAYD.cjs","sourcesContent":[null,"import type {\n AvailabilityOverrideCreateRequest,\n AvailabilityOverrideResponse,\n AvailabilityPreviewParams,\n AvailabilityPreviewResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Merchant payment-method availability overrides. Force-show or force-hide a\n * payment method per country/region at global, project, or shop scope, on top\n * of the curated country defaults. Admin (`sk_*`) access required.\n */\nexport class AvailabilityOverrides {\n constructor(private readonly request: RequestFn) {}\n\n /** Create an availability override. `POST /availability-overrides` */\n async create(params: AvailabilityOverrideCreateRequest): Promise<AvailabilityOverrideResponse> {\n return this.request('POST', '/availability-overrides', { body: params });\n }\n\n /** List a merchant's availability overrides. `GET /availability-overrides` */\n async list(merchantId: string): Promise<AvailabilityOverrideResponse[]> {\n return this.request('GET', '/availability-overrides', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Delete an availability override by id. `DELETE /availability-overrides/{id}` */\n async delete(id: string): Promise<boolean> {\n return this.request('DELETE', `/availability-overrides/${encodeURIComponent(id)}`);\n }\n\n /**\n * Preview the methods a customer in `country` would be shown for a shop —\n * the connector ceiling narrowed by the smart country defaults and the\n * merchant overrides, without an active payment. Pass `amount` + `currency`\n * to also evaluate order-value rules.\n * `GET /availability-overrides/preview`\n */\n async preview(params: AvailabilityPreviewParams): Promise<AvailabilityPreviewResponse> {\n return this.request('GET', '/availability-overrides/preview', {\n query: {\n merchant_id: params.merchant_id,\n profile_id: params.profile_id,\n ...(params.country ? { country: params.country } : {}),\n // `0` is a legitimate order value, so test for presence, not truthiness.\n ...(params.amount !== undefined ? { amount: params.amount } : {}),\n ...(params.currency ? { currency: params.currency } : {}),\n },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-OYZP6NF6.cjs","../src/resources/regions.ts"],"names":[],"mappings":"AAAA;ACeO,IAAM,QAAA,EAAN,MAAc;AAAA,EACnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,MAAA,CAAO,SAAA,EAAmB,MAAA,EAAsD;AACpF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,EAAY;AAAA,MACtC,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,EAAE,UAAA,EAAY,UAAU;AAAA,IACjC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,IAAA,CAAK,SAAA,EAA8C;AACvD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,eAAA,EAAiB,EAAE,KAAA,EAAO,EAAE,UAAA,EAAY,UAAU,EAAE,CAAC,CAAA;AAAA,EAClF;AAAA;AAAA,EAGA,MAAM,MAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iBAAiB,CAAA;AAAA,EAC9C;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,QAAA,EAAkB,SAAA,EAA4C;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAClC,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAO2B,EAAA;AAC0C,IAAA;AAC3D,MAAA;AACyB,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAGoE,EAAA;AACL,IAAA;AAC5B,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAG0F,EAAA;AACrB,IAAA;AAClC,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAOoC,EAAA;AACiC,IAAA;AAC3D,MAAA;AACyB,MAAA;AAChC,IAAA;AACH,EAAA;AACF;AD3BwE;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-OYZP6NF6.cjs","sourcesContent":[null,"import type {\n RegionCreateRequest,\n RegionUpdateRequest,\n RegionResponse,\n RegionSetCountriesRequest,\n RegionCountriesResponse,\n BuiltInRegionGroupResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Custom regions (named country groups) scoped to a shop/profile, used by the\n * geo-aware payment-method availability overrides. Every endpoint is scoped by\n * `profileId`. Admin (`sk_*`) access required.\n */\nexport class Regions {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a region. `POST /regions?profile_id=` */\n async create(profileId: string, params: RegionCreateRequest): Promise<RegionResponse> {\n return this.request('POST', '/regions', {\n body: params,\n query: { profile_id: profileId },\n });\n }\n\n /** List all regions for a profile. `GET /regions/list?profile_id=` */\n async list(profileId: string): Promise<RegionResponse[]> {\n return this.request('GET', '/regions/list', { query: { profile_id: profileId } });\n }\n\n /** List the built-in (global) region groups (EU/EEA/SEPA/LATAM/APAC). `GET /regions/groups` */\n async groups(): Promise<BuiltInRegionGroupResponse[]> {\n return this.request('GET', '/regions/groups');\n }\n\n /** Retrieve a region by id. `GET /regions/{regionId}?profile_id=` */\n async retrieve(regionId: string, profileId: string): Promise<RegionResponse> {\n return this.request('GET', `/regions/${encodeURIComponent(regionId)}`, {\n query: { profile_id: profileId },\n });\n }\n\n /** Update a region. `PUT /regions/{regionId}?profile_id=` */\n async update(\n regionId: string,\n profileId: string,\n params: RegionUpdateRequest,\n ): Promise<RegionResponse> {\n return this.request('PUT', `/regions/${encodeURIComponent(regionId)}`, {\n body: params,\n query: { profile_id: profileId },\n });\n }\n\n /** Delete a region. `DELETE /regions/{regionId}?profile_id=` */\n async delete(regionId: string, profileId: string): Promise<boolean> {\n return this.request('DELETE', `/regions/${encodeURIComponent(regionId)}`, {\n query: { profile_id: profileId },\n });\n }\n\n /** Get the countries that belong to a region. `GET /regions/{regionId}/countries?profile_id=` */\n async getCountries(regionId: string, profileId: string): Promise<RegionCountriesResponse> {\n return this.request('GET', `/regions/${encodeURIComponent(regionId)}/countries`, {\n query: { profile_id: profileId },\n });\n }\n\n /** Replace the full country membership of a region. `PUT /regions/{regionId}/countries?profile_id=` */\n async setCountries(\n regionId: string,\n profileId: string,\n params: RegionSetCountriesRequest,\n ): Promise<RegionCountriesResponse> {\n return this.request('PUT', `/regions/${encodeURIComponent(regionId)}/countries`, {\n body: params,\n query: { profile_id: profileId },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-P4UILJVU.cjs","../src/resources/payoutDestinations.ts"],"names":[],"mappings":"AAAA;ACoCO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,QAAA,CAAA,EAA0C;AAC9C,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EA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AACrC,MAAA;AACtB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW+B,EAAA;AACqD,IAAA;AACxD,MAAA;AACzB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQiF,EAAA;AACzB,IAAA;AACnB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOsD,EAAA;AACH,IAAA;AACnD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU8C,EAAA;AACqB,IAAA;AACxD,MAAA;AACR,IAAA;AACH,EAAA;AACF;AD1D4F;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-P4UILJVU.cjs","sourcesContent":[null,"import type {\n MyPayoutDestinations,\n MyRevenueShares,\n OfferedMethodsSettings,\n OfferedMethodsSettingsParams,\n OfferedMethodsUpdateParams,\n OfferedPayoutMethods,\n PayoutDestination,\n PayoutDestinationCreateParams,\n PayoutDestinationUpdateParams,\n RevealedPayoutDestination,\n RevenueShareDistributionsParams,\n RevenueShareDistributionsResponse,\n RevenueShareHolder,\n TeamPayoutDestination,\n TeamPayoutDestinations,\n TeamPayoutDestinationsParams,\n} from '../types';\nimport type { RequestFn } from '../client';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Payouts: how a merchant's team members want to be paid, and which methods\n * the merchant offers them. Nothing here moves money.\n *\n * Dashboard (JWT) routes only; no API key reaches them. The merchant, the\n * member and the shop come from the token. Keeping one's own details needs\n * the Payouts view permission (`ProfilePayoutDestinationRead`); the team's\n * details and the offered methods need Payouts manage\n * (`ProfilePayoutDestinationWrite`, `MerchantPayoutDestinationWrite` for the\n * merchant's list). A session acting as someone else (act-as, a support\n * switch) may read and may not change or reveal anything (403, `IR_22`). A\n * stale `version` or `expected_revision` answers 400 with `code` `IR_16` and\n * `data.reason: 'changed_elsewhere'`.\n */\nexport class PayoutDestinations {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The caller's own destinations, masked, and the methods offered to them.\n *\n * `GET /payout-destinations/me`\n */\n async listMine(): Promise<MyPayoutDestinations> {\n return this.request('GET', '/payout-destinations/me');\n }\n\n /**\n * Save a destination. The method must be offered; at most 20 per member.\n *\n * `POST /payout-destinations/me`\n */\n async createMine(params: PayoutDestinationCreateParams): Promise<PayoutDestination> {\n return this.request('POST', '/payout-destinations/me', { body: params });\n }\n\n /**\n * Replace a destination's details at the version read.\n *\n * `PUT /payout-destinations/me/{destinationId}`\n */\n async updateMine(\n destinationId: string,\n params: PayoutDestinationUpdateParams,\n ): Promise<PayoutDestination> {\n return this.request('PUT', `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {\n body: params,\n });\n }\n\n /**\n * Make a destination the preferred one; the others lose it.\n *\n * `POST /payout-destinations/me/{destinationId}/preferred`\n */\n async preferMine(destinationId: string, version: number): Promise<PayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/me/${encodeURIComponent(destinationId)}/preferred`,\n { body: { version } },\n );\n }\n\n /**\n * Delete a destination. Final: the history keeps who, when and which\n * fields, never a value.\n *\n * `DELETE /payout-destinations/me/{destinationId}?version=`\n */\n async deleteMine(destinationId: string, version: number): Promise<void> {\n await this.request('DELETE', `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {\n query: { version },\n });\n }\n\n /**\n * One's own destination in plain text. Recorded in the history first.\n *\n * `POST /payout-destinations/me/{destinationId}/reveal`\n */\n async revealMine(destinationId: string): Promise<RevealedPayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/me/${encodeURIComponent(destinationId)}/reveal`,\n );\n }\n\n /**\n * The methods offered to the caller.\n *\n * `GET /payout-destinations/methods`\n */\n async offeredMethods(): Promise<OfferedPayoutMethods> {\n return this.request('GET', '/payout-destinations/methods');\n }\n\n /**\n * The merchant's list and, with `shop_id`, one shop's. A shop role reads\n * its own shop only.\n *\n * `GET /payout-destinations/methods/settings`\n */\n async retrieveMethodsSettings(\n params?: OfferedMethodsSettingsParams,\n ): Promise<OfferedMethodsSettings> {\n return this.request('GET', '/payout-destinations/methods/settings', {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Set the methods offered at the merchant or at one shop.\n *\n * `PUT /payout-destinations/methods/settings`\n */\n async updateMethodsSettings(params: OfferedMethodsUpdateParams): Promise<OfferedMethodsSettings> {\n return this.request('PUT', '/payout-destinations/methods/settings', { body: params });\n }\n\n /**\n * The team's destinations the caller manages, masked: every member for a\n * merchant-level role, the members reaching the caller's shop for a shop\n * role.\n *\n * `GET /payout-destinations`\n */\n async listTeam(params?: TeamPayoutDestinationsParams): Promise<TeamPayoutDestinations> {\n return this.request('GET', '/payout-destinations', { query: params as Query | undefined });\n }\n\n /**\n * A managed member's destination in plain text. Recorded in the history\n * first.\n *\n * `POST /payout-destinations/{destinationId}/reveal`\n */\n async revealTeam(destinationId: string): Promise<RevealedPayoutDestination> {\n return this.request('POST', `/payout-destinations/${encodeURIComponent(destinationId)}/reveal`);\n }\n\n /**\n * Confirm a changed destination was seen, at the version read.\n *\n * `POST /payout-destinations/{destinationId}/acknowledge`\n */\n async acknowledgeTeam(destinationId: string, version: number): Promise<TeamPayoutDestination> {\n return this.request(\n 'POST',\n `/payout-destinations/${encodeURIComponent(destinationId)}/acknowledge`,\n { body: { version } },\n );\n }\n\n /**\n * Link a revenue-share holder to a team member, or unlink it (`null`). The\n * member must be an active member of the merchant whose role reads Payouts.\n *\n * `PUT /revenue-shares/holders/{holderId}/member`\n */\n async linkRevenueShareHolder(\n holderId: string,\n userId: string | null,\n ): Promise<RevenueShareHolder> {\n return this.request('PUT', `/revenue-shares/holders/${encodeURIComponent(holderId)}/member`, {\n body: { user_id: userId },\n });\n }\n\n /**\n * The merchant's revenue-share holders, each with the team member it is\n * linked to, if any.\n *\n * `GET /revenue-shares/holders?merchant_id={merchantId}`\n */\n async listRevenueShareHolders(merchantId: string): Promise<RevenueShareHolder[]> {\n return this.request('GET', '/revenue-shares/holders', {\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * The share terms of the holders linked to the caller. Read-only.\n *\n * `GET /revenue-shares/mine`\n */\n async listMyRevenueShares(): Promise<MyRevenueShares> {\n return this.request('GET', '/revenue-shares/mine');\n }\n\n /**\n * Frozen period-report distributions and open carry-over for the holders\n * linked to the caller. Live by default; read-only.\n *\n * `GET /revenue-shares/mine/distributions`\n */\n async listMyRevenueShareDistributions(\n params?: RevenueShareDistributionsParams,\n ): Promise<RevenueShareDistributionsResponse> {\n return this.request('GET', '/revenue-shares/mine/distributions', {\n query: params as Query | undefined,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-P7DYLUUI.cjs","../src/currencies.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,mBAAA,EAAqB;AAAA,EAChC,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAA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EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA;ADLA;AACA;AACE;AACF,gDAAC","file":"/tmp/publish-sdk-04860-w6/dist/chunk-P7DYLUUI.cjs","sourcesContent":[null,"import type { Currency } from './types';\n\n/**\n * Every currency the API accepts, in the order the API lists them. The same\n * set as the `Currency` type, for code that needs the list at runtime: a\n * currency picker, a condition builder, input validation.\n */\nexport const PAYMENT_CURRENCIES = [\n 'AED',\n 'AFN',\n 'ALL',\n 'AMD',\n 'ANG',\n 'AOA',\n 'ARS',\n 'AUD',\n 'AWG',\n 'AZN',\n 'BAM',\n 'BBD',\n 'BDT',\n 'BGN',\n 'BHD',\n 'BIF',\n 'BMD',\n 'BND',\n 'BOB',\n 'BRL',\n 'BSD',\n 'BTN',\n 'BWP',\n 'BYN',\n 'BZD',\n 'CAD',\n 'CDF',\n 'CHF',\n 'CLF',\n 'CLP',\n 'CNY',\n 'COP',\n 'CRC',\n 'CUC',\n 'CUP',\n 'CVE',\n 'CZK',\n 'DJF',\n 'DKK',\n 'DOP',\n 'DZD',\n 'EGP',\n 'ERN',\n 'ETB',\n 'EUR',\n 'FJD',\n 'FKP',\n 'GBP',\n 'GEL',\n 'GHS',\n 'GIP',\n 'GMD',\n 'GNF',\n 'GTQ',\n 'GYD',\n 'HKD',\n 'HNL',\n 'HRK',\n 'HTG',\n 'HUF',\n 'IDR',\n 'ILS',\n 'INR',\n 'IQD',\n 'IRR',\n 'ISK',\n 'JMD',\n 'JOD',\n 'JPY',\n 'KES',\n 'KGS',\n 'KHR',\n 'KMF',\n 'KPW',\n 'KRW',\n 'KWD',\n 'KYD',\n 'KZT',\n 'LAK',\n 'LBP',\n 'LKR',\n 'LRD',\n 'LSL',\n 'LYD',\n 'MAD',\n 'MDL',\n 'MGA',\n 'MKD',\n 'MMK',\n 'MNT',\n 'MOP',\n 'MRU',\n 'MUR',\n 'MVR',\n 'MWK',\n 'MXN',\n 'MYR',\n 'MZN',\n 'NAD',\n 'NGN',\n 'NIO',\n 'NOK',\n 'NPR',\n 'NZD',\n 'OMR',\n 'PAB',\n 'PEN',\n 'PGK',\n 'PHP',\n 'PKR',\n 'PLN',\n 'PYG',\n 'QAR',\n 'RON',\n 'RSD',\n 'RUB',\n 'RWF',\n 'SAR',\n 'SBD',\n 'SCR',\n 'SDG',\n 'SEK',\n 'SGD',\n 'SHP',\n 'SLE',\n 'SLL',\n 'SOS',\n 'SRD',\n 'SSP',\n 'STD',\n 'STN',\n 'SVC',\n 'SYP',\n 'SZL',\n 'THB',\n 'TJS',\n 'TMT',\n 'TND',\n 'TOP',\n 'TRY',\n 'TTD',\n 'TWD',\n 'TZS',\n 'UAH',\n 'UGX',\n 'USD',\n 'UYU',\n 'UZS',\n 'VES',\n 'VND',\n 'VUV',\n 'WST',\n 'XAF',\n 'XCD',\n 'XOF',\n 'XPF',\n 'YER',\n 'ZAR',\n 'ZMW',\n 'ZWL',\n] as const satisfies readonly Currency[];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/pub0484/delopay-typescript-sdk/dist/chunk-PKAE6AQT.cjs","../src/internal/resources/diagnostic.ts"],"names":[],"mappings":"AAAA;AC6DO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,SAAA,CAAU,IAAA,EAAqE;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,oCAAA,EAAsC,EAAE,IAAA,mBAAM,IAAA,UAAQ,CAAC,IAAE,CAAC,CAAA;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,oBAAA,CACJ,IAAA,EACoD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4CAAA,EAA8C;AAAA,MACxE,IAAA,mBAAM,IAAA,UAAQ,CAAC;AAAA,IACjB,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,kBAAA,CAAmB,OAAA,EAA2D;AAClF,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,2CAAA,EAA8C,kBAAA,CAAmB,OAAO,CAAC,CAAA;AAAA,IAAA;AAC3E,EAAA;AACF;AAAA,EAAA;AAME,IAAA;AAA0E,MAAA;AACzD,IAAA;AAChB,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAkF,MAAA;AACjE,IAAA;AAChB,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dist/chunk-PKAE6AQT.cjs","sourcesContent":[null,"import type {\n DiagnosticAttentionBoard,\n DiagnosticAttentionParams,\n DiagnosticChange,\n DiagnosticChangeListParams,\n DiagnosticConnectorCall,\n DiagnosticConnectorCallListParams,\n DiagnosticErrorCodeCount,\n DiagnosticFiringAlert,\n DiagnosticIncomingWebhook,\n DiagnosticIncomingWebhookDetail,\n DiagnosticIncomingWebhookListParams,\n DiagnosticInfrastructure,\n DiagnosticList,\n DiagnosticOutgoingWebhook,\n DiagnosticOutgoingWebhookListParams,\n DiagnosticOutgoingWebhookSummary,\n DiagnosticPanel,\n DiagnosticPayment,\n DiagnosticPaymentListParams,\n DiagnosticQueueItem,\n DiagnosticQueueListParams,\n DiagnosticQueueSummary,\n DiagnosticResolvedId,\n DiagnosticRevealRequest,\n DiagnosticRevealResponse,\n DiagnosticRouterLog,\n DiagnosticRouterLogParams,\n DiagnosticTrace,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * The diagnostic console — everything the router did, without a\n * shell.\n *\n * Cross-merchant by construction: one call answers across every merchant on the\n * deployment. The backend gates that on the `Diagnostic` permission, which is\n * granted to DeloPay's internal staff roles alone, which is why this lives in\n * `@delopay/sdk/internal` and never on the merchant-facing client.\n *\n * ## Two shapes worth knowing before you call anything\n *\n * **Lists answer {@link DiagnosticList}**, which carries `hidden_by_environment`\n * beside the rows. That number is what lets a UI say \"612 test-mode rows are\n * hidden\" rather than leaving an operator unable to tell an empty tab from a\n * filtered one.\n *\n * **Two reads answer {@link DiagnosticPanel} instead** — {@link routerLogs} and\n * {@link alerts} — because their sources can be down independently of the\n * router. A panel is `available` with data or `unavailable` with a reason, and\n * that distinction is the whole point: **an unreachable log store must never be\n * rendered as \"no errors found\"**, and a `T[]` gives a caller no way to tell the\n * two apart.\n *\n * ## The environment filter\n *\n * Every list takes `environment`. Omitting it is read by the backend as\n * `'live'`, never as `'all'` — a caller that forgot to say gets the safer of the\n * two, and a test payment never appears in a view that reads as live.\n */\nexport class Diagnostic {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The ranked attention board — the page's landing state, with nothing typed.\n *\n * Always carries `checks_run` and `vitals`, so an empty `items` reads as\n * \"checked these things at 14:02, all clear\" rather than as a panel that\n * failed to load. A check that could not run is **absent** from `checks_run`\n * rather than silently counted as clear.\n */\n async attention(body?: DiagnosticAttentionParams): Promise<DiagnosticAttentionBoard> {\n return this.request('POST', '/admin-portal/diagnostic/attention', { body: body ?? {} });\n }\n\n /**\n * Provider webhooks received, across every merchant.\n *\n * `source_verified: false` selects rows that failed verification **or** never\n * reached it — the deliveries that failed before verification was attempted\n * are exactly the ones an operator opens this tab for.\n */\n async listIncomingWebhooks(\n body?: DiagnosticIncomingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticIncomingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/incoming', {\n body: body ?? {},\n });\n }\n\n /**\n * One delivery in full: masked headers and body, the verification verdict,\n * and the router log lines for its request id.\n *\n * `router_logs` is `null` — not `[]` — when the log store is unreachable, and\n * `router_logs_unavailable` then says why. Render the first as *unavailable*,\n * never as \"the router logged nothing\".\n */\n async getIncomingWebhook(eventId: string): Promise<DiagnosticIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */\n async listOutgoingWebhooks(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticOutgoingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing', {\n body: body ?? {},\n });\n }\n\n /**\n * The four tiles above the shop-webhooks table.\n *\n * Counted under the same window and environment as the table but **without**\n * its delivery filter — the tiles say what the window holds, and applying the\n * filter would make every tile agree with whichever one is selected.\n */\n async outgoingWebhookSummary(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticOutgoingWebhookSummary> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing/summary', {\n body: body ?? {},\n });\n }\n\n /**\n * Connector calls the router made.\n *\n * List rows carry no payload. Fetch one with {@link getConnectorCall} for the\n * masked request and response.\n */\n async listConnectorCalls(\n body?: DiagnosticConnectorCallListParams,\n ): Promise<DiagnosticList<DiagnosticConnectorCall>> {\n return this.request('POST', '/admin-portal/diagnostic/connector-calls', { body: body ?? {} });\n }\n\n /** One connector call, with its masked payloads. */\n async getConnectorCall(id: string): Promise<DiagnosticConnectorCall> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`,\n );\n }\n\n /**\n * Router logs, proxied from the deployment's log store.\n *\n * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:\n * `'unavailable'` means the store did not answer, which is the opposite of\n * \"there were no errors\" and must be rendered as such.\n */\n async routerLogs(\n body?: DiagnosticRouterLogParams,\n ): Promise<DiagnosticPanel<DiagnosticList<DiagnosticRouterLog>>> {\n return this.request('POST', '/admin-portal/diagnostic/logs', { body: body ?? {} });\n }\n\n /**\n * Payments that are stuck or failed.\n *\n * Stuck means non-terminal for longer than `stuck_minutes`; failed means it\n * ended without succeeding inside the window. Omitting `stuck_minutes` turns\n * the first arm off rather than widening it.\n */\n async listPayments(\n body?: DiagnosticPaymentListParams,\n ): Promise<DiagnosticList<DiagnosticPayment>> {\n return this.request('POST', '/admin-portal/diagnostic/payments', { body: body ?? {} });\n }\n\n /**\n * The error codes in this window, each with its count in the previous window\n * of equal length.\n *\n * `previous_count: null` means the code did not appear before — render it as\n * \"new\" rather than as a fall to zero.\n */\n async paymentErrorCodes(body?: DiagnosticPaymentListParams): Promise<DiagnosticErrorCodeCount[]> {\n return this.request('POST', '/admin-portal/diagnostic/payments/error-codes', {\n body: body ?? {},\n });\n }\n\n /**\n * Everything about one payment, in one call: the payment, its attempts, its\n * status history, its client context, and what it produced — connector calls,\n * webhooks both ways, and scheduler jobs.\n *\n * Read `diagnostic_capture` before rendering an empty section. A payment with\n * no connector calls and a deployment that never recorded any are different\n * facts, and the second must not read as the first.\n *\n * Typed loosely on purpose: the payment, attempts, status-history and\n * client-context halves are the merchant-facing shapes this package already\n * exports, and re-declaring them here would give consumers two names for one\n * thing that could then drift apart.\n */\n async getPayment(paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Scheduler tasks, most overdue first. */\n async listQueues(body?: DiagnosticQueueListParams): Promise<DiagnosticList<DiagnosticQueueItem>> {\n return this.request('POST', '/admin-portal/diagnostic/queues', { body: body ?? {} });\n }\n\n /**\n * The four tiles above the queues table, plus the approvals count.\n *\n * `pending_approvals` is a **different** queue from `pending_count`: a stalled\n * scheduler needs a consumer, a full approvals queue needs a person, and\n * folding them into one number would point an operator at the wrong fix.\n */\n async queueSummary(): Promise<DiagnosticQueueSummary> {\n return this.request('GET', '/admin-portal/diagnostic/queues/summary');\n }\n\n /**\n * Replicas and their dependencies.\n *\n * `build_mismatch` is computed server-side rather than left for a caller to\n * notice by comparing strings: one replica in four answering differently\n * explains a whole class of \"it only fails sometimes\" incident, and is\n * invisible unless something says it out loud.\n */\n async infrastructure(): Promise<DiagnosticInfrastructure> {\n return this.request('GET', '/admin-portal/diagnostic/infrastructure');\n }\n\n /**\n * Firing alerts, proxied from Alertmanager.\n *\n * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}\n * does: a strip that renders empty because Alertmanager is down says \"nothing\n * is firing\", which is the most dangerous sentence this page could print.\n */\n async alerts(): Promise<DiagnosticPanel<DiagnosticFiringAlert[]>> {\n return this.request('GET', '/admin-portal/diagnostic/alerts');\n }\n\n /** Config edits and admin actions inside the window. */\n async listChanges(body?: DiagnosticChangeListParams): Promise<DiagnosticList<DiagnosticChange>> {\n return this.request('POST', '/admin-portal/diagnostic/changes', { body: body ?? {} });\n }\n\n /**\n * What a pasted id is, and whether we hold it.\n *\n * `kind` and `found` are separate answers on purpose. A well-shaped id that\n * matches nothing comes back `found: false` with the three `reasons` and\n * their fixes — render that, never an empty table, which reads as \"no such\n * payment\" when the real answer is \"outside the window\" or \"it is a test\n * payment\".\n */\n async resolveId(id: string): Promise<DiagnosticResolvedId> {\n return this.request('GET', `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);\n }\n\n /**\n * One id across every source, as an ordered span list.\n *\n * Accepts a payment, attempt, event or request id. Sources that could not be\n * read are named in `unavailable_sources` rather than left out: a waterfall\n * with an unexplained gap reads as a period when nothing happened.\n */\n async trace(id: string): Promise<DiagnosticTrace> {\n return this.request('GET', `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);\n }\n\n /**\n * Unmask one field of one object.\n *\n * **Writes an audit row** naming the operator, the field and the object,\n * before the value is returned — a reveal that could not be audited does not\n * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key\n * cannot call it, because an API key names no person.\n *\n * `reason` is required and is stored verbatim.\n */\n async reveal(body: DiagnosticRevealRequest): Promise<DiagnosticRevealResponse> {\n return this.request('POST', '/admin-portal/diagnostic/reveal', { body });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-PKAE6AQT.cjs","../src/internal/resources/diagnostic.ts"],"names":[],"mappings":"AAAA;AC6DO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,SAAA,CAAU,IAAA,EAAqE;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,oCAAA,EAAsC,EAAE,IAAA,mBAAM,IAAA,UAAQ,CAAC,IAAE,CAAC,CAAA;AAAA,EACxF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,oBAAA,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AA;AAUE,IAAA;AAAoE,EAAA;AACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAoE,EAAA;AACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAA4D,EAAA;AAC9D;AAAA,EAAA;AAIE,IAAA;AAAoF,EAAA;AACtF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAuF,EAAA;AACzF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAqF,EAAA;AACvF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAaE,IAAA;AAAuE,EAAA;AAE3E;ADxFA;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-PKAE6AQT.cjs","sourcesContent":[null,"import type {\n DiagnosticAttentionBoard,\n DiagnosticAttentionParams,\n DiagnosticChange,\n DiagnosticChangeListParams,\n DiagnosticConnectorCall,\n DiagnosticConnectorCallListParams,\n DiagnosticErrorCodeCount,\n DiagnosticFiringAlert,\n DiagnosticIncomingWebhook,\n DiagnosticIncomingWebhookDetail,\n DiagnosticIncomingWebhookListParams,\n DiagnosticInfrastructure,\n DiagnosticList,\n DiagnosticOutgoingWebhook,\n DiagnosticOutgoingWebhookListParams,\n DiagnosticOutgoingWebhookSummary,\n DiagnosticPanel,\n DiagnosticPayment,\n DiagnosticPaymentListParams,\n DiagnosticQueueItem,\n DiagnosticQueueListParams,\n DiagnosticQueueSummary,\n DiagnosticResolvedId,\n DiagnosticRevealRequest,\n DiagnosticRevealResponse,\n DiagnosticRouterLog,\n DiagnosticRouterLogParams,\n DiagnosticTrace,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * The diagnostic console — everything the router did, without a\n * shell.\n *\n * Cross-merchant by construction: one call answers across every merchant on the\n * deployment. The backend gates that on the `Diagnostic` permission, which is\n * granted to DeloPay's internal staff roles alone, which is why this lives in\n * `@delopay/sdk/internal` and never on the merchant-facing client.\n *\n * ## Two shapes worth knowing before you call anything\n *\n * **Lists answer {@link DiagnosticList}**, which carries `hidden_by_environment`\n * beside the rows. That number is what lets a UI say \"612 test-mode rows are\n * hidden\" rather than leaving an operator unable to tell an empty tab from a\n * filtered one.\n *\n * **Two reads answer {@link DiagnosticPanel} instead** — {@link routerLogs} and\n * {@link alerts} — because their sources can be down independently of the\n * router. A panel is `available` with data or `unavailable` with a reason, and\n * that distinction is the whole point: **an unreachable log store must never be\n * rendered as \"no errors found\"**, and a `T[]` gives a caller no way to tell the\n * two apart.\n *\n * ## The environment filter\n *\n * Every list takes `environment`. Omitting it is read by the backend as\n * `'live'`, never as `'all'` — a caller that forgot to say gets the safer of the\n * two, and a test payment never appears in a view that reads as live.\n */\nexport class Diagnostic {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The ranked attention board — the page's landing state, with nothing typed.\n *\n * Always carries `checks_run` and `vitals`, so an empty `items` reads as\n * \"checked these things at 14:02, all clear\" rather than as a panel that\n * failed to load. A check that could not run is **absent** from `checks_run`\n * rather than silently counted as clear.\n */\n async attention(body?: DiagnosticAttentionParams): Promise<DiagnosticAttentionBoard> {\n return this.request('POST', '/admin-portal/diagnostic/attention', { body: body ?? {} });\n }\n\n /**\n * Provider webhooks received, across every merchant.\n *\n * `source_verified: false` selects rows that failed verification **or** never\n * reached it — the deliveries that failed before verification was attempted\n * are exactly the ones an operator opens this tab for.\n */\n async listIncomingWebhooks(\n body?: DiagnosticIncomingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticIncomingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/incoming', {\n body: body ?? {},\n });\n }\n\n /**\n * One delivery in full: masked headers and body, the verification verdict,\n * and the router log lines for its request id.\n *\n * `router_logs` is `null` — not `[]` — when the log store is unreachable, and\n * `router_logs_unavailable` then says why. Render the first as *unavailable*,\n * never as \"the router logged nothing\".\n */\n async getIncomingWebhook(eventId: string): Promise<DiagnosticIncomingWebhookDetail> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/webhooks/incoming/${encodeURIComponent(eventId)}`,\n );\n }\n\n /** Shop webhooks sent, across every merchant, with each event's attempts folded in. */\n async listOutgoingWebhooks(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticList<DiagnosticOutgoingWebhook>> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing', {\n body: body ?? {},\n });\n }\n\n /**\n * The four tiles above the shop-webhooks table.\n *\n * Counted under the same window and environment as the table but **without**\n * its delivery filter — the tiles say what the window holds, and applying the\n * filter would make every tile agree with whichever one is selected.\n */\n async outgoingWebhookSummary(\n body?: DiagnosticOutgoingWebhookListParams,\n ): Promise<DiagnosticOutgoingWebhookSummary> {\n return this.request('POST', '/admin-portal/diagnostic/webhooks/outgoing/summary', {\n body: body ?? {},\n });\n }\n\n /**\n * Connector calls the router made.\n *\n * List rows carry no payload. Fetch one with {@link getConnectorCall} for the\n * masked request and response.\n */\n async listConnectorCalls(\n body?: DiagnosticConnectorCallListParams,\n ): Promise<DiagnosticList<DiagnosticConnectorCall>> {\n return this.request('POST', '/admin-portal/diagnostic/connector-calls', { body: body ?? {} });\n }\n\n /** One connector call, with its masked payloads. */\n async getConnectorCall(id: string): Promise<DiagnosticConnectorCall> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/connector-calls/${encodeURIComponent(id)}`,\n );\n }\n\n /**\n * Router logs, proxied from the deployment's log store.\n *\n * Answers a {@link DiagnosticPanel}. Check `status` before reading `data`:\n * `'unavailable'` means the store did not answer, which is the opposite of\n * \"there were no errors\" and must be rendered as such.\n */\n async routerLogs(\n body?: DiagnosticRouterLogParams,\n ): Promise<DiagnosticPanel<DiagnosticList<DiagnosticRouterLog>>> {\n return this.request('POST', '/admin-portal/diagnostic/logs', { body: body ?? {} });\n }\n\n /**\n * Payments that are stuck or failed.\n *\n * Stuck means non-terminal for longer than `stuck_minutes`; failed means it\n * ended without succeeding inside the window. Omitting `stuck_minutes` turns\n * the first arm off rather than widening it.\n */\n async listPayments(\n body?: DiagnosticPaymentListParams,\n ): Promise<DiagnosticList<DiagnosticPayment>> {\n return this.request('POST', '/admin-portal/diagnostic/payments', { body: body ?? {} });\n }\n\n /**\n * The error codes in this window, each with its count in the previous window\n * of equal length.\n *\n * `previous_count: null` means the code did not appear before — render it as\n * \"new\" rather than as a fall to zero.\n */\n async paymentErrorCodes(body?: DiagnosticPaymentListParams): Promise<DiagnosticErrorCodeCount[]> {\n return this.request('POST', '/admin-portal/diagnostic/payments/error-codes', {\n body: body ?? {},\n });\n }\n\n /**\n * Everything about one payment, in one call: the payment, its attempts, its\n * status history, its client context, and what it produced — connector calls,\n * webhooks both ways, and scheduler jobs.\n *\n * Read `diagnostic_capture` before rendering an empty section. A payment with\n * no connector calls and a deployment that never recorded any are different\n * facts, and the second must not read as the first.\n *\n * Typed loosely on purpose: the payment, attempts, status-history and\n * client-context halves are the merchant-facing shapes this package already\n * exports, and re-declaring them here would give consumers two names for one\n * thing that could then drift apart.\n */\n async getPayment(paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/admin-portal/diagnostic/payments/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Scheduler tasks, most overdue first. */\n async listQueues(body?: DiagnosticQueueListParams): Promise<DiagnosticList<DiagnosticQueueItem>> {\n return this.request('POST', '/admin-portal/diagnostic/queues', { body: body ?? {} });\n }\n\n /**\n * The four tiles above the queues table, plus the approvals count.\n *\n * `pending_approvals` is a **different** queue from `pending_count`: a stalled\n * scheduler needs a consumer, a full approvals queue needs a person, and\n * folding them into one number would point an operator at the wrong fix.\n */\n async queueSummary(): Promise<DiagnosticQueueSummary> {\n return this.request('GET', '/admin-portal/diagnostic/queues/summary');\n }\n\n /**\n * Replicas and their dependencies.\n *\n * `build_mismatch` is computed server-side rather than left for a caller to\n * notice by comparing strings: one replica in four answering differently\n * explains a whole class of \"it only fails sometimes\" incident, and is\n * invisible unless something says it out loud.\n */\n async infrastructure(): Promise<DiagnosticInfrastructure> {\n return this.request('GET', '/admin-portal/diagnostic/infrastructure');\n }\n\n /**\n * Firing alerts, proxied from Alertmanager.\n *\n * Answers a {@link DiagnosticPanel} for the same reason {@link routerLogs}\n * does: a strip that renders empty because Alertmanager is down says \"nothing\n * is firing\", which is the most dangerous sentence this page could print.\n */\n async alerts(): Promise<DiagnosticPanel<DiagnosticFiringAlert[]>> {\n return this.request('GET', '/admin-portal/diagnostic/alerts');\n }\n\n /** Config edits and admin actions inside the window. */\n async listChanges(body?: DiagnosticChangeListParams): Promise<DiagnosticList<DiagnosticChange>> {\n return this.request('POST', '/admin-portal/diagnostic/changes', { body: body ?? {} });\n }\n\n /**\n * What a pasted id is, and whether we hold it.\n *\n * `kind` and `found` are separate answers on purpose. A well-shaped id that\n * matches nothing comes back `found: false` with the three `reasons` and\n * their fixes — render that, never an empty table, which reads as \"no such\n * payment\" when the real answer is \"outside the window\" or \"it is a test\n * payment\".\n */\n async resolveId(id: string): Promise<DiagnosticResolvedId> {\n return this.request('GET', `/admin-portal/diagnostic/resolve/${encodeURIComponent(id)}`);\n }\n\n /**\n * One id across every source, as an ordered span list.\n *\n * Accepts a payment, attempt, event or request id. Sources that could not be\n * read are named in `unavailable_sources` rather than left out: a waterfall\n * with an unexplained gap reads as a period when nothing happened.\n */\n async trace(id: string): Promise<DiagnosticTrace> {\n return this.request('GET', `/admin-portal/diagnostic/trace/${encodeURIComponent(id)}`);\n }\n\n /**\n * Unmask one field of one object.\n *\n * **Writes an audit row** naming the operator, the field and the object,\n * before the value is returned — a reveal that could not be audited does not\n * happen. Needs a dashboard JWT holding `DiagnosticReveal`; an admin API key\n * cannot call it, because an API key names no person.\n *\n * `reason` is required and is stored verbatim.\n */\n async reveal(body: DiagnosticRevealRequest): Promise<DiagnosticRevealResponse> {\n return this.request('POST', '/admin-portal/diagnostic/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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkC8C,EAAA;AACkC,IAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4B4C,EAAA;AACqC,IAAA;AACtE,MAAA;AACJ,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsB8C,EAAA;AAChC,IAAA;AACV,MAAA;AACiE,MAAA;AACM,MAAA;AACzE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAekD,EAAA;AACpC,IAAA;AACV,MAAA;AACiE,MAAA;AACjE,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuB8C,EAAA;AAChC,IAAA;AACV,MAAA;AACiE,MAAA;AACO,MAAA;AAC1E,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBiD,EAAA;AAC8B,IAAA;AAC/E,EAAA;AACF;AD7JoF;AACA;AACA;AACA","file":"/tmp/pub0484/delopay-typescript-sdk/dist/chunk-PYNHK6AP.cjs","sourcesContent":[null,"import type {\n BuyerPortalSubscriptionCapabilities,\n NativeShopConfigRequest,\n NativeShopConfigResponse,\n NativeDunningConfigRequest,\n NativeDunningConfigResponse,\n AdoptSubscriptionRequest,\n AdoptSubscriptionResponse,\n CreateSubscriptionRequest,\n CreateAndConfirmSubscriptionRequest,\n ConfirmSubscriptionRequest,\n UpdateSubscriptionRequest,\n PauseSubscriptionRequest,\n ResumeSubscriptionRequest,\n CancelSubscriptionRequest,\n SubscriptionResponse,\n ConfirmSubscriptionResponse,\n PauseSubscriptionResponse,\n ResumeSubscriptionResponse,\n CancelSubscriptionResponse,\n GetSubscriptionItemsResponse,\n GetSubscriptionItemsParams,\n SubscriptionEstimateResponse,\n SubscriptionEstimateParams,\n SubscriptionListParams,\n SubscriptionPaymentLookupRequest,\n SubscriptionPaymentLookupResponse,\n SubscriptionInvoiceListParams,\n SubscriptionInvoiceListResponse,\n SubscriptionBillingProcessorResponse,\n SubscriptionImportApplyRequest,\n SubscriptionImportApplyResponse,\n SubscriptionImportPreviewRequest,\n SubscriptionImportPreviewResponse,\n SubscriptionItemsPage,\n SubscriptionSyncRequest,\n SubscriptionSyncResponse,\n SubscriptionSyncResult,\n SubscriptionInvoiceRefundConfirmRequest,\n SubscriptionInvoiceRefundListResponse,\n SubscriptionInvoiceRefundRequest,\n SubscriptionInvoiceRefundResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/**\n * Subscription endpoints are profile-scoped: the backend requires an\n * `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`\n * otherwise). Pass it through the per-call `options.headers`, e.g.\n * `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.\n */\nexport class Subscriptions {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */\n async getNativeConfig(options?: RequestExtras): Promise<NativeShopConfigResponse> {\n return this.request('GET', '/subscriptions/native/config', { ...options });\n }\n\n /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */\n async updateNativeConfig(\n params: NativeShopConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeShopConfigResponse> {\n return this.request('PUT', '/subscriptions/native/config', { body: params, ...options });\n }\n\n /** Read merchant-wide renewal recovery settings. */\n async getNativeDunning(options?: RequestExtras): Promise<NativeDunningConfigResponse> {\n return this.request('GET', '/subscriptions/native/dunning', { ...options });\n }\n\n async updateNativeDunning(\n params: NativeDunningConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeDunningConfigResponse> {\n return this.request('PUT', '/subscriptions/native/dunning', { body: params, ...options });\n }\n\n /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */\n async getCapabilities(\n subscriptionId: string,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionCapabilities> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,\n { ...options },\n );\n }\n\n /**\n * Create and immediately confirm a subscription. `POST /subscriptions`\n *\n * For billing processors that require buyer approval (e.g. PayPal), the\n * response carries a `redirect_url` the customer must be sent to.\n */\n async createAndConfirm(\n params: CreateAndConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', '/subscriptions', { body: params, ...options });\n }\n\n /** Create a subscription without confirming it. `POST /subscriptions/create` */\n async create(\n params: CreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('POST', '/subscriptions/create', { body: params, ...options });\n }\n\n /**\n * Adopt an existing Creem subscription. `POST /subscriptions/adopt`\n *\n * Requires adoption to be enabled on the deployment and `X-Profile-Id` in\n * options.headers. Adoption charges nothing and emits no invoice or webhook.\n * Repeating the processor subscription ID returns the existing DeloPay ID.\n * Retry when handoff_confirmed is false. That flag confirms persistence,\n * not the merchant's external switch-over: stop processing Creem events in\n * your own integration when handing subsequent events to DeloPay.\n */\n async adopt(\n params: AdoptSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<AdoptSubscriptionResponse> {\n return this.request('POST', '/subscriptions/adopt', { body: params, ...options });\n }\n\n /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */\n async retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}`, {\n ...options,\n });\n }\n\n /**\n * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`\n *\n * Like {@link createAndConfirm}, the response may carry a `redirect_url` for\n * processors that require buyer approval.\n */\n async confirm(\n subscriptionId: string,\n params: ConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async update(\n subscriptionId: string,\n params: UpdateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('PUT', `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List subscriptions for the profile, or one customer's with `customer_id`.\n * `GET /subscriptions/list`\n */\n async list(\n params?: SubscriptionListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse[]> {\n return this.request('GET', '/subscriptions/list', {\n query: csvQuery(params, ['profile_ids', 'industry']),\n ...options,\n });\n }\n\n /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */\n async getEstimate(\n params: SubscriptionEstimateParams,\n options?: RequestExtras,\n ): Promise<SubscriptionEstimateResponse> {\n return this.request('GET', '/subscriptions/estimate', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */\n async getItems(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/subscriptions/items', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * {@link getItems}, with whether the list is only the first part of what the\n * processor holds. `GET /subscriptions/items`\n *\n * The backend states that in the `X-Delopay-Items-Truncated` response\n * header (Stripe Billing lists its first 100 products), which the plain\n * {@link getItems} cannot return. Without `limit` and `offset` every item\n * the billing account offers is listed, up to 500.\n */\n async getItemsPage(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<SubscriptionItemsPage> {\n let truncated = false;\n const items = await this.request<GetSubscriptionItemsResponse[]>(\n 'GET',\n '/subscriptions/items',\n {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n onDownloadProgress: (event) => {\n // The headers arrive with the first event; a retried request reports\n // them again, and the last attempt is the one the items come from.\n truncated = event.headers.get('x-delopay-items-truncated')?.toLowerCase() === 'true';\n options?.onDownloadProgress?.(event);\n },\n },\n );\n return { items, truncated };\n }\n\n /**\n * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n *\n * The body defaults to `{}` so the request still carries\n * `Content-Type: application/json` even when no params are passed — the\n * backend rejects the POST otherwise (\"Unsupported content type\").\n */\n async pause(\n subscriptionId: string,\n params?: PauseSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<PauseSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async resume(\n subscriptionId: string,\n params?: ResumeSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ResumeSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel`\n *\n * A subscription in a state it cannot be cancelled from is refused with\n * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async cancel(\n subscriptionId: string,\n params?: CancelSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<CancelSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Read 1 to 50 subscriptions back from their billing processor and mirror\n * what it reports. `POST /subscriptions/sync`\n *\n * Nothing is written at the processor. A status is mirrored only with the\n * time the processor stamped it with, and never over a newer event already\n * recorded; a plan only with its own stamp. One result per id, in request\n * order; one that fails does not stop the others.\n */\n async sync(\n params: SubscriptionSyncRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionSyncResponse> {\n return this.request('POST', '/subscriptions/sync', { body: params, ...options });\n }\n\n /**\n * Read one subscription back from its billing processor and mirror what it\n * reports, as {@link sync} does, with what the processor reported beside\n * what the mirror now holds. `POST /subscriptions/{subscriptionId}/sync`\n */\n async syncOne(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionSyncResult> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/sync`, {\n ...options,\n });\n }\n\n /**\n * List the subscriptions a billing account holds at its processor, and how\n * each relates to DeloPay's: already held, new (its buyer is a DeloPay\n * customer), needing a customer, ended, or not adoptable here.\n * `POST /subscriptions/import/preview`\n *\n * Reads only; nothing is written here or at the processor. Creem and\n * Stripe Billing can be listed; PayPal cannot, which `capabilities` states\n * (`reason_code: 'listing_unsupported'`).\n */\n async importPreview(\n params: SubscriptionImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportPreviewResponse> {\n return this.request('POST', '/subscriptions/import/preview', { body: params, ...options });\n }\n\n /**\n * Take 1 to 25 processor subscriptions over, each through {@link adopt}\n * with every one of its checks, one after another.\n * `POST /subscriptions/import/apply`\n *\n * One result per selection, in request order; one refused does not stop\n * the others.\n */\n async importApply(\n params: SubscriptionImportApplyRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportApplyResponse> {\n return this.request('POST', '/subscriptions/import/apply', { body: params, ...options });\n }\n\n /**\n * Resolve which of the given payments were raised by a subscription.\n * `POST /subscriptions/payments/lookup`\n *\n * The linkage exists in one direction only — an invoice points at the payment\n * it settled, and nothing is stamped on the payment — so this is the only way\n * to tell a subscription charge from a one-off one when you are holding a\n * page of payments. In particular, do not use `off_session` or the presence\n * of a mandate: an ordinary saved-card charge sets those identically.\n *\n * Ids that belong to no subscription are **absent** from `links` rather than\n * returned as an error, so match on presence:\n *\n * ```ts\n * const { links } = await subscriptions.lookupPayments(\n * { payment_ids: page.map((p) => p.payment_id) },\n * { headers: { 'X-Profile-Id': profileId } },\n * );\n * const bySubscription = new Map(links.map((l) => [l.payment_id, l]));\n * ```\n *\n * Profile-scoped like every other subscription route, and that matters more\n * here than elsewhere: a `payment_id` is merchant-supplied and only unique\n * within a merchant, so the shop is part of the question, not an\n * optimisation. Pass the profile that owns **the payments** — for a list\n * spanning several shops, group the ids by shop and call once per group.\n *\n * At most 200 ids per call.\n */\n async lookupPayments(\n params: SubscriptionPaymentLookupRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionPaymentLookupResponse> {\n return this.request('POST', '/subscriptions/payments/lookup', { body: params, ...options });\n }\n\n /**\n * One subscription's billing history, newest cycle first.\n * `GET /subscriptions/{subscriptionId}/invoices`\n *\n * {@link retrieve} carries only the *latest* invoice, which is the current\n * cycle — a subscription that has renewed monthly for a year has one of those\n * and twelve of these. Use this wherever a merchant needs to see what a\n * subscription has actually billed, in particular on self-charging processors\n * (Creem, PayPal) where each renewal is charged by the processor and mirrored\n * here rather than raised as a DeloPay payment.\n *\n * Two things to render honestly, both decided rather than incidental:\n *\n * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net\n * them: the difference between the two is not a smaller charge.\n * - A `refunded_amount` of `null` is \"not reported\" and must not render as\n * `0`. Likewise a processor-hosted origination records a bootstrap invoice\n * at `0` before the buyer has paid anything, so a zero amount on such a\n * subscription is a placeholder rather than a free cycle.\n *\n * Profile-scoped like every other subscription route.\n */\n async listInvoices(\n subscriptionId: string,\n params?: SubscriptionInvoiceListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceListResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * Refund one paid subscription invoice at the billing processor that charged it.\n * `POST /subscriptions/{subscriptionId}/invoices/{invoiceId}/refund`\n *\n * Needs the refund permission, as a payment refund does, and the merchant's\n * refund rules apply. Only invoices of processor-billed cycles are refunded\n * here; a cycle paid by a payment is refunded through `refunds.create`. The\n * processor refunds the whole amount left on the charge, so omit `amount` or\n * send exactly that remainder.\n *\n * The answer is usually `pending` or `succeeded`: the invoice's refunded total\n * moves, and `invoice_refunded` is sent, once the processor reports the refund.\n * The same `idempotency_key` again answers the first refund and sends nothing.\n * While one refund of an invoice awaits the processor, another is refused.\n */\n async refundInvoice(\n subscriptionId: string,\n invoiceId: string,\n params: SubscriptionInvoiceRefundRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceRefundResponse> {\n return this.request(\n 'POST',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices/${encodeURIComponent(invoiceId)}/refund`,\n { body: params, ...options, bodyIdempotencyKey: params.idempotency_key },\n );\n }\n\n /**\n * The refunds of one subscription invoice made through the API, oldest first.\n * `GET /subscriptions/{subscriptionId}/invoices/{invoiceId}/refunds`\n *\n * Needs subscription read. A refund whose processor reported a refund of the\n * invoice without a refund time of its own, while this one awaited it, reads\n * `awaiting_confirmation` with the processor's refunds it may be in\n * `confirmation_candidates`.\n */\n async listInvoiceRefunds(\n subscriptionId: string,\n invoiceId: string,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceRefundListResponse> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices/${encodeURIComponent(invoiceId)}/refunds`,\n options,\n );\n }\n\n /**\n * Confirm that a refund the processor reported is this refund, once checked\n * at the processor.\n * `POST /subscriptions/{subscriptionId}/invoices/{invoiceId}/refunds/{refundId}/confirm`\n *\n * Needs the refund permission. Only a refund in `awaiting_confirmation` is\n * confirmed, and only with one of its `confirmation_candidates`; it becomes\n * `succeeded` with the processor's refund id and amount. The invoice's\n * refunded total does not move and no webhook is sent. The same candidate\n * again answers the refund as it stands. A refund that does not await\n * confirmation, or a processor refund that is not one of its candidates, is\n * refused with a 400 (`IR_16`); a subscription, invoice or refund that is not\n * found answers 404. Only `connector_refund_id` is sent, so a candidate from\n * `confirmation_candidates` can be passed as it is.\n */\n async confirmInvoiceRefund(\n subscriptionId: string,\n invoiceId: string,\n refundId: string,\n params: SubscriptionInvoiceRefundConfirmRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceRefundResponse> {\n return this.request(\n 'POST',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices/${encodeURIComponent(invoiceId)}/refunds/${encodeURIComponent(refundId)}/confirm`,\n { ...options, body: { connector_refund_id: params.connector_refund_id } },\n );\n }\n\n /**\n * Which billing processor this shop's subscriptions run on.\n * `GET /subscriptions/billing_processor`\n *\n * The same mapping is derivable from the connector inventory\n * (`GET /account/{merchant_id}/connectors`), but that route is gated by a\n * connector-read permission granted independently of subscriptions — so a\n * role authorised to create subscriptions could be unable to learn which\n * processor it was creating them on. This answers under the same\n * authorization as the rest of the subscription API.\n *\n * Reach for it when the client must branch on the processor *before* calling\n * — origination differs by processor, and guessing is destructive. Resolve\n * the shop's `billing_processor_id` first: a shop that runs no subscriptions\n * has none assigned, and this route has no identity to report for it.\n */\n async getBillingProcessor(\n options?: RequestExtras,\n ): Promise<SubscriptionBillingProcessorResponse> {\n return this.request('GET', '/subscriptions/billing_processor', { ...options });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/publish-sdk-04860-w6/dist/chunk-PYNHK6AP.cjs","../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACgDO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,eAAA,CAAgB,OAAA,EAA4D;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,8BAAA,EAAgC,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3E;AAAA;AAAA,EAGA,MAAM,kBAAA,CACJ,MAAA,EACA,OAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,8BAAA,EAAgC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACzF;AAAA;AAAA,EAGA,MAAM,gBAAA,CAAiB,OAAA,EAA+D;AACpF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAAA,EAAiC,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC5E;AAAA,EAEA,MAAM,mBAAA,CACJ,MAAA,EACA,OAAA,EACsC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAAA,EAAiC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC1F;AAAA;AAAA,EAGA,MAAM,eAAA,CACJ,cAAA,EACA,OAAA,EAC8C;AAC9C,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,eAAA,EAAkB,kBAAA,CAAmB,cAAc,CAAC,CAAA,aAAA,CAAA;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkC8C,EAAA;AACkC,IAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4B4C,EAAA;AACqC,IAAA;AACtE,MAAA;AACJ,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsB8C,EAAA;AAChC,IAAA;AACV,MAAA;AACiE,MAAA;AACM,MAAA;AACzE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAekD,EAAA;AACpC,IAAA;AACV,MAAA;AACiE,MAAA;AACjE,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuB8C,EAAA;AAChC,IAAA;AACV,MAAA;AACiE,MAAA;AACO,MAAA;AAC1E,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBiD,EAAA;AAC8B,IAAA;AAC/E,EAAA;AACF;AD7JoF;AACA;AACA;AACA","file":"/tmp/publish-sdk-04860-w6/dist/chunk-PYNHK6AP.cjs","sourcesContent":[null,"import type {\n BuyerPortalSubscriptionCapabilities,\n NativeShopConfigRequest,\n NativeShopConfigResponse,\n NativeDunningConfigRequest,\n NativeDunningConfigResponse,\n AdoptSubscriptionRequest,\n AdoptSubscriptionResponse,\n CreateSubscriptionRequest,\n CreateAndConfirmSubscriptionRequest,\n ConfirmSubscriptionRequest,\n UpdateSubscriptionRequest,\n PauseSubscriptionRequest,\n ResumeSubscriptionRequest,\n CancelSubscriptionRequest,\n SubscriptionResponse,\n ConfirmSubscriptionResponse,\n PauseSubscriptionResponse,\n ResumeSubscriptionResponse,\n CancelSubscriptionResponse,\n GetSubscriptionItemsResponse,\n GetSubscriptionItemsParams,\n SubscriptionEstimateResponse,\n SubscriptionEstimateParams,\n SubscriptionListParams,\n SubscriptionPaymentLookupRequest,\n SubscriptionPaymentLookupResponse,\n SubscriptionInvoiceListParams,\n SubscriptionInvoiceListResponse,\n SubscriptionBillingProcessorResponse,\n SubscriptionImportApplyRequest,\n SubscriptionImportApplyResponse,\n SubscriptionImportPreviewRequest,\n SubscriptionImportPreviewResponse,\n SubscriptionItemsPage,\n SubscriptionSyncRequest,\n SubscriptionSyncResponse,\n SubscriptionSyncResult,\n SubscriptionInvoiceRefundConfirmRequest,\n SubscriptionInvoiceRefundListResponse,\n SubscriptionInvoiceRefundRequest,\n SubscriptionInvoiceRefundResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/**\n * Subscription endpoints are profile-scoped: the backend requires an\n * `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`\n * otherwise). Pass it through the per-call `options.headers`, e.g.\n * `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.\n */\nexport class Subscriptions {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */\n async getNativeConfig(options?: RequestExtras): Promise<NativeShopConfigResponse> {\n return this.request('GET', '/subscriptions/native/config', { ...options });\n }\n\n /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */\n async updateNativeConfig(\n params: NativeShopConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeShopConfigResponse> {\n return this.request('PUT', '/subscriptions/native/config', { body: params, ...options });\n }\n\n /** Read merchant-wide renewal recovery settings. */\n async getNativeDunning(options?: RequestExtras): Promise<NativeDunningConfigResponse> {\n return this.request('GET', '/subscriptions/native/dunning', { ...options });\n }\n\n async updateNativeDunning(\n params: NativeDunningConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeDunningConfigResponse> {\n return this.request('PUT', '/subscriptions/native/dunning', { body: params, ...options });\n }\n\n /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */\n async getCapabilities(\n subscriptionId: string,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionCapabilities> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,\n { ...options },\n );\n }\n\n /**\n * Create and immediately confirm a subscription. `POST /subscriptions`\n *\n * For billing processors that require buyer approval (e.g. PayPal), the\n * response carries a `redirect_url` the customer must be sent to.\n */\n async createAndConfirm(\n params: CreateAndConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', '/subscriptions', { body: params, ...options });\n }\n\n /** Create a subscription without confirming it. `POST /subscriptions/create` */\n async create(\n params: CreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('POST', '/subscriptions/create', { body: params, ...options });\n }\n\n /**\n * Adopt an existing Creem subscription. `POST /subscriptions/adopt`\n *\n * Requires adoption to be enabled on the deployment and `X-Profile-Id` in\n * options.headers. Adoption charges nothing and emits no invoice or webhook.\n * Repeating the processor subscription ID returns the existing DeloPay ID.\n * Retry when handoff_confirmed is false. That flag confirms persistence,\n * not the merchant's external switch-over: stop processing Creem events in\n * your own integration when handing subsequent events to DeloPay.\n */\n async adopt(\n params: AdoptSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<AdoptSubscriptionResponse> {\n return this.request('POST', '/subscriptions/adopt', { body: params, ...options });\n }\n\n /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */\n async retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}`, {\n ...options,\n });\n }\n\n /**\n * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`\n *\n * Like {@link createAndConfirm}, the response may carry a `redirect_url` for\n * processors that require buyer approval.\n */\n async confirm(\n subscriptionId: string,\n params: ConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async update(\n subscriptionId: string,\n params: UpdateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('PUT', `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List subscriptions for the profile, or one customer's with `customer_id`.\n * `GET /subscriptions/list`\n */\n async list(\n params?: SubscriptionListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse[]> {\n return this.request('GET', '/subscriptions/list', {\n query: csvQuery(params, ['profile_ids', 'industry']),\n ...options,\n });\n }\n\n /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */\n async getEstimate(\n params: SubscriptionEstimateParams,\n options?: RequestExtras,\n ): Promise<SubscriptionEstimateResponse> {\n return this.request('GET', '/subscriptions/estimate', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */\n async getItems(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/subscriptions/items', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * {@link getItems}, with whether the list is only the first part of what the\n * processor holds. `GET /subscriptions/items`\n *\n * The backend states that in the `X-Delopay-Items-Truncated` response\n * header (Stripe Billing lists its first 100 products), which the plain\n * {@link getItems} cannot return. Without `limit` and `offset` every item\n * the billing account offers is listed, up to 500.\n */\n async getItemsPage(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<SubscriptionItemsPage> {\n let truncated = false;\n const items = await this.request<GetSubscriptionItemsResponse[]>(\n 'GET',\n '/subscriptions/items',\n {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n onDownloadProgress: (event) => {\n // The headers arrive with the first event; a retried request reports\n // them again, and the last attempt is the one the items come from.\n truncated = event.headers.get('x-delopay-items-truncated')?.toLowerCase() === 'true';\n options?.onDownloadProgress?.(event);\n },\n },\n );\n return { items, truncated };\n }\n\n /**\n * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n *\n * The body defaults to `{}` so the request still carries\n * `Content-Type: application/json` even when no params are passed — the\n * backend rejects the POST otherwise (\"Unsupported content type\").\n */\n async pause(\n subscriptionId: string,\n params?: PauseSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<PauseSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async resume(\n subscriptionId: string,\n params?: ResumeSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ResumeSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel`\n *\n * A subscription in a state it cannot be cancelled from is refused with\n * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async cancel(\n subscriptionId: string,\n params?: CancelSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<CancelSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Read 1 to 50 subscriptions back from their billing processor and mirror\n * what it reports. `POST /subscriptions/sync`\n *\n * Nothing is written at the processor. A status is mirrored only with the\n * time the processor stamped it with, and never over a newer event already\n * recorded; a plan only with its own stamp. One result per id, in request\n * order; one that fails does not stop the others.\n */\n async sync(\n params: SubscriptionSyncRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionSyncResponse> {\n return this.request('POST', '/subscriptions/sync', { body: params, ...options });\n }\n\n /**\n * Read one subscription back from its billing processor and mirror what it\n * reports, as {@link sync} does, with what the processor reported beside\n * what the mirror now holds. `POST /subscriptions/{subscriptionId}/sync`\n */\n async syncOne(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionSyncResult> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/sync`, {\n ...options,\n });\n }\n\n /**\n * List the subscriptions a billing account holds at its processor, and how\n * each relates to DeloPay's: already held, new (its buyer is a DeloPay\n * customer), needing a customer, ended, or not adoptable here.\n * `POST /subscriptions/import/preview`\n *\n * Reads only; nothing is written here or at the processor. Creem and\n * Stripe Billing can be listed; PayPal cannot, which `capabilities` states\n * (`reason_code: 'listing_unsupported'`).\n */\n async importPreview(\n params: SubscriptionImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportPreviewResponse> {\n return this.request('POST', '/subscriptions/import/preview', { body: params, ...options });\n }\n\n /**\n * Take 1 to 25 processor subscriptions over, each through {@link adopt}\n * with every one of its checks, one after another.\n * `POST /subscriptions/import/apply`\n *\n * One result per selection, in request order; one refused does not stop\n * the others.\n */\n async importApply(\n params: SubscriptionImportApplyRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportApplyResponse> {\n return this.request('POST', '/subscriptions/import/apply', { body: params, ...options });\n }\n\n /**\n * Resolve which of the given payments were raised by a subscription.\n * `POST /subscriptions/payments/lookup`\n *\n * The linkage exists in one direction only — an invoice points at the payment\n * it settled, and nothing is stamped on the payment — so this is the only way\n * to tell a subscription charge from a one-off one when you are holding a\n * page of payments. In particular, do not use `off_session` or the presence\n * of a mandate: an ordinary saved-card charge sets those identically.\n *\n * Ids that belong to no subscription are **absent** from `links` rather than\n * returned as an error, so match on presence:\n *\n * ```ts\n * const { links } = await subscriptions.lookupPayments(\n * { payment_ids: page.map((p) => p.payment_id) },\n * { headers: { 'X-Profile-Id': profileId } },\n * );\n * const bySubscription = new Map(links.map((l) => [l.payment_id, l]));\n * ```\n *\n * Profile-scoped like every other subscription route, and that matters more\n * here than elsewhere: a `payment_id` is merchant-supplied and only unique\n * within a merchant, so the shop is part of the question, not an\n * optimisation. Pass the profile that owns **the payments** — for a list\n * spanning several shops, group the ids by shop and call once per group.\n *\n * At most 200 ids per call.\n */\n async lookupPayments(\n params: SubscriptionPaymentLookupRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionPaymentLookupResponse> {\n return this.request('POST', '/subscriptions/payments/lookup', { body: params, ...options });\n }\n\n /**\n * One subscription's billing history, newest cycle first.\n * `GET /subscriptions/{subscriptionId}/invoices`\n *\n * {@link retrieve} carries only the *latest* invoice, which is the current\n * cycle — a subscription that has renewed monthly for a year has one of those\n * and twelve of these. Use this wherever a merchant needs to see what a\n * subscription has actually billed, in particular on self-charging processors\n * (Creem, PayPal) where each renewal is charged by the processor and mirrored\n * here rather than raised as a DeloPay payment.\n *\n * Two things to render honestly, both decided rather than incidental:\n *\n * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net\n * them: the difference between the two is not a smaller charge.\n * - A `refunded_amount` of `null` is \"not reported\" and must not render as\n * `0`. Likewise a processor-hosted origination records a bootstrap invoice\n * at `0` before the buyer has paid anything, so a zero amount on such a\n * subscription is a placeholder rather than a free cycle.\n *\n * Profile-scoped like every other subscription route.\n */\n async listInvoices(\n subscriptionId: string,\n params?: SubscriptionInvoiceListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceListResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * Refund one paid subscription invoice at the billing processor that charged it.\n * `POST /subscriptions/{subscriptionId}/invoices/{invoiceId}/refund`\n *\n * Needs the refund permission, as a payment refund does, and the merchant's\n * refund rules apply. Only invoices of processor-billed cycles are refunded\n * here; a cycle paid by a payment is refunded through `refunds.create`. The\n * processor refunds the whole amount left on the charge, so omit `amount` or\n * send exactly that remainder.\n *\n * The answer is usually `pending` or `succeeded`: the invoice's refunded total\n * moves, and `invoice_refunded` is sent, once the processor reports the refund.\n * The same `idempotency_key` again answers the first refund and sends nothing.\n * While one refund of an invoice awaits the processor, another is refused.\n */\n async refundInvoice(\n subscriptionId: string,\n invoiceId: string,\n params: SubscriptionInvoiceRefundRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceRefundResponse> {\n return this.request(\n 'POST',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices/${encodeURIComponent(invoiceId)}/refund`,\n { body: params, ...options, bodyIdempotencyKey: params.idempotency_key },\n );\n }\n\n /**\n * The refunds of one subscription invoice made through the API, oldest first.\n * `GET /subscriptions/{subscriptionId}/invoices/{invoiceId}/refunds`\n *\n * Needs subscription read. A refund whose processor reported a refund of the\n * invoice without a refund time of its own, while this one awaited it, reads\n * `awaiting_confirmation` with the processor's refunds it may be in\n * `confirmation_candidates`.\n */\n async listInvoiceRefunds(\n subscriptionId: string,\n invoiceId: string,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceRefundListResponse> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices/${encodeURIComponent(invoiceId)}/refunds`,\n options,\n );\n }\n\n /**\n * Confirm that a refund the processor reported is this refund, once checked\n * at the processor.\n * `POST /subscriptions/{subscriptionId}/invoices/{invoiceId}/refunds/{refundId}/confirm`\n *\n * Needs the refund permission. Only a refund in `awaiting_confirmation` is\n * confirmed, and only with one of its `confirmation_candidates`; it becomes\n * `succeeded` with the processor's refund id and amount. The invoice's\n * refunded total does not move and no webhook is sent. The same candidate\n * again answers the refund as it stands. A refund that does not await\n * confirmation, or a processor refund that is not one of its candidates, is\n * refused with a 400 (`IR_16`); a subscription, invoice or refund that is not\n * found answers 404. Only `connector_refund_id` is sent, so a candidate from\n * `confirmation_candidates` can be passed as it is.\n */\n async confirmInvoiceRefund(\n subscriptionId: string,\n invoiceId: string,\n refundId: string,\n params: SubscriptionInvoiceRefundConfirmRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceRefundResponse> {\n return this.request(\n 'POST',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices/${encodeURIComponent(invoiceId)}/refunds/${encodeURIComponent(refundId)}/confirm`,\n { ...options, body: { connector_refund_id: params.connector_refund_id } },\n );\n }\n\n /**\n * Which billing processor this shop's subscriptions run on.\n * `GET /subscriptions/billing_processor`\n *\n * The same mapping is derivable from the connector inventory\n * (`GET /account/{merchant_id}/connectors`), but that route is gated by a\n * connector-read permission granted independently of subscriptions — so a\n * role authorised to create subscriptions could be unable to learn which\n * processor it was creating them on. This answers under the same\n * authorization as the rest of the subscription API.\n *\n * Reach for it when the client must branch on the processor *before* calling\n * — origination differs by processor, and guessing is destructive. Resolve\n * the shop's `billing_processor_id` first: a shop that runs no subscriptions\n * has none assigned, and this route has no identity to report for it.\n */\n async getBillingProcessor(\n options?: RequestExtras,\n ): Promise<SubscriptionBillingProcessorResponse> {\n return this.request('GET', '/subscriptions/billing_processor', { ...options });\n }\n}\n"]}
|