@delopay/sdk 0.458.0 → 0.459.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/airwallexCard.cjs.map +1 -1
- package/dist/branding.cjs.map +1 -1
- package/dist/cardFormStyles.cjs.map +1 -1
- package/dist/checkoutSession.cjs.map +1 -1
- package/dist/chunk-244VZFFO.cjs.map +1 -1
- package/dist/chunk-2IJRBJXW.cjs.map +1 -1
- package/dist/chunk-34PC72O7.cjs.map +1 -1
- package/dist/chunk-3GBWQWTP.cjs.map +1 -1
- package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
- package/dist/chunk-44QBWVRS.cjs.map +1 -1
- package/dist/chunk-4EKAWNYI.cjs.map +1 -1
- package/dist/chunk-4LN4BR2T.cjs.map +1 -1
- package/dist/chunk-4T4XHPYN.cjs.map +1 -1
- package/dist/chunk-5CITBN33.cjs.map +1 -1
- package/dist/chunk-5HCKC4HF.cjs.map +1 -1
- package/dist/chunk-5O2JSQYA.cjs.map +1 -1
- package/dist/chunk-6EBY2KKL.cjs.map +1 -1
- package/dist/chunk-6LFOM6HV.cjs.map +1 -1
- package/dist/chunk-6LOWE2YI.cjs.map +1 -1
- package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
- package/dist/chunk-6SU2MTN2.cjs.map +1 -1
- package/dist/chunk-6YCDLSIU.cjs.map +1 -1
- package/dist/chunk-75E5WNJG.cjs.map +1 -1
- package/dist/chunk-7JV6VVO7.cjs.map +1 -1
- package/dist/chunk-7QZCUXWB.cjs.map +1 -1
- package/dist/chunk-7VXF5D67.cjs.map +1 -1
- package/dist/chunk-ABWAYMN5.cjs.map +1 -1
- package/dist/chunk-ACZ2R47X.cjs.map +1 -1
- package/dist/chunk-AVR2GPXU.cjs.map +1 -1
- package/dist/chunk-AYUYJO3I.cjs.map +1 -1
- package/dist/chunk-BCA3TCGS.cjs.map +1 -1
- package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
- package/dist/chunk-BRY3W7N3.cjs.map +1 -1
- package/dist/chunk-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.map +1 -1
- package/dist/chunk-F6S3WCCB.cjs.map +1 -1
- package/dist/chunk-FG7YBXJQ.cjs.map +1 -1
- package/dist/chunk-FQRC4NJG.cjs.map +1 -1
- package/dist/chunk-FYISDU2Y.cjs.map +1 -1
- package/dist/chunk-GG52SAHA.cjs.map +1 -1
- package/dist/chunk-GH6CASEG.cjs.map +1 -1
- package/dist/chunk-GK5FWN4H.cjs.map +1 -1
- package/dist/chunk-GSQN5EOO.cjs.map +1 -1
- package/dist/chunk-GW7IHYXR.cjs.map +1 -1
- package/dist/chunk-HLHML5ES.cjs.map +1 -1
- package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
- package/dist/chunk-HLYGHP6F.cjs.map +1 -1
- package/dist/chunk-HSJABE7X.cjs.map +1 -1
- package/dist/chunk-I2W7AO4B.cjs.map +1 -1
- package/dist/chunk-I2XGNALG.cjs.map +1 -1
- package/dist/chunk-IA6O7DWZ.cjs.map +1 -1
- package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
- package/dist/chunk-IR2LFKKA.cjs.map +1 -1
- package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
- package/dist/chunk-JPRSNCYP.cjs.map +1 -1
- package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
- package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
- package/dist/chunk-KJDMNF2T.cjs.map +1 -1
- package/dist/chunk-KLONGJCL.cjs.map +1 -1
- package/dist/chunk-KOB6MOAV.cjs.map +1 -1
- package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
- package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
- package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
- package/dist/chunk-LYIBTVK6.cjs.map +1 -1
- package/dist/chunk-M3HWE7KT.cjs.map +1 -1
- package/dist/chunk-M3SJHFT4.cjs.map +1 -1
- package/dist/chunk-MCNDMK7F.cjs.map +1 -1
- package/dist/chunk-MLG6NXI6.cjs.map +1 -1
- package/dist/chunk-NFB3S2E6.cjs.map +1 -1
- package/dist/chunk-NKDUQ2BI.cjs.map +1 -1
- package/dist/chunk-NYL3BNHR.cjs.map +1 -1
- package/dist/chunk-O4AYHLQX.cjs.map +1 -1
- package/dist/chunk-OAEKP665.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-P4UILJVU.cjs.map +1 -1
- package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
- package/dist/chunk-P7DYLUUI.cjs.map +1 -1
- package/dist/chunk-PKAE6AQT.cjs.map +1 -1
- package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
- package/dist/chunk-QKUWFMZP.cjs.map +1 -1
- package/dist/chunk-QRSA72B3.cjs.map +1 -1
- package/dist/chunk-QYNRNDIY.cjs.map +1 -1
- package/dist/chunk-R4FE6K43.cjs.map +1 -1
- package/dist/chunk-R4GA6BVP.cjs.map +1 -1
- package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
- package/dist/chunk-RHFUXHQN.cjs.map +1 -1
- package/dist/chunk-RI42IDRR.cjs.map +1 -1
- package/dist/chunk-RSVLVW4L.cjs.map +1 -1
- package/dist/chunk-S4TNMIX7.cjs.map +1 -1
- package/dist/chunk-S77LQWYC.cjs.map +1 -1
- package/dist/chunk-S7SBNOGS.cjs.map +1 -1
- package/dist/chunk-TMAJE5P2.cjs.map +1 -1
- package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
- package/dist/chunk-U3JK7NBG.cjs.map +1 -1
- package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
- package/dist/chunk-UKLZAOLW.cjs.map +1 -1
- package/dist/chunk-UZUNBL7K.cjs.map +1 -1
- package/dist/chunk-V47G7P6L.cjs.map +1 -1
- package/dist/chunk-VH5A6SMU.cjs.map +1 -1
- package/dist/chunk-VHMH4QMY.cjs.map +1 -1
- package/dist/chunk-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-Y7LSSRNJ.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.map +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/currencies.cjs.map +1 -1
- package/dist/enigmaCardForm.cjs.map +1 -1
- package/dist/error.cjs.map +1 -1
- package/dist/eventStream.cjs.map +1 -1
- package/dist/exportDownload.cjs.map +1 -1
- package/dist/feeProgram.cjs.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/internal/resources/admin.cjs.map +1 -1
- package/dist/internal/resources/adminBranding.cjs.map +1 -1
- package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
- package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
- package/dist/internal/resources/adminFileScans.cjs.map +1 -1
- package/dist/internal/resources/adminIndustries.cjs.map +1 -1
- package/dist/internal/resources/adminLive.cjs.map +1 -1
- package/dist/internal/resources/adminNotices.cjs.map +1 -1
- package/dist/internal/resources/adminPortal.cjs.map +1 -1
- package/dist/internal/resources/adminSupport.cjs.map +1 -1
- package/dist/internal/resources/auditLogs.cjs.map +1 -1
- package/dist/internal/resources/cache.cjs.map +1 -1
- package/dist/internal/resources/cardIssuers.cjs.map +1 -1
- package/dist/internal/resources/configs.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
- package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
- package/dist/internal/resources/diagnostic.cjs.map +1 -1
- package/dist/internal/resources/gsm.cjs.map +1 -1
- package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
- package/dist/internal/resources/platformBilling.cjs.map +1 -1
- package/dist/internal/resources/platformFees.cjs.map +1 -1
- package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
- package/dist/internal/resources/platformSettings.cjs.map +1 -1
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +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/checkoutDomains.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.map +1 -1
- package/dist/resources/costRules.cjs.map +1 -1
- package/dist/resources/customers.cjs.map +1 -1
- package/dist/resources/deploymentBranding.cjs.map +1 -1
- package/dist/resources/disputes.cjs.map +1 -1
- package/dist/resources/ephemeralKeys.cjs.map +1 -1
- package/dist/resources/events.cjs.map +1 -1
- package/dist/resources/export.cjs.map +1 -1
- package/dist/resources/externalRecords.cjs.map +1 -1
- package/dist/resources/featureMatrix.cjs.map +1 -1
- package/dist/resources/fees.cjs.map +1 -1
- package/dist/resources/files.cjs.map +1 -1
- package/dist/resources/forex.cjs.map +1 -1
- package/dist/resources/identityVerifications.cjs.map +1 -1
- package/dist/resources/industries.cjs.map +1 -1
- package/dist/resources/invoiceSettings.cjs.map +1 -1
- package/dist/resources/invoices.cjs.map +1 -1
- package/dist/resources/live.cjs.map +1 -1
- package/dist/resources/mandates.cjs.map +1 -1
- package/dist/resources/merchantAccounts.cjs.map +1 -1
- package/dist/resources/messageTemplates.cjs.map +1 -1
- package/dist/resources/notices.cjs.map +1 -1
- package/dist/resources/operationLimits.cjs.map +1 -1
- package/dist/resources/paymentLinks.cjs.map +1 -1
- package/dist/resources/paymentMethods.cjs.map +1 -1
- package/dist/resources/payments.cjs.map +1 -1
- package/dist/resources/payoutDestinations.cjs.map +1 -1
- package/dist/resources/payouts.cjs.map +1 -1
- package/dist/resources/paypalDisputes.cjs.map +1 -1
- package/dist/resources/persons.cjs.map +1 -1
- package/dist/resources/poll.cjs.map +1 -1
- package/dist/resources/processorCosts.cjs.map +1 -1
- package/dist/resources/processorImports.cjs.map +1 -1
- package/dist/resources/products.cjs.map +1 -1
- package/dist/resources/profileAcquirers.cjs.map +1 -1
- package/dist/resources/profiles.cjs.map +1 -1
- package/dist/resources/projects.cjs.map +1 -1
- package/dist/resources/refunds.cjs.map +1 -1
- package/dist/resources/regions.cjs.map +1 -1
- package/dist/resources/relay.cjs.map +1 -1
- package/dist/resources/risk.cjs.map +1 -1
- package/dist/resources/routing.cjs.map +1 -1
- package/dist/resources/search.cjs.map +1 -1
- package/dist/resources/sellToRestrictions.cjs.map +1 -1
- package/dist/resources/settings.cjs.map +1 -1
- package/dist/resources/settlement.cjs.map +1 -1
- package/dist/resources/shopLabels.cjs.map +1 -1
- package/dist/resources/shops.cjs.map +1 -1
- package/dist/resources/stripeConnect.cjs.map +1 -1
- package/dist/resources/subscriptions.cjs.map +1 -1
- package/dist/resources/support.cjs.map +1 -1
- package/dist/resources/threeDsRules.cjs.map +1 -1
- package/dist/resources/users.cjs.map +1 -1
- package/dist/resources/vatRates.cjs.map +1 -1
- package/dist/resources/verification.cjs.map +1 -1
- package/dist/resources/webhooks.cjs.map +1 -1
- package/dist/resources/whopResolutionCases.cjs.map +1 -1
- package/dist/trustedOrigins.cjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +65 -2
- package/dist/types.d.ts +65 -2
- package/package.json +17 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/anes/delo-payment/sdk-publish-w2/dist/chunk-R4FE6K43.cjs","../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA;ACgEO,SAAS,8BAAA,CACd,MAAA,EAC4B;AAC5B,EAAA,OAAO,OAAQ,MAAA,CAAqC,cAAA,IAAkB,QAAA;AACxE;AAUO,SAAS,4BAAA,CACd,MAAA,EACsC;AACtC,EAAA,OAAO,OAAQ,MAAA,CAA+C,qBAAA,IAAyB,QAAA;AACzF;AAyBA,SAAS,UAAA,CAAW,GAAA,EAAgC;AAClD,EAAA,GAAA,CAAI,GAAA,CAAI,OAAA,IAAW,EAAA,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I,KAAA,CAAM,kCAAkC,CAAA;AAAA,IACpD;AAEA,IAAA,MAAM,QAAA,EAAU,IAAI,WAAA,CAAY,CAAA;AAChC,IAAA,MAAM,UAAA,EAAY,OAAO,QAAA,IAAY,SAAA,EAAW,OAAA,CAAQ,MAAA,CAAO,OAAO,EAAA,EAAI,OAAA;AAK1E,IAAA,MAAM,eAAA,EAAiB,CAAC,KAAA,EAAA,GAAoC,KAAA;AAC5D,IAAA,MAAM,IAAA,EAAM,MAAM,MAAA,CAAO,SAAA;AAAA,MACvB,KAAA;AAAA,MACA,cAAA,CAAe,OAAA,CAAQ,MAAA,CAAO,MAAM,CAAC,CAAA;AAAA,MACrC,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,UAAU,CAAA;AAAA,MAChC,KAAA;AAAA,MACA,CAAC,QAAQ;AAAA,IACX,CAAA;AAEA,IAAA,MAAM,MAAA,EAAQ,MAAM,MAAA,CAAO,MAAA;AAAA,MACzB,MAAA;AAAA,MACA,GAAA;AAAA,MACA,cAAA,CAAe,cAAc,CAAA;AAAA,MAC7B,cAAA,CAAe,SAAS;AAAA,IAC1B,CAAA;AAEA,IAAA,GAAA,CAAI,CAAC,KAAA,EAAO;AACV,MAAA,MAAM,IAAI,KAAA,CAAM,2BAA2B,CAAA;AAAA,IAC7C;AAEA,IAAA,MAAM,SAAA,EACJ,OAAO,QAAA,IAAY,SAAA,EAAW,QAAA,EAAU,IAAI,WAAA,CAAY,OAAO,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA;AACjF,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,QAAQ,CAAA;AAAA,EAC5B;AACF,CAAA;ADlHA;AACA;AACE;AACA;AACA;AACF,0KAAC","file":"/home/anes/delo-payment/sdk-publish-w2/dist/chunk-R4FE6K43.cjs","sourcesContent":[null,"import type {\n EventType,\n PaymentResponse,\n RefundResponse,\n DisputeResponse,\n MandateResponse,\n PayoutResponse,\n LifecycleWebhook,\n SubscriptionDisputeWebhook,\n SubscriptionWebhookContent,\n ShopRiskEscalationWebhook,\n BuyerRiskAlertWebhook,\n MerchantInvoiceWebhook,\n} from '../types';\n\n/**\n * The payload of a webhook event, tagged by kind.\n *\n * Mirrors the backend's `{ \"type\": …, \"object\": … }` envelope: `type` names the\n * payload shape and `object` carries it. Narrow on `content.type` to get a\n * fully-typed `object`:\n *\n * ```typescript\n * if (event.content.type === 'payment_details') {\n * event.content.object.payment_id; // typed as PaymentResponse\n * }\n * ```\n */\nexport type WebhookContent =\n | { type: 'payment_details'; object: PaymentResponse }\n | { type: 'refund_details'; object: RefundResponse }\n | { type: 'dispute_details'; object: DisputeResponse }\n | { type: 'mandate_details'; object: MandateResponse }\n | { type: 'payout_details'; object: PayoutResponse }\n | { type: 'subscription_details'; object: SubscriptionWebhookContent }\n | { type: 'shop_risk_details'; object: ShopRiskEscalationWebhook }\n | { type: 'buyer_risk_alert_details'; object: BuyerRiskAlertWebhook }\n | { type: 'merchant_invoice_details'; object: MerchantInvoiceWebhook };\n\n/**\n * Whether a `subscription_details` payload is a lifecycle snapshot\n * ({@link LifecycleWebhook}) rather than a cycle chargeback or a paid invoice.\n *\n * Three shapes share `content.type`; what marks a lifecycle snapshot on the\n * wire is `transition_id`, which neither of the other two carries. Narrowing\n * on it — rather than on `event_type` — keeps a handler correct for a\n * lifecycle event added after it was written. A payload that fails this check\n * is not yet a paid invoice: test {@link isSubscriptionDisputeWebhook} next.\n *\n * @example\n * ```typescript\n * if (event.content.type === 'subscription_details') {\n * const object = event.content.object;\n * if (isSubscriptionLifecycleWebhook(object)) {\n * object.status; // SubscriptionStatus at the transition\n * object.cancel_at_period_end; // true for a scheduled cancellation\n * } else if (isSubscriptionDisputeWebhook(object)) {\n * object.amount; // what this chargeback took from the cycle\n * } else {\n * object.invoice; // the paid invoice\n * }\n * }\n * ```\n */\nexport function isSubscriptionLifecycleWebhook(\n object: SubscriptionWebhookContent,\n): object is LifecycleWebhook {\n return typeof (object as Partial<LifecycleWebhook>).transition_id === 'string';\n}\n\n/**\n * Whether a `subscription_details` payload is a chargeback against a\n * subscription cycle ({@link SubscriptionDisputeWebhook}, sent as\n * `invoice_disputed`).\n *\n * It is the only `subscription_details` shape that carries\n * `connector_dispute_id`; neither a lifecycle snapshot nor a paid invoice does.\n */\nexport function isSubscriptionDisputeWebhook(\n object: SubscriptionWebhookContent,\n): object is SubscriptionDisputeWebhook {\n return typeof (object as Partial<SubscriptionDisputeWebhook>).connector_dispute_id === 'string';\n}\n\n/**\n * A parsed and verified Delopay webhook event.\n *\n * Matches the signed wire body exactly:\n * `{ merchant_id, event_id, event_type, content: { type, object }, timestamp }`.\n *\n * - `event_type` identifies the event, e.g. `'payment_succeeded'`.\n * - `content.type` tags the payload kind, e.g. `'payment_details'`.\n * - `content.object` is the payload; narrow on `content.type` to type it.\n */\nexport interface WebhookEvent {\n /** ID of the merchant that owns this event. */\n merchant_id: string;\n /** Unique ID for this event (stable across delivery retries). */\n event_id: string;\n /** Event type identifier, e.g. `'payment_succeeded'` or `'refund_succeeded'`. */\n event_type: EventType;\n /** The event payload, tagged by kind. Narrow on `content.type` to type `object`. */\n content: WebhookContent;\n /** ISO 8601 timestamp at which the webhook was sent. */\n timestamp: string;\n}\n\nfunction hexToBytes(hex: string): Uint8Array | null {\n if (hex.length === 0 || hex.length % 2 !== 0) return null;\n const bytes = new Uint8Array(hex.length / 2);\n for (let i = 0; i < hex.length; i += 2) {\n const byte = Number.parseInt(hex.slice(i, i + 2), 16);\n if (Number.isNaN(byte)) return null;\n bytes[i / 2] = byte;\n }\n return bytes;\n}\n\nexport const Webhooks = {\n /**\n * Verify the signature of an incoming Delopay webhook and return the parsed event.\n *\n * Delopay signs each outgoing webhook with HMAC-SHA512 over the raw request body,\n * using your shop's webhook secret (the *payment response hash key* configured on\n * the shop). The hex-encoded digest is delivered in the `X-Webhook-Signature-512`\n * HTTP header.\n *\n * Uses the Web Crypto API (`globalThis.crypto.subtle`), so it runs unchanged in\n * Node 18+, modern browsers, Deno, Bun, and edge runtimes (Cloudflare Workers, Vercel Edge).\n *\n * Available as a static property on the `Delopay` class\n * (`Delopay.webhooks.verify`) and does not require a client instance.\n *\n * @param rawBody - The raw request body. Pass the original bytes (`Uint8Array` /\n * `Buffer`) when possible; if you pass a string, it must be the unmodified UTF-8\n * text of the request body. Do **not** parse it before passing.\n * @param signatureHeader - The value of the `X-Webhook-Signature-512` HTTP header.\n * @param secret - Your shop's webhook signing secret.\n * @returns Promise that resolves to the parsed webhook event.\n * @throws {Error} When the signature header is malformed or does not match the body.\n *\n * @example\n * ```typescript\n * // Express example\n * app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {\n * try {\n * const event = await Delopay.webhooks.verify(\n * req.body, // Buffer from express.raw()\n * req.header('x-webhook-signature-512') ?? '',\n * process.env.DELOPAY_WEBHOOK_SECRET!,\n * );\n * console.log(event.event_type, event.content.object);\n * res.sendStatus(200);\n * } catch {\n * res.status(400).send('Invalid signature');\n * }\n * });\n * ```\n */\n async verify(\n rawBody: string | Uint8Array,\n signatureHeader: string,\n secret: string,\n ): Promise<WebhookEvent> {\n const subtle = globalThis.crypto?.subtle;\n if (!subtle) {\n throw new Error(\n 'Web Crypto unavailable: Delopay.webhooks.verify requires globalThis.crypto.subtle (Node 18+, modern browsers, Workers, Deno)',\n );\n }\n\n const signatureBytes = hexToBytes(signatureHeader.trim());\n if (!signatureBytes) {\n throw new Error('Invalid webhook signature format');\n }\n\n const encoder = new TextEncoder();\n const bodyBytes = typeof rawBody === 'string' ? encoder.encode(rawBody) : rawBody;\n\n // `TextEncoder.encode` returns `Uint8Array<ArrayBufferLike>` in current lib.dom.d.ts,\n // but `crypto.subtle.*` wants `BufferSource` (backed by `ArrayBuffer`). At runtime the\n // underlying buffer is always an `ArrayBuffer` — cast to quiet the type checker.\n const asBufferSource = (bytes: Uint8Array): BufferSource => bytes as unknown as BufferSource;\n const key = await subtle.importKey(\n 'raw',\n asBufferSource(encoder.encode(secret)),\n { name: 'HMAC', hash: 'SHA-512' },\n false,\n ['verify'],\n );\n\n const valid = await subtle.verify(\n 'HMAC',\n key,\n asBufferSource(signatureBytes),\n asBufferSource(bodyBytes),\n );\n\n if (!valid) {\n throw new Error('Invalid webhook signature');\n }\n\n const bodyText =\n typeof rawBody === 'string' ? rawBody : new TextDecoder('utf-8').decode(rawBody);\n return JSON.parse(bodyText) as WebhookEvent;\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["/tmp/sdk-pub-0459/dist/chunk-R4FE6K43.cjs","../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA;ACgEO,SAAS,8BAAA,CACd,MAAA,EAC4B;AAC5B,EAAA,OAAO,OAAQ,MAAA,CAAqC,cAAA,IAAkB,QAAA;AACxE;AAUO,SAAS,4BAAA,CACd,MAAA,EACsC;AACtC,EAAA,OAAO,OAAQ,MAAA,CAA+C,qBAAA,IAAyB,QAAA;AACzF;AAyBA,SAAS,UAAA,CAAW,GAAA,EAAgC;AAClD,EAAA,GAAA,CAAI,GAAA,CAAI,OAAA,IAAW,EAAA,GAAK,GAAA,CAAI,OAAA,EAAS,EAAA,IAAM,CAAA,EAAG,OAAO,IAAA;AACrD,EAAA,MAAM,MAAA,EAAQ,IAAI,UAAA,CAAW,GAAA,CAAI,OAAA,EAAS,CAAC,CAAA;AAC3C,EAAA,IAAA,CAAA,IAAS,EAAA,EAAI,CAAA,EAAG,EAAA,EAAI,GAAA,CAAI,MAAA,EAAQ,EAAA,GAAK,CAAA,EAAG;AACtC,IAAA,MAAM,KAAA,EAAO,MAAA,CAAO,QAAA,CAAS,GAAA,CAAI,KAAA,CAAM,CAAA,EAAG,EAAA,EAAI,CAAC,CAAA,EAAG,EAAE,CAAA;AACpD,IAAA,GAAA,CAAI,MAAA,CAAO,KAAA,CAAM,IAAI,CAAA,EAAG,OAAO,IAAA;AAC/B,IAAA,KAAA,CAAM,EAAA,EAAI,CAAC,EAAA,EAAI,IAAA;AAAA,EACjB;AACA,EAAA,OAAO,KAAA;AACT;AAEO,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AA;AAAA,MACzB,MAAA;AAAA,MACA,GAAA;AAAA,MACA,cAAA,CAAe,cAAc,CAAA;AAAA,MAC7B,cAAA,CAAe,SAAS;AAAA,IAC1B,CAAA;AAEA,IAAA,GAAA,CAAI,CAAC,KAAA,EAAO;AACV,MAAA,MAAM,IAAI,KAAA,CAAM,2BAA2B,CAAA;AAAA,IAC7C;AAEA,IAAA,MAAM,SAAA,EACJ,OAAO,QAAA,IAAY,SAAA,EAAW,QAAA,EAAU,IAAI,WAAA,CAAY,OAAO,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA;AACjF,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,QAAQ,CAAA;AAAA,EAC5B;AACF,CAAA;ADlHA;AACA;AACE;AACA;AACA;AACF,0KAAC","file":"/tmp/sdk-pub-0459/dist/chunk-R4FE6K43.cjs","sourcesContent":[null,"import type {\n EventType,\n PaymentResponse,\n RefundResponse,\n DisputeResponse,\n MandateResponse,\n PayoutResponse,\n LifecycleWebhook,\n SubscriptionDisputeWebhook,\n SubscriptionWebhookContent,\n ShopRiskEscalationWebhook,\n BuyerRiskAlertWebhook,\n MerchantInvoiceWebhook,\n} from '../types';\n\n/**\n * The payload of a webhook event, tagged by kind.\n *\n * Mirrors the backend's `{ \"type\": …, \"object\": … }` envelope: `type` names the\n * payload shape and `object` carries it. Narrow on `content.type` to get a\n * fully-typed `object`:\n *\n * ```typescript\n * if (event.content.type === 'payment_details') {\n * event.content.object.payment_id; // typed as PaymentResponse\n * }\n * ```\n */\nexport type WebhookContent =\n | { type: 'payment_details'; object: PaymentResponse }\n | { type: 'refund_details'; object: RefundResponse }\n | { type: 'dispute_details'; object: DisputeResponse }\n | { type: 'mandate_details'; object: MandateResponse }\n | { type: 'payout_details'; object: PayoutResponse }\n | { type: 'subscription_details'; object: SubscriptionWebhookContent }\n | { type: 'shop_risk_details'; object: ShopRiskEscalationWebhook }\n | { type: 'buyer_risk_alert_details'; object: BuyerRiskAlertWebhook }\n | { type: 'merchant_invoice_details'; object: MerchantInvoiceWebhook };\n\n/**\n * Whether a `subscription_details` payload is a lifecycle snapshot\n * ({@link LifecycleWebhook}) rather than a cycle chargeback or a paid invoice.\n *\n * Three shapes share `content.type`; what marks a lifecycle snapshot on the\n * wire is `transition_id`, which neither of the other two carries. Narrowing\n * on it — rather than on `event_type` — keeps a handler correct for a\n * lifecycle event added after it was written. A payload that fails this check\n * is not yet a paid invoice: test {@link isSubscriptionDisputeWebhook} next.\n *\n * @example\n * ```typescript\n * if (event.content.type === 'subscription_details') {\n * const object = event.content.object;\n * if (isSubscriptionLifecycleWebhook(object)) {\n * object.status; // SubscriptionStatus at the transition\n * object.cancel_at_period_end; // true for a scheduled cancellation\n * } else if (isSubscriptionDisputeWebhook(object)) {\n * object.amount; // what this chargeback took from the cycle\n * } else {\n * object.invoice; // the paid invoice\n * }\n * }\n * ```\n */\nexport function isSubscriptionLifecycleWebhook(\n object: SubscriptionWebhookContent,\n): object is LifecycleWebhook {\n return typeof (object as Partial<LifecycleWebhook>).transition_id === 'string';\n}\n\n/**\n * Whether a `subscription_details` payload is a chargeback against a\n * subscription cycle ({@link SubscriptionDisputeWebhook}, sent as\n * `invoice_disputed`).\n *\n * It is the only `subscription_details` shape that carries\n * `connector_dispute_id`; neither a lifecycle snapshot nor a paid invoice does.\n */\nexport function isSubscriptionDisputeWebhook(\n object: SubscriptionWebhookContent,\n): object is SubscriptionDisputeWebhook {\n return typeof (object as Partial<SubscriptionDisputeWebhook>).connector_dispute_id === 'string';\n}\n\n/**\n * A parsed and verified Delopay webhook event.\n *\n * Matches the signed wire body exactly:\n * `{ merchant_id, event_id, event_type, content: { type, object }, timestamp }`.\n *\n * - `event_type` identifies the event, e.g. `'payment_succeeded'`.\n * - `content.type` tags the payload kind, e.g. `'payment_details'`.\n * - `content.object` is the payload; narrow on `content.type` to type it.\n */\nexport interface WebhookEvent {\n /** ID of the merchant that owns this event. */\n merchant_id: string;\n /** Unique ID for this event (stable across delivery retries). */\n event_id: string;\n /** Event type identifier, e.g. `'payment_succeeded'` or `'refund_succeeded'`. */\n event_type: EventType;\n /** The event payload, tagged by kind. Narrow on `content.type` to type `object`. */\n content: WebhookContent;\n /** ISO 8601 timestamp at which the webhook was sent. */\n timestamp: string;\n}\n\nfunction hexToBytes(hex: string): Uint8Array | null {\n if (hex.length === 0 || hex.length % 2 !== 0) return null;\n const bytes = new Uint8Array(hex.length / 2);\n for (let i = 0; i < hex.length; i += 2) {\n const byte = Number.parseInt(hex.slice(i, i + 2), 16);\n if (Number.isNaN(byte)) return null;\n bytes[i / 2] = byte;\n }\n return bytes;\n}\n\nexport const Webhooks = {\n /**\n * Verify the signature of an incoming Delopay webhook and return the parsed event.\n *\n * Delopay signs each outgoing webhook with HMAC-SHA512 over the raw request body,\n * using your shop's webhook secret (the *payment response hash key* configured on\n * the shop). The hex-encoded digest is delivered in the `X-Webhook-Signature-512`\n * HTTP header.\n *\n * Uses the Web Crypto API (`globalThis.crypto.subtle`), so it runs unchanged in\n * Node 18+, modern browsers, Deno, Bun, and edge runtimes (Cloudflare Workers, Vercel Edge).\n *\n * Available as a static property on the `Delopay` class\n * (`Delopay.webhooks.verify`) and does not require a client instance.\n *\n * @param rawBody - The raw request body. Pass the original bytes (`Uint8Array` /\n * `Buffer`) when possible; if you pass a string, it must be the unmodified UTF-8\n * text of the request body. Do **not** parse it before passing.\n * @param signatureHeader - The value of the `X-Webhook-Signature-512` HTTP header.\n * @param secret - Your shop's webhook signing secret.\n * @returns Promise that resolves to the parsed webhook event.\n * @throws {Error} When the signature header is malformed or does not match the body.\n *\n * @example\n * ```typescript\n * // Express example\n * app.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {\n * try {\n * const event = await Delopay.webhooks.verify(\n * req.body, // Buffer from express.raw()\n * req.header('x-webhook-signature-512') ?? '',\n * process.env.DELOPAY_WEBHOOK_SECRET!,\n * );\n * console.log(event.event_type, event.content.object);\n * res.sendStatus(200);\n * } catch {\n * res.status(400).send('Invalid signature');\n * }\n * });\n * ```\n */\n async verify(\n rawBody: string | Uint8Array,\n signatureHeader: string,\n secret: string,\n ): Promise<WebhookEvent> {\n const subtle = globalThis.crypto?.subtle;\n if (!subtle) {\n throw new Error(\n 'Web Crypto unavailable: Delopay.webhooks.verify requires globalThis.crypto.subtle (Node 18+, modern browsers, Workers, Deno)',\n );\n }\n\n const signatureBytes = hexToBytes(signatureHeader.trim());\n if (!signatureBytes) {\n throw new Error('Invalid webhook signature format');\n }\n\n const encoder = new TextEncoder();\n const bodyBytes = typeof rawBody === 'string' ? encoder.encode(rawBody) : rawBody;\n\n // `TextEncoder.encode` returns `Uint8Array<ArrayBufferLike>` in current lib.dom.d.ts,\n // but `crypto.subtle.*` wants `BufferSource` (backed by `ArrayBuffer`). At runtime the\n // underlying buffer is always an `ArrayBuffer` — cast to quiet the type checker.\n const asBufferSource = (bytes: Uint8Array): BufferSource => bytes as unknown as BufferSource;\n const key = await subtle.importKey(\n 'raw',\n asBufferSource(encoder.encode(secret)),\n { name: 'HMAC', hash: 'SHA-512' },\n false,\n ['verify'],\n );\n\n const valid = await subtle.verify(\n 'HMAC',\n key,\n asBufferSource(signatureBytes),\n asBufferSource(bodyBytes),\n );\n\n if (!valid) {\n throw new Error('Invalid webhook signature');\n }\n\n const bodyText =\n typeof rawBody === 'string' ? rawBody : new TextDecoder('utf-8').decode(rawBody);\n return JSON.parse(bodyText) as WebhookEvent;\n },\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/sdk-pub-0459/dist/chunk-R4GA6BVP.cjs","../src/internal/resources/auditLogs.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACUO,IAAM,UAAA,EAAN,MAAgB;AAAA,EACrB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOlD,MAAM,IAAA,CAAK,MAAA,EAA4D;AACrE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,qBAAA,EAAuB;AAAA,MAChD,KAAA,EAAO,wCAAA,MAAS,EAAQ,CAAC,QAAA,EAAU,aAAa,CAAC;AAAA,IACnD,CAAC,CAAA;AAAA,EACH;AAAA,EAEA,MAAM,QAAA,CAAS,KAAA,EAA0C;AACvD,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,oBAAA,EAAuB,kBAAA,CAAmB,KAAK,CAAC,CAAA,CAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYqF,EAAA;AACvE,IAAA;AACV,MAAA;AACwD,MAAA;AAC1D,IAAA;AACF,EAAA;AA6B6D,EAAA;AACpD,IAAA;AACA,MAAA;AACL,MAAA;AACA,MAAA;AAAA;AAAA;AAAA;AAIqD,MAAA;AACrD,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADrCgF;AACA;AACA;AACA","file":"/tmp/sdk-pub-0459/dist/chunk-R4GA6BVP.cjs","sourcesContent":[null,"import type {\n AuditLogListParams,\n AuditLogListResponse,\n AuditLogResponse,\n ShopCheckoutStateListResponse,\n} from '../types';\nimport type { AdminAuditLogExportRecord } from '../types';\nimport type {\n BinaryExportOptions,\n ExportEnvelope,\n ExportOptions,\n JsonExportOptions,\n} from '../../types';\nimport type { RequestFn } from '../../client';\nimport { runExport } from '../../exportDownload';\nimport { csvQuery } from '../../listQuery';\n\nexport class AuditLogs {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of the platform audit log, the newest entry first unless\n * `sort_by` says otherwise. Several `action` or `entity_type` values match\n * an entry with any of them.\n */\n async list(params?: AuditLogListParams): Promise<AuditLogListResponse> {\n return this.request('GET', '/admin-portal/audit', {\n query: csvQuery(params, ['action', 'entity_type']),\n });\n }\n\n async retrieve(logId: string): Promise<AuditLogResponse> {\n return this.request('GET', `/admin-portal/audit/${encodeURIComponent(logId)}`);\n }\n\n /**\n * What each shop of a merchant can take at its Live and its Test checkout\n * now. `GET /admin-portal/accounts/{merchant_id}/checkout-state`\n *\n * Every shop of the merchant is listed, with the number of accounts that\n * can take a payment at each checkout. For an account a checkout does not\n * use, `blocks` names who hid it or switched it off in the shop and why;\n * `idle_accounts` names the accounts that take no payments for a reason of\n * their own, such as missing credentials for that environment.\n */\n async shopCheckoutStates(merchantId: string): Promise<ShopCheckoutStateListResponse> {\n return this.request(\n 'GET',\n `/admin-portal/accounts/${encodeURIComponent(merchantId)}/checkout-state`,\n );\n }\n\n /**\n * The platform audit log as a file. `GET /admin-portal/audit/export`\n *\n * Takes the same filters as {@link AuditLogs.list}, and returns the whole\n * match set rather than a page — bounded at 25,000 rows (500 for `pdf`), and\n * refused past that with `DE_07` rather than truncated. `csv` and `json` are\n * streamed and held to their `X-Delopay-Record-Count`; see\n * {@link ExportTransferOptions} for progress, cancellation and the\n * `EXPORT_INCOMPLETE` check.\n *\n * Columns answer the question an audit asks rather than mirroring the\n * dashboard table: the actor, the real actor behind an impersonation, the\n * action, its target, when, and from where. `details` is deliberately absent —\n * an unbounded per-action blob is unreadable in a spreadsheet cell.\n */\n async export(\n params?: AuditLogListParams,\n options?: JsonExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord>>;\n async export(params: AuditLogListParams | undefined, options: BinaryExportOptions): Promise<Blob>;\n async export(\n params: AuditLogListParams | undefined,\n options: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob>;\n async export(\n params?: AuditLogListParams,\n options?: ExportOptions,\n ): Promise<ExportEnvelope<AdminAuditLogExportRecord> | Blob> {\n return runExport(\n this.request,\n 'GET',\n '/admin-portal/audit/export',\n // The format is negotiated by `Accept`, never a query field: the query\n // here is the list's own filter model, and adding a key to it would fork\n // the filter vocabulary the export exists to reuse.\n { query: csvQuery(params, ['action', 'entity_type']) },\n options,\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/sdk-pub-0459/dist/chunk-R5VYSZ3Q.cjs","../src/resources/events.ts"],"names":[],"mappings":"AAAA;ACSO,IAAM,OAAA,EAAN,MAAa;AAAA,EAClB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,IAAA,CAAK,UAAA,EAAoB,MAAA,EAAsD;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,QAAA,EAAW,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUgG,EAAA;AAClF,IAAA;AACV,MAAA;AACgE,MAAA;AAClE,IAAA;AACF,EAAA;AAEuF,EAAA;AACzE,IAAA;AACV,MAAA;AACgE,MAAA;AAClE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcuC,EAAA;AACgC,IAAA;AACvE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW0E,EAAA;AACJ,IAAA;AACtE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAS6F,EAAA;AAC5B,IAAA;AACjE,EAAA;AACF;ADf0E;AACA;AACA;AACA","file":"/tmp/sdk-pub-0459/dist/chunk-R5VYSZ3Q.cjs","sourcesContent":[null,"import type {\n EventListParams,\n EventListResponse,\n EventDetailResponse,\n EventManualTriggerRequest,\n EventManualTriggerResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Events {\n constructor(private readonly request: RequestFn) {}\n\n async list(merchantId: string, params?: EventListParams): Promise<EventListResponse> {\n return this.request('POST', `/events/${encodeURIComponent(merchantId)}`, { body: params });\n }\n\n /**\n * Every delivery attempt of one event, initial attempt first.\n * `GET /events/{merchant_id}/{event_id}/attempts`\n *\n * Each entry describes one attempt: `attempt_delivered` is that attempt's own\n * result, while `is_delivery_successful` and `delivery_terminal_reason` are\n * the event's and read the same on every entry.\n */\n async listDeliveryAttempts(merchantId: string, eventId: string): Promise<EventDetailResponse[]> {\n return this.request(\n 'GET',\n `/events/${encodeURIComponent(merchantId)}/${encodeURIComponent(eventId)}/attempts`,\n );\n }\n\n async retryDelivery(merchantId: string, eventId: string): Promise<EventDetailResponse> {\n return this.request(\n 'POST',\n `/events/${encodeURIComponent(merchantId)}/${encodeURIComponent(eventId)}/retry`,\n );\n }\n\n /**\n * Fire an outgoing webhook event by hand for one object.\n * `POST /events/{merchant_id}/trigger`\n *\n * Not a replay — see {@link EventManualTriggerRequest}. Needs the\n * `WebhookEventTrigger` permission, which is separate from the one that\n * authorizes {@link retryDelivery}, and is JWT-only: a forged payload must\n * be attributable to a person.\n */\n async trigger(\n merchantId: string,\n body: EventManualTriggerRequest,\n ): Promise<EventManualTriggerResponse> {\n return this.request('POST', `/events/${encodeURIComponent(merchantId)}/trigger`, { body });\n }\n\n // --- Profile-scoped listing (Task 4.12) ---\n\n /**\n * List events (profile-scoped). `POST /events/profile/list`\n *\n * Takes the same constraints as {@link list} — it is the same endpoint\n * narrowed to the caller's own shop, so `profile_id` is redundant and\n * ignored there.\n */\n async listByProfile(params?: EventListParams): Promise<EventListResponse> {\n return this.request('POST', '/events/profile/list', { body: params });\n }\n\n /**\n * Fire an outgoing webhook event by hand (profile-scoped).\n * `POST /events/profile/trigger`\n *\n * The shop-user twin of {@link trigger}; the shop is taken from the auth\n * context, so `profile_id` on the body is ignored.\n */\n async triggerByProfile(body: EventManualTriggerRequest): Promise<EventManualTriggerResponse> {\n return this.request('POST', '/events/profile/trigger', { body });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/sdk-pub-0459/dist/chunk-RHFUXHQN.cjs","../src/resources/aiTools.ts"],"names":[],"mappings":"AAAA;ACQA,IAAM,iBAAA,EAAmB,CAAC,cAAA,EAAwB,QAAA,EAAA,GAChD,CAAA,2BAAA,EAA8B,kBAAA,CAAmB,cAAc,CAAC,CAAA,CAAA,EAAI,QAAQ,CAAA,CAAA;AAgBzD;AAC8B,EAAA;AAApB,IAAA;AAAqB,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUV,EAAA;AACmB,IAAA;AACH,MAAA;AACrD,IAAA;AACH,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOiF,EAAA;AACR,IAAA;AACzE,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO4D,EAAA;AACL,IAAA;AACvD,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQuD,EAAA;AACkC,IAAA;AACzF,EAAA;AACF;AD3BkI;AACA;AACA;AACA","file":"/tmp/sdk-pub-0459/dist/chunk-RHFUXHQN.cjs","sourcesContent":[null,"import type {\n McpConfirmationEntry,\n McpConfirmationListParams,\n McpConfirmationListResponse,\n McpConnectionListResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nconst confirmationPath = (confirmationId: string, decision: 'approve' | 'decline'): string =>\n `/account/mcp/confirmations/${encodeURIComponent(confirmationId)}/${decision}`;\n\n/**\n * AI tools that work in the merchant account through the MCP server: the\n * confirmations they ask for, and the tools connected by signing in.\n *\n * A sensitive change an AI tool makes, such as a refund, a deletion or an\n * access change, waits for a person's confirmation. When the tool cannot ask\n * in the agent, the confirmation waits here for a decision.\n *\n * Every method needs a signed-in dashboard user and acts on the merchant of\n * that sign-in. A user sees the confirmations of their own sign-ins and their\n * own connected tools; a user whose role may manage API keys sees every one of\n * the merchant's. A sign-in's confirmation is decided only by the user who\n * signed in, an API key's by a user whose role may manage API keys.\n */\nexport class AiTools {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * The confirmations this user may see, newest first: by default those\n * waiting for a decision and not expired, or every one with\n * `{ status: 'all' }`.\n * `GET /account/mcp/confirmations`\n */\n async listConfirmations(\n params: McpConfirmationListParams = {},\n ): Promise<McpConfirmationListResponse> {\n return this.request('GET', '/account/mcp/confirmations', {\n query: params.status ? { status: params.status } : {},\n });\n }\n\n /**\n * Approve a pending confirmation. The AI tool can then make the confirmed\n * change once, for the same request, before the confirmation expires.\n * Refused with 400 when it is no longer pending, 403 when this user may not\n * decide it, and 404 for an unknown confirmation.\n * `POST /account/mcp/confirmations/{confirmationId}/approve`\n */\n async approveConfirmation(confirmationId: string): Promise<McpConfirmationEntry> {\n return this.request('POST', confirmationPath(confirmationId, 'approve'));\n }\n\n /**\n * Decline a pending confirmation; the change is not made. Refused like\n * {@link AiTools.approveConfirmation}.\n * `POST /account/mcp/confirmations/{confirmationId}/decline`\n */\n async declineConfirmation(confirmationId: string): Promise<McpConfirmationEntry> {\n return this.request('POST', confirmationPath(confirmationId, 'decline'));\n }\n\n /**\n * The AI tools connected to the merchant by signing in, newest first: this\n * user's own, or every user's for a role that may manage API keys.\n * `GET /account/mcp/connections`\n */\n async listConnections(): Promise<McpConnectionListResponse> {\n return this.request('GET', '/account/mcp/connections');\n }\n\n /**\n * Remove a connected AI tool by revoking its sign-in; its next request is\n * refused. Refused with 403 when it is neither this user's tool nor the role\n * may manage API keys, and 404 for an unknown one.\n * `DELETE /account/mcp/connections/{grantId}`\n */\n async removeConnection(grantId: string): Promise<void> {\n return this.request('DELETE', `/account/mcp/connections/${encodeURIComponent(grantId)}`);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/sdk-pub-0459/dist/chunk-RI42IDRR.cjs","../src/resources/profileAcquirers.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,iBAAA,EAAN,MAAuB;AAAA,EAC5B,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAAwE;AACnF,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,mBAAA,EAAqB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EACnE;AAAA,EAEA,MAAM,MAAA,CACJ,SAAA,EACA,iBAAA,EACA,MAAA,EACkC;AAClC,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,MAAA;AAAA,MACA,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,SAAS,CAAC,CAAA,CAAA,EAAI,kBAAA,CAAmB,iBAAiB,CAAC,CAAA,CAAA;AAC3F,MAAA;AACQ,QAAA;AACR,MAAA;AACF,IAAA;AACF,EAAA;AACF;ADTkG;AACA;AACA;AACA","file":"/tmp/sdk-pub-0459/dist/chunk-RI42IDRR.cjs","sourcesContent":[null,"import type {\n ProfileAcquirerCreateRequest,\n ProfileAcquirerResponse,\n ProfileAcquirerUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ProfileAcquirers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: ProfileAcquirerCreateRequest): Promise<ProfileAcquirerResponse> {\n return this.request('POST', '/profile-acquirer', { body: params });\n }\n\n async update(\n profileId: string,\n profileAcquirerId: string,\n params: ProfileAcquirerUpdateRequest,\n ): Promise<ProfileAcquirerResponse> {\n return this.request(\n 'POST',\n `/profile-acquirer/${encodeURIComponent(profileId)}/${encodeURIComponent(profileAcquirerId)}`,\n {\n body: params,\n },\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/tmp/sdk-pub-0459/dist/chunk-RSVLVW4L.cjs","../src/resources/buyerBlocklist.ts"],"names":[],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AA;AAAA;AAMuE,EAAA;AACM,IAAA;AAC7E,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAO8D,EAAA;AACJ,IAAA;AAC1D,EAAA;AAAA;AAAA;AAAA;AAAA;AAMyF,EAAA;AAC3E,IAAA;AACV,MAAA;AACsE,MAAA;AACxE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUsC,EAAA;AACxB,IAAA;AACV,MAAA;AACsE,MAAA;AACvD,MAAA;AACjB,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOwF,EAAA;AAC1E,IAAA;AACV,MAAA;AACsE,MAAA;AACxE,IAAA;AACF,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ4E,EAAA;AACb,IAAA;AAC/D,EAAA;AACF;ADxDkF;AACA;AACA;AACA","file":"/tmp/sdk-pub-0459/dist/chunk-RSVLVW4L.cjs","sourcesContent":[null,"import type {\n BuyerBlocklistCapabilitiesResponse,\n BuyerBlocklistEntryCreateRequest,\n BuyerBlocklistEntryDeleteRequest,\n BuyerBlocklistEntryResponse,\n BuyerBlocklistEventsQuery,\n BuyerBlocklistEventsResponse,\n BuyerBlocklistFromPaymentPreviewRequest,\n BuyerBlocklistFromPaymentPreviewResponse,\n BuyerBlocklistFromPaymentRequest,\n BuyerBlocklistListQuery,\n BuyerBlocklistListResponse,\n PaymentFraudSignalsResponse,\n RadarSyncSettingsListResponse,\n RadarSyncSettingsResponse,\n RadarSyncSettingsUpdateRequest,\n} from '../types';\nimport type { RequestFn } from '../client';\nimport { csvQuery } from '../listQuery';\n\n/**\n * Buyer blocklist: the buyers a merchant refuses to sell to again, in every\n * shop of the merchant or in one shop. One entry names the buyer by email\n * address, IP address, IP range, customer id, device id, Stripe card\n * fingerprint and card BIN, at most one of each and at least one in total,\n * and blocks a payment when any one of them matches. An entry can instead\n * block a class of network (hosting, VPN or proxy, Tor, residential proxy) on its own. A blocked buyer's hosted checkout\n * and confirms fail with error code `DE_14`, and the payments create\n * response marks the buyer with `buyer_blocked` and the entry's\n * `buyer_block_note`. Card fingerprints, emails, IPs and BINs can also be\n * copied to Stripe Radar value lists per Stripe connection; a Radar list\n * blocks only once its rule is added in Stripe (`rule_needed`).\n *\n * Every route needs a dashboard session. Reading needs the `BuyerBlocklist`\n * area at `Read`, adding and removing needs `Write`. A caller scoped to one\n * shop lists, adds and removes that shop's entries only, and never an entry\n * that blocks in every shop.\n */\nexport class BuyerBlocklist {\n constructor(private readonly request: RequestFn) {}\n\n /**\n * One page of blocked buyers, newest first unless `sort_by` says otherwise,\n * filtered by scope, by `kind` (the entries that include an identifier of\n * that kind, or of any of several) and by a search over every identifier\n * and the note. Expired entries are not listed.\n * `GET /buyer-blocklist`\n */\n async list(params?: BuyerBlocklistListQuery): Promise<BuyerBlocklistListResponse> {\n return this.request('GET', '/buyer-blocklist', {\n query: csvQuery(params, ['kind']),\n });\n }\n\n /**\n * Block a buyer in one shop or, without `profile_id`, in every shop of the\n * merchant, named by one or more of `email`, `ip`, `customer_id` and\n * `device_id`. Each identifier is normalised as it is matched; an\n * identifier another entry already names in that scope is refused. The\n * change is recorded in the audit log before it is made.\n * `POST /buyer-blocklist`\n */\n async create(params: BuyerBlocklistEntryCreateRequest): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', '/buyer-blocklist', { body: params });\n }\n\n /**\n * Remove an entry, so the buyer can pay again. Payments the entry already\n * refused keep their status. The removal and the optional `reason` are\n * recorded in the audit log before it is made. The route requires a body,\n * so `{}` is sent when no reason is given.\n * `DELETE /buyer-blocklist/{entry_id}`\n */\n async delete(\n entryId: string,\n params?: BuyerBlocklistEntryDeleteRequest,\n ): Promise<BuyerBlocklistEntryResponse> {\n return this.request('DELETE', `/buyer-blocklist/${encodeURIComponent(entryId)}`, {\n body: params ?? {},\n });\n }\n\n /**\n * Block the buyer of a payment by the identifiers the payment carries:\n * its card (the Stripe fingerprint), email, IP, device or customer, in the\n * payment's shop or in every shop. With `all_ips`, also every address the\n * buyer was seen paying from, one entry each, grouped under one\n * `group_id`; the answer then carries `ip_snapshot`.\n * `POST /buyer-blocklist/from-payment`\n */\n async createFromPayment(\n params: BuyerBlocklistFromPaymentRequest,\n ): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', '/buyer-blocklist/from-payment', { body: params });\n }\n\n /**\n * The addresses an \"all IPs\" block of a payment's buyer would take: the\n * payment's own, then those its device, email or card were seen at in the\n * last 90 days, newest first, at most 20. An address shared with two or\n * more other buyers is offered but not preselected. Writes nothing; needs\n * the same permissions as the block.\n * `POST /buyer-blocklist/from-payment/preview`\n */\n async previewFromPayment(\n params: BuyerBlocklistFromPaymentPreviewRequest,\n ): Promise<BuyerBlocklistFromPaymentPreviewResponse> {\n return this.request('POST', '/buyer-blocklist/from-payment/preview', { body: params });\n }\n\n /**\n * An entry's recorded refusals, newest first, with where each happened and\n * which identifier matched. A caller scoped to one shop reaches only its own\n * shop's entries.\n * `GET /buyer-blocklist/{entry_id}/events`\n */\n async listEvents(\n entryId: string,\n params?: BuyerBlocklistEventsQuery,\n ): Promise<BuyerBlocklistEventsResponse> {\n return this.request('GET', `/buyer-blocklist/${encodeURIComponent(entryId)}/events`, {\n query: params as Record<string, string | number | null | undefined>,\n });\n }\n\n /**\n * Which classes of network an `ip_class` entry can be judged by on this\n * deployment now, and by which sources.\n * `GET /buyer-blocklist/capabilities`\n */\n async capabilities(): Promise<BuyerBlocklistCapabilitiesResponse> {\n return this.request('GET', '/buyer-blocklist/capabilities');\n }\n\n /**\n * Retry now every failed or pending Radar sync of an entry.\n * `POST /buyer-blocklist/{entry_id}/sync/retry`\n */\n async retrySync(entryId: string): Promise<BuyerBlocklistEntryResponse> {\n return this.request('POST', `/buyer-blocklist/${encodeURIComponent(entryId)}/sync/retry`);\n }\n\n /**\n * The Radar sync settings of every Stripe connection the caller sees. A\n * role that hides processor names is refused (403).\n * `GET /buyer-blocklist/radar-sync`\n */\n async listRadarSync(): Promise<RadarSyncSettingsListResponse> {\n return this.request('GET', '/buyer-blocklist/radar-sync');\n }\n\n /**\n * The Radar sync settings of one Stripe connection.\n * `GET /buyer-blocklist/radar-sync/{merchant_connector_id}`\n */\n async retrieveRadarSync(merchantConnectorId: string): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'GET',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}`,\n );\n }\n\n /**\n * Turn Radar sync on or off for one Stripe connection and set what an\n * early fraud warning or a review does.\n * `PUT /buyer-blocklist/radar-sync/{merchant_connector_id}`\n */\n async updateRadarSync(\n merchantConnectorId: string,\n params: RadarSyncSettingsUpdateRequest,\n ): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'PUT',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}`,\n { body: params },\n );\n }\n\n /**\n * Remove every item DeloPay synced from this connection's Radar lists. The\n * lists themselves are kept.\n * `POST /buyer-blocklist/radar-sync/{merchant_connector_id}/remove-items`\n */\n async removeRadarItems(merchantConnectorId: string): Promise<RadarSyncSettingsResponse> {\n return this.request(\n 'POST',\n `/buyer-blocklist/radar-sync/${encodeURIComponent(merchantConnectorId)}/remove-items`,\n );\n }\n\n /**\n * Stripe's fraud signals on a payment (risk, early fraud warnings,\n * reviews), what of its buyer can be blocked, and the entries that\n * already match it.\n * `GET /buyer-blocklist/fraud-signals/{payment_id}`\n */\n async fraudSignals(paymentId: string): Promise<PaymentFraudSignalsResponse> {\n return this.request('GET', `/buyer-blocklist/fraud-signals/${encodeURIComponent(paymentId)}`);\n }\n}\n"]}
|