@authhero/kysely-adapter 0.2.0 → 0.3.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,1632 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import { z } from '@hono/zod-openapi';
4
+ import { Kysely } from 'kysely';
5
+
6
+ export interface SqlBranding {
7
+ tenant_id: string;
8
+ colors_primary?: string;
9
+ colors_page_background_type?: string;
10
+ colors_page_background_start?: string;
11
+ colors_page_background_end?: string;
12
+ colors_page_background_angle_dev?: number;
13
+ logo_url?: string;
14
+ favicon_url?: string;
15
+ font_url?: string;
16
+ }
17
+ export interface Totals {
18
+ start: number;
19
+ limit: number;
20
+ length: number;
21
+ }
22
+ declare const baseUserSchema: z.ZodObject<{
23
+ email: z.ZodOptional<z.ZodString>;
24
+ username: z.ZodOptional<z.ZodString>;
25
+ given_name: z.ZodOptional<z.ZodString>;
26
+ family_name: z.ZodOptional<z.ZodString>;
27
+ nickname: z.ZodOptional<z.ZodString>;
28
+ name: z.ZodOptional<z.ZodString>;
29
+ picture: z.ZodOptional<z.ZodString>;
30
+ locale: z.ZodOptional<z.ZodString>;
31
+ linked_to: z.ZodOptional<z.ZodString>;
32
+ profileData: z.ZodOptional<z.ZodString>;
33
+ user_id: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ email?: string | undefined;
36
+ name?: string | undefined;
37
+ username?: string | undefined;
38
+ given_name?: string | undefined;
39
+ family_name?: string | undefined;
40
+ user_id?: string | undefined;
41
+ profileData?: string | undefined;
42
+ nickname?: string | undefined;
43
+ picture?: string | undefined;
44
+ locale?: string | undefined;
45
+ linked_to?: string | undefined;
46
+ }, {
47
+ email?: string | undefined;
48
+ name?: string | undefined;
49
+ username?: string | undefined;
50
+ given_name?: string | undefined;
51
+ family_name?: string | undefined;
52
+ user_id?: string | undefined;
53
+ profileData?: string | undefined;
54
+ nickname?: string | undefined;
55
+ picture?: string | undefined;
56
+ locale?: string | undefined;
57
+ linked_to?: string | undefined;
58
+ }>;
59
+ export type BaseUser = z.infer<typeof baseUserSchema>;
60
+ declare const userSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
61
+ email: z.ZodOptional<z.ZodString>;
62
+ username: z.ZodOptional<z.ZodString>;
63
+ given_name: z.ZodOptional<z.ZodString>;
64
+ family_name: z.ZodOptional<z.ZodString>;
65
+ nickname: z.ZodOptional<z.ZodString>;
66
+ name: z.ZodOptional<z.ZodString>;
67
+ picture: z.ZodOptional<z.ZodString>;
68
+ locale: z.ZodOptional<z.ZodString>;
69
+ linked_to: z.ZodOptional<z.ZodString>;
70
+ profileData: z.ZodOptional<z.ZodString>;
71
+ user_id: z.ZodOptional<z.ZodString>;
72
+ }, {
73
+ email_verified: z.ZodDefault<z.ZodBoolean>;
74
+ verify_email: z.ZodOptional<z.ZodBoolean>;
75
+ last_ip: z.ZodOptional<z.ZodString>;
76
+ last_login: z.ZodOptional<z.ZodString>;
77
+ user_id: z.ZodOptional<z.ZodString>;
78
+ provider: z.ZodDefault<z.ZodString>;
79
+ connection: z.ZodDefault<z.ZodString>;
80
+ }>, {
81
+ created_at: z.ZodString;
82
+ updated_at: z.ZodString;
83
+ }>, {
84
+ user_id: z.ZodString;
85
+ email: z.ZodString;
86
+ is_social: z.ZodBoolean;
87
+ login_count: z.ZodNumber;
88
+ identities: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ connection: z.ZodString;
90
+ user_id: z.ZodString;
91
+ provider: z.ZodString;
92
+ isSocial: z.ZodBoolean;
93
+ access_token: z.ZodOptional<z.ZodString>;
94
+ access_token_secret: z.ZodOptional<z.ZodString>;
95
+ refresh_token: z.ZodOptional<z.ZodString>;
96
+ profileData: z.ZodOptional<z.ZodObject<{
97
+ email: z.ZodOptional<z.ZodString>;
98
+ email_verified: z.ZodOptional<z.ZodBoolean>;
99
+ name: z.ZodOptional<z.ZodString>;
100
+ username: z.ZodOptional<z.ZodString>;
101
+ given_name: z.ZodOptional<z.ZodString>;
102
+ phone_number: z.ZodOptional<z.ZodString>;
103
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
104
+ family_name: z.ZodOptional<z.ZodString>;
105
+ }, "strip", z.ZodAny, z.objectOutputType<{
106
+ email: z.ZodOptional<z.ZodString>;
107
+ email_verified: z.ZodOptional<z.ZodBoolean>;
108
+ name: z.ZodOptional<z.ZodString>;
109
+ username: z.ZodOptional<z.ZodString>;
110
+ given_name: z.ZodOptional<z.ZodString>;
111
+ phone_number: z.ZodOptional<z.ZodString>;
112
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
113
+ family_name: z.ZodOptional<z.ZodString>;
114
+ }, z.ZodAny, "strip">, z.objectInputType<{
115
+ email: z.ZodOptional<z.ZodString>;
116
+ email_verified: z.ZodOptional<z.ZodBoolean>;
117
+ name: z.ZodOptional<z.ZodString>;
118
+ username: z.ZodOptional<z.ZodString>;
119
+ given_name: z.ZodOptional<z.ZodString>;
120
+ phone_number: z.ZodOptional<z.ZodString>;
121
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
122
+ family_name: z.ZodOptional<z.ZodString>;
123
+ }, z.ZodAny, "strip">>>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ connection: string;
126
+ user_id: string;
127
+ provider: string;
128
+ isSocial: boolean;
129
+ access_token?: string | undefined;
130
+ access_token_secret?: string | undefined;
131
+ refresh_token?: string | undefined;
132
+ profileData?: z.objectOutputType<{
133
+ email: z.ZodOptional<z.ZodString>;
134
+ email_verified: z.ZodOptional<z.ZodBoolean>;
135
+ name: z.ZodOptional<z.ZodString>;
136
+ username: z.ZodOptional<z.ZodString>;
137
+ given_name: z.ZodOptional<z.ZodString>;
138
+ phone_number: z.ZodOptional<z.ZodString>;
139
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
140
+ family_name: z.ZodOptional<z.ZodString>;
141
+ }, z.ZodAny, "strip"> | undefined;
142
+ }, {
143
+ connection: string;
144
+ user_id: string;
145
+ provider: string;
146
+ isSocial: boolean;
147
+ access_token?: string | undefined;
148
+ access_token_secret?: string | undefined;
149
+ refresh_token?: string | undefined;
150
+ profileData?: z.objectInputType<{
151
+ email: z.ZodOptional<z.ZodString>;
152
+ email_verified: z.ZodOptional<z.ZodBoolean>;
153
+ name: z.ZodOptional<z.ZodString>;
154
+ username: z.ZodOptional<z.ZodString>;
155
+ given_name: z.ZodOptional<z.ZodString>;
156
+ phone_number: z.ZodOptional<z.ZodString>;
157
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
158
+ family_name: z.ZodOptional<z.ZodString>;
159
+ }, z.ZodAny, "strip"> | undefined;
160
+ }>, "many">>;
161
+ }>, "strip", z.ZodTypeAny, {
162
+ created_at: string;
163
+ updated_at: string;
164
+ email: string;
165
+ email_verified: boolean;
166
+ connection: string;
167
+ user_id: string;
168
+ provider: string;
169
+ is_social: boolean;
170
+ login_count: number;
171
+ name?: string | undefined;
172
+ username?: string | undefined;
173
+ given_name?: string | undefined;
174
+ family_name?: string | undefined;
175
+ profileData?: string | undefined;
176
+ nickname?: string | undefined;
177
+ picture?: string | undefined;
178
+ locale?: string | undefined;
179
+ linked_to?: string | undefined;
180
+ verify_email?: boolean | undefined;
181
+ last_ip?: string | undefined;
182
+ last_login?: string | undefined;
183
+ identities?: {
184
+ connection: string;
185
+ user_id: string;
186
+ provider: string;
187
+ isSocial: boolean;
188
+ access_token?: string | undefined;
189
+ access_token_secret?: string | undefined;
190
+ refresh_token?: string | undefined;
191
+ profileData?: z.objectOutputType<{
192
+ email: z.ZodOptional<z.ZodString>;
193
+ email_verified: z.ZodOptional<z.ZodBoolean>;
194
+ name: z.ZodOptional<z.ZodString>;
195
+ username: z.ZodOptional<z.ZodString>;
196
+ given_name: z.ZodOptional<z.ZodString>;
197
+ phone_number: z.ZodOptional<z.ZodString>;
198
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
199
+ family_name: z.ZodOptional<z.ZodString>;
200
+ }, z.ZodAny, "strip"> | undefined;
201
+ }[] | undefined;
202
+ }, {
203
+ created_at: string;
204
+ updated_at: string;
205
+ email: string;
206
+ user_id: string;
207
+ is_social: boolean;
208
+ login_count: number;
209
+ email_verified?: boolean | undefined;
210
+ name?: string | undefined;
211
+ username?: string | undefined;
212
+ given_name?: string | undefined;
213
+ family_name?: string | undefined;
214
+ connection?: string | undefined;
215
+ provider?: string | undefined;
216
+ profileData?: string | undefined;
217
+ nickname?: string | undefined;
218
+ picture?: string | undefined;
219
+ locale?: string | undefined;
220
+ linked_to?: string | undefined;
221
+ verify_email?: boolean | undefined;
222
+ last_ip?: string | undefined;
223
+ last_login?: string | undefined;
224
+ identities?: {
225
+ connection: string;
226
+ user_id: string;
227
+ provider: string;
228
+ isSocial: boolean;
229
+ access_token?: string | undefined;
230
+ access_token_secret?: string | undefined;
231
+ refresh_token?: string | undefined;
232
+ profileData?: z.objectInputType<{
233
+ email: z.ZodOptional<z.ZodString>;
234
+ email_verified: z.ZodOptional<z.ZodBoolean>;
235
+ name: z.ZodOptional<z.ZodString>;
236
+ username: z.ZodOptional<z.ZodString>;
237
+ given_name: z.ZodOptional<z.ZodString>;
238
+ phone_number: z.ZodOptional<z.ZodString>;
239
+ phone_verified: z.ZodOptional<z.ZodBoolean>;
240
+ family_name: z.ZodOptional<z.ZodString>;
241
+ }, z.ZodAny, "strip"> | undefined;
242
+ }[] | undefined;
243
+ }>;
244
+ export type User = z.infer<typeof userSchema>;
245
+ declare const LogType: z.ZodEnum<[
246
+ "sapi",
247
+ "ssa",
248
+ "fsa",
249
+ "ss",
250
+ "ssa",
251
+ "fs",
252
+ "s",
253
+ "f",
254
+ "fp",
255
+ "slo",
256
+ "scoa",
257
+ "fcoa",
258
+ "seccft",
259
+ "cls",
260
+ "seacft",
261
+ "serft"
262
+ ]>;
263
+ export type LogType$1 = z.infer<typeof LogType>;
264
+ declare const logSchema: z.ZodObject<{
265
+ type: z.ZodEnum<[
266
+ "sapi",
267
+ "ssa",
268
+ "fsa",
269
+ "ss",
270
+ "ssa",
271
+ "fs",
272
+ "s",
273
+ "f",
274
+ "fp",
275
+ "slo",
276
+ "scoa",
277
+ "fcoa",
278
+ "seccft",
279
+ "cls",
280
+ "seacft",
281
+ "serft"
282
+ ]>;
283
+ date: z.ZodString;
284
+ description: z.ZodOptional<z.ZodString>;
285
+ log_id: z.ZodOptional<z.ZodString>;
286
+ _id: z.ZodOptional<z.ZodString>;
287
+ ip: z.ZodString;
288
+ user_agent: z.ZodString;
289
+ details: z.ZodOptional<z.ZodAny>;
290
+ isMobile: z.ZodBoolean;
291
+ user_id: z.ZodOptional<z.ZodString>;
292
+ user_name: z.ZodOptional<z.ZodString>;
293
+ connection: z.ZodOptional<z.ZodString>;
294
+ connection_id: z.ZodOptional<z.ZodString>;
295
+ client_id: z.ZodOptional<z.ZodString>;
296
+ client_name: z.ZodOptional<z.ZodString>;
297
+ audience: z.ZodOptional<z.ZodString>;
298
+ scope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
299
+ strategy: z.ZodOptional<z.ZodString>;
300
+ strategy_type: z.ZodOptional<z.ZodString>;
301
+ hostname: z.ZodOptional<z.ZodString>;
302
+ auth0_client: z.ZodOptional<z.ZodObject<{
303
+ name: z.ZodString;
304
+ version: z.ZodString;
305
+ env: z.ZodOptional<z.ZodObject<{
306
+ node: z.ZodOptional<z.ZodString>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ node?: string | undefined;
309
+ }, {
310
+ node?: string | undefined;
311
+ }>>;
312
+ }, "strip", z.ZodTypeAny, {
313
+ name: string;
314
+ version: string;
315
+ env?: {
316
+ node?: string | undefined;
317
+ } | undefined;
318
+ }, {
319
+ name: string;
320
+ version: string;
321
+ env?: {
322
+ node?: string | undefined;
323
+ } | undefined;
324
+ }>>;
325
+ }, "strip", z.ZodTypeAny, {
326
+ type: "sapi" | "ssa" | "fsa" | "ss" | "fs" | "s" | "f" | "fp" | "slo" | "scoa" | "fcoa" | "seacft" | "serft" | "cls" | "seccft";
327
+ date: string;
328
+ ip: string;
329
+ user_agent: string;
330
+ isMobile: boolean;
331
+ description?: string | undefined;
332
+ connection?: string | undefined;
333
+ user_id?: string | undefined;
334
+ log_id?: string | undefined;
335
+ _id?: string | undefined;
336
+ details?: any;
337
+ user_name?: string | undefined;
338
+ connection_id?: string | undefined;
339
+ client_id?: string | undefined;
340
+ client_name?: string | undefined;
341
+ audience?: string | undefined;
342
+ scope?: string[] | undefined;
343
+ strategy?: string | undefined;
344
+ strategy_type?: string | undefined;
345
+ hostname?: string | undefined;
346
+ auth0_client?: {
347
+ name: string;
348
+ version: string;
349
+ env?: {
350
+ node?: string | undefined;
351
+ } | undefined;
352
+ } | undefined;
353
+ }, {
354
+ type: "sapi" | "ssa" | "fsa" | "ss" | "fs" | "s" | "f" | "fp" | "slo" | "scoa" | "fcoa" | "seacft" | "serft" | "cls" | "seccft";
355
+ date: string;
356
+ ip: string;
357
+ user_agent: string;
358
+ isMobile: boolean;
359
+ description?: string | undefined;
360
+ connection?: string | undefined;
361
+ user_id?: string | undefined;
362
+ log_id?: string | undefined;
363
+ _id?: string | undefined;
364
+ details?: any;
365
+ user_name?: string | undefined;
366
+ connection_id?: string | undefined;
367
+ client_id?: string | undefined;
368
+ client_name?: string | undefined;
369
+ audience?: string | undefined;
370
+ scope?: string[] | undefined;
371
+ strategy?: string | undefined;
372
+ strategy_type?: string | undefined;
373
+ hostname?: string | undefined;
374
+ auth0_client?: {
375
+ name: string;
376
+ version: string;
377
+ env?: {
378
+ node?: string | undefined;
379
+ } | undefined;
380
+ } | undefined;
381
+ }>;
382
+ export type Log = z.infer<typeof logSchema>;
383
+ export type LogsResponse = Log & {
384
+ log_id: string;
385
+ _id: string;
386
+ };
387
+ declare const applicationSchema: z.ZodObject<z.objectUtil.extendShape<{
388
+ created_at: z.ZodEffects<z.ZodString, string, string>;
389
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
390
+ }, {
391
+ id: z.ZodString;
392
+ name: z.ZodString;
393
+ allowed_web_origins: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
394
+ allowed_callback_urls: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
395
+ allowed_logout_urls: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
396
+ email_validation: z.ZodDefault<z.ZodEnum<[
397
+ "enabled",
398
+ "disabled",
399
+ "enforced"
400
+ ]>>;
401
+ client_secret: z.ZodDefault<z.ZodString>;
402
+ disable_sign_ups: z.ZodDefault<z.ZodBoolean>;
403
+ }>, "strip", z.ZodTypeAny, {
404
+ created_at: string;
405
+ updated_at: string;
406
+ name: string;
407
+ id: string;
408
+ allowed_web_origins: string;
409
+ allowed_callback_urls: string;
410
+ allowed_logout_urls: string;
411
+ email_validation: "enabled" | "disabled" | "enforced";
412
+ client_secret: string;
413
+ disable_sign_ups: boolean;
414
+ }, {
415
+ created_at: string;
416
+ updated_at: string;
417
+ name: string;
418
+ id: string;
419
+ allowed_web_origins?: string | undefined;
420
+ allowed_callback_urls?: string | undefined;
421
+ allowed_logout_urls?: string | undefined;
422
+ email_validation?: "enabled" | "disabled" | "enforced" | undefined;
423
+ client_secret?: string | undefined;
424
+ disable_sign_ups?: boolean | undefined;
425
+ }>;
426
+ export type Application = z.infer<typeof applicationSchema>;
427
+ declare enum AuthorizationResponseType {
428
+ TOKEN = "token",
429
+ TOKEN_ID_TOKEN = "token id_token",
430
+ CODE = "code"
431
+ }
432
+ declare enum AuthorizationResponseMode {
433
+ QUERY = "query",
434
+ FRAGMENT = "fragment",
435
+ FORM_POST = "form_post",
436
+ WEB_MESSAGE = "web_message"
437
+ }
438
+ declare enum CodeChallengeMethod {
439
+ S265 = "S256",
440
+ plain = "plain"
441
+ }
442
+ declare const authenticationCodeSchema: z.ZodObject<{
443
+ created_at: z.ZodString;
444
+ authParams: z.ZodObject<{
445
+ client_id: z.ZodString;
446
+ vendor_id: z.ZodOptional<z.ZodString>;
447
+ response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
448
+ response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
449
+ redirect_uri: z.ZodOptional<z.ZodString>;
450
+ audience: z.ZodOptional<z.ZodString>;
451
+ state: z.ZodOptional<z.ZodString>;
452
+ nonce: z.ZodOptional<z.ZodString>;
453
+ scope: z.ZodOptional<z.ZodString>;
454
+ code_challenge_method: z.ZodOptional<z.ZodNativeEnum<typeof CodeChallengeMethod>>;
455
+ code_challenge: z.ZodOptional<z.ZodString>;
456
+ username: z.ZodOptional<z.ZodString>;
457
+ }, "strip", z.ZodTypeAny, {
458
+ client_id: string;
459
+ username?: string | undefined;
460
+ audience?: string | undefined;
461
+ scope?: string | undefined;
462
+ vendor_id?: string | undefined;
463
+ response_type?: AuthorizationResponseType | undefined;
464
+ response_mode?: AuthorizationResponseMode | undefined;
465
+ redirect_uri?: string | undefined;
466
+ state?: string | undefined;
467
+ nonce?: string | undefined;
468
+ code_challenge_method?: CodeChallengeMethod | undefined;
469
+ code_challenge?: string | undefined;
470
+ }, {
471
+ client_id: string;
472
+ username?: string | undefined;
473
+ audience?: string | undefined;
474
+ scope?: string | undefined;
475
+ vendor_id?: string | undefined;
476
+ response_type?: AuthorizationResponseType | undefined;
477
+ response_mode?: AuthorizationResponseMode | undefined;
478
+ redirect_uri?: string | undefined;
479
+ state?: string | undefined;
480
+ nonce?: string | undefined;
481
+ code_challenge_method?: CodeChallengeMethod | undefined;
482
+ code_challenge?: string | undefined;
483
+ }>;
484
+ code: z.ZodString;
485
+ user_id: z.ZodString;
486
+ expires_at: z.ZodString;
487
+ used_at: z.ZodOptional<z.ZodString>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ code: string;
490
+ created_at: string;
491
+ user_id: string;
492
+ authParams: {
493
+ client_id: string;
494
+ username?: string | undefined;
495
+ audience?: string | undefined;
496
+ scope?: string | undefined;
497
+ vendor_id?: string | undefined;
498
+ response_type?: AuthorizationResponseType | undefined;
499
+ response_mode?: AuthorizationResponseMode | undefined;
500
+ redirect_uri?: string | undefined;
501
+ state?: string | undefined;
502
+ nonce?: string | undefined;
503
+ code_challenge_method?: CodeChallengeMethod | undefined;
504
+ code_challenge?: string | undefined;
505
+ };
506
+ expires_at: string;
507
+ used_at?: string | undefined;
508
+ }, {
509
+ code: string;
510
+ created_at: string;
511
+ user_id: string;
512
+ authParams: {
513
+ client_id: string;
514
+ username?: string | undefined;
515
+ audience?: string | undefined;
516
+ scope?: string | undefined;
517
+ vendor_id?: string | undefined;
518
+ response_type?: AuthorizationResponseType | undefined;
519
+ response_mode?: AuthorizationResponseMode | undefined;
520
+ redirect_uri?: string | undefined;
521
+ state?: string | undefined;
522
+ nonce?: string | undefined;
523
+ code_challenge_method?: CodeChallengeMethod | undefined;
524
+ code_challenge?: string | undefined;
525
+ };
526
+ expires_at: string;
527
+ used_at?: string | undefined;
528
+ }>;
529
+ export type AuthenticationCode = z.infer<typeof authenticationCodeSchema>;
530
+ declare const brandingSchema: z.ZodObject<{
531
+ colors: z.ZodOptional<z.ZodObject<{
532
+ primary: z.ZodString;
533
+ page_background: z.ZodOptional<z.ZodObject<{
534
+ type: z.ZodOptional<z.ZodString>;
535
+ start: z.ZodOptional<z.ZodString>;
536
+ end: z.ZodOptional<z.ZodString>;
537
+ angle_deg: z.ZodOptional<z.ZodNumber>;
538
+ }, "strip", z.ZodTypeAny, {
539
+ start?: string | undefined;
540
+ type?: string | undefined;
541
+ end?: string | undefined;
542
+ angle_deg?: number | undefined;
543
+ }, {
544
+ start?: string | undefined;
545
+ type?: string | undefined;
546
+ end?: string | undefined;
547
+ angle_deg?: number | undefined;
548
+ }>>;
549
+ }, "strip", z.ZodTypeAny, {
550
+ primary: string;
551
+ page_background?: {
552
+ start?: string | undefined;
553
+ type?: string | undefined;
554
+ end?: string | undefined;
555
+ angle_deg?: number | undefined;
556
+ } | undefined;
557
+ }, {
558
+ primary: string;
559
+ page_background?: {
560
+ start?: string | undefined;
561
+ type?: string | undefined;
562
+ end?: string | undefined;
563
+ angle_deg?: number | undefined;
564
+ } | undefined;
565
+ }>>;
566
+ logo_url: z.ZodOptional<z.ZodString>;
567
+ favicon_url: z.ZodOptional<z.ZodString>;
568
+ font: z.ZodOptional<z.ZodObject<{
569
+ url: z.ZodString;
570
+ }, "strip", z.ZodTypeAny, {
571
+ url: string;
572
+ }, {
573
+ url: string;
574
+ }>>;
575
+ }, "strip", z.ZodTypeAny, {
576
+ colors?: {
577
+ primary: string;
578
+ page_background?: {
579
+ start?: string | undefined;
580
+ type?: string | undefined;
581
+ end?: string | undefined;
582
+ angle_deg?: number | undefined;
583
+ } | undefined;
584
+ } | undefined;
585
+ logo_url?: string | undefined;
586
+ favicon_url?: string | undefined;
587
+ font?: {
588
+ url: string;
589
+ } | undefined;
590
+ }, {
591
+ colors?: {
592
+ primary: string;
593
+ page_background?: {
594
+ start?: string | undefined;
595
+ type?: string | undefined;
596
+ end?: string | undefined;
597
+ angle_deg?: number | undefined;
598
+ } | undefined;
599
+ } | undefined;
600
+ logo_url?: string | undefined;
601
+ favicon_url?: string | undefined;
602
+ font?: {
603
+ url: string;
604
+ } | undefined;
605
+ }>;
606
+ export type Branding = z.infer<typeof brandingSchema>;
607
+ export interface Code {
608
+ id: string;
609
+ code: string;
610
+ type: "password_reset" | "validation";
611
+ created_at: string;
612
+ expires_at: string;
613
+ used_at?: string;
614
+ user_id: string;
615
+ }
616
+ declare const connectionInsertSchema: z.ZodObject<{
617
+ id: z.ZodOptional<z.ZodString>;
618
+ name: z.ZodString;
619
+ client_id: z.ZodOptional<z.ZodString>;
620
+ client_secret: z.ZodOptional<z.ZodString>;
621
+ authorization_endpoint: z.ZodOptional<z.ZodString>;
622
+ response_type: z.ZodOptional<z.ZodType<AuthorizationResponseType, z.ZodTypeDef, AuthorizationResponseType>>;
623
+ response_mode: z.ZodOptional<z.ZodType<AuthorizationResponseMode, z.ZodTypeDef, AuthorizationResponseMode>>;
624
+ private_key: z.ZodOptional<z.ZodString>;
625
+ kid: z.ZodOptional<z.ZodString>;
626
+ team_id: z.ZodOptional<z.ZodString>;
627
+ token_endpoint: z.ZodOptional<z.ZodString>;
628
+ token_exchange_basic_auth: z.ZodOptional<z.ZodBoolean>;
629
+ userinfo_endpoint: z.ZodOptional<z.ZodString>;
630
+ scope: z.ZodOptional<z.ZodString>;
631
+ }, "strip", z.ZodTypeAny, {
632
+ name: string;
633
+ client_id?: string | undefined;
634
+ scope?: string | undefined;
635
+ id?: string | undefined;
636
+ client_secret?: string | undefined;
637
+ response_type?: AuthorizationResponseType | undefined;
638
+ response_mode?: AuthorizationResponseMode | undefined;
639
+ authorization_endpoint?: string | undefined;
640
+ private_key?: string | undefined;
641
+ kid?: string | undefined;
642
+ team_id?: string | undefined;
643
+ token_endpoint?: string | undefined;
644
+ token_exchange_basic_auth?: boolean | undefined;
645
+ userinfo_endpoint?: string | undefined;
646
+ }, {
647
+ name: string;
648
+ client_id?: string | undefined;
649
+ scope?: string | undefined;
650
+ id?: string | undefined;
651
+ client_secret?: string | undefined;
652
+ response_type?: AuthorizationResponseType | undefined;
653
+ response_mode?: AuthorizationResponseMode | undefined;
654
+ authorization_endpoint?: string | undefined;
655
+ private_key?: string | undefined;
656
+ kid?: string | undefined;
657
+ team_id?: string | undefined;
658
+ token_endpoint?: string | undefined;
659
+ token_exchange_basic_auth?: boolean | undefined;
660
+ userinfo_endpoint?: string | undefined;
661
+ }>;
662
+ export type ConnectionInsert = z.infer<typeof connectionInsertSchema>;
663
+ declare const connectionSchema: z.ZodObject<z.objectUtil.extendShape<{
664
+ id: z.ZodString;
665
+ created_at: z.ZodEffects<z.ZodString, string, string>;
666
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
667
+ }, {
668
+ id: z.ZodOptional<z.ZodString>;
669
+ name: z.ZodString;
670
+ client_id: z.ZodOptional<z.ZodString>;
671
+ client_secret: z.ZodOptional<z.ZodString>;
672
+ authorization_endpoint: z.ZodOptional<z.ZodString>;
673
+ response_type: z.ZodOptional<z.ZodType<AuthorizationResponseType, z.ZodTypeDef, AuthorizationResponseType>>;
674
+ response_mode: z.ZodOptional<z.ZodType<AuthorizationResponseMode, z.ZodTypeDef, AuthorizationResponseMode>>;
675
+ private_key: z.ZodOptional<z.ZodString>;
676
+ kid: z.ZodOptional<z.ZodString>;
677
+ team_id: z.ZodOptional<z.ZodString>;
678
+ token_endpoint: z.ZodOptional<z.ZodString>;
679
+ token_exchange_basic_auth: z.ZodOptional<z.ZodBoolean>;
680
+ userinfo_endpoint: z.ZodOptional<z.ZodString>;
681
+ scope: z.ZodOptional<z.ZodString>;
682
+ }>, "strip", z.ZodTypeAny, {
683
+ created_at: string;
684
+ updated_at: string;
685
+ name: string;
686
+ client_id?: string | undefined;
687
+ scope?: string | undefined;
688
+ id?: string | undefined;
689
+ client_secret?: string | undefined;
690
+ response_type?: AuthorizationResponseType | undefined;
691
+ response_mode?: AuthorizationResponseMode | undefined;
692
+ authorization_endpoint?: string | undefined;
693
+ private_key?: string | undefined;
694
+ kid?: string | undefined;
695
+ team_id?: string | undefined;
696
+ token_endpoint?: string | undefined;
697
+ token_exchange_basic_auth?: boolean | undefined;
698
+ userinfo_endpoint?: string | undefined;
699
+ }, {
700
+ created_at: string;
701
+ updated_at: string;
702
+ name: string;
703
+ client_id?: string | undefined;
704
+ scope?: string | undefined;
705
+ id?: string | undefined;
706
+ client_secret?: string | undefined;
707
+ response_type?: AuthorizationResponseType | undefined;
708
+ response_mode?: AuthorizationResponseMode | undefined;
709
+ authorization_endpoint?: string | undefined;
710
+ private_key?: string | undefined;
711
+ kid?: string | undefined;
712
+ team_id?: string | undefined;
713
+ token_endpoint?: string | undefined;
714
+ token_exchange_basic_auth?: boolean | undefined;
715
+ userinfo_endpoint?: string | undefined;
716
+ }>;
717
+ export type Connection = z.infer<typeof connectionSchema>;
718
+ declare const domainSchema: z.ZodObject<z.objectUtil.extendShape<{
719
+ created_at: z.ZodString;
720
+ updated_at: z.ZodString;
721
+ }, {
722
+ id: z.ZodString;
723
+ domain: z.ZodString;
724
+ dkim_private_key: z.ZodOptional<z.ZodString>;
725
+ dkim_public_key: z.ZodOptional<z.ZodString>;
726
+ email_api_key: z.ZodOptional<z.ZodString>;
727
+ email_service: z.ZodEnum<[
728
+ "mailgun",
729
+ "mailchannels"
730
+ ]>;
731
+ }>, "strip", z.ZodTypeAny, {
732
+ created_at: string;
733
+ updated_at: string;
734
+ id: string;
735
+ domain: string;
736
+ email_service: "mailgun" | "mailchannels";
737
+ dkim_private_key?: string | undefined;
738
+ dkim_public_key?: string | undefined;
739
+ email_api_key?: string | undefined;
740
+ }, {
741
+ created_at: string;
742
+ updated_at: string;
743
+ id: string;
744
+ domain: string;
745
+ email_service: "mailgun" | "mailchannels";
746
+ dkim_private_key?: string | undefined;
747
+ dkim_public_key?: string | undefined;
748
+ email_api_key?: string | undefined;
749
+ }>;
750
+ export type Domain = z.infer<typeof domainSchema>;
751
+ declare const hookInsertSchema: z.ZodObject<{
752
+ trigger_id: z.ZodEnum<[
753
+ "post-user-registration",
754
+ "post-user-login"
755
+ ]>;
756
+ enabled: z.ZodDefault<z.ZodBoolean>;
757
+ url: z.ZodString;
758
+ hook_id: z.ZodOptional<z.ZodString>;
759
+ }, "strip", z.ZodTypeAny, {
760
+ enabled: boolean;
761
+ url: string;
762
+ trigger_id: "post-user-registration" | "post-user-login";
763
+ hook_id?: string | undefined;
764
+ }, {
765
+ url: string;
766
+ trigger_id: "post-user-registration" | "post-user-login";
767
+ enabled?: boolean | undefined;
768
+ hook_id?: string | undefined;
769
+ }>;
770
+ export type HookInsert = z.infer<typeof hookInsertSchema>;
771
+ declare const hookSchema: z.ZodObject<z.objectUtil.extendShape<{
772
+ trigger_id: z.ZodEnum<[
773
+ "post-user-registration",
774
+ "post-user-login"
775
+ ]>;
776
+ enabled: z.ZodDefault<z.ZodBoolean>;
777
+ url: z.ZodString;
778
+ hook_id: z.ZodOptional<z.ZodString>;
779
+ }, {
780
+ hook_id: z.ZodString;
781
+ created_at: z.ZodString;
782
+ updated_at: z.ZodString;
783
+ }>, "strip", z.ZodTypeAny, {
784
+ created_at: string;
785
+ updated_at: string;
786
+ enabled: boolean;
787
+ url: string;
788
+ trigger_id: "post-user-registration" | "post-user-login";
789
+ hook_id: string;
790
+ }, {
791
+ created_at: string;
792
+ updated_at: string;
793
+ url: string;
794
+ trigger_id: "post-user-registration" | "post-user-login";
795
+ hook_id: string;
796
+ enabled?: boolean | undefined;
797
+ }>;
798
+ export type Hook = z.infer<typeof hookSchema>;
799
+ declare const otpInsertSchema: z.ZodObject<{
800
+ id: z.ZodString;
801
+ email: z.ZodString;
802
+ code: z.ZodString;
803
+ ip: z.ZodOptional<z.ZodString>;
804
+ send: z.ZodEnum<[
805
+ "code",
806
+ "link"
807
+ ]>;
808
+ authParams: z.ZodObject<{
809
+ client_id: z.ZodString;
810
+ vendor_id: z.ZodOptional<z.ZodString>;
811
+ response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
812
+ response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
813
+ redirect_uri: z.ZodOptional<z.ZodString>;
814
+ audience: z.ZodOptional<z.ZodString>;
815
+ state: z.ZodOptional<z.ZodString>;
816
+ nonce: z.ZodOptional<z.ZodString>;
817
+ scope: z.ZodOptional<z.ZodString>;
818
+ code_challenge_method: z.ZodOptional<z.ZodNativeEnum<typeof CodeChallengeMethod>>;
819
+ code_challenge: z.ZodOptional<z.ZodString>;
820
+ username: z.ZodOptional<z.ZodString>;
821
+ }, "strip", z.ZodTypeAny, {
822
+ client_id: string;
823
+ username?: string | undefined;
824
+ audience?: string | undefined;
825
+ scope?: string | undefined;
826
+ vendor_id?: string | undefined;
827
+ response_type?: AuthorizationResponseType | undefined;
828
+ response_mode?: AuthorizationResponseMode | undefined;
829
+ redirect_uri?: string | undefined;
830
+ state?: string | undefined;
831
+ nonce?: string | undefined;
832
+ code_challenge_method?: CodeChallengeMethod | undefined;
833
+ code_challenge?: string | undefined;
834
+ }, {
835
+ client_id: string;
836
+ username?: string | undefined;
837
+ audience?: string | undefined;
838
+ scope?: string | undefined;
839
+ vendor_id?: string | undefined;
840
+ response_type?: AuthorizationResponseType | undefined;
841
+ response_mode?: AuthorizationResponseMode | undefined;
842
+ redirect_uri?: string | undefined;
843
+ state?: string | undefined;
844
+ nonce?: string | undefined;
845
+ code_challenge_method?: CodeChallengeMethod | undefined;
846
+ code_challenge?: string | undefined;
847
+ }>;
848
+ expires_at: z.ZodString;
849
+ used_at: z.ZodOptional<z.ZodString>;
850
+ user_id: z.ZodOptional<z.ZodString>;
851
+ }, "strip", z.ZodTypeAny, {
852
+ code: string;
853
+ email: string;
854
+ id: string;
855
+ authParams: {
856
+ client_id: string;
857
+ username?: string | undefined;
858
+ audience?: string | undefined;
859
+ scope?: string | undefined;
860
+ vendor_id?: string | undefined;
861
+ response_type?: AuthorizationResponseType | undefined;
862
+ response_mode?: AuthorizationResponseMode | undefined;
863
+ redirect_uri?: string | undefined;
864
+ state?: string | undefined;
865
+ nonce?: string | undefined;
866
+ code_challenge_method?: CodeChallengeMethod | undefined;
867
+ code_challenge?: string | undefined;
868
+ };
869
+ expires_at: string;
870
+ send: "code" | "link";
871
+ user_id?: string | undefined;
872
+ ip?: string | undefined;
873
+ used_at?: string | undefined;
874
+ }, {
875
+ code: string;
876
+ email: string;
877
+ id: string;
878
+ authParams: {
879
+ client_id: string;
880
+ username?: string | undefined;
881
+ audience?: string | undefined;
882
+ scope?: string | undefined;
883
+ vendor_id?: string | undefined;
884
+ response_type?: AuthorizationResponseType | undefined;
885
+ response_mode?: AuthorizationResponseMode | undefined;
886
+ redirect_uri?: string | undefined;
887
+ state?: string | undefined;
888
+ nonce?: string | undefined;
889
+ code_challenge_method?: CodeChallengeMethod | undefined;
890
+ code_challenge?: string | undefined;
891
+ };
892
+ expires_at: string;
893
+ send: "code" | "link";
894
+ user_id?: string | undefined;
895
+ ip?: string | undefined;
896
+ used_at?: string | undefined;
897
+ }>;
898
+ export type OTPInsert = z.infer<typeof otpInsertSchema>;
899
+ declare const otpSchema: z.ZodObject<{
900
+ id: z.ZodString;
901
+ email: z.ZodString;
902
+ code: z.ZodString;
903
+ ip: z.ZodOptional<z.ZodString>;
904
+ send: z.ZodEnum<[
905
+ "code",
906
+ "link"
907
+ ]>;
908
+ authParams: z.ZodObject<{
909
+ client_id: z.ZodString;
910
+ vendor_id: z.ZodOptional<z.ZodString>;
911
+ response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
912
+ response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
913
+ redirect_uri: z.ZodOptional<z.ZodString>;
914
+ audience: z.ZodOptional<z.ZodString>;
915
+ state: z.ZodOptional<z.ZodString>;
916
+ nonce: z.ZodOptional<z.ZodString>;
917
+ scope: z.ZodOptional<z.ZodString>;
918
+ code_challenge_method: z.ZodOptional<z.ZodNativeEnum<typeof CodeChallengeMethod>>;
919
+ code_challenge: z.ZodOptional<z.ZodString>;
920
+ username: z.ZodOptional<z.ZodString>;
921
+ }, "strip", z.ZodTypeAny, {
922
+ client_id: string;
923
+ username?: string | undefined;
924
+ audience?: string | undefined;
925
+ scope?: string | undefined;
926
+ vendor_id?: string | undefined;
927
+ response_type?: AuthorizationResponseType | undefined;
928
+ response_mode?: AuthorizationResponseMode | undefined;
929
+ redirect_uri?: string | undefined;
930
+ state?: string | undefined;
931
+ nonce?: string | undefined;
932
+ code_challenge_method?: CodeChallengeMethod | undefined;
933
+ code_challenge?: string | undefined;
934
+ }, {
935
+ client_id: string;
936
+ username?: string | undefined;
937
+ audience?: string | undefined;
938
+ scope?: string | undefined;
939
+ vendor_id?: string | undefined;
940
+ response_type?: AuthorizationResponseType | undefined;
941
+ response_mode?: AuthorizationResponseMode | undefined;
942
+ redirect_uri?: string | undefined;
943
+ state?: string | undefined;
944
+ nonce?: string | undefined;
945
+ code_challenge_method?: CodeChallengeMethod | undefined;
946
+ code_challenge?: string | undefined;
947
+ }>;
948
+ expires_at: z.ZodString;
949
+ used_at: z.ZodOptional<z.ZodString>;
950
+ user_id: z.ZodOptional<z.ZodString>;
951
+ created_at: z.ZodString;
952
+ }, "strip", z.ZodTypeAny, {
953
+ code: string;
954
+ created_at: string;
955
+ email: string;
956
+ id: string;
957
+ authParams: {
958
+ client_id: string;
959
+ username?: string | undefined;
960
+ audience?: string | undefined;
961
+ scope?: string | undefined;
962
+ vendor_id?: string | undefined;
963
+ response_type?: AuthorizationResponseType | undefined;
964
+ response_mode?: AuthorizationResponseMode | undefined;
965
+ redirect_uri?: string | undefined;
966
+ state?: string | undefined;
967
+ nonce?: string | undefined;
968
+ code_challenge_method?: CodeChallengeMethod | undefined;
969
+ code_challenge?: string | undefined;
970
+ };
971
+ expires_at: string;
972
+ send: "code" | "link";
973
+ user_id?: string | undefined;
974
+ ip?: string | undefined;
975
+ used_at?: string | undefined;
976
+ }, {
977
+ code: string;
978
+ created_at: string;
979
+ email: string;
980
+ id: string;
981
+ authParams: {
982
+ client_id: string;
983
+ username?: string | undefined;
984
+ audience?: string | undefined;
985
+ scope?: string | undefined;
986
+ vendor_id?: string | undefined;
987
+ response_type?: AuthorizationResponseType | undefined;
988
+ response_mode?: AuthorizationResponseMode | undefined;
989
+ redirect_uri?: string | undefined;
990
+ state?: string | undefined;
991
+ nonce?: string | undefined;
992
+ code_challenge_method?: CodeChallengeMethod | undefined;
993
+ code_challenge?: string | undefined;
994
+ };
995
+ expires_at: string;
996
+ send: "code" | "link";
997
+ user_id?: string | undefined;
998
+ ip?: string | undefined;
999
+ used_at?: string | undefined;
1000
+ }>;
1001
+ export type OTP = z.infer<typeof otpSchema>;
1002
+ export interface PasswordResponse {
1003
+ valid: boolean;
1004
+ message: string;
1005
+ }
1006
+ export interface PasswordParams {
1007
+ user_id: string;
1008
+ password: string;
1009
+ }
1010
+ declare const sessionInsertSchema: z.ZodObject<{
1011
+ session_id: z.ZodString;
1012
+ client_id: z.ZodString;
1013
+ expires_at: z.ZodString;
1014
+ used_at: z.ZodString;
1015
+ deleted_at: z.ZodOptional<z.ZodString>;
1016
+ user_id: z.ZodString;
1017
+ }, "strip", z.ZodTypeAny, {
1018
+ user_id: string;
1019
+ client_id: string;
1020
+ expires_at: string;
1021
+ used_at: string;
1022
+ session_id: string;
1023
+ deleted_at?: string | undefined;
1024
+ }, {
1025
+ user_id: string;
1026
+ client_id: string;
1027
+ expires_at: string;
1028
+ used_at: string;
1029
+ session_id: string;
1030
+ deleted_at?: string | undefined;
1031
+ }>;
1032
+ export type SessionInsert = z.infer<typeof sessionInsertSchema>;
1033
+ declare const sessionSchema: z.ZodObject<{
1034
+ session_id: z.ZodString;
1035
+ client_id: z.ZodString;
1036
+ expires_at: z.ZodString;
1037
+ used_at: z.ZodString;
1038
+ deleted_at: z.ZodOptional<z.ZodString>;
1039
+ user_id: z.ZodString;
1040
+ created_at: z.ZodString;
1041
+ }, "strip", z.ZodTypeAny, {
1042
+ created_at: string;
1043
+ user_id: string;
1044
+ client_id: string;
1045
+ expires_at: string;
1046
+ used_at: string;
1047
+ session_id: string;
1048
+ deleted_at?: string | undefined;
1049
+ }, {
1050
+ created_at: string;
1051
+ user_id: string;
1052
+ client_id: string;
1053
+ expires_at: string;
1054
+ used_at: string;
1055
+ session_id: string;
1056
+ deleted_at?: string | undefined;
1057
+ }>;
1058
+ export type Session = z.infer<typeof sessionSchema>;
1059
+ export interface Certificate {
1060
+ private_key: string;
1061
+ public_key: string;
1062
+ kid: string;
1063
+ created_at: string;
1064
+ revoked_at?: string;
1065
+ }
1066
+ export interface Tenant {
1067
+ id: string;
1068
+ name: string;
1069
+ audience: string;
1070
+ sender_email: string;
1071
+ sender_name: string;
1072
+ support_url?: string;
1073
+ logo?: string;
1074
+ primary_color?: string;
1075
+ secondary_color?: string;
1076
+ language?: string;
1077
+ created_at: string;
1078
+ updated_at: string;
1079
+ }
1080
+ export interface Ticket {
1081
+ id: string;
1082
+ tenant_id: string;
1083
+ client_id: string;
1084
+ email: string;
1085
+ authParams?: {
1086
+ nonce?: string;
1087
+ state?: string;
1088
+ scope?: string;
1089
+ response_type?: AuthorizationResponseType;
1090
+ response_mode?: AuthorizationResponseMode;
1091
+ redirect_uri?: string;
1092
+ };
1093
+ created_at: Date;
1094
+ expires_at: Date;
1095
+ used_at?: Date;
1096
+ }
1097
+ declare const universalLoginSessionInsertSchema: z.ZodObject<{
1098
+ id: z.ZodString;
1099
+ expires_at: z.ZodString;
1100
+ auth0Client: z.ZodOptional<z.ZodString>;
1101
+ authParams: z.ZodObject<{
1102
+ client_id: z.ZodString;
1103
+ vendor_id: z.ZodOptional<z.ZodString>;
1104
+ response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
1105
+ response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
1106
+ redirect_uri: z.ZodOptional<z.ZodString>;
1107
+ audience: z.ZodOptional<z.ZodString>;
1108
+ state: z.ZodOptional<z.ZodString>;
1109
+ nonce: z.ZodOptional<z.ZodString>;
1110
+ scope: z.ZodOptional<z.ZodString>;
1111
+ code_challenge_method: z.ZodOptional<z.ZodNativeEnum<typeof CodeChallengeMethod>>;
1112
+ code_challenge: z.ZodOptional<z.ZodString>;
1113
+ username: z.ZodOptional<z.ZodString>;
1114
+ }, "strip", z.ZodTypeAny, {
1115
+ client_id: string;
1116
+ username?: string | undefined;
1117
+ audience?: string | undefined;
1118
+ scope?: string | undefined;
1119
+ vendor_id?: string | undefined;
1120
+ response_type?: AuthorizationResponseType | undefined;
1121
+ response_mode?: AuthorizationResponseMode | undefined;
1122
+ redirect_uri?: string | undefined;
1123
+ state?: string | undefined;
1124
+ nonce?: string | undefined;
1125
+ code_challenge_method?: CodeChallengeMethod | undefined;
1126
+ code_challenge?: string | undefined;
1127
+ }, {
1128
+ client_id: string;
1129
+ username?: string | undefined;
1130
+ audience?: string | undefined;
1131
+ scope?: string | undefined;
1132
+ vendor_id?: string | undefined;
1133
+ response_type?: AuthorizationResponseType | undefined;
1134
+ response_mode?: AuthorizationResponseMode | undefined;
1135
+ redirect_uri?: string | undefined;
1136
+ state?: string | undefined;
1137
+ nonce?: string | undefined;
1138
+ code_challenge_method?: CodeChallengeMethod | undefined;
1139
+ code_challenge?: string | undefined;
1140
+ }>;
1141
+ }, "strip", z.ZodTypeAny, {
1142
+ id: string;
1143
+ authParams: {
1144
+ client_id: string;
1145
+ username?: string | undefined;
1146
+ audience?: string | undefined;
1147
+ scope?: string | undefined;
1148
+ vendor_id?: string | undefined;
1149
+ response_type?: AuthorizationResponseType | undefined;
1150
+ response_mode?: AuthorizationResponseMode | undefined;
1151
+ redirect_uri?: string | undefined;
1152
+ state?: string | undefined;
1153
+ nonce?: string | undefined;
1154
+ code_challenge_method?: CodeChallengeMethod | undefined;
1155
+ code_challenge?: string | undefined;
1156
+ };
1157
+ expires_at: string;
1158
+ auth0Client?: string | undefined;
1159
+ }, {
1160
+ id: string;
1161
+ authParams: {
1162
+ client_id: string;
1163
+ username?: string | undefined;
1164
+ audience?: string | undefined;
1165
+ scope?: string | undefined;
1166
+ vendor_id?: string | undefined;
1167
+ response_type?: AuthorizationResponseType | undefined;
1168
+ response_mode?: AuthorizationResponseMode | undefined;
1169
+ redirect_uri?: string | undefined;
1170
+ state?: string | undefined;
1171
+ nonce?: string | undefined;
1172
+ code_challenge_method?: CodeChallengeMethod | undefined;
1173
+ code_challenge?: string | undefined;
1174
+ };
1175
+ expires_at: string;
1176
+ auth0Client?: string | undefined;
1177
+ }>;
1178
+ export type UniversalLoginSessionInsert = z.infer<typeof universalLoginSessionInsertSchema>;
1179
+ declare const universalLoginSessionSchema: z.ZodObject<{
1180
+ created_at: z.ZodString;
1181
+ updated_at: z.ZodString;
1182
+ id: z.ZodString;
1183
+ expires_at: z.ZodString;
1184
+ auth0Client: z.ZodOptional<z.ZodString>;
1185
+ authParams: z.ZodObject<{
1186
+ client_id: z.ZodString;
1187
+ vendor_id: z.ZodOptional<z.ZodString>;
1188
+ response_type: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseType>>;
1189
+ response_mode: z.ZodOptional<z.ZodNativeEnum<typeof AuthorizationResponseMode>>;
1190
+ redirect_uri: z.ZodOptional<z.ZodString>;
1191
+ audience: z.ZodOptional<z.ZodString>;
1192
+ state: z.ZodOptional<z.ZodString>;
1193
+ nonce: z.ZodOptional<z.ZodString>;
1194
+ scope: z.ZodOptional<z.ZodString>;
1195
+ code_challenge_method: z.ZodOptional<z.ZodNativeEnum<typeof CodeChallengeMethod>>;
1196
+ code_challenge: z.ZodOptional<z.ZodString>;
1197
+ username: z.ZodOptional<z.ZodString>;
1198
+ }, "strip", z.ZodTypeAny, {
1199
+ client_id: string;
1200
+ username?: string | undefined;
1201
+ audience?: string | undefined;
1202
+ scope?: string | undefined;
1203
+ vendor_id?: string | undefined;
1204
+ response_type?: AuthorizationResponseType | undefined;
1205
+ response_mode?: AuthorizationResponseMode | undefined;
1206
+ redirect_uri?: string | undefined;
1207
+ state?: string | undefined;
1208
+ nonce?: string | undefined;
1209
+ code_challenge_method?: CodeChallengeMethod | undefined;
1210
+ code_challenge?: string | undefined;
1211
+ }, {
1212
+ client_id: string;
1213
+ username?: string | undefined;
1214
+ audience?: string | undefined;
1215
+ scope?: string | undefined;
1216
+ vendor_id?: string | undefined;
1217
+ response_type?: AuthorizationResponseType | undefined;
1218
+ response_mode?: AuthorizationResponseMode | undefined;
1219
+ redirect_uri?: string | undefined;
1220
+ state?: string | undefined;
1221
+ nonce?: string | undefined;
1222
+ code_challenge_method?: CodeChallengeMethod | undefined;
1223
+ code_challenge?: string | undefined;
1224
+ }>;
1225
+ }, "strip", z.ZodTypeAny, {
1226
+ created_at: string;
1227
+ updated_at: string;
1228
+ id: string;
1229
+ authParams: {
1230
+ client_id: string;
1231
+ username?: string | undefined;
1232
+ audience?: string | undefined;
1233
+ scope?: string | undefined;
1234
+ vendor_id?: string | undefined;
1235
+ response_type?: AuthorizationResponseType | undefined;
1236
+ response_mode?: AuthorizationResponseMode | undefined;
1237
+ redirect_uri?: string | undefined;
1238
+ state?: string | undefined;
1239
+ nonce?: string | undefined;
1240
+ code_challenge_method?: CodeChallengeMethod | undefined;
1241
+ code_challenge?: string | undefined;
1242
+ };
1243
+ expires_at: string;
1244
+ auth0Client?: string | undefined;
1245
+ }, {
1246
+ created_at: string;
1247
+ updated_at: string;
1248
+ id: string;
1249
+ authParams: {
1250
+ client_id: string;
1251
+ username?: string | undefined;
1252
+ audience?: string | undefined;
1253
+ scope?: string | undefined;
1254
+ vendor_id?: string | undefined;
1255
+ response_type?: AuthorizationResponseType | undefined;
1256
+ response_mode?: AuthorizationResponseMode | undefined;
1257
+ redirect_uri?: string | undefined;
1258
+ state?: string | undefined;
1259
+ nonce?: string | undefined;
1260
+ code_challenge_method?: CodeChallengeMethod | undefined;
1261
+ code_challenge?: string | undefined;
1262
+ };
1263
+ expires_at: string;
1264
+ auth0Client?: string | undefined;
1265
+ }>;
1266
+ export type UniversalLoginSession = z.infer<typeof universalLoginSessionSchema>;
1267
+ export interface CodesAdapter {
1268
+ create: (tenant_id: string, authCode: Code) => Promise<void>;
1269
+ list: (tenant_id: string, user_id: string) => Promise<Code[]>;
1270
+ }
1271
+ export interface OTPAdapter {
1272
+ create: (tenant_id: string, authCode: OTPInsert) => Promise<void>;
1273
+ list: (tenant_id: string, email: string) => Promise<OTP[]>;
1274
+ remove: (tenant_id: string, id: string) => Promise<boolean>;
1275
+ }
1276
+ export interface PasswordsAdapter {
1277
+ create: (tenant_id: string, params: PasswordParams) => Promise<void>;
1278
+ update: (tenant_id: string, params: PasswordParams) => Promise<boolean>;
1279
+ validate: (tenant_id: string, params: PasswordParams) => Promise<PasswordResponse>;
1280
+ }
1281
+ export interface ListParams {
1282
+ page: number;
1283
+ per_page: number;
1284
+ include_totals: boolean;
1285
+ q?: string;
1286
+ sort?: {
1287
+ sort_by: string;
1288
+ sort_order: "asc" | "desc";
1289
+ };
1290
+ }
1291
+ export interface ListSesssionsResponse extends Totals {
1292
+ sessions: Session[];
1293
+ }
1294
+ export interface SessionsAdapter {
1295
+ create: (tenant_id: string, session: SessionInsert) => Promise<Session>;
1296
+ get: (tenant_id: string, id: string) => Promise<Session | null>;
1297
+ list(tenantId: string, params: ListParams): Promise<ListSesssionsResponse>;
1298
+ update: (tenant_id: string, id: string, session: {
1299
+ used_at: string;
1300
+ }) => Promise<boolean>;
1301
+ remove: (tenant_id: string, id: string) => Promise<boolean>;
1302
+ }
1303
+ export interface CreateTenantParams {
1304
+ name: string;
1305
+ audience: string;
1306
+ sender_name: string;
1307
+ sender_email: string;
1308
+ id?: string;
1309
+ }
1310
+ export interface TenantsDataAdapter {
1311
+ create(params: CreateTenantParams): Promise<Tenant>;
1312
+ get(id: string): Promise<Tenant | null>;
1313
+ list(params: ListParams): Promise<{
1314
+ tenants: Tenant[];
1315
+ totals?: Totals;
1316
+ }>;
1317
+ update(id: string, tenant: Partial<Tenant>): Promise<void>;
1318
+ remove(tenantId: string): Promise<boolean>;
1319
+ }
1320
+ export interface TicketsAdapter {
1321
+ create: (ticket: Ticket) => Promise<void>;
1322
+ get: (tenant_id: string, id: string) => Promise<Ticket | null>;
1323
+ remove: (tenant_id: string, id: string) => Promise<void>;
1324
+ }
1325
+ export interface ListUsersResponse extends Totals {
1326
+ users: User[];
1327
+ }
1328
+ export interface UserDataAdapter {
1329
+ get(tenant_id: string, id: string): Promise<User | null>;
1330
+ create(tenantId: string, user: User): Promise<User>;
1331
+ remove(tenantId: string, id: string): Promise<boolean>;
1332
+ list(tenantId: string, params: ListParams): Promise<ListUsersResponse>;
1333
+ update(tenantId: string, id: string, user: Partial<User>): Promise<boolean>;
1334
+ unlink(tenantId: string, id: string, provider: string, linked_user_id: string): Promise<boolean>;
1335
+ }
1336
+ export interface ListLogsResponse extends Totals {
1337
+ logs: LogsResponse[];
1338
+ }
1339
+ export interface LogsDataAdapter {
1340
+ create(tenantId: string, params: Log): Promise<Log>;
1341
+ list(tenantId: string, params: ListParams): Promise<ListLogsResponse>;
1342
+ get(tenantId: string, logId: string): Promise<LogsResponse | null>;
1343
+ }
1344
+ export interface CreateApplicationParams {
1345
+ name: string;
1346
+ allowed_web_origins: string;
1347
+ allowed_callback_urls: string;
1348
+ allowed_logout_urls: string;
1349
+ email_validation: "enabled" | "disabled" | "enforced";
1350
+ client_secret: string;
1351
+ id: string;
1352
+ disable_sign_ups: boolean;
1353
+ }
1354
+ export interface ApplicationsAdapter {
1355
+ create(tenant_id: string, params: CreateApplicationParams): Promise<Application>;
1356
+ get(tenant_id: string, id: string): Promise<Application | null>;
1357
+ remove(tenant_id: string, id: string): Promise<boolean>;
1358
+ list(tenant_id: string, params: ListParams): Promise<{
1359
+ applications: Application[];
1360
+ totals?: Totals;
1361
+ }>;
1362
+ update(tenant_id: string, id: string, application: Partial<Application>): Promise<boolean>;
1363
+ }
1364
+ export interface UniversalLoginSessionsAdapter {
1365
+ create: (tenant_id: string, session: UniversalLoginSessionInsert) => Promise<UniversalLoginSession>;
1366
+ update: (tenant_id: string, id: string, session: UniversalLoginSession) => Promise<boolean>;
1367
+ get: (id: string) => Promise<UniversalLoginSession | null>;
1368
+ }
1369
+ export interface ListConnectionsResponse extends Totals {
1370
+ connections: Connection[];
1371
+ }
1372
+ export interface ConnectionsAdapter {
1373
+ create(tenant_id: string, params: ConnectionInsert): Promise<Connection>;
1374
+ remove(tenant_id: string, connection_id: string): Promise<boolean>;
1375
+ get(tenant_id: string, connection_id: string): Promise<Connection | null>;
1376
+ update(tenant_id: string, connection_id: string, params: Partial<ConnectionInsert>): Promise<boolean>;
1377
+ list(tenant_id: string, params: ListParams): Promise<ListConnectionsResponse>;
1378
+ }
1379
+ export interface ListDomainsResponse extends Totals {
1380
+ domains: Domain[];
1381
+ }
1382
+ export interface DomainsAdapter {
1383
+ create(tenant_id: string, params: Domain): Promise<Domain>;
1384
+ list(tenant_id: string, params: ListParams): Promise<ListDomainsResponse>;
1385
+ }
1386
+ export interface KeysAdapter {
1387
+ create: (key: Certificate) => Promise<void>;
1388
+ list: () => Promise<Certificate[]>;
1389
+ revoke: (kid: string, revoke_at: Date) => Promise<boolean>;
1390
+ }
1391
+ export interface BrandingAdapter {
1392
+ set: (tenant_id: string, authCode: Branding) => Promise<void>;
1393
+ get: (tenant_id: string) => Promise<Branding | null>;
1394
+ }
1395
+ export interface AuthenticationCodesAdapter {
1396
+ create: (tenant_id: string, authCode: AuthenticationCode) => Promise<void>;
1397
+ get: (tenant_id: string, code: string) => Promise<AuthenticationCode>;
1398
+ }
1399
+ export interface ListHooksResponse extends Totals {
1400
+ hooks: Hook[];
1401
+ }
1402
+ export interface HooksAdapter {
1403
+ create: (tenant_id: string, hook: HookInsert) => Promise<Hook>;
1404
+ remove: (tenant_id: string, hook_id: string) => Promise<boolean>;
1405
+ get: (tenant_id: string, hook_id: string) => Promise<Hook | null>;
1406
+ update: (tenant_id: string, hook_id: string, hook: Partial<HookInsert>) => Promise<boolean>;
1407
+ list: (tenant_id: string, params: ListParams) => Promise<ListHooksResponse>;
1408
+ }
1409
+ export interface SqlAuthenticationCode {
1410
+ code: string;
1411
+ tenant_id: string;
1412
+ client_id: string;
1413
+ user_id: string;
1414
+ nonce?: string;
1415
+ state?: string;
1416
+ scope?: string;
1417
+ response_type?: AuthorizationResponseType;
1418
+ response_mode?: AuthorizationResponseMode;
1419
+ redirect_uri?: string;
1420
+ created_at: string;
1421
+ expires_at: string;
1422
+ used_at?: string;
1423
+ }
1424
+ export interface SqlUser extends BaseUser {
1425
+ user_id: string;
1426
+ email_verified: number;
1427
+ last_ip?: string;
1428
+ last_login?: string;
1429
+ login_count: number;
1430
+ provider: string;
1431
+ connection: string;
1432
+ is_social: number;
1433
+ tenant_id: string;
1434
+ created_at: string;
1435
+ updated_at: string;
1436
+ }
1437
+ export interface SqlOTP {
1438
+ id: string;
1439
+ tenant_id: string;
1440
+ client_id: string;
1441
+ email: string;
1442
+ code: string;
1443
+ send: "link" | "code";
1444
+ nonce?: string;
1445
+ state?: string;
1446
+ scope?: string;
1447
+ response_type?: AuthorizationResponseType;
1448
+ redirect_uri?: string;
1449
+ created_at: string;
1450
+ expires_at: string;
1451
+ used_at?: string;
1452
+ user_id?: string;
1453
+ }
1454
+ export interface SqlPassword {
1455
+ tenant_id: string;
1456
+ user_id: string;
1457
+ password: string;
1458
+ created_at: string;
1459
+ updated_at: string;
1460
+ }
1461
+ export interface SqlTicket {
1462
+ id: string;
1463
+ tenant_id: string;
1464
+ client_id: string;
1465
+ email: string;
1466
+ nonce?: string;
1467
+ state?: string;
1468
+ scope?: string;
1469
+ response_type?: AuthorizationResponseType;
1470
+ response_mode?: AuthorizationResponseMode;
1471
+ redirect_uri?: string;
1472
+ created_at: string;
1473
+ expires_at: string;
1474
+ used_at?: string;
1475
+ }
1476
+ export interface SqlUniversalLoginSession {
1477
+ id: string;
1478
+ tenant_id: string;
1479
+ client_id: string;
1480
+ email?: string;
1481
+ nonce?: string;
1482
+ state?: string;
1483
+ scope?: string;
1484
+ response_type?: AuthorizationResponseType;
1485
+ response_mode?: AuthorizationResponseMode;
1486
+ redirect_uri?: string;
1487
+ code_challenge_method?: string;
1488
+ code_challenge?: string;
1489
+ username?: string;
1490
+ vendor_id?: string;
1491
+ audience?: string;
1492
+ created_at: string;
1493
+ expires_at: string;
1494
+ updated_at: string;
1495
+ }
1496
+ export interface SqlLog {
1497
+ id: string;
1498
+ tenant_id: string;
1499
+ type: LogType$1;
1500
+ date: string;
1501
+ description?: string;
1502
+ ip: string;
1503
+ user_agent: string;
1504
+ details?: string;
1505
+ auth0_client?: string;
1506
+ isMobile?: number;
1507
+ user_id?: string;
1508
+ user_name?: string;
1509
+ connection?: string;
1510
+ connection_id?: string;
1511
+ client_id?: string;
1512
+ client_name?: string;
1513
+ audience?: string;
1514
+ scope?: string;
1515
+ strategy?: string;
1516
+ strategy_type?: string;
1517
+ hostname?: string;
1518
+ session_connection?: string;
1519
+ }
1520
+ export interface SqlSession {
1521
+ tenant_id: string;
1522
+ created_at: string;
1523
+ user_id: string;
1524
+ client_id: string;
1525
+ expires_at: string;
1526
+ used_at: string;
1527
+ id: string;
1528
+ deleted_at?: string | undefined;
1529
+ }
1530
+ export interface Database {
1531
+ authentication_codes: SqlAuthenticationCode;
1532
+ branding: SqlBranding & {
1533
+ tenant_id: string;
1534
+ };
1535
+ codes: Code & {
1536
+ tenant_id: string;
1537
+ };
1538
+ domains: Domain & {
1539
+ tenant_id: string;
1540
+ };
1541
+ hooks: Hook & {
1542
+ tenant_id: string;
1543
+ };
1544
+ keys: Certificate;
1545
+ users: SqlUser;
1546
+ applications: Application & {
1547
+ tenant_id: string;
1548
+ };
1549
+ connections: Connection & {
1550
+ tenant_id: string;
1551
+ };
1552
+ otps: SqlOTP;
1553
+ passwords: SqlPassword;
1554
+ sessions: SqlSession;
1555
+ tenants: Tenant;
1556
+ tickets: SqlTicket;
1557
+ universal_login_sessions: SqlUniversalLoginSession;
1558
+ logs: SqlLog;
1559
+ }
1560
+ declare function createAdapters(db: Kysely<Database>): {
1561
+ applications: ApplicationsAdapter;
1562
+ authenticationCodes: AuthenticationCodesAdapter;
1563
+ branding: BrandingAdapter;
1564
+ clients: {
1565
+ get: (applicationId: string) => Promise<{
1566
+ name: string;
1567
+ id: string;
1568
+ allowed_web_origins: string[];
1569
+ allowed_callback_urls: string[];
1570
+ allowed_logout_urls: string[];
1571
+ email_validation: "enabled" | "disabled" | "enforced";
1572
+ client_secret: string;
1573
+ disable_sign_ups: boolean;
1574
+ domains: {
1575
+ domain: string;
1576
+ dkim_private_key?: string | undefined;
1577
+ dkim_public_key?: string | undefined;
1578
+ email_api_key?: string | undefined;
1579
+ email_service?: "mailgun" | "mailchannels" | undefined;
1580
+ }[];
1581
+ tenant_id: string;
1582
+ tenant: {
1583
+ name: string;
1584
+ sender_email: string;
1585
+ sender_name: string;
1586
+ audience?: string | undefined;
1587
+ logo?: string | undefined;
1588
+ primary_color?: string | undefined;
1589
+ secondary_color?: string | undefined;
1590
+ support_url?: string | undefined;
1591
+ language?: string | undefined;
1592
+ };
1593
+ connections: {
1594
+ created_at?: string | undefined;
1595
+ updated_at?: string | undefined;
1596
+ name?: string | undefined;
1597
+ client_id?: string | undefined;
1598
+ scope?: string | undefined;
1599
+ id?: string | undefined;
1600
+ client_secret?: string | undefined;
1601
+ response_type?: AuthorizationResponseType | undefined;
1602
+ response_mode?: AuthorizationResponseMode | undefined;
1603
+ authorization_endpoint?: string | undefined;
1604
+ private_key?: string | undefined;
1605
+ kid?: string | undefined;
1606
+ team_id?: string | undefined;
1607
+ token_endpoint?: string | undefined;
1608
+ token_exchange_basic_auth?: boolean | undefined;
1609
+ userinfo_endpoint?: string | undefined;
1610
+ }[];
1611
+ }>;
1612
+ };
1613
+ keys: KeysAdapter;
1614
+ users: UserDataAdapter;
1615
+ sessions: SessionsAdapter;
1616
+ tenants: TenantsDataAdapter;
1617
+ tickets: TicketsAdapter;
1618
+ universalLoginSessions: UniversalLoginSessionsAdapter;
1619
+ OTP: OTPAdapter;
1620
+ logs: LogsDataAdapter;
1621
+ passwords: PasswordsAdapter;
1622
+ codes: CodesAdapter;
1623
+ connections: ConnectionsAdapter;
1624
+ domains: DomainsAdapter;
1625
+ hooks: HooksAdapter;
1626
+ };
1627
+
1628
+ export {
1629
+ createAdapters as default,
1630
+ };
1631
+
1632
+ export {};