@parsrun/types 0.1.29 → 0.1.31

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/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/common.ts","../src/auth.ts","../src/tenant.ts","../src/email.ts","../src/storage.ts","../src/queue.ts","../src/cache.ts","../src/payments.ts","../src/server.ts","../src/index.ts"],"names":["type"],"mappings":";;;;AAwBO,IAAM,IAAA,GAAO,KAAK,aAAa;AAG/B,IAAM,SAAA,GAAY,KAAK,iBAAiB;AAGxC,IAAM,KAAA,GAAQ,KAAK,cAAc;AAGjC,IAAM,GAAA,GAAM,KAAK,YAAY;AAG7B,IAAM,cAAA,GAAiB,KAAK,aAAa;AAGzC,IAAM,WAAA,GAAc,KAAK,oBAAoB;AAG7C,IAAM,cAAA,GAAiB,KAAK,qBAAqB;AAOjD,IAAM,MAAA,GAAS,KAAK,iDAAiD;AAGrE,IAAM,aAAA,GAAgB,KAAK,kCAAkC;AAO7D,IAAM,aAAa,IAAA,CAAK;AAAA,EAC7B,IAAA,EAAM,aAAA;AAAA,EACN,KAAA,EAAO,aAAA;AAAA,EACP,UAAA,EAAY,QAAA;AAAA,EACZ,iBAAA,EAAmB;AACrB,CAAC;AAGM,IAAM,iBAAiB,IAAA,CAAK;AAAA,EACjC,IAAA,EAAM,QAAA;AAAA,EACN,KAAA,EAAO,QAAA;AAAA,EACP,KAAA,EAAO,QAAA;AAAA,EACP,UAAA,EAAY,QAAA;AAAA,EACZ,OAAA,EAAS,SAAA;AAAA,EACT,OAAA,EAAS;AACX,CAAC;AAGM,IAAM,mBAAmB,IAAA,CAAK;AAAA,EACnC,SAAA,EAAW,QAAA;AAAA,EACX,KAAA,EAAO,aAAA;AAAA,EACP,YAAA,EAAc;AAChB,CAAC;AAGM,IAAM,uBAAuB,IAAA,CAAK;AAAA,EACvC,SAAA,EAAW,QAAA;AAAA,EACX,aAAA,EAAe,QAAA;AAAA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AAC,KAAK,CAAA,CAAE,OAAO,CAAA,CAAE,CAAA,CAAE,KAAK,IAAI,CAAA;AAC7E,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA;AAAA,EAAuB,MAAM,CAAA,CAAE,CAAA;AAAA,EACjD;AAEA,EAAA,OAAO,MAAA;AACT;AAoBO,SAAS,YAAA,CACd,QACA,IAAA,EAC4E;AAC5E,EAAA,MAAM,MAAA,GAAS,OAAO,IAAI,CAAA;AAE1B,EAAA,IAAI,MAAA,YAAkBA,KAAK,MAAA,EAAQ;AACjC,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,KAAA;AAAA,MACT,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,KAAM,CAAA,EAAG,MAAA,CAAO,CAAA,CAAE,IAAI,CAAC,CAAA,EAAA,EAAK,CAAA,CAAE,OAAO,CAAA,CAAE;AAAA,KAC7D;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,IAAA;AAAA,IACT,IAAA,EAAM;AAAA,GACR;AACF;AAgBO,SAAS,OAAA,CACd,QACA,IAAA,EACoB;AACpB,EAAA,MAAM,MAAA,GAAS,OAAO,IAAI,CAAA;AAC1B,EAAA,OAAO,EAAE,kBAAkBA,IAAAA,CAAK,MAAA,CAAA;AAClC;AAiBO,SAAS,aACd,MAAA,EACwB;AACxB,EAAA,MAAM,YAAoC,EAAC;AAE3C,EAAA,KAAA,MAAW,SAAS,MAAA,EAAQ;AAC1B,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,KAAA,CAAM,IAAI,CAAA,IAAK,MAAA;AACnC,IAAA,SAAA,CAAU,IAAI,IAAI,KAAA,CAAM,OAAA;AAAA,EAC1B;AAEA,EAAA,OAAO,SAAA;AACT","file":"index.js","sourcesContent":["/**\n * @module\n * Common validation schemas shared across all Pars packages.\n * Includes primitive validators, pagination, and response wrappers.\n *\n * @example\n * ```typescript\n * import { uuid, email, pagination, successResponse } from '@parsrun/types';\n *\n * // Validate a UUID\n * const id = uuid('550e8400-e29b-41d4-a716-446655440000');\n *\n * // Create paginated response schema\n * const usersResponse = paginatedResponse(user.array());\n * ```\n */\n\nimport { type } from \"arktype\";\n\n// ============================================================================\n// Primitive Schemas\n// ============================================================================\n\n/** UUID v4 string validation */\nexport const uuid = type(\"string.uuid\");\n\n/** ISO 8601 timestamp string */\nexport const timestamp = type(\"string.date.iso\");\n\n/** Email address validation */\nexport const email = type(\"string.email\");\n\n/** URL validation */\nexport const url = type(\"string.url\");\n\n/** Non-empty string */\nexport const nonEmptyString = type(\"string >= 1\");\n\n/** Positive integer */\nexport const positiveInt = type(\"number.integer > 0\");\n\n/** Non-negative integer */\nexport const nonNegativeInt = type(\"number.integer >= 0\");\n\n// ============================================================================\n// Status Schemas\n// ============================================================================\n\n/** Common entity status */\nexport const status = type(\"'active' | 'inactive' | 'suspended' | 'deleted'\");\n\n/** Session status */\nexport const sessionStatus = type(\"'active' | 'expired' | 'revoked'\");\n\n// ============================================================================\n// Pagination Schemas\n// ============================================================================\n\n/** Pagination request parameters */\nexport const pagination = type({\n page: \"number >= 1\",\n limit: \"number >= 1\",\n \"orderBy?\": \"string\",\n \"orderDirection?\": \"'asc' | 'desc'\",\n});\n\n/** Pagination metadata in responses */\nexport const paginationMeta = type({\n page: \"number\",\n limit: \"number\",\n total: \"number\",\n totalPages: \"number\",\n hasNext: \"boolean\",\n hasPrev: \"boolean\",\n});\n\n/** Cursor-based pagination */\nexport const cursorPagination = type({\n \"cursor?\": \"string\",\n limit: \"number >= 1\",\n \"direction?\": \"'forward' | 'backward'\",\n});\n\n/** Cursor pagination metadata */\nexport const cursorPaginationMeta = type({\n \"cursor?\": \"string\",\n \"nextCursor?\": \"string\",\n \"prevCursor?\": \"string\",\n hasMore: \"boolean\",\n limit: \"number\",\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/** Success response wrapper */\nexport const successResponse = <T>(dataSchema: T) =>\n type({\n success: \"'true'\",\n data: dataSchema as never,\n \"message?\": \"string\",\n });\n\n/** Error response */\nexport const errorResponse = type({\n success: \"'false'\",\n error: {\n code: \"string\",\n message: \"string\",\n \"details?\": \"unknown\",\n },\n \"message?\": \"string\",\n});\n\n/** Paginated response wrapper */\nexport const paginatedResponse = <T>(dataSchema: T) =>\n type({\n success: \"boolean\",\n data: dataSchema as never,\n pagination: paginationMeta,\n \"message?\": \"string\",\n });\n\n/** Cursor paginated response wrapper */\nexport const cursorPaginatedResponse = <T>(dataSchema: T) =>\n type({\n success: \"boolean\",\n data: dataSchema as never,\n pagination: cursorPaginationMeta,\n \"message?\": \"string\",\n });\n\n// ============================================================================\n// Error Schemas\n// ============================================================================\n\n/** Pars framework error */\nexport const parsError = type({\n message: \"string\",\n statusCode: \"number >= 100\",\n \"code?\": \"string\",\n \"details?\": \"unknown\",\n});\n\n/** Validation error details */\nexport const validationErrorDetail = type({\n path: \"string\",\n message: \"string\",\n \"expected?\": \"string\",\n \"received?\": \"unknown\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/** UUID v4 string type */\nexport type UUID = typeof uuid.infer;\n/** ISO 8601 timestamp string type */\nexport type Timestamp = typeof timestamp.infer;\n/** Valid email address string type */\nexport type Email = typeof email.infer;\n/** Valid URL string type */\nexport type Url = typeof url.infer;\n/** Non-empty string type (length >= 1) */\nexport type NonEmptyString = typeof nonEmptyString.infer;\n/** Positive integer type (> 0) */\nexport type PositiveInt = typeof positiveInt.infer;\n/** Non-negative integer type (>= 0) */\nexport type NonNegativeInt = typeof nonNegativeInt.infer;\n\n/** Entity status: 'active' | 'inactive' | 'suspended' | 'deleted' */\nexport type Status = typeof status.infer;\n/** Session status: 'active' | 'expired' | 'revoked' */\nexport type SessionStatus = typeof sessionStatus.infer;\n\n/** Pagination request parameters */\nexport type Pagination = typeof pagination.infer;\n/** Pagination metadata in responses */\nexport type PaginationMeta = typeof paginationMeta.infer;\n/** Cursor-based pagination request */\nexport type CursorPagination = typeof cursorPagination.infer;\n/** Cursor-based pagination metadata */\nexport type CursorPaginationMeta = typeof cursorPaginationMeta.infer;\n\n/** Standard error response structure */\nexport type ErrorResponse = typeof errorResponse.infer;\n/** Pars framework error structure */\nexport type ParsError = typeof parsError.infer;\n/** Validation error detail with path and message */\nexport type ValidationErrorDetail = typeof validationErrorDetail.infer;\n\n// ============================================================================\n// API Response Interfaces (for TypeScript convenience)\n// ============================================================================\n\n/** Generic API response wrapper */\nexport interface ApiResponse<T = unknown> {\n success: boolean;\n data?: T;\n message?: string;\n}\n\n/** API error response structure */\nexport interface ApiErrorResponse {\n success: false;\n error: {\n code: string;\n message: string;\n details?: unknown;\n };\n message?: string;\n}\n\n/** Paginated API response with offset-based pagination */\nexport interface ApiPaginatedResponse<T = unknown> {\n success: boolean;\n data: T[];\n pagination: PaginationMeta;\n message?: string;\n}\n\n/** Paginated API response with cursor-based pagination */\nexport interface ApiCursorPaginatedResponse<T = unknown> {\n success: boolean;\n data: T[];\n pagination: CursorPaginationMeta;\n message?: string;\n}\n","/**\n * @module\n * Authentication and authorization validation schemas.\n * Includes user, session, JWT, RBAC, and OAuth configuration types.\n *\n * @example\n * ```typescript\n * import { user, session, jwtPayload, type User } from '@parsrun/types';\n *\n * // Validate user data\n * const userData = user(input);\n *\n * // Type-safe user object\n * const currentUser: User = { id: '...', status: 'active', ... };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { status, sessionStatus, timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// User Schemas\n// ============================================================================\n\n/** User entity */\nexport const user = type({\n id: uuid,\n \"displayName?\": \"string\",\n twoFactorEnabled: \"boolean\",\n \"twoFactorSecret?\": \"string\",\n status,\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Auth method (email, phone, OAuth providers) */\nexport const authMethod = type({\n id: uuid,\n userId: uuid,\n provider: \"'email' | 'phone' | 'google' | 'github' | 'microsoft' | 'apple'\",\n providerId: \"string >= 1\",\n verified: \"boolean\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n// ============================================================================\n// Session Schemas\n// ============================================================================\n\n/** Session entity */\nexport const session = type({\n id: uuid,\n userId: uuid,\n \"authMethodId?\": uuid,\n \"currentTenantId?\": uuid,\n \"refreshTokenHash?\": \"string\",\n csrfTokenHash: \"string\",\n expiresAt: timestamp,\n \"refreshExpiresAt?\": timestamp,\n \"deviceType?\": \"'mobile' | 'desktop' | 'tablet' | 'api'\",\n \"deviceName?\": \"string\",\n \"userAgent?\": \"string\",\n \"ipAddress?\": \"string\",\n \"locationData?\": \"object\",\n \"deviceFingerprint?\": \"string\",\n status: sessionStatus,\n lastActivityAt: timestamp,\n \"revokedAt?\": timestamp,\n \"revokedReason?\":\n \"'user_logout' | 'admin_revoke' | 'security_breach' | 'suspicious_activity'\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n// ============================================================================\n// Tenant & Membership Schemas\n// ============================================================================\n\n/** Tenant membership */\nexport const tenantMembership = type({\n id: uuid,\n userId: uuid,\n tenantId: uuid,\n roleId: uuid,\n status: \"'active' | 'inactive' | 'invited' | 'suspended'\",\n permissions: \"object\",\n accessLevel: \"'full' | 'limited' | 'read_only'\",\n resourceRestrictions: \"object\",\n \"ipRestrictions?\": \"object\",\n \"timeRestrictions?\": \"object\",\n \"expiresAt?\": timestamp,\n \"invitedBy?\": uuid,\n \"invitedAt?\": timestamp,\n \"joinedAt?\": timestamp,\n \"lastLoginAt?\": timestamp,\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n// ============================================================================\n// OTP Schemas\n// ============================================================================\n\n/** Request OTP (email/phone) */\nexport const requestOTPRequest = type({\n \"email?\": \"string.email\",\n \"phone?\": \"string >= 10\",\n \"tenantId?\": uuid,\n});\n\n/** OTP request response */\nexport const requestOTPResponse = type({\n success: \"boolean\",\n message: \"string\",\n \"expiresAt?\": timestamp,\n \"requiresTenantSelection?\": \"boolean\",\n \"isNewUser?\": \"boolean\",\n \"defaultTenantId?\": uuid,\n \"defaultTenantName?\": \"string\",\n \"selectedTenantId?\": uuid,\n \"selectedTenantName?\": \"string\",\n \"tenants?\": type({\n id: uuid,\n name: \"string\",\n role: \"string\",\n }).array(),\n});\n\n/** Verify OTP */\nexport const verifyOTPRequest = type({\n \"email?\": \"string.email\",\n \"phone?\": \"string >= 10\",\n code: \"string >= 6\",\n \"tenantId?\": uuid,\n});\n\n/** Resend OTP */\nexport const resendOTPRequest = type({\n \"email?\": \"string.email\",\n \"phone?\": \"string >= 10\",\n});\n\n// ============================================================================\n// Login Response Schemas\n// ============================================================================\n\n/** Login response data */\nexport const loginResponseData = type({\n user,\n session: {\n accessToken: \"string\",\n expiresAt: timestamp,\n csrfToken: \"string\",\n },\n \"refreshToken?\": \"string\",\n authMethod: {\n id: uuid,\n provider: \"'email' | 'phone' | 'google' | 'github' | 'microsoft' | 'apple'\",\n providerId: \"string >= 1\",\n verified: \"boolean\",\n \"metadata?\": \"object\",\n },\n \"tenantMemberships?\": tenantMembership.array(),\n isNewUser: \"boolean\",\n});\n\n/** Login response */\nexport const loginResponse = type({\n success: \"boolean\",\n data: loginResponseData,\n \"message?\": \"string\",\n});\n\n// ============================================================================\n// Current User Schemas\n// ============================================================================\n\n/** Current user response data */\nexport const currentUserResponseData = type({\n user,\n \"authMethod?\": {\n id: uuid,\n provider: \"'email' | 'phone' | 'google' | 'github' | 'microsoft' | 'apple'\",\n providerId: \"string >= 1\",\n verified: \"boolean\",\n \"metadata?\": \"object\",\n },\n tenantMemberships: tenantMembership.array(),\n roles: type({\n id: uuid,\n name: \"string\",\n \"description?\": \"string\",\n }).array(),\n permissions: \"string[]\",\n currentTenant: uuid,\n});\n\n/** Current user response */\nexport const currentUserResponse = type({\n success: \"boolean\",\n data: currentUserResponseData,\n \"message?\": \"string\",\n});\n\n// ============================================================================\n// Token Schemas\n// ============================================================================\n\n/** Refresh token request */\nexport const refreshTokenRequest = type({\n refreshToken: \"string\",\n});\n\n/** Token info (for client storage) */\nexport const tokenInfo = type({\n accessToken: \"string\",\n \"refreshToken?\": \"string\",\n expiresAt: \"Date\",\n csrfToken: \"string\",\n \"tenantId?\": uuid,\n});\n\n/** JWT payload */\nexport const jwtPayload = type({\n sub: uuid,\n tenantId: uuid,\n \"sessionId?\": uuid,\n \"roles?\": \"string[]\",\n \"permissions?\": \"string[]\",\n iat: \"number\",\n exp: \"number\",\n \"aud?\": \"string\",\n \"iss?\": \"string\",\n});\n\n// ============================================================================\n// RBAC Schemas\n// ============================================================================\n\n/** Permission entity */\nexport const permission = type({\n id: uuid,\n name: \"string >= 1\",\n \"description?\": \"string\",\n resource: \"string >= 1\",\n action: \"'create' | 'read' | 'update' | 'delete' | 'list' | 'manage'\",\n scope: \"'tenant' | 'global' | 'own'\",\n isSystem: \"boolean\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Role entity */\nexport const role = type({\n id: uuid,\n tenantId: uuid,\n name: \"string >= 1\",\n \"description?\": \"string\",\n isSystem: \"boolean\",\n isActive: \"boolean\",\n \"color?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Permission check request */\nexport const permissionCheck = type({\n resource: \"string >= 1\",\n action: \"string >= 1\",\n \"scope?\": \"'tenant' | 'global' | 'own'\",\n \"resourceId?\": \"string\",\n});\n\n// ============================================================================\n// Session Management Schemas\n// ============================================================================\n\n/** Logout request */\nexport const logoutRequest = type({\n \"refreshToken?\": \"string\",\n allDevices: \"boolean\",\n});\n\n/** Revoke session request */\nexport const revokeSessionRequest = type({\n \"reason?\":\n \"'user_logout' | 'admin_revoke' | 'security_breach' | 'suspicious_activity'\",\n});\n\n/** Revoke all sessions request */\nexport const revokeAllSessionsRequest = type({\n \"reason?\":\n \"'user_logout' | 'admin_revoke' | 'security_breach' | 'suspicious_activity'\",\n \"excludeCurrent?\": \"boolean\",\n});\n\n/** Revoke all sessions response */\nexport const revokeAllSessionsResponse = type({\n success: \"boolean\",\n message: \"string\",\n revokedCount: \"number\",\n});\n\n// ============================================================================\n// Email Verification Schemas\n// ============================================================================\n\n/** Send verification email request */\nexport const sendVerificationEmailRequest = type({\n email: \"string.email\",\n});\n\n/** Verify email request */\nexport const verifyEmailRequest = type({\n token: \"string >= 1\",\n});\n\n/** Check verification status */\nexport const checkVerificationStatusRequest = type({\n email: \"string.email\",\n});\n\nexport const checkVerificationStatusResponse = type({\n success: \"boolean\",\n verified: \"boolean\",\n message: \"string\",\n \"sentAt?\": timestamp,\n \"expiresAt?\": timestamp,\n});\n\n// ============================================================================\n// CSRF Schemas\n// ============================================================================\n\n/** CSRF token validation */\nexport const csrfTokenRequest = type({\n csrfToken: \"string >= 1\",\n});\n\n// ============================================================================\n// Config Schemas (for @parsrun/auth)\n// ============================================================================\n\n/** Session config */\nexport const sessionConfig = type({\n \"accessTokenExpiry?\": \"number > 0\",\n \"refreshTokenExpiry?\": \"number > 0\",\n \"slidingWindow?\": \"boolean\",\n \"maxSessions?\": \"number > 0\",\n \"invalidateOnPasswordChange?\": \"boolean\",\n});\n\n/** JWT config */\nexport const jwtConfig = type({\n \"algorithm?\":\n \"'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512' | 'ES256' | 'ES384' | 'ES512'\",\n \"issuer?\": \"string\",\n \"audience?\": \"string | string[]\",\n});\n\n/** Cookie config */\nexport const cookieConfig = type({\n \"prefix?\": \"string\",\n \"domain?\": \"string\",\n \"path?\": \"string\",\n \"secure?\": \"boolean\",\n \"sameSite?\": \"'strict' | 'lax' | 'none'\",\n \"httpOnly?\": \"boolean\",\n});\n\n/** CSRF config */\nexport const csrfConfig = type({\n \"enabled?\": \"boolean\",\n \"headerName?\": \"string\",\n \"cookieName?\": \"string\",\n});\n\n/** Rate limit config */\nexport const rateLimitConfig = type({\n \"enabled?\": \"boolean\",\n \"loginAttempts?\": \"number > 0\",\n \"windowSize?\": \"number > 0\",\n});\n\n/** Lockout config */\nexport const lockoutConfig = type({\n \"enabled?\": \"boolean\",\n \"maxAttempts?\": \"number > 0\",\n \"duration?\": \"number > 0\",\n});\n\n/** Security config */\nexport const securityConfig = type({\n \"rateLimit?\": rateLimitConfig,\n \"lockout?\": lockoutConfig,\n \"csrf?\": csrfConfig,\n});\n\n/** Tenant config */\nexport const tenantConfig = type({\n \"enabled?\": \"boolean\",\n \"strategy?\": \"'subdomain' | 'header' | 'path' | 'query' | 'custom'\",\n \"headerName?\": \"string\",\n \"resolver?\": \"Function\",\n});\n\n/** OAuth provider config */\nexport const oauthProviderConfig = type({\n \"enabled?\": \"boolean\",\n clientId: \"string\",\n clientSecret: \"string\",\n \"scopes?\": \"string[]\",\n \"callbackUrl?\": \"string\",\n});\n\n/** OTP email config */\nexport const otpEmailConfig = type({\n \"enabled?\": \"boolean\",\n \"expiresIn?\": \"number > 0\",\n \"length?\": \"number >= 4\",\n \"maxAttempts?\": \"number > 0\",\n \"rateLimit?\": \"number > 0\",\n \"rateLimitWindow?\": \"number > 0\",\n send: \"Function\",\n});\n\n/** OTP SMS config */\nexport const otpSmsConfig = type({\n \"enabled?\": \"boolean\",\n \"expiresIn?\": \"number > 0\",\n \"length?\": \"number >= 4\",\n \"maxAttempts?\": \"number > 0\",\n \"rateLimit?\": \"number > 0\",\n \"rateLimitWindow?\": \"number > 0\",\n send: \"Function\",\n});\n\n/** OTP config */\nexport const otpConfig = type({\n \"enabled?\": \"boolean\",\n \"email?\": otpEmailConfig,\n \"sms?\": otpSmsConfig,\n});\n\n/** Magic link config */\nexport const magicLinkConfig = type({\n \"enabled?\": \"boolean\",\n \"expiresIn?\": \"number > 0\",\n send: \"Function\",\n});\n\n/** TOTP config */\nexport const totpConfig = type({\n \"enabled?\": \"boolean\",\n \"issuer?\": \"string\",\n \"backupCodesCount?\": \"number > 0\",\n});\n\n/** WebAuthn config */\nexport const webauthnConfig = type({\n \"enabled?\": \"boolean\",\n rpName: \"string\",\n rpId: \"string\",\n \"origins?\": \"string[]\",\n});\n\n/** Password config */\nexport const passwordConfig = type({\n \"enabled?\": \"boolean\",\n \"minLength?\": \"number >= 6\",\n \"requireUppercase?\": \"boolean\",\n \"requireLowercase?\": \"boolean\",\n \"requireNumbers?\": \"boolean\",\n \"requireSymbols?\": \"boolean\",\n \"checkCommonPasswords?\": \"boolean\",\n});\n\n/** OAuth providers config */\nexport const oauthProvidersConfig = type({\n \"google?\": oauthProviderConfig,\n \"github?\": oauthProviderConfig,\n \"microsoft?\": oauthProviderConfig,\n \"apple?\": oauthProviderConfig,\n \"custom?\": type(\"Record<string, unknown>\"),\n});\n\n/** Providers config */\nexport const providersConfig = type({\n \"otp?\": otpConfig,\n \"magicLink?\": magicLinkConfig,\n \"oauth?\": oauthProvidersConfig,\n \"totp?\": totpConfig,\n \"webauthn?\": webauthnConfig,\n \"password?\": passwordConfig,\n});\n\n/** Storage config */\nexport const storageConfig = type({\n \"type?\": \"'memory' | 'redis' | 'upstash' | 'cloudflare-kv' | 'deno-kv' | 'custom'\",\n \"redis?\": \"object\",\n \"upstash?\": \"object\",\n \"cloudflareKv?\": \"object\",\n \"denoKv?\": \"object\",\n \"custom?\": \"object\",\n});\n\n/** Main Pars auth config */\nexport const parsAuthConfig = type({\n secret: \"string >= 32\",\n \"baseUrl?\": \"string\",\n \"storage?\": storageConfig,\n \"providers?\": providersConfig,\n \"session?\": sessionConfig,\n \"jwt?\": jwtConfig,\n \"cookies?\": cookieConfig,\n \"security?\": securityConfig,\n \"tenant?\": tenantConfig,\n adapter: \"object\",\n \"callbacks?\": \"object\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n// Entity types\nexport type User = typeof user.infer;\nexport type AuthMethod = typeof authMethod.infer;\nexport type Session = typeof session.infer;\nexport type TenantMembership = typeof tenantMembership.infer;\n\n// OTP types\nexport type RequestOTPRequest = typeof requestOTPRequest.infer;\nexport type RequestOTPResponse = typeof requestOTPResponse.infer;\nexport type VerifyOTPRequest = typeof verifyOTPRequest.infer;\nexport type ResendOTPRequest = typeof resendOTPRequest.infer;\n\n// Login types\nexport type LoginResponseData = typeof loginResponseData.infer;\nexport type LoginResponse = typeof loginResponse.infer;\n\n// Current user types\nexport type CurrentUserResponseData = typeof currentUserResponseData.infer;\nexport type CurrentUserResponse = typeof currentUserResponse.infer;\n\n// Token types\nexport type RefreshTokenRequest = typeof refreshTokenRequest.infer;\nexport type TokenInfo = typeof tokenInfo.infer;\nexport type JwtPayload = typeof jwtPayload.infer;\n\n// RBAC types\nexport type Permission = typeof permission.infer;\nexport type Role = typeof role.infer;\nexport type PermissionCheck = typeof permissionCheck.infer;\n\n// Session management types\nexport type LogoutRequest = typeof logoutRequest.infer;\nexport type RevokeSessionRequest = typeof revokeSessionRequest.infer;\nexport type RevokeAllSessionsRequest = typeof revokeAllSessionsRequest.infer;\nexport type RevokeAllSessionsResponse = typeof revokeAllSessionsResponse.infer;\n\n// Email verification types\nexport type SendVerificationEmailRequest = typeof sendVerificationEmailRequest.infer;\nexport type VerifyEmailRequest = typeof verifyEmailRequest.infer;\nexport type CheckVerificationStatusRequest = typeof checkVerificationStatusRequest.infer;\nexport type CheckVerificationStatusResponse = typeof checkVerificationStatusResponse.infer;\n\n// CSRF types\nexport type CSRFTokenRequest = typeof csrfTokenRequest.infer;\n\n// Config types\nexport type SessionConfig = typeof sessionConfig.infer;\nexport type JwtConfig = typeof jwtConfig.infer;\nexport type CookieConfig = typeof cookieConfig.infer;\nexport type CsrfConfig = typeof csrfConfig.infer;\nexport type RateLimitConfig = typeof rateLimitConfig.infer;\nexport type LockoutConfig = typeof lockoutConfig.infer;\nexport type SecurityConfig = typeof securityConfig.infer;\nexport type TenantConfig = typeof tenantConfig.infer;\nexport type OAuthProviderConfig = typeof oauthProviderConfig.infer;\nexport type OtpEmailConfig = typeof otpEmailConfig.infer;\nexport type OtpSmsConfig = typeof otpSmsConfig.infer;\nexport type OtpConfig = typeof otpConfig.infer;\nexport type MagicLinkConfig = typeof magicLinkConfig.infer;\nexport type TotpConfig = typeof totpConfig.infer;\nexport type WebAuthnConfig = typeof webauthnConfig.infer;\nexport type PasswordConfig = typeof passwordConfig.infer;\nexport type OAuthProvidersConfig = typeof oauthProvidersConfig.infer;\nexport type ProvidersConfig = typeof providersConfig.infer;\nexport type StorageConfig = typeof storageConfig.infer;\nexport type ParsAuthConfig = typeof parsAuthConfig.infer;\n","/**\n * @module\n * Multi-tenant validation schemas for SaaS applications.\n * Includes tenant entity, membership, and invitation types.\n *\n * @example\n * ```typescript\n * import { tenant, createTenantRequest, type Tenant } from '@parsrun/types';\n *\n * // Validate tenant creation\n * const result = createTenantRequest({ name: 'Acme Corp' });\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { status, timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// Tenant Schemas\n// ============================================================================\n\n/** Tenant entity */\nexport const tenant = type({\n id: uuid,\n name: \"string >= 1\",\n \"slug?\": \"string\",\n \"description?\": \"string\",\n status,\n \"settings?\": \"object\",\n \"metadata?\": \"object\",\n \"logoUrl?\": \"string\",\n \"primaryColor?\": \"string\",\n \"timezone?\": \"string\",\n \"locale?\": \"string\",\n \"currency?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Tenant creation request */\nexport const createTenantRequest = type({\n name: \"string >= 1\",\n \"slug?\": \"string\",\n \"description?\": \"string\",\n \"settings?\": \"object\",\n \"logoUrl?\": \"string\",\n \"primaryColor?\": \"string\",\n \"timezone?\": \"string\",\n \"locale?\": \"string\",\n \"currency?\": \"string\",\n});\n\n/** Tenant update request */\nexport const updateTenantRequest = type({\n \"name?\": \"string >= 1\",\n \"slug?\": \"string\",\n \"description?\": \"string\",\n \"settings?\": \"object\",\n \"logoUrl?\": \"string\",\n \"primaryColor?\": \"string\",\n \"timezone?\": \"string\",\n \"locale?\": \"string\",\n \"currency?\": \"string\",\n \"status?\": status,\n});\n\n/** Tenant invite request */\nexport const inviteTenantMemberRequest = type({\n email: \"string.email\",\n roleId: uuid,\n \"accessLevel?\": \"'full' | 'limited' | 'read_only'\",\n \"expiresAt?\": timestamp,\n \"message?\": \"string\",\n});\n\n/** Tenant member list query */\nexport const tenantMemberListQuery = type({\n \"page?\": \"number >= 1\",\n \"limit?\": \"number >= 1\",\n \"status?\": \"'active' | 'inactive' | 'invited' | 'suspended'\",\n \"roleId?\": uuid,\n \"search?\": \"string\",\n});\n\n/** Tenant switch request */\nexport const switchTenantRequest = type({\n tenantId: uuid,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type Tenant = typeof tenant.infer;\nexport type CreateTenantRequest = typeof createTenantRequest.infer;\nexport type UpdateTenantRequest = typeof updateTenantRequest.infer;\nexport type InviteTenantMemberRequest = typeof inviteTenantMemberRequest.infer;\nexport type TenantMemberListQuery = typeof tenantMemberListQuery.infer;\nexport type SwitchTenantRequest = typeof switchTenantRequest.infer;\n","/**\n * @module\n * Email service validation schemas for sending emails.\n * Includes address, attachment, and provider configuration types.\n *\n * @example\n * ```typescript\n * import { sendEmailOptions, emailConfig, type SendEmailOptions } from '@parsrun/types';\n *\n * const options: SendEmailOptions = {\n * to: 'user@example.com',\n * subject: 'Welcome!',\n * html: '<h1>Hello</h1>'\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\n\n// ============================================================================\n// Email Address Schemas\n// ============================================================================\n\n/** Email address with optional name */\nexport const emailAddress = type({\n email: \"string.email\",\n \"name?\": \"string\",\n});\n\n/** Simple email string or address object */\nexport const emailRecipient = type(\"string.email | object\");\n\n// ============================================================================\n// Email Content Schemas\n// ============================================================================\n\n/** Email attachment */\nexport const emailAttachment = type({\n filename: \"string >= 1\",\n content: \"string | object\",\n \"contentType?\": \"string\",\n \"encoding?\": \"'base64' | 'utf-8' | 'binary'\",\n \"contentId?\": \"string\",\n \"disposition?\": \"'attachment' | 'inline'\",\n});\n\n/** Email options */\nexport const sendEmailOptions = type({\n to: \"string.email | string.email[] | object | object[]\",\n \"cc?\": \"string.email | string.email[] | object | object[]\",\n \"bcc?\": \"string.email | string.email[] | object | object[]\",\n \"from?\": \"string.email | object\",\n \"replyTo?\": \"string.email | object\",\n subject: \"string >= 1\",\n \"text?\": \"string\",\n \"html?\": \"string\",\n \"attachments?\": emailAttachment.array(),\n \"headers?\": \"object\",\n \"priority?\": \"'high' | 'normal' | 'low'\",\n \"tags?\": \"string[]\",\n \"metadata?\": \"object\",\n});\n\n/** Templated email options */\nexport const sendTemplateEmailOptions = type({\n to: \"string.email | string.email[] | object | object[]\",\n \"cc?\": \"string.email | string.email[] | object | object[]\",\n \"bcc?\": \"string.email | string.email[] | object | object[]\",\n \"from?\": \"string.email | object\",\n \"replyTo?\": \"string.email | object\",\n template: \"string >= 1\",\n \"data?\": \"object\",\n \"attachments?\": emailAttachment.array(),\n \"headers?\": \"object\",\n \"priority?\": \"'high' | 'normal' | 'low'\",\n \"tags?\": \"string[]\",\n \"metadata?\": \"object\",\n});\n\n/** Email send result */\nexport const emailSendResult = type({\n success: \"boolean\",\n messageId: \"string\",\n \"accepted?\": \"string[]\",\n \"rejected?\": \"string[]\",\n \"pending?\": \"string[]\",\n});\n\n// ============================================================================\n// Email Provider Config Schemas\n// ============================================================================\n\n/** SMTP config */\nexport const smtpConfig = type({\n host: \"string >= 1\",\n port: \"number > 0\",\n \"secure?\": \"boolean\",\n \"auth?\": {\n user: \"string\",\n pass: \"string\",\n },\n \"tls?\": \"object\",\n});\n\n/** Resend config */\nexport const resendConfig = type({\n apiKey: \"string >= 1\",\n \"domain?\": \"string\",\n});\n\n/** SendGrid config */\nexport const sendgridConfig = type({\n apiKey: \"string >= 1\",\n});\n\n/** AWS SES config */\nexport const sesConfig = type({\n region: \"string >= 1\",\n \"accessKeyId?\": \"string\",\n \"secretAccessKey?\": \"string\",\n \"endpoint?\": \"string\",\n});\n\n/** Postmark config */\nexport const postmarkConfig = type({\n serverToken: \"string >= 1\",\n});\n\n/** Email provider config */\nexport const emailConfig = type({\n provider: \"'smtp' | 'resend' | 'sendgrid' | 'ses' | 'postmark' | 'mailgun'\",\n \"from?\": \"string.email | object\",\n \"replyTo?\": \"string.email | object\",\n \"smtp?\": smtpConfig,\n \"resend?\": resendConfig,\n \"sendgrid?\": sendgridConfig,\n \"ses?\": sesConfig,\n \"postmark?\": postmarkConfig,\n \"templates?\": \"object\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type EmailAddress = typeof emailAddress.infer;\nexport type EmailRecipient = typeof emailRecipient.infer;\nexport type EmailAttachment = typeof emailAttachment.infer;\nexport type SendEmailOptions = typeof sendEmailOptions.infer;\nexport type SendTemplateEmailOptions = typeof sendTemplateEmailOptions.infer;\nexport type EmailSendResult = typeof emailSendResult.infer;\nexport type SmtpConfig = typeof smtpConfig.infer;\nexport type ResendConfig = typeof resendConfig.infer;\nexport type SendgridConfig = typeof sendgridConfig.infer;\nexport type SesConfig = typeof sesConfig.infer;\nexport type PostmarkConfig = typeof postmarkConfig.infer;\nexport type EmailConfig = typeof emailConfig.infer;\n","/**\n * @module\n * File storage validation schemas for upload and retrieval.\n * Supports local, S3, R2, and GCS providers.\n *\n * @example\n * ```typescript\n * import { uploadOptions, fileMetadata, type FileMetadata } from '@parsrun/types';\n *\n * const file: FileMetadata = {\n * id: '...',\n * filename: 'document.pdf',\n * mimeType: 'application/pdf',\n * size: 1024,\n * bucket: 'uploads'\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// File Schemas\n// ============================================================================\n\n/** File metadata */\nexport const fileMetadata = type({\n id: uuid,\n filename: \"string >= 1\",\n originalName: \"string >= 1\",\n mimeType: \"string\",\n size: \"number >= 0\",\n \"path?\": \"string\",\n \"url?\": \"string\",\n bucket: \"string\",\n \"etag?\": \"string\",\n \"metadata?\": \"object\",\n \"uploadedBy?\": uuid,\n \"tenantId?\": uuid,\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Upload options */\nexport const uploadOptions = type({\n \"path?\": \"string\",\n \"filename?\": \"string\",\n \"contentType?\": \"string\",\n \"metadata?\": \"object\",\n \"acl?\": \"'private' | 'public-read' | 'authenticated-read'\",\n \"cacheControl?\": \"string\",\n \"contentDisposition?\": \"string\",\n});\n\n/** Signed URL options */\nexport const signedUrlOptions = type({\n \"expiresIn?\": \"number > 0\",\n \"method?\": \"'GET' | 'PUT'\",\n \"contentType?\": \"string\",\n \"responseContentType?\": \"string\",\n \"responseContentDisposition?\": \"string\",\n});\n\n/** List files options */\nexport const listFilesOptions = type({\n \"prefix?\": \"string\",\n \"limit?\": \"number >= 1\",\n \"cursor?\": \"string\",\n \"delimiter?\": \"string\",\n});\n\n/** List files result */\nexport const listFilesResult = type({\n files: fileMetadata.array(),\n \"nextCursor?\": \"string\",\n hasMore: \"boolean\",\n});\n\n// ============================================================================\n// Storage Provider Config Schemas\n// ============================================================================\n\n/** Local storage config */\nexport const localStorageConfig = type({\n basePath: \"string >= 1\",\n \"baseUrl?\": \"string\",\n \"permissions?\": \"number\",\n});\n\n/** S3 storage config */\nexport const s3StorageConfig = type({\n bucket: \"string >= 1\",\n region: \"string >= 1\",\n \"endpoint?\": \"string\",\n \"accessKeyId?\": \"string\",\n \"secretAccessKey?\": \"string\",\n \"forcePathStyle?\": \"boolean\",\n \"acl?\": \"'private' | 'public-read' | 'authenticated-read'\",\n});\n\n/** Cloudflare R2 config */\nexport const r2StorageConfig = type({\n accountId: \"string >= 1\",\n bucket: \"string >= 1\",\n accessKeyId: \"string >= 1\",\n secretAccessKey: \"string >= 1\",\n \"publicUrl?\": \"string\",\n});\n\n/** GCS config */\nexport const gcsStorageConfig = type({\n bucket: \"string >= 1\",\n \"projectId?\": \"string\",\n \"credentials?\": \"object\",\n \"keyFilename?\": \"string\",\n});\n\n/** Storage config */\nexport const storageProviderConfig = type({\n provider: \"'local' | 's3' | 'r2' | 'gcs' | 'azure'\",\n \"defaultBucket?\": \"string\",\n \"local?\": localStorageConfig,\n \"s3?\": s3StorageConfig,\n \"r2?\": r2StorageConfig,\n \"gcs?\": gcsStorageConfig,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type FileMetadata = typeof fileMetadata.infer;\nexport type UploadOptions = typeof uploadOptions.infer;\nexport type SignedUrlOptions = typeof signedUrlOptions.infer;\nexport type ListFilesOptions = typeof listFilesOptions.infer;\nexport type ListFilesResult = typeof listFilesResult.infer;\nexport type LocalStorageConfig = typeof localStorageConfig.infer;\nexport type S3StorageConfig = typeof s3StorageConfig.infer;\nexport type R2StorageConfig = typeof r2StorageConfig.infer;\nexport type GcsStorageConfig = typeof gcsStorageConfig.infer;\nexport type StorageProviderConfig = typeof storageProviderConfig.infer;\n","/**\n * @module\n * Job queue validation schemas for background processing.\n * Supports BullMQ, SQS, RabbitMQ, and in-memory queues.\n *\n * @example\n * ```typescript\n * import { job, jobOptions, type Job, type JobOptions } from '@parsrun/types';\n *\n * const options: JobOptions = {\n * priority: 1,\n * attempts: 3,\n * backoff: { type: 'exponential', delay: 1000 }\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// Job Schemas\n// ============================================================================\n\n/** Job status */\nexport const jobStatus = type(\n \"'pending' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused'\"\n);\n\n/** Job entity */\nexport const job = type({\n id: uuid,\n queue: \"string >= 1\",\n name: \"string >= 1\",\n data: \"unknown\",\n \"result?\": \"unknown\",\n \"error?\": \"string\",\n status: jobStatus,\n attempts: \"number >= 0\",\n maxAttempts: \"number >= 1\",\n \"priority?\": \"number\",\n \"delay?\": \"number >= 0\",\n \"progress?\": \"number >= 0\",\n \"startedAt?\": timestamp,\n \"completedAt?\": timestamp,\n \"failedAt?\": timestamp,\n \"processedBy?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Job options */\nexport const jobOptions = type({\n \"priority?\": \"number\",\n \"delay?\": \"number >= 0\",\n \"attempts?\": \"number >= 1\",\n \"backoff?\": {\n type: \"'fixed' | 'exponential'\",\n \"delay?\": \"number >= 0\",\n },\n \"timeout?\": \"number > 0\",\n \"removeOnComplete?\": \"boolean | number\",\n \"removeOnFail?\": \"boolean | number\",\n \"repeat?\": {\n \"pattern?\": \"string\",\n \"every?\": \"number > 0\",\n \"limit?\": \"number >= 1\",\n \"tz?\": \"string\",\n },\n});\n\n/** Add job request */\nexport const addJobRequest = type({\n name: \"string >= 1\",\n data: \"unknown\",\n \"options?\": jobOptions,\n});\n\n/** Job progress update */\nexport const jobProgressUpdate = type({\n progress: \"number >= 0\",\n \"message?\": \"string\",\n \"data?\": \"unknown\",\n});\n\n// ============================================================================\n// Queue Stats Schemas\n// ============================================================================\n\n/** Queue stats */\nexport const queueStats = type({\n name: \"string\",\n pending: \"number >= 0\",\n active: \"number >= 0\",\n completed: \"number >= 0\",\n failed: \"number >= 0\",\n delayed: \"number >= 0\",\n paused: \"boolean\",\n});\n\n/** Queue list options */\nexport const queueListOptions = type({\n \"status?\": jobStatus,\n \"start?\": \"number >= 0\",\n \"end?\": \"number\",\n \"order?\": \"'asc' | 'desc'\",\n});\n\n// ============================================================================\n// Queue Config Schemas\n// ============================================================================\n\n/** Redis queue config */\nexport const redisQueueConfig = type({\n \"host?\": \"string\",\n \"port?\": \"number > 0\",\n \"password?\": \"string\",\n \"db?\": \"number >= 0\",\n \"url?\": \"string\",\n \"tls?\": \"boolean | object\",\n});\n\n/** Queue worker options */\nexport const workerOptions = type({\n \"concurrency?\": \"number >= 1\",\n \"limiter?\": {\n max: \"number >= 1\",\n duration: \"number > 0\",\n },\n \"lockDuration?\": \"number > 0\",\n \"lockRenewTime?\": \"number > 0\",\n \"stalledInterval?\": \"number > 0\",\n \"maxStalledCount?\": \"number >= 0\",\n});\n\n/** Queue config */\nexport const queueConfig = type({\n provider: \"'bullmq' | 'sqs' | 'rabbitmq' | 'memory'\",\n \"defaultJobOptions?\": jobOptions,\n \"redis?\": redisQueueConfig,\n \"prefix?\": \"string\",\n \"worker?\": workerOptions,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type JobStatus = typeof jobStatus.infer;\nexport type Job = typeof job.infer;\nexport type JobOptions = typeof jobOptions.infer;\nexport type AddJobRequest = typeof addJobRequest.infer;\nexport type JobProgressUpdate = typeof jobProgressUpdate.infer;\nexport type QueueStats = typeof queueStats.infer;\nexport type QueueListOptions = typeof queueListOptions.infer;\nexport type RedisQueueConfig = typeof redisQueueConfig.infer;\nexport type WorkerOptions = typeof workerOptions.infer;\nexport type QueueConfig = typeof queueConfig.infer;\n","/**\n * @module\n * Caching validation schemas for key-value storage.\n * Supports memory, Redis, Upstash, and Cloudflare KV.\n *\n * @example\n * ```typescript\n * import { cacheSetOptions, cacheConfig, type CacheConfig } from '@parsrun/types';\n *\n * const config: CacheConfig = {\n * provider: 'redis',\n * ttl: 3600,\n * redis: { host: 'localhost', port: 6379 }\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\n\n// ============================================================================\n// Cache Operation Schemas\n// ============================================================================\n\n/** Cache set options */\nexport const cacheSetOptions = type({\n \"ttl?\": \"number > 0\",\n \"tags?\": \"string[]\",\n \"metadata?\": \"object\",\n});\n\n/** Cache get result */\nexport const cacheGetResult = type({\n value: \"unknown\",\n \"ttl?\": \"number\",\n \"createdAt?\": \"number\",\n \"tags?\": \"string[]\",\n});\n\n/** Cache stats */\nexport const cacheStats = type({\n hits: \"number >= 0\",\n misses: \"number >= 0\",\n keys: \"number >= 0\",\n \"memory?\": \"number >= 0\",\n});\n\n// ============================================================================\n// Cache Config Schemas\n// ============================================================================\n\n/** Memory cache config */\nexport const memoryCacheConfig = type({\n \"maxSize?\": \"number > 0\",\n \"ttl?\": \"number > 0\",\n \"checkInterval?\": \"number > 0\",\n \"stale?\": \"boolean\",\n});\n\n/** Redis cache config */\nexport const redisCacheConfig = type({\n \"host?\": \"string\",\n \"port?\": \"number > 0\",\n \"password?\": \"string\",\n \"db?\": \"number >= 0\",\n \"url?\": \"string\",\n \"tls?\": \"boolean | object\",\n \"keyPrefix?\": \"string\",\n \"ttl?\": \"number > 0\",\n});\n\n/** Upstash cache config */\nexport const upstashCacheConfig = type({\n url: \"string >= 1\",\n token: \"string >= 1\",\n \"keyPrefix?\": \"string\",\n \"ttl?\": \"number > 0\",\n});\n\n/** Cloudflare KV config */\nexport const cloudflareKvConfig = type({\n namespaceId: \"string >= 1\",\n \"accountId?\": \"string\",\n \"apiToken?\": \"string\",\n \"keyPrefix?\": \"string\",\n});\n\n/** Multi-tier cache config */\nexport const multiTierCacheConfig = type({\n tiers: type({\n type: \"'memory' | 'redis' | 'upstash' | 'cloudflare-kv'\",\n \"priority?\": \"number\",\n \"ttl?\": \"number > 0\",\n \"config?\": \"object\",\n }).array(),\n \"writeThrough?\": \"boolean\",\n \"readThrough?\": \"boolean\",\n});\n\n/** Cache config */\nexport const cacheConfig = type({\n provider: \"'memory' | 'redis' | 'upstash' | 'cloudflare-kv' | 'multi-tier'\",\n \"ttl?\": \"number > 0\",\n \"keyPrefix?\": \"string\",\n \"memory?\": memoryCacheConfig,\n \"redis?\": redisCacheConfig,\n \"upstash?\": upstashCacheConfig,\n \"cloudflareKv?\": cloudflareKvConfig,\n \"multiTier?\": multiTierCacheConfig,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type CacheSetOptions = typeof cacheSetOptions.infer;\nexport type CacheGetResult = typeof cacheGetResult.infer;\nexport type CacheStats = typeof cacheStats.infer;\nexport type MemoryCacheConfig = typeof memoryCacheConfig.infer;\nexport type RedisCacheConfig = typeof redisCacheConfig.infer;\nexport type UpstashCacheConfig = typeof upstashCacheConfig.infer;\nexport type CloudflareKvConfig = typeof cloudflareKvConfig.infer;\nexport type MultiTierCacheConfig = typeof multiTierCacheConfig.infer;\nexport type CacheConfig = typeof cacheConfig.infer;\n","/**\n * @module\n * Payment provider validation schemas for subscriptions and transactions.\n * Supports Stripe, Paddle, and iyzico providers.\n *\n * @example\n * ```typescript\n * import { subscription, paymentIntent, type Subscription } from '@parsrun/types';\n *\n * const sub: Subscription = {\n * id: '...',\n * customerId: '...',\n * priceId: '...',\n * status: 'active',\n * currentPeriodStart: '2024-01-01T00:00:00Z',\n * currentPeriodEnd: '2024-02-01T00:00:00Z'\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// Currency & Amount Schemas\n// ============================================================================\n\n/** Currency code (ISO 4217) */\nexport const currencyCode = type(\"string >= 3\");\n\n/** Money amount with currency */\nexport const money = type({\n amount: \"number\",\n currency: currencyCode,\n});\n\n// ============================================================================\n// Customer Schemas\n// ============================================================================\n\n/** Payment customer */\nexport const paymentCustomer = type({\n id: uuid,\n \"externalId?\": \"string\",\n email: \"string.email\",\n \"name?\": \"string\",\n \"phone?\": \"string\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create customer request */\nexport const createCustomerRequest = type({\n email: \"string.email\",\n \"name?\": \"string\",\n \"phone?\": \"string\",\n \"metadata?\": \"object\",\n});\n\n// ============================================================================\n// Payment Method Schemas\n// ============================================================================\n\n/** Card details */\nexport const cardDetails = type({\n brand: \"string\",\n last4: \"string\",\n expMonth: \"number >= 1\",\n expYear: \"number >= 2000\",\n \"fingerprint?\": \"string\",\n});\n\n/** Payment method */\nexport const paymentMethod = type({\n id: uuid,\n \"externalId?\": \"string\",\n customerId: uuid,\n type: \"'card' | 'bank_account' | 'paypal' | 'crypto' | 'other'\",\n \"card?\": cardDetails,\n isDefault: \"boolean\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n// ============================================================================\n// Payment Intent Schemas\n// ============================================================================\n\n/** Payment intent status */\nexport const paymentIntentStatus = type(\n \"'created' | 'processing' | 'requires_action' | 'succeeded' | 'failed' | 'canceled'\"\n);\n\n/** Payment intent */\nexport const paymentIntent = type({\n id: uuid,\n \"externalId?\": \"string\",\n customerId: uuid,\n \"paymentMethodId?\": uuid,\n amount: \"number > 0\",\n currency: currencyCode,\n status: paymentIntentStatus,\n \"description?\": \"string\",\n \"metadata?\": \"object\",\n \"clientSecret?\": \"string\",\n \"failureReason?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create payment intent request */\nexport const createPaymentIntentRequest = type({\n customerId: uuid,\n amount: \"number > 0\",\n currency: currencyCode,\n \"paymentMethodId?\": uuid,\n \"description?\": \"string\",\n \"metadata?\": \"object\",\n \"confirm?\": \"boolean\",\n \"returnUrl?\": \"string\",\n});\n\n// ============================================================================\n// Subscription Schemas\n// ============================================================================\n\n/** Subscription status */\nexport const subscriptionStatus = type(\n \"'active' | 'past_due' | 'canceled' | 'incomplete' | 'incomplete_expired' | 'trialing' | 'paused'\"\n);\n\n/** Price interval */\nexport const priceInterval = type(\"'day' | 'week' | 'month' | 'year'\");\n\n/** Price */\nexport const price = type({\n id: uuid,\n \"externalId?\": \"string\",\n productId: uuid,\n amount: \"number >= 0\",\n currency: currencyCode,\n interval: priceInterval,\n \"intervalCount?\": \"number >= 1\",\n \"trialDays?\": \"number >= 0\",\n isActive: \"boolean\",\n \"metadata?\": \"object\",\n});\n\n/** Subscription */\nexport const subscription = type({\n id: uuid,\n \"externalId?\": \"string\",\n customerId: uuid,\n priceId: uuid,\n status: subscriptionStatus,\n currentPeriodStart: timestamp,\n currentPeriodEnd: timestamp,\n \"cancelAt?\": timestamp,\n \"canceledAt?\": timestamp,\n \"trialStart?\": timestamp,\n \"trialEnd?\": timestamp,\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create subscription request */\nexport const createSubscriptionRequest = type({\n customerId: uuid,\n priceId: uuid,\n \"paymentMethodId?\": uuid,\n \"trialDays?\": \"number >= 0\",\n \"metadata?\": \"object\",\n});\n\n// ============================================================================\n// Refund Schemas\n// ============================================================================\n\n/** Refund status */\nexport const refundStatus = type(\"'pending' | 'succeeded' | 'failed' | 'canceled'\");\n\n/** Refund */\nexport const refund = type({\n id: uuid,\n \"externalId?\": \"string\",\n paymentIntentId: uuid,\n amount: \"number > 0\",\n currency: currencyCode,\n status: refundStatus,\n \"reason?\": \"string\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create refund request */\nexport const createRefundRequest = type({\n paymentIntentId: uuid,\n \"amount?\": \"number > 0\",\n \"reason?\": \"string\",\n \"metadata?\": \"object\",\n});\n\n// ============================================================================\n// Webhook Schemas\n// ============================================================================\n\n/** Webhook event types */\nexport const webhookEventType = type(\n \"'payment.succeeded' | 'payment.failed' | 'subscription.created' | 'subscription.updated' | 'subscription.canceled' | 'refund.created' | 'customer.created' | 'customer.updated'\"\n);\n\n/** Webhook event */\nexport const webhookEvent = type({\n id: uuid,\n type: webhookEventType,\n data: \"object\",\n \"livemode?\": \"boolean\",\n \"apiVersion?\": \"string\",\n createdAt: timestamp,\n});\n\n// ============================================================================\n// Provider Config Schemas\n// ============================================================================\n\n/** Stripe config */\nexport const stripeConfig = type({\n secretKey: \"string >= 1\",\n \"publishableKey?\": \"string\",\n \"webhookSecret?\": \"string\",\n \"apiVersion?\": \"string\",\n});\n\n/** Paddle config */\nexport const paddleConfig = type({\n vendorId: \"string >= 1\",\n vendorAuthCode: \"string >= 1\",\n \"publicKey?\": \"string\",\n \"webhookSecret?\": \"string\",\n \"sandbox?\": \"boolean\",\n});\n\n/** iyzico config */\nexport const iyzicoConfig = type({\n apiKey: \"string >= 1\",\n secretKey: \"string >= 1\",\n baseUrl: \"string >= 1\",\n \"sandbox?\": \"boolean\",\n});\n\n/** Payments config */\nexport const paymentsConfig = type({\n provider: \"'stripe' | 'paddle' | 'iyzico'\",\n \"currency?\": currencyCode,\n \"stripe?\": stripeConfig,\n \"paddle?\": paddleConfig,\n \"iyzico?\": iyzicoConfig,\n \"webhookPath?\": \"string\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type CurrencyCode = typeof currencyCode.infer;\nexport type Money = typeof money.infer;\nexport type PaymentCustomer = typeof paymentCustomer.infer;\nexport type CreateCustomerRequest = typeof createCustomerRequest.infer;\nexport type CardDetails = typeof cardDetails.infer;\nexport type PaymentMethod = typeof paymentMethod.infer;\nexport type PaymentIntentStatus = typeof paymentIntentStatus.infer;\nexport type PaymentIntent = typeof paymentIntent.infer;\nexport type CreatePaymentIntentRequest = typeof createPaymentIntentRequest.infer;\nexport type SubscriptionStatus = typeof subscriptionStatus.infer;\nexport type PriceInterval = typeof priceInterval.infer;\nexport type Price = typeof price.infer;\nexport type Subscription = typeof subscription.infer;\nexport type CreateSubscriptionRequest = typeof createSubscriptionRequest.infer;\nexport type RefundStatus = typeof refundStatus.infer;\nexport type Refund = typeof refund.infer;\nexport type CreateRefundRequest = typeof createRefundRequest.infer;\nexport type WebhookEventType = typeof webhookEventType.infer;\nexport type WebhookEvent = typeof webhookEvent.infer;\nexport type StripeConfig = typeof stripeConfig.infer;\nexport type PaddleConfig = typeof paddleConfig.infer;\nexport type IyzicoConfig = typeof iyzicoConfig.infer;\nexport type PaymentsConfig = typeof paymentsConfig.infer;\n","/**\n * @module\n * HTTP server validation schemas for request/response handling.\n * Includes pagination, CORS, rate limiting, and middleware context types.\n *\n * @example\n * ```typescript\n * import { serverConfig, healthResponse, type ServerConfig } from '@parsrun/types';\n *\n * const config: ServerConfig = {\n * port: 3000,\n * cors: { origin: '*', credentials: true },\n * rateLimit: { windowMs: 60000, max: 100 }\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { uuid } from \"./common\";\n\n// ============================================================================\n// Request Validation Schemas\n// ============================================================================\n\n/** UUID path parameter */\nexport const uuidParam = type({\n id: uuid,\n});\n\n/** Standard pagination query */\nexport const paginationQuery = type({\n \"page?\": \"string\",\n \"limit?\": \"string\",\n \"orderBy?\": \"string\",\n \"orderDirection?\": \"'asc' | 'desc'\",\n});\n\n/** Cursor pagination query */\nexport const cursorPaginationQuery = type({\n \"cursor?\": \"string\",\n \"limit?\": \"string\",\n \"direction?\": \"'forward' | 'backward'\",\n});\n\n/** Search query */\nexport const searchQuery = type({\n \"q?\": \"string\",\n \"search?\": \"string\",\n \"filter?\": \"string\",\n});\n\n/** Date range query */\nexport const dateRangeQuery = type({\n \"startDate?\": \"string.date.iso\",\n \"endDate?\": \"string.date.iso\",\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/** Health check response */\nexport const healthResponse = type({\n status: \"'healthy' | 'degraded' | 'unhealthy'\",\n timestamp: \"string\",\n \"version?\": \"string\",\n \"uptime?\": \"number\",\n checks: type({\n name: \"string\",\n status: \"'healthy' | 'degraded' | 'unhealthy'\",\n \"message?\": \"string\",\n \"latency?\": \"number\",\n }).array(),\n});\n\n/** API info response */\nexport const apiInfoResponse = type({\n name: \"string\",\n version: \"string\",\n \"description?\": \"string\",\n \"environment?\": \"string\",\n \"documentation?\": \"string\",\n});\n\n// ============================================================================\n// Server Config Schemas\n// ============================================================================\n\n/** CORS config */\nexport const corsConfig = type({\n \"origin?\": \"string | string[] | boolean | Function\",\n \"methods?\": \"string[]\",\n \"allowedHeaders?\": \"string[]\",\n \"exposedHeaders?\": \"string[]\",\n \"credentials?\": \"boolean\",\n \"maxAge?\": \"number\",\n});\n\n/** Server rate limit config */\nexport const serverRateLimitConfig = type({\n \"enabled?\": \"boolean\",\n \"windowMs?\": \"number > 0\",\n \"max?\": \"number > 0\",\n \"keyGenerator?\": \"Function\",\n \"skip?\": \"Function\",\n \"message?\": \"string\",\n});\n\n/** Logger config */\nexport const loggerConfig = type({\n \"level?\": \"'debug' | 'info' | 'warn' | 'error'\",\n \"format?\": \"'json' | 'pretty' | 'combined' | 'short'\",\n \"redact?\": \"string[]\",\n \"timestamp?\": \"boolean\",\n});\n\n/** Server config */\nexport const serverConfig = type({\n \"port?\": \"number > 0\",\n \"host?\": \"string\",\n \"basePath?\": \"string\",\n \"cors?\": corsConfig,\n \"rateLimit?\": serverRateLimitConfig,\n \"logger?\": loggerConfig,\n \"trustProxy?\": \"boolean\",\n \"strictRouting?\": \"boolean\",\n \"caseSensitiveRouting?\": \"boolean\",\n});\n\n// ============================================================================\n// Middleware Context Schemas\n// ============================================================================\n\n/** Auth context (after auth middleware) */\nexport const authContext = type({\n userId: uuid,\n \"tenantId?\": uuid,\n \"sessionId?\": uuid,\n \"roles?\": \"string[]\",\n \"permissions?\": \"string[]\",\n});\n\n/** Request context */\nexport const requestContext = type({\n requestId: \"string\",\n \"startTime?\": \"number\",\n \"ip?\": \"string\",\n \"userAgent?\": \"string\",\n \"auth?\": authContext,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\nexport type UuidParam = typeof uuidParam.infer;\nexport type PaginationQuery = typeof paginationQuery.infer;\nexport type CursorPaginationQuery = typeof cursorPaginationQuery.infer;\nexport type SearchQuery = typeof searchQuery.infer;\nexport type DateRangeQuery = typeof dateRangeQuery.infer;\nexport type HealthResponse = typeof healthResponse.infer;\nexport type ApiInfoResponse = typeof apiInfoResponse.infer;\nexport type CorsConfig = typeof corsConfig.infer;\nexport type ServerRateLimitConfig = typeof serverRateLimitConfig.infer;\nexport type LoggerConfig = typeof loggerConfig.infer;\nexport type ServerConfig = typeof serverConfig.infer;\nexport type AuthContext = typeof authContext.infer;\nexport type RequestContext = typeof requestContext.infer;\n","/**\n * @module\n * Core types and validation schemas for the Pars framework.\n * Uses ArkType for runtime validation with automatic TypeScript type inference.\n *\n * @example\n * ```typescript\n * import { user, validateWithSchema, safeValidate, type User } from '@parsrun/types';\n *\n * // Runtime validation (throws on error)\n * const userData = validateWithSchema(user, input);\n *\n * // Safe validation (returns result object)\n * const result = safeValidate(user, input);\n * if (result.success) {\n * console.log(result.data);\n * } else {\n * console.error(result.errors);\n * }\n *\n * // Type guard\n * if (isValid(user, input)) {\n * // input is typed as User\n * }\n * ```\n */\n\n// Re-export ArkType for convenience\nexport { type } from \"arktype\";\nexport type { Type } from \"arktype\";\n\n// ============================================================================\n// Common Schemas & Types\n// ============================================================================\nexport * from \"./common\";\n\n// ============================================================================\n// Auth Schemas & Types\n// ============================================================================\nexport * from \"./auth\";\n\n// ============================================================================\n// Tenant Schemas & Types\n// ============================================================================\nexport * from \"./tenant\";\n\n// ============================================================================\n// Email Schemas & Types\n// ============================================================================\nexport * from \"./email\";\n\n// ============================================================================\n// Storage Schemas & Types\n// ============================================================================\nexport * from \"./storage\";\n\n// ============================================================================\n// Queue Schemas & Types\n// ============================================================================\nexport * from \"./queue\";\n\n// ============================================================================\n// Cache Schemas & Types\n// ============================================================================\nexport * from \"./cache\";\n\n// ============================================================================\n// Payments Schemas & Types\n// ============================================================================\nexport * from \"./payments\";\n\n// ============================================================================\n// Server Schemas & Types\n// ============================================================================\nexport * from \"./server\";\n\n// ============================================================================\n// Validation Helpers\n// ============================================================================\n\nimport { type, type Type } from \"arktype\";\n\n/**\n * Validate data against an ArkType schema.\n * Returns the validated data or throws an error.\n *\n * @param schema - The ArkType schema to validate against\n * @param data - The data to validate\n * @returns The validated and typed data\n * @throws Error if validation fails\n *\n * @example\n * ```typescript\n * const userData = validateWithSchema(user, input);\n * ```\n */\nexport function validateWithSchema<T extends Type>(\n schema: T,\n data: unknown\n): T[\"infer\"] {\n const result = schema(data);\n\n if (result instanceof type.errors) {\n const errors = result.map((e) => `${String(e.path)}: ${e.message}`).join(\"\\n\");\n throw new Error(`Validation failed:\\n${errors}`);\n }\n\n return result;\n}\n\n/**\n * Safely validate data against an ArkType schema.\n * Returns a result object instead of throwing.\n *\n * @param schema - The ArkType schema to validate against\n * @param data - The data to validate\n * @returns Object with success status and either data or errors\n *\n * @example\n * ```typescript\n * const result = safeValidate(user, input);\n * if (result.success) {\n * console.log(result.data);\n * } else {\n * console.error(result.errors);\n * }\n * ```\n */\nexport function safeValidate<T extends Type>(\n schema: T,\n data: unknown\n): { success: true; data: T[\"infer\"] } | { success: false; errors: string[] } {\n const result = schema(data);\n\n if (result instanceof type.errors) {\n return {\n success: false,\n errors: result.map((e) => `${String(e.path)}: ${e.message}`),\n };\n }\n\n return {\n success: true,\n data: result,\n };\n}\n\n/**\n * Check if data matches an ArkType schema (type guard).\n *\n * @param schema - The ArkType schema to validate against\n * @param data - The data to check\n * @returns True if data matches schema, with TypeScript type narrowing\n *\n * @example\n * ```typescript\n * if (isValid(user, input)) {\n * // input is typed as User\n * }\n * ```\n */\nexport function isValid<T extends Type>(\n schema: T,\n data: unknown\n): data is T[\"infer\"] {\n const result = schema(data);\n return !(result instanceof type.errors);\n}\n\n/**\n * Format ArkType errors to a user-friendly object.\n *\n * @param errors - The ArkType errors to format\n * @returns Object mapping field paths to error messages\n *\n * @example\n * ```typescript\n * const result = user(input);\n * if (result instanceof type.errors) {\n * const formatted = formatErrors(result);\n * // { email: \"must be a valid email\", ... }\n * }\n * ```\n */\nexport function formatErrors(\n errors: type.errors\n): Record<string, string> {\n const formatted: Record<string, string> = {};\n\n for (const error of errors) {\n const path = String(error.path) || \"root\";\n formatted[path] = error.message;\n }\n\n return formatted;\n}\n"]}
1
+ {"version":3,"sources":["../src/common.ts","../src/auth.ts","../src/tenant.ts","../src/email.ts","../src/storage.ts","../src/queue.ts","../src/cache.ts","../src/payments.ts","../src/server.ts","../src/index.ts"],"names":["type"],"mappings":";;;;AAwBO,IAAM,IAAA,GAAO,KAAK,aAAa;AAG/B,IAAM,SAAA,GAAY,KAAK,iBAAiB;AAGxC,IAAM,KAAA,GAAQ,KAAK,cAAc;AAGjC,IAAM,GAAA,GAAM,KAAK,YAAY;AAG7B,IAAM,cAAA,GAAiB,KAAK,aAAa;AAGzC,IAAM,WAAA,GAAc,KAAK,oBAAoB;AAG7C,IAAM,cAAA,GAAiB,KAAK,qBAAqB;AAOjD,IAAM,MAAA,GAAS,KAAK,iDAAiD;AAGrE,IAAM,aAAA,GAAgB,KAAK,kCAAkC;AAO7D,IAAM,aAAa,IAAA,CAAK;AAAA,EAC7B,IAAA,EAAM,aAAA;AAAA,EACN,KAAA,EAAO,aAAA;AAAA,EACP,UAAA,EAAY,QAAA;AAAA,EAC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AE,kBAAkBA,IAAAA,CAAK,MAAA,CAAA;AAClC;AAiBO,SAAS,aACd,MAAA,EACwB;AACxB,EAAA,MAAM,YAAoC,EAAC;AAE3C,EAAA,KAAA,MAAW,SAAS,MAAA,EAAQ;AAC1B,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,KAAA,CAAM,IAAI,CAAA,IAAK,MAAA;AACnC,IAAA,SAAA,CAAU,IAAI,IAAI,KAAA,CAAM,OAAA;AAAA,EAC1B;AAEA,EAAA,OAAO,SAAA;AACT","file":"index.js","sourcesContent":["/**\n * @module\n * Common validation schemas shared across all Pars packages.\n * Includes primitive validators, pagination, and response wrappers.\n *\n * @example\n * ```typescript\n * import { uuid, email, pagination, successResponse } from '@parsrun/types';\n *\n * // Validate a UUID\n * const id = uuid('550e8400-e29b-41d4-a716-446655440000');\n *\n * // Create paginated response schema\n * const usersResponse = paginatedResponse(user.array());\n * ```\n */\n\nimport { type } from \"arktype\";\n\n// ============================================================================\n// Primitive Schemas\n// ============================================================================\n\n/** UUID v4 string validation */\nexport const uuid = type(\"string.uuid\");\n\n/** ISO 8601 timestamp string */\nexport const timestamp = type(\"string.date.iso\");\n\n/** Email address validation */\nexport const email = type(\"string.email\");\n\n/** URL validation */\nexport const url = type(\"string.url\");\n\n/** Non-empty string */\nexport const nonEmptyString = type(\"string >= 1\");\n\n/** Positive integer */\nexport const positiveInt = type(\"number.integer > 0\");\n\n/** Non-negative integer */\nexport const nonNegativeInt = type(\"number.integer >= 0\");\n\n// ============================================================================\n// Status Schemas\n// ============================================================================\n\n/** Common entity status */\nexport const status = type(\"'active' | 'inactive' | 'suspended' | 'deleted'\");\n\n/** Session status */\nexport const sessionStatus = type(\"'active' | 'expired' | 'revoked'\");\n\n// ============================================================================\n// Pagination Schemas\n// ============================================================================\n\n/** Pagination request parameters */\nexport const pagination = type({\n page: \"number >= 1\",\n limit: \"number >= 1\",\n \"orderBy?\": \"string\",\n \"orderDirection?\": \"'asc' | 'desc'\",\n});\n\n/** Pagination metadata in responses */\nexport const paginationMeta = type({\n page: \"number\",\n limit: \"number\",\n total: \"number\",\n totalPages: \"number\",\n hasNext: \"boolean\",\n hasPrev: \"boolean\",\n});\n\n/** Cursor-based pagination */\nexport const cursorPagination = type({\n \"cursor?\": \"string\",\n limit: \"number >= 1\",\n \"direction?\": \"'forward' | 'backward'\",\n});\n\n/** Cursor pagination metadata */\nexport const cursorPaginationMeta = type({\n \"cursor?\": \"string\",\n \"nextCursor?\": \"string\",\n \"prevCursor?\": \"string\",\n hasMore: \"boolean\",\n limit: \"number\",\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/**\n * Creates a success response schema wrapper for any data type.\n * @template T - The data schema type\n * @param dataSchema - The ArkType schema for the response data\n * @returns An ArkType schema for a success response containing the data\n */\nexport const successResponse = <T>(dataSchema: T) =>\n type({\n success: \"'true'\",\n data: dataSchema as never,\n \"message?\": \"string\",\n });\n\n/** Error response */\nexport const errorResponse = type({\n success: \"'false'\",\n error: {\n code: \"string\",\n message: \"string\",\n \"details?\": \"unknown\",\n },\n \"message?\": \"string\",\n});\n\n/**\n * Creates a paginated response schema wrapper for offset-based pagination.\n * @template T - The data schema type (typically an array schema)\n * @param dataSchema - The ArkType schema for the paginated data array\n * @returns An ArkType schema for a paginated response with pagination metadata\n */\nexport const paginatedResponse = <T>(dataSchema: T) =>\n type({\n success: \"boolean\",\n data: dataSchema as never,\n pagination: paginationMeta,\n \"message?\": \"string\",\n });\n\n/**\n * Creates a cursor-paginated response schema wrapper for cursor-based pagination.\n * @template T - The data schema type (typically an array schema)\n * @param dataSchema - The ArkType schema for the paginated data array\n * @returns An ArkType schema for a cursor-paginated response with cursor metadata\n */\nexport const cursorPaginatedResponse = <T>(dataSchema: T) =>\n type({\n success: \"boolean\",\n data: dataSchema as never,\n pagination: cursorPaginationMeta,\n \"message?\": \"string\",\n });\n\n// ============================================================================\n// Error Schemas\n// ============================================================================\n\n/** Pars framework error */\nexport const parsError = type({\n message: \"string\",\n statusCode: \"number >= 100\",\n \"code?\": \"string\",\n \"details?\": \"unknown\",\n});\n\n/** Validation error details */\nexport const validationErrorDetail = type({\n path: \"string\",\n message: \"string\",\n \"expected?\": \"string\",\n \"received?\": \"unknown\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * UUID v4 string type.\n * Represents a universally unique identifier in the standard UUID v4 format.\n */\nexport type UUID = typeof uuid.infer;\n\n/**\n * ISO 8601 timestamp string type.\n * Represents a date-time value in ISO 8601 format (e.g., \"2024-01-15T10:30:00Z\").\n */\nexport type Timestamp = typeof timestamp.infer;\n\n/**\n * Valid email address string type.\n * Represents a properly formatted email address.\n */\nexport type Email = typeof email.infer;\n\n/**\n * Valid URL string type.\n * Represents a properly formatted URL.\n */\nexport type Url = typeof url.infer;\n\n/**\n * Non-empty string type (length >= 1).\n * Ensures the string contains at least one character.\n */\nexport type NonEmptyString = typeof nonEmptyString.infer;\n\n/**\n * Positive integer type (> 0).\n * Represents whole numbers greater than zero.\n */\nexport type PositiveInt = typeof positiveInt.infer;\n\n/**\n * Non-negative integer type (>= 0).\n * Represents whole numbers that are zero or greater.\n */\nexport type NonNegativeInt = typeof nonNegativeInt.infer;\n\n/**\n * Entity status type.\n * Common lifecycle states for entities: 'active' | 'inactive' | 'suspended' | 'deleted'.\n */\nexport type Status = typeof status.infer;\n\n/**\n * Session status type.\n * Represents the current state of a user session: 'active' | 'expired' | 'revoked'.\n */\nexport type SessionStatus = typeof sessionStatus.infer;\n\n/**\n * Pagination request parameters type.\n * Contains page number, limit, and optional ordering for offset-based pagination.\n */\nexport type Pagination = typeof pagination.infer;\n\n/**\n * Pagination metadata type for responses.\n * Contains page info, totals, and navigation flags for offset-based pagination.\n */\nexport type PaginationMeta = typeof paginationMeta.infer;\n\n/**\n * Cursor-based pagination request type.\n * Contains cursor, limit, and direction for cursor-based pagination.\n */\nexport type CursorPagination = typeof cursorPagination.infer;\n\n/**\n * Cursor-based pagination metadata type.\n * Contains current/next/prev cursors and hasMore flag for cursor-based pagination.\n */\nexport type CursorPaginationMeta = typeof cursorPaginationMeta.infer;\n\n/**\n * Standard error response structure type.\n * Contains success flag, error object with code/message/details, and optional message.\n */\nexport type ErrorResponse = typeof errorResponse.infer;\n\n/**\n * Pars framework error structure type.\n * Contains message, HTTP status code, optional error code, and optional details.\n */\nexport type ParsError = typeof parsError.infer;\n\n/**\n * Validation error detail type.\n * Contains the field path, error message, and optional expected/received values.\n */\nexport type ValidationErrorDetail = typeof validationErrorDetail.infer;\n\n// ============================================================================\n// API Response Interfaces (for TypeScript convenience)\n// ============================================================================\n\n/** Generic API response wrapper */\nexport interface ApiResponse<T = unknown> {\n success: boolean;\n data?: T;\n message?: string;\n}\n\n/** API error response structure */\nexport interface ApiErrorResponse {\n success: false;\n error: {\n code: string;\n message: string;\n details?: unknown;\n };\n message?: string;\n}\n\n/** Paginated API response with offset-based pagination */\nexport interface ApiPaginatedResponse<T = unknown> {\n success: boolean;\n data: T[];\n pagination: PaginationMeta;\n message?: string;\n}\n\n/** Paginated API response with cursor-based pagination */\nexport interface ApiCursorPaginatedResponse<T = unknown> {\n success: boolean;\n data: T[];\n pagination: CursorPaginationMeta;\n message?: string;\n}\n","/**\n * @module\n * Authentication and authorization validation schemas.\n * Includes user, session, JWT, RBAC, and OAuth configuration types.\n *\n * @example\n * ```typescript\n * import { user, session, jwtPayload, type User } from '@parsrun/types';\n *\n * // Validate user data\n * const userData = user(input);\n *\n * // Type-safe user object\n * const currentUser: User = { id: '...', status: 'active', ... };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { status, sessionStatus, timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// User Schemas\n// ============================================================================\n\n/** User entity */\nexport const user = type({\n id: uuid,\n \"displayName?\": \"string\",\n twoFactorEnabled: \"boolean\",\n \"twoFactorSecret?\": \"string\",\n status,\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Auth method (email, phone, OAuth providers) */\nexport const authMethod = type({\n id: uuid,\n userId: uuid,\n provider: \"'email' | 'phone' | 'google' | 'github' | 'microsoft' | 'apple'\",\n providerId: \"string >= 1\",\n verified: \"boolean\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n// ============================================================================\n// Session Schemas\n// ============================================================================\n\n/** Session entity */\nexport const session = type({\n id: uuid,\n userId: uuid,\n \"authMethodId?\": uuid,\n \"currentTenantId?\": uuid,\n \"refreshTokenHash?\": \"string\",\n csrfTokenHash: \"string\",\n expiresAt: timestamp,\n \"refreshExpiresAt?\": timestamp,\n \"deviceType?\": \"'mobile' | 'desktop' | 'tablet' | 'api'\",\n \"deviceName?\": \"string\",\n \"userAgent?\": \"string\",\n \"ipAddress?\": \"string\",\n \"locationData?\": \"object\",\n \"deviceFingerprint?\": \"string\",\n status: sessionStatus,\n lastActivityAt: timestamp,\n \"revokedAt?\": timestamp,\n \"revokedReason?\":\n \"'user_logout' | 'admin_revoke' | 'security_breach' | 'suspicious_activity'\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n// ============================================================================\n// Tenant & Membership Schemas\n// ============================================================================\n\n/** Tenant membership */\nexport const tenantMembership = type({\n id: uuid,\n userId: uuid,\n tenantId: uuid,\n roleId: uuid,\n status: \"'active' | 'inactive' | 'invited' | 'suspended'\",\n permissions: \"object\",\n accessLevel: \"'full' | 'limited' | 'read_only'\",\n resourceRestrictions: \"object\",\n \"ipRestrictions?\": \"object\",\n \"timeRestrictions?\": \"object\",\n \"expiresAt?\": timestamp,\n \"invitedBy?\": uuid,\n \"invitedAt?\": timestamp,\n \"joinedAt?\": timestamp,\n \"lastLoginAt?\": timestamp,\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n// ============================================================================\n// OTP Schemas\n// ============================================================================\n\n/** Request OTP (email/phone) */\nexport const requestOTPRequest = type({\n \"email?\": \"string.email\",\n \"phone?\": \"string >= 10\",\n \"tenantId?\": uuid,\n});\n\n/** OTP request response */\nexport const requestOTPResponse = type({\n success: \"boolean\",\n message: \"string\",\n \"expiresAt?\": timestamp,\n \"requiresTenantSelection?\": \"boolean\",\n \"isNewUser?\": \"boolean\",\n \"defaultTenantId?\": uuid,\n \"defaultTenantName?\": \"string\",\n \"selectedTenantId?\": uuid,\n \"selectedTenantName?\": \"string\",\n \"tenants?\": type({\n id: uuid,\n name: \"string\",\n role: \"string\",\n }).array(),\n});\n\n/** Verify OTP */\nexport const verifyOTPRequest = type({\n \"email?\": \"string.email\",\n \"phone?\": \"string >= 10\",\n code: \"string >= 6\",\n \"tenantId?\": uuid,\n});\n\n/** Resend OTP */\nexport const resendOTPRequest = type({\n \"email?\": \"string.email\",\n \"phone?\": \"string >= 10\",\n});\n\n// ============================================================================\n// Login Response Schemas\n// ============================================================================\n\n/** Login response data */\nexport const loginResponseData = type({\n user,\n session: {\n accessToken: \"string\",\n expiresAt: timestamp,\n csrfToken: \"string\",\n },\n \"refreshToken?\": \"string\",\n authMethod: {\n id: uuid,\n provider: \"'email' | 'phone' | 'google' | 'github' | 'microsoft' | 'apple'\",\n providerId: \"string >= 1\",\n verified: \"boolean\",\n \"metadata?\": \"object\",\n },\n \"tenantMemberships?\": tenantMembership.array(),\n isNewUser: \"boolean\",\n});\n\n/** Login response */\nexport const loginResponse = type({\n success: \"boolean\",\n data: loginResponseData,\n \"message?\": \"string\",\n});\n\n// ============================================================================\n// Current User Schemas\n// ============================================================================\n\n/** Current user response data */\nexport const currentUserResponseData = type({\n user,\n \"authMethod?\": {\n id: uuid,\n provider: \"'email' | 'phone' | 'google' | 'github' | 'microsoft' | 'apple'\",\n providerId: \"string >= 1\",\n verified: \"boolean\",\n \"metadata?\": \"object\",\n },\n tenantMemberships: tenantMembership.array(),\n roles: type({\n id: uuid,\n name: \"string\",\n \"description?\": \"string\",\n }).array(),\n permissions: \"string[]\",\n currentTenant: uuid,\n});\n\n/** Current user response */\nexport const currentUserResponse = type({\n success: \"boolean\",\n data: currentUserResponseData,\n \"message?\": \"string\",\n});\n\n// ============================================================================\n// Token Schemas\n// ============================================================================\n\n/** Refresh token request */\nexport const refreshTokenRequest = type({\n refreshToken: \"string\",\n});\n\n/** Token info (for client storage) */\nexport const tokenInfo = type({\n accessToken: \"string\",\n \"refreshToken?\": \"string\",\n expiresAt: \"Date\",\n csrfToken: \"string\",\n \"tenantId?\": uuid,\n});\n\n/** JWT payload */\nexport const jwtPayload = type({\n sub: uuid,\n tenantId: uuid,\n \"sessionId?\": uuid,\n \"roles?\": \"string[]\",\n \"permissions?\": \"string[]\",\n iat: \"number\",\n exp: \"number\",\n \"aud?\": \"string\",\n \"iss?\": \"string\",\n});\n\n// ============================================================================\n// RBAC Schemas\n// ============================================================================\n\n/** Permission entity */\nexport const permission = type({\n id: uuid,\n name: \"string >= 1\",\n \"description?\": \"string\",\n resource: \"string >= 1\",\n action: \"'create' | 'read' | 'update' | 'delete' | 'list' | 'manage'\",\n scope: \"'tenant' | 'global' | 'own'\",\n isSystem: \"boolean\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Role entity */\nexport const role = type({\n id: uuid,\n tenantId: uuid,\n name: \"string >= 1\",\n \"description?\": \"string\",\n isSystem: \"boolean\",\n isActive: \"boolean\",\n \"color?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Permission check request */\nexport const permissionCheck = type({\n resource: \"string >= 1\",\n action: \"string >= 1\",\n \"scope?\": \"'tenant' | 'global' | 'own'\",\n \"resourceId?\": \"string\",\n});\n\n// ============================================================================\n// Session Management Schemas\n// ============================================================================\n\n/** Logout request */\nexport const logoutRequest = type({\n \"refreshToken?\": \"string\",\n allDevices: \"boolean\",\n});\n\n/** Revoke session request */\nexport const revokeSessionRequest = type({\n \"reason?\":\n \"'user_logout' | 'admin_revoke' | 'security_breach' | 'suspicious_activity'\",\n});\n\n/** Revoke all sessions request */\nexport const revokeAllSessionsRequest = type({\n \"reason?\":\n \"'user_logout' | 'admin_revoke' | 'security_breach' | 'suspicious_activity'\",\n \"excludeCurrent?\": \"boolean\",\n});\n\n/** Revoke all sessions response */\nexport const revokeAllSessionsResponse = type({\n success: \"boolean\",\n message: \"string\",\n revokedCount: \"number\",\n});\n\n// ============================================================================\n// Email Verification Schemas\n// ============================================================================\n\n/** Send verification email request */\nexport const sendVerificationEmailRequest = type({\n email: \"string.email\",\n});\n\n/** Verify email request */\nexport const verifyEmailRequest = type({\n token: \"string >= 1\",\n});\n\n/** Check verification status */\nexport const checkVerificationStatusRequest = type({\n email: \"string.email\",\n});\n\n/** Check verification status response */\nexport const checkVerificationStatusResponse = type({\n success: \"boolean\",\n verified: \"boolean\",\n message: \"string\",\n \"sentAt?\": timestamp,\n \"expiresAt?\": timestamp,\n});\n\n// ============================================================================\n// CSRF Schemas\n// ============================================================================\n\n/** CSRF token validation */\nexport const csrfTokenRequest = type({\n csrfToken: \"string >= 1\",\n});\n\n// ============================================================================\n// Config Schemas (for @parsrun/auth)\n// ============================================================================\n\n/** Session config */\nexport const sessionConfig = type({\n \"accessTokenExpiry?\": \"number > 0\",\n \"refreshTokenExpiry?\": \"number > 0\",\n \"slidingWindow?\": \"boolean\",\n \"maxSessions?\": \"number > 0\",\n \"invalidateOnPasswordChange?\": \"boolean\",\n});\n\n/** JWT config */\nexport const jwtConfig = type({\n \"algorithm?\":\n \"'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512' | 'ES256' | 'ES384' | 'ES512'\",\n \"issuer?\": \"string\",\n \"audience?\": \"string | string[]\",\n});\n\n/** Cookie config */\nexport const cookieConfig = type({\n \"prefix?\": \"string\",\n \"domain?\": \"string\",\n \"path?\": \"string\",\n \"secure?\": \"boolean\",\n \"sameSite?\": \"'strict' | 'lax' | 'none'\",\n \"httpOnly?\": \"boolean\",\n});\n\n/** CSRF config */\nexport const csrfConfig = type({\n \"enabled?\": \"boolean\",\n \"headerName?\": \"string\",\n \"cookieName?\": \"string\",\n});\n\n/** Rate limit config */\nexport const rateLimitConfig = type({\n \"enabled?\": \"boolean\",\n \"loginAttempts?\": \"number > 0\",\n \"windowSize?\": \"number > 0\",\n});\n\n/** Lockout config */\nexport const lockoutConfig = type({\n \"enabled?\": \"boolean\",\n \"maxAttempts?\": \"number > 0\",\n \"duration?\": \"number > 0\",\n});\n\n/** Security config */\nexport const securityConfig = type({\n \"rateLimit?\": rateLimitConfig,\n \"lockout?\": lockoutConfig,\n \"csrf?\": csrfConfig,\n});\n\n/** Tenant config */\nexport const tenantConfig = type({\n \"enabled?\": \"boolean\",\n \"strategy?\": \"'subdomain' | 'header' | 'path' | 'query' | 'custom'\",\n \"headerName?\": \"string\",\n \"resolver?\": \"Function\",\n});\n\n/** OAuth provider config */\nexport const oauthProviderConfig = type({\n \"enabled?\": \"boolean\",\n clientId: \"string\",\n clientSecret: \"string\",\n \"scopes?\": \"string[]\",\n \"callbackUrl?\": \"string\",\n});\n\n/** OTP email config */\nexport const otpEmailConfig = type({\n \"enabled?\": \"boolean\",\n \"expiresIn?\": \"number > 0\",\n \"length?\": \"number >= 4\",\n \"maxAttempts?\": \"number > 0\",\n \"rateLimit?\": \"number > 0\",\n \"rateLimitWindow?\": \"number > 0\",\n send: \"Function\",\n});\n\n/** OTP SMS config */\nexport const otpSmsConfig = type({\n \"enabled?\": \"boolean\",\n \"expiresIn?\": \"number > 0\",\n \"length?\": \"number >= 4\",\n \"maxAttempts?\": \"number > 0\",\n \"rateLimit?\": \"number > 0\",\n \"rateLimitWindow?\": \"number > 0\",\n send: \"Function\",\n});\n\n/** OTP config */\nexport const otpConfig = type({\n \"enabled?\": \"boolean\",\n \"email?\": otpEmailConfig,\n \"sms?\": otpSmsConfig,\n});\n\n/** Magic link config */\nexport const magicLinkConfig = type({\n \"enabled?\": \"boolean\",\n \"expiresIn?\": \"number > 0\",\n send: \"Function\",\n});\n\n/** TOTP config */\nexport const totpConfig = type({\n \"enabled?\": \"boolean\",\n \"issuer?\": \"string\",\n \"backupCodesCount?\": \"number > 0\",\n});\n\n/** WebAuthn config */\nexport const webauthnConfig = type({\n \"enabled?\": \"boolean\",\n rpName: \"string\",\n rpId: \"string\",\n \"origins?\": \"string[]\",\n});\n\n/** Password config */\nexport const passwordConfig = type({\n \"enabled?\": \"boolean\",\n \"minLength?\": \"number >= 6\",\n \"requireUppercase?\": \"boolean\",\n \"requireLowercase?\": \"boolean\",\n \"requireNumbers?\": \"boolean\",\n \"requireSymbols?\": \"boolean\",\n \"checkCommonPasswords?\": \"boolean\",\n});\n\n/** OAuth providers config */\nexport const oauthProvidersConfig = type({\n \"google?\": oauthProviderConfig,\n \"github?\": oauthProviderConfig,\n \"microsoft?\": oauthProviderConfig,\n \"apple?\": oauthProviderConfig,\n \"custom?\": type(\"Record<string, unknown>\"),\n});\n\n/** Providers config */\nexport const providersConfig = type({\n \"otp?\": otpConfig,\n \"magicLink?\": magicLinkConfig,\n \"oauth?\": oauthProvidersConfig,\n \"totp?\": totpConfig,\n \"webauthn?\": webauthnConfig,\n \"password?\": passwordConfig,\n});\n\n/** Storage config */\nexport const storageConfig = type({\n \"type?\": \"'memory' | 'redis' | 'upstash' | 'cloudflare-kv' | 'deno-kv' | 'custom'\",\n \"redis?\": \"object\",\n \"upstash?\": \"object\",\n \"cloudflareKv?\": \"object\",\n \"denoKv?\": \"object\",\n \"custom?\": \"object\",\n});\n\n/** Main Pars auth config */\nexport const parsAuthConfig = type({\n secret: \"string >= 32\",\n \"baseUrl?\": \"string\",\n \"storage?\": storageConfig,\n \"providers?\": providersConfig,\n \"session?\": sessionConfig,\n \"jwt?\": jwtConfig,\n \"cookies?\": cookieConfig,\n \"security?\": securityConfig,\n \"tenant?\": tenantConfig,\n adapter: \"object\",\n \"callbacks?\": \"object\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n// Entity types\n\n/**\n * User entity type.\n * Represents a user account with display name, 2FA settings, and status.\n */\nexport type User = typeof user.infer;\n\n/**\n * Authentication method type.\n * Represents how a user authenticates (email, phone, OAuth providers).\n */\nexport type AuthMethod = typeof authMethod.infer;\n\n/**\n * Session entity type.\n * Represents an active user session with tokens, device info, and expiry.\n */\nexport type Session = typeof session.infer;\n\n/**\n * Tenant membership type.\n * Represents a user's membership and role within a specific tenant.\n */\nexport type TenantMembership = typeof tenantMembership.infer;\n\n// OTP types\n\n/**\n * Request OTP request type.\n * Contains email or phone number for OTP delivery.\n */\nexport type RequestOTPRequest = typeof requestOTPRequest.infer;\n\n/**\n * Request OTP response type.\n * Contains success status, expiry, and optional tenant selection info.\n */\nexport type RequestOTPResponse = typeof requestOTPResponse.infer;\n\n/**\n * Verify OTP request type.\n * Contains email/phone, OTP code, and optional tenant ID.\n */\nexport type VerifyOTPRequest = typeof verifyOTPRequest.infer;\n\n/**\n * Resend OTP request type.\n * Contains email or phone number to resend OTP to.\n */\nexport type ResendOTPRequest = typeof resendOTPRequest.infer;\n\n// Login types\n\n/**\n * Login response data type.\n * Contains user, session tokens, auth method, and membership info.\n */\nexport type LoginResponseData = typeof loginResponseData.infer;\n\n/**\n * Login response type.\n * Wrapper containing success status and login response data.\n */\nexport type LoginResponse = typeof loginResponse.infer;\n\n// Current user types\n\n/**\n * Current user response data type.\n * Contains user details, auth method, memberships, roles, and permissions.\n */\nexport type CurrentUserResponseData = typeof currentUserResponseData.infer;\n\n/**\n * Current user response type.\n * Wrapper containing success status and current user data.\n */\nexport type CurrentUserResponse = typeof currentUserResponse.infer;\n\n// Token types\n\n/**\n * Refresh token request type.\n * Contains the refresh token for obtaining new access tokens.\n */\nexport type RefreshTokenRequest = typeof refreshTokenRequest.infer;\n\n/**\n * Token info type for client storage.\n * Contains access token, optional refresh token, expiry, and CSRF token.\n */\nexport type TokenInfo = typeof tokenInfo.infer;\n\n/**\n * JWT payload type.\n * Contains subject (user ID), tenant ID, session ID, roles, permissions, and timing claims.\n */\nexport type JwtPayload = typeof jwtPayload.infer;\n\n// RBAC types\n\n/**\n * Permission entity type.\n * Defines an action that can be performed on a resource within a scope.\n */\nexport type Permission = typeof permission.infer;\n\n/**\n * Role entity type.\n * Groups permissions together for assignment to users within a tenant.\n */\nexport type Role = typeof role.infer;\n\n/**\n * Permission check request type.\n * Used to verify if a user has permission for a specific resource/action.\n */\nexport type PermissionCheck = typeof permissionCheck.infer;\n\n// Session management types\n\n/**\n * Logout request type.\n * Contains refresh token and flag for logging out all devices.\n */\nexport type LogoutRequest = typeof logoutRequest.infer;\n\n/**\n * Revoke session request type.\n * Contains optional reason for session revocation.\n */\nexport type RevokeSessionRequest = typeof revokeSessionRequest.infer;\n\n/**\n * Revoke all sessions request type.\n * Contains reason and option to exclude the current session.\n */\nexport type RevokeAllSessionsRequest = typeof revokeAllSessionsRequest.infer;\n\n/**\n * Revoke all sessions response type.\n * Contains success status, message, and count of revoked sessions.\n */\nexport type RevokeAllSessionsResponse = typeof revokeAllSessionsResponse.infer;\n\n// Email verification types\n\n/**\n * Send verification email request type.\n * Contains the email address to send verification to.\n */\nexport type SendVerificationEmailRequest = typeof sendVerificationEmailRequest.infer;\n\n/**\n * Verify email request type.\n * Contains the verification token from the email link.\n */\nexport type VerifyEmailRequest = typeof verifyEmailRequest.infer;\n\n/**\n * Check verification status request type.\n * Contains email address to check verification status for.\n */\nexport type CheckVerificationStatusRequest = typeof checkVerificationStatusRequest.infer;\n\n/**\n * Check verification status response type.\n * Contains verification status and optional timing information.\n */\nexport type CheckVerificationStatusResponse = typeof checkVerificationStatusResponse.infer;\n\n// CSRF types\n\n/**\n * CSRF token request type.\n * Contains the CSRF token for validation.\n */\nexport type CSRFTokenRequest = typeof csrfTokenRequest.infer;\n\n// Config types\n\n/**\n * Session configuration type.\n * Controls token expiry, sliding window, max sessions, and invalidation rules.\n */\nexport type SessionConfig = typeof sessionConfig.infer;\n\n/**\n * JWT configuration type.\n * Controls algorithm, issuer, and audience for JWT tokens.\n */\nexport type JwtConfig = typeof jwtConfig.infer;\n\n/**\n * Cookie configuration type.\n * Controls cookie naming, domain, path, and security settings.\n */\nexport type CookieConfig = typeof cookieConfig.infer;\n\n/**\n * CSRF configuration type.\n * Controls CSRF protection settings including header and cookie names.\n */\nexport type CsrfConfig = typeof csrfConfig.infer;\n\n/**\n * Rate limit configuration type.\n * Controls login attempt limits and window size.\n */\nexport type RateLimitConfig = typeof rateLimitConfig.infer;\n\n/**\n * Lockout configuration type.\n * Controls account lockout after failed attempts.\n */\nexport type LockoutConfig = typeof lockoutConfig.infer;\n\n/**\n * Security configuration type.\n * Groups rate limit, lockout, and CSRF settings.\n */\nexport type SecurityConfig = typeof securityConfig.infer;\n\n/**\n * Tenant configuration type.\n * Controls multi-tenancy strategy and resolution method.\n */\nexport type TenantConfig = typeof tenantConfig.infer;\n\n/**\n * OAuth provider configuration type.\n * Contains client credentials and callback URL for an OAuth provider.\n */\nexport type OAuthProviderConfig = typeof oauthProviderConfig.infer;\n\n/**\n * OTP email configuration type.\n * Controls email OTP settings including expiry, length, and rate limits.\n */\nexport type OtpEmailConfig = typeof otpEmailConfig.infer;\n\n/**\n * OTP SMS configuration type.\n * Controls SMS OTP settings including expiry, length, and rate limits.\n */\nexport type OtpSmsConfig = typeof otpSmsConfig.infer;\n\n/**\n * OTP configuration type.\n * Groups email and SMS OTP settings.\n */\nexport type OtpConfig = typeof otpConfig.infer;\n\n/**\n * Magic link configuration type.\n * Controls magic link expiry and send function.\n */\nexport type MagicLinkConfig = typeof magicLinkConfig.infer;\n\n/**\n * TOTP configuration type.\n * Controls time-based OTP settings for 2FA including issuer and backup codes.\n */\nexport type TotpConfig = typeof totpConfig.infer;\n\n/**\n * WebAuthn configuration type.\n * Controls WebAuthn/FIDO2 settings including relying party info.\n */\nexport type WebAuthnConfig = typeof webauthnConfig.infer;\n\n/**\n * Password configuration type.\n * Controls password requirements including length and character requirements.\n */\nexport type PasswordConfig = typeof passwordConfig.infer;\n\n/**\n * OAuth providers configuration type.\n * Maps OAuth provider names to their configurations.\n */\nexport type OAuthProvidersConfig = typeof oauthProvidersConfig.infer;\n\n/**\n * Auth providers configuration type.\n * Groups all authentication provider settings.\n */\nexport type ProvidersConfig = typeof providersConfig.infer;\n\n/**\n * Auth storage configuration type.\n * Controls session/token storage backend selection.\n */\nexport type StorageConfig = typeof storageConfig.infer;\n\n/**\n * Main Pars auth configuration type.\n * Complete configuration object for the Pars authentication system.\n */\nexport type ParsAuthConfig = typeof parsAuthConfig.infer;\n","/**\n * @module\n * Multi-tenant validation schemas for SaaS applications.\n * Includes tenant entity, membership, and invitation types.\n *\n * @example\n * ```typescript\n * import { tenant, createTenantRequest, type Tenant } from '@parsrun/types';\n *\n * // Validate tenant creation\n * const result = createTenantRequest({ name: 'Acme Corp' });\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { status, timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// Tenant Schemas\n// ============================================================================\n\n/** Tenant entity */\nexport const tenant = type({\n id: uuid,\n name: \"string >= 1\",\n \"slug?\": \"string\",\n \"description?\": \"string\",\n status,\n \"settings?\": \"object\",\n \"metadata?\": \"object\",\n \"logoUrl?\": \"string\",\n \"primaryColor?\": \"string\",\n \"timezone?\": \"string\",\n \"locale?\": \"string\",\n \"currency?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Tenant creation request */\nexport const createTenantRequest = type({\n name: \"string >= 1\",\n \"slug?\": \"string\",\n \"description?\": \"string\",\n \"settings?\": \"object\",\n \"logoUrl?\": \"string\",\n \"primaryColor?\": \"string\",\n \"timezone?\": \"string\",\n \"locale?\": \"string\",\n \"currency?\": \"string\",\n});\n\n/** Tenant update request */\nexport const updateTenantRequest = type({\n \"name?\": \"string >= 1\",\n \"slug?\": \"string\",\n \"description?\": \"string\",\n \"settings?\": \"object\",\n \"logoUrl?\": \"string\",\n \"primaryColor?\": \"string\",\n \"timezone?\": \"string\",\n \"locale?\": \"string\",\n \"currency?\": \"string\",\n \"status?\": status,\n});\n\n/** Tenant invite request */\nexport const inviteTenantMemberRequest = type({\n email: \"string.email\",\n roleId: uuid,\n \"accessLevel?\": \"'full' | 'limited' | 'read_only'\",\n \"expiresAt?\": timestamp,\n \"message?\": \"string\",\n});\n\n/** Tenant member list query */\nexport const tenantMemberListQuery = type({\n \"page?\": \"number >= 1\",\n \"limit?\": \"number >= 1\",\n \"status?\": \"'active' | 'inactive' | 'invited' | 'suspended'\",\n \"roleId?\": uuid,\n \"search?\": \"string\",\n});\n\n/** Tenant switch request */\nexport const switchTenantRequest = type({\n tenantId: uuid,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * Tenant entity type.\n * Represents an organization/workspace with branding, settings, and localization.\n */\nexport type Tenant = typeof tenant.infer;\n\n/**\n * Create tenant request type.\n * Contains required name and optional branding/localization settings.\n */\nexport type CreateTenantRequest = typeof createTenantRequest.infer;\n\n/**\n * Update tenant request type.\n * Contains optional fields for updating tenant properties.\n */\nexport type UpdateTenantRequest = typeof updateTenantRequest.infer;\n\n/**\n * Invite tenant member request type.\n * Contains email, role, access level, and optional expiry for invitations.\n */\nexport type InviteTenantMemberRequest = typeof inviteTenantMemberRequest.infer;\n\n/**\n * Tenant member list query type.\n * Contains pagination, filtering, and search options for listing members.\n */\nexport type TenantMemberListQuery = typeof tenantMemberListQuery.infer;\n\n/**\n * Switch tenant request type.\n * Contains the target tenant ID for switching the user's active tenant.\n */\nexport type SwitchTenantRequest = typeof switchTenantRequest.infer;\n","/**\n * @module\n * Email service validation schemas for sending emails.\n * Includes address, attachment, and provider configuration types.\n *\n * @example\n * ```typescript\n * import { sendEmailOptions, emailConfig, type SendEmailOptions } from '@parsrun/types';\n *\n * const options: SendEmailOptions = {\n * to: 'user@example.com',\n * subject: 'Welcome!',\n * html: '<h1>Hello</h1>'\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\n\n// ============================================================================\n// Email Address Schemas\n// ============================================================================\n\n/** Email address with optional name */\nexport const emailAddress = type({\n email: \"string.email\",\n \"name?\": \"string\",\n});\n\n/** Simple email string or address object */\nexport const emailRecipient = type(\"string.email | object\");\n\n// ============================================================================\n// Email Content Schemas\n// ============================================================================\n\n/** Email attachment */\nexport const emailAttachment = type({\n filename: \"string >= 1\",\n content: \"string | object\",\n \"contentType?\": \"string\",\n \"encoding?\": \"'base64' | 'utf-8' | 'binary'\",\n \"contentId?\": \"string\",\n \"disposition?\": \"'attachment' | 'inline'\",\n});\n\n/** Email options */\nexport const sendEmailOptions = type({\n to: \"string.email | string.email[] | object | object[]\",\n \"cc?\": \"string.email | string.email[] | object | object[]\",\n \"bcc?\": \"string.email | string.email[] | object | object[]\",\n \"from?\": \"string.email | object\",\n \"replyTo?\": \"string.email | object\",\n subject: \"string >= 1\",\n \"text?\": \"string\",\n \"html?\": \"string\",\n \"attachments?\": emailAttachment.array(),\n \"headers?\": \"object\",\n \"priority?\": \"'high' | 'normal' | 'low'\",\n \"tags?\": \"string[]\",\n \"metadata?\": \"object\",\n});\n\n/** Templated email options */\nexport const sendTemplateEmailOptions = type({\n to: \"string.email | string.email[] | object | object[]\",\n \"cc?\": \"string.email | string.email[] | object | object[]\",\n \"bcc?\": \"string.email | string.email[] | object | object[]\",\n \"from?\": \"string.email | object\",\n \"replyTo?\": \"string.email | object\",\n template: \"string >= 1\",\n \"data?\": \"object\",\n \"attachments?\": emailAttachment.array(),\n \"headers?\": \"object\",\n \"priority?\": \"'high' | 'normal' | 'low'\",\n \"tags?\": \"string[]\",\n \"metadata?\": \"object\",\n});\n\n/** Email send result */\nexport const emailSendResult = type({\n success: \"boolean\",\n messageId: \"string\",\n \"accepted?\": \"string[]\",\n \"rejected?\": \"string[]\",\n \"pending?\": \"string[]\",\n});\n\n// ============================================================================\n// Email Provider Config Schemas\n// ============================================================================\n\n/** SMTP config */\nexport const smtpConfig = type({\n host: \"string >= 1\",\n port: \"number > 0\",\n \"secure?\": \"boolean\",\n \"auth?\": {\n user: \"string\",\n pass: \"string\",\n },\n \"tls?\": \"object\",\n});\n\n/** Resend config */\nexport const resendConfig = type({\n apiKey: \"string >= 1\",\n \"domain?\": \"string\",\n});\n\n/** SendGrid config */\nexport const sendgridConfig = type({\n apiKey: \"string >= 1\",\n});\n\n/** AWS SES config */\nexport const sesConfig = type({\n region: \"string >= 1\",\n \"accessKeyId?\": \"string\",\n \"secretAccessKey?\": \"string\",\n \"endpoint?\": \"string\",\n});\n\n/** Postmark config */\nexport const postmarkConfig = type({\n serverToken: \"string >= 1\",\n});\n\n/** Email provider config */\nexport const emailConfig = type({\n provider: \"'smtp' | 'resend' | 'sendgrid' | 'ses' | 'postmark' | 'mailgun'\",\n \"from?\": \"string.email | object\",\n \"replyTo?\": \"string.email | object\",\n \"smtp?\": smtpConfig,\n \"resend?\": resendConfig,\n \"sendgrid?\": sendgridConfig,\n \"ses?\": sesConfig,\n \"postmark?\": postmarkConfig,\n \"templates?\": \"object\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * Email address type with optional display name.\n * Contains email and optional name for formatted addresses like \"John Doe <john@example.com>\".\n */\nexport type EmailAddress = typeof emailAddress.infer;\n\n/**\n * Email recipient type.\n * Accepts either a simple email string or an EmailAddress object.\n */\nexport type EmailRecipient = typeof emailRecipient.infer;\n\n/**\n * Email attachment type.\n * Contains filename, content, encoding, and disposition for email attachments.\n */\nexport type EmailAttachment = typeof emailAttachment.infer;\n\n/**\n * Send email options type.\n * Contains recipients, subject, body content (text/html), attachments, and metadata.\n */\nexport type SendEmailOptions = typeof sendEmailOptions.infer;\n\n/**\n * Send template email options type.\n * Contains recipients, template name, template data, and attachments.\n */\nexport type SendTemplateEmailOptions = typeof sendTemplateEmailOptions.infer;\n\n/**\n * Email send result type.\n * Contains success status, message ID, and lists of accepted/rejected/pending recipients.\n */\nexport type EmailSendResult = typeof emailSendResult.infer;\n\n/**\n * SMTP configuration type.\n * Contains host, port, authentication, and TLS settings for SMTP servers.\n */\nexport type SmtpConfig = typeof smtpConfig.infer;\n\n/**\n * Resend configuration type.\n * Contains API key and optional domain for the Resend email service.\n */\nexport type ResendConfig = typeof resendConfig.infer;\n\n/**\n * SendGrid configuration type.\n * Contains API key for the SendGrid email service.\n */\nexport type SendgridConfig = typeof sendgridConfig.infer;\n\n/**\n * AWS SES configuration type.\n * Contains region and optional credentials for Amazon Simple Email Service.\n */\nexport type SesConfig = typeof sesConfig.infer;\n\n/**\n * Postmark configuration type.\n * Contains server token for the Postmark email service.\n */\nexport type PostmarkConfig = typeof postmarkConfig.infer;\n\n/**\n * Email configuration type.\n * Contains provider selection and provider-specific configuration.\n */\nexport type EmailConfig = typeof emailConfig.infer;\n","/**\n * @module\n * File storage validation schemas for upload and retrieval.\n * Supports local, S3, R2, and GCS providers.\n *\n * @example\n * ```typescript\n * import { uploadOptions, fileMetadata, type FileMetadata } from '@parsrun/types';\n *\n * const file: FileMetadata = {\n * id: '...',\n * filename: 'document.pdf',\n * mimeType: 'application/pdf',\n * size: 1024,\n * bucket: 'uploads'\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// File Schemas\n// ============================================================================\n\n/** File metadata */\nexport const fileMetadata = type({\n id: uuid,\n filename: \"string >= 1\",\n originalName: \"string >= 1\",\n mimeType: \"string\",\n size: \"number >= 0\",\n \"path?\": \"string\",\n \"url?\": \"string\",\n bucket: \"string\",\n \"etag?\": \"string\",\n \"metadata?\": \"object\",\n \"uploadedBy?\": uuid,\n \"tenantId?\": uuid,\n insertedAt: timestamp,\n updatedAt: timestamp,\n \"deletedAt?\": timestamp,\n});\n\n/** Upload options */\nexport const uploadOptions = type({\n \"path?\": \"string\",\n \"filename?\": \"string\",\n \"contentType?\": \"string\",\n \"metadata?\": \"object\",\n \"acl?\": \"'private' | 'public-read' | 'authenticated-read'\",\n \"cacheControl?\": \"string\",\n \"contentDisposition?\": \"string\",\n});\n\n/** Signed URL options */\nexport const signedUrlOptions = type({\n \"expiresIn?\": \"number > 0\",\n \"method?\": \"'GET' | 'PUT'\",\n \"contentType?\": \"string\",\n \"responseContentType?\": \"string\",\n \"responseContentDisposition?\": \"string\",\n});\n\n/** List files options */\nexport const listFilesOptions = type({\n \"prefix?\": \"string\",\n \"limit?\": \"number >= 1\",\n \"cursor?\": \"string\",\n \"delimiter?\": \"string\",\n});\n\n/** List files result */\nexport const listFilesResult = type({\n files: fileMetadata.array(),\n \"nextCursor?\": \"string\",\n hasMore: \"boolean\",\n});\n\n// ============================================================================\n// Storage Provider Config Schemas\n// ============================================================================\n\n/** Local storage config */\nexport const localStorageConfig = type({\n basePath: \"string >= 1\",\n \"baseUrl?\": \"string\",\n \"permissions?\": \"number\",\n});\n\n/** S3 storage config */\nexport const s3StorageConfig = type({\n bucket: \"string >= 1\",\n region: \"string >= 1\",\n \"endpoint?\": \"string\",\n \"accessKeyId?\": \"string\",\n \"secretAccessKey?\": \"string\",\n \"forcePathStyle?\": \"boolean\",\n \"acl?\": \"'private' | 'public-read' | 'authenticated-read'\",\n});\n\n/** Cloudflare R2 config */\nexport const r2StorageConfig = type({\n accountId: \"string >= 1\",\n bucket: \"string >= 1\",\n accessKeyId: \"string >= 1\",\n secretAccessKey: \"string >= 1\",\n \"publicUrl?\": \"string\",\n});\n\n/** GCS config */\nexport const gcsStorageConfig = type({\n bucket: \"string >= 1\",\n \"projectId?\": \"string\",\n \"credentials?\": \"object\",\n \"keyFilename?\": \"string\",\n});\n\n/** Storage config */\nexport const storageProviderConfig = type({\n provider: \"'local' | 's3' | 'r2' | 'gcs' | 'azure'\",\n \"defaultBucket?\": \"string\",\n \"local?\": localStorageConfig,\n \"s3?\": s3StorageConfig,\n \"r2?\": r2StorageConfig,\n \"gcs?\": gcsStorageConfig,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * File metadata type.\n * Contains file information including name, MIME type, size, path, and upload details.\n */\nexport type FileMetadata = typeof fileMetadata.infer;\n\n/**\n * Upload options type.\n * Contains optional path, filename, content type, ACL, and caching settings for uploads.\n */\nexport type UploadOptions = typeof uploadOptions.infer;\n\n/**\n * Signed URL options type.\n * Contains expiry, HTTP method, and content type settings for generating signed URLs.\n */\nexport type SignedUrlOptions = typeof signedUrlOptions.infer;\n\n/**\n * List files options type.\n * Contains prefix filter, pagination limit, cursor, and delimiter for file listing.\n */\nexport type ListFilesOptions = typeof listFilesOptions.infer;\n\n/**\n * List files result type.\n * Contains array of file metadata, pagination cursor, and hasMore flag.\n */\nexport type ListFilesResult = typeof listFilesResult.infer;\n\n/**\n * Local storage configuration type.\n * Contains base path, optional base URL, and file permissions for local file storage.\n */\nexport type LocalStorageConfig = typeof localStorageConfig.infer;\n\n/**\n * S3 storage configuration type.\n * Contains bucket, region, endpoint, credentials, and ACL settings for Amazon S3.\n */\nexport type S3StorageConfig = typeof s3StorageConfig.infer;\n\n/**\n * Cloudflare R2 storage configuration type.\n * Contains account ID, bucket, credentials, and optional public URL for R2.\n */\nexport type R2StorageConfig = typeof r2StorageConfig.infer;\n\n/**\n * Google Cloud Storage configuration type.\n * Contains bucket, project ID, and credentials for GCS.\n */\nexport type GcsStorageConfig = typeof gcsStorageConfig.infer;\n\n/**\n * Storage provider configuration type.\n * Contains provider selection and provider-specific configuration.\n */\nexport type StorageProviderConfig = typeof storageProviderConfig.infer;\n","/**\n * @module\n * Job queue validation schemas for background processing.\n * Supports BullMQ, SQS, RabbitMQ, and in-memory queues.\n *\n * @example\n * ```typescript\n * import { job, jobOptions, type Job, type JobOptions } from '@parsrun/types';\n *\n * const options: JobOptions = {\n * priority: 1,\n * attempts: 3,\n * backoff: { type: 'exponential', delay: 1000 }\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// Job Schemas\n// ============================================================================\n\n/** Job status */\nexport const jobStatus = type(\n \"'pending' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused'\"\n);\n\n/** Job entity */\nexport const job = type({\n id: uuid,\n queue: \"string >= 1\",\n name: \"string >= 1\",\n data: \"unknown\",\n \"result?\": \"unknown\",\n \"error?\": \"string\",\n status: jobStatus,\n attempts: \"number >= 0\",\n maxAttempts: \"number >= 1\",\n \"priority?\": \"number\",\n \"delay?\": \"number >= 0\",\n \"progress?\": \"number >= 0\",\n \"startedAt?\": timestamp,\n \"completedAt?\": timestamp,\n \"failedAt?\": timestamp,\n \"processedBy?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Job options */\nexport const jobOptions = type({\n \"priority?\": \"number\",\n \"delay?\": \"number >= 0\",\n \"attempts?\": \"number >= 1\",\n \"backoff?\": {\n type: \"'fixed' | 'exponential'\",\n \"delay?\": \"number >= 0\",\n },\n \"timeout?\": \"number > 0\",\n \"removeOnComplete?\": \"boolean | number\",\n \"removeOnFail?\": \"boolean | number\",\n \"repeat?\": {\n \"pattern?\": \"string\",\n \"every?\": \"number > 0\",\n \"limit?\": \"number >= 1\",\n \"tz?\": \"string\",\n },\n});\n\n/** Add job request */\nexport const addJobRequest = type({\n name: \"string >= 1\",\n data: \"unknown\",\n \"options?\": jobOptions,\n});\n\n/** Job progress update */\nexport const jobProgressUpdate = type({\n progress: \"number >= 0\",\n \"message?\": \"string\",\n \"data?\": \"unknown\",\n});\n\n// ============================================================================\n// Queue Stats Schemas\n// ============================================================================\n\n/** Queue stats */\nexport const queueStats = type({\n name: \"string\",\n pending: \"number >= 0\",\n active: \"number >= 0\",\n completed: \"number >= 0\",\n failed: \"number >= 0\",\n delayed: \"number >= 0\",\n paused: \"boolean\",\n});\n\n/** Queue list options */\nexport const queueListOptions = type({\n \"status?\": jobStatus,\n \"start?\": \"number >= 0\",\n \"end?\": \"number\",\n \"order?\": \"'asc' | 'desc'\",\n});\n\n// ============================================================================\n// Queue Config Schemas\n// ============================================================================\n\n/** Redis queue config */\nexport const redisQueueConfig = type({\n \"host?\": \"string\",\n \"port?\": \"number > 0\",\n \"password?\": \"string\",\n \"db?\": \"number >= 0\",\n \"url?\": \"string\",\n \"tls?\": \"boolean | object\",\n});\n\n/** Queue worker options */\nexport const workerOptions = type({\n \"concurrency?\": \"number >= 1\",\n \"limiter?\": {\n max: \"number >= 1\",\n duration: \"number > 0\",\n },\n \"lockDuration?\": \"number > 0\",\n \"lockRenewTime?\": \"number > 0\",\n \"stalledInterval?\": \"number > 0\",\n \"maxStalledCount?\": \"number >= 0\",\n});\n\n/** Queue config */\nexport const queueConfig = type({\n provider: \"'bullmq' | 'sqs' | 'rabbitmq' | 'memory'\",\n \"defaultJobOptions?\": jobOptions,\n \"redis?\": redisQueueConfig,\n \"prefix?\": \"string\",\n \"worker?\": workerOptions,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * Job status type.\n * Represents job lifecycle states: 'pending' | 'active' | 'completed' | 'failed' | 'delayed' | 'paused'.\n */\nexport type JobStatus = typeof jobStatus.infer;\n\n/**\n * Job entity type.\n * Represents a background job with data, status, attempts, priority, and timing information.\n */\nexport type Job = typeof job.infer;\n\n/**\n * Job options type.\n * Contains priority, delay, retry attempts, backoff strategy, timeout, and repeat settings.\n */\nexport type JobOptions = typeof jobOptions.infer;\n\n/**\n * Add job request type.\n * Contains job name, data payload, and optional job options.\n */\nexport type AddJobRequest = typeof addJobRequest.infer;\n\n/**\n * Job progress update type.\n * Contains progress percentage, optional message, and additional data.\n */\nexport type JobProgressUpdate = typeof jobProgressUpdate.infer;\n\n/**\n * Queue stats type.\n * Contains counts of jobs in each state and pause status for a queue.\n */\nexport type QueueStats = typeof queueStats.infer;\n\n/**\n * Queue list options type.\n * Contains status filter, pagination range, and sort order for listing jobs.\n */\nexport type QueueListOptions = typeof queueListOptions.infer;\n\n/**\n * Redis queue configuration type.\n * Contains Redis connection settings including host, port, password, and TLS.\n */\nexport type RedisQueueConfig = typeof redisQueueConfig.infer;\n\n/**\n * Worker options type.\n * Contains concurrency, rate limiting, lock settings, and stalled job handling.\n */\nexport type WorkerOptions = typeof workerOptions.infer;\n\n/**\n * Queue configuration type.\n * Contains provider selection, default job options, and provider-specific settings.\n */\nexport type QueueConfig = typeof queueConfig.infer;\n","/**\n * @module\n * Caching validation schemas for key-value storage.\n * Supports memory, Redis, Upstash, and Cloudflare KV.\n *\n * @example\n * ```typescript\n * import { cacheSetOptions, cacheConfig, type CacheConfig } from '@parsrun/types';\n *\n * const config: CacheConfig = {\n * provider: 'redis',\n * ttl: 3600,\n * redis: { host: 'localhost', port: 6379 }\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\n\n// ============================================================================\n// Cache Operation Schemas\n// ============================================================================\n\n/** Cache set options */\nexport const cacheSetOptions = type({\n \"ttl?\": \"number > 0\",\n \"tags?\": \"string[]\",\n \"metadata?\": \"object\",\n});\n\n/** Cache get result */\nexport const cacheGetResult = type({\n value: \"unknown\",\n \"ttl?\": \"number\",\n \"createdAt?\": \"number\",\n \"tags?\": \"string[]\",\n});\n\n/** Cache stats */\nexport const cacheStats = type({\n hits: \"number >= 0\",\n misses: \"number >= 0\",\n keys: \"number >= 0\",\n \"memory?\": \"number >= 0\",\n});\n\n// ============================================================================\n// Cache Config Schemas\n// ============================================================================\n\n/** Memory cache config */\nexport const memoryCacheConfig = type({\n \"maxSize?\": \"number > 0\",\n \"ttl?\": \"number > 0\",\n \"checkInterval?\": \"number > 0\",\n \"stale?\": \"boolean\",\n});\n\n/** Redis cache config */\nexport const redisCacheConfig = type({\n \"host?\": \"string\",\n \"port?\": \"number > 0\",\n \"password?\": \"string\",\n \"db?\": \"number >= 0\",\n \"url?\": \"string\",\n \"tls?\": \"boolean | object\",\n \"keyPrefix?\": \"string\",\n \"ttl?\": \"number > 0\",\n});\n\n/** Upstash cache config */\nexport const upstashCacheConfig = type({\n url: \"string >= 1\",\n token: \"string >= 1\",\n \"keyPrefix?\": \"string\",\n \"ttl?\": \"number > 0\",\n});\n\n/** Cloudflare KV config */\nexport const cloudflareKvConfig = type({\n namespaceId: \"string >= 1\",\n \"accountId?\": \"string\",\n \"apiToken?\": \"string\",\n \"keyPrefix?\": \"string\",\n});\n\n/** Multi-tier cache config */\nexport const multiTierCacheConfig = type({\n tiers: type({\n type: \"'memory' | 'redis' | 'upstash' | 'cloudflare-kv'\",\n \"priority?\": \"number\",\n \"ttl?\": \"number > 0\",\n \"config?\": \"object\",\n }).array(),\n \"writeThrough?\": \"boolean\",\n \"readThrough?\": \"boolean\",\n});\n\n/** Cache config */\nexport const cacheConfig = type({\n provider: \"'memory' | 'redis' | 'upstash' | 'cloudflare-kv' | 'multi-tier'\",\n \"ttl?\": \"number > 0\",\n \"keyPrefix?\": \"string\",\n \"memory?\": memoryCacheConfig,\n \"redis?\": redisCacheConfig,\n \"upstash?\": upstashCacheConfig,\n \"cloudflareKv?\": cloudflareKvConfig,\n \"multiTier?\": multiTierCacheConfig,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * Cache set options type.\n * Contains optional TTL, tags for invalidation, and metadata.\n */\nexport type CacheSetOptions = typeof cacheSetOptions.infer;\n\n/**\n * Cache get result type.\n * Contains the cached value, remaining TTL, creation time, and tags.\n */\nexport type CacheGetResult = typeof cacheGetResult.infer;\n\n/**\n * Cache stats type.\n * Contains hit/miss counts, total keys, and optional memory usage.\n */\nexport type CacheStats = typeof cacheStats.infer;\n\n/**\n * Memory cache configuration type.\n * Contains max size, default TTL, cleanup interval, and stale serving options.\n */\nexport type MemoryCacheConfig = typeof memoryCacheConfig.infer;\n\n/**\n * Redis cache configuration type.\n * Contains Redis connection settings, key prefix, and default TTL.\n */\nexport type RedisCacheConfig = typeof redisCacheConfig.infer;\n\n/**\n * Upstash cache configuration type.\n * Contains Upstash URL, token, key prefix, and default TTL.\n */\nexport type UpstashCacheConfig = typeof upstashCacheConfig.infer;\n\n/**\n * Cloudflare KV configuration type.\n * Contains namespace ID, account credentials, and key prefix.\n */\nexport type CloudflareKvConfig = typeof cloudflareKvConfig.infer;\n\n/**\n * Multi-tier cache configuration type.\n * Contains array of cache tiers with priorities and write-through/read-through settings.\n */\nexport type MultiTierCacheConfig = typeof multiTierCacheConfig.infer;\n\n/**\n * Cache configuration type.\n * Contains provider selection and provider-specific configuration.\n */\nexport type CacheConfig = typeof cacheConfig.infer;\n","/**\n * @module\n * Payment provider validation schemas for subscriptions and transactions.\n * Supports Stripe, Paddle, and iyzico providers.\n *\n * @example\n * ```typescript\n * import { subscription, paymentIntent, type Subscription } from '@parsrun/types';\n *\n * const sub: Subscription = {\n * id: '...',\n * customerId: '...',\n * priceId: '...',\n * status: 'active',\n * currentPeriodStart: '2024-01-01T00:00:00Z',\n * currentPeriodEnd: '2024-02-01T00:00:00Z'\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { timestamp, uuid } from \"./common\";\n\n// ============================================================================\n// Currency & Amount Schemas\n// ============================================================================\n\n/** Currency code (ISO 4217) */\nexport const currencyCode = type(\"string >= 3\");\n\n/** Money amount with currency */\nexport const money = type({\n amount: \"number\",\n currency: currencyCode,\n});\n\n// ============================================================================\n// Customer Schemas\n// ============================================================================\n\n/** Payment customer */\nexport const paymentCustomer = type({\n id: uuid,\n \"externalId?\": \"string\",\n email: \"string.email\",\n \"name?\": \"string\",\n \"phone?\": \"string\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create customer request */\nexport const createCustomerRequest = type({\n email: \"string.email\",\n \"name?\": \"string\",\n \"phone?\": \"string\",\n \"metadata?\": \"object\",\n});\n\n// ============================================================================\n// Payment Method Schemas\n// ============================================================================\n\n/** Card details */\nexport const cardDetails = type({\n brand: \"string\",\n last4: \"string\",\n expMonth: \"number >= 1\",\n expYear: \"number >= 2000\",\n \"fingerprint?\": \"string\",\n});\n\n/** Payment method */\nexport const paymentMethod = type({\n id: uuid,\n \"externalId?\": \"string\",\n customerId: uuid,\n type: \"'card' | 'bank_account' | 'paypal' | 'crypto' | 'other'\",\n \"card?\": cardDetails,\n isDefault: \"boolean\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n// ============================================================================\n// Payment Intent Schemas\n// ============================================================================\n\n/** Payment intent status */\nexport const paymentIntentStatus = type(\n \"'created' | 'processing' | 'requires_action' | 'succeeded' | 'failed' | 'canceled'\"\n);\n\n/** Payment intent */\nexport const paymentIntent = type({\n id: uuid,\n \"externalId?\": \"string\",\n customerId: uuid,\n \"paymentMethodId?\": uuid,\n amount: \"number > 0\",\n currency: currencyCode,\n status: paymentIntentStatus,\n \"description?\": \"string\",\n \"metadata?\": \"object\",\n \"clientSecret?\": \"string\",\n \"failureReason?\": \"string\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create payment intent request */\nexport const createPaymentIntentRequest = type({\n customerId: uuid,\n amount: \"number > 0\",\n currency: currencyCode,\n \"paymentMethodId?\": uuid,\n \"description?\": \"string\",\n \"metadata?\": \"object\",\n \"confirm?\": \"boolean\",\n \"returnUrl?\": \"string\",\n});\n\n// ============================================================================\n// Subscription Schemas\n// ============================================================================\n\n/** Subscription status */\nexport const subscriptionStatus = type(\n \"'active' | 'past_due' | 'canceled' | 'incomplete' | 'incomplete_expired' | 'trialing' | 'paused'\"\n);\n\n/** Price interval */\nexport const priceInterval = type(\"'day' | 'week' | 'month' | 'year'\");\n\n/** Price */\nexport const price = type({\n id: uuid,\n \"externalId?\": \"string\",\n productId: uuid,\n amount: \"number >= 0\",\n currency: currencyCode,\n interval: priceInterval,\n \"intervalCount?\": \"number >= 1\",\n \"trialDays?\": \"number >= 0\",\n isActive: \"boolean\",\n \"metadata?\": \"object\",\n});\n\n/** Subscription */\nexport const subscription = type({\n id: uuid,\n \"externalId?\": \"string\",\n customerId: uuid,\n priceId: uuid,\n status: subscriptionStatus,\n currentPeriodStart: timestamp,\n currentPeriodEnd: timestamp,\n \"cancelAt?\": timestamp,\n \"canceledAt?\": timestamp,\n \"trialStart?\": timestamp,\n \"trialEnd?\": timestamp,\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create subscription request */\nexport const createSubscriptionRequest = type({\n customerId: uuid,\n priceId: uuid,\n \"paymentMethodId?\": uuid,\n \"trialDays?\": \"number >= 0\",\n \"metadata?\": \"object\",\n});\n\n// ============================================================================\n// Refund Schemas\n// ============================================================================\n\n/** Refund status */\nexport const refundStatus = type(\"'pending' | 'succeeded' | 'failed' | 'canceled'\");\n\n/** Refund */\nexport const refund = type({\n id: uuid,\n \"externalId?\": \"string\",\n paymentIntentId: uuid,\n amount: \"number > 0\",\n currency: currencyCode,\n status: refundStatus,\n \"reason?\": \"string\",\n \"metadata?\": \"object\",\n insertedAt: timestamp,\n updatedAt: timestamp,\n});\n\n/** Create refund request */\nexport const createRefundRequest = type({\n paymentIntentId: uuid,\n \"amount?\": \"number > 0\",\n \"reason?\": \"string\",\n \"metadata?\": \"object\",\n});\n\n// ============================================================================\n// Webhook Schemas\n// ============================================================================\n\n/** Webhook event types */\nexport const webhookEventType = type(\n \"'payment.succeeded' | 'payment.failed' | 'subscription.created' | 'subscription.updated' | 'subscription.canceled' | 'refund.created' | 'customer.created' | 'customer.updated'\"\n);\n\n/** Webhook event */\nexport const webhookEvent = type({\n id: uuid,\n type: webhookEventType,\n data: \"object\",\n \"livemode?\": \"boolean\",\n \"apiVersion?\": \"string\",\n createdAt: timestamp,\n});\n\n// ============================================================================\n// Provider Config Schemas\n// ============================================================================\n\n/** Stripe config */\nexport const stripeConfig = type({\n secretKey: \"string >= 1\",\n \"publishableKey?\": \"string\",\n \"webhookSecret?\": \"string\",\n \"apiVersion?\": \"string\",\n});\n\n/** Paddle config */\nexport const paddleConfig = type({\n vendorId: \"string >= 1\",\n vendorAuthCode: \"string >= 1\",\n \"publicKey?\": \"string\",\n \"webhookSecret?\": \"string\",\n \"sandbox?\": \"boolean\",\n});\n\n/** iyzico config */\nexport const iyzicoConfig = type({\n apiKey: \"string >= 1\",\n secretKey: \"string >= 1\",\n baseUrl: \"string >= 1\",\n \"sandbox?\": \"boolean\",\n});\n\n/** Payments config */\nexport const paymentsConfig = type({\n provider: \"'stripe' | 'paddle' | 'iyzico'\",\n \"currency?\": currencyCode,\n \"stripe?\": stripeConfig,\n \"paddle?\": paddleConfig,\n \"iyzico?\": iyzicoConfig,\n \"webhookPath?\": \"string\",\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * ISO 4217 currency code type.\n * Represents a 3-letter currency code (e.g., \"USD\", \"EUR\", \"GBP\").\n */\nexport type CurrencyCode = typeof currencyCode.infer;\n\n/**\n * Money type with amount and currency.\n * Represents a monetary value with its currency code.\n */\nexport type Money = typeof money.infer;\n\n/**\n * Payment customer type.\n * Represents a customer in the payment system with email, name, and metadata.\n */\nexport type PaymentCustomer = typeof paymentCustomer.infer;\n\n/**\n * Create customer request type.\n * Contains email, optional name, phone, and metadata for creating customers.\n */\nexport type CreateCustomerRequest = typeof createCustomerRequest.infer;\n\n/**\n * Card details type.\n * Contains card brand, last 4 digits, expiration, and optional fingerprint.\n */\nexport type CardDetails = typeof cardDetails.infer;\n\n/**\n * Payment method type.\n * Represents a stored payment method (card, bank account, etc.) for a customer.\n */\nexport type PaymentMethod = typeof paymentMethod.infer;\n\n/**\n * Payment intent status type.\n * Represents payment lifecycle: 'created' | 'processing' | 'requires_action' | 'succeeded' | 'failed' | 'canceled'.\n */\nexport type PaymentIntentStatus = typeof paymentIntentStatus.infer;\n\n/**\n * Payment intent type.\n * Represents a payment attempt with amount, currency, status, and customer info.\n */\nexport type PaymentIntent = typeof paymentIntent.infer;\n\n/**\n * Create payment intent request type.\n * Contains customer ID, amount, currency, and optional payment method.\n */\nexport type CreatePaymentIntentRequest = typeof createPaymentIntentRequest.infer;\n\n/**\n * Subscription status type.\n * Represents subscription states: 'active' | 'past_due' | 'canceled' | 'incomplete' | 'trialing' | 'paused'.\n */\nexport type SubscriptionStatus = typeof subscriptionStatus.infer;\n\n/**\n * Price interval type.\n * Represents billing frequency: 'day' | 'week' | 'month' | 'year'.\n */\nexport type PriceInterval = typeof priceInterval.infer;\n\n/**\n * Price type.\n * Represents a recurring price with amount, currency, interval, and trial settings.\n */\nexport type Price = typeof price.infer;\n\n/**\n * Subscription type.\n * Represents a recurring subscription with status, billing period, and trial info.\n */\nexport type Subscription = typeof subscription.infer;\n\n/**\n * Create subscription request type.\n * Contains customer ID, price ID, optional payment method, and trial days.\n */\nexport type CreateSubscriptionRequest = typeof createSubscriptionRequest.infer;\n\n/**\n * Refund status type.\n * Represents refund states: 'pending' | 'succeeded' | 'failed' | 'canceled'.\n */\nexport type RefundStatus = typeof refundStatus.infer;\n\n/**\n * Refund type.\n * Represents a refund for a payment with amount, status, and reason.\n */\nexport type Refund = typeof refund.infer;\n\n/**\n * Create refund request type.\n * Contains payment intent ID, optional amount for partial refunds, and reason.\n */\nexport type CreateRefundRequest = typeof createRefundRequest.infer;\n\n/**\n * Webhook event type.\n * Represents payment webhook event types like payment.succeeded, subscription.created, etc.\n */\nexport type WebhookEventType = typeof webhookEventType.infer;\n\n/**\n * Webhook event type.\n * Represents a payment provider webhook event with type, data, and timestamp.\n */\nexport type WebhookEvent = typeof webhookEvent.infer;\n\n/**\n * Stripe configuration type.\n * Contains Stripe API keys and webhook secret.\n */\nexport type StripeConfig = typeof stripeConfig.infer;\n\n/**\n * Paddle configuration type.\n * Contains Paddle vendor credentials and webhook settings.\n */\nexport type PaddleConfig = typeof paddleConfig.infer;\n\n/**\n * iyzico configuration type.\n * Contains iyzico API credentials and base URL.\n */\nexport type IyzicoConfig = typeof iyzicoConfig.infer;\n\n/**\n * Payments configuration type.\n * Contains provider selection and provider-specific configuration.\n */\nexport type PaymentsConfig = typeof paymentsConfig.infer;\n","/**\n * @module\n * HTTP server validation schemas for request/response handling.\n * Includes pagination, CORS, rate limiting, and middleware context types.\n *\n * @example\n * ```typescript\n * import { serverConfig, healthResponse, type ServerConfig } from '@parsrun/types';\n *\n * const config: ServerConfig = {\n * port: 3000,\n * cors: { origin: '*', credentials: true },\n * rateLimit: { windowMs: 60000, max: 100 }\n * };\n * ```\n */\n\nimport { type } from \"arktype\";\nimport { uuid } from \"./common\";\n\n// ============================================================================\n// Request Validation Schemas\n// ============================================================================\n\n/** UUID path parameter */\nexport const uuidParam = type({\n id: uuid,\n});\n\n/** Standard pagination query */\nexport const paginationQuery = type({\n \"page?\": \"string\",\n \"limit?\": \"string\",\n \"orderBy?\": \"string\",\n \"orderDirection?\": \"'asc' | 'desc'\",\n});\n\n/** Cursor pagination query */\nexport const cursorPaginationQuery = type({\n \"cursor?\": \"string\",\n \"limit?\": \"string\",\n \"direction?\": \"'forward' | 'backward'\",\n});\n\n/** Search query */\nexport const searchQuery = type({\n \"q?\": \"string\",\n \"search?\": \"string\",\n \"filter?\": \"string\",\n});\n\n/** Date range query */\nexport const dateRangeQuery = type({\n \"startDate?\": \"string.date.iso\",\n \"endDate?\": \"string.date.iso\",\n});\n\n// ============================================================================\n// Response Schemas\n// ============================================================================\n\n/** Health check response */\nexport const healthResponse = type({\n status: \"'healthy' | 'degraded' | 'unhealthy'\",\n timestamp: \"string\",\n \"version?\": \"string\",\n \"uptime?\": \"number\",\n checks: type({\n name: \"string\",\n status: \"'healthy' | 'degraded' | 'unhealthy'\",\n \"message?\": \"string\",\n \"latency?\": \"number\",\n }).array(),\n});\n\n/** API info response */\nexport const apiInfoResponse = type({\n name: \"string\",\n version: \"string\",\n \"description?\": \"string\",\n \"environment?\": \"string\",\n \"documentation?\": \"string\",\n});\n\n// ============================================================================\n// Server Config Schemas\n// ============================================================================\n\n/** CORS config */\nexport const corsConfig = type({\n \"origin?\": \"string | string[] | boolean | Function\",\n \"methods?\": \"string[]\",\n \"allowedHeaders?\": \"string[]\",\n \"exposedHeaders?\": \"string[]\",\n \"credentials?\": \"boolean\",\n \"maxAge?\": \"number\",\n});\n\n/** Server rate limit config */\nexport const serverRateLimitConfig = type({\n \"enabled?\": \"boolean\",\n \"windowMs?\": \"number > 0\",\n \"max?\": \"number > 0\",\n \"keyGenerator?\": \"Function\",\n \"skip?\": \"Function\",\n \"message?\": \"string\",\n});\n\n/** Logger config */\nexport const loggerConfig = type({\n \"level?\": \"'debug' | 'info' | 'warn' | 'error'\",\n \"format?\": \"'json' | 'pretty' | 'combined' | 'short'\",\n \"redact?\": \"string[]\",\n \"timestamp?\": \"boolean\",\n});\n\n/** Server config */\nexport const serverConfig = type({\n \"port?\": \"number > 0\",\n \"host?\": \"string\",\n \"basePath?\": \"string\",\n \"cors?\": corsConfig,\n \"rateLimit?\": serverRateLimitConfig,\n \"logger?\": loggerConfig,\n \"trustProxy?\": \"boolean\",\n \"strictRouting?\": \"boolean\",\n \"caseSensitiveRouting?\": \"boolean\",\n});\n\n// ============================================================================\n// Middleware Context Schemas\n// ============================================================================\n\n/** Auth context (after auth middleware) */\nexport const authContext = type({\n userId: uuid,\n \"tenantId?\": uuid,\n \"sessionId?\": uuid,\n \"roles?\": \"string[]\",\n \"permissions?\": \"string[]\",\n});\n\n/** Request context */\nexport const requestContext = type({\n requestId: \"string\",\n \"startTime?\": \"number\",\n \"ip?\": \"string\",\n \"userAgent?\": \"string\",\n \"auth?\": authContext,\n});\n\n// ============================================================================\n// Type Exports\n// ============================================================================\n\n/**\n * UUID path parameter type.\n * Contains an 'id' field for extracting UUID parameters from URL paths.\n */\nexport type UuidParam = typeof uuidParam.infer;\n\n/**\n * Pagination query type for URL query parameters.\n * Contains page, limit, orderBy, and orderDirection as strings for parsing.\n */\nexport type PaginationQuery = typeof paginationQuery.infer;\n\n/**\n * Cursor pagination query type for URL query parameters.\n * Contains cursor, limit, and direction as strings for parsing.\n */\nexport type CursorPaginationQuery = typeof cursorPaginationQuery.infer;\n\n/**\n * Search query type for URL query parameters.\n * Contains q, search, and filter fields for search endpoints.\n */\nexport type SearchQuery = typeof searchQuery.infer;\n\n/**\n * Date range query type for URL query parameters.\n * Contains startDate and endDate as ISO 8601 strings.\n */\nexport type DateRangeQuery = typeof dateRangeQuery.infer;\n\n/**\n * Health check response type.\n * Contains overall status, timestamp, version, uptime, and individual check results.\n */\nexport type HealthResponse = typeof healthResponse.infer;\n\n/**\n * API info response type.\n * Contains API name, version, description, environment, and documentation URL.\n */\nexport type ApiInfoResponse = typeof apiInfoResponse.infer;\n\n/**\n * CORS configuration type.\n * Contains origin, methods, headers, credentials, and max age settings.\n */\nexport type CorsConfig = typeof corsConfig.infer;\n\n/**\n * Server rate limit configuration type.\n * Contains window size, max requests, key generator, and skip function.\n */\nexport type ServerRateLimitConfig = typeof serverRateLimitConfig.infer;\n\n/**\n * Logger configuration type.\n * Contains log level, format, fields to redact, and timestamp settings.\n */\nexport type LoggerConfig = typeof loggerConfig.infer;\n\n/**\n * Server configuration type.\n * Contains port, host, base path, CORS, rate limiting, and logging settings.\n */\nexport type ServerConfig = typeof serverConfig.infer;\n\n/**\n * Auth context type (available after auth middleware).\n * Contains user ID, tenant ID, session ID, roles, and permissions.\n */\nexport type AuthContext = typeof authContext.infer;\n\n/**\n * Request context type.\n * Contains request ID, start time, client IP, user agent, and auth context.\n */\nexport type RequestContext = typeof requestContext.infer;\n","/**\n * @module\n * Core types and validation schemas for the Pars framework.\n * Uses ArkType for runtime validation with automatic TypeScript type inference.\n *\n * @example\n * ```typescript\n * import { user, validateWithSchema, safeValidate, type User } from '@parsrun/types';\n *\n * // Runtime validation (throws on error)\n * const userData = validateWithSchema(user, input);\n *\n * // Safe validation (returns result object)\n * const result = safeValidate(user, input);\n * if (result.success) {\n * console.log(result.data);\n * } else {\n * console.error(result.errors);\n * }\n *\n * // Type guard\n * if (isValid(user, input)) {\n * // input is typed as User\n * }\n * ```\n */\n\n// Re-export ArkType for convenience\nexport { type } from \"arktype\";\nexport type { Type } from \"arktype\";\n\n// ============================================================================\n// Common Schemas & Types\n// ============================================================================\nexport * from \"./common\";\n\n// ============================================================================\n// Auth Schemas & Types\n// ============================================================================\nexport * from \"./auth\";\n\n// ============================================================================\n// Tenant Schemas & Types\n// ============================================================================\nexport * from \"./tenant\";\n\n// ============================================================================\n// Email Schemas & Types\n// ============================================================================\nexport * from \"./email\";\n\n// ============================================================================\n// Storage Schemas & Types\n// ============================================================================\nexport * from \"./storage\";\n\n// ============================================================================\n// Queue Schemas & Types\n// ============================================================================\nexport * from \"./queue\";\n\n// ============================================================================\n// Cache Schemas & Types\n// ============================================================================\nexport * from \"./cache\";\n\n// ============================================================================\n// Payments Schemas & Types\n// ============================================================================\nexport * from \"./payments\";\n\n// ============================================================================\n// Server Schemas & Types\n// ============================================================================\nexport * from \"./server\";\n\n// ============================================================================\n// Validation Helpers\n// ============================================================================\n\nimport { type, type Type } from \"arktype\";\n\n/**\n * Validate data against an ArkType schema.\n * Returns the validated data or throws an error.\n *\n * @param schema - The ArkType schema to validate against\n * @param data - The data to validate\n * @returns The validated and typed data\n * @throws Error if validation fails\n *\n * @example\n * ```typescript\n * const userData = validateWithSchema(user, input);\n * ```\n */\nexport function validateWithSchema<T extends Type>(\n schema: T,\n data: unknown\n): T[\"infer\"] {\n const result = schema(data);\n\n if (result instanceof type.errors) {\n const errors = result.map((e) => `${String(e.path)}: ${e.message}`).join(\"\\n\");\n throw new Error(`Validation failed:\\n${errors}`);\n }\n\n return result;\n}\n\n/**\n * Safely validate data against an ArkType schema.\n * Returns a result object instead of throwing.\n *\n * @param schema - The ArkType schema to validate against\n * @param data - The data to validate\n * @returns Object with success status and either data or errors\n *\n * @example\n * ```typescript\n * const result = safeValidate(user, input);\n * if (result.success) {\n * console.log(result.data);\n * } else {\n * console.error(result.errors);\n * }\n * ```\n */\nexport function safeValidate<T extends Type>(\n schema: T,\n data: unknown\n): { success: true; data: T[\"infer\"] } | { success: false; errors: string[] } {\n const result = schema(data);\n\n if (result instanceof type.errors) {\n return {\n success: false,\n errors: result.map((e) => `${String(e.path)}: ${e.message}`),\n };\n }\n\n return {\n success: true,\n data: result,\n };\n}\n\n/**\n * Check if data matches an ArkType schema (type guard).\n *\n * @param schema - The ArkType schema to validate against\n * @param data - The data to check\n * @returns True if data matches schema, with TypeScript type narrowing\n *\n * @example\n * ```typescript\n * if (isValid(user, input)) {\n * // input is typed as User\n * }\n * ```\n */\nexport function isValid<T extends Type>(\n schema: T,\n data: unknown\n): data is T[\"infer\"] {\n const result = schema(data);\n return !(result instanceof type.errors);\n}\n\n/**\n * Format ArkType errors to a user-friendly object.\n *\n * @param errors - The ArkType errors to format\n * @returns Object mapping field paths to error messages\n *\n * @example\n * ```typescript\n * const result = user(input);\n * if (result instanceof type.errors) {\n * const formatted = formatErrors(result);\n * // { email: \"must be a valid email\", ... }\n * }\n * ```\n */\nexport function formatErrors(\n errors: type.errors\n): Record<string, string> {\n const formatted: Record<string, string> = {};\n\n for (const error of errors) {\n const path = String(error.path) || \"root\";\n formatted[path] = error.message;\n }\n\n return formatted;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parsrun/types",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "description": "Core types and validation schemas for Pars framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",