@delopay/sdk 0.448.0 → 0.451.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-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-YJQPKT6W.cjs → chunk-ABWAYMN5.cjs} +1 -1
- package/dist/chunk-ABWAYMN5.cjs.map +1 -0
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/{chunk-2QMSBWQY.js → chunk-AM5JQGDN.js} +1 -1
- package/dist/{chunk-2QMSBWQY.js.map → chunk-AM5JQGDN.js.map} +1 -1
- package/dist/chunk-AVR2GPXU.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-ZPFPDNBE.js → chunk-BY3BENXH.js} +87 -1
- package/dist/chunk-BY3BENXH.js.map +1 -0
- 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-GY26OJZF.js → chunk-EBA6DJKI.js} +2 -2
- 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-FG7YBXJQ.cjs.map +1 -1
- package/dist/chunk-FQRC4NJG.cjs.map +1 -1
- package/dist/chunk-FYISDU2Y.cjs.map +1 -1
- package/dist/{chunk-3A7J2TO5.js → chunk-G6H6G2JS.js} +34 -3
- package/dist/chunk-G6H6G2JS.js.map +1 -0
- 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-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-5QNQRLWX.cjs → chunk-KT2WXUWG.cjs} +87 -1
- package/dist/chunk-KT2WXUWG.cjs.map +1 -0
- package/dist/{chunk-I5XG56UR.cjs → chunk-KZHLKMVX.cjs} +17 -3
- package/dist/chunk-KZHLKMVX.cjs.map +1 -0
- 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-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-JJPKURUG.cjs → chunk-OAEKP665.cjs} +34 -2
- package/dist/chunk-OAEKP665.cjs.map +1 -0
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- package/dist/{chunk-ZFUGT6YL.cjs → chunk-OKFOU6F7.cjs} +9 -9
- package/dist/chunk-OKFOU6F7.cjs.map +1 -0
- package/dist/{chunk-MKMWXXMC.js → chunk-OOC7ZT4T.js} +5 -5
- package/dist/chunk-OWP7XBY2.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.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-4FOFD2A3.js → chunk-QDFT5E4U.js} +1 -1
- package/dist/chunk-QDFT5E4U.js.map +1 -0
- 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-4CRVNVVO.cjs → chunk-R46A6AGY.cjs} +3 -3
- package/dist/chunk-R46A6AGY.cjs.map +1 -0
- 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-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/{chunk-GWJ33GOK.cjs → chunk-U3JK7NBG.cjs} +1 -1
- package/dist/chunk-U3JK7NBG.cjs.map +1 -0
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHMH4QMY.cjs.map +1 -1
- package/dist/{chunk-G6BMUQW2.js → chunk-VPJXGF2L.js} +34 -2
- package/dist/chunk-VPJXGF2L.js.map +1 -0
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/{chunk-SQELICSX.cjs → chunk-WCAIY7DR.cjs} +1 -1
- package/dist/chunk-WCAIY7DR.cjs.map +1 -0
- 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-XR4SKXMH.js → chunk-WYR27JGG.js} +16 -2
- package/dist/chunk-WYR27JGG.js.map +1 -0
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/{chunk-HHUUSNIL.cjs → chunk-Y7LSSRNJ.cjs} +34 -3
- package/dist/chunk-Y7LSSRNJ.cjs.map +1 -0
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- package/dist/{chunk-ZYWW275O.js → chunk-Z5MEER63.js} +1 -1
- package/dist/chunk-Z5MEER63.js.map +1 -0
- 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 +8 -8
- 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 +7 -7
- 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 +2 -2
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.d.cts +29 -4
- package/dist/internal/resources/adminCheckoutDomains.d.ts +29 -4
- package/dist/internal/resources/adminCheckoutDomains.js +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 +10 -2
- package/dist/internal/resources/adminPortal.d.ts +10 -2
- 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 +13 -13
- 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 +9 -9
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs +2 -2
- package/dist/panes.cjs.map +1 -1
- package/dist/panes.d.cts +14 -2
- package/dist/panes.d.ts +14 -2
- package/dist/panes.js +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 +2 -2
- package/dist/resources/checkoutDomains.cjs.map +1 -1
- package/dist/resources/checkoutDomains.d.cts +30 -2
- package/dist/resources/checkoutDomains.d.ts +30 -2
- package/dist/resources/checkoutDomains.js +1 -1
- package/dist/resources/checkoutMethods.cjs.map +1 -1
- package/dist/resources/checkoutRecovery.cjs.map +1 -1
- package/dist/resources/checkoutTemplates.cjs.map +1 -1
- package/dist/resources/connectors.cjs.map +1 -1
- package/dist/resources/contentEncryption.cjs.map +1 -1
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/notices.cjs +2 -2
- package/dist/resources/notices.cjs.map +1 -1
- package/dist/resources/notices.d.cts +1 -1
- package/dist/resources/notices.d.ts +1 -1
- package/dist/resources/notices.js +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 +2 -2
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payoutDestinations.d.cts +2 -2
- package/dist/resources/payoutDestinations.d.ts +2 -2
- package/dist/resources/payoutDestinations.js +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 +53 -1
- package/dist/resources/settlement.d.ts +53 -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-9JmhQ4Gf.d.cts → types-BgtOYc1g.d.ts} +44 -3
- package/dist/{types-CRqkiXMY.d.ts → types-n2jLRgEU.d.cts} +44 -3
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +391 -9
- package/dist/types.d.ts +391 -9
- package/package.json +1 -1
- package/dist/chunk-3A7J2TO5.js.map +0 -1
- package/dist/chunk-4CRVNVVO.cjs.map +0 -1
- package/dist/chunk-4FOFD2A3.js.map +0 -1
- package/dist/chunk-5QNQRLWX.cjs.map +0 -1
- package/dist/chunk-G6BMUQW2.js.map +0 -1
- package/dist/chunk-GWJ33GOK.cjs.map +0 -1
- package/dist/chunk-HHUUSNIL.cjs.map +0 -1
- package/dist/chunk-I5XG56UR.cjs.map +0 -1
- package/dist/chunk-JJPKURUG.cjs.map +0 -1
- package/dist/chunk-SQELICSX.cjs.map +0 -1
- package/dist/chunk-XR4SKXMH.js.map +0 -1
- package/dist/chunk-YJQPKT6W.cjs.map +0 -1
- package/dist/chunk-ZFUGT6YL.cjs.map +0 -1
- package/dist/chunk-ZPFPDNBE.js.map +0 -1
- package/dist/chunk-ZYWW275O.js.map +0 -1
- /package/dist/{chunk-GY26OJZF.js.map → chunk-EBA6DJKI.js.map} +0 -0
- /package/dist/{chunk-MKMWXXMC.js.map → chunk-OOC7ZT4T.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/w6pub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A;AAAA;AAAA;AAAA;AAAA;AAkC8C,EAAA;AACkC,IAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4B4C,EAAA;AACqC,IAAA;AACtE,MAAA;AACJ,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBiD,EAAA;AAC8B,IAAA;AAC/E,EAAA;AACF;AD1IoF;AACA;AACA;AACA","file":"/tmp/w6pub/delopay-typescript-sdk/dist/chunk-CKKNFFKP.cjs","sourcesContent":[null,"import type {\n BuyerPortalSubscriptionCapabilities,\n NativeShopConfigRequest,\n NativeShopConfigResponse,\n NativeDunningConfigRequest,\n NativeDunningConfigResponse,\n AdoptSubscriptionRequest,\n AdoptSubscriptionResponse,\n CreateSubscriptionRequest,\n CreateAndConfirmSubscriptionRequest,\n ConfirmSubscriptionRequest,\n UpdateSubscriptionRequest,\n PauseSubscriptionRequest,\n ResumeSubscriptionRequest,\n CancelSubscriptionRequest,\n SubscriptionResponse,\n ConfirmSubscriptionResponse,\n PauseSubscriptionResponse,\n ResumeSubscriptionResponse,\n CancelSubscriptionResponse,\n GetSubscriptionItemsResponse,\n GetSubscriptionItemsParams,\n SubscriptionEstimateResponse,\n SubscriptionEstimateParams,\n SubscriptionListParams,\n SubscriptionPaymentLookupRequest,\n SubscriptionPaymentLookupResponse,\n SubscriptionInvoiceListParams,\n SubscriptionInvoiceListResponse,\n SubscriptionBillingProcessorResponse,\n SubscriptionImportApplyRequest,\n SubscriptionImportApplyResponse,\n SubscriptionImportPreviewRequest,\n SubscriptionImportPreviewResponse,\n SubscriptionItemsPage,\n SubscriptionSyncRequest,\n SubscriptionSyncResponse,\n SubscriptionSyncResult,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Subscription endpoints are profile-scoped: the backend requires an\n * `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`\n * otherwise). Pass it through the per-call `options.headers`, e.g.\n * `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.\n */\nexport class Subscriptions {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */\n async getNativeConfig(options?: RequestExtras): Promise<NativeShopConfigResponse> {\n return this.request('GET', '/subscriptions/native/config', { ...options });\n }\n\n /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */\n async updateNativeConfig(\n params: NativeShopConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeShopConfigResponse> {\n return this.request('PUT', '/subscriptions/native/config', { body: params, ...options });\n }\n\n /** Read merchant-wide renewal recovery settings. */\n async getNativeDunning(options?: RequestExtras): Promise<NativeDunningConfigResponse> {\n return this.request('GET', '/subscriptions/native/dunning', { ...options });\n }\n\n async updateNativeDunning(\n params: NativeDunningConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeDunningConfigResponse> {\n return this.request('PUT', '/subscriptions/native/dunning', { body: params, ...options });\n }\n\n /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */\n async getCapabilities(\n subscriptionId: string,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionCapabilities> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,\n { ...options },\n );\n }\n\n /**\n * Create and immediately confirm a subscription. `POST /subscriptions`\n *\n * For billing processors that require buyer approval (e.g. PayPal), the\n * response carries a `redirect_url` the customer must be sent to.\n */\n async createAndConfirm(\n params: CreateAndConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', '/subscriptions', { body: params, ...options });\n }\n\n /** Create a subscription without confirming it. `POST /subscriptions/create` */\n async create(\n params: CreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('POST', '/subscriptions/create', { body: params, ...options });\n }\n\n /**\n * Adopt an existing Creem subscription. `POST /subscriptions/adopt`\n *\n * Requires adoption to be enabled on the deployment and `X-Profile-Id` in\n * options.headers. Adoption charges nothing and emits no invoice or webhook.\n * Repeating the processor subscription ID returns the existing DeloPay ID.\n * Retry when handoff_confirmed is false. That flag confirms persistence,\n * not the merchant's external switch-over: stop processing Creem events in\n * your own integration when handing subsequent events to DeloPay.\n */\n async adopt(\n params: AdoptSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<AdoptSubscriptionResponse> {\n return this.request('POST', '/subscriptions/adopt', { body: params, ...options });\n }\n\n /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */\n async retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}`, {\n ...options,\n });\n }\n\n /**\n * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`\n *\n * Like {@link createAndConfirm}, the response may carry a `redirect_url` for\n * processors that require buyer approval.\n */\n async confirm(\n subscriptionId: string,\n params: ConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async update(\n subscriptionId: string,\n params: UpdateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('PUT', `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List subscriptions for the profile, or one customer's with `customer_id`.\n * `GET /subscriptions/list`\n */\n async list(\n params?: SubscriptionListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse[]> {\n return this.request('GET', '/subscriptions/list', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */\n async getEstimate(\n params: SubscriptionEstimateParams,\n options?: RequestExtras,\n ): Promise<SubscriptionEstimateResponse> {\n return this.request('GET', '/subscriptions/estimate', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */\n async getItems(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/subscriptions/items', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * {@link getItems}, with whether the list is only the first part of what the\n * processor holds. `GET /subscriptions/items`\n *\n * The backend states that in the `X-Delopay-Items-Truncated` response\n * header (Stripe Billing lists its first 100 products), which the plain\n * {@link getItems} cannot return. Without `limit` and `offset` every item\n * the billing account offers is listed, up to 500.\n */\n async getItemsPage(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<SubscriptionItemsPage> {\n let truncated = false;\n const items = await this.request<GetSubscriptionItemsResponse[]>(\n 'GET',\n '/subscriptions/items',\n {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n onDownloadProgress: (event) => {\n // The headers arrive with the first event; a retried request reports\n // them again, and the last attempt is the one the items come from.\n truncated = event.headers.get('x-delopay-items-truncated')?.toLowerCase() === 'true';\n options?.onDownloadProgress?.(event);\n },\n },\n );\n return { items, truncated };\n }\n\n /**\n * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n *\n * The body defaults to `{}` so the request still carries\n * `Content-Type: application/json` even when no params are passed — the\n * backend rejects the POST otherwise (\"Unsupported content type\").\n */\n async pause(\n subscriptionId: string,\n params?: PauseSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<PauseSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async resume(\n subscriptionId: string,\n params?: ResumeSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ResumeSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel`\n *\n * A subscription in a state it cannot be cancelled from is refused with\n * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async cancel(\n subscriptionId: string,\n params?: CancelSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<CancelSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Read 1 to 50 subscriptions back from their billing processor and mirror\n * what it reports. `POST /subscriptions/sync`\n *\n * Nothing is written at the processor. A status is mirrored only with the\n * time the processor stamped it with, and never over a newer event already\n * recorded; a plan only with its own stamp. One result per id, in request\n * order; one that fails does not stop the others.\n */\n async sync(\n params: SubscriptionSyncRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionSyncResponse> {\n return this.request('POST', '/subscriptions/sync', { body: params, ...options });\n }\n\n /**\n * Read one subscription back from its billing processor and mirror what it\n * reports, as {@link sync} does, with what the processor reported beside\n * what the mirror now holds. `POST /subscriptions/{subscriptionId}/sync`\n */\n async syncOne(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionSyncResult> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/sync`, {\n ...options,\n });\n }\n\n /**\n * List the subscriptions a billing account holds at its processor, and how\n * each relates to DeloPay's: already held, new (its buyer is a DeloPay\n * customer), needing a customer, ended, or not adoptable here.\n * `POST /subscriptions/import/preview`\n *\n * Reads only; nothing is written here or at the processor. Creem and\n * Stripe Billing can be listed; PayPal cannot, which `capabilities` states\n * (`reason_code: 'listing_unsupported'`).\n */\n async importPreview(\n params: SubscriptionImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportPreviewResponse> {\n return this.request('POST', '/subscriptions/import/preview', { body: params, ...options });\n }\n\n /**\n * Take 1 to 25 processor subscriptions over, each through {@link adopt}\n * with every one of its checks, one after another.\n * `POST /subscriptions/import/apply`\n *\n * One result per selection, in request order; one refused does not stop\n * the others.\n */\n async importApply(\n params: SubscriptionImportApplyRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportApplyResponse> {\n return this.request('POST', '/subscriptions/import/apply', { body: params, ...options });\n }\n\n /**\n * Resolve which of the given payments were raised by a subscription.\n * `POST /subscriptions/payments/lookup`\n *\n * The linkage exists in one direction only — an invoice points at the payment\n * it settled, and nothing is stamped on the payment — so this is the only way\n * to tell a subscription charge from a one-off one when you are holding a\n * page of payments. In particular, do not use `off_session` or the presence\n * of a mandate: an ordinary saved-card charge sets those identically.\n *\n * Ids that belong to no subscription are **absent** from `links` rather than\n * returned as an error, so match on presence:\n *\n * ```ts\n * const { links } = await subscriptions.lookupPayments(\n * { payment_ids: page.map((p) => p.payment_id) },\n * { headers: { 'X-Profile-Id': profileId } },\n * );\n * const bySubscription = new Map(links.map((l) => [l.payment_id, l]));\n * ```\n *\n * Profile-scoped like every other subscription route, and that matters more\n * here than elsewhere: a `payment_id` is merchant-supplied and only unique\n * within a merchant, so the shop is part of the question, not an\n * optimisation. Pass the profile that owns **the payments** — for a list\n * spanning several shops, group the ids by shop and call once per group.\n *\n * At most 200 ids per call.\n */\n async lookupPayments(\n params: SubscriptionPaymentLookupRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionPaymentLookupResponse> {\n return this.request('POST', '/subscriptions/payments/lookup', { body: params, ...options });\n }\n\n /**\n * One subscription's billing history, newest cycle first.\n * `GET /subscriptions/{subscriptionId}/invoices`\n *\n * {@link retrieve} carries only the *latest* invoice, which is the current\n * cycle — a subscription that has renewed monthly for a year has one of those\n * and twelve of these. Use this wherever a merchant needs to see what a\n * subscription has actually billed, in particular on self-charging processors\n * (Creem, PayPal) where each renewal is charged by the processor and mirrored\n * here rather than raised as a DeloPay payment.\n *\n * Two things to render honestly, both decided rather than incidental:\n *\n * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net\n * them: the difference between the two is not a smaller charge.\n * - A `refunded_amount` of `null` is \"not reported\" and must not render as\n * `0`. Likewise a processor-hosted origination records a bootstrap invoice\n * at `0` before the buyer has paid anything, so a zero amount on such a\n * subscription is a placeholder rather than a free cycle.\n *\n * Profile-scoped like every other subscription route.\n */\n async listInvoices(\n subscriptionId: string,\n params?: SubscriptionInvoiceListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceListResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * Which billing processor this shop's subscriptions run on.\n * `GET /subscriptions/billing_processor`\n *\n * The same mapping is derivable from the connector inventory\n * (`GET /account/{merchant_id}/connectors`), but that route is gated by a\n * connector-read permission granted independently of subscriptions — so a\n * role authorised to create subscriptions could be unable to learn which\n * processor it was creating them on. This answers under the same\n * authorization as the rest of the subscription API.\n *\n * Reach for it when the client must branch on the processor *before* calling\n * — origination differs by processor, and guessing is destructive. Resolve\n * the shop's `billing_processor_id` first: a shop that runs no subscriptions\n * has none assigned, and this route has no identity to report for it.\n */\n async getBillingProcessor(\n options?: RequestExtras,\n ): Promise<SubscriptionBillingProcessorResponse> {\n return this.request('GET', '/subscriptions/billing_processor', { ...options });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-CKKNFFKP.cjs","../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA;AC+CO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,eAAA,CAAgB,OAAA,EAA4D;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,8BAAA,EAAgC,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC3E;AAAA;AAAA,EAGA,MAAM,kBAAA,CACJ,MAAA,EACA,OAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,8BAAA,EAAgC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACzF;AAAA;AAAA,EAGA,MAAM,gBAAA,CAAiB,OAAA,EAA+D;AACpF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAAA,EAAiC,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC5E;AAAA,EAEA,MAAM,mBAAA,CACJ,MAAA,EACA,OAAA,EACsC;AACtC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAAA,EAAiC,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC1F;AAAA;AAAA,EAGA,MAAM,eAAA,CACJ,cAAA,EACA,OAAA,EAC8C;AAC9C,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,eAAA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,IAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkC8C,EAAA;AACkC,IAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4B4C,EAAA;AACqC,IAAA;AACtE,MAAA;AACJ,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBiD,EAAA;AAC8B,IAAA;AAC/E,EAAA;AACF;AD1IoF;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-CKKNFFKP.cjs","sourcesContent":[null,"import type {\n BuyerPortalSubscriptionCapabilities,\n NativeShopConfigRequest,\n NativeShopConfigResponse,\n NativeDunningConfigRequest,\n NativeDunningConfigResponse,\n AdoptSubscriptionRequest,\n AdoptSubscriptionResponse,\n CreateSubscriptionRequest,\n CreateAndConfirmSubscriptionRequest,\n ConfirmSubscriptionRequest,\n UpdateSubscriptionRequest,\n PauseSubscriptionRequest,\n ResumeSubscriptionRequest,\n CancelSubscriptionRequest,\n SubscriptionResponse,\n ConfirmSubscriptionResponse,\n PauseSubscriptionResponse,\n ResumeSubscriptionResponse,\n CancelSubscriptionResponse,\n GetSubscriptionItemsResponse,\n GetSubscriptionItemsParams,\n SubscriptionEstimateResponse,\n SubscriptionEstimateParams,\n SubscriptionListParams,\n SubscriptionPaymentLookupRequest,\n SubscriptionPaymentLookupResponse,\n SubscriptionInvoiceListParams,\n SubscriptionInvoiceListResponse,\n SubscriptionBillingProcessorResponse,\n SubscriptionImportApplyRequest,\n SubscriptionImportApplyResponse,\n SubscriptionImportPreviewRequest,\n SubscriptionImportPreviewResponse,\n SubscriptionItemsPage,\n SubscriptionSyncRequest,\n SubscriptionSyncResponse,\n SubscriptionSyncResult,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Subscription endpoints are profile-scoped: the backend requires an\n * `X-Profile-Id` header to resolve the shop / billing processor (`IR_04`\n * otherwise). Pass it through the per-call `options.headers`, e.g.\n * `subscriptions.list(params, { headers: { 'X-Profile-Id': profileId } })`.\n */\nexport class Subscriptions {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native enrollment settings. Pass X-Profile-Id in options.headers. */\n async getNativeConfig(options?: RequestExtras): Promise<NativeShopConfigResponse> {\n return this.request('GET', '/subscriptions/native/config', { ...options });\n }\n\n /** Replace native enrollment settings. Pass X-Profile-Id in options.headers. */\n async updateNativeConfig(\n params: NativeShopConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeShopConfigResponse> {\n return this.request('PUT', '/subscriptions/native/config', { body: params, ...options });\n }\n\n /** Read merchant-wide renewal recovery settings. */\n async getNativeDunning(options?: RequestExtras): Promise<NativeDunningConfigResponse> {\n return this.request('GET', '/subscriptions/native/dunning', { ...options });\n }\n\n async updateNativeDunning(\n params: NativeDunningConfigRequest,\n options?: RequestExtras,\n ): Promise<NativeDunningConfigResponse> {\n return this.request('PUT', '/subscriptions/native/dunning', { body: params, ...options });\n }\n\n /** Read supported actions for an owned subscription. Pass X-Profile-Id in options.headers. */\n async getCapabilities(\n subscriptionId: string,\n options?: RequestExtras,\n ): Promise<BuyerPortalSubscriptionCapabilities> {\n return this.request(\n 'GET',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/capabilities`,\n { ...options },\n );\n }\n\n /**\n * Create and immediately confirm a subscription. `POST /subscriptions`\n *\n * For billing processors that require buyer approval (e.g. PayPal), the\n * response carries a `redirect_url` the customer must be sent to.\n */\n async createAndConfirm(\n params: CreateAndConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', '/subscriptions', { body: params, ...options });\n }\n\n /** Create a subscription without confirming it. `POST /subscriptions/create` */\n async create(\n params: CreateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('POST', '/subscriptions/create', { body: params, ...options });\n }\n\n /**\n * Adopt an existing Creem subscription. `POST /subscriptions/adopt`\n *\n * Requires adoption to be enabled on the deployment and `X-Profile-Id` in\n * options.headers. Adoption charges nothing and emits no invoice or webhook.\n * Repeating the processor subscription ID returns the existing DeloPay ID.\n * Retry when handoff_confirmed is false. That flag confirms persistence,\n * not the merchant's external switch-over: stop processing Creem events in\n * your own integration when handing subsequent events to DeloPay.\n */\n async adopt(\n params: AdoptSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<AdoptSubscriptionResponse> {\n return this.request('POST', '/subscriptions/adopt', { body: params, ...options });\n }\n\n /** Retrieve a subscription by ID. `GET /subscriptions/{subscriptionId}` */\n async retrieve(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}`, {\n ...options,\n });\n }\n\n /**\n * Confirm a previously created subscription. `POST /subscriptions/{subscriptionId}/confirm`\n *\n * Like {@link createAndConfirm}, the response may carry a `redirect_url` for\n * processors that require buyer approval.\n */\n async confirm(\n subscriptionId: string,\n params: ConfirmSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Update a subscription's plan/price. `PUT /subscriptions/{subscriptionId}/update`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async update(\n subscriptionId: string,\n params: UpdateSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n return this.request('PUT', `/subscriptions/${encodeURIComponent(subscriptionId)}/update`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List subscriptions for the profile, or one customer's with `customer_id`.\n * `GET /subscriptions/list`\n */\n async list(\n params?: SubscriptionListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse[]> {\n return this.request('GET', '/subscriptions/list', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** Estimate the cost of a subscription before creating it. `GET /subscriptions/estimate` */\n async getEstimate(\n params: SubscriptionEstimateParams,\n options?: RequestExtras,\n ): Promise<SubscriptionEstimateResponse> {\n return this.request('GET', '/subscriptions/estimate', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /** List purchasable subscription items (plans/addons). `GET /subscriptions/items` */\n async getItems(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<GetSubscriptionItemsResponse[]> {\n return this.request('GET', '/subscriptions/items', {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * {@link getItems}, with whether the list is only the first part of what the\n * processor holds. `GET /subscriptions/items`\n *\n * The backend states that in the `X-Delopay-Items-Truncated` response\n * header (Stripe Billing lists its first 100 products), which the plain\n * {@link getItems} cannot return. Without `limit` and `offset` every item\n * the billing account offers is listed, up to 500.\n */\n async getItemsPage(\n params: GetSubscriptionItemsParams,\n options?: RequestExtras,\n ): Promise<SubscriptionItemsPage> {\n let truncated = false;\n const items = await this.request<GetSubscriptionItemsResponse[]>(\n 'GET',\n '/subscriptions/items',\n {\n query: params as unknown as Record<string, string | number | undefined>,\n ...options,\n onDownloadProgress: (event) => {\n // The headers arrive with the first event; a retried request reports\n // them again, and the last attempt is the one the items come from.\n truncated = event.headers.get('x-delopay-items-truncated')?.toLowerCase() === 'true';\n options?.onDownloadProgress?.(event);\n },\n },\n );\n return { items, truncated };\n }\n\n /**\n * Pause a subscription. `POST /subscriptions/{subscriptionId}/pause`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n *\n * The body defaults to `{}` so the request still carries\n * `Content-Type: application/json` even when no params are passed — the\n * backend rejects the POST otherwise (\"Unsupported content type\").\n */\n async pause(\n subscriptionId: string,\n params?: PauseSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<PauseSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/pause`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Resume a paused subscription. `POST /subscriptions/{subscriptionId}/resume`\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async resume(\n subscriptionId: string,\n params?: ResumeSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<ResumeSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/resume`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Cancel a subscription. `POST /subscriptions/{subscriptionId}/cancel`\n *\n * A subscription in a state it cannot be cancelled from is refused with\n * `DE_11`; `error.data.reason` then names why (`SubscriptionActionRefusal`).\n *\n * From the dashboard this counts against the caller's `subscription_change`\n * operation limit; an over-limit call fails with `DE_01` and nothing reaches\n * the processor. Calls made with an API key are not limited.\n */\n async cancel(\n subscriptionId: string,\n params?: CancelSubscriptionRequest,\n options?: RequestExtras,\n ): Promise<CancelSubscriptionResponse> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/cancel`, {\n body: params ?? {},\n ...options,\n });\n }\n\n /**\n * Read 1 to 50 subscriptions back from their billing processor and mirror\n * what it reports. `POST /subscriptions/sync`\n *\n * Nothing is written at the processor. A status is mirrored only with the\n * time the processor stamped it with, and never over a newer event already\n * recorded; a plan only with its own stamp. One result per id, in request\n * order; one that fails does not stop the others.\n */\n async sync(\n params: SubscriptionSyncRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionSyncResponse> {\n return this.request('POST', '/subscriptions/sync', { body: params, ...options });\n }\n\n /**\n * Read one subscription back from its billing processor and mirror what it\n * reports, as {@link sync} does, with what the processor reported beside\n * what the mirror now holds. `POST /subscriptions/{subscriptionId}/sync`\n */\n async syncOne(subscriptionId: string, options?: RequestExtras): Promise<SubscriptionSyncResult> {\n return this.request('POST', `/subscriptions/${encodeURIComponent(subscriptionId)}/sync`, {\n ...options,\n });\n }\n\n /**\n * List the subscriptions a billing account holds at its processor, and how\n * each relates to DeloPay's: already held, new (its buyer is a DeloPay\n * customer), needing a customer, ended, or not adoptable here.\n * `POST /subscriptions/import/preview`\n *\n * Reads only; nothing is written here or at the processor. Creem and\n * Stripe Billing can be listed; PayPal cannot, which `capabilities` states\n * (`reason_code: 'listing_unsupported'`).\n */\n async importPreview(\n params: SubscriptionImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportPreviewResponse> {\n return this.request('POST', '/subscriptions/import/preview', { body: params, ...options });\n }\n\n /**\n * Take 1 to 25 processor subscriptions over, each through {@link adopt}\n * with every one of its checks, one after another.\n * `POST /subscriptions/import/apply`\n *\n * One result per selection, in request order; one refused does not stop\n * the others.\n */\n async importApply(\n params: SubscriptionImportApplyRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionImportApplyResponse> {\n return this.request('POST', '/subscriptions/import/apply', { body: params, ...options });\n }\n\n /**\n * Resolve which of the given payments were raised by a subscription.\n * `POST /subscriptions/payments/lookup`\n *\n * The linkage exists in one direction only — an invoice points at the payment\n * it settled, and nothing is stamped on the payment — so this is the only way\n * to tell a subscription charge from a one-off one when you are holding a\n * page of payments. In particular, do not use `off_session` or the presence\n * of a mandate: an ordinary saved-card charge sets those identically.\n *\n * Ids that belong to no subscription are **absent** from `links` rather than\n * returned as an error, so match on presence:\n *\n * ```ts\n * const { links } = await subscriptions.lookupPayments(\n * { payment_ids: page.map((p) => p.payment_id) },\n * { headers: { 'X-Profile-Id': profileId } },\n * );\n * const bySubscription = new Map(links.map((l) => [l.payment_id, l]));\n * ```\n *\n * Profile-scoped like every other subscription route, and that matters more\n * here than elsewhere: a `payment_id` is merchant-supplied and only unique\n * within a merchant, so the shop is part of the question, not an\n * optimisation. Pass the profile that owns **the payments** — for a list\n * spanning several shops, group the ids by shop and call once per group.\n *\n * At most 200 ids per call.\n */\n async lookupPayments(\n params: SubscriptionPaymentLookupRequest,\n options?: RequestExtras,\n ): Promise<SubscriptionPaymentLookupResponse> {\n return this.request('POST', '/subscriptions/payments/lookup', { body: params, ...options });\n }\n\n /**\n * One subscription's billing history, newest cycle first.\n * `GET /subscriptions/{subscriptionId}/invoices`\n *\n * {@link retrieve} carries only the *latest* invoice, which is the current\n * cycle — a subscription that has renewed monthly for a year has one of those\n * and twelve of these. Use this wherever a merchant needs to see what a\n * subscription has actually billed, in particular on self-charging processors\n * (Creem, PayPal) where each renewal is charged by the processor and mirrored\n * here rather than raised as a DeloPay payment.\n *\n * Two things to render honestly, both decided rather than incidental:\n *\n * - `amount` is **gross** and `refunded_amount` sits beside it. Do not net\n * them: the difference between the two is not a smaller charge.\n * - A `refunded_amount` of `null` is \"not reported\" and must not render as\n * `0`. Likewise a processor-hosted origination records a bootstrap invoice\n * at `0` before the buyer has paid anything, so a zero amount on such a\n * subscription is a placeholder rather than a free cycle.\n *\n * Profile-scoped like every other subscription route.\n */\n async listInvoices(\n subscriptionId: string,\n params?: SubscriptionInvoiceListParams,\n options?: RequestExtras,\n ): Promise<SubscriptionInvoiceListResponse> {\n return this.request('GET', `/subscriptions/${encodeURIComponent(subscriptionId)}/invoices`, {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * Which billing processor this shop's subscriptions run on.\n * `GET /subscriptions/billing_processor`\n *\n * The same mapping is derivable from the connector inventory\n * (`GET /account/{merchant_id}/connectors`), but that route is gated by a\n * connector-read permission granted independently of subscriptions — so a\n * role authorised to create subscriptions could be unable to learn which\n * processor it was creating them on. This answers under the same\n * authorization as the rest of the subscription API.\n *\n * Reach for it when the client must branch on the processor *before* calling\n * — origination differs by processor, and guessing is destructive. Resolve\n * the shop's `billing_processor_id` first: a shop that runs no subscriptions\n * has none assigned, and this route has no identity to report for it.\n */\n async getBillingProcessor(\n options?: RequestExtras,\n ): Promise<SubscriptionBillingProcessorResponse> {\n return this.request('GET', '/subscriptions/billing_processor', { ...options });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-CR3JBTP3.cjs","../src/internal/resources/adminBranding.ts"],"names":[],"mappings":"AAAA;ACYO,IAAM,cAAA,EAAN,MAAoB;AAAA,EACzB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,OAAA,EAAyD;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EACrE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACgC;AAChC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,wBAAA,EAA0B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACnF;AACF,CAAA;ADbA;AACA;AACE;AACF,sCAAC","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-CR3JBTP3.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../../client';\nimport type { BrandingAdminResponse, BrandingUpdateRequest } from '../types';\n\n/**\n * The deployment's branding as the platform operator edits it: name, logos,\n * favicon, email font and accent, and the default checkout, status page and\n * redirect page colours.\n *\n * Needs the admin API key or an internal user with permission to change\n * accounts, for reading too. Every change is recorded in the audit log as a\n * change of the setting `deployment.branding` (`entity_type: 'setting'`).\n */\nexport class AdminBranding {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * What is saved, the value in force for each unset field, and the revision\n * to send back on the next update.\n *\n * `GET /admin-portal/branding`\n */\n async retrieve(options?: RequestExtras): Promise<BrandingAdminResponse> {\n return this.request('GET', '/admin-portal/branding', { ...options });\n }\n\n /**\n * Replace the whole branding; all fields `null` clears it. A changed image\n * or font address is fetched first and refused unless it answers with the\n * right kind of file. A stale `expected_revision` is refused and changes\n * nothing.\n *\n * `PUT /admin-portal/branding`\n */\n async update(\n params: BrandingUpdateRequest,\n options?: RequestExtras,\n ): Promise<BrandingAdminResponse> {\n return this.request('PUT', '/admin-portal/branding', { body: params, ...options });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-DJASVBOJ.cjs","../src/resources/shopLabels.ts"],"names":[],"mappings":"AAAA;ACUA,IAAM,WAAA,EAAa,CAAC,UAAA,EAAA,GAClB,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,wBAAA,CAAA;AAcrC,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,IAAA,CAAK,UAAA,EAAkD;AAC3D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,UAAA,CAAW,UAAU,CAAC,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CAAO,UAAA,EAAoB,MAAA,EAA4D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,CAAW,UAAU,CAAA,EAAG,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,MAAA,CACJ,UAAA,EACA,OAAA,EACA,MAAA,EAC4B;AAC5B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,OAAA,EAAS,CAAA,EAAA;AACrB,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAMiC,EAAA;AACD,IAAA;AAChC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUE,EAAA;AAGY,IAAA;AACV,MAAA;AACY,MAAA;AACG,MAAA;AACjB,IAAA;AACF,EAAA;AACF;ADjCkC;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-DJASVBOJ.cjs","sourcesContent":[null,"import type {\n ShopLabelCreateRequest,\n ShopLabelDeleteResponse,\n ShopLabelResponse,\n ShopLabelsResponse,\n ShopLabelsSetRequest,\n ShopLabelUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nconst labelsPath = (merchantId: string): string =>\n `/account/${encodeURIComponent(merchantId)}/business-profile/labels`;\n\n/**\n * Shop labels: the merchant's own tags for grouping shops, for example by\n * industry, brand or region. A shop can carry several\n * labels and a label is shared by every shop of the merchant. Labels are\n * separate from projects and change nothing about a shop's project, payments\n * or routing.\n *\n * Reading needs the `Account` area at `Read`; every change needs `Write`.\n * Renaming and deleting change every shop that carries the label, so a caller\n * limited to one shop may not do either; it may create labels and set its own\n * shop's labels. Labels of one merchant are never visible to another.\n */\nexport class ShopLabels {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every label of the merchant, ordered by name, each with the ids of the\n * shops that carry it. A shop with several labels appears under each of\n * them; a shop with none appears under no label. A caller limited to one\n * shop sees every label but only its own shop in `profile_ids`.\n * `GET /account/{merchantId}/business-profile/labels`\n */\n async list(merchantId: string): Promise<ShopLabelResponse[]> {\n return this.request('GET', labelsPath(merchantId));\n }\n\n /**\n * Create a label. The name is trimmed and inner whitespace collapsed; a\n * name that differs from an existing label only in letter case is refused\n * (`IR_38`), so one category is never spelled two ways. A merchant holds at\n * most 200 labels.\n * `POST /account/{merchantId}/business-profile/labels`\n */\n async create(merchantId: string, params: ShopLabelCreateRequest): Promise<ShopLabelResponse> {\n return this.request('POST', labelsPath(merchantId), { body: params });\n }\n\n /**\n * Rename a label on every shop that carries it.\n * `PATCH /account/{merchantId}/business-profile/labels/{labelId}`\n */\n async update(\n merchantId: string,\n labelId: string,\n params: ShopLabelUpdateRequest,\n ): Promise<ShopLabelResponse> {\n return this.request('PATCH', `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`, {\n body: params,\n });\n }\n\n /**\n * Delete a label and remove it from every shop. The shops are unchanged.\n * `DELETE /account/{merchantId}/business-profile/labels/{labelId}`\n */\n async delete(merchantId: string, labelId: string): Promise<ShopLabelDeleteResponse> {\n return this.request('DELETE', `${labelsPath(merchantId)}/${encodeURIComponent(labelId)}`);\n }\n\n /**\n * Replace the labels of one shop: `label_ids` is the complete set\n * afterwards, so a label left out is removed from the shop and an empty\n * list removes them all. At most 20 per shop.\n * `PUT /account/{merchantId}/business-profile/{profileId}/labels`\n */\n async setForShop(\n merchantId: string,\n profileId: string,\n params: ShopLabelsSetRequest,\n ): Promise<ShopLabelsResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/business-profile/${encodeURIComponent(profileId)}/labels`,\n { body: params },\n );\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Delopay
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OOC7ZT4T.js";
|
|
4
4
|
import {
|
|
5
5
|
DelopayError
|
|
6
6
|
} from "./chunk-37BJUQ32.js";
|
|
@@ -1035,4 +1035,4 @@ var CheckoutSession = class {
|
|
|
1035
1035
|
export {
|
|
1036
1036
|
CheckoutSession
|
|
1037
1037
|
};
|
|
1038
|
-
//# sourceMappingURL=chunk-
|
|
1038
|
+
//# sourceMappingURL=chunk-EBA6DJKI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/w6pub/delopay-typescript-sdk/dist/chunk-EEB2HDYL.cjs","../src/resources/industries.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAA,EAAoD;AACxD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAsB,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,WAAA,CACJ,MAAA,EACA,OAAA,EACiC;AACjC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB,EAAE,IAAA,EAAM,MAAA,EAAQ,KAAA,EAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAA;AAAA,EAC5F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAA,CAAc,OAAA,EAA+D;AACjF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,QAAA,EAAU,sBAAA,EAAwB,EAAE,KAAA,EAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAA;AAAA,EACjF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,eAAA,CAAgB,SAAA,EAAoD;AACxE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EA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E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,cAAA,CAAe,MAAA,EAA6B,CAAC,CAAA,EAAkC;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,6BAAA,EAA+B,EAAE,KAAA,EAAO,EAAE,GAAG,MAAM,EAAE,CAAC,CAAA;AAAA,EACnF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAA,CACJ,SAAA,EACA,MAAA,EAA6B,CAAC,CAAA,EACC;AAC/B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,EAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASE,EAAA;AAE2B,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS0C,EAAA;AACb,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUwE,EAAA;AAC1C,IAAA;AAC9B,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASoC,EAAA;AACd,IAAA;AACtB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaE,EAAA;AAEoB,IAAA;AACtB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASyE,EAAA;AAC5C,IAAA;AAC7B,EAAA;AACF;AAEgD;AACvC,EAAA;AACT;AAE6C;AACf,EAAA;AAC9B;AAE6C;AACjB,EAAA;AAC5B;AD1FgC;AACA;AACA;AACA","file":"/tmp/w6pub/delopay-typescript-sdk/dist/chunk-EEB2HDYL.cjs","sourcesContent":[null,"import type {\n IndustryApplyQuery,\n IndustryChangeImpact,\n IndustryClassification,\n IndustryImpactQuery,\n IndustrySelectionRequest,\n IndustrySuggestQuery,\n IndustrySuggestions,\n OwnIndustry,\n OwnIndustryCreateRequest,\n OwnIndustryList,\n OwnIndustryRemoveQuery,\n OwnIndustryRemoved,\n OwnIndustryRenameRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * The industry of the caller's merchant, its projects and its shops.\n *\n * One primary industry per merchant, project or shop: an industry or a\n * sub-industry, which implies its industry. A shop without its own selection\n * inherits the nearest one of its project and that project's parents, then the\n * merchant's. A project inherits from its parents, then the merchant. Every\n * call answers the target's `IndustryClassification`: what is stored there,\n * what it inherits, what applies, what can be selected and whether the caller\n * may change it.\n *\n * Classification only: payments, routing, risk policies, the merchant\n * category code and shop labels do not read it, and a change writes none of\n * them. Every change is recorded in the audit log\n * (`entity_type: 'industry_selection'`).\n *\n * A payment counts in the industry its shop had when the payment was created.\n * Every write that changes a shop's industry takes an optional\n * `IndustryApplyQuery`: which of its existing payments follow the change\n * (`all`, the default; from a `from_date`; or from today). The `impact*`\n * methods preview how many would move before writing. Besides DeloPay's\n * industries, a merchant can define its own (`createOwn`), which only it sees\n * and selects.\n *\n * Dashboard (JWT) routes; the merchant comes from the token. Reading needs\n * `MerchantIndustryRead` (merchant, project) or `ProfileIndustryRead` (shop);\n * changing needs `MerchantIndustryWrite`, `MerchantIndustryEdit` or\n * `ProfileIndustryEdit`. A scope the caller may not address answers 403\n * (`IR_22`); a project or shop the merchant does not hold answers 404\n * (`IR_37`); an id that cannot be selected there answers 400 (`IR_16`).\n */\nexport class Industries {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's industry: the default its projects and shops inherit.\n *\n * `GET /industries/merchant`\n */\n async retrieveMerchant(): Promise<IndustryClassification> {\n return this.request('GET', '/industries/merchant');\n }\n\n /**\n * Select the merchant's industry.\n *\n * `PUT /industries/merchant`\n */\n async setMerchant(\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', '/industries/merchant', { body: params, query: { ...options } });\n }\n\n /**\n * Clear the merchant's industry.\n *\n * `DELETE /industries/merchant`\n */\n async clearMerchant(options?: IndustryApplyQuery): Promise<IndustryClassification> {\n return this.request('DELETE', '/industries/merchant', { query: { ...options } });\n }\n\n /**\n * One project's industry.\n *\n * `GET /industries/projects/{projectId}`\n */\n async retrieveProject(projectId: string): Promise<IndustryClassification> {\n return this.request('GET', projectPath(projectId));\n }\n\n /**\n * Select one project's industry.\n *\n * `PUT /industries/projects/{projectId}`\n */\n async setProject(\n projectId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', projectPath(projectId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one project's industry, so it inherits again.\n *\n * `DELETE /industries/projects/{projectId}`\n */\n async clearProject(\n projectId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', projectPath(projectId), { query: { ...options } });\n }\n\n /**\n * One shop's industry.\n *\n * `GET /industries/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<IndustryClassification> {\n return this.request('GET', shopPath(profileId));\n }\n\n /**\n * Select one shop's industry.\n *\n * `PUT /industries/shops/{profileId}`\n */\n async setShop(\n profileId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', shopPath(profileId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one shop's industry, so it inherits again.\n *\n * `DELETE /industries/shops/{profileId}`\n */\n async clearShop(\n profileId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', shopPath(profileId), { query: { ...options } });\n }\n\n /**\n * What selecting `industry_id` for the merchant (or clearing it, when\n * omitted) would move: the shops whose effective industry changes and their\n * payments, test and live, in total, from `from_date` and from today.\n * Writes nothing. Same permission as reading the classification.\n *\n * `GET /industries/merchant/impact`\n */\n async impactMerchant(query: IndustryImpactQuery = {}): Promise<IndustryChangeImpact> {\n return this.request('GET', '/industries/merchant/impact', { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one project's selection.\n *\n * `GET /industries/projects/{projectId}/impact`\n */\n async impactProject(\n projectId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${projectPath(projectId)}/impact`, { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one shop's selection.\n *\n * `GET /industries/shops/{profileId}/impact`\n */\n async impactShop(\n profileId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${shopPath(profileId)}/impact`, { query: { ...query } });\n }\n\n /**\n * The merchant's own industries: the active ones, and those mapped to one of\n * DeloPay's in the last 90 days, with the selections naming each. Needs\n * `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/own`\n */\n async listOwn(): Promise<OwnIndustryList> {\n return this.request('GET', '/industries/own');\n }\n\n /**\n * Define an industry only this merchant sees and selects, optionally under\n * one of DeloPay's industries it can select. It never has sub-industries; at\n * most 100 are active at once (422, `IR_06`). Needs `MerchantIndustryWrite`\n * at merchant level.\n *\n * `POST /industries/own`\n */\n async createOwn(params: OwnIndustryCreateRequest): Promise<OwnIndustry> {\n return this.request('POST', '/industries/own', { body: params });\n }\n\n /**\n * Rename an active own industry. With `apply_to` `from` or `today` the answer\n * is the new own industry that carries the new name (see\n * `OwnIndustryRenameRequest`). Needs `MerchantIndustryWrite`.\n *\n * `PATCH /industries/own/{industryId}`\n */\n async renameOwn(industryId: string, params: OwnIndustryRenameRequest): Promise<OwnIndustry> {\n return this.request('PATCH', ownPath(industryId), { body: params });\n }\n\n /**\n * Archive an active own industry. While a selection names it, `replacement`\n * is required: an industry the merchant can select, which every such\n * selection then names, or `'inherit'`, which clears them. The shops whose\n * industry changes move their payments from `apply_to` on. Needs\n * `MerchantIndustryWrite`.\n *\n * `DELETE /industries/own/{industryId}`\n */\n async removeOwn(\n industryId: string,\n query: OwnIndustryRemoveQuery = {},\n ): Promise<OwnIndustryRemoved> {\n return this.request('DELETE', ownPath(industryId), { query: { ...query } });\n }\n\n /**\n * At most three of DeloPay's industries and sub-industries the merchant can\n * select that are like `name`, closest first: a hint before defining an own\n * industry. Needs `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/suggest`\n */\n async suggest(query: IndustrySuggestQuery): Promise<IndustrySuggestions> {\n return this.request('GET', '/industries/suggest', { query: { ...query } });\n }\n}\n\nfunction projectPath(projectId: string): string {\n return `/industries/projects/${encodeURIComponent(projectId)}`;\n}\n\nfunction shopPath(profileId: string): string {\n return `/industries/shops/${encodeURIComponent(profileId)}`;\n}\n\nfunction ownPath(industryId: string): string {\n return `/industries/own/${encodeURIComponent(industryId)}`;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-EEB2HDYL.cjs","../src/resources/industries.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,gBAAA,CAAA,EAAoD;AACxD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAsB,CAAA;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,WAAA,CACJ,MAAA,EACA,OAAA,EACiC;AACjC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB,EAAE,IAAA,EAAM,MAAA,EAAQ,KAAA,EAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAA;AAAA,EAC5F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAA,CAAc,OAAA,EAA+D;AACjF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,QAAA,EAAU,sBAAA,EAAwB,EAAE,KAAA,EAAO,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAA;AA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":[null,"import type {\n IndustryApplyQuery,\n IndustryChangeImpact,\n IndustryClassification,\n IndustryImpactQuery,\n IndustrySelectionRequest,\n IndustrySuggestQuery,\n IndustrySuggestions,\n OwnIndustry,\n OwnIndustryCreateRequest,\n OwnIndustryList,\n OwnIndustryRemoveQuery,\n OwnIndustryRemoved,\n OwnIndustryRenameRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * The industry of the caller's merchant, its projects and its shops.\n *\n * One primary industry per merchant, project or shop: an industry or a\n * sub-industry, which implies its industry. A shop without its own selection\n * inherits the nearest one of its project and that project's parents, then the\n * merchant's. A project inherits from its parents, then the merchant. Every\n * call answers the target's `IndustryClassification`: what is stored there,\n * what it inherits, what applies, what can be selected and whether the caller\n * may change it.\n *\n * Classification only: payments, routing, risk policies, the merchant\n * category code and shop labels do not read it, and a change writes none of\n * them. Every change is recorded in the audit log\n * (`entity_type: 'industry_selection'`).\n *\n * A payment counts in the industry its shop had when the payment was created.\n * Every write that changes a shop's industry takes an optional\n * `IndustryApplyQuery`: which of its existing payments follow the change\n * (`all`, the default; from a `from_date`; or from today). The `impact*`\n * methods preview how many would move before writing. Besides DeloPay's\n * industries, a merchant can define its own (`createOwn`), which only it sees\n * and selects.\n *\n * Dashboard (JWT) routes; the merchant comes from the token. Reading needs\n * `MerchantIndustryRead` (merchant, project) or `ProfileIndustryRead` (shop);\n * changing needs `MerchantIndustryWrite`, `MerchantIndustryEdit` or\n * `ProfileIndustryEdit`. A scope the caller may not address answers 403\n * (`IR_22`); a project or shop the merchant does not hold answers 404\n * (`IR_37`); an id that cannot be selected there answers 400 (`IR_16`).\n */\nexport class Industries {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The merchant's industry: the default its projects and shops inherit.\n *\n * `GET /industries/merchant`\n */\n async retrieveMerchant(): Promise<IndustryClassification> {\n return this.request('GET', '/industries/merchant');\n }\n\n /**\n * Select the merchant's industry.\n *\n * `PUT /industries/merchant`\n */\n async setMerchant(\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', '/industries/merchant', { body: params, query: { ...options } });\n }\n\n /**\n * Clear the merchant's industry.\n *\n * `DELETE /industries/merchant`\n */\n async clearMerchant(options?: IndustryApplyQuery): Promise<IndustryClassification> {\n return this.request('DELETE', '/industries/merchant', { query: { ...options } });\n }\n\n /**\n * One project's industry.\n *\n * `GET /industries/projects/{projectId}`\n */\n async retrieveProject(projectId: string): Promise<IndustryClassification> {\n return this.request('GET', projectPath(projectId));\n }\n\n /**\n * Select one project's industry.\n *\n * `PUT /industries/projects/{projectId}`\n */\n async setProject(\n projectId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', projectPath(projectId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one project's industry, so it inherits again.\n *\n * `DELETE /industries/projects/{projectId}`\n */\n async clearProject(\n projectId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', projectPath(projectId), { query: { ...options } });\n }\n\n /**\n * One shop's industry.\n *\n * `GET /industries/shops/{profileId}`\n */\n async retrieveShop(profileId: string): Promise<IndustryClassification> {\n return this.request('GET', shopPath(profileId));\n }\n\n /**\n * Select one shop's industry.\n *\n * `PUT /industries/shops/{profileId}`\n */\n async setShop(\n profileId: string,\n params: IndustrySelectionRequest,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('PUT', shopPath(profileId), { body: params, query: { ...options } });\n }\n\n /**\n * Clear one shop's industry, so it inherits again.\n *\n * `DELETE /industries/shops/{profileId}`\n */\n async clearShop(\n profileId: string,\n options?: IndustryApplyQuery,\n ): Promise<IndustryClassification> {\n return this.request('DELETE', shopPath(profileId), { query: { ...options } });\n }\n\n /**\n * What selecting `industry_id` for the merchant (or clearing it, when\n * omitted) would move: the shops whose effective industry changes and their\n * payments, test and live, in total, from `from_date` and from today.\n * Writes nothing. Same permission as reading the classification.\n *\n * `GET /industries/merchant/impact`\n */\n async impactMerchant(query: IndustryImpactQuery = {}): Promise<IndustryChangeImpact> {\n return this.request('GET', '/industries/merchant/impact', { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one project's selection.\n *\n * `GET /industries/projects/{projectId}/impact`\n */\n async impactProject(\n projectId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${projectPath(projectId)}/impact`, { query: { ...query } });\n }\n\n /**\n * As `impactMerchant`, for one shop's selection.\n *\n * `GET /industries/shops/{profileId}/impact`\n */\n async impactShop(\n profileId: string,\n query: IndustryImpactQuery = {},\n ): Promise<IndustryChangeImpact> {\n return this.request('GET', `${shopPath(profileId)}/impact`, { query: { ...query } });\n }\n\n /**\n * The merchant's own industries: the active ones, and those mapped to one of\n * DeloPay's in the last 90 days, with the selections naming each. Needs\n * `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/own`\n */\n async listOwn(): Promise<OwnIndustryList> {\n return this.request('GET', '/industries/own');\n }\n\n /**\n * Define an industry only this merchant sees and selects, optionally under\n * one of DeloPay's industries it can select. It never has sub-industries; at\n * most 100 are active at once (422, `IR_06`). Needs `MerchantIndustryWrite`\n * at merchant level.\n *\n * `POST /industries/own`\n */\n async createOwn(params: OwnIndustryCreateRequest): Promise<OwnIndustry> {\n return this.request('POST', '/industries/own', { body: params });\n }\n\n /**\n * Rename an active own industry. With `apply_to` `from` or `today` the answer\n * is the new own industry that carries the new name (see\n * `OwnIndustryRenameRequest`). Needs `MerchantIndustryWrite`.\n *\n * `PATCH /industries/own/{industryId}`\n */\n async renameOwn(industryId: string, params: OwnIndustryRenameRequest): Promise<OwnIndustry> {\n return this.request('PATCH', ownPath(industryId), { body: params });\n }\n\n /**\n * Archive an active own industry. While a selection names it, `replacement`\n * is required: an industry the merchant can select, which every such\n * selection then names, or `'inherit'`, which clears them. The shops whose\n * industry changes move their payments from `apply_to` on. Needs\n * `MerchantIndustryWrite`.\n *\n * `DELETE /industries/own/{industryId}`\n */\n async removeOwn(\n industryId: string,\n query: OwnIndustryRemoveQuery = {},\n ): Promise<OwnIndustryRemoved> {\n return this.request('DELETE', ownPath(industryId), { query: { ...query } });\n }\n\n /**\n * At most three of DeloPay's industries and sub-industries the merchant can\n * select that are like `name`, closest first: a hint before defining an own\n * industry. Needs `MerchantIndustryRead` at merchant level.\n *\n * `GET /industries/suggest`\n */\n async suggest(query: IndustrySuggestQuery): Promise<IndustrySuggestions> {\n return this.request('GET', '/industries/suggest', { query: { ...query } });\n }\n}\n\nfunction projectPath(projectId: string): string {\n return `/industries/projects/${encodeURIComponent(projectId)}`;\n}\n\nfunction shopPath(profileId: string): string {\n return `/industries/shops/${encodeURIComponent(profileId)}`;\n}\n\nfunction ownPath(industryId: string): string {\n return `/industries/own/${encodeURIComponent(industryId)}`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-ENPSUWTS.cjs","../src/internal/resources/connectorRestrictions.ts"],"names":[],"mappings":"AAAA;ACWO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,MAAA,CAAO,IAAA,EAAgF;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,+BAAA,EAAiC,EAAE,KAAK,CAAC,CAAA;AAAA,EACvE;AAAA,EAEA,MAAM,IAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,+BAA+B,CAAA;AAAA,EAC5D;AAAA,EAEA,MAAM,QAAA,CAAS,aAAA,EAA8D;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,8BAAA,EAAiC,kBAAA,CAAmB,aAAa,CAAC,CAAA;AAAA,IAAA;AACpE,EAAA;AACF;AAAA,EAAA;AAIE,IAAA;AAAY,MAAA;AACV,MAAA;AACkE,IAAA;AACpE,EAAA;AAEJ;ADXA;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-ENPSUWTS.cjs","sourcesContent":[null,"import type { ConnectorRestrictionResponse, UpsertConnectorRestrictionRequest } from '../types';\nimport type { RequestFn } from '../../client';\n\n/**\n * Admin-only allowlist for phased connector rollouts.\n *\n * Default-open semantics: a connector with no restriction row is\n * usable by every merchant (current behavior). A connector with a\n * row is gated — only merchants in `allowed_merchant_ids` can attach\n * a connector account. Enforced server-side at MCA-create time.\n */\nexport class ConnectorRestrictions {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Idempotent upsert. If a row exists for `connector_name`, its\n * allowlist + reason are replaced. To open the connector to\n * everyone again, call `delete()`.\n */\n async upsert(body: UpsertConnectorRestrictionRequest): Promise<ConnectorRestrictionResponse> {\n return this.request('POST', '/admin/connector-restrictions', { body });\n }\n\n async list(): Promise<ConnectorRestrictionResponse[]> {\n return this.request('GET', '/admin/connector-restrictions');\n }\n\n async retrieve(connectorName: string): Promise<ConnectorRestrictionResponse> {\n return this.request(\n 'GET',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n\n /** Removing the row makes the connector public again. */\n async delete(connectorName: string): Promise<{ connector_name: string; deleted: boolean }> {\n return this.request(\n 'DELETE',\n `/admin/connector-restrictions/${encodeURIComponent(connectorName)}`,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/w6pub/delopay-typescript-sdk/dist/chunk-EQ6P6ZND.cjs","../src/feeProgram.ts"],"names":[],"mappings":"AAAA;ACoCO,SAAS,IAAA,CACd,GAAA,EACA,UAAA,EACA,KAAA,EAC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KAAA,CAAM,QAAA;AACtE,IAAA,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,EAAE,IAAA,EAAM,KAAA,CAAM,IAAA,EAAM,kBAAA,EAAoB,WAAW,CAAC,CAAA;AACpE,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA,EAGA,SAAA,CAAU,GAAA,EAAyB;AACjC,IAAA,IAAA,CAAK,WAAA,EAAa,WAAA,CAAY,GAAG,CAAA;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA,EAGA,KAAA,CAAA,EAA4B;AAC1B,IAAA,OAAO;AAAA,MACL,gBAAA,EAAkB,EAAE,GAAA,EAAK,IAAA,CAAK,WAAW,CAAA;AAAA,MACzC,KAAA,EAAO,IAAA,CAAK,KAAA;AAAA,MACZ,QAAA,EAAU,CAAC;AAAA,IACb,CAAA;AAAA,EACF;AACF,CAAA;AAGO,SAAS,UAAA,CAAA,EAAgC;AAC9C,EAAA,OAAO,IAAI,iBAAA,CAAkB,CAAA;AAC/B;AD7MA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6VAAC","file":"/tmp/w6pub/delopay-typescript-sdk/dist/chunk-EQ6P6ZND.cjs","sourcesContent":[null,"import type {\n Connector,\n Currency,\n EuclidComparison,\n EuclidComparisonType,\n EuclidIfStatement,\n EuclidValue,\n PaymentMethod,\n PlatformFeeKind,\n PlatformFeeOutput,\n PlatformFeeProgram,\n PlatformFeeRule,\n RuleSchedule,\n} from './types';\n\n/** A single condition leaf in the builder's condition tree. */\nexport interface LeafNode {\n kind: 'leaf';\n lhs: string;\n comparison: EuclidComparisonType;\n value: EuclidValue;\n}\n\n/** An AND (`all`) or OR (`any`) group of condition nodes. */\nexport interface GroupNode {\n kind: 'all' | 'any';\n children: ConditionNode[];\n}\n\nexport type ConditionNode = LeafNode | GroupNode;\n\n/**\n * A condition leaf. Numeric values (amount, merchant_volume) tag as `number`;\n * string values (payment_method, connector, currency, card_network) tag as\n * `enum_variant`.\n */\nexport function leaf(\n lhs: string,\n comparison: EuclidComparisonType,\n value: string | number,\n): LeafNode {\n const tagged: EuclidValue =\n typeof value === 'number' ? { type: 'number', value } : { type: 'enum_variant', value };\n return { kind: 'leaf', lhs, comparison, value: tagged };\n}\n\n/**\n * A condition on one entry of the payment's merchant-supplied metadata (the\n * `routing_parameters` string map). `equal` and `not_equal` compare the\n * stored string with `value`; a payment without the key never matches `equal`.\n */\nexport function metadataLeaf(\n key: string,\n comparison: 'equal' | 'not_equal',\n value: string,\n): LeafNode {\n return {\n kind: 'leaf',\n lhs: 'metadata',\n comparison,\n value: { type: 'metadata_variant', value: { key, value } },\n };\n}\n\n/** AND group — all children must match. */\nexport function allOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'all', children };\n}\n\n/** OR group — any child matching is enough. */\nexport function anyOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'any', children };\n}\n\n/**\n * How a rule (or the default) prices a transaction. `fee_type` is inferred:\n * percentage-only → `percentage`, flat-only → `flat`, both → `combined`.\n */\nexport interface FeeSpecInput {\n /** Percentage fee, e.g. `2.5` means 2.5%. */\n percentage?: number;\n /** Flat fee in minor units. */\n flat?: number;\n /** ISO 4217 currency for the flat fee. */\n flatCurrency?: string;\n /** Clamp floor in minor units. */\n min?: number;\n /** Clamp ceiling in minor units. */\n max?: number;\n}\n\n/**\n * Friendly conditions for a rule. Every provided key becomes one condition and\n * they are ANDed together. For dimensions not covered here (payment-method-type\n * keys like `crypto`/`wallet`, metadata, value arrays) use `rawConditions`.\n */\nexport interface FeeRuleConditions {\n paymentMethod?: PaymentMethod;\n connector?: Connector;\n currency?: Currency;\n cardNetwork?: string;\n /**\n * Customer billing-address country. Must be the exact backend `Country` enum\n * variant (PascalCase full name, e.g. `Germany`/`UnitedStatesOfAmerica`), not\n * an ISO code — the engine lowers `billing_country` via case-sensitive\n * `from_str`.\n */\n billingCountry?: string;\n /** `amount == n` (minor units). */\n amountEquals?: number;\n /** `amount > n` (minor units). */\n amountGreaterThan?: number;\n /** `amount < n` (minor units). */\n amountLessThan?: number;\n /**\n * `merchant_volume == n` — the merchant's previous-month volume snapshot\n * (USD minor units). Combine with any other condition, e.g.\n * `{ paymentMethod: 'crypto', merchantVolumeGreaterThan: 1_000_000 }`.\n */\n merchantVolumeEquals?: number;\n /** `merchant_volume > n` (USD minor units). */\n merchantVolumeGreaterThan?: number;\n /** `merchant_volume < n` (USD minor units). */\n merchantVolumeLessThan?: number;\n}\n\nexport interface FeeRuleInput {\n name: string;\n /** Friendly conditions (ANDed). Omit for an always-matching rule (prefer `otherwise`). */\n when?: FeeRuleConditions;\n /** Extra raw conditions ANDed in, for dimensions `when` does not cover. */\n rawConditions?: EuclidComparison[];\n /** Nested AND/OR condition tree. Mutually exclusive with `when`/`rawConditions`. */\n match?: ConditionNode;\n fee: FeeSpecInput;\n /**\n * A recurring window outside which the rule is skipped and the next rule or\n * `otherwise` applies. Omit for a rule that applies at all times.\n */\n schedule?: RuleSchedule;\n}\n\nfunction toFeeOutput(spec: FeeSpecInput): PlatformFeeOutput {\n const hasPct = spec.percentage != null;\n const hasFlat = spec.flat != null;\n const feeType: PlatformFeeKind = hasPct && hasFlat ? 'combined' : hasFlat ? 'flat' : 'percentage';\n return {\n fee_type: feeType,\n percentage_fee: spec.percentage ?? null,\n flat_fee_amount: spec.flat ?? null,\n flat_fee_currency: spec.flatCurrency ?? null,\n min_fee_amount: spec.min ?? null,\n max_fee_amount: spec.max ?? null,\n };\n}\n\nfunction enumCondition(lhs: string, value: string): EuclidComparison {\n return { lhs, comparison: 'equal', value: { type: 'enum_variant', value }, metadata: {} };\n}\n\nfunction numberCondition(\n lhs: string,\n comparison: EuclidComparisonType,\n value: number,\n): EuclidComparison {\n return { lhs, comparison, value: { type: 'number', value }, metadata: {} };\n}\n\nfunction buildConditions(\n when: FeeRuleConditions = {},\n raw: EuclidComparison[] = [],\n): EuclidComparison[] {\n const out: EuclidComparison[] = [];\n if (when.paymentMethod != null) out.push(enumCondition('payment_method', when.paymentMethod));\n if (when.connector != null) out.push(enumCondition('connector', when.connector));\n if (when.currency != null) out.push(enumCondition('currency', when.currency));\n if (when.cardNetwork != null) out.push(enumCondition('card_network', when.cardNetwork));\n if (when.billingCountry != null) out.push(enumCondition('billing_country', when.billingCountry));\n if (when.amountEquals != null) out.push(numberCondition('amount', 'equal', when.amountEquals));\n if (when.amountGreaterThan != null) {\n out.push(numberCondition('amount', 'greater_than', when.amountGreaterThan));\n }\n if (when.amountLessThan != null) {\n out.push(numberCondition('amount', 'less_than', when.amountLessThan));\n }\n if (when.merchantVolumeEquals != null) {\n out.push(numberCondition('merchant_volume', 'equal', when.merchantVolumeEquals));\n }\n if (when.merchantVolumeGreaterThan != null) {\n out.push(numberCondition('merchant_volume', 'greater_than', when.merchantVolumeGreaterThan));\n }\n if (when.merchantVolumeLessThan != null) {\n out.push(numberCondition('merchant_volume', 'less_than', when.merchantVolumeLessThan));\n }\n out.push(...raw);\n return out;\n}\n\nfunction leafToComparison(node: LeafNode): EuclidComparison {\n return { lhs: node.lhs, comparison: node.comparison, value: node.value, metadata: {} };\n}\n\n/**\n * Flatten associativity (nested all-in-all / any-in-any) and collapse\n * single-child groups, so every group child of an `all` is an `any`.\n * @internal\n */\nexport function normalizeNode(node: ConditionNode): ConditionNode {\n if (node.kind === 'leaf') return node;\n const children = node.children.map(normalizeNode);\n const flat: ConditionNode[] = [];\n for (const c of children) {\n if (c.kind === node.kind) flat.push(...c.children);\n else flat.push(c);\n }\n if (flat.length === 1) return flat[0];\n return { kind: node.kind, children: flat };\n}\n\nfunction toStatement(node: ConditionNode): EuclidIfStatement {\n if (node.kind === 'leaf') return { condition: [leafToComparison(node)], nested: null };\n // Unreachable via current callers (encodeStatements strips top-level any); kept for totality.\n if (node.kind === 'any') {\n return { condition: [], nested: node.children.map(toStatement) };\n }\n // 'all': after normalize, group children are all 'any'.\n const leaves = node.children.filter((c): c is LeafNode => c.kind === 'leaf');\n const groups = node.children.filter((c): c is GroupNode => c.kind !== 'leaf');\n const condition = leaves.map(leafToComparison);\n if (groups.length === 0) return { condition, nested: null };\n const [first, ...rest] = groups;\n // `first` is an OR; AND each of its branches with the remaining OR groups.\n const nested = first.children.map((branch) => toStatement(normalizeNode(allOf(branch, ...rest))));\n return { condition, nested };\n}\n\nfunction assertNoEmptyAnyOf(node: ConditionNode): void {\n if (node.kind === 'leaf') return;\n if (node.kind === 'any' && node.children.length === 0) {\n throw new Error('feeProgram: an anyOf() group must have at least one condition');\n }\n node.children.forEach(assertNoEmptyAnyOf);\n}\n\n/**\n * Encode a rule's match (a condition tree) into the engine's `statements[]`.\n * A top-level OR spreads across statements; anything else is a single statement.\n * @internal\n */\nexport function encodeStatements(match: ConditionNode): EuclidIfStatement[] {\n const m = normalizeNode(match);\n if (m.kind === 'any') return m.children.map(toStatement);\n return [toStatement(m)];\n}\n\nfunction comparisonToLeaf(c: EuclidComparison): LeafNode {\n return { kind: 'leaf', lhs: c.lhs, comparison: c.comparison, value: c.value };\n}\n\nfunction statementToNode(stmt: EuclidIfStatement): ConditionNode {\n const leaves = stmt.condition.map(comparisonToLeaf);\n if (stmt.nested && stmt.nested.length > 0) {\n const orNode = anyOf(...stmt.nested.map(statementToNode));\n if (leaves.length === 0) return orNode;\n return allOf(...leaves, orNode);\n }\n return leaves.length === 1 ? leaves[0] : allOf(...leaves);\n}\n\n/**\n * Decode a rule's `statements[]` back into a condition tree.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function ruleMatchToTree(statements: EuclidIfStatement[]): ConditionNode {\n if (statements.length === 1) return normalizeNode(statementToNode(statements[0]));\n return normalizeNode(anyOf(...statements.map(statementToNode)));\n}\n\n/**\n * Decode a stored program into the builder's editable model.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function programToTree(program: PlatformFeeProgram): {\n rules: {\n name: string;\n match: ConditionNode;\n fee: PlatformFeeOutput | null;\n schedule: RuleSchedule | null;\n }[];\n otherwise: PlatformFeeOutput | null;\n} {\n return {\n rules: program.rules.map((r) => ({\n name: r.name,\n match: ruleMatchToTree(r.statements),\n fee: r.connectorSelection.fee ?? null,\n schedule: r.connectorSelection.schedule ?? null,\n })),\n otherwise: program.defaultSelection.fee ?? null,\n };\n}\n\n/**\n * Fluent builder for a platform fee-rule program. Emits the exact Euclid wire\n * shape (camelCase tree, tagged values, `metadata: {}` everywhere) so callers\n * never hand-write the AST. Rules are evaluated in order; the first match wins,\n * else `otherwise` (the default selection).\n *\n * @example\n * ```ts\n * const algorithm = feeProgram()\n * .rule({ name: 'crypto', when: { paymentMethod: 'crypto' }, fee: { percentage: 1.0 } })\n * .rule({\n * name: 'card_on_cryptomus',\n * when: { paymentMethod: 'card', connector: 'cryptomus' },\n * fee: { percentage: 2.0 },\n * })\n * .otherwise({ percentage: 3.0 })\n * .build();\n *\n * await delopay.fees.rules.upsert({ algorithm }, merchantId);\n * ```\n */\nexport class FeeProgramBuilder {\n private readonly rules: PlatformFeeRule[] = [];\n private defaultFee: PlatformFeeOutput | null = null;\n\n /** Append a rule. Provided `when`/`rawConditions` are ANDed. */\n rule(input: FeeRuleInput): this {\n if (input.match) assertNoEmptyAnyOf(input.match);\n const statements: PlatformFeeRule['statements'] = input.match\n ? encodeStatements(input.match)\n : [{ condition: buildConditions(input.when, input.rawConditions) }];\n const connectorSelection: PlatformFeeRule['connectorSelection'] = {\n fee: toFeeOutput(input.fee),\n };\n if (input.schedule !== undefined) connectorSelection.schedule = input.schedule;\n this.rules.push({ name: input.name, connectorSelection, statements });\n return this;\n }\n\n /** Set the default selection (applied when no rule matches). */\n otherwise(fee: FeeSpecInput): this {\n this.defaultFee = toFeeOutput(fee);\n return this;\n }\n\n /** Produce the wire-ready program. */\n build(): PlatformFeeProgram {\n return {\n defaultSelection: { fee: this.defaultFee },\n rules: this.rules,\n metadata: {},\n };\n }\n}\n\n/** Start building a platform fee-rule program. See {@link FeeProgramBuilder}. */\nexport function feeProgram(): FeeProgramBuilder {\n return new FeeProgramBuilder();\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-EQ6P6ZND.cjs","../src/feeProgram.ts"],"names":[],"mappings":"AAAA;ACoCO,SAAS,IAAA,CACd,GAAA,EACA,UAAA,EACA,KAAA,EACU;AACV,EAAA,MAAM,OAAA,EACJ,OAAO,MAAA,IAAU,SAAA,EAAW,EAAE,IAAA,EAAM,QAAA,EAAU,MAAM,EAAA,EAAI,EAAE,IAAA,EAAM,cAAA,EAAgB,MAAM,CAAA;AACxF,EAAA,OAAO,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAA,EAAK,UAAA,EAAY,KAAA,EAAO,OAAO,CAAA;AACxD;AAOO,SAAS,YAAA,CACd,GAAA,EACA,UAAA,EACA,KAAA,EACU;AACV,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,GAAA,EAAK,UAAA;AAAA,IACL,UAAA;AAAA,IACA,KAAA,EAAO,EAAE,IAAA,EAAM,kBAAA,EAAoB,KAAA,EAAO,EAAE,GAAA,EAAK,MAAM,EAAE;AAAA,EAC3D,CAAA;AACF;AAGO,SAAS,KAAA,CAAA,GAAS,QAAA,EAAsC;AAC7D,EAAA,OAAO,EAAE,IAAA,EAAM,KAAA,EAAO,SAAS,CAAA;AACjC;AAGO,SAAS,KAAA,CAAA,GAAS,QAAA,EAAsC;AAC7D,EAAA,OAAO,EAAE,IAAA,EAAM,KAAA,EAAO,SAAS,CAAA;AACjC;AAsEA,SAAS,WAAA,CAAY,IAAA,EAAuC;AAC1D,EAAA,MAAM,OAAA,EAAS,IAAA,CAAK,WAAA,GAAc,IAAA;AAClC,EAAA,MAAM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A4C,KAAA,CAAM,MAAA,EACpD,gBAAA,CAAiB,KAAA,CAAM,KAAK,EAAA,EAC5B,CAAC,EAAE,SAAA,EAAW,eAAA,CAAgB,KAAA,CAAM,IAAA,EAAM,KAAA,CAAM,aAAa,EAAE,CAAC,CAAA;AACpE,IAAA,MAAM,mBAAA,EAA4D;AAAA,MAChE,GAAA,EAAK,WAAA,CAAY,KAAA,CAAM,GAAG;AAAA,IAC5B,CAAA;AACA,IAAA,GAAA,CAAI,KAAA,CAAM,SAAA,IAAa,KAAA,CAAA,EAAW,kBAAA,CAAmB,SAAA,EAAW,KAAA,CAAM,QAAA;AACtE,IAAA,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,EAAE,IAAA,EAAM,KAAA,CAAM,IAAA,EAAM,kBAAA,EAAoB,WAAW,CAAC,CAAA;AACpE,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA,EAGA,SAAA,CAAU,GAAA,EAAyB;AACjC,IAAA,IAAA,CAAK,WAAA,EAAa,WAAA,CAAY,GAAG,CAAA;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAAA;AAAA,EAGA,KAAA,CAAA,EAA4B;AAC1B,IAAA,OAAO;AAAA,MACL,gBAAA,EAAkB,EAAE,GAAA,EAAK,IAAA,CAAK,WAAW,CAAA;AAAA,MACzC,KAAA,EAAO,IAAA,CAAK,KAAA;AAAA,MACZ,QAAA,EAAU,CAAC;AAAA,IACb,CAAA;AAAA,EACF;AACF,CAAA;AAGO,SAAS,UAAA,CAAA,EAAgC;AAC9C,EAAA,OAAO,IAAI,iBAAA,CAAkB,CAAA;AAC/B;AD7MA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,6VAAC","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-EQ6P6ZND.cjs","sourcesContent":[null,"import type {\n Connector,\n Currency,\n EuclidComparison,\n EuclidComparisonType,\n EuclidIfStatement,\n EuclidValue,\n PaymentMethod,\n PlatformFeeKind,\n PlatformFeeOutput,\n PlatformFeeProgram,\n PlatformFeeRule,\n RuleSchedule,\n} from './types';\n\n/** A single condition leaf in the builder's condition tree. */\nexport interface LeafNode {\n kind: 'leaf';\n lhs: string;\n comparison: EuclidComparisonType;\n value: EuclidValue;\n}\n\n/** An AND (`all`) or OR (`any`) group of condition nodes. */\nexport interface GroupNode {\n kind: 'all' | 'any';\n children: ConditionNode[];\n}\n\nexport type ConditionNode = LeafNode | GroupNode;\n\n/**\n * A condition leaf. Numeric values (amount, merchant_volume) tag as `number`;\n * string values (payment_method, connector, currency, card_network) tag as\n * `enum_variant`.\n */\nexport function leaf(\n lhs: string,\n comparison: EuclidComparisonType,\n value: string | number,\n): LeafNode {\n const tagged: EuclidValue =\n typeof value === 'number' ? { type: 'number', value } : { type: 'enum_variant', value };\n return { kind: 'leaf', lhs, comparison, value: tagged };\n}\n\n/**\n * A condition on one entry of the payment's merchant-supplied metadata (the\n * `routing_parameters` string map). `equal` and `not_equal` compare the\n * stored string with `value`; a payment without the key never matches `equal`.\n */\nexport function metadataLeaf(\n key: string,\n comparison: 'equal' | 'not_equal',\n value: string,\n): LeafNode {\n return {\n kind: 'leaf',\n lhs: 'metadata',\n comparison,\n value: { type: 'metadata_variant', value: { key, value } },\n };\n}\n\n/** AND group — all children must match. */\nexport function allOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'all', children };\n}\n\n/** OR group — any child matching is enough. */\nexport function anyOf(...children: ConditionNode[]): GroupNode {\n return { kind: 'any', children };\n}\n\n/**\n * How a rule (or the default) prices a transaction. `fee_type` is inferred:\n * percentage-only → `percentage`, flat-only → `flat`, both → `combined`.\n */\nexport interface FeeSpecInput {\n /** Percentage fee, e.g. `2.5` means 2.5%. */\n percentage?: number;\n /** Flat fee in minor units. */\n flat?: number;\n /** ISO 4217 currency for the flat fee. */\n flatCurrency?: string;\n /** Clamp floor in minor units. */\n min?: number;\n /** Clamp ceiling in minor units. */\n max?: number;\n}\n\n/**\n * Friendly conditions for a rule. Every provided key becomes one condition and\n * they are ANDed together. For dimensions not covered here (payment-method-type\n * keys like `crypto`/`wallet`, metadata, value arrays) use `rawConditions`.\n */\nexport interface FeeRuleConditions {\n paymentMethod?: PaymentMethod;\n connector?: Connector;\n currency?: Currency;\n cardNetwork?: string;\n /**\n * Customer billing-address country. Must be the exact backend `Country` enum\n * variant (PascalCase full name, e.g. `Germany`/`UnitedStatesOfAmerica`), not\n * an ISO code — the engine lowers `billing_country` via case-sensitive\n * `from_str`.\n */\n billingCountry?: string;\n /** `amount == n` (minor units). */\n amountEquals?: number;\n /** `amount > n` (minor units). */\n amountGreaterThan?: number;\n /** `amount < n` (minor units). */\n amountLessThan?: number;\n /**\n * `merchant_volume == n` — the merchant's previous-month volume snapshot\n * (USD minor units). Combine with any other condition, e.g.\n * `{ paymentMethod: 'crypto', merchantVolumeGreaterThan: 1_000_000 }`.\n */\n merchantVolumeEquals?: number;\n /** `merchant_volume > n` (USD minor units). */\n merchantVolumeGreaterThan?: number;\n /** `merchant_volume < n` (USD minor units). */\n merchantVolumeLessThan?: number;\n}\n\nexport interface FeeRuleInput {\n name: string;\n /** Friendly conditions (ANDed). Omit for an always-matching rule (prefer `otherwise`). */\n when?: FeeRuleConditions;\n /** Extra raw conditions ANDed in, for dimensions `when` does not cover. */\n rawConditions?: EuclidComparison[];\n /** Nested AND/OR condition tree. Mutually exclusive with `when`/`rawConditions`. */\n match?: ConditionNode;\n fee: FeeSpecInput;\n /**\n * A recurring window outside which the rule is skipped and the next rule or\n * `otherwise` applies. Omit for a rule that applies at all times.\n */\n schedule?: RuleSchedule;\n}\n\nfunction toFeeOutput(spec: FeeSpecInput): PlatformFeeOutput {\n const hasPct = spec.percentage != null;\n const hasFlat = spec.flat != null;\n const feeType: PlatformFeeKind = hasPct && hasFlat ? 'combined' : hasFlat ? 'flat' : 'percentage';\n return {\n fee_type: feeType,\n percentage_fee: spec.percentage ?? null,\n flat_fee_amount: spec.flat ?? null,\n flat_fee_currency: spec.flatCurrency ?? null,\n min_fee_amount: spec.min ?? null,\n max_fee_amount: spec.max ?? null,\n };\n}\n\nfunction enumCondition(lhs: string, value: string): EuclidComparison {\n return { lhs, comparison: 'equal', value: { type: 'enum_variant', value }, metadata: {} };\n}\n\nfunction numberCondition(\n lhs: string,\n comparison: EuclidComparisonType,\n value: number,\n): EuclidComparison {\n return { lhs, comparison, value: { type: 'number', value }, metadata: {} };\n}\n\nfunction buildConditions(\n when: FeeRuleConditions = {},\n raw: EuclidComparison[] = [],\n): EuclidComparison[] {\n const out: EuclidComparison[] = [];\n if (when.paymentMethod != null) out.push(enumCondition('payment_method', when.paymentMethod));\n if (when.connector != null) out.push(enumCondition('connector', when.connector));\n if (when.currency != null) out.push(enumCondition('currency', when.currency));\n if (when.cardNetwork != null) out.push(enumCondition('card_network', when.cardNetwork));\n if (when.billingCountry != null) out.push(enumCondition('billing_country', when.billingCountry));\n if (when.amountEquals != null) out.push(numberCondition('amount', 'equal', when.amountEquals));\n if (when.amountGreaterThan != null) {\n out.push(numberCondition('amount', 'greater_than', when.amountGreaterThan));\n }\n if (when.amountLessThan != null) {\n out.push(numberCondition('amount', 'less_than', when.amountLessThan));\n }\n if (when.merchantVolumeEquals != null) {\n out.push(numberCondition('merchant_volume', 'equal', when.merchantVolumeEquals));\n }\n if (when.merchantVolumeGreaterThan != null) {\n out.push(numberCondition('merchant_volume', 'greater_than', when.merchantVolumeGreaterThan));\n }\n if (when.merchantVolumeLessThan != null) {\n out.push(numberCondition('merchant_volume', 'less_than', when.merchantVolumeLessThan));\n }\n out.push(...raw);\n return out;\n}\n\nfunction leafToComparison(node: LeafNode): EuclidComparison {\n return { lhs: node.lhs, comparison: node.comparison, value: node.value, metadata: {} };\n}\n\n/**\n * Flatten associativity (nested all-in-all / any-in-any) and collapse\n * single-child groups, so every group child of an `all` is an `any`.\n * @internal\n */\nexport function normalizeNode(node: ConditionNode): ConditionNode {\n if (node.kind === 'leaf') return node;\n const children = node.children.map(normalizeNode);\n const flat: ConditionNode[] = [];\n for (const c of children) {\n if (c.kind === node.kind) flat.push(...c.children);\n else flat.push(c);\n }\n if (flat.length === 1) return flat[0];\n return { kind: node.kind, children: flat };\n}\n\nfunction toStatement(node: ConditionNode): EuclidIfStatement {\n if (node.kind === 'leaf') return { condition: [leafToComparison(node)], nested: null };\n // Unreachable via current callers (encodeStatements strips top-level any); kept for totality.\n if (node.kind === 'any') {\n return { condition: [], nested: node.children.map(toStatement) };\n }\n // 'all': after normalize, group children are all 'any'.\n const leaves = node.children.filter((c): c is LeafNode => c.kind === 'leaf');\n const groups = node.children.filter((c): c is GroupNode => c.kind !== 'leaf');\n const condition = leaves.map(leafToComparison);\n if (groups.length === 0) return { condition, nested: null };\n const [first, ...rest] = groups;\n // `first` is an OR; AND each of its branches with the remaining OR groups.\n const nested = first.children.map((branch) => toStatement(normalizeNode(allOf(branch, ...rest))));\n return { condition, nested };\n}\n\nfunction assertNoEmptyAnyOf(node: ConditionNode): void {\n if (node.kind === 'leaf') return;\n if (node.kind === 'any' && node.children.length === 0) {\n throw new Error('feeProgram: an anyOf() group must have at least one condition');\n }\n node.children.forEach(assertNoEmptyAnyOf);\n}\n\n/**\n * Encode a rule's match (a condition tree) into the engine's `statements[]`.\n * A top-level OR spreads across statements; anything else is a single statement.\n * @internal\n */\nexport function encodeStatements(match: ConditionNode): EuclidIfStatement[] {\n const m = normalizeNode(match);\n if (m.kind === 'any') return m.children.map(toStatement);\n return [toStatement(m)];\n}\n\nfunction comparisonToLeaf(c: EuclidComparison): LeafNode {\n return { kind: 'leaf', lhs: c.lhs, comparison: c.comparison, value: c.value };\n}\n\nfunction statementToNode(stmt: EuclidIfStatement): ConditionNode {\n const leaves = stmt.condition.map(comparisonToLeaf);\n if (stmt.nested && stmt.nested.length > 0) {\n const orNode = anyOf(...stmt.nested.map(statementToNode));\n if (leaves.length === 0) return orNode;\n return allOf(...leaves, orNode);\n }\n return leaves.length === 1 ? leaves[0] : allOf(...leaves);\n}\n\n/**\n * Decode a rule's `statements[]` back into a condition tree.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function ruleMatchToTree(statements: EuclidIfStatement[]): ConditionNode {\n if (statements.length === 1) return normalizeNode(statementToNode(statements[0]));\n return normalizeNode(anyOf(...statements.map(statementToNode)));\n}\n\n/**\n * Decode a stored program into the builder's editable model.\n *\n * Returns a tree that is **logically equivalent** to the source. It is\n * deep-equal to `normalizeNode(input)` only when no `all` group contains two\n * or more `any` groups; where the encoder distributed AND over OR, the decoded\n * shape differs (still equivalent).\n */\nexport function programToTree(program: PlatformFeeProgram): {\n rules: {\n name: string;\n match: ConditionNode;\n fee: PlatformFeeOutput | null;\n schedule: RuleSchedule | null;\n }[];\n otherwise: PlatformFeeOutput | null;\n} {\n return {\n rules: program.rules.map((r) => ({\n name: r.name,\n match: ruleMatchToTree(r.statements),\n fee: r.connectorSelection.fee ?? null,\n schedule: r.connectorSelection.schedule ?? null,\n })),\n otherwise: program.defaultSelection.fee ?? null,\n };\n}\n\n/**\n * Fluent builder for a platform fee-rule program. Emits the exact Euclid wire\n * shape (camelCase tree, tagged values, `metadata: {}` everywhere) so callers\n * never hand-write the AST. Rules are evaluated in order; the first match wins,\n * else `otherwise` (the default selection).\n *\n * @example\n * ```ts\n * const algorithm = feeProgram()\n * .rule({ name: 'crypto', when: { paymentMethod: 'crypto' }, fee: { percentage: 1.0 } })\n * .rule({\n * name: 'card_on_cryptomus',\n * when: { paymentMethod: 'card', connector: 'cryptomus' },\n * fee: { percentage: 2.0 },\n * })\n * .otherwise({ percentage: 3.0 })\n * .build();\n *\n * await delopay.fees.rules.upsert({ algorithm }, merchantId);\n * ```\n */\nexport class FeeProgramBuilder {\n private readonly rules: PlatformFeeRule[] = [];\n private defaultFee: PlatformFeeOutput | null = null;\n\n /** Append a rule. Provided `when`/`rawConditions` are ANDed. */\n rule(input: FeeRuleInput): this {\n if (input.match) assertNoEmptyAnyOf(input.match);\n const statements: PlatformFeeRule['statements'] = input.match\n ? encodeStatements(input.match)\n : [{ condition: buildConditions(input.when, input.rawConditions) }];\n const connectorSelection: PlatformFeeRule['connectorSelection'] = {\n fee: toFeeOutput(input.fee),\n };\n if (input.schedule !== undefined) connectorSelection.schedule = input.schedule;\n this.rules.push({ name: input.name, connectorSelection, statements });\n return this;\n }\n\n /** Set the default selection (applied when no rule matches). */\n otherwise(fee: FeeSpecInput): this {\n this.defaultFee = toFeeOutput(fee);\n return this;\n }\n\n /** Produce the wire-ready program. */\n build(): PlatformFeeProgram {\n return {\n defaultSelection: { fee: this.defaultFee },\n rules: this.rules,\n metadata: {},\n };\n }\n}\n\n/** Start building a platform fee-rule program. See {@link FeeProgramBuilder}. */\nexport function feeProgram(): FeeProgramBuilder {\n return new FeeProgramBuilder();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-EXPWQBI3.cjs","../src/resources/files.ts"],"names":[],"mappings":"AAAA;ACEO,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,MAAA,CAAO,MAAA,EAAmE;AAC9E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,QAAA,EAAU,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACxD;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,MAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,OAAA,EAAU,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACjE,EAAA;AAAA;AAG+D,EAAA;AACF,IAAA;AAC7D,EAAA;AACF;ADDoE;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-EXPWQBI3.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\n\nexport class Files {\n constructor(private readonly request: RequestFn) {}\n\n /** Upload a file. `POST /files` */\n async create(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/files', { body: params });\n }\n\n /** Retrieve/download a file. `GET /files/{fileId}` */\n async retrieve(fileId: string): Promise<Record<string, unknown>> {\n return this.request('GET', `/files/${encodeURIComponent(fileId)}`);\n }\n\n /** Delete a file. `DELETE /files/{fileId}` */\n async delete(fileId: string): Promise<Record<string, unknown>> {\n return this.request('DELETE', `/files/${encodeURIComponent(fileId)}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-F3I5DOWV.cjs","../src/resources/poll.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,KAAA,EAAN,MAAW;AAAA,EAChB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,SAAA,CAAU,MAAA,EAA6C;AAC3D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,aAAA,EAAgB,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AACvE,EAAA;AACF;ADA0E;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-F3I5DOWV.cjs","sourcesContent":[null,"import type { PollStatusResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Poll {\n constructor(private readonly request: RequestFn) {}\n\n async getStatus(pollId: string): Promise<PollStatusResponse> {\n return this.request('GET', `/poll/status/${encodeURIComponent(pollId)}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-F46K5H3U.cjs","../src/internal/resources/adminNotices.ts"],"names":[],"mappings":"AAAA;ACcA,IAAM,KAAA,EAAO,uBAAA;AACb,IAAM,KAAA,EAAO,CAAC,QAAA,EAAA,GAA6B,CAAA,EAAA;AASjB;AACyB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGF,EAAA;AAC1B,IAAA;AACtB,EAAA;AAAA;AAGgF,EAAA;AAC1D,IAAA;AACtB,EAAA;AAAA;AAG0E,EAAA;AACpD,IAAA;AACtB,EAAA;AAAA;AAG2E,EAAA;AACrD,IAAA;AACtB,EAAA;AAAA;AAGe,EAAA;AACO,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGiB,EAAA;AACK,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGe,EAAA;AACO,IAAA;AACtB,EAAA;AAAA;AAGgC,EAAA;AACV,IAAA;AACtB,EAAA;AAAA;AAG+B,EAAA;AACT,IAAA;AACtB,EAAA;AAAA;AAGsB,EAAA;AACA,IAAA;AACC,MAAA;AACpB,IAAA;AACH,EAAA;AACF;AD9B0B;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-F46K5H3U.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type { NoticeList, NoticeListParams } from '../../types';\nimport type {\n PlatformNotice,\n PlatformNoticeAudience,\n PlatformNoticeCreateParams,\n PlatformNoticeDetail,\n PlatformNoticeList,\n PlatformNoticeListParams,\n PlatformNoticeOptions,\n PlatformNoticePreview,\n PlatformNoticeUpdateParams,\n} from '../types';\n\nconst BASE = '/admin-portal/notices';\nconst path = (noticeId: string): string => `${BASE}/${encodeURIComponent(noticeId)}`;\n\n/**\n * Notices staff send to the people of merchants and to colleagues. What the\n * caller may send follows their staff actions; an employee limited to\n * selected merchants reaches only those. A notice to every merchant can wait\n * for a second member of staff (`pending_approval`), never its author or\n * whoever last changed it, for 72 hours.\n */\nexport class AdminNotices {\n constructor(private readonly request: RequestFn) {}\n\n /** What the caller may send, and the staff roles, colleagues and merchant roles. `GET /admin-portal/notices/options` */\n async options(): Promise<PlatformNoticeOptions> {\n return this.request('GET', `${BASE}/options`);\n }\n\n /** How many people, at how many merchants, an audience reaches right now. `POST /admin-portal/notices/preview` */\n async preview(audience: PlatformNoticeAudience): Promise<PlatformNoticePreview> {\n return this.request('POST', `${BASE}/preview`, { body: { audience } });\n }\n\n /** Send now, at `send_at`, or keep as a draft; or wait for approval. `POST /admin-portal/notices` */\n async create(params: PlatformNoticeCreateParams): Promise<PlatformNotice> {\n return this.request('POST', BASE, { body: params });\n }\n\n /** What staff sent, newest first: sent and withdrawn by default. `GET /admin-portal/notices` */\n async list(params?: PlatformNoticeListParams): Promise<PlatformNoticeList> {\n return this.request('GET', BASE, { query: { ...params } });\n }\n\n /** One notice with its recipients and their merchant. `GET /admin-portal/notices/{noticeId}` */\n async retrieve(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('GET', path(noticeId));\n }\n\n /** Change a notice not sent yet, at the version read. `PUT /admin-portal/notices/{noticeId}` */\n async update(noticeId: string, params: PlatformNoticeUpdateParams): Promise<PlatformNotice> {\n return this.request('PUT', path(noticeId), { body: params });\n }\n\n /** Send a draft or a scheduled notice now. `POST /admin-portal/notices/{noticeId}/send` */\n async sendStored(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('POST', `${path(noticeId)}/send`, { body: { version } });\n }\n\n /** Delete a notice not sent yet. `DELETE /admin-portal/notices/{noticeId}` */\n async delete(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('DELETE', path(noticeId), { query: { version } });\n }\n\n /** Take a sent notice back from everyone it reached. `POST /admin-portal/notices/{noticeId}/withdraw` */\n async withdraw(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/withdraw`);\n }\n\n /** Approve a notice to every merchant another member of staff wrote. `POST /admin-portal/notices/{noticeId}/approve` */\n async approve(noticeId: string, version: number): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/approve`, { body: { version } });\n }\n\n /** Refuse a notice to every merchant, saying why. `POST /admin-portal/notices/{noticeId}/refuse` */\n async refuse(noticeId: string, version: number, note: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/refuse`, { body: { version, note } });\n }\n\n /** The notices one merchant's people sent each other, read-only. `GET /admin-portal/notices/merchants/{merchantId}` */\n async merchantNotices(merchantId: string, params?: NoticeListParams): Promise<NoticeList> {\n return this.request('GET', `${BASE}/merchants/${encodeURIComponent(merchantId)}`, {\n query: { ...params },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-F6S3WCCB.cjs","../src/resources/mandates.ts"],"names":[],"mappings":"AAAA;ACIO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,QAAA,CAAS,SAAA,EAA6C;AAC1D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,UAAA,EAAa,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQiE,EAAA;AACI,IAAA;AACrE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQmE,EAAA;AACpB,IAAA;AACpC,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADH0E;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-F6S3WCCB.cjs","sourcesContent":[null,"import type { MandateResponse, MandateRevokedResponse, MandateListParams } from '../types';\nimport type { RequestFn } from '../client';\n\n/** View and revoke recurring payment mandates. */\nexport class Mandates {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Retrieve a mandate by its ID.\n *\n * @param mandateId - The unique mandate ID.\n * @returns The mandate.\n */\n async retrieve(mandateId: string): Promise<MandateResponse> {\n return this.request('GET', `/mandates/${encodeURIComponent(mandateId)}`);\n }\n\n /**\n * Revoke an active mandate, preventing future charges.\n *\n * @param mandateId - The mandate ID to revoke.\n * @returns Revocation confirmation.\n */\n async revoke(mandateId: string): Promise<MandateRevokedResponse> {\n return this.request('POST', `/mandates/revoke/${encodeURIComponent(mandateId)}`);\n }\n\n /**\n * List mandates, optionally filtered by customer or status.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of mandates.\n */\n async list(params?: MandateListParams): Promise<MandateResponse[]> {\n return this.request('GET', '/mandates/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-FG7YBXJQ.cjs"],"names":[],"mappings":"AAAA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-FG7YBXJQ.cjs"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/w6pub/delopay-typescript-sdk/dist/chunk-FQRC4NJG.cjs","../src/resources/invoices.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACcA,IAAM,iBAAA,EAAmB,CAAC,QAAA,EAAU,MAAM,CAAA;AA4BnC,IAAM,SAAA,E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AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ6F,EAAA;AACrB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB2F,EAAA;AACnB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOgG,EAAA;AACzB,IAAA;AAChE,MAAA;AACJ,IAAA;AACH,EAAA;AACF;AD3E0E;AACA;AACA;AACA","file":"/tmp/w6pub/delopay-typescript-sdk/dist/chunk-FQRC4NJG.cjs","sourcesContent":[null,"import type {\n CreateCreditNoteRequest,\n CreateInvoiceRequest,\n InvoiceEmailDelivery,\n InvoiceEmailDeliveryList,\n InvoiceExportParams,\n InvoiceList,\n InvoiceListQuery,\n InvoicePageQuery,\n InvoiceShareLink,\n MerchantInvoiceDocument,\n UpdateInvoiceRequest,\n VoidInvoiceRequest,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** The invoice list filters that take several values. */\nconst INVOICE_CSV_KEYS = ['status', 'kind'] as const;\n\n/**\n * The invoices and credit notes a merchant issues to their buyers.\n *\n * DeloPay renders and stores each document **in the merchant's name**. The\n * seller block comes from the invoice settings (see `invoiceSettings`) and\n * every amount from the source — a paid payment or a paid subscription cycle —\n * so no method here takes a seller, an amount or a quantity, except the\n * optional partial amounts of a credit note, which the API caps at what the\n * line has left.\n *\n * A document is `draft` → `issued` → `voided`. A draft is unnumbered and\n * editable, and deleting it leaves no gap; `finalize` numbers it, freezes it\n * and stores its PDF; an issued document is corrected with a credit note, or\n * voided if it never reached the buyer.\n *\n * Scope comes from the caller: a shop-scoped key or dashboard session sees\n * only its shop, and a merchant-level one narrows with `profile_id` on the\n * list filters. Reading needs the `Invoice` area's read grant; every change\n * needs its write grant.\n *\n * Refusals: `IR_16` (400) for a document in the wrong state or a source that\n * may not be invoiced, `IR_06` (422) for a finalise the document cannot pass,\n * and `DE_13` (409) for a second live invoice of one source. The first two\n * carry `error.data` as a `MerchantInvoiceRefusal`; the last as a\n * `MerchantInvoiceConflict`.\n */\nexport class Invoices {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a draft from a paid payment or subscription cycle, and with\n * `finalize: true` issue it in the same call.\n * `POST /invoices`\n *\n * Send an `Idempotency-Key` header in `options.headers` to make this safe to\n * retry: the same key and body return the document it created, in its\n * current state, even after a lost response, and a different body under the\n * same key answers 409. A retry of a `finalize: true` request whose draft\n * was committed but not finalised finalises that draft.\n */\n async create(\n params: CreateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', '/invoices', { body: params, ...options });\n }\n\n /**\n * One page of documents, newest first unless `sort_by` says otherwise. List\n * rows carry no `lines` unless `include_lines` is set, and never a `refund`\n * summary. Several `status` or `kind` values match a document in any of\n * them.\n * `GET /invoices`\n */\n async list(params?: InvoiceListQuery, options?: RequestExtras): Promise<InvoiceList> {\n return this.request('GET', '/invoices', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * One page of a payment's invoice and its credit notes, lines included. The\n * page also says whether a merchant of record sold the payment\n * (`merchant_of_record`, which `create` then refuses) and what was refunded\n * (`refunded_amount`, and `refund` on each invoice). Needs the payment read\n * grant as well.\n * `GET /payments/{payment_id}/invoices`\n */\n async listForPayment(\n paymentId: string,\n params?: InvoicePageQuery,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/invoices`, {\n query: params === undefined ? undefined : { ...params },\n ...options,\n });\n }\n\n /**\n * The documents with a line of one product; a bundle's components count,\n * flagged `included`. Takes the list filters; the product is the path's.\n * `GET /products/{product_id}/invoices`\n */\n async listForProduct(\n productId: string,\n params?: Omit<InvoiceListQuery, 'product_id'>,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/invoices`, {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * The documents of one period, with the list's filters, as CSV\n * (`text/csv; charset=utf-8`) by default. Amounts are decimal in each\n * document's currency; drafts have an empty number.\n *\n * Another file is asked for with `Accept` in `options.headers`:\n * `application/json` (the rows as `records`, with `record_count` and the\n * filters applied), `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n * (an Excel workbook) or `application/zip` (the stored PDF of every issued or\n * voided document, with the CSV as `invoices.csv`; at most 500 documents).\n * `GET /invoices/export`\n */\n async export(params: InvoiceExportParams, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', '/invoices/export', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * One document, lines included.\n * `GET /invoices/{invoice_id}`\n */\n async retrieve(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Edit a draft: its words, buyer, dates and tax treatment, never what was\n * paid. Absent fields stay; `null` clears a clearable one. A document that\n * is not a draft is refused (`not_a_draft`).\n * `PATCH /invoices/{invoice_id}`\n */\n async update(\n invoiceId: string,\n params: UpdateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('PATCH', `/invoices/${encodeURIComponent(invoiceId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a draft. A draft has no number, so nothing leaves a gap; an issued\n * document is refused (`not_a_draft`) — void or credit it instead.\n * `DELETE /invoices/{invoice_id}`\n */\n async delete(invoiceId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Issue a draft: allocate its number, freeze it and store its PDF. It is\n * immutable afterwards. A document that would be legally incomplete is\n * refused with `IR_06` and a reason (`seller_tax_id_missing`,\n * `line_tax_unexplained`, …) that says what to fix and where.\n * `POST /invoices/{invoice_id}/finalize`\n */\n async finalize(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/finalize`, {\n ...options,\n });\n }\n\n /**\n * Withdraw an issued document with a reason; its number stays used. For a\n * document that never reached the buyer — one they hold is corrected with\n * `createCreditNote`. An invoice with live credit notes is refused\n * (`has_credit_notes`).\n * `POST /invoices/{invoice_id}/void`\n */\n async void(\n invoiceId: string,\n params: VoidInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/void`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct an issued invoice with a credit note: all of what it has left, or\n * the named lines. Returns the **credit note**, not the invoice.\n * `POST /invoices/{invoice_id}/credit-note`\n */\n async createCreditNote(\n invoiceId: string,\n params: CreateCreditNoteRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/credit-note`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * The document as a PDF. An issued document is its stored copy; a draft\n * renders live under a DRAFT banner, and a voided one under a VOIDED banner.\n * `GET /invoices/{invoice_id}/pdf`\n */\n async downloadPdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * A public link to an issued document's stored PDF, valid for 7 days.\n * **Anyone holding the link can open the document**, without logging in. A\n * document that is not issued is refused (`not_issued`).\n * `POST /invoices/{invoice_id}/share-link`\n */\n async createShareLink(invoiceId: string, options?: RequestExtras): Promise<InvoiceShareLink> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/share-link`, {\n ...options,\n });\n }\n\n /**\n * Mail an issued invoice to the buyer address it carries, its PDF attached,\n * in the document's language. Each call is a new message (the next\n * `revision`) and resolves with what became of it: `sent`, or `failed` with\n * `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),\n * `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is\n * queued or being sent) and `send_limit_reached` (5 sends by hand in 24\n * hours). Shops with the `email.invoice_auto_send` setting mail every\n * invoice they issue without this call.\n *\n * The merchant's daily sending limit is **not** a refusal: the call answers\n * with the message `failed` and `error_code: 'merchant_limit_reached'`.\n * Check `status` on the result, not only that the call succeeded.\n * `POST /invoices/{invoice_id}/email`\n */\n async sendEmail(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDelivery> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/email`, {\n ...options,\n });\n }\n\n /**\n * Every message about a document to its buyer, automatic and by hand,\n * newest first, with its delivery status. The recipient is masked.\n * `GET /invoices/{invoice_id}/emails`\n */\n async listEmails(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDeliveryList> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/emails`, {\n ...options,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-FQRC4NJG.cjs","../src/resources/invoices.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACcA,IAAM,iBAAA,EAAmB,CAAC,QAAA,EAAU,MAAM,CAAA;AA4BnC,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAA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;AAAA;AAAA;AAAA;AAAA;AAOgG,EAAA;AACzB,IAAA;AAChE,MAAA;AACJ,IAAA;AACH,EAAA;AACF;AD3E0E;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-FQRC4NJG.cjs","sourcesContent":[null,"import type {\n CreateCreditNoteRequest,\n CreateInvoiceRequest,\n InvoiceEmailDelivery,\n InvoiceEmailDeliveryList,\n InvoiceExportParams,\n InvoiceList,\n InvoiceListQuery,\n InvoicePageQuery,\n InvoiceShareLink,\n MerchantInvoiceDocument,\n UpdateInvoiceRequest,\n VoidInvoiceRequest,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** The invoice list filters that take several values. */\nconst INVOICE_CSV_KEYS = ['status', 'kind'] as const;\n\n/**\n * The invoices and credit notes a merchant issues to their buyers.\n *\n * DeloPay renders and stores each document **in the merchant's name**. The\n * seller block comes from the invoice settings (see `invoiceSettings`) and\n * every amount from the source — a paid payment or a paid subscription cycle —\n * so no method here takes a seller, an amount or a quantity, except the\n * optional partial amounts of a credit note, which the API caps at what the\n * line has left.\n *\n * A document is `draft` → `issued` → `voided`. A draft is unnumbered and\n * editable, and deleting it leaves no gap; `finalize` numbers it, freezes it\n * and stores its PDF; an issued document is corrected with a credit note, or\n * voided if it never reached the buyer.\n *\n * Scope comes from the caller: a shop-scoped key or dashboard session sees\n * only its shop, and a merchant-level one narrows with `profile_id` on the\n * list filters. Reading needs the `Invoice` area's read grant; every change\n * needs its write grant.\n *\n * Refusals: `IR_16` (400) for a document in the wrong state or a source that\n * may not be invoiced, `IR_06` (422) for a finalise the document cannot pass,\n * and `DE_13` (409) for a second live invoice of one source. The first two\n * carry `error.data` as a `MerchantInvoiceRefusal`; the last as a\n * `MerchantInvoiceConflict`.\n */\nexport class Invoices {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a draft from a paid payment or subscription cycle, and with\n * `finalize: true` issue it in the same call.\n * `POST /invoices`\n *\n * Send an `Idempotency-Key` header in `options.headers` to make this safe to\n * retry: the same key and body return the document it created, in its\n * current state, even after a lost response, and a different body under the\n * same key answers 409. A retry of a `finalize: true` request whose draft\n * was committed but not finalised finalises that draft.\n */\n async create(\n params: CreateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', '/invoices', { body: params, ...options });\n }\n\n /**\n * One page of documents, newest first unless `sort_by` says otherwise. List\n * rows carry no `lines` unless `include_lines` is set, and never a `refund`\n * summary. Several `status` or `kind` values match a document in any of\n * them.\n * `GET /invoices`\n */\n async list(params?: InvoiceListQuery, options?: RequestExtras): Promise<InvoiceList> {\n return this.request('GET', '/invoices', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * One page of a payment's invoice and its credit notes, lines included. The\n * page also says whether a merchant of record sold the payment\n * (`merchant_of_record`, which `create` then refuses) and what was refunded\n * (`refunded_amount`, and `refund` on each invoice). Needs the payment read\n * grant as well.\n * `GET /payments/{payment_id}/invoices`\n */\n async listForPayment(\n paymentId: string,\n params?: InvoicePageQuery,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/invoices`, {\n query: params === undefined ? undefined : { ...params },\n ...options,\n });\n }\n\n /**\n * The documents with a line of one product; a bundle's components count,\n * flagged `included`. Takes the list filters; the product is the path's.\n * `GET /products/{product_id}/invoices`\n */\n async listForProduct(\n productId: string,\n params?: Omit<InvoiceListQuery, 'product_id'>,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/invoices`, {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * The documents of one period, with the list's filters, as CSV\n * (`text/csv; charset=utf-8`) by default. Amounts are decimal in each\n * document's currency; drafts have an empty number.\n *\n * Another file is asked for with `Accept` in `options.headers`:\n * `application/json` (the rows as `records`, with `record_count` and the\n * filters applied), `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n * (an Excel workbook) or `application/zip` (the stored PDF of every issued or\n * voided document, with the CSV as `invoices.csv`; at most 500 documents).\n * `GET /invoices/export`\n */\n async export(params: InvoiceExportParams, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', '/invoices/export', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * One document, lines included.\n * `GET /invoices/{invoice_id}`\n */\n async retrieve(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Edit a draft: its words, buyer, dates and tax treatment, never what was\n * paid. Absent fields stay; `null` clears a clearable one. A document that\n * is not a draft is refused (`not_a_draft`).\n * `PATCH /invoices/{invoice_id}`\n */\n async update(\n invoiceId: string,\n params: UpdateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('PATCH', `/invoices/${encodeURIComponent(invoiceId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a draft. A draft has no number, so nothing leaves a gap; an issued\n * document is refused (`not_a_draft`) — void or credit it instead.\n * `DELETE /invoices/{invoice_id}`\n */\n async delete(invoiceId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Issue a draft: allocate its number, freeze it and store its PDF. It is\n * immutable afterwards. A document that would be legally incomplete is\n * refused with `IR_06` and a reason (`seller_tax_id_missing`,\n * `line_tax_unexplained`, …) that says what to fix and where.\n * `POST /invoices/{invoice_id}/finalize`\n */\n async finalize(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/finalize`, {\n ...options,\n });\n }\n\n /**\n * Withdraw an issued document with a reason; its number stays used. For a\n * document that never reached the buyer — one they hold is corrected with\n * `createCreditNote`. An invoice with live credit notes is refused\n * (`has_credit_notes`).\n * `POST /invoices/{invoice_id}/void`\n */\n async void(\n invoiceId: string,\n params: VoidInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/void`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct an issued invoice with a credit note: all of what it has left, or\n * the named lines. Returns the **credit note**, not the invoice.\n * `POST /invoices/{invoice_id}/credit-note`\n */\n async createCreditNote(\n invoiceId: string,\n params: CreateCreditNoteRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/credit-note`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * The document as a PDF. An issued document is its stored copy; a draft\n * renders live under a DRAFT banner, and a voided one under a VOIDED banner.\n * `GET /invoices/{invoice_id}/pdf`\n */\n async downloadPdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * A public link to an issued document's stored PDF, valid for 7 days.\n * **Anyone holding the link can open the document**, without logging in. A\n * document that is not issued is refused (`not_issued`).\n * `POST /invoices/{invoice_id}/share-link`\n */\n async createShareLink(invoiceId: string, options?: RequestExtras): Promise<InvoiceShareLink> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/share-link`, {\n ...options,\n });\n }\n\n /**\n * Mail an issued invoice to the buyer address it carries, its PDF attached,\n * in the document's language. Each call is a new message (the next\n * `revision`) and resolves with what became of it: `sent`, or `failed` with\n * `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),\n * `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is\n * queued or being sent) and `send_limit_reached` (5 sends by hand in 24\n * hours). Shops with the `email.invoice_auto_send` setting mail every\n * invoice they issue without this call.\n *\n * The merchant's daily sending limit is **not** a refusal: the call answers\n * with the message `failed` and `error_code: 'merchant_limit_reached'`.\n * Check `status` on the result, not only that the call succeeded.\n * `POST /invoices/{invoice_id}/email`\n */\n async sendEmail(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDelivery> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/email`, {\n ...options,\n });\n }\n\n /**\n * Every message about a document to its buyer, automatic and by hand,\n * newest first, with its delivery status. The recipient is masked.\n * `GET /invoices/{invoice_id}/emails`\n */\n async listEmails(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDeliveryList> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/emails`, {\n ...options,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-FYISDU2Y.cjs","../src/resources/profiles.ts"],"names":[],"mappings":"AAAA;ACaO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,OAAA,CAAQ,SAAA,EAAmB,SAAA,EAAiD;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,SAAS,CAAC,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,SAAS,CAAC,CAAA,QAAA,CAAA;AAAA,MAC3F,EAAE,IAAA,EAAM,EAAE,WAAA,EAAa,KAAK,EAAqC;AAAA,IACnE,CAAA;AAAA,EACF;AAAA;AAAA,EAGA,MAAM,OAAA,CAAQ,SAAA,EAAmB,SAAA,EAAiD;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AA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MAAA,EAAQ,CAAA,SAAA,EAAY,kBAAA,CAAmB,SAAS,CAAC,CAAA,iBAAA,CAAA,EAAqB;AAAA,MACxF,IAAA,EAAM;AAAA,IACR,CAAC,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,QAAA,CAAS,SAAA,EAAmB,SAAA,EAA6C;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,SAAS,CAAC,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,SAAS,CAAC,CAAA;AAAA,IAAA;AAC7F,EAAA;AACF,EAAA;AAGE,IAAA;AAAuF,EAAA;AACzF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAA8E,EAAA;AAChF,EAAA;AAQE,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,MAAA;AAC3F,QAAA;AACQ,QAAA;AACH,MAAA;AACL,IAAA;AACF,EAAA;AACF,EAAA;AAGE,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AACF;AAAA;AAAA,EAAA;AAME,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AACF;AAAA,EAAA;AAIE,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AAEJ;AD7BA;AACA;AACA;AACA","file":"/home/jonathan/Desktop/DeloPay/dev1/delopay-typescript-sdk/dist/chunk-FYISDU2Y.cjs","sourcesContent":[null,"import type {\n ProfileCreateRequest,\n ProfileResponse,\n ProfileUpdateRequest,\n ShopArchiveUpdateRequest,\n ShopArchiveResponse,\n ShopPaymentsSwitchRequest,\n ShopPaymentsSwitchResponse,\n ArchivedShopResponse,\n VaultSwitchOffResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\nexport class Profiles {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Hide a shop from ordinary navigation. Its identity, project membership,\n * settings and retained records remain unchanged. Requires shop write access.\n * Repeating the same state is safe; use restore() to make it visible again.\n */\n async archive(accountId: string, profileId: string): Promise<ShopArchiveResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/archive`,\n { body: { is_archived: true } satisfies ShopArchiveUpdateRequest },\n );\n }\n\n /** Restore an archived shop to navigation with the same identity and project. */\n async restore(accountId: string, profileId: string): Promise<ShopArchiveResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/archive`,\n { body: { is_archived: false } satisfies ShopArchiveUpdateRequest },\n );\n }\n\n /**\n * Switch a shop's payments off. While they are off the shop takes no new\n * payment: creating one, and confirming one no provider holds yet, is\n * refused with `DE_21`, and its hosted checkout does not render. A payment a\n * provider already holds is finished; refunds and disputes are unaffected.\n * Needs the `ShopPaymentsSwitch` area's `Write` and a signed-in user.\n * Repeating the same state is safe.\n *\n * `PUT /account/{accountId}/business-profile/{profileId}/payments-switch`\n */\n async disablePayments(accountId: string, profileId: string): Promise<ShopPaymentsSwitchResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/payments-switch`,\n { body: { payments_disabled: true } satisfies ShopPaymentsSwitchRequest },\n );\n }\n\n /** Switch a shop's payments on again after {@link Profiles.disablePayments}. */\n async enablePayments(accountId: string, profileId: string): Promise<ShopPaymentsSwitchResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/payments-switch`,\n { body: { payments_disabled: false } satisfies ShopPaymentsSwitchRequest },\n );\n }\n\n /** Archived shop identities in the caller's merchant and shop-read scope. */\n async listArchived(accountId: string): Promise<ArchivedShopResponse[]> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/business-profile/archived`,\n );\n }\n\n async create(accountId: string, params: ProfileCreateRequest): Promise<ProfileResponse> {\n return this.request('POST', `/account/${encodeURIComponent(accountId)}/business-profile`, {\n body: params,\n });\n }\n\n async retrieve(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,\n );\n }\n\n async list(accountId: string): Promise<ProfileResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/business-profile`);\n }\n\n /**\n * List the business profiles the caller can see at profile scope — the\n * `ProfileAccountRead` twin of `list()` (which needs merchant-level read).\n * A shop-scoped user gets exactly their own shop back.\n *\n * `GET /account/{accountId}/profile`\n */\n async listByProfile(accountId: string): Promise<ProfileResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/profile`);\n }\n\n async update(\n accountId: string,\n profileId: string,\n params: ProfileUpdateRequest,\n options?: RequestExtras,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,\n {\n body: params,\n ...options,\n },\n );\n }\n\n async delete(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'DELETE',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,\n );\n }\n\n // --- Advanced operations (Task 4.8) ---\n\n /** Toggle extended card info for a profile. `POST /account/{accountId}/business-profile/{profileId}/toggle-extended-card-info` */\n async toggleExtendedCardInfo(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/toggle-extended-card-info`,\n );\n }\n\n /** Toggle connector agnostic MIT. `POST /account/{accountId}/business-profile/{profileId}/toggle-connector-agnostic-mit` */\n async toggleConnectorAgnosticMit(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/toggle-connector-agnostic-mit`,\n );\n }\n\n /**\n * Switch the shop's card vault off. From the next checkout on, the checkout\n * draws each processor's own card form and card payments no longer depend on\n * the vault account. Cards saved in the vault cannot be charged while it is\n * off.\n *\n * The vault stays configured; switch it on again with {@link Profiles.update},\n * which verifies the vault first. Needs the permission to edit the shop's\n * connectors, not the one to edit the shop. Calling it for a shop whose vault\n * is already off changes nothing.\n *\n * `POST /account/{accountId}/business-profile/{profileId}/vault/switch-off`\n */\n async switchVaultOff(accountId: string, profileId: string): Promise<VaultSwitchOffResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/vault/switch-off`,\n );\n }\n}\n"]}
|