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