@parsrun/types 0.1.15 → 0.1.16
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.d.ts +187 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,20 @@ import * as arktype_internal_variants_number_ts from 'arktype/internal/variants/
|
|
|
6
6
|
import * as arktype_internal_variants_string_ts from 'arktype/internal/variants/string.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
9
|
+
* @module
|
|
10
|
+
* Common validation schemas shared across all Pars packages.
|
|
11
|
+
* Includes primitive validators, pagination, and response wrappers.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { uuid, email, pagination, successResponse } from '@parsrun/types';
|
|
16
|
+
*
|
|
17
|
+
* // Validate a UUID
|
|
18
|
+
* const id = uuid('550e8400-e29b-41d4-a716-446655440000');
|
|
19
|
+
*
|
|
20
|
+
* // Create paginated response schema
|
|
21
|
+
* const usersResponse = paginatedResponse(user.array());
|
|
22
|
+
* ```
|
|
11
23
|
*/
|
|
12
24
|
/** UUID v4 string validation */
|
|
13
25
|
declare const uuid: arktype_internal_variants_string_ts.StringType<string, {}>;
|
|
@@ -114,27 +126,45 @@ declare const validationErrorDetail: arktype_internal_variants_object_ts.ObjectT
|
|
|
114
126
|
expected?: string;
|
|
115
127
|
received?: unknown;
|
|
116
128
|
}, {}>;
|
|
129
|
+
/** UUID v4 string type */
|
|
117
130
|
type UUID = typeof uuid.infer;
|
|
131
|
+
/** ISO 8601 timestamp string type */
|
|
118
132
|
type Timestamp = typeof timestamp.infer;
|
|
133
|
+
/** Valid email address string type */
|
|
119
134
|
type Email = typeof email.infer;
|
|
135
|
+
/** Valid URL string type */
|
|
120
136
|
type Url = typeof url.infer;
|
|
137
|
+
/** Non-empty string type (length >= 1) */
|
|
121
138
|
type NonEmptyString = typeof nonEmptyString.infer;
|
|
139
|
+
/** Positive integer type (> 0) */
|
|
122
140
|
type PositiveInt = typeof positiveInt.infer;
|
|
141
|
+
/** Non-negative integer type (>= 0) */
|
|
123
142
|
type NonNegativeInt = typeof nonNegativeInt.infer;
|
|
143
|
+
/** Entity status: 'active' | 'inactive' | 'suspended' | 'deleted' */
|
|
124
144
|
type Status = typeof status.infer;
|
|
145
|
+
/** Session status: 'active' | 'expired' | 'revoked' */
|
|
125
146
|
type SessionStatus = typeof sessionStatus.infer;
|
|
147
|
+
/** Pagination request parameters */
|
|
126
148
|
type Pagination = typeof pagination.infer;
|
|
149
|
+
/** Pagination metadata in responses */
|
|
127
150
|
type PaginationMeta = typeof paginationMeta.infer;
|
|
151
|
+
/** Cursor-based pagination request */
|
|
128
152
|
type CursorPagination = typeof cursorPagination.infer;
|
|
153
|
+
/** Cursor-based pagination metadata */
|
|
129
154
|
type CursorPaginationMeta = typeof cursorPaginationMeta.infer;
|
|
155
|
+
/** Standard error response structure */
|
|
130
156
|
type ErrorResponse = typeof errorResponse.infer;
|
|
157
|
+
/** Pars framework error structure */
|
|
131
158
|
type ParsError = typeof parsError.infer;
|
|
159
|
+
/** Validation error detail with path and message */
|
|
132
160
|
type ValidationErrorDetail = typeof validationErrorDetail.infer;
|
|
161
|
+
/** Generic API response wrapper */
|
|
133
162
|
interface ApiResponse<T = unknown> {
|
|
134
163
|
success: boolean;
|
|
135
164
|
data?: T;
|
|
136
165
|
message?: string;
|
|
137
166
|
}
|
|
167
|
+
/** API error response structure */
|
|
138
168
|
interface ApiErrorResponse {
|
|
139
169
|
success: false;
|
|
140
170
|
error: {
|
|
@@ -144,12 +174,14 @@ interface ApiErrorResponse {
|
|
|
144
174
|
};
|
|
145
175
|
message?: string;
|
|
146
176
|
}
|
|
177
|
+
/** Paginated API response with offset-based pagination */
|
|
147
178
|
interface ApiPaginatedResponse<T = unknown> {
|
|
148
179
|
success: boolean;
|
|
149
180
|
data: T[];
|
|
150
181
|
pagination: PaginationMeta;
|
|
151
182
|
message?: string;
|
|
152
183
|
}
|
|
184
|
+
/** Paginated API response with cursor-based pagination */
|
|
153
185
|
interface ApiCursorPaginatedResponse<T = unknown> {
|
|
154
186
|
success: boolean;
|
|
155
187
|
data: T[];
|
|
@@ -158,8 +190,20 @@ interface ApiCursorPaginatedResponse<T = unknown> {
|
|
|
158
190
|
}
|
|
159
191
|
|
|
160
192
|
/**
|
|
161
|
-
* @
|
|
162
|
-
* Authentication and authorization validation schemas
|
|
193
|
+
* @module
|
|
194
|
+
* Authentication and authorization validation schemas.
|
|
195
|
+
* Includes user, session, JWT, RBAC, and OAuth configuration types.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* import { user, session, jwtPayload, type User } from '@parsrun/types';
|
|
200
|
+
*
|
|
201
|
+
* // Validate user data
|
|
202
|
+
* const userData = user(input);
|
|
203
|
+
*
|
|
204
|
+
* // Type-safe user object
|
|
205
|
+
* const currentUser: User = { id: '...', status: 'active', ... };
|
|
206
|
+
* ```
|
|
163
207
|
*/
|
|
164
208
|
/** User entity */
|
|
165
209
|
declare const user: arktype_internal_variants_object_ts.ObjectType<{
|
|
@@ -1011,8 +1055,17 @@ type StorageConfig = typeof storageConfig.infer;
|
|
|
1011
1055
|
type ParsAuthConfig = typeof parsAuthConfig.infer;
|
|
1012
1056
|
|
|
1013
1057
|
/**
|
|
1014
|
-
* @
|
|
1015
|
-
* Multi-tenant
|
|
1058
|
+
* @module
|
|
1059
|
+
* Multi-tenant validation schemas for SaaS applications.
|
|
1060
|
+
* Includes tenant entity, membership, and invitation types.
|
|
1061
|
+
*
|
|
1062
|
+
* @example
|
|
1063
|
+
* ```typescript
|
|
1064
|
+
* import { tenant, createTenantRequest, type Tenant } from '@parsrun/types';
|
|
1065
|
+
*
|
|
1066
|
+
* // Validate tenant creation
|
|
1067
|
+
* const result = createTenantRequest({ name: 'Acme Corp' });
|
|
1068
|
+
* ```
|
|
1016
1069
|
*/
|
|
1017
1070
|
/** Tenant entity */
|
|
1018
1071
|
declare const tenant: arktype_internal_variants_object_ts.ObjectType<{
|
|
@@ -1085,8 +1138,20 @@ type TenantMemberListQuery = typeof tenantMemberListQuery.infer;
|
|
|
1085
1138
|
type SwitchTenantRequest = typeof switchTenantRequest.infer;
|
|
1086
1139
|
|
|
1087
1140
|
/**
|
|
1088
|
-
* @
|
|
1089
|
-
* Email service validation schemas
|
|
1141
|
+
* @module
|
|
1142
|
+
* Email service validation schemas for sending emails.
|
|
1143
|
+
* Includes address, attachment, and provider configuration types.
|
|
1144
|
+
*
|
|
1145
|
+
* @example
|
|
1146
|
+
* ```typescript
|
|
1147
|
+
* import { sendEmailOptions, emailConfig, type SendEmailOptions } from '@parsrun/types';
|
|
1148
|
+
*
|
|
1149
|
+
* const options: SendEmailOptions = {
|
|
1150
|
+
* to: 'user@example.com',
|
|
1151
|
+
* subject: 'Welcome!',
|
|
1152
|
+
* html: '<h1>Hello</h1>'
|
|
1153
|
+
* };
|
|
1154
|
+
* ```
|
|
1090
1155
|
*/
|
|
1091
1156
|
/** Email address with optional name */
|
|
1092
1157
|
declare const emailAddress: arktype_internal_variants_object_ts.ObjectType<{
|
|
@@ -1235,8 +1300,22 @@ type PostmarkConfig = typeof postmarkConfig.infer;
|
|
|
1235
1300
|
type EmailConfig = typeof emailConfig.infer;
|
|
1236
1301
|
|
|
1237
1302
|
/**
|
|
1238
|
-
* @
|
|
1239
|
-
* File storage validation schemas
|
|
1303
|
+
* @module
|
|
1304
|
+
* File storage validation schemas for upload and retrieval.
|
|
1305
|
+
* Supports local, S3, R2, and GCS providers.
|
|
1306
|
+
*
|
|
1307
|
+
* @example
|
|
1308
|
+
* ```typescript
|
|
1309
|
+
* import { uploadOptions, fileMetadata, type FileMetadata } from '@parsrun/types';
|
|
1310
|
+
*
|
|
1311
|
+
* const file: FileMetadata = {
|
|
1312
|
+
* id: '...',
|
|
1313
|
+
* filename: 'document.pdf',
|
|
1314
|
+
* mimeType: 'application/pdf',
|
|
1315
|
+
* size: 1024,
|
|
1316
|
+
* bucket: 'uploads'
|
|
1317
|
+
* };
|
|
1318
|
+
* ```
|
|
1240
1319
|
*/
|
|
1241
1320
|
/** File metadata */
|
|
1242
1321
|
declare const fileMetadata: arktype_internal_variants_object_ts.ObjectType<{
|
|
@@ -1378,8 +1457,20 @@ type GcsStorageConfig = typeof gcsStorageConfig.infer;
|
|
|
1378
1457
|
type StorageProviderConfig = typeof storageProviderConfig.infer;
|
|
1379
1458
|
|
|
1380
1459
|
/**
|
|
1381
|
-
* @
|
|
1382
|
-
* Job queue validation schemas
|
|
1460
|
+
* @module
|
|
1461
|
+
* Job queue validation schemas for background processing.
|
|
1462
|
+
* Supports BullMQ, SQS, RabbitMQ, and in-memory queues.
|
|
1463
|
+
*
|
|
1464
|
+
* @example
|
|
1465
|
+
* ```typescript
|
|
1466
|
+
* import { job, jobOptions, type Job, type JobOptions } from '@parsrun/types';
|
|
1467
|
+
*
|
|
1468
|
+
* const options: JobOptions = {
|
|
1469
|
+
* priority: 1,
|
|
1470
|
+
* attempts: 3,
|
|
1471
|
+
* backoff: { type: 'exponential', delay: 1000 }
|
|
1472
|
+
* };
|
|
1473
|
+
* ```
|
|
1383
1474
|
*/
|
|
1384
1475
|
/** Job status */
|
|
1385
1476
|
declare const jobStatus: arktype_internal_variants_string_ts.StringType<"active" | "pending" | "completed" | "failed" | "delayed" | "paused", {}>;
|
|
@@ -1544,8 +1635,20 @@ type WorkerOptions = typeof workerOptions.infer;
|
|
|
1544
1635
|
type QueueConfig = typeof queueConfig.infer;
|
|
1545
1636
|
|
|
1546
1637
|
/**
|
|
1547
|
-
* @
|
|
1548
|
-
* Caching validation schemas
|
|
1638
|
+
* @module
|
|
1639
|
+
* Caching validation schemas for key-value storage.
|
|
1640
|
+
* Supports memory, Redis, Upstash, and Cloudflare KV.
|
|
1641
|
+
*
|
|
1642
|
+
* @example
|
|
1643
|
+
* ```typescript
|
|
1644
|
+
* import { cacheSetOptions, cacheConfig, type CacheConfig } from '@parsrun/types';
|
|
1645
|
+
*
|
|
1646
|
+
* const config: CacheConfig = {
|
|
1647
|
+
* provider: 'redis',
|
|
1648
|
+
* ttl: 3600,
|
|
1649
|
+
* redis: { host: 'localhost', port: 6379 }
|
|
1650
|
+
* };
|
|
1651
|
+
* ```
|
|
1549
1652
|
*/
|
|
1550
1653
|
/** Cache set options */
|
|
1551
1654
|
declare const cacheSetOptions: arktype_internal_variants_object_ts.ObjectType<{
|
|
@@ -1665,8 +1768,23 @@ type MultiTierCacheConfig = typeof multiTierCacheConfig.infer;
|
|
|
1665
1768
|
type CacheConfig = typeof cacheConfig.infer;
|
|
1666
1769
|
|
|
1667
1770
|
/**
|
|
1668
|
-
* @
|
|
1669
|
-
* Payment provider validation schemas
|
|
1771
|
+
* @module
|
|
1772
|
+
* Payment provider validation schemas for subscriptions and transactions.
|
|
1773
|
+
* Supports Stripe, Paddle, and iyzico providers.
|
|
1774
|
+
*
|
|
1775
|
+
* @example
|
|
1776
|
+
* ```typescript
|
|
1777
|
+
* import { subscription, paymentIntent, type Subscription } from '@parsrun/types';
|
|
1778
|
+
*
|
|
1779
|
+
* const sub: Subscription = {
|
|
1780
|
+
* id: '...',
|
|
1781
|
+
* customerId: '...',
|
|
1782
|
+
* priceId: '...',
|
|
1783
|
+
* status: 'active',
|
|
1784
|
+
* currentPeriodStart: '2024-01-01T00:00:00Z',
|
|
1785
|
+
* currentPeriodEnd: '2024-02-01T00:00:00Z'
|
|
1786
|
+
* };
|
|
1787
|
+
* ```
|
|
1670
1788
|
*/
|
|
1671
1789
|
/** Currency code (ISO 4217) */
|
|
1672
1790
|
declare const currencyCode: arktype_internal_variants_string_ts.StringType<string, {}>;
|
|
@@ -1895,8 +2013,20 @@ type IyzicoConfig = typeof iyzicoConfig.infer;
|
|
|
1895
2013
|
type PaymentsConfig = typeof paymentsConfig.infer;
|
|
1896
2014
|
|
|
1897
2015
|
/**
|
|
1898
|
-
* @
|
|
1899
|
-
* HTTP server validation schemas
|
|
2016
|
+
* @module
|
|
2017
|
+
* HTTP server validation schemas for request/response handling.
|
|
2018
|
+
* Includes pagination, CORS, rate limiting, and middleware context types.
|
|
2019
|
+
*
|
|
2020
|
+
* @example
|
|
2021
|
+
* ```typescript
|
|
2022
|
+
* import { serverConfig, healthResponse, type ServerConfig } from '@parsrun/types';
|
|
2023
|
+
*
|
|
2024
|
+
* const config: ServerConfig = {
|
|
2025
|
+
* port: 3000,
|
|
2026
|
+
* cors: { origin: '*', credentials: true },
|
|
2027
|
+
* rateLimit: { windowMs: 60000, max: 100 }
|
|
2028
|
+
* };
|
|
2029
|
+
* ```
|
|
1900
2030
|
*/
|
|
1901
2031
|
/** UUID path parameter */
|
|
1902
2032
|
declare const uuidParam: arktype_internal_variants_object_ts.ObjectType<{
|
|
@@ -2040,29 +2170,40 @@ type AuthContext = typeof authContext.infer;
|
|
|
2040
2170
|
type RequestContext = typeof requestContext.infer;
|
|
2041
2171
|
|
|
2042
2172
|
/**
|
|
2043
|
-
* @
|
|
2044
|
-
* Core types and validation schemas for Pars framework
|
|
2045
|
-
*
|
|
2046
|
-
* Uses ArkType for runtime validation + type inference
|
|
2173
|
+
* @module
|
|
2174
|
+
* Core types and validation schemas for the Pars framework.
|
|
2175
|
+
* Uses ArkType for runtime validation with automatic TypeScript type inference.
|
|
2047
2176
|
*
|
|
2048
2177
|
* @example
|
|
2049
2178
|
* ```typescript
|
|
2050
|
-
* import { user,
|
|
2179
|
+
* import { user, validateWithSchema, safeValidate, type User } from '@parsrun/types';
|
|
2051
2180
|
*
|
|
2052
|
-
* // Runtime validation
|
|
2053
|
-
* const
|
|
2054
|
-
*
|
|
2055
|
-
*
|
|
2181
|
+
* // Runtime validation (throws on error)
|
|
2182
|
+
* const userData = validateWithSchema(user, input);
|
|
2183
|
+
*
|
|
2184
|
+
* // Safe validation (returns result object)
|
|
2185
|
+
* const result = safeValidate(user, input);
|
|
2186
|
+
* if (result.success) {
|
|
2187
|
+
* console.log(result.data);
|
|
2188
|
+
* } else {
|
|
2189
|
+
* console.error(result.errors);
|
|
2056
2190
|
* }
|
|
2057
2191
|
*
|
|
2058
|
-
* // Type
|
|
2059
|
-
*
|
|
2192
|
+
* // Type guard
|
|
2193
|
+
* if (isValid(user, input)) {
|
|
2194
|
+
* // input is typed as User
|
|
2195
|
+
* }
|
|
2060
2196
|
* ```
|
|
2061
2197
|
*/
|
|
2062
2198
|
|
|
2063
2199
|
/**
|
|
2064
|
-
* Validate data against an ArkType schema
|
|
2065
|
-
* Returns the validated data or throws an error
|
|
2200
|
+
* Validate data against an ArkType schema.
|
|
2201
|
+
* Returns the validated data or throws an error.
|
|
2202
|
+
*
|
|
2203
|
+
* @param schema - The ArkType schema to validate against
|
|
2204
|
+
* @param data - The data to validate
|
|
2205
|
+
* @returns The validated and typed data
|
|
2206
|
+
* @throws Error if validation fails
|
|
2066
2207
|
*
|
|
2067
2208
|
* @example
|
|
2068
2209
|
* ```typescript
|
|
@@ -2071,8 +2212,12 @@ type RequestContext = typeof requestContext.infer;
|
|
|
2071
2212
|
*/
|
|
2072
2213
|
declare function validateWithSchema<T extends Type>(schema: T, data: unknown): T["infer"];
|
|
2073
2214
|
/**
|
|
2074
|
-
* Safely validate data against an ArkType schema
|
|
2075
|
-
* Returns a result object
|
|
2215
|
+
* Safely validate data against an ArkType schema.
|
|
2216
|
+
* Returns a result object instead of throwing.
|
|
2217
|
+
*
|
|
2218
|
+
* @param schema - The ArkType schema to validate against
|
|
2219
|
+
* @param data - The data to validate
|
|
2220
|
+
* @returns Object with success status and either data or errors
|
|
2076
2221
|
*
|
|
2077
2222
|
* @example
|
|
2078
2223
|
* ```typescript
|
|
@@ -2092,7 +2237,11 @@ declare function safeValidate<T extends Type>(schema: T, data: unknown): {
|
|
|
2092
2237
|
errors: string[];
|
|
2093
2238
|
};
|
|
2094
2239
|
/**
|
|
2095
|
-
* Check if data matches an ArkType schema (type guard)
|
|
2240
|
+
* Check if data matches an ArkType schema (type guard).
|
|
2241
|
+
*
|
|
2242
|
+
* @param schema - The ArkType schema to validate against
|
|
2243
|
+
* @param data - The data to check
|
|
2244
|
+
* @returns True if data matches schema, with TypeScript type narrowing
|
|
2096
2245
|
*
|
|
2097
2246
|
* @example
|
|
2098
2247
|
* ```typescript
|
|
@@ -2103,7 +2252,10 @@ declare function safeValidate<T extends Type>(schema: T, data: unknown): {
|
|
|
2103
2252
|
*/
|
|
2104
2253
|
declare function isValid<T extends Type>(schema: T, data: unknown): data is T["infer"];
|
|
2105
2254
|
/**
|
|
2106
|
-
* Format ArkType errors to a user-friendly object
|
|
2255
|
+
* Format ArkType errors to a user-friendly object.
|
|
2256
|
+
*
|
|
2257
|
+
* @param errors - The ArkType errors to format
|
|
2258
|
+
* @returns Object mapping field paths to error messages
|
|
2107
2259
|
*
|
|
2108
2260
|
* @example
|
|
2109
2261
|
* ```typescript
|
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":";;;;AAYO,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,iBAA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AkBA,IAAAA,CAAK,MAAA,CAAA;AAClC;AAcO,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 * @parsrun/types - Common Schemas\n * Shared validation schemas used across all Pars packages\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\nexport type UUID = typeof uuid.infer;\nexport type Timestamp = typeof timestamp.infer;\nexport type Email = typeof email.infer;\nexport type Url = typeof url.infer;\nexport type NonEmptyString = typeof nonEmptyString.infer;\nexport type PositiveInt = typeof positiveInt.infer;\nexport type NonNegativeInt = typeof nonNegativeInt.infer;\n\nexport type Status = typeof status.infer;\nexport type SessionStatus = typeof sessionStatus.infer;\n\nexport type Pagination = typeof pagination.infer;\nexport type PaginationMeta = typeof paginationMeta.infer;\nexport type CursorPagination = typeof cursorPagination.infer;\nexport type CursorPaginationMeta = typeof cursorPaginationMeta.infer;\n\nexport type ErrorResponse = typeof errorResponse.infer;\nexport type ParsError = typeof parsError.infer;\nexport type ValidationErrorDetail = typeof validationErrorDetail.infer;\n\n// ============================================================================\n// API Response Interfaces (for TypeScript convenience)\n// ============================================================================\n\nexport interface ApiResponse<T = unknown> {\n success: boolean;\n data?: T;\n message?: string;\n}\n\nexport interface ApiErrorResponse {\n success: false;\n error: {\n code: string;\n message: string;\n details?: unknown;\n };\n message?: string;\n}\n\nexport interface ApiPaginatedResponse<T = unknown> {\n success: boolean;\n data: T[];\n pagination: PaginationMeta;\n message?: string;\n}\n\nexport interface ApiCursorPaginatedResponse<T = unknown> {\n success: boolean;\n data: T[];\n pagination: CursorPaginationMeta;\n message?: string;\n}\n","/**\n * @parsrun/types - Auth Schemas\n * Authentication and authorization validation schemas\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 * @parsrun/types - Tenant Schemas\n * Multi-tenant related validation schemas\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 * @parsrun/types - Email Schemas\n * Email service validation schemas\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 * @parsrun/types - Storage Schemas\n * File storage validation schemas\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 * @parsrun/types - Queue Schemas\n * Job queue validation schemas\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 * @parsrun/types - Cache Schemas\n * Caching validation schemas\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 * @parsrun/types - Payments Schemas\n * Payment provider validation schemas\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 * @parsrun/types - Server Schemas\n * HTTP server validation schemas\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 * @parsrun/types\n * Core types and validation schemas for Pars framework\n *\n * Uses ArkType for runtime validation + type inference\n *\n * @example\n * ```typescript\n * import { user, User, validateWithSchema } from '@parsrun/types';\n *\n * // Runtime validation\n * const result = user(data);\n * if (result instanceof type.errors) {\n * console.error(result.summary);\n * }\n *\n * // Type inference\n * const userData: User = result;\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 * @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 with success/error\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 * @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 * @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,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,EACf,aAAA,EAAe,QAAA;AAAA,EACf,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAC;AAOM,IAAM,eAAA,GAAkB,CAAI,UAAA,KACjC,IAAA,CAAK;AAAA,EACH,OAAA,EAAS,QAAA;AAAA,EACT,I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AAA;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"]}
|