@chalksurf/cli 0.3.7 → 0.4.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.
@@ -1,198 +1,564 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/knowledge-maps/chalksurf/blob/main/packages/cli/schemas/sheet-import-manifest.schema.json",
4
- "title": "ChalkSurf Sheet Import Manifest",
5
3
  "type": "object",
6
- "additionalProperties": false,
7
- "required": ["sheets"],
8
4
  "properties": {
9
- "organizationId": {
5
+ "schemaVersion": {
10
6
  "type": "string",
11
- "minLength": 1
7
+ "const": "v1"
12
8
  },
13
- "wait": {
14
- "type": "boolean"
9
+ "operation": {
10
+ "type": "string",
11
+ "const": "sheet.import"
15
12
  },
16
- "sheets": {
17
- "type": "array",
13
+ "items": {
18
14
  "minItems": 1,
15
+ "maxItems": 20,
16
+ "type": "array",
19
17
  "items": {
20
- "$ref": "#/$defs/sheet"
21
- }
22
- }
23
- },
24
- "$defs": {
25
- "nonEmptyString": {
26
- "type": "string",
27
- "minLength": 1
28
- },
29
- "targetFolderPath": {
30
- "oneOf": [
31
- {
32
- "type": "null"
33
- },
34
- {
35
- "$ref": "#/$defs/nonEmptyString"
36
- }
37
- ]
38
- },
39
- "translateLanguage": {
40
- "type": "string",
41
- "enum": ["english", "hungarian", "german", "french", "spanish", "italian"]
42
- },
43
- "componentId": {
44
- "type": "string",
45
- "pattern": "^[a-zA-Z0-9_-]{1,80}$"
46
- },
47
- "component": {
48
- "type": "object",
49
- "additionalProperties": false,
50
- "required": ["componentId", "description"],
51
- "properties": {
52
- "componentId": {
53
- "$ref": "#/$defs/componentId"
54
- },
55
- "description": {
56
- "$ref": "#/$defs/nonEmptyString"
57
- },
58
- "targetFolderPath": {
59
- "$ref": "#/$defs/targetFolderPath"
60
- },
61
- "title": {
62
- "$ref": "#/$defs/nonEmptyString"
63
- },
64
- "translateTo": {
65
- "type": "array",
66
- "minItems": 1,
67
- "uniqueItems": true,
68
- "items": {
69
- "$ref": "#/$defs/translateLanguage"
70
- }
71
- }
72
- }
73
- },
74
- "localSource": {
75
- "type": "object",
76
- "additionalProperties": false,
77
- "required": ["kind", "path"],
78
- "properties": {
79
- "sourceId": {
80
- "$ref": "#/$defs/nonEmptyString"
81
- },
82
- "kind": {
83
- "const": "local"
84
- },
85
- "path": {
86
- "$ref": "#/$defs/nonEmptyString"
87
- },
88
- "relativePath": {
89
- "$ref": "#/$defs/nonEmptyString"
90
- }
91
- }
92
- },
93
- "directorySource": {
94
- "type": "object",
95
- "additionalProperties": false,
96
- "required": ["kind", "path"],
97
- "properties": {
98
- "sourceId": {
99
- "$ref": "#/$defs/nonEmptyString"
100
- },
101
- "kind": {
102
- "const": "directory"
103
- },
104
- "path": {
105
- "$ref": "#/$defs/nonEmptyString"
106
- },
107
- "relativeRoot": {
108
- "$ref": "#/$defs/nonEmptyString"
109
- }
110
- }
111
- },
112
- "urlSource": {
113
- "type": "object",
114
- "additionalProperties": false,
115
- "required": ["kind", "url"],
116
- "properties": {
117
- "sourceId": {
118
- "$ref": "#/$defs/nonEmptyString"
119
- },
120
- "kind": {
121
- "const": "url"
122
- },
123
- "url": {
124
- "$ref": "#/$defs/nonEmptyString"
125
- },
126
- "relativePath": {
127
- "$ref": "#/$defs/nonEmptyString"
128
- }
129
- }
130
- },
131
- "source": {
132
- "oneOf": [
133
- {
134
- "$ref": "#/$defs/localSource"
135
- },
136
- {
137
- "$ref": "#/$defs/directorySource"
138
- },
139
- {
140
- "$ref": "#/$defs/urlSource"
141
- }
142
- ]
143
- },
144
- "sheet": {
145
- "oneOf": [
146
- {
147
- "type": "object",
148
- "additionalProperties": false,
149
- "required": ["targetFolderPath", "sources"],
150
- "properties": {
151
- "targetFolderPath": {
152
- "$ref": "#/$defs/targetFolderPath"
153
- },
154
- "title": {
155
- "$ref": "#/$defs/nonEmptyString"
156
- },
157
- "translateTo": {
158
- "type": "array",
159
- "minItems": 1,
160
- "uniqueItems": true,
161
- "items": {
162
- "$ref": "#/$defs/translateLanguage"
18
+ "anyOf": [
19
+ {
20
+ "type": "object",
21
+ "properties": {
22
+ "itemId": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 100
26
+ },
27
+ "targetFolderPath": {
28
+ "anyOf": [
29
+ {
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ {
34
+ "type": "null"
35
+ }
36
+ ]
37
+ },
38
+ "title": {
39
+ "type": "string",
40
+ "minLength": 1
41
+ },
42
+ "targetLanguages": {
43
+ "minItems": 1,
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string",
47
+ "enum": [
48
+ "english",
49
+ "hungarian",
50
+ "german",
51
+ "french",
52
+ "spanish",
53
+ "italian"
54
+ ]
55
+ }
56
+ },
57
+ "sources": {
58
+ "minItems": 1,
59
+ "type": "array",
60
+ "items": {
61
+ "oneOf": [
62
+ {
63
+ "type": "object",
64
+ "properties": {
65
+ "kind": {
66
+ "type": "string",
67
+ "const": "local"
68
+ },
69
+ "path": {
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "relativePath": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ },
77
+ "sourceId": {
78
+ "type": "string",
79
+ "minLength": 1
80
+ }
81
+ },
82
+ "required": [
83
+ "kind",
84
+ "path"
85
+ ],
86
+ "additionalProperties": false
87
+ },
88
+ {
89
+ "type": "object",
90
+ "properties": {
91
+ "kind": {
92
+ "type": "string",
93
+ "const": "directory"
94
+ },
95
+ "path": {
96
+ "type": "string",
97
+ "minLength": 1
98
+ },
99
+ "relativeRoot": {
100
+ "type": "string",
101
+ "minLength": 1
102
+ },
103
+ "sourceId": {
104
+ "type": "string",
105
+ "minLength": 1
106
+ }
107
+ },
108
+ "required": [
109
+ "kind",
110
+ "path"
111
+ ],
112
+ "additionalProperties": false
113
+ },
114
+ {
115
+ "type": "object",
116
+ "properties": {
117
+ "kind": {
118
+ "type": "string",
119
+ "const": "url"
120
+ },
121
+ "url": {
122
+ "type": "string",
123
+ "format": "uri"
124
+ },
125
+ "relativePath": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "sourceId": {
130
+ "type": "string",
131
+ "minLength": 1
132
+ }
133
+ },
134
+ "required": [
135
+ "kind",
136
+ "url"
137
+ ],
138
+ "additionalProperties": false
139
+ }
140
+ ]
141
+ }
163
142
  }
164
143
  },
165
- "sources": {
166
- "type": "array",
167
- "minItems": 1,
168
- "items": {
169
- "$ref": "#/$defs/source"
170
- }
171
- }
172
- }
173
- },
174
- {
175
- "type": "object",
176
- "additionalProperties": false,
177
- "required": ["sources", "components"],
178
- "properties": {
179
- "sources": {
180
- "type": "array",
181
- "minItems": 1,
182
- "items": {
183
- "$ref": "#/$defs/source"
144
+ "required": [
145
+ "itemId",
146
+ "sources"
147
+ ],
148
+ "additionalProperties": false
149
+ },
150
+ {
151
+ "type": "object",
152
+ "properties": {
153
+ "itemId": {
154
+ "type": "string",
155
+ "minLength": 1,
156
+ "maxLength": 100
157
+ },
158
+ "sources": {
159
+ "minItems": 1,
160
+ "type": "array",
161
+ "items": {
162
+ "oneOf": [
163
+ {
164
+ "type": "object",
165
+ "properties": {
166
+ "kind": {
167
+ "type": "string",
168
+ "const": "local"
169
+ },
170
+ "path": {
171
+ "type": "string",
172
+ "minLength": 1
173
+ },
174
+ "relativePath": {
175
+ "type": "string",
176
+ "minLength": 1
177
+ },
178
+ "sourceId": {
179
+ "type": "string",
180
+ "minLength": 1
181
+ }
182
+ },
183
+ "required": [
184
+ "kind",
185
+ "path"
186
+ ],
187
+ "additionalProperties": false
188
+ },
189
+ {
190
+ "type": "object",
191
+ "properties": {
192
+ "kind": {
193
+ "type": "string",
194
+ "const": "directory"
195
+ },
196
+ "path": {
197
+ "type": "string",
198
+ "minLength": 1
199
+ },
200
+ "relativeRoot": {
201
+ "type": "string",
202
+ "minLength": 1
203
+ },
204
+ "sourceId": {
205
+ "type": "string",
206
+ "minLength": 1
207
+ }
208
+ },
209
+ "required": [
210
+ "kind",
211
+ "path"
212
+ ],
213
+ "additionalProperties": false
214
+ },
215
+ {
216
+ "type": "object",
217
+ "properties": {
218
+ "kind": {
219
+ "type": "string",
220
+ "const": "url"
221
+ },
222
+ "url": {
223
+ "type": "string",
224
+ "format": "uri"
225
+ },
226
+ "relativePath": {
227
+ "type": "string",
228
+ "minLength": 1
229
+ },
230
+ "sourceId": {
231
+ "type": "string",
232
+ "minLength": 1
233
+ }
234
+ },
235
+ "required": [
236
+ "kind",
237
+ "url"
238
+ ],
239
+ "additionalProperties": false
240
+ }
241
+ ]
242
+ }
243
+ },
244
+ "components": {
245
+ "minItems": 1,
246
+ "maxItems": 100,
247
+ "type": "array",
248
+ "items": {
249
+ "type": "object",
250
+ "properties": {
251
+ "componentId": {
252
+ "type": "string",
253
+ "pattern": "^[a-zA-Z0-9_-]{1,80}$"
254
+ },
255
+ "description": {
256
+ "type": "string",
257
+ "minLength": 1
258
+ },
259
+ "targetFolderPath": {
260
+ "anyOf": [
261
+ {
262
+ "type": "string",
263
+ "minLength": 1
264
+ },
265
+ {
266
+ "type": "null"
267
+ }
268
+ ]
269
+ },
270
+ "title": {
271
+ "type": "string",
272
+ "minLength": 1
273
+ },
274
+ "targetLanguages": {
275
+ "minItems": 1,
276
+ "type": "array",
277
+ "items": {
278
+ "type": "string",
279
+ "enum": [
280
+ "english",
281
+ "hungarian",
282
+ "german",
283
+ "french",
284
+ "spanish",
285
+ "italian"
286
+ ]
287
+ }
288
+ }
289
+ },
290
+ "required": [
291
+ "componentId",
292
+ "description"
293
+ ],
294
+ "additionalProperties": false
295
+ }
184
296
  }
185
297
  },
186
- "components": {
187
- "type": "array",
188
- "minItems": 1,
189
- "items": {
190
- "$ref": "#/$defs/component"
298
+ "required": [
299
+ "itemId",
300
+ "sources",
301
+ "components"
302
+ ],
303
+ "additionalProperties": false
304
+ },
305
+ {
306
+ "type": "object",
307
+ "properties": {
308
+ "itemId": {
309
+ "type": "string",
310
+ "minLength": 1,
311
+ "maxLength": 100
312
+ },
313
+ "targetFolderPath": {
314
+ "anyOf": [
315
+ {
316
+ "type": "string",
317
+ "minLength": 1
318
+ },
319
+ {
320
+ "type": "null"
321
+ }
322
+ ]
323
+ },
324
+ "title": {
325
+ "type": "string",
326
+ "minLength": 1
327
+ },
328
+ "base": {
329
+ "type": "object",
330
+ "properties": {
331
+ "language": {
332
+ "type": "string",
333
+ "enum": [
334
+ "english",
335
+ "hungarian",
336
+ "german",
337
+ "french",
338
+ "spanish",
339
+ "italian"
340
+ ]
341
+ },
342
+ "sources": {
343
+ "minItems": 1,
344
+ "type": "array",
345
+ "items": {
346
+ "oneOf": [
347
+ {
348
+ "type": "object",
349
+ "properties": {
350
+ "kind": {
351
+ "type": "string",
352
+ "const": "local"
353
+ },
354
+ "path": {
355
+ "type": "string",
356
+ "minLength": 1
357
+ },
358
+ "relativePath": {
359
+ "type": "string",
360
+ "minLength": 1
361
+ },
362
+ "sourceId": {
363
+ "type": "string",
364
+ "minLength": 1
365
+ }
366
+ },
367
+ "required": [
368
+ "kind",
369
+ "path"
370
+ ],
371
+ "additionalProperties": false
372
+ },
373
+ {
374
+ "type": "object",
375
+ "properties": {
376
+ "kind": {
377
+ "type": "string",
378
+ "const": "directory"
379
+ },
380
+ "path": {
381
+ "type": "string",
382
+ "minLength": 1
383
+ },
384
+ "relativeRoot": {
385
+ "type": "string",
386
+ "minLength": 1
387
+ },
388
+ "sourceId": {
389
+ "type": "string",
390
+ "minLength": 1
391
+ }
392
+ },
393
+ "required": [
394
+ "kind",
395
+ "path"
396
+ ],
397
+ "additionalProperties": false
398
+ },
399
+ {
400
+ "type": "object",
401
+ "properties": {
402
+ "kind": {
403
+ "type": "string",
404
+ "const": "url"
405
+ },
406
+ "url": {
407
+ "type": "string",
408
+ "format": "uri"
409
+ },
410
+ "relativePath": {
411
+ "type": "string",
412
+ "minLength": 1
413
+ },
414
+ "sourceId": {
415
+ "type": "string",
416
+ "minLength": 1
417
+ }
418
+ },
419
+ "required": [
420
+ "kind",
421
+ "url"
422
+ ],
423
+ "additionalProperties": false
424
+ }
425
+ ]
426
+ }
427
+ }
428
+ },
429
+ "required": [
430
+ "language",
431
+ "sources"
432
+ ],
433
+ "additionalProperties": false
434
+ },
435
+ "translations": {
436
+ "minItems": 1,
437
+ "type": "array",
438
+ "items": {
439
+ "type": "object",
440
+ "properties": {
441
+ "language": {
442
+ "type": "string",
443
+ "enum": [
444
+ "english",
445
+ "hungarian",
446
+ "german",
447
+ "french",
448
+ "spanish",
449
+ "italian"
450
+ ]
451
+ },
452
+ "sources": {
453
+ "minItems": 1,
454
+ "type": "array",
455
+ "items": {
456
+ "oneOf": [
457
+ {
458
+ "type": "object",
459
+ "properties": {
460
+ "kind": {
461
+ "type": "string",
462
+ "const": "local"
463
+ },
464
+ "path": {
465
+ "type": "string",
466
+ "minLength": 1
467
+ },
468
+ "relativePath": {
469
+ "type": "string",
470
+ "minLength": 1
471
+ },
472
+ "sourceId": {
473
+ "type": "string",
474
+ "minLength": 1
475
+ }
476
+ },
477
+ "required": [
478
+ "kind",
479
+ "path"
480
+ ],
481
+ "additionalProperties": false
482
+ },
483
+ {
484
+ "type": "object",
485
+ "properties": {
486
+ "kind": {
487
+ "type": "string",
488
+ "const": "directory"
489
+ },
490
+ "path": {
491
+ "type": "string",
492
+ "minLength": 1
493
+ },
494
+ "relativeRoot": {
495
+ "type": "string",
496
+ "minLength": 1
497
+ },
498
+ "sourceId": {
499
+ "type": "string",
500
+ "minLength": 1
501
+ }
502
+ },
503
+ "required": [
504
+ "kind",
505
+ "path"
506
+ ],
507
+ "additionalProperties": false
508
+ },
509
+ {
510
+ "type": "object",
511
+ "properties": {
512
+ "kind": {
513
+ "type": "string",
514
+ "const": "url"
515
+ },
516
+ "url": {
517
+ "type": "string",
518
+ "format": "uri"
519
+ },
520
+ "relativePath": {
521
+ "type": "string",
522
+ "minLength": 1
523
+ },
524
+ "sourceId": {
525
+ "type": "string",
526
+ "minLength": 1
527
+ }
528
+ },
529
+ "required": [
530
+ "kind",
531
+ "url"
532
+ ],
533
+ "additionalProperties": false
534
+ }
535
+ ]
536
+ }
537
+ }
538
+ },
539
+ "required": [
540
+ "language",
541
+ "sources"
542
+ ],
543
+ "additionalProperties": false
544
+ }
191
545
  }
192
- }
546
+ },
547
+ "required": [
548
+ "itemId",
549
+ "base",
550
+ "translations"
551
+ ],
552
+ "additionalProperties": false
193
553
  }
194
- }
195
- ]
554
+ ]
555
+ }
196
556
  }
197
- }
557
+ },
558
+ "required": [
559
+ "schemaVersion",
560
+ "operation",
561
+ "items"
562
+ ],
563
+ "additionalProperties": false
198
564
  }