@delopay/sdk 0.458.0 → 0.461.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-4T4XHPYN.cjs.map +1 -1
- package/dist/{chunk-T5BLVSK3.js → chunk-4WZMHDID.js} +37 -4
- package/dist/chunk-4WZMHDID.js.map +1 -0
- 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-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-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- 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-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CKKNFFKP.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-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F46K5H3U.cjs.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/{chunk-66PCQHAT.js → chunk-F6V5A62N.js} +3 -3
- package/dist/chunk-FG7YBXJQ.cjs.map +1 -1
- package/dist/chunk-FQRC4NJG.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-HLHML5ES.cjs.map +1 -1
- 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-I2W7AO4B.cjs.map +1 -1
- package/dist/chunk-I2XGNALG.cjs.map +1 -1
- package/dist/{chunk-UZUNBL7K.cjs → chunk-I5LUU7ZR.cjs} +3 -3
- package/dist/chunk-I5LUU7ZR.cjs.map +1 -0
- 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-JPRSNCYP.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-KOB6MOAV.cjs.map +1 -1
- package/dist/chunk-KSJ7JLR3.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-MCNDMK7F.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/{chunk-S4TNMIX7.cjs → chunk-NCPCCAEI.cjs} +3 -3
- package/dist/chunk-NCPCCAEI.cjs.map +1 -0
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NKDUQ2BI.cjs.map +1 -1
- package/dist/chunk-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/{chunk-IA6O7DWZ.cjs → chunk-O4OI44YL.cjs} +5 -5
- package/dist/chunk-O4OI44YL.cjs.map +1 -0
- package/dist/chunk-OAEKP665.cjs.map +1 -1
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- package/dist/{chunk-AVR2GPXU.cjs → chunk-ORCK5GQ3.cjs} +37 -4
- package/dist/chunk-ORCK5GQ3.cjs.map +1 -0
- package/dist/chunk-OWP7XBY2.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.cjs.map +1 -1
- package/dist/chunk-P4UILJVU.cjs.map +1 -1
- package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.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-R4FE6K43.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-RSVLVW4L.cjs.map +1 -1
- package/dist/chunk-S77LQWYC.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/{chunk-GH6CASEG.cjs → chunk-TJJLCFKO.cjs} +38 -1
- package/dist/chunk-TJJLCFKO.cjs.map +1 -0
- 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-RBNTITQG.js → chunk-UUNRVLAS.js} +38 -1
- package/dist/chunk-UUNRVLAS.js.map +1 -0
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/{chunk-25KYFJIB.js → chunk-V7ACE3LA.js} +2 -2
- 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-WITCPKNL.cjs.map +1 -1
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/{chunk-T3X5DOSW.js → chunk-Y6XIPSSK.js} +2 -2
- package/dist/chunk-Y7LSSRNJ.cjs.map +1 -1
- package/dist/chunk-YK3P5QNZ.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/admin.d.cts +1 -1
- package/dist/internal/resources/admin.d.ts +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.d.cts +1 -1
- package/dist/internal/resources/adminBranding.d.ts +1 -1
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.d.cts +1 -1
- package/dist/internal/resources/adminCheckoutDomains.d.ts +1 -1
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
- package/dist/internal/resources/adminFeePlans.d.cts +1 -1
- package/dist/internal/resources/adminFeePlans.d.ts +1 -1
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.d.cts +1 -1
- package/dist/internal/resources/adminFileScans.d.ts +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.d.cts +1 -1
- package/dist/internal/resources/adminIndustries.d.ts +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.d.cts +1 -1
- package/dist/internal/resources/adminNotices.d.ts +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 +1 -1
- package/dist/internal/resources/adminPortal.d.ts +1 -1
- package/dist/internal/resources/adminPortal.js +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/adminSupport.d.cts +1 -1
- package/dist/internal/resources/adminSupport.d.ts +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.d.cts +1 -1
- package/dist/internal/resources/auditLogs.d.ts +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.d.cts +1 -1
- package/dist/internal/resources/cardIssuers.d.ts +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.d.cts +1 -1
- package/dist/internal/resources/diagnostic.d.ts +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/gsm.d.cts +1 -1
- package/dist/internal/resources/gsm.d.ts +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.d.cts +1 -1
- package/dist/internal/resources/nativeRenewals.d.ts +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.d.cts +1 -1
- package/dist/internal/resources/platformBilling.d.ts +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/resources/platformSettings.d.cts +1 -1
- package/dist/internal/resources/platformSettings.d.ts +1 -1
- package/dist/internal.cjs +8 -8
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- 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 +2 -2
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/identityVerifications.d.cts +25 -4
- package/dist/resources/identityVerifications.d.ts +25 -4
- package/dist/resources/identityVerifications.js +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.map +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 +2 -2
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/settlement.d.cts +24 -1
- package/dist/resources/settlement.d.ts +24 -1
- package/dist/resources/settlement.js +1 -1
- package/dist/resources/shopLabels.cjs.map +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-BgtOYc1g.d.ts → types-DOTyjOZD.d.ts} +5 -1
- package/dist/{types-n2jLRgEU.d.cts → types-zLnhjw0u.d.cts} +5 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +151 -4
- package/dist/types.d.ts +151 -4
- package/package.json +17 -19
- package/dist/chunk-AVR2GPXU.cjs.map +0 -1
- package/dist/chunk-GH6CASEG.cjs.map +0 -1
- package/dist/chunk-IA6O7DWZ.cjs.map +0 -1
- package/dist/chunk-RBNTITQG.js.map +0 -1
- package/dist/chunk-S4TNMIX7.cjs.map +0 -1
- package/dist/chunk-T5BLVSK3.js.map +0 -1
- package/dist/chunk-UZUNBL7K.cjs.map +0 -1
- /package/dist/{chunk-66PCQHAT.js.map → chunk-F6V5A62N.js.map} +0 -0
- /package/dist/{chunk-25KYFJIB.js.map → chunk-V7ACE3LA.js.map} +0 -0
- /package/dist/{chunk-T3X5DOSW.js.map → chunk-Y6XIPSSK.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAmF,EAAA;AACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAaE,IAAA;AAAwF,MAAA;AAChF,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAA4E,MAAA;AACxD,IAAA;AACnB,EAAA;AACH;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,IAAA;AAC3D,EAAA;AACF;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,MAAA;AAC1C,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAY,MAAA;AACV,MAAA;AAC8G,MAAA;AAC/F,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAY,MAAA;AACV,MAAA;AAC8G,IAAA;AAChH,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAY,MAAA;AACV,MAAA;AACyD,MAAA;AAC1C,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAkE,EAAA;AACpE;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAAoF,EAAA;AAExF;ADjHA;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-Y7LSSRNJ.cjs","sourcesContent":[null,"import type {\n AdminMerchantCheckoutDomains,\n ApplePayVerificationFileCreateRequest,\n ApplePayVerificationFileResponse,\n ApplePayVerificationFileUpdateRequest,\n CheckoutDomainCreateRequest,\n CheckoutDomainResponse,\n CheckoutDomainsEntitlementSaved,\n CheckoutDomainsEntitlementUpdate,\n CheckoutDomainsOverview,\n CheckoutHostAvailability,\n CheckoutHostAvailabilityQuery,\n CheckoutHostCheckList,\n CheckoutHostChecksQuery,\n CheckoutHostCreateRequest,\n CheckoutHostHealthList,\n CheckoutHostHealthQuery,\n CheckoutHostPrimaryImpact,\n CheckoutHostRegistrationCounts,\n CheckoutHostRenameImpact,\n CheckoutHostRenameRequest,\n CheckoutHostRenameResponse,\n CheckoutDomainAdminAlerts,\n CheckoutDomainsEntitlementPreview,\n MerchantHostSuspendRequest,\n MerchantHostsList,\n MerchantHostsQuery,\n PlatformCloudflare,\n PlatformCloudflareConnect,\n} from '../types';\nimport type {\n CheckoutHostHealthDetail,\n CloudflareOAuthCallback,\n CloudflareOAuthStart,\n CheckoutHostPauseRequest,\n CheckoutHostPreview,\n CheckoutHostResponse,\n CheckoutHostUpdateRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/** The filters of the checks log, taken key by key so nothing else reaches the query. */\nfunction checksQuery(\n query: Omit<CheckoutHostChecksQuery, 'format'> | undefined,\n): Omit<CheckoutHostChecksQuery, 'format'> {\n const { host_id, result, from, to, limit } = query ?? {};\n return { host_id, result, from, to, limit };\n}\n\n/**\n * Checkout domains for DeloPay staff: the platform's checkout hosts and base\n * domains, the Apple Pay verification file library, host health and the raw\n * check log, the platform Cloudflare connection, and each merchant's\n * checkout-domain entitlement and addresses.\n *\n * Reads need a staff role; every write needs account management and is\n * recorded in the audit log.\n */\nexport class AdminCheckoutDomains {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every platform domain and host, the Apple Pay file library, the config fallback and how pool hostnames are spelled.\n * `GET /admin-portal/checkout-domains`\n */\n async overview(): Promise<CheckoutDomainsOverview> {\n return this.request('GET', '/admin-portal/checkout-domains');\n }\n\n /**\n * The raw checks of the last 7 days, filtered by host, result and time.\n * `GET /admin-portal/checkout-domains/checks`\n */\n async listChecks(\n query?: Omit<CheckoutHostChecksQuery, 'format'>,\n ): Promise<CheckoutHostCheckList> {\n // Always JSON here, whatever a caller's object carries at runtime.\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'json' },\n });\n }\n\n /**\n * The same checks as a CSV file (`format=csv`), for a download.\n * `GET /admin-portal/checkout-domains/checks?format=csv`\n */\n async exportChecks(query?: Omit<CheckoutHostChecksQuery, 'format'>): Promise<Blob> {\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'csv' },\n responseType: 'blob',\n });\n }\n\n /**\n * Add a checkout domain\n * `POST /admin-portal/checkout-domains/domains`\n */\n async createDomain(params: CheckoutDomainCreateRequest): Promise<CheckoutDomainResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/domains', { body: params });\n }\n\n /**\n * Remove a checkout domain\n * `DELETE /admin-portal/checkout-domains/domains/{domain_id}`\n */\n async deleteDomain(domainId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/domains/${encodeURIComponent(domainId)}`,\n );\n }\n\n /**\n * Upload an Apple Pay verification file. The stored file is read back\n * before it is saved; when that fails nothing is saved, and the refusal\n * (`code` `IR_16`, `data.reason`) is `file_unreadable` (the file storage\n * writes but does not read: check its configuration) or `file_corrupted`\n * (the stored bytes differ from the upload: try again).\n * `POST /admin-portal/checkout-domains/files`\n */\n async uploadFile(\n params: ApplePayVerificationFileCreateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/files', { body: params });\n }\n\n /**\n * Change an Apple Pay verification file\n * `PATCH /admin-portal/checkout-domains/files/{file_id}`\n */\n async updateFile(\n fileId: string,\n params: ApplePayVerificationFileUpdateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove an Apple Pay verification file\n * `DELETE /admin-portal/checkout-domains/files/{file_id}`\n */\n async deleteFile(fileId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n );\n }\n\n /**\n * The bytes of an Apple Pay verification file, presets included.\n * `GET /admin-portal/checkout-domains/files/{file_id}/content`\n */\n async downloadFile(fileId: string): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}/content`,\n { responseType: 'blob' },\n );\n }\n\n /**\n * Every host with its health, uptime and payments, with counts per summary filter; sorted and searched on the server.\n * `GET /admin-portal/checkout-domains/health`\n */\n async health(query?: CheckoutHostHealthQuery): Promise<CheckoutHostHealthList> {\n return this.request('GET', '/admin-portal/checkout-domains/health', { query: { ...query } });\n }\n\n /**\n * Add a checkout host\n * `POST /admin-portal/checkout-domains/hosts`\n */\n async createHost(params: CheckoutHostCreateRequest): Promise<CheckoutHostResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/hosts', { body: params });\n }\n\n /**\n * Whether a platform host name is free\n * `GET /admin-portal/checkout-domains/hosts/availability`\n */\n async hostAvailability(query: CheckoutHostAvailabilityQuery): Promise<CheckoutHostAvailability> {\n return this.request('GET', '/admin-portal/checkout-domains/hosts/availability', {\n query: { ...query },\n });\n }\n\n /**\n * Change a checkout host\n * `PATCH /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async updateHost(\n hostId: string,\n params: CheckoutHostUpdateRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove a host, in two steps for every kind: it must stop taking traffic\n * first. Refusals (`code` `IR_16`, `data.reason`): `primary_host`,\n * `last_default_host`, `configured_host` (the configured checkout address),\n * `host_takes_traffic` (pause or rename it first), `host_draining`\n * (`retry_after_seconds`), `host_in_use` (`payment_ids`) and `host_changed`.\n * `DELETE /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async deleteHost(hostId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n );\n }\n\n /**\n * Check a checkout host now\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/check`\n */\n async checkHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/check`,\n );\n }\n\n /**\n * One host's health page: uptime, 90 days, incidents, the checks where the result changed, and usage.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/health`\n */\n async hostHealth(hostId: string): Promise<CheckoutHostHealthDetail> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/health`,\n );\n }\n\n /**\n * Pause a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/pause`\n */\n async pauseHost(hostId: string, params: CheckoutHostPauseRequest): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/pause`,\n { body: params },\n );\n }\n\n /**\n * Resume a paused checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/resume`\n */\n async resumeHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/resume`,\n );\n }\n\n /**\n * A signed preview link of a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/preview`\n */\n async previewHost(hostId: string): Promise<CheckoutHostPreview> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/preview`,\n );\n }\n\n /**\n * Make a ready default host the primary one: new links use it within about 30 seconds. Old hosts keep serving.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/primary`\n */\n async makePrimary(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary`,\n );\n }\n\n /**\n * What making a host primary would change for Apple Pay registrations.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/primary-impact`\n */\n async primaryImpact(hostId: string): Promise<CheckoutHostPrimaryImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary-impact`,\n );\n }\n\n /**\n * A checkout host's Apple Pay registrations, counted\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/registrations`\n */\n async hostRegistrations(hostId: string): Promise<CheckoutHostRegistrationCounts> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/registrations`,\n );\n }\n\n /**\n * Rename a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/rename`\n */\n async renameHost(\n hostId: string,\n params: CheckoutHostRenameRequest,\n ): Promise<CheckoutHostRenameResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename`,\n { body: params },\n );\n }\n\n /**\n * What renaming a host would cost: the processors whose Apple Pay registration of the hostname is lost, and the merchants affected.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/rename-impact`\n */\n async renameImpact(hostId: string): Promise<CheckoutHostRenameImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename-impact`,\n );\n }\n\n /**\n * Create the host's proxied DNS record through the platform Cloudflare connection.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/dns`\n */\n async createHostDns(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/dns`,\n );\n }\n\n /**\n * the platform Cloudflare connection\n * `GET /admin-portal/checkout-domains/cloudflare`\n */\n async cloudflare(): Promise<PlatformCloudflare> {\n return this.request('GET', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * connect or replace the platform Cloudflare token\n * `PUT /admin-portal/checkout-domains/cloudflare`\n */\n async connectCloudflare(params: PlatformCloudflareConnect): Promise<PlatformCloudflare> {\n return this.request('PUT', '/admin-portal/checkout-domains/cloudflare', { body: params });\n }\n\n /**\n * disconnect the platform Cloudflare token\n * `DELETE /admin-portal/checkout-domains/cloudflare`\n */\n async disconnectCloudflare(): Promise<void> {\n return this.request('DELETE', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * check the platform Cloudflare token again\n * `POST /admin-portal/checkout-domains/cloudflare/check`\n */\n async checkCloudflare(): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/check');\n }\n\n /**\n * Start \"Connect with Cloudflare\" (OAuth) for the platform connection,\n * instead of pasting a token. Send the person to `authorize_url`;\n * Cloudflare sends them back to the deployment's redirect URI with `code`\n * and `state`, which go to {@link finishCloudflareOAuth} before\n * `expires_at`. Offered only while `cloudflare()` says `oauth_available`;\n * otherwise refused with `cloudflare_oauth_unavailable`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/start`\n */\n async startCloudflareOAuth(): Promise<CloudflareOAuthStart> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/start');\n }\n\n /**\n * Finish \"Connect with Cloudflare\" for the platform: pass the `code` and\n * `state` from the redirect unchanged. The same person who started it\n * must finish it, and a `state` works once. Answers with the platform\n * connection as it now is. A refusal throws a `DelopayError` with `code`\n * `IR_16` and the reason in `data.reason`, among them\n * `cloudflare_oauth_state_invalid`, `cloudflare_oauth_rejected` and\n * `cloudflare_scopes_missing`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/callback`\n */\n async finishCloudflareOAuth(params: CloudflareOAuthCallback): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/callback', {\n body: params,\n });\n }\n\n /**\n * every merchant's checkout addresses\n * `GET /admin-portal/checkout-domains/merchant-hosts`\n */\n async merchantHosts(query?: MerchantHostsQuery): Promise<MerchantHostsList> {\n return this.request('GET', '/admin-portal/checkout-domains/merchant-hosts', {\n query: { ...query },\n });\n }\n\n /**\n * a merchant's checkout domains and entitlement\n * `GET /admin-portal/merchants/{merchant_id}/checkout-domains`\n */\n async merchantCheckoutDomains(merchantId: string): Promise<AdminMerchantCheckoutDomains> {\n return this.request(\n 'GET',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains`,\n );\n }\n\n /**\n * A merchant's checkout-domain entitlement. Turning a kind off suspends that kind's addresses; lowering the maximum removes nothing.\n * `PUT /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement`\n */\n async updateEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementSaved> {\n return this.request(\n 'PUT',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement`,\n { body: params },\n );\n }\n\n /**\n * Suspend a merchant's address: its shops fall back to the default address for new links.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/suspend`\n */\n async suspendMerchantHost(\n merchantId: string,\n hostId: string,\n params: MerchantHostSuspendRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/suspend`,\n { body: params },\n );\n }\n\n /**\n * Lift a suspension; the address sets up again until its next check passes.\n * Refused with `kind_not_entitled` while the entitlement does not allow its\n * kind.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/unsuspend`\n */\n async unsuspendMerchantHost(merchantId: string, hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/unsuspend`,\n );\n }\n\n /**\n * What an entitlement change would do, saving nothing: the entitlement as\n * it would be and the addresses it would suspend.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement/preview`\n */\n async previewEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementPreview> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement/preview`,\n { body: params },\n );\n }\n\n /**\n * Who on the platform team hears about checkout hosts: the platform's own\n * hosts (on by default) and merchant addresses down for 30 minutes or more\n * (off by default).\n * `GET /admin-portal/checkout-domains/alerts`\n */\n async alerts(): Promise<CheckoutDomainAdminAlerts> {\n return this.request('GET', '/admin-portal/checkout-domains/alerts');\n }\n\n /**\n * Save the platform team's checkout host alerts.\n * `PUT /admin-portal/checkout-domains/alerts`\n */\n async updateAlerts(params: CheckoutDomainAdminAlerts): Promise<CheckoutDomainAdminAlerts> {\n return this.request('PUT', '/admin-portal/checkout-domains/alerts', { body: params });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/delopay-sdk-publish/dist/chunk-Y7LSSRNJ.cjs","../src/internal/resources/adminCheckoutDomains.ts"],"names":[],"mappings":"AAAA;AC0CA,SAAS,WAAA,CACP,KAAA,EACyC;AACzC,EAAA,MAAM,EAAE,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAM,EAAA,EAAI,MAAM,EAAA,mBAAI,KAAA,UAAS,CAAC,GAAA;AACvD,EAAA,OAAO,EAAE,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAM,EAAA,EAAI,MAAM,CAAA;AAC5C;AAWO,IAAM,qBAAA,EAAN,MAA2B;AAAA,EAChC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlD,MAAM,QAAA,CAAA,EAA6C;AACjD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,gCAAgC,CAAA;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,UAAA,CACJ,KAAA,EACgC;AAEhC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,uCAAA,EAAyC;AAAA,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AY,MAAA;AACV,MAAA;AACyD,MAAA;AAC1C,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AASE,IAAA;AAAkE,EAAA;AACpE;AAAA;AAAA;AAAA;AAAA,EAAA;AAOE,IAAA;AAAoF,EAAA;AAExF;ADjHA;AACA;AACA;AACA","file":"/tmp/delopay-sdk-publish/dist/chunk-Y7LSSRNJ.cjs","sourcesContent":[null,"import type {\n AdminMerchantCheckoutDomains,\n ApplePayVerificationFileCreateRequest,\n ApplePayVerificationFileResponse,\n ApplePayVerificationFileUpdateRequest,\n CheckoutDomainCreateRequest,\n CheckoutDomainResponse,\n CheckoutDomainsEntitlementSaved,\n CheckoutDomainsEntitlementUpdate,\n CheckoutDomainsOverview,\n CheckoutHostAvailability,\n CheckoutHostAvailabilityQuery,\n CheckoutHostCheckList,\n CheckoutHostChecksQuery,\n CheckoutHostCreateRequest,\n CheckoutHostHealthList,\n CheckoutHostHealthQuery,\n CheckoutHostPrimaryImpact,\n CheckoutHostRegistrationCounts,\n CheckoutHostRenameImpact,\n CheckoutHostRenameRequest,\n CheckoutHostRenameResponse,\n CheckoutDomainAdminAlerts,\n CheckoutDomainsEntitlementPreview,\n MerchantHostSuspendRequest,\n MerchantHostsList,\n MerchantHostsQuery,\n PlatformCloudflare,\n PlatformCloudflareConnect,\n} from '../types';\nimport type {\n CheckoutHostHealthDetail,\n CloudflareOAuthCallback,\n CloudflareOAuthStart,\n CheckoutHostPauseRequest,\n CheckoutHostPreview,\n CheckoutHostResponse,\n CheckoutHostUpdateRequest,\n} from '../../types';\nimport type { RequestFn } from '../../client';\n\n/** The filters of the checks log, taken key by key so nothing else reaches the query. */\nfunction checksQuery(\n query: Omit<CheckoutHostChecksQuery, 'format'> | undefined,\n): Omit<CheckoutHostChecksQuery, 'format'> {\n const { host_id, result, from, to, limit } = query ?? {};\n return { host_id, result, from, to, limit };\n}\n\n/**\n * Checkout domains for DeloPay staff: the platform's checkout hosts and base\n * domains, the Apple Pay verification file library, host health and the raw\n * check log, the platform Cloudflare connection, and each merchant's\n * checkout-domain entitlement and addresses.\n *\n * Reads need a staff role; every write needs account management and is\n * recorded in the audit log.\n */\nexport class AdminCheckoutDomains {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every platform domain and host, the Apple Pay file library, the config fallback and how pool hostnames are spelled.\n * `GET /admin-portal/checkout-domains`\n */\n async overview(): Promise<CheckoutDomainsOverview> {\n return this.request('GET', '/admin-portal/checkout-domains');\n }\n\n /**\n * The raw checks of the last 7 days, filtered by host, result and time.\n * `GET /admin-portal/checkout-domains/checks`\n */\n async listChecks(\n query?: Omit<CheckoutHostChecksQuery, 'format'>,\n ): Promise<CheckoutHostCheckList> {\n // Always JSON here, whatever a caller's object carries at runtime.\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'json' },\n });\n }\n\n /**\n * The same checks as a CSV file (`format=csv`), for a download.\n * `GET /admin-portal/checkout-domains/checks?format=csv`\n */\n async exportChecks(query?: Omit<CheckoutHostChecksQuery, 'format'>): Promise<Blob> {\n return this.request('GET', '/admin-portal/checkout-domains/checks', {\n query: { ...checksQuery(query), format: 'csv' },\n responseType: 'blob',\n });\n }\n\n /**\n * Add a checkout domain\n * `POST /admin-portal/checkout-domains/domains`\n */\n async createDomain(params: CheckoutDomainCreateRequest): Promise<CheckoutDomainResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/domains', { body: params });\n }\n\n /**\n * Remove a checkout domain\n * `DELETE /admin-portal/checkout-domains/domains/{domain_id}`\n */\n async deleteDomain(domainId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/domains/${encodeURIComponent(domainId)}`,\n );\n }\n\n /**\n * Upload an Apple Pay verification file. The stored file is read back\n * before it is saved; when that fails nothing is saved, and the refusal\n * (`code` `IR_16`, `data.reason`) is `file_unreadable` (the file storage\n * writes but does not read: check its configuration) or `file_corrupted`\n * (the stored bytes differ from the upload: try again).\n * `POST /admin-portal/checkout-domains/files`\n */\n async uploadFile(\n params: ApplePayVerificationFileCreateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/files', { body: params });\n }\n\n /**\n * Change an Apple Pay verification file\n * `PATCH /admin-portal/checkout-domains/files/{file_id}`\n */\n async updateFile(\n fileId: string,\n params: ApplePayVerificationFileUpdateRequest,\n ): Promise<ApplePayVerificationFileResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove an Apple Pay verification file\n * `DELETE /admin-portal/checkout-domains/files/{file_id}`\n */\n async deleteFile(fileId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}`,\n );\n }\n\n /**\n * The bytes of an Apple Pay verification file, presets included.\n * `GET /admin-portal/checkout-domains/files/{file_id}/content`\n */\n async downloadFile(fileId: string): Promise<Blob> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/files/${encodeURIComponent(fileId)}/content`,\n { responseType: 'blob' },\n );\n }\n\n /**\n * Every host with its health, uptime and payments, with counts per summary filter; sorted and searched on the server.\n * `GET /admin-portal/checkout-domains/health`\n */\n async health(query?: CheckoutHostHealthQuery): Promise<CheckoutHostHealthList> {\n return this.request('GET', '/admin-portal/checkout-domains/health', { query: { ...query } });\n }\n\n /**\n * Add a checkout host\n * `POST /admin-portal/checkout-domains/hosts`\n */\n async createHost(params: CheckoutHostCreateRequest): Promise<CheckoutHostResponse> {\n return this.request('POST', '/admin-portal/checkout-domains/hosts', { body: params });\n }\n\n /**\n * Whether a platform host name is free\n * `GET /admin-portal/checkout-domains/hosts/availability`\n */\n async hostAvailability(query: CheckoutHostAvailabilityQuery): Promise<CheckoutHostAvailability> {\n return this.request('GET', '/admin-portal/checkout-domains/hosts/availability', {\n query: { ...query },\n });\n }\n\n /**\n * Change a checkout host\n * `PATCH /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async updateHost(\n hostId: string,\n params: CheckoutHostUpdateRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'PATCH',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove a host, in two steps for every kind: it must stop taking traffic\n * first. Refusals (`code` `IR_16`, `data.reason`): `primary_host`,\n * `last_default_host`, `configured_host` (the configured checkout address),\n * `host_takes_traffic` (pause or rename it first), `host_draining`\n * (`retry_after_seconds`), `host_in_use` (`payment_ids`) and `host_changed`.\n * `DELETE /admin-portal/checkout-domains/hosts/{host_id}`\n */\n async deleteHost(hostId: string): Promise<void> {\n return this.request(\n 'DELETE',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}`,\n );\n }\n\n /**\n * Check a checkout host now\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/check`\n */\n async checkHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/check`,\n );\n }\n\n /**\n * One host's health page: uptime, 90 days, incidents, the checks where the result changed, and usage.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/health`\n */\n async hostHealth(hostId: string): Promise<CheckoutHostHealthDetail> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/health`,\n );\n }\n\n /**\n * Pause a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/pause`\n */\n async pauseHost(hostId: string, params: CheckoutHostPauseRequest): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/pause`,\n { body: params },\n );\n }\n\n /**\n * Resume a paused checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/resume`\n */\n async resumeHost(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/resume`,\n );\n }\n\n /**\n * A signed preview link of a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/preview`\n */\n async previewHost(hostId: string): Promise<CheckoutHostPreview> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/preview`,\n );\n }\n\n /**\n * Make a ready default host the primary one: new links use it within about 30 seconds. Old hosts keep serving.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/primary`\n */\n async makePrimary(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary`,\n );\n }\n\n /**\n * What making a host primary would change for Apple Pay registrations.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/primary-impact`\n */\n async primaryImpact(hostId: string): Promise<CheckoutHostPrimaryImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/primary-impact`,\n );\n }\n\n /**\n * A checkout host's Apple Pay registrations, counted\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/registrations`\n */\n async hostRegistrations(hostId: string): Promise<CheckoutHostRegistrationCounts> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/registrations`,\n );\n }\n\n /**\n * Rename a checkout host\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/rename`\n */\n async renameHost(\n hostId: string,\n params: CheckoutHostRenameRequest,\n ): Promise<CheckoutHostRenameResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename`,\n { body: params },\n );\n }\n\n /**\n * What renaming a host would cost: the processors whose Apple Pay registration of the hostname is lost, and the merchants affected.\n * `GET /admin-portal/checkout-domains/hosts/{host_id}/rename-impact`\n */\n async renameImpact(hostId: string): Promise<CheckoutHostRenameImpact> {\n return this.request(\n 'GET',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/rename-impact`,\n );\n }\n\n /**\n * Create the host's proxied DNS record through the platform Cloudflare connection.\n * `POST /admin-portal/checkout-domains/hosts/{host_id}/dns`\n */\n async createHostDns(hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/checkout-domains/hosts/${encodeURIComponent(hostId)}/dns`,\n );\n }\n\n /**\n * the platform Cloudflare connection\n * `GET /admin-portal/checkout-domains/cloudflare`\n */\n async cloudflare(): Promise<PlatformCloudflare> {\n return this.request('GET', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * connect or replace the platform Cloudflare token\n * `PUT /admin-portal/checkout-domains/cloudflare`\n */\n async connectCloudflare(params: PlatformCloudflareConnect): Promise<PlatformCloudflare> {\n return this.request('PUT', '/admin-portal/checkout-domains/cloudflare', { body: params });\n }\n\n /**\n * disconnect the platform Cloudflare token\n * `DELETE /admin-portal/checkout-domains/cloudflare`\n */\n async disconnectCloudflare(): Promise<void> {\n return this.request('DELETE', '/admin-portal/checkout-domains/cloudflare');\n }\n\n /**\n * check the platform Cloudflare token again\n * `POST /admin-portal/checkout-domains/cloudflare/check`\n */\n async checkCloudflare(): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/check');\n }\n\n /**\n * Start \"Connect with Cloudflare\" (OAuth) for the platform connection,\n * instead of pasting a token. Send the person to `authorize_url`;\n * Cloudflare sends them back to the deployment's redirect URI with `code`\n * and `state`, which go to {@link finishCloudflareOAuth} before\n * `expires_at`. Offered only while `cloudflare()` says `oauth_available`;\n * otherwise refused with `cloudflare_oauth_unavailable`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/start`\n */\n async startCloudflareOAuth(): Promise<CloudflareOAuthStart> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/start');\n }\n\n /**\n * Finish \"Connect with Cloudflare\" for the platform: pass the `code` and\n * `state` from the redirect unchanged. The same person who started it\n * must finish it, and a `state` works once. Answers with the platform\n * connection as it now is. A refusal throws a `DelopayError` with `code`\n * `IR_16` and the reason in `data.reason`, among them\n * `cloudflare_oauth_state_invalid`, `cloudflare_oauth_rejected` and\n * `cloudflare_scopes_missing`.\n * `POST /admin-portal/checkout-domains/cloudflare/oauth/callback`\n */\n async finishCloudflareOAuth(params: CloudflareOAuthCallback): Promise<PlatformCloudflare> {\n return this.request('POST', '/admin-portal/checkout-domains/cloudflare/oauth/callback', {\n body: params,\n });\n }\n\n /**\n * every merchant's checkout addresses\n * `GET /admin-portal/checkout-domains/merchant-hosts`\n */\n async merchantHosts(query?: MerchantHostsQuery): Promise<MerchantHostsList> {\n return this.request('GET', '/admin-portal/checkout-domains/merchant-hosts', {\n query: { ...query },\n });\n }\n\n /**\n * a merchant's checkout domains and entitlement\n * `GET /admin-portal/merchants/{merchant_id}/checkout-domains`\n */\n async merchantCheckoutDomains(merchantId: string): Promise<AdminMerchantCheckoutDomains> {\n return this.request(\n 'GET',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains`,\n );\n }\n\n /**\n * A merchant's checkout-domain entitlement. Turning a kind off suspends that kind's addresses; lowering the maximum removes nothing.\n * `PUT /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement`\n */\n async updateEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementSaved> {\n return this.request(\n 'PUT',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement`,\n { body: params },\n );\n }\n\n /**\n * Suspend a merchant's address: its shops fall back to the default address for new links.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/suspend`\n */\n async suspendMerchantHost(\n merchantId: string,\n hostId: string,\n params: MerchantHostSuspendRequest,\n ): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/suspend`,\n { body: params },\n );\n }\n\n /**\n * Lift a suspension; the address sets up again until its next check passes.\n * Refused with `kind_not_entitled` while the entitlement does not allow its\n * kind.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/hosts/{host_id}/unsuspend`\n */\n async unsuspendMerchantHost(merchantId: string, hostId: string): Promise<CheckoutHostResponse> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/hosts/${encodeURIComponent(hostId)}/unsuspend`,\n );\n }\n\n /**\n * What an entitlement change would do, saving nothing: the entitlement as\n * it would be and the addresses it would suspend.\n * `POST /admin-portal/merchants/{merchant_id}/checkout-domains/entitlement/preview`\n */\n async previewEntitlement(\n merchantId: string,\n params: CheckoutDomainsEntitlementUpdate,\n ): Promise<CheckoutDomainsEntitlementPreview> {\n return this.request(\n 'POST',\n `/admin-portal/merchants/${encodeURIComponent(merchantId)}/checkout-domains/entitlement/preview`,\n { body: params },\n );\n }\n\n /**\n * Who on the platform team hears about checkout hosts: the platform's own\n * hosts (on by default) and merchant addresses down for 30 minutes or more\n * (off by default).\n * `GET /admin-portal/checkout-domains/alerts`\n */\n async alerts(): Promise<CheckoutDomainAdminAlerts> {\n return this.request('GET', '/admin-portal/checkout-domains/alerts');\n }\n\n /**\n * Save the platform team's checkout host alerts.\n * `PUT /admin-portal/checkout-domains/alerts`\n */\n async updateAlerts(params: CheckoutDomainAdminAlerts): Promise<CheckoutDomainAdminAlerts> {\n return this.request('PUT', '/admin-portal/checkout-domains/alerts', { body: params });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAA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C,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/delopay-sdk-publish/dist/chunk-YK3P5QNZ.cjs","../src/resources/products.ts"],"names":[],"mappings":"AAAA;ACmFO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG1C,MAAA,CAAO,SAAA,EAAmB,OAAA,EAAwC;AACxE,IAAA,OAAO,EAAE,GAAG,OAAA,EAAS,OAAA,EAAS,EAAE,cAAA,EAAgB,SAAA,EAAW,mBAAG,OAAA,2BAAS,UAAQ,EAAE,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA,EAIA,MAAM,WAAA,CACJ,IAAA,EACA,SAAA,EACA,OAAA,EACqC;AACrC,IAAA,MAAM,KAAA,EAAO,IAAI,QAAA,CAAS,CAAA;AAC1B,IAAA,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,IAAI,CAAA;AACxB,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB;AAAA,MAC9C,IAAA,EAAM,IAAA;AAAA,MACN,GAAG,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,OAAO;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,MAAA,EACA,SAAA,EACA,OAAA,EAC0B;AAC1B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,WAAA,EAAa;AAAA,MACvC,IAAA,EAAM,MAAA;AAAA,MACN,GAAG,IAAA,CAAK,MAAA,CAAO,SAAA,EAAW,OAAO;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM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AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwC,EAAA;AACoB,IAAA;AACvB,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAe0C,EAAA;AAC8B,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACqC,IAAA;AAC9D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD/U0E;AACA;AACA;AACA","file":"/tmp/delopay-sdk-publish/dist/chunk-YK3P5QNZ.cjs","sourcesContent":[null,"import type {\n BillingReadinessResponse,\n ProductSalesQuery,\n ProductSalesResponse,\n AddonGroupCreateRequest,\n AddonGroupUpdateRequest,\n BundleDefinition,\n GetSubscriptionItemsResponse,\n ProductCategoryCreateRequest,\n ProductCategoryListQuery,\n ProductCategoryListResponse,\n ProductCategoryReorderRequest,\n ProductCategoryResponse,\n ProductCategoryUpdateRequest,\n ProductAliasCreateRequest,\n ProductConnectorReferenceCreateRequest,\n ProductAssignModeRequest,\n ProductCopyToLivePreview,\n ProductCopyToLivePreviewQuery,\n ProductCopyToLiveRequest,\n ProductCopyToLiveResponse,\n ProductCreateRequest,\n ProductLegacyUsageParams,\n ProductLegacyUsageResponse,\n ProductDeleteRequest,\n ProductDeleteResponse,\n ProductImageUploadResponse,\n ProductImportAcceptRequest,\n ProductImportApplyRequest,\n ProductImportPreviewRequest,\n ProductImportPreviewResponse,\n ProductImportRunListResponse,\n ProductImportRunResponse,\n ProductImportSuggestionsQuery,\n ProductListParams,\n ProductListResponse,\n ProductProviderCreateRequest,\n ProductProviderCreateResponse,\n ProductProviderPushRequest,\n ProductProviderPushResponse,\n ProductProviderSyncBatchRequest,\n ProductProviderSyncBatchResponse,\n ProductProviderSyncResponse,\n ProductPriceCreateRequest,\n ProductPriceUpdateRequest,\n ProductResolveQuery,\n ProductResolveResponse,\n ProductResponse,\n ProductUpdateRequest,\n ProviderAccountListResponse,\n ProviderArchiveOutcome,\n ProviderArchiveRequest,\n ProviderCleanupListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * A shop's product catalogue: what it sells, and at which prices.\n *\n * **Every route here belongs to one shop**, and the backend resolves it from\n * an `X-Profile-Id` header, answering `IR_04` without one. That is why\n * `profileId` is a required argument on every method rather than something to\n * remember in `options.headers`: a header that can be forgotten is forgotten,\n * and the failure arrives at runtime in a caller's dashboard rather than at\n * their compiler.\n *\n * Two shapes of the catalogue are worth knowing before calling this:\n *\n * * **A product is created with its prices.** The API requires at least one,\n * because a product nobody can be charged for cannot be sold.\n * * **A price is closed, never rewritten.** `updatePrice` changes its label,\n * its default flag and its metadata; the amount, the currency and the\n * billing interval are fixed for the life of the price, so a charge that was\n * made can always be explained by a price that still exists. Charging a new\n * figure means adding a price and archiving the old one.\n * * **Every price route answers with the whole product.** The catalogue's unit\n * is the product: a price means something only beside its siblings, and\n * which one is the default changes the moment another is added. So these\n * methods return `ProductResponse`, and the price that was touched is found\n * in its `prices` — typing them as the price alone let a caller read\n * `result.amount` as a number that is `undefined` at runtime, and mistake\n * the product's id for a price id.\n */\nexport class Products {\n constructor(private readonly request: RequestFn) {}\n\n /** The shop scope every route here takes, as the backend expects it. */\n private scoped(profileId: string, options?: RequestExtras): RequestExtras {\n return { ...options, headers: { 'X-Profile-Id': profileId, ...options?.headers } };\n }\n\n /** Upload a PNG, JPEG or WebP image to the merchant CDN. Save the returned\n * URL in a product create or update request; upload alone changes no product. */\n async uploadImage(\n file: Blob,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImageUploadResponse> {\n const form = new FormData();\n form.append('file', file);\n return this.request('POST', '/products/images', {\n body: form,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product together with its prices.\n * `POST /products`\n *\n * @param params - The product, with at least one price.\n * @param profileId - The shop the product belongs to.\n */\n async create(\n params: ProductCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', '/products', {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * One page of the shop's catalogue.\n * `GET /products/list`\n *\n * Archived products are returned too unless `status` narrows them away —\n * they are what past charges refer to.\n */\n async list(\n params: ProductListParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductListResponse> {\n return this.request('GET', '/products/list', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Find the product a name or a connector's id belongs to. Pass exactly one\n * of `alias`, `connector_product_id` and `connector_price_id`; the connector\n * ids need `connector` as well. Archived products resolve too, so a payment\n * that references one is still attributed. No match answers 404.\n * `GET /products/resolve`\n */\n async resolve(\n query: ProductResolveQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResolveResponse> {\n return this.request('GET', '/products/resolve', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Retrieve one product with its prices.\n * `GET /products/{product_id}`\n */\n async retrieve(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What a product sold in a window, per currency, net of the refunds credited\n * to its lines. Refunds that named no product line are not included.\n * `GET /products/{product_id}/sales`\n *\n * Needs payment read; refused (403) to a caller limited to some connector\n * accounts.\n */\n async sales(\n productId: string,\n query: ProductSalesQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductSalesResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/sales`, {\n ...this.scoped(profileId, options),\n query: { ...query },\n });\n }\n\n /**\n * Which active prices of the named recurring products can start a\n * subscription on the shop's billing processor account, in the environment\n * the account is in now. `GET /products/billing-readiness`\n *\n * Reads only; subscribing still checks the processor's price before\n * anything is billed. Unknown ids, one-time products and archived prices\n * are left out of the answer.\n *\n * @param productIds - 1 to 100 product ids.\n * @param profileId - The shop the products belong to.\n */\n async billingReadiness(\n productIds: readonly string[],\n profileId: string,\n options?: RequestExtras,\n ): Promise<BillingReadinessResponse> {\n return this.request('GET', '/products/billing-readiness', {\n ...this.scoped(profileId, options),\n // One comma-separated value, as the route reads it — not repeated keys.\n query: { product_ids: productIds.join(',') },\n });\n }\n\n /**\n * Change a product's name, description, image, metadata or category\n * (`category_id: null` makes it uncategorized).\n * `POST /products/{product_id}`\n *\n * Its kind and its prices are not editable here — see the class note.\n */\n async update(\n productId: string,\n params: ProductUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Take a product off sale.\n * `POST /products/{product_id}/archive`\n *\n * It stays readable and keeps its prices: a payment made against it has to\n * remain explicable after it is withdrawn.\n */\n async archive(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Copy a test product to live: its names, active prices under new ids,\n * image, tax category, category, selection groups and bundle composition.\n * A test product it contains or offers is replaced by its live copy; one\n * without a live copy refuses the copy. Nothing at a payment provider is\n * copied. A repeated copy returns the existing live copy unless `another`\n * is set (`created` says which).\n * `POST /products/{product_id}/copy-to-live`\n */\n async copyToLive(\n productId: string,\n params: ProductCopyToLiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLiveResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/copy-to-live`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * What `copyToLive` would do, with nothing written. A copy that would be\n * refused answers with the copy's error.\n * `GET /products/{product_id}/copy-to-live/preview`\n */\n async previewCopyToLive(\n productId: string,\n query: ProductCopyToLivePreviewQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCopyToLivePreview> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's products from before modes, newest first, each with where it\n * is in use per mode.\n * `GET /products/legacy-usage`\n */\n async legacyUsage(\n params: ProductLegacyUsageParams | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductLegacyUsageResponse> {\n return this.request('GET', '/products/legacy-usage', {\n query: params === undefined ? undefined : { ...params },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Give a product from before modes the mode it belongs to, once. Refused\n * while the other mode still uses it, or when it already has a mode.\n * `POST /products/{product_id}/assign-mode`\n */\n async assignMode(\n productId: string,\n params: ProductAssignModeRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/assign-mode`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put an archived product back on sale.\n * `POST /products/{product_id}/restore`\n */\n async restore(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /** Mark an archived product deleted. Historical payment lines keep\n * their own immutable purchase snapshots, and the catalog row remains stored. */\n async delete(productId: string, profileId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/products/${encodeURIComponent(productId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Delete an archived product, then carry out the chosen action at each\n * connected account it is tied to. An account not named in\n * `provider_actions` is kept as it is. A failed provider action does not\n * undo the delete: it is listed by {@link providerCleanups} and retried\n * with {@link providerArchive}.\n * `POST /products/{product_id}/delete`\n */\n async deleteWithProviders(\n productId: string,\n request: ProductDeleteRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductDeleteResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/delete`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Add a price to an existing product.\n * `POST /products/{product_id}/prices`\n *\n * This is how a price changes: the new figure is added and the old price is\n * archived, so both remain readable.\n */\n async addPrice(\n productId: string,\n params: ProductPriceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/prices`, {\n body: params,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a price's label, its default flag or its metadata.\n * `POST /products/{product_id}/prices/{price_id}`\n *\n * Not its amount, its currency or its interval: see the class note.\n */\n async updatePrice(\n productId: string,\n priceId: string,\n params: ProductPriceUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}`,\n { body: params, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Take one price off sale, leaving the product on it.\n * `POST /products/{product_id}/prices/{price_id}/archive`\n */\n async archivePrice(\n productId: string,\n priceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/prices/${encodeURIComponent(priceId)}/archive`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- add-on selection groups ---------------------------------------\n\n /**\n * Add a group of optional extras to a one-time product, with how many of\n * them a buyer must and may choose. Each add-on is an active product of kind\n * `addon` in the same shop. Returns the whole product.\n * `POST /products/{product_id}/addon-groups`\n */\n async createAddonGroup(\n productId: string,\n group: AddonGroupCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/addon-groups`, {\n body: group,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Change a group's name, bounds, or the add-ons it offers; a new list\n * replaces the old one whole.\n * `POST /products/{product_id}/addon-groups/{group_id}`\n */\n async updateAddonGroup(\n productId: string,\n groupId: string,\n changes: AddonGroupUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { body: changes, ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Remove a group and what it offered. The add-on products themselves stay.\n * `DELETE /products/{product_id}/addon-groups/{group_id}`\n */\n async deleteAddonGroup(\n productId: string,\n groupId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'DELETE',\n `/products/${encodeURIComponent(productId)}/addon-groups/${encodeURIComponent(groupId)}`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n // --- bundles ---------------------------------------------------------\n\n /**\n * Replace what a bundle contains. Its pricing mode is fixed at creation;\n * past purchases keep their own frozen lines.\n * `POST /products/{product_id}/bundle`\n */\n async replaceBundle(\n productId: string,\n bundle: BundleDefinition,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/bundle`, {\n body: bundle,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- identity: names and connector references ---------------------\n\n /**\n * Add a name the product goes by. A name it already goes by is returned\n * as it is; one another product of the shop goes by is refused.\n * `POST /products/{product_id}/aliases`\n */\n async addAlias(\n productId: string,\n body: ProductAliasCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/aliases`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a name the product goes by. Its current name stays.\n * `POST /products/{product_id}/aliases/{alias_id}/remove`\n */\n async removeAlias(\n productId: string,\n aliasId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/aliases/${encodeURIComponent(aliasId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * Tie a connected account's product, or one of its prices, to the product.\n * Recorded as `manual_id`: the ids are not checked against the account.\n * `POST /products/{product_id}/connector-references`\n */\n async addConnectorReference(\n productId: string,\n body: ProductConnectorReferenceCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/connector-references`, {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Remove a connected account's product or price from the product.\n * `POST /products/{product_id}/connector-references/{reference_id}/remove`\n */\n async removeConnectorReference(\n productId: string,\n referenceId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/${encodeURIComponent(referenceId)}/remove`,\n { ...this.scoped(profileId, options) },\n );\n }\n\n /**\n * One bounded page of a connected billing account's products, to pick an\n * existing one to tie to a product. Reads only.\n * `GET /products/import-suggestions`\n */\n async importSuggestions(\n query: ProductImportSuggestionsQuery,\n profileId: string,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/products/import-suggestions', {\n query: { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Tie one of a connected account's existing products (or a price of it) to\n * the product, verified against a fresh read of the page it was suggested\n * on — pass the same `limit` and `offset`. Recorded as `map_existing`.\n * `POST /products/{product_id}/connector-references/import`\n */\n async acceptImport(\n productId: string,\n body: ProductImportAcceptRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductResponse> {\n return this.request(\n 'POST',\n `/products/${encodeURIComponent(productId)}/connector-references/import`,\n { body, ...this.scoped(profileId, options) },\n );\n }\n\n // --- categories ------------------------------------------------------\n\n /**\n * Add a category to the shop, at the end of its order. File products under\n * it with `category_id` on `create` or `update`.\n * `POST /products/categories`\n */\n async createCategory(\n body: ProductCategoryCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', '/products/categories', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's categories in order. Archived ones only with\n * `include_archived`; deleted ones never.\n * `GET /products/categories/list`\n */\n async listCategories(\n query: ProductCategoryListQuery | undefined,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('GET', '/products/categories/list', {\n query: query === undefined ? undefined : { ...query },\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Put the shop's categories in a new order. Name every live category,\n * archived ones included, exactly once. Returns the categories in their new\n * order.\n * `POST /products/categories/reorder`\n */\n async reorderCategories(\n body: ProductCategoryReorderRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryListResponse> {\n return this.request('POST', '/products/categories/reorder', {\n body,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Rename a category.\n * `POST /products/categories/{category_id}`\n */\n async updateCategory(\n categoryId: string,\n changes: ProductCategoryUpdateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}`, {\n body: changes,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Mark a category deleted. Its products become uncategorized and no payment\n * changes. Returns the deleted category.\n * `DELETE /products/categories/{category_id}`\n */\n async deleteCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('DELETE', `/products/categories/${encodeURIComponent(categoryId)}`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Keep a category with its products, but file no new product under it.\n * `POST /products/categories/{category_id}/archive`\n */\n async archiveCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/archive`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Let an archived category take products again.\n * `POST /products/categories/{category_id}/restore`\n */\n async restoreCategory(\n categoryId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductCategoryResponse> {\n return this.request('POST', `/products/categories/${encodeURIComponent(categoryId)}/restore`, {\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider import ---------------------------------------------\n\n /**\n * Read a connected billing account's products and say how each relates to\n * the catalog. Reads only: nothing is written to the provider or the catalog.\n * `POST /products/import/preview`\n */\n async importPreview(\n request: ProductImportPreviewRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportPreviewResponse> {\n return this.request('POST', '/products/import/preview', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create a product for every new item and add the new prices of every\n * changed one, tied to the provider's ids. Nothing else is edited or\n * removed, except that `options.archived: 'archive'` archives the catalog\n * product of every item the provider no longer offers (by default it is\n * left as it is). Nothing is written to the provider. A failed item is\n * reported with its reason and can be retried by naming it in\n * `connector_product_ids`.\n * `POST /products/import/apply`\n */\n async importApply(\n request: ProductImportApplyRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunResponse> {\n return this.request('POST', '/products/import/apply', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * The shop's past imports from one connected account, newest first.\n * `GET /products/import/runs`\n */\n async listImportRuns(\n merchantConnectorId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductImportRunListResponse> {\n return this.request('GET', '/products/import/runs', {\n query: { merchant_connector_id: merchantConnectorId },\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider sync -----------------------------------------------\n\n /**\n * Compare the product with its copy at every connected account it is tied\n * to. Reads the providers now; an unreadable provider answers `unknown`,\n * never `in_sync`.\n * `GET /products/{product_id}/provider-sync`\n */\n async providerSync(\n productId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncResponse> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/provider-sync`, {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * {@link providerSync} for 1 to 50 products at once, such as one page of the\n * product list. Unknown ids are left out of the answer.\n * `POST /products/provider-sync`\n */\n async providerSyncBatch(\n request: ProductProviderSyncBatchRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderSyncBatchResponse> {\n return this.request('POST', '/products/provider-sync', {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Write the catalog's state onto one connected account's copy of the\n * product, for the differences a push changes and nothing else. When it\n * would change a difference not named in `confirmed`, nothing is written and\n * the answer carries `confirmation_outdated: true` with the current\n * differences in `result`; `nothing_to_push` answers without a provider\n * write when nothing pushable differs.\n * `POST /products/{product_id}/provider-sync/push`\n */\n async providerPush(\n productId: string,\n request: ProductProviderPushRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderPushResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/push`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n // --- provider lifecycle -----------------------------------------\n\n /**\n * The shop's connected accounts the catalog works with, and what each can\n * do: read, create, push, and how a delete can clean up there.\n * `GET /products/provider-accounts`\n */\n async providerAccounts(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderAccountListResponse> {\n return this.request('GET', '/products/provider-accounts', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Provider clean-ups still to be carried out: deletes whose action at a\n * provider failed, or was recorded and never reached.\n * `GET /products/provider-cleanups`\n */\n async providerCleanups(\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderCleanupListResponse> {\n return this.request('GET', '/products/provider-cleanups', {\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Create the product at a connected account it is not at yet. Without\n * `confirmed` nothing is written and the answer holds the plan to review;\n * send the plan's `fingerprint` back as `confirmed` to carry it out. When\n * the plan changed since, nothing is written and the answer carries\n * `confirmation_outdated: true` with the current plan.\n * `POST /products/{product_id}/provider-sync/create`\n */\n async providerCreate(\n productId: string,\n request: ProductProviderCreateRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProductProviderCreateResponse> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-sync/create`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n\n /**\n * Archive the product at one connected account, or retry a clean-up that\n * failed after the product was deleted. Existing subscriptions there keep\n * billing; the catalog is not changed.\n * `POST /products/{product_id}/provider-archive`\n */\n async providerArchive(\n productId: string,\n request: ProviderArchiveRequest,\n profileId: string,\n options?: RequestExtras,\n ): Promise<ProviderArchiveOutcome> {\n return this.request('POST', `/products/${encodeURIComponent(productId)}/provider-archive`, {\n body: request,\n ...this.scoped(profileId, options),\n });\n }\n}\n"]}
|