import { type Encodable } from "@automate.ax/codec"; import type { StripePublicValue } from "@automate.ax/integration-contracts/stripe"; import Stripe from "stripe"; import * as z from "zod"; import type { DefinedAction } from "../../automation/actions.js"; import type { ResolvedIntegrationAccount } from "../../automation/integrations.js"; type InputObject = Record; /** Camel-cased, codec-safe form of an official Stripe SDK type. */ export type StripeValue = StripePublicValue & Encodable; /** Camel-cased official Stripe input type accepted by an action. */ export type StripeInputValue = StripePublicValue & InputObject; /** Mutation input with an optional Stripe idempotency key. */ export type StripeMutationInput = StripeInputValue & { /** Prevents duplicate Stripe mutations when the same request is retried. */ idempotencyKey?: string; }; /** Portable public type for one Stripe-backed action definition. */ export type StripeDefinedAction = DefinedAction, z.ZodType>, "stripe">; /** * Keeps declaration emit on public Stripe SDK names instead of private resource * modules. * * @param action - Completed Stripe-backed action definition. * @returns The same action with a portable public type. */ export declare function stripeAction(action: StripeDefinedAction): StripeDefinedAction; /** * Creates the official Stripe client for a resolved integration account. * * @param account - Resolved Stripe integration account. * @returns Authenticated Stripe client. */ export declare function getStripeApi(account: ResolvedIntegrationAccount<"stripe">): Stripe; /** Runtime schema for a camel-cased official Stripe object or parameter type. */ export declare function stripeObjectSchema(): z.ZodType>; /** Shared concrete schemas and factories for Stripe action inputs. */ export declare const stripeActionSchemas: { empty: z.ZodObject<{ expand: z.ZodOptional>; }, z.core.$loose>; id: (key: string, prefix?: string) => z.ZodObject<{ [x: string]: z.ZodString | z.ZodOptional>; expand: z.ZodOptional>; }, z.core.$loose>; list: z.ZodObject<{ endingBefore: z.ZodOptional; expand: z.ZodOptional>; limit: z.ZodOptional; startingAfter: z.ZodOptional; }, z.core.$loose>; mutation: (shape?: z.ZodRawShape) => z.ZodObject<{ idempotencyKey: z.ZodOptional; }, z.core.$loose>; object: (shape?: z.ZodRawShape) => z.ZodObject<{ [x: string]: z.core.$ZodType>; }, z.core.$loose>; search: z.ZodObject<{ expand: z.ZodOptional>; limit: z.ZodOptional; page: z.ZodOptional; query: z.ZodString; }, z.core.$loose>; }; /** * Runtime schema for an already public, codec-safe Stripe object type. * * @param schema - Concrete provider parameter validation. */ export declare function stripeSchema(schema: z.ZodType): z.ZodType; /** * Runtime schema for camel-cased official Stripe action parameters. * * @param schema - Concrete provider parameter validation. */ export declare function stripeInputSchema(schema: z.ZodType): z.ZodType>; /** * Runtime schema for a Stripe mutation input with request idempotency. * * @param schema - Concrete provider parameter validation. */ export declare function stripeMutationSchema(schema: z.ZodType): z.ZodType>; /** * Converts public camelCase parameters to Stripe's provider-native keys. * * @param value - Public action parameters. * @returns Stripe provider parameters. */ export declare function toStripeParams(value: StripeInputValue | InputObject): T; /** * Converts an official Stripe response to stable public camelCase keys. * * @param value - Stripe provider response. * @returns Codec-safe public response. */ export declare function fromStripe(value: T): StripeValue; /** * Splits public mutation input into Stripe parameters and request options. * * @param input - Public mutation input. * @returns Stripe parameters and optional request options. */ export declare function stripeMutationArguments(input: StripeMutationInput): readonly [T, { idempotencyKey: string; } | undefined]; /** * Makes durable replay conditional on one stable Stripe idempotency key. * * @param input - Validated Stripe mutation input. * @param input.idempotencyKey - Optional provider idempotency key. */ export declare function stripeMutationReplaySafety(input: { idempotencyKey?: string; }): "safe" | "unsafe"; export {}; //# sourceMappingURL=lib.d.ts.map