@dsgraph/schema 0.0.0-stage → 0.3.0

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.
@@ -0,0 +1,542 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "Snapshot",
4
+ "type": "object",
5
+ "required": [
6
+ "schema",
7
+ "source",
8
+ "contexts",
9
+ "nodes",
10
+ "edges",
11
+ "diagnostics",
12
+ "hash"
13
+ ],
14
+ "properties": {
15
+ "schema": {
16
+ "const": "dsgraph/snapshot@1",
17
+ "type": "string"
18
+ },
19
+ "source": {
20
+ "$id": "SourceMeta",
21
+ "additionalProperties": true,
22
+ "type": "object",
23
+ "required": [
24
+ "kind"
25
+ ],
26
+ "properties": {
27
+ "kind": {
28
+ "type": "string"
29
+ },
30
+ "package": {
31
+ "type": "string"
32
+ },
33
+ "version": {
34
+ "type": "string"
35
+ },
36
+ "repo": {
37
+ "type": "string"
38
+ },
39
+ "ref": {
40
+ "type": "string"
41
+ },
42
+ "commit": {
43
+ "type": "string"
44
+ },
45
+ "path": {
46
+ "type": "string"
47
+ }
48
+ }
49
+ },
50
+ "contexts": {
51
+ "type": "object",
52
+ "required": [
53
+ "modifiers",
54
+ "permutations",
55
+ "partial"
56
+ ],
57
+ "properties": {
58
+ "modifiers": {
59
+ "type": "array",
60
+ "items": {
61
+ "$id": "Modifier",
62
+ "type": "object",
63
+ "required": [
64
+ "name",
65
+ "contexts"
66
+ ],
67
+ "properties": {
68
+ "name": {
69
+ "type": "string"
70
+ },
71
+ "contexts": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string"
75
+ }
76
+ },
77
+ "default": {
78
+ "type": "string"
79
+ }
80
+ }
81
+ }
82
+ },
83
+ "permutations": {
84
+ "type": "integer"
85
+ },
86
+ "partial": {
87
+ "type": "boolean"
88
+ }
89
+ }
90
+ },
91
+ "nodes": {
92
+ "type": "object",
93
+ "required": [
94
+ "groups",
95
+ "tokens"
96
+ ],
97
+ "properties": {
98
+ "groups": {
99
+ "type": "array",
100
+ "items": {
101
+ "$id": "Group",
102
+ "type": "object",
103
+ "required": [
104
+ "id",
105
+ "path",
106
+ "origin"
107
+ ],
108
+ "properties": {
109
+ "id": {
110
+ "type": "string"
111
+ },
112
+ "path": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ }
117
+ },
118
+ "type": {
119
+ "type": "string"
120
+ },
121
+ "description": {
122
+ "type": "string"
123
+ },
124
+ "deprecated": {
125
+ "$id": "Deprecated",
126
+ "type": "object",
127
+ "properties": {
128
+ "reason": {
129
+ "type": "string"
130
+ },
131
+ "replacement": {
132
+ "type": "string"
133
+ }
134
+ }
135
+ },
136
+ "extends": {
137
+ "type": "string"
138
+ },
139
+ "extensions": {
140
+ "type": "object",
141
+ "patternProperties": {
142
+ "^(.*)$": {}
143
+ }
144
+ },
145
+ "origin": {
146
+ "$id": "Origin",
147
+ "type": "object",
148
+ "required": [
149
+ "file",
150
+ "pointer"
151
+ ],
152
+ "properties": {
153
+ "file": {
154
+ "type": "string"
155
+ },
156
+ "pointer": {
157
+ "type": "string"
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ },
164
+ "tokens": {
165
+ "type": "array",
166
+ "items": {
167
+ "$id": "Token",
168
+ "type": "object",
169
+ "required": [
170
+ "id",
171
+ "path",
172
+ "type",
173
+ "typeSource",
174
+ "layer",
175
+ "deprecated",
176
+ "values",
177
+ "origin",
178
+ "inheritedFrom",
179
+ "flags"
180
+ ],
181
+ "properties": {
182
+ "id": {
183
+ "type": "string"
184
+ },
185
+ "path": {
186
+ "type": "array",
187
+ "items": {
188
+ "type": "string"
189
+ }
190
+ },
191
+ "type": {
192
+ "anyOf": [
193
+ {
194
+ "type": "string"
195
+ },
196
+ {
197
+ "type": "null"
198
+ }
199
+ ]
200
+ },
201
+ "typeSource": {
202
+ "anyOf": [
203
+ {
204
+ "anyOf": [
205
+ {
206
+ "const": "explicit",
207
+ "type": "string"
208
+ },
209
+ {
210
+ "const": "inherited",
211
+ "type": "string"
212
+ },
213
+ {
214
+ "const": "alias",
215
+ "type": "string"
216
+ },
217
+ {
218
+ "const": "inferred",
219
+ "type": "string"
220
+ }
221
+ ]
222
+ },
223
+ {
224
+ "type": "null"
225
+ }
226
+ ]
227
+ },
228
+ "layer": {
229
+ "anyOf": [
230
+ {
231
+ "type": "string"
232
+ },
233
+ {
234
+ "type": "null"
235
+ }
236
+ ]
237
+ },
238
+ "description": {
239
+ "type": "string"
240
+ },
241
+ "deprecated": {
242
+ "anyOf": [
243
+ {
244
+ "$id": "Deprecated",
245
+ "type": "object",
246
+ "properties": {
247
+ "reason": {
248
+ "type": "string"
249
+ },
250
+ "replacement": {
251
+ "type": "string"
252
+ }
253
+ }
254
+ },
255
+ {
256
+ "type": "null"
257
+ }
258
+ ]
259
+ },
260
+ "values": {
261
+ "type": "array",
262
+ "items": {
263
+ "$id": "TokenValue",
264
+ "type": "object",
265
+ "required": [
266
+ "when",
267
+ "raw",
268
+ "value",
269
+ "refs"
270
+ ],
271
+ "properties": {
272
+ "when": {
273
+ "$id": "When",
274
+ "type": "object",
275
+ "patternProperties": {
276
+ "^(.*)$": {
277
+ "type": "string"
278
+ }
279
+ }
280
+ },
281
+ "raw": {},
282
+ "value": {},
283
+ "refs": {
284
+ "type": "array",
285
+ "items": {
286
+ "$id": "Ref",
287
+ "type": "object",
288
+ "required": [
289
+ "to"
290
+ ],
291
+ "properties": {
292
+ "to": {
293
+ "type": "string"
294
+ },
295
+ "property": {
296
+ "type": "string"
297
+ },
298
+ "targetPath": {
299
+ "type": "string"
300
+ }
301
+ }
302
+ }
303
+ }
304
+ }
305
+ }
306
+ },
307
+ "origin": {
308
+ "$id": "Origin",
309
+ "type": "object",
310
+ "required": [
311
+ "file",
312
+ "pointer"
313
+ ],
314
+ "properties": {
315
+ "file": {
316
+ "type": "string"
317
+ },
318
+ "pointer": {
319
+ "type": "string"
320
+ }
321
+ }
322
+ },
323
+ "inheritedFrom": {
324
+ "anyOf": [
325
+ {
326
+ "type": "string"
327
+ },
328
+ {
329
+ "type": "null"
330
+ }
331
+ ]
332
+ },
333
+ "extensions": {
334
+ "type": "object",
335
+ "patternProperties": {
336
+ "^(.*)$": {}
337
+ }
338
+ },
339
+ "flags": {
340
+ "type": "array",
341
+ "items": {
342
+ "type": "string"
343
+ }
344
+ }
345
+ }
346
+ }
347
+ }
348
+ }
349
+ },
350
+ "edges": {
351
+ "type": "array",
352
+ "items": {
353
+ "anyOf": [
354
+ {
355
+ "type": "array",
356
+ "items": [
357
+ {
358
+ "anyOf": [
359
+ {
360
+ "const": "aliases",
361
+ "type": "string"
362
+ },
363
+ {
364
+ "const": "extends",
365
+ "type": "string"
366
+ },
367
+ {
368
+ "const": "deprecated_by",
369
+ "type": "string"
370
+ },
371
+ {
372
+ "const": "uses_token",
373
+ "type": "string"
374
+ },
375
+ {
376
+ "const": "imports",
377
+ "type": "string"
378
+ },
379
+ {
380
+ "const": "renders",
381
+ "type": "string"
382
+ },
383
+ {
384
+ "const": "used_at",
385
+ "type": "string"
386
+ },
387
+ {
388
+ "const": "hardcodes",
389
+ "type": "string"
390
+ }
391
+ ]
392
+ },
393
+ {
394
+ "type": "string"
395
+ },
396
+ {
397
+ "type": "string"
398
+ }
399
+ ],
400
+ "additionalItems": false,
401
+ "minItems": 3,
402
+ "maxItems": 3
403
+ },
404
+ {
405
+ "type": "array",
406
+ "items": [
407
+ {
408
+ "anyOf": [
409
+ {
410
+ "const": "aliases",
411
+ "type": "string"
412
+ },
413
+ {
414
+ "const": "extends",
415
+ "type": "string"
416
+ },
417
+ {
418
+ "const": "deprecated_by",
419
+ "type": "string"
420
+ },
421
+ {
422
+ "const": "uses_token",
423
+ "type": "string"
424
+ },
425
+ {
426
+ "const": "imports",
427
+ "type": "string"
428
+ },
429
+ {
430
+ "const": "renders",
431
+ "type": "string"
432
+ },
433
+ {
434
+ "const": "used_at",
435
+ "type": "string"
436
+ },
437
+ {
438
+ "const": "hardcodes",
439
+ "type": "string"
440
+ }
441
+ ]
442
+ },
443
+ {
444
+ "type": "string"
445
+ },
446
+ {
447
+ "type": "string"
448
+ },
449
+ {
450
+ "additionalProperties": true,
451
+ "type": "object",
452
+ "properties": {
453
+ "property": {
454
+ "type": "string"
455
+ },
456
+ "targetPath": {
457
+ "type": "string"
458
+ },
459
+ "when": {
460
+ "$id": "When",
461
+ "type": "object",
462
+ "patternProperties": {
463
+ "^(.*)$": {
464
+ "type": "string"
465
+ }
466
+ }
467
+ }
468
+ }
469
+ }
470
+ ],
471
+ "additionalItems": false,
472
+ "minItems": 4,
473
+ "maxItems": 4
474
+ }
475
+ ]
476
+ }
477
+ },
478
+ "diagnostics": {
479
+ "type": "array",
480
+ "items": {
481
+ "$id": "Diagnostic",
482
+ "type": "object",
483
+ "required": [
484
+ "code",
485
+ "severity",
486
+ "message"
487
+ ],
488
+ "properties": {
489
+ "code": {
490
+ "type": "string"
491
+ },
492
+ "severity": {
493
+ "anyOf": [
494
+ {
495
+ "const": "error",
496
+ "type": "string"
497
+ },
498
+ {
499
+ "const": "warning",
500
+ "type": "string"
501
+ },
502
+ {
503
+ "const": "info",
504
+ "type": "string"
505
+ }
506
+ ]
507
+ },
508
+ "message": {
509
+ "type": "string"
510
+ },
511
+ "loc": {
512
+ "$id": "Loc",
513
+ "type": "object",
514
+ "properties": {
515
+ "file": {
516
+ "type": "string"
517
+ },
518
+ "pointer": {
519
+ "type": "string"
520
+ },
521
+ "line": {
522
+ "type": "integer"
523
+ },
524
+ "column": {
525
+ "type": "integer"
526
+ }
527
+ }
528
+ }
529
+ }
530
+ }
531
+ },
532
+ "hash": {
533
+ "type": "string"
534
+ },
535
+ "meta": {
536
+ "type": "object",
537
+ "patternProperties": {
538
+ "^(.*)$": {}
539
+ }
540
+ }
541
+ }
542
+ }