/** * SMI-1062: Stripe ID Validators * * Validation and sanitization functions for Stripe IDs. * Extracted from sanitization.ts for file size compliance. */ /** * Stripe ID prefixes for validation */ declare const STRIPE_ID_PREFIXES: { readonly customer: "cus_"; readonly subscription: "sub_"; readonly price: "price_"; readonly invoice: "in_"; readonly paymentIntent: "pi_"; readonly paymentMethod: "pm_"; readonly product: "prod_"; readonly checkout: "cs_"; readonly event: "evt_"; }; type StripeIdType = keyof typeof STRIPE_ID_PREFIXES; /** * Validate a Stripe ID format * * Stripe IDs follow the pattern: prefix_alphanumeric * - Prefix identifies the object type (cus_, sub_, price_, etc.) * - Suffix is alphanumeric, typically 14-24 characters * * @param id - The Stripe ID to validate * @param type - The expected ID type (customer, subscription, price, etc.) * @param maxLength - Maximum allowed input length (default: 100) * @returns true if valid, false otherwise * * @example * ```typescript * isValidStripeId('cus_OtLqEJvHu1Mvxm', 'customer') // true * isValidStripeId('sub_1234567890abcd', 'subscription') // true * isValidStripeId('invalid_id', 'customer') // false * ``` */ export declare function isValidStripeId(id: string, type: StripeIdType, maxLength?: number): boolean; /** * Sanitize a Stripe customer ID * * @param customerId - Raw customer ID * @param maxLength - Maximum allowed input length (default: 100) * @returns Sanitized customer ID or empty string if invalid * * @example * ```typescript * sanitizeStripeCustomerId('cus_OtLqEJvHu1Mvxm') * // Returns: 'cus_OtLqEJvHu1Mvxm' * * sanitizeStripeCustomerId('cus_