@numericoach/gskills-admin-cli 0.1.27 → 0.1.29
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 +25 -2
- package/dist/gskills-admin.js +238 -9
- package/package.json +1 -1
- package/skills/gskills-admin-cli/SKILL.md +14 -0
package/README.md
CHANGED
|
@@ -99,6 +99,20 @@ gskills-admin resources update <resourceId> --upload-file ./webinar-v2.mp4 --dat
|
|
|
99
99
|
|
|
100
100
|
Use `--mime-type` when the extension is ambiguous, and `--upload-name` when the stored file name needs a cleaner label.
|
|
101
101
|
|
|
102
|
+
Learning path icons can use the same three sources as the super-admin editor:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
gskills-admin learning-paths icons --query Gmail --output json
|
|
106
|
+
gskills-admin learning-paths set-icon <learningPathId> --app Gmail --dry-run --output json
|
|
107
|
+
gskills-admin learning-paths set-icon <learningPathId> --upload-file ./icon.png --instance <instanceId> --dry-run --output json
|
|
108
|
+
gskills-admin learning-paths generate-icon <learningPathId> --prompt "flat central handshake, transparent background" --dry-run --output json
|
|
109
|
+
gskills-admin learning-paths generate-icon <learningPathId> --prompt-file ./icon-prompt.txt --yes --output json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`icons` reads only French global category app icons. `set-icon --upload-file` streams the local image to storage with a signed URL and writes `LearningPath.iconUrl`. `generate-icon` calls the same server-side image generator used by the editor, then stores the generated URL on the learning path.
|
|
113
|
+
|
|
114
|
+
Do not pass `--use-app-icon` unless the user explicitly asks for the app logo to appear. It is off by default because most parcours icons should be symbolic. Repeating app logos across every learning path gets visually heavy and often produces cluttered, low-quality icons.
|
|
115
|
+
|
|
102
116
|
AI translation is available for content that has native AI translation in the editor:
|
|
103
117
|
|
|
104
118
|
Warning: `translate pages` rewrites each translated page from the source page. It is not a diff update. Recreating translated pages this way can lose activity-specific fields, quiz ids, embedded ids, or future custom block data if the translator does not preserve them. Prefer the app diff update flow for pages with activities or custom blocks.
|
|
@@ -112,10 +126,19 @@ gskills-admin translate pages --ids <pageId,pageId> --from fr --to en --dry-run
|
|
|
112
126
|
gskills-admin translate pages --all --instance global --from fr --to en --take 100 --dry-run --output json
|
|
113
127
|
gskills-admin translate quizzes <quizId> --to en --yes --output json
|
|
114
128
|
gskills-admin translate knowledge-video <knowledgeId> --from en --to es --yes --output json
|
|
129
|
+
gskills-admin translate changelogs <changelogId> --to all --concurrency 8 --dry-run --output json
|
|
115
130
|
```
|
|
116
131
|
|
|
117
|
-
Supported kinds are `pages`, `quizzes`, `topics`, `badges`, `menus`, `menu-sections`, `internal-knowledge`, `knowledge-video`, `learning-paths`,
|
|
118
|
-
|
|
132
|
+
Supported kinds are `pages`, `quizzes`, `topics`, `badges`, `menus`, `menu-sections`, `internal-knowledge`, `knowledge-video`, `learning-paths`, `chromebook-exercises`, and `changelogs`.
|
|
133
|
+
Use `--to all` to expand to every supported locale. Changelog translation supports `--concurrency 1-20` for faster backfills.
|
|
134
|
+
|
|
135
|
+
Changelog CRUD is available through `changelogs` and `changelog-groups`:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
gskills-admin changelog-groups create --data '{"name":"...","releaseDate":"2026-06-08T10:00:00.000Z"}' --dry-run --output json
|
|
139
|
+
gskills-admin changelogs create --data-file ./changelog-entry.json --dry-run --output json
|
|
140
|
+
gskills-admin changelogs update <changelogId> --data '{"status":"PUBLISHED"}' --yes --output json
|
|
141
|
+
```
|
|
119
142
|
|
|
120
143
|
Imported Google Sheets have their own command family:
|
|
121
144
|
|
package/dist/gskills-admin.js
CHANGED
|
@@ -442,7 +442,7 @@ var resources = [
|
|
|
442
442
|
delegate: "learningPath",
|
|
443
443
|
label: "Learning paths",
|
|
444
444
|
aliases: ["learning-path", "paths", "path"],
|
|
445
|
-
defaultFields: ["id", "name", "slug", "language", "instanceId", "isActive", "mandatory", "disabled", "archived", "alphaProgramIds", "updatedAt"],
|
|
445
|
+
defaultFields: ["id", "name", "slug", "language", "instanceId", "iconUrl", "isActive", "mandatory", "disabled", "archived", "alphaProgramIds", "updatedAt"],
|
|
446
446
|
syncable: true,
|
|
447
447
|
dangerousDelete: true,
|
|
448
448
|
cacheScopes: ["pages", "pages-knowledge"]
|
|
@@ -472,7 +472,17 @@ var resources = [
|
|
|
472
472
|
delegate: "changelog",
|
|
473
473
|
label: "Changelogs",
|
|
474
474
|
aliases: ["changelog"],
|
|
475
|
-
defaultFields: ["id", "title", "slug", "target", "status", "language", "updatedAt"],
|
|
475
|
+
defaultFields: ["id", "title", "slug", "groupId", "target", "status", "language", "parentId", "publishedAt", "updatedAt"],
|
|
476
|
+
instanceField: null,
|
|
477
|
+
dangerousDelete: true
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "changelog-groups",
|
|
481
|
+
delegate: "changelogGroup",
|
|
482
|
+
label: "Changelog groups",
|
|
483
|
+
aliases: ["changelog-group", "changelog-groupe", "changelog-groups"],
|
|
484
|
+
defaultFields: ["id", "name", "releaseDate", "createdAt", "updatedAt"],
|
|
485
|
+
instanceField: null,
|
|
476
486
|
dangerousDelete: true
|
|
477
487
|
},
|
|
478
488
|
{
|
|
@@ -1831,6 +1841,56 @@ import { cp, mkdir as mkdir2, readFile as readFile2, readdir, stat } from "node:
|
|
|
1831
1841
|
import { basename, dirname as dirname2, extname, join as join2, resolve } from "node:path";
|
|
1832
1842
|
import { homedir as homedir2 } from "node:os";
|
|
1833
1843
|
import { fileURLToPath } from "node:url";
|
|
1844
|
+
|
|
1845
|
+
// ../../src/lib/supported-locales.ts
|
|
1846
|
+
var supportedLocales = [
|
|
1847
|
+
"ar",
|
|
1848
|
+
"bg",
|
|
1849
|
+
"cs",
|
|
1850
|
+
"da",
|
|
1851
|
+
"de",
|
|
1852
|
+
"el",
|
|
1853
|
+
"en",
|
|
1854
|
+
"es",
|
|
1855
|
+
"et",
|
|
1856
|
+
"fa",
|
|
1857
|
+
"fi",
|
|
1858
|
+
"fil",
|
|
1859
|
+
"fr",
|
|
1860
|
+
"fr-CA",
|
|
1861
|
+
"he",
|
|
1862
|
+
"hi",
|
|
1863
|
+
"hr",
|
|
1864
|
+
"hu",
|
|
1865
|
+
"id",
|
|
1866
|
+
"is",
|
|
1867
|
+
"it",
|
|
1868
|
+
"ja",
|
|
1869
|
+
"ko",
|
|
1870
|
+
"lt",
|
|
1871
|
+
"lv",
|
|
1872
|
+
"ms",
|
|
1873
|
+
"nl",
|
|
1874
|
+
"no",
|
|
1875
|
+
"pl",
|
|
1876
|
+
"pt",
|
|
1877
|
+
"pt-BR",
|
|
1878
|
+
"ro",
|
|
1879
|
+
"ru",
|
|
1880
|
+
"sk",
|
|
1881
|
+
"sl",
|
|
1882
|
+
"sq",
|
|
1883
|
+
"sr",
|
|
1884
|
+
"sv",
|
|
1885
|
+
"th",
|
|
1886
|
+
"tr",
|
|
1887
|
+
"uk",
|
|
1888
|
+
"ur",
|
|
1889
|
+
"vi",
|
|
1890
|
+
"zh"
|
|
1891
|
+
];
|
|
1892
|
+
|
|
1893
|
+
// ../../src/cli/commands.ts
|
|
1834
1894
|
var runCommand = async (ctx) => {
|
|
1835
1895
|
const [group, actionOrResource, maybeAction, ...rest] = ctx.args;
|
|
1836
1896
|
if (!group || group === "help")
|
|
@@ -1926,6 +1986,9 @@ var runResourceCommand = async (resource, action, maybeId, rest, ctx) => {
|
|
|
1926
1986
|
throw new CliError("Missing pages id", 2);
|
|
1927
1987
|
return runPagesPatchContentCommand(maybeId, ctx);
|
|
1928
1988
|
}
|
|
1989
|
+
if (resource.name === "learning-paths" && isLearningPathIconAction(action)) {
|
|
1990
|
+
return runLearningPathIconCommand(resource, action, maybeId, ctx);
|
|
1991
|
+
}
|
|
1929
1992
|
if (action === "list")
|
|
1930
1993
|
return listResource(resource, ctx);
|
|
1931
1994
|
if (action === "get") {
|
|
@@ -2004,7 +2067,142 @@ var updateResource = async (resource, id, ctx) => {
|
|
|
2004
2067
|
body: JSON.stringify({ data })
|
|
2005
2068
|
});
|
|
2006
2069
|
};
|
|
2007
|
-
var
|
|
2070
|
+
var runLearningPathIconCommand = async (resource, action, learningPathId, ctx) => {
|
|
2071
|
+
if (action === "icons") {
|
|
2072
|
+
const searchParams = new URLSearchParams;
|
|
2073
|
+
const query = getStringFlag(ctx, "query") ?? getStringFlag(ctx, "search");
|
|
2074
|
+
const take = getNumberFlag(ctx, "take");
|
|
2075
|
+
if (query)
|
|
2076
|
+
searchParams.set("query", query);
|
|
2077
|
+
if (take)
|
|
2078
|
+
searchParams.set("take", String(take));
|
|
2079
|
+
if (hasFlag(ctx, "dry-run")) {
|
|
2080
|
+
return {
|
|
2081
|
+
dryRun: true,
|
|
2082
|
+
resource: "learning-path-icons",
|
|
2083
|
+
source: "global-french-category-app-icons",
|
|
2084
|
+
query: query ?? null,
|
|
2085
|
+
take: take ?? 50
|
|
2086
|
+
};
|
|
2087
|
+
}
|
|
2088
|
+
const suffix = searchParams.size > 0 ? `?${searchParams.toString()}` : "";
|
|
2089
|
+
return requestApi(`/api/cli/learning-path-icons${suffix}`);
|
|
2090
|
+
}
|
|
2091
|
+
if (!learningPathId)
|
|
2092
|
+
throw new CliError("Missing learning path id", 2);
|
|
2093
|
+
if (action === "set-icon") {
|
|
2094
|
+
requireWriteConfirmation("Learning path icon update writes data. Add --yes or use --dry-run.", ctx);
|
|
2095
|
+
const categoryRef = getStringFlag(ctx, "category") ?? getStringFlag(ctx, "app") ?? getStringFlag(ctx, "icon");
|
|
2096
|
+
const uploadFilePath = getStringFlag(ctx, "upload-file") ?? getStringFlag(ctx, "icon-file");
|
|
2097
|
+
if (categoryRef && uploadFilePath) {
|
|
2098
|
+
throw new CliError("Use either --category/--app or --upload-file, not both", 2);
|
|
2099
|
+
}
|
|
2100
|
+
if (!categoryRef && !uploadFilePath) {
|
|
2101
|
+
throw new CliError("Missing --category, --app, --upload-file, or --icon-file", 2);
|
|
2102
|
+
}
|
|
2103
|
+
if (categoryRef) {
|
|
2104
|
+
if (hasFlag(ctx, "dry-run")) {
|
|
2105
|
+
return {
|
|
2106
|
+
dryRun: true,
|
|
2107
|
+
resource: resource.name,
|
|
2108
|
+
id: learningPathId,
|
|
2109
|
+
mode: "category",
|
|
2110
|
+
categoryRef,
|
|
2111
|
+
data: {
|
|
2112
|
+
iconUrl: "<resolved global French category app icon>"
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
const category = await resolveLearningPathIconCategory(categoryRef);
|
|
2117
|
+
return requestApi(`/api/cli/${resource.name}/${learningPathId}`, {
|
|
2118
|
+
method: "PATCH",
|
|
2119
|
+
body: JSON.stringify({
|
|
2120
|
+
data: {
|
|
2121
|
+
iconUrl: category.icon
|
|
2122
|
+
}
|
|
2123
|
+
})
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
const data = {};
|
|
2127
|
+
const resolvedUploadFilePath = uploadFilePath;
|
|
2128
|
+
if (!resolvedUploadFilePath) {
|
|
2129
|
+
throw new CliError("Missing --upload-file or --icon-file", 2);
|
|
2130
|
+
}
|
|
2131
|
+
const uploadCtx = {
|
|
2132
|
+
...ctx,
|
|
2133
|
+
flags: {
|
|
2134
|
+
...ctx.flags,
|
|
2135
|
+
"upload-file": resolvedUploadFilePath
|
|
2136
|
+
}
|
|
2137
|
+
};
|
|
2138
|
+
await applyUploadFileData(resource, data, uploadCtx, {
|
|
2139
|
+
id: learningPathId,
|
|
2140
|
+
instanceId: getStringFlag(ctx, "instance")
|
|
2141
|
+
});
|
|
2142
|
+
if (hasFlag(ctx, "dry-run")) {
|
|
2143
|
+
return {
|
|
2144
|
+
dryRun: true,
|
|
2145
|
+
resource: resource.name,
|
|
2146
|
+
id: learningPathId,
|
|
2147
|
+
mode: "upload",
|
|
2148
|
+
data
|
|
2149
|
+
};
|
|
2150
|
+
}
|
|
2151
|
+
return requestApi(`/api/cli/${resource.name}/${learningPathId}`, {
|
|
2152
|
+
method: "PATCH",
|
|
2153
|
+
body: JSON.stringify({ data })
|
|
2154
|
+
});
|
|
2155
|
+
}
|
|
2156
|
+
if (action === "generate-icon") {
|
|
2157
|
+
requireWriteConfirmation("Learning path icon generation writes data. Add --yes or use --dry-run.", ctx);
|
|
2158
|
+
const appRef = getStringFlag(ctx, "app") ?? getStringFlag(ctx, "category");
|
|
2159
|
+
const extraPrompt = await getTextFlag(ctx, "prompt", "prompt-file") ?? getStringFlag(ctx, "extra-prompt") ?? "";
|
|
2160
|
+
const useAppIcon = hasFlag(ctx, "use-app-icon");
|
|
2161
|
+
const app = appRef && !hasFlag(ctx, "dry-run") ? await resolveLearningPathIconCategory(appRef) : null;
|
|
2162
|
+
const payload = {
|
|
2163
|
+
extraPrompt,
|
|
2164
|
+
useAppIcon,
|
|
2165
|
+
appName: app?.name ?? appRef ?? getStringFlag(ctx, "app-name") ?? "",
|
|
2166
|
+
appIconUrl: useAppIcon ? app?.icon ?? getStringFlag(ctx, "app-icon-url") ?? "" : "",
|
|
2167
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
2168
|
+
};
|
|
2169
|
+
if (payload.dryRun) {
|
|
2170
|
+
return {
|
|
2171
|
+
dryRun: true,
|
|
2172
|
+
resource: resource.name,
|
|
2173
|
+
id: learningPathId,
|
|
2174
|
+
operation: "generate-icon",
|
|
2175
|
+
payload
|
|
2176
|
+
};
|
|
2177
|
+
}
|
|
2178
|
+
return requestApi(`/api/cli/${resource.name}/${learningPathId}/generate-icon`, {
|
|
2179
|
+
method: "POST",
|
|
2180
|
+
body: JSON.stringify(payload)
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
throw new CliError(`Unknown learning-paths icon command "${action}"`, 2);
|
|
2184
|
+
};
|
|
2185
|
+
var isLearningPathIconAction = (action) => action === "icons" || action === "set-icon" || action === "generate-icon";
|
|
2186
|
+
var resolveLearningPathIconCategory = async (categoryRef) => {
|
|
2187
|
+
const searchParams = new URLSearchParams;
|
|
2188
|
+
searchParams.set("query", categoryRef);
|
|
2189
|
+
searchParams.set("take", "25");
|
|
2190
|
+
const result = await requestApi(`/api/cli/learning-path-icons?${searchParams.toString()}`);
|
|
2191
|
+
const categories = Array.isArray(result.icons) ? result.icons : [];
|
|
2192
|
+
const normalizedRef = normalizeCliSearchText(categoryRef);
|
|
2193
|
+
const category = categories.find((item) => [item.id, item.slug, item.name].some((value) => typeof value === "string" && normalizeCliSearchText(value) === normalizedRef)) ?? categories[0];
|
|
2194
|
+
if (!category || typeof category.icon !== "string") {
|
|
2195
|
+
throw new CliError(`No global French category app icon found for "${categoryRef}"`, 2);
|
|
2196
|
+
}
|
|
2197
|
+
return {
|
|
2198
|
+
id: String(category.id ?? ""),
|
|
2199
|
+
name: String(category.name ?? categoryRef),
|
|
2200
|
+
slug: String(category.slug ?? ""),
|
|
2201
|
+
icon: category.icon
|
|
2202
|
+
};
|
|
2203
|
+
};
|
|
2204
|
+
var normalizeCliSearchText = (value) => value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim();
|
|
2205
|
+
var UPLOADABLE_RESOURCE_NAMES = new Set(["internal-knowledge", "resources", "learning-paths"]);
|
|
2008
2206
|
var applyUploadFileData = async (resource, data, ctx, target) => {
|
|
2009
2207
|
const uploadFilePath = getStringFlag(ctx, "upload-file");
|
|
2010
2208
|
if (!uploadFilePath)
|
|
@@ -2034,6 +2232,9 @@ var prepareDirectUpload = async (resource, uploadFilePath, ctx, target) => {
|
|
|
2034
2232
|
throw new CliError(`Upload file not found: ${uploadFilePath}`, 2);
|
|
2035
2233
|
}
|
|
2036
2234
|
const contentType = getStringFlag(ctx, "mime-type") ?? inferMimeType(filePath);
|
|
2235
|
+
if (resource.name === "learning-paths" && !contentType.startsWith("image/")) {
|
|
2236
|
+
throw new CliError("Learning path icon uploads must be image files. Use --mime-type image/png if the extension is ambiguous.", 2);
|
|
2237
|
+
}
|
|
2037
2238
|
const instanceId = await resolveUploadInstanceId(resource, target);
|
|
2038
2239
|
const fileName = getStringFlag(ctx, "upload-name") ?? basename(filePath);
|
|
2039
2240
|
if (hasFlag(ctx, "dry-run")) {
|
|
@@ -2094,6 +2295,10 @@ var applyUploadedMediaData = (resource, data, upload) => {
|
|
|
2094
2295
|
data.sourceType = "UPLOAD";
|
|
2095
2296
|
data.fileUrl = upload.fileUrl;
|
|
2096
2297
|
data.linkUrl = upload.fileUrl;
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
if (resource.name === "learning-paths") {
|
|
2301
|
+
data.iconUrl = upload.fileUrl;
|
|
2097
2302
|
}
|
|
2098
2303
|
};
|
|
2099
2304
|
var setUploadInstanceData = (resource, data, instanceId) => {
|
|
@@ -2154,6 +2359,12 @@ var inferMimeType = (filePath) => {
|
|
|
2154
2359
|
".md": "text/markdown",
|
|
2155
2360
|
".html": "text/html",
|
|
2156
2361
|
".htm": "text/html",
|
|
2362
|
+
".png": "image/png",
|
|
2363
|
+
".jpg": "image/jpeg",
|
|
2364
|
+
".jpeg": "image/jpeg",
|
|
2365
|
+
".webp": "image/webp",
|
|
2366
|
+
".gif": "image/gif",
|
|
2367
|
+
".svg": "image/svg+xml",
|
|
2157
2368
|
".doc": "application/msword",
|
|
2158
2369
|
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
2159
2370
|
};
|
|
@@ -2964,11 +3175,11 @@ var runTranslateCommand = async (kind, id, ctx) => {
|
|
|
2964
3175
|
throw new CliError("Missing source content id, --ids, or --all", 2);
|
|
2965
3176
|
if (all && (id || ids.length > 0))
|
|
2966
3177
|
throw new CliError("Use either an id/--ids or --all, not both", 2);
|
|
2967
|
-
|
|
3178
|
+
let targetLanguages = splitCsv(getStringFlag(ctx, "to") ?? getStringFlag(ctx, "languages"));
|
|
2968
3179
|
if (targetLanguages.length === 0)
|
|
2969
3180
|
throw new CliError("Missing --to", 2);
|
|
2970
3181
|
if (targetLanguages.some((language) => language.toLowerCase() === "all")) {
|
|
2971
|
-
|
|
3182
|
+
targetLanguages = [...supportedLocales];
|
|
2972
3183
|
}
|
|
2973
3184
|
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
2974
3185
|
throw new CliError("AI translation writes content. Add --yes or use --dry-run.", 2);
|
|
@@ -2987,6 +3198,7 @@ var runTranslateCommand = async (kind, id, ctx) => {
|
|
|
2987
3198
|
sourceLanguage: getStringFlag(ctx, "from") ?? getStringFlag(ctx, "source-language"),
|
|
2988
3199
|
sourceHistoryEntryId: getStringFlag(ctx, "source-history") ?? getStringFlag(ctx, "source-history-entry"),
|
|
2989
3200
|
mode,
|
|
3201
|
+
concurrency: getNumberFlag(ctx, "concurrency"),
|
|
2990
3202
|
dryRun: hasFlag(ctx, "dry-run")
|
|
2991
3203
|
})
|
|
2992
3204
|
});
|
|
@@ -3748,9 +3960,15 @@ var rootHelp = () => ({
|
|
|
3748
3960
|
"gskills-admin sync run --target <instanceId> --only pages,quizzes --yes",
|
|
3749
3961
|
"gskills-admin sync repair-source-links --target <instanceId> --dry-run",
|
|
3750
3962
|
"gskills-admin translate pages <id> --to en,es --dry-run",
|
|
3963
|
+
"gskills-admin translate changelogs <id> --to all --concurrency 8 --yes",
|
|
3964
|
+
`gskills-admin changelog-groups create --data '{"name":"...","releaseDate":"2026-06-08T10:00:00.000Z"}' --yes`,
|
|
3751
3965
|
"gskills-admin imported-sheets create --instance <id> --source <url> --tab <name> --default-locale en --locales fr,en --owner-email admin@example.com --enable-vectorization --dry-run",
|
|
3752
3966
|
`gskills-admin internal-knowledge create --instance <instanceId> --upload-file ./video.mp4 --data '{"title":"...","language":"fr"}' --yes`,
|
|
3753
3967
|
`gskills-admin resources create --instance <instanceId> --upload-file ./webinar.mp4 --data '{"title":"...","type":"WEBINAR","language":"fr"}' --yes`,
|
|
3968
|
+
"gskills-admin learning-paths icons --query Gmail",
|
|
3969
|
+
"gskills-admin learning-paths set-icon <id> --app Gmail --yes",
|
|
3970
|
+
"gskills-admin learning-paths set-icon <id> --upload-file ./icon.png --yes",
|
|
3971
|
+
"gskills-admin learning-paths generate-icon <id> --prompt 'flat handshake, transparent background' --yes",
|
|
3754
3972
|
"gskills-admin internal-knowledge sync-media --since today --languages fr --all-targets --dry-run",
|
|
3755
3973
|
"gskills-admin progress learning-path-quiz-mismatches --instance <instanceId>",
|
|
3756
3974
|
"gskills-admin sessions invalidate --email user@example.com --dry-run",
|
|
@@ -3787,7 +4005,7 @@ var schemaHelp = () => ({
|
|
|
3787
4005
|
{ name: "sync repair-source-links", required: ["--target"], flags: ["--source", "--yes", "--dry-run"], writes: true },
|
|
3788
4006
|
{ name: "cache scopes", writes: false },
|
|
3789
4007
|
{ name: "cache invalidate", required: ["--instance"], flags: ["--scope", "--languages", "--yes", "--dry-run"], writes: true },
|
|
3790
|
-
{ name: "translate", args: ["kind", "id?"], required: ["--to"], flags: ["--ids", "--all", "--instance", "--from", "--where", "--take", "--mode", "--source-history", "--yes", "--dry-run"], writes: true },
|
|
4008
|
+
{ name: "translate", args: ["kind", "id?"], required: ["--to"], flags: ["--ids", "--all", "--instance", "--from", "--where", "--take", "--mode", "--source-history", "--concurrency", "--yes", "--dry-run"], writes: true },
|
|
3791
4009
|
{ name: "imported-sheets list", required: ["--instance"], writes: false },
|
|
3792
4010
|
{ name: "imported-sheets get", args: ["id"], required: ["--instance"], flags: ["--locale", "--page", "--page-size"], writes: false },
|
|
3793
4011
|
{ name: "imported-sheets locales", args: ["id"], required: ["--instance"], writes: false },
|
|
@@ -3819,6 +4037,9 @@ var schemaHelp = () => ({
|
|
|
3819
4037
|
{ name: "pages block insert-before", args: ["id"], required: ["--block-id", "--block or --block-file", "--yes or --dry-run"], flags: ["--expect-updated-at", "--expect-version", "--expect-content-sha1", "--reason", "--include-content"], writes: true },
|
|
3820
4038
|
{ name: "pages block insert-after", args: ["id"], required: ["--block-id", "--block or --block-file", "--yes or --dry-run"], flags: ["--expect-updated-at", "--expect-version", "--expect-content-sha1", "--reason", "--include-content"], writes: true },
|
|
3821
4039
|
{ name: "pages block remove", args: ["id"], required: ["--block-id", "--yes or --dry-run"], flags: ["--expect-type", "--expect-updated-at", "--expect-version", "--expect-content-sha1", "--reason", "--include-content"], writes: true },
|
|
4040
|
+
{ name: "learning-paths icons", flags: ["--query", "--take"], writes: false },
|
|
4041
|
+
{ name: "learning-paths set-icon", args: ["id"], required: ["--app or --category or --upload-file", "--yes or --dry-run"], flags: ["--instance", "--app", "--category", "--upload-file", "--icon-file", "--upload-name", "--mime-type"], writes: true },
|
|
4042
|
+
{ name: "learning-paths generate-icon", args: ["id"], required: ["--yes or --dry-run"], flags: ["--prompt", "--prompt-file", "--extra-prompt", "--app", "--category", "--app-name", "--use-app-icon"], writes: true },
|
|
3822
4043
|
{ name: "feedback inspect", args: ["feedbackId or URL"], writes: false },
|
|
3823
4044
|
{ name: "feedback translation-status", args: ["feedbackId or URL"], writes: false },
|
|
3824
4045
|
{ name: "feedback import-email", flags: ["--data", "--data-file", "--yes", "--dry-run"], writes: true },
|
|
@@ -3924,7 +4145,8 @@ var translateHelp = () => ({
|
|
|
3924
4145
|
"gskills-admin translate internal-knowledge <knowledgeId> --to en --yes",
|
|
3925
4146
|
"gskills-admin translate knowledge-video <knowledgeId> --from en --to es --yes",
|
|
3926
4147
|
"gskills-admin translate learning-paths <pathId> --to en --yes",
|
|
3927
|
-
"gskills-admin translate chromebook-exercises <exerciseId> --to en --yes"
|
|
4148
|
+
"gskills-admin translate chromebook-exercises <exerciseId> --to en --yes",
|
|
4149
|
+
"gskills-admin translate changelogs <changelogId> --to all --concurrency 8 --yes"
|
|
3928
4150
|
],
|
|
3929
4151
|
contentKinds: [
|
|
3930
4152
|
"pages",
|
|
@@ -3936,13 +4158,14 @@ var translateHelp = () => ({
|
|
|
3936
4158
|
"internal-knowledge",
|
|
3937
4159
|
"knowledge-video",
|
|
3938
4160
|
"learning-paths",
|
|
3939
|
-
"chromebook-exercises"
|
|
4161
|
+
"chromebook-exercises",
|
|
4162
|
+
"changelogs"
|
|
3940
4163
|
],
|
|
3941
4164
|
modes: ["upsert", "create", "update", "patch"],
|
|
3942
4165
|
selection: "Pass one id, --ids for several source rows, or --all with optional --instance, --from, --where and --take.",
|
|
3943
4166
|
warning: PAGE_TRANSLATION_REWRITE_WARNING,
|
|
3944
4167
|
patchMode: "For pages, --mode patch uses source page history to update changed translatable text while preserving target non-text block data such as activity ids, quiz ids, embedded ids, files, and future custom fields. It updates existing translations only and fails when no previous source history exists.",
|
|
3945
|
-
note: "Uses the same AI translation helpers as the editors. Dry-run plans the write without calling AI.
|
|
4168
|
+
note: "Uses the same AI translation helpers as the editors. Dry-run plans the write without calling AI. --to all expands to every supported locale. Changelogs support --concurrency 1-20."
|
|
3946
4169
|
});
|
|
3947
4170
|
var importedSheetsHelp = () => ({
|
|
3948
4171
|
usage: [
|
|
@@ -4144,6 +4367,12 @@ var resourceHelp = (resource) => ({
|
|
|
4144
4367
|
`gskills-admin ${resource.name} delete <id> --force --confirm-delete ${resource.name}:<id> --yes`,
|
|
4145
4368
|
...resource.name === "internal-knowledge" ? [`gskills-admin ${resource.name} create --instance <instanceId> --upload-file ./video.mp4 --data '{"title":"Video","language":"fr","isActive":true}' --dry-run`] : [],
|
|
4146
4369
|
...resource.name === "resources" ? [`gskills-admin ${resource.name} create --instance <instanceId> --upload-file ./webinar.mp4 --data '{"title":"Webinar","type":"WEBINAR","language":"fr","isActive":true}' --dry-run`] : [],
|
|
4370
|
+
...resource.name === "learning-paths" ? [
|
|
4371
|
+
`gskills-admin ${resource.name} icons --query Gmail`,
|
|
4372
|
+
`gskills-admin ${resource.name} set-icon <id> --app Gmail --dry-run`,
|
|
4373
|
+
`gskills-admin ${resource.name} set-icon <id> --upload-file ./icon.png --instance <instanceId> --dry-run`,
|
|
4374
|
+
`gskills-admin ${resource.name} generate-icon <id> --prompt "flat central symbol" --dry-run`
|
|
4375
|
+
] : [],
|
|
4147
4376
|
...resource.name === "internal-knowledge" ? [`gskills-admin ${resource.name} sync-media --since today --languages fr --all-targets --dry-run`] : [],
|
|
4148
4377
|
...resource.name === "pages" ? [`gskills-admin ${resource.name} backfill-field --field headerColor --all-targets --dry-run`] : [],
|
|
4149
4378
|
...resource.name === "pages" ? [`gskills-admin ${resource.name} content-schema --output json`] : [],
|
package/package.json
CHANGED
|
@@ -116,6 +116,20 @@ gskills-admin resources update <resourceId> --instance dev-numericoach --upload-
|
|
|
116
116
|
|
|
117
117
|
Use `--mime-type` when the extension is ambiguous and `--upload-name` when the stored file name should differ from the local basename. Always pass `--instance` for client-specific content; otherwise content-like creates default to `global`.
|
|
118
118
|
|
|
119
|
+
Learning path icons support the same sources as the super-admin editor:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
gskills-admin learning-paths icons --query Gmail --output json
|
|
123
|
+
gskills-admin learning-paths set-icon <learningPathId> --app Gmail --dry-run --output json
|
|
124
|
+
gskills-admin learning-paths set-icon <learningPathId> --upload-file ./icon.png --instance dev-numericoach --dry-run --output json
|
|
125
|
+
gskills-admin learning-paths generate-icon <learningPathId> --prompt "flat central handshake, transparent background" --dry-run --output json
|
|
126
|
+
gskills-admin learning-paths generate-icon <learningPathId> --prompt-file ./icon-prompt.txt --yes --output json
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`icons` reads only French global category app icons. `set-icon --upload-file` streams the local image through the signed upload path and writes `LearningPath.iconUrl`. `generate-icon` calls the same server-side image generator used by the editor, including the same prompt and post-processing.
|
|
130
|
+
|
|
131
|
+
Do not pass `--use-app-icon` unless the user explicitly asks for the app logo to appear. It is off by default because most parcours icons should be symbolic. Repeating app logos across every learning path gets visually heavy and often produces cluttered, low-quality icons.
|
|
132
|
+
|
|
119
133
|
Delete commands are soft-only. They require both `--force` and an exact confirmation token, then write the safest inactive field available, such as `disabled: true`, `archived: true`, `isActive: false`, or `active: false`. If a resource cannot be safely disabled, the CLI refuses the delete command.
|
|
120
134
|
|
|
121
135
|
```bash
|