@horizon36596/zenith-schema 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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +18 -0
  3. package/README.md +24 -0
  4. package/dist/auto.d.ts +1882 -0
  5. package/dist/auto.d.ts.map +1 -0
  6. package/dist/auto.js +236 -0
  7. package/dist/auto.js.map +1 -0
  8. package/dist/common.d.ts +76 -0
  9. package/dist/common.d.ts.map +1 -0
  10. package/dist/common.js +30 -0
  11. package/dist/common.js.map +1 -0
  12. package/dist/expr.d.ts +56 -0
  13. package/dist/expr.d.ts.map +1 -0
  14. package/dist/expr.js +245 -0
  15. package/dist/expr.js.map +1 -0
  16. package/dist/field.d.ts +719 -0
  17. package/dist/field.d.ts.map +1 -0
  18. package/dist/field.js +158 -0
  19. package/dist/field.js.map +1 -0
  20. package/dist/ids.d.ts +62 -0
  21. package/dist/ids.d.ts.map +1 -0
  22. package/dist/ids.js +79 -0
  23. package/dist/ids.js.map +1 -0
  24. package/dist/index.d.ts +17 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +17 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/jsonschema.d.ts +14 -0
  29. package/dist/jsonschema.d.ts.map +1 -0
  30. package/dist/jsonschema.js +31 -0
  31. package/dist/jsonschema.js.map +1 -0
  32. package/dist/link.d.ts +117 -0
  33. package/dist/link.d.ts.map +1 -0
  34. package/dist/link.js +58 -0
  35. package/dist/link.js.map +1 -0
  36. package/dist/migrate.d.ts +2699 -0
  37. package/dist/migrate.d.ts.map +1 -0
  38. package/dist/migrate.js +109 -0
  39. package/dist/migrate.js.map +1 -0
  40. package/dist/parse.d.ts +28 -0
  41. package/dist/parse.d.ts.map +1 -0
  42. package/dist/parse.js +46 -0
  43. package/dist/parse.js.map +1 -0
  44. package/dist/robot.d.ts +2935 -0
  45. package/dist/robot.d.ts.map +1 -0
  46. package/dist/robot.js +231 -0
  47. package/dist/robot.js.map +1 -0
  48. package/dist/waypoints.d.ts +63 -0
  49. package/dist/waypoints.d.ts.map +1 -0
  50. package/dist/waypoints.js +20 -0
  51. package/dist/waypoints.js.map +1 -0
  52. package/json/auto.json +683 -0
  53. package/json/field.json +457 -0
  54. package/json/link.json +110 -0
  55. package/json/robot.json +664 -0
  56. package/json/waypoints.json +50 -0
  57. package/package.json +65 -0
package/json/auto.json ADDED
@@ -0,0 +1,683 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://libraries.horizon36596.org/zenith/schema/v1/auto.json",
4
+ "title": "Zenith auto file, formatVersion 3",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string"
9
+ },
10
+ "formatVersion": {
11
+ "type": "number",
12
+ "const": 3
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "title": {
19
+ "type": "string"
20
+ },
21
+ "description": {
22
+ "type": "string"
23
+ },
24
+ "robot": {
25
+ "type": "string",
26
+ "minLength": 1
27
+ },
28
+ "field": {
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "alliance": {
33
+ "type": "string",
34
+ "enum": [
35
+ "RED",
36
+ "BLUE"
37
+ ]
38
+ },
39
+ "authors": {
40
+ "type": "array",
41
+ "items": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ }
45
+ },
46
+ "created": {
47
+ "type": "string"
48
+ },
49
+ "start": {
50
+ "type": "object",
51
+ "properties": {
52
+ "pose": {
53
+ "anyOf": [
54
+ {
55
+ "type": "object",
56
+ "properties": {
57
+ "ref": {
58
+ "type": "string",
59
+ "minLength": 1
60
+ }
61
+ },
62
+ "required": [
63
+ "ref"
64
+ ],
65
+ "additionalProperties": false
66
+ },
67
+ {
68
+ "type": "object",
69
+ "properties": {
70
+ "xIn": {
71
+ "type": "number"
72
+ },
73
+ "yIn": {
74
+ "type": "number"
75
+ },
76
+ "headingRad": {
77
+ "type": "number"
78
+ },
79
+ "provenance": {
80
+ "type": "string",
81
+ "minLength": 1
82
+ }
83
+ },
84
+ "required": [
85
+ "xIn",
86
+ "yIn"
87
+ ],
88
+ "additionalProperties": false
89
+ }
90
+ ]
91
+ },
92
+ "holds": {
93
+ "type": "object",
94
+ "additionalProperties": {
95
+ "type": "number"
96
+ }
97
+ }
98
+ },
99
+ "required": [
100
+ "pose"
101
+ ],
102
+ "additionalProperties": false
103
+ },
104
+ "steps": {
105
+ "type": "array",
106
+ "items": {
107
+ "anyOf": [
108
+ {
109
+ "type": "object",
110
+ "properties": {
111
+ "id": {
112
+ "type": "string",
113
+ "minLength": 1
114
+ },
115
+ "kind": {
116
+ "type": "string",
117
+ "const": "path"
118
+ },
119
+ "timeoutS": {
120
+ "type": "number",
121
+ "exclusiveMinimum": true,
122
+ "minimum": 0
123
+ },
124
+ "segments": {
125
+ "type": "array",
126
+ "items": {
127
+ "anyOf": [
128
+ {
129
+ "type": "object",
130
+ "properties": {
131
+ "kind": {
132
+ "type": "string",
133
+ "const": "line"
134
+ },
135
+ "from": {
136
+ "anyOf": [
137
+ {
138
+ "type": "string",
139
+ "const": "current"
140
+ },
141
+ {
142
+ "type": "object",
143
+ "properties": {
144
+ "ref": {
145
+ "type": "string",
146
+ "minLength": 1
147
+ }
148
+ },
149
+ "required": [
150
+ "ref"
151
+ ],
152
+ "additionalProperties": false
153
+ },
154
+ {
155
+ "$ref": "#/properties/start/properties/pose/anyOf/1"
156
+ }
157
+ ]
158
+ },
159
+ "to": {
160
+ "$ref": "#/properties/steps/items/anyOf/0/properties/segments/items/anyOf/0/properties/from"
161
+ }
162
+ },
163
+ "required": [
164
+ "kind",
165
+ "from",
166
+ "to"
167
+ ],
168
+ "additionalProperties": false
169
+ },
170
+ {
171
+ "type": "object",
172
+ "properties": {
173
+ "kind": {
174
+ "type": "string",
175
+ "const": "bezier"
176
+ },
177
+ "from": {
178
+ "$ref": "#/properties/steps/items/anyOf/0/properties/segments/items/anyOf/0/properties/from"
179
+ },
180
+ "control": {
181
+ "type": "array",
182
+ "items": {
183
+ "$ref": "#/properties/start/properties/pose/anyOf/1"
184
+ },
185
+ "minItems": 1,
186
+ "maxItems": 3
187
+ },
188
+ "to": {
189
+ "$ref": "#/properties/steps/items/anyOf/0/properties/segments/items/anyOf/0/properties/from"
190
+ }
191
+ },
192
+ "required": [
193
+ "kind",
194
+ "from",
195
+ "control",
196
+ "to"
197
+ ],
198
+ "additionalProperties": false
199
+ }
200
+ ]
201
+ },
202
+ "minItems": 1
203
+ },
204
+ "heading": {
205
+ "anyOf": [
206
+ {
207
+ "type": "object",
208
+ "properties": {
209
+ "mode": {
210
+ "type": "string",
211
+ "const": "tangent"
212
+ }
213
+ },
214
+ "required": [
215
+ "mode"
216
+ ],
217
+ "additionalProperties": false
218
+ },
219
+ {
220
+ "type": "object",
221
+ "properties": {
222
+ "mode": {
223
+ "type": "string",
224
+ "const": "tangentReversed"
225
+ }
226
+ },
227
+ "required": [
228
+ "mode"
229
+ ],
230
+ "additionalProperties": false
231
+ },
232
+ {
233
+ "type": "object",
234
+ "properties": {
235
+ "mode": {
236
+ "type": "string",
237
+ "const": "constant"
238
+ },
239
+ "headingRad": {
240
+ "type": "number"
241
+ }
242
+ },
243
+ "required": [
244
+ "mode",
245
+ "headingRad"
246
+ ],
247
+ "additionalProperties": false
248
+ },
249
+ {
250
+ "type": "object",
251
+ "properties": {
252
+ "mode": {
253
+ "type": "string",
254
+ "const": "linear"
255
+ },
256
+ "fromRad": {
257
+ "type": "number"
258
+ },
259
+ "toRad": {
260
+ "type": "number"
261
+ }
262
+ },
263
+ "required": [
264
+ "mode",
265
+ "fromRad",
266
+ "toRad"
267
+ ],
268
+ "additionalProperties": false
269
+ },
270
+ {
271
+ "type": "object",
272
+ "properties": {
273
+ "mode": {
274
+ "type": "string",
275
+ "const": "facePoint"
276
+ },
277
+ "xIn": {
278
+ "type": "number"
279
+ },
280
+ "yIn": {
281
+ "type": "number"
282
+ },
283
+ "offsetRad": {
284
+ "type": "number"
285
+ }
286
+ },
287
+ "required": [
288
+ "mode",
289
+ "xIn",
290
+ "yIn"
291
+ ],
292
+ "additionalProperties": false
293
+ },
294
+ {
295
+ "type": "object",
296
+ "properties": {
297
+ "mode": {
298
+ "type": "string",
299
+ "const": "piecewise"
300
+ },
301
+ "ranges": {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "object",
305
+ "properties": {
306
+ "startT": {
307
+ "type": "number",
308
+ "minimum": 0,
309
+ "maximum": 1
310
+ },
311
+ "endT": {
312
+ "type": "number",
313
+ "minimum": 0,
314
+ "maximum": 1
315
+ },
316
+ "heading": {
317
+ "anyOf": [
318
+ {
319
+ "$ref": "#/properties/steps/items/anyOf/0/properties/heading/anyOf/0"
320
+ },
321
+ {
322
+ "$ref": "#/properties/steps/items/anyOf/0/properties/heading/anyOf/1"
323
+ },
324
+ {
325
+ "$ref": "#/properties/steps/items/anyOf/0/properties/heading/anyOf/2"
326
+ },
327
+ {
328
+ "$ref": "#/properties/steps/items/anyOf/0/properties/heading/anyOf/3"
329
+ },
330
+ {
331
+ "$ref": "#/properties/steps/items/anyOf/0/properties/heading/anyOf/4"
332
+ }
333
+ ]
334
+ }
335
+ },
336
+ "required": [
337
+ "startT",
338
+ "endT",
339
+ "heading"
340
+ ],
341
+ "additionalProperties": false
342
+ },
343
+ "minItems": 1
344
+ }
345
+ },
346
+ "required": [
347
+ "mode",
348
+ "ranges"
349
+ ],
350
+ "additionalProperties": false
351
+ }
352
+ ]
353
+ },
354
+ "speedFraction": {
355
+ "type": "number",
356
+ "exclusiveMinimum": true,
357
+ "minimum": 0,
358
+ "maximum": 1
359
+ },
360
+ "markers": {
361
+ "type": "array",
362
+ "items": {
363
+ "type": "object",
364
+ "properties": {
365
+ "at": {
366
+ "anyOf": [
367
+ {
368
+ "type": "object",
369
+ "properties": {
370
+ "t": {
371
+ "type": "number",
372
+ "minimum": 0,
373
+ "maximum": 1
374
+ }
375
+ },
376
+ "required": [
377
+ "t"
378
+ ],
379
+ "additionalProperties": false
380
+ },
381
+ {
382
+ "type": "object",
383
+ "properties": {
384
+ "distanceIn": {
385
+ "type": "number",
386
+ "minimum": 0
387
+ }
388
+ },
389
+ "required": [
390
+ "distanceIn"
391
+ ],
392
+ "additionalProperties": false
393
+ },
394
+ {
395
+ "type": "object",
396
+ "properties": {
397
+ "distanceFromEndIn": {
398
+ "type": "number",
399
+ "minimum": 0
400
+ }
401
+ },
402
+ "required": [
403
+ "distanceFromEndIn"
404
+ ],
405
+ "additionalProperties": false
406
+ }
407
+ ]
408
+ },
409
+ "command": {
410
+ "type": "object",
411
+ "properties": {
412
+ "name": {
413
+ "type": "string",
414
+ "minLength": 1
415
+ },
416
+ "args": {
417
+ "type": "object",
418
+ "additionalProperties": {
419
+ "type": [
420
+ "string",
421
+ "number",
422
+ "boolean"
423
+ ]
424
+ }
425
+ }
426
+ },
427
+ "required": [
428
+ "name"
429
+ ],
430
+ "additionalProperties": false
431
+ }
432
+ },
433
+ "required": [
434
+ "at",
435
+ "command"
436
+ ],
437
+ "additionalProperties": false
438
+ }
439
+ },
440
+ "endCondition": {
441
+ "type": "object",
442
+ "properties": {
443
+ "condition": {
444
+ "type": "string",
445
+ "minLength": 1
446
+ }
447
+ },
448
+ "required": [
449
+ "condition"
450
+ ],
451
+ "additionalProperties": false
452
+ },
453
+ "expect": {
454
+ "type": "object",
455
+ "properties": {
456
+ "collectFrom": {
457
+ "type": "string",
458
+ "minLength": 1
459
+ },
460
+ "count": {
461
+ "type": "number"
462
+ },
463
+ "launchesInto": {
464
+ "type": "string",
465
+ "minLength": 1
466
+ },
467
+ "tip": {
468
+ "type": "string",
469
+ "enum": [
470
+ "own",
471
+ "opponent"
472
+ ]
473
+ }
474
+ },
475
+ "additionalProperties": false
476
+ },
477
+ "notes": {
478
+ "type": "string"
479
+ }
480
+ },
481
+ "required": [
482
+ "kind",
483
+ "segments"
484
+ ],
485
+ "additionalProperties": false
486
+ },
487
+ {
488
+ "type": "object",
489
+ "properties": {
490
+ "id": {
491
+ "type": "string",
492
+ "minLength": 1
493
+ },
494
+ "kind": {
495
+ "type": "string",
496
+ "const": "command"
497
+ },
498
+ "name": {
499
+ "type": "string",
500
+ "minLength": 1
501
+ },
502
+ "args": {
503
+ "type": "object",
504
+ "additionalProperties": {
505
+ "type": [
506
+ "string",
507
+ "number",
508
+ "boolean"
509
+ ]
510
+ }
511
+ },
512
+ "timeoutS": {
513
+ "type": "number",
514
+ "exclusiveMinimum": true,
515
+ "minimum": 0
516
+ },
517
+ "expect": {
518
+ "$ref": "#/properties/steps/items/anyOf/0/properties/expect"
519
+ },
520
+ "notes": {
521
+ "type": "string"
522
+ }
523
+ },
524
+ "required": [
525
+ "kind",
526
+ "name"
527
+ ],
528
+ "additionalProperties": false
529
+ },
530
+ {
531
+ "type": "object",
532
+ "properties": {
533
+ "id": {
534
+ "type": "string",
535
+ "minLength": 1
536
+ },
537
+ "kind": {
538
+ "type": "string",
539
+ "const": "wait"
540
+ },
541
+ "seconds": {
542
+ "type": "number",
543
+ "minimum": 0
544
+ },
545
+ "until": {
546
+ "type": "string",
547
+ "minLength": 1
548
+ },
549
+ "timeoutS": {
550
+ "type": "number",
551
+ "exclusiveMinimum": true,
552
+ "minimum": 0
553
+ },
554
+ "notes": {
555
+ "type": "string"
556
+ }
557
+ },
558
+ "required": [
559
+ "kind"
560
+ ],
561
+ "additionalProperties": false
562
+ },
563
+ {
564
+ "type": "object",
565
+ "properties": {
566
+ "id": {
567
+ "type": "string",
568
+ "minLength": 1
569
+ },
570
+ "kind": {
571
+ "type": "string",
572
+ "const": "sequence"
573
+ },
574
+ "steps": {
575
+ "type": "array",
576
+ "items": {
577
+ "$ref": "#/properties/steps/items"
578
+ },
579
+ "minItems": 1
580
+ },
581
+ "notes": {
582
+ "type": "string"
583
+ }
584
+ },
585
+ "required": [
586
+ "kind",
587
+ "steps"
588
+ ],
589
+ "additionalProperties": false
590
+ },
591
+ {
592
+ "type": "object",
593
+ "properties": {
594
+ "id": {
595
+ "type": "string",
596
+ "minLength": 1
597
+ },
598
+ "kind": {
599
+ "type": "string",
600
+ "const": "parallel"
601
+ },
602
+ "mode": {
603
+ "type": "string",
604
+ "enum": [
605
+ "all",
606
+ "race",
607
+ "deadline"
608
+ ]
609
+ },
610
+ "deadline": {
611
+ "type": "string",
612
+ "minLength": 1
613
+ },
614
+ "steps": {
615
+ "type": "array",
616
+ "items": {
617
+ "$ref": "#/properties/steps/items"
618
+ },
619
+ "minItems": 1
620
+ },
621
+ "notes": {
622
+ "type": "string"
623
+ }
624
+ },
625
+ "required": [
626
+ "kind",
627
+ "mode",
628
+ "steps"
629
+ ],
630
+ "additionalProperties": false
631
+ },
632
+ {
633
+ "type": "object",
634
+ "properties": {
635
+ "id": {
636
+ "type": "string",
637
+ "minLength": 1
638
+ },
639
+ "kind": {
640
+ "type": "string",
641
+ "const": "branch"
642
+ },
643
+ "condition": {
644
+ "type": "string",
645
+ "minLength": 1
646
+ },
647
+ "then": {
648
+ "type": "array",
649
+ "items": {
650
+ "$ref": "#/properties/steps/items"
651
+ }
652
+ },
653
+ "else": {
654
+ "type": "array",
655
+ "items": {
656
+ "$ref": "#/properties/steps/items"
657
+ }
658
+ },
659
+ "notes": {
660
+ "type": "string"
661
+ }
662
+ },
663
+ "required": [
664
+ "kind",
665
+ "condition",
666
+ "then"
667
+ ],
668
+ "additionalProperties": false
669
+ }
670
+ ]
671
+ },
672
+ "minItems": 1
673
+ }
674
+ },
675
+ "required": [
676
+ "formatVersion",
677
+ "name",
678
+ "alliance",
679
+ "start",
680
+ "steps"
681
+ ],
682
+ "additionalProperties": false
683
+ }