@syncello/auth 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -0
- package/dist/chunk-OZ26T3ZA.js +263 -0
- package/dist/chunk-OZ26T3ZA.js.map +1 -0
- package/dist/cli/index.js +1100 -0
- package/dist/index.cjs +5751 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1339 -0
- package/dist/index.d.ts +1339 -0
- package/dist/index.js +5359 -0
- package/dist/index.js.map +1 -0
- package/dist/schema/index.cjs +292 -0
- package/dist/schema/index.cjs.map +1 -0
- package/dist/schema/index.d.cts +671 -0
- package/dist/schema/index.d.ts +671 -0
- package/dist/schema/index.js +13 -0
- package/dist/schema/index.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @syncello/auth Schema Definitions
|
|
3
|
+
* Plain TypeScript objects for CLI-based Drizzle code generation
|
|
4
|
+
*/
|
|
5
|
+
declare const SCHEMA_VERSION = "2026.05.1";
|
|
6
|
+
type ColumnType = 'uuid' | 'varchar' | 'text' | 'boolean' | 'integer' | 'bigint' | 'timestamp' | 'json' | 'serial';
|
|
7
|
+
type ColumnDefinition = {
|
|
8
|
+
type: ColumnType | string;
|
|
9
|
+
length?: number;
|
|
10
|
+
primaryKey?: boolean;
|
|
11
|
+
notNull?: boolean;
|
|
12
|
+
unique?: boolean;
|
|
13
|
+
default?: string | number | boolean | null;
|
|
14
|
+
references?: {
|
|
15
|
+
table: string;
|
|
16
|
+
column: string;
|
|
17
|
+
onDelete?: 'cascade' | 'set null' | 'restrict' | 'no action';
|
|
18
|
+
};
|
|
19
|
+
mode?: 'number';
|
|
20
|
+
withTimezone?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type IndexDefinition = {
|
|
23
|
+
name: string;
|
|
24
|
+
columns: string[];
|
|
25
|
+
unique?: boolean;
|
|
26
|
+
};
|
|
27
|
+
type TableDefinition = {
|
|
28
|
+
columns: Record<string, ColumnDefinition>;
|
|
29
|
+
indexes?: IndexDefinition[];
|
|
30
|
+
};
|
|
31
|
+
type EnumDefinition = {
|
|
32
|
+
name: string;
|
|
33
|
+
values: readonly string[];
|
|
34
|
+
};
|
|
35
|
+
declare const enums: {
|
|
36
|
+
readonly identifierType: {
|
|
37
|
+
readonly name: "identifier_type_enum";
|
|
38
|
+
readonly values: readonly ["email", "ip"];
|
|
39
|
+
};
|
|
40
|
+
readonly twoFactorMethod: {
|
|
41
|
+
readonly name: "two_factor_method";
|
|
42
|
+
readonly values: readonly ["totp", "email"];
|
|
43
|
+
};
|
|
44
|
+
readonly deviceType: {
|
|
45
|
+
readonly name: "device_type";
|
|
46
|
+
readonly values: readonly ["desktop", "mobile", "tablet"];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
declare const tables: {
|
|
50
|
+
readonly users: {
|
|
51
|
+
readonly columns: {
|
|
52
|
+
readonly id: {
|
|
53
|
+
readonly type: "uuid";
|
|
54
|
+
readonly primaryKey: true;
|
|
55
|
+
readonly default: "gen_random_uuid()";
|
|
56
|
+
};
|
|
57
|
+
readonly email: {
|
|
58
|
+
readonly type: "varchar";
|
|
59
|
+
readonly length: 255;
|
|
60
|
+
readonly notNull: true;
|
|
61
|
+
readonly unique: true;
|
|
62
|
+
};
|
|
63
|
+
readonly name: {
|
|
64
|
+
readonly type: "text";
|
|
65
|
+
};
|
|
66
|
+
readonly hashedPassword: {
|
|
67
|
+
readonly type: "varchar";
|
|
68
|
+
readonly length: 255;
|
|
69
|
+
};
|
|
70
|
+
readonly pepperKid: {
|
|
71
|
+
readonly type: "varchar";
|
|
72
|
+
readonly length: 10;
|
|
73
|
+
readonly default: "v1";
|
|
74
|
+
};
|
|
75
|
+
readonly emailVerified: {
|
|
76
|
+
readonly type: "boolean";
|
|
77
|
+
readonly default: false;
|
|
78
|
+
};
|
|
79
|
+
readonly isAdmin: {
|
|
80
|
+
readonly type: "boolean";
|
|
81
|
+
readonly default: false;
|
|
82
|
+
readonly notNull: true;
|
|
83
|
+
};
|
|
84
|
+
readonly sessionVersion: {
|
|
85
|
+
readonly type: "integer";
|
|
86
|
+
readonly default: 1;
|
|
87
|
+
};
|
|
88
|
+
readonly lockedUntil: {
|
|
89
|
+
readonly type: "bigint";
|
|
90
|
+
readonly mode: "number";
|
|
91
|
+
};
|
|
92
|
+
readonly failedLoginCount: {
|
|
93
|
+
readonly type: "integer";
|
|
94
|
+
readonly default: 0;
|
|
95
|
+
};
|
|
96
|
+
readonly emailBounced: {
|
|
97
|
+
readonly type: "boolean";
|
|
98
|
+
readonly default: false;
|
|
99
|
+
readonly notNull: true;
|
|
100
|
+
};
|
|
101
|
+
readonly emailBouncedAt: {
|
|
102
|
+
readonly type: "timestamp";
|
|
103
|
+
readonly withTimezone: true;
|
|
104
|
+
};
|
|
105
|
+
readonly emailComplained: {
|
|
106
|
+
readonly type: "boolean";
|
|
107
|
+
readonly default: false;
|
|
108
|
+
readonly notNull: true;
|
|
109
|
+
};
|
|
110
|
+
readonly emailComplainedAt: {
|
|
111
|
+
readonly type: "timestamp";
|
|
112
|
+
readonly withTimezone: true;
|
|
113
|
+
};
|
|
114
|
+
readonly activatedAt: {
|
|
115
|
+
readonly type: "timestamp";
|
|
116
|
+
readonly withTimezone: true;
|
|
117
|
+
};
|
|
118
|
+
readonly deletedAt: {
|
|
119
|
+
readonly type: "timestamp";
|
|
120
|
+
readonly withTimezone: true;
|
|
121
|
+
};
|
|
122
|
+
readonly scheduledPurgeAt: {
|
|
123
|
+
readonly type: "timestamp";
|
|
124
|
+
readonly withTimezone: true;
|
|
125
|
+
};
|
|
126
|
+
readonly createdAt: {
|
|
127
|
+
readonly type: "timestamp";
|
|
128
|
+
readonly withTimezone: true;
|
|
129
|
+
readonly default: "now()";
|
|
130
|
+
};
|
|
131
|
+
readonly updatedAt: {
|
|
132
|
+
readonly type: "timestamp";
|
|
133
|
+
readonly withTimezone: true;
|
|
134
|
+
readonly default: "now()";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly indexes: [{
|
|
138
|
+
readonly name: "idx_users_email";
|
|
139
|
+
readonly columns: ["email"];
|
|
140
|
+
}];
|
|
141
|
+
};
|
|
142
|
+
readonly sessions: {
|
|
143
|
+
readonly columns: {
|
|
144
|
+
readonly id: {
|
|
145
|
+
readonly type: "varchar";
|
|
146
|
+
readonly length: 128;
|
|
147
|
+
readonly primaryKey: true;
|
|
148
|
+
};
|
|
149
|
+
readonly userId: {
|
|
150
|
+
readonly type: "uuid";
|
|
151
|
+
readonly notNull: true;
|
|
152
|
+
readonly references: {
|
|
153
|
+
readonly table: "users";
|
|
154
|
+
readonly column: "id";
|
|
155
|
+
readonly onDelete: "cascade";
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
readonly expiresAt: {
|
|
159
|
+
readonly type: "bigint";
|
|
160
|
+
readonly mode: "number";
|
|
161
|
+
readonly notNull: true;
|
|
162
|
+
};
|
|
163
|
+
readonly createdAt: {
|
|
164
|
+
readonly type: "bigint";
|
|
165
|
+
readonly mode: "number";
|
|
166
|
+
readonly notNull: true;
|
|
167
|
+
};
|
|
168
|
+
readonly lastActiveAt: {
|
|
169
|
+
readonly type: "bigint";
|
|
170
|
+
readonly mode: "number";
|
|
171
|
+
};
|
|
172
|
+
readonly fingerprint: {
|
|
173
|
+
readonly type: "varchar";
|
|
174
|
+
readonly length: 64;
|
|
175
|
+
};
|
|
176
|
+
readonly ipAddress: {
|
|
177
|
+
readonly type: "varchar";
|
|
178
|
+
readonly length: 45;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
readonly indexes: [{
|
|
182
|
+
readonly name: "idx_sessions_expires";
|
|
183
|
+
readonly columns: ["expiresAt"];
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "idx_sessions_user";
|
|
186
|
+
readonly columns: ["userId"];
|
|
187
|
+
}];
|
|
188
|
+
};
|
|
189
|
+
readonly user2faMethods: {
|
|
190
|
+
readonly columns: {
|
|
191
|
+
readonly id: {
|
|
192
|
+
readonly type: "uuid";
|
|
193
|
+
readonly primaryKey: true;
|
|
194
|
+
readonly default: "gen_random_uuid()";
|
|
195
|
+
};
|
|
196
|
+
readonly userId: {
|
|
197
|
+
readonly type: "uuid";
|
|
198
|
+
readonly notNull: true;
|
|
199
|
+
readonly references: {
|
|
200
|
+
readonly table: "users";
|
|
201
|
+
readonly column: "id";
|
|
202
|
+
readonly onDelete: "cascade";
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
readonly method: {
|
|
206
|
+
readonly type: "two_factor_method";
|
|
207
|
+
readonly notNull: true;
|
|
208
|
+
};
|
|
209
|
+
readonly totpSecret: {
|
|
210
|
+
readonly type: "varchar";
|
|
211
|
+
readonly length: 256;
|
|
212
|
+
};
|
|
213
|
+
readonly lastTotpCounter: {
|
|
214
|
+
readonly type: "bigint";
|
|
215
|
+
readonly mode: "number";
|
|
216
|
+
};
|
|
217
|
+
readonly isPrimary: {
|
|
218
|
+
readonly type: "boolean";
|
|
219
|
+
readonly default: false;
|
|
220
|
+
readonly notNull: true;
|
|
221
|
+
};
|
|
222
|
+
readonly verifiedAt: {
|
|
223
|
+
readonly type: "bigint";
|
|
224
|
+
readonly mode: "number";
|
|
225
|
+
readonly notNull: true;
|
|
226
|
+
};
|
|
227
|
+
readonly createdAt: {
|
|
228
|
+
readonly type: "bigint";
|
|
229
|
+
readonly mode: "number";
|
|
230
|
+
readonly notNull: true;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
readonly indexes: [{
|
|
234
|
+
readonly name: "user_2fa_methods_user_method_idx";
|
|
235
|
+
readonly columns: ["userId", "method"];
|
|
236
|
+
readonly unique: true;
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "user_2fa_methods_user_idx";
|
|
239
|
+
readonly columns: ["userId"];
|
|
240
|
+
}];
|
|
241
|
+
};
|
|
242
|
+
readonly userBackupCodes: {
|
|
243
|
+
readonly columns: {
|
|
244
|
+
readonly id: {
|
|
245
|
+
readonly type: "uuid";
|
|
246
|
+
readonly primaryKey: true;
|
|
247
|
+
readonly default: "gen_random_uuid()";
|
|
248
|
+
};
|
|
249
|
+
readonly userId: {
|
|
250
|
+
readonly type: "uuid";
|
|
251
|
+
readonly notNull: true;
|
|
252
|
+
readonly references: {
|
|
253
|
+
readonly table: "users";
|
|
254
|
+
readonly column: "id";
|
|
255
|
+
readonly onDelete: "cascade";
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
readonly codeHash: {
|
|
259
|
+
readonly type: "varchar";
|
|
260
|
+
readonly length: 255;
|
|
261
|
+
readonly notNull: true;
|
|
262
|
+
};
|
|
263
|
+
readonly usedAt: {
|
|
264
|
+
readonly type: "bigint";
|
|
265
|
+
readonly mode: "number";
|
|
266
|
+
};
|
|
267
|
+
readonly createdAt: {
|
|
268
|
+
readonly type: "bigint";
|
|
269
|
+
readonly mode: "number";
|
|
270
|
+
readonly notNull: true;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
readonly indexes: [{
|
|
274
|
+
readonly name: "user_backup_codes_user_idx";
|
|
275
|
+
readonly columns: ["userId"];
|
|
276
|
+
}];
|
|
277
|
+
};
|
|
278
|
+
readonly userTrustedDevices: {
|
|
279
|
+
readonly columns: {
|
|
280
|
+
readonly id: {
|
|
281
|
+
readonly type: "uuid";
|
|
282
|
+
readonly primaryKey: true;
|
|
283
|
+
readonly default: "gen_random_uuid()";
|
|
284
|
+
};
|
|
285
|
+
readonly userId: {
|
|
286
|
+
readonly type: "uuid";
|
|
287
|
+
readonly notNull: true;
|
|
288
|
+
readonly references: {
|
|
289
|
+
readonly table: "users";
|
|
290
|
+
readonly column: "id";
|
|
291
|
+
readonly onDelete: "cascade";
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
readonly tokenHash: {
|
|
295
|
+
readonly type: "varchar";
|
|
296
|
+
readonly length: 128;
|
|
297
|
+
readonly notNull: true;
|
|
298
|
+
};
|
|
299
|
+
readonly deviceName: {
|
|
300
|
+
readonly type: "varchar";
|
|
301
|
+
readonly length: 255;
|
|
302
|
+
readonly notNull: true;
|
|
303
|
+
};
|
|
304
|
+
readonly deviceType: {
|
|
305
|
+
readonly type: "device_type";
|
|
306
|
+
readonly notNull: true;
|
|
307
|
+
readonly default: "desktop";
|
|
308
|
+
};
|
|
309
|
+
readonly ipAddress: {
|
|
310
|
+
readonly type: "varchar";
|
|
311
|
+
readonly length: 45;
|
|
312
|
+
readonly notNull: true;
|
|
313
|
+
};
|
|
314
|
+
readonly expiresAt: {
|
|
315
|
+
readonly type: "bigint";
|
|
316
|
+
readonly mode: "number";
|
|
317
|
+
readonly notNull: true;
|
|
318
|
+
};
|
|
319
|
+
readonly lastUsedAt: {
|
|
320
|
+
readonly type: "bigint";
|
|
321
|
+
readonly mode: "number";
|
|
322
|
+
readonly notNull: true;
|
|
323
|
+
};
|
|
324
|
+
readonly createdAt: {
|
|
325
|
+
readonly type: "bigint";
|
|
326
|
+
readonly mode: "number";
|
|
327
|
+
readonly notNull: true;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
readonly indexes: [{
|
|
331
|
+
readonly name: "user_trusted_devices_user_idx";
|
|
332
|
+
readonly columns: ["userId"];
|
|
333
|
+
}, {
|
|
334
|
+
readonly name: "user_trusted_devices_token_idx";
|
|
335
|
+
readonly columns: ["tokenHash"];
|
|
336
|
+
}, {
|
|
337
|
+
readonly name: "user_trusted_devices_expires_idx";
|
|
338
|
+
readonly columns: ["expiresAt"];
|
|
339
|
+
}];
|
|
340
|
+
};
|
|
341
|
+
readonly emailVerificationTokens: {
|
|
342
|
+
readonly columns: {
|
|
343
|
+
readonly tokenHash: {
|
|
344
|
+
readonly type: "varchar";
|
|
345
|
+
readonly length: 128;
|
|
346
|
+
readonly primaryKey: true;
|
|
347
|
+
};
|
|
348
|
+
readonly userId: {
|
|
349
|
+
readonly type: "uuid";
|
|
350
|
+
readonly notNull: true;
|
|
351
|
+
readonly references: {
|
|
352
|
+
readonly table: "users";
|
|
353
|
+
readonly column: "id";
|
|
354
|
+
readonly onDelete: "cascade";
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
readonly email: {
|
|
358
|
+
readonly type: "varchar";
|
|
359
|
+
readonly length: 255;
|
|
360
|
+
readonly notNull: true;
|
|
361
|
+
};
|
|
362
|
+
readonly expiresAt: {
|
|
363
|
+
readonly type: "bigint";
|
|
364
|
+
readonly mode: "number";
|
|
365
|
+
readonly notNull: true;
|
|
366
|
+
};
|
|
367
|
+
readonly createdAt: {
|
|
368
|
+
readonly type: "bigint";
|
|
369
|
+
readonly mode: "number";
|
|
370
|
+
readonly notNull: true;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
readonly indexes: [{
|
|
374
|
+
readonly name: "idx_email_verification_user";
|
|
375
|
+
readonly columns: ["userId"];
|
|
376
|
+
}, {
|
|
377
|
+
readonly name: "idx_email_verification_expires";
|
|
378
|
+
readonly columns: ["expiresAt"];
|
|
379
|
+
}];
|
|
380
|
+
};
|
|
381
|
+
readonly passwordResetTokens: {
|
|
382
|
+
readonly columns: {
|
|
383
|
+
readonly tokenHash: {
|
|
384
|
+
readonly type: "varchar";
|
|
385
|
+
readonly length: 128;
|
|
386
|
+
readonly primaryKey: true;
|
|
387
|
+
};
|
|
388
|
+
readonly userId: {
|
|
389
|
+
readonly type: "uuid";
|
|
390
|
+
readonly notNull: true;
|
|
391
|
+
readonly references: {
|
|
392
|
+
readonly table: "users";
|
|
393
|
+
readonly column: "id";
|
|
394
|
+
readonly onDelete: "cascade";
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
readonly expiresAt: {
|
|
398
|
+
readonly type: "bigint";
|
|
399
|
+
readonly mode: "number";
|
|
400
|
+
readonly notNull: true;
|
|
401
|
+
};
|
|
402
|
+
readonly used: {
|
|
403
|
+
readonly type: "boolean";
|
|
404
|
+
readonly default: false;
|
|
405
|
+
};
|
|
406
|
+
readonly createdAt: {
|
|
407
|
+
readonly type: "bigint";
|
|
408
|
+
readonly mode: "number";
|
|
409
|
+
readonly notNull: true;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
readonly indexes: [{
|
|
413
|
+
readonly name: "idx_password_reset_user";
|
|
414
|
+
readonly columns: ["userId"];
|
|
415
|
+
}, {
|
|
416
|
+
readonly name: "idx_password_reset_expires";
|
|
417
|
+
readonly columns: ["expiresAt"];
|
|
418
|
+
}];
|
|
419
|
+
};
|
|
420
|
+
readonly emailChangeTokens: {
|
|
421
|
+
readonly columns: {
|
|
422
|
+
readonly id: {
|
|
423
|
+
readonly type: "uuid";
|
|
424
|
+
readonly primaryKey: true;
|
|
425
|
+
readonly default: "gen_random_uuid()";
|
|
426
|
+
};
|
|
427
|
+
readonly userId: {
|
|
428
|
+
readonly type: "uuid";
|
|
429
|
+
readonly notNull: true;
|
|
430
|
+
readonly references: {
|
|
431
|
+
readonly table: "users";
|
|
432
|
+
readonly column: "id";
|
|
433
|
+
readonly onDelete: "cascade";
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
readonly newEmail: {
|
|
437
|
+
readonly type: "varchar";
|
|
438
|
+
readonly length: 255;
|
|
439
|
+
readonly notNull: true;
|
|
440
|
+
};
|
|
441
|
+
readonly tokenHash: {
|
|
442
|
+
readonly type: "varchar";
|
|
443
|
+
readonly length: 128;
|
|
444
|
+
readonly notNull: true;
|
|
445
|
+
};
|
|
446
|
+
readonly cancelTokenHash: {
|
|
447
|
+
readonly type: "varchar";
|
|
448
|
+
readonly length: 128;
|
|
449
|
+
readonly notNull: true;
|
|
450
|
+
};
|
|
451
|
+
readonly expiresAt: {
|
|
452
|
+
readonly type: "bigint";
|
|
453
|
+
readonly mode: "number";
|
|
454
|
+
readonly notNull: true;
|
|
455
|
+
};
|
|
456
|
+
readonly createdAt: {
|
|
457
|
+
readonly type: "bigint";
|
|
458
|
+
readonly mode: "number";
|
|
459
|
+
readonly notNull: true;
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
readonly indexes: [{
|
|
463
|
+
readonly name: "idx_email_change_tokens_user";
|
|
464
|
+
readonly columns: ["userId"];
|
|
465
|
+
readonly unique: true;
|
|
466
|
+
}, {
|
|
467
|
+
readonly name: "idx_email_change_tokens_token";
|
|
468
|
+
readonly columns: ["tokenHash"];
|
|
469
|
+
}, {
|
|
470
|
+
readonly name: "idx_email_change_tokens_cancel";
|
|
471
|
+
readonly columns: ["cancelTokenHash"];
|
|
472
|
+
}, {
|
|
473
|
+
readonly name: "idx_email_change_tokens_expires";
|
|
474
|
+
readonly columns: ["expiresAt"];
|
|
475
|
+
}];
|
|
476
|
+
};
|
|
477
|
+
readonly emailEvents: {
|
|
478
|
+
readonly columns: {
|
|
479
|
+
readonly id: {
|
|
480
|
+
readonly type: "uuid";
|
|
481
|
+
readonly primaryKey: true;
|
|
482
|
+
readonly default: "gen_random_uuid()";
|
|
483
|
+
};
|
|
484
|
+
readonly emailId: {
|
|
485
|
+
readonly type: "text";
|
|
486
|
+
readonly notNull: true;
|
|
487
|
+
};
|
|
488
|
+
readonly userId: {
|
|
489
|
+
readonly type: "uuid";
|
|
490
|
+
readonly references: {
|
|
491
|
+
readonly table: "users";
|
|
492
|
+
readonly column: "id";
|
|
493
|
+
readonly onDelete: "cascade";
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
readonly eventType: {
|
|
497
|
+
readonly type: "text";
|
|
498
|
+
readonly notNull: true;
|
|
499
|
+
};
|
|
500
|
+
readonly emailAddress: {
|
|
501
|
+
readonly type: "text";
|
|
502
|
+
readonly notNull: true;
|
|
503
|
+
};
|
|
504
|
+
readonly metadata: {
|
|
505
|
+
readonly type: "json";
|
|
506
|
+
};
|
|
507
|
+
readonly createdAt: {
|
|
508
|
+
readonly type: "timestamp";
|
|
509
|
+
readonly withTimezone: true;
|
|
510
|
+
readonly default: "now()";
|
|
511
|
+
readonly notNull: true;
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
readonly indexes: [{
|
|
515
|
+
readonly name: "email_events_email_address_idx";
|
|
516
|
+
readonly columns: ["emailAddress"];
|
|
517
|
+
}, {
|
|
518
|
+
readonly name: "email_events_user_id_idx";
|
|
519
|
+
readonly columns: ["userId"];
|
|
520
|
+
}, {
|
|
521
|
+
readonly name: "email_events_email_id_event_type_idx";
|
|
522
|
+
readonly columns: ["emailId", "eventType"];
|
|
523
|
+
readonly unique: true;
|
|
524
|
+
}];
|
|
525
|
+
};
|
|
526
|
+
readonly failedLoginAttempts: {
|
|
527
|
+
readonly columns: {
|
|
528
|
+
readonly id: {
|
|
529
|
+
readonly type: "serial";
|
|
530
|
+
readonly primaryKey: true;
|
|
531
|
+
};
|
|
532
|
+
readonly identifier: {
|
|
533
|
+
readonly type: "varchar";
|
|
534
|
+
readonly length: 255;
|
|
535
|
+
readonly notNull: true;
|
|
536
|
+
};
|
|
537
|
+
readonly identifierType: {
|
|
538
|
+
readonly type: "identifier_type_enum";
|
|
539
|
+
readonly notNull: true;
|
|
540
|
+
};
|
|
541
|
+
readonly attemptedAt: {
|
|
542
|
+
readonly type: "bigint";
|
|
543
|
+
readonly mode: "number";
|
|
544
|
+
readonly notNull: true;
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
readonly indexes: [{
|
|
548
|
+
readonly name: "idx_failed_attempts_identifier";
|
|
549
|
+
readonly columns: ["identifier", "attemptedAt"];
|
|
550
|
+
}, {
|
|
551
|
+
readonly name: "idx_failed_attempts_time";
|
|
552
|
+
readonly columns: ["attemptedAt"];
|
|
553
|
+
}];
|
|
554
|
+
};
|
|
555
|
+
readonly securityAuditLog: {
|
|
556
|
+
readonly columns: {
|
|
557
|
+
readonly id: {
|
|
558
|
+
readonly type: "serial";
|
|
559
|
+
readonly primaryKey: true;
|
|
560
|
+
};
|
|
561
|
+
readonly userId: {
|
|
562
|
+
readonly type: "uuid";
|
|
563
|
+
readonly references: {
|
|
564
|
+
readonly table: "users";
|
|
565
|
+
readonly column: "id";
|
|
566
|
+
readonly onDelete: "set null";
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
readonly eventType: {
|
|
570
|
+
readonly type: "varchar";
|
|
571
|
+
readonly length: 50;
|
|
572
|
+
readonly notNull: true;
|
|
573
|
+
};
|
|
574
|
+
readonly eventData: {
|
|
575
|
+
readonly type: "json";
|
|
576
|
+
};
|
|
577
|
+
readonly ipAddress: {
|
|
578
|
+
readonly type: "varchar";
|
|
579
|
+
readonly length: 45;
|
|
580
|
+
};
|
|
581
|
+
readonly userAgent: {
|
|
582
|
+
readonly type: "text";
|
|
583
|
+
};
|
|
584
|
+
readonly success: {
|
|
585
|
+
readonly type: "boolean";
|
|
586
|
+
readonly notNull: true;
|
|
587
|
+
};
|
|
588
|
+
readonly createdAt: {
|
|
589
|
+
readonly type: "timestamp";
|
|
590
|
+
readonly withTimezone: true;
|
|
591
|
+
readonly default: "now()";
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
readonly indexes: [{
|
|
595
|
+
readonly name: "idx_audit_user";
|
|
596
|
+
readonly columns: ["userId"];
|
|
597
|
+
}, {
|
|
598
|
+
readonly name: "idx_audit_event";
|
|
599
|
+
readonly columns: ["eventType"];
|
|
600
|
+
}, {
|
|
601
|
+
readonly name: "idx_audit_created";
|
|
602
|
+
readonly columns: ["createdAt"];
|
|
603
|
+
}];
|
|
604
|
+
};
|
|
605
|
+
readonly oauthAccounts: {
|
|
606
|
+
readonly columns: {
|
|
607
|
+
readonly id: {
|
|
608
|
+
readonly type: "uuid";
|
|
609
|
+
readonly primaryKey: true;
|
|
610
|
+
readonly default: "gen_random_uuid()";
|
|
611
|
+
};
|
|
612
|
+
readonly userId: {
|
|
613
|
+
readonly type: "uuid";
|
|
614
|
+
readonly notNull: true;
|
|
615
|
+
readonly references: {
|
|
616
|
+
readonly table: "users";
|
|
617
|
+
readonly column: "id";
|
|
618
|
+
readonly onDelete: "cascade";
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
readonly provider: {
|
|
622
|
+
readonly type: "varchar";
|
|
623
|
+
readonly length: 50;
|
|
624
|
+
readonly notNull: true;
|
|
625
|
+
};
|
|
626
|
+
readonly providerUserId: {
|
|
627
|
+
readonly type: "varchar";
|
|
628
|
+
readonly length: 255;
|
|
629
|
+
readonly notNull: true;
|
|
630
|
+
};
|
|
631
|
+
readonly email: {
|
|
632
|
+
readonly type: "varchar";
|
|
633
|
+
readonly length: 255;
|
|
634
|
+
readonly notNull: true;
|
|
635
|
+
};
|
|
636
|
+
readonly createdAt: {
|
|
637
|
+
readonly type: "timestamp";
|
|
638
|
+
readonly withTimezone: true;
|
|
639
|
+
readonly default: "now()";
|
|
640
|
+
readonly notNull: true;
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
readonly indexes: [{
|
|
644
|
+
readonly name: "oauth_accounts_user_provider_idx";
|
|
645
|
+
readonly columns: ["userId", "provider"];
|
|
646
|
+
readonly unique: true;
|
|
647
|
+
}, {
|
|
648
|
+
readonly name: "oauth_accounts_provider_user_idx";
|
|
649
|
+
readonly columns: ["provider", "providerUserId"];
|
|
650
|
+
readonly unique: true;
|
|
651
|
+
}];
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
declare const tableNames: {
|
|
655
|
+
readonly users: "users";
|
|
656
|
+
readonly sessions: "sessions";
|
|
657
|
+
readonly user2faMethods: "user_2fa_methods";
|
|
658
|
+
readonly userBackupCodes: "user_backup_codes";
|
|
659
|
+
readonly userTrustedDevices: "user_trusted_devices";
|
|
660
|
+
readonly emailVerificationTokens: "email_verification_tokens";
|
|
661
|
+
readonly passwordResetTokens: "password_reset_tokens";
|
|
662
|
+
readonly emailChangeTokens: "email_change_tokens";
|
|
663
|
+
readonly emailEvents: "email_events";
|
|
664
|
+
readonly failedLoginAttempts: "failed_login_attempts";
|
|
665
|
+
readonly securityAuditLog: "security_audit_log";
|
|
666
|
+
readonly oauthAccounts: "oauth_accounts";
|
|
667
|
+
};
|
|
668
|
+
type TableName = keyof typeof tables;
|
|
669
|
+
type EnumName = keyof typeof enums;
|
|
670
|
+
|
|
671
|
+
export { type ColumnDefinition, type ColumnType, type EnumDefinition, type EnumName, type IndexDefinition, SCHEMA_VERSION, type TableDefinition, type TableName, enums, tableNames, tables };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|