import type { StringValue } from "ms"; import { CartItem, CheckoutSessionCreate } from "../models/components"; import type { Gr4vy } from "../sdk/sdk"; /** * Helper method for generating a bearer token for use with the SDK */ export declare const withToken: (options: { privateKey: string; scopes?: JWTScope[] | string[]; expiresIn?: StringValue; }) => (() => Promise); /** * Helper method for generating a bearer token for use with and without the SDK */ export declare const getToken: (options: { privateKey: string; expiresIn?: StringValue; scopes?: JWTScope[] | string[]; embedParams?: EmbedParams; checkoutSessionId?: string; }) => Promise; export declare const updateToken: (options: { token: string; privateKey: string; expiresIn?: StringValue; scopes?: JWTScope[] | string[]; embedParams?: EmbedParams; checkoutSessionId?: string; }) => Promise; /** * Helper method for generating a bearer token for use with Embed */ export declare const getEmbedToken: (options: { privateKey: string; embedParams?: EmbedParams; checkoutSessionId?: string; }) => Promise; /** * Helper method that creates a checkout session and returns an Embed token with * the new checkout session ID baked in. * * This is a convenience wrapper around `getEmbedToken` for the common Embed flow * where every transaction should be tied to a checkout session. It uses the * provided (already authenticated) SDK client to create the checkout session, * then signs an Embed token that pins the resulting `checkout_session_id`. */ export declare const getEmbedTokenWithCheckoutSession: (options: { client: Gr4vy; privateKey: string; embedParams?: EmbedParams; /** Optional checkout session body to seed cart items, metadata, and so on. */ checkoutSession?: CheckoutSessionCreate; /** Optional merchant account ID override. Defaults to the client's configured one. */ merchantAccountId?: string; }) => Promise; /** * Short hands for scopes. Strings can be used as well. */ export declare enum JWTScope { ReadAll = "*.read", WriteAll = "*.write", Embed = "embed", AntiFraudServiceDefinitionsRead = "anti-fraud-service-definitions.read", AntiFraudServiceDefinitionsWrite = "anti-fraud-service-definitions.write", AntiFraudServicesRead = "anti-fraud-services.read", AntiFraudServicesWrite = "anti-fraud-services.write", ApiKeyPairsRead = "api-key-pairs.read", ApiKeyPairsWrite = "api-key-pairs.write", ApiLogsRead = "api-logs.read", ApiLogsWrite = "api-logs.write", ApplePayCertificatesRead = "apple-pay-certificates.read", ApplePayCertificatesWrite = "apple-pay-certificates.write", AuditLogsRead = "audit-logs.read", AuditLogsWrite = "audit-logs.write", BinCheckerRead = "bin-checker.read", BinCheckerWrite = "bin-checker.write", BuyersRead = "buyers.read", BuyersWrite = "buyers.write", BuyersBillingDetailsRead = "buyers.billing-details.read", BuyersBillingDetailsWrite = "buyers.billing-details.write", CardSchemeDefinitionsRead = "card-scheme-definitions.read", CardSchemeDefinitionsWrite = "card-scheme-definitions.write", CheckoutSessionsRead = "checkout-sessions.read", CheckoutSessionsWrite = "checkout-sessions.write", ConnectionsRead = "connections.read", ConnectionsWrite = "connections.write", DigitalWalletsRead = "digital-wallets.read", DigitalWalletsWrite = "digital-wallets.write", FlowsRead = "flows.read", FlowsWrite = "flows.write", GiftCardServiceDefinitionsRead = "gift-card-service-definitions.read", GiftCardServiceDefinitionsWrite = "gift-card-service-definitions.write", GiftCardServicesRead = "gift-card-services.read", GiftCardServicesWrite = "gift-card-services.write", GiftCardsRead = "gift-cards.read", GiftCardsWrite = "gift-cards.write", MerchantAccountsRead = "merchant-accounts.read", MerchantAccountsWrite = "merchant-accounts.write", PaymentLinksRead = "payment-links.read", PaymentLinksWrite = "payment-links.write", PaymentMethodDefinitionsRead = "payment-method-definitions.read", PaymentMethodDefinitionsWrite = "payment-method-definitions.write", PaymentMethodsRead = "payment-methods.read", PaymentMethodsWrite = "payment-methods.write", PaymentOptionsRead = "payment-options.read", PaymentOptionsWrite = "payment-options.write", PaymentServiceDefinitionsRead = "payment-service-definitions.read", PaymentServiceDefinitionsWrite = "payment-service-definitions.write", PaymentServicesRead = "payment-services.read", PaymentServicesWrite = "payment-services.write", PayoutsRead = "payouts.read", PayoutsWrite = "payouts.write", ReportsRead = "reports.read", ReportsWrite = "reports.write", RolesRead = "roles.read", RolesWrite = "roles.write", ThreeDSScenariosRead = "three-ds-scenarios.read", ThreeDSScenariosWrite = "three-ds-scenarios.write", TransactionsRead = "transactions.read", TransactionsWrite = "transactions.write", UsersMeRead = "users.me.read", UsersMeWrite = "users.me.write", VaultForwardRead = "vault-forward.read", VaultForwardWrite = "vault-forward.write", VaultForwardAuthenticationsRead = "vault-forward-authentications.read", VaultForwardAuthenticationsWrite = "vault-forward-authentications.write", VaultForwardConfigsRead = "vault-forward-configs.read", VaultForwardConfigsWrite = "vault-forward-configs.write", VaultForwardDefinitionsRead = "vault-forward-definitions.read", VaultForwardDefinitionsWrite = "vault-forward-definitions.write", WebhookSubscriptionsRead = "webhook-subscriptions.read", WebhookSubscriptionsWrite = "webhook-subscriptions.write" } /** * Parameters that can be pinned using Embed */ export type EmbedParams = { amount: number; currency: string; buyerId?: string; buyerExternalIdentifier?: string; metadata?: Record; cartItems?: Array; merchantAccountId?: string; connectionOptions?: Record; }; //# sourceMappingURL=auth.d.ts.map