@restura/core 0.1.0-alpha.8 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/index.d.mts +1439 -177
  2. package/dist/index.d.ts +1439 -177
  3. package/dist/index.js +1767 -708
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1751 -705
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +17 -6
  8. package/dist/acorn-SW5GI5G7.mjs +0 -3016
  9. package/dist/acorn-SW5GI5G7.mjs.map +0 -1
  10. package/dist/angular-FYEH6QOL.mjs +0 -1547
  11. package/dist/angular-FYEH6QOL.mjs.map +0 -1
  12. package/dist/babel-V6GZHMYX.mjs +0 -6911
  13. package/dist/babel-V6GZHMYX.mjs.map +0 -1
  14. package/dist/chunk-TL4KRYOF.mjs +0 -58
  15. package/dist/chunk-TL4KRYOF.mjs.map +0 -1
  16. package/dist/estree-67ZCSSSI.mjs +0 -4396
  17. package/dist/estree-67ZCSSSI.mjs.map +0 -1
  18. package/dist/flow-SJW7PRXX.mjs +0 -26365
  19. package/dist/flow-SJW7PRXX.mjs.map +0 -1
  20. package/dist/glimmer-PF2X22V2.mjs +0 -2995
  21. package/dist/glimmer-PF2X22V2.mjs.map +0 -1
  22. package/dist/graphql-NOJ5HX7K.mjs +0 -1253
  23. package/dist/graphql-NOJ5HX7K.mjs.map +0 -1
  24. package/dist/html-ROPIWVPQ.mjs +0 -2780
  25. package/dist/html-ROPIWVPQ.mjs.map +0 -1
  26. package/dist/index.cjs +0 -34
  27. package/dist/index.cjs.map +0 -1
  28. package/dist/index.d.cts +0 -3
  29. package/dist/markdown-PFYT4MSP.mjs +0 -3423
  30. package/dist/markdown-PFYT4MSP.mjs.map +0 -1
  31. package/dist/meriyah-5NLZXLMA.mjs +0 -2356
  32. package/dist/meriyah-5NLZXLMA.mjs.map +0 -1
  33. package/dist/postcss-ITO6IEN5.mjs +0 -5027
  34. package/dist/postcss-ITO6IEN5.mjs.map +0 -1
  35. package/dist/typescript-6IE7K56Q.mjs +0 -13392
  36. package/dist/typescript-6IE7K56Q.mjs.map +0 -1
  37. package/dist/yaml-DB2OVPLH.mjs +0 -4230
  38. package/dist/yaml-DB2OVPLH.mjs.map +0 -1
package/dist/index.d.mts CHANGED
@@ -1,34 +1,1180 @@
1
1
  import winston from 'winston';
2
+ import { UUID } from 'crypto';
2
3
  import * as express from 'express';
4
+ import { IncomingHttpHeaders } from 'http2';
3
5
  import { z } from 'zod';
4
- import { PoolConfig, Pool } from 'pg';
6
+ import { QueryResultRow, QueryConfigValues, QueryResult, PoolConfig, Pool, ClientConfig, Client } from 'pg';
7
+ import peg from 'pegjs';
5
8
 
6
9
  declare const logger: winston.Logger;
7
10
 
11
+ interface RsErrorInternalData {
12
+ err: ErrorCode;
13
+ msg: string;
14
+ stack: string;
15
+ status: number;
16
+ message?: string;
17
+ }
18
+ declare enum HtmlStatusCodes {
19
+ BAD_REQUEST = 400,
20
+ UNAUTHORIZED = 401,
21
+ FORBIDDEN = 403,
22
+ NOT_FOUND = 404,
23
+ METHOD_NOT_ALLOWED = 405,
24
+ CONFLICT = 409,
25
+ VERSION_OUT_OF_DATE = 418,// Technically this is the I'm a teapot code that was a joke.
26
+ SERVER_ERROR = 500,
27
+ SERVICE_UNAVAILABLE = 503,
28
+ NETWORK_CONNECT_TIMEOUT = 599
29
+ }
30
+ type ErrorCode = 'UNKNOWN_ERROR' | 'NOT_FOUND' | 'EMAIL_TAKEN' | 'UNAUTHORIZED' | 'FORBIDDEN' | 'CONFLICT' | 'UPDATE_FORBIDDEN' | 'CREATE_FORBIDDEN' | 'DELETE_FORBIDDEN' | 'DELETE_FAILURE' | 'BAD_REQUEST' | 'INVALID_TOKEN' | 'INCORRECT_EMAIL_OR_PASSWORD' | 'DUPLICATE_TOKEN' | 'DUPLICATE_USERNAME' | 'DUPLICATE_EMAIL' | 'DUPLICATE' | 'EMAIL_NOT_VERIFIED' | 'UPDATE_WITHOUT_ID' | 'CONNECTION_ERROR' | 'INVALID_PAYMENT' | 'DECLINED_PAYMENT' | 'INTEGRATION_ERROR' | 'CANNOT_RESERVE' | 'REFUND_FAILURE' | 'INVALID_INVOICE' | 'INVALID_COUPON' | 'SERVICE_UNAVAILABLE' | 'METHOD_UNALLOWED' | 'LOGIN_EXPIRED' | 'THIRD_PARTY_ERROR' | 'ACCESS_DENIED' | 'DATABASE_ERROR' | 'SCHEMA_ERROR';
31
+ declare class RsError {
32
+ err: ErrorCode;
33
+ msg: string;
34
+ status?: number;
35
+ stack: string;
36
+ constructor(errCode: ErrorCode, message?: string);
37
+ static htmlStatus(code: ErrorCode): number;
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;
114
+ }
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
+
8
176
  declare const resturaConfigSchema: z.ZodObject<{
9
177
  authToken: z.ZodString;
10
178
  sendErrorStackTrace: z.ZodDefault<z.ZodBoolean>;
11
179
  schemaFilePath: z.ZodDefault<z.ZodString>;
180
+ customApiFolderPath: z.ZodDefault<z.ZodString>;
12
181
  generatedTypesPath: z.ZodDefault<z.ZodString>;
182
+ fileTempCachePath: z.ZodOptional<z.ZodString>;
13
183
  }, "strip", z.ZodTypeAny, {
14
184
  authToken: string;
15
185
  sendErrorStackTrace: boolean;
16
186
  schemaFilePath: string;
187
+ customApiFolderPath: string;
17
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
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
514
+ value: string | number | string[] | number[];
515
+ }, {
516
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
517
+ value: string | number | string[] | number[];
518
+ }>, "many">;
519
+ }, "strict", z.ZodTypeAny, {
520
+ name: string;
521
+ required: boolean;
522
+ validator: {
523
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
524
+ value: string | number | string[] | number[];
525
+ }[];
526
+ isNullable?: boolean | undefined;
527
+ }, {
528
+ name: string;
529
+ required: boolean;
530
+ validator: {
531
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
532
+ value: string | number | string[] | number[];
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
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
787
+ value: string | number | string[] | number[];
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;
833
+ }, {
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
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
866
+ value: string | number | string[] | number[];
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;
912
+ }>;
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
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
933
+ value: string | number | string[] | number[];
934
+ }, {
935
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
936
+ value: string | number | string[] | number[];
937
+ }>, "many">;
938
+ }, "strict", z.ZodTypeAny, {
939
+ name: string;
940
+ required: boolean;
941
+ validator: {
942
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
943
+ value: string | number | string[] | number[];
944
+ }[];
945
+ isNullable?: boolean | undefined;
946
+ }, {
947
+ name: string;
948
+ required: boolean;
949
+ validator: {
950
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
951
+ value: string | number | string[] | number[];
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
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
975
+ value: string | number | string[] | number[];
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
+ type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
997
+ value: string | number | string[] | number[];
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
+ length?: number | undefined;
1026
+ value?: string | 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
+ length?: number | undefined;
1038
+ value?: string | 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
+ length?: number | undefined;
1107
+ value?: string | 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;
18
1134
  }, {
19
- authToken: string;
20
- sendErrorStackTrace?: boolean | undefined;
21
- schemaFilePath?: string | undefined;
22
- generatedTypesPath?: string | undefined;
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
+ length?: number | undefined;
1143
+ value?: string | 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;
23
1170
  }>;
24
- type ResturaConfigSchema = z.infer<typeof resturaConfigSchema>;
25
-
26
- declare const resturaZodSchema: z.ZodObject<{
1171
+ type TableData = z.infer<typeof tableDataSchema>;
1172
+ declare const resturaSchema: z.ZodObject<{
27
1173
  database: z.ZodArray<z.ZodObject<{
28
1174
  name: z.ZodString;
29
1175
  columns: z.ZodArray<z.ZodObject<{
30
1176
  name: z.ZodString;
31
- 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"]>]>;
32
1178
  isNullable: z.ZodBoolean;
33
1179
  roles: z.ZodArray<z.ZodString, "many">;
34
1180
  comment: z.ZodOptional<z.ZodString>;
@@ -39,10 +1185,10 @@ declare const resturaZodSchema: z.ZodObject<{
39
1185
  hasAutoIncrement: z.ZodOptional<z.ZodBoolean>;
40
1186
  length: z.ZodOptional<z.ZodNumber>;
41
1187
  }, "strict", z.ZodTypeAny, {
42
- 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";
43
1189
  name: string;
44
- roles: string[];
45
1190
  isNullable: boolean;
1191
+ roles: string[];
46
1192
  length?: number | undefined;
47
1193
  value?: string | undefined;
48
1194
  default?: string | undefined;
@@ -51,10 +1197,10 @@ declare const resturaZodSchema: z.ZodObject<{
51
1197
  isUnique?: boolean | undefined;
52
1198
  hasAutoIncrement?: boolean | undefined;
53
1199
  }, {
54
- 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";
55
1201
  name: string;
56
- roles: string[];
57
1202
  isNullable: boolean;
1203
+ roles: string[];
58
1204
  length?: number | undefined;
59
1205
  value?: string | undefined;
60
1206
  default?: string | undefined;
@@ -115,14 +1261,15 @@ declare const resturaZodSchema: z.ZodObject<{
115
1261
  check: string;
116
1262
  }>, "many">;
117
1263
  roles: z.ZodArray<z.ZodString, "many">;
1264
+ notify: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"ALL">, z.ZodArray<z.ZodString, "many">]>>;
118
1265
  }, "strict", z.ZodTypeAny, {
119
1266
  name: string;
120
1267
  roles: string[];
121
1268
  columns: {
122
- 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";
123
1270
  name: string;
124
- roles: string[];
125
1271
  isNullable: boolean;
1272
+ roles: string[];
126
1273
  length?: number | undefined;
127
1274
  value?: string | undefined;
128
1275
  default?: string | undefined;
@@ -150,14 +1297,15 @@ declare const resturaZodSchema: z.ZodObject<{
150
1297
  name: string;
151
1298
  check: string;
152
1299
  }[];
1300
+ notify?: string[] | "ALL" | undefined;
153
1301
  }, {
154
1302
  name: string;
155
1303
  roles: string[];
156
1304
  columns: {
157
- 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";
158
1306
  name: string;
159
- roles: string[];
160
1307
  isNullable: boolean;
1308
+ roles: string[];
161
1309
  length?: number | undefined;
162
1310
  value?: string | undefined;
163
1311
  default?: string | undefined;
@@ -185,6 +1333,7 @@ declare const resturaZodSchema: z.ZodObject<{
185
1333
  name: string;
186
1334
  check: string;
187
1335
  }[];
1336
+ notify?: string[] | "ALL" | undefined;
188
1337
  }>, "many">;
189
1338
  endpoints: z.ZodArray<z.ZodObject<{
190
1339
  name: z.ZodString;
@@ -234,28 +1383,29 @@ declare const resturaZodSchema: z.ZodObject<{
234
1383
  where: z.ZodArray<z.ZodObject<{
235
1384
  tableName: z.ZodOptional<z.ZodString>;
236
1385
  columnName: z.ZodOptional<z.ZodString>;
237
- 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"]>>;
238
1387
  value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
239
1388
  custom: z.ZodOptional<z.ZodString>;
240
1389
  conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
241
1390
  }, "strict", z.ZodTypeAny, {
242
1391
  value?: string | number | undefined;
243
1392
  custom?: string | undefined;
244
- columnName?: string | undefined;
245
1393
  tableName?: string | undefined;
246
- 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;
247
1396
  conjunction?: "AND" | "OR" | undefined;
248
1397
  }, {
249
1398
  value?: string | number | undefined;
250
1399
  custom?: string | undefined;
251
- columnName?: string | undefined;
252
1400
  tableName?: string | undefined;
253
- 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;
254
1403
  conjunction?: "AND" | "OR" | undefined;
255
1404
  }>, "many">;
256
1405
  request: z.ZodArray<z.ZodObject<{
257
1406
  name: z.ZodString;
258
1407
  required: z.ZodBoolean;
1408
+ isNullable: z.ZodOptional<z.ZodBoolean>;
259
1409
  validator: z.ZodArray<z.ZodObject<{
260
1410
  type: z.ZodEnum<["TYPE_CHECK", "MIN", "MAX", "ONE_OF"]>;
261
1411
  value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>;
@@ -267,19 +1417,21 @@ declare const resturaZodSchema: z.ZodObject<{
267
1417
  value: string | number | string[] | number[];
268
1418
  }>, "many">;
269
1419
  }, "strict", z.ZodTypeAny, {
1420
+ name: string;
1421
+ required: boolean;
270
1422
  validator: {
271
1423
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
272
1424
  value: string | number | string[] | number[];
273
1425
  }[];
1426
+ isNullable?: boolean | undefined;
1427
+ }, {
274
1428
  name: string;
275
1429
  required: boolean;
276
- }, {
277
1430
  validator: {
278
1431
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
279
1432
  value: string | number | string[] | number[];
280
1433
  }[];
281
- name: string;
282
- required: boolean;
1434
+ isNullable?: boolean | undefined;
283
1435
  }>, "many">;
284
1436
  response: z.ZodArray<z.ZodObject<{
285
1437
  name: z.ZodString;
@@ -311,23 +1463,23 @@ declare const resturaZodSchema: z.ZodObject<{
311
1463
  where: z.ZodArray<z.ZodObject<{
312
1464
  tableName: z.ZodOptional<z.ZodString>;
313
1465
  columnName: z.ZodOptional<z.ZodString>;
314
- 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"]>>;
315
1467
  value: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
316
1468
  custom: z.ZodOptional<z.ZodString>;
317
1469
  conjunction: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>;
318
1470
  }, "strict", z.ZodTypeAny, {
319
1471
  value?: string | number | undefined;
320
1472
  custom?: string | undefined;
321
- columnName?: string | undefined;
322
1473
  tableName?: string | undefined;
323
- 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;
324
1476
  conjunction?: "AND" | "OR" | undefined;
325
1477
  }, {
326
1478
  value?: string | number | undefined;
327
1479
  custom?: string | undefined;
328
- columnName?: string | undefined;
329
1480
  tableName?: string | undefined;
330
- 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;
331
1483
  conjunction?: "AND" | "OR" | undefined;
332
1484
  }>, "many">;
333
1485
  properties: z.ZodArray<z.ZodLazy<z.ZodType<any, z.ZodTypeDef, any>>, "many">;
@@ -335,24 +1487,24 @@ declare const resturaZodSchema: z.ZodObject<{
335
1487
  columnName: z.ZodString;
336
1488
  tableName: z.ZodString;
337
1489
  }, "strict", z.ZodTypeAny, {
338
- columnName: string;
339
1490
  tableName: string;
340
- }, {
341
1491
  columnName: string;
1492
+ }, {
342
1493
  tableName: string;
1494
+ columnName: string;
343
1495
  }>>;
344
1496
  orderBy: z.ZodOptional<z.ZodObject<{
345
1497
  columnName: z.ZodString;
346
1498
  order: z.ZodEnum<["ASC", "DESC"]>;
347
1499
  tableName: z.ZodString;
348
1500
  }, "strict", z.ZodTypeAny, {
1501
+ tableName: string;
349
1502
  columnName: string;
350
1503
  order: "ASC" | "DESC";
351
- tableName: string;
352
1504
  }, {
1505
+ tableName: string;
353
1506
  columnName: string;
354
1507
  order: "ASC" | "DESC";
355
- tableName: string;
356
1508
  }>>;
357
1509
  }, "strip", z.ZodTypeAny, {
358
1510
  table: string;
@@ -367,20 +1519,20 @@ declare const resturaZodSchema: z.ZodObject<{
367
1519
  where: {
368
1520
  value?: string | number | undefined;
369
1521
  custom?: string | undefined;
370
- columnName?: string | undefined;
371
1522
  tableName?: string | undefined;
372
- 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;
373
1525
  conjunction?: "AND" | "OR" | undefined;
374
1526
  }[];
375
1527
  properties: any[];
376
1528
  groupBy?: {
377
- columnName: string;
378
1529
  tableName: string;
1530
+ columnName: string;
379
1531
  } | undefined;
380
1532
  orderBy?: {
1533
+ tableName: string;
381
1534
  columnName: string;
382
1535
  order: "ASC" | "DESC";
383
- tableName: string;
384
1536
  } | undefined;
385
1537
  }, {
386
1538
  table: string;
@@ -395,20 +1547,20 @@ declare const resturaZodSchema: z.ZodObject<{
395
1547
  where: {
396
1548
  value?: string | number | undefined;
397
1549
  custom?: string | undefined;
398
- columnName?: string | undefined;
399
1550
  tableName?: string | undefined;
400
- 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;
401
1553
  conjunction?: "AND" | "OR" | undefined;
402
1554
  }[];
403
1555
  properties: any[];
404
1556
  groupBy?: {
405
- columnName: string;
406
1557
  tableName: string;
1558
+ columnName: string;
407
1559
  } | undefined;
408
1560
  orderBy?: {
1561
+ tableName: string;
409
1562
  columnName: string;
410
1563
  order: "ASC" | "DESC";
411
- tableName: string;
412
1564
  } | undefined;
413
1565
  }>>;
414
1566
  }, "strict", z.ZodTypeAny, {
@@ -427,20 +1579,20 @@ declare const resturaZodSchema: z.ZodObject<{
427
1579
  where: {
428
1580
  value?: string | number | undefined;
429
1581
  custom?: string | undefined;
430
- columnName?: string | undefined;
431
1582
  tableName?: string | undefined;
432
- 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;
433
1585
  conjunction?: "AND" | "OR" | undefined;
434
1586
  }[];
435
1587
  properties: any[];
436
1588
  groupBy?: {
437
- columnName: string;
438
1589
  tableName: string;
1590
+ columnName: string;
439
1591
  } | undefined;
440
1592
  orderBy?: {
1593
+ tableName: string;
441
1594
  columnName: string;
442
1595
  order: "ASC" | "DESC";
443
- tableName: string;
444
1596
  } | undefined;
445
1597
  } | undefined;
446
1598
  }, {
@@ -459,20 +1611,20 @@ declare const resturaZodSchema: z.ZodObject<{
459
1611
  where: {
460
1612
  value?: string | number | undefined;
461
1613
  custom?: string | undefined;
462
- columnName?: string | undefined;
463
1614
  tableName?: string | undefined;
464
- 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;
465
1617
  conjunction?: "AND" | "OR" | undefined;
466
1618
  }[];
467
1619
  properties: any[];
468
1620
  groupBy?: {
469
- columnName: string;
470
1621
  tableName: string;
1622
+ columnName: string;
471
1623
  } | undefined;
472
1624
  orderBy?: {
1625
+ tableName: string;
473
1626
  columnName: string;
474
1627
  order: "ASC" | "DESC";
475
- tableName: string;
476
1628
  } | undefined;
477
1629
  } | undefined;
478
1630
  }>, "many">;
@@ -480,28 +1632,28 @@ declare const resturaZodSchema: z.ZodObject<{
480
1632
  columnName: z.ZodString;
481
1633
  tableName: z.ZodString;
482
1634
  }, "strict", z.ZodTypeAny, {
483
- columnName: string;
484
1635
  tableName: string;
485
- }, {
486
1636
  columnName: string;
1637
+ }, {
487
1638
  tableName: string;
1639
+ columnName: string;
488
1640
  }>>;
489
1641
  orderBy: z.ZodOptional<z.ZodObject<{
490
1642
  columnName: z.ZodString;
491
1643
  order: z.ZodEnum<["ASC", "DESC"]>;
492
1644
  tableName: z.ZodString;
493
1645
  }, "strict", z.ZodTypeAny, {
1646
+ tableName: string;
494
1647
  columnName: string;
495
1648
  order: "ASC" | "DESC";
496
- tableName: string;
497
1649
  }, {
1650
+ tableName: string;
498
1651
  columnName: string;
499
1652
  order: "ASC" | "DESC";
500
- tableName: string;
501
1653
  }>>;
502
1654
  }>, "strict", z.ZodTypeAny, {
503
1655
  path: string;
504
- type: "PAGED" | "ARRAY" | "ONE";
1656
+ type: "ONE" | "ARRAY" | "PAGED";
505
1657
  name: string;
506
1658
  table: string;
507
1659
  joins: {
@@ -515,9 +1667,9 @@ declare const resturaZodSchema: z.ZodObject<{
515
1667
  where: {
516
1668
  value?: string | number | undefined;
517
1669
  custom?: string | undefined;
518
- columnName?: string | undefined;
519
1670
  tableName?: string | undefined;
520
- 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;
521
1673
  conjunction?: "AND" | "OR" | undefined;
522
1674
  }[];
523
1675
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -528,12 +1680,13 @@ declare const resturaZodSchema: z.ZodObject<{
528
1680
  name: string;
529
1681
  }[];
530
1682
  request: {
1683
+ name: string;
1684
+ required: boolean;
531
1685
  validator: {
532
1686
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
533
1687
  value: string | number | string[] | number[];
534
1688
  }[];
535
- name: string;
536
- required: boolean;
1689
+ isNullable?: boolean | undefined;
537
1690
  }[];
538
1691
  response: {
539
1692
  name: string;
@@ -551,35 +1704,35 @@ declare const resturaZodSchema: z.ZodObject<{
551
1704
  where: {
552
1705
  value?: string | number | undefined;
553
1706
  custom?: string | undefined;
554
- columnName?: string | undefined;
555
1707
  tableName?: string | undefined;
556
- 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;
557
1710
  conjunction?: "AND" | "OR" | undefined;
558
1711
  }[];
559
1712
  properties: any[];
560
1713
  groupBy?: {
561
- columnName: string;
562
1714
  tableName: string;
1715
+ columnName: string;
563
1716
  } | undefined;
564
1717
  orderBy?: {
1718
+ tableName: string;
565
1719
  columnName: string;
566
1720
  order: "ASC" | "DESC";
567
- tableName: string;
568
1721
  } | undefined;
569
1722
  } | undefined;
570
1723
  }[];
571
1724
  groupBy?: {
572
- columnName: string;
573
1725
  tableName: string;
1726
+ columnName: string;
574
1727
  } | undefined;
575
1728
  orderBy?: {
1729
+ tableName: string;
576
1730
  columnName: string;
577
1731
  order: "ASC" | "DESC";
578
- tableName: string;
579
1732
  } | undefined;
580
1733
  }, {
581
1734
  path: string;
582
- type: "PAGED" | "ARRAY" | "ONE";
1735
+ type: "ONE" | "ARRAY" | "PAGED";
583
1736
  name: string;
584
1737
  table: string;
585
1738
  joins: {
@@ -593,9 +1746,9 @@ declare const resturaZodSchema: z.ZodObject<{
593
1746
  where: {
594
1747
  value?: string | number | undefined;
595
1748
  custom?: string | undefined;
596
- columnName?: string | undefined;
597
1749
  tableName?: string | undefined;
598
- 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;
599
1752
  conjunction?: "AND" | "OR" | undefined;
600
1753
  }[];
601
1754
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -606,12 +1759,13 @@ declare const resturaZodSchema: z.ZodObject<{
606
1759
  name: string;
607
1760
  }[];
608
1761
  request: {
1762
+ name: string;
1763
+ required: boolean;
609
1764
  validator: {
610
1765
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
611
1766
  value: string | number | string[] | number[];
612
1767
  }[];
613
- name: string;
614
- required: boolean;
1768
+ isNullable?: boolean | undefined;
615
1769
  }[];
616
1770
  response: {
617
1771
  name: string;
@@ -629,31 +1783,31 @@ declare const resturaZodSchema: z.ZodObject<{
629
1783
  where: {
630
1784
  value?: string | number | undefined;
631
1785
  custom?: string | undefined;
632
- columnName?: string | undefined;
633
1786
  tableName?: string | undefined;
634
- 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;
635
1789
  conjunction?: "AND" | "OR" | undefined;
636
1790
  }[];
637
1791
  properties: any[];
638
1792
  groupBy?: {
639
- columnName: string;
640
1793
  tableName: string;
1794
+ columnName: string;
641
1795
  } | undefined;
642
1796
  orderBy?: {
1797
+ tableName: string;
643
1798
  columnName: string;
644
1799
  order: "ASC" | "DESC";
645
- tableName: string;
646
1800
  } | undefined;
647
1801
  } | undefined;
648
1802
  }[];
649
1803
  groupBy?: {
650
- columnName: string;
651
1804
  tableName: string;
1805
+ columnName: string;
652
1806
  } | undefined;
653
1807
  orderBy?: {
1808
+ tableName: string;
654
1809
  columnName: string;
655
1810
  order: "ASC" | "DESC";
656
- tableName: string;
657
1811
  } | undefined;
658
1812
  }>, z.ZodObject<z.objectUtil.extendShape<{
659
1813
  method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
@@ -668,6 +1822,7 @@ declare const resturaZodSchema: z.ZodObject<{
668
1822
  request: z.ZodOptional<z.ZodArray<z.ZodObject<{
669
1823
  name: z.ZodString;
670
1824
  required: z.ZodBoolean;
1825
+ isNullable: z.ZodOptional<z.ZodBoolean>;
671
1826
  validator: z.ZodArray<z.ZodObject<{
672
1827
  type: z.ZodEnum<["TYPE_CHECK", "MIN", "MAX", "ONE_OF"]>;
673
1828
  value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>;
@@ -679,19 +1834,21 @@ declare const resturaZodSchema: z.ZodObject<{
679
1834
  value: string | number | string[] | number[];
680
1835
  }>, "many">;
681
1836
  }, "strict", z.ZodTypeAny, {
1837
+ name: string;
1838
+ required: boolean;
682
1839
  validator: {
683
1840
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
684
1841
  value: string | number | string[] | number[];
685
1842
  }[];
1843
+ isNullable?: boolean | undefined;
1844
+ }, {
686
1845
  name: string;
687
1846
  required: boolean;
688
- }, {
689
1847
  validator: {
690
1848
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
691
1849
  value: string | number | string[] | number[];
692
1850
  }[];
693
- name: string;
694
- required: boolean;
1851
+ isNullable?: boolean | undefined;
695
1852
  }>, "many">>;
696
1853
  table: z.ZodUndefined;
697
1854
  joins: z.ZodUndefined;
@@ -709,12 +1866,13 @@ declare const resturaZodSchema: z.ZodObject<{
709
1866
  joins?: undefined;
710
1867
  assignments?: undefined;
711
1868
  request?: {
1869
+ name: string;
1870
+ required: boolean;
712
1871
  validator: {
713
1872
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
714
1873
  value: string | number | string[] | number[];
715
1874
  }[];
716
- name: string;
717
- required: boolean;
1875
+ isNullable?: boolean | undefined;
718
1876
  }[] | undefined;
719
1877
  requestType?: string | undefined;
720
1878
  fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
@@ -730,12 +1888,13 @@ declare const resturaZodSchema: z.ZodObject<{
730
1888
  joins?: undefined;
731
1889
  assignments?: undefined;
732
1890
  request?: {
1891
+ name: string;
1892
+ required: boolean;
733
1893
  validator: {
734
1894
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
735
1895
  value: string | number | string[] | number[];
736
1896
  }[];
737
- name: string;
738
- required: boolean;
1897
+ isNullable?: boolean | undefined;
739
1898
  }[] | undefined;
740
1899
  requestType?: string | undefined;
741
1900
  fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
@@ -746,7 +1905,7 @@ declare const resturaZodSchema: z.ZodObject<{
746
1905
  baseUrl: string;
747
1906
  routes: ({
748
1907
  path: string;
749
- type: "PAGED" | "ARRAY" | "ONE";
1908
+ type: "ONE" | "ARRAY" | "PAGED";
750
1909
  name: string;
751
1910
  table: string;
752
1911
  joins: {
@@ -760,9 +1919,9 @@ declare const resturaZodSchema: z.ZodObject<{
760
1919
  where: {
761
1920
  value?: string | number | undefined;
762
1921
  custom?: string | undefined;
763
- columnName?: string | undefined;
764
1922
  tableName?: string | undefined;
765
- 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;
766
1925
  conjunction?: "AND" | "OR" | undefined;
767
1926
  }[];
768
1927
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -773,12 +1932,13 @@ declare const resturaZodSchema: z.ZodObject<{
773
1932
  name: string;
774
1933
  }[];
775
1934
  request: {
1935
+ name: string;
1936
+ required: boolean;
776
1937
  validator: {
777
1938
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
778
1939
  value: string | number | string[] | number[];
779
1940
  }[];
780
- name: string;
781
- required: boolean;
1941
+ isNullable?: boolean | undefined;
782
1942
  }[];
783
1943
  response: {
784
1944
  name: string;
@@ -796,31 +1956,31 @@ declare const resturaZodSchema: z.ZodObject<{
796
1956
  where: {
797
1957
  value?: string | number | undefined;
798
1958
  custom?: string | undefined;
799
- columnName?: string | undefined;
800
1959
  tableName?: string | undefined;
801
- 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;
802
1962
  conjunction?: "AND" | "OR" | undefined;
803
1963
  }[];
804
1964
  properties: any[];
805
1965
  groupBy?: {
806
- columnName: string;
807
1966
  tableName: string;
1967
+ columnName: string;
808
1968
  } | undefined;
809
1969
  orderBy?: {
1970
+ tableName: string;
810
1971
  columnName: string;
811
1972
  order: "ASC" | "DESC";
812
- tableName: string;
813
1973
  } | undefined;
814
1974
  } | undefined;
815
1975
  }[];
816
1976
  groupBy?: {
817
- columnName: string;
818
1977
  tableName: string;
1978
+ columnName: string;
819
1979
  } | undefined;
820
1980
  orderBy?: {
1981
+ tableName: string;
821
1982
  columnName: string;
822
1983
  order: "ASC" | "DESC";
823
- tableName: string;
824
1984
  } | undefined;
825
1985
  } | {
826
1986
  path: string;
@@ -834,12 +1994,13 @@ declare const resturaZodSchema: z.ZodObject<{
834
1994
  joins?: undefined;
835
1995
  assignments?: undefined;
836
1996
  request?: {
1997
+ name: string;
1998
+ required: boolean;
837
1999
  validator: {
838
2000
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
839
2001
  value: string | number | string[] | number[];
840
2002
  }[];
841
- name: string;
842
- required: boolean;
2003
+ isNullable?: boolean | undefined;
843
2004
  }[] | undefined;
844
2005
  requestType?: string | undefined;
845
2006
  fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
@@ -850,7 +2011,7 @@ declare const resturaZodSchema: z.ZodObject<{
850
2011
  baseUrl: string;
851
2012
  routes: ({
852
2013
  path: string;
853
- type: "PAGED" | "ARRAY" | "ONE";
2014
+ type: "ONE" | "ARRAY" | "PAGED";
854
2015
  name: string;
855
2016
  table: string;
856
2017
  joins: {
@@ -864,9 +2025,9 @@ declare const resturaZodSchema: z.ZodObject<{
864
2025
  where: {
865
2026
  value?: string | number | undefined;
866
2027
  custom?: string | undefined;
867
- columnName?: string | undefined;
868
2028
  tableName?: string | undefined;
869
- 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;
870
2031
  conjunction?: "AND" | "OR" | undefined;
871
2032
  }[];
872
2033
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -877,12 +2038,13 @@ declare const resturaZodSchema: z.ZodObject<{
877
2038
  name: string;
878
2039
  }[];
879
2040
  request: {
2041
+ name: string;
2042
+ required: boolean;
880
2043
  validator: {
881
2044
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
882
2045
  value: string | number | string[] | number[];
883
2046
  }[];
884
- name: string;
885
- required: boolean;
2047
+ isNullable?: boolean | undefined;
886
2048
  }[];
887
2049
  response: {
888
2050
  name: string;
@@ -900,31 +2062,31 @@ declare const resturaZodSchema: z.ZodObject<{
900
2062
  where: {
901
2063
  value?: string | number | undefined;
902
2064
  custom?: string | undefined;
903
- columnName?: string | undefined;
904
2065
  tableName?: string | undefined;
905
- 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;
906
2068
  conjunction?: "AND" | "OR" | undefined;
907
2069
  }[];
908
2070
  properties: any[];
909
2071
  groupBy?: {
910
- columnName: string;
911
2072
  tableName: string;
2073
+ columnName: string;
912
2074
  } | undefined;
913
2075
  orderBy?: {
2076
+ tableName: string;
914
2077
  columnName: string;
915
2078
  order: "ASC" | "DESC";
916
- tableName: string;
917
2079
  } | undefined;
918
2080
  } | undefined;
919
2081
  }[];
920
2082
  groupBy?: {
921
- columnName: string;
922
2083
  tableName: string;
2084
+ columnName: string;
923
2085
  } | undefined;
924
2086
  orderBy?: {
2087
+ tableName: string;
925
2088
  columnName: string;
926
2089
  order: "ASC" | "DESC";
927
- tableName: string;
928
2090
  } | undefined;
929
2091
  } | {
930
2092
  path: string;
@@ -938,12 +2100,13 @@ declare const resturaZodSchema: z.ZodObject<{
938
2100
  joins?: undefined;
939
2101
  assignments?: undefined;
940
2102
  request?: {
2103
+ name: string;
2104
+ required: boolean;
941
2105
  validator: {
942
2106
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
943
2107
  value: string | number | string[] | number[];
944
2108
  }[];
945
- name: string;
946
- required: boolean;
2109
+ isNullable?: boolean | undefined;
947
2110
  }[] | undefined;
948
2111
  requestType?: string | undefined;
949
2112
  fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
@@ -951,17 +2114,17 @@ declare const resturaZodSchema: z.ZodObject<{
951
2114
  }>, "many">;
952
2115
  globalParams: z.ZodArray<z.ZodString, "many">;
953
2116
  roles: z.ZodArray<z.ZodString, "many">;
954
- customTypes: z.ZodString;
2117
+ customTypes: z.ZodArray<z.ZodString, "many">;
955
2118
  }, "strict", z.ZodTypeAny, {
956
2119
  roles: string[];
957
2120
  database: {
958
2121
  name: string;
959
2122
  roles: string[];
960
2123
  columns: {
961
- 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";
962
2125
  name: string;
963
- roles: string[];
964
2126
  isNullable: boolean;
2127
+ roles: string[];
965
2128
  length?: number | undefined;
966
2129
  value?: string | undefined;
967
2130
  default?: string | undefined;
@@ -989,6 +2152,7 @@ declare const resturaZodSchema: z.ZodObject<{
989
2152
  name: string;
990
2153
  check: string;
991
2154
  }[];
2155
+ notify?: string[] | "ALL" | undefined;
992
2156
  }[];
993
2157
  endpoints: {
994
2158
  name: string;
@@ -996,7 +2160,7 @@ declare const resturaZodSchema: z.ZodObject<{
996
2160
  baseUrl: string;
997
2161
  routes: ({
998
2162
  path: string;
999
- type: "PAGED" | "ARRAY" | "ONE";
2163
+ type: "ONE" | "ARRAY" | "PAGED";
1000
2164
  name: string;
1001
2165
  table: string;
1002
2166
  joins: {
@@ -1010,9 +2174,9 @@ declare const resturaZodSchema: z.ZodObject<{
1010
2174
  where: {
1011
2175
  value?: string | number | undefined;
1012
2176
  custom?: string | undefined;
1013
- columnName?: string | undefined;
1014
2177
  tableName?: string | undefined;
1015
- 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;
1016
2180
  conjunction?: "AND" | "OR" | undefined;
1017
2181
  }[];
1018
2182
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -1023,12 +2187,13 @@ declare const resturaZodSchema: z.ZodObject<{
1023
2187
  name: string;
1024
2188
  }[];
1025
2189
  request: {
2190
+ name: string;
2191
+ required: boolean;
1026
2192
  validator: {
1027
2193
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1028
2194
  value: string | number | string[] | number[];
1029
2195
  }[];
1030
- name: string;
1031
- required: boolean;
2196
+ isNullable?: boolean | undefined;
1032
2197
  }[];
1033
2198
  response: {
1034
2199
  name: string;
@@ -1046,31 +2211,31 @@ declare const resturaZodSchema: z.ZodObject<{
1046
2211
  where: {
1047
2212
  value?: string | number | undefined;
1048
2213
  custom?: string | undefined;
1049
- columnName?: string | undefined;
1050
2214
  tableName?: string | undefined;
1051
- 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;
1052
2217
  conjunction?: "AND" | "OR" | undefined;
1053
2218
  }[];
1054
2219
  properties: any[];
1055
2220
  groupBy?: {
1056
- columnName: string;
1057
2221
  tableName: string;
2222
+ columnName: string;
1058
2223
  } | undefined;
1059
2224
  orderBy?: {
2225
+ tableName: string;
1060
2226
  columnName: string;
1061
2227
  order: "ASC" | "DESC";
1062
- tableName: string;
1063
2228
  } | undefined;
1064
2229
  } | undefined;
1065
2230
  }[];
1066
2231
  groupBy?: {
1067
- columnName: string;
1068
2232
  tableName: string;
2233
+ columnName: string;
1069
2234
  } | undefined;
1070
2235
  orderBy?: {
2236
+ tableName: string;
1071
2237
  columnName: string;
1072
2238
  order: "ASC" | "DESC";
1073
- tableName: string;
1074
2239
  } | undefined;
1075
2240
  } | {
1076
2241
  path: string;
@@ -1084,29 +2249,30 @@ declare const resturaZodSchema: z.ZodObject<{
1084
2249
  joins?: undefined;
1085
2250
  assignments?: undefined;
1086
2251
  request?: {
2252
+ name: string;
2253
+ required: boolean;
1087
2254
  validator: {
1088
2255
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1089
2256
  value: string | number | string[] | number[];
1090
2257
  }[];
1091
- name: string;
1092
- required: boolean;
2258
+ isNullable?: boolean | undefined;
1093
2259
  }[] | undefined;
1094
2260
  requestType?: string | undefined;
1095
2261
  fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
1096
2262
  })[];
1097
2263
  }[];
1098
2264
  globalParams: string[];
1099
- customTypes: string;
2265
+ customTypes: string[];
1100
2266
  }, {
1101
2267
  roles: string[];
1102
2268
  database: {
1103
2269
  name: string;
1104
2270
  roles: string[];
1105
2271
  columns: {
1106
- 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";
1107
2273
  name: string;
1108
- roles: string[];
1109
2274
  isNullable: boolean;
2275
+ roles: string[];
1110
2276
  length?: number | undefined;
1111
2277
  value?: string | undefined;
1112
2278
  default?: string | undefined;
@@ -1134,6 +2300,7 @@ declare const resturaZodSchema: z.ZodObject<{
1134
2300
  name: string;
1135
2301
  check: string;
1136
2302
  }[];
2303
+ notify?: string[] | "ALL" | undefined;
1137
2304
  }[];
1138
2305
  endpoints: {
1139
2306
  name: string;
@@ -1141,7 +2308,7 @@ declare const resturaZodSchema: z.ZodObject<{
1141
2308
  baseUrl: string;
1142
2309
  routes: ({
1143
2310
  path: string;
1144
- type: "PAGED" | "ARRAY" | "ONE";
2311
+ type: "ONE" | "ARRAY" | "PAGED";
1145
2312
  name: string;
1146
2313
  table: string;
1147
2314
  joins: {
@@ -1155,9 +2322,9 @@ declare const resturaZodSchema: z.ZodObject<{
1155
2322
  where: {
1156
2323
  value?: string | number | undefined;
1157
2324
  custom?: string | undefined;
1158
- columnName?: string | undefined;
1159
2325
  tableName?: string | undefined;
1160
- 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;
1161
2328
  conjunction?: "AND" | "OR" | undefined;
1162
2329
  }[];
1163
2330
  method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
@@ -1168,12 +2335,13 @@ declare const resturaZodSchema: z.ZodObject<{
1168
2335
  name: string;
1169
2336
  }[];
1170
2337
  request: {
2338
+ name: string;
2339
+ required: boolean;
1171
2340
  validator: {
1172
2341
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1173
2342
  value: string | number | string[] | number[];
1174
2343
  }[];
1175
- name: string;
1176
- required: boolean;
2344
+ isNullable?: boolean | undefined;
1177
2345
  }[];
1178
2346
  response: {
1179
2347
  name: string;
@@ -1191,31 +2359,31 @@ declare const resturaZodSchema: z.ZodObject<{
1191
2359
  where: {
1192
2360
  value?: string | number | undefined;
1193
2361
  custom?: string | undefined;
1194
- columnName?: string | undefined;
1195
2362
  tableName?: string | undefined;
1196
- 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;
1197
2365
  conjunction?: "AND" | "OR" | undefined;
1198
2366
  }[];
1199
2367
  properties: any[];
1200
2368
  groupBy?: {
1201
- columnName: string;
1202
2369
  tableName: string;
2370
+ columnName: string;
1203
2371
  } | undefined;
1204
2372
  orderBy?: {
2373
+ tableName: string;
1205
2374
  columnName: string;
1206
2375
  order: "ASC" | "DESC";
1207
- tableName: string;
1208
2376
  } | undefined;
1209
2377
  } | undefined;
1210
2378
  }[];
1211
2379
  groupBy?: {
1212
- columnName: string;
1213
2380
  tableName: string;
2381
+ columnName: string;
1214
2382
  } | undefined;
1215
2383
  orderBy?: {
2384
+ tableName: string;
1216
2385
  columnName: string;
1217
2386
  order: "ASC" | "DESC";
1218
- tableName: string;
1219
2387
  } | undefined;
1220
2388
  } | {
1221
2389
  path: string;
@@ -1229,49 +2397,42 @@ declare const resturaZodSchema: z.ZodObject<{
1229
2397
  joins?: undefined;
1230
2398
  assignments?: undefined;
1231
2399
  request?: {
2400
+ name: string;
2401
+ required: boolean;
1232
2402
  validator: {
1233
2403
  type: "TYPE_CHECK" | "MIN" | "MAX" | "ONE_OF";
1234
2404
  value: string | number | string[] | number[];
1235
2405
  }[];
1236
- name: string;
1237
- required: boolean;
2406
+ isNullable?: boolean | undefined;
1238
2407
  }[] | undefined;
1239
2408
  requestType?: string | undefined;
1240
2409
  fileUploadType?: "SINGLE" | "MULTIPLE" | undefined;
1241
2410
  })[];
1242
2411
  }[];
1243
2412
  globalParams: string[];
1244
- customTypes: string;
2413
+ customTypes: string[];
1245
2414
  }>;
1246
- type ResturaSchema = z.infer<typeof resturaZodSchema>;
1247
-
1248
- interface RequesterDetails {
1249
- role?: string;
1250
- host: string;
1251
- ipAddress: string;
1252
- [key: string]: string | number | undefined | null | boolean;
1253
- }
1254
- interface RsRequest<T = unknown> extends express.Request {
1255
- requesterDetails: RequesterDetails;
1256
- data: T;
1257
- }
2415
+ type ResturaSchema = z.infer<typeof resturaSchema>;
1258
2416
 
1259
- interface RoleWithOptionalUserDetails {
1260
- role: string;
1261
- [key: string]: string | number | boolean | object | null;
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 logSqlStatement;
1262
2424
  }
1263
- type AuthenticateHandler = (req: RsRequest<unknown>, onValid: (userDetails: RoleWithOptionalUserDetails) => void, onReject: (errorMessage: string) => void) => Promise<void>;
1264
2425
 
1265
- declare class PsqlPool {
2426
+ declare class PsqlPool extends PsqlConnection {
1266
2427
  poolConfig: PoolConfig;
1267
2428
  pool: Pool;
1268
2429
  constructor(poolConfig: PoolConfig);
1269
- queryOne(query: string, options: Array<any>): Promise<any>;
1270
- runQuery(query: string, options: any[]): Promise<any[]>;
2430
+ protected query<R extends QueryResultRow = QueryResultRow, T extends Array<unknown> = unknown[]>(query: string, values?: QueryConfigValues<T>): Promise<QueryResult<R>>;
1271
2431
  }
1272
2432
 
1273
2433
  declare class ResturaEngine {
1274
2434
  resturaConfig: ResturaConfigSchema;
2435
+ private multerCommonUpload;
1275
2436
  private resturaRouter;
1276
2437
  private publicEndpoints;
1277
2438
  private expressApp;
@@ -1321,6 +2482,12 @@ declare class ResturaEngine {
1321
2482
  * @returns A promise that resolves when the model has been successfully written to the output file.
1322
2483
  */
1323
2484
  generateModelFromSchema(outputFile: string, providedSchema: ResturaSchema): Promise<void>;
2485
+ /**
2486
+ * Generates the ambient module declaration for Restura global types and writes it to the specified output file.
2487
+ * These types are used sometimes in the CustomTypes
2488
+ * @param outputFile
2489
+ */
2490
+ generateResturaGlobalTypes(outputFile: string): void;
1324
2491
  /**
1325
2492
  * Retrieves the latest file system schema for Restura.
1326
2493
  *
@@ -1328,20 +2495,6 @@ declare class ResturaEngine {
1328
2495
  * @throws {Error} If the schema file is missing or the schema is not valid.
1329
2496
  */
1330
2497
  getLatestFileSystemSchema(): Promise<ResturaSchema>;
1331
- /**
1332
- * Asynchronously generates and retrieves hashes for the provided schema and related generated files.
1333
- *
1334
- * @param providedSchema - The schema for which hashes need to be generated.
1335
- * @returns A promise that resolves to an object containing:
1336
- * - `schemaHash`: The hash of the provided schema.
1337
- * - `apiCreatedSchemaHash`: The hash extracted from the generated `api.d.ts` file.
1338
- * - `modelCreatedSchemaHash`: The hash extracted from the generated `models.d.ts` file.
1339
- */
1340
- getHashes(providedSchema: ResturaSchema): Promise<{
1341
- schemaHash: string;
1342
- apiCreatedSchemaHash: string;
1343
- modelCreatedSchemaHash: string;
1344
- }>;
1345
2498
  private reloadEndpoints;
1346
2499
  private validateGeneratedTypesFolder;
1347
2500
  private resturaAuthentication;
@@ -1350,9 +2503,10 @@ declare class ResturaEngine {
1350
2503
  private updateTypes;
1351
2504
  private getSchema;
1352
2505
  private getSchemaAndTypes;
2506
+ private getMulterFilesIfAny;
1353
2507
  private executeRouteLogic;
1354
2508
  private isCustomRoute;
1355
- private generateHashForSchema;
2509
+ private runCustomRouteLogic;
1356
2510
  private storeFileSystemSchema;
1357
2511
  private resetPublicEndpoints;
1358
2512
  private validateAuthorization;
@@ -1360,4 +2514,112 @@ declare class ResturaEngine {
1360
2514
  }
1361
2515
  declare const restura: ResturaEngine;
1362
2516
 
1363
- export { PsqlPool, logger, restura };
2517
+ declare const filterPsqlParser: peg.Parser;
2518
+
2519
+ declare abstract class SqlEngine {
2520
+ runQueryForRoute(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[] | boolean>;
2521
+ protected getTableSchema(schema: ResturaSchema, tableName: string): TableData;
2522
+ protected doesRoleHavePermissionToColumn(role: string | undefined | null, schema: ResturaSchema, item: ResponseData, joins: JoinData[]): boolean;
2523
+ protected doesRoleHavePermissionToTable(userRole: string | undefined, schema: ResturaSchema, tableName: string): boolean;
2524
+ protected abstract generateJoinStatements(req: RsRequest<unknown>, joins: JoinData[], baseTable: string, routeData: StandardRouteData, schema: ResturaSchema, userRole: string | undefined, sqlParams: string[]): string;
2525
+ protected abstract generateGroupBy(routeData: StandardRouteData): string;
2526
+ protected abstract generateOrderBy(req: RsRequest<unknown>, routeData: StandardRouteData): string;
2527
+ protected abstract generateWhereClause(req: RsRequest<unknown>, where: WhereData[], routeData: StandardRouteData, sqlParams: string[]): string;
2528
+ protected replaceParamKeywords(value: string | number, routeData: RouteData, req: RsRequest<unknown>, sqlParams: string[]): string | number;
2529
+ protected replaceLocalParamKeywords(value: string | number, routeData: RouteData, req: RsRequest<unknown>, sqlParams: string[]): string | number;
2530
+ protected replaceGlobalParamKeywords(value: string | number, routeData: RouteData, req: RsRequest<unknown>, sqlParams: string[]): string | number;
2531
+ abstract generateDatabaseSchemaFromSchema(schema: ResturaSchema): string;
2532
+ abstract diffDatabaseToSchema(schema: ResturaSchema): Promise<string>;
2533
+ protected abstract createNestedSelect(req: RsRequest<unknown>, schema: ResturaSchema, item: ResponseData, routeData: StandardRouteData, userRole: string | undefined, sqlParams: string[]): string;
2534
+ protected abstract executeCreateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2535
+ protected abstract executeGetRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[]>;
2536
+ protected abstract executeUpdateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2537
+ protected abstract executeDeleteRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<boolean>;
2538
+ }
2539
+
2540
+ declare class PsqlEngine extends SqlEngine {
2541
+ private psqlConnectionPool;
2542
+ setupTriggerListeners: Promise<void> | undefined;
2543
+ private triggerClient;
2544
+ constructor(psqlConnectionPool: PsqlPool, shouldListenForDbTriggers?: boolean);
2545
+ close(): Promise<void>;
2546
+ private setupPgReturnTypes;
2547
+ private listenForDbTriggers;
2548
+ private handleTrigger;
2549
+ createDatabaseFromSchema(schema: ResturaSchema, connection: PsqlPool): Promise<string>;
2550
+ generateDatabaseSchemaFromSchema(schema: ResturaSchema): string;
2551
+ private getScratchPool;
2552
+ diffDatabaseToSchema(schema: ResturaSchema): Promise<string>;
2553
+ protected createNestedSelect(req: RsRequest<unknown>, schema: ResturaSchema, item: ResponseData, routeData: StandardRouteData, userRole: string | undefined, sqlParams: string[]): string;
2554
+ protected executeCreateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2555
+ protected executeGetRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject | any[]>;
2556
+ protected executeUpdateRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<DynamicObject>;
2557
+ protected executeDeleteRequest(req: RsRequest<unknown>, routeData: StandardRouteData, schema: ResturaSchema): Promise<boolean>;
2558
+ protected generateJoinStatements(req: RsRequest<unknown>, joins: JoinData[], baseTable: string, routeData: StandardRouteData | CustomRouteData, schema: ResturaSchema, userRole: string | undefined, sqlParams: string[]): string;
2559
+ protected generateGroupBy(routeData: StandardRouteData): string;
2560
+ protected generateOrderBy(req: RsRequest<unknown>, routeData: StandardRouteData): string;
2561
+ protected generateWhereClause(req: RsRequest<unknown>, where: WhereData[], routeData: StandardRouteData | CustomRouteData, sqlParams: string[]): string;
2562
+ private createUpdateTrigger;
2563
+ private createDeleteTrigger;
2564
+ private createInsertTriggers;
2565
+ private schemaToPsqlType;
2566
+ }
2567
+
2568
+ declare class PsqlTransaction extends PsqlConnection {
2569
+ clientConfig: ClientConfig;
2570
+ client: Client;
2571
+ private beginTransactionPromise;
2572
+ private connectPromise;
2573
+ constructor(clientConfig: ClientConfig, instanceId?: UUID);
2574
+ close(): Promise<void>;
2575
+ private beginTransaction;
2576
+ rollback(): Promise<QueryResult<QueryResultRow>>;
2577
+ commit(): Promise<QueryResult<QueryResultRow>>;
2578
+ release(): Promise<void>;
2579
+ protected query<R extends QueryResultRow = QueryResultRow, T extends Array<unknown> = unknown[]>(query: string, values?: QueryConfigValues<T>): Promise<QueryResult<R>>;
2580
+ }
2581
+
2582
+ /**
2583
+ * This method does a couple of things:
2584
+ * 1. It escapes the column name to prevent SQL injection by removing any double quotes.
2585
+ * 2. It wraps the column name in double quotes to prevent any issues with reserved words or casing.
2586
+ * 3. It replaces any periods in the column name with a period wrapped in double quotes to prevent any issues with schema names.
2587
+ * NOTE: I looked into using pg-format ident() method but that will strip the double quotes when not needed.
2588
+ * @param columnName
2589
+ * @returns
2590
+ */
2591
+ declare function escapeColumnName(columnName: string | undefined): string;
2592
+ /**
2593
+ * Converts a query with question marks to a query with numbered parameters,
2594
+ * however it ignores question marks inside single or double quotes.
2595
+ * @param query PostgreSQL query with question marks
2596
+ * @returns A string with numbered parameters such as $1, $2 in replacement of question marks
2597
+ */
2598
+ declare function questionMarksToOrderedParams(query: string): string;
2599
+ /**
2600
+ * Creates a query to insert an object into a table.
2601
+ * @param table Table name to insert the object into
2602
+ * @param obj Data to insert into the table
2603
+ * @returns the query to insert the object into the table
2604
+ */
2605
+ declare function insertObjectQuery(table: string, obj: DynamicObject): string;
2606
+ /**
2607
+ * Creates a query to update an object in a table.
2608
+ * @param table Table name to update the object in
2609
+ * @param obj Data to update in the table
2610
+ * @param whereStatement Where clause to determine which rows to update
2611
+ * @returns the query to update the object in the table
2612
+ */
2613
+ declare function updateObjectQuery(table: string, obj: DynamicObject, whereStatement: string): string;
2614
+ declare function isValueNumber(value: unknown): value is number;
2615
+ /**
2616
+ * This method is used to format a query and escape user input.
2617
+ * Use this with the SQL tag to escape user input. For example:
2618
+ * SQL`UPDATE "USER" SET "firstName" = ${firstName}, "isActive" = ${isActive} WHERE "id" = ${id} RETURNING *`
2619
+ * @param strings template strings array
2620
+ * @param values values to escape
2621
+ * @returns An escaped query with user input
2622
+ */
2623
+ declare function SQL(strings: TemplateStringsArray, ...values: unknown[]): string;
2624
+
2625
+ 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 };