@phystack/ts-schema 4.3.40-dev
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/CHANGELOG.md +992 -0
- package/cli.js +150 -0
- package/convert.js +62 -0
- package/package.json +21 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,992 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## 4.1.31 (2025-01-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 4.1.30 (2025-01-14)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 4.1.29 (2025-01-14)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 4.1.28 (2024-12-19)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 4.1.27 (2024-10-03)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 4.1.26 (2024-10-03)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 4.1.25 (2024-09-06)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 4.1.24 (2024-09-06)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 4.1.22 (2024-08-25)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
* track active downloads ([75c0878](https://github.com/ombori/gridapp/commit/75c087891d0c6f23abfa79f9dfa42311d3616eb5))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## 4.1.21 (2024-08-25)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Bug Fixes
|
|
85
|
+
|
|
86
|
+
* attempt at new caching at app level ([7a34054](https://github.com/ombori/gridapp/commit/7a34054a04b4c6ab07d664582c14bc5e638956fe))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## 4.1.20 (2024-08-25)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Bug Fixes
|
|
96
|
+
|
|
97
|
+
* es ([9fc1caa](https://github.com/ombori/gridapp/commit/9fc1caa7b63c25d841cdb63dc6adbb9c6704ee53))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## 4.1.19 (2024-08-25)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
* revert settings mess ([a108198](https://github.com/ombori/gridapp/commit/a108198a394f49634d082b37ff53391f8542417f))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 4.1.18 (2024-08-25)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Bug Fixes
|
|
118
|
+
|
|
119
|
+
* remove the blobs ([155d625](https://github.com/ombori/gridapp/commit/155d6250c8c3b4c7a630b08b3d29a2f06814ec24))
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
## 4.1.17 (2024-08-25)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
### Bug Fixes
|
|
129
|
+
|
|
130
|
+
* attempt at unfiltered settings 3 ([a76bfc3](https://github.com/ombori/gridapp/commit/a76bfc3c974643291296853d60874196fc791980))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## 4.1.16 (2024-08-25)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Bug Fixes
|
|
140
|
+
|
|
141
|
+
* attempt at unfiltered settings 2 ([d073d75](https://github.com/ombori/gridapp/commit/d073d75714bff8559167fb0dd5fc5b9ae881f0d1))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## 4.1.15 (2024-08-25)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
|
|
152
|
+
* attempt at unfiltered settings ([843a0e1](https://github.com/ombori/gridapp/commit/843a0e102940ccae2356857a55f819da38f3528e))
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## 4.1.14 (2024-08-25)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Bug Fixes
|
|
162
|
+
|
|
163
|
+
* update ([e68dc51](https://github.com/ombori/gridapp/commit/e68dc51a92207cc1be4222543a7288fb5a17e86c))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
## 4.1.13 (2024-08-25)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Bug Fixes
|
|
173
|
+
|
|
174
|
+
* include hash ([e1c87e9](https://github.com/ombori/gridapp/commit/e1c87e9e6d7a2a3b5fed45861c5f8f5b7fda5d16))
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
## 4.1.12 (2024-08-25)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### Bug Fixes
|
|
184
|
+
|
|
185
|
+
* test ([f0ba5ae](https://github.com/ombori/gridapp/commit/f0ba5aeff3d29224bb376342ef4646c927d17ee4))
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
## 4.1.11 (2024-08-25)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Bug Fixes
|
|
195
|
+
|
|
196
|
+
* product fetch progress ([af6f143](https://github.com/ombori/gridapp/commit/af6f1433e21b7378c9a8465c4fd188fb056ad36f))
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## 4.1.10 (2024-08-25)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
### Bug Fixes
|
|
206
|
+
|
|
207
|
+
* better total progress 2 ([284d21e](https://github.com/ombori/gridapp/commit/284d21eb8ea53883ee49946ba6040a64d55f7147))
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
## 4.1.9 (2024-08-25)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
### Bug Fixes
|
|
217
|
+
|
|
218
|
+
* better total progress ([17d3fc4](https://github.com/ombori/gridapp/commit/17d3fc416d8b8b07a46ac7c772cef10da340dd63))
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
## 4.1.8 (2024-08-25)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
### Bug Fixes
|
|
228
|
+
|
|
229
|
+
* better value 2 ([c588acc](https://github.com/ombori/gridapp/commit/c588acc6b6b264ae44e46b8b5801dc73dcac3ae7))
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
## 4.1.7 (2024-08-25)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### Bug Fixes
|
|
239
|
+
|
|
240
|
+
* better value ([a5187af](https://github.com/ombori/gridapp/commit/a5187af09f02da1dd48099dfc9503dd1023733b3))
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
## 4.1.6 (2024-08-25)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
### Bug Fixes
|
|
250
|
+
|
|
251
|
+
* better ([2e88234](https://github.com/ombori/gridapp/commit/2e882348c9b741d0a5607ea8dc8cb5d92cb08455))
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
## 4.1.5 (2024-08-25)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
### Bug Fixes
|
|
261
|
+
|
|
262
|
+
* yes 2 ([e13193e](https://github.com/ombori/gridapp/commit/e13193efd61fd460e12177843b19c68f029a88b3))
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
## 4.1.4 (2024-08-25)
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
### Bug Fixes
|
|
272
|
+
|
|
273
|
+
* handle invalid manifest response ([7b61a7d](https://github.com/ombori/gridapp/commit/7b61a7d026ecdb2e1197815659762b0823d27c3f))
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
## 4.1.3 (2024-08-25)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
### Bug Fixes
|
|
283
|
+
|
|
284
|
+
* fuckup, need to keep container for the schema ([4f31201](https://github.com/ombori/gridapp/commit/4f31201958aece468428d785dcc5258f9fdd4354))
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
## 4.1.2 (2024-08-25)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
### Bug Fixes
|
|
294
|
+
|
|
295
|
+
* fixes ([ece5813](https://github.com/ombori/gridapp/commit/ece5813ca8b9aef4c8f4a7354a2b591ba6936607))
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
## 4.1.1 (2024-08-25)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
### Bug Fixes
|
|
305
|
+
|
|
306
|
+
* settings read from right localstorage ([9dcf45c](https://github.com/ombori/gridapp/commit/9dcf45cfb5016c4a5872f759914b928341130fc9))
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
# 4.1.0 (2024-08-25)
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
### Features
|
|
316
|
+
|
|
317
|
+
* interesting new boot ([787d1bf](https://github.com/ombori/gridapp/commit/787d1bfad9837a55fab01b1f856648cd7b58ce88))
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
## 4.0.6 (2024-08-25)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
### Bug Fixes
|
|
327
|
+
|
|
328
|
+
* logging ([636df86](https://github.com/ombori/gridapp/commit/636df865515514734f5a0135803eccab87c695a7))
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
## 4.0.5 (2024-08-25)
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
### Bug Fixes
|
|
338
|
+
|
|
339
|
+
* logging ([c7726c6](https://github.com/ombori/gridapp/commit/c7726c663608f9c15e54ea5d3bd4b2316c4fa7d5))
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
## 4.0.4 (2024-08-25)
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
### Bug Fixes
|
|
349
|
+
|
|
350
|
+
* logging ([4934668](https://github.com/ombori/gridapp/commit/4934668dead37809297a0a4a78221711c8f4d982))
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
## 4.0.3 (2024-08-24)
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
### Bug Fixes
|
|
360
|
+
|
|
361
|
+
* es ([da88e20](https://github.com/ombori/gridapp/commit/da88e209c7bc5698d385b062aa8f5601f22944de))
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
## 4.0.2 (2024-08-24)
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
### Bug Fixes
|
|
371
|
+
|
|
372
|
+
* logging ([a4b6674](https://github.com/ombori/gridapp/commit/a4b6674dc83eb7bb2d85b15c260d94fdf3fa0907))
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
## 4.0.1 (2024-08-24)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
### Bug Fixes
|
|
382
|
+
|
|
383
|
+
* deps ([b4f1925](https://github.com/ombori/gridapp/commit/b4f1925d08d3977d4d7dfdacddfad3696f0f8f65))
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
## 3.92.13 (2024-05-30)
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
### Bug Fixes
|
|
393
|
+
|
|
394
|
+
* refactored ga-messaging ([0f1b527](https://github.com/ombori/gridapp/commit/0f1b527e66150611fd31f4cea72f10ee56503198))
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
## 3.92.12 (2024-05-29)
|
|
401
|
+
|
|
402
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
## 3.92.11 (2024-05-26)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
### Bug Fixes
|
|
412
|
+
|
|
413
|
+
* scanner ([0550883](https://github.com/ombori/gridapp/commit/05508835d802344500028f297f4e0c3f25411aaa))
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
## 3.92.10 (2024-05-25)
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
### Bug Fixes
|
|
423
|
+
|
|
424
|
+
* reconnect ([5b8adac](https://github.com/ombori/gridapp/commit/5b8adacae1041fde922222da46b141e9eaee456f))
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
## 3.92.9 (2024-05-25)
|
|
431
|
+
|
|
432
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
## 3.92.8 (2024-05-24)
|
|
439
|
+
|
|
440
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
## 3.92.7 (2024-05-24)
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
### Bug Fixes
|
|
450
|
+
|
|
451
|
+
* ver ([a6b8c30](https://github.com/ombori/gridapp/commit/a6b8c307d841d1cd4f0574b754b29d06724002dd))
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
## 3.92.6 (2024-05-24)
|
|
458
|
+
|
|
459
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
## 3.92.5 (2024-05-20)
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
### Bug Fixes
|
|
469
|
+
|
|
470
|
+
* exit if it can not connect to phyedged timeout 2 ([ad402af](https://github.com/ombori/gridapp/commit/ad402af91d8a75f56578dbe9ad41b98e09ddbb3a))
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
## 3.92.4 (2024-05-20)
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
### Bug Fixes
|
|
480
|
+
|
|
481
|
+
* exit if it can not connect to phyedged timeout ([c45ca4a](https://github.com/ombori/gridapp/commit/c45ca4ae63ceba6773ef8d301db5e51f74fbda80))
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
## 3.92.3 (2024-05-20)
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
### Bug Fixes
|
|
491
|
+
|
|
492
|
+
* throw an error it connection fails ([5f61fc8](https://github.com/ombori/gridapp/commit/5f61fc8c4546a8c202128a023951288fc67e1bb4))
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
## 3.92.2 (2024-05-16)
|
|
499
|
+
|
|
500
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
## 3.92.1 (2024-05-16)
|
|
507
|
+
|
|
508
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
# 3.92.0 (2024-05-15)
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
### Features
|
|
518
|
+
|
|
519
|
+
* data matrix data source type ([bc47310](https://github.com/ombori/gridapp/commit/bc47310fec84b9fcf7b22a4d5261f7053f8877bd))
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
## 3.91.13 (2024-05-14)
|
|
526
|
+
|
|
527
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
## 3.91.12 (2024-05-14)
|
|
534
|
+
|
|
535
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
## 3.91.11 (2024-05-14)
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
### Bug Fixes
|
|
545
|
+
|
|
546
|
+
* new docker buildx local tag 2 ([4b63c84](https://github.com/ombori/gridapp/commit/4b63c8408ddb0264ced7a026f2658547f4fb2bba))
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
## 3.91.10 (2024-05-14)
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
### Bug Fixes
|
|
556
|
+
|
|
557
|
+
* new docker buildx local tag ([084f1a9](https://github.com/ombori/gridapp/commit/084f1a923ae16cd978d7a3a84036cf81ca07748a))
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
## 3.91.9 (2024-05-12)
|
|
564
|
+
|
|
565
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
## 3.91.8 (2024-05-12)
|
|
572
|
+
|
|
573
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
## 3.91.7 (2024-05-11)
|
|
580
|
+
|
|
581
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
## 3.91.6 (2024-05-03)
|
|
588
|
+
|
|
589
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
## 3.91.5 (2024-04-16)
|
|
596
|
+
|
|
597
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
## 3.91.4 (2024-04-15)
|
|
604
|
+
|
|
605
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
## 3.91.3 (2024-04-15)
|
|
612
|
+
|
|
613
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
## 3.91.2 (2024-04-15)
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
### Reverts
|
|
623
|
+
|
|
624
|
+
* format changes ([ac616fe](https://github.com/ombori/gridapp/commit/ac616feeaf79f3a57123cad0c87868b17880c635))
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
## 3.91.1 (2024-04-08)
|
|
631
|
+
|
|
632
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
# 3.91.0 (2024-04-08)
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
### Features
|
|
642
|
+
|
|
643
|
+
* override ai assistants ([1519ed6](https://github.com/ombori/gridapp/commit/1519ed6d3fdfafdc99a521c91e9efd1348dc976b))
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
## 3.90.12 (2024-03-14)
|
|
650
|
+
|
|
651
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
|
|
657
|
+
## 3.90.11 (2024-03-14)
|
|
658
|
+
|
|
659
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
## 3.90.10 (2024-03-11)
|
|
666
|
+
|
|
667
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
## 3.90.9 (2024-03-11)
|
|
674
|
+
|
|
675
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
## 3.90.8 (2024-03-11)
|
|
682
|
+
|
|
683
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
## 3.90.7 (2024-03-11)
|
|
690
|
+
|
|
691
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
## 3.90.6 (2024-03-08)
|
|
698
|
+
|
|
699
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
## 3.90.5 (2024-03-07)
|
|
706
|
+
|
|
707
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
## 3.90.3 (2024-03-07)
|
|
714
|
+
|
|
715
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
## 3.90.2 (2024-03-07)
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
### Bug Fixes
|
|
725
|
+
|
|
726
|
+
* update yarn.lock ([c68966c](https://github.com/ombori/gridapp/commit/c68966c4aaa68e9e217716723db0e3ed09d559f2))
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
## 3.90.1 (2024-03-06)
|
|
733
|
+
|
|
734
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
## [3.53.1](https://github.com/ombori/gridapp/compare/v3.53.0...v3.53.1) (2023-07-11)
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
### Bug Fixes
|
|
744
|
+
|
|
745
|
+
* typo ([6035052](https://github.com/ombori/gridapp/commit/6035052487fd6d4532fa6d5b0c7e9afc86dafb61))
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
# [3.53.0](https://github.com/ombori/gridapp/compare/v3.52.0...v3.53.0) (2023-07-11)
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
### Features
|
|
755
|
+
|
|
756
|
+
* support ui options for ts schema ([ce80c5a](https://github.com/ombori/gridapp/commit/ce80c5ada56152546d15cac8e2d84b73b8496c25))
|
|
757
|
+
* ui options support on ts-schema ([3f0c80a](https://github.com/ombori/gridapp/commit/3f0c80ac9dc515bab0e68aa244d249ccbb1efe89))
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
# [3.23.0](https://github.com/ombori/gridapp/compare/v3.22.2...v3.23.0) (2023-02-22)
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
### Features
|
|
767
|
+
|
|
768
|
+
* roles and settingsOverridingRule in ts-schema ([cf88387](https://github.com/ombori/gridapp/commit/cf88387a9573e7671a274e9aac1c622055ea3fde))
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
## [2.231.1](https://github.com/ombori/gridapp/compare/v2.231.0...v2.231.1) (2022-10-11)
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
### Bug Fixes
|
|
778
|
+
|
|
779
|
+
* schema dollar sign ([2762e23](https://github.com/ombori/gridapp/commit/2762e2310f3a44af5fdfceadc5d06150c057145c))
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
# [2.92.0](https://github.com/ombori/gridapp/compare/v2.91.9...v2.92.0) (2021-10-01)
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
### Features
|
|
789
|
+
|
|
790
|
+
* ts-schema support for widget and help ([4ed027c](https://github.com/ombori/gridapp/commit/4ed027c6e7825f3b82559bd4419f7ea6a6b07ed1))
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
## [2.82.17](https://github.com/ombori/gridapp/compare/v2.82.16...v2.82.17) (2021-08-13)
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
### Bug Fixes
|
|
800
|
+
|
|
801
|
+
* builtin types in settings ([f970d2e](https://github.com/ombori/gridapp/commit/f970d2e16ebd3e834dad81e10267daa22e44c188))
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
## [2.65.5](https://github.com/ombori/gridapp/compare/v2.65.4...v2.65.5) (2021-06-09)
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
### Bug Fixes
|
|
811
|
+
|
|
812
|
+
* ts-schema version bump ([9a6d42a](https://github.com/ombori/gridapp/commit/9a6d42a29d7bda45f6b381d4fcd22c599f54a473))
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
## [2.39.3](https://github.com/ombori/gridapp/compare/v2.39.2...v2.39.3) (2021-03-25)
|
|
819
|
+
|
|
820
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
|
|
825
|
+
|
|
826
|
+
## [2.39.2](https://github.com/ombori/gridapp/compare/v2.39.1...v2.39.2) (2021-03-25)
|
|
827
|
+
|
|
828
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
## [2.39.1](https://github.com/ombori/gridapp/compare/v2.39.0...v2.39.1) (2021-03-23)
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
### Bug Fixes
|
|
838
|
+
|
|
839
|
+
* meta-schema building when ts-schema is an empty object ([ff14c19](https://github.com/ombori/gridapp/commit/ff14c19e6e4740abb6fca8fdda4ce1e915b7e8f6))
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
## [2.19.2](https://github.com/ombori/gridapp/compare/v2.19.1...v2.19.2) (2020-12-01)
|
|
846
|
+
|
|
847
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
|
|
853
|
+
## [2.19.1](https://github.com/ombori/gridapp/compare/v2.19.0...v2.19.1) (2020-12-01)
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
### Bug Fixes
|
|
857
|
+
|
|
858
|
+
* empty objects handling in ts-schema ([8dad475](https://github.com/ombori/gridapp/commit/8dad475bc0fa0542d060e5e2b9b7be2f5f093baa))
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
## [2.14.3](https://github.com/ombori/gridapp/compare/v2.14.2...v2.14.3) (2020-10-05)
|
|
865
|
+
|
|
866
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
## [2.14.2](https://github.com/ombori/gridapp/compare/v2.14.1...v2.14.2) (2020-10-05)
|
|
873
|
+
|
|
874
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
## [2.14.1](https://github.com/ombori/gridapp/compare/v2.14.0...v2.14.1) (2020-10-05)
|
|
881
|
+
|
|
882
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
# [2.14.0](https://github.com/ombori/gridapp/compare/v2.13.8...v2.14.0) (2020-09-30)
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
### Bug Fixes
|
|
892
|
+
|
|
893
|
+
* faces in app settings for door ([08f5ac9](https://github.com/ombori/gridapp/commit/08f5ac97e5d2ba930740417c7de8d938a9a4597d))
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
### Features
|
|
897
|
+
|
|
898
|
+
* meta-schema generator ([b1094f9](https://github.com/ombori/gridapp/commit/b1094f91d2a8212ca5f0692e97ddcfda1f92fdf4))
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
## [1.7.6](https://github.com/ombori/gridapp/compare/v1.7.5...v1.7.6) (2020-07-24)
|
|
905
|
+
|
|
906
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
## [1.5.12](https://github.com/ombori/gridapp/compare/v1.5.11...v1.5.12) (2020-07-16)
|
|
913
|
+
|
|
914
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
## [1.5.11](https://github.com/ombori/gridapp/compare/v1.5.10...v1.5.11) (2020-07-16)
|
|
921
|
+
|
|
922
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
## [1.5.10](https://github.com/ombori/gridapp/compare/v1.5.9...v1.5.10) (2020-07-16)
|
|
929
|
+
|
|
930
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
## [1.5.9](https://github.com/ombori/gridapp/compare/v1.5.8...v1.5.9) (2020-07-16)
|
|
937
|
+
|
|
938
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
## [1.5.8](https://github.com/ombori/gridapp/compare/v1.5.7...v1.5.8) (2020-07-16)
|
|
945
|
+
|
|
946
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
## [1.5.7](https://github.com/ombori/gridapp/compare/v1.5.6...v1.5.7) (2020-07-16)
|
|
953
|
+
|
|
954
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
## [1.5.6](https://github.com/ombori/gridapp/compare/v1.5.5...v1.5.6) (2020-07-16)
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
### Bug Fixes
|
|
964
|
+
|
|
965
|
+
* schema for queue ([66a36bf](https://github.com/ombori/gridapp/commit/66a36bf4b8fc80ce37a0996fbe29d113b1f3e140))
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
## [1.5.5](https://github.com/ombori/gridapp/compare/v1.5.4...v1.5.5) (2020-07-16)
|
|
972
|
+
|
|
973
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
## [1.5.4](https://github.com/ombori/gridapp/compare/v1.5.3...v1.5.4) (2020-07-16)
|
|
980
|
+
|
|
981
|
+
**Note:** Version bump only for package @ombori/ts-schema
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
## [1.5.3](https://github.com/ombori/gridapp/compare/v1.5.2...v1.5.3) (2020-07-16)
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
### Bug Fixes
|
|
991
|
+
|
|
992
|
+
* schema for queue ([d4d563f](https://github.com/ombori/gridapp/commit/d4d563f9b2be413851f1af19951c8ceb2171e17b))
|
package/cli.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const tsj = require('ts-json-schema-generator');
|
|
4
|
+
const convert = require('./convert');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
//
|
|
8
|
+
// Extract certain custom fields like `ui`, `uiOptions`, `widget`, etc.
|
|
9
|
+
// and move them into a "meta-schema". We keep these helper functions
|
|
10
|
+
// from your original code in case you still want them.
|
|
11
|
+
//
|
|
12
|
+
function getRichMetaSchema(schema) {
|
|
13
|
+
const metaSchema = {};
|
|
14
|
+
|
|
15
|
+
if (schema.ui) {
|
|
16
|
+
const { ui } = schema;
|
|
17
|
+
delete schema.ui;
|
|
18
|
+
metaSchema['ui:field'] = ui;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (schema.uiOptions) {
|
|
22
|
+
const { uiOptions } = schema;
|
|
23
|
+
delete schema.uiOptions;
|
|
24
|
+
try {
|
|
25
|
+
metaSchema['ui:options'] =
|
|
26
|
+
typeof uiOptions === 'string' ? eval('(' + uiOptions + ')') : uiOptions;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
metaSchema['ui:options'] = {};
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (schema.widget) {
|
|
33
|
+
const { widget } = schema;
|
|
34
|
+
delete schema.widget;
|
|
35
|
+
metaSchema['ui:widget'] = widget;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (schema.help) {
|
|
39
|
+
const { help } = schema;
|
|
40
|
+
delete schema.help;
|
|
41
|
+
metaSchema['ui:help'] = help;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (schema.roles) {
|
|
45
|
+
const { roles } = schema;
|
|
46
|
+
delete schema.roles;
|
|
47
|
+
metaSchema['roles'] = roles;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (schema.settingsOverridingRule) {
|
|
51
|
+
const { settingsOverridingRule } = schema;
|
|
52
|
+
delete schema.settingsOverridingRule;
|
|
53
|
+
metaSchema['settingsOverridingRule'] = settingsOverridingRule;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return metaSchema;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function extractMeta(schema, root) {
|
|
60
|
+
if (schema.$ref) {
|
|
61
|
+
const ref = schema.$ref.split('/');
|
|
62
|
+
if (ref.shift() !== '#') throw new Error('Ref must start with #');
|
|
63
|
+
|
|
64
|
+
const obj = ref.reduce((prev, item) => prev[item], root);
|
|
65
|
+
const copy = JSON.parse(JSON.stringify(obj)); // create a deep copy
|
|
66
|
+
return extractMeta(copy, root);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (schema.type === 'object' && schema.properties) {
|
|
70
|
+
return Object.keys(schema.properties).reduce((res, field) => {
|
|
71
|
+
const meta = extractMeta(schema.properties[field], root);
|
|
72
|
+
if (meta !== null) {
|
|
73
|
+
res[field] = meta;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const richMetaSchema = getRichMetaSchema(schema);
|
|
77
|
+
|
|
78
|
+
return { ...res, ...richMetaSchema };
|
|
79
|
+
}, {});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Support for non-object input meta-schema
|
|
83
|
+
if (schema.type === 'array') {
|
|
84
|
+
return {
|
|
85
|
+
items: extractMeta(schema.items, root),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const richMetaSchema = getRichMetaSchema(schema);
|
|
90
|
+
return richMetaSchema;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function main(argv) {
|
|
94
|
+
argv.shift(); // node
|
|
95
|
+
argv.shift(); // cli.js
|
|
96
|
+
|
|
97
|
+
if (argv.length < 1) {
|
|
98
|
+
console.error('Usage: ts-schema <schema.ts> [<destination>]');
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const schema = argv.shift();
|
|
103
|
+
|
|
104
|
+
let destination = null;
|
|
105
|
+
if (argv.length) {
|
|
106
|
+
destination = argv.shift();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Updated config for ts-json-schema-generator v2.3.0
|
|
110
|
+
const config = {
|
|
111
|
+
path: schema,
|
|
112
|
+
type: '*',
|
|
113
|
+
// Using extraTags to capture @ui, @widget, @help, etc. from JSDoc
|
|
114
|
+
extraTags: ['ui', 'widget', 'help', 'roles', 'settingsOverridingRule', 'uiOptions'],
|
|
115
|
+
sortProps: false, // preserve original property order
|
|
116
|
+
topRef: false, // do NOT wrap the schema in a top-level $ref
|
|
117
|
+
skipTypeCheck: true, // skip type checks (as per your original code)
|
|
118
|
+
// optional: additionalProperties: false, strictTuples: false, etc.
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Generate the raw schema
|
|
122
|
+
const result = tsj.createGenerator(config).createSchema(config.type);
|
|
123
|
+
|
|
124
|
+
// Convert the schema (e.g., inject dependencies, remove additionalProperties, etc.)
|
|
125
|
+
const converted = convert(result);
|
|
126
|
+
|
|
127
|
+
// Extract the metadata into a separate meta-schema
|
|
128
|
+
const meta = extractMeta(converted, converted); // NOTE: this removes 'ui' fields from `converted`
|
|
129
|
+
|
|
130
|
+
// Replace `$schema` with `schema` text if needed
|
|
131
|
+
const schemaText = JSON.stringify(converted, null, 2).replace('$schema', 'schema');
|
|
132
|
+
const metaSchemaText = JSON.stringify(meta, null, 2);
|
|
133
|
+
|
|
134
|
+
if (!destination) {
|
|
135
|
+
// If no destination specified, just print the schema to stdout
|
|
136
|
+
console.log(schemaText);
|
|
137
|
+
} else {
|
|
138
|
+
// Otherwise, write schema.json and meta-schema.json to the destination
|
|
139
|
+
const file = path.join(destination, 'schema.json');
|
|
140
|
+
fs.writeFileSync(file, schemaText);
|
|
141
|
+
|
|
142
|
+
const metaFile = path.join(destination, 'meta-schema.json');
|
|
143
|
+
fs.writeFileSync(metaFile, metaSchemaText);
|
|
144
|
+
|
|
145
|
+
console.log(`Schema written to: ${file}`);
|
|
146
|
+
console.log(`Meta-schema written to: ${metaFile}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
main(process.argv).then((code) => process.exit(code));
|
package/convert.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// convert.js
|
|
2
|
+
function injectConditions(options, field) {
|
|
3
|
+
let fieldDescription = {};
|
|
4
|
+
options.forEach((option) => {
|
|
5
|
+
fieldDescription = { ...fieldDescription, ...option.properties[field] };
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
delete fieldDescription.enum;
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
[field]: fieldDescription,
|
|
14
|
+
},
|
|
15
|
+
dependencies: {
|
|
16
|
+
[field]: { oneOf: options },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function walkSchema(schema) {
|
|
22
|
+
// Remove `additionalProperties` if present
|
|
23
|
+
if (schema && schema.additionalProperties !== undefined) {
|
|
24
|
+
delete schema.additionalProperties;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Convert anyOf => inject conditional schemas
|
|
28
|
+
if (schema.anyOf && schema.anyOf.every((option) => option.type === 'object')) {
|
|
29
|
+
const fields = Object.keys(schema.anyOf[0].properties).filter((propName) =>
|
|
30
|
+
schema.anyOf.every((option) => option.properties[propName]),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
schema.anyOf.forEach((option) => {
|
|
34
|
+
if (option && option.additionalProperties !== undefined) {
|
|
35
|
+
delete option.additionalProperties;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (fields.length === 1) {
|
|
40
|
+
// If there's exactly 1 common field, inject conditions
|
|
41
|
+
return injectConditions(schema.anyOf, fields[0]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Recursively walk through object properties
|
|
46
|
+
if (schema.type === 'object' && schema.properties) {
|
|
47
|
+
Object.keys(schema.properties).forEach((prop) => {
|
|
48
|
+
schema.properties[prop] = walkSchema(schema.properties[prop]);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Recursively walk arrays
|
|
53
|
+
if (schema.type === 'array' && schema.items) {
|
|
54
|
+
schema.items = walkSchema(schema.items);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return schema;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = function convert(rootSchema) {
|
|
61
|
+
return walkSchema(rootSchema);
|
|
62
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phystack/ts-schema",
|
|
3
|
+
"version": "4.3.40-dev",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"ts-schema": "cli.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"ts-json-schema-generator": "^2.3.0"
|
|
18
|
+
},
|
|
19
|
+
"author": "",
|
|
20
|
+
"gitHead": "53c505b3ecad47ebd4f38819c07b0ec1227214a6"
|
|
21
|
+
}
|