@delopay/sdk 0.425.0 → 0.428.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-3HBWRBUT.js +58 -0
- package/dist/chunk-3HBWRBUT.js.map +1 -0
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-424542L2.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-26THONSG.js → chunk-5D5UYMQK.js} +18 -1
- package/dist/chunk-5D5UYMQK.js.map +1 -0
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/{chunk-ONEPBY3O.cjs → chunk-5JJ65Z7J.cjs} +18 -14
- package/dist/chunk-5JJ65Z7J.cjs.map +1 -0
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.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-7ITPMVDB.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-A4UPU5UE.js +1 -0
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
- package/dist/chunk-BRY3W7N3.cjs.map +1 -1
- package/dist/chunk-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CKKNFFKP.cjs.map +1 -1
- package/dist/chunk-CR3JBTP3.cjs.map +1 -1
- package/dist/chunk-DJASVBOJ.cjs.map +1 -1
- package/dist/chunk-EEB2HDYL.cjs.map +1 -1
- package/dist/chunk-ENPSUWTS.cjs.map +1 -1
- package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
- package/dist/chunk-EXPWQBI3.cjs.map +1 -1
- package/dist/chunk-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/{chunk-HNJFRQSY.js → chunk-FELTF5FF.js} +2 -2
- package/dist/chunk-FQRC4NJG.cjs.map +1 -1
- package/dist/chunk-FYISDU2Y.cjs.map +1 -1
- package/dist/chunk-GA3KXPIF.cjs.map +1 -1
- package/dist/chunk-GG52SAHA.cjs.map +1 -1
- package/dist/chunk-GK5FWN4H.cjs.map +1 -1
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/{chunk-JZGSKVTT.js → chunk-GU3VNMQ5.js} +14 -1
- package/dist/chunk-GU3VNMQ5.js.map +1 -0
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/{chunk-VOIELJLZ.cjs → chunk-HLHML5ES.cjs} +18 -1
- package/dist/chunk-HLHML5ES.cjs.map +1 -0
- package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
- package/dist/chunk-HLYGHP6F.cjs.map +1 -1
- package/dist/chunk-I2W7AO4B.cjs.map +1 -1
- package/dist/chunk-I2XGNALG.cjs.map +1 -1
- package/dist/chunk-I65QS3YQ.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-K5Q2H3VD.cjs.map +1 -1
- package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
- package/dist/chunk-KJDMNF2T.cjs.map +1 -1
- package/dist/chunk-KLONGJCL.cjs.map +1 -1
- package/dist/chunk-KOB6MOAV.cjs.map +1 -1
- package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MCNDMK7F.cjs.map +1 -1
- package/dist/{chunk-3TFE2JB5.cjs → chunk-MFZ5FBS7.cjs} +3 -3
- package/dist/chunk-MFZ5FBS7.cjs.map +1 -0
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- 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-PWDY5D5S.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QMLU5DST.cjs.map +1 -1
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4FE6K43.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RHFUXHQN.cjs +58 -0
- package/dist/chunk-RHFUXHQN.cjs.map +1 -0
- 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-SQELICSX.cjs.map +1 -1
- package/dist/chunk-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/{chunk-NN74DH4Q.js → chunk-UZ5V4N7M.js} +25 -21
- package/dist/chunk-UZ5V4N7M.js.map +1 -0
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHHQX52U.cjs +1 -0
- package/dist/chunk-VHHQX52U.cjs.map +1 -0
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/chunk-WHDI3TMP.cjs.map +1 -1
- package/dist/chunk-WITCPKNL.cjs.map +1 -1
- package/dist/{chunk-U2BPNOYN.cjs → chunk-WR6Z4I52.cjs} +14 -1
- package/dist/chunk-WR6Z4I52.cjs.map +1 -0
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/chunk-YJQPKT6W.cjs.map +1 -1
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
- package/dist/client.cjs +2 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +3 -0
- package/dist/client.d.ts +3 -0
- 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 +21 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +27 -23
- 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/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/adminPortal.cjs +2 -2
- package/dist/internal/resources/adminPortal.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.d.cts +11 -2
- package/dist/internal/resources/adminPortal.d.ts +11 -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 +30 -26
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +3 -2
- package/dist/internal.d.ts +3 -2
- package/dist/internal.js +36 -32
- package/dist/internal.js.map +1 -1
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs.map +1 -1
- package/dist/paymentPresentation.cjs.map +1 -1
- package/dist/recordCounter.cjs.map +1 -1
- package/dist/resources/aiTools.cjs +7 -0
- package/dist/resources/aiTools.cjs.map +1 -0
- package/dist/resources/aiTools.d.cts +59 -0
- package/dist/resources/aiTools.d.ts +59 -0
- package/dist/resources/aiTools.js +7 -0
- package/dist/resources/aiTools.js.map +1 -0
- package/dist/resources/analytics.cjs +2 -2
- package/dist/resources/analytics.cjs.map +1 -1
- package/dist/resources/analytics.d.cts +14 -1
- package/dist/resources/analytics.d.ts +14 -1
- package/dist/resources/analytics.js +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/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/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/operationLimits.cjs.map +1 -1
- package/dist/resources/paymentLinks.cjs.map +1 -1
- package/dist/resources/paymentMethods.cjs.map +1 -1
- package/dist/resources/payments.cjs.map +1 -1
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payouts.cjs.map +1 -1
- package/dist/resources/paypalDisputes.cjs.map +1 -1
- package/dist/resources/persons.cjs.map +1 -1
- package/dist/resources/poll.cjs.map +1 -1
- package/dist/resources/processorCosts.cjs.map +1 -1
- package/dist/resources/processorImports.cjs.map +1 -1
- package/dist/resources/products.cjs.map +1 -1
- package/dist/resources/profileAcquirers.cjs.map +1 -1
- package/dist/resources/profiles.cjs.map +1 -1
- package/dist/resources/projects.cjs.map +1 -1
- package/dist/resources/refunds.cjs.map +1 -1
- package/dist/resources/regions.cjs.map +1 -1
- package/dist/resources/relay.cjs.map +1 -1
- package/dist/resources/risk.cjs.map +1 -1
- package/dist/resources/routing.cjs.map +1 -1
- package/dist/resources/search.cjs.map +1 -1
- package/dist/resources/sellToRestrictions.cjs.map +1 -1
- package/dist/resources/settings.cjs.map +1 -1
- package/dist/resources/settlement.cjs.map +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/{types-DaKpMBi_.d.ts → types-CAF6Fg1O.d.ts} +24 -1
- package/dist/{types-Cgt_cKwA.d.cts → types-gi0y0Jy7.d.cts} +24 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +447 -3
- package/dist/types.d.ts +447 -3
- package/package.json +1 -1
- package/dist/chunk-26THONSG.js.map +0 -1
- package/dist/chunk-3TFE2JB5.cjs.map +0 -1
- package/dist/chunk-BOU2TQ6U.cjs +0 -1
- package/dist/chunk-BOU2TQ6U.cjs.map +0 -1
- package/dist/chunk-FI7NLDWZ.js +0 -1
- package/dist/chunk-JZGSKVTT.js.map +0 -1
- package/dist/chunk-NN74DH4Q.js.map +0 -1
- package/dist/chunk-ONEPBY3O.cjs.map +0 -1
- package/dist/chunk-U2BPNOYN.cjs.map +0 -1
- package/dist/chunk-VOIELJLZ.cjs.map +0 -1
- /package/dist/{chunk-FI7NLDWZ.js.map → chunk-A4UPU5UE.js.map} +0 -0
- /package/dist/{chunk-HNJFRQSY.js.map → chunk-FELTF5FF.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/
|
|
1
|
+
{"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-KLONGJCL.cjs","../src/resources/costRules.ts"],"names":[],"mappings":"AAAA;ACqBO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,IAAA,CAAK,UAAA,EAAyD;AAClE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,aAAA,EAAe,EAAE,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW,EAAE,CAAC,CAAA;AAAA,EAClF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,MAAA,CACJ,MAAA,EACA,UAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,aAAA,EAAe;AAAA,MACzC,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAA,CACJ,MAAA,EACA,MAAA,EACA,UAAA,EACmC;AACnC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,YAAA,EAAe,kBAAA,CAAmB,MAAM,CAAC,CAAA,CAAA;AAC5D,MAAA;AAC2B,MAAA;AAClC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS0F,EAAA;AACxB,IAAA;AAC7B,MAAA;AAClC,IAAA;AACH,EAAA;AACF;AD5ByE;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-KLONGJCL.cjs","sourcesContent":[null,"import type {\n CreateMerchantCostRuleRequest,\n MerchantCostRuleDeleteResponse,\n MerchantCostRuleResponse,\n UpdateMerchantCostRuleRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Merchant cost rules: what a merchant's own goods and partners' shares cost\n * it, as a percentage, a flat amount or both, merchant-wide or for one shop,\n * over a validity window.\n *\n * A rule is a record, not an instruction. It writes no billing ledger entry and\n * moves no money. Its rate, category and scope cannot be edited; a price change\n * is a new rule with a new window.\n *\n * Every route needs a dashboard session for the merchant: listing needs the\n * merchant account read permission, every change the write permission. A\n * shop-scoped session reaches nothing here.\n */\nexport class CostRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Every cost rule of the merchant.\n * `GET /cost-rules`\n *\n * @param merchantId - The merchant account ID.\n */\n async list(merchantId: string): Promise<MerchantCostRuleResponse[]> {\n return this.request('GET', '/cost-rules', { query: { merchant_id: merchantId } });\n }\n\n /**\n * Record a cost rule.\n * `POST /cost-rules`\n *\n * @param params - The rule.\n * @param merchantId - The merchant account ID.\n */\n async create(\n params: CreateMerchantCostRuleRequest,\n merchantId: string,\n ): Promise<MerchantCostRuleResponse> {\n return this.request('POST', '/cost-rules', {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Close, deactivate or rename a cost rule.\n * `PUT /cost-rules/{rule_id}`\n *\n * @param ruleId - The rule ID.\n * @param params - What to change.\n * @param merchantId - The merchant account ID.\n */\n async update(\n ruleId: string,\n params: UpdateMerchantCostRuleRequest,\n merchantId: string,\n ): Promise<MerchantCostRuleResponse> {\n return this.request('PUT', `/cost-rules/${encodeURIComponent(ruleId)}`, {\n body: params,\n query: { merchant_id: merchantId },\n });\n }\n\n /**\n * Delete a cost rule.\n * `DELETE /cost-rules/{rule_id}`\n *\n * @param ruleId - The rule ID.\n * @param merchantId - The merchant account ID.\n */\n async delete(ruleId: string, merchantId: string): Promise<MerchantCostRuleDeleteResponse> {\n return this.request('DELETE', `/cost-rules/${encodeURIComponent(ruleId)}`, {\n query: { merchant_id: merchantId },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/
|
|
1
|
+
{"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-KOB6MOAV.cjs","../src/resources/persons.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,QAAA,EAAN,MAAc;AAAA,EACnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,EAAwD;AACjE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,UAAA,EAAY,EAAE,KAAA,EAAO,OAA4B,CAAC,CAAA;AAAA,EAC/E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,QAAA,CAAS,QAAA,EAAkB,MAAA,EAAqD;AACpF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC1D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ6F,EAAA;AACxB,IAAA;AAC1D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ+F,EAAA;AAC3B,IAAA;AACzD,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS+F,EAAA;AAC1B,IAAA;AAC1D,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYmC,EAAA;AACmC,IAAA;AAClE,MAAA;AACO,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACrB,IAAA;AACV,MAAA;AACkD,MAAA;AACP,MAAA;AAC7C,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAamC,EAAA;AACrB,IAAA;AACV,MAAA;AACkD,MAAA;AACK,MAAA;AACzD,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQgG,EAAA;AACT,IAAA;AACvF,EAAA;AACF;AD9DwE;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-KOB6MOAV.cjs","sourcesContent":[null,"import type {\n MerchantFlaggedPersonList,\n MerchantFlaggedPersonListParams,\n MerchantPersonFlagCreate,\n MerchantPersonFlagList,\n MerchantPersonFlagUpdate,\n MerchantPersonFlagView,\n PaymentPersonResponse,\n PersonListParams,\n PersonListResponse,\n PersonResponse,\n PersonScopeParams,\n RelatedPersonsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Persons: the payments of one merchant that belong to the same person,\n * joined by a shared customer id, email, device id or card. Two payments\n * that share one of them are one person, also through a chain of payments.\n * An IP address is shown and never joins. An identifier seen with too many\n * different persons is marked `common` and joins nothing.\n *\n * A payment gets its person a few minutes after it was created or changed;\n * until then it has none. When two persons turn out to be one, the older\n * `person_id` stays and the other id keeps resolving to it.\n *\n * Every route takes an API key or a dashboard session. A full secret key\n * reads; a restricted key needs the `persons_view` permission group; a\n * dashboard session needs the persons permission in its role. A credential\n * bound to one shop reads that shop's persons, with every figure counted\n * there. A caller that sees only part of a shop's payments is refused with\n * `403`.\n *\n * The merchant's own flags on its persons (`listFlags`, `flag`, `updateFlag`,\n * `removeFlag`, `listFlagged`) take a dashboard session only, never an API\n * key. Reading them needs the persons permission; setting, changing and\n * removing them needs the persons manage permission. A flag marks a person as\n * suspicious for the merchant's own team: it changes no payment, and no other\n * merchant sees it.\n */\nexport class Persons {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of persons, by default the most recent payment first, with the\n * number of persons the request matches.\n * `GET /persons`\n */\n async list(params?: PersonListParams): Promise<PersonListResponse> {\n return this.request('GET', '/persons', { query: params as Query | undefined });\n }\n\n /**\n * One person: its figures, the identifiers and IP addresses its payments\n * carry, and its payments by status, shop, payment method, risk band and\n * environment. The id of a person that was merged into another returns\n * that person, with `merged_from` naming the id asked for. A person with\n * no payment in the scope is not found (`404`).\n * `GET /persons/{person_id}`\n */\n async retrieve(personId: string, params?: PersonScopeParams): Promise<PersonResponse> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Other persons of the merchant that may be the same person, the likeliest\n * first, at most 20. An estimate from the devices the persons paid with;\n * related persons stay separate persons.\n * `GET /persons/{person_id}/related`\n */\n async related(personId: string, params?: PersonScopeParams): Promise<RelatedPersonsResponse> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}/related`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * The person of one payment, with how many payments the person has and\n * which kinds of identifier tie this payment to the others. `404` while\n * the payment has no person yet.\n * `GET /persons/payment/{payment_id}`\n */\n async ofPayment(paymentId: string, params?: PersonScopeParams): Promise<PaymentPersonResponse> {\n return this.request('GET', `/persons/payment/${encodeURIComponent(paymentId)}`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Every flag the merchant's team set on the person, active and removed,\n * newest first, with those of the persons merged into it. A merged person\n * reads as the person it merged into. A person with no payment in the\n * scope, or another merchant's, is not found (`404`).\n * `GET /persons/{person_id}/flags`\n */\n async listFlags(personId: string, params?: PersonScopeParams): Promise<MerchantPersonFlagList> {\n return this.request('GET', `/persons/${encodeURIComponent(personId)}/flags`, {\n query: params as Query | undefined,\n });\n }\n\n /**\n * Flags the person for the merchant's team, with a reason and an optional\n * note. A merged person's flag goes on the person it merged into. A person\n * already flagged is refused with `IR_38` (400).\n * `POST /persons/{person_id}/flags`\n */\n async flag(\n personId: string,\n body: MerchantPersonFlagCreate,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request('POST', `/persons/${encodeURIComponent(personId)}/flags`, {\n body,\n query: params as Query | undefined,\n });\n }\n\n /**\n * Replaces an active flag's reason and note at the `version` read. A\n * colleague's newer change, or a removal, since that read is refused with\n * `IR_16` (400) rather than overwritten.\n * `PUT /persons/{person_id}/flags/{flag_id}`\n */\n async updateFlag(\n personId: string,\n flagId: string,\n body: MerchantPersonFlagUpdate,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request(\n 'PUT',\n `/persons/${encodeURIComponent(personId)}/flags/${encodeURIComponent(flagId)}`,\n { body, query: params as Query | undefined },\n );\n }\n\n /**\n * Removes a flag at the `version` read: the flag stops and stays in the\n * history with who removed it and when, which is what this answers. A\n * colleague's change since that read is refused with `IR_16` (400).\n * `DELETE /persons/{person_id}/flags/{flag_id}?version=`\n */\n async removeFlag(\n personId: string,\n flagId: string,\n version: number,\n params?: PersonScopeParams,\n ): Promise<MerchantPersonFlagView> {\n return this.request(\n 'DELETE',\n `/persons/${encodeURIComponent(personId)}/flags/${encodeURIComponent(flagId)}`,\n { query: { ...(params as Query | undefined), version } },\n );\n }\n\n /**\n * One page of the persons in scope with an active flag of the merchant,\n * each once with its newest active flag, newest flag first, and how many\n * there are over every page. A `limit` outside 1 to 100 is a `400`.\n * `GET /persons/flagged`\n */\n async listFlagged(params?: MerchantFlaggedPersonListParams): Promise<MerchantFlaggedPersonList> {\n return this.request('GET', '/persons/flagged', { query: params as Query | undefined });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/_worktrees/sdk-publish-0425-clone-w4/dist/chunk-KSJ7JLR3.cjs","../src/resources/disputes.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACuBA,SAAS,cAAA,CAAe,MAAA,EAA2D;AACjF,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,EAAE,SAAA,EAAW,QAAA,EAAU,cAAA,EAAgB,aAAA,EAAe,GAAG,MAAM,EAAA,EAAI,MAAA;AACzE,EAAA,OAAO;AAAA,IACL,GAAG,KAAA;AAAA,IACH,mBAAI,SAAA,2BAAW,SAAA,EAAS,EAAE,SAAA,EAAW,SAAA,CAAU,IAAA,CAAK,GAAG,EAAE,EAAA,EAAI,CAAC,CAAA;AAAA,IAC9D,mBAAI,QAAA,6BAAU,SAAA,EAAS,EAAE,QAAA,EAAU,QAAA,CAAS,IAAA,CAAK,GAAG,EAAE,EAAA,EAAI,CAAC,CAAA;AAAA,IAC3D,mBAAI,cAAA,6BAAgB,SAAA,EAAS,EAAE,cAAA,EAAgB,cAAA,CAAe,IAAA,CA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AAAA;AAAA;AAAA;AAAA;AAAA;AAQmE,EAAA;AACpB,IAAA;AACpC,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ0D,EAAA;AACW,IAAA;AACrE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAc+F,EAAA;AACvB,IAAA;AAC9D,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ+E,EAAA;AACX,IAAA;AACpE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO+E,EAAA;AACZ,IAAA;AACnE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY2E,EAAA;AACL,IAAA;AACtE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ8E,EAAA;AACR,IAAA;AACtE,EAAA;AAAA;AAAA;AAK4E,EAAA;AACrB,IAAA;AAC5C,MAAA;AACR,IAAA;AACH,EAAA;AAAA;AAKoC,EAAA;AAC8B,IAAA;AAClE,EAAA;AAAA;AAKoC,EAAA;AAC8B,IAAA;AAClE,EAAA;AAAA;AAKoC,EAAA;AACiC,IAAA;AACrE,EAAA;AAAA;AAKoC,EAAA;AACiC,IAAA;AACrE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAesE,EAAA;AACC,IAAA;AACvC,MAAA;AAC7B,IAAA;AACH,EAAA;AACF;ADxF0E;AACA;AACA;AACA","file":"/home/anes/delo-payment/_worktrees/sdk-publish-0425-clone-w4/dist/chunk-KSJ7JLR3.cjs","sourcesContent":[null,"import type {\n DisputeReconcileRequest,\n DisputeResponse,\n DisputeListParams,\n DisputeEvidenceRequest,\n DeleteEvidenceRequest,\n DisputeEvidenceBlock,\n DisputeRefundDeclaration,\n DisputeRefundAssociationRequest,\n DisputeRefundAssociationsResponse,\n DisputeWorkspaceRequest,\n DisputeWorkspaceResponse,\n DisputeWorkspaceFilters,\n DisputeWorkspaceAggregate,\n DisputeWorkspaceExport,\n DisputeBulkAcceptRequest,\n DisputeBulkAcceptResponse,\n DisputeBulkBlockBuyerRequest,\n DisputeBulkBlockBuyerResponse,\n DisputeBulkPreviewRequest,\n DisputeBulkPreviewResponse,\n DynamicWorkspaceExportOptions,\n JsonExportOptions,\n PdfExportOptions,\n} from '../types';\nimport type { RequestFn, RequestOptions } from '../client';\nimport { WORKSPACE_ENVELOPE, downloadExport, negotiated } from '../exportDownload';\n\n/** Workspace filters use CSV values, unlike the transport's repeated-key arrays. */\nfunction workspaceQuery(params?: DisputeWorkspaceRequest): RequestOptions['query'] {\n if (!params) return undefined;\n const { connector, currency, dispute_status, dispute_stage, ...query } = params;\n return {\n ...query,\n ...(connector?.length ? { connector: connector.join(',') } : {}),\n ...(currency?.length ? { currency: currency.join(',') } : {}),\n ...(dispute_status?.length ? { dispute_status: dispute_status.join(',') } : {}),\n ...(dispute_stage?.length ? { dispute_stage: dispute_stage.join(',') } : {}),\n };\n}\n\n/** View and respond to payment disputes and chargebacks. */\nexport class Disputes {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native disputes and provider-only cases once, after shared authorization and filters. */\n async workspace(params?: DisputeWorkspaceRequest): Promise<DisputeWorkspaceResponse> {\n return this.request('GET', '/disputes/workspace', { query: workspaceQuery(params) });\n }\n\n /** Read filter options over the same scoped case set; pagination is ignored. */\n async workspaceFilters(params?: DisputeWorkspaceRequest): Promise<DisputeWorkspaceFilters> {\n return this.request('GET', '/disputes/workspace/filters', { query: workspaceQuery(params) });\n }\n\n /** Count the filtered case set, including unknown outcomes; pagination is ignored. */\n async workspaceAggregate(params?: DisputeWorkspaceRequest): Promise<DisputeWorkspaceAggregate> {\n return this.request('GET', '/disputes/workspace/aggregate', { query: workspaceQuery(params) });\n }\n\n /**\n * Export the complete filtered set, or throw on the server's explicit\n * export-limit refusal. `GET /disputes/workspace/export`\n *\n * The body is streamed, and held to the `X-Delopay-Record-Count` the server\n * announces and to its own `total_count`: a set that arrives short rejects\n * with `EXPORT_INCOMPLETE` rather than resolving. `options` reports the\n * download's progress and takes a signal and an idle timeout — see\n * {@link ExportTransferOptions}.\n *\n * `format: 'pdf'` resolves to the same set laid out as a document (a\n * `Blob`), with the words in `options.presentation` — see\n * {@link ExportPresentation}. This route offers no CSV.\n */\n async workspaceExport(\n params?: DisputeWorkspaceRequest,\n options?: JsonExportOptions,\n ): Promise<DisputeWorkspaceExport>;\n async workspaceExport(\n params: DisputeWorkspaceRequest | undefined,\n options: PdfExportOptions,\n ): Promise<Blob>;\n async workspaceExport(\n params: DisputeWorkspaceRequest | undefined,\n options: DynamicWorkspaceExportOptions,\n ): Promise<DisputeWorkspaceExport | Blob>;\n async workspaceExport(\n params?: DisputeWorkspaceRequest,\n options?: JsonExportOptions | PdfExportOptions | DynamicWorkspaceExportOptions,\n ): Promise<DisputeWorkspaceExport | Blob> {\n const format = options?.format ?? 'json';\n return downloadExport(\n this.request,\n {\n method: 'GET',\n path: '/disputes/workspace/export',\n request: negotiated({ query: workspaceQuery(params) }, format, options?.presentation),\n format,\n envelope: WORKSPACE_ENVELOPE,\n },\n options,\n );\n }\n\n /**\n * What a bulk action would do to the selected cases, changing nothing:\n * each case as eligible or skipped with a reason, and what the eligible ones\n * add up to per currency. Name the cases by `ids` or by the list's\n * `filters`, exactly one of the two; at most `max_cases` are read.\n *\n * `POST /disputes/workspace/bulk/preview`. Needs a dashboard JWT.\n */\n async bulkPreview(request: DisputeBulkPreviewRequest): Promise<DisputeBulkPreviewResponse> {\n // The body's filters take CSV values, as the list's query does.\n const { filters, ...rest } = request;\n return this.request('POST', '/disputes/workspace/bulk/preview', {\n body: filters ? { ...rest, filters: workspaceQuery(filters) } : rest,\n });\n }\n\n /**\n * Accept the listed cases at their processors, at most the preview's\n * `max_run_cases` per call; send a larger set in parts under one\n * `request_id`. Eligibility is decided again at run time, and every case\n * gets its own result. An `unknown` result means the processor may have\n * acted: read the case before acting on it again.\n *\n * `POST /disputes/workspace/bulk/accept`. Needs a dashboard JWT.\n */\n async bulkAccept(request: DisputeBulkAcceptRequest): Promise<DisputeBulkAcceptResponse> {\n return this.request('POST', '/disputes/workspace/bulk/accept', { body: request });\n }\n\n /**\n * Add the buyer of each listed case's payment to the buyer blocklist: the\n * payment's email and customer id, and the device ids and IP address of the\n * browser that paid, when DeloPay can tie them to it. Identifiers already\n * blocked are not added again, and `unattributed` names those it could not\n * tie to the buyer.\n *\n * `POST /disputes/workspace/bulk/block-buyer`. Needs a dashboard JWT.\n */\n async bulkBlockBuyer(\n request: DisputeBulkBlockBuyerRequest,\n ): Promise<DisputeBulkBlockBuyerResponse> {\n return this.request('POST', '/disputes/workspace/bulk/block-buyer', { body: request });\n }\n\n /**\n * Retrieve a dispute by its ID.\n *\n * @param disputeId - The unique dispute ID.\n * @returns The dispute.\n */\n async retrieve(disputeId: string): Promise<DisputeResponse> {\n return this.request('GET', `/disputes/${encodeURIComponent(disputeId)}`);\n }\n\n /** Read declared links and provider-reported refund references. Empty means unknown. */\n async listRefundAssociations(disputeId: string): Promise<DisputeRefundAssociationsResponse> {\n return this.request('GET', `/disputes/${encodeURIComponent(disputeId)}/refund-associations`);\n }\n\n /** Declare or clear an allocation against a successful refund of this payment. */\n async setRefundAssociation(\n disputeId: string,\n params: DisputeRefundAssociationRequest,\n ): Promise<DisputeRefundDeclaration> {\n return this.request('PUT', `/disputes/${encodeURIComponent(disputeId)}/refund-associations`, {\n body: params,\n });\n }\n\n /**\n * List disputes, optionally filtered by status, stage, or date range.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of disputes.\n */\n async list(params?: DisputeListParams): Promise<DisputeResponse[]> {\n return this.request('GET', '/disputes/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * Accept a dispute, conceding the chargeback to the customer.\n *\n * @param disputeId - The dispute ID to accept.\n * @returns The updated dispute.\n */\n async accept(disputeId: string): Promise<DisputeResponse> {\n return this.request('POST', `/disputes/accept/${encodeURIComponent(disputeId)}`);\n }\n\n /**\n * Correct the exchange rate of a dispute the processor reported in another\n * currency, or record its final settled amount. Until it is settled, the\n * reserved amount is an estimate and no other dispute on the same payment\n * attempt can take a new reservation. Signed-in users with the\n * external-record permission only.\n *\n * @param disputeId - The dispute to reconcile.\n * @param request - `correct_rate` with the processor's rate, or `settle`\n * with the final amount and a reason.\n * @returns The updated dispute.\n */\n async reconcile(disputeId: string, request: DisputeReconcileRequest): Promise<DisputeResponse> {\n return this.request('POST', `/disputes/${encodeURIComponent(disputeId)}/reconcile`, {\n body: request,\n });\n }\n\n /**\n * Submit evidence to challenge a dispute.\n *\n * @param params - Evidence details and the dispute ID to contest.\n * @returns The updated dispute.\n */\n async submitEvidence(params: DisputeEvidenceRequest): Promise<DisputeResponse> {\n return this.request('POST', '/disputes/evidence', { body: params });\n }\n\n /**\n * Attach evidence (e.g. file upload metadata) to a dispute.\n *\n * Uses `PUT /disputes/evidence`.\n */\n async attachEvidence(params: DisputeEvidenceRequest): Promise<DisputeResponse> {\n return this.request('PUT', '/disputes/evidence', { body: params });\n }\n\n /**\n * Retrieve previously stored evidence for a dispute.\n *\n * Returns an ARRAY of file-evidence blocks (this was previously mistyped\n * as the flat submit-request shape). Only file evidence is reported —\n * text evidence is not retrievable once submitted.\n *\n * @param disputeId - The dispute ID.\n * @returns The stored file-evidence blocks.\n */\n async retrieveEvidence(disputeId: string): Promise<DisputeEvidenceBlock[]> {\n return this.request('GET', `/disputes/evidence/${encodeURIComponent(disputeId)}`);\n }\n\n /**\n * Delete submitted evidence for a dispute.\n *\n * @param params - Evidence request body identifying what to delete.\n * @returns The updated dispute.\n */\n async deleteEvidence(params: DeleteEvidenceRequest): Promise<DisputeResponse> {\n return this.request('DELETE', '/disputes/evidence', { body: params });\n }\n\n // --- OLAP extensions (Task 4.4) ---\n\n /** List disputes (profile-scoped). `GET /disputes/profile/list` */\n async listByProfile(params?: DisputeListParams): Promise<DisputeResponse[]> {\n return this.request('GET', '/disputes/profile/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /** Get dispute filter options. `GET /disputes/filter` */\n async getFilters(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/filter', { query: params });\n }\n\n /** Get dispute filters (profile-scoped). `GET /disputes/profile/filter` */\n async getFiltersByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/profile/filter', { query: params });\n }\n\n /** Get dispute aggregates. `GET /disputes/aggregate` */\n async aggregate(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/aggregate', { query: params });\n }\n\n /** Get dispute aggregates (profile-scoped). `GET /disputes/profile/aggregate` */\n async aggregateByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/profile/aggregate', { query: params });\n }\n\n /**\n * Fetch the latest dispute state from the connector (gateway) and persist it.\n * `GET /disputes/{disputeId}?force_sync=true`\n *\n * The path parameter is the **Delopay dispute id** (`dp_…`). Force-sync asks the\n * backend to pull the dispute from the connector (supported where the connector\n * implements the dispute-sync flow, e.g. Stripe) and update the stored record\n * before returning it.\n *\n * Note: this method previously called `GET /disputes/{id}/fetch`, which is a\n * different backend route — a bulk import keyed by **merchant connector account\n * id** with a required date range — so every call with a dispute id failed.\n */\n async fetchFromConnector(disputeId: string): Promise<DisputeResponse> {\n return this.request('GET', `/disputes/${encodeURIComponent(disputeId)}`, {\n query: { force_sync: 'true' },\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-KSJ7JLR3.cjs","../src/resources/disputes.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACuBA,SAAS,cAAA,CA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AAAA;AAKoC,EAAA;AAC8B,IAAA;AAClE,EAAA;AAAA;AAKoC,EAAA;AAC8B,IAAA;AAClE,EAAA;AAAA;AAKoC,EAAA;AACiC,IAAA;AACrE,EAAA;AAAA;AAKoC,EAAA;AACiC,IAAA;AACrE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAesE,EAAA;AACC,IAAA;AACvC,MAAA;AAC7B,IAAA;AACH,EAAA;AACF;ADxF0E;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-KSJ7JLR3.cjs","sourcesContent":[null,"import type {\n DisputeReconcileRequest,\n DisputeResponse,\n DisputeListParams,\n DisputeEvidenceRequest,\n DeleteEvidenceRequest,\n DisputeEvidenceBlock,\n DisputeRefundDeclaration,\n DisputeRefundAssociationRequest,\n DisputeRefundAssociationsResponse,\n DisputeWorkspaceRequest,\n DisputeWorkspaceResponse,\n DisputeWorkspaceFilters,\n DisputeWorkspaceAggregate,\n DisputeWorkspaceExport,\n DisputeBulkAcceptRequest,\n DisputeBulkAcceptResponse,\n DisputeBulkBlockBuyerRequest,\n DisputeBulkBlockBuyerResponse,\n DisputeBulkPreviewRequest,\n DisputeBulkPreviewResponse,\n DynamicWorkspaceExportOptions,\n JsonExportOptions,\n PdfExportOptions,\n} from '../types';\nimport type { RequestFn, RequestOptions } from '../client';\nimport { WORKSPACE_ENVELOPE, downloadExport, negotiated } from '../exportDownload';\n\n/** Workspace filters use CSV values, unlike the transport's repeated-key arrays. */\nfunction workspaceQuery(params?: DisputeWorkspaceRequest): RequestOptions['query'] {\n if (!params) return undefined;\n const { connector, currency, dispute_status, dispute_stage, ...query } = params;\n return {\n ...query,\n ...(connector?.length ? { connector: connector.join(',') } : {}),\n ...(currency?.length ? { currency: currency.join(',') } : {}),\n ...(dispute_status?.length ? { dispute_status: dispute_status.join(',') } : {}),\n ...(dispute_stage?.length ? { dispute_stage: dispute_stage.join(',') } : {}),\n };\n}\n\n/** View and respond to payment disputes and chargebacks. */\nexport class Disputes {\n constructor(private readonly request: RequestFn) {}\n\n /** Read native disputes and provider-only cases once, after shared authorization and filters. */\n async workspace(params?: DisputeWorkspaceRequest): Promise<DisputeWorkspaceResponse> {\n return this.request('GET', '/disputes/workspace', { query: workspaceQuery(params) });\n }\n\n /** Read filter options over the same scoped case set; pagination is ignored. */\n async workspaceFilters(params?: DisputeWorkspaceRequest): Promise<DisputeWorkspaceFilters> {\n return this.request('GET', '/disputes/workspace/filters', { query: workspaceQuery(params) });\n }\n\n /** Count the filtered case set, including unknown outcomes; pagination is ignored. */\n async workspaceAggregate(params?: DisputeWorkspaceRequest): Promise<DisputeWorkspaceAggregate> {\n return this.request('GET', '/disputes/workspace/aggregate', { query: workspaceQuery(params) });\n }\n\n /**\n * Export the complete filtered set, or throw on the server's explicit\n * export-limit refusal. `GET /disputes/workspace/export`\n *\n * The body is streamed, and held to the `X-Delopay-Record-Count` the server\n * announces and to its own `total_count`: a set that arrives short rejects\n * with `EXPORT_INCOMPLETE` rather than resolving. `options` reports the\n * download's progress and takes a signal and an idle timeout — see\n * {@link ExportTransferOptions}.\n *\n * `format: 'pdf'` resolves to the same set laid out as a document (a\n * `Blob`), with the words in `options.presentation` — see\n * {@link ExportPresentation}. This route offers no CSV.\n */\n async workspaceExport(\n params?: DisputeWorkspaceRequest,\n options?: JsonExportOptions,\n ): Promise<DisputeWorkspaceExport>;\n async workspaceExport(\n params: DisputeWorkspaceRequest | undefined,\n options: PdfExportOptions,\n ): Promise<Blob>;\n async workspaceExport(\n params: DisputeWorkspaceRequest | undefined,\n options: DynamicWorkspaceExportOptions,\n ): Promise<DisputeWorkspaceExport | Blob>;\n async workspaceExport(\n params?: DisputeWorkspaceRequest,\n options?: JsonExportOptions | PdfExportOptions | DynamicWorkspaceExportOptions,\n ): Promise<DisputeWorkspaceExport | Blob> {\n const format = options?.format ?? 'json';\n return downloadExport(\n this.request,\n {\n method: 'GET',\n path: '/disputes/workspace/export',\n request: negotiated({ query: workspaceQuery(params) }, format, options?.presentation),\n format,\n envelope: WORKSPACE_ENVELOPE,\n },\n options,\n );\n }\n\n /**\n * What a bulk action would do to the selected cases, changing nothing:\n * each case as eligible or skipped with a reason, and what the eligible ones\n * add up to per currency. Name the cases by `ids` or by the list's\n * `filters`, exactly one of the two; at most `max_cases` are read.\n *\n * `POST /disputes/workspace/bulk/preview`. Needs a dashboard JWT.\n */\n async bulkPreview(request: DisputeBulkPreviewRequest): Promise<DisputeBulkPreviewResponse> {\n // The body's filters take CSV values, as the list's query does.\n const { filters, ...rest } = request;\n return this.request('POST', '/disputes/workspace/bulk/preview', {\n body: filters ? { ...rest, filters: workspaceQuery(filters) } : rest,\n });\n }\n\n /**\n * Accept the listed cases at their processors, at most the preview's\n * `max_run_cases` per call; send a larger set in parts under one\n * `request_id`. Eligibility is decided again at run time, and every case\n * gets its own result. An `unknown` result means the processor may have\n * acted: read the case before acting on it again.\n *\n * `POST /disputes/workspace/bulk/accept`. Needs a dashboard JWT.\n */\n async bulkAccept(request: DisputeBulkAcceptRequest): Promise<DisputeBulkAcceptResponse> {\n return this.request('POST', '/disputes/workspace/bulk/accept', { body: request });\n }\n\n /**\n * Add the buyer of each listed case's payment to the buyer blocklist: the\n * payment's email and customer id, and the device ids and IP address of the\n * browser that paid, when DeloPay can tie them to it. Identifiers already\n * blocked are not added again, and `unattributed` names those it could not\n * tie to the buyer.\n *\n * `POST /disputes/workspace/bulk/block-buyer`. Needs a dashboard JWT.\n */\n async bulkBlockBuyer(\n request: DisputeBulkBlockBuyerRequest,\n ): Promise<DisputeBulkBlockBuyerResponse> {\n return this.request('POST', '/disputes/workspace/bulk/block-buyer', { body: request });\n }\n\n /**\n * Retrieve a dispute by its ID.\n *\n * @param disputeId - The unique dispute ID.\n * @returns The dispute.\n */\n async retrieve(disputeId: string): Promise<DisputeResponse> {\n return this.request('GET', `/disputes/${encodeURIComponent(disputeId)}`);\n }\n\n /** Read declared links and provider-reported refund references. Empty means unknown. */\n async listRefundAssociations(disputeId: string): Promise<DisputeRefundAssociationsResponse> {\n return this.request('GET', `/disputes/${encodeURIComponent(disputeId)}/refund-associations`);\n }\n\n /** Declare or clear an allocation against a successful refund of this payment. */\n async setRefundAssociation(\n disputeId: string,\n params: DisputeRefundAssociationRequest,\n ): Promise<DisputeRefundDeclaration> {\n return this.request('PUT', `/disputes/${encodeURIComponent(disputeId)}/refund-associations`, {\n body: params,\n });\n }\n\n /**\n * List disputes, optionally filtered by status, stage, or date range.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of disputes.\n */\n async list(params?: DisputeListParams): Promise<DisputeResponse[]> {\n return this.request('GET', '/disputes/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * Accept a dispute, conceding the chargeback to the customer.\n *\n * @param disputeId - The dispute ID to accept.\n * @returns The updated dispute.\n */\n async accept(disputeId: string): Promise<DisputeResponse> {\n return this.request('POST', `/disputes/accept/${encodeURIComponent(disputeId)}`);\n }\n\n /**\n * Correct the exchange rate of a dispute the processor reported in another\n * currency, or record its final settled amount. Until it is settled, the\n * reserved amount is an estimate and no other dispute on the same payment\n * attempt can take a new reservation. Signed-in users with the\n * external-record permission only.\n *\n * @param disputeId - The dispute to reconcile.\n * @param request - `correct_rate` with the processor's rate, or `settle`\n * with the final amount and a reason.\n * @returns The updated dispute.\n */\n async reconcile(disputeId: string, request: DisputeReconcileRequest): Promise<DisputeResponse> {\n return this.request('POST', `/disputes/${encodeURIComponent(disputeId)}/reconcile`, {\n body: request,\n });\n }\n\n /**\n * Submit evidence to challenge a dispute.\n *\n * @param params - Evidence details and the dispute ID to contest.\n * @returns The updated dispute.\n */\n async submitEvidence(params: DisputeEvidenceRequest): Promise<DisputeResponse> {\n return this.request('POST', '/disputes/evidence', { body: params });\n }\n\n /**\n * Attach evidence (e.g. file upload metadata) to a dispute.\n *\n * Uses `PUT /disputes/evidence`.\n */\n async attachEvidence(params: DisputeEvidenceRequest): Promise<DisputeResponse> {\n return this.request('PUT', '/disputes/evidence', { body: params });\n }\n\n /**\n * Retrieve previously stored evidence for a dispute.\n *\n * Returns an ARRAY of file-evidence blocks (this was previously mistyped\n * as the flat submit-request shape). Only file evidence is reported —\n * text evidence is not retrievable once submitted.\n *\n * @param disputeId - The dispute ID.\n * @returns The stored file-evidence blocks.\n */\n async retrieveEvidence(disputeId: string): Promise<DisputeEvidenceBlock[]> {\n return this.request('GET', `/disputes/evidence/${encodeURIComponent(disputeId)}`);\n }\n\n /**\n * Delete submitted evidence for a dispute.\n *\n * @param params - Evidence request body identifying what to delete.\n * @returns The updated dispute.\n */\n async deleteEvidence(params: DeleteEvidenceRequest): Promise<DisputeResponse> {\n return this.request('DELETE', '/disputes/evidence', { body: params });\n }\n\n // --- OLAP extensions (Task 4.4) ---\n\n /** List disputes (profile-scoped). `GET /disputes/profile/list` */\n async listByProfile(params?: DisputeListParams): Promise<DisputeResponse[]> {\n return this.request('GET', '/disputes/profile/list', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /** Get dispute filter options. `GET /disputes/filter` */\n async getFilters(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/filter', { query: params });\n }\n\n /** Get dispute filters (profile-scoped). `GET /disputes/profile/filter` */\n async getFiltersByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/profile/filter', { query: params });\n }\n\n /** Get dispute aggregates. `GET /disputes/aggregate` */\n async aggregate(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/aggregate', { query: params });\n }\n\n /** Get dispute aggregates (profile-scoped). `GET /disputes/profile/aggregate` */\n async aggregateByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/disputes/profile/aggregate', { query: params });\n }\n\n /**\n * Fetch the latest dispute state from the connector (gateway) and persist it.\n * `GET /disputes/{disputeId}?force_sync=true`\n *\n * The path parameter is the **Delopay dispute id** (`dp_…`). Force-sync asks the\n * backend to pull the dispute from the connector (supported where the connector\n * implements the dispute-sync flow, e.g. Stripe) and update the stored record\n * before returning it.\n *\n * Note: this method previously called `GET /disputes/{id}/fetch`, which is a\n * different backend route — a bulk import keyed by **merchant connector account\n * id** with a required date range — so every call with a dispute id failed.\n */\n async fetchFromConnector(disputeId: string): Promise<DisputeResponse> {\n return this.request('GET', `/disputes/${encodeURIComponent(disputeId)}`, {\n query: { force_sync: 'true' },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/_worktrees/sdk-publish-0425-clone-w4/dist/chunk-LJ2EG6JK.cjs","../src/resources/paymentMethods.ts"],"names":[],"mappings":"AAAA;ACeO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBlD,MAAM,MAAA,CAAO,MAAA,EAAoE;AAC/E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,QAAA,CAAS,QAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYkC,EAAA;AAC4C,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;A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IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAGwF,EAAA;AACZ,IAAA;AAC5E,EAAA;AAAA;AAG2F,EAAA;AACnB,IAAA;AACxE,EAAA;AAAA;AAMoC,EAAA;AAC0C,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADhDgF;AACA;AACA;AACA","file":"/home/anes/delo-payment/_worktrees/sdk-publish-0425-clone-w4/dist/chunk-LJ2EG6JK.cjs","sourcesContent":[null,"import type {\n PaymentMethodCreateRequest,\n PaymentMethodResponse,\n PaymentMethodUpdateRequest,\n PaymentMethodListParams,\n PaymentMethodListResponse,\n PaymentMethodDeleteResponse,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n CustomerPaymentMethodsListParams,\n CustomerPaymentMethodsListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Create and manage saved payment methods for customers. */\nexport class PaymentMethods {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Save a new payment method (card, bank account, wallet, etc.).\n *\n * @param params - Payment method data including type and card/bank details.\n * @returns The saved payment method.\n *\n * @example\n * ```typescript\n * const pm = await delopay.paymentMethods.create({\n * payment_method: 'card',\n * customer_id: 'cus_123',\n * client_secret: 'cs_...',\n * });\n * ```\n */\n async create(params: PaymentMethodCreateRequest): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods', { body: params });\n }\n\n /**\n * Retrieve a saved payment method by its ID.\n *\n * @param methodId - The payment method ID.\n * @returns The payment method.\n */\n async retrieve(methodId: string): Promise<PaymentMethodResponse> {\n return this.request('GET', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * Update an existing payment method (e.g. update card expiry).\n *\n * @param methodId - The payment method ID to update.\n * @param params - Fields to update (card expiry, holder name, etc.).\n * @returns The updated payment method.\n */\n async update(\n methodId: string,\n params: PaymentMethodUpdateRequest,\n ): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/update`, {\n body: params,\n });\n }\n\n /**\n * Delete a saved payment method.\n *\n * @param methodId - The payment method ID to delete.\n * @returns Deletion confirmation.\n */\n async delete(methodId: string): Promise<PaymentMethodDeleteResponse> {\n return this.request('DELETE', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * List the payment methods available for a payment — the discovery endpoint a\n * custom checkout renders its tiles from.\n *\n * Callable with a publishable key plus the payment's `client_secret`, so it\n * runs from the browser. The returned set is already filtered by country,\n * order value and the merchant's availability rules, and each entry carries\n * `display` (name + icon slug) and `amount_limits` (the order values it stays\n * available for) so you do not have to maintain either alongside.\n *\n * This is *not* the customer's saved methods — see {@link listForCustomer}.\n *\n * @param params - `client_secret`, plus optional `country`, `amount` and filters.\n * @returns The methods available for the payment, grouped by payment method.\n *\n * @example\n * ```typescript\n * const { payment_methods } = await delopay.paymentMethods.list({\n * client_secret: 'pay_abc_secret_xyz',\n * country: 'DE',\n * amount: 25000,\n * });\n *\n * for (const group of payment_methods) {\n * for (const method of group.payment_method_types) {\n * // Re-check availability yourself as the cart total changes, instead of\n * // re-listing on every keystroke.\n * const limits = method.amount_limits;\n * const available =\n * !limits ||\n * ((limits.min_amount == null || cartTotal >= limits.min_amount) &&\n * (limits.max_amount == null || cartTotal <= limits.max_amount) &&\n * !limits.excluded_ranges.some(\n * (band) => cartTotal >= band.min_amount && cartTotal <= band.max_amount,\n * ));\n *\n * if (available) render(method.display?.display_name, method.display?.icon_slug);\n * }\n * }\n * ```\n */\n async list(params?: PaymentMethodListParams): Promise<PaymentMethodListResponse> {\n return this.request('GET', '/payment-methods', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * The shop's payment buttons as the hosted checkout draws them: order,\n * labels in the shop's or caller's language, artwork, and what selecting\n * each one does. For rendering payment buttons on your own site without a\n * local table of provider names and icons.\n *\n * With a secret key, name the shop (`profile_id`) and optionally the\n * environment and a buyer context; the answer may be reused for\n * `cache.max_age_seconds` — {@link PresentationCache} does that. With a\n * publishable key, pass the payment's `client_secret` (or use\n * `CheckoutSession.paymentMethodPresentation`); that answer is never reused.\n *\n * A displayed entry is not a promise: the payment is confirmed against the\n * current configuration.\n *\n * `GET /account/payment-methods/presentation`\n *\n * @example\n * ```typescript\n * const buttons = await delopay.paymentMethods.presentation({\n * profile_id: 'pro_123',\n * country: 'DE',\n * currency: 'EUR',\n * amount: 4999,\n * locale: 'de',\n * });\n * for (const entry of buttons.entries) {\n * if (entry.kind === 'heading') renderHeading(entry.label);\n * else renderButton(entry.label, entry.sublabel, presentationIconSrc(entry));\n * }\n * ```\n */\n async presentation(\n params?: PaymentMethodPresentationParams,\n options?: RequestExtras,\n ): Promise<PaymentMethodPresentationResponse> {\n return this.request('GET', '/account/payment-methods/presentation', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * List all saved payment methods for a customer, optionally filtered.\n *\n * @param customerId - The customer ID.\n * @param params - Optional filters: `client_secret`, `accepted_countries`, `accepted_currencies`,\n * `amount`, `recurring_enabled`, `installment_payment_enabled`, `limit`, `card_networks`.\n * @returns Customer's saved payment methods.\n *\n * @example\n * ```typescript\n * const { customer_payment_methods } = await delopay.paymentMethods.listForCustomer(\n * 'cus_123',\n * { accepted_currencies: ['EUR'], amount: 5000 },\n * );\n * ```\n */\n async listForCustomer(\n customerId: string,\n params?: CustomerPaymentMethodsListParams,\n ): Promise<CustomerPaymentMethodsListResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/payment-methods`, {\n query: params as Record<\n string,\n string | number | boolean | (string | number | boolean)[] | null | undefined\n >,\n });\n }\n\n /**\n * Set a payment method as the default for a customer.\n *\n * @param customerId - The customer ID.\n * @param methodId - The payment method ID to set as default.\n * @returns The updated payment method.\n */\n async setDefault(customerId: string, methodId: string): Promise<PaymentMethodResponse> {\n return this.request(\n 'POST',\n `/customers/${encodeURIComponent(customerId)}/payment-methods/${encodeURIComponent(methodId)}/default`,\n );\n }\n\n // --- Advanced operations (Task 3.3) ---\n\n /** Migrate a payment method. `POST /payment-methods/migrate` */\n async migrate(params: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods/migrate', { body: params });\n }\n\n /** Batch migrate payment methods. `POST /payment-methods/migrate-batch` */\n async migrateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/migrate-batch', { body: params });\n }\n\n /** Batch update payment methods. `POST /payment-methods/update-batch` */\n async updateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/update-batch', { body: params });\n }\n\n /** Batch retrieve payment methods. `GET /payment-methods/batch` */\n async batchRetrieve(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentMethodResponse[]> {\n return this.request('GET', '/payment-methods/batch', { query: params });\n }\n\n /** Tokenize a card. `POST /payment-methods/tokenize-card` */\n async tokenizeCard(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card', { body: params });\n }\n\n /** Batch tokenize cards. `POST /payment-methods/tokenize-card-batch` */\n async tokenizeCardBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card-batch', { body: params });\n }\n\n /** Initiate payment method collect link flow. `POST /payment-methods/collect` */\n async collect(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/collect', { body: params });\n }\n\n /** Save a payment method. `POST /payment-methods/{methodId}/save` */\n async save(methodId: string, params?: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/save`, {\n body: params,\n });\n }\n\n /** Create payment method auth link token. `POST /payment-methods/auth/link` */\n async createAuthLink(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/link', { body: params });\n }\n\n /** Exchange payment method auth token. `POST /payment-methods/auth/exchange` */\n async exchangeAuthToken(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/exchange', { body: params });\n }\n\n /** Tokenize card using existing PM. `POST /payment-methods/{methodId}/tokenize-card` */\n async tokenizeCardForMethod(\n methodId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/tokenize-card`, {\n body: params,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-LJ2EG6JK.cjs","../src/resources/paymentMethods.ts"],"names":[],"mappings":"AAAA;ACeO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBlD,MAAM,MAAA,CAAO,MAAA,EAAoE;AAC/E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,kBAAA,EAAoB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAClE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,QAAA,CAAS,QAAA,EAAkD;AAC/D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYkC,EAAA;AAC4C,IAAA;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQqE,EAAA;AACE,IAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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A;AACpE,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADhDgF;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-LJ2EG6JK.cjs","sourcesContent":[null,"import type {\n PaymentMethodCreateRequest,\n PaymentMethodResponse,\n PaymentMethodUpdateRequest,\n PaymentMethodListParams,\n PaymentMethodListResponse,\n PaymentMethodDeleteResponse,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n CustomerPaymentMethodsListParams,\n CustomerPaymentMethodsListResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Create and manage saved payment methods for customers. */\nexport class PaymentMethods {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Save a new payment method (card, bank account, wallet, etc.).\n *\n * @param params - Payment method data including type and card/bank details.\n * @returns The saved payment method.\n *\n * @example\n * ```typescript\n * const pm = await delopay.paymentMethods.create({\n * payment_method: 'card',\n * customer_id: 'cus_123',\n * client_secret: 'cs_...',\n * });\n * ```\n */\n async create(params: PaymentMethodCreateRequest): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods', { body: params });\n }\n\n /**\n * Retrieve a saved payment method by its ID.\n *\n * @param methodId - The payment method ID.\n * @returns The payment method.\n */\n async retrieve(methodId: string): Promise<PaymentMethodResponse> {\n return this.request('GET', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * Update an existing payment method (e.g. update card expiry).\n *\n * @param methodId - The payment method ID to update.\n * @param params - Fields to update (card expiry, holder name, etc.).\n * @returns The updated payment method.\n */\n async update(\n methodId: string,\n params: PaymentMethodUpdateRequest,\n ): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/update`, {\n body: params,\n });\n }\n\n /**\n * Delete a saved payment method.\n *\n * @param methodId - The payment method ID to delete.\n * @returns Deletion confirmation.\n */\n async delete(methodId: string): Promise<PaymentMethodDeleteResponse> {\n return this.request('DELETE', `/payment-methods/${encodeURIComponent(methodId)}`);\n }\n\n /**\n * List the payment methods available for a payment — the discovery endpoint a\n * custom checkout renders its tiles from.\n *\n * Callable with a publishable key plus the payment's `client_secret`, so it\n * runs from the browser. The returned set is already filtered by country,\n * order value and the merchant's availability rules, and each entry carries\n * `display` (name + icon slug) and `amount_limits` (the order values it stays\n * available for) so you do not have to maintain either alongside.\n *\n * This is *not* the customer's saved methods — see {@link listForCustomer}.\n *\n * @param params - `client_secret`, plus optional `country`, `amount` and filters.\n * @returns The methods available for the payment, grouped by payment method.\n *\n * @example\n * ```typescript\n * const { payment_methods } = await delopay.paymentMethods.list({\n * client_secret: 'pay_abc_secret_xyz',\n * country: 'DE',\n * amount: 25000,\n * });\n *\n * for (const group of payment_methods) {\n * for (const method of group.payment_method_types) {\n * // Re-check availability yourself as the cart total changes, instead of\n * // re-listing on every keystroke.\n * const limits = method.amount_limits;\n * const available =\n * !limits ||\n * ((limits.min_amount == null || cartTotal >= limits.min_amount) &&\n * (limits.max_amount == null || cartTotal <= limits.max_amount) &&\n * !limits.excluded_ranges.some(\n * (band) => cartTotal >= band.min_amount && cartTotal <= band.max_amount,\n * ));\n *\n * if (available) render(method.display?.display_name, method.display?.icon_slug);\n * }\n * }\n * ```\n */\n async list(params?: PaymentMethodListParams): Promise<PaymentMethodListResponse> {\n return this.request('GET', '/payment-methods', {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * The shop's payment buttons as the hosted checkout draws them: order,\n * labels in the shop's or caller's language, artwork, and what selecting\n * each one does. For rendering payment buttons on your own site without a\n * local table of provider names and icons.\n *\n * With a secret key, name the shop (`profile_id`) and optionally the\n * environment and a buyer context; the answer may be reused for\n * `cache.max_age_seconds` — {@link PresentationCache} does that. With a\n * publishable key, pass the payment's `client_secret` (or use\n * `CheckoutSession.paymentMethodPresentation`); that answer is never reused.\n *\n * A displayed entry is not a promise: the payment is confirmed against the\n * current configuration.\n *\n * `GET /account/payment-methods/presentation`\n *\n * @example\n * ```typescript\n * const buttons = await delopay.paymentMethods.presentation({\n * profile_id: 'pro_123',\n * country: 'DE',\n * currency: 'EUR',\n * amount: 4999,\n * locale: 'de',\n * });\n * for (const entry of buttons.entries) {\n * if (entry.kind === 'heading') renderHeading(entry.label);\n * else renderButton(entry.label, entry.sublabel, presentationIconSrc(entry));\n * }\n * ```\n */\n async presentation(\n params?: PaymentMethodPresentationParams,\n options?: RequestExtras,\n ): Promise<PaymentMethodPresentationResponse> {\n return this.request('GET', '/account/payment-methods/presentation', {\n query: params as Record<string, string | number | undefined>,\n ...options,\n });\n }\n\n /**\n * List all saved payment methods for a customer, optionally filtered.\n *\n * @param customerId - The customer ID.\n * @param params - Optional filters: `client_secret`, `accepted_countries`, `accepted_currencies`,\n * `amount`, `recurring_enabled`, `installment_payment_enabled`, `limit`, `card_networks`.\n * @returns Customer's saved payment methods.\n *\n * @example\n * ```typescript\n * const { customer_payment_methods } = await delopay.paymentMethods.listForCustomer(\n * 'cus_123',\n * { accepted_currencies: ['EUR'], amount: 5000 },\n * );\n * ```\n */\n async listForCustomer(\n customerId: string,\n params?: CustomerPaymentMethodsListParams,\n ): Promise<CustomerPaymentMethodsListResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/payment-methods`, {\n query: params as Record<\n string,\n string | number | boolean | (string | number | boolean)[] | null | undefined\n >,\n });\n }\n\n /**\n * Set a payment method as the default for a customer.\n *\n * @param customerId - The customer ID.\n * @param methodId - The payment method ID to set as default.\n * @returns The updated payment method.\n */\n async setDefault(customerId: string, methodId: string): Promise<PaymentMethodResponse> {\n return this.request(\n 'POST',\n `/customers/${encodeURIComponent(customerId)}/payment-methods/${encodeURIComponent(methodId)}/default`,\n );\n }\n\n // --- Advanced operations (Task 3.3) ---\n\n /** Migrate a payment method. `POST /payment-methods/migrate` */\n async migrate(params: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', '/payment-methods/migrate', { body: params });\n }\n\n /** Batch migrate payment methods. `POST /payment-methods/migrate-batch` */\n async migrateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/migrate-batch', { body: params });\n }\n\n /** Batch update payment methods. `POST /payment-methods/update-batch` */\n async updateBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/update-batch', { body: params });\n }\n\n /** Batch retrieve payment methods. `GET /payment-methods/batch` */\n async batchRetrieve(\n params?: Record<string, string | number | undefined>,\n ): Promise<PaymentMethodResponse[]> {\n return this.request('GET', '/payment-methods/batch', { query: params });\n }\n\n /** Tokenize a card. `POST /payment-methods/tokenize-card` */\n async tokenizeCard(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card', { body: params });\n }\n\n /** Batch tokenize cards. `POST /payment-methods/tokenize-card-batch` */\n async tokenizeCardBatch(params: Record<string, unknown>[]): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/tokenize-card-batch', { body: params });\n }\n\n /** Initiate payment method collect link flow. `POST /payment-methods/collect` */\n async collect(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/collect', { body: params });\n }\n\n /** Save a payment method. `POST /payment-methods/{methodId}/save` */\n async save(methodId: string, params?: Record<string, unknown>): Promise<PaymentMethodResponse> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/save`, {\n body: params,\n });\n }\n\n /** Create payment method auth link token. `POST /payment-methods/auth/link` */\n async createAuthLink(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/link', { body: params });\n }\n\n /** Exchange payment method auth token. `POST /payment-methods/auth/exchange` */\n async exchangeAuthToken(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/payment-methods/auth/exchange', { body: params });\n }\n\n /** Tokenize card using existing PM. `POST /payment-methods/{methodId}/tokenize-card` */\n async tokenizeCardForMethod(\n methodId: string,\n params: Record<string, unknown>,\n ): Promise<Record<string, unknown>> {\n return this.request('POST', `/payment-methods/${encodeURIComponent(methodId)}/tokenize-card`, {\n body: params,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/_worktrees/sdk-publish-0425-clone-w4/dist/chunk-LLYY4TCZ.cjs","../src/resources/routing.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,QAAA,EAAN,MAAc;AAAA,EASnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAC3B,IAAA,IAAA,CAAK,SAAA,EAAW,IAAI,sBAAA,CAAuB,OAAO,CAAA;AAClD,IAAA,IAAA,CAAK,eAAA,EAAiB,IAAI,cAAA,CAAe,OAAO,CAAA;AAChD,IAAA,IAAA,CAAK,mBAAA,EAAqB,IAAI,kBAAA,CAAmB,OAAO,CAAA;AACxD,IAAA,IAAA,CAAK,wBAAA,EAA0B,IAAI,uBAAA,CAAwB,OAAO,CAAA;AAAA,EACpE;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;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,EA2DA,MAAM,MAAA,CAAO,MAAA,EAAsE;AACjF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,EAAY,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,QAAA,CAAS,WAAA,EAAwD;AACrE,IAAA,OAAO,IAAA,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B,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDuC,EAAA;AACnB,IAAA;AACtE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUiF,EAAA;AACnB,IAAA;AAC3B,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAagD,EAAA;AACiB,IAAA;AAC9B,MAAA;AAChC,IAAA;AACH,EAAA;AACF;AAqB8B;AACqB,EAAA;AAApB,IAAA;AAAqB,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;AA6B6C,EAAA;AAC5B,IAAA;AACxD,MAAA;AACc,QAAA;AACL,QAAA;AACF,QAAA;AACI,QAAA;AACqB,QAAA;AACV,QAAA;AACI,QAAA;AACjC,MAAA;AACD,IAAA;AACH,EAAA;AACF;AD9L2E;AACA;AACA;AACA","file":"/home/anes/delo-payment/_worktrees/sdk-publish-0425-clone-w4/dist/chunk-LLYY4TCZ.cjs","sourcesContent":[null,"import type {\n CheckoutThemeConversionQuery,\n CheckoutThemeConversionResponse,\n CheckoutThemeProgramRequest,\n CheckoutThemeProgramResponse,\n DefaultRoutingConfigUpdate,\n LinkedRoutingConfigRetrieveResponse,\n MerchantRoutingAlgorithm,\n ProfileDefaultRoutingConfig,\n ProfileDeniedConnectorsResponse,\n RoutableConnectorChoice,\n RoutingActivatePayload,\n RoutingConfigCreateRequest,\n RoutingConfigDeleteResponse,\n RoutingConfigHistoryResponse,\n RoutingConfigUpdateRequest,\n ConnectorCapOverride,\n ConnectorCapOverrideLevel,\n ConnectorCapOverrideList,\n ConnectorCapOverrideRequest,\n ConnectorCapOverrides,\n RoutingConnectorCapReset,\n RoutingConnectorCapResetRequest,\n RoutingConnectorCaps,\n RoutingConnectorCapSchedule,\n RoutingConnectorCapScheduleShuffle,\n RoutingDeactivateRequest,\n RoutingDictionary,\n RoutingDictionaryRecord,\n RoutingHistoryParams,\n RoutingTimePlanDocument,\n RoutingVolumeCounters,\n SurchargeRuleRequest,\n SurchargeRuleResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Create and manage payment routing algorithms.\n *\n * Routing rules determine which gateway connector handles each payment based on\n * card type, currency, amount, or custom conditions.\n */\nexport class Routing {\n readonly decision: RoutingDecisionManager;\n /** Merchant-friendly, per-payment-method surcharge rules (no Euclid DSL). */\n readonly surchargeRules: SurchargeRules;\n /** Which stored appearance variant a buyer is shown. Decides a look, never a payment. */\n readonly checkoutThemeRules: CheckoutThemeRules;\n /** Rendered-to-paid conversion per appearance variant and segment. */\n readonly checkoutThemeConversion: CheckoutThemeConversion;\n\n constructor(private readonly request: RequestFn) {\n this.decision = new RoutingDecisionManager(request);\n this.surchargeRules = new SurchargeRules(request);\n this.checkoutThemeRules = new CheckoutThemeRules(request);\n this.checkoutThemeConversion = new CheckoutThemeConversion(request);\n }\n\n /**\n * Create a new routing algorithm.\n *\n * @param params - Routing algorithm definition (rule-based, priority, or volume-based).\n * @returns Metadata record for the created routing configuration. The full\n * algorithm body is not echoed back — use `retrieve(id)` if you need it.\n *\n * @example\n * ```typescript\n * const config = await delopay.routing.create({\n * name: 'EU Priority',\n * algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },\n * });\n * ```\n *\n * @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.\n * Rules run top-down (first match wins); `defaultSelection` is the fallback.\n * Splits must sum to 100; `amount` conditions are in minor units.\n * ```typescript\n * const config = await delopay.routing.create({\n * name: 'Card split 90/10',\n * profile_id: 'pro_...',\n * algorithm: {\n * type: 'advanced',\n * data: {\n * defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },\n * rules: [\n * {\n * name: 'cards',\n * connectorSelection: {\n * type: 'volume_split',\n * data: [\n * { connector: { connector: 'epayouts' }, split: 90 },\n * { connector: { connector: 'stripe' }, split: 10 },\n * ],\n * },\n * statements: [\n * {\n * condition: [\n * {\n * lhs: 'payment_method',\n * comparison: 'equal',\n * value: { type: 'enum_variant', value: 'card' },\n * metadata: {},\n * },\n * ],\n * },\n * ],\n * },\n * ],\n * metadata: {},\n * },\n * },\n * });\n * await delopay.routing.activate(config.id);\n * ```\n */\n async create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord> {\n return this.request('POST', '/routing', { body: params });\n }\n\n /**\n * Retrieve a routing algorithm by its ID.\n *\n * @param algorithmId - The routing algorithm ID.\n * @returns The full routing configuration including the algorithm body.\n */\n async retrieve(algorithmId: string): Promise<MerchantRoutingAlgorithm> {\n return this.request('GET', `/routing/${encodeURIComponent(algorithmId)}`);\n }\n\n /**\n * Activate a routing algorithm, making it the active routing strategy.\n *\n * Always sends a JSON body (default `{}`) so the request carries the\n * `Content-Type: application/json` header that the server requires.\n *\n * @param algorithmId - The routing algorithm ID to activate.\n * @param params - Optional activation payload (e.g. `transaction_type`).\n */\n async activate(\n algorithmId: string,\n params: RoutingActivatePayload = {},\n ): Promise<RoutingDictionaryRecord> {\n return this.request('POST', `/routing/${encodeURIComponent(algorithmId)}/activate`, {\n body: params,\n });\n }\n\n /**\n * Deactivate the currently active routing algorithm (falls back to default routing).\n *\n * Always sends a JSON body (default `{}`) so the request carries the\n * `Content-Type: application/json` header that the server requires.\n *\n * @param params - Optional deactivation payload.\n */\n async deactivate(params: RoutingDeactivateRequest = {}): Promise<RoutingDictionaryRecord> {\n return this.request('POST', '/routing/deactivate', { body: params });\n }\n\n /**\n * Edit a static routing configuration.\n *\n * Partial: send only the fields to change. `name`/`description` are\n * metadata-only; `algorithm` is a wholesale rule replacement, validated\n * against the shop exactly as at create. `modified_at` is bumped either way.\n *\n * `PUT /routing/{algorithmId}`\n *\n * @param algorithmId - The routing algorithm ID to edit.\n * @param params - The fields to change (at least one required).\n * @returns The updated routing configuration including the algorithm body.\n */\n async update(\n algorithmId: string,\n params: RoutingConfigUpdateRequest,\n options?: RequestExtras,\n ): Promise<MerchantRoutingAlgorithm> {\n return this.request('PUT', `/routing/${encodeURIComponent(algorithmId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a static routing configuration.\n *\n * A soft delete: the configuration disappears from every list and read, but\n * its version history is kept server-side for audit. The live configuration\n * of a shop cannot be deleted — the backend refuses it (400, `IR_16`); deactivate it first.\n * Only `single`, `priority`, `volume_split` and `advanced` payment\n * configurations qualify (400 otherwise).\n *\n * `DELETE /routing/{algorithmId}`\n *\n * @param algorithmId - The routing algorithm to delete.\n */\n async delete(algorithmId: string): Promise<RoutingConfigDeleteResponse> {\n return this.request('DELETE', `/routing/${encodeURIComponent(algorithmId)}`);\n }\n\n /**\n * Every content window a routing configuration has had, oldest first.\n *\n * A configuration's rule can be edited in place, so this is what makes \"which\n * rule decided this payment\" answerable after the fact. Each entry is the rule\n * as it stood between `valid_from` and `valid_until`; the windows of one\n * config abut exactly, with no gap.\n *\n * Paging covers the whole timeline including the live window, so a page never\n * holds more than `limit` entries and the live one — the only entry without a\n * `valid_until` — comes back on exactly one page. Advance `offset` by `limit`;\n * a page past the end is empty, and `total_count` says where that end is\n * without probing for it.\n *\n * `GET /routing/{algorithmId}/history`\n *\n * @param algorithmId - The routing algorithm to read the history of.\n * @param params - Optional paging.\n */\n async history(\n algorithmId: string,\n params: RoutingHistoryParams = {},\n ): Promise<RoutingConfigHistoryResponse> {\n return this.request('GET', `/routing/${encodeURIComponent(algorithmId)}/history`, {\n query: params as Record<string, number | null | undefined>,\n });\n }\n\n /**\n * A shop's per-connector caps, each with its unit and window and how much of\n * the current window is spent (`used`) or held by payments in flight\n * (`reserved`).\n *\n * `GET /routing/connector-caps/{profileId}`\n */\n async connectorCaps(profileId: string): Promise<RoutingConnectorCaps> {\n return this.request('GET', `/routing/connector-caps/${encodeURIComponent(profileId)}`);\n }\n\n /** Read a shop's dated limit overrides. `GET /routing/connector-cap-schedules/{profileId}` */\n async connectorCapSchedules(profileId: string): Promise<RoutingConnectorCapSchedule> {\n return this.request('GET', `/routing/connector-cap-schedules/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Replace a shop's complete schedule using its last-read revision.\n * Remove an entry to cancel it; ordinary configured caps are unchanged.\n * Instants require explicit offsets, and overlapping entries for the same\n * account and unit are refused by the server. Capability preflight refuses\n * unsupported backends before submitting any schedule.\n *\n * `PUT /routing/connector-cap-schedules/{profileId}`\n */\n async setConnectorCapSchedules(\n profileId: string,\n params: RoutingConnectorCapSchedule,\n ): Promise<RoutingConnectorCapSchedule> {\n const caps = await this.connectorCaps(profileId);\n if (!caps.features?.includes('limit_schedules')) {\n throw new Error('Connector limit schedules are unsupported by the serving backend');\n }\n return this.request(\n 'PUT',\n `/routing/connector-cap-schedules/${encodeURIComponent(profileId)}`,\n {\n body: params,\n },\n );\n }\n\n /** Change the drawn value of an active scheduled range; preserves all usage. */\n async shuffleConnectorCapSchedule(\n profileId: string,\n params: RoutingConnectorCapScheduleShuffle,\n ): Promise<RoutingConnectorCaps> {\n const caps = await this.connectorCaps(profileId);\n if (!caps.features?.includes('limit_schedules')) {\n throw new Error('Connector limit schedules are unsupported by the serving backend');\n }\n return this.request(\n 'POST',\n `/routing/connector-cap-schedules/${encodeURIComponent(profileId)}/shuffle`,\n { body: params },\n );\n }\n\n /**\n * A shop's recurring time plan with its revision, the band active now, the\n * next change and each limit the plan releases in parts.\n *\n * `GET /routing/time-plans/{profileId}`\n */\n async timePlan(profileId: string): Promise<RoutingTimePlanDocument> {\n return this.request('GET', `/routing/time-plans/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Replace a shop's whole time plan using its last-read revision; `plan`\n * null removes it. Usage, reservations and dated limit entries are left as\n * they are. Overlapping bands, shares that do not total 100 and a stale\n * revision are refused by the server. Capability preflight refuses a\n * backend that would not apply the plan before anything is sent.\n *\n * `PUT /routing/time-plans/{profileId}`\n */\n async setTimePlan(\n profileId: string,\n params: Pick<RoutingTimePlanDocument, 'revision' | 'plan'>,\n ): Promise<RoutingTimePlanDocument> {\n const caps = await this.connectorCaps(profileId);\n if (!caps.features?.includes('time_plans')) {\n throw new Error('Time plans are unsupported by the serving backend');\n }\n return this.request('PUT', `/routing/time-plans/${encodeURIComponent(profileId)}`, {\n body: { revision: params.revision, plan: params.plan },\n });\n }\n\n /**\n * The live `routing_volume` counters behind a shop's active advanced\n * program: one per distinct budget the program reads, each with the window\n * it covers, the figure in the pinned threshold currency, and the rules that\n * read it. Lets a merchant see whether a `routing_volume < 50000` rule is at\n * 120 or at 499 today, and support answer why a payment went to the overflow\n * connector.\n *\n * What routing will use right now, not what the shop turned over: the\n * counters are held in Redis only and a lost Redis restarts the window at\n * zero. Read-only; needs the same permission as reading the rules.\n *\n * `GET /routing/volume-counters/{profileId}`\n */\n async volumeCounters(profileId: string): Promise<RoutingVolumeCounters> {\n return this.request('GET', `/routing/volume-counters/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Replace a shop's per-connector caps.\n *\n * Whole-set replacement, not a patch: the list sent becomes the complete set\n * of capped connectors, and an empty list clears them all — which is how\n * acquirer onboarding finishes, the new account ceasing to be a special case.\n * Re-send every other cap with its `unit`, `window` and `currency` as read:\n * an amount cap sent back without its `unit` is refused, because it carries a\n * currency and would otherwise be a payment count.\n *\n * Every account named must belong to this shop; one that does not is refused.\n * So is an amount cap without a `currency`, and a payment cap with one.\n *\n * An account may appear twice — a payment count and a budget — and never\n * twice in one `unit`. Re-send a range with its `limit_max`, or it is stored\n * as its bottom. Never re-send `current_limit` as `set_current_limit`: the\n * value read belongs to the window it was read in, and pinning it into a\n * window that has since reset is a limit nobody chose.\n *\n * `PUT /routing/connector-caps/{profileId}`\n */\n async setConnectorCaps(\n profileId: string,\n params: RoutingConnectorCaps,\n ): Promise<RoutingConnectorCaps> {\n return this.request('PUT', `/routing/connector-caps/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n\n /**\n * Reset one limit's usage for the window open now: what settled payments\n * spent stops counting, so the account takes payments again. Payments still\n * in flight keep their hold and count once they complete. The account's\n * other limit is untouched. Offered by a router that lists `usage_reset` in\n * `features`; refused (422) for an account with no limit in that unit.\n *\n * `POST /routing/connector-caps/{profileId}/reset`\n */\n async resetConnectorCapUsage(\n profileId: string,\n params: RoutingConnectorCapResetRequest,\n ): Promise<RoutingConnectorCapReset> {\n return this.request('POST', `/routing/connector-caps/${encodeURIComponent(profileId)}/reset`, {\n body: params,\n });\n }\n\n /**\n * Every connector cap override of the merchant: the accounts whose limits a\n * project or shop overrides.\n *\n * `GET /routing/connector-caps/overrides`\n */\n async connectorCapOverrides(): Promise<ConnectorCapOverrideList> {\n return this.request('GET', '/routing/connector-caps/overrides');\n }\n\n /**\n * One connector account's overrides, and for every shop the account takes\n * payments in, which limits apply there and where they come from.\n *\n * `GET /routing/connector-caps/accounts/{merchantConnectorId}/overrides`\n */\n async accountConnectorCapOverrides(merchantConnectorId: string): Promise<ConnectorCapOverrides> {\n return this.request(\n 'GET',\n `/routing/connector-caps/accounts/${encodeURIComponent(merchantConnectorId)}/overrides`,\n );\n }\n\n /**\n * Override an account's limits for one project (and every shop below it) or\n * one shop: `unlimited` lifts them there, `own` sets limits of its own,\n * counted separately from the account's. Replaces an existing override of\n * the same target. Setting the same target again keeps the usage its\n * current window already counted.\n *\n * `PUT /routing/connector-caps/accounts/{merchantConnectorId}/overrides/{level}/{scopeId}`\n */\n async setConnectorCapOverride(\n merchantConnectorId: string,\n level: ConnectorCapOverrideLevel,\n scopeId: string,\n params: ConnectorCapOverrideRequest,\n ): Promise<ConnectorCapOverride> {\n return this.request('PUT', this.overridePath(merchantConnectorId, level, scopeId), {\n body: params,\n });\n }\n\n /**\n * Remove an account's override for one project or shop; the next level up\n * applies again. Answers the override removed.\n *\n * `DELETE /routing/connector-caps/accounts/{merchantConnectorId}/overrides/{level}/{scopeId}`\n */\n async deleteConnectorCapOverride(\n merchantConnectorId: string,\n level: ConnectorCapOverrideLevel,\n scopeId: string,\n ): Promise<ConnectorCapOverride> {\n return this.request('DELETE', this.overridePath(merchantConnectorId, level, scopeId));\n }\n\n private overridePath(\n merchantConnectorId: string,\n level: ConnectorCapOverrideLevel,\n scopeId: string,\n ): string {\n return `/routing/connector-caps/accounts/${encodeURIComponent(merchantConnectorId)}/overrides/${encodeURIComponent(level)}/${encodeURIComponent(scopeId)}`;\n }\n\n /**\n * List all routing algorithms for the current merchant.\n *\n * @returns The routing dictionary (records + currently active id).\n */\n async list(): Promise<RoutingDictionary> {\n return this.request('GET', '/routing');\n }\n\n /**\n * Connector names denied at routing for a shop (explicit denies plus\n * whitelist-implied exclusions). Read-only; surfaced in the routing builder.\n *\n * `GET /routing/connector-restrictions/{profileId}`\n */\n async connectorRestrictions(profileId: string): Promise<ProfileDeniedConnectorsResponse> {\n return this.request('GET', `/routing/connector-restrictions/${encodeURIComponent(profileId)}`);\n }\n\n // --- Advanced operations (Task 3.4) ---\n\n /** Get active routing config. `GET /routing/active` */\n async getActive(): Promise<LinkedRoutingConfigRetrieveResponse> {\n return this.request('GET', '/routing/active');\n }\n\n /** Update default routing config. `POST /routing/default` */\n async updateDefault(params: Record<string, unknown>): Promise<RoutableConnectorChoice[]> {\n return this.request('POST', '/routing/default', { body: params });\n }\n\n /** Retrieve default config for profiles. `GET /routing/default/profile` */\n async getDefaultProfile(): Promise<RoutableConnectorChoice[] | ProfileDefaultRoutingConfig[]> {\n return this.request('GET', '/routing/default/profile');\n }\n\n /**\n * Retrieve one profile's default config. `GET /routing/default/profile/{profileId}`\n *\n * The narrow counterpart of `getDefaultProfile()`: that one returns every\n * profile of the merchant and needs merchant-level routing read, so a\n * profile-scoped (shop) role could write its own default through\n * `updateDefaultProfile()` but never read it back. This read is gated on\n * profile-level routing read and pinned to the caller's own profile — a shop\n * role asking for a sibling profile is refused.\n */\n async getDefaultForProfile(profileId: string): Promise<ProfileDefaultRoutingConfig> {\n return this.request('GET', `/routing/default/profile/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Update default config for a profile. `POST /routing/default/profile/{profileId}`\n *\n * Send the list alone to keep the shop's fallback mode, or `{ connectors, mode, splits }` to set\n * it. A `volume_split` whose shares do not total 100 is refused.\n */\n async updateDefaultProfile(\n profileId: string,\n params: DefaultRoutingConfigUpdate | Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<ProfileDefaultRoutingConfig> {\n return this.request('POST', `/routing/default/profile/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /** List routing configs for profile. `GET /routing/list/profile` */\n async listForProfile(): Promise<RoutingDictionary> {\n return this.request('GET', '/routing/list/profile');\n }\n\n /** Evaluate a routing rule. `POST /routing/rule/evaluate` */\n async evaluateRule(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/rule/evaluate', { body: params });\n }\n\n /** Migrate routing rules for profile. `POST /routing/rule/migrate` */\n async migrateRule(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/rule/migrate', { body: params });\n }\n\n /** Evaluate routing for a payment. `POST /routing/evaluate` */\n async evaluate(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/evaluate', { body: params });\n }\n\n /** Update gateway scores for dynamic routing. `POST /routing/feedback` */\n async feedback(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/feedback', { body: params });\n }\n}\n\nclass RoutingDecisionManager {\n constructor(private readonly request: RequestFn) {}\n\n /** Upsert decision manager config. `PUT /routing/decision` */\n async upsert(\n params: Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<Record<string, unknown>> {\n return this.request('PUT', '/routing/decision', { body: params, ...options });\n }\n\n /** Retrieve decision manager config. `GET /routing/decision` */\n async retrieve(): Promise<Record<string, unknown>> {\n return this.request('GET', '/routing/decision');\n }\n\n /** Delete decision manager config. `DELETE /routing/decision` */\n async delete(options?: RequestExtras): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/routing/decision', options);\n }\n\n /** Upsert surcharge decision config. `PUT /routing/decision/surcharge` */\n async upsertSurcharge(\n params: Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<Record<string, unknown>> {\n return this.request('PUT', '/routing/decision/surcharge', { body: params, ...options });\n }\n\n /** Retrieve surcharge decision config. `GET /routing/decision/surcharge` */\n async retrieveSurcharge(): Promise<Record<string, unknown>> {\n return this.request('GET', '/routing/decision/surcharge');\n }\n\n /** Delete surcharge decision config. `DELETE /routing/decision/surcharge` */\n async deleteSurcharge(options?: RequestExtras): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/routing/decision/surcharge', options);\n }\n}\n\n/**\n * Merchant-friendly surcharge rules: configure a per-payment-method surcharge\n * (fixed or %) added to the amount the buyer pays — without hand-writing the\n * Euclid DSL. Scope to a shop via `profile_id` (omit for merchant-wide).\n *\n * Distinct from the platform fee (a balance deduction): a surcharge changes what\n * the buyer is charged.\n */\nclass SurchargeRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create or replace the surcharge program for a scope.\n *\n * `PUT /routing/surcharge/rules`\n *\n * @example\n * ```typescript\n * await delopay.routing.surchargeRules.upsert({\n * surcharges: [\n * { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },\n * { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },\n * ],\n * });\n * ```\n */\n async upsert(\n params: SurchargeRuleRequest,\n options?: RequestExtras,\n ): Promise<SurchargeRuleResponse> {\n return this.request('PUT', '/routing/surcharge/rules', { body: params, ...options });\n }\n\n /**\n * Retrieve the active surcharge program for a scope, or `null` when none is set.\n *\n * `GET /routing/surcharge/rules?profile_id={profileId}`\n *\n * @param profileId - Shop scope. Omit for the merchant-wide rule.\n */\n async retrieve(profileId?: string): Promise<SurchargeRuleResponse | null> {\n return this.request('GET', '/routing/surcharge/rules', {\n query: { profile_id: profileId },\n });\n }\n\n /**\n * Deactivate the active surcharge program for a scope.\n *\n * `DELETE /routing/surcharge/rules?profile_id={profileId}`\n *\n * @param profileId - Shop scope. Omit for the merchant-wide rule.\n */\n async delete(profileId?: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', '/routing/surcharge/rules', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n}\n\n/**\n * Checkout theme programs: which of a shop's stored appearance variants a buyer\n * is shown.\n *\n * Same engine and same wire format as the advanced routing rules above — a\n * Euclid program whose rules run top-down, first match wins, with\n * `defaultSelection` as the fallback — with the output swapped for a variant\n * name. That is deliberate: the dashboard's routing rule builder can author\n * these without learning a second condition language.\n *\n * **A theme program decides a look and nothing else.** It cannot express which\n * payment methods are offered, what is charged, which provider processes the\n * payment, or whether it succeeds. The allowed dimensions are fixed server-side\n * by the output type — see {@link CheckoutThemeDimension} — so that is a\n * property of the API rather than a convention.\n *\n * Naming a variant the shop has not defined is **not** an error: the checkout\n * falls back to the shop default, exactly as it does for an unknown `?theme=`,\n * because a buyer who cannot pay is worse than a buyer who sees the default\n * look. Such names come back in `warnings` instead, recomputed on every read.\n */\nclass CheckoutThemeRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create or replace the theme program for a scope.\n *\n * `PUT /routing/checkout-theme/rules`\n *\n * Supersedes rather than overwrites: the previous active version is retired\n * and a new one stored, so the record of which look was live when survives.\n * Pass `active: false` to store a revision **without** retiring the live one —\n * that is where a program drafted against a variant you have not built yet\n * belongs.\n *\n * @example A phone in Germany gets the compact look; everyone else the house style.\n * ```typescript\n * await delopay.routing.checkoutThemeRules.upsert({\n * name: 'Autumn targeting',\n * profile_id: 'pro_...',\n * algorithm: {\n * rules: [\n * {\n * name: 'German phones',\n * connectorSelection: { theme: { variant: 'compact' } },\n * statements: [\n * {\n * condition: [\n * {\n * lhs: 'device_class',\n * comparison: 'equal',\n * value: { type: 'enum_variant', value: 'phone' },\n * metadata: {},\n * },\n * {\n * lhs: 'browser_language',\n * comparison: 'equal',\n * value: { type: 'enum_variant', value: 'de' },\n * metadata: {},\n * },\n * ],\n * },\n * ],\n * },\n * ],\n * defaultSelection: { theme: { variant: 'house' } },\n * metadata: {},\n * },\n * });\n * ```\n */\n async upsert(params: CheckoutThemeProgramRequest): Promise<CheckoutThemeProgramResponse> {\n return this.request('PUT', '/routing/checkout-theme/rules', { body: params });\n }\n\n /**\n * Retrieve the active theme program for a scope, or `null` when none is set.\n *\n * `GET /routing/checkout-theme/rules?profile_id={profileId}`\n *\n * @param profileId - Shop scope. Omit for the merchant-wide program. A\n * shop-scoped caller that omits it gets its own shop's program.\n */\n async retrieve(profileId?: string): Promise<CheckoutThemeProgramResponse | null> {\n return this.request('GET', '/routing/checkout-theme/rules', {\n query: { profile_id: profileId },\n });\n }\n\n /**\n * Deactivate the active theme program for a scope. Idempotent.\n *\n * `DELETE /routing/checkout-theme/rules?profile_id={profileId}`\n *\n * Deactivation, not deletion — the stored row is what says which look was\n * live when, and that history cannot be reconstructed after the fact. Shops\n * go back to their default appearance immediately.\n *\n * @param profileId - Shop scope. Omit for the merchant-wide program.\n */\n async delete(profileId?: string): Promise<void> {\n return this.request('DELETE', '/routing/checkout-theme/rules', {\n query: { profile_id: profileId },\n });\n }\n}\n\n/**\n * Rendered-to-paid conversion, per appearance variant and segment.\n *\n * Answers the one question theme targeting exists for: *does variant B convert\n * better than the house style, on phones, in Germany?*\n *\n * **What a rate here means.** The denominator is backend-observed checkout page\n * opens, deduplicated by device within the hosted checkout's cache window, with\n * automated traffic excluded from both sides. It is narrower than \"paints\", and\n * that is deliberate - counting one buyer's refresh as a second render would\n * understate conversion. The exact basis travels with every response in\n * `denominator`, and the ways it is not the whole truth travel in `caveats`.\n *\n * **The server decides what may be concluded, not you.** Rate, Wilson interval,\n * per-cell `verdict` and the variant-vs-default `separates` test are computed\n * once, server-side, and shipped as values. Do not recompute them: the first\n * client that rounds differently tells a merchant a difference is real when the\n * server says it is not.\n */\nclass CheckoutThemeConversion {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Rendered-to-paid conversion for a shop over a window.\n *\n * `GET /routing/checkout-theme/conversion`\n *\n * Requires `CheckoutBranding` read at profile scope - the same permission\n * that governs seeing how a checkout looks.\n *\n * @param params - Window (RFC3339, `start` inclusive / `end` exclusive), the\n * shop, the dimension to group by, and the optional `device_class`,\n * `country` and `selection` filters.\n *\n * @example Which variant wins on which device, over the last 30 days.\n * ```typescript\n * const report = await delopay.routing.checkoutThemeConversion.retrieve({\n * profile_id: 'pro_...',\n * start: '2026-07-21T00:00:00Z',\n * end: '2026-08-20T00:00:00Z',\n * segment: 'device',\n * });\n *\n * for (const c of report.comparisons) {\n * if (!c.separates) continue; // \"not shown to differ\" - say nothing\n * console.log(`${c.variant} on ${c.segment}: ${c.higher} converts better`);\n * }\n * ```\n */\n async retrieve(params: CheckoutThemeConversionQuery): Promise<CheckoutThemeConversionResponse> {\n return this.request('GET', '/routing/checkout-theme/conversion', {\n query: {\n profile_id: params.profile_id,\n start: params.start,\n end: params.end,\n segment: params.segment,\n device_class: params.device_class ?? undefined,\n country: params.country ?? undefined,\n selection: params.selection ?? undefined,\n },\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-LLYY4TCZ.cjs","../src/resources/routing.ts"],"names":[],"mappings":"AAAA;AC2CO,IAAM,QAAA,EAAN,MAAc;AAAA,EASnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAC3B,IAAA,IAAA,CAAK,SAAA,EAAW,IAAI,sBAAA,CAAuB,OAAO,CAAA;AAClD,IAAA,IAAA,CAAK,e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;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAagD,EAAA;AACiB,IAAA;AAC9B,MAAA;AAChC,IAAA;AACH,EAAA;AACF;AAqB8B;AACqB,EAAA;AAApB,IAAA;AAAqB,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;AA6B6C,EAAA;AAC5B,IAAA;AACxD,MAAA;AACc,QAAA;AACL,QAAA;AACF,QAAA;AACI,QAAA;AACqB,QAAA;AACV,QAAA;AACI,QAAA;AACjC,MAAA;AACD,IAAA;AACH,EAAA;AACF;AD9L2E;AACA;AACA;AACA","file":"/home/skyline/Programming/work/delopay/delopay-typescript-sdk/dist/chunk-LLYY4TCZ.cjs","sourcesContent":[null,"import type {\n CheckoutThemeConversionQuery,\n CheckoutThemeConversionResponse,\n CheckoutThemeProgramRequest,\n CheckoutThemeProgramResponse,\n DefaultRoutingConfigUpdate,\n LinkedRoutingConfigRetrieveResponse,\n MerchantRoutingAlgorithm,\n ProfileDefaultRoutingConfig,\n ProfileDeniedConnectorsResponse,\n RoutableConnectorChoice,\n RoutingActivatePayload,\n RoutingConfigCreateRequest,\n RoutingConfigDeleteResponse,\n RoutingConfigHistoryResponse,\n RoutingConfigUpdateRequest,\n ConnectorCapOverride,\n ConnectorCapOverrideLevel,\n ConnectorCapOverrideList,\n ConnectorCapOverrideRequest,\n ConnectorCapOverrides,\n RoutingConnectorCapReset,\n RoutingConnectorCapResetRequest,\n RoutingConnectorCaps,\n RoutingConnectorCapSchedule,\n RoutingConnectorCapScheduleShuffle,\n RoutingDeactivateRequest,\n RoutingDictionary,\n RoutingDictionaryRecord,\n RoutingHistoryParams,\n RoutingTimePlanDocument,\n RoutingVolumeCounters,\n SurchargeRuleRequest,\n SurchargeRuleResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Create and manage payment routing algorithms.\n *\n * Routing rules determine which gateway connector handles each payment based on\n * card type, currency, amount, or custom conditions.\n */\nexport class Routing {\n readonly decision: RoutingDecisionManager;\n /** Merchant-friendly, per-payment-method surcharge rules (no Euclid DSL). */\n readonly surchargeRules: SurchargeRules;\n /** Which stored appearance variant a buyer is shown. Decides a look, never a payment. */\n readonly checkoutThemeRules: CheckoutThemeRules;\n /** Rendered-to-paid conversion per appearance variant and segment. */\n readonly checkoutThemeConversion: CheckoutThemeConversion;\n\n constructor(private readonly request: RequestFn) {\n this.decision = new RoutingDecisionManager(request);\n this.surchargeRules = new SurchargeRules(request);\n this.checkoutThemeRules = new CheckoutThemeRules(request);\n this.checkoutThemeConversion = new CheckoutThemeConversion(request);\n }\n\n /**\n * Create a new routing algorithm.\n *\n * @param params - Routing algorithm definition (rule-based, priority, or volume-based).\n * @returns Metadata record for the created routing configuration. The full\n * algorithm body is not echoed back — use `retrieve(id)` if you need it.\n *\n * @example\n * ```typescript\n * const config = await delopay.routing.create({\n * name: 'EU Priority',\n * algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },\n * });\n * ```\n *\n * @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.\n * Rules run top-down (first match wins); `defaultSelection` is the fallback.\n * Splits must sum to 100; `amount` conditions are in minor units.\n * ```typescript\n * const config = await delopay.routing.create({\n * name: 'Card split 90/10',\n * profile_id: 'pro_...',\n * algorithm: {\n * type: 'advanced',\n * data: {\n * defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },\n * rules: [\n * {\n * name: 'cards',\n * connectorSelection: {\n * type: 'volume_split',\n * data: [\n * { connector: { connector: 'epayouts' }, split: 90 },\n * { connector: { connector: 'stripe' }, split: 10 },\n * ],\n * },\n * statements: [\n * {\n * condition: [\n * {\n * lhs: 'payment_method',\n * comparison: 'equal',\n * value: { type: 'enum_variant', value: 'card' },\n * metadata: {},\n * },\n * ],\n * },\n * ],\n * },\n * ],\n * metadata: {},\n * },\n * },\n * });\n * await delopay.routing.activate(config.id);\n * ```\n */\n async create(params: RoutingConfigCreateRequest): Promise<RoutingDictionaryRecord> {\n return this.request('POST', '/routing', { body: params });\n }\n\n /**\n * Retrieve a routing algorithm by its ID.\n *\n * @param algorithmId - The routing algorithm ID.\n * @returns The full routing configuration including the algorithm body.\n */\n async retrieve(algorithmId: string): Promise<MerchantRoutingAlgorithm> {\n return this.request('GET', `/routing/${encodeURIComponent(algorithmId)}`);\n }\n\n /**\n * Activate a routing algorithm, making it the active routing strategy.\n *\n * Always sends a JSON body (default `{}`) so the request carries the\n * `Content-Type: application/json` header that the server requires.\n *\n * @param algorithmId - The routing algorithm ID to activate.\n * @param params - Optional activation payload (e.g. `transaction_type`).\n */\n async activate(\n algorithmId: string,\n params: RoutingActivatePayload = {},\n ): Promise<RoutingDictionaryRecord> {\n return this.request('POST', `/routing/${encodeURIComponent(algorithmId)}/activate`, {\n body: params,\n });\n }\n\n /**\n * Deactivate the currently active routing algorithm (falls back to default routing).\n *\n * Always sends a JSON body (default `{}`) so the request carries the\n * `Content-Type: application/json` header that the server requires.\n *\n * @param params - Optional deactivation payload.\n */\n async deactivate(params: RoutingDeactivateRequest = {}): Promise<RoutingDictionaryRecord> {\n return this.request('POST', '/routing/deactivate', { body: params });\n }\n\n /**\n * Edit a static routing configuration.\n *\n * Partial: send only the fields to change. `name`/`description` are\n * metadata-only; `algorithm` is a wholesale rule replacement, validated\n * against the shop exactly as at create. `modified_at` is bumped either way.\n *\n * `PUT /routing/{algorithmId}`\n *\n * @param algorithmId - The routing algorithm ID to edit.\n * @param params - The fields to change (at least one required).\n * @returns The updated routing configuration including the algorithm body.\n */\n async update(\n algorithmId: string,\n params: RoutingConfigUpdateRequest,\n options?: RequestExtras,\n ): Promise<MerchantRoutingAlgorithm> {\n return this.request('PUT', `/routing/${encodeURIComponent(algorithmId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a static routing configuration.\n *\n * A soft delete: the configuration disappears from every list and read, but\n * its version history is kept server-side for audit. The live configuration\n * of a shop cannot be deleted — the backend refuses it (400, `IR_16`); deactivate it first.\n * Only `single`, `priority`, `volume_split` and `advanced` payment\n * configurations qualify (400 otherwise).\n *\n * `DELETE /routing/{algorithmId}`\n *\n * @param algorithmId - The routing algorithm to delete.\n */\n async delete(algorithmId: string): Promise<RoutingConfigDeleteResponse> {\n return this.request('DELETE', `/routing/${encodeURIComponent(algorithmId)}`);\n }\n\n /**\n * Every content window a routing configuration has had, oldest first.\n *\n * A configuration's rule can be edited in place, so this is what makes \"which\n * rule decided this payment\" answerable after the fact. Each entry is the rule\n * as it stood between `valid_from` and `valid_until`; the windows of one\n * config abut exactly, with no gap.\n *\n * Paging covers the whole timeline including the live window, so a page never\n * holds more than `limit` entries and the live one — the only entry without a\n * `valid_until` — comes back on exactly one page. Advance `offset` by `limit`;\n * a page past the end is empty, and `total_count` says where that end is\n * without probing for it.\n *\n * `GET /routing/{algorithmId}/history`\n *\n * @param algorithmId - The routing algorithm to read the history of.\n * @param params - Optional paging.\n */\n async history(\n algorithmId: string,\n params: RoutingHistoryParams = {},\n ): Promise<RoutingConfigHistoryResponse> {\n return this.request('GET', `/routing/${encodeURIComponent(algorithmId)}/history`, {\n query: params as Record<string, number | null | undefined>,\n });\n }\n\n /**\n * A shop's per-connector caps, each with its unit and window and how much of\n * the current window is spent (`used`) or held by payments in flight\n * (`reserved`).\n *\n * `GET /routing/connector-caps/{profileId}`\n */\n async connectorCaps(profileId: string): Promise<RoutingConnectorCaps> {\n return this.request('GET', `/routing/connector-caps/${encodeURIComponent(profileId)}`);\n }\n\n /** Read a shop's dated limit overrides. `GET /routing/connector-cap-schedules/{profileId}` */\n async connectorCapSchedules(profileId: string): Promise<RoutingConnectorCapSchedule> {\n return this.request('GET', `/routing/connector-cap-schedules/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Replace a shop's complete schedule using its last-read revision.\n * Remove an entry to cancel it; ordinary configured caps are unchanged.\n * Instants require explicit offsets, and overlapping entries for the same\n * account and unit are refused by the server. Capability preflight refuses\n * unsupported backends before submitting any schedule.\n *\n * `PUT /routing/connector-cap-schedules/{profileId}`\n */\n async setConnectorCapSchedules(\n profileId: string,\n params: RoutingConnectorCapSchedule,\n ): Promise<RoutingConnectorCapSchedule> {\n const caps = await this.connectorCaps(profileId);\n if (!caps.features?.includes('limit_schedules')) {\n throw new Error('Connector limit schedules are unsupported by the serving backend');\n }\n return this.request(\n 'PUT',\n `/routing/connector-cap-schedules/${encodeURIComponent(profileId)}`,\n {\n body: params,\n },\n );\n }\n\n /** Change the drawn value of an active scheduled range; preserves all usage. */\n async shuffleConnectorCapSchedule(\n profileId: string,\n params: RoutingConnectorCapScheduleShuffle,\n ): Promise<RoutingConnectorCaps> {\n const caps = await this.connectorCaps(profileId);\n if (!caps.features?.includes('limit_schedules')) {\n throw new Error('Connector limit schedules are unsupported by the serving backend');\n }\n return this.request(\n 'POST',\n `/routing/connector-cap-schedules/${encodeURIComponent(profileId)}/shuffle`,\n { body: params },\n );\n }\n\n /**\n * A shop's recurring time plan with its revision, the band active now, the\n * next change and each limit the plan releases in parts.\n *\n * `GET /routing/time-plans/{profileId}`\n */\n async timePlan(profileId: string): Promise<RoutingTimePlanDocument> {\n return this.request('GET', `/routing/time-plans/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Replace a shop's whole time plan using its last-read revision; `plan`\n * null removes it. Usage, reservations and dated limit entries are left as\n * they are. Overlapping bands, shares that do not total 100 and a stale\n * revision are refused by the server. Capability preflight refuses a\n * backend that would not apply the plan before anything is sent.\n *\n * `PUT /routing/time-plans/{profileId}`\n */\n async setTimePlan(\n profileId: string,\n params: Pick<RoutingTimePlanDocument, 'revision' | 'plan'>,\n ): Promise<RoutingTimePlanDocument> {\n const caps = await this.connectorCaps(profileId);\n if (!caps.features?.includes('time_plans')) {\n throw new Error('Time plans are unsupported by the serving backend');\n }\n return this.request('PUT', `/routing/time-plans/${encodeURIComponent(profileId)}`, {\n body: { revision: params.revision, plan: params.plan },\n });\n }\n\n /**\n * The live `routing_volume` counters behind a shop's active advanced\n * program: one per distinct budget the program reads, each with the window\n * it covers, the figure in the pinned threshold currency, and the rules that\n * read it. Lets a merchant see whether a `routing_volume < 50000` rule is at\n * 120 or at 499 today, and support answer why a payment went to the overflow\n * connector.\n *\n * What routing will use right now, not what the shop turned over: the\n * counters are held in Redis only and a lost Redis restarts the window at\n * zero. Read-only; needs the same permission as reading the rules.\n *\n * `GET /routing/volume-counters/{profileId}`\n */\n async volumeCounters(profileId: string): Promise<RoutingVolumeCounters> {\n return this.request('GET', `/routing/volume-counters/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Replace a shop's per-connector caps.\n *\n * Whole-set replacement, not a patch: the list sent becomes the complete set\n * of capped connectors, and an empty list clears them all — which is how\n * acquirer onboarding finishes, the new account ceasing to be a special case.\n * Re-send every other cap with its `unit`, `window` and `currency` as read:\n * an amount cap sent back without its `unit` is refused, because it carries a\n * currency and would otherwise be a payment count.\n *\n * Every account named must belong to this shop; one that does not is refused.\n * So is an amount cap without a `currency`, and a payment cap with one.\n *\n * An account may appear twice — a payment count and a budget — and never\n * twice in one `unit`. Re-send a range with its `limit_max`, or it is stored\n * as its bottom. Never re-send `current_limit` as `set_current_limit`: the\n * value read belongs to the window it was read in, and pinning it into a\n * window that has since reset is a limit nobody chose.\n *\n * `PUT /routing/connector-caps/{profileId}`\n */\n async setConnectorCaps(\n profileId: string,\n params: RoutingConnectorCaps,\n ): Promise<RoutingConnectorCaps> {\n return this.request('PUT', `/routing/connector-caps/${encodeURIComponent(profileId)}`, {\n body: params,\n });\n }\n\n /**\n * Reset one limit's usage for the window open now: what settled payments\n * spent stops counting, so the account takes payments again. Payments still\n * in flight keep their hold and count once they complete. The account's\n * other limit is untouched. Offered by a router that lists `usage_reset` in\n * `features`; refused (422) for an account with no limit in that unit.\n *\n * `POST /routing/connector-caps/{profileId}/reset`\n */\n async resetConnectorCapUsage(\n profileId: string,\n params: RoutingConnectorCapResetRequest,\n ): Promise<RoutingConnectorCapReset> {\n return this.request('POST', `/routing/connector-caps/${encodeURIComponent(profileId)}/reset`, {\n body: params,\n });\n }\n\n /**\n * Every connector cap override of the merchant: the accounts whose limits a\n * project or shop overrides.\n *\n * `GET /routing/connector-caps/overrides`\n */\n async connectorCapOverrides(): Promise<ConnectorCapOverrideList> {\n return this.request('GET', '/routing/connector-caps/overrides');\n }\n\n /**\n * One connector account's overrides, and for every shop the account takes\n * payments in, which limits apply there and where they come from.\n *\n * `GET /routing/connector-caps/accounts/{merchantConnectorId}/overrides`\n */\n async accountConnectorCapOverrides(merchantConnectorId: string): Promise<ConnectorCapOverrides> {\n return this.request(\n 'GET',\n `/routing/connector-caps/accounts/${encodeURIComponent(merchantConnectorId)}/overrides`,\n );\n }\n\n /**\n * Override an account's limits for one project (and every shop below it) or\n * one shop: `unlimited` lifts them there, `own` sets limits of its own,\n * counted separately from the account's. Replaces an existing override of\n * the same target. Setting the same target again keeps the usage its\n * current window already counted.\n *\n * `PUT /routing/connector-caps/accounts/{merchantConnectorId}/overrides/{level}/{scopeId}`\n */\n async setConnectorCapOverride(\n merchantConnectorId: string,\n level: ConnectorCapOverrideLevel,\n scopeId: string,\n params: ConnectorCapOverrideRequest,\n ): Promise<ConnectorCapOverride> {\n return this.request('PUT', this.overridePath(merchantConnectorId, level, scopeId), {\n body: params,\n });\n }\n\n /**\n * Remove an account's override for one project or shop; the next level up\n * applies again. Answers the override removed.\n *\n * `DELETE /routing/connector-caps/accounts/{merchantConnectorId}/overrides/{level}/{scopeId}`\n */\n async deleteConnectorCapOverride(\n merchantConnectorId: string,\n level: ConnectorCapOverrideLevel,\n scopeId: string,\n ): Promise<ConnectorCapOverride> {\n return this.request('DELETE', this.overridePath(merchantConnectorId, level, scopeId));\n }\n\n private overridePath(\n merchantConnectorId: string,\n level: ConnectorCapOverrideLevel,\n scopeId: string,\n ): string {\n return `/routing/connector-caps/accounts/${encodeURIComponent(merchantConnectorId)}/overrides/${encodeURIComponent(level)}/${encodeURIComponent(scopeId)}`;\n }\n\n /**\n * List all routing algorithms for the current merchant.\n *\n * @returns The routing dictionary (records + currently active id).\n */\n async list(): Promise<RoutingDictionary> {\n return this.request('GET', '/routing');\n }\n\n /**\n * Connector names denied at routing for a shop (explicit denies plus\n * whitelist-implied exclusions). Read-only; surfaced in the routing builder.\n *\n * `GET /routing/connector-restrictions/{profileId}`\n */\n async connectorRestrictions(profileId: string): Promise<ProfileDeniedConnectorsResponse> {\n return this.request('GET', `/routing/connector-restrictions/${encodeURIComponent(profileId)}`);\n }\n\n // --- Advanced operations (Task 3.4) ---\n\n /** Get active routing config. `GET /routing/active` */\n async getActive(): Promise<LinkedRoutingConfigRetrieveResponse> {\n return this.request('GET', '/routing/active');\n }\n\n /** Update default routing config. `POST /routing/default` */\n async updateDefault(params: Record<string, unknown>): Promise<RoutableConnectorChoice[]> {\n return this.request('POST', '/routing/default', { body: params });\n }\n\n /** Retrieve default config for profiles. `GET /routing/default/profile` */\n async getDefaultProfile(): Promise<RoutableConnectorChoice[] | ProfileDefaultRoutingConfig[]> {\n return this.request('GET', '/routing/default/profile');\n }\n\n /**\n * Retrieve one profile's default config. `GET /routing/default/profile/{profileId}`\n *\n * The narrow counterpart of `getDefaultProfile()`: that one returns every\n * profile of the merchant and needs merchant-level routing read, so a\n * profile-scoped (shop) role could write its own default through\n * `updateDefaultProfile()` but never read it back. This read is gated on\n * profile-level routing read and pinned to the caller's own profile — a shop\n * role asking for a sibling profile is refused.\n */\n async getDefaultForProfile(profileId: string): Promise<ProfileDefaultRoutingConfig> {\n return this.request('GET', `/routing/default/profile/${encodeURIComponent(profileId)}`);\n }\n\n /**\n * Update default config for a profile. `POST /routing/default/profile/{profileId}`\n *\n * Send the list alone to keep the shop's fallback mode, or `{ connectors, mode, splits }` to set\n * it. A `volume_split` whose shares do not total 100 is refused.\n */\n async updateDefaultProfile(\n profileId: string,\n params: DefaultRoutingConfigUpdate | Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<ProfileDefaultRoutingConfig> {\n return this.request('POST', `/routing/default/profile/${encodeURIComponent(profileId)}`, {\n body: params,\n ...options,\n });\n }\n\n /** List routing configs for profile. `GET /routing/list/profile` */\n async listForProfile(): Promise<RoutingDictionary> {\n return this.request('GET', '/routing/list/profile');\n }\n\n /** Evaluate a routing rule. `POST /routing/rule/evaluate` */\n async evaluateRule(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/rule/evaluate', { body: params });\n }\n\n /** Migrate routing rules for profile. `POST /routing/rule/migrate` */\n async migrateRule(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/rule/migrate', { body: params });\n }\n\n /** Evaluate routing for a payment. `POST /routing/evaluate` */\n async evaluate(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/evaluate', { body: params });\n }\n\n /** Update gateway scores for dynamic routing. `POST /routing/feedback` */\n async feedback(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/routing/feedback', { body: params });\n }\n}\n\nclass RoutingDecisionManager {\n constructor(private readonly request: RequestFn) {}\n\n /** Upsert decision manager config. `PUT /routing/decision` */\n async upsert(\n params: Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<Record<string, unknown>> {\n return this.request('PUT', '/routing/decision', { body: params, ...options });\n }\n\n /** Retrieve decision manager config. `GET /routing/decision` */\n async retrieve(): Promise<Record<string, unknown>> {\n return this.request('GET', '/routing/decision');\n }\n\n /** Delete decision manager config. `DELETE /routing/decision` */\n async delete(options?: RequestExtras): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/routing/decision', options);\n }\n\n /** Upsert surcharge decision config. `PUT /routing/decision/surcharge` */\n async upsertSurcharge(\n params: Record<string, unknown>,\n options?: RequestExtras,\n ): Promise<Record<string, unknown>> {\n return this.request('PUT', '/routing/decision/surcharge', { body: params, ...options });\n }\n\n /** Retrieve surcharge decision config. `GET /routing/decision/surcharge` */\n async retrieveSurcharge(): Promise<Record<string, unknown>> {\n return this.request('GET', '/routing/decision/surcharge');\n }\n\n /** Delete surcharge decision config. `DELETE /routing/decision/surcharge` */\n async deleteSurcharge(options?: RequestExtras): Promise<Record<string, unknown>> {\n return this.request('DELETE', '/routing/decision/surcharge', options);\n }\n}\n\n/**\n * Merchant-friendly surcharge rules: configure a per-payment-method surcharge\n * (fixed or %) added to the amount the buyer pays — without hand-writing the\n * Euclid DSL. Scope to a shop via `profile_id` (omit for merchant-wide).\n *\n * Distinct from the platform fee (a balance deduction): a surcharge changes what\n * the buyer is charged.\n */\nclass SurchargeRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create or replace the surcharge program for a scope.\n *\n * `PUT /routing/surcharge/rules`\n *\n * @example\n * ```typescript\n * await delopay.routing.surchargeRules.upsert({\n * surcharges: [\n * { payment_method: 'crypto', surcharge: { rate: { percent: 1.0 } } },\n * { payment_method: 'card', surcharge: { fixed: { amount: 35 } } },\n * ],\n * });\n * ```\n */\n async upsert(\n params: SurchargeRuleRequest,\n options?: RequestExtras,\n ): Promise<SurchargeRuleResponse> {\n return this.request('PUT', '/routing/surcharge/rules', { body: params, ...options });\n }\n\n /**\n * Retrieve the active surcharge program for a scope, or `null` when none is set.\n *\n * `GET /routing/surcharge/rules?profile_id={profileId}`\n *\n * @param profileId - Shop scope. Omit for the merchant-wide rule.\n */\n async retrieve(profileId?: string): Promise<SurchargeRuleResponse | null> {\n return this.request('GET', '/routing/surcharge/rules', {\n query: { profile_id: profileId },\n });\n }\n\n /**\n * Deactivate the active surcharge program for a scope.\n *\n * `DELETE /routing/surcharge/rules?profile_id={profileId}`\n *\n * @param profileId - Shop scope. Omit for the merchant-wide rule.\n */\n async delete(profileId?: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', '/routing/surcharge/rules', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n}\n\n/**\n * Checkout theme programs: which of a shop's stored appearance variants a buyer\n * is shown.\n *\n * Same engine and same wire format as the advanced routing rules above — a\n * Euclid program whose rules run top-down, first match wins, with\n * `defaultSelection` as the fallback — with the output swapped for a variant\n * name. That is deliberate: the dashboard's routing rule builder can author\n * these without learning a second condition language.\n *\n * **A theme program decides a look and nothing else.** It cannot express which\n * payment methods are offered, what is charged, which provider processes the\n * payment, or whether it succeeds. The allowed dimensions are fixed server-side\n * by the output type — see {@link CheckoutThemeDimension} — so that is a\n * property of the API rather than a convention.\n *\n * Naming a variant the shop has not defined is **not** an error: the checkout\n * falls back to the shop default, exactly as it does for an unknown `?theme=`,\n * because a buyer who cannot pay is worse than a buyer who sees the default\n * look. Such names come back in `warnings` instead, recomputed on every read.\n */\nclass CheckoutThemeRules {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create or replace the theme program for a scope.\n *\n * `PUT /routing/checkout-theme/rules`\n *\n * Supersedes rather than overwrites: the previous active version is retired\n * and a new one stored, so the record of which look was live when survives.\n * Pass `active: false` to store a revision **without** retiring the live one —\n * that is where a program drafted against a variant you have not built yet\n * belongs.\n *\n * @example A phone in Germany gets the compact look; everyone else the house style.\n * ```typescript\n * await delopay.routing.checkoutThemeRules.upsert({\n * name: 'Autumn targeting',\n * profile_id: 'pro_...',\n * algorithm: {\n * rules: [\n * {\n * name: 'German phones',\n * connectorSelection: { theme: { variant: 'compact' } },\n * statements: [\n * {\n * condition: [\n * {\n * lhs: 'device_class',\n * comparison: 'equal',\n * value: { type: 'enum_variant', value: 'phone' },\n * metadata: {},\n * },\n * {\n * lhs: 'browser_language',\n * comparison: 'equal',\n * value: { type: 'enum_variant', value: 'de' },\n * metadata: {},\n * },\n * ],\n * },\n * ],\n * },\n * ],\n * defaultSelection: { theme: { variant: 'house' } },\n * metadata: {},\n * },\n * });\n * ```\n */\n async upsert(params: CheckoutThemeProgramRequest): Promise<CheckoutThemeProgramResponse> {\n return this.request('PUT', '/routing/checkout-theme/rules', { body: params });\n }\n\n /**\n * Retrieve the active theme program for a scope, or `null` when none is set.\n *\n * `GET /routing/checkout-theme/rules?profile_id={profileId}`\n *\n * @param profileId - Shop scope. Omit for the merchant-wide program. A\n * shop-scoped caller that omits it gets its own shop's program.\n */\n async retrieve(profileId?: string): Promise<CheckoutThemeProgramResponse | null> {\n return this.request('GET', '/routing/checkout-theme/rules', {\n query: { profile_id: profileId },\n });\n }\n\n /**\n * Deactivate the active theme program for a scope. Idempotent.\n *\n * `DELETE /routing/checkout-theme/rules?profile_id={profileId}`\n *\n * Deactivation, not deletion — the stored row is what says which look was\n * live when, and that history cannot be reconstructed after the fact. Shops\n * go back to their default appearance immediately.\n *\n * @param profileId - Shop scope. Omit for the merchant-wide program.\n */\n async delete(profileId?: string): Promise<void> {\n return this.request('DELETE', '/routing/checkout-theme/rules', {\n query: { profile_id: profileId },\n });\n }\n}\n\n/**\n * Rendered-to-paid conversion, per appearance variant and segment.\n *\n * Answers the one question theme targeting exists for: *does variant B convert\n * better than the house style, on phones, in Germany?*\n *\n * **What a rate here means.** The denominator is backend-observed checkout page\n * opens, deduplicated by device within the hosted checkout's cache window, with\n * automated traffic excluded from both sides. It is narrower than \"paints\", and\n * that is deliberate - counting one buyer's refresh as a second render would\n * understate conversion. The exact basis travels with every response in\n * `denominator`, and the ways it is not the whole truth travel in `caveats`.\n *\n * **The server decides what may be concluded, not you.** Rate, Wilson interval,\n * per-cell `verdict` and the variant-vs-default `separates` test are computed\n * once, server-side, and shipped as values. Do not recompute them: the first\n * client that rounds differently tells a merchant a difference is real when the\n * server says it is not.\n */\nclass CheckoutThemeConversion {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Rendered-to-paid conversion for a shop over a window.\n *\n * `GET /routing/checkout-theme/conversion`\n *\n * Requires `CheckoutBranding` read at profile scope - the same permission\n * that governs seeing how a checkout looks.\n *\n * @param params - Window (RFC3339, `start` inclusive / `end` exclusive), the\n * shop, the dimension to group by, and the optional `device_class`,\n * `country` and `selection` filters.\n *\n * @example Which variant wins on which device, over the last 30 days.\n * ```typescript\n * const report = await delopay.routing.checkoutThemeConversion.retrieve({\n * profile_id: 'pro_...',\n * start: '2026-07-21T00:00:00Z',\n * end: '2026-08-20T00:00:00Z',\n * segment: 'device',\n * });\n *\n * for (const c of report.comparisons) {\n * if (!c.separates) continue; // \"not shown to differ\" - say nothing\n * console.log(`${c.variant} on ${c.segment}: ${c.higher} converts better`);\n * }\n * ```\n */\n async retrieve(params: CheckoutThemeConversionQuery): Promise<CheckoutThemeConversionResponse> {\n return this.request('GET', '/routing/checkout-theme/conversion', {\n query: {\n profile_id: params.profile_id,\n start: params.start,\n end: params.end,\n segment: params.segment,\n device_class: params.device_class ?? undefined,\n country: params.country ?? undefined,\n selection: params.selection ?? undefined,\n },\n });\n }\n}\n"]}
|