@numericoach/gskills-admin-cli 0.1.23 → 0.1.24

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 CHANGED
@@ -78,6 +78,7 @@ gskills-admin imported-sheets sync <sheetId> --instance <instanceId> --dry-run -
78
78
  gskills-admin imported-sheets translate <sheetId> --instance <instanceId> --to en,es --dry-run --output json
79
79
  gskills-admin imported-sheets retranslate <sheetId> --instance <instanceId> --from en --to fr,de,es --dry-run --output json
80
80
  gskills-admin imported-sheets replace-grid <sheetId> --instance <instanceId> --locale en --data-file ./grid.json --rebuild-columns --dry-run --output json
81
+ gskills-admin imported-sheets patch-cells <sheetId> --instance <instanceId> --data-file ./cell-patches.json --dry-run --output json
81
82
  gskills-admin imported-sheets vectorize <sheetId> --instance <instanceId> --locales fr,en --dry-run --output json
82
83
  gskills-admin imported-sheets repair-french <sheetId> --instance <instanceId> --locales es,it --revectorize --dry-run --output json
83
84
  gskills-admin imported-sheets copy-to <sheetId> --instance global --target <instanceId> --display-name "Use cases" --dry-run --output json
@@ -85,7 +86,24 @@ gskills-admin imported-sheets attach-page <sheetId> --instance <instanceId> --pa
85
86
  gskills-admin imported-sheets set-source <sheetId> --instance <instanceId> --locale en --source <sheet-url> --tab EN --resync --dry-run --output json
86
87
  ```
87
88
 
88
- Use `sync` to resync the stored rows from Google Sheets and refresh AI-translated variants. Use `translate` to enable or refresh explicit AI locales. Use `vectorize` after enabling vectorization or changing vector columns. Use `copy-to --display-name "Use cases"` for the Gemini use-case list flow, then `attach-page` when the list must be embedded in a normal page. Use `set-source --resync` to swap a locale to another spreadsheet tab and refresh it in one CLI call. All writes require `--dry-run` or `--yes`.
89
+ Use `sync` to resync the stored rows from Google Sheets and refresh AI-translated variants. Use `translate` to enable or refresh explicit AI locales. Use `patch-cells` for focused row-cell updates such as capture links without replacing the whole grid. Use `vectorize` after enabling vectorization or changing vector columns. Use `copy-to --display-name "Use cases"` for the Gemini use-case list flow, then `attach-page` when the list must be embedded in a normal page. Use `set-source --resync` to swap a locale to another spreadsheet tab and refresh it in one CLI call. All writes require `--dry-run` or `--yes`.
90
+
91
+ `patch-cells` accepts a JSON object with a `patches` array:
92
+
93
+ ```json
94
+ {
95
+ "patches": [
96
+ {
97
+ "locale": "fr",
98
+ "rowIndex": 12,
99
+ "columnHeader": "Capture_link",
100
+ "rawValue": "https://lh7-qw.googleusercontent.com/docsz/..."
101
+ }
102
+ ]
103
+ }
104
+ ```
105
+
106
+ Each patch uses `locale`, `rowId` or `rowIndex`, `columnId` or `columnHeader`, and `rawValue`. Dry-runs resolve the real row and column and show before/after samples. Applied patches write through the authenticated app API, log an admin event, and invalidate deploy cache unless `--no-cache` is passed.
89
107
 
90
108
  Operational helpers are available for the admin-only flows agents should not improvise:
91
109
 
@@ -1609,6 +1609,7 @@ var runImportedSheetsCommand = async (action, importedSheetId, ctx) => {
1609
1609
  "translate",
1610
1610
  "retranslate",
1611
1611
  "replace-grid",
1612
+ "patch-cells",
1612
1613
  "vectorize",
1613
1614
  "repair-french",
1614
1615
  "copy-to",
@@ -1719,7 +1720,7 @@ var runImportedSheetsCommand = async (action, importedSheetId, ctx) => {
1719
1720
  body: JSON.stringify({ instanceId, sourceInput })
1720
1721
  });
1721
1722
  }
1722
- if (["create", "update", "sync", "enable-locales", "translate", "retranslate", "replace-grid", "vectorize", "repair-french", "delete"].includes(action)) {
1723
+ if (["create", "update", "sync", "enable-locales", "translate", "retranslate", "replace-grid", "patch-cells", "vectorize", "repair-french", "delete"].includes(action)) {
1723
1724
  requireWriteConfirmation("Imported sheet operation writes production data. Add --yes or use --dry-run.", ctx);
1724
1725
  }
1725
1726
  if (action === "create") {
@@ -1823,6 +1824,24 @@ var runImportedSheetsCommand = async (action, importedSheetId, ctx) => {
1823
1824
  body: JSON.stringify(payload)
1824
1825
  });
1825
1826
  }
1827
+ if (action === "patch-cells") {
1828
+ const data = await parseJsonObjectFlag(ctx, "data", "data-file");
1829
+ if (Object.keys(data).length === 0)
1830
+ throw new CliError("Missing --data or --data-file JSON", 2);
1831
+ const payload = {
1832
+ instanceId,
1833
+ ...data,
1834
+ locale: getStringFlag(ctx, "locale") ?? getStringFlag(ctx, "language") ?? data.locale,
1835
+ revectorize: hasFlag(ctx, "revectorize") || Boolean(data.revectorize),
1836
+ skipCache: hasFlag(ctx, "no-cache") || Boolean(data.skipCache),
1837
+ cacheScope: getStringFlag(ctx, "cache-scope") ?? data.cacheScope,
1838
+ dryRun: hasFlag(ctx, "dry-run")
1839
+ };
1840
+ return requestApi(`/api/cli/imported-sheets/${importedSheetId}/patch-cells`, {
1841
+ method: "POST",
1842
+ body: JSON.stringify(payload)
1843
+ });
1844
+ }
1826
1845
  if (action === "vectorize") {
1827
1846
  const payload = {
1828
1847
  instanceId,
@@ -2256,6 +2275,7 @@ var schemaHelp = () => ({
2256
2275
  { name: "imported-sheets translate", args: ["id"], required: ["--instance", "--to"], flags: ["--yes", "--dry-run"], writes: true },
2257
2276
  { name: "imported-sheets retranslate", args: ["id"], required: ["--instance", "--to"], flags: ["--from", "--revectorize", "--yes", "--dry-run"], writes: true },
2258
2277
  { name: "imported-sheets replace-grid", args: ["id"], required: ["--instance", "--locale", "--data or --data-file"], flags: ["--rebuild-columns", "--revectorize", "--yes", "--dry-run"], writes: true },
2278
+ { name: "imported-sheets patch-cells", args: ["id"], required: ["--instance", "--data or --data-file"], flags: ["--locale", "--revectorize", "--cache-scope", "--no-cache", "--yes", "--dry-run"], writes: true },
2259
2279
  { name: "imported-sheets vectorize", args: ["id"], required: ["--instance"], flags: ["--locales", "--yes", "--dry-run"], writes: true },
2260
2280
  { name: "imported-sheets repair-french", args: ["id"], required: ["--instance"], flags: ["--locales", "--revectorize", "--yes", "--dry-run"], writes: true },
2261
2281
  { name: "imported-sheets copy-to", args: ["id"], required: ["--instance", "--target or --targets"], flags: ["--display-name", "--replace", "--revectorize", "--yes", "--dry-run"], writes: true },
@@ -2400,6 +2420,7 @@ var importedSheetsHelp = () => ({
2400
2420
  "gskills-admin imported-sheets translate <sheetId> --instance <instanceId> --to en,es --dry-run",
2401
2421
  "gskills-admin imported-sheets retranslate <sheetId> --instance <instanceId> --from en --to fr,de,es --dry-run",
2402
2422
  "gskills-admin imported-sheets replace-grid <sheetId> --instance <instanceId> --locale en --data-file ./grid.json --rebuild-columns --dry-run",
2423
+ "gskills-admin imported-sheets patch-cells <sheetId> --instance <instanceId> --data-file ./cell-patches.json --dry-run",
2403
2424
  "gskills-admin imported-sheets vectorize <sheetId> --instance <instanceId> --locales fr,en --dry-run",
2404
2425
  "gskills-admin imported-sheets repair-french <sheetId> --instance <instanceId> --locales es,it --revectorize --dry-run",
2405
2426
  "gskills-admin imported-sheets copy-to <sheetId> --instance global --target <instanceId> --display-name 'Use cases' --dry-run",
@@ -2407,7 +2428,23 @@ var importedSheetsHelp = () => ({
2407
2428
  "gskills-admin imported-sheets set-source <sheetId> --instance <instanceId> --locale en --source <sheet-url> --tab EN --resync --dry-run",
2408
2429
  "gskills-admin imported-sheets delete <sheetId> --instance <instanceId> --force --confirm-delete imported-sheets:<sheetId> --dry-run"
2409
2430
  ],
2410
- writes: "create, update, sync, translate, retranslate, replace-grid, vectorize, repair-french, copy-to, attach-page, set-source and delete require --yes or --dry-run.",
2431
+ writes: "create, update, sync, translate, retranslate, replace-grid, patch-cells, vectorize, repair-french, copy-to, attach-page, set-source and delete require --yes or --dry-run.",
2432
+ patchCellsDataShape: {
2433
+ patches: [
2434
+ {
2435
+ locale: "fr",
2436
+ rowIndex: 12,
2437
+ columnHeader: "Capture_link",
2438
+ rawValue: "https://lh7-qw.googleusercontent.com/docsz/..."
2439
+ },
2440
+ {
2441
+ locale: "en",
2442
+ rowId: "row_id_from_imported_sheets_get",
2443
+ columnId: "column_id_from_imported_sheets_get",
2444
+ rawValue: null
2445
+ }
2446
+ ]
2447
+ },
2411
2448
  createDataShape: {
2412
2449
  instanceId: "global",
2413
2450
  displayName: "Cas d'usage Gemini",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@numericoach/gskills-admin-cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin-only CLI for GSkills super-admin operations.",
@@ -124,9 +124,48 @@ These recurring historical DB-only jobs now have CLI paths:
124
124
  | Force relogin after access/auth data change | `gskills-admin sessions invalidate --email user@example.com --dry-run --output json` |
125
125
  | Find content-assistant artifact links | `gskills-admin content-assistant lookup --query "artifact title" --output json` |
126
126
  | Admin ingest incomplete sync repair | `gskills-admin admin-ingest repair-state --instance <instanceId> --output json` then `gskills-admin admin-ingest repair --instance <instanceId> --dry-run --output json` |
127
+ | Imported-sheet row-cell repair or media enrichment | `gskills-admin imported-sheets patch-cells <sheetId> --instance <instanceId> --data-file ./cell-patches.json --dry-run --output json` |
127
128
 
128
129
  If a job is not in this table, first try `gskills-admin schema --output json` and resource CRUD. If the route is still missing and the job is recurring, add the CLI route before reaching for direct DB access.
129
130
 
131
+ ## Imported Sheet Cell Updates
132
+
133
+ Use `patch-cells` for focused imported-sheet row-cell updates, especially when a script already has the right target rows from `imported-sheets get`.
134
+
135
+ ```bash
136
+ gskills-admin imported-sheets patch-cells <sheetId> --instance global --data-file ./cell-patches.json --dry-run --output json
137
+ gskills-admin imported-sheets patch-cells <sheetId> --instance global --data-file ./cell-patches.json --yes --output json
138
+ ```
139
+
140
+ Patch file shape:
141
+
142
+ ```json
143
+ {
144
+ "patches": [
145
+ {
146
+ "locale": "fr",
147
+ "rowIndex": 12,
148
+ "columnHeader": "Capture_link",
149
+ "rawValue": "https://lh7-qw.googleusercontent.com/docsz/..."
150
+ },
151
+ {
152
+ "locale": "en",
153
+ "rowId": "row_id_from_imported_sheets_get",
154
+ "columnId": "column_id_from_imported_sheets_get",
155
+ "rawValue": null
156
+ }
157
+ ]
158
+ }
159
+ ```
160
+
161
+ Rules:
162
+
163
+ - Always dry-run first. The server resolves real locale, row and column and shows before/after samples.
164
+ - Prefer `rowId` and `columnId` when they are available from `imported-sheets get`; use `rowIndex` and `columnHeader` only when the row order and headers were just verified.
165
+ - By default the command invalidates deploy cache for touched locales. Use `--no-cache` only for internal fields that cannot affect visible deploy pages.
166
+ - Use `--revectorize` only when patched cells are included in vectorization. Media or link-only fixes usually do not need it.
167
+ - Do not write direct DB scripts for repeatable imported-sheet edits. Add a CLI route or use `patch-cells`.
168
+
130
169
  ## Instance Rules
131
170
 
132
171
  If `--instance` is omitted, content-like resources default to `instanceId = "global"`.