@parsrun/types 0.1.0

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.
@@ -0,0 +1,2119 @@
1
+ import * as arktype from 'arktype';
2
+ import { Type, type } from 'arktype';
3
+ export { Type, type } from 'arktype';
4
+ import * as arktype_internal_variants_object_ts from 'arktype/internal/variants/object.ts';
5
+ import * as arktype_internal_variants_number_ts from 'arktype/internal/variants/number.ts';
6
+ import * as arktype_internal_variants_string_ts from 'arktype/internal/variants/string.ts';
7
+
8
+ /**
9
+ * @parsrun/types - Common Schemas
10
+ * Shared validation schemas used across all Pars packages
11
+ */
12
+ /** UUID v4 string validation */
13
+ declare const uuid: arktype_internal_variants_string_ts.StringType<string, {}>;
14
+ /** ISO 8601 timestamp string */
15
+ declare const timestamp: arktype_internal_variants_string_ts.StringType<string, {}>;
16
+ /** Email address validation */
17
+ declare const email: arktype_internal_variants_string_ts.StringType<string, {}>;
18
+ /** URL validation */
19
+ declare const url: arktype_internal_variants_string_ts.StringType<string, {}>;
20
+ /** Non-empty string */
21
+ declare const nonEmptyString: arktype_internal_variants_string_ts.StringType<string, {}>;
22
+ /** Positive integer */
23
+ declare const positiveInt: arktype_internal_variants_number_ts.NumberType<number, {}>;
24
+ /** Non-negative integer */
25
+ declare const nonNegativeInt: arktype_internal_variants_number_ts.NumberType<number, {}>;
26
+ /** Common entity status */
27
+ declare const status: arktype_internal_variants_string_ts.StringType<"active" | "inactive" | "suspended" | "deleted", {}>;
28
+ /** Session status */
29
+ declare const sessionStatus: arktype_internal_variants_string_ts.StringType<"active" | "expired" | "revoked", {}>;
30
+ /** Pagination request parameters */
31
+ declare const pagination: arktype_internal_variants_object_ts.ObjectType<{
32
+ page: number;
33
+ limit: number;
34
+ orderBy?: string;
35
+ orderDirection?: "asc" | "desc";
36
+ }, {}>;
37
+ /** Pagination metadata in responses */
38
+ declare const paginationMeta: arktype_internal_variants_object_ts.ObjectType<{
39
+ page: number;
40
+ limit: number;
41
+ total: number;
42
+ totalPages: number;
43
+ hasNext: boolean;
44
+ hasPrev: boolean;
45
+ }, {}>;
46
+ /** Cursor-based pagination */
47
+ declare const cursorPagination: arktype_internal_variants_object_ts.ObjectType<{
48
+ limit: number;
49
+ cursor?: string;
50
+ direction?: "forward" | "backward";
51
+ }, {}>;
52
+ /** Cursor pagination metadata */
53
+ declare const cursorPaginationMeta: arktype_internal_variants_object_ts.ObjectType<{
54
+ hasMore: boolean;
55
+ limit: number;
56
+ cursor?: string;
57
+ nextCursor?: string;
58
+ prevCursor?: string;
59
+ }, {}>;
60
+ /** Success response wrapper */
61
+ declare const successResponse: <T>(dataSchema: T) => arktype_internal_variants_object_ts.ObjectType<{
62
+ success: "true";
63
+ data: never;
64
+ message?: string;
65
+ }, {}>;
66
+ /** Error response */
67
+ declare const errorResponse: arktype_internal_variants_object_ts.ObjectType<{
68
+ success: "false";
69
+ error: {
70
+ code: string;
71
+ message: string;
72
+ details?: unknown;
73
+ };
74
+ message?: string;
75
+ }, {}>;
76
+ /** Paginated response wrapper */
77
+ declare const paginatedResponse: <T>(dataSchema: T) => arktype_internal_variants_object_ts.ObjectType<{
78
+ success: boolean;
79
+ data: never;
80
+ pagination: {
81
+ page: number;
82
+ limit: number;
83
+ total: number;
84
+ totalPages: number;
85
+ hasNext: boolean;
86
+ hasPrev: boolean;
87
+ };
88
+ message?: string;
89
+ }, {}>;
90
+ /** Cursor paginated response wrapper */
91
+ declare const cursorPaginatedResponse: <T>(dataSchema: T) => arktype_internal_variants_object_ts.ObjectType<{
92
+ success: boolean;
93
+ data: never;
94
+ pagination: {
95
+ hasMore: boolean;
96
+ limit: number;
97
+ cursor?: string;
98
+ nextCursor?: string;
99
+ prevCursor?: string;
100
+ };
101
+ message?: string;
102
+ }, {}>;
103
+ /** Pars framework error */
104
+ declare const parsError: arktype_internal_variants_object_ts.ObjectType<{
105
+ message: string;
106
+ statusCode: number;
107
+ code?: string;
108
+ details?: unknown;
109
+ }, {}>;
110
+ /** Validation error details */
111
+ declare const validationErrorDetail: arktype_internal_variants_object_ts.ObjectType<{
112
+ path: string;
113
+ message: string;
114
+ expected?: string;
115
+ received?: unknown;
116
+ }, {}>;
117
+ type UUID = typeof uuid.infer;
118
+ type Timestamp = typeof timestamp.infer;
119
+ type Email = typeof email.infer;
120
+ type Url = typeof url.infer;
121
+ type NonEmptyString = typeof nonEmptyString.infer;
122
+ type PositiveInt = typeof positiveInt.infer;
123
+ type NonNegativeInt = typeof nonNegativeInt.infer;
124
+ type Status = typeof status.infer;
125
+ type SessionStatus = typeof sessionStatus.infer;
126
+ type Pagination = typeof pagination.infer;
127
+ type PaginationMeta = typeof paginationMeta.infer;
128
+ type CursorPagination = typeof cursorPagination.infer;
129
+ type CursorPaginationMeta = typeof cursorPaginationMeta.infer;
130
+ type ErrorResponse = typeof errorResponse.infer;
131
+ type ParsError = typeof parsError.infer;
132
+ type ValidationErrorDetail = typeof validationErrorDetail.infer;
133
+ interface ApiResponse<T = unknown> {
134
+ success: boolean;
135
+ data?: T;
136
+ message?: string;
137
+ }
138
+ interface ApiErrorResponse {
139
+ success: false;
140
+ error: {
141
+ code: string;
142
+ message: string;
143
+ details?: unknown;
144
+ };
145
+ message?: string;
146
+ }
147
+ interface ApiPaginatedResponse<T = unknown> {
148
+ success: boolean;
149
+ data: T[];
150
+ pagination: PaginationMeta;
151
+ message?: string;
152
+ }
153
+ interface ApiCursorPaginatedResponse<T = unknown> {
154
+ success: boolean;
155
+ data: T[];
156
+ pagination: CursorPaginationMeta;
157
+ message?: string;
158
+ }
159
+
160
+ /**
161
+ * @parsrun/types - Auth Schemas
162
+ * Authentication and authorization validation schemas
163
+ */
164
+ /** User entity */
165
+ declare const user: arktype_internal_variants_object_ts.ObjectType<{
166
+ id: string;
167
+ twoFactorEnabled: boolean;
168
+ status: "active" | "inactive" | "suspended" | "deleted";
169
+ insertedAt: string;
170
+ updatedAt: string;
171
+ displayName?: string;
172
+ twoFactorSecret?: string;
173
+ deletedAt?: string;
174
+ }, {}>;
175
+ /** Auth method (email, phone, OAuth providers) */
176
+ declare const authMethod: arktype_internal_variants_object_ts.ObjectType<{
177
+ id: string;
178
+ userId: string;
179
+ provider: "email" | "phone" | "google" | "github" | "microsoft" | "apple";
180
+ providerId: string;
181
+ verified: boolean;
182
+ insertedAt: string;
183
+ updatedAt: string;
184
+ metadata?: object;
185
+ deletedAt?: string;
186
+ }, {}>;
187
+ /** Session entity */
188
+ declare const session: arktype_internal_variants_object_ts.ObjectType<{
189
+ id: string;
190
+ userId: string;
191
+ csrfTokenHash: string;
192
+ expiresAt: string;
193
+ status: "active" | "expired" | "revoked";
194
+ lastActivityAt: string;
195
+ insertedAt: string;
196
+ updatedAt: string;
197
+ authMethodId?: string;
198
+ currentTenantId?: string;
199
+ refreshTokenHash?: string;
200
+ refreshExpiresAt?: string;
201
+ deviceType?: "mobile" | "desktop" | "tablet" | "api";
202
+ deviceName?: string;
203
+ userAgent?: string;
204
+ ipAddress?: string;
205
+ locationData?: object;
206
+ deviceFingerprint?: string;
207
+ revokedAt?: string;
208
+ revokedReason?: "user_logout" | "admin_revoke" | "security_breach" | "suspicious_activity";
209
+ deletedAt?: string;
210
+ }, {}>;
211
+ /** Tenant membership */
212
+ declare const tenantMembership: arktype_internal_variants_object_ts.ObjectType<{
213
+ id: string;
214
+ userId: string;
215
+ tenantId: string;
216
+ roleId: string;
217
+ status: "active" | "inactive" | "suspended" | "invited";
218
+ permissions: object;
219
+ accessLevel: "full" | "limited" | "read_only";
220
+ resourceRestrictions: object;
221
+ insertedAt: string;
222
+ updatedAt: string;
223
+ ipRestrictions?: object;
224
+ timeRestrictions?: object;
225
+ expiresAt?: string;
226
+ invitedBy?: string;
227
+ invitedAt?: string;
228
+ joinedAt?: string;
229
+ lastLoginAt?: string;
230
+ deletedAt?: string;
231
+ }, {}>;
232
+ /** Request OTP (email/phone) */
233
+ declare const requestOTPRequest: arktype_internal_variants_object_ts.ObjectType<{
234
+ email?: string;
235
+ phone?: string;
236
+ tenantId?: string;
237
+ }, {}>;
238
+ /** OTP request response */
239
+ declare const requestOTPResponse: arktype_internal_variants_object_ts.ObjectType<{
240
+ success: boolean;
241
+ message: string;
242
+ expiresAt?: string;
243
+ requiresTenantSelection?: boolean;
244
+ isNewUser?: boolean;
245
+ defaultTenantId?: string;
246
+ defaultTenantName?: string;
247
+ selectedTenantId?: string;
248
+ selectedTenantName?: string;
249
+ tenants?: {
250
+ id: string;
251
+ name: string;
252
+ role: string;
253
+ }[];
254
+ }, {}>;
255
+ /** Verify OTP */
256
+ declare const verifyOTPRequest: arktype_internal_variants_object_ts.ObjectType<{
257
+ code: string;
258
+ email?: string;
259
+ phone?: string;
260
+ tenantId?: string;
261
+ }, {}>;
262
+ /** Resend OTP */
263
+ declare const resendOTPRequest: arktype_internal_variants_object_ts.ObjectType<{
264
+ email?: string;
265
+ phone?: string;
266
+ }, {}>;
267
+ /** Login response data */
268
+ declare const loginResponseData: arktype_internal_variants_object_ts.ObjectType<{
269
+ user: {
270
+ id: string;
271
+ twoFactorEnabled: boolean;
272
+ status: "active" | "inactive" | "suspended" | "deleted";
273
+ insertedAt: string;
274
+ updatedAt: string;
275
+ displayName?: string;
276
+ twoFactorSecret?: string;
277
+ deletedAt?: string;
278
+ };
279
+ session: {
280
+ accessToken: string;
281
+ expiresAt: string;
282
+ csrfToken: string;
283
+ };
284
+ authMethod: {
285
+ id: string;
286
+ provider: "email" | "phone" | "google" | "github" | "microsoft" | "apple";
287
+ providerId: string;
288
+ verified: boolean;
289
+ metadata?: object;
290
+ };
291
+ isNewUser: boolean;
292
+ refreshToken?: string;
293
+ tenantMemberships?: {
294
+ id: string;
295
+ userId: string;
296
+ tenantId: string;
297
+ roleId: string;
298
+ status: "active" | "inactive" | "suspended" | "invited";
299
+ permissions: object;
300
+ accessLevel: "full" | "limited" | "read_only";
301
+ resourceRestrictions: object;
302
+ insertedAt: string;
303
+ updatedAt: string;
304
+ ipRestrictions?: object;
305
+ timeRestrictions?: object;
306
+ expiresAt?: string;
307
+ invitedBy?: string;
308
+ invitedAt?: string;
309
+ joinedAt?: string;
310
+ lastLoginAt?: string;
311
+ deletedAt?: string;
312
+ }[];
313
+ }, {}>;
314
+ /** Login response */
315
+ declare const loginResponse: arktype_internal_variants_object_ts.ObjectType<{
316
+ success: boolean;
317
+ data: {
318
+ user: {
319
+ id: string;
320
+ twoFactorEnabled: boolean;
321
+ status: "active" | "inactive" | "suspended" | "deleted";
322
+ insertedAt: string;
323
+ updatedAt: string;
324
+ displayName?: string;
325
+ twoFactorSecret?: string;
326
+ deletedAt?: string;
327
+ };
328
+ session: {
329
+ accessToken: string;
330
+ expiresAt: string;
331
+ csrfToken: string;
332
+ };
333
+ authMethod: {
334
+ id: string;
335
+ provider: "email" | "phone" | "google" | "github" | "microsoft" | "apple";
336
+ providerId: string;
337
+ verified: boolean;
338
+ metadata?: object;
339
+ };
340
+ isNewUser: boolean;
341
+ refreshToken?: string;
342
+ tenantMemberships?: {
343
+ id: string;
344
+ userId: string;
345
+ tenantId: string;
346
+ roleId: string;
347
+ status: "active" | "inactive" | "suspended" | "invited";
348
+ permissions: object;
349
+ accessLevel: "full" | "limited" | "read_only";
350
+ resourceRestrictions: object;
351
+ insertedAt: string;
352
+ updatedAt: string;
353
+ ipRestrictions?: object;
354
+ timeRestrictions?: object;
355
+ expiresAt?: string;
356
+ invitedBy?: string;
357
+ invitedAt?: string;
358
+ joinedAt?: string;
359
+ lastLoginAt?: string;
360
+ deletedAt?: string;
361
+ }[];
362
+ };
363
+ message?: string;
364
+ }, {}>;
365
+ /** Current user response data */
366
+ declare const currentUserResponseData: arktype_internal_variants_object_ts.ObjectType<{
367
+ user: {
368
+ id: string;
369
+ twoFactorEnabled: boolean;
370
+ status: "active" | "inactive" | "suspended" | "deleted";
371
+ insertedAt: string;
372
+ updatedAt: string;
373
+ displayName?: string;
374
+ twoFactorSecret?: string;
375
+ deletedAt?: string;
376
+ };
377
+ tenantMemberships: {
378
+ id: string;
379
+ userId: string;
380
+ tenantId: string;
381
+ roleId: string;
382
+ status: "active" | "inactive" | "suspended" | "invited";
383
+ permissions: object;
384
+ accessLevel: "full" | "limited" | "read_only";
385
+ resourceRestrictions: object;
386
+ insertedAt: string;
387
+ updatedAt: string;
388
+ ipRestrictions?: object;
389
+ timeRestrictions?: object;
390
+ expiresAt?: string;
391
+ invitedBy?: string;
392
+ invitedAt?: string;
393
+ joinedAt?: string;
394
+ lastLoginAt?: string;
395
+ deletedAt?: string;
396
+ }[];
397
+ roles: {
398
+ id: string;
399
+ name: string;
400
+ description?: string;
401
+ }[];
402
+ permissions: string[];
403
+ currentTenant: string;
404
+ authMethod?: {
405
+ id: string;
406
+ provider: "email" | "phone" | "google" | "github" | "microsoft" | "apple";
407
+ providerId: string;
408
+ verified: boolean;
409
+ metadata?: object;
410
+ };
411
+ }, {}>;
412
+ /** Current user response */
413
+ declare const currentUserResponse: arktype_internal_variants_object_ts.ObjectType<{
414
+ success: boolean;
415
+ data: {
416
+ user: {
417
+ id: string;
418
+ twoFactorEnabled: boolean;
419
+ status: "active" | "inactive" | "suspended" | "deleted";
420
+ insertedAt: string;
421
+ updatedAt: string;
422
+ displayName?: string;
423
+ twoFactorSecret?: string;
424
+ deletedAt?: string;
425
+ };
426
+ tenantMemberships: {
427
+ id: string;
428
+ userId: string;
429
+ tenantId: string;
430
+ roleId: string;
431
+ status: "active" | "inactive" | "suspended" | "invited";
432
+ permissions: object;
433
+ accessLevel: "full" | "limited" | "read_only";
434
+ resourceRestrictions: object;
435
+ insertedAt: string;
436
+ updatedAt: string;
437
+ ipRestrictions?: object;
438
+ timeRestrictions?: object;
439
+ expiresAt?: string;
440
+ invitedBy?: string;
441
+ invitedAt?: string;
442
+ joinedAt?: string;
443
+ lastLoginAt?: string;
444
+ deletedAt?: string;
445
+ }[];
446
+ roles: {
447
+ id: string;
448
+ name: string;
449
+ description?: string;
450
+ }[];
451
+ permissions: string[];
452
+ currentTenant: string;
453
+ authMethod?: {
454
+ id: string;
455
+ provider: "email" | "phone" | "google" | "github" | "microsoft" | "apple";
456
+ providerId: string;
457
+ verified: boolean;
458
+ metadata?: object;
459
+ };
460
+ };
461
+ message?: string;
462
+ }, {}>;
463
+ /** Refresh token request */
464
+ declare const refreshTokenRequest: arktype_internal_variants_object_ts.ObjectType<{
465
+ refreshToken: string;
466
+ }, {}>;
467
+ /** Token info (for client storage) */
468
+ declare const tokenInfo: arktype_internal_variants_object_ts.ObjectType<{
469
+ accessToken: string;
470
+ expiresAt: Date;
471
+ csrfToken: string;
472
+ refreshToken?: string;
473
+ tenantId?: string;
474
+ }, {}>;
475
+ /** JWT payload */
476
+ declare const jwtPayload: arktype_internal_variants_object_ts.ObjectType<{
477
+ sub: string;
478
+ tenantId: string;
479
+ iat: number;
480
+ exp: number;
481
+ sessionId?: string;
482
+ roles?: string[];
483
+ permissions?: string[];
484
+ aud?: string;
485
+ iss?: string;
486
+ }, {}>;
487
+ /** Permission entity */
488
+ declare const permission: arktype_internal_variants_object_ts.ObjectType<{
489
+ id: string;
490
+ name: string;
491
+ resource: string;
492
+ action: "delete" | "read" | "create" | "update" | "list" | "manage";
493
+ scope: "global" | "own" | "tenant";
494
+ isSystem: boolean;
495
+ insertedAt: string;
496
+ updatedAt: string;
497
+ description?: string;
498
+ }, {}>;
499
+ /** Role entity */
500
+ declare const role: arktype_internal_variants_object_ts.ObjectType<{
501
+ id: string;
502
+ tenantId: string;
503
+ name: string;
504
+ isSystem: boolean;
505
+ isActive: boolean;
506
+ insertedAt: string;
507
+ updatedAt: string;
508
+ description?: string;
509
+ color?: string;
510
+ deletedAt?: string;
511
+ }, {}>;
512
+ /** Permission check request */
513
+ declare const permissionCheck: arktype_internal_variants_object_ts.ObjectType<{
514
+ resource: string;
515
+ action: string;
516
+ scope?: "global" | "own" | "tenant";
517
+ resourceId?: string;
518
+ }, {}>;
519
+ /** Logout request */
520
+ declare const logoutRequest: arktype_internal_variants_object_ts.ObjectType<{
521
+ allDevices: boolean;
522
+ refreshToken?: string;
523
+ }, {}>;
524
+ /** Revoke session request */
525
+ declare const revokeSessionRequest: arktype_internal_variants_object_ts.ObjectType<{
526
+ reason?: "user_logout" | "admin_revoke" | "security_breach" | "suspicious_activity";
527
+ }, {}>;
528
+ /** Revoke all sessions request */
529
+ declare const revokeAllSessionsRequest: arktype_internal_variants_object_ts.ObjectType<{
530
+ reason?: "user_logout" | "admin_revoke" | "security_breach" | "suspicious_activity";
531
+ excludeCurrent?: boolean;
532
+ }, {}>;
533
+ /** Revoke all sessions response */
534
+ declare const revokeAllSessionsResponse: arktype_internal_variants_object_ts.ObjectType<{
535
+ success: boolean;
536
+ message: string;
537
+ revokedCount: number;
538
+ }, {}>;
539
+ /** Send verification email request */
540
+ declare const sendVerificationEmailRequest: arktype_internal_variants_object_ts.ObjectType<{
541
+ email: string;
542
+ }, {}>;
543
+ /** Verify email request */
544
+ declare const verifyEmailRequest: arktype_internal_variants_object_ts.ObjectType<{
545
+ token: string;
546
+ }, {}>;
547
+ /** Check verification status */
548
+ declare const checkVerificationStatusRequest: arktype_internal_variants_object_ts.ObjectType<{
549
+ email: string;
550
+ }, {}>;
551
+ declare const checkVerificationStatusResponse: arktype_internal_variants_object_ts.ObjectType<{
552
+ success: boolean;
553
+ verified: boolean;
554
+ message: string;
555
+ sentAt?: string;
556
+ expiresAt?: string;
557
+ }, {}>;
558
+ /** CSRF token validation */
559
+ declare const csrfTokenRequest: arktype_internal_variants_object_ts.ObjectType<{
560
+ csrfToken: string;
561
+ }, {}>;
562
+ /** Session config */
563
+ declare const sessionConfig: arktype_internal_variants_object_ts.ObjectType<{
564
+ accessTokenExpiry?: number;
565
+ refreshTokenExpiry?: number;
566
+ slidingWindow?: boolean;
567
+ maxSessions?: number;
568
+ invalidateOnPasswordChange?: boolean;
569
+ }, {}>;
570
+ /** JWT config */
571
+ declare const jwtConfig: arktype_internal_variants_object_ts.ObjectType<{
572
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512";
573
+ issuer?: string;
574
+ audience?: string | string[];
575
+ }, {}>;
576
+ /** Cookie config */
577
+ declare const cookieConfig: arktype_internal_variants_object_ts.ObjectType<{
578
+ prefix?: string;
579
+ domain?: string;
580
+ path?: string;
581
+ secure?: boolean;
582
+ sameSite?: "strict" | "lax" | "none";
583
+ httpOnly?: boolean;
584
+ }, {}>;
585
+ /** CSRF config */
586
+ declare const csrfConfig: arktype_internal_variants_object_ts.ObjectType<{
587
+ enabled?: boolean;
588
+ headerName?: string;
589
+ cookieName?: string;
590
+ }, {}>;
591
+ /** Rate limit config */
592
+ declare const rateLimitConfig: arktype_internal_variants_object_ts.ObjectType<{
593
+ enabled?: boolean;
594
+ loginAttempts?: number;
595
+ windowSize?: number;
596
+ }, {}>;
597
+ /** Lockout config */
598
+ declare const lockoutConfig: arktype_internal_variants_object_ts.ObjectType<{
599
+ enabled?: boolean;
600
+ maxAttempts?: number;
601
+ duration?: number;
602
+ }, {}>;
603
+ /** Security config */
604
+ declare const securityConfig: arktype_internal_variants_object_ts.ObjectType<{
605
+ rateLimit?: {
606
+ enabled?: boolean;
607
+ loginAttempts?: number;
608
+ windowSize?: number;
609
+ };
610
+ lockout?: {
611
+ enabled?: boolean;
612
+ maxAttempts?: number;
613
+ duration?: number;
614
+ };
615
+ csrf?: {
616
+ enabled?: boolean;
617
+ headerName?: string;
618
+ cookieName?: string;
619
+ };
620
+ }, {}>;
621
+ /** Tenant config */
622
+ declare const tenantConfig: arktype_internal_variants_object_ts.ObjectType<{
623
+ enabled?: boolean;
624
+ strategy?: "path" | "subdomain" | "header" | "query" | "custom";
625
+ headerName?: string;
626
+ resolver?: Function;
627
+ }, {}>;
628
+ /** OAuth provider config */
629
+ declare const oauthProviderConfig: arktype_internal_variants_object_ts.ObjectType<{
630
+ clientId: string;
631
+ clientSecret: string;
632
+ enabled?: boolean;
633
+ scopes?: string[];
634
+ callbackUrl?: string;
635
+ }, {}>;
636
+ /** OTP email config */
637
+ declare const otpEmailConfig: arktype_internal_variants_object_ts.ObjectType<{
638
+ send: Function;
639
+ enabled?: boolean;
640
+ expiresIn?: number;
641
+ length?: number;
642
+ maxAttempts?: number;
643
+ rateLimit?: number;
644
+ rateLimitWindow?: number;
645
+ }, {}>;
646
+ /** OTP SMS config */
647
+ declare const otpSmsConfig: arktype_internal_variants_object_ts.ObjectType<{
648
+ send: Function;
649
+ enabled?: boolean;
650
+ expiresIn?: number;
651
+ length?: number;
652
+ maxAttempts?: number;
653
+ rateLimit?: number;
654
+ rateLimitWindow?: number;
655
+ }, {}>;
656
+ /** OTP config */
657
+ declare const otpConfig: arktype_internal_variants_object_ts.ObjectType<{
658
+ enabled?: boolean;
659
+ email?: {
660
+ send: Function;
661
+ enabled?: boolean;
662
+ expiresIn?: number;
663
+ length?: number;
664
+ maxAttempts?: number;
665
+ rateLimit?: number;
666
+ rateLimitWindow?: number;
667
+ };
668
+ sms?: {
669
+ send: Function;
670
+ enabled?: boolean;
671
+ expiresIn?: number;
672
+ length?: number;
673
+ maxAttempts?: number;
674
+ rateLimit?: number;
675
+ rateLimitWindow?: number;
676
+ };
677
+ }, {}>;
678
+ /** Magic link config */
679
+ declare const magicLinkConfig: arktype_internal_variants_object_ts.ObjectType<{
680
+ send: Function;
681
+ enabled?: boolean;
682
+ expiresIn?: number;
683
+ }, {}>;
684
+ /** TOTP config */
685
+ declare const totpConfig: arktype_internal_variants_object_ts.ObjectType<{
686
+ enabled?: boolean;
687
+ issuer?: string;
688
+ backupCodesCount?: number;
689
+ }, {}>;
690
+ /** WebAuthn config */
691
+ declare const webauthnConfig: arktype_internal_variants_object_ts.ObjectType<{
692
+ rpName: string;
693
+ rpId: string;
694
+ enabled?: boolean;
695
+ origins?: string[];
696
+ }, {}>;
697
+ /** Password config */
698
+ declare const passwordConfig: arktype_internal_variants_object_ts.ObjectType<{
699
+ enabled?: boolean;
700
+ minLength?: number;
701
+ requireUppercase?: boolean;
702
+ requireLowercase?: boolean;
703
+ requireNumbers?: boolean;
704
+ requireSymbols?: boolean;
705
+ checkCommonPasswords?: boolean;
706
+ }, {}>;
707
+ /** OAuth providers config */
708
+ declare const oauthProvidersConfig: arktype_internal_variants_object_ts.ObjectType<{
709
+ google?: {
710
+ clientId: string;
711
+ clientSecret: string;
712
+ enabled?: boolean;
713
+ scopes?: string[];
714
+ callbackUrl?: string;
715
+ };
716
+ github?: {
717
+ clientId: string;
718
+ clientSecret: string;
719
+ enabled?: boolean;
720
+ scopes?: string[];
721
+ callbackUrl?: string;
722
+ };
723
+ microsoft?: {
724
+ clientId: string;
725
+ clientSecret: string;
726
+ enabled?: boolean;
727
+ scopes?: string[];
728
+ callbackUrl?: string;
729
+ };
730
+ apple?: {
731
+ clientId: string;
732
+ clientSecret: string;
733
+ enabled?: boolean;
734
+ scopes?: string[];
735
+ callbackUrl?: string;
736
+ };
737
+ custom?: Record<string, unknown>;
738
+ }, {}>;
739
+ /** Providers config */
740
+ declare const providersConfig: arktype_internal_variants_object_ts.ObjectType<{
741
+ otp?: {
742
+ enabled?: boolean;
743
+ email?: {
744
+ send: Function;
745
+ enabled?: boolean;
746
+ expiresIn?: number;
747
+ length?: number;
748
+ maxAttempts?: number;
749
+ rateLimit?: number;
750
+ rateLimitWindow?: number;
751
+ };
752
+ sms?: {
753
+ send: Function;
754
+ enabled?: boolean;
755
+ expiresIn?: number;
756
+ length?: number;
757
+ maxAttempts?: number;
758
+ rateLimit?: number;
759
+ rateLimitWindow?: number;
760
+ };
761
+ };
762
+ magicLink?: {
763
+ send: Function;
764
+ enabled?: boolean;
765
+ expiresIn?: number;
766
+ };
767
+ oauth?: {
768
+ google?: {
769
+ clientId: string;
770
+ clientSecret: string;
771
+ enabled?: boolean;
772
+ scopes?: string[];
773
+ callbackUrl?: string;
774
+ };
775
+ github?: {
776
+ clientId: string;
777
+ clientSecret: string;
778
+ enabled?: boolean;
779
+ scopes?: string[];
780
+ callbackUrl?: string;
781
+ };
782
+ microsoft?: {
783
+ clientId: string;
784
+ clientSecret: string;
785
+ enabled?: boolean;
786
+ scopes?: string[];
787
+ callbackUrl?: string;
788
+ };
789
+ apple?: {
790
+ clientId: string;
791
+ clientSecret: string;
792
+ enabled?: boolean;
793
+ scopes?: string[];
794
+ callbackUrl?: string;
795
+ };
796
+ custom?: Record<string, unknown>;
797
+ };
798
+ totp?: {
799
+ enabled?: boolean;
800
+ issuer?: string;
801
+ backupCodesCount?: number;
802
+ };
803
+ webauthn?: {
804
+ rpName: string;
805
+ rpId: string;
806
+ enabled?: boolean;
807
+ origins?: string[];
808
+ };
809
+ password?: {
810
+ enabled?: boolean;
811
+ minLength?: number;
812
+ requireUppercase?: boolean;
813
+ requireLowercase?: boolean;
814
+ requireNumbers?: boolean;
815
+ requireSymbols?: boolean;
816
+ checkCommonPasswords?: boolean;
817
+ };
818
+ }, {}>;
819
+ /** Storage config */
820
+ declare const storageConfig: arktype_internal_variants_object_ts.ObjectType<{
821
+ type?: "custom" | "redis" | "upstash" | "memory" | "cloudflare-kv" | "deno-kv";
822
+ redis?: object;
823
+ upstash?: object;
824
+ cloudflareKv?: object;
825
+ denoKv?: object;
826
+ custom?: object;
827
+ }, {}>;
828
+ /** Main Pars auth config */
829
+ declare const parsAuthConfig: arktype_internal_variants_object_ts.ObjectType<{
830
+ secret: string;
831
+ adapter: object;
832
+ baseUrl?: string;
833
+ storage?: {
834
+ type?: "custom" | "redis" | "upstash" | "memory" | "cloudflare-kv" | "deno-kv";
835
+ redis?: object;
836
+ upstash?: object;
837
+ cloudflareKv?: object;
838
+ denoKv?: object;
839
+ custom?: object;
840
+ };
841
+ providers?: {
842
+ otp?: {
843
+ enabled?: boolean;
844
+ email?: {
845
+ send: Function;
846
+ enabled?: boolean;
847
+ expiresIn?: number;
848
+ length?: number;
849
+ maxAttempts?: number;
850
+ rateLimit?: number;
851
+ rateLimitWindow?: number;
852
+ };
853
+ sms?: {
854
+ send: Function;
855
+ enabled?: boolean;
856
+ expiresIn?: number;
857
+ length?: number;
858
+ maxAttempts?: number;
859
+ rateLimit?: number;
860
+ rateLimitWindow?: number;
861
+ };
862
+ };
863
+ magicLink?: {
864
+ send: Function;
865
+ enabled?: boolean;
866
+ expiresIn?: number;
867
+ };
868
+ oauth?: {
869
+ google?: {
870
+ clientId: string;
871
+ clientSecret: string;
872
+ enabled?: boolean;
873
+ scopes?: string[];
874
+ callbackUrl?: string;
875
+ };
876
+ github?: {
877
+ clientId: string;
878
+ clientSecret: string;
879
+ enabled?: boolean;
880
+ scopes?: string[];
881
+ callbackUrl?: string;
882
+ };
883
+ microsoft?: {
884
+ clientId: string;
885
+ clientSecret: string;
886
+ enabled?: boolean;
887
+ scopes?: string[];
888
+ callbackUrl?: string;
889
+ };
890
+ apple?: {
891
+ clientId: string;
892
+ clientSecret: string;
893
+ enabled?: boolean;
894
+ scopes?: string[];
895
+ callbackUrl?: string;
896
+ };
897
+ custom?: Record<string, unknown>;
898
+ };
899
+ totp?: {
900
+ enabled?: boolean;
901
+ issuer?: string;
902
+ backupCodesCount?: number;
903
+ };
904
+ webauthn?: {
905
+ rpName: string;
906
+ rpId: string;
907
+ enabled?: boolean;
908
+ origins?: string[];
909
+ };
910
+ password?: {
911
+ enabled?: boolean;
912
+ minLength?: number;
913
+ requireUppercase?: boolean;
914
+ requireLowercase?: boolean;
915
+ requireNumbers?: boolean;
916
+ requireSymbols?: boolean;
917
+ checkCommonPasswords?: boolean;
918
+ };
919
+ };
920
+ session?: {
921
+ accessTokenExpiry?: number;
922
+ refreshTokenExpiry?: number;
923
+ slidingWindow?: boolean;
924
+ maxSessions?: number;
925
+ invalidateOnPasswordChange?: boolean;
926
+ };
927
+ jwt?: {
928
+ algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512";
929
+ issuer?: string;
930
+ audience?: string | string[];
931
+ };
932
+ cookies?: {
933
+ prefix?: string;
934
+ domain?: string;
935
+ path?: string;
936
+ secure?: boolean;
937
+ sameSite?: "strict" | "lax" | "none";
938
+ httpOnly?: boolean;
939
+ };
940
+ security?: {
941
+ rateLimit?: {
942
+ enabled?: boolean;
943
+ loginAttempts?: number;
944
+ windowSize?: number;
945
+ };
946
+ lockout?: {
947
+ enabled?: boolean;
948
+ maxAttempts?: number;
949
+ duration?: number;
950
+ };
951
+ csrf?: {
952
+ enabled?: boolean;
953
+ headerName?: string;
954
+ cookieName?: string;
955
+ };
956
+ };
957
+ tenant?: {
958
+ enabled?: boolean;
959
+ strategy?: "path" | "subdomain" | "header" | "query" | "custom";
960
+ headerName?: string;
961
+ resolver?: Function;
962
+ };
963
+ callbacks?: object;
964
+ }, {}>;
965
+ type User = typeof user.infer;
966
+ type AuthMethod = typeof authMethod.infer;
967
+ type Session = typeof session.infer;
968
+ type TenantMembership = typeof tenantMembership.infer;
969
+ type RequestOTPRequest = typeof requestOTPRequest.infer;
970
+ type RequestOTPResponse = typeof requestOTPResponse.infer;
971
+ type VerifyOTPRequest = typeof verifyOTPRequest.infer;
972
+ type ResendOTPRequest = typeof resendOTPRequest.infer;
973
+ type LoginResponseData = typeof loginResponseData.infer;
974
+ type LoginResponse = typeof loginResponse.infer;
975
+ type CurrentUserResponseData = typeof currentUserResponseData.infer;
976
+ type CurrentUserResponse = typeof currentUserResponse.infer;
977
+ type RefreshTokenRequest = typeof refreshTokenRequest.infer;
978
+ type TokenInfo = typeof tokenInfo.infer;
979
+ type JwtPayload = typeof jwtPayload.infer;
980
+ type Permission = typeof permission.infer;
981
+ type Role = typeof role.infer;
982
+ type PermissionCheck = typeof permissionCheck.infer;
983
+ type LogoutRequest = typeof logoutRequest.infer;
984
+ type RevokeSessionRequest = typeof revokeSessionRequest.infer;
985
+ type RevokeAllSessionsRequest = typeof revokeAllSessionsRequest.infer;
986
+ type RevokeAllSessionsResponse = typeof revokeAllSessionsResponse.infer;
987
+ type SendVerificationEmailRequest = typeof sendVerificationEmailRequest.infer;
988
+ type VerifyEmailRequest = typeof verifyEmailRequest.infer;
989
+ type CheckVerificationStatusRequest = typeof checkVerificationStatusRequest.infer;
990
+ type CheckVerificationStatusResponse = typeof checkVerificationStatusResponse.infer;
991
+ type CSRFTokenRequest = typeof csrfTokenRequest.infer;
992
+ type SessionConfig = typeof sessionConfig.infer;
993
+ type JwtConfig = typeof jwtConfig.infer;
994
+ type CookieConfig = typeof cookieConfig.infer;
995
+ type CsrfConfig = typeof csrfConfig.infer;
996
+ type RateLimitConfig = typeof rateLimitConfig.infer;
997
+ type LockoutConfig = typeof lockoutConfig.infer;
998
+ type SecurityConfig = typeof securityConfig.infer;
999
+ type TenantConfig = typeof tenantConfig.infer;
1000
+ type OAuthProviderConfig = typeof oauthProviderConfig.infer;
1001
+ type OtpEmailConfig = typeof otpEmailConfig.infer;
1002
+ type OtpSmsConfig = typeof otpSmsConfig.infer;
1003
+ type OtpConfig = typeof otpConfig.infer;
1004
+ type MagicLinkConfig = typeof magicLinkConfig.infer;
1005
+ type TotpConfig = typeof totpConfig.infer;
1006
+ type WebAuthnConfig = typeof webauthnConfig.infer;
1007
+ type PasswordConfig = typeof passwordConfig.infer;
1008
+ type OAuthProvidersConfig = typeof oauthProvidersConfig.infer;
1009
+ type ProvidersConfig = typeof providersConfig.infer;
1010
+ type StorageConfig = typeof storageConfig.infer;
1011
+ type ParsAuthConfig = typeof parsAuthConfig.infer;
1012
+
1013
+ /**
1014
+ * @parsrun/types - Tenant Schemas
1015
+ * Multi-tenant related validation schemas
1016
+ */
1017
+ /** Tenant entity */
1018
+ declare const tenant: arktype_internal_variants_object_ts.ObjectType<{
1019
+ id: string;
1020
+ name: string;
1021
+ status: "active" | "inactive" | "suspended" | "deleted";
1022
+ insertedAt: string;
1023
+ updatedAt: string;
1024
+ slug?: string;
1025
+ description?: string;
1026
+ settings?: object;
1027
+ metadata?: object;
1028
+ logoUrl?: string;
1029
+ primaryColor?: string;
1030
+ timezone?: string;
1031
+ locale?: string;
1032
+ currency?: string;
1033
+ deletedAt?: string;
1034
+ }, {}>;
1035
+ /** Tenant creation request */
1036
+ declare const createTenantRequest: arktype_internal_variants_object_ts.ObjectType<{
1037
+ name: string;
1038
+ slug?: string;
1039
+ description?: string;
1040
+ settings?: object;
1041
+ logoUrl?: string;
1042
+ primaryColor?: string;
1043
+ timezone?: string;
1044
+ locale?: string;
1045
+ currency?: string;
1046
+ }, {}>;
1047
+ /** Tenant update request */
1048
+ declare const updateTenantRequest: arktype_internal_variants_object_ts.ObjectType<{
1049
+ name?: string;
1050
+ slug?: string;
1051
+ description?: string;
1052
+ settings?: object;
1053
+ logoUrl?: string;
1054
+ primaryColor?: string;
1055
+ timezone?: string;
1056
+ locale?: string;
1057
+ currency?: string;
1058
+ status?: "active" | "inactive" | "suspended" | "deleted";
1059
+ }, {}>;
1060
+ /** Tenant invite request */
1061
+ declare const inviteTenantMemberRequest: arktype_internal_variants_object_ts.ObjectType<{
1062
+ email: string;
1063
+ roleId: string;
1064
+ accessLevel?: "full" | "limited" | "read_only";
1065
+ expiresAt?: string;
1066
+ message?: string;
1067
+ }, {}>;
1068
+ /** Tenant member list query */
1069
+ declare const tenantMemberListQuery: arktype_internal_variants_object_ts.ObjectType<{
1070
+ page?: number;
1071
+ limit?: number;
1072
+ status?: "active" | "inactive" | "suspended" | "invited";
1073
+ roleId?: string;
1074
+ search?: string;
1075
+ }, {}>;
1076
+ /** Tenant switch request */
1077
+ declare const switchTenantRequest: arktype_internal_variants_object_ts.ObjectType<{
1078
+ tenantId: string;
1079
+ }, {}>;
1080
+ type Tenant = typeof tenant.infer;
1081
+ type CreateTenantRequest = typeof createTenantRequest.infer;
1082
+ type UpdateTenantRequest = typeof updateTenantRequest.infer;
1083
+ type InviteTenantMemberRequest = typeof inviteTenantMemberRequest.infer;
1084
+ type TenantMemberListQuery = typeof tenantMemberListQuery.infer;
1085
+ type SwitchTenantRequest = typeof switchTenantRequest.infer;
1086
+
1087
+ /**
1088
+ * @parsrun/types - Email Schemas
1089
+ * Email service validation schemas
1090
+ */
1091
+ /** Email address with optional name */
1092
+ declare const emailAddress: arktype_internal_variants_object_ts.ObjectType<{
1093
+ email: string;
1094
+ name?: string;
1095
+ }, {}>;
1096
+ /** Simple email string or address object */
1097
+ declare const emailRecipient: arktype.BaseType<string | object, {}>;
1098
+ /** Email attachment */
1099
+ declare const emailAttachment: arktype_internal_variants_object_ts.ObjectType<{
1100
+ filename: string;
1101
+ content: string | object;
1102
+ contentType?: string;
1103
+ encoding?: "base64" | "utf-8" | "binary";
1104
+ contentId?: string;
1105
+ disposition?: "attachment" | "inline";
1106
+ }, {}>;
1107
+ /** Email options */
1108
+ declare const sendEmailOptions: arktype_internal_variants_object_ts.ObjectType<{
1109
+ to: string | object | string[] | object[];
1110
+ subject: string;
1111
+ cc?: string | object | string[] | object[];
1112
+ bcc?: string | object | string[] | object[];
1113
+ from?: string | object;
1114
+ replyTo?: string | object;
1115
+ text?: string;
1116
+ html?: string;
1117
+ attachments?: {
1118
+ filename: string;
1119
+ content: string | object;
1120
+ contentType?: string;
1121
+ encoding?: "base64" | "utf-8" | "binary";
1122
+ contentId?: string;
1123
+ disposition?: "attachment" | "inline";
1124
+ }[];
1125
+ headers?: object;
1126
+ priority?: "high" | "normal" | "low";
1127
+ tags?: string[];
1128
+ metadata?: object;
1129
+ }, {}>;
1130
+ /** Templated email options */
1131
+ declare const sendTemplateEmailOptions: arktype_internal_variants_object_ts.ObjectType<{
1132
+ to: string | object | string[] | object[];
1133
+ template: string;
1134
+ cc?: string | object | string[] | object[];
1135
+ bcc?: string | object | string[] | object[];
1136
+ from?: string | object;
1137
+ replyTo?: string | object;
1138
+ data?: object;
1139
+ attachments?: {
1140
+ filename: string;
1141
+ content: string | object;
1142
+ contentType?: string;
1143
+ encoding?: "base64" | "utf-8" | "binary";
1144
+ contentId?: string;
1145
+ disposition?: "attachment" | "inline";
1146
+ }[];
1147
+ headers?: object;
1148
+ priority?: "high" | "normal" | "low";
1149
+ tags?: string[];
1150
+ metadata?: object;
1151
+ }, {}>;
1152
+ /** Email send result */
1153
+ declare const emailSendResult: arktype_internal_variants_object_ts.ObjectType<{
1154
+ success: boolean;
1155
+ messageId: string;
1156
+ accepted?: string[];
1157
+ rejected?: string[];
1158
+ pending?: string[];
1159
+ }, {}>;
1160
+ /** SMTP config */
1161
+ declare const smtpConfig: arktype_internal_variants_object_ts.ObjectType<{
1162
+ host: string;
1163
+ port: number;
1164
+ secure?: boolean;
1165
+ auth?: {
1166
+ user: string;
1167
+ pass: string;
1168
+ };
1169
+ tls?: object;
1170
+ }, {}>;
1171
+ /** Resend config */
1172
+ declare const resendConfig: arktype_internal_variants_object_ts.ObjectType<{
1173
+ apiKey: string;
1174
+ domain?: string;
1175
+ }, {}>;
1176
+ /** SendGrid config */
1177
+ declare const sendgridConfig: arktype_internal_variants_object_ts.ObjectType<{
1178
+ apiKey: string;
1179
+ }, {}>;
1180
+ /** AWS SES config */
1181
+ declare const sesConfig: arktype_internal_variants_object_ts.ObjectType<{
1182
+ region: string;
1183
+ accessKeyId?: string;
1184
+ secretAccessKey?: string;
1185
+ endpoint?: string;
1186
+ }, {}>;
1187
+ /** Postmark config */
1188
+ declare const postmarkConfig: arktype_internal_variants_object_ts.ObjectType<{
1189
+ serverToken: string;
1190
+ }, {}>;
1191
+ /** Email provider config */
1192
+ declare const emailConfig: arktype_internal_variants_object_ts.ObjectType<{
1193
+ provider: "smtp" | "resend" | "sendgrid" | "ses" | "postmark" | "mailgun";
1194
+ from?: string | object;
1195
+ replyTo?: string | object;
1196
+ smtp?: {
1197
+ host: string;
1198
+ port: number;
1199
+ secure?: boolean;
1200
+ auth?: {
1201
+ user: string;
1202
+ pass: string;
1203
+ };
1204
+ tls?: object;
1205
+ };
1206
+ resend?: {
1207
+ apiKey: string;
1208
+ domain?: string;
1209
+ };
1210
+ sendgrid?: {
1211
+ apiKey: string;
1212
+ };
1213
+ ses?: {
1214
+ region: string;
1215
+ accessKeyId?: string;
1216
+ secretAccessKey?: string;
1217
+ endpoint?: string;
1218
+ };
1219
+ postmark?: {
1220
+ serverToken: string;
1221
+ };
1222
+ templates?: object;
1223
+ }, {}>;
1224
+ type EmailAddress = typeof emailAddress.infer;
1225
+ type EmailRecipient = typeof emailRecipient.infer;
1226
+ type EmailAttachment = typeof emailAttachment.infer;
1227
+ type SendEmailOptions = typeof sendEmailOptions.infer;
1228
+ type SendTemplateEmailOptions = typeof sendTemplateEmailOptions.infer;
1229
+ type EmailSendResult = typeof emailSendResult.infer;
1230
+ type SmtpConfig = typeof smtpConfig.infer;
1231
+ type ResendConfig = typeof resendConfig.infer;
1232
+ type SendgridConfig = typeof sendgridConfig.infer;
1233
+ type SesConfig = typeof sesConfig.infer;
1234
+ type PostmarkConfig = typeof postmarkConfig.infer;
1235
+ type EmailConfig = typeof emailConfig.infer;
1236
+
1237
+ /**
1238
+ * @parsrun/types - Storage Schemas
1239
+ * File storage validation schemas
1240
+ */
1241
+ /** File metadata */
1242
+ declare const fileMetadata: arktype_internal_variants_object_ts.ObjectType<{
1243
+ id: string;
1244
+ filename: string;
1245
+ originalName: string;
1246
+ mimeType: string;
1247
+ size: number;
1248
+ bucket: string;
1249
+ insertedAt: string;
1250
+ updatedAt: string;
1251
+ path?: string;
1252
+ url?: string;
1253
+ etag?: string;
1254
+ metadata?: object;
1255
+ uploadedBy?: string;
1256
+ tenantId?: string;
1257
+ deletedAt?: string;
1258
+ }, {}>;
1259
+ /** Upload options */
1260
+ declare const uploadOptions: arktype_internal_variants_object_ts.ObjectType<{
1261
+ path?: string;
1262
+ filename?: string;
1263
+ contentType?: string;
1264
+ metadata?: object;
1265
+ acl?: "private" | "public-read" | "authenticated-read";
1266
+ cacheControl?: string;
1267
+ contentDisposition?: string;
1268
+ }, {}>;
1269
+ /** Signed URL options */
1270
+ declare const signedUrlOptions: arktype_internal_variants_object_ts.ObjectType<{
1271
+ expiresIn?: number;
1272
+ method?: "GET" | "PUT";
1273
+ contentType?: string;
1274
+ responseContentType?: string;
1275
+ responseContentDisposition?: string;
1276
+ }, {}>;
1277
+ /** List files options */
1278
+ declare const listFilesOptions: arktype_internal_variants_object_ts.ObjectType<{
1279
+ prefix?: string;
1280
+ limit?: number;
1281
+ cursor?: string;
1282
+ delimiter?: string;
1283
+ }, {}>;
1284
+ /** List files result */
1285
+ declare const listFilesResult: arktype_internal_variants_object_ts.ObjectType<{
1286
+ files: {
1287
+ id: string;
1288
+ filename: string;
1289
+ originalName: string;
1290
+ mimeType: string;
1291
+ size: number;
1292
+ bucket: string;
1293
+ insertedAt: string;
1294
+ updatedAt: string;
1295
+ path?: string;
1296
+ url?: string;
1297
+ etag?: string;
1298
+ metadata?: object;
1299
+ uploadedBy?: string;
1300
+ tenantId?: string;
1301
+ deletedAt?: string;
1302
+ }[];
1303
+ hasMore: boolean;
1304
+ nextCursor?: string;
1305
+ }, {}>;
1306
+ /** Local storage config */
1307
+ declare const localStorageConfig: arktype_internal_variants_object_ts.ObjectType<{
1308
+ basePath: string;
1309
+ baseUrl?: string;
1310
+ permissions?: number;
1311
+ }, {}>;
1312
+ /** S3 storage config */
1313
+ declare const s3StorageConfig: arktype_internal_variants_object_ts.ObjectType<{
1314
+ bucket: string;
1315
+ region: string;
1316
+ endpoint?: string;
1317
+ accessKeyId?: string;
1318
+ secretAccessKey?: string;
1319
+ forcePathStyle?: boolean;
1320
+ acl?: "private" | "public-read" | "authenticated-read";
1321
+ }, {}>;
1322
+ /** Cloudflare R2 config */
1323
+ declare const r2StorageConfig: arktype_internal_variants_object_ts.ObjectType<{
1324
+ accountId: string;
1325
+ bucket: string;
1326
+ accessKeyId: string;
1327
+ secretAccessKey: string;
1328
+ publicUrl?: string;
1329
+ }, {}>;
1330
+ /** GCS config */
1331
+ declare const gcsStorageConfig: arktype_internal_variants_object_ts.ObjectType<{
1332
+ bucket: string;
1333
+ projectId?: string;
1334
+ credentials?: object;
1335
+ keyFilename?: string;
1336
+ }, {}>;
1337
+ /** Storage config */
1338
+ declare const storageProviderConfig: arktype_internal_variants_object_ts.ObjectType<{
1339
+ provider: "local" | "s3" | "r2" | "gcs" | "azure";
1340
+ defaultBucket?: string;
1341
+ local?: {
1342
+ basePath: string;
1343
+ baseUrl?: string;
1344
+ permissions?: number;
1345
+ };
1346
+ s3?: {
1347
+ bucket: string;
1348
+ region: string;
1349
+ endpoint?: string;
1350
+ accessKeyId?: string;
1351
+ secretAccessKey?: string;
1352
+ forcePathStyle?: boolean;
1353
+ acl?: "private" | "public-read" | "authenticated-read";
1354
+ };
1355
+ r2?: {
1356
+ accountId: string;
1357
+ bucket: string;
1358
+ accessKeyId: string;
1359
+ secretAccessKey: string;
1360
+ publicUrl?: string;
1361
+ };
1362
+ gcs?: {
1363
+ bucket: string;
1364
+ projectId?: string;
1365
+ credentials?: object;
1366
+ keyFilename?: string;
1367
+ };
1368
+ }, {}>;
1369
+ type FileMetadata = typeof fileMetadata.infer;
1370
+ type UploadOptions = typeof uploadOptions.infer;
1371
+ type SignedUrlOptions = typeof signedUrlOptions.infer;
1372
+ type ListFilesOptions = typeof listFilesOptions.infer;
1373
+ type ListFilesResult = typeof listFilesResult.infer;
1374
+ type LocalStorageConfig = typeof localStorageConfig.infer;
1375
+ type S3StorageConfig = typeof s3StorageConfig.infer;
1376
+ type R2StorageConfig = typeof r2StorageConfig.infer;
1377
+ type GcsStorageConfig = typeof gcsStorageConfig.infer;
1378
+ type StorageProviderConfig = typeof storageProviderConfig.infer;
1379
+
1380
+ /**
1381
+ * @parsrun/types - Queue Schemas
1382
+ * Job queue validation schemas
1383
+ */
1384
+ /** Job status */
1385
+ declare const jobStatus: arktype_internal_variants_string_ts.StringType<"active" | "pending" | "completed" | "failed" | "delayed" | "paused", {}>;
1386
+ /** Job entity */
1387
+ declare const job: arktype_internal_variants_object_ts.ObjectType<{
1388
+ id: string;
1389
+ queue: string;
1390
+ name: string;
1391
+ data: unknown;
1392
+ status: "active" | "pending" | "completed" | "failed" | "delayed" | "paused";
1393
+ attempts: number;
1394
+ maxAttempts: number;
1395
+ insertedAt: string;
1396
+ updatedAt: string;
1397
+ result?: unknown;
1398
+ error?: string;
1399
+ priority?: number;
1400
+ delay?: number;
1401
+ progress?: number;
1402
+ startedAt?: string;
1403
+ completedAt?: string;
1404
+ failedAt?: string;
1405
+ processedBy?: string;
1406
+ }, {}>;
1407
+ /** Job options */
1408
+ declare const jobOptions: arktype_internal_variants_object_ts.ObjectType<{
1409
+ priority?: number;
1410
+ delay?: number;
1411
+ attempts?: number;
1412
+ backoff?: {
1413
+ type: "fixed" | "exponential";
1414
+ delay?: number;
1415
+ };
1416
+ timeout?: number;
1417
+ removeOnComplete?: number | boolean;
1418
+ removeOnFail?: number | boolean;
1419
+ repeat?: {
1420
+ pattern?: string;
1421
+ every?: number;
1422
+ limit?: number;
1423
+ tz?: string;
1424
+ };
1425
+ }, {}>;
1426
+ /** Add job request */
1427
+ declare const addJobRequest: arktype_internal_variants_object_ts.ObjectType<{
1428
+ name: string;
1429
+ data: unknown;
1430
+ options?: {
1431
+ priority?: number;
1432
+ delay?: number;
1433
+ attempts?: number;
1434
+ backoff?: {
1435
+ type: "fixed" | "exponential";
1436
+ delay?: number;
1437
+ };
1438
+ timeout?: number;
1439
+ removeOnComplete?: number | boolean;
1440
+ removeOnFail?: number | boolean;
1441
+ repeat?: {
1442
+ pattern?: string;
1443
+ every?: number;
1444
+ limit?: number;
1445
+ tz?: string;
1446
+ };
1447
+ };
1448
+ }, {}>;
1449
+ /** Job progress update */
1450
+ declare const jobProgressUpdate: arktype_internal_variants_object_ts.ObjectType<{
1451
+ progress: number;
1452
+ message?: string;
1453
+ data?: unknown;
1454
+ }, {}>;
1455
+ /** Queue stats */
1456
+ declare const queueStats: arktype_internal_variants_object_ts.ObjectType<{
1457
+ name: string;
1458
+ pending: number;
1459
+ active: number;
1460
+ completed: number;
1461
+ failed: number;
1462
+ delayed: number;
1463
+ paused: boolean;
1464
+ }, {}>;
1465
+ /** Queue list options */
1466
+ declare const queueListOptions: arktype_internal_variants_object_ts.ObjectType<{
1467
+ status?: "active" | "pending" | "completed" | "failed" | "delayed" | "paused";
1468
+ start?: number;
1469
+ end?: number;
1470
+ order?: "asc" | "desc";
1471
+ }, {}>;
1472
+ /** Redis queue config */
1473
+ declare const redisQueueConfig: arktype_internal_variants_object_ts.ObjectType<{
1474
+ host?: string;
1475
+ port?: number;
1476
+ password?: string;
1477
+ db?: number;
1478
+ url?: string;
1479
+ tls?: boolean | object;
1480
+ }, {}>;
1481
+ /** Queue worker options */
1482
+ declare const workerOptions: arktype_internal_variants_object_ts.ObjectType<{
1483
+ concurrency?: number;
1484
+ limiter?: {
1485
+ max: number;
1486
+ duration: number;
1487
+ };
1488
+ lockDuration?: number;
1489
+ lockRenewTime?: number;
1490
+ stalledInterval?: number;
1491
+ maxStalledCount?: number;
1492
+ }, {}>;
1493
+ /** Queue config */
1494
+ declare const queueConfig: arktype_internal_variants_object_ts.ObjectType<{
1495
+ provider: "memory" | "bullmq" | "sqs" | "rabbitmq";
1496
+ defaultJobOptions?: {
1497
+ priority?: number;
1498
+ delay?: number;
1499
+ attempts?: number;
1500
+ backoff?: {
1501
+ type: "fixed" | "exponential";
1502
+ delay?: number;
1503
+ };
1504
+ timeout?: number;
1505
+ removeOnComplete?: number | boolean;
1506
+ removeOnFail?: number | boolean;
1507
+ repeat?: {
1508
+ pattern?: string;
1509
+ every?: number;
1510
+ limit?: number;
1511
+ tz?: string;
1512
+ };
1513
+ };
1514
+ redis?: {
1515
+ host?: string;
1516
+ port?: number;
1517
+ password?: string;
1518
+ db?: number;
1519
+ url?: string;
1520
+ tls?: boolean | object;
1521
+ };
1522
+ prefix?: string;
1523
+ worker?: {
1524
+ concurrency?: number;
1525
+ limiter?: {
1526
+ max: number;
1527
+ duration: number;
1528
+ };
1529
+ lockDuration?: number;
1530
+ lockRenewTime?: number;
1531
+ stalledInterval?: number;
1532
+ maxStalledCount?: number;
1533
+ };
1534
+ }, {}>;
1535
+ type JobStatus = typeof jobStatus.infer;
1536
+ type Job = typeof job.infer;
1537
+ type JobOptions = typeof jobOptions.infer;
1538
+ type AddJobRequest = typeof addJobRequest.infer;
1539
+ type JobProgressUpdate = typeof jobProgressUpdate.infer;
1540
+ type QueueStats = typeof queueStats.infer;
1541
+ type QueueListOptions = typeof queueListOptions.infer;
1542
+ type RedisQueueConfig = typeof redisQueueConfig.infer;
1543
+ type WorkerOptions = typeof workerOptions.infer;
1544
+ type QueueConfig = typeof queueConfig.infer;
1545
+
1546
+ /**
1547
+ * @parsrun/types - Cache Schemas
1548
+ * Caching validation schemas
1549
+ */
1550
+ /** Cache set options */
1551
+ declare const cacheSetOptions: arktype_internal_variants_object_ts.ObjectType<{
1552
+ ttl?: number;
1553
+ tags?: string[];
1554
+ metadata?: object;
1555
+ }, {}>;
1556
+ /** Cache get result */
1557
+ declare const cacheGetResult: arktype_internal_variants_object_ts.ObjectType<{
1558
+ value: unknown;
1559
+ ttl?: number;
1560
+ createdAt?: number;
1561
+ tags?: string[];
1562
+ }, {}>;
1563
+ /** Cache stats */
1564
+ declare const cacheStats: arktype_internal_variants_object_ts.ObjectType<{
1565
+ hits: number;
1566
+ misses: number;
1567
+ keys: number;
1568
+ memory?: number;
1569
+ }, {}>;
1570
+ /** Memory cache config */
1571
+ declare const memoryCacheConfig: arktype_internal_variants_object_ts.ObjectType<{
1572
+ maxSize?: number;
1573
+ ttl?: number;
1574
+ checkInterval?: number;
1575
+ stale?: boolean;
1576
+ }, {}>;
1577
+ /** Redis cache config */
1578
+ declare const redisCacheConfig: arktype_internal_variants_object_ts.ObjectType<{
1579
+ host?: string;
1580
+ port?: number;
1581
+ password?: string;
1582
+ db?: number;
1583
+ url?: string;
1584
+ tls?: boolean | object;
1585
+ keyPrefix?: string;
1586
+ ttl?: number;
1587
+ }, {}>;
1588
+ /** Upstash cache config */
1589
+ declare const upstashCacheConfig: arktype_internal_variants_object_ts.ObjectType<{
1590
+ url: string;
1591
+ token: string;
1592
+ keyPrefix?: string;
1593
+ ttl?: number;
1594
+ }, {}>;
1595
+ /** Cloudflare KV config */
1596
+ declare const cloudflareKvConfig: arktype_internal_variants_object_ts.ObjectType<{
1597
+ namespaceId: string;
1598
+ accountId?: string;
1599
+ apiToken?: string;
1600
+ keyPrefix?: string;
1601
+ }, {}>;
1602
+ /** Multi-tier cache config */
1603
+ declare const multiTierCacheConfig: arktype_internal_variants_object_ts.ObjectType<{
1604
+ tiers: {
1605
+ type: "redis" | "upstash" | "memory" | "cloudflare-kv";
1606
+ priority?: number;
1607
+ ttl?: number;
1608
+ config?: object;
1609
+ }[];
1610
+ writeThrough?: boolean;
1611
+ readThrough?: boolean;
1612
+ }, {}>;
1613
+ /** Cache config */
1614
+ declare const cacheConfig: arktype_internal_variants_object_ts.ObjectType<{
1615
+ provider: "redis" | "upstash" | "memory" | "cloudflare-kv" | "multi-tier";
1616
+ ttl?: number;
1617
+ keyPrefix?: string;
1618
+ memory?: {
1619
+ maxSize?: number;
1620
+ ttl?: number;
1621
+ checkInterval?: number;
1622
+ stale?: boolean;
1623
+ };
1624
+ redis?: {
1625
+ host?: string;
1626
+ port?: number;
1627
+ password?: string;
1628
+ db?: number;
1629
+ url?: string;
1630
+ tls?: boolean | object;
1631
+ keyPrefix?: string;
1632
+ ttl?: number;
1633
+ };
1634
+ upstash?: {
1635
+ url: string;
1636
+ token: string;
1637
+ keyPrefix?: string;
1638
+ ttl?: number;
1639
+ };
1640
+ cloudflareKv?: {
1641
+ namespaceId: string;
1642
+ accountId?: string;
1643
+ apiToken?: string;
1644
+ keyPrefix?: string;
1645
+ };
1646
+ multiTier?: {
1647
+ tiers: {
1648
+ type: "redis" | "upstash" | "memory" | "cloudflare-kv";
1649
+ priority?: number;
1650
+ ttl?: number;
1651
+ config?: object;
1652
+ }[];
1653
+ writeThrough?: boolean;
1654
+ readThrough?: boolean;
1655
+ };
1656
+ }, {}>;
1657
+ type CacheSetOptions = typeof cacheSetOptions.infer;
1658
+ type CacheGetResult = typeof cacheGetResult.infer;
1659
+ type CacheStats = typeof cacheStats.infer;
1660
+ type MemoryCacheConfig = typeof memoryCacheConfig.infer;
1661
+ type RedisCacheConfig = typeof redisCacheConfig.infer;
1662
+ type UpstashCacheConfig = typeof upstashCacheConfig.infer;
1663
+ type CloudflareKvConfig = typeof cloudflareKvConfig.infer;
1664
+ type MultiTierCacheConfig = typeof multiTierCacheConfig.infer;
1665
+ type CacheConfig = typeof cacheConfig.infer;
1666
+
1667
+ /**
1668
+ * @parsrun/types - Payments Schemas
1669
+ * Payment provider validation schemas
1670
+ */
1671
+ /** Currency code (ISO 4217) */
1672
+ declare const currencyCode: arktype_internal_variants_string_ts.StringType<string, {}>;
1673
+ /** Money amount with currency */
1674
+ declare const money: arktype_internal_variants_object_ts.ObjectType<{
1675
+ amount: number;
1676
+ currency: string;
1677
+ }, {}>;
1678
+ /** Payment customer */
1679
+ declare const paymentCustomer: arktype_internal_variants_object_ts.ObjectType<{
1680
+ id: string;
1681
+ email: string;
1682
+ insertedAt: string;
1683
+ updatedAt: string;
1684
+ externalId?: string;
1685
+ name?: string;
1686
+ phone?: string;
1687
+ metadata?: object;
1688
+ }, {}>;
1689
+ /** Create customer request */
1690
+ declare const createCustomerRequest: arktype_internal_variants_object_ts.ObjectType<{
1691
+ email: string;
1692
+ name?: string;
1693
+ phone?: string;
1694
+ metadata?: object;
1695
+ }, {}>;
1696
+ /** Card details */
1697
+ declare const cardDetails: arktype_internal_variants_object_ts.ObjectType<{
1698
+ brand: string;
1699
+ last4: string;
1700
+ expMonth: number;
1701
+ expYear: number;
1702
+ fingerprint?: string;
1703
+ }, {}>;
1704
+ /** Payment method */
1705
+ declare const paymentMethod: arktype_internal_variants_object_ts.ObjectType<{
1706
+ id: string;
1707
+ customerId: string;
1708
+ type: "crypto" | "card" | "bank_account" | "paypal" | "other";
1709
+ isDefault: boolean;
1710
+ insertedAt: string;
1711
+ updatedAt: string;
1712
+ externalId?: string;
1713
+ card?: {
1714
+ brand: string;
1715
+ last4: string;
1716
+ expMonth: number;
1717
+ expYear: number;
1718
+ fingerprint?: string;
1719
+ };
1720
+ metadata?: object;
1721
+ }, {}>;
1722
+ /** Payment intent status */
1723
+ declare const paymentIntentStatus: arktype_internal_variants_string_ts.StringType<"failed" | "created" | "processing" | "requires_action" | "succeeded" | "canceled", {}>;
1724
+ /** Payment intent */
1725
+ declare const paymentIntent: arktype_internal_variants_object_ts.ObjectType<{
1726
+ id: string;
1727
+ customerId: string;
1728
+ amount: number;
1729
+ currency: string;
1730
+ status: "failed" | "created" | "processing" | "requires_action" | "succeeded" | "canceled";
1731
+ insertedAt: string;
1732
+ updatedAt: string;
1733
+ externalId?: string;
1734
+ paymentMethodId?: string;
1735
+ description?: string;
1736
+ metadata?: object;
1737
+ clientSecret?: string;
1738
+ failureReason?: string;
1739
+ }, {}>;
1740
+ /** Create payment intent request */
1741
+ declare const createPaymentIntentRequest: arktype_internal_variants_object_ts.ObjectType<{
1742
+ customerId: string;
1743
+ amount: number;
1744
+ currency: string;
1745
+ paymentMethodId?: string;
1746
+ description?: string;
1747
+ metadata?: object;
1748
+ confirm?: boolean;
1749
+ returnUrl?: string;
1750
+ }, {}>;
1751
+ /** Subscription status */
1752
+ declare const subscriptionStatus: arktype_internal_variants_string_ts.StringType<"active" | "paused" | "canceled" | "past_due" | "incomplete" | "incomplete_expired" | "trialing", {}>;
1753
+ /** Price interval */
1754
+ declare const priceInterval: arktype_internal_variants_string_ts.StringType<"day" | "week" | "month" | "year", {}>;
1755
+ /** Price */
1756
+ declare const price: arktype_internal_variants_object_ts.ObjectType<{
1757
+ id: string;
1758
+ productId: string;
1759
+ amount: number;
1760
+ currency: string;
1761
+ interval: "day" | "week" | "month" | "year";
1762
+ isActive: boolean;
1763
+ externalId?: string;
1764
+ intervalCount?: number;
1765
+ trialDays?: number;
1766
+ metadata?: object;
1767
+ }, {}>;
1768
+ /** Subscription */
1769
+ declare const subscription: arktype_internal_variants_object_ts.ObjectType<{
1770
+ id: string;
1771
+ customerId: string;
1772
+ priceId: string;
1773
+ status: "active" | "paused" | "canceled" | "past_due" | "incomplete" | "incomplete_expired" | "trialing";
1774
+ currentPeriodStart: string;
1775
+ currentPeriodEnd: string;
1776
+ insertedAt: string;
1777
+ updatedAt: string;
1778
+ externalId?: string;
1779
+ cancelAt?: string;
1780
+ canceledAt?: string;
1781
+ trialStart?: string;
1782
+ trialEnd?: string;
1783
+ metadata?: object;
1784
+ }, {}>;
1785
+ /** Create subscription request */
1786
+ declare const createSubscriptionRequest: arktype_internal_variants_object_ts.ObjectType<{
1787
+ customerId: string;
1788
+ priceId: string;
1789
+ paymentMethodId?: string;
1790
+ trialDays?: number;
1791
+ metadata?: object;
1792
+ }, {}>;
1793
+ /** Refund status */
1794
+ declare const refundStatus: arktype_internal_variants_string_ts.StringType<"pending" | "failed" | "succeeded" | "canceled", {}>;
1795
+ /** Refund */
1796
+ declare const refund: arktype_internal_variants_object_ts.ObjectType<{
1797
+ id: string;
1798
+ paymentIntentId: string;
1799
+ amount: number;
1800
+ currency: string;
1801
+ status: "pending" | "failed" | "succeeded" | "canceled";
1802
+ insertedAt: string;
1803
+ updatedAt: string;
1804
+ externalId?: string;
1805
+ reason?: string;
1806
+ metadata?: object;
1807
+ }, {}>;
1808
+ /** Create refund request */
1809
+ declare const createRefundRequest: arktype_internal_variants_object_ts.ObjectType<{
1810
+ paymentIntentId: string;
1811
+ amount?: number;
1812
+ reason?: string;
1813
+ metadata?: object;
1814
+ }, {}>;
1815
+ /** Webhook event types */
1816
+ declare const webhookEventType: arktype_internal_variants_string_ts.StringType<"payment.succeeded" | "payment.failed" | "subscription.created" | "subscription.updated" | "subscription.canceled" | "refund.created" | "customer.created" | "customer.updated", {}>;
1817
+ /** Webhook event */
1818
+ declare const webhookEvent: arktype_internal_variants_object_ts.ObjectType<{
1819
+ id: string;
1820
+ type: "payment.succeeded" | "payment.failed" | "subscription.created" | "subscription.updated" | "subscription.canceled" | "refund.created" | "customer.created" | "customer.updated";
1821
+ data: object;
1822
+ createdAt: string;
1823
+ livemode?: boolean;
1824
+ apiVersion?: string;
1825
+ }, {}>;
1826
+ /** Stripe config */
1827
+ declare const stripeConfig: arktype_internal_variants_object_ts.ObjectType<{
1828
+ secretKey: string;
1829
+ publishableKey?: string;
1830
+ webhookSecret?: string;
1831
+ apiVersion?: string;
1832
+ }, {}>;
1833
+ /** Paddle config */
1834
+ declare const paddleConfig: arktype_internal_variants_object_ts.ObjectType<{
1835
+ vendorId: string;
1836
+ vendorAuthCode: string;
1837
+ publicKey?: string;
1838
+ webhookSecret?: string;
1839
+ sandbox?: boolean;
1840
+ }, {}>;
1841
+ /** iyzico config */
1842
+ declare const iyzicoConfig: arktype_internal_variants_object_ts.ObjectType<{
1843
+ apiKey: string;
1844
+ secretKey: string;
1845
+ baseUrl: string;
1846
+ sandbox?: boolean;
1847
+ }, {}>;
1848
+ /** Payments config */
1849
+ declare const paymentsConfig: arktype_internal_variants_object_ts.ObjectType<{
1850
+ provider: "stripe" | "paddle" | "iyzico";
1851
+ currency?: string;
1852
+ stripe?: {
1853
+ secretKey: string;
1854
+ publishableKey?: string;
1855
+ webhookSecret?: string;
1856
+ apiVersion?: string;
1857
+ };
1858
+ paddle?: {
1859
+ vendorId: string;
1860
+ vendorAuthCode: string;
1861
+ publicKey?: string;
1862
+ webhookSecret?: string;
1863
+ sandbox?: boolean;
1864
+ };
1865
+ iyzico?: {
1866
+ apiKey: string;
1867
+ secretKey: string;
1868
+ baseUrl: string;
1869
+ sandbox?: boolean;
1870
+ };
1871
+ webhookPath?: string;
1872
+ }, {}>;
1873
+ type CurrencyCode = typeof currencyCode.infer;
1874
+ type Money = typeof money.infer;
1875
+ type PaymentCustomer = typeof paymentCustomer.infer;
1876
+ type CreateCustomerRequest = typeof createCustomerRequest.infer;
1877
+ type CardDetails = typeof cardDetails.infer;
1878
+ type PaymentMethod = typeof paymentMethod.infer;
1879
+ type PaymentIntentStatus = typeof paymentIntentStatus.infer;
1880
+ type PaymentIntent = typeof paymentIntent.infer;
1881
+ type CreatePaymentIntentRequest = typeof createPaymentIntentRequest.infer;
1882
+ type SubscriptionStatus = typeof subscriptionStatus.infer;
1883
+ type PriceInterval = typeof priceInterval.infer;
1884
+ type Price = typeof price.infer;
1885
+ type Subscription = typeof subscription.infer;
1886
+ type CreateSubscriptionRequest = typeof createSubscriptionRequest.infer;
1887
+ type RefundStatus = typeof refundStatus.infer;
1888
+ type Refund = typeof refund.infer;
1889
+ type CreateRefundRequest = typeof createRefundRequest.infer;
1890
+ type WebhookEventType = typeof webhookEventType.infer;
1891
+ type WebhookEvent = typeof webhookEvent.infer;
1892
+ type StripeConfig = typeof stripeConfig.infer;
1893
+ type PaddleConfig = typeof paddleConfig.infer;
1894
+ type IyzicoConfig = typeof iyzicoConfig.infer;
1895
+ type PaymentsConfig = typeof paymentsConfig.infer;
1896
+
1897
+ /**
1898
+ * @parsrun/types - Server Schemas
1899
+ * HTTP server validation schemas
1900
+ */
1901
+ /** UUID path parameter */
1902
+ declare const uuidParam: arktype_internal_variants_object_ts.ObjectType<{
1903
+ id: string;
1904
+ }, {}>;
1905
+ /** Standard pagination query */
1906
+ declare const paginationQuery: arktype_internal_variants_object_ts.ObjectType<{
1907
+ page?: string;
1908
+ limit?: string;
1909
+ orderBy?: string;
1910
+ orderDirection?: "asc" | "desc";
1911
+ }, {}>;
1912
+ /** Cursor pagination query */
1913
+ declare const cursorPaginationQuery: arktype_internal_variants_object_ts.ObjectType<{
1914
+ cursor?: string;
1915
+ limit?: string;
1916
+ direction?: "forward" | "backward";
1917
+ }, {}>;
1918
+ /** Search query */
1919
+ declare const searchQuery: arktype_internal_variants_object_ts.ObjectType<{
1920
+ q?: string;
1921
+ search?: string;
1922
+ filter?: string;
1923
+ }, {}>;
1924
+ /** Date range query */
1925
+ declare const dateRangeQuery: arktype_internal_variants_object_ts.ObjectType<{
1926
+ startDate?: string;
1927
+ endDate?: string;
1928
+ }, {}>;
1929
+ /** Health check response */
1930
+ declare const healthResponse: arktype_internal_variants_object_ts.ObjectType<{
1931
+ status: "healthy" | "degraded" | "unhealthy";
1932
+ timestamp: string;
1933
+ checks: {
1934
+ name: string;
1935
+ status: "healthy" | "degraded" | "unhealthy";
1936
+ message?: string;
1937
+ latency?: number;
1938
+ }[];
1939
+ version?: string;
1940
+ uptime?: number;
1941
+ }, {}>;
1942
+ /** API info response */
1943
+ declare const apiInfoResponse: arktype_internal_variants_object_ts.ObjectType<{
1944
+ name: string;
1945
+ version: string;
1946
+ description?: string;
1947
+ environment?: string;
1948
+ documentation?: string;
1949
+ }, {}>;
1950
+ /** CORS config */
1951
+ declare const corsConfig: arktype_internal_variants_object_ts.ObjectType<{
1952
+ origin?: string | boolean | Function | string[];
1953
+ methods?: string[];
1954
+ allowedHeaders?: string[];
1955
+ exposedHeaders?: string[];
1956
+ credentials?: boolean;
1957
+ maxAge?: number;
1958
+ }, {}>;
1959
+ /** Server rate limit config */
1960
+ declare const serverRateLimitConfig: arktype_internal_variants_object_ts.ObjectType<{
1961
+ enabled?: boolean;
1962
+ windowMs?: number;
1963
+ max?: number;
1964
+ keyGenerator?: Function;
1965
+ skip?: Function;
1966
+ message?: string;
1967
+ }, {}>;
1968
+ /** Logger config */
1969
+ declare const loggerConfig: arktype_internal_variants_object_ts.ObjectType<{
1970
+ level?: "error" | "debug" | "info" | "warn";
1971
+ format?: "json" | "pretty" | "combined" | "short";
1972
+ redact?: string[];
1973
+ timestamp?: boolean;
1974
+ }, {}>;
1975
+ /** Server config */
1976
+ declare const serverConfig: arktype_internal_variants_object_ts.ObjectType<{
1977
+ port?: number;
1978
+ host?: string;
1979
+ basePath?: string;
1980
+ cors?: {
1981
+ origin?: string | boolean | Function | string[];
1982
+ methods?: string[];
1983
+ allowedHeaders?: string[];
1984
+ exposedHeaders?: string[];
1985
+ credentials?: boolean;
1986
+ maxAge?: number;
1987
+ };
1988
+ rateLimit?: {
1989
+ enabled?: boolean;
1990
+ windowMs?: number;
1991
+ max?: number;
1992
+ keyGenerator?: Function;
1993
+ skip?: Function;
1994
+ message?: string;
1995
+ };
1996
+ logger?: {
1997
+ level?: "error" | "debug" | "info" | "warn";
1998
+ format?: "json" | "pretty" | "combined" | "short";
1999
+ redact?: string[];
2000
+ timestamp?: boolean;
2001
+ };
2002
+ trustProxy?: boolean;
2003
+ strictRouting?: boolean;
2004
+ caseSensitiveRouting?: boolean;
2005
+ }, {}>;
2006
+ /** Auth context (after auth middleware) */
2007
+ declare const authContext: arktype_internal_variants_object_ts.ObjectType<{
2008
+ userId: string;
2009
+ tenantId?: string;
2010
+ sessionId?: string;
2011
+ roles?: string[];
2012
+ permissions?: string[];
2013
+ }, {}>;
2014
+ /** Request context */
2015
+ declare const requestContext: arktype_internal_variants_object_ts.ObjectType<{
2016
+ requestId: string;
2017
+ startTime?: number;
2018
+ ip?: string;
2019
+ userAgent?: string;
2020
+ auth?: {
2021
+ userId: string;
2022
+ tenantId?: string;
2023
+ sessionId?: string;
2024
+ roles?: string[];
2025
+ permissions?: string[];
2026
+ };
2027
+ }, {}>;
2028
+ type UuidParam = typeof uuidParam.infer;
2029
+ type PaginationQuery = typeof paginationQuery.infer;
2030
+ type CursorPaginationQuery = typeof cursorPaginationQuery.infer;
2031
+ type SearchQuery = typeof searchQuery.infer;
2032
+ type DateRangeQuery = typeof dateRangeQuery.infer;
2033
+ type HealthResponse = typeof healthResponse.infer;
2034
+ type ApiInfoResponse = typeof apiInfoResponse.infer;
2035
+ type CorsConfig = typeof corsConfig.infer;
2036
+ type ServerRateLimitConfig = typeof serverRateLimitConfig.infer;
2037
+ type LoggerConfig = typeof loggerConfig.infer;
2038
+ type ServerConfig = typeof serverConfig.infer;
2039
+ type AuthContext = typeof authContext.infer;
2040
+ type RequestContext = typeof requestContext.infer;
2041
+
2042
+ /**
2043
+ * @parsrun/types
2044
+ * Core types and validation schemas for Pars framework
2045
+ *
2046
+ * Uses ArkType for runtime validation + type inference
2047
+ *
2048
+ * @example
2049
+ * ```typescript
2050
+ * import { user, User, validateWithSchema } from '@parsrun/types';
2051
+ *
2052
+ * // Runtime validation
2053
+ * const result = user(data);
2054
+ * if (result instanceof type.errors) {
2055
+ * console.error(result.summary);
2056
+ * }
2057
+ *
2058
+ * // Type inference
2059
+ * const userData: User = result;
2060
+ * ```
2061
+ */
2062
+
2063
+ /**
2064
+ * Validate data against an ArkType schema
2065
+ * Returns the validated data or throws an error
2066
+ *
2067
+ * @example
2068
+ * ```typescript
2069
+ * const userData = validateWithSchema(user, input);
2070
+ * ```
2071
+ */
2072
+ declare function validateWithSchema<T extends Type>(schema: T, data: unknown): T["infer"];
2073
+ /**
2074
+ * Safely validate data against an ArkType schema
2075
+ * Returns a result object with success/error
2076
+ *
2077
+ * @example
2078
+ * ```typescript
2079
+ * const result = safeValidate(user, input);
2080
+ * if (result.success) {
2081
+ * console.log(result.data);
2082
+ * } else {
2083
+ * console.error(result.errors);
2084
+ * }
2085
+ * ```
2086
+ */
2087
+ declare function safeValidate<T extends Type>(schema: T, data: unknown): {
2088
+ success: true;
2089
+ data: T["infer"];
2090
+ } | {
2091
+ success: false;
2092
+ errors: string[];
2093
+ };
2094
+ /**
2095
+ * Check if data matches an ArkType schema (type guard)
2096
+ *
2097
+ * @example
2098
+ * ```typescript
2099
+ * if (isValid(user, input)) {
2100
+ * // input is typed as User
2101
+ * }
2102
+ * ```
2103
+ */
2104
+ declare function isValid<T extends Type>(schema: T, data: unknown): data is T["infer"];
2105
+ /**
2106
+ * Format ArkType errors to a user-friendly object
2107
+ *
2108
+ * @example
2109
+ * ```typescript
2110
+ * const result = user(input);
2111
+ * if (result instanceof type.errors) {
2112
+ * const formatted = formatErrors(result);
2113
+ * // { email: "must be a valid email", ... }
2114
+ * }
2115
+ * ```
2116
+ */
2117
+ declare function formatErrors(errors: type.errors): Record<string, string>;
2118
+
2119
+ export { type AddJobRequest, type ApiCursorPaginatedResponse, type ApiErrorResponse, type ApiInfoResponse, type ApiPaginatedResponse, type ApiResponse, type AuthContext, type AuthMethod, type CSRFTokenRequest, type CacheConfig, type CacheGetResult, type CacheSetOptions, type CacheStats, type CardDetails, type CheckVerificationStatusRequest, type CheckVerificationStatusResponse, type CloudflareKvConfig, type CookieConfig, type CorsConfig, type CreateCustomerRequest, type CreatePaymentIntentRequest, type CreateRefundRequest, type CreateSubscriptionRequest, type CreateTenantRequest, type CsrfConfig, type CurrencyCode, type CurrentUserResponse, type CurrentUserResponseData, type CursorPagination, type CursorPaginationMeta, type CursorPaginationQuery, type DateRangeQuery, type Email, type EmailAddress, type EmailAttachment, type EmailConfig, type EmailRecipient, type EmailSendResult, type ErrorResponse, type FileMetadata, type GcsStorageConfig, type HealthResponse, type InviteTenantMemberRequest, type IyzicoConfig, type Job, type JobOptions, type JobProgressUpdate, type JobStatus, type JwtConfig, type JwtPayload, type ListFilesOptions, type ListFilesResult, type LocalStorageConfig, type LockoutConfig, type LoggerConfig, type LoginResponse, type LoginResponseData, type LogoutRequest, type MagicLinkConfig, type MemoryCacheConfig, type Money, type MultiTierCacheConfig, type NonEmptyString, type NonNegativeInt, type OAuthProviderConfig, type OAuthProvidersConfig, type OtpConfig, type OtpEmailConfig, type OtpSmsConfig, type PaddleConfig, type Pagination, type PaginationMeta, type PaginationQuery, type ParsAuthConfig, type ParsError, type PasswordConfig, type PaymentCustomer, type PaymentIntent, type PaymentIntentStatus, type PaymentMethod, type PaymentsConfig, type Permission, type PermissionCheck, type PositiveInt, type PostmarkConfig, type Price, type PriceInterval, type ProvidersConfig, type QueueConfig, type QueueListOptions, type QueueStats, type R2StorageConfig, type RateLimitConfig, type RedisCacheConfig, type RedisQueueConfig, type RefreshTokenRequest, type Refund, type RefundStatus, type RequestContext, type RequestOTPRequest, type RequestOTPResponse, type ResendConfig, type ResendOTPRequest, type RevokeAllSessionsRequest, type RevokeAllSessionsResponse, type RevokeSessionRequest, type Role, type S3StorageConfig, type SearchQuery, type SecurityConfig, type SendEmailOptions, type SendTemplateEmailOptions, type SendVerificationEmailRequest, type SendgridConfig, type ServerConfig, type ServerRateLimitConfig, type SesConfig, type Session, type SessionConfig, type SessionStatus, type SignedUrlOptions, type SmtpConfig, type Status, type StorageConfig, type StorageProviderConfig, type StripeConfig, type Subscription, type SubscriptionStatus, type SwitchTenantRequest, type Tenant, type TenantConfig, type TenantMemberListQuery, type TenantMembership, type Timestamp, type TokenInfo, type TotpConfig, type UUID, type UpdateTenantRequest, type UploadOptions, type UpstashCacheConfig, type Url, type User, type UuidParam, type ValidationErrorDetail, type VerifyEmailRequest, type VerifyOTPRequest, type WebAuthnConfig, type WebhookEvent, type WebhookEventType, type WorkerOptions, addJobRequest, apiInfoResponse, authContext, authMethod, cacheConfig, cacheGetResult, cacheSetOptions, cacheStats, cardDetails, checkVerificationStatusRequest, checkVerificationStatusResponse, cloudflareKvConfig, cookieConfig, corsConfig, createCustomerRequest, createPaymentIntentRequest, createRefundRequest, createSubscriptionRequest, createTenantRequest, csrfConfig, csrfTokenRequest, currencyCode, currentUserResponse, currentUserResponseData, cursorPaginatedResponse, cursorPagination, cursorPaginationMeta, cursorPaginationQuery, dateRangeQuery, email, emailAddress, emailAttachment, emailConfig, emailRecipient, emailSendResult, errorResponse, fileMetadata, formatErrors, gcsStorageConfig, healthResponse, inviteTenantMemberRequest, isValid, iyzicoConfig, job, jobOptions, jobProgressUpdate, jobStatus, jwtConfig, jwtPayload, listFilesOptions, listFilesResult, localStorageConfig, lockoutConfig, loggerConfig, loginResponse, loginResponseData, logoutRequest, magicLinkConfig, memoryCacheConfig, money, multiTierCacheConfig, nonEmptyString, nonNegativeInt, oauthProviderConfig, oauthProvidersConfig, otpConfig, otpEmailConfig, otpSmsConfig, paddleConfig, paginatedResponse, pagination, paginationMeta, paginationQuery, parsAuthConfig, parsError, passwordConfig, paymentCustomer, paymentIntent, paymentIntentStatus, paymentMethod, paymentsConfig, permission, permissionCheck, positiveInt, postmarkConfig, price, priceInterval, providersConfig, queueConfig, queueListOptions, queueStats, r2StorageConfig, rateLimitConfig, redisCacheConfig, redisQueueConfig, refreshTokenRequest, refund, refundStatus, requestContext, requestOTPRequest, requestOTPResponse, resendConfig, resendOTPRequest, revokeAllSessionsRequest, revokeAllSessionsResponse, revokeSessionRequest, role, s3StorageConfig, safeValidate, searchQuery, securityConfig, sendEmailOptions, sendTemplateEmailOptions, sendVerificationEmailRequest, sendgridConfig, serverConfig, serverRateLimitConfig, sesConfig, session, sessionConfig, sessionStatus, signedUrlOptions, smtpConfig, status, storageConfig, storageProviderConfig, stripeConfig, subscription, subscriptionStatus, successResponse, switchTenantRequest, tenant, tenantConfig, tenantMemberListQuery, tenantMembership, timestamp, tokenInfo, totpConfig, updateTenantRequest, uploadOptions, upstashCacheConfig, url, user, uuid, uuidParam, validateWithSchema, validationErrorDetail, verifyEmailRequest, verifyOTPRequest, webauthnConfig, webhookEvent, webhookEventType, workerOptions };