@delopay/sdk 0.433.0 → 0.437.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/airwallexCard.cjs.map +1 -1
- package/dist/branding.cjs.map +1 -1
- package/dist/cardFormStyles.cjs.map +1 -1
- package/dist/checkoutSession.cjs +2 -2
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/checkoutSession.js +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/{chunk-MFRZ7K5O.cjs → chunk-2QULWFRR.cjs} +27 -19
- package/dist/chunk-2QULWFRR.cjs.map +1 -0
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3MS2HPSJ.js +25 -0
- package/dist/chunk-3MS2HPSJ.js.map +1 -0
- 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-4FOFD2A3.js +63 -0
- package/dist/chunk-4FOFD2A3.js.map +1 -0
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/{chunk-2D6BLOLP.cjs → chunk-4XURI7WM.cjs} +3 -3
- package/dist/chunk-4XURI7WM.cjs.map +1 -0
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.cjs.map +1 -1
- package/dist/chunk-6LFOM6HV.cjs.map +1 -1
- package/dist/chunk-6LOWE2YI.cjs.map +1 -1
- package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
- package/dist/chunk-6SU2MTN2.cjs.map +1 -1
- package/dist/chunk-6YCDLSIU.cjs.map +1 -1
- package/dist/chunk-75E5WNJG.cjs.map +1 -1
- package/dist/chunk-7JV6VVO7.cjs.map +1 -1
- package/dist/{chunk-CYWU7IL3.js → chunk-7M32LYPT.js} +35 -27
- package/dist/chunk-7M32LYPT.js.map +1 -0
- package/dist/chunk-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
- package/dist/chunk-BRY3W7N3.cjs.map +1 -1
- package/dist/chunk-CAMALM35.cjs.map +1 -1
- package/dist/chunk-CCN44NZJ.cjs.map +1 -1
- package/dist/chunk-CKKNFFKP.cjs.map +1 -1
- package/dist/chunk-CR3JBTP3.cjs.map +1 -1
- package/dist/chunk-DJASVBOJ.cjs.map +1 -1
- package/dist/chunk-EEB2HDYL.cjs.map +1 -1
- package/dist/chunk-ENPSUWTS.cjs.map +1 -1
- package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
- package/dist/chunk-EXPWQBI3.cjs.map +1 -1
- package/dist/chunk-F3I5DOWV.cjs.map +1 -1
- package/dist/chunk-F46K5H3U.cjs +63 -0
- package/dist/chunk-F46K5H3U.cjs.map +1 -0
- 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-GK5FWN4H.cjs.map +1 -1
- package/dist/{chunk-ZLKNVITE.js → chunk-GQYWT7BY.js} +2 -2
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/chunk-GWJ33GOK.cjs +63 -0
- package/dist/chunk-GWJ33GOK.cjs.map +1 -0
- package/dist/chunk-HBBEQWDU.cjs +1 -0
- package/dist/chunk-HBBEQWDU.cjs.map +1 -0
- package/dist/chunk-HLHML5ES.cjs.map +1 -1
- package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
- package/dist/chunk-HLYGHP6F.cjs.map +1 -1
- package/dist/{chunk-NYOJM4SZ.js → chunk-I23IC3T4.js} +19 -1
- package/dist/chunk-I23IC3T4.js.map +1 -0
- 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-IH4OVCKM.cjs.map +1 -1
- package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
- package/dist/chunk-IR2LFKKA.cjs.map +1 -1
- package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
- package/dist/chunk-K36XUB3A.cjs.map +1 -1
- package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
- package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
- package/dist/chunk-KJDMNF2T.cjs.map +1 -1
- package/dist/chunk-KLONGJCL.cjs.map +1 -1
- package/dist/chunk-KOB6MOAV.cjs.map +1 -1
- package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MCNDMK7F.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/chunk-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-QKJZY32F.js +63 -0
- package/dist/chunk-QKJZY32F.js.map +1 -0
- package/dist/chunk-QKUWFMZP.cjs +69 -0
- package/dist/chunk-QKUWFMZP.cjs.map +1 -0
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/{chunk-3INZM4LR.cjs → chunk-QXVMSF3D.cjs} +19 -1
- package/dist/chunk-QXVMSF3D.cjs.map +1 -0
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4FE6K43.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RHFUXHQN.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-RSVLVW4L.cjs.map +1 -1
- package/dist/chunk-S77LQWYC.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/chunk-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-VFPQUIEP.js +69 -0
- package/dist/chunk-VFPQUIEP.js.map +1 -0
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VYC7WUM5.cjs.map +1 -1
- package/dist/chunk-W457XUA6.cjs.map +1 -1
- package/dist/chunk-WHDI3TMP.cjs.map +1 -1
- package/dist/chunk-WITCPKNL.cjs.map +1 -1
- package/dist/chunk-WX6NP7UU.cjs.map +1 -1
- package/dist/chunk-XQLRIBVR.cjs.map +1 -1
- package/dist/chunk-XW7LMBMD.js +1 -0
- 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-ZUULK36E.cjs +25 -0
- package/dist/chunk-ZUULK36E.cjs.map +1 -0
- package/dist/client.cjs +2 -2
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +9 -0
- package/dist/client.d.ts +9 -0
- package/dist/client.js +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/currencies.cjs.map +1 -1
- package/dist/enigmaCardForm.cjs.map +1 -1
- package/dist/error.cjs.map +1 -1
- package/dist/eventStream.cjs.map +1 -1
- package/dist/exportDownload.cjs.map +1 -1
- package/dist/feeProgram.cjs.map +1 -1
- package/dist/index.cjs +30 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +37 -29
- 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/adminFeePlans.cjs +7 -0
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -0
- package/dist/internal/resources/adminFeePlans.d.cts +39 -0
- package/dist/internal/resources/adminFeePlans.d.ts +39 -0
- package/dist/internal/resources/adminFeePlans.js +7 -0
- package/dist/internal/resources/adminFeePlans.js.map +1 -0
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.d.cts +1 -1
- package/dist/internal/resources/adminFileScans.d.ts +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.d.cts +1 -1
- package/dist/internal/resources/adminIndustries.d.ts +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs +7 -0
- package/dist/internal/resources/adminNotices.cjs.map +1 -0
- package/dist/internal/resources/adminNotices.d.cts +43 -0
- package/dist/internal/resources/adminNotices.d.ts +43 -0
- package/dist/internal/resources/adminNotices.js +7 -0
- package/dist/internal/resources/adminNotices.js.map +1 -0
- package/dist/internal/resources/adminPortal.cjs +2 -2
- package/dist/internal/resources/adminPortal.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.d.cts +18 -2
- package/dist/internal/resources/adminPortal.d.ts +18 -2
- package/dist/internal/resources/adminPortal.js +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/adminSupport.d.cts +1 -1
- package/dist/internal/resources/adminSupport.d.ts +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.d.cts +1 -1
- package/dist/internal/resources/auditLogs.d.ts +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.d.cts +1 -1
- package/dist/internal/resources/cardIssuers.d.ts +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictionRules.d.ts +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.d.cts +1 -1
- package/dist/internal/resources/connectorRestrictions.d.ts +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.d.cts +1 -1
- package/dist/internal/resources/diagnostic.d.ts +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/gsm.d.cts +1 -1
- package/dist/internal/resources/gsm.d.ts +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.d.cts +1 -1
- package/dist/internal/resources/nativeRenewals.d.ts +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.d.cts +1 -1
- package/dist/internal/resources/platformBilling.d.ts +1 -1
- package/dist/internal/resources/platformFees.cjs.map +1 -1
- package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.d.cts +1 -1
- package/dist/internal/resources/platformSettings.d.ts +1 -1
- package/dist/internal.cjs +61 -43
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +10 -3
- package/dist/internal.d.ts +10 -3
- package/dist/internal.js +75 -57
- package/dist/internal.js.map +1 -1
- package/dist/listQuery.cjs.map +1 -1
- package/dist/panes.cjs.map +1 -1
- package/dist/paymentPresentation.cjs.map +1 -1
- package/dist/recordCounter.cjs.map +1 -1
- package/dist/resources/aiTools.cjs.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/contentEncryption.cjs +7 -0
- package/dist/resources/contentEncryption.cjs.map +1 -0
- package/dist/resources/contentEncryption.d.cts +31 -0
- package/dist/resources/contentEncryption.d.ts +31 -0
- package/dist/resources/contentEncryption.js +7 -0
- package/dist/resources/contentEncryption.js.map +1 -0
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/notices.cjs +7 -0
- package/dist/resources/notices.cjs.map +1 -0
- package/dist/resources/notices.d.cts +56 -0
- package/dist/resources/notices.d.ts +56 -0
- package/dist/resources/notices.js +7 -0
- package/dist/resources/notices.js.map +1 -0
- 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-B_Zk_eTX.d.cts → types-B82KRgid.d.cts} +263 -3
- package/dist/{types-BkRBo8eM.d.ts → types-CVKMSviB.d.ts} +263 -3
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +159 -2
- package/dist/types.d.ts +159 -2
- package/package.json +17 -19
- package/dist/chunk-2D6BLOLP.cjs.map +0 -1
- package/dist/chunk-3INZM4LR.cjs.map +0 -1
- package/dist/chunk-A4UPU5UE.js +0 -1
- package/dist/chunk-CYWU7IL3.js.map +0 -1
- package/dist/chunk-MFRZ7K5O.cjs.map +0 -1
- package/dist/chunk-NYOJM4SZ.js.map +0 -1
- package/dist/chunk-VHHQX52U.cjs +0 -1
- package/dist/chunk-VHHQX52U.cjs.map +0 -1
- /package/dist/{chunk-ZLKNVITE.js.map → chunk-GQYWT7BY.js.map} +0 -0
- /package/dist/{chunk-A4UPU5UE.js.map → chunk-XW7LMBMD.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/sdk-publish-0433/dist/chunk-PWDY5D5S.cjs","../src/resources/identityVerifications.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACwCO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,yBAAA,EAA2B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,IAAA,CACJ,KAAA,EACA,OAAA,EAC2C;AAC3C,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,yBAAA,EAA2B;AAAA,MACpD,KAAA,EAAO,wCAAA,KAAS,EAAO,CAAC,SAAA,EAAW,MAAA,EAAQ,uBAAuB,CAAC,CAAA;AAAA,MACnE,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,QAAA,CACJ,cAAA,EACA,KAAA,EACA,OAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,wBAAA,EAA2B,kBAAA,CAAmB,cAAc,CAAC,CAAA,CAAA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AAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYiD,EAAA;AACnC,IAAA;AACV,MAAA;AAC8E,MAAA;AAC9E,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADhI6F;AACA;AACA;AACA","file":"/tmp/sdk-publish-0433/dist/chunk-PWDY5D5S.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n AmlEventListResponse,\n AmlMonitoringRequest,\n ConnectionCheckSettingRequest,\n ConnectionCheckSettingResponse,\n ConnectionChecksResponse,\n IdentityVerificationCreateRequest,\n IdentityVerificationFlowsQuery,\n IdentityVerificationFlowsResponse,\n IdentityVerificationListQuery,\n IdentityVerificationListResponse,\n IdentityVerificationResponse,\n IdentityVerificationRetrieveQuery,\n DeviceIntelligenceSettingRequest,\n DeviceIntelligenceSettingResponse,\n DeviceSignalResponse,\n EffectiveRequirementResponse,\n IdentityVerificationDecisionResponse,\n IdentityVerificationRequirementDeleteQuery,\n IdentityVerificationRequirementDeleteResponse,\n IdentityVerificationRequirementListResponse,\n IdentityVerificationRequirementRequest,\n IdentityVerificationRequirementResponse,\n OperationScreeningResponse,\n PaymentScreeningResponse,\n PaymentScreeningSettingRequest,\n PaymentScreeningSettingResponse,\n SubjectVerificationQuery,\n SubjectVerificationResponse,\n} from '../types';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Identity verification (KYC, KYB, AML screening, age, proof of address)\n * through a connected identity verification provider account, such as Didit.\n *\n * The provider account is a connector account of type `fiz_operations`. A test\n * verification runs on the account's test credentials only, a live one on its\n * live credentials only. Reading needs permission to read customers; starting\n * a verification needs permission to edit them.\n */\nexport class IdentityVerifications {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Start a verification of a person or a business. The provider-side\n * workflow decides the checks. With a `return_url`, the provider's session\n * is created at once and its page returned in `verification_url`. With a\n * `payment_id` and no `return_url`, the payment's checkout starts it.\n *\n * `POST /identity-verifications`\n */\n async create(\n params: IdentityVerificationCreateRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('POST', '/identity-verifications', { body: params, ...options });\n }\n\n /**\n * The merchant's verifications, newest first unless `sort_by` says\n * otherwise. A caller limited to one shop sees that shop's only. Several\n * `outcome`, `kind` or `merchant_connector_id` values match a verification\n * with any of them.\n *\n * `GET /identity-verifications`\n */\n async list(\n query?: IdentityVerificationListQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationListResponse> {\n return this.request('GET', '/identity-verifications', {\n query: csvQuery(query, ['outcome', 'kind', 'merchant_connector_id']),\n ...options,\n });\n }\n\n /**\n * One verification. With `force_sync: true`, a verification the provider\n * can still change (pending or in review, or a subject under ongoing AML\n * monitoring) is read from the provider first.\n *\n * `GET /identity-verifications/{verification_id}`\n */\n async retrieve(\n verificationId: string,\n query?: IdentityVerificationRetrieveQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('GET', `/identity-verifications/${encodeURIComponent(verificationId)}`, {\n query: query as Query | undefined,\n ...options,\n });\n }\n\n /**\n * A subject's latest verification in one environment (live unless\n * `test_mode: true`), with its checks, and the subject's verification under\n * ongoing AML monitoring. This is what risk rules read. `verification` and\n * `aml_monitoring` are `null` when the subject has none.\n *\n * `GET /identity-verifications/subjects/{subject_reference}`\n */\n async subject(\n subjectReference: string,\n query?: SubjectVerificationQuery,\n options?: RequestExtras,\n ): Promise<SubjectVerificationResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/subjects/${encodeURIComponent(subjectReference)}`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * The provider-side workflows an account can run in one environment, read\n * from the provider with that environment's credentials. Pass a `flow_id`\n * as `provider_flow_id` to {@link IdentityVerifications.create}.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/flows`\n */\n async flows(\n merchantConnectorId: string,\n query?: IdentityVerificationFlowsQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationFlowsResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/flows`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * Switch ongoing AML monitoring of a verification's subject. The provider\n * then keeps re-screening the subject against sanctions, PEP and\n * adverse-media lists, and every change it reports is recorded. Only a\n * verified person or business can be enrolled; monitoring can be switched\n * off at any time. Needs permission to edit customers.\n *\n * `POST /identity-verifications/{verification_id}/aml-monitoring`\n */\n async setAmlMonitoring(\n verificationId: string,\n params: AmlMonitoringRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request(\n 'POST',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,\n { body: params, ...options },\n );\n }\n\n /**\n * Every change of the subject's AML result the provider reported while the\n * subject was monitored, newest first, at most 100.\n *\n * `GET /identity-verifications/{verification_id}/aml-events`\n */\n async amlEvents(verificationId: string, options?: RequestExtras): Promise<AmlEventListResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,\n options,\n );\n }\n\n /**\n * A payment's screening by the transaction monitoring of the shop's\n * screening account. Recorded only: it never holds or refuses the payment.\n * Answers 404 when the payment has no screening. Needs permission to read\n * payments.\n *\n * `GET /identity-verifications/payment-screenings/{payment_id}`\n */\n async paymentScreening(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account screens its shop's payments. Needs permission to read\n * connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async paymentScreeningSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n options,\n );\n }\n\n /**\n * Switch screening of the account's shop's payments. Switched on, every\n * payment of the shop that succeeds from then on is screened shortly after,\n * in the payment's own environment. A shop has at most one screening\n * account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async updatePaymentScreeningSetting(\n merchantConnectorId: string,\n params: PaymentScreeningSettingRequest,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n { body: params, ...options },\n );\n }\n\n /**\n * A refund's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens refunds. Recorded only: it\n * never holds or reverses the refund. Answers 404 when the refund has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/refund-screenings/{refund_id}`\n */\n async refundScreening(\n refundId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/refund-screenings/${encodeURIComponent(refundId)}`,\n options,\n );\n }\n\n /**\n * A payout's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens payouts. Recorded only: it\n * never holds or reverses the payout. Answers 404 when the payout has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/payout-screenings/{payout_id}`\n */\n async payoutScreening(\n payoutId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payout-screenings/${encodeURIComponent(payoutId)}`,\n options,\n );\n }\n\n /**\n * Whether an account assesses its shop's checkout devices. Needs permission\n * to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async deviceIntelligenceSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n options,\n );\n }\n\n /**\n * Switch device intelligence of the account's shop. Switched on, every\n * checkout of the shop assesses the buyer's device and records the\n * provider's signal on the payment; it never holds or refuses a payment.\n * Switching on is refused when the provider has not switched the feature on\n * for the account. A shop has at most one device intelligence account.\n * Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async updateDeviceIntelligenceSetting(\n merchantConnectorId: string,\n params: DeviceIntelligenceSettingRequest,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's device signal from its checkout's device assessment. Recorded\n * only: it never holds or refuses the payment. Answers 404 when the payment's\n * checkout was not assessed. Needs permission to read payments.\n *\n * `GET /identity-verifications/device-signals/{payment_id}`\n */\n async deviceSignal(paymentId: string, options?: RequestExtras): Promise<DeviceSignalResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/device-signals/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account rates the buyer addresses of its shop's payments.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async connectionCheckSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n options,\n );\n }\n\n /**\n * Switch the connection check of the account's shop. Switched on, the\n * buyer address of every payment the shop confirms is rated by the\n * provider, once per payment and address, before authorization. A\n * provider that classifies addresses reports the network classes it found\n * (hosting, Tor, VPN, proxy, residential proxy), and each counts as that\n * network class in the buyer risk score and the buyer blocklist. For a\n * provider that only rates, a `high` or `very_high` rating counts as the\n * `proxy` class. A check never holds or refuses a payment by itself. Switching on asks the\n * provider nothing, since every check is billed. A shop has at most one\n * connection check account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async updateConnectionCheckSetting(\n merchantConnectorId: string,\n params: ConnectionCheckSettingRequest,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's connection checks, newest first; empty when none ran. Each\n * check carries the network classes it counts as, and, from a provider that\n * classifies addresses, the services, infrastructure and risk tags it\n * named. Needs permission to read payments.\n *\n * `GET /identity-verifications/connection-checks/{payment_id}`\n */\n async connectionChecks(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ConnectionChecksResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/connection-checks/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Set which payments need an identity verification at one level: the\n * merchant, a project, a shop, a checkout template or one payment. `off`\n * lifts a wider requirement. Without `payment_method_types` or\n * `merchant_connector_ids` the checkout shows the identity step before any\n * payment option; with them, only when the buyer picks a matching method.\n * A payment is decided once, so a later change does not change it.\n * Merchant, project and checkout template requirements need a\n * merchant-level caller; a shop on a checkout template takes its\n * requirement from the template. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/requirements`\n */\n async putRequirement(\n params: IdentityVerificationRequirementRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementResponse> {\n return this.request('PUT', '/identity-verifications/requirements', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Every requirement of the merchant. A caller limited to one shop sees the\n * merchant's and projects' requirements and its own shop's and payments'.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements`\n */\n async listRequirements(\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementListResponse> {\n return this.request('GET', '/identity-verifications/requirements', options);\n }\n\n /**\n * The level inherits again. Payments already decided keep their decision.\n * Needs permission to edit connectors.\n *\n * `DELETE /identity-verifications/requirements`\n */\n async deleteRequirement(\n query: IdentityVerificationRequirementDeleteQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementDeleteResponse> {\n return this.request('DELETE', '/identity-verifications/requirements', {\n query: query as unknown as Query,\n ...options,\n });\n }\n\n /**\n * The requirement a new payment of the shop meets and the level it comes\n * from. Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements/effective`\n */\n async effectiveRequirement(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveRequirementResponse> {\n return this.request('GET', '/identity-verifications/requirements/effective', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Whether the payment needs an identity verification, as decided the first\n * time its checkout was drawn or it was confirmed. Not found until then.\n * Needs permission to read payments.\n *\n * `GET /identity-verifications/requirements/payments/{payment_id}`\n */\n async paymentDecision(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<IdentityVerificationDecisionResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/requirements/payments/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-PWDY5D5S.cjs","../src/resources/identityVerifications.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACwCO,IAAM,sBAAA,EAAN,MAA4B;AAAA,EACjC,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUlD,MAAM,MAAA,CACJ,MAAA,EACA,OAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,yBAAA,EAA2B,EAAE,IAAA,EAAM,MAAA,EAAQ,GAAG,QAAQ,CAAC,CAAA;AAAA,EACrF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,IAAA,CACJ,KAAA,EACA,OAAA,EAC2C;AAC3C,IAAA,OAAO,IAAA,CAAK,OAAA,CA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBoD,EAAA;AACiB,IAAA;AAC3D,MAAA;AACH,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWwD,EAAA;AACoB,IAAA;AAC5E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW0D,EAAA;AACc,IAAA;AACpE,MAAA;AACG,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWyC,EAAA;AACsC,IAAA;AAC5C,MAAA;AAC5B,MAAA;AACJ,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYiD,EAAA;AACnC,IAAA;AACV,MAAA;AAC8E,MAAA;AAC9E,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADhI6F;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-PWDY5D5S.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type {\n AmlEventListResponse,\n AmlMonitoringRequest,\n ConnectionCheckSettingRequest,\n ConnectionCheckSettingResponse,\n ConnectionChecksResponse,\n IdentityVerificationCreateRequest,\n IdentityVerificationFlowsQuery,\n IdentityVerificationFlowsResponse,\n IdentityVerificationListQuery,\n IdentityVerificationListResponse,\n IdentityVerificationResponse,\n IdentityVerificationRetrieveQuery,\n DeviceIntelligenceSettingRequest,\n DeviceIntelligenceSettingResponse,\n DeviceSignalResponse,\n EffectiveRequirementResponse,\n IdentityVerificationDecisionResponse,\n IdentityVerificationRequirementDeleteQuery,\n IdentityVerificationRequirementDeleteResponse,\n IdentityVerificationRequirementListResponse,\n IdentityVerificationRequirementRequest,\n IdentityVerificationRequirementResponse,\n OperationScreeningResponse,\n PaymentScreeningResponse,\n PaymentScreeningSettingRequest,\n PaymentScreeningSettingResponse,\n SubjectVerificationQuery,\n SubjectVerificationResponse,\n} from '../types';\nimport { csvQuery } from '../listQuery';\n\ntype Query = Record<string, string | number | boolean | null | undefined>;\n\n/**\n * Identity verification (KYC, KYB, AML screening, age, proof of address)\n * through a connected identity verification provider account, such as Didit.\n *\n * The provider account is a connector account of type `fiz_operations`. A test\n * verification runs on the account's test credentials only, a live one on its\n * live credentials only. Reading needs permission to read customers; starting\n * a verification needs permission to edit them.\n */\nexport class IdentityVerifications {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * Start a verification of a person or a business. The provider-side\n * workflow decides the checks. With a `return_url`, the provider's session\n * is created at once and its page returned in `verification_url`. With a\n * `payment_id` and no `return_url`, the payment's checkout starts it.\n *\n * `POST /identity-verifications`\n */\n async create(\n params: IdentityVerificationCreateRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('POST', '/identity-verifications', { body: params, ...options });\n }\n\n /**\n * The merchant's verifications, newest first unless `sort_by` says\n * otherwise. A caller limited to one shop sees that shop's only. Several\n * `outcome`, `kind` or `merchant_connector_id` values match a verification\n * with any of them.\n *\n * `GET /identity-verifications`\n */\n async list(\n query?: IdentityVerificationListQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationListResponse> {\n return this.request('GET', '/identity-verifications', {\n query: csvQuery(query, ['outcome', 'kind', 'merchant_connector_id']),\n ...options,\n });\n }\n\n /**\n * One verification. With `force_sync: true`, a verification the provider\n * can still change (pending or in review, or a subject under ongoing AML\n * monitoring) is read from the provider first.\n *\n * `GET /identity-verifications/{verification_id}`\n */\n async retrieve(\n verificationId: string,\n query?: IdentityVerificationRetrieveQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request('GET', `/identity-verifications/${encodeURIComponent(verificationId)}`, {\n query: query as Query | undefined,\n ...options,\n });\n }\n\n /**\n * A subject's latest verification in one environment (live unless\n * `test_mode: true`), with its checks, and the subject's verification under\n * ongoing AML monitoring. This is what risk rules read. `verification` and\n * `aml_monitoring` are `null` when the subject has none.\n *\n * `GET /identity-verifications/subjects/{subject_reference}`\n */\n async subject(\n subjectReference: string,\n query?: SubjectVerificationQuery,\n options?: RequestExtras,\n ): Promise<SubjectVerificationResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/subjects/${encodeURIComponent(subjectReference)}`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * The provider-side workflows an account can run in one environment, read\n * from the provider with that environment's credentials. Pass a `flow_id`\n * as `provider_flow_id` to {@link IdentityVerifications.create}.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/flows`\n */\n async flows(\n merchantConnectorId: string,\n query?: IdentityVerificationFlowsQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationFlowsResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/flows`,\n { query: query as Query | undefined, ...options },\n );\n }\n\n /**\n * Switch ongoing AML monitoring of a verification's subject. The provider\n * then keeps re-screening the subject against sanctions, PEP and\n * adverse-media lists, and every change it reports is recorded. Only a\n * verified person or business can be enrolled; monitoring can be switched\n * off at any time. Needs permission to edit customers.\n *\n * `POST /identity-verifications/{verification_id}/aml-monitoring`\n */\n async setAmlMonitoring(\n verificationId: string,\n params: AmlMonitoringRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationResponse> {\n return this.request(\n 'POST',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,\n { body: params, ...options },\n );\n }\n\n /**\n * Every change of the subject's AML result the provider reported while the\n * subject was monitored, newest first, at most 100.\n *\n * `GET /identity-verifications/{verification_id}/aml-events`\n */\n async amlEvents(verificationId: string, options?: RequestExtras): Promise<AmlEventListResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,\n options,\n );\n }\n\n /**\n * A payment's screening by the transaction monitoring of the shop's\n * screening account. Recorded only: it never holds or refuses the payment.\n * Answers 404 when the payment has no screening. Needs permission to read\n * payments.\n *\n * `GET /identity-verifications/payment-screenings/{payment_id}`\n */\n async paymentScreening(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account screens its shop's payments. Needs permission to read\n * connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async paymentScreeningSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n options,\n );\n }\n\n /**\n * Switch screening of the account's shop's payments. Switched on, every\n * payment of the shop that succeeds from then on is screened shortly after,\n * in the payment's own environment. A shop has at most one screening\n * account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`\n */\n async updatePaymentScreeningSetting(\n merchantConnectorId: string,\n params: PaymentScreeningSettingRequest,\n options?: RequestExtras,\n ): Promise<PaymentScreeningSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,\n { body: params, ...options },\n );\n }\n\n /**\n * A refund's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens refunds. Recorded only: it\n * never holds or reverses the refund. Answers 404 when the refund has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/refund-screenings/{refund_id}`\n */\n async refundScreening(\n refundId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/refund-screenings/${encodeURIComponent(refundId)}`,\n options,\n );\n }\n\n /**\n * A payout's screening by the transaction monitoring of the shop's\n * screening account, for a provider that screens payouts. Recorded only: it\n * never holds or reverses the payout. Answers 404 when the payout has no\n * screening. Needs permission to read payments.\n *\n * `GET /identity-verifications/payout-screenings/{payout_id}`\n */\n async payoutScreening(\n payoutId: string,\n options?: RequestExtras,\n ): Promise<OperationScreeningResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/payout-screenings/${encodeURIComponent(payoutId)}`,\n options,\n );\n }\n\n /**\n * Whether an account assesses its shop's checkout devices. Needs permission\n * to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async deviceIntelligenceSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n options,\n );\n }\n\n /**\n * Switch device intelligence of the account's shop. Switched on, every\n * checkout of the shop assesses the buyer's device and records the\n * provider's signal on the payment; it never holds or refuses a payment.\n * Switching on is refused when the provider has not switched the feature on\n * for the account. A shop has at most one device intelligence account.\n * Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/device-intelligence`\n */\n async updateDeviceIntelligenceSetting(\n merchantConnectorId: string,\n params: DeviceIntelligenceSettingRequest,\n options?: RequestExtras,\n ): Promise<DeviceIntelligenceSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/device-intelligence`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's device signal from its checkout's device assessment. Recorded\n * only: it never holds or refuses the payment. Answers 404 when the payment's\n * checkout was not assessed. Needs permission to read payments.\n *\n * `GET /identity-verifications/device-signals/{payment_id}`\n */\n async deviceSignal(paymentId: string, options?: RequestExtras): Promise<DeviceSignalResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/device-signals/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Whether an account rates the buyer addresses of its shop's payments.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async connectionCheckSetting(\n merchantConnectorId: string,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n options,\n );\n }\n\n /**\n * Switch the connection check of the account's shop. Switched on, the\n * buyer address of every payment the shop confirms is rated by the\n * provider, once per payment and address, before authorization. A\n * provider that classifies addresses reports the network classes it found\n * (hosting, Tor, VPN, proxy, residential proxy), and each counts as that\n * network class in the buyer risk score and the buyer blocklist. For a\n * provider that only rates, a `high` or `very_high` rating counts as the\n * `proxy` class. A check never holds or refuses a payment by itself. Switching on asks the\n * provider nothing, since every check is billed. A shop has at most one\n * connection check account. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/accounts/{merchant_connector_id}/connection-check`\n */\n async updateConnectionCheckSetting(\n merchantConnectorId: string,\n params: ConnectionCheckSettingRequest,\n options?: RequestExtras,\n ): Promise<ConnectionCheckSettingResponse> {\n return this.request(\n 'PUT',\n `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/connection-check`,\n { body: params, ...options },\n );\n }\n\n /**\n * A payment's connection checks, newest first; empty when none ran. Each\n * check carries the network classes it counts as, and, from a provider that\n * classifies addresses, the services, infrastructure and risk tags it\n * named. Needs permission to read payments.\n *\n * `GET /identity-verifications/connection-checks/{payment_id}`\n */\n async connectionChecks(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<ConnectionChecksResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/connection-checks/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n\n /**\n * Set which payments need an identity verification at one level: the\n * merchant, a project, a shop, a checkout template or one payment. `off`\n * lifts a wider requirement. Without `payment_method_types` or\n * `merchant_connector_ids` the checkout shows the identity step before any\n * payment option; with them, only when the buyer picks a matching method.\n * A payment is decided once, so a later change does not change it.\n * Merchant, project and checkout template requirements need a\n * merchant-level caller; a shop on a checkout template takes its\n * requirement from the template. Needs permission to edit connectors.\n *\n * `PUT /identity-verifications/requirements`\n */\n async putRequirement(\n params: IdentityVerificationRequirementRequest,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementResponse> {\n return this.request('PUT', '/identity-verifications/requirements', {\n body: params,\n ...options,\n });\n }\n\n /**\n * Every requirement of the merchant. A caller limited to one shop sees the\n * merchant's and projects' requirements and its own shop's and payments'.\n * Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements`\n */\n async listRequirements(\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementListResponse> {\n return this.request('GET', '/identity-verifications/requirements', options);\n }\n\n /**\n * The level inherits again. Payments already decided keep their decision.\n * Needs permission to edit connectors.\n *\n * `DELETE /identity-verifications/requirements`\n */\n async deleteRequirement(\n query: IdentityVerificationRequirementDeleteQuery,\n options?: RequestExtras,\n ): Promise<IdentityVerificationRequirementDeleteResponse> {\n return this.request('DELETE', '/identity-verifications/requirements', {\n query: query as unknown as Query,\n ...options,\n });\n }\n\n /**\n * The requirement a new payment of the shop meets and the level it comes\n * from. Needs permission to read connectors.\n *\n * `GET /identity-verifications/requirements/effective`\n */\n async effectiveRequirement(\n profileId: string,\n options?: RequestExtras,\n ): Promise<EffectiveRequirementResponse> {\n return this.request('GET', '/identity-verifications/requirements/effective', {\n query: { profile_id: profileId },\n ...options,\n });\n }\n\n /**\n * Whether the payment needs an identity verification, as decided the first\n * time its checkout was drawn or it was confirmed. Not found until then.\n * Needs permission to read payments.\n *\n * `GET /identity-verifications/requirements/payments/{payment_id}`\n */\n async paymentDecision(\n paymentId: string,\n options?: RequestExtras,\n ): Promise<IdentityVerificationDecisionResponse> {\n return this.request(\n 'GET',\n `/identity-verifications/requirements/payments/${encodeURIComponent(paymentId)}`,\n options,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/tmp/sdk-publish-0433/dist/chunk-Q7M7DO7M.cjs","../src/paymentPresentation.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBO,IAAM,8BAAA,EAAgC,CAAA;AAGtC,IAAM,0BAAA,EAA4B;AAAA,EACvC,QAAA;AAAA,EACA,MAAA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C5C,MAAA;AACe,MAAA;AACpB,IAAA;AACY,IAAA;AACS,MAAA;AACrB,IAAA;AACY,IAAA;AACM,IAAA;AACG,IAAA;AACH,IAAA;AACG,MAAA;AACrB,IAAA;AACI,IAAA;AACe,MAAA;AACf,QAAA;AACkB,QAAA;AACpB,MAAA;AACgB,MAAA;AACG,MAAA;AACL,IAAA;AACF,MAAA;AACM,QAAA;AACP,QAAA;AACX,MAAA;AACe,MAAA;AACK,MAAA;AAIR,MAAA;AACD,QAAA;AACX,MAAA;AAGY,MAAA;AACN,MAAA;AACR,IAAA;AACF,EAAA;AAAA;AAGc,EAAA;AACK,IAAA;AACnB,EAAA;AAEwE,EAAA;AACnD,IAAA;AACC,MAAA;AAClB,MAAA;AACF,IAAA;AACqB,IAAA;AACC,IAAA;AACJ,IAAA;AACI,MAAA;AACL,MAAA;AACG,MAAA;AACpB,IAAA;AACF,EAAA;AACF;AAO4C;AAEvB,EAAA;AAKrB;AAEuB;AACE,EAAA;AACC,EAAA;AAC1B;ADrJ0B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/sdk-publish-0433/dist/chunk-Q7M7DO7M.cjs","sourcesContent":[null,"/**\n * Helpers for rendering a shop's payment buttons on the merchant's own site\n * from `GET /account/payment-methods/presentation`: DeloPay's\n * built-in glyphs, icon resolution with a fallback, grouping by tier, and a\n * cache for the merchant's server that honours the response's own policy.\n *\n * Nothing here decides which methods a payment can be confirmed with. The\n * payment is confirmed against the shop's current configuration, whatever a\n * cached or displayed list says.\n */\nimport { DelopayError } from './error';\nimport type {\n PaymentMethodPresentationEntry,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n PresentationChild,\n PresentationIcon,\n} from './types';\nimport type { RequestExtras } from './client';\n\n/** The response contract these helpers read. */\nexport const PRESENTATION_CONTRACT_VERSION = 1;\n\n/** The built-in glyph keys a presentation names in `icon.key` and `fallback_icon`. */\nexport const BUILTIN_PAYMENT_ICON_KEYS = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n 'paypal',\n 'klarna',\n 'crypto',\n] as const;\n\nexport type BuiltinPaymentIconKey = (typeof BUILTIN_PAYMENT_ICON_KEYS)[number];\n\nconst SVG_OPEN = '<svg xmlns=\"http://www.w3.org/2000/svg\"';\n\n/**\n * The glyphs DeloPay's hosted checkout draws, as standalone SVG documents.\n * Line glyphs and Apple's mark take `color`; the other brand marks keep their\n * brand colours.\n */\nfunction glyph(key: BuiltinPaymentIconKey, color: string): string {\n const line = (body: string) =>\n `${SVG_OPEN} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"${color}\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${body}</svg>`;\n switch (key) {\n case 'card':\n return line('<rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\"/><path d=\"M2 10h20\"/>');\n case 'bank':\n return line(\n '<path d=\"M3 10h18\"/><path d=\"m12 3 9 5H3l9-5Z\"/><path d=\"M6 10v7M10 10v7M14 10v7M18 10v7\"/><path d=\"M3 20h18\"/>',\n );\n case 'bnpl':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><path d=\"M6 12h4\"/><path d=\"M14 10v4\"/><path d=\"M18 10v4\"/>',\n );\n case 'cash':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M6 12h.01M18 12h.01\"/>',\n );\n case 'apple':\n return `${SVG_OPEN} viewBox=\"0 0 384 512\" fill=\"${color}\"><path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\"/></svg>`;\n case 'google':\n return `${SVG_OPEN} viewBox=\"0 0 48 48\"><path fill=\"#4285F4\" d=\"M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z\"/><path fill=\"#34A853\" d=\"M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z\"/><path fill=\"#FBBC05\" d=\"M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24s.85 6.91 2.34 9.88l7.35-5.7z\"/><path fill=\"#EA4335\" d=\"M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z\"/></svg>`;\n case 'paypal':\n return `${SVG_OPEN} viewBox=\"0 0 32 32\"><path d=\"M9 4h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L10.4 23H6.7L9 4z\" fill=\"#003087\"/><path d=\"M13 8.5h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L14.4 27.5H10.7L13 8.5z\" fill=\"#009cde\"/></svg>`;\n case 'klarna':\n return `${SVG_OPEN} viewBox=\"0 0 24 24\"><rect width=\"24\" height=\"24\" rx=\"6\" fill=\"#FFA8CD\"/><path fill=\"#0B051D\" d=\"M8 6h2.7v12H8V6zm6.5 0h2.5c-.4 2.7-1.5 5-3 6.6 1.6 1.6 2.7 3.6 3.2 5.4h-2.7c-.5-1.6-1.4-3-2.7-4.2v4.2H10V12c2.1-1 3.8-3.2 4.5-6z\"/></svg>`;\n case 'crypto':\n return `${SVG_OPEN} viewBox=\"0 0 64 64\"><path fill=\"#F7931A\" d=\"m63.033,39.744c-4.274,17.143-21.637,27.576-38.782,23.301-17.138-4.274-27.571-21.638-23.295-38.78,4.272-17.145,21.635-27.579,38.775-23.305,17.144,4.274,27.576,21.64,23.302,38.784z\"/><path fill=\"#FFF\" d=\"m46.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z\"/></svg>`;\n case 'wallet':\n return line(\n '<path d=\"M3 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2\"/><rect x=\"3\" y=\"7\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M16 13h3\"/>',\n );\n }\n}\n\nfunction isBuiltinKey(key: string): key is BuiltinPaymentIconKey {\n return (BUILTIN_PAYMENT_ICON_KEYS as readonly string[]).includes(key);\n}\n\n/**\n * The SVG document of a built-in glyph. An unknown key — one a newer API\n * added — draws the neutral `wallet` glyph rather than nothing.\n *\n * @param color - What line glyphs and Apple's mark are drawn in. Defaults to\n * a dark grey that reads on a light button.\n */\nexport function builtinPaymentIconSvg(key: string, color = '#1f2937'): string {\n return glyph(isBuiltinKey(key) ? key : 'wallet', color);\n}\n\n/** {@link builtinPaymentIconSvg} as a `data:` URI for an image element's `src`. */\nexport function builtinPaymentIconDataUri(key: string, color?: string): string {\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(builtinPaymentIconSvg(key, color))}`;\n}\n\n/**\n * The image `src` for an icon: an SVG icon's own `data_uri`, a built-in\n * glyph's document otherwise. Use it with an image element, which renders the\n * artwork without running anything in it.\n */\nexport function presentationIconDataUri(icon: PresentationIcon, color?: string): string {\n return icon.type === 'svg' ? icon.data_uri : builtinPaymentIconDataUri(icon.key, color);\n}\n\n/**\n * The image `src` to draw for an entry: its icon, else its fallback glyph.\n * `null` only for a heading, which has no artwork. Pair it with an `onerror`\n * that swaps to `builtinPaymentIconDataUri(entry.fallback_icon)` if you load\n * artwork from anywhere that can fail.\n */\nexport function presentationIconSrc(\n entry: PaymentMethodPresentationEntry,\n color?: string,\n): string | null {\n if (entry.icon) return presentationIconDataUri(entry.icon, color);\n if (entry.fallback_icon) return builtinPaymentIconDataUri(entry.fallback_icon, color);\n return null;\n}\n\n/**\n * Whether DeloPay confirmed a badge: from the provider's answer for the\n * account, or the account's own settings. A `merchant` badge is the shop's\n * own statement for a provider DeloPay cannot ask; draw it, if at all, so a\n * buyer can tell it apart.\n */\nexport function isConfirmedChild(child: Pick<PresentationChild, 'source'>): boolean {\n return child.source !== 'merchant';\n}\n\n/** Whether these helpers understand a response. A different `contract_version` is not read. */\nexport function isSupportedPresentation(\n response: Pick<PaymentMethodPresentationResponse, 'contract_version'>,\n): boolean {\n return response.contract_version === PRESENTATION_CONTRACT_VERSION;\n}\n\n/** A presentation's entries by tier, express rows kept apart, in checkout order. */\nexport interface PresentationTiers {\n express: PaymentMethodPresentationEntry[][];\n normal: PaymentMethodPresentationEntry[];\n alternative: PaymentMethodPresentationEntry[];\n}\n\n/** Group a presentation's entries the way the hosted checkout lays them out. */\nexport function presentationTiers(response: PaymentMethodPresentationResponse): PresentationTiers {\n const out: PresentationTiers = { express: [], normal: [], alternative: [] };\n for (const entry of response.entries) {\n if (entry.tier === 'express') {\n const row = entry.row ?? 0;\n while (out.express.length <= row) out.express.push([]);\n out.express[row]?.push(entry);\n } else {\n out[entry.tier].push(entry);\n }\n }\n out.express = out.express.filter((row) => row.length > 0);\n return out;\n}\n\n/** The entries a buyer can select, in order: everything but headings. */\nexport function selectableEntries(\n response: PaymentMethodPresentationResponse,\n): PaymentMethodPresentationEntry[] {\n return response.entries.filter((entry) => entry.action !== undefined);\n}\n\n/** What {@link PresentationCache.get} answers. */\nexport interface CachedPresentation {\n response: PaymentMethodPresentationResponse;\n /**\n * `true` when DeloPay could not be reached and this is the last answer,\n * still inside its `stale_if_error_seconds`. Display only.\n */\n stale: boolean;\n}\n\n/** How {@link PresentationCache} asks DeloPay. */\nexport type PresentationLoader = (\n params: PaymentMethodPresentationParams,\n options: RequestExtras,\n) => Promise<PaymentMethodPresentationResponse>;\n\nexport interface PresentationCacheOptions {\n /** Usually `(params, options) => delopay.paymentMethods.presentation(params, options)`. */\n load: PresentationLoader;\n /** Milliseconds since the epoch. Defaults to `Date.now`. */\n now?: () => number;\n /** At most this many contexts are kept; the least recently fetched goes first. Default 500. */\n maxEntries?: number;\n}\n\ninterface CacheSlot {\n response: PaymentMethodPresentationResponse;\n fetchedAt: number;\n}\n\n/**\n * A cache for the merchant's server in front of\n * `GET /account/payment-methods/presentation`, keyed by everything that\n * changes the answer: shop, environment, locale, country, currency and amount.\n *\n * - Reuses an answer for its `cache.max_age_seconds`, then revalidates with\n * `If-None-Match`; an unchanged revision costs no body.\n * - While DeloPay cannot be reached it keeps serving the last answer for\n * `cache.stale_if_error_seconds` more, marked `stale`, then rethrows.\n * - Never caches a payment's answer (`client_secret`): those are asked every\n * time, since a cart change needs a new answer.\n *\n * One instance per secret key: an answer is the authenticated merchant's and\n * must not be shared with another merchant's requests.\n */\nexport class PresentationCache {\n private readonly slots = new Map<string, CacheSlot>();\n private readonly load: PresentationLoader;\n private readonly now: () => number;\n private readonly maxEntries: number;\n\n constructor(options: PresentationCacheOptions) {\n this.load = options.load;\n this.now = options.now ?? Date.now;\n this.maxEntries = options.maxEntries ?? 500;\n }\n\n /** The key two requests share exactly when DeloPay would answer them alike. */\n static keyOf(params: PaymentMethodPresentationParams): string {\n return JSON.stringify([\n params.profile_id ?? null,\n params.environment ?? 'live',\n params.locale?.toLowerCase() ?? null,\n params.country?.toUpperCase() ?? null,\n params.currency ?? null,\n params.amount ?? null,\n params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n ]);\n }\n\n async get(params: PaymentMethodPresentationParams): Promise<CachedPresentation> {\n const request: PaymentMethodPresentationParams = {\n ...params,\n contract_version: params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n };\n if (request.client_secret) {\n return { response: await this.load(request, {}), stale: false };\n }\n const key = PresentationCache.keyOf(request);\n const slot = this.slots.get(key);\n const now = this.now();\n if (slot && now - slot.fetchedAt < slot.response.cache.max_age_seconds * 1000) {\n return { response: slot.response, stale: false };\n }\n try {\n const response = await this.load(\n request,\n slot ? { headers: { 'If-None-Match': `\"${slot.response.revision}\"` } } : {},\n );\n this.store(key, response, now);\n return { response, stale: false };\n } catch (error) {\n if (slot && error instanceof DelopayError && error.status === 304) {\n this.store(key, slot.response, now);\n return { response: slot.response, stale: false };\n }\n const policy = slot?.response.cache;\n const usableUntil = slot\n ? slot.fetchedAt +\n ((policy?.max_age_seconds ?? 0) + (policy?.stale_if_error_seconds ?? 0)) * 1000\n : 0;\n if (slot && isUnavailable(error) && now < usableUntil) {\n return { response: slot.response, stale: true };\n }\n // A definitive refusal (a shop that is gone, a revoked key) retires the\n // answer: a later outage must not bring it back as a stale copy.\n if (slot && isRefusal(error)) this.slots.delete(key);\n throw error;\n }\n }\n\n /** Forget every answer, e.g. after the merchant changes the checkout editor. */\n clear(): void {\n this.slots.clear();\n }\n\n private store(key: string, response: PaymentMethodPresentationResponse, now: number): void {\n if (response.cache.max_age_seconds <= 0) {\n this.slots.delete(key);\n return;\n }\n this.slots.delete(key);\n this.slots.set(key, { response, fetchedAt: now });\n while (this.slots.size > this.maxEntries) {\n const oldest = this.slots.keys().next().value;\n if (oldest === undefined) break;\n this.slots.delete(oldest);\n }\n }\n}\n\n/**\n * DeloPay could not answer: the network, a timeout, a rate limit or a server\n * error. A 4xx (a refused key, a shop that is not there) is an answer, and is\n * never papered over with an older one.\n */\nfunction isRefusal(error: unknown): boolean {\n return (\n error instanceof DelopayError &&\n error.status >= 400 &&\n error.status < 500 &&\n error.status !== 429\n );\n}\n\nfunction isUnavailable(error: unknown): boolean {\n if (!(error instanceof DelopayError)) return false;\n return error.status === 0 || error.status === 429 || error.status >= 500;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-Q7M7DO7M.cjs","../src/paymentPresentation.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBO,IAAM,8BAAA,EAAgC,CAAA;AAGtC,IAAM,0BAAA,EAA4B;AAAA,EACvC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA;AAIA,IAAM,SAAA,EAAW,yCAAA;AAOjB,SA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B,MAAA;AACgB,MAAA;AACG,MAAA;AACL,IAAA;AACF,MAAA;AACM,QAAA;AACP,QAAA;AACX,MAAA;AACe,MAAA;AACK,MAAA;AAIR,MAAA;AACD,QAAA;AACX,MAAA;AAGY,MAAA;AACN,MAAA;AACR,IAAA;AACF,EAAA;AAAA;AAGc,EAAA;AACK,IAAA;AACnB,EAAA;AAEwE,EAAA;AACnD,IAAA;AACC,MAAA;AAClB,MAAA;AACF,IAAA;AACqB,IAAA;AACC,IAAA;AACJ,IAAA;AACI,MAAA;AACL,MAAA;AACG,MAAA;AACpB,IAAA;AACF,EAAA;AACF;AAO4C;AAEvB,EAAA;AAKrB;AAEuB;AACE,EAAA;AACC,EAAA;AAC1B;ADrJ0B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-Q7M7DO7M.cjs","sourcesContent":[null,"/**\n * Helpers for rendering a shop's payment buttons on the merchant's own site\n * from `GET /account/payment-methods/presentation`: DeloPay's\n * built-in glyphs, icon resolution with a fallback, grouping by tier, and a\n * cache for the merchant's server that honours the response's own policy.\n *\n * Nothing here decides which methods a payment can be confirmed with. The\n * payment is confirmed against the shop's current configuration, whatever a\n * cached or displayed list says.\n */\nimport { DelopayError } from './error';\nimport type {\n PaymentMethodPresentationEntry,\n PaymentMethodPresentationParams,\n PaymentMethodPresentationResponse,\n PresentationChild,\n PresentationIcon,\n} from './types';\nimport type { RequestExtras } from './client';\n\n/** The response contract these helpers read. */\nexport const PRESENTATION_CONTRACT_VERSION = 1;\n\n/** The built-in glyph keys a presentation names in `icon.key` and `fallback_icon`. */\nexport const BUILTIN_PAYMENT_ICON_KEYS = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n 'paypal',\n 'klarna',\n 'crypto',\n] as const;\n\nexport type BuiltinPaymentIconKey = (typeof BUILTIN_PAYMENT_ICON_KEYS)[number];\n\nconst SVG_OPEN = '<svg xmlns=\"http://www.w3.org/2000/svg\"';\n\n/**\n * The glyphs DeloPay's hosted checkout draws, as standalone SVG documents.\n * Line glyphs and Apple's mark take `color`; the other brand marks keep their\n * brand colours.\n */\nfunction glyph(key: BuiltinPaymentIconKey, color: string): string {\n const line = (body: string) =>\n `${SVG_OPEN} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"${color}\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\">${body}</svg>`;\n switch (key) {\n case 'card':\n return line('<rect x=\"2\" y=\"5\" width=\"20\" height=\"14\" rx=\"2\"/><path d=\"M2 10h20\"/>');\n case 'bank':\n return line(\n '<path d=\"M3 10h18\"/><path d=\"m12 3 9 5H3l9-5Z\"/><path d=\"M6 10v7M10 10v7M14 10v7M18 10v7\"/><path d=\"M3 20h18\"/>',\n );\n case 'bnpl':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><path d=\"M6 12h4\"/><path d=\"M14 10v4\"/><path d=\"M18 10v4\"/>',\n );\n case 'cash':\n return line(\n '<rect x=\"2\" y=\"6\" width=\"20\" height=\"12\" rx=\"2\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M6 12h.01M18 12h.01\"/>',\n );\n case 'apple':\n return `${SVG_OPEN} viewBox=\"0 0 384 512\" fill=\"${color}\"><path d=\"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z\"/></svg>`;\n case 'google':\n return `${SVG_OPEN} viewBox=\"0 0 48 48\"><path fill=\"#4285F4\" d=\"M45.12 24.5c0-1.56-.14-3.06-.4-4.5H24v8.51h11.84c-.51 2.75-2.06 5.08-4.39 6.64v5.52h7.11c4.16-3.83 6.56-9.47 6.56-16.17z\"/><path fill=\"#34A853\" d=\"M24 46c5.94 0 10.92-1.97 14.56-5.33l-7.11-5.52c-1.97 1.32-4.49 2.1-7.45 2.1-5.73 0-10.58-3.87-12.31-9.07H4.34v5.7C7.96 41.07 15.4 46 24 46z\"/><path fill=\"#FBBC05\" d=\"M11.69 28.18C11.25 26.86 11 25.45 11 24s.25-2.86.69-4.18v-5.7H4.34C2.85 17.09 2 20.45 2 24s.85 6.91 2.34 9.88l7.35-5.7z\"/><path fill=\"#EA4335\" d=\"M24 10.75c3.23 0 6.13 1.11 8.41 3.29l6.31-6.31C34.91 4.18 29.93 2 24 2 15.4 2 7.96 6.93 4.34 14.12l7.35 5.7c1.73-5.2 6.58-9.07 12.31-9.07z\"/></svg>`;\n case 'paypal':\n return `${SVG_OPEN} viewBox=\"0 0 32 32\"><path d=\"M9 4h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L10.4 23H6.7L9 4z\" fill=\"#003087\"/><path d=\"M13 8.5h7.2c3.4 0 6 2.4 5.6 5.8-.4 3.6-3.5 6-7.1 6h-3.2L14.4 27.5H10.7L13 8.5z\" fill=\"#009cde\"/></svg>`;\n case 'klarna':\n return `${SVG_OPEN} viewBox=\"0 0 24 24\"><rect width=\"24\" height=\"24\" rx=\"6\" fill=\"#FFA8CD\"/><path fill=\"#0B051D\" d=\"M8 6h2.7v12H8V6zm6.5 0h2.5c-.4 2.7-1.5 5-3 6.6 1.6 1.6 2.7 3.6 3.2 5.4h-2.7c-.5-1.6-1.4-3-2.7-4.2v4.2H10V12c2.1-1 3.8-3.2 4.5-6z\"/></svg>`;\n case 'crypto':\n return `${SVG_OPEN} viewBox=\"0 0 64 64\"><path fill=\"#F7931A\" d=\"m63.033,39.744c-4.274,17.143-21.637,27.576-38.782,23.301-17.138-4.274-27.571-21.638-23.295-38.78,4.272-17.145,21.635-27.579,38.775-23.305,17.144,4.274,27.576,21.64,23.302,38.784z\"/><path fill=\"#FFF\" d=\"m46.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z\"/></svg>`;\n case 'wallet':\n return line(\n '<path d=\"M3 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2\"/><rect x=\"3\" y=\"7\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M16 13h3\"/>',\n );\n }\n}\n\nfunction isBuiltinKey(key: string): key is BuiltinPaymentIconKey {\n return (BUILTIN_PAYMENT_ICON_KEYS as readonly string[]).includes(key);\n}\n\n/**\n * The SVG document of a built-in glyph. An unknown key — one a newer API\n * added — draws the neutral `wallet` glyph rather than nothing.\n *\n * @param color - What line glyphs and Apple's mark are drawn in. Defaults to\n * a dark grey that reads on a light button.\n */\nexport function builtinPaymentIconSvg(key: string, color = '#1f2937'): string {\n return glyph(isBuiltinKey(key) ? key : 'wallet', color);\n}\n\n/** {@link builtinPaymentIconSvg} as a `data:` URI for an image element's `src`. */\nexport function builtinPaymentIconDataUri(key: string, color?: string): string {\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(builtinPaymentIconSvg(key, color))}`;\n}\n\n/**\n * The image `src` for an icon: an SVG icon's own `data_uri`, a built-in\n * glyph's document otherwise. Use it with an image element, which renders the\n * artwork without running anything in it.\n */\nexport function presentationIconDataUri(icon: PresentationIcon, color?: string): string {\n return icon.type === 'svg' ? icon.data_uri : builtinPaymentIconDataUri(icon.key, color);\n}\n\n/**\n * The image `src` to draw for an entry: its icon, else its fallback glyph.\n * `null` only for a heading, which has no artwork. Pair it with an `onerror`\n * that swaps to `builtinPaymentIconDataUri(entry.fallback_icon)` if you load\n * artwork from anywhere that can fail.\n */\nexport function presentationIconSrc(\n entry: PaymentMethodPresentationEntry,\n color?: string,\n): string | null {\n if (entry.icon) return presentationIconDataUri(entry.icon, color);\n if (entry.fallback_icon) return builtinPaymentIconDataUri(entry.fallback_icon, color);\n return null;\n}\n\n/**\n * Whether DeloPay confirmed a badge: from the provider's answer for the\n * account, or the account's own settings. A `merchant` badge is the shop's\n * own statement for a provider DeloPay cannot ask; draw it, if at all, so a\n * buyer can tell it apart.\n */\nexport function isConfirmedChild(child: Pick<PresentationChild, 'source'>): boolean {\n return child.source !== 'merchant';\n}\n\n/** Whether these helpers understand a response. A different `contract_version` is not read. */\nexport function isSupportedPresentation(\n response: Pick<PaymentMethodPresentationResponse, 'contract_version'>,\n): boolean {\n return response.contract_version === PRESENTATION_CONTRACT_VERSION;\n}\n\n/** A presentation's entries by tier, express rows kept apart, in checkout order. */\nexport interface PresentationTiers {\n express: PaymentMethodPresentationEntry[][];\n normal: PaymentMethodPresentationEntry[];\n alternative: PaymentMethodPresentationEntry[];\n}\n\n/** Group a presentation's entries the way the hosted checkout lays them out. */\nexport function presentationTiers(response: PaymentMethodPresentationResponse): PresentationTiers {\n const out: PresentationTiers = { express: [], normal: [], alternative: [] };\n for (const entry of response.entries) {\n if (entry.tier === 'express') {\n const row = entry.row ?? 0;\n while (out.express.length <= row) out.express.push([]);\n out.express[row]?.push(entry);\n } else {\n out[entry.tier].push(entry);\n }\n }\n out.express = out.express.filter((row) => row.length > 0);\n return out;\n}\n\n/** The entries a buyer can select, in order: everything but headings. */\nexport function selectableEntries(\n response: PaymentMethodPresentationResponse,\n): PaymentMethodPresentationEntry[] {\n return response.entries.filter((entry) => entry.action !== undefined);\n}\n\n/** What {@link PresentationCache.get} answers. */\nexport interface CachedPresentation {\n response: PaymentMethodPresentationResponse;\n /**\n * `true` when DeloPay could not be reached and this is the last answer,\n * still inside its `stale_if_error_seconds`. Display only.\n */\n stale: boolean;\n}\n\n/** How {@link PresentationCache} asks DeloPay. */\nexport type PresentationLoader = (\n params: PaymentMethodPresentationParams,\n options: RequestExtras,\n) => Promise<PaymentMethodPresentationResponse>;\n\nexport interface PresentationCacheOptions {\n /** Usually `(params, options) => delopay.paymentMethods.presentation(params, options)`. */\n load: PresentationLoader;\n /** Milliseconds since the epoch. Defaults to `Date.now`. */\n now?: () => number;\n /** At most this many contexts are kept; the least recently fetched goes first. Default 500. */\n maxEntries?: number;\n}\n\ninterface CacheSlot {\n response: PaymentMethodPresentationResponse;\n fetchedAt: number;\n}\n\n/**\n * A cache for the merchant's server in front of\n * `GET /account/payment-methods/presentation`, keyed by everything that\n * changes the answer: shop, environment, locale, country, currency and amount.\n *\n * - Reuses an answer for its `cache.max_age_seconds`, then revalidates with\n * `If-None-Match`; an unchanged revision costs no body.\n * - While DeloPay cannot be reached it keeps serving the last answer for\n * `cache.stale_if_error_seconds` more, marked `stale`, then rethrows.\n * - Never caches a payment's answer (`client_secret`): those are asked every\n * time, since a cart change needs a new answer.\n *\n * One instance per secret key: an answer is the authenticated merchant's and\n * must not be shared with another merchant's requests.\n */\nexport class PresentationCache {\n private readonly slots = new Map<string, CacheSlot>();\n private readonly load: PresentationLoader;\n private readonly now: () => number;\n private readonly maxEntries: number;\n\n constructor(options: PresentationCacheOptions) {\n this.load = options.load;\n this.now = options.now ?? Date.now;\n this.maxEntries = options.maxEntries ?? 500;\n }\n\n /** The key two requests share exactly when DeloPay would answer them alike. */\n static keyOf(params: PaymentMethodPresentationParams): string {\n return JSON.stringify([\n params.profile_id ?? null,\n params.environment ?? 'live',\n params.locale?.toLowerCase() ?? null,\n params.country?.toUpperCase() ?? null,\n params.currency ?? null,\n params.amount ?? null,\n params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n ]);\n }\n\n async get(params: PaymentMethodPresentationParams): Promise<CachedPresentation> {\n const request: PaymentMethodPresentationParams = {\n ...params,\n contract_version: params.contract_version ?? PRESENTATION_CONTRACT_VERSION,\n };\n if (request.client_secret) {\n return { response: await this.load(request, {}), stale: false };\n }\n const key = PresentationCache.keyOf(request);\n const slot = this.slots.get(key);\n const now = this.now();\n if (slot && now - slot.fetchedAt < slot.response.cache.max_age_seconds * 1000) {\n return { response: slot.response, stale: false };\n }\n try {\n const response = await this.load(\n request,\n slot ? { headers: { 'If-None-Match': `\"${slot.response.revision}\"` } } : {},\n );\n this.store(key, response, now);\n return { response, stale: false };\n } catch (error) {\n if (slot && error instanceof DelopayError && error.status === 304) {\n this.store(key, slot.response, now);\n return { response: slot.response, stale: false };\n }\n const policy = slot?.response.cache;\n const usableUntil = slot\n ? slot.fetchedAt +\n ((policy?.max_age_seconds ?? 0) + (policy?.stale_if_error_seconds ?? 0)) * 1000\n : 0;\n if (slot && isUnavailable(error) && now < usableUntil) {\n return { response: slot.response, stale: true };\n }\n // A definitive refusal (a shop that is gone, a revoked key) retires the\n // answer: a later outage must not bring it back as a stale copy.\n if (slot && isRefusal(error)) this.slots.delete(key);\n throw error;\n }\n }\n\n /** Forget every answer, e.g. after the merchant changes the checkout editor. */\n clear(): void {\n this.slots.clear();\n }\n\n private store(key: string, response: PaymentMethodPresentationResponse, now: number): void {\n if (response.cache.max_age_seconds <= 0) {\n this.slots.delete(key);\n return;\n }\n this.slots.delete(key);\n this.slots.set(key, { response, fetchedAt: now });\n while (this.slots.size > this.maxEntries) {\n const oldest = this.slots.keys().next().value;\n if (oldest === undefined) break;\n this.slots.delete(oldest);\n }\n }\n}\n\n/**\n * DeloPay could not answer: the network, a timeout, a rate limit or a server\n * error. A 4xx (a refused key, a shop that is not there) is an answer, and is\n * never papered over with an older one.\n */\nfunction isRefusal(error: unknown): boolean {\n return (\n error instanceof DelopayError &&\n error.status >= 400 &&\n error.status < 500 &&\n error.status !== 429\n );\n}\n\nfunction isUnavailable(error: unknown): boolean {\n if (!(error instanceof DelopayError)) return false;\n return error.status === 0 || error.status === 429 || error.status >= 500;\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/internal/resources/adminNotices.ts
|
|
2
|
+
var BASE = "/admin-portal/notices";
|
|
3
|
+
var path = (noticeId) => `${BASE}/${encodeURIComponent(noticeId)}`;
|
|
4
|
+
var AdminNotices = class {
|
|
5
|
+
constructor(request) {
|
|
6
|
+
this.request = request;
|
|
7
|
+
}
|
|
8
|
+
/** What the caller may send, and the staff roles, colleagues and merchant roles. `GET /admin-portal/notices/options` */
|
|
9
|
+
async options() {
|
|
10
|
+
return this.request("GET", `${BASE}/options`);
|
|
11
|
+
}
|
|
12
|
+
/** How many people, at how many merchants, an audience reaches right now. `POST /admin-portal/notices/preview` */
|
|
13
|
+
async preview(audience) {
|
|
14
|
+
return this.request("POST", `${BASE}/preview`, { body: { audience } });
|
|
15
|
+
}
|
|
16
|
+
/** Send now, at `send_at`, or keep as a draft; or wait for approval. `POST /admin-portal/notices` */
|
|
17
|
+
async create(params) {
|
|
18
|
+
return this.request("POST", BASE, { body: params });
|
|
19
|
+
}
|
|
20
|
+
/** What staff sent, newest first: sent and withdrawn by default. `GET /admin-portal/notices` */
|
|
21
|
+
async list(params) {
|
|
22
|
+
return this.request("GET", BASE, { query: { ...params } });
|
|
23
|
+
}
|
|
24
|
+
/** One notice with its recipients and their merchant. `GET /admin-portal/notices/{noticeId}` */
|
|
25
|
+
async retrieve(noticeId) {
|
|
26
|
+
return this.request("GET", path(noticeId));
|
|
27
|
+
}
|
|
28
|
+
/** Change a notice not sent yet, at the version read. `PUT /admin-portal/notices/{noticeId}` */
|
|
29
|
+
async update(noticeId, params) {
|
|
30
|
+
return this.request("PUT", path(noticeId), { body: params });
|
|
31
|
+
}
|
|
32
|
+
/** Send a draft or a scheduled notice now. `POST /admin-portal/notices/{noticeId}/send` */
|
|
33
|
+
async sendStored(noticeId, version) {
|
|
34
|
+
return this.request("POST", `${path(noticeId)}/send`, { body: { version } });
|
|
35
|
+
}
|
|
36
|
+
/** Delete a notice not sent yet. `DELETE /admin-portal/notices/{noticeId}` */
|
|
37
|
+
async delete(noticeId, version) {
|
|
38
|
+
return this.request("DELETE", path(noticeId), { query: { version } });
|
|
39
|
+
}
|
|
40
|
+
/** Take a sent notice back from everyone it reached. `POST /admin-portal/notices/{noticeId}/withdraw` */
|
|
41
|
+
async withdraw(noticeId) {
|
|
42
|
+
return this.request("POST", `${path(noticeId)}/withdraw`);
|
|
43
|
+
}
|
|
44
|
+
/** Approve a notice to every merchant another member of staff wrote. `POST /admin-portal/notices/{noticeId}/approve` */
|
|
45
|
+
async approve(noticeId, version) {
|
|
46
|
+
return this.request("POST", `${path(noticeId)}/approve`, { body: { version } });
|
|
47
|
+
}
|
|
48
|
+
/** Refuse a notice to every merchant, saying why. `POST /admin-portal/notices/{noticeId}/refuse` */
|
|
49
|
+
async refuse(noticeId, version, note) {
|
|
50
|
+
return this.request("POST", `${path(noticeId)}/refuse`, { body: { version, note } });
|
|
51
|
+
}
|
|
52
|
+
/** The notices one merchant's people sent each other, read-only. `GET /admin-portal/notices/merchants/{merchantId}` */
|
|
53
|
+
async merchantNotices(merchantId, params) {
|
|
54
|
+
return this.request("GET", `${BASE}/merchants/${encodeURIComponent(merchantId)}`, {
|
|
55
|
+
query: { ...params }
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
AdminNotices
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-QKJZY32F.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/resources/adminNotices.ts"],"sourcesContent":["import type { RequestFn } from '../../client';\nimport type { NoticeList, NoticeListParams } from '../../types';\nimport type {\n PlatformNotice,\n PlatformNoticeAudience,\n PlatformNoticeCreateParams,\n PlatformNoticeDetail,\n PlatformNoticeList,\n PlatformNoticeListParams,\n PlatformNoticeOptions,\n PlatformNoticePreview,\n PlatformNoticeUpdateParams,\n} from '../types';\n\nconst BASE = '/admin-portal/notices';\nconst path = (noticeId: string): string => `${BASE}/${encodeURIComponent(noticeId)}`;\n\n/**\n * Notices staff send to the people of merchants and to colleagues. What the\n * caller may send follows their staff actions; an employee limited to\n * selected merchants reaches only those. A notice to every merchant can wait\n * for a second member of staff (`pending_approval`), never its author or\n * whoever last changed it, for 72 hours.\n */\nexport class AdminNotices {\n constructor(private readonly request: RequestFn) {}\n\n /** What the caller may send, and the staff roles, colleagues and merchant roles. `GET /admin-portal/notices/options` */\n async options(): Promise<PlatformNoticeOptions> {\n return this.request('GET', `${BASE}/options`);\n }\n\n /** How many people, at how many merchants, an audience reaches right now. `POST /admin-portal/notices/preview` */\n async preview(audience: PlatformNoticeAudience): Promise<PlatformNoticePreview> {\n return this.request('POST', `${BASE}/preview`, { body: { audience } });\n }\n\n /** Send now, at `send_at`, or keep as a draft; or wait for approval. `POST /admin-portal/notices` */\n async create(params: PlatformNoticeCreateParams): Promise<PlatformNotice> {\n return this.request('POST', BASE, { body: params });\n }\n\n /** What staff sent, newest first: sent and withdrawn by default. `GET /admin-portal/notices` */\n async list(params?: PlatformNoticeListParams): Promise<PlatformNoticeList> {\n return this.request('GET', BASE, { query: { ...params } });\n }\n\n /** One notice with its recipients and their merchant. `GET /admin-portal/notices/{noticeId}` */\n async retrieve(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('GET', path(noticeId));\n }\n\n /** Change a notice not sent yet, at the version read. `PUT /admin-portal/notices/{noticeId}` */\n async update(noticeId: string, params: PlatformNoticeUpdateParams): Promise<PlatformNotice> {\n return this.request('PUT', path(noticeId), { body: params });\n }\n\n /** Send a draft or a scheduled notice now. `POST /admin-portal/notices/{noticeId}/send` */\n async sendStored(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('POST', `${path(noticeId)}/send`, { body: { version } });\n }\n\n /** Delete a notice not sent yet. `DELETE /admin-portal/notices/{noticeId}` */\n async delete(noticeId: string, version: number): Promise<PlatformNotice> {\n return this.request('DELETE', path(noticeId), { query: { version } });\n }\n\n /** Take a sent notice back from everyone it reached. `POST /admin-portal/notices/{noticeId}/withdraw` */\n async withdraw(noticeId: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/withdraw`);\n }\n\n /** Approve a notice to every merchant another member of staff wrote. `POST /admin-portal/notices/{noticeId}/approve` */\n async approve(noticeId: string, version: number): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/approve`, { body: { version } });\n }\n\n /** Refuse a notice to every merchant, saying why. `POST /admin-portal/notices/{noticeId}/refuse` */\n async refuse(noticeId: string, version: number, note: string): Promise<PlatformNoticeDetail> {\n return this.request('POST', `${path(noticeId)}/refuse`, { body: { version, note } });\n }\n\n /** The notices one merchant's people sent each other, read-only. `GET /admin-portal/notices/merchants/{merchantId}` */\n async merchantNotices(merchantId: string, params?: NoticeListParams): Promise<NoticeList> {\n return this.request('GET', `${BASE}/merchants/${encodeURIComponent(merchantId)}`, {\n query: { ...params },\n });\n }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C9D,WAAO,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,CAAC,WAAW;AAAA,EAC1D;AAAA;AAAA,EAGA,MAAM,QAAQ,UAAkB,SAAgD;AAC9E,WAAO,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AAAA,EAChF;AAAA;AAAA,EAGA,MAAM,OAAO,UAAkB,SAAiB,MAA6C;AAC3F,WAAO,KAAK,QAAQ,QAAQ,GAAG,KAAK,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;AAAA,EACrF;AAAA;AAAA,EAGA,MAAM,gBAAgB,YAAoB,QAAgD;AACxF,WAAO,KAAK,QAAQ,OAAO,GAAG,IAAI,cAAc,mBAAmB,UAAU,CAAC,IAAI;AAAA,MAChF,OAAO,EAAE,GAAG,OAAO;AAAA,IACrB,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/internal/resources/adminFeePlans.ts
|
|
2
|
+
var BASE = "/admin-portal/fee-plans";
|
|
3
|
+
var merchantPath = (merchantId) => `${BASE}/merchants/${encodeURIComponent(merchantId)}`;
|
|
4
|
+
var shopPath = (merchantId, profileId) => `${merchantPath(merchantId)}/shops/${encodeURIComponent(profileId)}`;
|
|
5
|
+
var AdminFeePlans = class {
|
|
6
|
+
constructor(request) {
|
|
7
|
+
this.request = request;
|
|
8
|
+
}
|
|
9
|
+
/** The default plan and every exception, or one merchant's. `GET /admin-portal/fee-plans` */
|
|
10
|
+
async overview(merchantId) {
|
|
11
|
+
return this.request("GET", BASE, { query: { merchant_id: merchantId } });
|
|
12
|
+
}
|
|
13
|
+
/** A new version of the default plan. `PUT /admin-portal/fee-plans/default` */
|
|
14
|
+
async saveDefault(params) {
|
|
15
|
+
return this.request("PUT", `${BASE}/default`, { body: params });
|
|
16
|
+
}
|
|
17
|
+
/** A new version of a merchant exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}` */
|
|
18
|
+
async saveMerchant(merchantId, params) {
|
|
19
|
+
return this.request("PUT", merchantPath(merchantId), { body: params });
|
|
20
|
+
}
|
|
21
|
+
/** A new version of a shop exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}/shops/{profile_id}` */
|
|
22
|
+
async saveShop(merchantId, profileId, params) {
|
|
23
|
+
return this.request("PUT", shopPath(merchantId, profileId), { body: params });
|
|
24
|
+
}
|
|
25
|
+
/** Save the plan of any scope: the default, a merchant or a shop. */
|
|
26
|
+
async save(scope, params) {
|
|
27
|
+
if (!scope.merchant_id) return this.saveDefault(params);
|
|
28
|
+
if (!scope.profile_id) return this.saveMerchant(scope.merchant_id, params);
|
|
29
|
+
return this.saveShop(scope.merchant_id, scope.profile_id, params);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Remove an exception with every scheduled version; the plan above it
|
|
33
|
+
* applies. The default plan cannot be removed.
|
|
34
|
+
*/
|
|
35
|
+
async remove(scope, expectedRevision) {
|
|
36
|
+
if (!scope.merchant_id) {
|
|
37
|
+
throw new TypeError("The default plan cannot be removed.");
|
|
38
|
+
}
|
|
39
|
+
const path = scope.profile_id ? shopPath(scope.merchant_id, scope.profile_id) : merchantPath(scope.merchant_id);
|
|
40
|
+
return this.request("DELETE", path, { query: { expected_revision: expectedRevision } });
|
|
41
|
+
}
|
|
42
|
+
/** Cancel a version that has not started yet. `DELETE /admin-portal/fee-plans/versions/{version_id}` */
|
|
43
|
+
async cancelVersion(versionId, scope, expectedRevision) {
|
|
44
|
+
return this.request("DELETE", `${BASE}/versions/${encodeURIComponent(versionId)}`, {
|
|
45
|
+
query: {
|
|
46
|
+
merchant_id: scope.merchant_id,
|
|
47
|
+
profile_id: scope.profile_id,
|
|
48
|
+
expected_revision: expectedRevision
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** A merchant's connector accounts, for an override that names one. `GET /admin-portal/fee-plans/merchants/{merchant_id}/connector-accounts` */
|
|
53
|
+
async connectorAccounts(merchantId) {
|
|
54
|
+
const body = await this.request(
|
|
55
|
+
"GET",
|
|
56
|
+
`${merchantPath(merchantId)}/connector-accounts`
|
|
57
|
+
);
|
|
58
|
+
return body.accounts;
|
|
59
|
+
}
|
|
60
|
+
/** What a sample payment would be charged under a plan, without saving it. `POST /admin-portal/fee-plans/preview` */
|
|
61
|
+
async preview(params) {
|
|
62
|
+
return this.request("POST", `${BASE}/preview`, { body: params });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
exports.AdminFeePlans = AdminFeePlans;
|
|
69
|
+
//# sourceMappingURL=chunk-QKUWFMZP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-QKUWFMZP.cjs","../src/internal/resources/adminFeePlans.ts"],"names":[],"mappings":"AAAA;ACWA,IAAM,KAAA,EAAO,yBAAA;AACb,IAAM,aAAA,EAAe,CAAC,UAAA,EAAA,GACpB,CAAA,EAAA;AACoC;AASX;AACwB,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAGY,EAAA;AACjC,IAAA;AAC7B,EAAA;AAAA;AAGyE,EAAA;AACzC,IAAA;AAChC,EAAA;AAAA;AAGuC,EAAA;AACV,IAAA;AAC7B,EAAA;AAAA;AAKE,EAAA;AAG2B,IAAA;AAC7B,EAAA;AAAA;AAGuF,EAAA;AACtD,IAAA;AACD,IAAA;AACH,IAAA;AAC7B,EAAA;AAAA;AAAA;AAAA;AAAA;AAMkC,EAAA;AACR,IAAA;AACF,MAAA;AACtB,IAAA;AAEI,IAAA;AAE0B,IAAA;AAChC,EAAA;AAAA;AAKE,EAAA;AAG8B,IAAA;AACrB,MAAA;AACc,QAAA;AACD,QAAA;AACC,QAAA;AACrB,MAAA;AACD,IAAA;AACH,EAAA;AAAA;AAGwB,EAAA;AACE,IAAA;AACtB,MAAA;AAC2B,MAAA;AAC7B,IAAA;AACY,IAAA;AACd,EAAA;AAAA;AAG8E,EAAA;AAC7C,IAAA;AACjC,EAAA;AACF;ADnCoC;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-QKUWFMZP.cjs","sourcesContent":[null,"import type { RequestFn } from '../../client';\nimport type {\n FeePlanConnectorAccount,\n FeePlanOverview,\n FeePlanPreviewRequest,\n FeePlanPreviewResponse,\n FeePlanSaveRequest,\n FeePlanScope,\n FeePlanScopeView,\n} from '../types';\n\nconst BASE = '/admin-portal/fee-plans';\nconst merchantPath = (merchantId: string): string =>\n `${BASE}/merchants/${encodeURIComponent(merchantId)}`;\nconst shopPath = (merchantId: string, profileId: string): string =>\n `${merchantPath(merchantId)}/shops/${encodeURIComponent(profileId)}`;\n\n/**\n * Platform fee plans: the default plan every merchant pays, and exceptions for\n * one merchant or one shop. Every write names the scope's `revision` as read,\n * and one against an older revision is refused, so two editors never\n * overwrite each other.\n */\nexport class AdminFeePlans {\n constructor(private readonly request: RequestFn) {}\n\n /** The default plan and every exception, or one merchant's. `GET /admin-portal/fee-plans` */\n async overview(merchantId?: string): Promise<FeePlanOverview> {\n return this.request('GET', BASE, { query: { merchant_id: merchantId } });\n }\n\n /** A new version of the default plan. `PUT /admin-portal/fee-plans/default` */\n async saveDefault(params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n return this.request('PUT', `${BASE}/default`, { body: params });\n }\n\n /** A new version of a merchant exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}` */\n async saveMerchant(merchantId: string, params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n return this.request('PUT', merchantPath(merchantId), { body: params });\n }\n\n /** A new version of a shop exception. `PUT /admin-portal/fee-plans/merchants/{merchant_id}/shops/{profile_id}` */\n async saveShop(\n merchantId: string,\n profileId: string,\n params: FeePlanSaveRequest,\n ): Promise<FeePlanScopeView> {\n return this.request('PUT', shopPath(merchantId, profileId), { body: params });\n }\n\n /** Save the plan of any scope: the default, a merchant or a shop. */\n async save(scope: FeePlanScope, params: FeePlanSaveRequest): Promise<FeePlanScopeView> {\n if (!scope.merchant_id) return this.saveDefault(params);\n if (!scope.profile_id) return this.saveMerchant(scope.merchant_id, params);\n return this.saveShop(scope.merchant_id, scope.profile_id, params);\n }\n\n /**\n * Remove an exception with every scheduled version; the plan above it\n * applies. The default plan cannot be removed.\n */\n async remove(scope: FeePlanScope, expectedRevision: string): Promise<FeePlanScopeView> {\n if (!scope.merchant_id) {\n throw new TypeError('The default plan cannot be removed.');\n }\n const path = scope.profile_id\n ? shopPath(scope.merchant_id, scope.profile_id)\n : merchantPath(scope.merchant_id);\n return this.request('DELETE', path, { query: { expected_revision: expectedRevision } });\n }\n\n /** Cancel a version that has not started yet. `DELETE /admin-portal/fee-plans/versions/{version_id}` */\n async cancelVersion(\n versionId: string,\n scope: FeePlanScope,\n expectedRevision: string,\n ): Promise<FeePlanScopeView> {\n return this.request('DELETE', `${BASE}/versions/${encodeURIComponent(versionId)}`, {\n query: {\n merchant_id: scope.merchant_id,\n profile_id: scope.profile_id,\n expected_revision: expectedRevision,\n },\n });\n }\n\n /** A merchant's connector accounts, for an override that names one. `GET /admin-portal/fee-plans/merchants/{merchant_id}/connector-accounts` */\n async connectorAccounts(merchantId: string): Promise<FeePlanConnectorAccount[]> {\n const body = await this.request<{ accounts: FeePlanConnectorAccount[] }>(\n 'GET',\n `${merchantPath(merchantId)}/connector-accounts`,\n );\n return body.accounts;\n }\n\n /** What a sample payment would be charged under a plan, without saving it. `POST /admin-portal/fee-plans/preview` */\n async preview(params: FeePlanPreviewRequest): Promise<FeePlanPreviewResponse> {\n return this.request('POST', `${BASE}/preview`, { body: params });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-QRSA72B3.cjs","../src/resources/deploymentBranding.ts"],"names":[],"mappings":"AAAA;ACgBO,SAAS,iBAAA,CAAkB,KAAA,EAAsB,OAAA,EAAiC;AACvF,EAAA,MAAM,KAAA,EAAO,CAAA,iBAAA,EAAoB,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AACD,EAAA;AAC3D;AAQsB;AAIlB,EAAA;AAFiB,IAAA;AACA,IAAA;AAChB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAY8D,EAAA;AACT,IAAA;AACxD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASgE,EAAA;AACL,IAAA;AAC3D,EAAA;AACF;ADvB6D;AACA;AACA;AACA;AACA","file":"/Users/skyline/Programming/delopay/delopay-typescript-sdk/dist/chunk-QRSA72B3.cjs","sourcesContent":[null,"import type { RequestExtras, RequestFn } from '../client';\nimport type { BrandingAsset, PublicBranding } from '../types';\n\n/**\n * The path of one branding image or font file, relative to the API base URL:\n * `/branding/assets/{asset}`, with `?v={version}` when a version is given.\n *\n * The router serves the file in force from this path: the address the\n * operator saved, else the router's own environment value (only `logo` and\n * `email_font` have one). It answers 404 only when neither applies. A page\n * whose content security policy allows only same-origin images and fonts can\n * load it through its same-origin API prefix.\n *\n * So a `null` field from `branding.retrieve()` does not mean this path 404s:\n * `logo` and `email_font` may still serve the router's default.\n */\nexport function brandingAssetPath(asset: BrandingAsset, version?: string | null): string {\n const path = `/branding/assets/${encodeURIComponent(asset)}`;\n return version ? `${path}?v=${encodeURIComponent(version)}` : path;\n}\n\n/**\n * The deployment's branding (name, logos, favicon, default checkout colours)\n * as the platform operator saved it. Public: no credential is needed.\n *\n * The operator edits it through `adminBranding` on `DelopayInternal`.\n */\nexport class Branding {\n constructor(\n private readonly request: RequestFn,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * The saved branding. A `null` field means \"keep your own default\".\n *\n * Branding is cosmetic, so treat any failure as \"nothing saved\": routers\n * from before this route answer 404, and a page must never wait long for\n * it. Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call\n * including its retries; a `timeout` alone applies to each attempt.\n *\n * `GET /branding`\n */\n async retrieve(options?: RequestExtras): Promise<PublicBranding> {\n return this.request('GET', '/branding', { ...options });\n }\n\n /**\n * The address of one branding image or font file on this client's base\n * URL, for an `<img src>` or a `@font-face` `src`. See\n * {@link brandingAssetPath}.\n *\n * `GET /branding/assets/{asset}`\n */\n assetUrl(asset: BrandingAsset, version?: string | null): string {\n return `${this.baseUrl}${brandingAssetPath(asset, version)}`;\n }\n}\n"]}
|
|
@@ -1229,6 +1229,24 @@ var AdminPortal = class {
|
|
|
1229
1229
|
{ body }
|
|
1230
1230
|
);
|
|
1231
1231
|
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Sign in as another staff member, to see and do what they may. Only an
|
|
1234
|
+
* administrator may, from their own session, and only as an active staff
|
|
1235
|
+
* member who is not an administrator. Answers the staff member's session
|
|
1236
|
+
* token for a tab of its own: no cookie is set and the caller's own session
|
|
1237
|
+
* stays as it is. The session ends one sign-in lifetime later, when the
|
|
1238
|
+
* administrator signs out in that tab, or when either person no longer
|
|
1239
|
+
* qualifies. Every change made in it is recorded under the administrator.
|
|
1240
|
+
*
|
|
1241
|
+
* Needs `UsersManage`, else a `403`. A refusal is a `400` `UR_33`: the
|
|
1242
|
+
* caller is no administrator, names themselves, an administrator or no
|
|
1243
|
+
* active staff member, or calls from a session that is not their own. The
|
|
1244
|
+
* admin API key signs in as nobody and is refused the same way.
|
|
1245
|
+
* `POST /admin-portal/staff/{user_id}/sign-in-as`
|
|
1246
|
+
*/
|
|
1247
|
+
async signInAsStaffMember(userId) {
|
|
1248
|
+
return this.request("POST", `/admin-portal/staff/${encodeURIComponent(userId)}/sign-in-as`);
|
|
1249
|
+
}
|
|
1232
1250
|
/**
|
|
1233
1251
|
* What holders of each staff role may do inside a merchant's dashboard
|
|
1234
1252
|
* during a support session.
|
|
@@ -1926,4 +1944,4 @@ function adminAccount(merchantId) {
|
|
|
1926
1944
|
|
|
1927
1945
|
|
|
1928
1946
|
exports.AdminPortal = AdminPortal;
|
|
1929
|
-
//# sourceMappingURL=chunk-
|
|
1947
|
+
//# sourceMappingURL=chunk-QXVMSF3D.cjs.map
|