@sqrzro/server 2.0.0-bz.62 → 2.0.0-bz.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.cjs +2 -65
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +2 -20
- package/dist/auth/index.js.map +1 -1
- package/dist/cache/index.cjs +1 -9
- package/dist/cache/index.cjs.map +1 -1
- package/dist/cache/index.js +1 -6
- package/dist/cache/index.js.map +1 -1
- package/dist/database/schema.cjs +1 -15
- package/dist/database/schema.cjs.map +1 -1
- package/dist/database/schema.d.cts +105 -0
- package/dist/database/schema.d.ts +105 -0
- package/dist/database/schema.js +1 -6
- package/dist/database/schema.js.map +1 -1
- package/dist/forms/index.cjs +1 -21
- package/dist/forms/index.cjs.map +1 -1
- package/dist/forms/index.js +1 -7
- package/dist/forms/index.js.map +1 -1
- package/dist/lists/index.cjs +1 -8
- package/dist/lists/index.cjs.map +1 -1
- package/dist/lists/index.js +1 -6
- package/dist/lists/index.js.map +1 -1
- package/dist/mail/index.cjs +2 -14
- package/dist/mail/index.cjs.map +1 -1
- package/dist/mail/index.js +2 -6
- package/dist/mail/index.js.map +1 -1
- package/dist/middleware.cjs +1 -8
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.js +1 -6
- package/dist/middleware.js.map +1 -1
- package/dist/url/index.cjs +2 -11
- package/dist/url/index.cjs.map +1 -1
- package/dist/url/index.js +2 -6
- package/dist/url/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,8 +17,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
17
17
|
driverParam: string;
|
|
18
18
|
notNull: true;
|
|
19
19
|
hasDefault: false;
|
|
20
|
+
isPrimaryKey: true;
|
|
21
|
+
isAutoincrement: false;
|
|
22
|
+
hasRuntimeDefault: false;
|
|
20
23
|
enumValues: [string, ...string[]];
|
|
21
24
|
baseColumn: never;
|
|
25
|
+
identity: undefined;
|
|
26
|
+
generated: undefined;
|
|
22
27
|
}, {}, {}>;
|
|
23
28
|
email: drizzle_orm_pg_core.PgColumn<{
|
|
24
29
|
name: "email";
|
|
@@ -29,8 +34,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
29
34
|
driverParam: string;
|
|
30
35
|
notNull: true;
|
|
31
36
|
hasDefault: false;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: false;
|
|
32
40
|
enumValues: [string, ...string[]];
|
|
33
41
|
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
34
44
|
}, {}, {}>;
|
|
35
45
|
password: drizzle_orm_pg_core.PgColumn<{
|
|
36
46
|
name: "password";
|
|
@@ -41,8 +51,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
41
51
|
driverParam: string;
|
|
42
52
|
notNull: false;
|
|
43
53
|
hasDefault: false;
|
|
54
|
+
isPrimaryKey: false;
|
|
55
|
+
isAutoincrement: false;
|
|
56
|
+
hasRuntimeDefault: false;
|
|
44
57
|
enumValues: [string, ...string[]];
|
|
45
58
|
baseColumn: never;
|
|
59
|
+
identity: undefined;
|
|
60
|
+
generated: undefined;
|
|
46
61
|
}, {}, {}>;
|
|
47
62
|
role: drizzle_orm_pg_core.PgColumn<{
|
|
48
63
|
name: "role";
|
|
@@ -53,8 +68,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
53
68
|
driverParam: string | number;
|
|
54
69
|
notNull: true;
|
|
55
70
|
hasDefault: true;
|
|
71
|
+
isPrimaryKey: false;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
56
74
|
enumValues: undefined;
|
|
57
75
|
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
58
78
|
}, {}, {}>;
|
|
59
79
|
deletedAt: drizzle_orm_pg_core.PgColumn<{
|
|
60
80
|
name: "deletedAt";
|
|
@@ -65,8 +85,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
65
85
|
driverParam: string;
|
|
66
86
|
notNull: false;
|
|
67
87
|
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
68
91
|
enumValues: undefined;
|
|
69
92
|
baseColumn: never;
|
|
93
|
+
identity: undefined;
|
|
94
|
+
generated: undefined;
|
|
70
95
|
}, {}, {}>;
|
|
71
96
|
};
|
|
72
97
|
dialect: "pg";
|
|
@@ -85,8 +110,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
85
110
|
driverParam: string;
|
|
86
111
|
notNull: true;
|
|
87
112
|
hasDefault: false;
|
|
113
|
+
isPrimaryKey: true;
|
|
114
|
+
isAutoincrement: false;
|
|
115
|
+
hasRuntimeDefault: false;
|
|
88
116
|
enumValues: [string, ...string[]];
|
|
89
117
|
baseColumn: never;
|
|
118
|
+
identity: undefined;
|
|
119
|
+
generated: undefined;
|
|
90
120
|
}, {}, {}>;
|
|
91
121
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
92
122
|
name: "userId";
|
|
@@ -97,8 +127,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
97
127
|
driverParam: string;
|
|
98
128
|
notNull: true;
|
|
99
129
|
hasDefault: false;
|
|
130
|
+
isPrimaryKey: false;
|
|
131
|
+
isAutoincrement: false;
|
|
132
|
+
hasRuntimeDefault: false;
|
|
100
133
|
enumValues: [string, ...string[]];
|
|
101
134
|
baseColumn: never;
|
|
135
|
+
identity: undefined;
|
|
136
|
+
generated: undefined;
|
|
102
137
|
}, {}, {}>;
|
|
103
138
|
scope: drizzle_orm_pg_core.PgColumn<{
|
|
104
139
|
name: "scope";
|
|
@@ -109,8 +144,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
109
144
|
driverParam: string;
|
|
110
145
|
notNull: true;
|
|
111
146
|
hasDefault: true;
|
|
147
|
+
isPrimaryKey: false;
|
|
148
|
+
isAutoincrement: false;
|
|
149
|
+
hasRuntimeDefault: false;
|
|
112
150
|
enumValues: ["ANON", "MFA", "AUTHED"];
|
|
113
151
|
baseColumn: never;
|
|
152
|
+
identity: undefined;
|
|
153
|
+
generated: undefined;
|
|
114
154
|
}, {}, {}>;
|
|
115
155
|
expiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
116
156
|
name: "expiresAt";
|
|
@@ -121,8 +161,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
121
161
|
driverParam: string;
|
|
122
162
|
notNull: true;
|
|
123
163
|
hasDefault: false;
|
|
164
|
+
isPrimaryKey: false;
|
|
165
|
+
isAutoincrement: false;
|
|
166
|
+
hasRuntimeDefault: false;
|
|
124
167
|
enumValues: undefined;
|
|
125
168
|
baseColumn: never;
|
|
169
|
+
identity: undefined;
|
|
170
|
+
generated: undefined;
|
|
126
171
|
}, {}, {}>;
|
|
127
172
|
};
|
|
128
173
|
dialect: "pg";
|
|
@@ -141,8 +186,13 @@ declare const authResetTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
141
186
|
driverParam: string;
|
|
142
187
|
notNull: true;
|
|
143
188
|
hasDefault: false;
|
|
189
|
+
isPrimaryKey: true;
|
|
190
|
+
isAutoincrement: false;
|
|
191
|
+
hasRuntimeDefault: false;
|
|
144
192
|
enumValues: [string, ...string[]];
|
|
145
193
|
baseColumn: never;
|
|
194
|
+
identity: undefined;
|
|
195
|
+
generated: undefined;
|
|
146
196
|
}, {}, {}>;
|
|
147
197
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
148
198
|
name: "userId";
|
|
@@ -153,8 +203,13 @@ declare const authResetTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
153
203
|
driverParam: string;
|
|
154
204
|
notNull: true;
|
|
155
205
|
hasDefault: false;
|
|
206
|
+
isPrimaryKey: false;
|
|
207
|
+
isAutoincrement: false;
|
|
208
|
+
hasRuntimeDefault: false;
|
|
156
209
|
enumValues: [string, ...string[]];
|
|
157
210
|
baseColumn: never;
|
|
211
|
+
identity: undefined;
|
|
212
|
+
generated: undefined;
|
|
158
213
|
}, {}, {}>;
|
|
159
214
|
expiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
160
215
|
name: "expiresAt";
|
|
@@ -165,8 +220,13 @@ declare const authResetTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
165
220
|
driverParam: string;
|
|
166
221
|
notNull: true;
|
|
167
222
|
hasDefault: false;
|
|
223
|
+
isPrimaryKey: false;
|
|
224
|
+
isAutoincrement: false;
|
|
225
|
+
hasRuntimeDefault: false;
|
|
168
226
|
enumValues: undefined;
|
|
169
227
|
baseColumn: never;
|
|
228
|
+
identity: undefined;
|
|
229
|
+
generated: undefined;
|
|
170
230
|
}, {}, {}>;
|
|
171
231
|
};
|
|
172
232
|
dialect: "pg";
|
|
@@ -185,8 +245,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
185
245
|
driverParam: string;
|
|
186
246
|
notNull: true;
|
|
187
247
|
hasDefault: false;
|
|
248
|
+
isPrimaryKey: true;
|
|
249
|
+
isAutoincrement: false;
|
|
250
|
+
hasRuntimeDefault: false;
|
|
188
251
|
enumValues: [string, ...string[]];
|
|
189
252
|
baseColumn: never;
|
|
253
|
+
identity: undefined;
|
|
254
|
+
generated: undefined;
|
|
190
255
|
}, {}, {}>;
|
|
191
256
|
name: drizzle_orm_pg_core.PgColumn<{
|
|
192
257
|
name: "name";
|
|
@@ -197,8 +262,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
197
262
|
driverParam: string;
|
|
198
263
|
notNull: true;
|
|
199
264
|
hasDefault: false;
|
|
265
|
+
isPrimaryKey: false;
|
|
266
|
+
isAutoincrement: false;
|
|
267
|
+
hasRuntimeDefault: false;
|
|
200
268
|
enumValues: [string, ...string[]];
|
|
201
269
|
baseColumn: never;
|
|
270
|
+
identity: undefined;
|
|
271
|
+
generated: undefined;
|
|
202
272
|
}, {}, {}>;
|
|
203
273
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
204
274
|
name: "userId";
|
|
@@ -209,8 +279,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
209
279
|
driverParam: string;
|
|
210
280
|
notNull: true;
|
|
211
281
|
hasDefault: false;
|
|
282
|
+
isPrimaryKey: false;
|
|
283
|
+
isAutoincrement: false;
|
|
284
|
+
hasRuntimeDefault: false;
|
|
212
285
|
enumValues: [string, ...string[]];
|
|
213
286
|
baseColumn: never;
|
|
287
|
+
identity: undefined;
|
|
288
|
+
generated: undefined;
|
|
214
289
|
}, {}, {}>;
|
|
215
290
|
type: drizzle_orm_pg_core.PgColumn<{
|
|
216
291
|
name: "type";
|
|
@@ -221,8 +296,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
221
296
|
driverParam: string;
|
|
222
297
|
notNull: true;
|
|
223
298
|
hasDefault: true;
|
|
299
|
+
isPrimaryKey: false;
|
|
300
|
+
isAutoincrement: false;
|
|
301
|
+
hasRuntimeDefault: false;
|
|
224
302
|
enumValues: ["TOTP", "HARDWARE"];
|
|
225
303
|
baseColumn: never;
|
|
304
|
+
identity: undefined;
|
|
305
|
+
generated: undefined;
|
|
226
306
|
}, {}, {}>;
|
|
227
307
|
secret: drizzle_orm_pg_core.PgColumn<{
|
|
228
308
|
name: "secret";
|
|
@@ -233,8 +313,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
233
313
|
driverParam: string;
|
|
234
314
|
notNull: true;
|
|
235
315
|
hasDefault: false;
|
|
316
|
+
isPrimaryKey: false;
|
|
317
|
+
isAutoincrement: false;
|
|
318
|
+
hasRuntimeDefault: false;
|
|
236
319
|
enumValues: [string, ...string[]];
|
|
237
320
|
baseColumn: never;
|
|
321
|
+
identity: undefined;
|
|
322
|
+
generated: undefined;
|
|
238
323
|
}, {}, {}>;
|
|
239
324
|
verifiedAt: drizzle_orm_pg_core.PgColumn<{
|
|
240
325
|
name: "verifiedAt";
|
|
@@ -245,8 +330,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
245
330
|
driverParam: string;
|
|
246
331
|
notNull: false;
|
|
247
332
|
hasDefault: false;
|
|
333
|
+
isPrimaryKey: false;
|
|
334
|
+
isAutoincrement: false;
|
|
335
|
+
hasRuntimeDefault: false;
|
|
248
336
|
enumValues: undefined;
|
|
249
337
|
baseColumn: never;
|
|
338
|
+
identity: undefined;
|
|
339
|
+
generated: undefined;
|
|
250
340
|
}, {}, {}>;
|
|
251
341
|
};
|
|
252
342
|
dialect: "pg";
|
|
@@ -265,8 +355,13 @@ declare const authClientTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
265
355
|
driverParam: string;
|
|
266
356
|
notNull: true;
|
|
267
357
|
hasDefault: false;
|
|
358
|
+
isPrimaryKey: true;
|
|
359
|
+
isAutoincrement: false;
|
|
360
|
+
hasRuntimeDefault: false;
|
|
268
361
|
enumValues: [string, ...string[]];
|
|
269
362
|
baseColumn: never;
|
|
363
|
+
identity: undefined;
|
|
364
|
+
generated: undefined;
|
|
270
365
|
}, {}, {}>;
|
|
271
366
|
alias: drizzle_orm_pg_core.PgColumn<{
|
|
272
367
|
name: "alias";
|
|
@@ -277,8 +372,13 @@ declare const authClientTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
277
372
|
driverParam: string;
|
|
278
373
|
notNull: true;
|
|
279
374
|
hasDefault: false;
|
|
375
|
+
isPrimaryKey: false;
|
|
376
|
+
isAutoincrement: false;
|
|
377
|
+
hasRuntimeDefault: false;
|
|
280
378
|
enumValues: [string, ...string[]];
|
|
281
379
|
baseColumn: never;
|
|
380
|
+
identity: undefined;
|
|
381
|
+
generated: undefined;
|
|
282
382
|
}, {}, {}>;
|
|
283
383
|
secret: drizzle_orm_pg_core.PgColumn<{
|
|
284
384
|
name: "secret";
|
|
@@ -289,8 +389,13 @@ declare const authClientTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
289
389
|
driverParam: string;
|
|
290
390
|
notNull: true;
|
|
291
391
|
hasDefault: false;
|
|
392
|
+
isPrimaryKey: false;
|
|
393
|
+
isAutoincrement: false;
|
|
394
|
+
hasRuntimeDefault: false;
|
|
292
395
|
enumValues: [string, ...string[]];
|
|
293
396
|
baseColumn: never;
|
|
397
|
+
identity: undefined;
|
|
398
|
+
generated: undefined;
|
|
294
399
|
}, {}, {}>;
|
|
295
400
|
};
|
|
296
401
|
dialect: "pg";
|
|
@@ -17,8 +17,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
17
17
|
driverParam: string;
|
|
18
18
|
notNull: true;
|
|
19
19
|
hasDefault: false;
|
|
20
|
+
isPrimaryKey: true;
|
|
21
|
+
isAutoincrement: false;
|
|
22
|
+
hasRuntimeDefault: false;
|
|
20
23
|
enumValues: [string, ...string[]];
|
|
21
24
|
baseColumn: never;
|
|
25
|
+
identity: undefined;
|
|
26
|
+
generated: undefined;
|
|
22
27
|
}, {}, {}>;
|
|
23
28
|
email: drizzle_orm_pg_core.PgColumn<{
|
|
24
29
|
name: "email";
|
|
@@ -29,8 +34,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
29
34
|
driverParam: string;
|
|
30
35
|
notNull: true;
|
|
31
36
|
hasDefault: false;
|
|
37
|
+
isPrimaryKey: false;
|
|
38
|
+
isAutoincrement: false;
|
|
39
|
+
hasRuntimeDefault: false;
|
|
32
40
|
enumValues: [string, ...string[]];
|
|
33
41
|
baseColumn: never;
|
|
42
|
+
identity: undefined;
|
|
43
|
+
generated: undefined;
|
|
34
44
|
}, {}, {}>;
|
|
35
45
|
password: drizzle_orm_pg_core.PgColumn<{
|
|
36
46
|
name: "password";
|
|
@@ -41,8 +51,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
41
51
|
driverParam: string;
|
|
42
52
|
notNull: false;
|
|
43
53
|
hasDefault: false;
|
|
54
|
+
isPrimaryKey: false;
|
|
55
|
+
isAutoincrement: false;
|
|
56
|
+
hasRuntimeDefault: false;
|
|
44
57
|
enumValues: [string, ...string[]];
|
|
45
58
|
baseColumn: never;
|
|
59
|
+
identity: undefined;
|
|
60
|
+
generated: undefined;
|
|
46
61
|
}, {}, {}>;
|
|
47
62
|
role: drizzle_orm_pg_core.PgColumn<{
|
|
48
63
|
name: "role";
|
|
@@ -53,8 +68,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
53
68
|
driverParam: string | number;
|
|
54
69
|
notNull: true;
|
|
55
70
|
hasDefault: true;
|
|
71
|
+
isPrimaryKey: false;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
56
74
|
enumValues: undefined;
|
|
57
75
|
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
58
78
|
}, {}, {}>;
|
|
59
79
|
deletedAt: drizzle_orm_pg_core.PgColumn<{
|
|
60
80
|
name: "deletedAt";
|
|
@@ -65,8 +85,13 @@ declare const authUserTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
65
85
|
driverParam: string;
|
|
66
86
|
notNull: false;
|
|
67
87
|
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
68
91
|
enumValues: undefined;
|
|
69
92
|
baseColumn: never;
|
|
93
|
+
identity: undefined;
|
|
94
|
+
generated: undefined;
|
|
70
95
|
}, {}, {}>;
|
|
71
96
|
};
|
|
72
97
|
dialect: "pg";
|
|
@@ -85,8 +110,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
85
110
|
driverParam: string;
|
|
86
111
|
notNull: true;
|
|
87
112
|
hasDefault: false;
|
|
113
|
+
isPrimaryKey: true;
|
|
114
|
+
isAutoincrement: false;
|
|
115
|
+
hasRuntimeDefault: false;
|
|
88
116
|
enumValues: [string, ...string[]];
|
|
89
117
|
baseColumn: never;
|
|
118
|
+
identity: undefined;
|
|
119
|
+
generated: undefined;
|
|
90
120
|
}, {}, {}>;
|
|
91
121
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
92
122
|
name: "userId";
|
|
@@ -97,8 +127,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
97
127
|
driverParam: string;
|
|
98
128
|
notNull: true;
|
|
99
129
|
hasDefault: false;
|
|
130
|
+
isPrimaryKey: false;
|
|
131
|
+
isAutoincrement: false;
|
|
132
|
+
hasRuntimeDefault: false;
|
|
100
133
|
enumValues: [string, ...string[]];
|
|
101
134
|
baseColumn: never;
|
|
135
|
+
identity: undefined;
|
|
136
|
+
generated: undefined;
|
|
102
137
|
}, {}, {}>;
|
|
103
138
|
scope: drizzle_orm_pg_core.PgColumn<{
|
|
104
139
|
name: "scope";
|
|
@@ -109,8 +144,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
109
144
|
driverParam: string;
|
|
110
145
|
notNull: true;
|
|
111
146
|
hasDefault: true;
|
|
147
|
+
isPrimaryKey: false;
|
|
148
|
+
isAutoincrement: false;
|
|
149
|
+
hasRuntimeDefault: false;
|
|
112
150
|
enumValues: ["ANON", "MFA", "AUTHED"];
|
|
113
151
|
baseColumn: never;
|
|
152
|
+
identity: undefined;
|
|
153
|
+
generated: undefined;
|
|
114
154
|
}, {}, {}>;
|
|
115
155
|
expiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
116
156
|
name: "expiresAt";
|
|
@@ -121,8 +161,13 @@ declare const authSessionTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
121
161
|
driverParam: string;
|
|
122
162
|
notNull: true;
|
|
123
163
|
hasDefault: false;
|
|
164
|
+
isPrimaryKey: false;
|
|
165
|
+
isAutoincrement: false;
|
|
166
|
+
hasRuntimeDefault: false;
|
|
124
167
|
enumValues: undefined;
|
|
125
168
|
baseColumn: never;
|
|
169
|
+
identity: undefined;
|
|
170
|
+
generated: undefined;
|
|
126
171
|
}, {}, {}>;
|
|
127
172
|
};
|
|
128
173
|
dialect: "pg";
|
|
@@ -141,8 +186,13 @@ declare const authResetTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
141
186
|
driverParam: string;
|
|
142
187
|
notNull: true;
|
|
143
188
|
hasDefault: false;
|
|
189
|
+
isPrimaryKey: true;
|
|
190
|
+
isAutoincrement: false;
|
|
191
|
+
hasRuntimeDefault: false;
|
|
144
192
|
enumValues: [string, ...string[]];
|
|
145
193
|
baseColumn: never;
|
|
194
|
+
identity: undefined;
|
|
195
|
+
generated: undefined;
|
|
146
196
|
}, {}, {}>;
|
|
147
197
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
148
198
|
name: "userId";
|
|
@@ -153,8 +203,13 @@ declare const authResetTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
153
203
|
driverParam: string;
|
|
154
204
|
notNull: true;
|
|
155
205
|
hasDefault: false;
|
|
206
|
+
isPrimaryKey: false;
|
|
207
|
+
isAutoincrement: false;
|
|
208
|
+
hasRuntimeDefault: false;
|
|
156
209
|
enumValues: [string, ...string[]];
|
|
157
210
|
baseColumn: never;
|
|
211
|
+
identity: undefined;
|
|
212
|
+
generated: undefined;
|
|
158
213
|
}, {}, {}>;
|
|
159
214
|
expiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
160
215
|
name: "expiresAt";
|
|
@@ -165,8 +220,13 @@ declare const authResetTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
165
220
|
driverParam: string;
|
|
166
221
|
notNull: true;
|
|
167
222
|
hasDefault: false;
|
|
223
|
+
isPrimaryKey: false;
|
|
224
|
+
isAutoincrement: false;
|
|
225
|
+
hasRuntimeDefault: false;
|
|
168
226
|
enumValues: undefined;
|
|
169
227
|
baseColumn: never;
|
|
228
|
+
identity: undefined;
|
|
229
|
+
generated: undefined;
|
|
170
230
|
}, {}, {}>;
|
|
171
231
|
};
|
|
172
232
|
dialect: "pg";
|
|
@@ -185,8 +245,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
185
245
|
driverParam: string;
|
|
186
246
|
notNull: true;
|
|
187
247
|
hasDefault: false;
|
|
248
|
+
isPrimaryKey: true;
|
|
249
|
+
isAutoincrement: false;
|
|
250
|
+
hasRuntimeDefault: false;
|
|
188
251
|
enumValues: [string, ...string[]];
|
|
189
252
|
baseColumn: never;
|
|
253
|
+
identity: undefined;
|
|
254
|
+
generated: undefined;
|
|
190
255
|
}, {}, {}>;
|
|
191
256
|
name: drizzle_orm_pg_core.PgColumn<{
|
|
192
257
|
name: "name";
|
|
@@ -197,8 +262,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
197
262
|
driverParam: string;
|
|
198
263
|
notNull: true;
|
|
199
264
|
hasDefault: false;
|
|
265
|
+
isPrimaryKey: false;
|
|
266
|
+
isAutoincrement: false;
|
|
267
|
+
hasRuntimeDefault: false;
|
|
200
268
|
enumValues: [string, ...string[]];
|
|
201
269
|
baseColumn: never;
|
|
270
|
+
identity: undefined;
|
|
271
|
+
generated: undefined;
|
|
202
272
|
}, {}, {}>;
|
|
203
273
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
204
274
|
name: "userId";
|
|
@@ -209,8 +279,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
209
279
|
driverParam: string;
|
|
210
280
|
notNull: true;
|
|
211
281
|
hasDefault: false;
|
|
282
|
+
isPrimaryKey: false;
|
|
283
|
+
isAutoincrement: false;
|
|
284
|
+
hasRuntimeDefault: false;
|
|
212
285
|
enumValues: [string, ...string[]];
|
|
213
286
|
baseColumn: never;
|
|
287
|
+
identity: undefined;
|
|
288
|
+
generated: undefined;
|
|
214
289
|
}, {}, {}>;
|
|
215
290
|
type: drizzle_orm_pg_core.PgColumn<{
|
|
216
291
|
name: "type";
|
|
@@ -221,8 +296,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
221
296
|
driverParam: string;
|
|
222
297
|
notNull: true;
|
|
223
298
|
hasDefault: true;
|
|
299
|
+
isPrimaryKey: false;
|
|
300
|
+
isAutoincrement: false;
|
|
301
|
+
hasRuntimeDefault: false;
|
|
224
302
|
enumValues: ["TOTP", "HARDWARE"];
|
|
225
303
|
baseColumn: never;
|
|
304
|
+
identity: undefined;
|
|
305
|
+
generated: undefined;
|
|
226
306
|
}, {}, {}>;
|
|
227
307
|
secret: drizzle_orm_pg_core.PgColumn<{
|
|
228
308
|
name: "secret";
|
|
@@ -233,8 +313,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
233
313
|
driverParam: string;
|
|
234
314
|
notNull: true;
|
|
235
315
|
hasDefault: false;
|
|
316
|
+
isPrimaryKey: false;
|
|
317
|
+
isAutoincrement: false;
|
|
318
|
+
hasRuntimeDefault: false;
|
|
236
319
|
enumValues: [string, ...string[]];
|
|
237
320
|
baseColumn: never;
|
|
321
|
+
identity: undefined;
|
|
322
|
+
generated: undefined;
|
|
238
323
|
}, {}, {}>;
|
|
239
324
|
verifiedAt: drizzle_orm_pg_core.PgColumn<{
|
|
240
325
|
name: "verifiedAt";
|
|
@@ -245,8 +330,13 @@ declare const authMFATable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
245
330
|
driverParam: string;
|
|
246
331
|
notNull: false;
|
|
247
332
|
hasDefault: false;
|
|
333
|
+
isPrimaryKey: false;
|
|
334
|
+
isAutoincrement: false;
|
|
335
|
+
hasRuntimeDefault: false;
|
|
248
336
|
enumValues: undefined;
|
|
249
337
|
baseColumn: never;
|
|
338
|
+
identity: undefined;
|
|
339
|
+
generated: undefined;
|
|
250
340
|
}, {}, {}>;
|
|
251
341
|
};
|
|
252
342
|
dialect: "pg";
|
|
@@ -265,8 +355,13 @@ declare const authClientTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
265
355
|
driverParam: string;
|
|
266
356
|
notNull: true;
|
|
267
357
|
hasDefault: false;
|
|
358
|
+
isPrimaryKey: true;
|
|
359
|
+
isAutoincrement: false;
|
|
360
|
+
hasRuntimeDefault: false;
|
|
268
361
|
enumValues: [string, ...string[]];
|
|
269
362
|
baseColumn: never;
|
|
363
|
+
identity: undefined;
|
|
364
|
+
generated: undefined;
|
|
270
365
|
}, {}, {}>;
|
|
271
366
|
alias: drizzle_orm_pg_core.PgColumn<{
|
|
272
367
|
name: "alias";
|
|
@@ -277,8 +372,13 @@ declare const authClientTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
277
372
|
driverParam: string;
|
|
278
373
|
notNull: true;
|
|
279
374
|
hasDefault: false;
|
|
375
|
+
isPrimaryKey: false;
|
|
376
|
+
isAutoincrement: false;
|
|
377
|
+
hasRuntimeDefault: false;
|
|
280
378
|
enumValues: [string, ...string[]];
|
|
281
379
|
baseColumn: never;
|
|
380
|
+
identity: undefined;
|
|
381
|
+
generated: undefined;
|
|
282
382
|
}, {}, {}>;
|
|
283
383
|
secret: drizzle_orm_pg_core.PgColumn<{
|
|
284
384
|
name: "secret";
|
|
@@ -289,8 +389,13 @@ declare const authClientTable: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
289
389
|
driverParam: string;
|
|
290
390
|
notNull: true;
|
|
291
391
|
hasDefault: false;
|
|
392
|
+
isPrimaryKey: false;
|
|
393
|
+
isAutoincrement: false;
|
|
394
|
+
hasRuntimeDefault: false;
|
|
292
395
|
enumValues: [string, ...string[]];
|
|
293
396
|
baseColumn: never;
|
|
397
|
+
identity: undefined;
|
|
398
|
+
generated: undefined;
|
|
294
399
|
}, {}, {}>;
|
|
295
400
|
};
|
|
296
401
|
dialect: "pg";
|
package/dist/database/schema.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var u=10,p=pgEnum("mfaType",["TOTP","HARDWARE"]),c=pgEnum("scope",["ANON","MFA","AUTHED"]),t=pgSchema("auth"),r=t.table("user_credentials",{id:text("id").primaryKey(),email:text("email").notNull(),password:text("password"),role:integer("role").notNull().default(u),deletedAt:timestamp("deletedAt")},s=>({unique:uniqueIndex().on(s.email,s.role)})),y=t.table("sessions",{id:text("id").primaryKey(),userId:text("userId").notNull().references(()=>r.id,{onDelete:"cascade"}),scope:c("scope").notNull().default("ANON"),expiresAt:timestamp("expiresAt").notNull()}),f=t.table("resets",{id:text("id").primaryKey(),userId:text("userId").notNull().references(()=>r.id,{onDelete:"cascade"}),expiresAt:timestamp("expiresAt").notNull()}),A=t.table("mfas",{id:text("id").primaryKey(),name:text("name").notNull(),userId:text("userId").notNull().references(()=>r.id,{onDelete:"cascade"}),type:p("type").notNull().default("TOTP"),secret:text("secret").notNull(),verifiedAt:timestamp("verifiedAt")}),m=t.table("client_credentials",{id:text("id").primaryKey(),alias:text("alias").notNull().unique(),secret:text("secret").notNull().unique()});
|
|
4
|
-
|
|
5
|
-
export { m as authClientTable, A as authMFATable, f as authResetTable, t as authSchema, y as authSessionTable, r as authUserTable, p as mfaType, c as scope };
|
|
6
|
-
//# sourceMappingURL=out.js.map
|
|
1
|
+
import {pgEnum,pgSchema,text,integer,timestamp,uniqueIndex}from'drizzle-orm/pg-core';var u=10,p=pgEnum("mfaType",["TOTP","HARDWARE"]),c=pgEnum("scope",["ANON","MFA","AUTHED"]),t=pgSchema("auth"),r=t.table("user_credentials",{id:text("id").primaryKey(),email:text("email").notNull(),password:text("password"),role:integer("role").notNull().default(u),deletedAt:timestamp("deletedAt")},s=>({unique:uniqueIndex().on(s.email,s.role)})),y=t.table("sessions",{id:text("id").primaryKey(),userId:text("userId").notNull().references(()=>r.id,{onDelete:"cascade"}),scope:c("scope").notNull().default("ANON"),expiresAt:timestamp("expiresAt").notNull()}),f=t.table("resets",{id:text("id").primaryKey(),userId:text("userId").notNull().references(()=>r.id,{onDelete:"cascade"}),expiresAt:timestamp("expiresAt").notNull()}),A=t.table("mfas",{id:text("id").primaryKey(),name:text("name").notNull(),userId:text("userId").notNull().references(()=>r.id,{onDelete:"cascade"}),type:p("type").notNull().default("TOTP"),secret:text("secret").notNull(),verifiedAt:timestamp("verifiedAt")}),m=t.table("client_credentials",{id:text("id").primaryKey(),alias:text("alias").notNull().unique(),secret:text("secret").notNull().unique()});export{m as authClientTable,A as authMFATable,f as authResetTable,t as authSchema,y as authSessionTable,r as authUserTable,p as mfaType,c as scope};//# sourceMappingURL=schema.js.map
|
|
7
2
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/database/schema.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/database/schema.ts"],"names":["DEFAULT_ROLE","mfaType","pgEnum","scope","authSchema","pgSchema","authUserTable","text","integer","timestamp","table","uniqueIndex","authSessionTable","authResetTable","authMFATable","authClientTable"],"mappings":"yFAIMA,CAAe,CAAA,EAAA,CAERC,CAAUC,CAAAA,MAAAA,CAAO,SAAW,CAAA,CAAC,MAAQ,CAAA,UAAU,CAAC,CAAA,CAChDC,CAAQD,CAAAA,MAAAA,CAAO,OAAS,CAAA,CAAC,OAAQ,KAAO,CAAA,QAAQ,CAAC,CAAA,CAIjDE,CAAaC,CAAAA,QAAAA,CAAS,MAAM,CAAA,CAE5BC,CAAgBF,CAAAA,CAAAA,CAAW,KACpC,CAAA,kBAAA,CACA,CACI,EAAA,CAAIG,IAAK,CAAA,IAAI,CAAE,CAAA,UAAA,EACf,CAAA,KAAA,CAAOA,IAAK,CAAA,OAAO,CAAE,CAAA,OAAA,EACrB,CAAA,QAAA,CAAUA,IAAK,CAAA,UAAU,CACzB,CAAA,IAAA,CAAMC,QAAQ,MAAM,CAAA,CAAE,OAAQ,EAAA,CAAE,OAAQR,CAAAA,CAAY,CACpD,CAAA,SAAA,CAAWS,SAAU,CAAA,WAAW,CACpC,CAAA,CACCC,CAAW,GAAA,CACR,MAAQC,CAAAA,WAAAA,EAAc,CAAA,EAAA,CAAGD,CAAM,CAAA,KAAA,CAAOA,CAAM,CAAA,IAAI,CACpD,CAAA,CACJ,CAIaE,CAAAA,CAAAA,CAAmBR,CAAW,CAAA,KAAA,CAAM,UAAY,CAAA,CACzD,GAAIG,IAAK,CAAA,IAAI,CAAE,CAAA,UAAA,EACf,CAAA,MAAA,CAAQA,IAAK,CAAA,QAAQ,CAChB,CAAA,OAAA,EACA,CAAA,UAAA,CAAW,IAAMD,CAAAA,CAAc,EAAI,CAAA,CAAE,QAAU,CAAA,SAAU,CAAC,CAAA,CAC/D,KAAOH,CAAAA,CAAAA,CAAM,OAAO,CAAA,CAAE,OAAQ,EAAA,CAAE,OAAQ,CAAA,MAAM,CAC9C,CAAA,SAAA,CAAWM,UAAU,WAAW,CAAA,CAAE,OAAQ,EAC9C,CAAC,CAAA,CAIYI,CAAiBT,CAAAA,CAAAA,CAAW,KAAM,CAAA,QAAA,CAAU,CACrD,EAAA,CAAIG,IAAK,CAAA,IAAI,EAAE,UAAW,EAAA,CAC1B,MAAQA,CAAAA,IAAAA,CAAK,QAAQ,CAAA,CAChB,OAAQ,EAAA,CACR,UAAW,CAAA,IAAMD,CAAc,CAAA,EAAA,CAAI,CAAE,QAAA,CAAU,SAAU,CAAC,CAAA,CAC/D,SAAWG,CAAAA,SAAAA,CAAU,WAAW,CAAA,CAAE,OAAQ,EAC9C,CAAC,CAAA,CAIYK,CAAeV,CAAAA,CAAAA,CAAW,KAAM,CAAA,MAAA,CAAQ,CACjD,EAAA,CAAIG,IAAK,CAAA,IAAI,CAAE,CAAA,UAAA,EACf,CAAA,IAAA,CAAMA,IAAK,CAAA,MAAM,CAAE,CAAA,OAAA,EACnB,CAAA,MAAA,CAAQA,IAAK,CAAA,QAAQ,EAChB,OAAQ,EAAA,CACR,UAAW,CAAA,IAAMD,CAAc,CAAA,EAAA,CAAI,CAAE,QAAA,CAAU,SAAU,CAAC,CAC/D,CAAA,IAAA,CAAML,CAAQ,CAAA,MAAM,CAAE,CAAA,OAAA,EAAU,CAAA,OAAA,CAAQ,MAAM,CAAA,CAC9C,MAAQM,CAAAA,IAAAA,CAAK,QAAQ,CAAA,CAAE,OAAQ,EAAA,CAC/B,UAAYE,CAAAA,SAAAA,CAAU,YAAY,CACtC,CAAC,CAIYM,CAAAA,CAAAA,CAAkBX,CAAW,CAAA,KAAA,CAAM,oBAAsB,CAAA,CAClE,EAAIG,CAAAA,IAAAA,CAAK,IAAI,CAAA,CAAE,UAAW,EAAA,CAC1B,KAAOA,CAAAA,IAAAA,CAAK,OAAO,CAAA,CAAE,OAAQ,EAAA,CAAE,MAAO,EAAA,CACtC,MAAQA,CAAAA,IAAAA,CAAK,QAAQ,CAAA,CAAE,OAAQ,EAAA,CAAE,MAAO,EAC5C,CAAC","file":"schema.js","sourcesContent":["/* istanbul ignore file */\n\nimport { integer, pgEnum, pgSchema, text, timestamp, uniqueIndex } from 'drizzle-orm/pg-core';\n\nconst DEFAULT_ROLE = 10;\n\nexport const mfaType = pgEnum('mfaType', ['TOTP', 'HARDWARE']);\nexport const scope = pgEnum('scope', ['ANON', 'MFA', 'AUTHED']);\n\nexport type Scope = (typeof scope.enumValues)[number];\n\nexport const authSchema = pgSchema('auth');\n\nexport const authUserTable = authSchema.table(\n 'user_credentials',\n {\n id: text('id').primaryKey(),\n email: text('email').notNull(),\n password: text('password'),\n role: integer('role').notNull().default(DEFAULT_ROLE),\n deletedAt: timestamp('deletedAt'),\n },\n (table) => ({\n unique: uniqueIndex().on(table.email, table.role),\n })\n);\n\nexport type AuthUser = typeof authUserTable.$inferSelect;\n\nexport const authSessionTable = authSchema.table('sessions', {\n id: text('id').primaryKey(),\n userId: text('userId')\n .notNull()\n .references(() => authUserTable.id, { onDelete: 'cascade' }),\n scope: scope('scope').notNull().default('ANON'),\n expiresAt: timestamp('expiresAt').notNull(),\n});\n\nexport type AuthSession = typeof authSessionTable.$inferSelect;\n\nexport const authResetTable = authSchema.table('resets', {\n id: text('id').primaryKey(),\n userId: text('userId')\n .notNull()\n .references(() => authUserTable.id, { onDelete: 'cascade' }),\n expiresAt: timestamp('expiresAt').notNull(),\n});\n\nexport type AuthReset = typeof authResetTable.$inferSelect;\n\nexport const authMFATable = authSchema.table('mfas', {\n id: text('id').primaryKey(),\n name: text('name').notNull(),\n userId: text('userId')\n .notNull()\n .references(() => authUserTable.id, { onDelete: 'cascade' }),\n type: mfaType('type').notNull().default('TOTP'),\n secret: text('secret').notNull(),\n verifiedAt: timestamp('verifiedAt'),\n});\n\nexport type AuthMFA = typeof authMFATable.$inferSelect;\n\nexport const authClientTable = authSchema.table('client_credentials', {\n id: text('id').primaryKey(),\n alias: text('alias').notNull().unique(),\n secret: text('secret').notNull().unique(),\n});\n\nexport type AuthClient = typeof authClientTable.$inferSelect;\n"]}
|
package/dist/forms/index.cjs
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var server = require('next/server');
|
|
4
|
-
var l = require('joi');
|
|
5
|
-
|
|
6
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
|
|
8
|
-
var l__default = /*#__PURE__*/_interopDefault(l);
|
|
9
|
-
|
|
10
|
-
var a=class extends Error{messages;constructor(e){super(JSON.stringify(e)),this.messages=e,this.name="ValidationError";}},i=a;var d={"alternatives.all":"","alternatives.any":"","alternatives.match":"","alternatives.one":"","alternatives.types":"","any.custom":"","any.default":"","any.failover":"","any.invalid":"","any.only":"","any.ref":"","any.required":"{{#label}} is required","any.unknown":"","array.base":"","array.excludes":"","array.includesRequiredBoth":"","array.includesRequiredKnowns":"","array.includesRequiredUnknowns":"","array.includes":"","array.length":"","array.max":"","array.min":"","array.orderedLength":"","array.sort":"","array.sort.mismatching":"","array.sort.unsupported":"","array.sparse":"","array.unique":"","array.hasKnown":"","array.hasUnknown":"","binary.base":"","binary.length":"","binary.max":"","binary.min":"","boolean.base":"","date.base":"","date.format":"","date.greater":"","date.less":"","date.max":"","date.min":"","date.strict":"","function.arity":"","function.class":"","function.maxArity":"","function.minArity":"","number.base":"{{#label}} should be a number","number.greater":"","number.infinity":"","number.integer":"","number.less":"","number.max":"","number.min":"{{#label}} should be greater than or equal to {{#limit}}","number.multiple":"","number.negative":"","number.port":"","number.positive":"","number.precision":"","number.unsafe":"","object.unknown":"","object.and":"","object.assert":"","object.base":"","object.length":"","object.max":"","object.min":"","object.missing":"","object.nand":"","object.pattern.match":"","object.refType":"","object.regex":"","object.rename.multiple":"","object.rename.override":"","object.schema":"","object.instance":"","object.with":"","object.without":"","object.xor":"","object.oxor":"","string.alphanum":"","string.base64":"","string.base":"","string.creditCard":"","string.dataUri":"","string.domain":"","string.email":"","string.empty":"{{#label}} is required","string.guid":"","string.hexAlign":"","string.hex":"","string.hostname":"","string.ipVersion":"","string.ip":"","string.isoDate":"","string.isoDuration":"","string.length":"","string.lowercase":"","string.max":"","string.min":"","string.normalize":"","string.pattern.base":"{{#label}} is not in the correct format","string.pattern.name":"","string.pattern.invert.base":"","string.pattern.invert.name":"","string.token":"","string.trim":"","string.uppercase":"","string.uri":"","string.uriCustomScheme":"","string.uriRelativeOnly":"","symbol.base":"","symbol.map":""},s=d;function S(){return l__default.default}function v(){return s}function b(){return Object.entries(s).reduce((r,[e,n])=>n?{...r,[e]:n}:r,{})}function g(r){let e=r.details.reduce((n,t)=>({...n,[t.path.join(".")]:t.message.replace(/"/gu,"")}),{});return new i(e)}async function m(r,e,n){try{return [await e.validateAsync(r,{abortEarly:!1,messages:n||b(),stripUnknown:!0}),null]}catch(t){return t instanceof l__default.default.ValidationError?[null,g(t)]:t instanceof Error?[null,t]:[null,new Error("Unknown validation error occured")]}}function w(r){return l__default.default.object(r)}function A(r,e){return r.append(e)}function c(r){return {cause:r.cause,message:r.message,name:r.name,stack:r.stack}}function p(r){return !!Object.prototype.hasOwnProperty.call(r,"fn")}async function f(r){let e={...r.formData};if(r.request){let[t,o]=await m(r.formData,r.request);if(o!==null)return o instanceof i&&r.onValidationError?.(o),[null,c(o)];e=t;}if(!p(r))return await r.onSuccess?.(e),[e,null];let n=null;try{n=await r.fn(e);}catch(t){if(t instanceof i)return r.onValidationError?.(t),[null,c(t)];throw t instanceof Error?t:new Error("The function supplied to submitForm encountered an unknown error")}if(!n)throw new Error("NO_MODEL");return await r.onSuccess?.(n),[n,null]}async function O(r){let[e,n]=await f(r);if(n!==null){if(n.name==="ValidationError")try{let t=JSON.parse(n.message);return [null,server.NextResponse.json(t,{status:422})]}catch{return [null,server.NextResponse.json({message:"An unknown error occured"},{status:500})]}return [null,server.NextResponse.json({message:n.message},{status:500})]}return [e,null]}var y=["image/png","image/jpeg","image/jpg"];async function R(r,e){return r?r instanceof File?(e?.types||y).includes(r.type)?r.size>(e?.maxSize||5242880)?Promise.resolve([null,new Error("IMAGE_TOO_HEAVY")]):Promise.resolve([r,null]):Promise.resolve([null,new Error("IMAGE_TYPE_NOT_VALID")]):Promise.resolve([null,new Error("IMAGE_NOT_VALID")]):Promise.resolve([null,new Error("IMAGE_UNDEFINED")])}
|
|
11
|
-
|
|
12
|
-
exports.ValidationError = i;
|
|
13
|
-
exports.createSchema = w;
|
|
14
|
-
exports.extendSchema = A;
|
|
15
|
-
exports.getDefaultErrorMessages = v;
|
|
16
|
-
exports.submitAPIRequest = O;
|
|
17
|
-
exports.submitForm = f;
|
|
18
|
-
exports.validate = S;
|
|
19
|
-
exports.validateImage = R;
|
|
20
|
-
exports.validateSchema = m;
|
|
21
|
-
//# sourceMappingURL=out.js.map
|
|
1
|
+
'use strict';var server=require('next/server'),l=require('joi');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var l__default=/*#__PURE__*/_interopDefault(l);var a=class extends Error{messages;constructor(e){super(JSON.stringify(e)),this.messages=e,this.name="ValidationError";}},i=a;var d={"alternatives.all":"","alternatives.any":"","alternatives.match":"","alternatives.one":"","alternatives.types":"","any.custom":"","any.default":"","any.failover":"","any.invalid":"","any.only":"","any.ref":"","any.required":"{{#label}} is required","any.unknown":"","array.base":"","array.excludes":"","array.includesRequiredBoth":"","array.includesRequiredKnowns":"","array.includesRequiredUnknowns":"","array.includes":"","array.length":"","array.max":"","array.min":"","array.orderedLength":"","array.sort":"","array.sort.mismatching":"","array.sort.unsupported":"","array.sparse":"","array.unique":"","array.hasKnown":"","array.hasUnknown":"","binary.base":"","binary.length":"","binary.max":"","binary.min":"","boolean.base":"","date.base":"","date.format":"","date.greater":"","date.less":"","date.max":"","date.min":"","date.strict":"","function.arity":"","function.class":"","function.maxArity":"","function.minArity":"","number.base":"{{#label}} should be a number","number.greater":"","number.infinity":"","number.integer":"","number.less":"","number.max":"","number.min":"{{#label}} should be greater than or equal to {{#limit}}","number.multiple":"","number.negative":"","number.port":"","number.positive":"","number.precision":"","number.unsafe":"","object.unknown":"","object.and":"","object.assert":"","object.base":"","object.length":"","object.max":"","object.min":"","object.missing":"","object.nand":"","object.pattern.match":"","object.refType":"","object.regex":"","object.rename.multiple":"","object.rename.override":"","object.schema":"","object.instance":"","object.with":"","object.without":"","object.xor":"","object.oxor":"","string.alphanum":"","string.base64":"","string.base":"","string.creditCard":"","string.dataUri":"","string.domain":"","string.email":"","string.empty":"{{#label}} is required","string.guid":"","string.hexAlign":"","string.hex":"","string.hostname":"","string.ipVersion":"","string.ip":"","string.isoDate":"","string.isoDuration":"","string.length":"","string.lowercase":"","string.max":"","string.min":"","string.normalize":"","string.pattern.base":"{{#label}} is not in the correct format","string.pattern.name":"","string.pattern.invert.base":"","string.pattern.invert.name":"","string.token":"","string.trim":"","string.uppercase":"","string.uri":"","string.uriCustomScheme":"","string.uriRelativeOnly":"","symbol.base":"","symbol.map":""},s=d;function S(){return l__default.default}function v(){return s}function b(){return Object.entries(s).reduce((r,[e,n])=>n?{...r,[e]:n}:r,{})}function g(r){let e=r.details.reduce((n,t)=>({...n,[t.path.join(".")]:t.message.replace(/"/gu,"")}),{});return new i(e)}async function m(r,e,n){try{return [await e.validateAsync(r,{abortEarly:!1,messages:n||b(),stripUnknown:!0}),null]}catch(t){return t instanceof l__default.default.ValidationError?[null,g(t)]:t instanceof Error?[null,t]:[null,new Error("Unknown validation error occured")]}}function w(r){return l__default.default.object(r)}function A(r,e){return r.append(e)}function c(r){return {cause:r.cause,message:r.message,name:r.name,stack:r.stack}}function p(r){return !!Object.prototype.hasOwnProperty.call(r,"fn")}async function f(r){let e={...r.formData};if(r.request){let[t,o]=await m(r.formData,r.request);if(o!==null)return o instanceof i&&r.onValidationError?.(o),[null,c(o)];e=t;}if(!p(r))return await r.onSuccess?.(e),[e,null];let n=null;try{n=await r.fn(e);}catch(t){if(t instanceof i)return r.onValidationError?.(t),[null,c(t)];throw t instanceof Error?t:new Error("The function supplied to submitForm encountered an unknown error")}if(!n)throw new Error("NO_MODEL");return await r.onSuccess?.(n),[n,null]}async function O(r){let[e,n]=await f(r);if(n!==null){if(n.name==="ValidationError")try{let t=JSON.parse(n.message);return [null,server.NextResponse.json(t,{status:422})]}catch{return [null,server.NextResponse.json({message:"An unknown error occured"},{status:500})]}return [null,server.NextResponse.json({message:n.message},{status:500})]}return [e,null]}var y=["image/png","image/jpeg","image/jpg"];async function R(r,e){return r?r instanceof File?(e?.types||y).includes(r.type)?r.size>(e?.maxSize||5242880)?Promise.resolve([null,new Error("IMAGE_TOO_HEAVY")]):Promise.resolve([r,null]):Promise.resolve([null,new Error("IMAGE_TYPE_NOT_VALID")]):Promise.resolve([null,new Error("IMAGE_NOT_VALID")]):Promise.resolve([null,new Error("IMAGE_UNDEFINED")])}exports.ValidationError=i;exports.createSchema=w;exports.extendSchema=A;exports.getDefaultErrorMessages=v;exports.submitAPIRequest=O;exports.submitForm=f;exports.validate=S;exports.validateImage=R;exports.validateSchema=m;//# sourceMappingURL=index.cjs.map
|
|
22
2
|
//# sourceMappingURL=index.cjs.map
|