@delopay/sdk 0.409.0 → 0.414.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/airwallexCard.cjs.map +1 -1
- package/dist/branding.cjs.map +1 -1
- package/dist/cardFormStyles.cjs.map +1 -1
- package/dist/checkoutSession.cjs +2 -2
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/checkoutSession.js +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-44QBWVRS.cjs.map +1 -1
- package/dist/chunk-4EKAWNYI.cjs.map +1 -1
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/{chunk-ZDYRYXY3.js → chunk-4YCQWMFF.js} +3 -3
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-5CNBINCX.cjs.map +1 -1
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.cjs.map +1 -1
- package/dist/chunk-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-NW37NQZB.cjs → chunk-A3DALTDS.cjs} +108 -3
- package/dist/chunk-A3DALTDS.cjs.map +1 -0
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-B2TCNGC2.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BOU2TQ6U.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-NXORFP3R.js → chunk-EGQKVHQB.js} +1 -1
- package/dist/chunk-EGQKVHQB.js.map +1 -0
- 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-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-GGYLU7YO.cjs.map +1 -1
- package/dist/chunk-GK5FWN4H.cjs.map +1 -1
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/chunk-H537KAYC.cjs.map +1 -1
- 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-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-KSJ7JLR3.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MCNDMK7F.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/{chunk-RBN2H7QR.js → chunk-NPIVFYLK.js} +11 -7
- package/dist/{chunk-RBN2H7QR.js.map → chunk-NPIVFYLK.js.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-AQ5NYBU4.cjs → chunk-PWDY5D5S.cjs} +11 -7
- package/dist/chunk-PWDY5D5S.cjs.map +1 -0
- 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-TIMYWB2C.cjs → chunk-QT3HUTWI.cjs} +5 -5
- package/dist/chunk-QT3HUTWI.cjs.map +1 -0
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4FE6K43.cjs.map +1 -1
- package/dist/{chunk-X7UAYGQR.cjs → chunk-R4GA6BVP.cjs} +17 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -0
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/{chunk-DZM3UP7F.cjs → chunk-RSVLVW4L.cjs} +1 -1
- package/dist/chunk-RSVLVW4L.cjs.map +1 -0
- 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-V47G7P6L.cjs.map +1 -1
- package/dist/{chunk-JTZ44ZLT.js → chunk-VCIPI4R2.js} +108 -3
- package/dist/chunk-VCIPI4R2.js.map +1 -0
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VOIELJLZ.cjs.map +1 -1
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/chunk-WHDI3TMP.cjs.map +1 -1
- package/dist/chunk-WITCPKNL.cjs.map +1 -1
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/{chunk-JSSDNDAG.cjs → chunk-XAUPBK6A.cjs} +3 -3
- package/dist/chunk-XAUPBK6A.cjs.map +1 -0
- 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-YOFIOZJ5.js → chunk-ZJRQ2AKS.js} +2 -2
- package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
- package/dist/chunk-ZOD4J4XF.cjs.map +1 -1
- package/dist/{chunk-3GMGEP5I.js → chunk-ZTFYSSKD.js} +17 -1
- package/dist/chunk-ZTFYSSKD.js.map +1 -0
- package/dist/client.cjs +2 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/currencies.cjs.map +1 -1
- package/dist/enigmaCardForm.cjs.map +1 -1
- package/dist/error.cjs.map +1 -1
- package/dist/eventStream.cjs.map +1 -1
- package/dist/exportDownload.cjs.map +1 -1
- package/dist/feeProgram.cjs.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/internal/resources/admin.cjs.map +1 -1
- package/dist/internal/resources/admin.d.cts +1 -1
- package/dist/internal/resources/admin.d.ts +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.d.cts +1 -1
- package/dist/internal/resources/adminBranding.d.ts +1 -1
- package/dist/internal/resources/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 +69 -6
- package/dist/internal/resources/adminPortal.d.ts +69 -6
- 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 +2 -2
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.d.cts +12 -1
- package/dist/internal/resources/auditLogs.d.ts +12 -1
- package/dist/internal/resources/auditLogs.js +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.cjs +10 -10
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +2 -2
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +6 -6
- 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/analytics.cjs.map +1 -1
- package/dist/resources/analyticsDashboard.cjs.map +1 -1
- package/dist/resources/apiKeys.cjs.map +1 -1
- package/dist/resources/audit.cjs.map +1 -1
- package/dist/resources/authentication.cjs.map +1 -1
- package/dist/resources/availabilityOverrides.cjs.map +1 -1
- package/dist/resources/billing.cjs.map +1 -1
- package/dist/resources/buyerAccount.cjs.map +1 -1
- package/dist/resources/buyerBlocklist.cjs +2 -2
- package/dist/resources/buyerBlocklist.cjs.map +1 -1
- package/dist/resources/buyerBlocklist.d.cts +1 -1
- package/dist/resources/buyerBlocklist.d.ts +1 -1
- package/dist/resources/buyerBlocklist.js +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 +2 -2
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/identityVerifications.d.cts +10 -6
- package/dist/resources/identityVerifications.d.ts +10 -6
- package/dist/resources/identityVerifications.js +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/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-BEuEdvtX.d.cts → types-D6FnCYfT.d.cts} +428 -3
- package/dist/{types-ewLZOLPZ.d.ts → types-DfdwbAWM.d.ts} +428 -3
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +151 -15
- package/dist/types.d.ts +151 -15
- package/package.json +17 -19
- package/dist/chunk-3GMGEP5I.js.map +0 -1
- package/dist/chunk-AQ5NYBU4.cjs.map +0 -1
- package/dist/chunk-DZM3UP7F.cjs.map +0 -1
- package/dist/chunk-JSSDNDAG.cjs.map +0 -1
- package/dist/chunk-JTZ44ZLT.js.map +0 -1
- package/dist/chunk-NW37NQZB.cjs.map +0 -1
- package/dist/chunk-NXORFP3R.js.map +0 -1
- package/dist/chunk-TIMYWB2C.cjs.map +0 -1
- package/dist/chunk-X7UAYGQR.cjs.map +0 -1
- /package/dist/{chunk-ZDYRYXY3.js.map → chunk-4YCQWMFF.js.map} +0 -0
- /package/dist/{chunk-YOFIOZJ5.js.map → chunk-ZJRQ2AKS.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-M3HWE7KT.cjs","../src/resources/audit.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACKA,IAAM,wBAAA,EAA0B,CAAC,YAAA,EAAc,QAAA,EAAU,aAAa,CAAA;AAc/D,IAAM,MAAA,EAAN,MAAY;AAAA,EACjB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,EAA4E;AACrF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,QAAA,EAAU;AAAA,MACnC,KAAA,EAAO,wCAAA,MAAS,EAAQ,uBAAuB;AAAA,IACjD,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,QAAA,CAAS,KAAA,EAA+C;AAC5D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,OAAA,EAAU,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AAChE,EAAA;AACF;ADhBmE;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-M3HWE7KT.cjs","sourcesContent":[null,"import type {\n MerchantAuditLogListParams,\n MerchantAuditLogListResponse,\n MerchantAuditLogEntry,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** The audit log filters that take several values. */\nconst MERCHANT_AUDIT_CSV_KEYS = ['profile_id', 'action', 'entity_type'] as const;\n\n/**\n * A merchant's own audit log — everything changed on their account and their\n * shops, grouped by the sign-in it happened in.\n *\n * Requires a dashboard JWT (`setJwtToken`) whose role holds the `AuditLog`\n * permission; an API key cannot read it. This is deliberate: the log names\n * people, and an API key names no one.\n *\n * There is no `merchant_id` parameter. The scope comes from the token, so this\n * resource cannot be pointed at another merchant — see\n * {@link MerchantAuditLogListParams}.\n */\nexport class Audit {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of the merchant's audit log, the newest entry first unless\n * `sort_by` says otherwise. Several `profile_id`, `action` or `entity_type`\n * values match an entry with any of them. `GET /audit`\n */\n async list(params?: MerchantAuditLogListParams): Promise<MerchantAuditLogListResponse> {\n return this.request('GET', '/audit', {\n query: csvQuery(params, MERCHANT_AUDIT_CSV_KEYS),\n });\n }\n\n /**\n * One entry. An id belonging to another merchant answers 404, not 403 — the\n * endpoint does not confirm that an entry it will not serve exists.\n */\n async retrieve(logId: string): Promise<MerchantAuditLogEntry> {\n return this.request('GET', `/audit/${encodeURIComponent(logId)}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-M3SJHFT4.cjs","../src/internal/resources/nativeRenewals.ts"],"names":[],"mappings":"AAAA;ACIO,IAAM,eAAA,EAAN,MAAqB;AAAA,EAC1B,WAAA,CACmB,OAAA,EACA,UAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAChB;AAAA;AAAA,EAGH,MAAM,KAAA,CACJ,SAAA,EACA,MAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,UAAA,EAAa,kBAAA,CAAmB,SAAS,CAAC,CAAA,qBAAA,CAAA,EAAyB;AAAA,MAC7F,GAAG,OAAA;AAAA,MACH,OAAA,EAAS;AAAA,QACP,mBAAG,OAAA,2BAAS,SAAA;AAAA,QACZ,oBAAA,EAAsB,IAAA,CAAK,UAAA;AAAA,QAC3B,eAAA,EAAiB,MAAA,CAAO,WAAA;AAAA,QACxB,cAAA,EAAgB,MAAA,CAAO;AAAA,MACzB;AAAA,IACF,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADPA;AACA;AACE;AACF,wCAAC","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-M3SJHFT4.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../../client';\nimport type { NativeRenewalCloseResponse, NativeRenewalCloseTarget } from '../types';\n\n/** Service-authenticated renewal reconciliation. */\nexport class NativeRenewals {\n constructor(\n private readonly request: RequestFn,\n private readonly serviceKey: string,\n ) {}\n\n /** Close the previous renewal payment using the internal service key and its owner context. */\n async close(\n paymentId: string,\n target: NativeRenewalCloseTarget,\n options?: RequestExtras,\n ): Promise<NativeRenewalCloseResponse> {\n return this.request('POST', `/payments/${encodeURIComponent(paymentId)}/native-renewal-close`, {\n ...options,\n headers: {\n ...options?.headers,\n 'X-Internal-API-Key': this.serviceKey,\n 'X-Merchant-Id': target.merchant_id,\n 'X-Profile-Id': target.profile_id,\n },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-MCNDMK7F.cjs","../src/resources/billing.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBA,IAAM,mBAAA,EAAN,MAAyB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASlD,MAAM,UAAA,CACJ,UAAA,EACA,MAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,wBAAA,CAAA;AAAA,MAC1C,EAAE,IAAA,EAAM,OAAO;AAAA,IACjB,CAAA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,WAAA,CACJ,UAAA,EACA,MAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,yBAAA,CAAA;AAAA,MAC1C;AAAA,QACE,IAAA,EAAM;AAAA,MACR;AAAA,IACF,CAAA;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,IAAA,CAAK,UAAA,EAAqD;AAC9D,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,YAAA,CAAc,CAAA;AAAA,EACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,GAAA,CAAI,UAAA,EAAoB,SAAA,EAAgD;AAC5E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,KAAA;AAAA,MACA,CAAA,SAAA,EAAY,kBAAA,CAAmB,UAAU,CAAC,CAAA,aAAA,EAAgB,kBAAA,CAAmB,SAAS,CAAC,CAAA;AAAA,IAAA;AACzF,EAAA;AAEJ;AAQO;AAAc,EAAA;AAIU,IAAA;AAC3B,IAAA;AAAiD,EAAA;AACnD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAeE,IAAA;AAAuE,EAAA;AACzE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAgF,MAAA;AACxE,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAaE,IAAA;AAAyF,MAAA;AACjF,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUE,IAAA;AAAgF,MAAA;AACxE,IAAA;AACP,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAYE,IAAA;AAAgF,MAAA;AACxC,IAAA;AACvC,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAiBE,IAAA;AAA0F,MAAA;AACjF,IAAA;AACR,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAcE,IAAA;AAAyF,MAAA;AACjF,MAAA;AACH,IAAA;AACJ,EAAA;AAEL;ADjDA;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-MCNDMK7F.cjs","sourcesContent":[null,"import type {\n BillingProfileResponse,\n BillingSetupRequest,\n BillingSetupResponse,\n BillingCompleteSetupRequest,\n TopupRequest,\n TopupResponse,\n LedgerResponse,\n LedgerListParams,\n BlockedAttemptListResponse,\n BlockedAttemptListParams,\n AutoRechargeUpdateRequest,\n AllocationTransferRequest,\n AllocationTransferResponse,\n AllocationListResponse,\n AllocationResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** Manage per-shop prepaid balance allocations transferred from the host merchant treasury. */\nclass BillingAllocations {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transfer funds from the host merchant treasury into a shop's allocation.\n *\n * @param merchantId - The host merchant account ID.\n * @param params - Transfer details (amount, target profile/shop ID).\n * @returns The allocation transfer result.\n */\n async transferIn(\n merchantId: string,\n params: AllocationTransferRequest,\n ): Promise<AllocationTransferResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/allocations/transfer-in`,\n { body: params },\n );\n }\n\n /**\n * Transfer funds from a shop's allocation back to the host merchant treasury.\n *\n * @param merchantId - The host merchant account ID.\n * @param params - Transfer details (amount, source profile/shop ID).\n * @returns The allocation transfer result.\n */\n async transferOut(\n merchantId: string,\n params: AllocationTransferRequest,\n ): Promise<AllocationTransferResponse> {\n return this.request(\n 'POST',\n `/billing/${encodeURIComponent(merchantId)}/allocations/transfer-out`,\n {\n body: params,\n },\n );\n }\n\n /**\n * List all shop balance allocations for a merchant.\n *\n * @param merchantId - The merchant account ID.\n * @returns List of shop allocations.\n */\n async list(merchantId: string): Promise<AllocationListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/allocations`);\n }\n\n /**\n * Get the balance allocation for a specific shop.\n *\n * @param merchantId - The merchant account ID.\n * @param profileId - The shop (business profile) ID.\n * @returns The shop's balance allocation.\n */\n async get(merchantId: string, profileId: string): Promise<AllocationResponse> {\n return this.request(\n 'GET',\n `/billing/${encodeURIComponent(merchantId)}/allocations/${encodeURIComponent(profileId)}`,\n );\n }\n}\n\n/**\n * Manage prepaid billing balances — top-ups, card setup, auto-recharge, and the balance ledger.\n *\n * Delopay deducts a platform fee from the merchant's prepaid balance on every successful payment.\n * Use these endpoints to fund and monitor that balance.\n */\nexport class Billing {\n /** Per-shop balance allocation management for host merchants. */\n readonly allocations: BillingAllocations;\n\n constructor(private readonly request: RequestFn) {\n this.allocations = new BillingAllocations(request);\n }\n\n /**\n * Retrieve a merchant's billing profile (balance, status, auto-recharge config).\n *\n * @param merchantId - The merchant account ID.\n * @returns The billing profile.\n *\n * @example\n * ```typescript\n * const profile = await delopay.billing.getProfile('merch_123');\n * console.log(profile.balance, profile.status);\n * ```\n */\n async getProfile(merchantId: string): Promise<BillingProfileResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}`);\n }\n\n /**\n * Start a Stripe SetupIntent flow to collect a payment card for auto-recharge.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional setup parameters.\n * @returns The Stripe client secret needed to render the card element.\n */\n async setup(merchantId: string, params?: BillingSetupRequest): Promise<BillingSetupResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/setup`, {\n body: params,\n });\n }\n\n /**\n * Confirm card setup after the Stripe SetupIntent completes on the frontend.\n *\n * @param merchantId - The merchant account ID.\n * @param params - The Stripe SetupIntent ID to confirm.\n * @returns The updated billing profile.\n */\n async completeSetup(\n merchantId: string,\n params: BillingCompleteSetupRequest,\n ): Promise<BillingProfileResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/setup/complete`, {\n body: params,\n });\n }\n\n /**\n * Manually top up a merchant's prepaid balance by charging their saved card.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Top-up amount and currency.\n * @returns The top-up result.\n */\n async topup(merchantId: string, params: TopupRequest): Promise<TopupResponse> {\n return this.request('POST', `/billing/${encodeURIComponent(merchantId)}/topup`, {\n body: params,\n });\n }\n\n /**\n * List the balance ledger (credits and debits) for a merchant, the newest\n * entry first unless `sort_by` says otherwise.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional pagination, filters (entry types, a creation\n * window) and sort.\n * @returns The ledger entries.\n */\n async listLedger(merchantId: string, params?: LedgerListParams): Promise<LedgerResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/ledger`, {\n query: csvQuery(params, ['entry_type']),\n });\n }\n\n /**\n * List payment attempts that were blocked by the billing suspension gate\n * (account suspended, setup incomplete, or shop allocation suspended).\n *\n * These attempts never created a payment, so they do not appear in the\n * payments list — this is the only way to retrieve them.\n *\n * @param merchantId - The merchant account ID.\n * @param params - Optional filters (profile, reason, date range) and pagination.\n * @returns The blocked-attempt entries with a total count.\n */\n async listBlockedAttempts(\n merchantId: string,\n params?: BlockedAttemptListParams,\n ): Promise<BlockedAttemptListResponse> {\n return this.request('GET', `/billing/${encodeURIComponent(merchantId)}/blocked-attempts`, {\n query: params as Record<string, string | number | undefined>,\n });\n }\n\n /**\n * Update auto-recharge configuration (threshold, top-up amount, enabled flag).\n *\n * @param merchantId - The merchant account ID.\n * @param params - Auto-recharge settings to update.\n * @returns The updated billing profile.\n */\n async updateAutoRecharge(\n merchantId: string,\n params: AutoRechargeUpdateRequest,\n options?: RequestExtras,\n ): Promise<BillingProfileResponse> {\n return this.request('PATCH', `/billing/${encodeURIComponent(merchantId)}/auto-recharge`, {\n body: params,\n ...options,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-MLG6NXI6.cjs","../src/resources/analyticsDashboard.ts"],"names":[],"mappings":"AAAA;ACEO,IAAM,mBAAA,EAAN,MAAyB;AAAA,EAC9B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,QAAA,CACJ,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,sBAAA,EAAwB,EAAE,KAAA,EAAO,OAAO,CAAC,CAAA;AAAA,EACtE;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,MAAA,EAAmE;AAChF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,sBAAA,EAAwB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACtE;AACF,CAAA;ADFA;AACA;AACE;AACF,gDAAC","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-MLG6NXI6.cjs","sourcesContent":[null,"import type { RequestFn } from '../client';\n\nexport class AnalyticsDashboard {\n constructor(private readonly request: RequestFn) {}\n\n /** Get analytics dashboard data. `GET /analytics-dashboard` */\n async retrieve(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/analytics-dashboard', { query: params });\n }\n\n /** Generate analytics dashboard report. `POST /analytics-dashboard` */\n async generate(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/analytics-dashboard', { body: params });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-NFB3S2E6.cjs","../src/resources/vatRates.ts"],"names":[],"mappings":"AAAA;ACSO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQlD,MAAM,IAAA,CAAK,MAAA,EAA0D;AACnE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,YAAA,EAAc;AAAA,MACvC,KAAA,EAAO,EAAE,OAAA,kBAAS,MAAA,2BAAQ,SAAA,EAAS,EAAA,kBAAI,MAAA,6BAAQ,KAAG;AAAA,IACpD,CAAC,CAAA;AAAA,EACH;AACF,CAAA;ADNA;AACA;AACE;AACF,4BAAC","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-NFB3S2E6.cjs","sourcesContent":[null,"import type { VatRateListParams, VatRateListResponse } from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * The platform VAT rate table: the rate charged for a country and tax\n * category from a date on, used when a shop has buyer tax on and no tax rule\n * of the merchant's own decides the line. Read-only. A rate change is a new\n * row with a later `valid_from`; a row in force never changes its rate.\n */\nexport class VatRates {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * List the rates, by country, category and `valid_from`. With `on`, only\n * the row in force on that date for each country and category.\n *\n * `GET /vat-rates`\n */\n async list(params?: VatRateListParams): Promise<VatRateListResponse> {\n return this.request('GET', '/vat-rates', {\n query: { country: params?.country, on: params?.on },\n });\n }\n}\n"]}
|
|
@@ -236,10 +236,12 @@ var IdentityVerifications = class {
|
|
|
236
236
|
/**
|
|
237
237
|
* Switch the connection check of the account's shop. Switched on, the
|
|
238
238
|
* buyer address of every payment the shop confirms is rated by the
|
|
239
|
-
* provider, once per payment and address, before authorization. A
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
239
|
+
* provider, once per payment and address, before authorization. A
|
|
240
|
+
* provider that classifies addresses reports the network classes it found
|
|
241
|
+
* (hosting, Tor, VPN, proxy, residential proxy), and each counts as that
|
|
242
|
+
* network class in the buyer risk score and the buyer blocklist. For a
|
|
243
|
+
* provider that only rates, a `high` or `very_high` rating counts as the
|
|
244
|
+
* `proxy` class. A check never holds or refuses a payment by itself. Switching on asks the
|
|
243
245
|
* provider nothing, since every check is billed. A shop has at most one
|
|
244
246
|
* connection check account. Needs permission to edit connectors.
|
|
245
247
|
*
|
|
@@ -253,8 +255,10 @@ var IdentityVerifications = class {
|
|
|
253
255
|
);
|
|
254
256
|
}
|
|
255
257
|
/**
|
|
256
|
-
* A payment's connection checks, newest first; empty when none ran.
|
|
257
|
-
*
|
|
258
|
+
* A payment's connection checks, newest first; empty when none ran. Each
|
|
259
|
+
* check carries the network classes it counts as, and, from a provider that
|
|
260
|
+
* classifies addresses, the services, infrastructure and risk tags it
|
|
261
|
+
* named. Needs permission to read payments.
|
|
258
262
|
*
|
|
259
263
|
* `GET /identity-verifications/connection-checks/{payment_id}`
|
|
260
264
|
*/
|
|
@@ -337,4 +341,4 @@ var IdentityVerifications = class {
|
|
|
337
341
|
export {
|
|
338
342
|
IdentityVerifications
|
|
339
343
|
};
|
|
340
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-NPIVFYLK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resources/identityVerifications.ts"],"sourcesContent":["import type { RequestExtras, RequestFn } from '../client';\nimport type {\n AmlEventListResponse,\n AmlMonitoringRequest,\n ConnectionCheckSettingRequest,\n ConnectionCheckSettingResponse,\n ConnectionChecksResponse,\n IdentityVerificationCreateRequest,\n IdentityVerificationFlowsQuery,\n IdentityVerificationFlowsResponse,\n IdentityVerificationListQuery,\n IdentityVerificationListResponse,\n IdentityVerificationResponse,\n IdentityVerificationRetrieveQuery,\n DeviceIntelligenceSettingRequest,\n DeviceIntelligenceSettingResponse,\n DeviceSignalResponse,\n EffectiveRequirementResponse,\n IdentityVerificationDecisionResponse,\n IdentityVerificationRequirementDeleteQuery,\n IdentityVerificationRequirementDeleteResponse,\n IdentityVerificationRequirementListResponse,\n IdentityVerificationRequirementRequest,\n IdentityVerificationRequirementResponse,\n OperationScreeningResponse,\n PaymentScreeningResponse,\n PaymentScreeningSettingRequest,\n PaymentScreeningSettingResponse,\n SubjectVerificationQuery,\n SubjectVerificationResponse,\n} from '../types';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Identity verification (KYC, KYB, AML screening, age, proof of address)\n * through a connected identity verification provider account, such as Didit.\n *\n * The provider account is a connector account of type `fiz_operations`. A test\n * verification runs on the account's test credentials only, a live one on its\n * live credentials only. Reading needs permission to read customers; starting\n * a verification needs permission to edit them.\n */\nexport class IdentityVerifications {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Start a verification of a person or a business. The provider-side\n * workflow decides the checks. With a `return_url`, the provider's session\n * is created at once and its page returned in `verification_url`. With a\n * `payment_id` and no `return_url`, the payment's checkout starts it.\n *\n * `POST /identity-verifications`\n */\n async create(\n params: IdentityVerificationCreateRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('POST', '/identity-verifications', { body: params, ...options });\n }\n\n /**\n * The merchant's verifications, newest first unless `sort_by` says\n * otherwise. A caller limited to one shop sees that shop's only. Several\n * `outcome`, `kind` or `merchant_connector_id` values match a verification\n * with any of them.\n *\n * `GET /identity-verifications`\n */\n async list(\n query?: IdentityVerificationListQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationListResponse> {\n return this.request('GET', '/identity-verifications', {\n query: csvQuery(query, ['outcome', 'kind', 'merchant_connector_id']),\n ...options,\n });\n }\n\n /**\n * One verification. With `force_sync: true`, a verification the provider\n * can still change (pending or in review, or a subject under ongoing AML\n * monitoring) is read from the provider first.\n *\n * `GET /identity-verifications/{verification_id}`\n */\n async retrieve(\n verificationId: string,\n query?: IdentityVerificationRetrieveQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('GET', `/identity-verifications/${encodeURIComponent(verificationId)}`, {\n query: query as Query | undefined,\n ...options,\n });\n }\n\n /**\n * A subject's latest verification in one environment (live unless\n * `test_mode: true`), with its checks, and the subject's verification under\n * ongoing AML monitoring. This is what risk rules read. `verification` and\n * `aml_monitoring` are `null` when the subject has none.\n *\n * `GET /identity-verifications/subjects/{subject_reference}`\n */\n async subject(\n subjectReference: string,\n query?: SubjectVerificationQuery,\n options?: RequestExtras,\n ): Promise<SubjectVerificationResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/subjects/${encodeURIComponent(subjectReference)}`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * The provider-side workflows an account can run in one environment, read\n * from the provider with that environment's credentials. Pass a `flow_id`\n * as `provider_flow_id` to {@link IdentityVerifications.create}.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/flows`\n */\n async flows(\n merchantConnectorId: string,\n query?: IdentityVerificationFlowsQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationFlowsResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/flows`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * Switch ongoing AML monitoring of a verification's subject. The provider\n * then keeps re-screening the subject against sanctions, PEP and\n * adverse-media lists, and every change it reports is recorded. Only a\n * verified person or business can be enrolled; monitoring can be switched\n * off at any time. Needs permission to edit customers.\n *\n * `POST /identity-verifications/{verification_id}/aml-monitoring`\n */\n async setAmlMonitoring(\n verificationId: string,\n params: AmlMonitoringRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request(\n 'POST',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,\n { body: params, ...options },\n );\n }\n\n /**\n * Every change of the subject's AML result the provider reported while the\n * subject was monitored, newest first, at most 100.\n *\n * `GET /identity-verifications/{verification_id}/aml-events`\n */\n async amlEvents(verificationId: string, options?: RequestExtras): Promise<AmlEventListResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,\n options,\n );\n }\n\n /**\n * A payment's screening by the transaction monitoring of the shop's\n * screening account. Recorded only: it never holds or refuses the payment.\n * Answers 404 when the payment has no screening. Needs permission to read\n * payments.\n *\n * `GET /identity-verifications/payment-screenings/{payment_id}`\n */\n async paymentScreening(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account screens its shop's payments. Needs permission to read\n * connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async paymentScreeningSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n options,\n );\n }\n\n /**\n * Switch screening of the account's shop's payments. Switched on, every\n * payment of the shop that succeeds from then on is screened shortly after,\n * in the payment's own environment. A shop has at most one screening\n * account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async updatePaymentScreeningSetting(\n merchantConnectorId: string,\n params: PaymentScreeningSettingRequest,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n { body: params, ...options },\n );\n }\n\n /**\n * A refund's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens refunds. Recorded only: it\n * never holds or reverses the refund. Answers 404 when the refund has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/refund-screenings/{refund_id}`\n */\n async refundScreening(\n refundId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/refund-screenings/${encodeURIComponent(refundId)}`,\n options,\n );\n }\n\n /**\n * A payout's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens payouts. Recorded only: it\n * never holds or reverses the payout. Answers 404 when the payout has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/payout-screenings/{payout_id}`\n */\n async payoutScreening(\n payoutId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payout-screenings/${encodeURIComponent(payoutId)}`,\n options,\n );\n }\n\n /**\n * Whether an account assesses its shop's checkout devices. Needs permission\n * to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async deviceIntelligenceSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n options,\n );\n }\n\n /**\n * Switch device intelligence of the account's shop. Switched on, every\n * checkout of the shop assesses the buyer's device and records the\n * provider's signal on the payment; it never holds or refuses a payment.\n * Switching on is refused when the provider has not switched the feature on\n * for the account. A shop has at most one device intelligence account.\n * Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async updateDeviceIntelligenceSetting(\n merchantConnectorId: string,\n params: DeviceIntelligenceSettingRequest,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's device signal from its checkout's device assessment. Recorded\n * only: it never holds or refuses the payment. Answers 404 when the payment's\n * checkout was not assessed. Needs permission to read payments.\n *\n * `GET /identity-verifications/device-signals/{payment_id}`\n */\n async deviceSignal(paymentId: string, options?: RequestExtras): Promise<DeviceSignalResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/device-signals/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account rates the buyer addresses of its shop's payments.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async connectionCheckSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n options,\n );\n }\n\n /**\n * Switch the connection check of the account's shop. Switched on, the\n * buyer address of every payment the shop confirms is rated by the\n * provider, once per payment and address, before authorization. A `high`\n * or `very_high` rating counts as an anonymising connection (the `proxy`\n * network class) in the buyer risk score and the buyer blocklist. A check\n * never holds or refuses a payment by itself. Switching on asks the\n * provider nothing, since every check is billed. A shop has at most one\n * connection check account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async updateConnectionCheckSetting(\n merchantConnectorId: string,\n params: ConnectionCheckSettingRequest,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's connection checks, newest first; empty when none ran. Needs\n * permission to read payments.\n *\n * `GET /identity-verifications/connection-checks/{payment_id}`\n */\n async connectionChecks(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ConnectionChecksResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/connection-checks/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Set which payments need an identity verification at one level: the\n * merchant, a project, a shop, a checkout template or one payment. `off`\n * lifts a wider requirement. Without `payment_method_types` or\n * `merchant_connector_ids` the checkout shows the identity step before any\n * payment option; with them, only when the buyer picks a matching method.\n * A payment is decided once, so a later change does not change it.\n * Merchant, project and checkout template requirements need a\n * merchant-level caller; a shop on a checkout template takes its\n * requirement from the template. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/requirements`\n */\n async putRequirement(\n params: IdentityVerificationRequirementRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementResponse> {\n return this.request('PUT', '/identity-verifications/requirements', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Every requirement of the merchant. A caller limited to one shop sees the\n * merchant's and projects' requirements and its own shop's and payments'.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements`\n */\n async listRequirements(\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementListResponse> {\n return this.request('GET', '/identity-verifications/requirements', options);\n }\n\n /**\n * The level inherits again. Payments already decided keep their decision.\n * Needs permission to edit connectors.\n *\n * `DELETE /identity-verifications/requirements`\n */\n async deleteRequirement(\n query: IdentityVerificationRequirementDeleteQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementDeleteResponse> {\n return this.request('DELETE', '/identity-verifications/requirements', {\n query: query as unknown as Query,\n ...options,\n });\n }\n\n /**\n * The requirement a new payment of the shop meets and the level it comes\n * from. Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements/effective`\n */\n async effectiveRequirement(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveRequirementResponse> {\n return this.request('GET', '/identity-verifications/requirements/effective', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Whether the payment needs an identity verification, as decided the first\n * time its checkout was drawn or it was confirmed. Not found until then.\n * Needs permission to read payments.\n *\n * `GET /identity-verifications/requirements/payments/{payment_id}`\n */\n async paymentDecision(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<IdentityVerificationDecisionResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/requirements/payments/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n}\n"],"mappings":";;;;;AA4CO,IAAM,wBAAN,MAA4B;AAAA,EACjC,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,OACJ,QACA,SACuC;AACvC,WAAO,KAAK,QAAQ,QAAQ,2BAA2B,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAAA,EACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,KACJ,OACA,SAC2C;AAC3C,WAAO,KAAK,QAAQ,OAAO,2BAA2B;AAAA,MACpD,OAAO,SAAS,OAAO,CAAC,WAAW,QAAQ,uBAAuB,CAAC;AAAA,MACnE,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,SACJ,gBACA,OACA,SACuC;AACvC,WAAO,KAAK,QAAQ,OAAO,2BAA2B,m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A,MAAM,qBACJ,WACA,SACuC;AACvC,WAAO,KAAK,QAAQ,OAAO,kDAAkD;AAAA,MAC3E,OAAO,EAAE,YAAY,UAAU;AAAA,MAC/B,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,gBACJ,WACA,SAC+C;AAC/C,WAAO,KAAK;AAAA,MACV;AAAA,MACA,iDAAiD,mBAAmB,SAAS,CAAC;AAAA,MAC9E;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/resources/identityVerifications.ts"],"sourcesContent":["import type { RequestExtras, RequestFn } from '../client';\nimport type {\n AmlEventListResponse,\n AmlMonitoringRequest,\n ConnectionCheckSettingRequest,\n ConnectionCheckSettingResponse,\n ConnectionChecksResponse,\n IdentityVerificationCreateRequest,\n IdentityVerificationFlowsQuery,\n IdentityVerificationFlowsResponse,\n IdentityVerificationListQuery,\n IdentityVerificationListResponse,\n IdentityVerificationResponse,\n IdentityVerificationRetrieveQuery,\n DeviceIntelligenceSettingRequest,\n DeviceIntelligenceSettingResponse,\n DeviceSignalResponse,\n EffectiveRequirementResponse,\n IdentityVerificationDecisionResponse,\n IdentityVerificationRequirementDeleteQuery,\n IdentityVerificationRequirementDeleteResponse,\n IdentityVerificationRequirementListResponse,\n IdentityVerificationRequirementRequest,\n IdentityVerificationRequirementResponse,\n OperationScreeningResponse,\n PaymentScreeningResponse,\n PaymentScreeningSettingRequest,\n PaymentScreeningSettingResponse,\n SubjectVerificationQuery,\n SubjectVerificationResponse,\n} from '../types';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Identity verification (KYC, KYB, AML screening, age, proof of address)\n * through a connected identity verification provider account, such as Didit.\n *\n * The provider account is a connector account of type `fiz_operations`. A test\n * verification runs on the account's test credentials only, a live one on its\n * live credentials only. Reading needs permission to read customers; starting\n * a verification needs permission to edit them.\n */\nexport class IdentityVerifications {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Start a verification of a person or a business. The provider-side\n * workflow decides the checks. With a `return_url`, the provider's session\n * is created at once and its page returned in `verification_url`. With a\n * `payment_id` and no `return_url`, the payment's checkout starts it.\n *\n * `POST /identity-verifications`\n */\n async create(\n params: IdentityVerificationCreateRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('POST', '/identity-verifications', { body: params, ...options });\n }\n\n /**\n * The merchant's verifications, newest first unless `sort_by` says\n * otherwise. A caller limited to one shop sees that shop's only. Several\n * `outcome`, `kind` or `merchant_connector_id` values match a verification\n * with any of them.\n *\n * `GET /identity-verifications`\n */\n async list(\n query?: IdentityVerificationListQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationListResponse> {\n return this.request('GET', '/identity-verifications', {\n query: csvQuery(query, ['outcome', 'kind', 'merchant_connector_id']),\n ...options,\n });\n }\n\n /**\n * One verification. With `force_sync: true`, a verification the provider\n * can still change (pending or in review, or a subject under ongoing AML\n * monitoring) is read from the provider first.\n *\n * `GET /identity-verifications/{verification_id}`\n */\n async retrieve(\n verificationId: string,\n query?: IdentityVerificationRetrieveQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('GET', `/identity-verifications/${encodeURIComponent(verificationId)}`, {\n query: query as Query | undefined,\n ...options,\n });\n }\n\n /**\n * A subject's latest verification in one environment (live unless\n * `test_mode: true`), with its checks, and the subject's verification under\n * ongoing AML monitoring. This is what risk rules read. `verification` and\n * `aml_monitoring` are `null` when the subject has none.\n *\n * `GET /identity-verifications/subjects/{subject_reference}`\n */\n async subject(\n subjectReference: string,\n query?: SubjectVerificationQuery,\n options?: RequestExtras,\n ): Promise<SubjectVerificationResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/subjects/${encodeURIComponent(subjectReference)}`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * The provider-side workflows an account can run in one environment, read\n * from the provider with that environment's credentials. Pass a `flow_id`\n * as `provider_flow_id` to {@link IdentityVerifications.create}.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/flows`\n */\n async flows(\n merchantConnectorId: string,\n query?: IdentityVerificationFlowsQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationFlowsResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/flows`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * Switch ongoing AML monitoring of a verification's subject. The provider\n * then keeps re-screening the subject against sanctions, PEP and\n * adverse-media lists, and every change it reports is recorded. Only a\n * verified person or business can be enrolled; monitoring can be switched\n * off at any time. Needs permission to edit customers.\n *\n * `POST /identity-verifications/{verification_id}/aml-monitoring`\n */\n async setAmlMonitoring(\n verificationId: string,\n params: AmlMonitoringRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request(\n 'POST',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,\n { body: params, ...options },\n );\n }\n\n /**\n * Every change of the subject's AML result the provider reported while the\n * subject was monitored, newest first, at most 100.\n *\n * `GET /identity-verifications/{verification_id}/aml-events`\n */\n async amlEvents(verificationId: string, options?: RequestExtras): Promise<AmlEventListResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,\n options,\n );\n }\n\n /**\n * A payment's screening by the transaction monitoring of the shop's\n * screening account. Recorded only: it never holds or refuses the payment.\n * Answers 404 when the payment has no screening. Needs permission to read\n * payments.\n *\n * `GET /identity-verifications/payment-screenings/{payment_id}`\n */\n async paymentScreening(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account screens its shop's payments. Needs permission to read\n * connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async paymentScreeningSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n options,\n );\n }\n\n /**\n * Switch screening of the account's shop's payments. Switched on, every\n * payment of the shop that succeeds from then on is screened shortly after,\n * in the payment's own environment. A shop has at most one screening\n * account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async updatePaymentScreeningSetting(\n merchantConnectorId: string,\n params: PaymentScreeningSettingRequest,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n { body: params, ...options },\n );\n }\n\n /**\n * A refund's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens refunds. Recorded only: it\n * never holds or reverses the refund. Answers 404 when the refund has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/refund-screenings/{refund_id}`\n */\n async refundScreening(\n refundId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/refund-screenings/${encodeURIComponent(refundId)}`,\n options,\n );\n }\n\n /**\n * A payout's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens payouts. Recorded only: it\n * never holds or reverses the payout. Answers 404 when the payout has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/payout-screenings/{payout_id}`\n */\n async payoutScreening(\n payoutId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payout-screenings/${encodeURIComponent(payoutId)}`,\n options,\n );\n }\n\n /**\n * Whether an account assesses its shop's checkout devices. Needs permission\n * to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async deviceIntelligenceSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n options,\n );\n }\n\n /**\n * Switch device intelligence of the account's shop. Switched on, every\n * checkout of the shop assesses the buyer's device and records the\n * provider's signal on the payment; it never holds or refuses a payment.\n * Switching on is refused when the provider has not switched the feature on\n * for the account. A shop has at most one device intelligence account.\n * Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async updateDeviceIntelligenceSetting(\n merchantConnectorId: string,\n params: DeviceIntelligenceSettingRequest,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's device signal from its checkout's device assessment. Recorded\n * only: it never holds or refuses the payment. Answers 404 when the payment's\n * checkout was not assessed. Needs permission to read payments.\n *\n * `GET /identity-verifications/device-signals/{payment_id}`\n */\n async deviceSignal(paymentId: string, options?: RequestExtras): Promise<DeviceSignalResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/device-signals/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account rates the buyer addresses of its shop's payments.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async connectionCheckSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n options,\n );\n }\n\n /**\n * Switch the connection check of the account's shop. Switched on, the\n * buyer address of every payment the shop confirms is rated by the\n * provider, once per payment and address, before authorization. A\n * provider that classifies addresses reports the network classes it found\n * (hosting, Tor, VPN, proxy, residential proxy), and each counts as that\n * network class in the buyer risk score and the buyer blocklist. For a\n * provider that only rates, a `high` or `very_high` rating counts as the\n * `proxy` class. A check never holds or refuses a payment by itself. Switching on asks the\n * provider nothing, since every check is billed. A shop has at most one\n * connection check account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async updateConnectionCheckSetting(\n merchantConnectorId: string,\n params: ConnectionCheckSettingRequest,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's connection checks, newest first; empty when none ran. Each\n * check carries the network classes it counts as, and, from a provider that\n * classifies addresses, the services, infrastructure and risk tags it\n * named. Needs permission to read payments.\n *\n * `GET /identity-verifications/connection-checks/{payment_id}`\n */\n async connectionChecks(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ConnectionChecksResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/connection-checks/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Set which payments need an identity verification at one level: the\n * merchant, a project, a shop, a checkout template or one payment. `off`\n * lifts a wider requirement. Without `payment_method_types` or\n * `merchant_connector_ids` the checkout shows the identity step before any\n * payment option; with them, only when the buyer picks a matching method.\n * A payment is decided once, so a later change does not change it.\n * Merchant, project and checkout template requirements need a\n * merchant-level caller; a shop on a checkout template takes its\n * requirement from the template. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/requirements`\n */\n async putRequirement(\n params: IdentityVerificationRequirementRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementResponse> {\n return this.request('PUT', '/identity-verifications/requirements', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Every requirement of the merchant. A caller limited to one shop sees the\n * merchant's and projects' requirements and its own shop's and payments'.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements`\n */\n async listRequirements(\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementListResponse> {\n return this.request('GET', '/identity-verifications/requirements', options);\n }\n\n /**\n * The level inherits again. Payments already decided keep their decision.\n * Needs permission to edit connectors.\n *\n * `DELETE /identity-verifications/requirements`\n */\n async deleteRequirement(\n query: IdentityVerificationRequirementDeleteQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementDeleteResponse> {\n return this.request('DELETE', '/identity-verifications/requirements', {\n query: query as unknown as Query,\n ...options,\n });\n }\n\n /**\n * The requirement a new payment of the shop meets and the level it comes\n * from. Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements/effective`\n */\n async effectiveRequirement(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveRequirementResponse> {\n return this.request('GET', '/identity-verifications/requirements/effective', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Whether the payment needs an identity verification, as decided the first\n * time its checkout was drawn or it was confirmed. Not found until then.\n * Needs permission to read payments.\n *\n * `GET /identity-verifications/requirements/payments/{payment_id}`\n */\n async paymentDecision(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<IdentityVerificationDecisionResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/requirements/payments/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n}\n"],"mappings":";;;;;AA4CO,IAAM,wBAAN,MAA4B;AAAA,EACjC,YAA6B,SAAoB;AAApB;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,OACJ,QACA,SACuC;AACvC,WAAO,KAAK,QAAQ,QAAQ,2BAA2B,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAAA,EACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,KACJ,OACA,SAC2C;AAC3C,WAAO,KAAK,QAAQ,OAAO,2BAA2B;AAAA,MACpD,OAAO,SAAS,OAAO,CAAC,WAAW,QAAQ,uBAAuB,CAAC;AAAA,MACnE,GAAG;AAAA,IACL,CAAC;AAAA,E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,IAAA;AACF,EAAA;AAAA;AAGsF,EAAA;AACxE,IAAA;AACV,MAAA;AAC0D,MAAA;AAC5D,IAAA;AACF,EAAA;AACF;ADV2E;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-NYL3BNHR.cjs","sourcesContent":[null,"import type {\n CheckoutLinkResolveResponse,\n PaymentLinkResponse,\n PaymentLinkListParams,\n PaymentLinkListResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/** Retrieve and list hosted payment links. */\nexport class PaymentLinks {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Retrieve a payment link by its ID.\n *\n * @param linkId - The unique payment link ID.\n * @returns The payment link details.\n */\n async retrieve(linkId: string): Promise<PaymentLinkResponse> {\n return this.request('GET', `/payment-link/${encodeURIComponent(linkId)}`);\n }\n\n /**\n * The merchant and payment an opaque checkout link opens.\n *\n * A link the API issues today is `/pay/{payment_link_id}`, so it names\n * neither the merchant nor the payment. This answers which ones it means.\n * Unauthenticated, like the checkout render it precedes: no credential is\n * needed or sent beyond what the client already carries. An unknown id is a\n * 404.\n *\n * `GET /payment-link/resolve/{payment_link_id}`\n */\n async resolve(paymentLinkId: string): Promise<CheckoutLinkResolveResponse> {\n return this.request('GET', `/payment-link/resolve/${encodeURIComponent(paymentLinkId)}`);\n }\n\n /**\n * List payment links, optionally filtered by status or date range.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Paginated list of payment links.\n */\n async list(params?: PaymentLinkListParams): Promise<PaymentLinkListResponse> {\n return this.request('POST', '/payment-link/list', { body: params });\n }\n\n /** Initiate (render) a payment link page. `GET /payment-link/{merchantId}/{paymentId}` */\n async initiate(merchantId: string, paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/payment-link/${encodeURIComponent(merchantId)}/${encodeURIComponent(paymentId)}`,\n );\n }\n\n /** Get payment link status. `GET /payment-link/status/{merchantId}/{paymentId}` */\n async status(merchantId: string, paymentId: string): Promise<Record<string, unknown>> {\n return this.request(\n 'GET',\n `/payment-link/status/${encodeURIComponent(merchantId)}/${encodeURIComponent(paymentId)}`,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-O4AYHLQX.cjs","../src/resources/processorImports.ts"],"names":[],"mappings":"AAAA;ACeO,SAAS,sBAAA,CAAuB,KAAA,EAGP;AAC9B,EAAA,OAAA,CAAQ,KAAA,CAAM,IAAA,EAAM;AAAA,IAClB,KAAK,UAAA,EAAY;AACf,MAAA,IAAI,GAAA;AACJ,MAAA,IAAI;AACF,QAAA,IAAA,EAAM,IAAA,CAAK,KAAA,CAAM,KAAA,CAAM,IAAI,CAAA;AAAA,MAC7B,EAAA,UAAQ;AACN,QAAA,OAAO,IAAA;AAAA,MACT;AACA,MAAA,GAAA,CAAI,IAAA,IAAQ,KAAA,GAAQ,OAAO,IAAA,IAAQ,SAAA,GAAY,KAAA,CAAM,OAAA,CAAQ,GAAG,CAAA,EAAG,OAAO,IAAA;AAC1E,MAAA,OAAO,EAAE,IAAA,EAAM,UAAA,EAAY,IAAiC,CAAA;AAAA,IAC9D;AAAA,IACA,KAAK,MAAA;AACH,MAAA,OAAO,EAAE,IAAA,EAAM,OAAO,CAAA;AAAA,IACxB,OAAA;AACE,MAAA,OAAO,IAAA;AAAA,EACX;AACF;AAaO,IAAM,qBAAA,EAAN,MAA0E;AAAA,EAG/E,WAAA,CAA6B,UAAA,EAAmC;AAAnC,IAAA,IAAA,CAAA,WAAA,EAAA,UAAA;AAAA,EAAoC;AAAA;AAAA,EAGjE,KAAA,CAAA,EAAc;AACZ,IAAA,IAAA,CAAK,UAAA,CAAW,KAAA,CAAM,CAAA;AAAA,EACxB;AAAA,EAEA,CAAC,MAAA,CAAO,aAAa,CAAA,CAAA,EAA2D;AAC9E,qBAAA,IAAA,CAAK,QAAA,UAAA,CAAL,IAAA,CAAK,SAA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EAAO,EAAE,SAAA,EAAW,MAAA,CAAO,UAAU;AAAA,IACvC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,EAAA,EAA2C;AACxD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,0BAAA,EAA6B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAChF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO4F,EAAA;AACZ,IAAA;AACtB,MAAA;AACvD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQwD,EAAA;AACyB,IAAA;AACjF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB8F,EAAA;AAC9D,IAAA;AACuB,MAAA;AACnD,MAAA;AACqD,QAAA;AACgB,QAAA;AACb,QAAA;AACxD,MAAA;AACF,IAAA;AAC0C,IAAA;AAC5C,EAAA;AACF;AD9CmF;AACA;AACA;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-O4AYHLQX.cjs","sourcesContent":[null,"import type {\n PspImportCreateRequest,\n PspImportIssuesRequest,\n PspImportIssuesResponse,\n PspImportLatestRequest,\n PspImportLatestResponse,\n PspImportRunResponse,\n PspImportSourcesRequest,\n PspImportSourcesResponse,\n PspImportStreamEvent,\n PspImportStreamOptions,\n} from '../types';\nimport type { EventStreamConnection, EventStreamFn, RequestFn } from '../client';\n\n/** The typed event a dispatch carries, or `null` for one the SDK does not know. */\nexport function toPspImportStreamEvent(event: {\n type: string;\n data: string;\n}): PspImportStreamEvent | null {\n switch (event.type) {\n case 'progress': {\n let run: unknown;\n try {\n run = JSON.parse(event.data);\n } catch {\n return null;\n }\n if (run === null || typeof run !== 'object' || Array.isArray(run)) return null;\n return { type: 'progress', run: run as PspImportRunResponse };\n }\n case 'done':\n return { type: 'done' };\n default:\n return null;\n }\n}\n\n/**\n * An open progress stream of one import: iterate it with `for await`.\n *\n * Each `progress` event carries the whole run, so a missed one loses nothing.\n * The iteration ends after `done`, when the server ends the stream (the\n * session ended, or the stream reached its lifetime), and when it is aborted\n * or closed. The SDK does not reconnect: read the run again with\n * `processorImports.retrieve()` and open a new stream while it is running. It\n * throws a `DelopayError` with code `TIMEOUT` when the stream stays silent too\n * long and `NETWORK` when the connection fails.\n */\nexport class PspImportEventStream implements AsyncIterable<PspImportStreamEvent> {\n private iterator?: AsyncGenerator<PspImportStreamEvent, void, undefined>;\n\n constructor(private readonly connection: EventStreamConnection) {}\n\n /** Close the stream; the iteration ends without an error. */\n close(): void {\n this.connection.close();\n }\n\n [Symbol.asyncIterator](): AsyncGenerator<PspImportStreamEvent, void, undefined> {\n this.iterator ??= this.events();\n return this.iterator;\n }\n\n private async *events(): AsyncGenerator<PspImportStreamEvent, void, undefined> {\n for await (const dispatch of this.connection.dispatches) {\n if (!dispatch.event) continue;\n const event = toPspImportStreamEvent(dispatch.event);\n if (event) yield event;\n }\n }\n}\n\n/**\n * Import refunds and disputes from the merchant's connected processor\n * accounts, in the background. An import only reads from the processor and\n * records what it already holds: it never answers a dispute, moves money or\n * changes a payment. A record DeloPay already holds is counted as already\n * present. Every method needs a dashboard JWT (`setJwtToken`).\n */\nexport class ProcessorImports {\n constructor(\n private readonly request: RequestFn,\n private readonly openStream: EventStreamFn,\n ) {}\n\n /**\n * Every connected processor account the caller may see, with what each can\n * provide in the environment: listed, read payment by payment, or\n * unavailable with a reason.\n *\n * `GET /refunds-disputes/imports/sources`\n */\n async sources(params: PspImportSourcesRequest): Promise<PspImportSourcesResponse> {\n return this.request('GET', '/refunds-disputes/imports/sources', {\n query: { test_mode: params.test_mode },\n });\n }\n\n /**\n * Start an import. A source a processor cannot provide is stored as\n * `unavailable` with its reason. Refused while another import of the\n * merchant runs in the same environment.\n *\n * `POST /refunds-disputes/imports`\n */\n async create(request: PspImportCreateRequest): Promise<PspImportRunResponse> {\n return this.request('POST', '/refunds-disputes/imports', { body: request });\n }\n\n /**\n * The newest import in the environment, running or finished.\n *\n * `GET /refunds-disputes/imports/latest`\n */\n async latest(params: PspImportLatestRequest): Promise<PspImportLatestResponse> {\n return this.request('GET', '/refunds-disputes/imports/latest', {\n query: { test_mode: params.test_mode },\n });\n }\n\n /** `GET /refunds-disputes/imports/{id}` */\n async retrieve(id: string): Promise<PspImportRunResponse> {\n return this.request('GET', `/refunds-disputes/imports/${encodeURIComponent(id)}`);\n }\n\n /**\n * The records an import left out or could not record, each with its reason.\n *\n * `GET /refunds-disputes/imports/{id}/issues`\n */\n async issues(id: string, params?: PspImportIssuesRequest): Promise<PspImportIssuesResponse> {\n return this.request('GET', `/refunds-disputes/imports/${encodeURIComponent(id)}/issues`, {\n query: { limit: params?.limit, offset: params?.offset },\n });\n }\n\n /**\n * Ask a running import to stop. It stops after the page it is reading;\n * what it recorded stays recorded.\n *\n * `POST /refunds-disputes/imports/{id}/cancel`\n */\n async cancel(id: string): Promise<PspImportRunResponse> {\n return this.request('POST', `/refunds-disputes/imports/${encodeURIComponent(id)}/cancel`);\n }\n\n /**\n * Open the progress stream of an import. Resolves once the server answered;\n * a `401` rejects with `DelopayAuthenticationError`.\n *\n * `GET /refunds-disputes/imports/{id}/stream`\n *\n * @example\n * ```typescript\n * const stream = await delopay.processorImports.stream(run.id, { signal });\n * for await (const event of stream) {\n * if (event.type === 'progress') render(event.run);\n * }\n * ```\n */\n async stream(id: string, options: PspImportStreamOptions = {}): Promise<PspImportEventStream> {\n const connection = await this.openStream(\n `/refunds-disputes/imports/${encodeURIComponent(id)}/stream`,\n {\n ...(options.signal ? { signal: options.signal } : {}),\n ...(options.idleTimeoutMs !== undefined ? { idleTimeoutMs: options.idleTimeoutMs } : {}),\n ...(options.headers ? { headers: options.headers } : {}),\n },\n );\n return new PspImportEventStream(connection);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-ODPNVNYE.cjs","../src/resources/support.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACUA,IAAM,KAAA,EAAO,CAAC,EAAA,EAAA,GAAuB,CAAA,uBAAA,EAA0B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAShE;AAC8B,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAG8B,EAAA;AAChB,IAAA;AAChE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOuE,EAAA;AAChB,IAAA;AACE,MAAA;AACtD,IAAA;AACH,EAAA;AAAA;AAG6D,EAAA;AACxB,IAAA;AACrC,EAAA;AAAA;AAGsF,EAAA;AACjC,IAAA;AACG,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAGiF,EAAA;AACnB,IAAA;AAC9D,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAakC,EAAA;AACN,IAAA;AACoB,IAAA;AACM,IAAA;AACb,IAAA;AACwB,IAAA;AACjE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOoE,EAAA;AACZ,IAAA;AACtC,MAAA;AACf,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO6D,EAAA;AACb,IAAA;AAChD,EAAA;AACF;AD3BoE;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-ODPNVNYE.cjs","sourcesContent":[null,"import type {\n SupportAttachmentView,\n SupportConversationCreate,\n SupportConversationList,\n SupportConversationView,\n SupportListQuery,\n SupportMessageCreate,\n SupportMessageList,\n SupportMessagesQuery,\n SupportMessageView,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\nconst path = (id: string): string => `/support/conversations/${encodeURIComponent(id)}`;\n\n/**\n * Conversations between a merchant and DeloPay's support team.\n *\n * Every route answers 404 while support is not available on the deployment, so\n * a 404 on {@link Support.list} means there is nothing to show. A member of a\n * shop reads the conversations they started and those linked to their shop.\n */\nexport class Support {\n constructor(private readonly request: RequestFn) {}\n\n /** Start a conversation with its first message. `POST /support/conversations` */\n async create(body: SupportConversationCreate): Promise<SupportConversationView> {\n return this.request('POST', '/support/conversations', { body });\n }\n\n /**\n * The conversations the caller may read, the latest message first unless\n * `sort_by` says otherwise. Several `kind`, `category` or `status` values\n * match a conversation with any of them. `GET /support/conversations`\n */\n async list(query?: SupportListQuery): Promise<SupportConversationList> {\n return this.request('GET', '/support/conversations', {\n query: csvQuery(query, ['kind', 'category', 'status']),\n });\n }\n\n /** One conversation. `GET /support/conversations/{id}` */\n async retrieve(id: string): Promise<SupportConversationView> {\n return this.request('GET', path(id));\n }\n\n /** A conversation's messages. `GET /support/conversations/{id}/messages` */\n async messages(id: string, query?: SupportMessagesQuery): Promise<SupportMessageList> {\n return this.request('GET', `${path(id)}/messages`, {\n query: query === undefined ? undefined : { ...query },\n });\n }\n\n /** Answer in a conversation. `POST /support/conversations/{id}/messages` */\n async reply(id: string, body: SupportMessageCreate): Promise<SupportMessageView> {\n return this.request('POST', `${path(id)}/messages`, { body });\n }\n\n /**\n * Upload a file for a message. PNG, JPEG, WebP, PDF, text, MP4 or WebM, read from the\n * content; 10 MB, a video 25 MB. It belongs to the caller until a message names it in\n * `attachments`. Uploading again with the same `clientUploadId` returns the same file.\n * `POST /support/conversations/{id}/attachments`\n */\n async uploadAttachment(\n id: string,\n file: Blob,\n clientUploadId: string,\n fileName?: string,\n ): Promise<SupportAttachmentView> {\n const form = new FormData();\n form.append('client_upload_id', clientUploadId);\n if (fileName === undefined) form.append('file', file);\n else form.append('file', file, fileName);\n return this.request('POST', `${path(id)}/attachments`, { body: form });\n }\n\n /**\n * Fetch a file once its scan is clean. Refused with `support_attachment_checking` while\n * the scan runs, and `support_attachment_blocked` after a block.\n * `GET /support/conversations/{id}/attachments/{fileId}`\n */\n async downloadAttachment(id: string, fileId: string): Promise<Blob> {\n return this.request('GET', `${path(id)}/attachments/${encodeURIComponent(fileId)}`, {\n responseType: 'blob',\n });\n }\n\n /**\n * Clear the merchant's unread mark and read the conversation as it is now.\n * Someone acting as somebody else leaves the mark in place.\n * `POST /support/conversations/{id}/read`\n */\n async markRead(id: string): Promise<SupportConversationView> {\n return this.request('POST', `${path(id)}/read`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-OG2KJAYD.cjs","../src/resources/availabilityOverrides.ts"],"names":[],"mappings":"AAAA;ACaO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,MAAA,CAAO,MAAA,EAAkF;AAC7F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,yBAAA,EAA2B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACzE;AAAA;AAAA,EAGA,MAAM,IAAA,CAAK,UAAA,EAA6D;AACtE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,yBAAA,EAA2B;AAAA,MACpD,KAAA,EAAO,EAAE,WAAA,EAAa,WAAW;AAAA,IACnC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,MAAA,CAAO,EAAA,EAA8B;AACzC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,QAAA,EAAU,CAAA,wBAAA,EAA2B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AACjF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASuF,EAAA;AACvB,IAAA;AACrD,MAAA;AACe,QAAA;AACD,QAAA;AACiC,QAAA;AAAA;AAEW,QAAA;AACR,QAAA;AACzD,MAAA;AACD,IAAA;AACH,EAAA;AACF;ADboF;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-OG2KJAYD.cjs","sourcesContent":[null,"import type {\n AvailabilityOverrideCreateRequest,\n AvailabilityOverrideResponse,\n AvailabilityPreviewParams,\n AvailabilityPreviewResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Merchant payment-method availability overrides. Force-show or force-hide a\n * payment method per country/region at global, project, or shop scope, on top\n * of the curated country defaults. Admin (`sk_*`) access required.\n */\nexport class AvailabilityOverrides {\n constructor(private readonly request: RequestFn) {}\n\n /** Create an availability override. `POST /availability-overrides` */\n async create(params: AvailabilityOverrideCreateRequest): Promise<AvailabilityOverrideResponse> {\n return this.request('POST', '/availability-overrides', { body: params });\n }\n\n /** List a merchant's availability overrides. `GET /availability-overrides` */\n async list(merchantId: string): Promise<AvailabilityOverrideResponse[]> {\n return this.request('GET', '/availability-overrides', {\n query: { merchant_id: merchantId },\n });\n }\n\n /** Delete an availability override by id. `DELETE /availability-overrides/{id}` */\n async delete(id: string): Promise<boolean> {\n return this.request('DELETE', `/availability-overrides/${encodeURIComponent(id)}`);\n }\n\n /**\n * Preview the methods a customer in `country` would be shown for a shop —\n * the connector ceiling narrowed by the smart country defaults and the\n * merchant overrides, without an active payment. Pass `amount` + `currency`\n * to also evaluate order-value rules.\n * `GET /availability-overrides/preview`\n */\n async preview(params: AvailabilityPreviewParams): Promise<AvailabilityPreviewResponse> {\n return this.request('GET', '/availability-overrides/preview', {\n query: {\n merchant_id: params.merchant_id,\n profile_id: params.profile_id,\n ...(params.country ? { country: params.country } : {}),\n // `0` is a legitimate order value, so test for presence, not truthiness.\n ...(params.amount !== undefined ? { amount: params.amount } : {}),\n ...(params.currency ? { currency: params.currency } : {}),\n },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/_worktrees/ts-publish-w3/dist/chunk-OWP7XBY2.cjs","../src/resources/customers.ts"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AA;AAAA;AAAA;AAAA;AAQyF,EAAA;AAC9B,IAAA;AAClC,MAAA;AACtB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW8E,EAAA;AACtB,IAAA;AAC/B,MAAA;AACtB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAQiC,EAAA;AACkC,IAAA;AAC1C,MAAA;AACtB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBuE,EAAA;AACY,IAAA;AACnF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYgF,EAAA;AACZ,IAAA;AACpE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB6B,EAAA;AACyD,IAAA;AAC5E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG2E,EAAA;AACS,IAAA;AACpF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASoF,EAAA;AACQ,IAAA;AAC5F,EAAA;AACF;ADtG+F;AACA;AACA;AACA","file":"/home/anes/delo-payment/_worktrees/ts-publish-w3/dist/chunk-OWP7XBY2.cjs","sourcesContent":[null,"import type {\n BuyerInvoiceLink,\n BuyerInvoiceLinkRequest,\n BuyerPortalLinkPage,\n BuyerPortalPageQuery,\n CustomerCreateRequest,\n CustomerIdentityHistoryRequest,\n CustomerIdentityHistoryResponse,\n CustomerIdentityHistorySearchRequest,\n CustomerIdentityImportPreviewRequest,\n CustomerIdentityImportPreviewResponse,\n CustomerIdentityImportRequest,\n CustomerIdentityImportResponse,\n CustomerResponse,\n CustomerShopBulkPlacementRequest,\n CustomerShopBulkPlacementResponse,\n CustomerShopPlacementResponse,\n CustomerUpdateRequest,\n CustomerListParams,\n CustomerListResponse,\n CustomerListWithCountParams,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Flatten list params for the query string.\n *\n * `profile_ids` must go out as ONE comma-separated value. The client\n * serializes arrays as repeated keys (`?profile_ids=a&profile_ids=b`), and the\n * customers endpoints cannot parse that — the whole request fails, rather than\n * the second id being ignored. So the join happens here, once, instead of at\n * four call sites.\n */\nfunction toQuery(\n params?: CustomerListParams,\n): Record<string, string | number | boolean | undefined> | undefined {\n if (!params) return undefined;\n const { profile_ids, ...rest } = params;\n const query = rest as Record<string, string | number | boolean | undefined>;\n // An empty array means \"no shop filter\", which is the absent key — sending\n // `profile_ids=` would work too, but omitting it keeps the URL honest.\n if (profile_ids && profile_ids.length > 0) {\n query.profile_ids = profile_ids.join(',');\n }\n return query;\n}\n\n/** Create and manage customer profiles. */\nexport class Customers {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Check identity import rows (email addresses, names, handles) and say what an import would do\n * with each. Writes nothing. Merchant-wide callers only.\n */\n async previewIdentityImport(\n params: CustomerIdentityImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportPreviewResponse> {\n return this.request('POST', '/customers/identity-history/import/preview', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Record identity import rows in the customers' identity history, apart from their current\n * details. Idempotent per `idempotency_key`; the same key with different rows is refused (400, `IR_38`).\n * A transient failure is retried with the unchanged key when client retries are enabled.\n */\n async importIdentityHistory(\n params: CustomerIdentityImportRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('POST', '/customers/identity-history/import', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /** Read an identity import back: its rows and the history entries they map to. */\n async retrieveIdentityImport(\n runId: string,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('GET', `/customers/identity-history/import/${encodeURIComponent(runId)}`, {\n ...options,\n });\n }\n\n /** The identity history of up to 1,000 customers. */\n async listIdentityHistory(\n params: CustomerIdentityHistoryRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/list', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Search the merchant's identity history for email addresses, names and handles containing a\n * text of at least three characters. The text travels in the body, never in the URL.\n */\n async searchIdentityHistory(\n params: CustomerIdentityHistorySearchRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/search', {\n body: params,\n ...options,\n });\n }\n\n /** Issue a shop-scoped buyer portal link for this customer. */\n async createPortalLink(\n customerId: string,\n params: BuyerInvoiceLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerInvoiceLink> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n body: params,\n ...options,\n });\n }\n\n /** List issued grants without disclosing their secret URLs. */\n async listPortalLinks(\n customerId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalLinkPage> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async revokePortalLink(\n customerId: string,\n linkId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,\n { ...options },\n );\n }\n\n /**\n * Create a new customer.\n *\n * @param params - Customer creation parameters (name, email, phone, address, etc.).\n * @returns The created customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.create({\n * email: 'alice@example.com',\n * name: 'Alice Smith',\n * });\n * ```\n */\n async create(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers', { body: params });\n }\n\n /**\n * Retrieve a customer by their ID.\n *\n * @param customerId - The unique customer ID.\n * @returns The customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.retrieve('cus_abc123');\n * ```\n */\n async retrieve(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Place an existing customer in a shop of the merchant, so the shop's API keys and team members\n * find the customer before any payment. The customer keeps the shops they already belong to;\n * placing one already in the shop changes nothing (`already_in_shop`). Needs a merchant-wide key:\n * a key bound to one shop is refused. An unknown customer answers `CustomerNotFound` (404).\n * `POST /customers/{customer_id}/shops`\n *\n * @param customerId - The customer to place.\n * @param profileId - The shop. It must belong to the merchant.\n */\n async placeInShop(\n customerId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<CustomerShopPlacementResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/shops`, {\n body: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Place up to 500 existing customers in one shop of the merchant, for example after an import.\n * The answer lists every distinct customer in request order with what happened: `placed`,\n * `already_in_shop` or `not_found`. Needs a merchant-wide key. `POST /customers/shops/place`\n */\n async placeManyInShop(\n params: CustomerShopBulkPlacementRequest,\n options?: RequestExtras,\n ): Promise<CustomerShopBulkPlacementResponse> {\n return this.request('POST', '/customers/shops/place', { body: params, ...options });\n }\n\n /**\n * Update an existing customer's details.\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update (name, email, address, metadata, etc.).\n * @returns The updated customer.\n */\n async update(\n customerId: string,\n params: CustomerUpdateRequest,\n options?: RequestExtras,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a customer and all their saved payment methods.\n *\n * @param customerId - The customer ID to delete.\n * @returns The deleted customer object.\n */\n async delete(customerId: string): Promise<CustomerResponse> {\n return this.request('DELETE', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * List customers, optionally filtered by customer id/name/email prefix,\n * shop (`profile_id`), or project (`project_id`).\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n *\n * @example\n * ```typescript\n * // Customers who have transacted in a specific shop.\n * const customers = await delopay.customers.list({ profile_id: 'pro_abc123' });\n *\n * // Several shops at once (unions with profile_id / project_id).\n * const many = await delopay.customers.list({\n * profile_ids: ['pro_abc123', 'pro_def456'],\n * });\n * ```\n */\n async list(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/list', {\n query: toQuery(params),\n });\n }\n\n // --- OLAP extensions (Task 4.6) ---\n\n /**\n * List customers with count. Supports the same `profile_id` / `project_id`\n * shop filters as {@link list}. `GET /customers/list-with-count`\n */\n async listWithCount(params?: CustomerListWithCountParams): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * List customers scoped to the authenticated dashboard user's shop\n * (business profile). The JWT auto-scopes to its own `profile`; an explicit\n * `profile_id` / `project_id` outside that scope is rejected with\n * `AccessForbidden`. `GET /customers/profile/list`\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n */\n async listByProfile(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/profile/list', {\n query: toQuery(params),\n });\n }\n\n /**\n * Profile-scoped variant of {@link listWithCount}.\n * `GET /customers/profile/list-with-count`\n */\n async listByProfileWithCount(\n params?: CustomerListWithCountParams,\n ): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/profile/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * Retrieve one customer, scoped to the authenticated dashboard user's shop\n * (business profile). The shop-scoped counterpart of {@link retrieve}, and\n * what makes a shop's own customer list clickable: the list is\n * `ProfileCustomerRead` while {@link retrieve} is merchant-level, so a shop\n * member could see a customer they could not open.\n *\n * A customer belonging to a sibling shop answers `CustomerNotFound` — the\n * same answer as a customer that does not exist, deliberately, so one shop\n * cannot enumerate another's customer ids.\n *\n * `GET /customers/profile/{customerId}`\n *\n * @param customerId - The unique customer ID.\n * @returns The customer, with `profile_ids` narrowed to the caller's own shop.\n */\n async retrieveByProfile(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Create a customer from a shop, recording that it belongs to that shop so\n * the shop can see the customer it just created. The shop is taken from the\n * credential; a caller-chosen `customer_id` is rejected.\n *\n * `POST /customers/profile`\n *\n * @param params - The customer to create.\n * @returns The created customer.\n */\n async createByProfile(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers/profile', { body: params });\n }\n\n /**\n * Update a customer from a shop, if the customer belongs to that shop.\n * A sibling shop's customer answers `CustomerNotFound`, as with\n * {@link retrieveByProfile}.\n *\n * `POST /customers/profile/{customerId}`\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update.\n * @returns The updated customer.\n */\n async updateByProfile(\n customerId: string,\n params: CustomerUpdateRequest,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/profile/${encodeURIComponent(customerId)}`, {\n body: params,\n });\n }\n\n /** List mandates for a customer. `GET /customers/{customerId}/mandates` */\n async listMandates(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/mandates`);\n }\n\n /**\n * List one customer's mandates, scoped to the caller's shop. Same membership\n * rule as {@link retrieveByProfile}: a sibling shop's customer answers\n * `CustomerNotFound` before any mandate is read.\n *\n * `GET /customers/profile/{customerId}/mandates`\n */\n async listMandatesByProfile(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}/mandates`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-OWP7XBY2.cjs","../src/resources/customers.ts"],"names":[],"mappings":"AAAA;ACiCA,SAAS,OAAA,CACP,MAAA,EACmE;AACnE,EAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,OAAO,KAAA,CAAA;AACpB,EAAA,MAAM,EAAE,WAAA,EAAa,GAAG,KAAK,EAAA,EAAI,MAAA;AACjC,EAAA,MAAM,MAAA,EAAQ,IAAA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A;AAQiC,EAAA;AACkC,IAAA;AAC1C,MAAA;AACtB,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBuE,EAAA;AACY,IAAA;AACnF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYgF,EAAA;AACZ,IAAA;AACpE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgB6B,EAAA;AACyD,IAAA;AAC5E,MAAA;AACP,IAAA;AACH,EAAA;AAAA;AAG2E,EAAA;AACS,IAAA;AACpF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASoF,EAAA;AACQ,IAAA;AAC5F,EAAA;AACF;ADtG+F;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-OWP7XBY2.cjs","sourcesContent":[null,"import type {\n BuyerInvoiceLink,\n BuyerInvoiceLinkRequest,\n BuyerPortalLinkPage,\n BuyerPortalPageQuery,\n CustomerCreateRequest,\n CustomerIdentityHistoryRequest,\n CustomerIdentityHistoryResponse,\n CustomerIdentityHistorySearchRequest,\n CustomerIdentityImportPreviewRequest,\n CustomerIdentityImportPreviewResponse,\n CustomerIdentityImportRequest,\n CustomerIdentityImportResponse,\n CustomerResponse,\n CustomerShopBulkPlacementRequest,\n CustomerShopBulkPlacementResponse,\n CustomerShopPlacementResponse,\n CustomerUpdateRequest,\n CustomerListParams,\n CustomerListResponse,\n CustomerListWithCountParams,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/**\n * Flatten list params for the query string.\n *\n * `profile_ids` must go out as ONE comma-separated value. The client\n * serializes arrays as repeated keys (`?profile_ids=a&profile_ids=b`), and the\n * customers endpoints cannot parse that — the whole request fails, rather than\n * the second id being ignored. So the join happens here, once, instead of at\n * four call sites.\n */\nfunction toQuery(\n params?: CustomerListParams,\n): Record<string, string | number | boolean | undefined> | undefined {\n if (!params) return undefined;\n const { profile_ids, ...rest } = params;\n const query = rest as Record<string, string | number | boolean | undefined>;\n // An empty array means \"no shop filter\", which is the absent key — sending\n // `profile_ids=` would work too, but omitting it keeps the URL honest.\n if (profile_ids && profile_ids.length > 0) {\n query.profile_ids = profile_ids.join(',');\n }\n return query;\n}\n\n/** Create and manage customer profiles. */\nexport class Customers {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Check identity import rows (email addresses, names, handles) and say what an import would do\n * with each. Writes nothing. Merchant-wide callers only.\n */\n async previewIdentityImport(\n params: CustomerIdentityImportPreviewRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportPreviewResponse> {\n return this.request('POST', '/customers/identity-history/import/preview', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Record identity import rows in the customers' identity history, apart from their current\n * details. Idempotent per `idempotency_key`; the same key with different rows is refused (400, `IR_38`).\n * A transient failure is retried with the unchanged key when client retries are enabled.\n */\n async importIdentityHistory(\n params: CustomerIdentityImportRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('POST', '/customers/identity-history/import', {\n body: params,\n ...options,\n bodyIdempotencyKey: params.idempotency_key,\n });\n }\n\n /** Read an identity import back: its rows and the history entries they map to. */\n async retrieveIdentityImport(\n runId: string,\n options?: RequestExtras,\n ): Promise<CustomerIdentityImportResponse> {\n return this.request('GET', `/customers/identity-history/import/${encodeURIComponent(runId)}`, {\n ...options,\n });\n }\n\n /** The identity history of up to 1,000 customers. */\n async listIdentityHistory(\n params: CustomerIdentityHistoryRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/list', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Search the merchant's identity history for email addresses, names and handles containing a\n * text of at least three characters. The text travels in the body, never in the URL.\n */\n async searchIdentityHistory(\n params: CustomerIdentityHistorySearchRequest,\n options?: RequestExtras,\n ): Promise<CustomerIdentityHistoryResponse> {\n return this.request('POST', '/customers/identity-history/search', {\n body: params,\n ...options,\n });\n }\n\n /** Issue a shop-scoped buyer portal link for this customer. */\n async createPortalLink(\n customerId: string,\n params: BuyerInvoiceLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerInvoiceLink> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n body: params,\n ...options,\n });\n }\n\n /** List issued grants without disclosing their secret URLs. */\n async listPortalLinks(\n customerId: string,\n params?: BuyerPortalPageQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalLinkPage> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/portal-links`, {\n query: params as Record<string, number | null | undefined>,\n ...options,\n });\n }\n\n async revokePortalLink(\n customerId: string,\n linkId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/customers/${encodeURIComponent(customerId)}/portal-links/${encodeURIComponent(linkId)}`,\n { ...options },\n );\n }\n\n /**\n * Create a new customer.\n *\n * @param params - Customer creation parameters (name, email, phone, address, etc.).\n * @returns The created customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.create({\n * email: 'alice@example.com',\n * name: 'Alice Smith',\n * });\n * ```\n */\n async create(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers', { body: params });\n }\n\n /**\n * Retrieve a customer by their ID.\n *\n * @param customerId - The unique customer ID.\n * @returns The customer.\n *\n * @example\n * ```typescript\n * const customer = await delopay.customers.retrieve('cus_abc123');\n * ```\n */\n async retrieve(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Place an existing customer in a shop of the merchant, so the shop's API keys and team members\n * find the customer before any payment. The customer keeps the shops they already belong to;\n * placing one already in the shop changes nothing (`already_in_shop`). Needs a merchant-wide key:\n * a key bound to one shop is refused. An unknown customer answers `CustomerNotFound` (404).\n * `POST /customers/{customer_id}/shops`\n *\n * @param customerId - The customer to place.\n * @param profileId - The shop. It must belong to the merchant.\n */\n async placeInShop(\n customerId: string,\n profileId: string,\n options?: RequestExtras,\n ): Promise<CustomerShopPlacementResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}/shops`, {\n body: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Place up to 500 existing customers in one shop of the merchant, for example after an import.\n * The answer lists every distinct customer in request order with what happened: `placed`,\n * `already_in_shop` or `not_found`. Needs a merchant-wide key. `POST /customers/shops/place`\n */\n async placeManyInShop(\n params: CustomerShopBulkPlacementRequest,\n options?: RequestExtras,\n ): Promise<CustomerShopBulkPlacementResponse> {\n return this.request('POST', '/customers/shops/place', { body: params, ...options });\n }\n\n /**\n * Update an existing customer's details.\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update (name, email, address, metadata, etc.).\n * @returns The updated customer.\n */\n async update(\n customerId: string,\n params: CustomerUpdateRequest,\n options?: RequestExtras,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/${encodeURIComponent(customerId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a customer and all their saved payment methods.\n *\n * @param customerId - The customer ID to delete.\n * @returns The deleted customer object.\n */\n async delete(customerId: string): Promise<CustomerResponse> {\n return this.request('DELETE', `/customers/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * List customers, optionally filtered by customer id/name/email prefix,\n * shop (`profile_id`), or project (`project_id`).\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n *\n * @example\n * ```typescript\n * // Customers who have transacted in a specific shop.\n * const customers = await delopay.customers.list({ profile_id: 'pro_abc123' });\n *\n * // Several shops at once (unions with profile_id / project_id).\n * const many = await delopay.customers.list({\n * profile_ids: ['pro_abc123', 'pro_def456'],\n * });\n * ```\n */\n async list(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/list', {\n query: toQuery(params),\n });\n }\n\n // --- OLAP extensions (Task 4.6) ---\n\n /**\n * List customers with count. Supports the same `profile_id` / `project_id`\n * shop filters as {@link list}. `GET /customers/list-with-count`\n */\n async listWithCount(params?: CustomerListWithCountParams): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * List customers scoped to the authenticated dashboard user's shop\n * (business profile). The JWT auto-scopes to its own `profile`; an explicit\n * `profile_id` / `project_id` outside that scope is rejected with\n * `AccessForbidden`. `GET /customers/profile/list`\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Array of customer objects.\n */\n async listByProfile(params?: CustomerListParams): Promise<CustomerResponse[]> {\n return this.request('GET', '/customers/profile/list', {\n query: toQuery(params),\n });\n }\n\n /**\n * Profile-scoped variant of {@link listWithCount}.\n * `GET /customers/profile/list-with-count`\n */\n async listByProfileWithCount(\n params?: CustomerListWithCountParams,\n ): Promise<CustomerListResponse> {\n return this.request('GET', '/customers/profile/list-with-count', {\n query: toQuery(params),\n });\n }\n\n /**\n * Retrieve one customer, scoped to the authenticated dashboard user's shop\n * (business profile). The shop-scoped counterpart of {@link retrieve}, and\n * what makes a shop's own customer list clickable: the list is\n * `ProfileCustomerRead` while {@link retrieve} is merchant-level, so a shop\n * member could see a customer they could not open.\n *\n * A customer belonging to a sibling shop answers `CustomerNotFound` — the\n * same answer as a customer that does not exist, deliberately, so one shop\n * cannot enumerate another's customer ids.\n *\n * `GET /customers/profile/{customerId}`\n *\n * @param customerId - The unique customer ID.\n * @returns The customer, with `profile_ids` narrowed to the caller's own shop.\n */\n async retrieveByProfile(customerId: string): Promise<CustomerResponse> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}`);\n }\n\n /**\n * Create a customer from a shop, recording that it belongs to that shop so\n * the shop can see the customer it just created. The shop is taken from the\n * credential; a caller-chosen `customer_id` is rejected.\n *\n * `POST /customers/profile`\n *\n * @param params - The customer to create.\n * @returns The created customer.\n */\n async createByProfile(params: CustomerCreateRequest): Promise<CustomerResponse> {\n return this.request('POST', '/customers/profile', { body: params });\n }\n\n /**\n * Update a customer from a shop, if the customer belongs to that shop.\n * A sibling shop's customer answers `CustomerNotFound`, as with\n * {@link retrieveByProfile}.\n *\n * `POST /customers/profile/{customerId}`\n *\n * @param customerId - The customer ID to update.\n * @param params - Fields to update.\n * @returns The updated customer.\n */\n async updateByProfile(\n customerId: string,\n params: CustomerUpdateRequest,\n ): Promise<CustomerResponse> {\n return this.request('POST', `/customers/profile/${encodeURIComponent(customerId)}`, {\n body: params,\n });\n }\n\n /** List mandates for a customer. `GET /customers/{customerId}/mandates` */\n async listMandates(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/${encodeURIComponent(customerId)}/mandates`);\n }\n\n /**\n * List one customer's mandates, scoped to the caller's shop. Same membership\n * rule as {@link retrieveByProfile}: a sibling shop's customer answers\n * `CustomerNotFound` before any mandate is read.\n *\n * `GET /customers/profile/{customerId}/mandates`\n */\n async listMandatesByProfile(customerId: string): Promise<Record<string, unknown>[]> {\n return this.request('GET', `/customers/profile/${encodeURIComponent(customerId)}/mandates`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-OYZP6NF6.cjs","../src/resources/regions.ts"],"names":[],"mappings":"AAAA;ACeO,IAAM,QAAA,EAAN,MAAc;AAAA,EACnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,MAAA,CAAO,SAAA,EAAmB,MAAA,EAAsD;AACpF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,UAAA,EAAY;AAAA,MACtC,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,EAAE,UAAA,EAAY,UAAU;AAAA,IACjC,CAAC,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,IAAA,CAAK,SAAA,EAA8C;AACvD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,eAAA,EAAiB,EAAE,KAAA,EAAO,EAAE,UAAA,EAAY,UAAU,EAAE,CAAC,CAAA;AAAA,EAClF;AAAA;AAAA,EAGA,MAAM,MAAA,CAAA,EAAgD;AACpD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,iBAAiB,CAAA;AAAA,EAC9C;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,QAAA,EAAkB,SAAA,EAA4C;AAC3E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,SAAA,EAAY,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAClC,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAO2B,EAAA;AAC0C,IAAA;AAC3D,MAAA;AACyB,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAGoE,EAAA;AACL,IAAA;AAC5B,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAG0F,EAAA;AACrB,IAAA;AAClC,MAAA;AAChC,IAAA;AACH,EAAA;AAAA;AAOoC,EAAA;AACiC,IAAA;AAC3D,MAAA;AACyB,MAAA;AAChC,IAAA;AACH,EAAA;AACF;AD3BwE;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-OYZP6NF6.cjs","sourcesContent":[null,"import type {\n RegionCreateRequest,\n RegionUpdateRequest,\n RegionResponse,\n RegionSetCountriesRequest,\n RegionCountriesResponse,\n BuiltInRegionGroupResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\n/**\n * Custom regions (named country groups) scoped to a shop/profile, used by the\n * geo-aware payment-method availability overrides. Every endpoint is scoped by\n * `profileId`. Admin (`sk_*`) access required.\n */\nexport class Regions {\n constructor(private readonly request: RequestFn) {}\n\n /** Create a region. `POST /regions?profile_id=` */\n async create(profileId: string, params: RegionCreateRequest): Promise<RegionResponse> {\n return this.request('POST', '/regions', {\n body: params,\n query: { profile_id: profileId },\n });\n }\n\n /** List all regions for a profile. `GET /regions/list?profile_id=` */\n async list(profileId: string): Promise<RegionResponse[]> {\n return this.request('GET', '/regions/list', { query: { profile_id: profileId } });\n }\n\n /** List the built-in (global) region groups (EU/EEA/SEPA/LATAM/APAC). `GET /regions/groups` */\n async groups(): Promise<BuiltInRegionGroupResponse[]> {\n return this.request('GET', '/regions/groups');\n }\n\n /** Retrieve a region by id. `GET /regions/{regionId}?profile_id=` */\n async retrieve(regionId: string, profileId: string): Promise<RegionResponse> {\n return this.request('GET', `/regions/${encodeURIComponent(regionId)}`, {\n query: { profile_id: profileId },\n });\n }\n\n /** Update a region. `PUT /regions/{regionId}?profile_id=` */\n async update(\n regionId: string,\n profileId: string,\n params: RegionUpdateRequest,\n ): Promise<RegionResponse> {\n return this.request('PUT', `/regions/${encodeURIComponent(regionId)}`, {\n body: params,\n query: { profile_id: profileId },\n });\n }\n\n /** Delete a region. `DELETE /regions/{regionId}?profile_id=` */\n async delete(regionId: string, profileId: string): Promise<boolean> {\n return this.request('DELETE', `/regions/${encodeURIComponent(regionId)}`, {\n query: { profile_id: profileId },\n });\n }\n\n /** Get the countries that belong to a region. `GET /regions/{regionId}/countries?profile_id=` */\n async getCountries(regionId: string, profileId: string): Promise<RegionCountriesResponse> {\n return this.request('GET', `/regions/${encodeURIComponent(regionId)}/countries`, {\n query: { profile_id: profileId },\n });\n }\n\n /** Replace the full country membership of a region. `PUT /regions/{regionId}/countries?profile_id=` */\n async setCountries(\n regionId: string,\n profileId: string,\n params: RegionSetCountriesRequest,\n ): Promise<RegionCountriesResponse> {\n return this.request('PUT', `/regions/${encodeURIComponent(regionId)}/countries`, {\n body: params,\n query: { profile_id: profileId },\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/_worktrees/ts-publish-w3/dist/chunk-P6JLNQ6L.cjs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ams,\n ExportEnvelope,\n BinaryExportOptions,\n CsvExportOptions,\n DynamicLineExportOptions,\n ExportOptions,\n JsonExportOptions,\n MerchantAuditLogExportRecord,\n MerchantAuditLogListParams,\n PayoutExportRecord,\n PayoutListParams,\n RefundExportRecord,\n RefundListParams,\n PaymentListFilterConstraints,\n ProfilePaymentListFilterConstraints,\n SubscriptionExportRecord,\n SubscriptionListParams,\n TransactionExportRecord,\n TransactionLineExportRecord,\n VatReportParams,\n VatReportRecord,\n} from '../types';\nimport type { RequestFn, RequestOptions } from '../client';\nimport { runExport } from '../exportDownload';\nimport { csvQuery } from '../listQuery';\n\n/** Query value shape `RequestOptions.query` accepts. */\ntype Query = NonNullable<RequestOptions['query']>;\n\n/**\n * Emit a list as a file.\n *\n * Every method here mirrors one list endpoint and takes **that list's own\n * filters**, unchanged — there is no second filter vocabulary for exports. The\n * shop scope is resolved the same way too, so an export cannot show a shop its\n * list would not: a shop-scoped token exports its own shop, and naming another\n * is refused rather than ignored.\n *\n * Every export is **one read**, not a paged walk, and is bounded at 25,000\n * rows (500 for `pdf`, which is a document rather than a data feed). Over the\n * bound the request is refused with `DE_07 export_row_limit_exceeded` carrying\n * `{entity, max_rows}` — a truncated finance file that reports success is the\n * thing these endpoints exist not to produce. When too many exports are\n * already running the server answers `429` `IR_52` (`export_capacity_busy`);\n * a `GET` export is retried after its `Retry-After` like any other `429`.\n *\n * `csv` and `json` are **streamed**: the server counts the match set, sends\n * that count in `X-Delopay-Record-Count` before the first byte, and writes the\n * rows as it reads them. Each method holds the finished body to that count and\n * rejects with `EXPORT_INCOMPLETE` rather than resolve to a file missing rows —\n * see {@link ExportTransferOptions}, which also carries the download's\n * `onProgress`, `signal` and (idle) `timeout`. `pdf` stays a buffered body.\n *\n * `format` selects an `Accept` header, never a request field: an export reuses\n * its list's filter model as literally the same type, and several of those are\n * `deny_unknown_fields`, so a `format` key would be a 400. It defaults to\n * `json`, which resolves to a typed {@link ExportEnvelope}; `csv` and `pdf`\n * resolve to a `Blob`.\n */\nexport class Export {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transactions. `POST /export/transactions`\n *\n * The payments `payments.listByFilter` would list for the same body, over the\n * whole match set: same filters, same order, same scope. `limit` and\n * `offset` are ignored — the page is what an export does away with. No time\n * window is required; the row bound refuses an export that matches too much.\n */\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/export/transactions', { body: params ?? {} }, options);\n }\n\n /**\n * The caller's own shop's transactions.\n * `POST /export/profile/transactions`\n *\n * The shop-scoped twin of {@link Export.transactions}, taking the body\n * `payments.listByProfileFilter` sends and scoped exactly as that list is: to\n * the shop on the token. Gated on the profile-level payment permission, which\n * a shop-scoped role can hold where the merchant-level one cannot. Its rows\n * carry no `connector_settlement_status`, which a shop viewer is not shown.\n */\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * Transactions, one row per product line. `POST /export/transactions/lines`\n *\n * The payments {@link Export.transactions} would export for the same body,\n * one row per product line they recorded, plus one `row_kind: 'no_lines'`\n * row for each payment that recorded none — see\n * {@link TransactionLineExportRecord} for how the file reconciles with the\n * per-payment one. `csv` or `json` only: a line export has no PDF form, and\n * the server refuses one with `422`. The row bound applies to the rows.\n */\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * The caller's own shop's transactions, one row per product line.\n * `POST /export/profile/transactions/lines`\n *\n * The shop-scoped twin of {@link Export.transactionLines}, scoped as\n * {@link Export.transactionsForProfile} is: to the shop on the token.\n */\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Refunds. `POST /refunds/list/export` */\n async refunds(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refunds(params: RefundListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async refunds(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refunds(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/refunds/list/export', { body: params ?? {} }, options);\n }\n\n /** The caller's own shop's refunds. `POST /refunds/profile/list/export` */\n async refundsForProfile(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refundsForProfile(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/refunds/profile/list/export',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Disputes. `GET /disputes/list/export` */\n async disputes(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputes(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputes(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputes(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(this.request, 'GET', '/disputes/list/export', queried(params), options);\n }\n\n /** The caller's own shop's disputes. `GET /disputes/profile/list/export` */\n async disputesForProfile(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputesForProfile(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/disputes/profile/list/export',\n queried(params),\n options,\n );\n }\n\n /** Payouts. `POST /payouts/list/export` */\n async payouts(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payouts(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payouts(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payouts(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/payouts/list/export', { body: params }, options);\n }\n\n /** The caller's own shop's payouts. `POST /payouts/profile/list/export` */\n async payoutsForProfile(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payoutsForProfile(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/payouts/profile/list/export',\n { body: params },\n options,\n );\n }\n\n /**\n * Subscriptions. `GET /subscriptions/list/export`\n *\n * `profileId` becomes the `X-Profile-Id` header, exactly as on the list. A\n * shop-scoped token exports its own shop whatever this says.\n */\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord>>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob>;\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/subscriptions/list/export',\n queried(params, { 'X-Profile-Id': profileId }),\n options,\n );\n }\n\n /**\n * The one-stop-shop VAT report of a quarter. `GET /export/vat-report`\n *\n * The quarter's sales and VAT per country, rate, reverse-charge mark and\n * currency, for the one-stop-shop return. It is built from the VAT DeloPay\n * determined and recorded on each payment; a payment without one is not in\n * it. The quarter's refunds and lost disputes reduce it by their share of\n * the payment's VAT, in the quarter they happened. Sales a provider made as\n * seller of record are left out: the provider taxed and declares them. See\n * {@link VatReportRecord}.\n *\n * `csv` or `json` only. The server answers `422` `IR_06` for an invalid year\n * or quarter, for `pdf`, and, rather than return the report incomplete,\n * when the quarter holds more than 100,000 payments or returns (ask for one\n * shop at a time). It answers `400` `IR_16` when a payment's recorded VAT\n * does not add up. A role that may see only some processors or payments is\n * refused with `403`.\n */\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReport(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReport(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/vat-report', queried(params), options);\n }\n\n /**\n * The caller's own shop's VAT report of a quarter.\n * `GET /export/profile/vat-report`\n *\n * The shop-scoped twin of {@link Export.vatReport}, gated on the\n * profile-level payment permission and confined to the shop on the token;\n * `profile_id` is ignored.\n */\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReportForProfile(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/profile/vat-report', queried(params), options);\n }\n\n /** Settlement statements. `GET /settlement/statements/export` */\n\n /** One period's settlement lines. `GET /settlement/lines/export` */\n\n /**\n * The merchant's own audit log. `GET /audit/export`\n *\n * Requires a dashboard JWT whose role holds the merchant-level `AuditLog`\n * permission — a shop-scoped role cannot hold it. There is no `merchant_id`\n * parameter: the scope comes from the token.\n */\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord>>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob>;\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/audit/export',\n { query: csvQuery(params, ['profile_id', 'action', 'entity_type']) },\n options,\n );\n }\n}\n\n/** Request options for an export whose filters travel in the query. */\nfunction queried(params: unknown, headers?: Record<string, string>): RequestOptions {\n return { query: (params ?? {}) as Query, ...(headers ? { headers } : {}) };\n}\n"]}
|
|
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/dist/chunk-P6JLNQ6L.cjs","sourcesContent":[null,"import type {\n DisputeExportRecord,\n DisputeListParams,\n ExportEnvelope,\n BinaryExportOptions,\n CsvExportOptions,\n DynamicLineExportOptions,\n ExportOptions,\n JsonExportOptions,\n MerchantAuditLogExportRecord,\n MerchantAuditLogListParams,\n PayoutExportRecord,\n PayoutListParams,\n RefundExportRecord,\n RefundListParams,\n PaymentListFilterConstraints,\n ProfilePaymentListFilterConstraints,\n SubscriptionExportRecord,\n SubscriptionListParams,\n TransactionExportRecord,\n TransactionLineExportRecord,\n VatReportParams,\n VatReportRecord,\n} from '../types';\nimport type { RequestFn, RequestOptions } from '../client';\nimport { runExport } from '../exportDownload';\nimport { csvQuery } from '../listQuery';\n\n/** Query value shape `RequestOptions.query` accepts. */\ntype Query = NonNullable<RequestOptions['query']>;\n\n/**\n * Emit a list as a file.\n *\n * Every method here mirrors one list endpoint and takes **that list's own\n * filters**, unchanged — there is no second filter vocabulary for exports. The\n * shop scope is resolved the same way too, so an export cannot show a shop its\n * list would not: a shop-scoped token exports its own shop, and naming another\n * is refused rather than ignored.\n *\n * Every export is **one read**, not a paged walk, and is bounded at 25,000\n * rows (500 for `pdf`, which is a document rather than a data feed). Over the\n * bound the request is refused with `DE_07 export_row_limit_exceeded` carrying\n * `{entity, max_rows}` — a truncated finance file that reports success is the\n * thing these endpoints exist not to produce. When too many exports are\n * already running the server answers `429` `IR_52` (`export_capacity_busy`);\n * a `GET` export is retried after its `Retry-After` like any other `429`.\n *\n * `csv` and `json` are **streamed**: the server counts the match set, sends\n * that count in `X-Delopay-Record-Count` before the first byte, and writes the\n * rows as it reads them. Each method holds the finished body to that count and\n * rejects with `EXPORT_INCOMPLETE` rather than resolve to a file missing rows —\n * see {@link ExportTransferOptions}, which also carries the download's\n * `onProgress`, `signal` and (idle) `timeout`. `pdf` stays a buffered body.\n *\n * `format` selects an `Accept` header, never a request field: an export reuses\n * its list's filter model as literally the same type, and several of those are\n * `deny_unknown_fields`, so a `format` key would be a 400. It defaults to\n * `json`, which resolves to a typed {@link ExportEnvelope}; `csv` and `pdf`\n * resolve to a `Blob`.\n */\nexport class Export {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Transactions. `POST /export/transactions`\n *\n * The payments `payments.listByFilter` would list for the same body, over the\n * whole match set: same filters, same order, same scope. `limit` and\n * `offset` are ignored — the page is what an export does away with. No time\n * window is required; the row bound refuses an export that matches too much.\n */\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactions(\n params: PaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactions(\n params?: PaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/export/transactions', { body: params ?? {} }, options);\n }\n\n /**\n * The caller's own shop's transactions.\n * `POST /export/profile/transactions`\n *\n * The shop-scoped twin of {@link Export.transactions}, taking the body\n * `payments.listByProfileFilter` sends and scoped exactly as that list is: to\n * the shop on the token. Gated on the profile-level payment permission, which\n * a shop-scoped role can hold where the merchant-level one cannot. Its rows\n * carry no `connector_settlement_status`, which a shop viewer is not shown.\n */\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord>>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async transactionsForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob>;\n async transactionsForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<TransactionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * Transactions, one row per product line. `POST /export/transactions/lines`\n *\n * The payments {@link Export.transactions} would export for the same body,\n * one row per product line they recorded, plus one `row_kind: 'no_lines'`\n * row for each payment that recorded none — see\n * {@link TransactionLineExportRecord} for how the file reconciles with the\n * per-payment one. `csv` or `json` only: a line export has no PDF form, and\n * the server refuses one with `422`. The row bound applies to the rows.\n */\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLines(\n params: PaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLines(\n params?: PaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /**\n * The caller's own shop's transactions, one row per product line.\n * `POST /export/profile/transactions/lines`\n *\n * The shop-scoped twin of {@link Export.transactionLines}, scoped as\n * {@link Export.transactionsForProfile} is: to the shop on the token.\n */\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord>>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: CsvExportOptions,\n ): Promise<Blob>;\n async transactionLinesForProfile(\n params: ProfilePaymentListFilterConstraints | undefined,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob>;\n async transactionLinesForProfile(\n params?: ProfilePaymentListFilterConstraints,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<TransactionLineExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/export/profile/transactions/lines',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Refunds. `POST /refunds/list/export` */\n async refunds(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refunds(params: RefundListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async refunds(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refunds(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/refunds/list/export', { body: params ?? {} }, options);\n }\n\n /** The caller's own shop's refunds. `POST /refunds/profile/list/export` */\n async refundsForProfile(\n params?: RefundListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord>>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async refundsForProfile(\n params: RefundListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob>;\n async refundsForProfile(\n params?: RefundListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<RefundExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/refunds/profile/list/export',\n { body: params ?? {} },\n options,\n );\n }\n\n /** Disputes. `GET /disputes/list/export` */\n async disputes(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputes(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputes(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputes(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(this.request, 'GET', '/disputes/list/export', queried(params), options);\n }\n\n /** The caller's own shop's disputes. `GET /disputes/profile/list/export` */\n async disputesForProfile(\n params?: DisputeListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord>>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async disputesForProfile(\n params: DisputeListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob>;\n async disputesForProfile(\n params?: DisputeListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<DisputeExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/disputes/profile/list/export',\n queried(params),\n options,\n );\n }\n\n /** Payouts. `POST /payouts/list/export` */\n async payouts(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payouts(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payouts(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payouts(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(this.request, 'POST', '/payouts/list/export', { body: params }, options);\n }\n\n /** The caller's own shop's payouts. `POST /payouts/profile/list/export` */\n async payoutsForProfile(\n params: PayoutListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord>>;\n async payoutsForProfile(params: PayoutListParams, options: BinaryExportOptions): Promise<Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob>;\n async payoutsForProfile(\n params: PayoutListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<PayoutExportRecord> | Blob> {\n return runExport(\n this.request,\n 'POST',\n '/payouts/profile/list/export',\n { body: params },\n options,\n );\n }\n\n /**\n * Subscriptions. `GET /subscriptions/list/export`\n *\n * `profileId` becomes the `X-Profile-Id` header, exactly as on the list. A\n * shop-scoped token exports its own shop whatever this says.\n */\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord>>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async subscriptions(\n profileId: string,\n params: SubscriptionListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob>;\n async subscriptions(\n profileId: string,\n params?: SubscriptionListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<SubscriptionExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/subscriptions/list/export',\n queried(params, { 'X-Profile-Id': profileId }),\n options,\n );\n }\n\n /**\n * The one-stop-shop VAT report of a quarter. `GET /export/vat-report`\n *\n * The quarter's sales and VAT per country, rate, reverse-charge mark and\n * currency, for the one-stop-shop return. It is built from the VAT DeloPay\n * determined and recorded on each payment; a payment without one is not in\n * it. The quarter's refunds and lost disputes reduce it by their share of\n * the payment's VAT, in the quarter they happened. Sales a provider made as\n * seller of record are left out: the provider taxed and declares them. See\n * {@link VatReportRecord}.\n *\n * `csv` or `json` only. The server answers `422` `IR_06` for an invalid year\n * or quarter, for `pdf`, and, rather than return the report incomplete,\n * when the quarter holds more than 100,000 payments or returns (ask for one\n * shop at a time). It answers `400` `IR_16` when a payment's recorded VAT\n * does not add up. A role that may see only some processors or payments is\n * refused with `403`.\n */\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReport(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReport(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReport(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/vat-report', queried(params), options);\n }\n\n /**\n * The caller's own shop's VAT report of a quarter.\n * `GET /export/profile/vat-report`\n *\n * The shop-scoped twin of {@link Export.vatReport}, gated on the\n * profile-level payment permission and confined to the shop on the token;\n * `profile_id` is ignored.\n */\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord>>;\n async vatReportForProfile(params: VatReportParams, options: CsvExportOptions): Promise<Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options: DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob>;\n async vatReportForProfile(\n params: VatReportParams,\n options?: JsonExportOptions | CsvExportOptions | DynamicLineExportOptions,\n ): Promise<ExportEnvelope<VatReportRecord> | Blob> {\n return runExport(this.request, 'GET', '/export/profile/vat-report', queried(params), options);\n }\n\n /** Settlement statements. `GET /settlement/statements/export` */\n\n /** One period's settlement lines. `GET /settlement/lines/export` */\n\n /**\n * The merchant's own audit log. `GET /audit/export`\n *\n * Requires a dashboard JWT whose role holds the merchant-level `AuditLog`\n * permission — a shop-scoped role cannot hold it. There is no `merchant_id`\n * parameter: the scope comes from the token.\n */\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord>>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: BinaryExportOptions,\n ): Promise<Blob>;\n async auditLog(\n params: MerchantAuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob>;\n async auditLog(\n params?: MerchantAuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<MerchantAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/audit/export',\n { query: csvQuery(params, ['profile_id', 'action', 'entity_type']) },\n options,\n );\n }\n}\n\n/** Request options for an export whose filters travel in the query. */\nfunction queried(params: unknown, headers?: Record<string, string>): RequestOptions {\n return { query: (params ?? {}) as Query, ...(headers ? { headers } : {}) };\n}\n"]}
|