UNPKG

autumn-js

Version:
9 lines (7 loc) 719 B
/** Fields that must come from identity, not frontend */ declare const DEFAULT_PROTECTED_BODY_FIELDS: readonly ["customerId", "customerData", "name", "email", "stripeId"]; declare const CUSTOMER_PROTECTED_BODY_FIELDS: readonly ["customerId", "customerData", "name", "email", "stripeId", "metadata"]; type ProtectedBodyField = (typeof DEFAULT_PROTECTED_BODY_FIELDS)[number] | (typeof CUSTOMER_PROTECTED_BODY_FIELDS)[number]; /** Strip protected fields from body to prevent spoofing */ declare const sanitizeBody: (body: unknown, protectedFields?: readonly ProtectedBodyField[]) => Record<string, unknown>; export { CUSTOMER_PROTECTED_BODY_FIELDS, DEFAULT_PROTECTED_BODY_FIELDS, type ProtectedBodyField, sanitizeBody };