@chalksurf/cli 0.1.0 → 0.2.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.
- package/README.md +31 -94
- package/dist/bin/chalksurf.js +84 -10
- package/dist/commands/auth.js +43 -24
- package/dist/commands/exercise.js +428 -0
- package/dist/commands/job.js +20 -10
- package/dist/commands/org.js +20 -11
- package/dist/commands/profile.js +97 -0
- package/dist/commands/sheet.js +287 -130
- package/dist/lib/api-client.js +9 -3
- package/dist/lib/cli-error.js +37 -1
- package/dist/lib/config-store.js +188 -10
- package/dist/lib/import-files.js +120 -0
- package/dist/lib/import-output.js +67 -0
- package/dist/lib/manifest.js +183 -19
- package/dist/lib/output.js +35 -2
- package/dist/lib/prompt-secret.js +32 -0
- package/dist/lib/session.js +1 -1
- package/dist/lib/source-resolver.js +72 -10
- package/dist/lib/translation-languages.js +1 -0
- package/dist/lib/user-jobs.js +16 -1
- package/docs/agents.md +203 -0
- package/docs/examples/exercise-import-manifest.json +13 -0
- package/docs/examples/exercise-solution-import-manifest.json +13 -0
- package/docs/examples/sheet-import-manifest.json +33 -0
- package/docs/exit-codes.md +57 -0
- package/docs/manifest.md +129 -0
- package/docs/manual.md +169 -0
- package/package.json +8 -4
- package/schemas/exercise-import-manifest.schema.json +104 -0
- package/schemas/exercise-solution-import-manifest.schema.json +104 -0
- package/schemas/sheet-import-manifest.schema.json +142 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
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
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["sources"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"organizationId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1
|
|
12
|
+
},
|
|
13
|
+
"exerciseSheetId": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1
|
|
16
|
+
},
|
|
17
|
+
"wait": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"sources": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"minItems": 1,
|
|
23
|
+
"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"
|
|
78
|
+
},
|
|
79
|
+
"kind": {
|
|
80
|
+
"const": "url"
|
|
81
|
+
},
|
|
82
|
+
"url": {
|
|
83
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
84
|
+
},
|
|
85
|
+
"relativePath": {
|
|
86
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
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
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/knowledge-maps/chalksurf/blob/main/packages/cli/schemas/exercise-solution-import-manifest.schema.json",
|
|
4
|
+
"title": "ChalkSurf Exercise Solution Import Manifest",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["sources"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"organizationId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1
|
|
12
|
+
},
|
|
13
|
+
"exerciseId": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"minLength": 1
|
|
16
|
+
},
|
|
17
|
+
"wait": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"sources": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"minItems": 1,
|
|
23
|
+
"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"
|
|
78
|
+
},
|
|
79
|
+
"kind": {
|
|
80
|
+
"const": "url"
|
|
81
|
+
},
|
|
82
|
+
"url": {
|
|
83
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
84
|
+
},
|
|
85
|
+
"relativePath": {
|
|
86
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
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
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
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
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["sheets"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"organizationId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"minLength": 1
|
|
12
|
+
},
|
|
13
|
+
"wait": {
|
|
14
|
+
"type": "boolean"
|
|
15
|
+
},
|
|
16
|
+
"sheets": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"minItems": 1,
|
|
19
|
+
"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
|
+
"localSource": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": ["kind", "path"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"sourceId": {
|
|
49
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
50
|
+
},
|
|
51
|
+
"kind": {
|
|
52
|
+
"const": "local"
|
|
53
|
+
},
|
|
54
|
+
"path": {
|
|
55
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
56
|
+
},
|
|
57
|
+
"relativePath": {
|
|
58
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"directorySource": {
|
|
63
|
+
"type": "object",
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": ["kind", "path"],
|
|
66
|
+
"properties": {
|
|
67
|
+
"sourceId": {
|
|
68
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
69
|
+
},
|
|
70
|
+
"kind": {
|
|
71
|
+
"const": "directory"
|
|
72
|
+
},
|
|
73
|
+
"path": {
|
|
74
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
75
|
+
},
|
|
76
|
+
"relativeRoot": {
|
|
77
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"urlSource": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"required": ["kind", "url"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"sourceId": {
|
|
87
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
88
|
+
},
|
|
89
|
+
"kind": {
|
|
90
|
+
"const": "url"
|
|
91
|
+
},
|
|
92
|
+
"url": {
|
|
93
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
94
|
+
},
|
|
95
|
+
"relativePath": {
|
|
96
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"source": {
|
|
101
|
+
"oneOf": [
|
|
102
|
+
{
|
|
103
|
+
"$ref": "#/$defs/localSource"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"$ref": "#/$defs/directorySource"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"$ref": "#/$defs/urlSource"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"sheet": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": ["targetFolderPath", "sources"],
|
|
117
|
+
"properties": {
|
|
118
|
+
"targetFolderPath": {
|
|
119
|
+
"$ref": "#/$defs/targetFolderPath"
|
|
120
|
+
},
|
|
121
|
+
"title": {
|
|
122
|
+
"$ref": "#/$defs/nonEmptyString"
|
|
123
|
+
},
|
|
124
|
+
"translateTo": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"minItems": 1,
|
|
127
|
+
"uniqueItems": true,
|
|
128
|
+
"items": {
|
|
129
|
+
"$ref": "#/$defs/translateLanguage"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"sources": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"minItems": 1,
|
|
135
|
+
"items": {
|
|
136
|
+
"$ref": "#/$defs/source"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|