@restura/core 0.1.0-alpha.2 → 0.1.0-alpha.20

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/index.d.mts CHANGED
@@ -1,3 +1,2595 @@
1
- declare function isEven(value: number): boolean;
1
+ import winston from 'winston';
2
+ import * as express from 'express';
3
+ import { z } from 'zod';
4
+ import { QueryResultRow, QueryConfigValues, QueryResult, PoolConfig, Pool, ClientConfig, Client } from 'pg';
5
+ import { IncomingHttpHeaders } from 'http2';
2
6
 
3
- export { isEven };
7
+ declare const logger: winston.Logger;
8
+
9
+ interface RsErrorInternalData {
10
+ err: ErrorCode;
11
+ msg: string;
12
+ stack: string;
13
+ status: number;
14
+ message?: string;
15
+ }
16
+ declare enum HtmlStatusCodes {
17
+ BAD_REQUEST = 400,
18
+ UNAUTHORIZED = 401,
19
+ FORBIDDEN = 403,
20
+ NOT_FOUND = 404,
21
+ METHOD_NOT_ALLOWED = 405,
22
+ CONFLICT = 409,
23
+ VERSION_OUT_OF_DATE = 418,// Technically this is the I'm a teapot code that was a joke.
24
+ SERVER_ERROR = 500,
25
+ SERVICE_UNAVAILABLE = 503,
26
+ NETWORK_CONNECT_TIMEOUT = 599
27
+ }
28
+ type ErrorCode = 'UNKNOWN_ERROR' | 'NOT_FOUND' | 'EMAIL_TAKEN' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UPDATE_FORBIDDEN' | 'CREATE_FORBIDDEN' | 'DELETE_FORBIDDEN' | 'DELETE_FAILURE' | 'BAD_REQUEST' | 'INVALID_TOKEN' | 'INCORRECT_EMAIL_OR_PASSWORD' | 'DUPLICATE_TOKEN' | 'DUPLICATE_USERNAME' | 'DUPLICATE_EMAIL' | 'DUPLICATE' | 'EMAIL_NOT_VERIFIED' | 'UPDATE_WITHOUT_ID' | 'CONNECTION_ERROR' | 'INVALID_PAYMENT' | 'DECLINED_PAYMENT' | 'INTEGRATION_ERROR' | 'CANNOT_RESERVE' | 'REFUND_FAILURE' | 'INVALID_INVOICE' | 'INVALID_COUPON' | 'SERVICE_UNAVAILABLE' | 'METHOD_UNALLOWED' | 'LOGIN_EXPIRED' | 'THIRD_PARTY_ERROR' | 'ACCESS_DENIED' | 'DATABASE_ERROR' | 'SCHEMA_ERROR';
29
+ declare class RsError {
30
+ err: ErrorCode;
31
+ msg: string;
32
+ status?: number;
33
+ stack: string;
34
+ constructor(errCode: ErrorCode, message?: string);
35
+ static htmlStatus(code: ErrorCode): number;
36
+ static isRsError(error: any): error is RsError;
37
+ }
38
+
39
+ declare const resturaConfigSchema: z.ZodObject<{
40
+ authToken: z.ZodString;
41
+ sendErrorStackTrace: z.ZodDefault<z.ZodBoolean>;
42
+ schemaFilePath: z.ZodDefault<z.ZodString>;
43
+ customApiFolderPath: z.ZodDefault<z.ZodString>;
44
+ generatedTypesPath: z.ZodDefault<z.ZodString>;
45
+ fileTempCachePath: z.ZodOptional<z.ZodString>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ authToken: string;
48
+ sendErrorStackTrace: boolean;
49
+ schemaFilePath: string;
50
+ customApiFolderPath: string;
51
+ generatedTypesPath: string;
52
+ fileTempCachePath?: string | undefined;
53
+ }, {
54
+ authToken: string;
55
+ sendErrorStackTrace?: boolean | undefined;
56
+ schemaFilePath?: string | undefined;
57
+ customApiFolderPath?: string | undefined;
58
+ generatedTypesPath?: string | undefined;
59
+ fileTempCachePath?: string | undefined;
60
+ }>;
61
+ type ResturaConfigSchema = z.infer<typeof resturaConfigSchema>;
62
+
63
+ declare const whereDataSchema: z.ZodObject<{
64
+ tableName: z.ZodOptional<z.ZodString>;
65
+ columnName: z.ZodOptional<z.ZodString>;
66
+ operator: z.ZodOptional<z.ZodEnum<["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]>>;
67
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
68
+ custom: z.ZodOptional<z.ZodString>;
69
+ conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
70
+ }, "strict", z.ZodTypeAny, {
71
+ value?: string | number | undefined;
72
+ custom?: string | undefined;
73
+ columnName?: string | undefined;
74
+ tableName?: string | undefined;
75
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
76
+ conjunction?: "AND" | "OR" | undefined;
77
+ }, {
78
+ value?: string | number | undefined;
79
+ custom?: string | undefined;
80
+ columnName?: string | undefined;
81
+ tableName?: string | undefined;
82
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
83
+ conjunction?: "AND" | "OR" | undefined;
84
+ }>;
85
+ type WhereData = z.infer<typeof whereDataSchema>;
86
+ declare const joinDataSchema: z.ZodObject<{
87
+ table: z.ZodString;
88
+ localColumnName: z.ZodOptional<z.ZodString>;
89
+ foreignColumnName: z.ZodOptional<z.ZodString>;
90
+ custom: z.ZodOptional<z.ZodString>;
91
+ type: z.ZodEnum<["LEFT", "INNER"]>;
92
+ alias: z.ZodOptional<z.ZodString>;
93
+ }, "strict", z.ZodTypeAny, {
94
+ type: "LEFT" | "INNER";
95
+ table: string;
96
+ custom?: string | undefined;
97
+ localColumnName?: string | undefined;
98
+ foreignColumnName?: string | undefined;
99
+ alias?: string | undefined;
100
+ }, {
101
+ type: "LEFT" | "INNER";
102
+ table: string;
103
+ custom?: string | undefined;
104
+ localColumnName?: string | undefined;
105
+ foreignColumnName?: string | undefined;
106
+ alias?: string | undefined;
107
+ }>;
108
+ type JoinData = z.infer<typeof joinDataSchema>;
109
+ declare const responseDataSchema: z.ZodObject<{
110
+ name: z.ZodString;
111
+ selector: z.ZodOptional<z.ZodString>;
112
+ subquery: z.ZodOptional<z.ZodObject<{
113
+ table: z.ZodString;
114
+ joins: z.ZodArray<z.ZodObject<{
115
+ table: z.ZodString;
116
+ localColumnName: z.ZodOptional<z.ZodString>;
117
+ foreignColumnName: z.ZodOptional<z.ZodString>;
118
+ custom: z.ZodOptional<z.ZodString>;
119
+ type: z.ZodEnum<["LEFT", "INNER"]>;
120
+ alias: z.ZodOptional<z.ZodString>;
121
+ }, "strict", z.ZodTypeAny, {
122
+ type: "LEFT" | "INNER";
123
+ table: string;
124
+ custom?: string | undefined;
125
+ localColumnName?: string | undefined;
126
+ foreignColumnName?: string | undefined;
127
+ alias?: string | undefined;
128
+ }, {
129
+ type: "LEFT" | "INNER";
130
+ table: string;
131
+ custom?: string | undefined;
132
+ localColumnName?: string | undefined;
133
+ foreignColumnName?: string | undefined;
134
+ alias?: string | undefined;
135
+ }>, "many">;
136
+ where: z.ZodArray<z.ZodObject<{
137
+ tableName: z.ZodOptional<z.ZodString>;
138
+ columnName: z.ZodOptional<z.ZodString>;
139
+ operator: z.ZodOptional<z.ZodEnum<["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]>>;
140
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
141
+ custom: z.ZodOptional<z.ZodString>;
142
+ conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
143
+ }, "strict", z.ZodTypeAny, {
144
+ value?: string | number | undefined;
145
+ custom?: string | undefined;
146
+ columnName?: string | undefined;
147
+ tableName?: string | undefined;
148
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
149
+ conjunction?: "AND" | "OR" | undefined;
150
+ }, {
151
+ value?: string | number | undefined;
152
+ custom?: string | undefined;
153
+ columnName?: string | undefined;
154
+ tableName?: string | undefined;
155
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
156
+ conjunction?: "AND" | "OR" | undefined;
157
+ }>, "many">;
158
+ properties: z.ZodArray<z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>, "many">;
159
+ groupBy: z.ZodOptional<z.ZodObject<{
160
+ columnName: z.ZodString;
161
+ tableName: z.ZodString;
162
+ }, "strict", z.ZodTypeAny, {
163
+ columnName: string;
164
+ tableName: string;
165
+ }, {
166
+ columnName: string;
167
+ tableName: string;
168
+ }>>;
169
+ orderBy: z.ZodOptional<z.ZodObject<{
170
+ columnName: z.ZodString;
171
+ order: z.ZodEnum<["ASC", "DESC"]>;
172
+ tableName: z.ZodString;
173
+ }, "strict", z.ZodTypeAny, {
174
+ columnName: string;
175
+ order: "ASC" | "DESC";
176
+ tableName: string;
177
+ }, {
178
+ columnName: string;
179
+ order: "ASC" | "DESC";
180
+ tableName: string;
181
+ }>>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ table: string;
184
+ joins: {
185
+ type: "LEFT" | "INNER";
186
+ table: string;
187
+ custom?: string | undefined;
188
+ localColumnName?: string | undefined;
189
+ foreignColumnName?: string | undefined;
190
+ alias?: string | undefined;
191
+ }[];
192
+ where: {
193
+ value?: string | number | undefined;
194
+ custom?: string | undefined;
195
+ columnName?: string | undefined;
196
+ tableName?: string | undefined;
197
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
198
+ conjunction?: "AND" | "OR" | undefined;
199
+ }[];
200
+ properties: any[];
201
+ groupBy?: {
202
+ columnName: string;
203
+ tableName: string;
204
+ } | undefined;
205
+ orderBy?: {
206
+ columnName: string;
207
+ order: "ASC" | "DESC";
208
+ tableName: string;
209
+ } | undefined;
210
+ }, {
211
+ table: string;
212
+ joins: {
213
+ type: "LEFT" | "INNER";
214
+ table: string;
215
+ custom?: string | undefined;
216
+ localColumnName?: string | undefined;
217
+ foreignColumnName?: string | undefined;
218
+ alias?: string | undefined;
219
+ }[];
220
+ where: {
221
+ value?: string | number | undefined;
222
+ custom?: string | undefined;
223
+ columnName?: string | undefined;
224
+ tableName?: string | undefined;
225
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
226
+ conjunction?: "AND" | "OR" | undefined;
227
+ }[];
228
+ properties: any[];
229
+ groupBy?: {
230
+ columnName: string;
231
+ tableName: string;
232
+ } | undefined;
233
+ orderBy?: {
234
+ columnName: string;
235
+ order: "ASC" | "DESC";
236
+ tableName: string;
237
+ } | undefined;
238
+ }>>;
239
+ }, "strict", z.ZodTypeAny, {
240
+ name: string;
241
+ selector?: string | undefined;
242
+ subquery?: {
243
+ table: string;
244
+ joins: {
245
+ type: "LEFT" | "INNER";
246
+ table: string;
247
+ custom?: string | undefined;
248
+ localColumnName?: string | undefined;
249
+ foreignColumnName?: string | undefined;
250
+ alias?: string | undefined;
251
+ }[];
252
+ where: {
253
+ value?: string | number | undefined;
254
+ custom?: string | undefined;
255
+ columnName?: string | undefined;
256
+ tableName?: string | undefined;
257
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
258
+ conjunction?: "AND" | "OR" | undefined;
259
+ }[];
260
+ properties: any[];
261
+ groupBy?: {
262
+ columnName: string;
263
+ tableName: string;
264
+ } | undefined;
265
+ orderBy?: {
266
+ columnName: string;
267
+ order: "ASC" | "DESC";
268
+ tableName: string;
269
+ } | undefined;
270
+ } | undefined;
271
+ }, {
272
+ name: string;
273
+ selector?: string | undefined;
274
+ subquery?: {
275
+ table: string;
276
+ joins: {
277
+ type: "LEFT" | "INNER";
278
+ table: string;
279
+ custom?: string | undefined;
280
+ localColumnName?: string | undefined;
281
+ foreignColumnName?: string | undefined;
282
+ alias?: string | undefined;
283
+ }[];
284
+ where: {
285
+ value?: string | number | undefined;
286
+ custom?: string | undefined;
287
+ columnName?: string | undefined;
288
+ tableName?: string | undefined;
289
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
290
+ conjunction?: "AND" | "OR" | undefined;
291
+ }[];
292
+ properties: any[];
293
+ groupBy?: {
294
+ columnName: string;
295
+ tableName: string;
296
+ } | undefined;
297
+ orderBy?: {
298
+ columnName: string;
299
+ order: "ASC" | "DESC";
300
+ tableName: string;
301
+ } | undefined;
302
+ } | undefined;
303
+ }>;
304
+ type ResponseData = z.infer<typeof responseDataSchema>;
305
+ declare const standardRouteSchema: z.ZodObject<z.objectUtil.extendShape<{
306
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
307
+ name: z.ZodString;
308
+ description: z.ZodString;
309
+ path: z.ZodString;
310
+ roles: z.ZodArray<z.ZodString, "many">;
311
+ }, {
312
+ type: z.ZodEnum<["ONE", "ARRAY", "PAGED"]>;
313
+ table: z.ZodString;
314
+ joins: z.ZodArray<z.ZodObject<{
315
+ table: z.ZodString;
316
+ localColumnName: z.ZodOptional<z.ZodString>;
317
+ foreignColumnName: z.ZodOptional<z.ZodString>;
318
+ custom: z.ZodOptional<z.ZodString>;
319
+ type: z.ZodEnum<["LEFT", "INNER"]>;
320
+ alias: z.ZodOptional<z.ZodString>;
321
+ }, "strict", z.ZodTypeAny, {
322
+ type: "LEFT" | "INNER";
323
+ table: string;
324
+ custom?: string | undefined;
325
+ localColumnName?: string | undefined;
326
+ foreignColumnName?: string | undefined;
327
+ alias?: string | undefined;
328
+ }, {
329
+ type: "LEFT" | "INNER";
330
+ table: string;
331
+ custom?: string | undefined;
332
+ localColumnName?: string | undefined;
333
+ foreignColumnName?: string | undefined;
334
+ alias?: string | undefined;
335
+ }>, "many">;
336
+ assignments: z.ZodArray<z.ZodObject<{
337
+ name: z.ZodString;
338
+ value: z.ZodString;
339
+ }, "strict", z.ZodTypeAny, {
340
+ value: string;
341
+ name: string;
342
+ }, {
343
+ value: string;
344
+ name: string;
345
+ }>, "many">;
346
+ where: z.ZodArray<z.ZodObject<{
347
+ tableName: z.ZodOptional<z.ZodString>;
348
+ columnName: z.ZodOptional<z.ZodString>;
349
+ operator: z.ZodOptional<z.ZodEnum<["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]>>;
350
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
351
+ custom: z.ZodOptional<z.ZodString>;
352
+ conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
353
+ }, "strict", z.ZodTypeAny, {
354
+ value?: string | number | undefined;
355
+ custom?: string | undefined;
356
+ columnName?: string | undefined;
357
+ tableName?: string | undefined;
358
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
359
+ conjunction?: "AND" | "OR" | undefined;
360
+ }, {
361
+ value?: string | number | undefined;
362
+ custom?: string | undefined;
363
+ columnName?: string | undefined;
364
+ tableName?: string | undefined;
365
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
366
+ conjunction?: "AND" | "OR" | undefined;
367
+ }>, "many">;
368
+ request: z.ZodArray<z.ZodObject<{
369
+ name: z.ZodString;
370
+ required: z.ZodBoolean;
371
+ isNullable: z.ZodOptional<z.ZodBoolean>;
372
+ validator: z.ZodArray<z.ZodObject<{
373
+ type: z.ZodEnum<["TYPE_CHECK", "MIN", "MAX", "ONE_OF"]>;
374
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>;
375
+ }, "strict", z.ZodTypeAny, {
376
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
377
+ value: string | number | string[] | number[];
378
+ }, {
379
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
380
+ value: string | number | string[] | number[];
381
+ }>, "many">;
382
+ }, "strict", z.ZodTypeAny, {
383
+ name: string;
384
+ required: boolean;
385
+ validator: {
386
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
387
+ value: string | number | string[] | number[];
388
+ }[];
389
+ isNullable?: boolean | undefined;
390
+ }, {
391
+ name: string;
392
+ required: boolean;
393
+ validator: {
394
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
395
+ value: string | number | string[] | number[];
396
+ }[];
397
+ isNullable?: boolean | undefined;
398
+ }>, "many">;
399
+ response: z.ZodArray<z.ZodObject<{
400
+ name: z.ZodString;
401
+ selector: z.ZodOptional<z.ZodString>;
402
+ subquery: z.ZodOptional<z.ZodObject<{
403
+ table: z.ZodString;
404
+ joins: z.ZodArray<z.ZodObject<{
405
+ table: z.ZodString;
406
+ localColumnName: z.ZodOptional<z.ZodString>;
407
+ foreignColumnName: z.ZodOptional<z.ZodString>;
408
+ custom: z.ZodOptional<z.ZodString>;
409
+ type: z.ZodEnum<["LEFT", "INNER"]>;
410
+ alias: z.ZodOptional<z.ZodString>;
411
+ }, "strict", z.ZodTypeAny, {
412
+ type: "LEFT" | "INNER";
413
+ table: string;
414
+ custom?: string | undefined;
415
+ localColumnName?: string | undefined;
416
+ foreignColumnName?: string | undefined;
417
+ alias?: string | undefined;
418
+ }, {
419
+ type: "LEFT" | "INNER";
420
+ table: string;
421
+ custom?: string | undefined;
422
+ localColumnName?: string | undefined;
423
+ foreignColumnName?: string | undefined;
424
+ alias?: string | undefined;
425
+ }>, "many">;
426
+ where: z.ZodArray<z.ZodObject<{
427
+ tableName: z.ZodOptional<z.ZodString>;
428
+ columnName: z.ZodOptional<z.ZodString>;
429
+ operator: z.ZodOptional<z.ZodEnum<["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]>>;
430
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
431
+ custom: z.ZodOptional<z.ZodString>;
432
+ conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
433
+ }, "strict", z.ZodTypeAny, {
434
+ value?: string | number | undefined;
435
+ custom?: string | undefined;
436
+ columnName?: string | undefined;
437
+ tableName?: string | undefined;
438
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
439
+ conjunction?: "AND" | "OR" | undefined;
440
+ }, {
441
+ value?: string | number | undefined;
442
+ custom?: string | undefined;
443
+ columnName?: string | undefined;
444
+ tableName?: string | undefined;
445
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
446
+ conjunction?: "AND" | "OR" | undefined;
447
+ }>, "many">;
448
+ properties: z.ZodArray<z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>, "many">;
449
+ groupBy: z.ZodOptional<z.ZodObject<{
450
+ columnName: z.ZodString;
451
+ tableName: z.ZodString;
452
+ }, "strict", z.ZodTypeAny, {
453
+ columnName: string;
454
+ tableName: string;
455
+ }, {
456
+ columnName: string;
457
+ tableName: string;
458
+ }>>;
459
+ orderBy: z.ZodOptional<z.ZodObject<{
460
+ columnName: z.ZodString;
461
+ order: z.ZodEnum<["ASC", "DESC"]>;
462
+ tableName: z.ZodString;
463
+ }, "strict", z.ZodTypeAny, {
464
+ columnName: string;
465
+ order: "ASC" | "DESC";
466
+ tableName: string;
467
+ }, {
468
+ columnName: string;
469
+ order: "ASC" | "DESC";
470
+ tableName: string;
471
+ }>>;
472
+ }, "strip", z.ZodTypeAny, {
473
+ table: string;
474
+ joins: {
475
+ type: "LEFT" | "INNER";
476
+ table: string;
477
+ custom?: string | undefined;
478
+ localColumnName?: string | undefined;
479
+ foreignColumnName?: string | undefined;
480
+ alias?: string | undefined;
481
+ }[];
482
+ where: {
483
+ value?: string | number | undefined;
484
+ custom?: string | undefined;
485
+ columnName?: string | undefined;
486
+ tableName?: string | undefined;
487
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
488
+ conjunction?: "AND" | "OR" | undefined;
489
+ }[];
490
+ properties: any[];
491
+ groupBy?: {
492
+ columnName: string;
493
+ tableName: string;
494
+ } | undefined;
495
+ orderBy?: {
496
+ columnName: string;
497
+ order: "ASC" | "DESC";
498
+ tableName: string;
499
+ } | undefined;
500
+ }, {
501
+ table: string;
502
+ joins: {
503
+ type: "LEFT" | "INNER";
504
+ table: string;
505
+ custom?: string | undefined;
506
+ localColumnName?: string | undefined;
507
+ foreignColumnName?: string | undefined;
508
+ alias?: string | undefined;
509
+ }[];
510
+ where: {
511
+ value?: string | number | undefined;
512
+ custom?: string | undefined;
513
+ columnName?: string | undefined;
514
+ tableName?: string | undefined;
515
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
516
+ conjunction?: "AND" | "OR" | undefined;
517
+ }[];
518
+ properties: any[];
519
+ groupBy?: {
520
+ columnName: string;
521
+ tableName: string;
522
+ } | undefined;
523
+ orderBy?: {
524
+ columnName: string;
525
+ order: "ASC" | "DESC";
526
+ tableName: string;
527
+ } | undefined;
528
+ }>>;
529
+ }, "strict", z.ZodTypeAny, {
530
+ name: string;
531
+ selector?: string | undefined;
532
+ subquery?: {
533
+ table: string;
534
+ joins: {
535
+ type: "LEFT" | "INNER";
536
+ table: string;
537
+ custom?: string | undefined;
538
+ localColumnName?: string | undefined;
539
+ foreignColumnName?: string | undefined;
540
+ alias?: string | undefined;
541
+ }[];
542
+ where: {
543
+ value?: string | number | undefined;
544
+ custom?: string | undefined;
545
+ columnName?: string | undefined;
546
+ tableName?: string | undefined;
547
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
548
+ conjunction?: "AND" | "OR" | undefined;
549
+ }[];
550
+ properties: any[];
551
+ groupBy?: {
552
+ columnName: string;
553
+ tableName: string;
554
+ } | undefined;
555
+ orderBy?: {
556
+ columnName: string;
557
+ order: "ASC" | "DESC";
558
+ tableName: string;
559
+ } | undefined;
560
+ } | undefined;
561
+ }, {
562
+ name: string;
563
+ selector?: string | undefined;
564
+ subquery?: {
565
+ table: string;
566
+ joins: {
567
+ type: "LEFT" | "INNER";
568
+ table: string;
569
+ custom?: string | undefined;
570
+ localColumnName?: string | undefined;
571
+ foreignColumnName?: string | undefined;
572
+ alias?: string | undefined;
573
+ }[];
574
+ where: {
575
+ value?: string | number | undefined;
576
+ custom?: string | undefined;
577
+ columnName?: string | undefined;
578
+ tableName?: string | undefined;
579
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
580
+ conjunction?: "AND" | "OR" | undefined;
581
+ }[];
582
+ properties: any[];
583
+ groupBy?: {
584
+ columnName: string;
585
+ tableName: string;
586
+ } | undefined;
587
+ orderBy?: {
588
+ columnName: string;
589
+ order: "ASC" | "DESC";
590
+ tableName: string;
591
+ } | undefined;
592
+ } | undefined;
593
+ }>, "many">;
594
+ groupBy: z.ZodOptional<z.ZodObject<{
595
+ columnName: z.ZodString;
596
+ tableName: z.ZodString;
597
+ }, "strict", z.ZodTypeAny, {
598
+ columnName: string;
599
+ tableName: string;
600
+ }, {
601
+ columnName: string;
602
+ tableName: string;
603
+ }>>;
604
+ orderBy: z.ZodOptional<z.ZodObject<{
605
+ columnName: z.ZodString;
606
+ order: z.ZodEnum<["ASC", "DESC"]>;
607
+ tableName: z.ZodString;
608
+ }, "strict", z.ZodTypeAny, {
609
+ columnName: string;
610
+ order: "ASC" | "DESC";
611
+ tableName: string;
612
+ }, {
613
+ columnName: string;
614
+ order: "ASC" | "DESC";
615
+ tableName: string;
616
+ }>>;
617
+ }>, "strict", z.ZodTypeAny, {
618
+ path: string;
619
+ type: "ONE" | "ARRAY" | "PAGED";
620
+ name: string;
621
+ table: string;
622
+ joins: {
623
+ type: "LEFT" | "INNER";
624
+ table: string;
625
+ custom?: string | undefined;
626
+ localColumnName?: string | undefined;
627
+ foreignColumnName?: string | undefined;
628
+ alias?: string | undefined;
629
+ }[];
630
+ where: {
631
+ value?: string | number | undefined;
632
+ custom?: string | undefined;
633
+ columnName?: string | undefined;
634
+ tableName?: string | undefined;
635
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
636
+ conjunction?: "AND" | "OR" | undefined;
637
+ }[];
638
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
639
+ description: string;
640
+ roles: string[];
641
+ assignments: {
642
+ value: string;
643
+ name: string;
644
+ }[];
645
+ request: {
646
+ name: string;
647
+ required: boolean;
648
+ validator: {
649
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
650
+ value: string | number | string[] | number[];
651
+ }[];
652
+ isNullable?: boolean | undefined;
653
+ }[];
654
+ response: {
655
+ name: string;
656
+ selector?: string | undefined;
657
+ subquery?: {
658
+ table: string;
659
+ joins: {
660
+ type: "LEFT" | "INNER";
661
+ table: string;
662
+ custom?: string | undefined;
663
+ localColumnName?: string | undefined;
664
+ foreignColumnName?: string | undefined;
665
+ alias?: string | undefined;
666
+ }[];
667
+ where: {
668
+ value?: string | number | undefined;
669
+ custom?: string | undefined;
670
+ columnName?: string | undefined;
671
+ tableName?: string | undefined;
672
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
673
+ conjunction?: "AND" | "OR" | undefined;
674
+ }[];
675
+ properties: any[];
676
+ groupBy?: {
677
+ columnName: string;
678
+ tableName: string;
679
+ } | undefined;
680
+ orderBy?: {
681
+ columnName: string;
682
+ order: "ASC" | "DESC";
683
+ tableName: string;
684
+ } | undefined;
685
+ } | undefined;
686
+ }[];
687
+ groupBy?: {
688
+ columnName: string;
689
+ tableName: string;
690
+ } | undefined;
691
+ orderBy?: {
692
+ columnName: string;
693
+ order: "ASC" | "DESC";
694
+ tableName: string;
695
+ } | undefined;
696
+ }, {
697
+ path: string;
698
+ type: "ONE" | "ARRAY" | "PAGED";
699
+ name: string;
700
+ table: string;
701
+ joins: {
702
+ type: "LEFT" | "INNER";
703
+ table: string;
704
+ custom?: string | undefined;
705
+ localColumnName?: string | undefined;
706
+ foreignColumnName?: string | undefined;
707
+ alias?: string | undefined;
708
+ }[];
709
+ where: {
710
+ value?: string | number | undefined;
711
+ custom?: string | undefined;
712
+ columnName?: string | undefined;
713
+ tableName?: string | undefined;
714
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
715
+ conjunction?: "AND" | "OR" | undefined;
716
+ }[];
717
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
718
+ description: string;
719
+ roles: string[];
720
+ assignments: {
721
+ value: string;
722
+ name: string;
723
+ }[];
724
+ request: {
725
+ name: string;
726
+ required: boolean;
727
+ validator: {
728
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
729
+ value: string | number | string[] | number[];
730
+ }[];
731
+ isNullable?: boolean | undefined;
732
+ }[];
733
+ response: {
734
+ name: string;
735
+ selector?: string | undefined;
736
+ subquery?: {
737
+ table: string;
738
+ joins: {
739
+ type: "LEFT" | "INNER";
740
+ table: string;
741
+ custom?: string | undefined;
742
+ localColumnName?: string | undefined;
743
+ foreignColumnName?: string | undefined;
744
+ alias?: string | undefined;
745
+ }[];
746
+ where: {
747
+ value?: string | number | undefined;
748
+ custom?: string | undefined;
749
+ columnName?: string | undefined;
750
+ tableName?: string | undefined;
751
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
752
+ conjunction?: "AND" | "OR" | undefined;
753
+ }[];
754
+ properties: any[];
755
+ groupBy?: {
756
+ columnName: string;
757
+ tableName: string;
758
+ } | undefined;
759
+ orderBy?: {
760
+ columnName: string;
761
+ order: "ASC" | "DESC";
762
+ tableName: string;
763
+ } | undefined;
764
+ } | undefined;
765
+ }[];
766
+ groupBy?: {
767
+ columnName: string;
768
+ tableName: string;
769
+ } | undefined;
770
+ orderBy?: {
771
+ columnName: string;
772
+ order: "ASC" | "DESC";
773
+ tableName: string;
774
+ } | undefined;
775
+ }>;
776
+ type StandardRouteData = z.infer<typeof standardRouteSchema>;
777
+ declare const customRouteSchema: z.ZodObject<z.objectUtil.extendShape<{
778
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
779
+ name: z.ZodString;
780
+ description: z.ZodString;
781
+ path: z.ZodString;
782
+ roles: z.ZodArray<z.ZodString, "many">;
783
+ }, {
784
+ type: z.ZodEnum<["CUSTOM_ONE", "CUSTOM_ARRAY", "CUSTOM_PAGED"]>;
785
+ responseType: z.ZodUnion<[z.ZodString, z.ZodEnum<["string", "number", "boolean"]>]>;
786
+ requestType: z.ZodOptional<z.ZodString>;
787
+ request: z.ZodOptional<z.ZodArray<z.ZodObject<{
788
+ name: z.ZodString;
789
+ required: z.ZodBoolean;
790
+ isNullable: z.ZodOptional<z.ZodBoolean>;
791
+ validator: z.ZodArray<z.ZodObject<{
792
+ type: z.ZodEnum<["TYPE_CHECK", "MIN", "MAX", "ONE_OF"]>;
793
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>;
794
+ }, "strict", z.ZodTypeAny, {
795
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
796
+ value: string | number | string[] | number[];
797
+ }, {
798
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
799
+ value: string | number | string[] | number[];
800
+ }>, "many">;
801
+ }, "strict", z.ZodTypeAny, {
802
+ name: string;
803
+ required: boolean;
804
+ validator: {
805
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
806
+ value: string | number | string[] | number[];
807
+ }[];
808
+ isNullable?: boolean | undefined;
809
+ }, {
810
+ name: string;
811
+ required: boolean;
812
+ validator: {
813
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
814
+ value: string | number | string[] | number[];
815
+ }[];
816
+ isNullable?: boolean | undefined;
817
+ }>, "many">>;
818
+ table: z.ZodUndefined;
819
+ joins: z.ZodUndefined;
820
+ assignments: z.ZodUndefined;
821
+ fileUploadType: z.ZodOptional<z.ZodEnum<["SINGLE", "MULTIPLE"]>>;
822
+ }>, "strict", z.ZodTypeAny, {
823
+ path: string;
824
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
825
+ name: string;
826
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
827
+ description: string;
828
+ roles: string[];
829
+ responseType: string;
830
+ table?: undefined;
831
+ joins?: undefined;
832
+ assignments?: undefined;
833
+ request?: {
834
+ name: string;
835
+ required: boolean;
836
+ validator: {
837
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
838
+ value: string | number | string[] | number[];
839
+ }[];
840
+ isNullable?: boolean | undefined;
841
+ }[] | undefined;
842
+ requestType?: string | undefined;
843
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
844
+ }, {
845
+ path: string;
846
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
847
+ name: string;
848
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
849
+ description: string;
850
+ roles: string[];
851
+ responseType: string;
852
+ table?: undefined;
853
+ joins?: undefined;
854
+ assignments?: undefined;
855
+ request?: {
856
+ name: string;
857
+ required: boolean;
858
+ validator: {
859
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
860
+ value: string | number | string[] | number[];
861
+ }[];
862
+ isNullable?: boolean | undefined;
863
+ }[] | undefined;
864
+ requestType?: string | undefined;
865
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
866
+ }>;
867
+ type CustomRouteData = z.infer<typeof customRouteSchema>;
868
+ type RouteData = CustomRouteData | StandardRouteData;
869
+ declare const tableDataSchema: z.ZodObject<{
870
+ name: z.ZodString;
871
+ columns: z.ZodArray<z.ZodObject<{
872
+ name: z.ZodString;
873
+ type: z.ZodUnion<[z.ZodEnum<["SMALLINT", "INTEGER", "BIGINT", "DECIMAL", "NUMERIC", "REAL", "DOUBLE PRECISION", "SERIAL", "BIGSERIAL"]>, z.ZodEnum<["CHAR", "VARCHAR", "TEXT", "BYTEA"]>, z.ZodEnum<["DATE", "TIMESTAMP", "TIMESTAMPTZ", "TIME", "INTERVAL"]>, z.ZodEnum<["JSON", "JSONB"]>, z.ZodEnum<["BOOLEAN", "TINYINT", "SMALLINT", "MEDIUMINT", "INTEGER", "BIGINT", "DECIMAL", "FLOAT", "DOUBLE"]>, z.ZodEnum<["CHAR", "VARCHAR", "TINYTEXT", "TINYBLOB", "TEXT", "BLOB", "MEDIUMTEXT", "MEDIUMBLOB", "LONGTEXT", "JSON", "LONGBLOB", "ENUM"]>, z.ZodEnum<["DATE", "DATETIME", "TIME", "TIMESTAMP"]>]>;
874
+ isNullable: z.ZodBoolean;
875
+ roles: z.ZodArray<z.ZodString, "many">;
876
+ comment: z.ZodOptional<z.ZodString>;
877
+ default: z.ZodOptional<z.ZodString>;
878
+ value: z.ZodOptional<z.ZodString>;
879
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
880
+ isUnique: z.ZodOptional<z.ZodBoolean>;
881
+ hasAutoIncrement: z.ZodOptional<z.ZodBoolean>;
882
+ length: z.ZodOptional<z.ZodNumber>;
883
+ }, "strict", z.ZodTypeAny, {
884
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
885
+ name: string;
886
+ isNullable: boolean;
887
+ roles: string[];
888
+ length?: number | undefined;
889
+ value?: string | undefined;
890
+ default?: string | undefined;
891
+ comment?: string | undefined;
892
+ isPrimary?: boolean | undefined;
893
+ isUnique?: boolean | undefined;
894
+ hasAutoIncrement?: boolean | undefined;
895
+ }, {
896
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
897
+ name: string;
898
+ isNullable: boolean;
899
+ roles: string[];
900
+ length?: number | undefined;
901
+ value?: string | undefined;
902
+ default?: string | undefined;
903
+ comment?: string | undefined;
904
+ isPrimary?: boolean | undefined;
905
+ isUnique?: boolean | undefined;
906
+ hasAutoIncrement?: boolean | undefined;
907
+ }>, "many">;
908
+ indexes: z.ZodArray<z.ZodObject<{
909
+ name: z.ZodString;
910
+ columns: z.ZodArray<z.ZodString, "many">;
911
+ isUnique: z.ZodBoolean;
912
+ isPrimaryKey: z.ZodBoolean;
913
+ order: z.ZodEnum<["ASC", "DESC"]>;
914
+ }, "strict", z.ZodTypeAny, {
915
+ order: "ASC" | "DESC";
916
+ name: string;
917
+ isUnique: boolean;
918
+ columns: string[];
919
+ isPrimaryKey: boolean;
920
+ }, {
921
+ order: "ASC" | "DESC";
922
+ name: string;
923
+ isUnique: boolean;
924
+ columns: string[];
925
+ isPrimaryKey: boolean;
926
+ }>, "many">;
927
+ foreignKeys: z.ZodArray<z.ZodObject<{
928
+ name: z.ZodString;
929
+ column: z.ZodString;
930
+ refTable: z.ZodString;
931
+ refColumn: z.ZodString;
932
+ onDelete: z.ZodEnum<["CASCADE", "SET NULL", "RESTRICT", "NO ACTION", "SET DEFAULT"]>;
933
+ onUpdate: z.ZodEnum<["CASCADE", "SET NULL", "RESTRICT", "NO ACTION", "SET DEFAULT"]>;
934
+ }, "strict", z.ZodTypeAny, {
935
+ name: string;
936
+ column: string;
937
+ refTable: string;
938
+ refColumn: string;
939
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
940
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
941
+ }, {
942
+ name: string;
943
+ column: string;
944
+ refTable: string;
945
+ refColumn: string;
946
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
947
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
948
+ }>, "many">;
949
+ checkConstraints: z.ZodArray<z.ZodObject<{
950
+ name: z.ZodString;
951
+ check: z.ZodString;
952
+ }, "strict", z.ZodTypeAny, {
953
+ name: string;
954
+ check: string;
955
+ }, {
956
+ name: string;
957
+ check: string;
958
+ }>, "many">;
959
+ roles: z.ZodArray<z.ZodString, "many">;
960
+ }, "strict", z.ZodTypeAny, {
961
+ name: string;
962
+ roles: string[];
963
+ columns: {
964
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
965
+ name: string;
966
+ isNullable: boolean;
967
+ roles: string[];
968
+ length?: number | undefined;
969
+ value?: string | undefined;
970
+ default?: string | undefined;
971
+ comment?: string | undefined;
972
+ isPrimary?: boolean | undefined;
973
+ isUnique?: boolean | undefined;
974
+ hasAutoIncrement?: boolean | undefined;
975
+ }[];
976
+ indexes: {
977
+ order: "ASC" | "DESC";
978
+ name: string;
979
+ isUnique: boolean;
980
+ columns: string[];
981
+ isPrimaryKey: boolean;
982
+ }[];
983
+ foreignKeys: {
984
+ name: string;
985
+ column: string;
986
+ refTable: string;
987
+ refColumn: string;
988
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
989
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
990
+ }[];
991
+ checkConstraints: {
992
+ name: string;
993
+ check: string;
994
+ }[];
995
+ }, {
996
+ name: string;
997
+ roles: string[];
998
+ columns: {
999
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
1000
+ name: string;
1001
+ isNullable: boolean;
1002
+ roles: string[];
1003
+ length?: number | undefined;
1004
+ value?: string | undefined;
1005
+ default?: string | undefined;
1006
+ comment?: string | undefined;
1007
+ isPrimary?: boolean | undefined;
1008
+ isUnique?: boolean | undefined;
1009
+ hasAutoIncrement?: boolean | undefined;
1010
+ }[];
1011
+ indexes: {
1012
+ order: "ASC" | "DESC";
1013
+ name: string;
1014
+ isUnique: boolean;
1015
+ columns: string[];
1016
+ isPrimaryKey: boolean;
1017
+ }[];
1018
+ foreignKeys: {
1019
+ name: string;
1020
+ column: string;
1021
+ refTable: string;
1022
+ refColumn: string;
1023
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1024
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1025
+ }[];
1026
+ checkConstraints: {
1027
+ name: string;
1028
+ check: string;
1029
+ }[];
1030
+ }>;
1031
+ type TableData = z.infer<typeof tableDataSchema>;
1032
+ declare const resturaZodSchema: z.ZodObject<{
1033
+ database: z.ZodArray<z.ZodObject<{
1034
+ name: z.ZodString;
1035
+ columns: z.ZodArray<z.ZodObject<{
1036
+ name: z.ZodString;
1037
+ type: z.ZodUnion<[z.ZodEnum<["SMALLINT", "INTEGER", "BIGINT", "DECIMAL", "NUMERIC", "REAL", "DOUBLE PRECISION", "SERIAL", "BIGSERIAL"]>, z.ZodEnum<["CHAR", "VARCHAR", "TEXT", "BYTEA"]>, z.ZodEnum<["DATE", "TIMESTAMP", "TIMESTAMPTZ", "TIME", "INTERVAL"]>, z.ZodEnum<["JSON", "JSONB"]>, z.ZodEnum<["BOOLEAN", "TINYINT", "SMALLINT", "MEDIUMINT", "INTEGER", "BIGINT", "DECIMAL", "FLOAT", "DOUBLE"]>, z.ZodEnum<["CHAR", "VARCHAR", "TINYTEXT", "TINYBLOB", "TEXT", "BLOB", "MEDIUMTEXT", "MEDIUMBLOB", "LONGTEXT", "JSON", "LONGBLOB", "ENUM"]>, z.ZodEnum<["DATE", "DATETIME", "TIME", "TIMESTAMP"]>]>;
1038
+ isNullable: z.ZodBoolean;
1039
+ roles: z.ZodArray<z.ZodString, "many">;
1040
+ comment: z.ZodOptional<z.ZodString>;
1041
+ default: z.ZodOptional<z.ZodString>;
1042
+ value: z.ZodOptional<z.ZodString>;
1043
+ isPrimary: z.ZodOptional<z.ZodBoolean>;
1044
+ isUnique: z.ZodOptional<z.ZodBoolean>;
1045
+ hasAutoIncrement: z.ZodOptional<z.ZodBoolean>;
1046
+ length: z.ZodOptional<z.ZodNumber>;
1047
+ }, "strict", z.ZodTypeAny, {
1048
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
1049
+ name: string;
1050
+ isNullable: boolean;
1051
+ roles: string[];
1052
+ length?: number | undefined;
1053
+ value?: string | undefined;
1054
+ default?: string | undefined;
1055
+ comment?: string | undefined;
1056
+ isPrimary?: boolean | undefined;
1057
+ isUnique?: boolean | undefined;
1058
+ hasAutoIncrement?: boolean | undefined;
1059
+ }, {
1060
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
1061
+ name: string;
1062
+ isNullable: boolean;
1063
+ roles: string[];
1064
+ length?: number | undefined;
1065
+ value?: string | undefined;
1066
+ default?: string | undefined;
1067
+ comment?: string | undefined;
1068
+ isPrimary?: boolean | undefined;
1069
+ isUnique?: boolean | undefined;
1070
+ hasAutoIncrement?: boolean | undefined;
1071
+ }>, "many">;
1072
+ indexes: z.ZodArray<z.ZodObject<{
1073
+ name: z.ZodString;
1074
+ columns: z.ZodArray<z.ZodString, "many">;
1075
+ isUnique: z.ZodBoolean;
1076
+ isPrimaryKey: z.ZodBoolean;
1077
+ order: z.ZodEnum<["ASC", "DESC"]>;
1078
+ }, "strict", z.ZodTypeAny, {
1079
+ order: "ASC" | "DESC";
1080
+ name: string;
1081
+ isUnique: boolean;
1082
+ columns: string[];
1083
+ isPrimaryKey: boolean;
1084
+ }, {
1085
+ order: "ASC" | "DESC";
1086
+ name: string;
1087
+ isUnique: boolean;
1088
+ columns: string[];
1089
+ isPrimaryKey: boolean;
1090
+ }>, "many">;
1091
+ foreignKeys: z.ZodArray<z.ZodObject<{
1092
+ name: z.ZodString;
1093
+ column: z.ZodString;
1094
+ refTable: z.ZodString;
1095
+ refColumn: z.ZodString;
1096
+ onDelete: z.ZodEnum<["CASCADE", "SET NULL", "RESTRICT", "NO ACTION", "SET DEFAULT"]>;
1097
+ onUpdate: z.ZodEnum<["CASCADE", "SET NULL", "RESTRICT", "NO ACTION", "SET DEFAULT"]>;
1098
+ }, "strict", z.ZodTypeAny, {
1099
+ name: string;
1100
+ column: string;
1101
+ refTable: string;
1102
+ refColumn: string;
1103
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1104
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1105
+ }, {
1106
+ name: string;
1107
+ column: string;
1108
+ refTable: string;
1109
+ refColumn: string;
1110
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1111
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1112
+ }>, "many">;
1113
+ checkConstraints: z.ZodArray<z.ZodObject<{
1114
+ name: z.ZodString;
1115
+ check: z.ZodString;
1116
+ }, "strict", z.ZodTypeAny, {
1117
+ name: string;
1118
+ check: string;
1119
+ }, {
1120
+ name: string;
1121
+ check: string;
1122
+ }>, "many">;
1123
+ roles: z.ZodArray<z.ZodString, "many">;
1124
+ }, "strict", z.ZodTypeAny, {
1125
+ name: string;
1126
+ roles: string[];
1127
+ columns: {
1128
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
1129
+ name: string;
1130
+ isNullable: boolean;
1131
+ roles: string[];
1132
+ length?: number | undefined;
1133
+ value?: string | undefined;
1134
+ default?: string | undefined;
1135
+ comment?: string | undefined;
1136
+ isPrimary?: boolean | undefined;
1137
+ isUnique?: boolean | undefined;
1138
+ hasAutoIncrement?: boolean | undefined;
1139
+ }[];
1140
+ indexes: {
1141
+ order: "ASC" | "DESC";
1142
+ name: string;
1143
+ isUnique: boolean;
1144
+ columns: string[];
1145
+ isPrimaryKey: boolean;
1146
+ }[];
1147
+ foreignKeys: {
1148
+ name: string;
1149
+ column: string;
1150
+ refTable: string;
1151
+ refColumn: string;
1152
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1153
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1154
+ }[];
1155
+ checkConstraints: {
1156
+ name: string;
1157
+ check: string;
1158
+ }[];
1159
+ }, {
1160
+ name: string;
1161
+ roles: string[];
1162
+ columns: {
1163
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
1164
+ name: string;
1165
+ isNullable: boolean;
1166
+ roles: string[];
1167
+ length?: number | undefined;
1168
+ value?: string | undefined;
1169
+ default?: string | undefined;
1170
+ comment?: string | undefined;
1171
+ isPrimary?: boolean | undefined;
1172
+ isUnique?: boolean | undefined;
1173
+ hasAutoIncrement?: boolean | undefined;
1174
+ }[];
1175
+ indexes: {
1176
+ order: "ASC" | "DESC";
1177
+ name: string;
1178
+ isUnique: boolean;
1179
+ columns: string[];
1180
+ isPrimaryKey: boolean;
1181
+ }[];
1182
+ foreignKeys: {
1183
+ name: string;
1184
+ column: string;
1185
+ refTable: string;
1186
+ refColumn: string;
1187
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1188
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
1189
+ }[];
1190
+ checkConstraints: {
1191
+ name: string;
1192
+ check: string;
1193
+ }[];
1194
+ }>, "many">;
1195
+ endpoints: z.ZodArray<z.ZodObject<{
1196
+ name: z.ZodString;
1197
+ description: z.ZodString;
1198
+ baseUrl: z.ZodString;
1199
+ routes: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
1200
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
1201
+ name: z.ZodString;
1202
+ description: z.ZodString;
1203
+ path: z.ZodString;
1204
+ roles: z.ZodArray<z.ZodString, "many">;
1205
+ }, {
1206
+ type: z.ZodEnum<["ONE", "ARRAY", "PAGED"]>;
1207
+ table: z.ZodString;
1208
+ joins: z.ZodArray<z.ZodObject<{
1209
+ table: z.ZodString;
1210
+ localColumnName: z.ZodOptional<z.ZodString>;
1211
+ foreignColumnName: z.ZodOptional<z.ZodString>;
1212
+ custom: z.ZodOptional<z.ZodString>;
1213
+ type: z.ZodEnum<["LEFT", "INNER"]>;
1214
+ alias: z.ZodOptional<z.ZodString>;
1215
+ }, "strict", z.ZodTypeAny, {
1216
+ type: "LEFT" | "INNER";
1217
+ table: string;
1218
+ custom?: string | undefined;
1219
+ localColumnName?: string | undefined;
1220
+ foreignColumnName?: string | undefined;
1221
+ alias?: string | undefined;
1222
+ }, {
1223
+ type: "LEFT" | "INNER";
1224
+ table: string;
1225
+ custom?: string | undefined;
1226
+ localColumnName?: string | undefined;
1227
+ foreignColumnName?: string | undefined;
1228
+ alias?: string | undefined;
1229
+ }>, "many">;
1230
+ assignments: z.ZodArray<z.ZodObject<{
1231
+ name: z.ZodString;
1232
+ value: z.ZodString;
1233
+ }, "strict", z.ZodTypeAny, {
1234
+ value: string;
1235
+ name: string;
1236
+ }, {
1237
+ value: string;
1238
+ name: string;
1239
+ }>, "many">;
1240
+ where: z.ZodArray<z.ZodObject<{
1241
+ tableName: z.ZodOptional<z.ZodString>;
1242
+ columnName: z.ZodOptional<z.ZodString>;
1243
+ operator: z.ZodOptional<z.ZodEnum<["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]>>;
1244
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1245
+ custom: z.ZodOptional<z.ZodString>;
1246
+ conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
1247
+ }, "strict", z.ZodTypeAny, {
1248
+ value?: string | number | undefined;
1249
+ custom?: string | undefined;
1250
+ columnName?: string | undefined;
1251
+ tableName?: string | undefined;
1252
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1253
+ conjunction?: "AND" | "OR" | undefined;
1254
+ }, {
1255
+ value?: string | number | undefined;
1256
+ custom?: string | undefined;
1257
+ columnName?: string | undefined;
1258
+ tableName?: string | undefined;
1259
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1260
+ conjunction?: "AND" | "OR" | undefined;
1261
+ }>, "many">;
1262
+ request: z.ZodArray<z.ZodObject<{
1263
+ name: z.ZodString;
1264
+ required: z.ZodBoolean;
1265
+ isNullable: z.ZodOptional<z.ZodBoolean>;
1266
+ validator: z.ZodArray<z.ZodObject<{
1267
+ type: z.ZodEnum<["TYPE_CHECK", "MIN", "MAX", "ONE_OF"]>;
1268
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>;
1269
+ }, "strict", z.ZodTypeAny, {
1270
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1271
+ value: string | number | string[] | number[];
1272
+ }, {
1273
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1274
+ value: string | number | string[] | number[];
1275
+ }>, "many">;
1276
+ }, "strict", z.ZodTypeAny, {
1277
+ name: string;
1278
+ required: boolean;
1279
+ validator: {
1280
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1281
+ value: string | number | string[] | number[];
1282
+ }[];
1283
+ isNullable?: boolean | undefined;
1284
+ }, {
1285
+ name: string;
1286
+ required: boolean;
1287
+ validator: {
1288
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1289
+ value: string | number | string[] | number[];
1290
+ }[];
1291
+ isNullable?: boolean | undefined;
1292
+ }>, "many">;
1293
+ response: z.ZodArray<z.ZodObject<{
1294
+ name: z.ZodString;
1295
+ selector: z.ZodOptional<z.ZodString>;
1296
+ subquery: z.ZodOptional<z.ZodObject<{
1297
+ table: z.ZodString;
1298
+ joins: z.ZodArray<z.ZodObject<{
1299
+ table: z.ZodString;
1300
+ localColumnName: z.ZodOptional<z.ZodString>;
1301
+ foreignColumnName: z.ZodOptional<z.ZodString>;
1302
+ custom: z.ZodOptional<z.ZodString>;
1303
+ type: z.ZodEnum<["LEFT", "INNER"]>;
1304
+ alias: z.ZodOptional<z.ZodString>;
1305
+ }, "strict", z.ZodTypeAny, {
1306
+ type: "LEFT" | "INNER";
1307
+ table: string;
1308
+ custom?: string | undefined;
1309
+ localColumnName?: string | undefined;
1310
+ foreignColumnName?: string | undefined;
1311
+ alias?: string | undefined;
1312
+ }, {
1313
+ type: "LEFT" | "INNER";
1314
+ table: string;
1315
+ custom?: string | undefined;
1316
+ localColumnName?: string | undefined;
1317
+ foreignColumnName?: string | undefined;
1318
+ alias?: string | undefined;
1319
+ }>, "many">;
1320
+ where: z.ZodArray<z.ZodObject<{
1321
+ tableName: z.ZodOptional<z.ZodString>;
1322
+ columnName: z.ZodOptional<z.ZodString>;
1323
+ operator: z.ZodOptional<z.ZodEnum<["=", "<", ">", "<=", ">=", "!=", "LIKE", "IN", "NOT IN", "STARTS WITH", "ENDS WITH"]>>;
1324
+ value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
1325
+ custom: z.ZodOptional<z.ZodString>;
1326
+ conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
1327
+ }, "strict", z.ZodTypeAny, {
1328
+ value?: string | number | undefined;
1329
+ custom?: string | undefined;
1330
+ columnName?: string | undefined;
1331
+ tableName?: string | undefined;
1332
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1333
+ conjunction?: "AND" | "OR" | undefined;
1334
+ }, {
1335
+ value?: string | number | undefined;
1336
+ custom?: string | undefined;
1337
+ columnName?: string | undefined;
1338
+ tableName?: string | undefined;
1339
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1340
+ conjunction?: "AND" | "OR" | undefined;
1341
+ }>, "many">;
1342
+ properties: z.ZodArray<z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>, "many">;
1343
+ groupBy: z.ZodOptional<z.ZodObject<{
1344
+ columnName: z.ZodString;
1345
+ tableName: z.ZodString;
1346
+ }, "strict", z.ZodTypeAny, {
1347
+ columnName: string;
1348
+ tableName: string;
1349
+ }, {
1350
+ columnName: string;
1351
+ tableName: string;
1352
+ }>>;
1353
+ orderBy: z.ZodOptional<z.ZodObject<{
1354
+ columnName: z.ZodString;
1355
+ order: z.ZodEnum<["ASC", "DESC"]>;
1356
+ tableName: z.ZodString;
1357
+ }, "strict", z.ZodTypeAny, {
1358
+ columnName: string;
1359
+ order: "ASC" | "DESC";
1360
+ tableName: string;
1361
+ }, {
1362
+ columnName: string;
1363
+ order: "ASC" | "DESC";
1364
+ tableName: string;
1365
+ }>>;
1366
+ }, "strip", z.ZodTypeAny, {
1367
+ table: string;
1368
+ joins: {
1369
+ type: "LEFT" | "INNER";
1370
+ table: string;
1371
+ custom?: string | undefined;
1372
+ localColumnName?: string | undefined;
1373
+ foreignColumnName?: string | undefined;
1374
+ alias?: string | undefined;
1375
+ }[];
1376
+ where: {
1377
+ value?: string | number | undefined;
1378
+ custom?: string | undefined;
1379
+ columnName?: string | undefined;
1380
+ tableName?: string | undefined;
1381
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1382
+ conjunction?: "AND" | "OR" | undefined;
1383
+ }[];
1384
+ properties: any[];
1385
+ groupBy?: {
1386
+ columnName: string;
1387
+ tableName: string;
1388
+ } | undefined;
1389
+ orderBy?: {
1390
+ columnName: string;
1391
+ order: "ASC" | "DESC";
1392
+ tableName: string;
1393
+ } | undefined;
1394
+ }, {
1395
+ table: string;
1396
+ joins: {
1397
+ type: "LEFT" | "INNER";
1398
+ table: string;
1399
+ custom?: string | undefined;
1400
+ localColumnName?: string | undefined;
1401
+ foreignColumnName?: string | undefined;
1402
+ alias?: string | undefined;
1403
+ }[];
1404
+ where: {
1405
+ value?: string | number | undefined;
1406
+ custom?: string | undefined;
1407
+ columnName?: string | undefined;
1408
+ tableName?: string | undefined;
1409
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1410
+ conjunction?: "AND" | "OR" | undefined;
1411
+ }[];
1412
+ properties: any[];
1413
+ groupBy?: {
1414
+ columnName: string;
1415
+ tableName: string;
1416
+ } | undefined;
1417
+ orderBy?: {
1418
+ columnName: string;
1419
+ order: "ASC" | "DESC";
1420
+ tableName: string;
1421
+ } | undefined;
1422
+ }>>;
1423
+ }, "strict", z.ZodTypeAny, {
1424
+ name: string;
1425
+ selector?: string | undefined;
1426
+ subquery?: {
1427
+ table: string;
1428
+ joins: {
1429
+ type: "LEFT" | "INNER";
1430
+ table: string;
1431
+ custom?: string | undefined;
1432
+ localColumnName?: string | undefined;
1433
+ foreignColumnName?: string | undefined;
1434
+ alias?: string | undefined;
1435
+ }[];
1436
+ where: {
1437
+ value?: string | number | undefined;
1438
+ custom?: string | undefined;
1439
+ columnName?: string | undefined;
1440
+ tableName?: string | undefined;
1441
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1442
+ conjunction?: "AND" | "OR" | undefined;
1443
+ }[];
1444
+ properties: any[];
1445
+ groupBy?: {
1446
+ columnName: string;
1447
+ tableName: string;
1448
+ } | undefined;
1449
+ orderBy?: {
1450
+ columnName: string;
1451
+ order: "ASC" | "DESC";
1452
+ tableName: string;
1453
+ } | undefined;
1454
+ } | undefined;
1455
+ }, {
1456
+ name: string;
1457
+ selector?: string | undefined;
1458
+ subquery?: {
1459
+ table: string;
1460
+ joins: {
1461
+ type: "LEFT" | "INNER";
1462
+ table: string;
1463
+ custom?: string | undefined;
1464
+ localColumnName?: string | undefined;
1465
+ foreignColumnName?: string | undefined;
1466
+ alias?: string | undefined;
1467
+ }[];
1468
+ where: {
1469
+ value?: string | number | undefined;
1470
+ custom?: string | undefined;
1471
+ columnName?: string | undefined;
1472
+ tableName?: string | undefined;
1473
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1474
+ conjunction?: "AND" | "OR" | undefined;
1475
+ }[];
1476
+ properties: any[];
1477
+ groupBy?: {
1478
+ columnName: string;
1479
+ tableName: string;
1480
+ } | undefined;
1481
+ orderBy?: {
1482
+ columnName: string;
1483
+ order: "ASC" | "DESC";
1484
+ tableName: string;
1485
+ } | undefined;
1486
+ } | undefined;
1487
+ }>, "many">;
1488
+ groupBy: z.ZodOptional<z.ZodObject<{
1489
+ columnName: z.ZodString;
1490
+ tableName: z.ZodString;
1491
+ }, "strict", z.ZodTypeAny, {
1492
+ columnName: string;
1493
+ tableName: string;
1494
+ }, {
1495
+ columnName: string;
1496
+ tableName: string;
1497
+ }>>;
1498
+ orderBy: z.ZodOptional<z.ZodObject<{
1499
+ columnName: z.ZodString;
1500
+ order: z.ZodEnum<["ASC", "DESC"]>;
1501
+ tableName: z.ZodString;
1502
+ }, "strict", z.ZodTypeAny, {
1503
+ columnName: string;
1504
+ order: "ASC" | "DESC";
1505
+ tableName: string;
1506
+ }, {
1507
+ columnName: string;
1508
+ order: "ASC" | "DESC";
1509
+ tableName: string;
1510
+ }>>;
1511
+ }>, "strict", z.ZodTypeAny, {
1512
+ path: string;
1513
+ type: "ONE" | "ARRAY" | "PAGED";
1514
+ name: string;
1515
+ table: string;
1516
+ joins: {
1517
+ type: "LEFT" | "INNER";
1518
+ table: string;
1519
+ custom?: string | undefined;
1520
+ localColumnName?: string | undefined;
1521
+ foreignColumnName?: string | undefined;
1522
+ alias?: string | undefined;
1523
+ }[];
1524
+ where: {
1525
+ value?: string | number | undefined;
1526
+ custom?: string | undefined;
1527
+ columnName?: string | undefined;
1528
+ tableName?: string | undefined;
1529
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1530
+ conjunction?: "AND" | "OR" | undefined;
1531
+ }[];
1532
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1533
+ description: string;
1534
+ roles: string[];
1535
+ assignments: {
1536
+ value: string;
1537
+ name: string;
1538
+ }[];
1539
+ request: {
1540
+ name: string;
1541
+ required: boolean;
1542
+ validator: {
1543
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1544
+ value: string | number | string[] | number[];
1545
+ }[];
1546
+ isNullable?: boolean | undefined;
1547
+ }[];
1548
+ response: {
1549
+ name: string;
1550
+ selector?: string | undefined;
1551
+ subquery?: {
1552
+ table: string;
1553
+ joins: {
1554
+ type: "LEFT" | "INNER";
1555
+ table: string;
1556
+ custom?: string | undefined;
1557
+ localColumnName?: string | undefined;
1558
+ foreignColumnName?: string | undefined;
1559
+ alias?: string | undefined;
1560
+ }[];
1561
+ where: {
1562
+ value?: string | number | undefined;
1563
+ custom?: string | undefined;
1564
+ columnName?: string | undefined;
1565
+ tableName?: string | undefined;
1566
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1567
+ conjunction?: "AND" | "OR" | undefined;
1568
+ }[];
1569
+ properties: any[];
1570
+ groupBy?: {
1571
+ columnName: string;
1572
+ tableName: string;
1573
+ } | undefined;
1574
+ orderBy?: {
1575
+ columnName: string;
1576
+ order: "ASC" | "DESC";
1577
+ tableName: string;
1578
+ } | undefined;
1579
+ } | undefined;
1580
+ }[];
1581
+ groupBy?: {
1582
+ columnName: string;
1583
+ tableName: string;
1584
+ } | undefined;
1585
+ orderBy?: {
1586
+ columnName: string;
1587
+ order: "ASC" | "DESC";
1588
+ tableName: string;
1589
+ } | undefined;
1590
+ }, {
1591
+ path: string;
1592
+ type: "ONE" | "ARRAY" | "PAGED";
1593
+ name: string;
1594
+ table: string;
1595
+ joins: {
1596
+ type: "LEFT" | "INNER";
1597
+ table: string;
1598
+ custom?: string | undefined;
1599
+ localColumnName?: string | undefined;
1600
+ foreignColumnName?: string | undefined;
1601
+ alias?: string | undefined;
1602
+ }[];
1603
+ where: {
1604
+ value?: string | number | undefined;
1605
+ custom?: string | undefined;
1606
+ columnName?: string | undefined;
1607
+ tableName?: string | undefined;
1608
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1609
+ conjunction?: "AND" | "OR" | undefined;
1610
+ }[];
1611
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1612
+ description: string;
1613
+ roles: string[];
1614
+ assignments: {
1615
+ value: string;
1616
+ name: string;
1617
+ }[];
1618
+ request: {
1619
+ name: string;
1620
+ required: boolean;
1621
+ validator: {
1622
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1623
+ value: string | number | string[] | number[];
1624
+ }[];
1625
+ isNullable?: boolean | undefined;
1626
+ }[];
1627
+ response: {
1628
+ name: string;
1629
+ selector?: string | undefined;
1630
+ subquery?: {
1631
+ table: string;
1632
+ joins: {
1633
+ type: "LEFT" | "INNER";
1634
+ table: string;
1635
+ custom?: string | undefined;
1636
+ localColumnName?: string | undefined;
1637
+ foreignColumnName?: string | undefined;
1638
+ alias?: string | undefined;
1639
+ }[];
1640
+ where: {
1641
+ value?: string | number | undefined;
1642
+ custom?: string | undefined;
1643
+ columnName?: string | undefined;
1644
+ tableName?: string | undefined;
1645
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1646
+ conjunction?: "AND" | "OR" | undefined;
1647
+ }[];
1648
+ properties: any[];
1649
+ groupBy?: {
1650
+ columnName: string;
1651
+ tableName: string;
1652
+ } | undefined;
1653
+ orderBy?: {
1654
+ columnName: string;
1655
+ order: "ASC" | "DESC";
1656
+ tableName: string;
1657
+ } | undefined;
1658
+ } | undefined;
1659
+ }[];
1660
+ groupBy?: {
1661
+ columnName: string;
1662
+ tableName: string;
1663
+ } | undefined;
1664
+ orderBy?: {
1665
+ columnName: string;
1666
+ order: "ASC" | "DESC";
1667
+ tableName: string;
1668
+ } | undefined;
1669
+ }>, z.ZodObject<z.objectUtil.extendShape<{
1670
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
1671
+ name: z.ZodString;
1672
+ description: z.ZodString;
1673
+ path: z.ZodString;
1674
+ roles: z.ZodArray<z.ZodString, "many">;
1675
+ }, {
1676
+ type: z.ZodEnum<["CUSTOM_ONE", "CUSTOM_ARRAY", "CUSTOM_PAGED"]>;
1677
+ responseType: z.ZodUnion<[z.ZodString, z.ZodEnum<["string", "number", "boolean"]>]>;
1678
+ requestType: z.ZodOptional<z.ZodString>;
1679
+ request: z.ZodOptional<z.ZodArray<z.ZodObject<{
1680
+ name: z.ZodString;
1681
+ required: z.ZodBoolean;
1682
+ isNullable: z.ZodOptional<z.ZodBoolean>;
1683
+ validator: z.ZodArray<z.ZodObject<{
1684
+ type: z.ZodEnum<["TYPE_CHECK", "MIN", "MAX", "ONE_OF"]>;
1685
+ value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>;
1686
+ }, "strict", z.ZodTypeAny, {
1687
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1688
+ value: string | number | string[] | number[];
1689
+ }, {
1690
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1691
+ value: string | number | string[] | number[];
1692
+ }>, "many">;
1693
+ }, "strict", z.ZodTypeAny, {
1694
+ name: string;
1695
+ required: boolean;
1696
+ validator: {
1697
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1698
+ value: string | number | string[] | number[];
1699
+ }[];
1700
+ isNullable?: boolean | undefined;
1701
+ }, {
1702
+ name: string;
1703
+ required: boolean;
1704
+ validator: {
1705
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1706
+ value: string | number | string[] | number[];
1707
+ }[];
1708
+ isNullable?: boolean | undefined;
1709
+ }>, "many">>;
1710
+ table: z.ZodUndefined;
1711
+ joins: z.ZodUndefined;
1712
+ assignments: z.ZodUndefined;
1713
+ fileUploadType: z.ZodOptional<z.ZodEnum<["SINGLE", "MULTIPLE"]>>;
1714
+ }>, "strict", z.ZodTypeAny, {
1715
+ path: string;
1716
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
1717
+ name: string;
1718
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1719
+ description: string;
1720
+ roles: string[];
1721
+ responseType: string;
1722
+ table?: undefined;
1723
+ joins?: undefined;
1724
+ assignments?: undefined;
1725
+ request?: {
1726
+ name: string;
1727
+ required: boolean;
1728
+ validator: {
1729
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1730
+ value: string | number | string[] | number[];
1731
+ }[];
1732
+ isNullable?: boolean | undefined;
1733
+ }[] | undefined;
1734
+ requestType?: string | undefined;
1735
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
1736
+ }, {
1737
+ path: string;
1738
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
1739
+ name: string;
1740
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1741
+ description: string;
1742
+ roles: string[];
1743
+ responseType: string;
1744
+ table?: undefined;
1745
+ joins?: undefined;
1746
+ assignments?: undefined;
1747
+ request?: {
1748
+ name: string;
1749
+ required: boolean;
1750
+ validator: {
1751
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1752
+ value: string | number | string[] | number[];
1753
+ }[];
1754
+ isNullable?: boolean | undefined;
1755
+ }[] | undefined;
1756
+ requestType?: string | undefined;
1757
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
1758
+ }>]>, "many">;
1759
+ }, "strict", z.ZodTypeAny, {
1760
+ name: string;
1761
+ description: string;
1762
+ baseUrl: string;
1763
+ routes: ({
1764
+ path: string;
1765
+ type: "ONE" | "ARRAY" | "PAGED";
1766
+ name: string;
1767
+ table: string;
1768
+ joins: {
1769
+ type: "LEFT" | "INNER";
1770
+ table: string;
1771
+ custom?: string | undefined;
1772
+ localColumnName?: string | undefined;
1773
+ foreignColumnName?: string | undefined;
1774
+ alias?: string | undefined;
1775
+ }[];
1776
+ where: {
1777
+ value?: string | number | undefined;
1778
+ custom?: string | undefined;
1779
+ columnName?: string | undefined;
1780
+ tableName?: string | undefined;
1781
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1782
+ conjunction?: "AND" | "OR" | undefined;
1783
+ }[];
1784
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1785
+ description: string;
1786
+ roles: string[];
1787
+ assignments: {
1788
+ value: string;
1789
+ name: string;
1790
+ }[];
1791
+ request: {
1792
+ name: string;
1793
+ required: boolean;
1794
+ validator: {
1795
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1796
+ value: string | number | string[] | number[];
1797
+ }[];
1798
+ isNullable?: boolean | undefined;
1799
+ }[];
1800
+ response: {
1801
+ name: string;
1802
+ selector?: string | undefined;
1803
+ subquery?: {
1804
+ table: string;
1805
+ joins: {
1806
+ type: "LEFT" | "INNER";
1807
+ table: string;
1808
+ custom?: string | undefined;
1809
+ localColumnName?: string | undefined;
1810
+ foreignColumnName?: string | undefined;
1811
+ alias?: string | undefined;
1812
+ }[];
1813
+ where: {
1814
+ value?: string | number | undefined;
1815
+ custom?: string | undefined;
1816
+ columnName?: string | undefined;
1817
+ tableName?: string | undefined;
1818
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1819
+ conjunction?: "AND" | "OR" | undefined;
1820
+ }[];
1821
+ properties: any[];
1822
+ groupBy?: {
1823
+ columnName: string;
1824
+ tableName: string;
1825
+ } | undefined;
1826
+ orderBy?: {
1827
+ columnName: string;
1828
+ order: "ASC" | "DESC";
1829
+ tableName: string;
1830
+ } | undefined;
1831
+ } | undefined;
1832
+ }[];
1833
+ groupBy?: {
1834
+ columnName: string;
1835
+ tableName: string;
1836
+ } | undefined;
1837
+ orderBy?: {
1838
+ columnName: string;
1839
+ order: "ASC" | "DESC";
1840
+ tableName: string;
1841
+ } | undefined;
1842
+ } | {
1843
+ path: string;
1844
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
1845
+ name: string;
1846
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1847
+ description: string;
1848
+ roles: string[];
1849
+ responseType: string;
1850
+ table?: undefined;
1851
+ joins?: undefined;
1852
+ assignments?: undefined;
1853
+ request?: {
1854
+ name: string;
1855
+ required: boolean;
1856
+ validator: {
1857
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1858
+ value: string | number | string[] | number[];
1859
+ }[];
1860
+ isNullable?: boolean | undefined;
1861
+ }[] | undefined;
1862
+ requestType?: string | undefined;
1863
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
1864
+ })[];
1865
+ }, {
1866
+ name: string;
1867
+ description: string;
1868
+ baseUrl: string;
1869
+ routes: ({
1870
+ path: string;
1871
+ type: "ONE" | "ARRAY" | "PAGED";
1872
+ name: string;
1873
+ table: string;
1874
+ joins: {
1875
+ type: "LEFT" | "INNER";
1876
+ table: string;
1877
+ custom?: string | undefined;
1878
+ localColumnName?: string | undefined;
1879
+ foreignColumnName?: string | undefined;
1880
+ alias?: string | undefined;
1881
+ }[];
1882
+ where: {
1883
+ value?: string | number | undefined;
1884
+ custom?: string | undefined;
1885
+ columnName?: string | undefined;
1886
+ tableName?: string | undefined;
1887
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1888
+ conjunction?: "AND" | "OR" | undefined;
1889
+ }[];
1890
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1891
+ description: string;
1892
+ roles: string[];
1893
+ assignments: {
1894
+ value: string;
1895
+ name: string;
1896
+ }[];
1897
+ request: {
1898
+ name: string;
1899
+ required: boolean;
1900
+ validator: {
1901
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1902
+ value: string | number | string[] | number[];
1903
+ }[];
1904
+ isNullable?: boolean | undefined;
1905
+ }[];
1906
+ response: {
1907
+ name: string;
1908
+ selector?: string | undefined;
1909
+ subquery?: {
1910
+ table: string;
1911
+ joins: {
1912
+ type: "LEFT" | "INNER";
1913
+ table: string;
1914
+ custom?: string | undefined;
1915
+ localColumnName?: string | undefined;
1916
+ foreignColumnName?: string | undefined;
1917
+ alias?: string | undefined;
1918
+ }[];
1919
+ where: {
1920
+ value?: string | number | undefined;
1921
+ custom?: string | undefined;
1922
+ columnName?: string | undefined;
1923
+ tableName?: string | undefined;
1924
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
1925
+ conjunction?: "AND" | "OR" | undefined;
1926
+ }[];
1927
+ properties: any[];
1928
+ groupBy?: {
1929
+ columnName: string;
1930
+ tableName: string;
1931
+ } | undefined;
1932
+ orderBy?: {
1933
+ columnName: string;
1934
+ order: "ASC" | "DESC";
1935
+ tableName: string;
1936
+ } | undefined;
1937
+ } | undefined;
1938
+ }[];
1939
+ groupBy?: {
1940
+ columnName: string;
1941
+ tableName: string;
1942
+ } | undefined;
1943
+ orderBy?: {
1944
+ columnName: string;
1945
+ order: "ASC" | "DESC";
1946
+ tableName: string;
1947
+ } | undefined;
1948
+ } | {
1949
+ path: string;
1950
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
1951
+ name: string;
1952
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
1953
+ description: string;
1954
+ roles: string[];
1955
+ responseType: string;
1956
+ table?: undefined;
1957
+ joins?: undefined;
1958
+ assignments?: undefined;
1959
+ request?: {
1960
+ name: string;
1961
+ required: boolean;
1962
+ validator: {
1963
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1964
+ value: string | number | string[] | number[];
1965
+ }[];
1966
+ isNullable?: boolean | undefined;
1967
+ }[] | undefined;
1968
+ requestType?: string | undefined;
1969
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
1970
+ })[];
1971
+ }>, "many">;
1972
+ globalParams: z.ZodArray<z.ZodString, "many">;
1973
+ roles: z.ZodArray<z.ZodString, "many">;
1974
+ customTypes: z.ZodString;
1975
+ }, "strict", z.ZodTypeAny, {
1976
+ roles: string[];
1977
+ database: {
1978
+ name: string;
1979
+ roles: string[];
1980
+ columns: {
1981
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
1982
+ name: string;
1983
+ isNullable: boolean;
1984
+ roles: string[];
1985
+ length?: number | undefined;
1986
+ value?: string | undefined;
1987
+ default?: string | undefined;
1988
+ comment?: string | undefined;
1989
+ isPrimary?: boolean | undefined;
1990
+ isUnique?: boolean | undefined;
1991
+ hasAutoIncrement?: boolean | undefined;
1992
+ }[];
1993
+ indexes: {
1994
+ order: "ASC" | "DESC";
1995
+ name: string;
1996
+ isUnique: boolean;
1997
+ columns: string[];
1998
+ isPrimaryKey: boolean;
1999
+ }[];
2000
+ foreignKeys: {
2001
+ name: string;
2002
+ column: string;
2003
+ refTable: string;
2004
+ refColumn: string;
2005
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
2006
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
2007
+ }[];
2008
+ checkConstraints: {
2009
+ name: string;
2010
+ check: string;
2011
+ }[];
2012
+ }[];
2013
+ endpoints: {
2014
+ name: string;
2015
+ description: string;
2016
+ baseUrl: string;
2017
+ routes: ({
2018
+ path: string;
2019
+ type: "ONE" | "ARRAY" | "PAGED";
2020
+ name: string;
2021
+ table: string;
2022
+ joins: {
2023
+ type: "LEFT" | "INNER";
2024
+ table: string;
2025
+ custom?: string | undefined;
2026
+ localColumnName?: string | undefined;
2027
+ foreignColumnName?: string | undefined;
2028
+ alias?: string | undefined;
2029
+ }[];
2030
+ where: {
2031
+ value?: string | number | undefined;
2032
+ custom?: string | undefined;
2033
+ columnName?: string | undefined;
2034
+ tableName?: string | undefined;
2035
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
2036
+ conjunction?: "AND" | "OR" | undefined;
2037
+ }[];
2038
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2039
+ description: string;
2040
+ roles: string[];
2041
+ assignments: {
2042
+ value: string;
2043
+ name: string;
2044
+ }[];
2045
+ request: {
2046
+ name: string;
2047
+ required: boolean;
2048
+ validator: {
2049
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
2050
+ value: string | number | string[] | number[];
2051
+ }[];
2052
+ isNullable?: boolean | undefined;
2053
+ }[];
2054
+ response: {
2055
+ name: string;
2056
+ selector?: string | undefined;
2057
+ subquery?: {
2058
+ table: string;
2059
+ joins: {
2060
+ type: "LEFT" | "INNER";
2061
+ table: string;
2062
+ custom?: string | undefined;
2063
+ localColumnName?: string | undefined;
2064
+ foreignColumnName?: string | undefined;
2065
+ alias?: string | undefined;
2066
+ }[];
2067
+ where: {
2068
+ value?: string | number | undefined;
2069
+ custom?: string | undefined;
2070
+ columnName?: string | undefined;
2071
+ tableName?: string | undefined;
2072
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
2073
+ conjunction?: "AND" | "OR" | undefined;
2074
+ }[];
2075
+ properties: any[];
2076
+ groupBy?: {
2077
+ columnName: string;
2078
+ tableName: string;
2079
+ } | undefined;
2080
+ orderBy?: {
2081
+ columnName: string;
2082
+ order: "ASC" | "DESC";
2083
+ tableName: string;
2084
+ } | undefined;
2085
+ } | undefined;
2086
+ }[];
2087
+ groupBy?: {
2088
+ columnName: string;
2089
+ tableName: string;
2090
+ } | undefined;
2091
+ orderBy?: {
2092
+ columnName: string;
2093
+ order: "ASC" | "DESC";
2094
+ tableName: string;
2095
+ } | undefined;
2096
+ } | {
2097
+ path: string;
2098
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
2099
+ name: string;
2100
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2101
+ description: string;
2102
+ roles: string[];
2103
+ responseType: string;
2104
+ table?: undefined;
2105
+ joins?: undefined;
2106
+ assignments?: undefined;
2107
+ request?: {
2108
+ name: string;
2109
+ required: boolean;
2110
+ validator: {
2111
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
2112
+ value: string | number | string[] | number[];
2113
+ }[];
2114
+ isNullable?: boolean | undefined;
2115
+ }[] | undefined;
2116
+ requestType?: string | undefined;
2117
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
2118
+ })[];
2119
+ }[];
2120
+ globalParams: string[];
2121
+ customTypes: string;
2122
+ }, {
2123
+ roles: string[];
2124
+ database: {
2125
+ name: string;
2126
+ roles: string[];
2127
+ columns: {
2128
+ type: "SMALLINT" | "INTEGER" | "BIGINT" | "DECIMAL" | "NUMERIC" | "REAL" | "DOUBLE PRECISION" | "SERIAL" | "BIGSERIAL" | "CHAR" | "VARCHAR" | "TEXT" | "BYTEA" | "DATE" | "TIMESTAMP" | "TIMESTAMPTZ" | "TIME" | "INTERVAL" | "JSON" | "JSONB" | "BOOLEAN" | "TINYINT" | "MEDIUMINT" | "FLOAT" | "DOUBLE" | "TINYTEXT" | "TINYBLOB" | "BLOB" | "MEDIUMTEXT" | "MEDIUMBLOB" | "LONGTEXT" | "LONGBLOB" | "ENUM" | "DATETIME";
2129
+ name: string;
2130
+ isNullable: boolean;
2131
+ roles: string[];
2132
+ length?: number | undefined;
2133
+ value?: string | undefined;
2134
+ default?: string | undefined;
2135
+ comment?: string | undefined;
2136
+ isPrimary?: boolean | undefined;
2137
+ isUnique?: boolean | undefined;
2138
+ hasAutoIncrement?: boolean | undefined;
2139
+ }[];
2140
+ indexes: {
2141
+ order: "ASC" | "DESC";
2142
+ name: string;
2143
+ isUnique: boolean;
2144
+ columns: string[];
2145
+ isPrimaryKey: boolean;
2146
+ }[];
2147
+ foreignKeys: {
2148
+ name: string;
2149
+ column: string;
2150
+ refTable: string;
2151
+ refColumn: string;
2152
+ onDelete: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
2153
+ onUpdate: "CASCADE" | "SET NULL" | "RESTRICT" | "NO ACTION" | "SET DEFAULT";
2154
+ }[];
2155
+ checkConstraints: {
2156
+ name: string;
2157
+ check: string;
2158
+ }[];
2159
+ }[];
2160
+ endpoints: {
2161
+ name: string;
2162
+ description: string;
2163
+ baseUrl: string;
2164
+ routes: ({
2165
+ path: string;
2166
+ type: "ONE" | "ARRAY" | "PAGED";
2167
+ name: string;
2168
+ table: string;
2169
+ joins: {
2170
+ type: "LEFT" | "INNER";
2171
+ table: string;
2172
+ custom?: string | undefined;
2173
+ localColumnName?: string | undefined;
2174
+ foreignColumnName?: string | undefined;
2175
+ alias?: string | undefined;
2176
+ }[];
2177
+ where: {
2178
+ value?: string | number | undefined;
2179
+ custom?: string | undefined;
2180
+ columnName?: string | undefined;
2181
+ tableName?: string | undefined;
2182
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
2183
+ conjunction?: "AND" | "OR" | undefined;
2184
+ }[];
2185
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2186
+ description: string;
2187
+ roles: string[];
2188
+ assignments: {
2189
+ value: string;
2190
+ name: string;
2191
+ }[];
2192
+ request: {
2193
+ name: string;
2194
+ required: boolean;
2195
+ validator: {
2196
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
2197
+ value: string | number | string[] | number[];
2198
+ }[];
2199
+ isNullable?: boolean | undefined;
2200
+ }[];
2201
+ response: {
2202
+ name: string;
2203
+ selector?: string | undefined;
2204
+ subquery?: {
2205
+ table: string;
2206
+ joins: {
2207
+ type: "LEFT" | "INNER";
2208
+ table: string;
2209
+ custom?: string | undefined;
2210
+ localColumnName?: string | undefined;
2211
+ foreignColumnName?: string | undefined;
2212
+ alias?: string | undefined;
2213
+ }[];
2214
+ where: {
2215
+ value?: string | number | undefined;
2216
+ custom?: string | undefined;
2217
+ columnName?: string | undefined;
2218
+ tableName?: string | undefined;
2219
+ operator?: "=" | "<" | ">" | "<=" | ">=" | "!=" | "LIKE" | "IN" | "NOT IN" | "STARTS WITH" | "ENDS WITH" | undefined;
2220
+ conjunction?: "AND" | "OR" | undefined;
2221
+ }[];
2222
+ properties: any[];
2223
+ groupBy?: {
2224
+ columnName: string;
2225
+ tableName: string;
2226
+ } | undefined;
2227
+ orderBy?: {
2228
+ columnName: string;
2229
+ order: "ASC" | "DESC";
2230
+ tableName: string;
2231
+ } | undefined;
2232
+ } | undefined;
2233
+ }[];
2234
+ groupBy?: {
2235
+ columnName: string;
2236
+ tableName: string;
2237
+ } | undefined;
2238
+ orderBy?: {
2239
+ columnName: string;
2240
+ order: "ASC" | "DESC";
2241
+ tableName: string;
2242
+ } | undefined;
2243
+ } | {
2244
+ path: string;
2245
+ type: "CUSTOM_ONE" | "CUSTOM_ARRAY" | "CUSTOM_PAGED";
2246
+ name: string;
2247
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2248
+ description: string;
2249
+ roles: string[];
2250
+ responseType: string;
2251
+ table?: undefined;
2252
+ joins?: undefined;
2253
+ assignments?: undefined;
2254
+ request?: {
2255
+ name: string;
2256
+ required: boolean;
2257
+ validator: {
2258
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
2259
+ value: string | number | string[] | number[];
2260
+ }[];
2261
+ isNullable?: boolean | undefined;
2262
+ }[] | undefined;
2263
+ requestType?: string | undefined;
2264
+ fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
2265
+ })[];
2266
+ }[];
2267
+ globalParams: string[];
2268
+ customTypes: string;
2269
+ }>;
2270
+ type ResturaSchema = z.infer<typeof resturaZodSchema>;
2271
+
2272
+ interface SchemaChangeValue {
2273
+ name: string;
2274
+ changeType: 'NEW' | 'MODIFIED' | 'DELETED';
2275
+ }
2276
+ interface SchemaPreview {
2277
+ commands: string;
2278
+ endPoints: SchemaChangeValue[];
2279
+ globalParams: SchemaChangeValue[];
2280
+ roles: SchemaChangeValue[];
2281
+ customTypes: boolean;
2282
+ }
2283
+ interface LoginDetails {
2284
+ token: string;
2285
+ refreshToken: string;
2286
+ expiresOn: string;
2287
+ user: {
2288
+ firstName: string;
2289
+ lastName: string;
2290
+ email: string;
2291
+ };
2292
+ }
2293
+ type ValidatorString = 'boolean' | 'string' | 'number' | 'object' | 'any';
2294
+ interface ResponseType {
2295
+ isOptional?: boolean;
2296
+ isArray?: boolean;
2297
+ validator: ValidatorString | ResponseTypeMap | string[];
2298
+ }
2299
+ interface ResponseTypeMap {
2300
+ [property: string]: ResponseType;
2301
+ }
2302
+ type StandardOrderTypes = 'ASC' | 'DESC' | 'RAND' | 'NONE';
2303
+ type ConjunctionTypes = 'AND' | 'OR';
2304
+ type MatchTypes = 'exact' | 'fuzzy' | 'like' | 'greaterThan' | 'greaterThanEqual' | 'lessThan' | 'lessThanEqual';
2305
+ interface RsResponseData<T> {
2306
+ data: T;
2307
+ }
2308
+ interface RsErrorData {
2309
+ err: string;
2310
+ msg: string;
2311
+ stack?: string;
2312
+ }
2313
+ interface RsPagedResponseData<T> extends RsResponseData<T> {
2314
+ total: number;
2315
+ }
2316
+ interface PageQuery {
2317
+ page: number;
2318
+ perPage: number;
2319
+ sortBy: string;
2320
+ sortOrder: StandardOrderTypes;
2321
+ filter?: string;
2322
+ [key: string]: string | number | boolean | object | null | undefined;
2323
+ }
2324
+ interface AuthenticationUserDetails {
2325
+ role: string;
2326
+ userId?: number;
2327
+ [key: string]: string | number | boolean | object | null | undefined;
2328
+ }
2329
+ type ValidAuthenticationCallback = (userDetails: AuthenticationUserDetails) => void;
2330
+ type AuthenticateHandler = (req: RsRequest<unknown>, res: RsResponse<unknown>, onValid: ValidAuthenticationCallback) => Promise<void>;
2331
+
2332
+ interface RsHeaders extends IncomingHttpHeaders {
2333
+ 'x-auth-token'?: string;
2334
+ }
2335
+ type ApiMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
2336
+ type RequesterDetails<T extends object = {}> = {
2337
+ role: string;
2338
+ host: string;
2339
+ ipAddress: string;
2340
+ userId?: number;
2341
+ isSystemUser?: boolean;
2342
+ } & T;
2343
+ interface RsRequest<T = unknown, U extends object = Record<string, never>> extends express.Request {
2344
+ requesterDetails: RequesterDetails<U>;
2345
+ data: T;
2346
+ }
2347
+ type DynamicObject<T = unknown> = {
2348
+ [key: string]: T;
2349
+ };
2350
+ interface RsResponse<T = unknown> extends express.Response {
2351
+ sendData: (data: T, statusCode?: number) => void;
2352
+ sendNoWrap: (data: T, statusCode?: number) => void;
2353
+ sendError: (err: ErrorCode, msg: string, htmlStatusCode?: HtmlStatusCodes, stack?: string) => void;
2354
+ sendPaginated: (pagedData: RsPagedResponseData<T>, statusCode?: number) => void;
2355
+ _contentLength?: number;
2356
+ }
2357
+ type RsRouteHandler<T = unknown, U = unknown> = (req: RsRequest<T>, res: RsResponse<U>, next?: express.NextFunction) => Promise<void>;
2358
+ interface AsyncExpressApplication {
2359
+ get: (url: string, handler: RsRouteHandler, nextFunction?: RsRouteHandler) => Promise<void> | void;
2360
+ post: (url: string, handler: RsRouteHandler, nextFunction?: RsRouteHandler) => Promise<void> | void;
2361
+ put: (url: string, handler: RsRouteHandler, nextFunction?: RsRouteHandler) => Promise<void> | void;
2362
+ patch: (url: string, handler: RsRouteHandler, nextFunction?: RsRouteHandler) => Promise<void> | void;
2363
+ delete: (url: string, handler: RsRouteHandler, nextFunction?: RsRouteHandler) => Promise<void> | void;
2364
+ }
2365
+
2366
+ declare abstract class PsqlConnection {
2367
+ protected constructor();
2368
+ protected abstract query<R extends QueryResultRow = QueryResultRow, T extends Array<unknown> = unknown[]>(query: string, values?: QueryConfigValues<T>): Promise<QueryResult<R>>;
2369
+ queryOne<T>(query: string, options: any[], requesterDetails: RequesterDetails): Promise<T>;
2370
+ runQuery<T>(query: string, options: any[], requesterDetails: RequesterDetails): Promise<T[]>;
2371
+ private logSqlStatement;
2372
+ }
2373
+
2374
+ declare class PsqlPool extends PsqlConnection {
2375
+ poolConfig: PoolConfig;
2376
+ pool: Pool;
2377
+ constructor(poolConfig: PoolConfig);
2378
+ protected query<R extends QueryResultRow = QueryResultRow, T extends Array<unknown> = unknown[]>(query: string, values?: QueryConfigValues<T>): Promise<QueryResult<R>>;
2379
+ }
2380
+
2381
+ declare class ResturaEngine {
2382
+ resturaConfig: ResturaConfigSchema;
2383
+ private multerCommonUpload;
2384
+ private resturaRouter;
2385
+ private publicEndpoints;
2386
+ private expressApp;
2387
+ private schema;
2388
+ private responseValidator;
2389
+ private authenticationHandler;
2390
+ private customTypeValidation;
2391
+ private psqlConnectionPool;
2392
+ private psqlEngine;
2393
+ /**
2394
+ * Initializes the Restura engine with the provided Express application.
2395
+ *
2396
+ * @param app - The Express application instance to initialize with Restura.
2397
+ * @returns A promise that resolves when the initialization is complete.
2398
+ */
2399
+ init(app: express.Application, authenticationHandler: AuthenticateHandler, psqlConnectionPool: PsqlPool): Promise<void>;
2400
+ /**
2401
+ * Determines if a given endpoint is public based on the HTTP method and full URL. This
2402
+ * is determined on whether the endpoint in the schema has no roles assigned to it.
2403
+ *
2404
+ * @param method - The HTTP method (e.g., 'GET', 'POST', 'PUT', 'PATCH', 'DELETE').
2405
+ * @param fullUrl - The full URL of the endpoint.
2406
+ * @returns A boolean indicating whether the endpoint is public.
2407
+ */
2408
+ isEndpointPublic(method: string, fullUrl: string): boolean;
2409
+ /**
2410
+ * Checks if an endpoint exists for a given HTTP method and full URL.
2411
+ *
2412
+ * @param method - The HTTP method to check (e.g., 'GET', 'POST', 'PUT', 'PATCH', 'DELETE').
2413
+ * @param fullUrl - The full URL of the endpoint to check.
2414
+ * @returns `true` if the endpoint exists, otherwise `false`.
2415
+ */
2416
+ doesEndpointExist(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', fullUrl: string): boolean;
2417
+ /**
2418
+ * Generates an API from the provided schema and writes it to the specified output file.
2419
+ *
2420
+ * @param outputFile - The path to the file where the generated API will be written.
2421
+ * @param providedSchema - The schema from which the API will be generated.
2422
+ * @returns A promise that resolves when the API has been successfully generated and written to the output file.
2423
+ */
2424
+ generateApiFromSchema(outputFile: string, providedSchema: ResturaSchema): Promise<void>;
2425
+ /**
2426
+ * Generates a model from the provided schema and writes it to the specified output file.
2427
+ *
2428
+ * @param outputFile - The path to the file where the generated model will be written.
2429
+ * @param providedSchema - The schema from which the model will be generated.
2430
+ * @returns A promise that resolves when the model has been successfully written to the output file.
2431
+ */
2432
+ generateModelFromSchema(outputFile: string, providedSchema: ResturaSchema): Promise<void>;
2433
+ /**
2434
+ * Retrieves the latest file system schema for Restura.
2435
+ *
2436
+ * @returns {Promise<ResturaSchema>} A promise that resolves to the latest Restura schema.
2437
+ * @throws {Error} If the schema file is missing or the schema is not valid.
2438
+ */
2439
+ getLatestFileSystemSchema(): Promise<ResturaSchema>;
2440
+ /**
2441
+ * Asynchronously generates and retrieves hashes for the provided schema and related generated files.
2442
+ *
2443
+ * @param providedSchema - The schema for which hashes need to be generated.
2444
+ * @returns A promise that resolves to an object containing:
2445
+ * - `schemaHash`: The hash of the provided schema.
2446
+ * - `apiCreatedSchemaHash`: The hash extracted from the generated `api.d.ts` file.
2447
+ * - `modelCreatedSchemaHash`: The hash extracted from the generated `models.d.ts` file.
2448
+ */
2449
+ getHashes(providedSchema: ResturaSchema): Promise<{
2450
+ schemaHash: string;
2451
+ apiCreatedSchemaHash: string;
2452
+ modelCreatedSchemaHash: string;
2453
+ }>;
2454
+ private reloadEndpoints;
2455
+ private validateGeneratedTypesFolder;
2456
+ private resturaAuthentication;
2457
+ private previewCreateSchema;
2458
+ private updateSchema;
2459
+ private updateTypes;
2460
+ private getSchema;
2461
+ private getSchemaAndTypes;
2462
+ private getMulterFilesIfAny;
2463
+ private executeRouteLogic;
2464
+ private isCustomRoute;
2465
+ private runCustomRouteLogic;
2466
+ private generateHashForSchema;
2467
+ private storeFileSystemSchema;
2468
+ private resetPublicEndpoints;
2469
+ private validateAuthorization;
2470
+ private getRouteData;
2471
+ }
2472
+ declare const restura: ResturaEngine;
2473
+
2474
+ declare function escapeColumnName(columnName: string | undefined): string;
2475
+ declare function questionMarksToOrderedParams(query: string): string;
2476
+ declare function insertObjectQuery(table: string, obj: DynamicObject): string;
2477
+ declare function updateObjectQuery(table: string, obj: DynamicObject, whereStatement: string): string;
2478
+ declare function isValueNumber(value: unknown): value is number;
2479
+ declare function SQL(strings: any, ...values: any): any;
2480
+
2481
+ declare class PsqlTransaction extends PsqlConnection {
2482
+ clientConfig: ClientConfig;
2483
+ client: Client;
2484
+ private beginTransactionPromise;
2485
+ private connectPromise;
2486
+ constructor(clientConfig: ClientConfig);
2487
+ close(): Promise<void>;
2488
+ private beginTransaction;
2489
+ rollback(): Promise<QueryResult<QueryResultRow>>;
2490
+ commit(): Promise<QueryResult<QueryResultRow>>;
2491
+ release(): Promise<void>;
2492
+ protected query<R extends QueryResultRow = QueryResultRow, T extends Array<unknown> = unknown[]>(query: string, values?: QueryConfigValues<T>): Promise<QueryResult<R>>;
2493
+ }
2494
+
2495
+ declare abstract class SqlEngine {
2496
+ runQueryForRoute(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[] | boolean>;
2497
+ protected getTableSchema(schema: ResturaSchema, tableName: string): TableData;
2498
+ protected doesRoleHavePermissionToColumn(role: string | undefined | null, schema: ResturaSchema, item: ResponseData, joins: JoinData[]): boolean;
2499
+ protected doesRoleHavePermissionToTable(userRole: string | undefined, schema: ResturaSchema, tableName: string): boolean;
2500
+ protected abstract generateJoinStatements(req: RsRequest<unknown>, joins: JoinData[], baseTable: string, routeData: StandardRouteData, schema: ResturaSchema, userRole: string | undefined, sqlParams: string[]): string;
2501
+ protected abstract generateGroupBy(routeData: StandardRouteData): string;
2502
+ protected abstract generateOrderBy(req: RsRequest<unknown>, routeData: StandardRouteData): string;
2503
+ protected abstract generateWhereClause(req: RsRequest<unknown>, where: WhereData[], routeData: StandardRouteData, sqlParams: string[]): string;
2504
+ protected replaceParamKeywords(value: string | number, routeData: RouteData, req: RsRequest<unknown>, sqlParams: string[]): string | number;
2505
+ protected replaceLocalParamKeywords(value: string | number, routeData: RouteData, req: RsRequest<unknown>, sqlParams: string[]): string | number;
2506
+ protected replaceGlobalParamKeywords(value: string | number, routeData: RouteData, req: RsRequest<unknown>, sqlParams: string[]): string | number;
2507
+ abstract generateDatabaseSchemaFromSchema(schema: ResturaSchema): string;
2508
+ abstract diffDatabaseToSchema(schema: ResturaSchema): Promise<string>;
2509
+ protected abstract createNestedSelect(req: RsRequest<unknown>, schema: ResturaSchema, item: ResponseData, routeData: StandardRouteData, userRole: string | undefined, sqlParams: string[]): string;
2510
+ protected abstract executeCreateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2511
+ protected abstract executeGetRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[]>;
2512
+ protected abstract executeUpdateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2513
+ protected abstract executeDeleteRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<boolean>;
2514
+ }
2515
+
2516
+ declare class PsqlEngine extends SqlEngine {
2517
+ private psqlConnectionPool;
2518
+ setupTriggerListeners: Promise<void> | undefined;
2519
+ private triggerClient;
2520
+ constructor(psqlConnectionPool: PsqlPool, shouldListenForDbTriggers?: boolean);
2521
+ close(): Promise<void>;
2522
+ private listenForDbTriggers;
2523
+ private handleTrigger;
2524
+ createDatabaseFromSchema(schema: ResturaSchema, connection: PsqlPool): Promise<string>;
2525
+ generateDatabaseSchemaFromSchema(schema: ResturaSchema): string;
2526
+ private getScratchPool;
2527
+ diffDatabaseToSchema(schema: ResturaSchema): Promise<string>;
2528
+ protected createNestedSelect(req: RsRequest<unknown>, schema: ResturaSchema, item: ResponseData, routeData: StandardRouteData, userRole: string | undefined, sqlParams: string[]): string;
2529
+ protected executeCreateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2530
+ protected executeGetRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[]>;
2531
+ protected executeUpdateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2532
+ protected executeDeleteRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<boolean>;
2533
+ protected generateJoinStatements(req: RsRequest<unknown>, joins: JoinData[], baseTable: string, routeData: StandardRouteData | CustomRouteData, schema: ResturaSchema, userRole: string | undefined, sqlParams: string[]): string;
2534
+ protected generateGroupBy(routeData: StandardRouteData): string;
2535
+ protected generateOrderBy(req: RsRequest<unknown>, routeData: StandardRouteData): string;
2536
+ protected generateWhereClause(req: RsRequest<unknown>, where: WhereData[], routeData: StandardRouteData | CustomRouteData, sqlParams: string[]): string;
2537
+ private createUpdateTrigger;
2538
+ private createDeleteTrigger;
2539
+ private createInsertTriggers;
2540
+ }
2541
+
2542
+ type EventType = 'DATABASE_ROW_DELETE' | 'DATABASE_ROW_INSERT' | 'DATABASE_COLUMN_UPDATE' | 'WEBHOOK';
2543
+ type MutationType = 'INSERT' | 'UPDATE' | 'DELETE';
2544
+ interface SqlMutationData {
2545
+ mutationType: MutationType;
2546
+ requesterDetails: RequesterDetails;
2547
+ }
2548
+ interface DatabaseActionData {
2549
+ tableName: string;
2550
+ requesterDetails: RequesterDetails;
2551
+ }
2552
+ interface ActionRowInsertData<T = DynamicObject> extends DatabaseActionData {
2553
+ insertId: number;
2554
+ insertObject: T;
2555
+ }
2556
+ interface ActionRowDeleteData extends DatabaseActionData {
2557
+ deletedRow: DynamicObject;
2558
+ }
2559
+ interface ActionColumnChangeData extends DatabaseActionData {
2560
+ tableName: string;
2561
+ rowId: number;
2562
+ newData: DynamicObject;
2563
+ oldData: DynamicObject;
2564
+ }
2565
+ interface ActionRowInsertFilter {
2566
+ tableName: string;
2567
+ }
2568
+ interface ActionRowDeleteFilter {
2569
+ tableName: string;
2570
+ }
2571
+ interface ActionColumnChangeFilter {
2572
+ tableName: string;
2573
+ }
2574
+ type TriggerResult = {
2575
+ table: string;
2576
+ insertId?: number;
2577
+ query: string;
2578
+ record: DynamicObject;
2579
+ previousRecord: DynamicObject;
2580
+ requesterId: number;
2581
+ };
2582
+ declare class EventManager {
2583
+ private actionHandlers;
2584
+ addRowInsertHandler(onInsert: (data: ActionRowInsertData<unknown>) => Promise<void>, filter?: ActionRowInsertFilter): void;
2585
+ addColumnChangeHandler(onUpdate: (data: ActionColumnChangeData) => Promise<void>, filter: ActionColumnChangeFilter): void;
2586
+ addRowDeleteHandler(onDelete: (data: ActionRowDeleteData) => Promise<void>, filter?: ActionRowDeleteFilter): void;
2587
+ fireActionFromDbTrigger(sqlMutationData: SqlMutationData, result: TriggerResult): Promise<void>;
2588
+ private fireInsertActions;
2589
+ private fireDeleteActions;
2590
+ private fireUpdateActions;
2591
+ private hasHandlersForEventType;
2592
+ }
2593
+ declare const eventManager: EventManager;
2594
+
2595
+ export { type ActionColumnChangeData, type ActionColumnChangeFilter, type ActionRowDeleteData, type ActionRowDeleteFilter, type ActionRowInsertData, type ActionRowInsertFilter, type ApiMethod, type AsyncExpressApplication, type AuthenticateHandler, type AuthenticationUserDetails, type ConjunctionTypes, type DatabaseActionData, type DynamicObject, type ErrorCode, type EventType, HtmlStatusCodes, type LoginDetails, type MatchTypes, type MutationType, type PageQuery, PsqlConnection, PsqlEngine, PsqlPool, PsqlTransaction, type RequesterDetails, type ResponseType, type ResponseTypeMap, RsError, type RsErrorData, type RsErrorInternalData, type RsHeaders, type RsPagedResponseData, type RsRequest, type RsResponse, type RsResponseData, type RsRouteHandler, SQL, type SchemaChangeValue, type SchemaPreview, type SqlMutationData, type StandardOrderTypes, type TriggerResult, type ValidAuthenticationCallback, type ValidatorString, escapeColumnName, eventManager, insertObjectQuery, isValueNumber, logger, questionMarksToOrderedParams, restura, updateObjectQuery };