@chalksurf/cli 0.3.6 → 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,116 +1,146 @@
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/exercise-import-manifest.schema.json",
4
- "title": "ChalkSurf Exercise Import Manifest",
5
3
  "type": "object",
6
- "additionalProperties": false,
7
- "required": ["sources"],
8
4
  "properties": {
9
- "organizationId": {
5
+ "schemaVersion": {
10
6
  "type": "string",
11
- "minLength": 1
7
+ "const": "v1"
12
8
  },
13
- "exerciseSheetId": {
9
+ "operation": {
14
10
  "type": "string",
15
- "minLength": 1
11
+ "const": "exercise.import"
16
12
  },
17
- "translateTo": {
18
- "type": "array",
13
+ "items": {
19
14
  "minItems": 1,
20
- "uniqueItems": true,
21
- "items": {
22
- "$ref": "#/$defs/translateLanguage"
23
- }
24
- },
25
- "wait": {
26
- "type": "boolean"
27
- },
28
- "sources": {
15
+ "maxItems": 100,
29
16
  "type": "array",
30
- "minItems": 1,
31
17
  "items": {
32
- "$ref": "#/$defs/source"
33
- }
34
- }
35
- },
36
- "$defs": {
37
- "nonEmptyString": {
38
- "type": "string",
39
- "minLength": 1
40
- },
41
- "translateLanguage": {
42
- "type": "string",
43
- "enum": ["english", "hungarian", "german", "french", "spanish", "italian"]
44
- },
45
- "localSource": {
46
- "type": "object",
47
- "additionalProperties": false,
48
- "required": ["kind", "path"],
49
- "properties": {
50
- "sourceId": {
51
- "$ref": "#/$defs/nonEmptyString"
52
- },
53
- "kind": {
54
- "const": "local"
55
- },
56
- "path": {
57
- "$ref": "#/$defs/nonEmptyString"
18
+ "type": "object",
19
+ "properties": {
20
+ "itemId": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 100
24
+ },
25
+ "exerciseSheetId": {
26
+ "type": "string",
27
+ "format": "uuid",
28
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
29
+ },
30
+ "sources": {
31
+ "minItems": 1,
32
+ "type": "array",
33
+ "items": {
34
+ "oneOf": [
35
+ {
36
+ "type": "object",
37
+ "properties": {
38
+ "kind": {
39
+ "type": "string",
40
+ "const": "local"
41
+ },
42
+ "path": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "relativePath": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "sourceId": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ }
54
+ },
55
+ "required": [
56
+ "kind",
57
+ "path"
58
+ ],
59
+ "additionalProperties": false
60
+ },
61
+ {
62
+ "type": "object",
63
+ "properties": {
64
+ "kind": {
65
+ "type": "string",
66
+ "const": "directory"
67
+ },
68
+ "path": {
69
+ "type": "string",
70
+ "minLength": 1
71
+ },
72
+ "relativeRoot": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "sourceId": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ }
80
+ },
81
+ "required": [
82
+ "kind",
83
+ "path"
84
+ ],
85
+ "additionalProperties": false
86
+ },
87
+ {
88
+ "type": "object",
89
+ "properties": {
90
+ "kind": {
91
+ "type": "string",
92
+ "const": "url"
93
+ },
94
+ "url": {
95
+ "type": "string",
96
+ "format": "uri"
97
+ },
98
+ "relativePath": {
99
+ "type": "string",
100
+ "minLength": 1
101
+ },
102
+ "sourceId": {
103
+ "type": "string",
104
+ "minLength": 1
105
+ }
106
+ },
107
+ "required": [
108
+ "kind",
109
+ "url"
110
+ ],
111
+ "additionalProperties": false
112
+ }
113
+ ]
114
+ }
115
+ },
116
+ "targetLanguages": {
117
+ "minItems": 1,
118
+ "type": "array",
119
+ "items": {
120
+ "type": "string",
121
+ "enum": [
122
+ "english",
123
+ "hungarian",
124
+ "german",
125
+ "french",
126
+ "spanish",
127
+ "italian"
128
+ ]
129
+ }
130
+ }
58
131
  },
59
- "relativePath": {
60
- "$ref": "#/$defs/nonEmptyString"
61
- }
132
+ "required": [
133
+ "itemId",
134
+ "sources"
135
+ ],
136
+ "additionalProperties": false
62
137
  }
63
- },
64
- "directorySource": {
65
- "type": "object",
66
- "additionalProperties": false,
67
- "required": ["kind", "path"],
68
- "properties": {
69
- "sourceId": {
70
- "$ref": "#/$defs/nonEmptyString"
71
- },
72
- "kind": {
73
- "const": "directory"
74
- },
75
- "path": {
76
- "$ref": "#/$defs/nonEmptyString"
77
- },
78
- "relativeRoot": {
79
- "$ref": "#/$defs/nonEmptyString"
80
- }
81
- }
82
- },
83
- "urlSource": {
84
- "type": "object",
85
- "additionalProperties": false,
86
- "required": ["kind", "url"],
87
- "properties": {
88
- "sourceId": {
89
- "$ref": "#/$defs/nonEmptyString"
90
- },
91
- "kind": {
92
- "const": "url"
93
- },
94
- "url": {
95
- "$ref": "#/$defs/nonEmptyString"
96
- },
97
- "relativePath": {
98
- "$ref": "#/$defs/nonEmptyString"
99
- }
100
- }
101
- },
102
- "source": {
103
- "oneOf": [
104
- {
105
- "$ref": "#/$defs/localSource"
106
- },
107
- {
108
- "$ref": "#/$defs/directorySource"
109
- },
110
- {
111
- "$ref": "#/$defs/urlSource"
112
- }
113
- ]
114
138
  }
115
- }
139
+ },
140
+ "required": [
141
+ "schemaVersion",
142
+ "operation",
143
+ "items"
144
+ ],
145
+ "additionalProperties": false
116
146
  }
@@ -1,104 +1,132 @@
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/exercise-sheet-solution-import-manifest.schema.json",
4
- "title": "ChalkSurf Exercise Sheet Solution Import Manifest",
5
3
  "type": "object",
6
- "additionalProperties": false,
7
- "required": ["sources"],
8
4
  "properties": {
9
- "organizationId": {
5
+ "schemaVersion": {
10
6
  "type": "string",
11
- "minLength": 1
7
+ "const": "v1"
12
8
  },
13
- "exerciseSheetId": {
9
+ "operation": {
14
10
  "type": "string",
15
- "minLength": 1
11
+ "const": "sheet.solution.import"
16
12
  },
17
- "wait": {
18
- "type": "boolean"
19
- },
20
- "sources": {
21
- "type": "array",
13
+ "items": {
22
14
  "minItems": 1,
15
+ "maxItems": 100,
16
+ "type": "array",
23
17
  "items": {
24
- "$ref": "#/$defs/source"
25
- }
26
- }
27
- },
28
- "$defs": {
29
- "nonEmptyString": {
30
- "type": "string",
31
- "minLength": 1
32
- },
33
- "localSource": {
34
- "type": "object",
35
- "additionalProperties": false,
36
- "required": ["kind", "path"],
37
- "properties": {
38
- "sourceId": {
39
- "$ref": "#/$defs/nonEmptyString"
40
- },
41
- "kind": {
42
- "const": "local"
43
- },
44
- "path": {
45
- "$ref": "#/$defs/nonEmptyString"
46
- },
47
- "relativePath": {
48
- "$ref": "#/$defs/nonEmptyString"
49
- }
50
- }
51
- },
52
- "directorySource": {
53
- "type": "object",
54
- "additionalProperties": false,
55
- "required": ["kind", "path"],
56
- "properties": {
57
- "sourceId": {
58
- "$ref": "#/$defs/nonEmptyString"
59
- },
60
- "kind": {
61
- "const": "directory"
62
- },
63
- "path": {
64
- "$ref": "#/$defs/nonEmptyString"
65
- },
66
- "relativeRoot": {
67
- "$ref": "#/$defs/nonEmptyString"
68
- }
69
- }
70
- },
71
- "urlSource": {
72
- "type": "object",
73
- "additionalProperties": false,
74
- "required": ["kind", "url"],
75
- "properties": {
76
- "sourceId": {
77
- "$ref": "#/$defs/nonEmptyString"
18
+ "type": "object",
19
+ "properties": {
20
+ "itemId": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 100
24
+ },
25
+ "exerciseSheetId": {
26
+ "type": "string",
27
+ "format": "uuid",
28
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
29
+ },
30
+ "sources": {
31
+ "minItems": 1,
32
+ "type": "array",
33
+ "items": {
34
+ "oneOf": [
35
+ {
36
+ "type": "object",
37
+ "properties": {
38
+ "kind": {
39
+ "type": "string",
40
+ "const": "local"
41
+ },
42
+ "path": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "relativePath": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "sourceId": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ }
54
+ },
55
+ "required": [
56
+ "kind",
57
+ "path"
58
+ ],
59
+ "additionalProperties": false
60
+ },
61
+ {
62
+ "type": "object",
63
+ "properties": {
64
+ "kind": {
65
+ "type": "string",
66
+ "const": "directory"
67
+ },
68
+ "path": {
69
+ "type": "string",
70
+ "minLength": 1
71
+ },
72
+ "relativeRoot": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "sourceId": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ }
80
+ },
81
+ "required": [
82
+ "kind",
83
+ "path"
84
+ ],
85
+ "additionalProperties": false
86
+ },
87
+ {
88
+ "type": "object",
89
+ "properties": {
90
+ "kind": {
91
+ "type": "string",
92
+ "const": "url"
93
+ },
94
+ "url": {
95
+ "type": "string",
96
+ "format": "uri"
97
+ },
98
+ "relativePath": {
99
+ "type": "string",
100
+ "minLength": 1
101
+ },
102
+ "sourceId": {
103
+ "type": "string",
104
+ "minLength": 1
105
+ }
106
+ },
107
+ "required": [
108
+ "kind",
109
+ "url"
110
+ ],
111
+ "additionalProperties": false
112
+ }
113
+ ]
114
+ }
115
+ }
78
116
  },
79
- "kind": {
80
- "const": "url"
81
- },
82
- "url": {
83
- "$ref": "#/$defs/nonEmptyString"
84
- },
85
- "relativePath": {
86
- "$ref": "#/$defs/nonEmptyString"
87
- }
117
+ "required": [
118
+ "itemId",
119
+ "exerciseSheetId",
120
+ "sources"
121
+ ],
122
+ "additionalProperties": false
88
123
  }
89
- },
90
- "source": {
91
- "oneOf": [
92
- {
93
- "$ref": "#/$defs/localSource"
94
- },
95
- {
96
- "$ref": "#/$defs/directorySource"
97
- },
98
- {
99
- "$ref": "#/$defs/urlSource"
100
- }
101
- ]
102
124
  }
103
- }
125
+ },
126
+ "required": [
127
+ "schemaVersion",
128
+ "operation",
129
+ "items"
130
+ ],
131
+ "additionalProperties": false
104
132
  }
@@ -0,0 +1,156 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "schemaVersion": {
6
+ "type": "string",
7
+ "const": "v1"
8
+ },
9
+ "operation": {
10
+ "type": "string",
11
+ "const": "sheet.translation.import"
12
+ },
13
+ "items": {
14
+ "minItems": 1,
15
+ "maxItems": 100,
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "properties": {
20
+ "itemId": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "maxLength": 100
24
+ },
25
+ "exerciseSheetId": {
26
+ "type": "string",
27
+ "format": "uuid",
28
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
29
+ },
30
+ "sources": {
31
+ "minItems": 1,
32
+ "type": "array",
33
+ "items": {
34
+ "oneOf": [
35
+ {
36
+ "type": "object",
37
+ "properties": {
38
+ "kind": {
39
+ "type": "string",
40
+ "const": "local"
41
+ },
42
+ "path": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "relativePath": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ },
50
+ "sourceId": {
51
+ "type": "string",
52
+ "minLength": 1
53
+ }
54
+ },
55
+ "required": [
56
+ "kind",
57
+ "path"
58
+ ],
59
+ "additionalProperties": false
60
+ },
61
+ {
62
+ "type": "object",
63
+ "properties": {
64
+ "kind": {
65
+ "type": "string",
66
+ "const": "directory"
67
+ },
68
+ "path": {
69
+ "type": "string",
70
+ "minLength": 1
71
+ },
72
+ "relativeRoot": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "sourceId": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ }
80
+ },
81
+ "required": [
82
+ "kind",
83
+ "path"
84
+ ],
85
+ "additionalProperties": false
86
+ },
87
+ {
88
+ "type": "object",
89
+ "properties": {
90
+ "kind": {
91
+ "type": "string",
92
+ "const": "url"
93
+ },
94
+ "url": {
95
+ "type": "string",
96
+ "format": "uri"
97
+ },
98
+ "relativePath": {
99
+ "type": "string",
100
+ "minLength": 1
101
+ },
102
+ "sourceId": {
103
+ "type": "string",
104
+ "minLength": 1
105
+ }
106
+ },
107
+ "required": [
108
+ "kind",
109
+ "url"
110
+ ],
111
+ "additionalProperties": false
112
+ }
113
+ ]
114
+ }
115
+ },
116
+ "sourceLanguage": {
117
+ "type": "string",
118
+ "enum": [
119
+ "english",
120
+ "hungarian",
121
+ "german",
122
+ "french",
123
+ "spanish",
124
+ "italian"
125
+ ]
126
+ },
127
+ "targetLanguage": {
128
+ "type": "string",
129
+ "enum": [
130
+ "english",
131
+ "hungarian",
132
+ "german",
133
+ "french",
134
+ "spanish",
135
+ "italian"
136
+ ]
137
+ }
138
+ },
139
+ "required": [
140
+ "itemId",
141
+ "exerciseSheetId",
142
+ "sources",
143
+ "sourceLanguage",
144
+ "targetLanguage"
145
+ ],
146
+ "additionalProperties": false
147
+ }
148
+ }
149
+ },
150
+ "required": [
151
+ "schemaVersion",
152
+ "operation",
153
+ "items"
154
+ ],
155
+ "additionalProperties": false
156
+ }