@sdeverywhere/check-core 0.1.0 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdeverywhere/check-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "files": [
5
5
  "dist/**",
6
6
  "schema/**"
@@ -17,10 +17,10 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "ajv": "^8.6.3",
20
+ "ajv": "^8.12.0",
21
21
  "assert-never": "^1.2.1",
22
22
  "neverthrow": "^4.2.2",
23
- "yaml": "^2.1.0"
23
+ "yaml": "^2.2.2"
24
24
  },
25
25
  "author": "Climate Interactive",
26
26
  "license": "MIT",
@@ -42,9 +42,10 @@
42
42
  "test": "vitest run",
43
43
  "test:watch": "vitest",
44
44
  "test:ci": "vitest run",
45
+ "type-check": "tsc --noEmit -p tsconfig-test.json",
45
46
  "compile": "tsup",
46
- "copy-schema": "./scripts/copy-schema.js",
47
- "build": "run-s compile copy-schema",
47
+ "copy-schemas": "./scripts/copy-schemas.js",
48
+ "build": "run-s compile copy-schemas",
48
49
  "docs": "../../scripts/gen-docs.js",
49
50
  "ci:build": "run-s clean lint prettier:check test:ci build docs"
50
51
  }
@@ -0,0 +1,456 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Model Comparison Test",
4
+ "type": "array",
5
+ "description": "A group of model comparison scenarios and views.",
6
+ "items": {
7
+ "$ref": "#/$defs/top_level_array_item"
8
+ },
9
+ "$defs": {
10
+ "top_level_array_item": {
11
+ "oneOf": [
12
+ {
13
+ "$ref": "#/$defs/scenario_array_item"
14
+ },
15
+ {
16
+ "$ref": "#/$defs/scenario_group_array_item"
17
+ },
18
+ {
19
+ "$ref": "#/$defs/view_group_array_item"
20
+ }
21
+ ]
22
+ },
23
+ "scenario_array_item": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "properties": {
27
+ "scenario": {
28
+ "$ref": "#/$defs/scenario"
29
+ }
30
+ },
31
+ "required": [
32
+ "scenario"
33
+ ]
34
+ },
35
+ "scenario": {
36
+ "oneOf": [
37
+ {
38
+ "$ref": "#/$defs/scenario_with_input_at_position"
39
+ },
40
+ {
41
+ "$ref": "#/$defs/scenario_with_input_at_value"
42
+ },
43
+ {
44
+ "$ref": "#/$defs/scenario_with_multiple_input_settings"
45
+ },
46
+ {
47
+ "$ref": "#/$defs/scenario_with_inputs_in_preset_at_position"
48
+ },
49
+ {
50
+ "$ref": "#/$defs/scenario_preset"
51
+ }
52
+ ]
53
+ },
54
+ "scenario_position": {
55
+ "type": "string",
56
+ "enum": [
57
+ "min",
58
+ "max",
59
+ "default"
60
+ ]
61
+ },
62
+ "scenario_with_input_at_position": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "id": {
67
+ "type": "string"
68
+ },
69
+ "title": {
70
+ "type": "string"
71
+ },
72
+ "subtitle": {
73
+ "type": "string"
74
+ },
75
+ "with": {
76
+ "type": "string"
77
+ },
78
+ "at": {
79
+ "$ref": "#/$defs/scenario_position"
80
+ }
81
+ },
82
+ "required": [
83
+ "with",
84
+ "at"
85
+ ]
86
+ },
87
+ "scenario_with_input_at_value": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "properties": {
91
+ "id": {
92
+ "type": "string"
93
+ },
94
+ "title": {
95
+ "type": "string"
96
+ },
97
+ "subtitle": {
98
+ "type": "string"
99
+ },
100
+ "with": {
101
+ "type": "string"
102
+ },
103
+ "at": {
104
+ "type": "number"
105
+ }
106
+ },
107
+ "required": [
108
+ "with",
109
+ "at"
110
+ ]
111
+ },
112
+ "scenario_input_at_position": {
113
+ "type": "object",
114
+ "additionalProperties": false,
115
+ "properties": {
116
+ "input": {
117
+ "type": "string"
118
+ },
119
+ "at": {
120
+ "$ref": "#/$defs/scenario_position"
121
+ }
122
+ },
123
+ "required": [
124
+ "input",
125
+ "at"
126
+ ]
127
+ },
128
+ "scenario_input_at_value": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "properties": {
132
+ "input": {
133
+ "type": "string"
134
+ },
135
+ "at": {
136
+ "type": "number"
137
+ }
138
+ },
139
+ "required": [
140
+ "input",
141
+ "at"
142
+ ]
143
+ },
144
+ "scenario_input_setting": {
145
+ "oneOf": [
146
+ {
147
+ "$ref": "#/$defs/scenario_input_at_position"
148
+ },
149
+ {
150
+ "$ref": "#/$defs/scenario_input_at_value"
151
+ }
152
+ ]
153
+ },
154
+ "scenario_input_setting_array": {
155
+ "type": "array",
156
+ "items": {
157
+ "$ref": "#/$defs/scenario_input_setting"
158
+ },
159
+ "minItems": 1
160
+ },
161
+ "scenario_with_multiple_input_settings": {
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "properties": {
165
+ "id": {
166
+ "type": "string"
167
+ },
168
+ "title": {
169
+ "type": "string"
170
+ },
171
+ "subtitle": {
172
+ "type": "string"
173
+ },
174
+ "with": {
175
+ "$ref": "#/$defs/scenario_input_setting_array"
176
+ }
177
+ },
178
+ "required": [
179
+ "with"
180
+ ]
181
+ },
182
+ "scenario_with_inputs_in_preset_at_position": {
183
+ "type": "object",
184
+ "additionalProperties": false,
185
+ "properties": {
186
+ "id": {
187
+ "type": "string"
188
+ },
189
+ "title": {
190
+ "type": "string"
191
+ },
192
+ "subtitle": {
193
+ "type": "string"
194
+ },
195
+ "with_inputs": {
196
+ "type": "string",
197
+ "enum": [
198
+ "all"
199
+ ]
200
+ },
201
+ "at": {
202
+ "$ref": "#/$defs/scenario_position"
203
+ }
204
+ },
205
+ "required": [
206
+ "with_inputs",
207
+ "at"
208
+ ]
209
+ },
210
+ "scenario_preset": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "properties": {
214
+ "preset": {
215
+ "type": "string",
216
+ "enum": [
217
+ "matrix"
218
+ ]
219
+ }
220
+ },
221
+ "required": [
222
+ "preset"
223
+ ]
224
+ },
225
+ "scenario_group_array_item": {
226
+ "type": "object",
227
+ "additionalProperties": false,
228
+ "properties": {
229
+ "scenario_group": {
230
+ "$ref": "#/$defs/scenario_group"
231
+ }
232
+ },
233
+ "required": [
234
+ "scenario_group"
235
+ ]
236
+ },
237
+ "scenario_group": {
238
+ "type": "object",
239
+ "additionalProperties": false,
240
+ "properties": {
241
+ "id": {
242
+ "type": "string"
243
+ },
244
+ "title": {
245
+ "type": "string"
246
+ },
247
+ "scenarios": {
248
+ "type": "array",
249
+ "items": {
250
+ "$ref": "#/$defs/scenario_group_scenarios_array_item"
251
+ },
252
+ "minItems": 1
253
+ }
254
+ },
255
+ "required": [
256
+ "title",
257
+ "scenarios"
258
+ ]
259
+ },
260
+ "scenario_group_scenarios_array_item": {
261
+ "oneOf": [
262
+ {
263
+ "$ref": "#/$defs/scenario_array_item"
264
+ },
265
+ {
266
+ "$ref": "#/$defs/scenario_ref_array_item"
267
+ }
268
+ ]
269
+ },
270
+ "scenario_ref_id": {
271
+ "type": "string"
272
+ },
273
+ "scenario_ref_object": {
274
+ "type": "object",
275
+ "additionalProperties": false,
276
+ "properties": {
277
+ "id": {
278
+ "type": "string"
279
+ },
280
+ "title": {
281
+ "type": "string"
282
+ },
283
+ "subtitle": {
284
+ "type": "string"
285
+ }
286
+ },
287
+ "required": [
288
+ "id"
289
+ ]
290
+ },
291
+ "scenario_ref": {
292
+ "oneOf": [
293
+ {
294
+ "$ref": "#/$defs/scenario_ref_id"
295
+ },
296
+ {
297
+ "$ref": "#/$defs/scenario_ref_object"
298
+ }
299
+ ]
300
+ },
301
+ "scenario_ref_array_item": {
302
+ "type": "object",
303
+ "additionalProperties": false,
304
+ "properties": {
305
+ "scenario_ref": {
306
+ "$ref": "#/$defs/scenario_ref"
307
+ }
308
+ },
309
+ "required": [
310
+ "scenario_ref"
311
+ ]
312
+ },
313
+ "scenario_group_ref": {
314
+ "type": "object",
315
+ "additionalProperties": false,
316
+ "properties": {
317
+ "scenario_group_ref": {
318
+ "type": "string"
319
+ }
320
+ },
321
+ "required": [
322
+ "scenario_group_ref"
323
+ ]
324
+ },
325
+ "view": {
326
+ "type": "object",
327
+ "additionalProperties": false,
328
+ "properties": {
329
+ "title": {
330
+ "type": "string"
331
+ },
332
+ "subtitle": {
333
+ "type": "string"
334
+ },
335
+ "scenario_ref": {
336
+ "type": "string"
337
+ },
338
+ "graphs": {
339
+ "$ref": "#/$defs/view_graphs"
340
+ }
341
+ },
342
+ "required": [
343
+ "scenario_ref",
344
+ "graphs"
345
+ ]
346
+ },
347
+ "view_graphs": {
348
+ "oneOf": [
349
+ {
350
+ "$ref": "#/$defs/view_graphs_preset"
351
+ },
352
+ {
353
+ "$ref": "#/$defs/view_graphs_array"
354
+ }
355
+ ]
356
+ },
357
+ "view_graphs_preset": {
358
+ "type": "string",
359
+ "enum": [
360
+ "all"
361
+ ]
362
+ },
363
+ "view_graphs_array": {
364
+ "type": "array",
365
+ "items": {
366
+ "type": "string"
367
+ },
368
+ "minItems": 1
369
+ },
370
+ "view_group_array_item": {
371
+ "type": "object",
372
+ "additionalProperties": false,
373
+ "properties": {
374
+ "view_group": {
375
+ "$ref": "#/$defs/view_group"
376
+ }
377
+ },
378
+ "required": [
379
+ "view_group"
380
+ ]
381
+ },
382
+ "view_group": {
383
+ "oneOf": [
384
+ {
385
+ "$ref": "#/$defs/view_group_with_views_array"
386
+ },
387
+ {
388
+ "$ref": "#/$defs/view_group_shorthand_with_scenarios_array"
389
+ }
390
+ ]
391
+ },
392
+ "view_group_with_views_array": {
393
+ "type": "object",
394
+ "additionalProperties": false,
395
+ "properties": {
396
+ "title": {
397
+ "type": "string"
398
+ },
399
+ "views": {
400
+ "type": "array",
401
+ "items": {
402
+ "$ref": "#/$defs/view_group_views_array_item"
403
+ },
404
+ "minItems": 1
405
+ }
406
+ },
407
+ "required": [
408
+ "title",
409
+ "views"
410
+ ]
411
+ },
412
+ "view_group_views_array_item": {
413
+ "type": "object",
414
+ "additionalProperties": false,
415
+ "properties": {
416
+ "view": {
417
+ "$ref": "#/$defs/view"
418
+ }
419
+ }
420
+ },
421
+ "view_group_shorthand_with_scenarios_array": {
422
+ "type": "object",
423
+ "additionalProperties": false,
424
+ "properties": {
425
+ "title": {
426
+ "type": "string"
427
+ },
428
+ "scenarios": {
429
+ "type": "array",
430
+ "items": {
431
+ "$ref": "#/$defs/view_group_scenarios_array_item"
432
+ },
433
+ "minItems": 1
434
+ },
435
+ "graphs": {
436
+ "$ref": "#/$defs/view_graphs"
437
+ }
438
+ },
439
+ "required": [
440
+ "title",
441
+ "scenarios",
442
+ "graphs"
443
+ ]
444
+ },
445
+ "view_group_scenarios_array_item": {
446
+ "oneOf": [
447
+ {
448
+ "$ref": "#/$defs/scenario_ref_array_item"
449
+ },
450
+ {
451
+ "$ref": "#/$defs/scenario_group_ref"
452
+ }
453
+ ]
454
+ }
455
+ }
456
+ }