@delopay/sdk 0.413.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.map +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-44QBWVRS.cjs.map +1 -1
- package/dist/chunk-4EKAWNYI.cjs.map +1 -1
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-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-Y6W2EJ2R.cjs → chunk-A3DALTDS.cjs} +54 -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-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-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/chunk-ODPNVNYE.cjs.map +1 -1
- package/dist/chunk-OG2KJAYD.cjs.map +1 -1
- package/dist/chunk-OWP7XBY2.cjs.map +1 -1
- package/dist/chunk-OYZP6NF6.cjs.map +1 -1
- package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.cjs.map +1 -1
- package/dist/chunk-PWDY5D5S.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QMLU5DST.cjs.map +1 -1
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QT3HUTWI.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4FE6K43.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-RSVLVW4L.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/chunk-SQELICSX.cjs.map +1 -1
- package/dist/chunk-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/{chunk-T326ZWR3.js → chunk-VCIPI4R2.js} +54 -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-XAUPBK6A.cjs.map +1 -1
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/chunk-YJQPKT6W.cjs.map +1 -1
- package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
- package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
- package/dist/chunk-ZOD4J4XF.cjs.map +1 -1
- package/dist/client.cjs.map +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.map +1 -1
- 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 +33 -6
- package/dist/internal/resources/adminPortal.d.ts +33 -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.map +1 -1
- package/dist/internal/resources/auditLogs.d.cts +1 -1
- package/dist/internal/resources/auditLogs.d.ts +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.d.cts +1 -1
- package/dist/internal/resources/cardIssuers.d.ts +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.d.cts +1 -1
- package/dist/internal/resources/diagnostic.d.ts +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/gsm.d.cts +1 -1
- package/dist/internal/resources/gsm.d.ts +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.d.cts +1 -1
- package/dist/internal/resources/nativeRenewals.d.ts +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.d.cts +1 -1
- package/dist/internal/resources/platformBilling.d.ts +1 -1
- package/dist/internal/resources/platformFees.cjs.map +1 -1
- package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.cjs.map +1 -1
- package/dist/internal.cjs +3 -3
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs.map +1 -1
- package/dist/paymentPresentation.cjs.map +1 -1
- package/dist/recordCounter.cjs.map +1 -1
- package/dist/resources/analytics.cjs.map +1 -1
- package/dist/resources/analyticsDashboard.cjs.map +1 -1
- package/dist/resources/apiKeys.cjs.map +1 -1
- package/dist/resources/audit.cjs.map +1 -1
- package/dist/resources/authentication.cjs.map +1 -1
- package/dist/resources/availabilityOverrides.cjs.map +1 -1
- package/dist/resources/billing.cjs.map +1 -1
- package/dist/resources/buyerAccount.cjs.map +1 -1
- package/dist/resources/buyerBlocklist.cjs.map +1 -1
- package/dist/resources/buyerConversations.cjs.map +1 -1
- package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
- package/dist/resources/buyerPortal.cjs.map +1 -1
- package/dist/resources/cards.cjs.map +1 -1
- package/dist/resources/chargebackPrevention.cjs.map +1 -1
- package/dist/resources/checkoutMethods.cjs.map +1 -1
- package/dist/resources/checkoutRecovery.cjs.map +1 -1
- package/dist/resources/checkoutTemplates.cjs.map +1 -1
- package/dist/resources/connectors.cjs.map +1 -1
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/operationLimits.cjs.map +1 -1
- package/dist/resources/paymentLinks.cjs.map +1 -1
- package/dist/resources/paymentMethods.cjs.map +1 -1
- package/dist/resources/payments.cjs.map +1 -1
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payouts.cjs.map +1 -1
- package/dist/resources/paypalDisputes.cjs.map +1 -1
- package/dist/resources/persons.cjs.map +1 -1
- package/dist/resources/poll.cjs.map +1 -1
- package/dist/resources/processorCosts.cjs.map +1 -1
- package/dist/resources/processorImports.cjs.map +1 -1
- package/dist/resources/products.cjs.map +1 -1
- package/dist/resources/profileAcquirers.cjs.map +1 -1
- package/dist/resources/profiles.cjs.map +1 -1
- package/dist/resources/projects.cjs.map +1 -1
- package/dist/resources/refunds.cjs.map +1 -1
- package/dist/resources/regions.cjs.map +1 -1
- package/dist/resources/relay.cjs.map +1 -1
- package/dist/resources/risk.cjs.map +1 -1
- package/dist/resources/routing.cjs.map +1 -1
- package/dist/resources/search.cjs.map +1 -1
- package/dist/resources/sellToRestrictions.cjs.map +1 -1
- package/dist/resources/settings.cjs.map +1 -1
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/shopLabels.cjs.map +1 -1
- package/dist/resources/shops.cjs.map +1 -1
- package/dist/resources/stripeConnect.cjs.map +1 -1
- package/dist/resources/subscriptions.cjs.map +1 -1
- package/dist/resources/support.cjs.map +1 -1
- package/dist/resources/threeDsRules.cjs.map +1 -1
- package/dist/resources/users.cjs.map +1 -1
- package/dist/resources/vatRates.cjs.map +1 -1
- package/dist/resources/verification.cjs.map +1 -1
- package/dist/resources/webhooks.cjs.map +1 -1
- package/dist/resources/whopResolutionCases.cjs.map +1 -1
- package/dist/{types-CZib7kHm.d.ts → types-D6FnCYfT.d.cts} +240 -3
- package/dist/{types-By5GGlvR.d.cts → types-DfdwbAWM.d.ts} +240 -3
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +21 -0
- package/dist/types.d.ts +21 -0
- package/package.json +1 -1
- package/dist/chunk-T326ZWR3.js.map +0 -1
- package/dist/chunk-Y6W2EJ2R.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/delopay-sdk-publish/dist/chunk-FQRC4NJG.cjs","../src/resources/invoices.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACcA,IAAM,iBAAA,EAAmB,CAAC,QAAA,EAAU,MAAM,CAAA;AA4BnC,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,WAAA,EAAa,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,MAAA,EAA2B,OAAA,EAA+C;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,WAAA,EAAa;AAAA,MACtC,KAAA,EAAO,wCAAA,MAAS,EAAQ,gBAAgB,CAAA;AAAA,MACxC,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AAAA;AA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AAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYoC,EAAA;AACoC,IAAA;AAC9D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOwE,EAAA;AACR,IAAA;AAChE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS6F,EAAA;AACrB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaoC,EAAA;AACoC,IAAA;AAC9D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWoC,EAAA;AACoC,IAAA;AAC9D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO6E,EAAA;AACN,IAAA;AACrD,MAAA;AACX,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ6F,EAAA;AACrB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB2F,EAAA;AACnB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOgG,EAAA;AACzB,IAAA;AAChE,MAAA;AACJ,IAAA;AACH,EAAA;AACF;AD3E0E;AACA;AACA;AACA","file":"/tmp/delopay-sdk-publish/dist/chunk-FQRC4NJG.cjs","sourcesContent":[null,"import type {\n CreateCreditNoteRequest,\n CreateInvoiceRequest,\n InvoiceEmailDelivery,\n InvoiceEmailDeliveryList,\n InvoiceExportParams,\n InvoiceList,\n InvoiceListQuery,\n InvoicePageQuery,\n InvoiceShareLink,\n MerchantInvoiceDocument,\n UpdateInvoiceRequest,\n VoidInvoiceRequest,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** The invoice list filters that take several values. */\nconst INVOICE_CSV_KEYS = ['status', 'kind'] as const;\n\n/**\n * The invoices and credit notes a merchant issues to their buyers.\n *\n * DeloPay renders and stores each document **in the merchant's name**. The\n * seller block comes from the invoice settings (see `invoiceSettings`) and\n * every amount from the source — a paid payment or a paid subscription cycle —\n * so no method here takes a seller, an amount or a quantity, except the\n * optional partial amounts of a credit note, which the API caps at what the\n * line has left.\n *\n * A document is `draft` → `issued` → `voided`. A draft is unnumbered and\n * editable, and deleting it leaves no gap; `finalize` numbers it, freezes it\n * and stores its PDF; an issued document is corrected with a credit note, or\n * voided if it never reached the buyer.\n *\n * Scope comes from the caller: a shop-scoped key or dashboard session sees\n * only its shop, and a merchant-level one narrows with `profile_id` on the\n * list filters. Reading needs the `Invoice` area's read grant; every change\n * needs its write grant.\n *\n * Refusals: `IR_16` (400) for a document in the wrong state or a source that\n * may not be invoiced, `IR_06` (422) for a finalise the document cannot pass,\n * and `DE_13` (409) for a second live invoice of one source. The first two\n * carry `error.data` as a `MerchantInvoiceRefusal`; the last as a\n * `MerchantInvoiceConflict`.\n */\nexport class Invoices {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a draft from a paid payment or subscription cycle, and with\n * `finalize: true` issue it in the same call.\n * `POST /invoices`\n *\n * Send an `Idempotency-Key` header in `options.headers` to make this safe to\n * retry: the same key and body return the document it created, in its\n * current state, even after a lost response, and a different body under the\n * same key answers 409. A retry of a `finalize: true` request whose draft\n * was committed but not finalised finalises that draft.\n */\n async create(\n params: CreateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', '/invoices', { body: params, ...options });\n }\n\n /**\n * One page of documents, newest first unless `sort_by` says otherwise. List\n * rows carry no `lines` unless `include_lines` is set, and never a `refund`\n * summary. Several `status` or `kind` values match a document in any of\n * them.\n * `GET /invoices`\n */\n async list(params?: InvoiceListQuery, options?: RequestExtras): Promise<InvoiceList> {\n return this.request('GET', '/invoices', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * One page of a payment's invoice and its credit notes, lines included. The\n * page also says whether a merchant of record sold the payment\n * (`merchant_of_record`, which `create` then refuses) and what was refunded\n * (`refunded_amount`, and `refund` on each invoice). Needs the payment read\n * grant as well.\n * `GET /payments/{payment_id}/invoices`\n */\n async listForPayment(\n paymentId: string,\n params?: InvoicePageQuery,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/invoices`, {\n query: params === undefined ? undefined : { ...params },\n ...options,\n });\n }\n\n /**\n * The documents with a line of one product; a bundle's components count,\n * flagged `included`. Takes the list filters; the product is the path's.\n * `GET /products/{product_id}/invoices`\n */\n async listForProduct(\n productId: string,\n params?: Omit<InvoiceListQuery, 'product_id'>,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/invoices`, {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * The documents of one period, with the list's filters, as CSV\n * (`text/csv; charset=utf-8`) by default. Amounts are decimal in each\n * document's currency; drafts have an empty number.\n *\n * Another file is asked for with `Accept` in `options.headers`:\n * `application/json` (the rows as `records`, with `record_count` and the\n * filters applied), `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n * (an Excel workbook) or `application/zip` (the stored PDF of every issued or\n * voided document, with the CSV as `invoices.csv`; at most 500 documents).\n * `GET /invoices/export`\n */\n async export(params: InvoiceExportParams, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', '/invoices/export', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * One document, lines included.\n * `GET /invoices/{invoice_id}`\n */\n async retrieve(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Edit a draft: its words, buyer, dates and tax treatment, never what was\n * paid. Absent fields stay; `null` clears a clearable one. A document that\n * is not a draft is refused (`not_a_draft`).\n * `PATCH /invoices/{invoice_id}`\n */\n async update(\n invoiceId: string,\n params: UpdateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('PATCH', `/invoices/${encodeURIComponent(invoiceId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a draft. A draft has no number, so nothing leaves a gap; an issued\n * document is refused (`not_a_draft`) — void or credit it instead.\n * `DELETE /invoices/{invoice_id}`\n */\n async delete(invoiceId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Issue a draft: allocate its number, freeze it and store its PDF. It is\n * immutable afterwards. A document that would be legally incomplete is\n * refused with `IR_06` and a reason (`seller_tax_id_missing`,\n * `line_tax_unexplained`, …) that says what to fix and where.\n * `POST /invoices/{invoice_id}/finalize`\n */\n async finalize(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/finalize`, {\n ...options,\n });\n }\n\n /**\n * Withdraw an issued document with a reason; its number stays used. For a\n * document that never reached the buyer — one they hold is corrected with\n * `createCreditNote`. An invoice with live credit notes is refused\n * (`has_credit_notes`).\n * `POST /invoices/{invoice_id}/void`\n */\n async void(\n invoiceId: string,\n params: VoidInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/void`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct an issued invoice with a credit note: all of what it has left, or\n * the named lines. Returns the **credit note**, not the invoice.\n * `POST /invoices/{invoice_id}/credit-note`\n */\n async createCreditNote(\n invoiceId: string,\n params: CreateCreditNoteRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/credit-note`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * The document as a PDF. An issued document is its stored copy; a draft\n * renders live under a DRAFT banner, and a voided one under a VOIDED banner.\n * `GET /invoices/{invoice_id}/pdf`\n */\n async downloadPdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * A public link to an issued document's stored PDF, valid for 7 days.\n * **Anyone holding the link can open the document**, without logging in. A\n * document that is not issued is refused (`not_issued`).\n * `POST /invoices/{invoice_id}/share-link`\n */\n async createShareLink(invoiceId: string, options?: RequestExtras): Promise<InvoiceShareLink> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/share-link`, {\n ...options,\n });\n }\n\n /**\n * Mail an issued invoice to the buyer address it carries, its PDF attached,\n * in the document's language. Each call is a new message (the next\n * `revision`) and resolves with what became of it: `sent`, or `failed` with\n * `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),\n * `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is\n * queued or being sent) and `send_limit_reached` (5 sends by hand in 24\n * hours). Shops with the `email.invoice_auto_send` setting mail every\n * invoice they issue without this call.\n *\n * The merchant's daily sending limit is **not** a refusal: the call answers\n * with the message `failed` and `error_code: 'merchant_limit_reached'`.\n * Check `status` on the result, not only that the call succeeded.\n * `POST /invoices/{invoice_id}/email`\n */\n async sendEmail(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDelivery> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/email`, {\n ...options,\n });\n }\n\n /**\n * Every message about a document to its buyer, automatic and by hand,\n * newest first, with its delivery status. The recipient is masked.\n * `GET /invoices/{invoice_id}/emails`\n */\n async listEmails(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDeliveryList> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/emails`, {\n ...options,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-FQRC4NJG.cjs","../src/resources/invoices.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACcA,IAAM,iBAAA,EAAmB,CAAC,QAAA,EAAU,MAAM,CAAA;AA4BnC,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAalD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,WAAA,EAAa,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,IAAA,CAAK,MAAA,EAA2B,OAAA,EAA+C;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,WAAA,EAAa;AAAA,MACtC,KAAA,EAAO,wCAAA,MAAS,EAAQ,gBAAgB,CAAA;AAAA,MACxC,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,cAAA,CACJ,SAAA,EACA,MAAA,EACA,OAAA,EACsB;AACtB,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,UAAA,EAAa,kBAAA,CAAmB,SAAS,CAAC,CAAA,SAAA,CAAA,EAAa;AAAA,MAChF,KAAA,EAAO,OAAA,IAAW,KAAA,EAAA,EAAY,KAAA,EAAA,EAAY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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaoC,EAAA;AACoC,IAAA;AAC9D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWoC,EAAA;AACoC,IAAA;AAC9D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO6E,EAAA;AACN,IAAA;AACrD,MAAA;AACX,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ6F,EAAA;AACrB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB2F,EAAA;AACnB,IAAA;AACjE,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOgG,EAAA;AACzB,IAAA;AAChE,MAAA;AACJ,IAAA;AACH,EAAA;AACF;AD3E0E;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-FQRC4NJG.cjs","sourcesContent":[null,"import type {\n CreateCreditNoteRequest,\n CreateInvoiceRequest,\n InvoiceEmailDelivery,\n InvoiceEmailDeliveryList,\n InvoiceExportParams,\n InvoiceList,\n InvoiceListQuery,\n InvoicePageQuery,\n InvoiceShareLink,\n MerchantInvoiceDocument,\n UpdateInvoiceRequest,\n VoidInvoiceRequest,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/** The invoice list filters that take several values. */\nconst INVOICE_CSV_KEYS = ['status', 'kind'] as const;\n\n/**\n * The invoices and credit notes a merchant issues to their buyers.\n *\n * DeloPay renders and stores each document **in the merchant's name**. The\n * seller block comes from the invoice settings (see `invoiceSettings`) and\n * every amount from the source — a paid payment or a paid subscription cycle —\n * so no method here takes a seller, an amount or a quantity, except the\n * optional partial amounts of a credit note, which the API caps at what the\n * line has left.\n *\n * A document is `draft` → `issued` → `voided`. A draft is unnumbered and\n * editable, and deleting it leaves no gap; `finalize` numbers it, freezes it\n * and stores its PDF; an issued document is corrected with a credit note, or\n * voided if it never reached the buyer.\n *\n * Scope comes from the caller: a shop-scoped key or dashboard session sees\n * only its shop, and a merchant-level one narrows with `profile_id` on the\n * list filters. Reading needs the `Invoice` area's read grant; every change\n * needs its write grant.\n *\n * Refusals: `IR_16` (400) for a document in the wrong state or a source that\n * may not be invoiced, `IR_06` (422) for a finalise the document cannot pass,\n * and `DE_13` (409) for a second live invoice of one source. The first two\n * carry `error.data` as a `MerchantInvoiceRefusal`; the last as a\n * `MerchantInvoiceConflict`.\n */\nexport class Invoices {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a draft from a paid payment or subscription cycle, and with\n * `finalize: true` issue it in the same call.\n * `POST /invoices`\n *\n * Send an `Idempotency-Key` header in `options.headers` to make this safe to\n * retry: the same key and body return the document it created, in its\n * current state, even after a lost response, and a different body under the\n * same key answers 409. A retry of a `finalize: true` request whose draft\n * was committed but not finalised finalises that draft.\n */\n async create(\n params: CreateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', '/invoices', { body: params, ...options });\n }\n\n /**\n * One page of documents, newest first unless `sort_by` says otherwise. List\n * rows carry no `lines` unless `include_lines` is set, and never a `refund`\n * summary. Several `status` or `kind` values match a document in any of\n * them.\n * `GET /invoices`\n */\n async list(params?: InvoiceListQuery, options?: RequestExtras): Promise<InvoiceList> {\n return this.request('GET', '/invoices', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * One page of a payment's invoice and its credit notes, lines included. The\n * page also says whether a merchant of record sold the payment\n * (`merchant_of_record`, which `create` then refuses) and what was refunded\n * (`refunded_amount`, and `refund` on each invoice). Needs the payment read\n * grant as well.\n * `GET /payments/{payment_id}/invoices`\n */\n async listForPayment(\n paymentId: string,\n params?: InvoicePageQuery,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/payments/${encodeURIComponent(paymentId)}/invoices`, {\n query: params === undefined ? undefined : { ...params },\n ...options,\n });\n }\n\n /**\n * The documents with a line of one product; a bundle's components count,\n * flagged `included`. Takes the list filters; the product is the path's.\n * `GET /products/{product_id}/invoices`\n */\n async listForProduct(\n productId: string,\n params?: Omit<InvoiceListQuery, 'product_id'>,\n options?: RequestExtras,\n ): Promise<InvoiceList> {\n return this.request('GET', `/products/${encodeURIComponent(productId)}/invoices`, {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n ...options,\n });\n }\n\n /**\n * The documents of one period, with the list's filters, as CSV\n * (`text/csv; charset=utf-8`) by default. Amounts are decimal in each\n * document's currency; drafts have an empty number.\n *\n * Another file is asked for with `Accept` in `options.headers`:\n * `application/json` (the rows as `records`, with `record_count` and the\n * filters applied), `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`\n * (an Excel workbook) or `application/zip` (the stored PDF of every issued or\n * voided document, with the CSV as `invoices.csv`; at most 500 documents).\n * `GET /invoices/export`\n */\n async export(params: InvoiceExportParams, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', '/invoices/export', {\n query: csvQuery(params, INVOICE_CSV_KEYS),\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * One document, lines included.\n * `GET /invoices/{invoice_id}`\n */\n async retrieve(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Edit a draft: its words, buyer, dates and tax treatment, never what was\n * paid. Absent fields stay; `null` clears a clearable one. A document that\n * is not a draft is refused (`not_a_draft`).\n * `PATCH /invoices/{invoice_id}`\n */\n async update(\n invoiceId: string,\n params: UpdateInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('PATCH', `/invoices/${encodeURIComponent(invoiceId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Delete a draft. A draft has no number, so nothing leaves a gap; an issued\n * document is refused (`not_a_draft`) — void or credit it instead.\n * `DELETE /invoices/{invoice_id}`\n */\n async delete(invoiceId: string, options?: RequestExtras): Promise<void> {\n return this.request('DELETE', `/invoices/${encodeURIComponent(invoiceId)}`, { ...options });\n }\n\n /**\n * Issue a draft: allocate its number, freeze it and store its PDF. It is\n * immutable afterwards. A document that would be legally incomplete is\n * refused with `IR_06` and a reason (`seller_tax_id_missing`,\n * `line_tax_unexplained`, …) that says what to fix and where.\n * `POST /invoices/{invoice_id}/finalize`\n */\n async finalize(invoiceId: string, options?: RequestExtras): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/finalize`, {\n ...options,\n });\n }\n\n /**\n * Withdraw an issued document with a reason; its number stays used. For a\n * document that never reached the buyer — one they hold is corrected with\n * `createCreditNote`. An invoice with live credit notes is refused\n * (`has_credit_notes`).\n * `POST /invoices/{invoice_id}/void`\n */\n async void(\n invoiceId: string,\n params: VoidInvoiceRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/void`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * Correct an issued invoice with a credit note: all of what it has left, or\n * the named lines. Returns the **credit note**, not the invoice.\n * `POST /invoices/{invoice_id}/credit-note`\n */\n async createCreditNote(\n invoiceId: string,\n params: CreateCreditNoteRequest,\n options?: RequestExtras,\n ): Promise<MerchantInvoiceDocument> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/credit-note`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * The document as a PDF. An issued document is its stored copy; a draft\n * renders live under a DRAFT banner, and a voided one under a VOIDED banner.\n * `GET /invoices/{invoice_id}/pdf`\n */\n async downloadPdf(invoiceId: string, options?: RequestExtras): Promise<Blob> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/pdf`, {\n responseType: 'blob',\n ...options,\n });\n }\n\n /**\n * A public link to an issued document's stored PDF, valid for 7 days.\n * **Anyone holding the link can open the document**, without logging in. A\n * document that is not issued is refused (`not_issued`).\n * `POST /invoices/{invoice_id}/share-link`\n */\n async createShareLink(invoiceId: string, options?: RequestExtras): Promise<InvoiceShareLink> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/share-link`, {\n ...options,\n });\n }\n\n /**\n * Mail an issued invoice to the buyer address it carries, its PDF attached,\n * in the document's language. Each call is a new message (the next\n * `revision`) and resolves with what became of it: `sent`, or `failed` with\n * `error_code`. Refused (`IR_16`) with `not_an_invoice` (a credit note),\n * `not_issued`, `no_buyer_email`, `send_in_progress` (an earlier message is\n * queued or being sent) and `send_limit_reached` (5 sends by hand in 24\n * hours). Shops with the `email.invoice_auto_send` setting mail every\n * invoice they issue without this call.\n *\n * The merchant's daily sending limit is **not** a refusal: the call answers\n * with the message `failed` and `error_code: 'merchant_limit_reached'`.\n * Check `status` on the result, not only that the call succeeded.\n * `POST /invoices/{invoice_id}/email`\n */\n async sendEmail(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDelivery> {\n return this.request('POST', `/invoices/${encodeURIComponent(invoiceId)}/email`, {\n ...options,\n });\n }\n\n /**\n * Every message about a document to its buyer, automatic and by hand,\n * newest first, with its delivery status. The recipient is masked.\n * `GET /invoices/{invoice_id}/emails`\n */\n async listEmails(invoiceId: string, options?: RequestExtras): Promise<InvoiceEmailDeliveryList> {\n return this.request('GET', `/invoices/${encodeURIComponent(invoiceId)}/emails`, {\n ...options,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-FYISDU2Y.cjs","../src/resources/profiles.ts"],"names":[],"mappings":"AAAA;ACaO,IAAM,SAAA,EAAN,MAAe;AAAA,EACpB,WAAA,CAA6B,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;AACF;AAAA;AAAA,EAAA;AAME,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AACF;AAAA,EAAA;AAIE,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAY,MAAA;AACV,MAAA;AAC2F,IAAA;AAC7F,EAAA;AAEJ;AD7BA;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-FYISDU2Y.cjs","sourcesContent":[null,"import type {\n ProfileCreateRequest,\n ProfileResponse,\n ProfileUpdateRequest,\n ShopArchiveUpdateRequest,\n ShopArchiveResponse,\n ShopPaymentsSwitchRequest,\n ShopPaymentsSwitchResponse,\n ArchivedShopResponse,\n VaultSwitchOffResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\nexport class Profiles {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Hide a shop from ordinary navigation. Its identity, project membership,\n * settings and retained records remain unchanged. Requires shop write access.\n * Repeating the same state is safe; use restore() to make it visible again.\n */\n async archive(accountId: string, profileId: string): Promise<ShopArchiveResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/archive`,\n { body: { is_archived: true } satisfies ShopArchiveUpdateRequest },\n );\n }\n\n /** Restore an archived shop to navigation with the same identity and project. */\n async restore(accountId: string, profileId: string): Promise<ShopArchiveResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/archive`,\n { body: { is_archived: false } satisfies ShopArchiveUpdateRequest },\n );\n }\n\n /**\n * Switch a shop's payments off. While they are off the shop takes no new\n * payment: creating one, and confirming one no provider holds yet, is\n * refused with `DE_21`, and its hosted checkout does not render. A payment a\n * provider already holds is finished; refunds and disputes are unaffected.\n * Needs the `ShopPaymentsSwitch` area's `Write` and a signed-in user.\n * Repeating the same state is safe.\n *\n * `PUT /account/{accountId}/business-profile/{profileId}/payments-switch`\n */\n async disablePayments(accountId: string, profileId: string): Promise<ShopPaymentsSwitchResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/payments-switch`,\n { body: { payments_disabled: true } satisfies ShopPaymentsSwitchRequest },\n );\n }\n\n /** Switch a shop's payments on again after {@link Profiles.disablePayments}. */\n async enablePayments(accountId: string, profileId: string): Promise<ShopPaymentsSwitchResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/payments-switch`,\n { body: { payments_disabled: false } satisfies ShopPaymentsSwitchRequest },\n );\n }\n\n /** Archived shop identities in the caller's merchant and shop-read scope. */\n async listArchived(accountId: string): Promise<ArchivedShopResponse[]> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/business-profile/archived`,\n );\n }\n\n async create(accountId: string, params: ProfileCreateRequest): Promise<ProfileResponse> {\n return this.request('POST', `/account/${encodeURIComponent(accountId)}/business-profile`, {\n body: params,\n });\n }\n\n async retrieve(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,\n );\n }\n\n async list(accountId: string): Promise<ProfileResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/business-profile`);\n }\n\n /**\n * List the business profiles the caller can see at profile scope — the\n * `ProfileAccountRead` twin of `list()` (which needs merchant-level read).\n * A shop-scoped user gets exactly their own shop back.\n *\n * `GET /account/{accountId}/profile`\n */\n async listByProfile(accountId: string): Promise<ProfileResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/profile`);\n }\n\n async update(\n accountId: string,\n profileId: string,\n params: ProfileUpdateRequest,\n options?: RequestExtras,\n ): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,\n {\n body: params,\n ...options,\n },\n );\n }\n\n async delete(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'DELETE',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}`,\n );\n }\n\n // --- Advanced operations (Task 4.8) ---\n\n /** Toggle extended card info for a profile. `POST /account/{accountId}/business-profile/{profileId}/toggle-extended-card-info` */\n async toggleExtendedCardInfo(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/toggle-extended-card-info`,\n );\n }\n\n /** Toggle connector agnostic MIT. `POST /account/{accountId}/business-profile/{profileId}/toggle-connector-agnostic-mit` */\n async toggleConnectorAgnosticMit(accountId: string, profileId: string): Promise<ProfileResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/toggle-connector-agnostic-mit`,\n );\n }\n\n /**\n * Switch the shop's card vault off. From the next checkout on, the checkout\n * draws each processor's own card form and card payments no longer depend on\n * the vault account. Cards saved in the vault cannot be charged while it is\n * off.\n *\n * The vault stays configured; switch it on again with {@link Profiles.update},\n * which verifies the vault first. Needs the permission to edit the shop's\n * connectors, not the one to edit the shop. Calling it for a shop whose vault\n * is already off changes nothing.\n *\n * `POST /account/{accountId}/business-profile/{profileId}/vault/switch-off`\n */\n async switchVaultOff(accountId: string, profileId: string): Promise<VaultSwitchOffResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/business-profile/${encodeURIComponent(profileId)}/vault/switch-off`,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/delopay-sdk-publish/dist/chunk-GA3KXPIF.cjs","../src/resources/connectors.ts"],"names":[],"mappings":"AAAA;ACuDO,IAAM,WAA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAeE,IAAA;AAA2F,EAAA;AAC7F;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAeE,IAAA;AAAY,MAAA;AACV,MAAA;AACiF,MAAA;AAClE,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAY,MAAA;AACV,MAAA;AACiF,MAAA;AAClE,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAuF,MAAA;AAChE,IAAA;AACtB,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAwF,MAAA;AAChF,IAAA;AACP,EAAA;AACH;AAAA,EAAA;AAIE,IAAA;AAAqD,EAAA;AAEzD;AAEA;AACE,EAAA;AACF;ADlOA;AACA;AACA;AACA","file":"/tmp/delopay-sdk-publish/dist/chunk-GA3KXPIF.cjs","sourcesContent":[null,"import type {\n ConnectorBuyerMailQuery,\n ConnectorBuyerMailResponse,\n ConnectorBuyerMailUpdate,\n ConnectorCloneRequest,\n ConnectorConsolidationRequest,\n ConnectorConsolidationResponse,\n ConnectorCurrencyPolicyResponse,\n ConnectorCurrencyPolicyUpdateRequest,\n ConnectorShopsAddRequest,\n ConnectorShopUpdateRequest,\n ConnectorShopsResponse,\n ConnectorHealthResponse,\n EpayoutsCatalogResponse,\n PanesCatalogResponse,\n VaultRoutesApplyRequest,\n VaultRoutesApplyResponse,\n VaultRoutesPreviewRequest,\n VaultRoutesPreviewResponse,\n VaultOutagesResponse,\n VaultVerificationResponse,\n VaultVerifyRequest,\n ConnectorCreateRequest,\n ConnectorResponse,\n ConnectorUpdateRequest,\n ConnectorWebhookListResponse,\n ConnectorWebhookRegisterRequest,\n ConnectorWebhookRegisterResponse,\n ConnectorWebhookSyncResponse,\n WebhookAddressPreviewResponse,\n WebhookAddressRequest,\n WebhookAddressResponse,\n ReturnAddressPreviewResponse,\n ReturnAddressRequest,\n ReturnAddressResponse,\n ProviderWebhookCreateRequest,\n ProviderWebhookCreateResponse,\n ProviderWebhookDeleteRequest,\n ProviderWebhookDeleteResult,\n ProviderWebhookEndpoint,\n ProviderWebhookListResponse,\n ProviderWebhookReplacePreviewResponse,\n ProviderWebhookReplaceRequest,\n ProviderWebhookReplaceResponse,\n ProviderWebhookUpdateRequest,\n WebhookRegistrationEnvironment,\n AirwallexApplePayDomainsRegisterRequest,\n AirwallexApplePayDomainsRegisterResponse,\n StripePaymentMethodDomainsRegisterRequest,\n StripePaymentMethodDomainsRegisterResponse,\n WhopApplePayDomainsRegisterRequest,\n WhopApplePayDomainsRegisterResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\nexport class Connectors {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Read the connected provider account's optional buyer-email preference.\n * Currently supported for Whop. Use `setJwtToken` with a merchant JWT that\n * has Connector Edit authority; a shop token or API key cannot substitute.\n * Select Sandbox or Live explicitly through `test_mode`.\n *\n * The preference affects every shop sharing the provider account. It does\n * not disable mandatory provider messages or DeloPay invoice delivery.\n * A null or absent value establishes no on/off preference.\n */\n async retrieveBuyerEmailPreference(\n merchantId: string,\n connectorId: string,\n params: ConnectorBuyerMailQuery,\n ): Promise<ConnectorBuyerMailResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/buyer-email-preference`,\n { query: { test_mode: params.test_mode } },\n );\n }\n\n /**\n * Change the optional buyer-email preference for the whole provider account.\n * Currently supported for Whop. Requires a merchant JWT with Connector Edit\n * authority and explicit confirmation for every shop sharing the account.\n * Send the exact account, credential mode and value read before confirmation;\n * a changed account or preference is refused before mutation.\n *\n * Inspect `outcome`: only `verified` confirms the requested value through a\n * fresh exact-account read. HTTP 200 may instead report a conflict, refusal\n * or unknown outcome. An uncertain change may have happened; read the\n * preference again before retrying, including after a transport error.\n * This method adds no automatic readback or retry. Mandatory provider\n * messages and DeloPay invoice delivery are unaffected.\n */\n async updateBuyerEmailPreference(\n merchantId: string,\n connectorId: string,\n params: ConnectorBuyerMailUpdate,\n ): Promise<ConnectorBuyerMailResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/buyer-email-preference`,\n { body: params },\n );\n }\n\n async create(accountId: string, params: ConnectorCreateRequest): Promise<ConnectorResponse> {\n return this.request('POST', `/account/${encodeURIComponent(accountId)}/connectors`, {\n body: params,\n });\n }\n\n /**\n * One connector account.\n *\n * The credential-bearing fields come back `null` here, whatever is stored:\n * `connector_webhook_details`, `connector_wallets_details`,\n * `pm_auth_config` and `additional_merchant_data`. They are dropped rather\n * than masked, because an editor that prefills from this response and\n * PATCHes the field back would otherwise save a mask over a live signing\n * secret. Send those fields only when the operator has typed a new value,\n * and omit them entirely otherwise — an omitted field leaves the stored one\n * alone.\n *\n * This is the retrieve path alone. `create` and `update` echo back what the\n * caller sent, and `clone` returns the *copied* secrets — see that method.\n *\n * Because the value is gone, `has_live_webhook_secret` and\n * `has_sandbox_webhook_secret` are what tell a stored webhook signing secret\n * from an unconfigured one. Render those; never infer configuration from the\n * `null` block.\n *\n * `GET /account/{accountId}/connectors/{connectorId}`\n */\n async retrieve(accountId: string, connectorId: string): Promise<ConnectorResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,\n );\n }\n\n /**\n * The merchant's connector accounts.\n *\n * Never wider than the caller: an API key pinned to one shop lists that\n * shop's connectors only, not every sibling shop's.\n *\n * `GET /account/{accountId}/connectors`\n */\n async list(accountId: string): Promise<ConnectorResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/connectors`);\n }\n\n /**\n * The profile-scoped connector list. The merchant-wide `list()` is\n * merchant-gated and 403s for a profile-entity (shop user) JWT; this\n * variant is scoped server-side to the caller's own profile.\n *\n * `GET /account/{accountId}/profile/connectors`\n */\n async listByProfile(accountId: string): Promise<ConnectorResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/profile/connectors`);\n }\n\n /**\n * Every connector's pane capabilities, as the router itself knows them —\n * which rails a connector supports, and which methods it can publish as a\n * pane with the confirm routing keys each one carries.\n *\n * Capability facts only: no label, sublabel or category comes back. A\n * designer renders a method's copy from its own locale files, keyed by\n * `key`, and takes `payment_method` / `payment_method_type` from here\n * verbatim rather than deriving them client-side.\n *\n * This is what the pane helpers in `src/panes.ts` should be driven from —\n * `paneMethodInfo`, `defaultPane` and `validatePanes` all take a\n * {@link PanesConnectorCatalog} out of this response, so a connector the\n * router starts publishing panes for needs no SDK release.\n *\n * `GET /account/{accountId}/connectors/native-panes/catalog`\n *\n * The path keeps the `native-panes` spelling deliberately. The identifiers\n * were renamed off \"native pane\"; the route was not, and pointing at the\n * backend's new name before it is deployed everywhere would both 404 against\n * un-upgraded replicas mid-rollout and fail `scripts/parity-check.mjs`,\n * which blocks publishing.\n */\n async getPanesCatalog(accountId: string): Promise<PanesCatalogResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/native-panes/catalog`,\n );\n }\n\n /** @deprecated Renamed to {@link getPanesCatalog}. Removed in 0.112.0. */\n async getNativePanesCatalog(accountId: string): Promise<PanesCatalogResponse> {\n return this.getPanesCatalog(accountId);\n }\n\n /**\n * Sweep the merchant's own e-Payouts module and return the rails it\n * actually has enabled. Server-side this makes many upstream calls, so it\n * can take several seconds — show progress.\n *\n * `POST /account/{accountId}/connectors/{connectorId}/epayouts/catalog/sync`\n */\n async syncEpayoutsCatalog(\n accountId: string,\n connectorId: string,\n ): Promise<EpayoutsCatalogResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/epayouts/catalog/sync`,\n );\n }\n\n /**\n * Update a connector account.\n *\n * `connector_webhook_details` **merges** into the stored block key by key:\n * an absent key keeps its stored secret, an explicit value is written, and\n * an explicit empty string clears that secret. Send only the\n * keys the operator typed — padding the other environment's keys with `''`\n * clears a live signing secret and inbound webhooks stop verifying.\n *\n * The other credential-bearing fields — `connector_wallets_details`,\n * `pm_auth_config`, `additional_merchant_data` — are still whole-value\n * replacements: omit them unless you are writing a complete new value.\n *\n * `POST /account/{accountId}/connectors/{connectorId}`\n */\n async update(\n accountId: string,\n connectorId: string,\n params: ConnectorUpdateRequest,\n options?: RequestExtras,\n ): Promise<ConnectorResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,\n {\n body: params,\n ...options,\n },\n );\n }\n\n /**\n * Remove a connector account.\n *\n * A shop-scoped role may remove a connector of its own shop — the shop is\n * re-checked server-side — so creating processors and removing them are the\n * same rung of access rather than two.\n *\n * `DELETE /account/{accountId}/connectors/{connectorId}`\n */\n async delete(accountId: string, connectorId: string): Promise<ConnectorResponse> {\n return this.request(\n 'DELETE',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,\n );\n }\n\n /**\n * Clone a connector into another shop (business profile) of the same\n * merchant. `POST /account/{accountId}/connectors/{connectorId}/clone`\n *\n * Credentials are copied server-side, re-encrypted under the same merchant\n * key, so the caller never has to *supply* them — `retrieve` returns `null`\n * for the credential fields, which is what makes a client-side copy\n * impossible in the first place.\n *\n * The response, however, is the unredacted connector: `connector_account_details`\n * is masked, but `connector_webhook_details`, `connector_wallets_details`,\n * `pm_auth_config` and `additional_merchant_data` come back with the copied\n * secrets in them — values this caller never sent. Do not log or echo the\n * response; read `merchant_connector_id` and discard the rest.\n */\n async clone(\n accountId: string,\n connectorId: string,\n params: ConnectorCloneRequest,\n ): Promise<ConnectorResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/clone`,\n { body: params },\n );\n }\n\n /**\n * Share a connector with more shops of the same merchant.\n * `POST /account/{accountId}/connectors/{connectorId}/shops`\n *\n * Nothing is copied: every shop sends payments to the same account, on the\n * same credentials and webhook, and the account's limits count them all.\n */\n async addShops(\n accountId: string,\n connectorId: string,\n params: ConnectorShopsAddRequest,\n ): Promise<ConnectorShopsResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops`,\n { body: params },\n );\n }\n\n /**\n * Fold copies of the same provider account into this connector.\n * `POST /account/{accountId}/connectors/{connectorId}/consolidate`\n *\n * The copies' shops move to the connector with their on/off state, routing,\n * checkout layout, currencies, saved credentials, mandates and\n * subscriptions. A copy keeps answering for the payments made on it and\n * serves no shop. Send `dry_run: true` first, then confirm with the\n * preview's `preview_token` and a choice for every conflict.\n */\n async consolidate(\n accountId: string,\n connectorId: string,\n params: ConnectorConsolidationRequest,\n ): Promise<ConnectorConsolidationResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/consolidate`,\n { body: params },\n );\n }\n\n /**\n * Switch a connector off, or back on, in one shop it serves.\n * `POST /account/{accountId}/connectors/{connectorId}/shops/{profileId}`\n */\n async setShopDisabled(\n accountId: string,\n connectorId: string,\n profileId: string,\n params: ConnectorShopUpdateRequest,\n ): Promise<ConnectorShopsResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`,\n { body: params },\n );\n }\n\n /**\n * Stop a connector serving one shop. Any shop may leave, the\n * one the connector was created in included, while another one stays: the\n * last shop is refused, and the connector is deleted instead. The account,\n * its limits and every other shop on it are unaffected.\n * `DELETE /account/{accountId}/connectors/{connectorId}/shops/{profileId}`\n */\n async removeShop(\n accountId: string,\n connectorId: string,\n profileId: string,\n ): Promise<ConnectorShopsResponse> {\n return this.request(\n 'DELETE',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`,\n );\n }\n\n /**\n * Read the transaction currencies a connector may process: its own list,\n * what the provider is known to accept with its methods, and the effective\n * currencies in each shop it serves.\n * `GET /account/{accountId}/connectors/{connectorId}/currencies`\n */\n async getCurrencies(\n accountId: string,\n connectorId: string,\n ): Promise<ConnectorCurrencyPolicyResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`,\n );\n }\n\n /**\n * Set the transaction currencies a connector may process in every shop it\n * serves, and what it does with a payment in a currency it does not take\n * (`conversion`). `allowed_currencies: null` allows every currency the\n * provider supports; a field left out stays as it is. With `dry_run`,\n * nothing is saved and `impact` reports the effect.\n * `PUT /account/{accountId}/connectors/{connectorId}/currencies`\n */\n async setCurrencies(\n accountId: string,\n connectorId: string,\n params: ConnectorCurrencyPolicyUpdateRequest,\n ): Promise<ConnectorCurrencyPolicyResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`,\n { body: params },\n );\n }\n\n /**\n * Narrow a connector's currencies in one shop it serves, within the\n * connector's own list, or set the shop's own `conversion`. `null` returns\n * the shop to the connector's setting; a field left out stays as it is.\n * `PUT /account/{accountId}/connectors/{connectorId}/shops/{profileId}/currencies`\n */\n async setShopCurrencies(\n accountId: string,\n connectorId: string,\n profileId: string,\n params: ConnectorCurrencyPolicyUpdateRequest,\n ): Promise<ConnectorCurrencyPolicyResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}/currencies`,\n { body: params },\n );\n }\n\n // --- Advanced operations (Task 4.8) ---\n\n /**\n * Run the configuration checks for a vault (VGS) connector account:\n * credential validity, write-only Collect scope, reachability, environment\n * coherence, route coverage. Read-only but not cheap — it decrypts the\n * vault's management credential and talks to VGS.\n *\n * `POST /account/{accountId}/connectors/{connectorId}/vault/verify`\n */\n async verifyVault(\n accountId: string,\n connectorId: string,\n params: VaultVerifyRequest,\n ): Promise<VaultVerificationResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/vault/verify`,\n { body: params },\n );\n }\n\n /**\n * The shops whose card vault is switched on and whose vault account has\n * stopped working, each with the cause. While a shop is listed, its card\n * form cannot be shown and its card payments fail.\n *\n * An outage is listed once the vault has refused the account several times\n * in a row over at least a minute, and is taken off the list when the vault\n * serves the account again. Nothing switches a vault off by itself: see\n * `profiles.switchVaultOff`.\n *\n * `GET /account/{accountId}/vault/outages`\n */\n async listVaultOutages(accountId: string): Promise<VaultOutagesResponse> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/vault/outages`);\n }\n\n /**\n * Compute the route document the vault SHOULD have and diff it against\n * what exists, without writing anything. The returned fingerprints must be\n * echoed byte for byte on {@link Connectors.applyVaultRoutes}.\n *\n * A router without these endpoints answers 404 — render that as \"this\n * build cannot configure routes\", never as \"there is nothing to change\".\n *\n * `POST /account/{accountId}/connectors/{connectorId}/vault/routes/preview`\n */\n async previewVaultRoutes(\n accountId: string,\n connectorId: string,\n params: VaultRoutesPreviewRequest,\n ): Promise<VaultRoutesPreviewResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/vault/routes/preview`,\n { body: params },\n );\n }\n\n /**\n * Write the routes the merchant just previewed. Both fingerprints come\n * from the preview and are opaque: `expected_current_fingerprint` says the\n * vault has not moved (`null` = \"the preview found no routes\" and is sent\n * as `null`, never omitted), `expected_desired_fingerprint` says the\n * document is still the one on screen. A 409 (`DE_04`) means the vault\n * changed since the preview — nothing was written; preview again.\n *\n * `POST /account/{accountId}/connectors/{connectorId}/vault/routes/apply`\n */\n async applyVaultRoutes(\n accountId: string,\n connectorId: string,\n params: VaultRoutesApplyRequest,\n ): Promise<VaultRoutesApplyResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/vault/routes/apply`,\n { body: params },\n );\n }\n\n /**\n * What the processor says about this connector account: whether it will\n * accept charges, which capabilities are live, and anything it is still\n * waiting on.\n *\n * This is **not** {@link Connectors.verify}. That one asks whether the stored\n * credentials work, by running a test-card authorization; a processor can\n * revoke an account's ability to take payments while the credentials stay\n * perfectly valid, and then a credential check reports healthy while every\n * checkout silently stalls. This asks the account's own status instead, and\n * does not create a payment. By default it reads a scheduler snapshot;\n * `refresh: true` asks for a new probe and `stale` identifies an overdue result.\n * `test_mode` selects the requested environment; `credential_source` identifies\n * a sandbox, live or shared credential set. Not every provider reports chargeability.\n *\n * Connectors with no probe answer `state: 'unknown'` with\n * `unknown_reason: 'connector_not_supported'`, rather than an error — every\n * `'unknown'` carries a reason code you render your own words for. A router\n * without this endpoint answers 404 — render that as \"this build cannot\n * report health\", never as \"healthy\".\n *\n * `GET /account/{accountId}/connectors/{connectorId}/health`\n */\n async health(\n accountId: string,\n connectorId: string,\n options?: { test_mode?: boolean; refresh?: boolean },\n ): Promise<ConnectorHealthResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/health`,\n { query: options },\n );\n }\n\n /** Verify connector credentials. `POST /account/connectors/verify` */\n async verify(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/account/connectors/verify', { body: params });\n }\n\n /**\n * Register a webhook for a connector.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}`\n *\n * @param params - Optional event scope. Defaults to `{ event_type: 'all_events' }`\n * when omitted; pass `{ event_type: { specific_event: '…' } }` to scope\n * to a single event.\n */\n async registerWebhook(\n merchantId: string,\n connectorId: string,\n params?: ConnectorWebhookRegisterRequest,\n ): Promise<ConnectorWebhookRegisterResponse> {\n const path = `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`;\n if (params === undefined) return this.request('POST', path);\n return this.request('POST', path, { body: params });\n }\n\n /**\n * Register checkout/shop domains as Stripe payment method domains, so Apple\n * Pay renders on those pages.\n * `POST /account/{merchantId}/connectors/{connectorId}/stripe/payment-method-domains`\n *\n * Stripe connectors only. One call registers against a single credential set\n * (`environment`, default `'live'`) — call twice to cover live and sandbox.\n * Per-URL outcomes come back in `results`; a missing sandbox credential set\n * is a request-level 400.\n */\n async registerStripePaymentMethodDomains(\n merchantId: string,\n connectorId: string,\n params: StripePaymentMethodDomainsRegisterRequest,\n ): Promise<StripePaymentMethodDomainsRegisterResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/stripe/payment-method-domains`,\n { body: params },\n );\n }\n\n /**\n * Register checkout/shop domains as Airwallex Apple Pay domains, so Apple Pay\n * renders on those pages.\n * `POST /account/{merchantId}/connectors/{connectorId}/airwallex/apple-pay-domains`\n *\n * Airwallex connectors only. One call registers against a single credential\n * set (`environment`, default `'live'`) — call twice to cover live and\n * sandbox. Idempotent: a host already on the account comes back\n * `already_registered` without a write.\n */\n async registerAirwallexApplePayDomains(\n merchantId: string,\n connectorId: string,\n params: AirwallexApplePayDomainsRegisterRequest,\n ): Promise<AirwallexApplePayDomainsRegisterResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/airwallex/apple-pay-domains`,\n { body: params },\n );\n }\n\n /**\n * Register and verify checkout/shop domains as Whop Apple Pay payment method\n * domains, so Apple Pay renders in Whop's embedded card form on those pages.\n * `POST /account/{merchantId}/connectors/{connectorId}/whop/apple-pay-domains`\n *\n * Whop connectors only. One call registers against a single credential set\n * (`environment`, default `'live'`) — call twice to cover live and sandbox.\n * Idempotent: a host Whop already holds as verified comes back\n * `already_verified` without a write, and a `pending` one is verified again.\n */\n async registerWhopApplePayDomains(\n merchantId: string,\n connectorId: string,\n params: WhopApplePayDomainsRegisterRequest,\n ): Promise<WhopApplePayDomainsRegisterResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/whop/apple-pay-domains`,\n { body: params },\n );\n }\n\n /** Get registered webhooks for a connector. `GET /account/{merchantId}/connectors/webhooks/{connectorId}` */\n async getWebhook(merchantId: string, connectorId: string): Promise<ConnectorWebhookListResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`,\n );\n }\n\n /**\n * Bring an already-registered webhook's event subscription up to date with\n * the events Delopay handles.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/sync-events`\n *\n * A PSP freezes an endpoint's event list at registration time, so an endpoint\n * created before an event type was added never receives it — silently, with\n * no error anywhere. {@link getWebhook} reports the gap as `missing_events`;\n * this repairs it.\n *\n * Unlike re-registering, the endpoints are updated in place: the endpoint id\n * and its signing secret are preserved, so signature verification keeps\n * working across the change. Stripe connectors only; idempotent, so it is\n * safe to call on a schedule or after every deploy.\n *\n * @example\n * ```typescript\n * const sync = await delopay.connectors.syncWebhookEvents('mer_abc', 'mca_xyz');\n * for (const endpoint of sync.endpoints) {\n * if (endpoint.error_message) console.warn(endpoint.connector_webhook_id, endpoint.error_message);\n * else if (endpoint.updated) console.log('subscribed', endpoint.added_events);\n * }\n * ```\n */\n async syncWebhookEvents(\n merchantId: string,\n connectorId: string,\n ): Promise<ConnectorWebhookSyncResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/sync-events`,\n );\n }\n\n /**\n * Read the callback addresses of a connector's payment provider.\n * `GET /account/{merchantId}/connectors/webhooks/{connectorId}/address`\n *\n * One entry per environment: the saved mode and identifier, and for every\n * credential group the URL the policy asks for (`desired_url`) beside the URL\n * actually registered at the provider (`registered_url`) with its `status`.\n * Only `registered` means the provider delivers to the desired URL.\n *\n * Available for providers whose webhooks Delopay manages (Stripe, PayPal,\n * Airwallex, Whop) and for hand-configured ones (Creem, NomuPay,\n * MicroPayment). Other connectors are refused with a 400.\n */\n async getWebhookAddress(\n merchantId: string,\n connectorId: string,\n ): Promise<WebhookAddressResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address`,\n );\n }\n\n /**\n * Validate a proposed callback address without saving it.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/address/preview`\n *\n * Returns the validation errors as `{ field, code }` pairs, the URL every\n * affected credential group would get, the connector accounts that share it,\n * and whether saving needs `confirm_shared: true`. Needs the same permission\n * as saving.\n *\n * @example\n * ```typescript\n * const preview = await delopay.connectors.previewWebhookAddress('mer_abc', 'mca_xyz', {\n * environment: 'live',\n * mode: 'anonymous',\n * format: { prefix: 'wh-', style: 'alphanumeric', length: 16 },\n * });\n * if (!preview.valid) console.warn(preview.errors);\n * ```\n */\n async previewWebhookAddress(\n merchantId: string,\n connectorId: string,\n params: WebhookAddressRequest,\n ): Promise<WebhookAddressPreviewResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address/preview`,\n { body: params },\n );\n }\n\n /**\n * Save the callback address of a connector's payment provider for one\n * environment.\n * `PUT /account/{merchantId}/connectors/webhooks/{connectorId}/address`\n *\n * The address applies to every connector account of that provider and\n * environment, so `confirm_shared: true` is required when other accounts are\n * affected. For a managed provider Delopay then registers the new URL and\n * keeps the former one accepted; the response reports each credential\n * group's outcome in `status`. A `pending` or `failed` group keeps receiving\n * on its previous URL and is retried. For a hand-configured provider the\n * merchant enters the new `desired_url` at the provider.\n *\n * A refused proposal answers 422 with error code `IR_06` and the message\n * `Webhook address refused: field:code,…`. A save that lost to a concurrent\n * change of the same address answers 422 with error code `HE_00` and can be\n * repeated. A caller who may not edit every affected account answers 403.\n * Address changes are limited per provider and environment (`rate_limit`).\n */\n async updateWebhookAddress(\n merchantId: string,\n connectorId: string,\n params: WebhookAddressRequest,\n ): Promise<WebhookAddressResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address`,\n { body: params },\n );\n }\n\n /**\n * Read how the return addresses of a connector's payment provider name the\n * merchant, per environment.\n * `GET /account/{merchantId}/connectors/{connectorId}/return-address`\n *\n * A return address is where the provider sends the buyer back after a step\n * it hosts. It belongs to the merchant, the provider and the environment,\n * so every connector account of that provider follows it.\n */\n async getReturnAddress(merchantId: string, connectorId: string): Promise<ReturnAddressResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address`,\n );\n }\n\n /**\n * Validate a proposed return address without saving it.\n * `POST /account/{merchantId}/connectors/{connectorId}/return-address/preview`\n *\n * Nothing is reserved: a generated identifier in the answer is an example.\n * Needs the same permission as saving.\n *\n * @example\n * ```typescript\n * const preview = await delopay.connectors.previewReturnAddress('mer_abc', 'mca_xyz', {\n * environment: 'live',\n * mode: 'anonymous',\n * share_webhook_identifier: true,\n * });\n * if (!preview.valid) console.warn(preview.errors);\n * ```\n */\n async previewReturnAddress(\n merchantId: string,\n connectorId: string,\n params: ReturnAddressRequest,\n ): Promise<ReturnAddressPreviewResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address/preview`,\n { body: params },\n );\n }\n\n /**\n * Save the return address of a connector's payment provider for one\n * environment.\n * `PUT /account/{merchantId}/connectors/{connectorId}/return-address`\n *\n * Payments started afterwards get return addresses of the new form; every\n * address already handed to the provider keeps working. A refused proposal\n * answers 422 with error code `IR_06` and the message\n * `Return address refused: field:code,…`. A caller who may not edit every\n * connector account of the provider answers 403. Address changes are\n * limited per provider and environment (`rate_limit`).\n */\n async updateReturnAddress(\n merchantId: string,\n connectorId: string,\n params: ReturnAddressRequest,\n ): Promise<ReturnAddressResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address`,\n { body: params },\n );\n }\n\n /**\n * Every webhook the connector's payment provider lists for its credentials\n * in one environment: Delopay's own, other connector accounts', former\n * addresses' and other integrations'.\n * `GET /account/{merchantId}/connectors/webhooks/{connectorId}/provider`\n *\n * Available for Stripe, PayPal, Airwallex, Whop and Adyen. Destinations are\n * masked; `capabilities` says which changes the provider allows and\n * `editable` whether the caller may make them.\n */\n async listProviderWebhooks(\n merchantId: string,\n connectorId: string,\n environment: WebhookRegistrationEnvironment,\n ): Promise<ProviderWebhookListResponse> {\n return this.request('GET', providerWebhooksPath(merchantId, connectorId), {\n query: { environment },\n });\n }\n\n /**\n * Create a webhook at the provider for the merchant's own systems.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/provider`\n *\n * The URL must be `https` and outside Delopay; Delopay's own webhook is\n * registered with `registerWebhook`. A returned `signing_secret` is not kept\n * by Delopay and cannot be read again.\n */\n async createProviderWebhook(\n merchantId: string,\n connectorId: string,\n params: ProviderWebhookCreateRequest,\n ): Promise<ProviderWebhookCreateResponse> {\n return this.request('POST', providerWebhooksPath(merchantId, connectorId), { body: params });\n }\n\n /**\n * Change one webhook at the provider.\n * `PATCH /account/{merchantId}/connectors/webhooks/{connectorId}/provider/{webhookId}`\n *\n * Refused once the webhook changed since `fingerprint`, and for Delopay's\n * own webhooks.\n */\n async updateProviderWebhook(\n merchantId: string,\n connectorId: string,\n webhookId: string,\n params: ProviderWebhookUpdateRequest,\n ): Promise<ProviderWebhookEndpoint> {\n return this.request(\n 'PATCH',\n `${providerWebhooksPath(merchantId, connectorId)}/${encodeURIComponent(webhookId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete one webhook at the provider.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/provider/{webhookId}/delete`\n *\n * Refused once the webhook changed since `fingerprint`. Deleting Delopay's\n * own webhook needs `confirm_managed: true`; another connector account's is\n * never deleted from here.\n */\n async deleteProviderWebhook(\n merchantId: string,\n connectorId: string,\n webhookId: string,\n params: ProviderWebhookDeleteRequest,\n ): Promise<ProviderWebhookDeleteResult> {\n return this.request(\n 'POST',\n `${providerWebhooksPath(merchantId, connectorId)}/${encodeURIComponent(webhookId)}/delete`,\n { body: params },\n );\n }\n\n /**\n * What \"replace all\" would delete and keep. Nothing is changed.\n * `GET /account/{merchantId}/connectors/webhooks/{connectorId}/provider/replace`\n */\n async previewProviderWebhookReplace(\n merchantId: string,\n connectorId: string,\n environment: WebhookRegistrationEnvironment,\n ): Promise<ProviderWebhookReplacePreviewResponse> {\n return this.request('GET', `${providerWebhooksPath(merchantId, connectorId)}/replace`, {\n query: { environment },\n });\n }\n\n /**\n * Keep only Delopay's webhook: delete exactly the confirmed webhooks of the\n * preview, after registering Delopay's own unless `sequence` is\n * `delete_first`.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/provider/replace`\n *\n * A list that changed since the preview answers `scope_changed` and deletes\n * nothing. A second replacement while one runs is refused as busy (`HE_00`).\n */\n async replaceProviderWebhooks(\n merchantId: string,\n connectorId: string,\n params: ProviderWebhookReplaceRequest,\n ): Promise<ProviderWebhookReplaceResponse> {\n return this.request('POST', `${providerWebhooksPath(merchantId, connectorId)}/replace`, {\n body: params,\n });\n }\n\n /** List available payment methods. `GET /account/payment-methods` */\n async listPaymentMethods(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/account/payment-methods');\n }\n}\n\nfunction providerWebhooksPath(merchantId: string, connectorId: string): string {\n return `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/provider`;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GA3KXPIF.cjs","../src/resources/connectors.ts"],"names":[],"mappings":"AAAA;ACuDO,IAAM,WAAA,EAAN,MAAiB;AAAA,EACtB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EA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AAA;AAAA;AAAA,EAAA;AAeE,IAAA;AAAY,MAAA;AACV,MAAA;AACiF,MAAA;AAClE,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAY,MAAA;AACV,MAAA;AACiF,MAAA;AAClE,IAAA;AACjB,EAAA;AACF;AAAA;AAAA;AAAA;AAAA,EAAA;AAWE,IAAA;AAAuF,MAAA;AAChE,IAAA;AACtB,EAAA;AACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAgBE,IAAA;AAAwF,MAAA;AAChF,IAAA;AACP,EAAA;AACH;AAAA,EAAA;AAIE,IAAA;AAAqD,EAAA;AAEzD;AAEA;AACE,EAAA;AACF;ADlOA;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GA3KXPIF.cjs","sourcesContent":[null,"import type {\n ConnectorBuyerMailQuery,\n ConnectorBuyerMailResponse,\n ConnectorBuyerMailUpdate,\n ConnectorCloneRequest,\n ConnectorConsolidationRequest,\n ConnectorConsolidationResponse,\n ConnectorCurrencyPolicyResponse,\n ConnectorCurrencyPolicyUpdateRequest,\n ConnectorShopsAddRequest,\n ConnectorShopUpdateRequest,\n ConnectorShopsResponse,\n ConnectorHealthResponse,\n EpayoutsCatalogResponse,\n PanesCatalogResponse,\n VaultRoutesApplyRequest,\n VaultRoutesApplyResponse,\n VaultRoutesPreviewRequest,\n VaultRoutesPreviewResponse,\n VaultOutagesResponse,\n VaultVerificationResponse,\n VaultVerifyRequest,\n ConnectorCreateRequest,\n ConnectorResponse,\n ConnectorUpdateRequest,\n ConnectorWebhookListResponse,\n ConnectorWebhookRegisterRequest,\n ConnectorWebhookRegisterResponse,\n ConnectorWebhookSyncResponse,\n WebhookAddressPreviewResponse,\n WebhookAddressRequest,\n WebhookAddressResponse,\n ReturnAddressPreviewResponse,\n ReturnAddressRequest,\n ReturnAddressResponse,\n ProviderWebhookCreateRequest,\n ProviderWebhookCreateResponse,\n ProviderWebhookDeleteRequest,\n ProviderWebhookDeleteResult,\n ProviderWebhookEndpoint,\n ProviderWebhookListResponse,\n ProviderWebhookReplacePreviewResponse,\n ProviderWebhookReplaceRequest,\n ProviderWebhookReplaceResponse,\n ProviderWebhookUpdateRequest,\n WebhookRegistrationEnvironment,\n AirwallexApplePayDomainsRegisterRequest,\n AirwallexApplePayDomainsRegisterResponse,\n StripePaymentMethodDomainsRegisterRequest,\n StripePaymentMethodDomainsRegisterResponse,\n WhopApplePayDomainsRegisterRequest,\n WhopApplePayDomainsRegisterResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\nexport class Connectors {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Read the connected provider account's optional buyer-email preference.\n * Currently supported for Whop. Use `setJwtToken` with a merchant JWT that\n * has Connector Edit authority; a shop token or API key cannot substitute.\n * Select Sandbox or Live explicitly through `test_mode`.\n *\n * The preference affects every shop sharing the provider account. It does\n * not disable mandatory provider messages or DeloPay invoice delivery.\n * A null or absent value establishes no on/off preference.\n */\n async retrieveBuyerEmailPreference(\n merchantId: string,\n connectorId: string,\n params: ConnectorBuyerMailQuery,\n ): Promise<ConnectorBuyerMailResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/buyer-email-preference`,\n { query: { test_mode: params.test_mode } },\n );\n }\n\n /**\n * Change the optional buyer-email preference for the whole provider account.\n * Currently supported for Whop. Requires a merchant JWT with Connector Edit\n * authority and explicit confirmation for every shop sharing the account.\n * Send the exact account, credential mode and value read before confirmation;\n * a changed account or preference is refused before mutation.\n *\n * Inspect `outcome`: only `verified` confirms the requested value through a\n * fresh exact-account read. HTTP 200 may instead report a conflict, refusal\n * or unknown outcome. An uncertain change may have happened; read the\n * preference again before retrying, including after a transport error.\n * This method adds no automatic readback or retry. Mandatory provider\n * messages and DeloPay invoice delivery are unaffected.\n */\n async updateBuyerEmailPreference(\n merchantId: string,\n connectorId: string,\n params: ConnectorBuyerMailUpdate,\n ): Promise<ConnectorBuyerMailResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/buyer-email-preference`,\n { body: params },\n );\n }\n\n async create(accountId: string, params: ConnectorCreateRequest): Promise<ConnectorResponse> {\n return this.request('POST', `/account/${encodeURIComponent(accountId)}/connectors`, {\n body: params,\n });\n }\n\n /**\n * One connector account.\n *\n * The credential-bearing fields come back `null` here, whatever is stored:\n * `connector_webhook_details`, `connector_wallets_details`,\n * `pm_auth_config` and `additional_merchant_data`. They are dropped rather\n * than masked, because an editor that prefills from this response and\n * PATCHes the field back would otherwise save a mask over a live signing\n * secret. Send those fields only when the operator has typed a new value,\n * and omit them entirely otherwise — an omitted field leaves the stored one\n * alone.\n *\n * This is the retrieve path alone. `create` and `update` echo back what the\n * caller sent, and `clone` returns the *copied* secrets — see that method.\n *\n * Because the value is gone, `has_live_webhook_secret` and\n * `has_sandbox_webhook_secret` are what tell a stored webhook signing secret\n * from an unconfigured one. Render those; never infer configuration from the\n * `null` block.\n *\n * `GET /account/{accountId}/connectors/{connectorId}`\n */\n async retrieve(accountId: string, connectorId: string): Promise<ConnectorResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,\n );\n }\n\n /**\n * The merchant's connector accounts.\n *\n * Never wider than the caller: an API key pinned to one shop lists that\n * shop's connectors only, not every sibling shop's.\n *\n * `GET /account/{accountId}/connectors`\n */\n async list(accountId: string): Promise<ConnectorResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/connectors`);\n }\n\n /**\n * The profile-scoped connector list. The merchant-wide `list()` is\n * merchant-gated and 403s for a profile-entity (shop user) JWT; this\n * variant is scoped server-side to the caller's own profile.\n *\n * `GET /account/{accountId}/profile/connectors`\n */\n async listByProfile(accountId: string): Promise<ConnectorResponse[]> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/profile/connectors`);\n }\n\n /**\n * Every connector's pane capabilities, as the router itself knows them —\n * which rails a connector supports, and which methods it can publish as a\n * pane with the confirm routing keys each one carries.\n *\n * Capability facts only: no label, sublabel or category comes back. A\n * designer renders a method's copy from its own locale files, keyed by\n * `key`, and takes `payment_method` / `payment_method_type` from here\n * verbatim rather than deriving them client-side.\n *\n * This is what the pane helpers in `src/panes.ts` should be driven from —\n * `paneMethodInfo`, `defaultPane` and `validatePanes` all take a\n * {@link PanesConnectorCatalog} out of this response, so a connector the\n * router starts publishing panes for needs no SDK release.\n *\n * `GET /account/{accountId}/connectors/native-panes/catalog`\n *\n * The path keeps the `native-panes` spelling deliberately. The identifiers\n * were renamed off \"native pane\"; the route was not, and pointing at the\n * backend's new name before it is deployed everywhere would both 404 against\n * un-upgraded replicas mid-rollout and fail `scripts/parity-check.mjs`,\n * which blocks publishing.\n */\n async getPanesCatalog(accountId: string): Promise<PanesCatalogResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/native-panes/catalog`,\n );\n }\n\n /** @deprecated Renamed to {@link getPanesCatalog}. Removed in 0.112.0. */\n async getNativePanesCatalog(accountId: string): Promise<PanesCatalogResponse> {\n return this.getPanesCatalog(accountId);\n }\n\n /**\n * Sweep the merchant's own e-Payouts module and return the rails it\n * actually has enabled. Server-side this makes many upstream calls, so it\n * can take several seconds — show progress.\n *\n * `POST /account/{accountId}/connectors/{connectorId}/epayouts/catalog/sync`\n */\n async syncEpayoutsCatalog(\n accountId: string,\n connectorId: string,\n ): Promise<EpayoutsCatalogResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/epayouts/catalog/sync`,\n );\n }\n\n /**\n * Update a connector account.\n *\n * `connector_webhook_details` **merges** into the stored block key by key:\n * an absent key keeps its stored secret, an explicit value is written, and\n * an explicit empty string clears that secret. Send only the\n * keys the operator typed — padding the other environment's keys with `''`\n * clears a live signing secret and inbound webhooks stop verifying.\n *\n * The other credential-bearing fields — `connector_wallets_details`,\n * `pm_auth_config`, `additional_merchant_data` — are still whole-value\n * replacements: omit them unless you are writing a complete new value.\n *\n * `POST /account/{accountId}/connectors/{connectorId}`\n */\n async update(\n accountId: string,\n connectorId: string,\n params: ConnectorUpdateRequest,\n options?: RequestExtras,\n ): Promise<ConnectorResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,\n {\n body: params,\n ...options,\n },\n );\n }\n\n /**\n * Remove a connector account.\n *\n * A shop-scoped role may remove a connector of its own shop — the shop is\n * re-checked server-side — so creating processors and removing them are the\n * same rung of access rather than two.\n *\n * `DELETE /account/{accountId}/connectors/{connectorId}`\n */\n async delete(accountId: string, connectorId: string): Promise<ConnectorResponse> {\n return this.request(\n 'DELETE',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}`,\n );\n }\n\n /**\n * Clone a connector into another shop (business profile) of the same\n * merchant. `POST /account/{accountId}/connectors/{connectorId}/clone`\n *\n * Credentials are copied server-side, re-encrypted under the same merchant\n * key, so the caller never has to *supply* them — `retrieve` returns `null`\n * for the credential fields, which is what makes a client-side copy\n * impossible in the first place.\n *\n * The response, however, is the unredacted connector: `connector_account_details`\n * is masked, but `connector_webhook_details`, `connector_wallets_details`,\n * `pm_auth_config` and `additional_merchant_data` come back with the copied\n * secrets in them — values this caller never sent. Do not log or echo the\n * response; read `merchant_connector_id` and discard the rest.\n */\n async clone(\n accountId: string,\n connectorId: string,\n params: ConnectorCloneRequest,\n ): Promise<ConnectorResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/clone`,\n { body: params },\n );\n }\n\n /**\n * Share a connector with more shops of the same merchant.\n * `POST /account/{accountId}/connectors/{connectorId}/shops`\n *\n * Nothing is copied: every shop sends payments to the same account, on the\n * same credentials and webhook, and the account's limits count them all.\n */\n async addShops(\n accountId: string,\n connectorId: string,\n params: ConnectorShopsAddRequest,\n ): Promise<ConnectorShopsResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops`,\n { body: params },\n );\n }\n\n /**\n * Fold copies of the same provider account into this connector.\n * `POST /account/{accountId}/connectors/{connectorId}/consolidate`\n *\n * The copies' shops move to the connector with their on/off state, routing,\n * checkout layout, currencies, saved credentials, mandates and\n * subscriptions. A copy keeps answering for the payments made on it and\n * serves no shop. Send `dry_run: true` first, then confirm with the\n * preview's `preview_token` and a choice for every conflict.\n */\n async consolidate(\n accountId: string,\n connectorId: string,\n params: ConnectorConsolidationRequest,\n ): Promise<ConnectorConsolidationResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/consolidate`,\n { body: params },\n );\n }\n\n /**\n * Switch a connector off, or back on, in one shop it serves.\n * `POST /account/{accountId}/connectors/{connectorId}/shops/{profileId}`\n */\n async setShopDisabled(\n accountId: string,\n connectorId: string,\n profileId: string,\n params: ConnectorShopUpdateRequest,\n ): Promise<ConnectorShopsResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`,\n { body: params },\n );\n }\n\n /**\n * Stop a connector serving one shop. Any shop may leave, the\n * one the connector was created in included, while another one stays: the\n * last shop is refused, and the connector is deleted instead. The account,\n * its limits and every other shop on it are unaffected.\n * `DELETE /account/{accountId}/connectors/{connectorId}/shops/{profileId}`\n */\n async removeShop(\n accountId: string,\n connectorId: string,\n profileId: string,\n ): Promise<ConnectorShopsResponse> {\n return this.request(\n 'DELETE',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}`,\n );\n }\n\n /**\n * Read the transaction currencies a connector may process: its own list,\n * what the provider is known to accept with its methods, and the effective\n * currencies in each shop it serves.\n * `GET /account/{accountId}/connectors/{connectorId}/currencies`\n */\n async getCurrencies(\n accountId: string,\n connectorId: string,\n ): Promise<ConnectorCurrencyPolicyResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`,\n );\n }\n\n /**\n * Set the transaction currencies a connector may process in every shop it\n * serves, and what it does with a payment in a currency it does not take\n * (`conversion`). `allowed_currencies: null` allows every currency the\n * provider supports; a field left out stays as it is. With `dry_run`,\n * nothing is saved and `impact` reports the effect.\n * `PUT /account/{accountId}/connectors/{connectorId}/currencies`\n */\n async setCurrencies(\n accountId: string,\n connectorId: string,\n params: ConnectorCurrencyPolicyUpdateRequest,\n ): Promise<ConnectorCurrencyPolicyResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/currencies`,\n { body: params },\n );\n }\n\n /**\n * Narrow a connector's currencies in one shop it serves, within the\n * connector's own list, or set the shop's own `conversion`. `null` returns\n * the shop to the connector's setting; a field left out stays as it is.\n * `PUT /account/{accountId}/connectors/{connectorId}/shops/{profileId}/currencies`\n */\n async setShopCurrencies(\n accountId: string,\n connectorId: string,\n profileId: string,\n params: ConnectorCurrencyPolicyUpdateRequest,\n ): Promise<ConnectorCurrencyPolicyResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/shops/${encodeURIComponent(profileId)}/currencies`,\n { body: params },\n );\n }\n\n // --- Advanced operations (Task 4.8) ---\n\n /**\n * Run the configuration checks for a vault (VGS) connector account:\n * credential validity, write-only Collect scope, reachability, environment\n * coherence, route coverage. Read-only but not cheap — it decrypts the\n * vault's management credential and talks to VGS.\n *\n * `POST /account/{accountId}/connectors/{connectorId}/vault/verify`\n */\n async verifyVault(\n accountId: string,\n connectorId: string,\n params: VaultVerifyRequest,\n ): Promise<VaultVerificationResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/vault/verify`,\n { body: params },\n );\n }\n\n /**\n * The shops whose card vault is switched on and whose vault account has\n * stopped working, each with the cause. While a shop is listed, its card\n * form cannot be shown and its card payments fail.\n *\n * An outage is listed once the vault has refused the account several times\n * in a row over at least a minute, and is taken off the list when the vault\n * serves the account again. Nothing switches a vault off by itself: see\n * `profiles.switchVaultOff`.\n *\n * `GET /account/{accountId}/vault/outages`\n */\n async listVaultOutages(accountId: string): Promise<VaultOutagesResponse> {\n return this.request('GET', `/account/${encodeURIComponent(accountId)}/vault/outages`);\n }\n\n /**\n * Compute the route document the vault SHOULD have and diff it against\n * what exists, without writing anything. The returned fingerprints must be\n * echoed byte for byte on {@link Connectors.applyVaultRoutes}.\n *\n * A router without these endpoints answers 404 — render that as \"this\n * build cannot configure routes\", never as \"there is nothing to change\".\n *\n * `POST /account/{accountId}/connectors/{connectorId}/vault/routes/preview`\n */\n async previewVaultRoutes(\n accountId: string,\n connectorId: string,\n params: VaultRoutesPreviewRequest,\n ): Promise<VaultRoutesPreviewResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/vault/routes/preview`,\n { body: params },\n );\n }\n\n /**\n * Write the routes the merchant just previewed. Both fingerprints come\n * from the preview and are opaque: `expected_current_fingerprint` says the\n * vault has not moved (`null` = \"the preview found no routes\" and is sent\n * as `null`, never omitted), `expected_desired_fingerprint` says the\n * document is still the one on screen. A 409 (`DE_04`) means the vault\n * changed since the preview — nothing was written; preview again.\n *\n * `POST /account/{accountId}/connectors/{connectorId}/vault/routes/apply`\n */\n async applyVaultRoutes(\n accountId: string,\n connectorId: string,\n params: VaultRoutesApplyRequest,\n ): Promise<VaultRoutesApplyResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/vault/routes/apply`,\n { body: params },\n );\n }\n\n /**\n * What the processor says about this connector account: whether it will\n * accept charges, which capabilities are live, and anything it is still\n * waiting on.\n *\n * This is **not** {@link Connectors.verify}. That one asks whether the stored\n * credentials work, by running a test-card authorization; a processor can\n * revoke an account's ability to take payments while the credentials stay\n * perfectly valid, and then a credential check reports healthy while every\n * checkout silently stalls. This asks the account's own status instead, and\n * does not create a payment. By default it reads a scheduler snapshot;\n * `refresh: true` asks for a new probe and `stale` identifies an overdue result.\n * `test_mode` selects the requested environment; `credential_source` identifies\n * a sandbox, live or shared credential set. Not every provider reports chargeability.\n *\n * Connectors with no probe answer `state: 'unknown'` with\n * `unknown_reason: 'connector_not_supported'`, rather than an error — every\n * `'unknown'` carries a reason code you render your own words for. A router\n * without this endpoint answers 404 — render that as \"this build cannot\n * report health\", never as \"healthy\".\n *\n * `GET /account/{accountId}/connectors/{connectorId}/health`\n */\n async health(\n accountId: string,\n connectorId: string,\n options?: { test_mode?: boolean; refresh?: boolean },\n ): Promise<ConnectorHealthResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(accountId)}/connectors/${encodeURIComponent(connectorId)}/health`,\n { query: options },\n );\n }\n\n /** Verify connector credentials. `POST /account/connectors/verify` */\n async verify(params: Record<string, unknown>): Promise<Record<string, unknown>> {\n return this.request('POST', '/account/connectors/verify', { body: params });\n }\n\n /**\n * Register a webhook for a connector.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}`\n *\n * @param params - Optional event scope. Defaults to `{ event_type: 'all_events' }`\n * when omitted; pass `{ event_type: { specific_event: '…' } }` to scope\n * to a single event.\n */\n async registerWebhook(\n merchantId: string,\n connectorId: string,\n params?: ConnectorWebhookRegisterRequest,\n ): Promise<ConnectorWebhookRegisterResponse> {\n const path = `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`;\n if (params === undefined) return this.request('POST', path);\n return this.request('POST', path, { body: params });\n }\n\n /**\n * Register checkout/shop domains as Stripe payment method domains, so Apple\n * Pay renders on those pages.\n * `POST /account/{merchantId}/connectors/{connectorId}/stripe/payment-method-domains`\n *\n * Stripe connectors only. One call registers against a single credential set\n * (`environment`, default `'live'`) — call twice to cover live and sandbox.\n * Per-URL outcomes come back in `results`; a missing sandbox credential set\n * is a request-level 400.\n */\n async registerStripePaymentMethodDomains(\n merchantId: string,\n connectorId: string,\n params: StripePaymentMethodDomainsRegisterRequest,\n ): Promise<StripePaymentMethodDomainsRegisterResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/stripe/payment-method-domains`,\n { body: params },\n );\n }\n\n /**\n * Register checkout/shop domains as Airwallex Apple Pay domains, so Apple Pay\n * renders on those pages.\n * `POST /account/{merchantId}/connectors/{connectorId}/airwallex/apple-pay-domains`\n *\n * Airwallex connectors only. One call registers against a single credential\n * set (`environment`, default `'live'`) — call twice to cover live and\n * sandbox. Idempotent: a host already on the account comes back\n * `already_registered` without a write.\n */\n async registerAirwallexApplePayDomains(\n merchantId: string,\n connectorId: string,\n params: AirwallexApplePayDomainsRegisterRequest,\n ): Promise<AirwallexApplePayDomainsRegisterResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/airwallex/apple-pay-domains`,\n { body: params },\n );\n }\n\n /**\n * Register and verify checkout/shop domains as Whop Apple Pay payment method\n * domains, so Apple Pay renders in Whop's embedded card form on those pages.\n * `POST /account/{merchantId}/connectors/{connectorId}/whop/apple-pay-domains`\n *\n * Whop connectors only. One call registers against a single credential set\n * (`environment`, default `'live'`) — call twice to cover live and sandbox.\n * Idempotent: a host Whop already holds as verified comes back\n * `already_verified` without a write, and a `pending` one is verified again.\n */\n async registerWhopApplePayDomains(\n merchantId: string,\n connectorId: string,\n params: WhopApplePayDomainsRegisterRequest,\n ): Promise<WhopApplePayDomainsRegisterResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/whop/apple-pay-domains`,\n { body: params },\n );\n }\n\n /** Get registered webhooks for a connector. `GET /account/{merchantId}/connectors/webhooks/{connectorId}` */\n async getWebhook(merchantId: string, connectorId: string): Promise<ConnectorWebhookListResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}`,\n );\n }\n\n /**\n * Bring an already-registered webhook's event subscription up to date with\n * the events Delopay handles.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/sync-events`\n *\n * A PSP freezes an endpoint's event list at registration time, so an endpoint\n * created before an event type was added never receives it — silently, with\n * no error anywhere. {@link getWebhook} reports the gap as `missing_events`;\n * this repairs it.\n *\n * Unlike re-registering, the endpoints are updated in place: the endpoint id\n * and its signing secret are preserved, so signature verification keeps\n * working across the change. Stripe connectors only; idempotent, so it is\n * safe to call on a schedule or after every deploy.\n *\n * @example\n * ```typescript\n * const sync = await delopay.connectors.syncWebhookEvents('mer_abc', 'mca_xyz');\n * for (const endpoint of sync.endpoints) {\n * if (endpoint.error_message) console.warn(endpoint.connector_webhook_id, endpoint.error_message);\n * else if (endpoint.updated) console.log('subscribed', endpoint.added_events);\n * }\n * ```\n */\n async syncWebhookEvents(\n merchantId: string,\n connectorId: string,\n ): Promise<ConnectorWebhookSyncResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/sync-events`,\n );\n }\n\n /**\n * Read the callback addresses of a connector's payment provider.\n * `GET /account/{merchantId}/connectors/webhooks/{connectorId}/address`\n *\n * One entry per environment: the saved mode and identifier, and for every\n * credential group the URL the policy asks for (`desired_url`) beside the URL\n * actually registered at the provider (`registered_url`) with its `status`.\n * Only `registered` means the provider delivers to the desired URL.\n *\n * Available for providers whose webhooks Delopay manages (Stripe, PayPal,\n * Airwallex, Whop) and for hand-configured ones (Creem, NomuPay,\n * MicroPayment). Other connectors are refused with a 400.\n */\n async getWebhookAddress(\n merchantId: string,\n connectorId: string,\n ): Promise<WebhookAddressResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address`,\n );\n }\n\n /**\n * Validate a proposed callback address without saving it.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/address/preview`\n *\n * Returns the validation errors as `{ field, code }` pairs, the URL every\n * affected credential group would get, the connector accounts that share it,\n * and whether saving needs `confirm_shared: true`. Needs the same permission\n * as saving.\n *\n * @example\n * ```typescript\n * const preview = await delopay.connectors.previewWebhookAddress('mer_abc', 'mca_xyz', {\n * environment: 'live',\n * mode: 'anonymous',\n * format: { prefix: 'wh-', style: 'alphanumeric', length: 16 },\n * });\n * if (!preview.valid) console.warn(preview.errors);\n * ```\n */\n async previewWebhookAddress(\n merchantId: string,\n connectorId: string,\n params: WebhookAddressRequest,\n ): Promise<WebhookAddressPreviewResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address/preview`,\n { body: params },\n );\n }\n\n /**\n * Save the callback address of a connector's payment provider for one\n * environment.\n * `PUT /account/{merchantId}/connectors/webhooks/{connectorId}/address`\n *\n * The address applies to every connector account of that provider and\n * environment, so `confirm_shared: true` is required when other accounts are\n * affected. For a managed provider Delopay then registers the new URL and\n * keeps the former one accepted; the response reports each credential\n * group's outcome in `status`. A `pending` or `failed` group keeps receiving\n * on its previous URL and is retried. For a hand-configured provider the\n * merchant enters the new `desired_url` at the provider.\n *\n * A refused proposal answers 422 with error code `IR_06` and the message\n * `Webhook address refused: field:code,…`. A save that lost to a concurrent\n * change of the same address answers 422 with error code `HE_00` and can be\n * repeated. A caller who may not edit every affected account answers 403.\n * Address changes are limited per provider and environment (`rate_limit`).\n */\n async updateWebhookAddress(\n merchantId: string,\n connectorId: string,\n params: WebhookAddressRequest,\n ): Promise<WebhookAddressResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/address`,\n { body: params },\n );\n }\n\n /**\n * Read how the return addresses of a connector's payment provider name the\n * merchant, per environment.\n * `GET /account/{merchantId}/connectors/{connectorId}/return-address`\n *\n * A return address is where the provider sends the buyer back after a step\n * it hosts. It belongs to the merchant, the provider and the environment,\n * so every connector account of that provider follows it.\n */\n async getReturnAddress(merchantId: string, connectorId: string): Promise<ReturnAddressResponse> {\n return this.request(\n 'GET',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address`,\n );\n }\n\n /**\n * Validate a proposed return address without saving it.\n * `POST /account/{merchantId}/connectors/{connectorId}/return-address/preview`\n *\n * Nothing is reserved: a generated identifier in the answer is an example.\n * Needs the same permission as saving.\n *\n * @example\n * ```typescript\n * const preview = await delopay.connectors.previewReturnAddress('mer_abc', 'mca_xyz', {\n * environment: 'live',\n * mode: 'anonymous',\n * share_webhook_identifier: true,\n * });\n * if (!preview.valid) console.warn(preview.errors);\n * ```\n */\n async previewReturnAddress(\n merchantId: string,\n connectorId: string,\n params: ReturnAddressRequest,\n ): Promise<ReturnAddressPreviewResponse> {\n return this.request(\n 'POST',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address/preview`,\n { body: params },\n );\n }\n\n /**\n * Save the return address of a connector's payment provider for one\n * environment.\n * `PUT /account/{merchantId}/connectors/{connectorId}/return-address`\n *\n * Payments started afterwards get return addresses of the new form; every\n * address already handed to the provider keeps working. A refused proposal\n * answers 422 with error code `IR_06` and the message\n * `Return address refused: field:code,…`. A caller who may not edit every\n * connector account of the provider answers 403. Address changes are\n * limited per provider and environment (`rate_limit`).\n */\n async updateReturnAddress(\n merchantId: string,\n connectorId: string,\n params: ReturnAddressRequest,\n ): Promise<ReturnAddressResponse> {\n return this.request(\n 'PUT',\n `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address`,\n { body: params },\n );\n }\n\n /**\n * Every webhook the connector's payment provider lists for its credentials\n * in one environment: Delopay's own, other connector accounts', former\n * addresses' and other integrations'.\n * `GET /account/{merchantId}/connectors/webhooks/{connectorId}/provider`\n *\n * Available for Stripe, PayPal, Airwallex, Whop and Adyen. Destinations are\n * masked; `capabilities` says which changes the provider allows and\n * `editable` whether the caller may make them.\n */\n async listProviderWebhooks(\n merchantId: string,\n connectorId: string,\n environment: WebhookRegistrationEnvironment,\n ): Promise<ProviderWebhookListResponse> {\n return this.request('GET', providerWebhooksPath(merchantId, connectorId), {\n query: { environment },\n });\n }\n\n /**\n * Create a webhook at the provider for the merchant's own systems.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/provider`\n *\n * The URL must be `https` and outside Delopay; Delopay's own webhook is\n * registered with `registerWebhook`. A returned `signing_secret` is not kept\n * by Delopay and cannot be read again.\n */\n async createProviderWebhook(\n merchantId: string,\n connectorId: string,\n params: ProviderWebhookCreateRequest,\n ): Promise<ProviderWebhookCreateResponse> {\n return this.request('POST', providerWebhooksPath(merchantId, connectorId), { body: params });\n }\n\n /**\n * Change one webhook at the provider.\n * `PATCH /account/{merchantId}/connectors/webhooks/{connectorId}/provider/{webhookId}`\n *\n * Refused once the webhook changed since `fingerprint`, and for Delopay's\n * own webhooks.\n */\n async updateProviderWebhook(\n merchantId: string,\n connectorId: string,\n webhookId: string,\n params: ProviderWebhookUpdateRequest,\n ): Promise<ProviderWebhookEndpoint> {\n return this.request(\n 'PATCH',\n `${providerWebhooksPath(merchantId, connectorId)}/${encodeURIComponent(webhookId)}`,\n { body: params },\n );\n }\n\n /**\n * Delete one webhook at the provider.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/provider/{webhookId}/delete`\n *\n * Refused once the webhook changed since `fingerprint`. Deleting Delopay's\n * own webhook needs `confirm_managed: true`; another connector account's is\n * never deleted from here.\n */\n async deleteProviderWebhook(\n merchantId: string,\n connectorId: string,\n webhookId: string,\n params: ProviderWebhookDeleteRequest,\n ): Promise<ProviderWebhookDeleteResult> {\n return this.request(\n 'POST',\n `${providerWebhooksPath(merchantId, connectorId)}/${encodeURIComponent(webhookId)}/delete`,\n { body: params },\n );\n }\n\n /**\n * What \"replace all\" would delete and keep. Nothing is changed.\n * `GET /account/{merchantId}/connectors/webhooks/{connectorId}/provider/replace`\n */\n async previewProviderWebhookReplace(\n merchantId: string,\n connectorId: string,\n environment: WebhookRegistrationEnvironment,\n ): Promise<ProviderWebhookReplacePreviewResponse> {\n return this.request('GET', `${providerWebhooksPath(merchantId, connectorId)}/replace`, {\n query: { environment },\n });\n }\n\n /**\n * Keep only Delopay's webhook: delete exactly the confirmed webhooks of the\n * preview, after registering Delopay's own unless `sequence` is\n * `delete_first`.\n * `POST /account/{merchantId}/connectors/webhooks/{connectorId}/provider/replace`\n *\n * A list that changed since the preview answers `scope_changed` and deletes\n * nothing. A second replacement while one runs is refused as busy (`HE_00`).\n */\n async replaceProviderWebhooks(\n merchantId: string,\n connectorId: string,\n params: ProviderWebhookReplaceRequest,\n ): Promise<ProviderWebhookReplaceResponse> {\n return this.request('POST', `${providerWebhooksPath(merchantId, connectorId)}/replace`, {\n body: params,\n });\n }\n\n /** List available payment methods. `GET /account/payment-methods` */\n async listPaymentMethods(): Promise<Record<string, unknown>[]> {\n return this.request('GET', '/account/payment-methods');\n }\n}\n\nfunction providerWebhooksPath(merchantId: string, connectorId: string): string {\n return `/account/${encodeURIComponent(merchantId)}/connectors/webhooks/${encodeURIComponent(connectorId)}/provider`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GG52SAHA.cjs","../src/resources/refunds.ts"],"names":[],"mappings":"AAAA;ACoBO,IAAM,QAAA,EAAN,MAAc;AAAA,EACnB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAAA;AAKoC,EAAA;AAC6B,IAAA;AACjE,EAAA;AAAA;AAKoC,EAAA;AACgC,IAAA;AACpE,EAAA;AAAA;AAKoC,EAAA;AACgC,IAAA;AACpE,EAAA;AAAA;AAG+F,EAAA;AAC1B,IAAA;AAC3D,MAAA;AACP,IAAA;AACH,EAAA;AACF;ADnDwE;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GG52SAHA.cjs","sourcesContent":[null,"import type {\n BuyerRefundRequest,\n BuyerRefundRequestApprove,\n BuyerRefundRequestDecline,\n BuyerRefundRequestList,\n BuyerRefundRequestListQuery,\n RefundCreateRequest,\n RefundResponse,\n RefundUpdateRequest,\n RefundListParams,\n RefundListResponse,\n RefundAggregateResponse,\n RefundBulkBlockBuyerRequest,\n RefundBulkBlockBuyerResponse,\n RefundBulkBlockPreviewRequest,\n RefundBulkBlockPreviewResponse,\n} from '../types';\nimport type { RequestExtras, RequestFn } from '../client';\n\n/** Create and manage refunds for completed payments. */\nexport class Refunds {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Create a refund for a payment.\n *\n * Dashboard-initiated refunds are subject to the caller's operation-limit\n * rule, resolved against the role the request authenticated with. An\n * over-limit refund either fails with `DE_01` (the rule blocks) or with\n * HTTP 409 `DE_06` — the rule requires approval, and `DelopayError.data`\n * carries `PendingApprovalErrorDetails`. No refund exists in either case;\n * `DE_06` names one that a second approver can still let through, via\n * `operationLimits.approve()`.\n *\n * @param params - Refund parameters, including the required `payment_id` and optional amount.\n * @returns The created refund.\n *\n * @example\n * ```typescript\n * const refund = await delopay.refunds.create({\n * payment_id: 'pay_abc123',\n * amount: 2500, // partial refund of 25.00 EUR\n * });\n * ```\n */\n async create(params: RefundCreateRequest): Promise<RefundResponse> {\n return this.request('POST', '/refunds', { body: params });\n }\n\n /**\n * Retrieve a refund by its ID.\n *\n * @param refundId - The unique refund ID.\n * @returns The refund.\n *\n * @example\n * ```typescript\n * const refund = await delopay.refunds.retrieve('ref_abc123');\n * ```\n */\n async retrieve(refundId: string): Promise<RefundResponse> {\n return this.request('GET', `/refunds/${encodeURIComponent(refundId)}`);\n }\n\n /**\n * Update the reason or metadata on an existing refund.\n *\n * @param refundId - The refund ID to update.\n * @param params - Fields to update (reason, metadata).\n * @returns The updated refund.\n */\n async update(\n refundId: string,\n params: RefundUpdateRequest,\n options?: RequestExtras,\n ): Promise<RefundResponse> {\n return this.request('POST', `/refunds/${encodeURIComponent(refundId)}`, {\n body: params,\n ...options,\n });\n }\n\n /**\n * List refunds, optionally filtered by payment, status, or date range.\n *\n * @param params - Optional filter and pagination parameters.\n * @returns Paginated list of refunds.\n */\n async list(params?: RefundListParams): Promise<RefundListResponse> {\n return this.request('POST', '/refunds/list', { body: params });\n }\n\n /**\n * Every identifier a block of each selected refund's buyer would name,\n * changing nothing: the payment's email and customer id, and every IP\n * address and device id seen on its checkout, each with where it was seen\n * and whether it is already blocked. Name the refunds by `ids` or by the\n * list's `filters`, exactly one of the two; at most `max_refunds` are read.\n *\n * `POST /refunds/bulk/block-buyer/preview`. Needs a dashboard JWT.\n */\n async bulkBlockPreview(\n request: RefundBulkBlockPreviewRequest,\n ): Promise<RefundBulkBlockPreviewResponse> {\n return this.request('POST', '/refunds/bulk/block-buyer/preview', { body: request });\n }\n\n /**\n * Add the buyer of each listed refund's payment to the buyer blocklist with\n * the chosen `kinds`, leaving out the `exclude`d identifiers, at most the\n * preview's `max_run_refunds` per call. The server reads each payment again;\n * it never blocks a value the request names. Identifiers already blocked\n * are not added again, and every refund gets its own result.\n *\n * `POST /refunds/bulk/block-buyer`. Needs a dashboard JWT.\n */\n async bulkBlockBuyer(\n request: RefundBulkBlockBuyerRequest,\n ): Promise<RefundBulkBlockBuyerResponse> {\n return this.request('POST', '/refunds/bulk/block-buyer', { body: request });\n }\n\n // --- OLAP extensions (Task 4.3) ---\n\n /**\n * Refund requests buyers raised from the customer portal, newest first.\n * Limited to the caller's shop when the caller is scoped to one.\n * `GET /refund-requests`\n */\n async listRequests(params?: BuyerRefundRequestListQuery): Promise<BuyerRefundRequestList> {\n return this.request('GET', '/refund-requests', {\n query: params as Record<string, string | number | null | undefined>,\n });\n }\n\n /**\n * Approve a buyer's refund request with a refund of its payment that has\n * succeeded, made with `create()` after the buyer asked. Approving records\n * the decision and moves no money. A refund that is still `pending` or in\n * `review` is refused: check it again later with `retrieve()` under the same\n * refund ID and approve once it has succeeded, rather than creating another\n * refund. `POST /refund-requests/{id}/approve`\n *\n * @example\n * ```typescript\n * const refund = await delopay.refunds.create({ payment_id: request.payment_id, amount: request.amount });\n * if (refund.status === 'succeeded') {\n * await delopay.refunds.approveRequest(request.id, { refund_id: refund.refund_id });\n * }\n * // Otherwise keep refund.refund_id, check it with retrieve() and approve once it has succeeded.\n * ```\n */\n async approveRequest(\n requestId: string,\n params: BuyerRefundRequestApprove,\n ): Promise<BuyerRefundRequest> {\n return this.request('POST', `/refund-requests/${encodeURIComponent(requestId)}/approve`, {\n body: params,\n });\n }\n\n /** Decline a buyer's refund request. The buyer sees the reply. `POST /refund-requests/{id}/decline` */\n async declineRequest(\n requestId: string,\n params: BuyerRefundRequestDecline,\n ): Promise<BuyerRefundRequest> {\n return this.request('POST', `/refund-requests/${encodeURIComponent(requestId)}/decline`, {\n body: params,\n });\n }\n\n /** List refunds (profile-scoped). `POST /refunds/profile/list` */\n async listByProfile(params?: RefundListParams): Promise<RefundListResponse> {\n return this.request('POST', '/refunds/profile/list', { body: params });\n }\n\n /** Get refund filter options. `GET /refunds/filter` */\n async getFilters(\n params?: Record<string, string | number | undefined>,\n ): Promise<Record<string, unknown>> {\n return this.request('GET', '/refunds/filter', { query: params });\n }\n\n /** Get refund aggregates. `GET /refunds/aggregate` */\n async aggregate(\n params?: Record<string, string | number | undefined>,\n ): Promise<RefundAggregateResponse> {\n return this.request('GET', '/refunds/aggregate', { query: params });\n }\n\n /** Get refund aggregates (profile-scoped). `GET /refunds/profile/aggregate` */\n async aggregateByProfile(\n params?: Record<string, string | number | undefined>,\n ): Promise<RefundAggregateResponse> {\n return this.request('GET', '/refunds/profile/aggregate', { query: params });\n }\n\n /** Manually update refund status. `PUT /refunds/{refundId}/manual-update` */\n async manualUpdate(refundId: string, params: Record<string, unknown>): Promise<RefundResponse> {\n return this.request('PUT', `/refunds/${encodeURIComponent(refundId)}/manual-update`, {\n body: params,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GGYLU7YO.cjs","../src/internal/resources/adminIndustries.ts"],"names":[],"mappings":"AAAA;ACWA,IAAM,KAAA,EAAO,CAAC,EAAA,EAAA,GAAuB,CAAA,yBAAA,EAA4B,kBAAA,CAAmB,EAAE,CAAC,CAAA,CAAA;AAmB1D;AACsB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGX,EAAA;AACgB,IAAA;AACvD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqE,EAAA;AACH,IAAA;AAClE,EAAA;AAAA;AAGyF,EAAA;AAChC,IAAA;AACzD,EAAA;AAAA;AAAA;AAAA;AAAA;AAM6D,EAAA;AACF,IAAA;AAC3D,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO6D,EAAA;AACF,IAAA;AAC3D,EAAA;AAAA;AAAA;AAAA;AAAA;AAMiG,EAAA;AAC9B,IAAA;AACnE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOqE,EAAA;AACF,IAAA;AACnE,EAAA;AACF;ADhCsE;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GGYLU7YO.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n IndustryAvailability,\n IndustryCatalog,\n IndustryCategory,\n IndustryCreateRequest,\n IndustryPreview,\n IndustryPreviewQuery,\n IndustryRenameRequest,\n} from '../types';\n\nconst path = (id: string): string => `/admin-portal/industries/${encodeURIComponent(id)}`;\n\n/**\n * The industry catalog: industries, their sub-industries, and where each one\n * can be selected. Reads take any internal role; changes need the account\n * management permission. Every change is recorded in the audit log\n * (`entity_type: 'industry'`), and a change that changes nothing records\n * nothing.\n *\n * An entry is selectable at a merchant, project or shop when it is active,\n * (for a sub-industry) its industry is selectable there too, and its own\n * availability is `all` or one of its scopes reaches the target.\n *\n * Errors: `IR_06` (422) an invalid name, scope or availability, a parent that\n * is a sub-industry, or a preview naming both a project and a shop; `IR_37`\n * (404) an unknown entry, parent, merchant, project or shop; `IR_38` (400) an\n * active sibling already has the name; `IR_16` (400) the parent industry is\n * archived.\n */\nexport class AdminIndustries {\n constructor(private readonly request: RequestFn) {}\n\n /** The whole catalog, archived entries included. `GET /admin-portal/industries` */\n async list(): Promise<IndustryCatalog> {\n return this.request('GET', '/admin-portal/industries');\n }\n\n /**\n * Create an industry, or a sub-industry under `parent_id`. Without\n * `availability` it can be selected nowhere until availability is set.\n * `POST /admin-portal/industries`\n */\n async create(body: IndustryCreateRequest): Promise<IndustryCategory> {\n return this.request('POST', '/admin-portal/industries', { body });\n }\n\n /** Rename an entry; its id stays. `PATCH /admin-portal/industries/{industry_id}` */\n async rename(industryId: string, body: IndustryRenameRequest): Promise<IndustryCategory> {\n return this.request('PATCH', path(industryId), { body });\n }\n\n /**\n * Stop offering an entry, and for an industry its sub-industries, for new\n * selections. Existing selections keep it. `POST /admin-portal/industries/{industry_id}/archive`\n */\n async archive(industryId: string): Promise<IndustryCategory> {\n return this.request('POST', `${path(industryId)}/archive`);\n }\n\n /**\n * Offer an archived entry again. Refused while an active sibling holds its\n * name, or for a sub-industry while its industry is archived.\n * `POST /admin-portal/industries/{industry_id}/restore`\n */\n async restore(industryId: string): Promise<IndustryCategory> {\n return this.request('POST', `${path(industryId)}/restore`);\n }\n\n /**\n * Replace where an entry can be selected.\n * `PUT /admin-portal/industries/{industry_id}/availability`\n */\n async setAvailability(industryId: string, body: IndustryAvailability): Promise<IndustryCategory> {\n return this.request('PUT', `${path(industryId)}/availability`, { body });\n }\n\n /**\n * Every entry as seen from one merchant, or one of its projects or shops:\n * whether it can be selected there, why, and which scope grants it.\n * `GET /admin-portal/industries/preview`\n */\n async preview(query: IndustryPreviewQuery): Promise<IndustryPreview> {\n return this.request('GET', '/admin-portal/industries/preview', { query: { ...query } });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/delopay-sdk-publish/dist/chunk-GK5FWN4H.cjs","../src/resources/buyerAccount.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAGlD,MAAM,YAAA,CAAa,OAAA,EAA4D;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,6BAAA,EAA+B,EAAE,GAAG,QAAQ,CAAC,CAAA;AAAA,EAC1E;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,WAAA,CACJ,MAAA,EACA,OAAA,EACqC;AACrC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,wBAAA,EAA0B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACpF;AAAA;AAAA,EAGA,MAAM,UAAA,CACJ,MAAA,EACA,OAAA,EAC8B;AAC9B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,6BAAA,EAA+B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACzF;AAAA;AAAA,EAGA,MAAM,UAAA,CACJ,MAAA,EACA,OAAA,EAC8B;AAC9B,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,6BAAA,EAA+B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ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AC3E,MAAA;AACf,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAa8B,EAAA;AACgB,IAAA;AAClB,IAAA;AACoB,IAAA;AACM,IAAA;AACb,IAAA;AAC3B,IAAA;AACV,MAAA;AACwF,MAAA;AAChE,MAAA;AAC1B,IAAA;AACF,EAAA;AAAA;AAQiB,EAAA;AACH,IAAA;AACV,MAAA;AACwF,MAAA;AACxF,MAAA;AACgB,QAAA;AACX,QAAA;AACL,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAQiB,EAAA;AACH,IAAA;AACV,MAAA;AACwF,MAAA;AACxF,MAAA;AACK,QAAA;AACL,MAAA;AACF,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY+B,EAAA;AACjB,IAAA;AACV,MAAA;AACwF,MAAA;AAC7D,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAQ+B,EAAA;AACjB,IAAA;AACV,MAAA;AACwF,MAAA;AAC7D,MAAA;AAC7B,IAAA;AACF,EAAA;AACF;ADpKwG;AACA;AACA;AACA","file":"/tmp/delopay-sdk-publish/dist/chunk-GK5FWN4H.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n BuyerConversationAttachment,\n BuyerPortalAttachmentQuery,\n BuyerAccountAnalytics,\n BuyerAccountAnalyticsQuery,\n BuyerAccountAvailability,\n BuyerAccountConfirmation,\n BuyerAccountConfirmRequest,\n BuyerAccountInvoiceList,\n BuyerAccountListQuery,\n BuyerAccountPortal,\n BuyerAccountPurchasePage,\n BuyerAccountPurchaseQuery,\n BuyerAccountRefundRequestList,\n BuyerCaseList,\n BuyerNoticeSettings,\n BuyerPortalConversationList,\n BuyerPortalConversationQuery,\n BuyerPortalMessage,\n BuyerPortalMessageCreate,\n BuyerPortalMessagePage,\n BuyerAccountSession,\n BuyerAccountSessionInfo,\n BuyerAccountShopList,\n BuyerAccountSignInRequest,\n BuyerAccountSignInResponse,\n BuyerAccountSubscriptionList,\n BuyerAccountSubscriptionQuery,\n BuyerAccountSectionQuery,\n BuyerAccountVerifyCodeRequest,\n BuyerAccountVerifyLinkRequest,\n BuyerEvidence,\n BuyerEvidenceEntry,\n BuyerEvidenceExtensionRequest,\n BuyerEvidenceFile,\n BuyerEvidenceSubmit,\n} from '../types';\n\n/**\n * The buyer account: a buyer signs in with their email address, by a code or\n * a link mailed to it, and sees their purchases across merchants.\n *\n * Starting and completing a sign-in need no credential. Everything after it\n * needs the buyer account session: construct a separate client with the\n * session `token` as its key. A customer portal grant is not a buyer account\n * session, and neither is a merchant secret key or a dashboard JWT.\n */\nexport class BuyerAccount {\n constructor(private readonly request: RequestFn) {}\n\n /** Whether buyers can sign in on this platform, and which methods are offered. */\n async availability(options?: RequestExtras): Promise<BuyerAccountAvailability> {\n return this.request('GET', '/buyer-account/availability', { ...options });\n }\n\n /**\n * Mail a sign-in code, a link, or both to the address, as the platform\n * offers. The answer is the same whether or not the address has purchases.\n */\n async startSignIn(\n params: BuyerAccountSignInRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountSignInResponse> {\n return this.request('POST', '/buyer-account/sign-in', { body: params, ...options });\n }\n\n /** Complete a sign-in with the code from the message. */\n async verifyCode(\n params: BuyerAccountVerifyCodeRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountSession> {\n return this.request('POST', '/buyer-account/sign-in/code', { body: params, ...options });\n }\n\n /** Complete a sign-in with the token of the link in the message. */\n async verifyLink(\n params: BuyerAccountVerifyLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountSession> {\n return this.request('POST', '/buyer-account/sign-in/link', { body: params, ...options });\n }\n\n /** The current session: the address signed in with, masked, and its expiry. */\n async getSession(options?: RequestExtras): Promise<BuyerAccountSessionInfo> {\n return this.request('GET', '/buyer-account/session', { ...options });\n }\n\n /**\n * What the buyer is mailed about: a reply from a shop's team they have not\n * read, and news in their refund requests and disputes.\n */\n async noticeSettings(options?: RequestExtras): Promise<BuyerNoticeSettings> {\n return this.request('GET', '/buyer-account/notice-settings', { ...options });\n }\n\n /** Turn either mail on or off for the buyer, at every shop. */\n async setNoticeSettings(\n params: BuyerNoticeSettings,\n options?: RequestExtras,\n ): Promise<BuyerNoticeSettings> {\n return this.request('PUT', '/buyer-account/notice-settings', { body: params, ...options });\n }\n\n /** End the current session. */\n async signOut(options?: RequestExtras): Promise<void> {\n return this.request('DELETE', '/buyer-account/session', { ...options });\n }\n\n /**\n * The buyer's purchases across merchants, newest first, as receipts: shop,\n * date, amount, items and status. Page with `next_cursor`.\n */\n async listPurchases(\n params?: BuyerAccountPurchaseQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountPurchasePage> {\n return this.request('GET', '/buyer-account/purchases', {\n query: params as Record<string, string | number | null | undefined>,\n ...options,\n });\n }\n\n /**\n * The shops the buyer has purchases at, once each and by name. Pass a\n * shop's `shop` to `listPurchases` to list only that shop's purchases.\n */\n async listShops(options?: RequestExtras): Promise<BuyerAccountShopList> {\n return this.request('GET', '/buyer-account/shops', { ...options });\n }\n\n /**\n * The buyer's subscriptions across shops, newest first. A record the buyer\n * has not confirmed shows what a receipt carries, without its period or\n * cancellation. Follow `next_cursor` with the same shop and mode; an\n * omitted mode includes both modes.\n */\n async listSubscriptions(\n query?: BuyerAccountSubscriptionQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountSubscriptionList> {\n return this.request('GET', '/buyer-account/subscriptions', {\n query: query ? { ...query } : undefined,\n ...options,\n });\n }\n\n /**\n * The issued invoices of the records the buyer has confirmed through a\n * shop's own link, newest first. `unconfirmed_records` says when records\n * were left out. Follow `next_cursor` with the same shop and mode; an\n * omitted mode includes both modes.\n */\n async listInvoices(\n query?: BuyerAccountSectionQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountInvoiceList> {\n return this.request('GET', '/buyer-account/invoices', {\n query: query ? { ...query } : undefined,\n ...options,\n });\n }\n\n /**\n * The confirmed records' refund requests, newest first, with the shop's\n * decision. Follow `next_cursor` with the same shop and mode; an omitted\n * mode includes both modes.\n */\n async listRefundRequests(\n query?: BuyerAccountSectionQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountRefundRequestList> {\n return this.request('GET', '/buyer-account/refund-requests', {\n query: query ? { ...query } : undefined,\n ...options,\n });\n }\n\n /**\n * The cases of the records the buyer has confirmed: the refund requests\n * they sent and the disputes about their purchases, newest first, with\n * where each stands, who acts next, the outcome and the recorded steps.\n */\n async listCases(query?: BuyerAccountListQuery, options?: RequestExtras): Promise<BuyerCaseList> {\n return this.request('GET', '/buyer-account/cases', {\n query: query as Record<string, string | null | undefined>,\n ...options,\n });\n }\n\n /**\n * The conversations of the records the buyer has confirmed, the latest\n * message first. `unconfirmed_records` says when other records were left out.\n */\n async listConversations(\n query?: BuyerAccountListQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request('GET', '/buyer-account/conversations', {\n query: query as Record<string, string | null | undefined>,\n ...options,\n });\n }\n\n /**\n * The conversation of a confirmed record with one shop, and its newest\n * messages, oldest first; `before` pages back. `shop` is required here.\n */\n async listRecordMessages(\n record: string,\n query: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessagePage> {\n return this.request('GET', `/buyer-account/records/${encodeURIComponent(record)}/messages`, {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * A message from a confirmed record to one of its shops. A message to a\n * closed conversation reopens it. Sending again with the same\n * `client_message_id` returns the message the first send stored.\n */\n async sendRecordMessage(\n record: string,\n message: BuyerPortalMessageCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessage> {\n return this.request('POST', `/buyer-account/records/${encodeURIComponent(record)}/messages`, {\n body: message,\n ...options,\n });\n }\n\n /**\n * The buyer has read a record's conversation with one shop up to its last\n * accepted message. Answers with the buyer's conversations as they now stand.\n */\n async markRecordMessagesRead(\n record: string,\n query: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/read`,\n {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n },\n );\n }\n\n /**\n * Upload a file for the buyer's next message to one shop of a confirmed\n * record, under the shop's attachment rules (`attachment_rules` on the\n * message page). It belongs to the buyer until a message names it in\n * `attachments`; one no message took within a day is cleared. Uploading\n * again with the same `clientUploadId` returns the file the first upload\n * stored. `shop` is required here.\n */\n async uploadRecordMessageFile(\n record: string,\n file: Blob,\n clientUploadId: string,\n query: BuyerPortalAttachmentQuery,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerConversationAttachment> {\n const { fileName, ...extras } = options ?? {};\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(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/files`,\n {\n body: form,\n query: query as Record<string, string | boolean | null | undefined>,\n ...extras,\n },\n );\n }\n\n /** Download a file a message of a record's conversation with one shop carries. */\n async downloadRecordMessageFile(\n record: string,\n fileId: string,\n query: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,\n {\n query: query as Record<string, string | boolean | null | undefined>,\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a file the buyer uploaded for a record's conversation that no message took. */\n async removeRecordMessageFile(\n record: string,\n fileId: string,\n query: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,\n {\n query: query as Record<string, string | boolean | null | undefined>,\n ...options,\n },\n );\n }\n\n /**\n * What the buyer spent in a period: paid purchases summed per currency,\n * never converted, for the whole period, per day, week or month, per shop\n * and per kind of purchase. `subscriptions`, when present, summarizes all\n * current subscriptions in the same shop and mode, independently of the\n * spending period and subscription list pagination.\n */\n async analytics(\n query: BuyerAccountAnalyticsQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountAnalytics> {\n return this.request('GET', '/buyer-account/analytics', {\n query: { ...query },\n ...options,\n });\n }\n\n /**\n * Confirm the record of a shop's customer portal link for the signed-in\n * buyer. The link's customer must carry the address the buyer signed in\n * with.\n */\n async confirm(\n params: BuyerAccountConfirmRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountConfirmation> {\n return this.request('POST', '/buyer-account/confirmations', { body: params, ...options });\n }\n\n /**\n * Open the shop's customer portal for a confirmed record, named by the\n * `record` its purchases carry. Opening another one for the same record\n * ends the previous one.\n */\n async openPortal(record: string, options?: RequestExtras): Promise<BuyerAccountPortal> {\n return this.request('POST', `/buyer-account/records/${encodeURIComponent(record)}/portal`, {\n ...options,\n });\n }\n /**\n * A case's evidence: what may be handed in and by when, the files saved\n * and handed in, and what the reviewer said. Opened on the first read\n * while the case still waits.\n * The case is one of a confirmed record's, named by the `record` its\n * purchases carry and the case id the case list shows.\n */\n async caseEvidence(\n record: string,\n caseId: string,\n options?: RequestExtras,\n ): Promise<BuyerEvidence> {\n return this.request(\n 'GET',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence`,\n { ...options },\n );\n }\n\n /**\n * Upload a file for a case. It is saved, not handed in, until a\n * submission takes it. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored, also after the cut-off.\n */\n async uploadEvidenceFile(\n record: string,\n caseId: string,\n file: Blob,\n clientUploadId: string,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerEvidenceFile> {\n const { fileName, ...extras } = options ?? {};\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(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files`,\n { body: form, ...extras },\n );\n }\n\n /** Download a file of the case's evidence. */\n async downloadEvidenceFile(\n record: string,\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a saved file. A file a submission took stays. */\n async removeEvidenceFile(\n record: string,\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n ...options,\n },\n );\n }\n\n /**\n * Hand in an explanation, saved files or both, while the buyer's window\n * is open. Sending again with the same `client_submission_id` returns the\n * submission the first send stored.\n */\n async submitEvidence(\n record: string,\n caseId: string,\n params: BuyerEvidenceSubmit,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/submissions`,\n { body: params, ...options },\n );\n }\n\n /** Ask for more time, once until the cut-off is next set. */\n async requestEvidenceExtension(\n record: string,\n caseId: string,\n params: BuyerEvidenceExtensionRequest,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,\n { body: params, ...options },\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GK5FWN4H.cjs","../src/resources/buyerAccount.ts"],"names":[],"mappings":"AAAA;ACgDO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA,EAG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A;AACV,MAAA;AACwF,MAAA;AAC7D,MAAA;AAC7B,IAAA;AACF,EAAA;AAAA;AAQ+B,EAAA;AACjB,IAAA;AACV,MAAA;AACwF,MAAA;AAC7D,MAAA;AAC7B,IAAA;AACF,EAAA;AACF;ADpKwG;AACA;AACA;AACA","file":"/tmp/tmp.xzfdPBfuom/sdk/dist/chunk-GK5FWN4H.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n BuyerConversationAttachment,\n BuyerPortalAttachmentQuery,\n BuyerAccountAnalytics,\n BuyerAccountAnalyticsQuery,\n BuyerAccountAvailability,\n BuyerAccountConfirmation,\n BuyerAccountConfirmRequest,\n BuyerAccountInvoiceList,\n BuyerAccountListQuery,\n BuyerAccountPortal,\n BuyerAccountPurchasePage,\n BuyerAccountPurchaseQuery,\n BuyerAccountRefundRequestList,\n BuyerCaseList,\n BuyerNoticeSettings,\n BuyerPortalConversationList,\n BuyerPortalConversationQuery,\n BuyerPortalMessage,\n BuyerPortalMessageCreate,\n BuyerPortalMessagePage,\n BuyerAccountSession,\n BuyerAccountSessionInfo,\n BuyerAccountShopList,\n BuyerAccountSignInRequest,\n BuyerAccountSignInResponse,\n BuyerAccountSubscriptionList,\n BuyerAccountSubscriptionQuery,\n BuyerAccountSectionQuery,\n BuyerAccountVerifyCodeRequest,\n BuyerAccountVerifyLinkRequest,\n BuyerEvidence,\n BuyerEvidenceEntry,\n BuyerEvidenceExtensionRequest,\n BuyerEvidenceFile,\n BuyerEvidenceSubmit,\n} from '../types';\n\n/**\n * The buyer account: a buyer signs in with their email address, by a code or\n * a link mailed to it, and sees their purchases across merchants.\n *\n * Starting and completing a sign-in need no credential. Everything after it\n * needs the buyer account session: construct a separate client with the\n * session `token` as its key. A customer portal grant is not a buyer account\n * session, and neither is a merchant secret key or a dashboard JWT.\n */\nexport class BuyerAccount {\n constructor(private readonly request: RequestFn) {}\n\n /** Whether buyers can sign in on this platform, and which methods are offered. */\n async availability(options?: RequestExtras): Promise<BuyerAccountAvailability> {\n return this.request('GET', '/buyer-account/availability', { ...options });\n }\n\n /**\n * Mail a sign-in code, a link, or both to the address, as the platform\n * offers. The answer is the same whether or not the address has purchases.\n */\n async startSignIn(\n params: BuyerAccountSignInRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountSignInResponse> {\n return this.request('POST', '/buyer-account/sign-in', { body: params, ...options });\n }\n\n /** Complete a sign-in with the code from the message. */\n async verifyCode(\n params: BuyerAccountVerifyCodeRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountSession> {\n return this.request('POST', '/buyer-account/sign-in/code', { body: params, ...options });\n }\n\n /** Complete a sign-in with the token of the link in the message. */\n async verifyLink(\n params: BuyerAccountVerifyLinkRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountSession> {\n return this.request('POST', '/buyer-account/sign-in/link', { body: params, ...options });\n }\n\n /** The current session: the address signed in with, masked, and its expiry. */\n async getSession(options?: RequestExtras): Promise<BuyerAccountSessionInfo> {\n return this.request('GET', '/buyer-account/session', { ...options });\n }\n\n /**\n * What the buyer is mailed about: a reply from a shop's team they have not\n * read, and news in their refund requests and disputes.\n */\n async noticeSettings(options?: RequestExtras): Promise<BuyerNoticeSettings> {\n return this.request('GET', '/buyer-account/notice-settings', { ...options });\n }\n\n /** Turn either mail on or off for the buyer, at every shop. */\n async setNoticeSettings(\n params: BuyerNoticeSettings,\n options?: RequestExtras,\n ): Promise<BuyerNoticeSettings> {\n return this.request('PUT', '/buyer-account/notice-settings', { body: params, ...options });\n }\n\n /** End the current session. */\n async signOut(options?: RequestExtras): Promise<void> {\n return this.request('DELETE', '/buyer-account/session', { ...options });\n }\n\n /**\n * The buyer's purchases across merchants, newest first, as receipts: shop,\n * date, amount, items and status. Page with `next_cursor`.\n */\n async listPurchases(\n params?: BuyerAccountPurchaseQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountPurchasePage> {\n return this.request('GET', '/buyer-account/purchases', {\n query: params as Record<string, string | number | null | undefined>,\n ...options,\n });\n }\n\n /**\n * The shops the buyer has purchases at, once each and by name. Pass a\n * shop's `shop` to `listPurchases` to list only that shop's purchases.\n */\n async listShops(options?: RequestExtras): Promise<BuyerAccountShopList> {\n return this.request('GET', '/buyer-account/shops', { ...options });\n }\n\n /**\n * The buyer's subscriptions across shops, newest first. A record the buyer\n * has not confirmed shows what a receipt carries, without its period or\n * cancellation. Follow `next_cursor` with the same shop and mode; an\n * omitted mode includes both modes.\n */\n async listSubscriptions(\n query?: BuyerAccountSubscriptionQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountSubscriptionList> {\n return this.request('GET', '/buyer-account/subscriptions', {\n query: query ? { ...query } : undefined,\n ...options,\n });\n }\n\n /**\n * The issued invoices of the records the buyer has confirmed through a\n * shop's own link, newest first. `unconfirmed_records` says when records\n * were left out. Follow `next_cursor` with the same shop and mode; an\n * omitted mode includes both modes.\n */\n async listInvoices(\n query?: BuyerAccountSectionQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountInvoiceList> {\n return this.request('GET', '/buyer-account/invoices', {\n query: query ? { ...query } : undefined,\n ...options,\n });\n }\n\n /**\n * The confirmed records' refund requests, newest first, with the shop's\n * decision. Follow `next_cursor` with the same shop and mode; an omitted\n * mode includes both modes.\n */\n async listRefundRequests(\n query?: BuyerAccountSectionQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountRefundRequestList> {\n return this.request('GET', '/buyer-account/refund-requests', {\n query: query ? { ...query } : undefined,\n ...options,\n });\n }\n\n /**\n * The cases of the records the buyer has confirmed: the refund requests\n * they sent and the disputes about their purchases, newest first, with\n * where each stands, who acts next, the outcome and the recorded steps.\n */\n async listCases(query?: BuyerAccountListQuery, options?: RequestExtras): Promise<BuyerCaseList> {\n return this.request('GET', '/buyer-account/cases', {\n query: query as Record<string, string | null | undefined>,\n ...options,\n });\n }\n\n /**\n * The conversations of the records the buyer has confirmed, the latest\n * message first. `unconfirmed_records` says when other records were left out.\n */\n async listConversations(\n query?: BuyerAccountListQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request('GET', '/buyer-account/conversations', {\n query: query as Record<string, string | null | undefined>,\n ...options,\n });\n }\n\n /**\n * The conversation of a confirmed record with one shop, and its newest\n * messages, oldest first; `before` pages back. `shop` is required here.\n */\n async listRecordMessages(\n record: string,\n query: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessagePage> {\n return this.request('GET', `/buyer-account/records/${encodeURIComponent(record)}/messages`, {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n });\n }\n\n /**\n * A message from a confirmed record to one of its shops. A message to a\n * closed conversation reopens it. Sending again with the same\n * `client_message_id` returns the message the first send stored.\n */\n async sendRecordMessage(\n record: string,\n message: BuyerPortalMessageCreate,\n options?: RequestExtras,\n ): Promise<BuyerPortalMessage> {\n return this.request('POST', `/buyer-account/records/${encodeURIComponent(record)}/messages`, {\n body: message,\n ...options,\n });\n }\n\n /**\n * The buyer has read a record's conversation with one shop up to its last\n * accepted message. Answers with the buyer's conversations as they now stand.\n */\n async markRecordMessagesRead(\n record: string,\n query: BuyerPortalConversationQuery,\n options?: RequestExtras,\n ): Promise<BuyerPortalConversationList> {\n return this.request(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/read`,\n {\n query: query as Record<string, string | number | boolean | null | undefined>,\n ...options,\n },\n );\n }\n\n /**\n * Upload a file for the buyer's next message to one shop of a confirmed\n * record, under the shop's attachment rules (`attachment_rules` on the\n * message page). It belongs to the buyer until a message names it in\n * `attachments`; one no message took within a day is cleared. Uploading\n * again with the same `clientUploadId` returns the file the first upload\n * stored. `shop` is required here.\n */\n async uploadRecordMessageFile(\n record: string,\n file: Blob,\n clientUploadId: string,\n query: BuyerPortalAttachmentQuery,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerConversationAttachment> {\n const { fileName, ...extras } = options ?? {};\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(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/files`,\n {\n body: form,\n query: query as Record<string, string | boolean | null | undefined>,\n ...extras,\n },\n );\n }\n\n /** Download a file a message of a record's conversation with one shop carries. */\n async downloadRecordMessageFile(\n record: string,\n fileId: string,\n query: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,\n {\n query: query as Record<string, string | boolean | null | undefined>,\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a file the buyer uploaded for a record's conversation that no message took. */\n async removeRecordMessageFile(\n record: string,\n fileId: string,\n query: BuyerPortalAttachmentQuery,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-account/records/${encodeURIComponent(record)}/messages/files/${encodeURIComponent(fileId)}`,\n {\n query: query as Record<string, string | boolean | null | undefined>,\n ...options,\n },\n );\n }\n\n /**\n * What the buyer spent in a period: paid purchases summed per currency,\n * never converted, for the whole period, per day, week or month, per shop\n * and per kind of purchase. `subscriptions`, when present, summarizes all\n * current subscriptions in the same shop and mode, independently of the\n * spending period and subscription list pagination.\n */\n async analytics(\n query: BuyerAccountAnalyticsQuery,\n options?: RequestExtras,\n ): Promise<BuyerAccountAnalytics> {\n return this.request('GET', '/buyer-account/analytics', {\n query: { ...query },\n ...options,\n });\n }\n\n /**\n * Confirm the record of a shop's customer portal link for the signed-in\n * buyer. The link's customer must carry the address the buyer signed in\n * with.\n */\n async confirm(\n params: BuyerAccountConfirmRequest,\n options?: RequestExtras,\n ): Promise<BuyerAccountConfirmation> {\n return this.request('POST', '/buyer-account/confirmations', { body: params, ...options });\n }\n\n /**\n * Open the shop's customer portal for a confirmed record, named by the\n * `record` its purchases carry. Opening another one for the same record\n * ends the previous one.\n */\n async openPortal(record: string, options?: RequestExtras): Promise<BuyerAccountPortal> {\n return this.request('POST', `/buyer-account/records/${encodeURIComponent(record)}/portal`, {\n ...options,\n });\n }\n /**\n * A case's evidence: what may be handed in and by when, the files saved\n * and handed in, and what the reviewer said. Opened on the first read\n * while the case still waits.\n * The case is one of a confirmed record's, named by the `record` its\n * purchases carry and the case id the case list shows.\n */\n async caseEvidence(\n record: string,\n caseId: string,\n options?: RequestExtras,\n ): Promise<BuyerEvidence> {\n return this.request(\n 'GET',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence`,\n { ...options },\n );\n }\n\n /**\n * Upload a file for a case. It is saved, not handed in, until a\n * submission takes it. Uploading again with the same `clientUploadId`\n * returns the file the first upload stored, also after the cut-off.\n */\n async uploadEvidenceFile(\n record: string,\n caseId: string,\n file: Blob,\n clientUploadId: string,\n options?: RequestExtras & { fileName?: string },\n ): Promise<BuyerEvidenceFile> {\n const { fileName, ...extras } = options ?? {};\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(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files`,\n { body: form, ...extras },\n );\n }\n\n /** Download a file of the case's evidence. */\n async downloadEvidenceFile(\n record: string,\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<Blob> {\n return this.request(\n 'GET',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n responseType: 'blob',\n ...options,\n },\n );\n }\n\n /** Remove a saved file. A file a submission took stays. */\n async removeEvidenceFile(\n record: string,\n caseId: string,\n fileId: string,\n options?: RequestExtras,\n ): Promise<void> {\n return this.request(\n 'DELETE',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/files/${encodeURIComponent(fileId)}`,\n {\n ...options,\n },\n );\n }\n\n /**\n * Hand in an explanation, saved files or both, while the buyer's window\n * is open. Sending again with the same `client_submission_id` returns the\n * submission the first send stored.\n */\n async submitEvidence(\n record: string,\n caseId: string,\n params: BuyerEvidenceSubmit,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/submissions`,\n { body: params, ...options },\n );\n }\n\n /** Ask for more time, once until the cut-off is next set. */\n async requestEvidenceExtension(\n record: string,\n caseId: string,\n params: BuyerEvidenceExtensionRequest,\n options?: RequestExtras,\n ): Promise<BuyerEvidenceEntry> {\n return this.request(\n 'POST',\n `/buyer-account/records/${encodeURIComponent(record)}/cases/${encodeURIComponent(caseId)}/evidence/extension-requests`,\n { body: params, ...options },\n );\n }\n}\n"]}
|