prostgles-server 2.0.229 → 2.0.230
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DBSchemaBuilder.d.ts.map +1 -1
- package/dist/DBSchemaBuilder.js +10 -1
- package/dist/DBSchemaBuilder.js.map +1 -1
- package/dist/TableConfig.d.ts +5 -1
- package/dist/TableConfig.d.ts.map +1 -1
- package/dist/TableConfig.js +8 -4
- package/dist/TableConfig.js.map +1 -1
- package/dist/validation.d.ts +50 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +135 -0
- package/dist/validation.js.map +1 -0
- package/lib/DBSchemaBuilder.d.ts.map +1 -1
- package/lib/DBSchemaBuilder.js +10 -1
- package/lib/DBSchemaBuilder.ts +10 -1
- package/lib/TableConfig.d.ts +5 -1
- package/lib/TableConfig.d.ts.map +1 -1
- package/lib/TableConfig.js +8 -4
- package/lib/TableConfig.ts +15 -5
- package/lib/validation.d.ts +50 -0
- package/lib/validation.d.ts.map +1 -0
- package/lib/validation.js +134 -0
- package/lib/validation.ts +157 -0
- package/package.json +1 -1
- package/tests/client/PID.txt +1 -1
- package/tests/isomorphic_queries.d.ts.map +1 -1
- package/tests/isomorphic_queries.js +25 -0
- package/tests/isomorphic_queries.ts +28 -1
- package/tests/server/DBoGenerated.d.ts +133 -114
- package/tests/server/index.js +13 -0
- package/tests/server/index.ts +13 -0
- package/tests/server/package-lock.json +1 -1
|
@@ -12,7 +12,7 @@ export type DBSchemaGenerated = {
|
|
|
12
12
|
update: true;
|
|
13
13
|
delete: true;
|
|
14
14
|
columns: {
|
|
15
|
-
"\"*\""?:
|
|
15
|
+
"\"*\""?: null | string;
|
|
16
16
|
id?: number
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -23,7 +23,7 @@ export type DBSchemaGenerated = {
|
|
|
23
23
|
update: true;
|
|
24
24
|
delete: true;
|
|
25
25
|
columns: {
|
|
26
|
-
"*"?:
|
|
26
|
+
"*"?: null | string;
|
|
27
27
|
id?: number
|
|
28
28
|
};
|
|
29
29
|
};
|
|
@@ -34,10 +34,10 @@ export type DBSchemaGenerated = {
|
|
|
34
34
|
update: true;
|
|
35
35
|
delete: true;
|
|
36
36
|
columns: {
|
|
37
|
-
added?:
|
|
38
|
-
id?: number
|
|
39
|
-
name: string
|
|
40
|
-
public?:
|
|
37
|
+
added?: null | Date;
|
|
38
|
+
id?: number;
|
|
39
|
+
name: string;
|
|
40
|
+
public?: null | string
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
geography_columns: {
|
|
@@ -47,13 +47,13 @@ export type DBSchemaGenerated = {
|
|
|
47
47
|
update: true;
|
|
48
48
|
delete: true;
|
|
49
49
|
columns: {
|
|
50
|
-
coord_dimension?:
|
|
51
|
-
f_geography_column?:
|
|
52
|
-
f_table_catalog?:
|
|
53
|
-
f_table_name?:
|
|
54
|
-
f_table_schema?:
|
|
55
|
-
srid?:
|
|
56
|
-
type?:
|
|
50
|
+
coord_dimension?: null | number;
|
|
51
|
+
f_geography_column?: null | string;
|
|
52
|
+
f_table_catalog?: null | string;
|
|
53
|
+
f_table_name?: null | string;
|
|
54
|
+
f_table_schema?: null | string;
|
|
55
|
+
srid?: null | number;
|
|
56
|
+
type?: null | string
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
geometry_columns: {
|
|
@@ -63,13 +63,13 @@ export type DBSchemaGenerated = {
|
|
|
63
63
|
update: true;
|
|
64
64
|
delete: true;
|
|
65
65
|
columns: {
|
|
66
|
-
coord_dimension?:
|
|
67
|
-
f_geometry_column?:
|
|
68
|
-
f_table_catalog?:
|
|
69
|
-
f_table_name?:
|
|
70
|
-
f_table_schema?:
|
|
71
|
-
srid?:
|
|
72
|
-
type?:
|
|
66
|
+
coord_dimension?: null | number;
|
|
67
|
+
f_geometry_column?: null | string;
|
|
68
|
+
f_table_catalog?: null | string;
|
|
69
|
+
f_table_name?: null | string;
|
|
70
|
+
f_table_schema?: null | string;
|
|
71
|
+
srid?: null | number;
|
|
72
|
+
type?: null | string
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
insert_rules: {
|
|
@@ -79,9 +79,9 @@ export type DBSchemaGenerated = {
|
|
|
79
79
|
update: true;
|
|
80
80
|
delete: true;
|
|
81
81
|
columns: {
|
|
82
|
-
added?:
|
|
83
|
-
id?: number
|
|
84
|
-
name?:
|
|
82
|
+
added?: null | Date;
|
|
83
|
+
id?: number;
|
|
84
|
+
name?: null | string
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
87
|
item_children: {
|
|
@@ -91,10 +91,10 @@ export type DBSchemaGenerated = {
|
|
|
91
91
|
update: true;
|
|
92
92
|
delete: true;
|
|
93
93
|
columns: {
|
|
94
|
-
id?: number
|
|
95
|
-
item_id?:
|
|
96
|
-
name?:
|
|
97
|
-
tst?:
|
|
94
|
+
id?: number;
|
|
95
|
+
item_id?: null | number;
|
|
96
|
+
name?: null | string;
|
|
97
|
+
tst?: null | Date
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
100
|
items: {
|
|
@@ -104,9 +104,9 @@ export type DBSchemaGenerated = {
|
|
|
104
104
|
update: true;
|
|
105
105
|
delete: true;
|
|
106
106
|
columns: {
|
|
107
|
-
h?: Array<string
|
|
108
|
-
id?: number
|
|
109
|
-
name?:
|
|
107
|
+
h?: null | Array<string>;
|
|
108
|
+
id?: number;
|
|
109
|
+
name?: null | string
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
112
|
items_multi: {
|
|
@@ -116,12 +116,12 @@ export type DBSchemaGenerated = {
|
|
|
116
116
|
update: true;
|
|
117
117
|
delete: true;
|
|
118
118
|
columns: {
|
|
119
|
-
id?: number
|
|
120
|
-
items0_id?:
|
|
121
|
-
items1_id?:
|
|
122
|
-
items2_id?:
|
|
123
|
-
items3_id?:
|
|
124
|
-
name?:
|
|
119
|
+
id?: number;
|
|
120
|
+
items0_id?: null | number;
|
|
121
|
+
items1_id?: null | number;
|
|
122
|
+
items2_id?: null | number;
|
|
123
|
+
items3_id?: null | number;
|
|
124
|
+
name?: null | string
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
127
|
items_with_media: {
|
|
@@ -131,8 +131,8 @@ export type DBSchemaGenerated = {
|
|
|
131
131
|
update: true;
|
|
132
132
|
delete: true;
|
|
133
133
|
columns: {
|
|
134
|
-
id?: number
|
|
135
|
-
name?:
|
|
134
|
+
id?: number;
|
|
135
|
+
name?: null | string
|
|
136
136
|
};
|
|
137
137
|
};
|
|
138
138
|
items_with_one_media: {
|
|
@@ -142,8 +142,8 @@ export type DBSchemaGenerated = {
|
|
|
142
142
|
update: true;
|
|
143
143
|
delete: true;
|
|
144
144
|
columns: {
|
|
145
|
-
id?: number
|
|
146
|
-
name?:
|
|
145
|
+
id?: number;
|
|
146
|
+
name?: null | string
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
149
|
items2: {
|
|
@@ -153,10 +153,10 @@ export type DBSchemaGenerated = {
|
|
|
153
153
|
update: true;
|
|
154
154
|
delete: true;
|
|
155
155
|
columns: {
|
|
156
|
-
hh?: Array<string
|
|
157
|
-
id?: number
|
|
158
|
-
items_id?:
|
|
159
|
-
name?:
|
|
156
|
+
hh?: null | Array<string>;
|
|
157
|
+
id?: number;
|
|
158
|
+
items_id?: null | number;
|
|
159
|
+
name?: null | string
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
162
|
items3: {
|
|
@@ -166,9 +166,9 @@ export type DBSchemaGenerated = {
|
|
|
166
166
|
update: true;
|
|
167
167
|
delete: true;
|
|
168
168
|
columns: {
|
|
169
|
-
h?: Array<string
|
|
170
|
-
id?: number
|
|
171
|
-
name?:
|
|
169
|
+
h?: null | Array<string>;
|
|
170
|
+
id?: number;
|
|
171
|
+
name?: null | string
|
|
172
172
|
};
|
|
173
173
|
};
|
|
174
174
|
items4: {
|
|
@@ -178,10 +178,10 @@ export type DBSchemaGenerated = {
|
|
|
178
178
|
update: true;
|
|
179
179
|
delete: true;
|
|
180
180
|
columns: {
|
|
181
|
-
added?:
|
|
182
|
-
id?: number
|
|
183
|
-
name: string
|
|
184
|
-
public?:
|
|
181
|
+
added?: null | Date;
|
|
182
|
+
id?: number;
|
|
183
|
+
name: string;
|
|
184
|
+
public?: null | string
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
187
|
items4_pub: {
|
|
@@ -191,10 +191,10 @@ export type DBSchemaGenerated = {
|
|
|
191
191
|
update: true;
|
|
192
192
|
delete: true;
|
|
193
193
|
columns: {
|
|
194
|
-
added?:
|
|
195
|
-
id?: number
|
|
196
|
-
name: string
|
|
197
|
-
public?:
|
|
194
|
+
added?: null | Date;
|
|
195
|
+
id?: number;
|
|
196
|
+
name: string;
|
|
197
|
+
public?: null | string
|
|
198
198
|
};
|
|
199
199
|
};
|
|
200
200
|
items4a: {
|
|
@@ -204,10 +204,10 @@ export type DBSchemaGenerated = {
|
|
|
204
204
|
update: true;
|
|
205
205
|
delete: true;
|
|
206
206
|
columns: {
|
|
207
|
-
id?: number
|
|
208
|
-
items_id?:
|
|
209
|
-
items2_id?:
|
|
210
|
-
name?:
|
|
207
|
+
id?: number;
|
|
208
|
+
items_id?: null | number;
|
|
209
|
+
items2_id?: null | number;
|
|
210
|
+
name?: null | string
|
|
211
211
|
};
|
|
212
212
|
};
|
|
213
213
|
lookup_col1: {
|
|
@@ -227,8 +227,8 @@ export type DBSchemaGenerated = {
|
|
|
227
227
|
update: true;
|
|
228
228
|
delete: true;
|
|
229
229
|
columns: {
|
|
230
|
-
en?:
|
|
231
|
-
fr?:
|
|
230
|
+
en?: null | string;
|
|
231
|
+
fr?: null | string;
|
|
232
232
|
id: string
|
|
233
233
|
};
|
|
234
234
|
};
|
|
@@ -239,19 +239,19 @@ export type DBSchemaGenerated = {
|
|
|
239
239
|
update: true;
|
|
240
240
|
delete: true;
|
|
241
241
|
columns: {
|
|
242
|
-
content_length?: number
|
|
243
|
-
content_type: string
|
|
244
|
-
deleted?:
|
|
245
|
-
deleted_from_storage?:
|
|
246
|
-
description?:
|
|
247
|
-
etag?:
|
|
248
|
-
extension: string
|
|
249
|
-
id?: string
|
|
250
|
-
name: string
|
|
251
|
-
original_name: string
|
|
252
|
-
s3_url?:
|
|
253
|
-
signed_url?:
|
|
254
|
-
signed_url_expires?:
|
|
242
|
+
content_length?: number;
|
|
243
|
+
content_type: string;
|
|
244
|
+
deleted?: null | number;
|
|
245
|
+
deleted_from_storage?: null | number;
|
|
246
|
+
description?: null | string;
|
|
247
|
+
etag?: null | string;
|
|
248
|
+
extension: string;
|
|
249
|
+
id?: string;
|
|
250
|
+
name: string;
|
|
251
|
+
original_name: string;
|
|
252
|
+
s3_url?: null | string;
|
|
253
|
+
signed_url?: null | string;
|
|
254
|
+
signed_url_expires?: null | number;
|
|
255
255
|
url: string
|
|
256
256
|
};
|
|
257
257
|
};
|
|
@@ -262,8 +262,8 @@ export type DBSchemaGenerated = {
|
|
|
262
262
|
update: true;
|
|
263
263
|
delete: true;
|
|
264
264
|
columns: {
|
|
265
|
-
id?: number
|
|
266
|
-
obj?:
|
|
265
|
+
id?: number;
|
|
266
|
+
obj?: null | any
|
|
267
267
|
};
|
|
268
268
|
};
|
|
269
269
|
planes: {
|
|
@@ -273,11 +273,11 @@ export type DBSchemaGenerated = {
|
|
|
273
273
|
update: true;
|
|
274
274
|
delete: true;
|
|
275
275
|
columns: {
|
|
276
|
-
flight_number?:
|
|
277
|
-
id?: number
|
|
278
|
-
last_updated: number
|
|
279
|
-
x?:
|
|
280
|
-
y?:
|
|
276
|
+
flight_number?: null | string;
|
|
277
|
+
id?: number;
|
|
278
|
+
last_updated: number;
|
|
279
|
+
x?: null | number;
|
|
280
|
+
y?: null | number
|
|
281
281
|
};
|
|
282
282
|
};
|
|
283
283
|
prostgles_lookup_media_items_with_media: {
|
|
@@ -287,7 +287,7 @@ export type DBSchemaGenerated = {
|
|
|
287
287
|
update: true;
|
|
288
288
|
delete: true;
|
|
289
289
|
columns: {
|
|
290
|
-
foreign_id?:
|
|
290
|
+
foreign_id?: null | number;
|
|
291
291
|
media_id: string
|
|
292
292
|
};
|
|
293
293
|
};
|
|
@@ -298,7 +298,7 @@ export type DBSchemaGenerated = {
|
|
|
298
298
|
update: true;
|
|
299
299
|
delete: true;
|
|
300
300
|
columns: {
|
|
301
|
-
foreign_id: number
|
|
301
|
+
foreign_id: number;
|
|
302
302
|
media_id: string
|
|
303
303
|
};
|
|
304
304
|
};
|
|
@@ -309,8 +309,8 @@ export type DBSchemaGenerated = {
|
|
|
309
309
|
update: true;
|
|
310
310
|
delete: true;
|
|
311
311
|
columns: {
|
|
312
|
-
geog?:
|
|
313
|
-
geom?:
|
|
312
|
+
geog?: null | any;
|
|
313
|
+
geom?: null | any;
|
|
314
314
|
id?: string
|
|
315
315
|
};
|
|
316
316
|
};
|
|
@@ -321,11 +321,30 @@ export type DBSchemaGenerated = {
|
|
|
321
321
|
update: true;
|
|
322
322
|
delete: true;
|
|
323
323
|
columns: {
|
|
324
|
-
auth_name?:
|
|
325
|
-
auth_srid?:
|
|
326
|
-
proj4text?:
|
|
327
|
-
srid: number
|
|
328
|
-
srtext?:
|
|
324
|
+
auth_name?: null | string;
|
|
325
|
+
auth_srid?: null | number;
|
|
326
|
+
proj4text?: null | string;
|
|
327
|
+
srid: number;
|
|
328
|
+
srtext?: null | string
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
tjson: {
|
|
332
|
+
is_view: false;
|
|
333
|
+
select: true;
|
|
334
|
+
insert: true;
|
|
335
|
+
update: true;
|
|
336
|
+
delete: true;
|
|
337
|
+
columns: {
|
|
338
|
+
json: {
|
|
339
|
+
a: boolean;
|
|
340
|
+
arr: 1 | 2 | 3;
|
|
341
|
+
arr2: number[];
|
|
342
|
+
o?: {
|
|
343
|
+
o1: number
|
|
344
|
+
} | {
|
|
345
|
+
o2: boolean
|
|
346
|
+
}
|
|
347
|
+
} ;
|
|
329
348
|
};
|
|
330
349
|
};
|
|
331
350
|
tr1: {
|
|
@@ -335,8 +354,8 @@ export type DBSchemaGenerated = {
|
|
|
335
354
|
update: true;
|
|
336
355
|
delete: true;
|
|
337
356
|
columns: {
|
|
338
|
-
id?: number
|
|
339
|
-
t1?:
|
|
357
|
+
id?: number;
|
|
358
|
+
t1?: null | string
|
|
340
359
|
};
|
|
341
360
|
};
|
|
342
361
|
tr2: {
|
|
@@ -346,10 +365,10 @@ export type DBSchemaGenerated = {
|
|
|
346
365
|
update: true;
|
|
347
366
|
delete: true;
|
|
348
367
|
columns: {
|
|
349
|
-
id?: number
|
|
350
|
-
t1?:
|
|
351
|
-
t2?:
|
|
352
|
-
tr1_id?:
|
|
368
|
+
id?: number;
|
|
369
|
+
t1?: null | string;
|
|
370
|
+
t2?: null | string;
|
|
371
|
+
tr1_id?: null | number
|
|
353
372
|
};
|
|
354
373
|
};
|
|
355
374
|
usr: {
|
|
@@ -359,12 +378,12 @@ export type DBSchemaGenerated = {
|
|
|
359
378
|
update: true;
|
|
360
379
|
delete: true;
|
|
361
380
|
columns: {
|
|
362
|
-
added?:
|
|
363
|
-
age?:
|
|
364
|
-
id?: number
|
|
365
|
-
is_active?:
|
|
366
|
-
msg?:
|
|
367
|
-
status?:
|
|
381
|
+
added?: null | Date;
|
|
382
|
+
age?: null | number;
|
|
383
|
+
id?: number;
|
|
384
|
+
is_active?: null | boolean;
|
|
385
|
+
msg?: null | string;
|
|
386
|
+
status?: null | string
|
|
368
387
|
};
|
|
369
388
|
};
|
|
370
389
|
uuid_text: {
|
|
@@ -374,10 +393,10 @@ export type DBSchemaGenerated = {
|
|
|
374
393
|
update: true;
|
|
375
394
|
delete: true;
|
|
376
395
|
columns: {
|
|
377
|
-
col1?:
|
|
378
|
-
col2?:
|
|
379
|
-
id?: string
|
|
380
|
-
name?:
|
|
396
|
+
col1?: null | string;
|
|
397
|
+
col2?: null | string;
|
|
398
|
+
id?: string;
|
|
399
|
+
name?: null | string
|
|
381
400
|
};
|
|
382
401
|
};
|
|
383
402
|
v_items: {
|
|
@@ -387,8 +406,8 @@ export type DBSchemaGenerated = {
|
|
|
387
406
|
update: true;
|
|
388
407
|
delete: true;
|
|
389
408
|
columns: {
|
|
390
|
-
id?:
|
|
391
|
-
name?:
|
|
409
|
+
id?: null | number;
|
|
410
|
+
name?: null | string
|
|
392
411
|
};
|
|
393
412
|
};
|
|
394
413
|
various: {
|
|
@@ -398,12 +417,12 @@ export type DBSchemaGenerated = {
|
|
|
398
417
|
update: true;
|
|
399
418
|
delete: true;
|
|
400
419
|
columns: {
|
|
401
|
-
added?:
|
|
402
|
-
h?: Array<string
|
|
403
|
-
id?: number
|
|
404
|
-
jsn?:
|
|
405
|
-
name?:
|
|
406
|
-
tsv?:
|
|
420
|
+
added?: null | Date;
|
|
421
|
+
h?: null | Array<string>;
|
|
422
|
+
id?: number;
|
|
423
|
+
jsn?: null | any;
|
|
424
|
+
name?: null | string;
|
|
425
|
+
tsv?: null | any
|
|
407
426
|
};
|
|
408
427
|
};
|
|
409
428
|
|
package/tests/server/index.js
CHANGED
|
@@ -64,6 +64,18 @@ function dd() {
|
|
|
64
64
|
t2: { label: { en: "en_t2" } },
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
+
tjson: {
|
|
68
|
+
dropIfExists: true,
|
|
69
|
+
columns: {
|
|
70
|
+
json: { jsonSchema: {
|
|
71
|
+
a: { type: "boolean" },
|
|
72
|
+
arr: { oneOf: ["1", "2", "3"] },
|
|
73
|
+
arr2: { type: "integer[]" },
|
|
74
|
+
o: { oneOfTypes: [{ o1: { type: "integer" } }, { o2: { type: "boolean" } }], optional: true },
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
67
79
|
lookup_col1: {
|
|
68
80
|
dropIfExists: true,
|
|
69
81
|
isLookupTable: {
|
|
@@ -205,6 +217,7 @@ function dd() {
|
|
|
205
217
|
items2: "*",
|
|
206
218
|
items3: "*",
|
|
207
219
|
items4a: "*",
|
|
220
|
+
tjson: "*",
|
|
208
221
|
// items_with_media_cols: "*",
|
|
209
222
|
items_multi: "*",
|
|
210
223
|
v_items: "*",
|
package/tests/server/index.ts
CHANGED
|
@@ -85,6 +85,18 @@ function dd(){
|
|
|
85
85
|
t2: { label: { en: "en_t2" } },
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
+
tjson: {
|
|
89
|
+
dropIfExists: true,
|
|
90
|
+
columns: {
|
|
91
|
+
json: { jsonSchema: {
|
|
92
|
+
a: { type: "boolean" },
|
|
93
|
+
arr: { oneOf: ["1", "2", "3"] },
|
|
94
|
+
arr2: { type: "integer[]" },
|
|
95
|
+
o: { oneOfTypes: [{ o1: { type: "integer" } }, { o2: { type: "boolean" } }], optional: true },
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
88
100
|
lookup_col1: {
|
|
89
101
|
dropIfExists: true,
|
|
90
102
|
isLookupTable: {
|
|
@@ -232,6 +244,7 @@ function dd(){
|
|
|
232
244
|
items2: "*",
|
|
233
245
|
items3: "*",
|
|
234
246
|
items4a: "*",
|
|
247
|
+
tjson: "*",
|
|
235
248
|
// items_with_media_cols: "*",
|
|
236
249
|
items_multi: "*",
|
|
237
250
|
v_items: "*",
|