@numericoach/gskills-admin-cli 0.1.27 → 0.1.28
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 +11 -2
- package/dist/gskills-admin.js +72 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,10 +112,19 @@ gskills-admin translate pages --ids <pageId,pageId> --from fr --to en --dry-run
|
|
|
112
112
|
gskills-admin translate pages --all --instance global --from fr --to en --take 100 --dry-run --output json
|
|
113
113
|
gskills-admin translate quizzes <quizId> --to en --yes --output json
|
|
114
114
|
gskills-admin translate knowledge-video <knowledgeId> --from en --to es --yes --output json
|
|
115
|
+
gskills-admin translate changelogs <changelogId> --to all --concurrency 8 --dry-run --output json
|
|
115
116
|
```
|
|
116
117
|
|
|
117
|
-
Supported kinds are `pages`, `quizzes`, `topics`, `badges`, `menus`, `menu-sections`, `internal-knowledge`, `knowledge-video`, `learning-paths`,
|
|
118
|
-
|
|
118
|
+
Supported kinds are `pages`, `quizzes`, `topics`, `badges`, `menus`, `menu-sections`, `internal-knowledge`, `knowledge-video`, `learning-paths`, `chromebook-exercises`, and `changelogs`.
|
|
119
|
+
Use `--to all` to expand to every supported locale. Changelog translation supports `--concurrency 1-20` for faster backfills.
|
|
120
|
+
|
|
121
|
+
Changelog CRUD is available through `changelogs` and `changelog-groups`:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
gskills-admin changelog-groups create --data '{"name":"...","releaseDate":"2026-06-08T10:00:00.000Z"}' --dry-run --output json
|
|
125
|
+
gskills-admin changelogs create --data-file ./changelog-entry.json --dry-run --output json
|
|
126
|
+
gskills-admin changelogs update <changelogId> --data '{"status":"PUBLISHED"}' --yes --output json
|
|
127
|
+
```
|
|
119
128
|
|
|
120
129
|
Imported Google Sheets have their own command family:
|
|
121
130
|
|
package/dist/gskills-admin.js
CHANGED
|
@@ -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")
|
|
@@ -2964,11 +3024,11 @@ var runTranslateCommand = async (kind, id, ctx) => {
|
|
|
2964
3024
|
throw new CliError("Missing source content id, --ids, or --all", 2);
|
|
2965
3025
|
if (all && (id || ids.length > 0))
|
|
2966
3026
|
throw new CliError("Use either an id/--ids or --all, not both", 2);
|
|
2967
|
-
|
|
3027
|
+
let targetLanguages = splitCsv(getStringFlag(ctx, "to") ?? getStringFlag(ctx, "languages"));
|
|
2968
3028
|
if (targetLanguages.length === 0)
|
|
2969
3029
|
throw new CliError("Missing --to", 2);
|
|
2970
3030
|
if (targetLanguages.some((language) => language.toLowerCase() === "all")) {
|
|
2971
|
-
|
|
3031
|
+
targetLanguages = [...supportedLocales];
|
|
2972
3032
|
}
|
|
2973
3033
|
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
2974
3034
|
throw new CliError("AI translation writes content. Add --yes or use --dry-run.", 2);
|
|
@@ -2987,6 +3047,7 @@ var runTranslateCommand = async (kind, id, ctx) => {
|
|
|
2987
3047
|
sourceLanguage: getStringFlag(ctx, "from") ?? getStringFlag(ctx, "source-language"),
|
|
2988
3048
|
sourceHistoryEntryId: getStringFlag(ctx, "source-history") ?? getStringFlag(ctx, "source-history-entry"),
|
|
2989
3049
|
mode,
|
|
3050
|
+
concurrency: getNumberFlag(ctx, "concurrency"),
|
|
2990
3051
|
dryRun: hasFlag(ctx, "dry-run")
|
|
2991
3052
|
})
|
|
2992
3053
|
});
|
|
@@ -3748,6 +3809,8 @@ var rootHelp = () => ({
|
|
|
3748
3809
|
"gskills-admin sync run --target <instanceId> --only pages,quizzes --yes",
|
|
3749
3810
|
"gskills-admin sync repair-source-links --target <instanceId> --dry-run",
|
|
3750
3811
|
"gskills-admin translate pages <id> --to en,es --dry-run",
|
|
3812
|
+
"gskills-admin translate changelogs <id> --to all --concurrency 8 --yes",
|
|
3813
|
+
`gskills-admin changelog-groups create --data '{"name":"...","releaseDate":"2026-06-08T10:00:00.000Z"}' --yes`,
|
|
3751
3814
|
"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
3815
|
`gskills-admin internal-knowledge create --instance <instanceId> --upload-file ./video.mp4 --data '{"title":"...","language":"fr"}' --yes`,
|
|
3753
3816
|
`gskills-admin resources create --instance <instanceId> --upload-file ./webinar.mp4 --data '{"title":"...","type":"WEBINAR","language":"fr"}' --yes`,
|
|
@@ -3787,7 +3850,7 @@ var schemaHelp = () => ({
|
|
|
3787
3850
|
{ name: "sync repair-source-links", required: ["--target"], flags: ["--source", "--yes", "--dry-run"], writes: true },
|
|
3788
3851
|
{ name: "cache scopes", writes: false },
|
|
3789
3852
|
{ 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 },
|
|
3853
|
+
{ name: "translate", args: ["kind", "id?"], required: ["--to"], flags: ["--ids", "--all", "--instance", "--from", "--where", "--take", "--mode", "--source-history", "--concurrency", "--yes", "--dry-run"], writes: true },
|
|
3791
3854
|
{ name: "imported-sheets list", required: ["--instance"], writes: false },
|
|
3792
3855
|
{ name: "imported-sheets get", args: ["id"], required: ["--instance"], flags: ["--locale", "--page", "--page-size"], writes: false },
|
|
3793
3856
|
{ name: "imported-sheets locales", args: ["id"], required: ["--instance"], writes: false },
|
|
@@ -3924,7 +3987,8 @@ var translateHelp = () => ({
|
|
|
3924
3987
|
"gskills-admin translate internal-knowledge <knowledgeId> --to en --yes",
|
|
3925
3988
|
"gskills-admin translate knowledge-video <knowledgeId> --from en --to es --yes",
|
|
3926
3989
|
"gskills-admin translate learning-paths <pathId> --to en --yes",
|
|
3927
|
-
"gskills-admin translate chromebook-exercises <exerciseId> --to en --yes"
|
|
3990
|
+
"gskills-admin translate chromebook-exercises <exerciseId> --to en --yes",
|
|
3991
|
+
"gskills-admin translate changelogs <changelogId> --to all --concurrency 8 --yes"
|
|
3928
3992
|
],
|
|
3929
3993
|
contentKinds: [
|
|
3930
3994
|
"pages",
|
|
@@ -3936,13 +4000,14 @@ var translateHelp = () => ({
|
|
|
3936
4000
|
"internal-knowledge",
|
|
3937
4001
|
"knowledge-video",
|
|
3938
4002
|
"learning-paths",
|
|
3939
|
-
"chromebook-exercises"
|
|
4003
|
+
"chromebook-exercises",
|
|
4004
|
+
"changelogs"
|
|
3940
4005
|
],
|
|
3941
4006
|
modes: ["upsert", "create", "update", "patch"],
|
|
3942
4007
|
selection: "Pass one id, --ids for several source rows, or --all with optional --instance, --from, --where and --take.",
|
|
3943
4008
|
warning: PAGE_TRANSLATION_REWRITE_WARNING,
|
|
3944
4009
|
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.
|
|
4010
|
+
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
4011
|
});
|
|
3947
4012
|
var importedSheetsHelp = () => ({
|
|
3948
4013
|
usage: [
|