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

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