@restura/core 0.1.0-alpha.9 → 0.1.2

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