@numericoach/gskills-admin-cli 0.1.4 → 0.1.5

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
@@ -41,7 +41,7 @@ gskills-admin cache invalidate --instance <instanceId> --scope menu-bundle --yes
41
41
  Operational helpers are available for the admin-only flows agents should not improvise:
42
42
 
43
43
  ```bash
44
- gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body "Bonjour..." --dry-run --output json
44
+ gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --dry-run --output json
45
45
  gskills-admin access grant --user <userId> --type DEFAULT --dry-run --output json
46
46
  gskills-admin instances create-plan --output json
47
47
  gskills-admin instances create --data '{"name":"Client","URL":"client","licenceType":"STARTER","tokensAllowed":50}' --dry-run --output json
@@ -690,7 +690,7 @@ var resourceHelpRows = () => resources.map((resource) => ({
690
690
  aliases: resource.aliases.join(", ")
691
691
  }));
692
692
  // ../../src/cli/commands.ts
693
- import { cp, mkdir as mkdir2, stat } from "node:fs/promises";
693
+ import { cp, mkdir as mkdir2, readFile as readFile2, stat } from "node:fs/promises";
694
694
  import { dirname as dirname2, join as join2 } from "node:path";
695
695
  import { fileURLToPath } from "node:url";
696
696
  var runCommand = async (ctx) => {
@@ -907,8 +907,10 @@ var runFeedbackCommand = async (action, feedbackId, ctx) => {
907
907
  if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
908
908
  throw new CliError("Sending feedback reply email requires --yes or --dry-run", 2);
909
909
  }
910
- const subject = getStringFlag(ctx, "subject");
911
- const body = getStringFlag(ctx, "body");
910
+ const subject = await getTextFlag(ctx, "subject", "subject-file");
911
+ const body = await getTextFlag(ctx, "body", "body-file");
912
+ const translatedSubject = await getTextFlag(ctx, "translated-subject", "translated-subject-file");
913
+ const translatedBody = await getTextFlag(ctx, "translated-body", "translated-body-file");
912
914
  if (!subject || !body)
913
915
  throw new CliError("Missing --subject or --body", 2);
914
916
  return requestApi("/api/cli/feedback/send-reply", {
@@ -917,8 +919,8 @@ var runFeedbackCommand = async (action, feedbackId, ctx) => {
917
919
  feedbackId,
918
920
  subject,
919
921
  body,
920
- translatedSubject: getStringFlag(ctx, "translated-subject"),
921
- translatedBody: getStringFlag(ctx, "translated-body"),
922
+ translatedSubject,
923
+ translatedBody,
922
924
  userLanguage: getStringFlag(ctx, "user-language"),
923
925
  currentLanguage: getStringFlag(ctx, "current-language") ?? "fr",
924
926
  dryRun: hasFlag(ctx, "dry-run")
@@ -1354,6 +1356,13 @@ var getStringFlag = (ctx, name) => {
1354
1356
  return value;
1355
1357
  return;
1356
1358
  };
1359
+ var getTextFlag = async (ctx, inlineName, fileName) => {
1360
+ const filePath = getStringFlag(ctx, fileName);
1361
+ if (filePath) {
1362
+ return readFile2(filePath, "utf8");
1363
+ }
1364
+ return getStringFlag(ctx, inlineName);
1365
+ };
1357
1366
  var getNumberFlag = (ctx, name) => {
1358
1367
  const value = getStringFlag(ctx, name);
1359
1368
  if (!value)
@@ -1405,7 +1414,7 @@ var schemaHelp = () => ({
1405
1414
  { name: "cache invalidate", required: ["--instance"], flags: ["--scope", "--languages", "--yes", "--dry-run"], writes: true },
1406
1415
  { name: "feedback claim", args: ["feedbackId"], flags: ["--dry-run"], writes: true },
1407
1416
  { name: "feedback send-claim", args: ["feedbackId"], flags: ["--recipient-email", "--recipient-name", "--cc", "--subject", "--body", "--yes", "--dry-run"], writes: true },
1408
- { name: "feedback send-reply", args: ["feedbackId"], flags: ["--subject", "--body", "--translated-subject", "--translated-body", "--user-language", "--current-language", "--yes", "--dry-run"], writes: true },
1417
+ { name: "feedback send-reply", args: ["feedbackId"], flags: ["--subject", "--subject-file", "--body", "--body-file", "--translated-subject", "--translated-subject-file", "--translated-body", "--translated-body-file", "--user-language", "--current-language", "--yes", "--dry-run"], writes: true },
1409
1418
  { name: "access grant", required: ["--user"], flags: ["--type", "--start-at", "--custom-duration-days", "--preferred-language", "--yes", "--dry-run"], writes: true },
1410
1419
  { name: "access revoke-active", required: ["--user"], flags: ["--yes", "--dry-run"], writes: true },
1411
1420
  { name: "instances create-plan", writes: false },
@@ -1479,8 +1488,8 @@ var cacheHelp = () => ({
1479
1488
  });
1480
1489
  var feedbackHelp = () => ({
1481
1490
  usage: [
1482
- "gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body 'Bonjour...' --dry-run",
1483
- "gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body 'Bonjour...' --yes",
1491
+ "gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body-file ./reply.fr.txt --dry-run",
1492
+ "gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body-file ./reply.fr.txt --yes",
1484
1493
  "gskills-admin feedback claim <feedbackId> --dry-run",
1485
1494
  "gskills-admin feedback claim <feedbackId>",
1486
1495
  "gskills-admin feedback send-claim <feedbackId> --recipient-email user@example.com --subject '...' --body '...' --yes"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@numericoach/gskills-admin-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin-only CLI for GSkills super-admin operations.",
@@ -263,14 +263,22 @@ gskills-admin cache invalidate --instance <instanceId> --scope all --yes --outpu
263
263
  Use `send-reply` for the normal email available from the feedback detail dialog. It uses the `GSkillsEmail` template, sends to the feedback user, stores a `FeedbackReply`, updates `repliedAt`, and writes admin logs.
264
264
 
265
265
  ```bash
266
- gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body "Bonjour..." --dry-run --output json
267
- gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body "Bonjour..." --yes --output json
266
+ gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --dry-run --output json
267
+ gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --yes --output json
268
268
  ```
269
269
 
270
- If the user language differs from French, pass the edited translated fields generated or reviewed by the agent:
270
+ Always answer in the language of the user's feedback or the user's UI language. If the feedback is in English, answer in English. If it is in Portuguese, answer in Portuguese. Do not default to French unless the feedback/user language is French.
271
+
272
+ For same-language replies, pass both language flags with that language:
273
+
274
+ ```bash
275
+ gskills-admin feedback send-reply <feedbackId> --subject "GSkills - Reply" --body-file ./reply.en.txt --user-language en --current-language en --dry-run --output json
276
+ ```
277
+
278
+ If you intentionally draft in French and provide a translated version, pass the translated fields:
271
279
 
272
280
  ```bash
273
- gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body "Bonjour..." --translated-subject "GSkills - ..." --translated-body "Hello..." --user-language en --current-language fr --dry-run --output json
281
+ gskills-admin feedback send-reply <feedbackId> --subject "GSkills - Réponse" --body-file ./reply.fr.txt --translated-subject "GSkills - Reply" --translated-body-file ./reply.en.txt --user-language en --current-language fr --dry-run --output json
274
282
  ```
275
283
 
276
284
  The claim commands below are not the normal feedback reply system. They are only for the SLA "ticket pris en charge" flow.
@@ -285,6 +293,7 @@ gskills-admin feedback send-claim <feedbackId> --recipient-email user@example.co
285
293
  Rules:
286
294
 
287
295
  - For normal feedback responses, use `send-reply`.
296
+ - For multi-line email bodies, use `--body-file` and `--translated-body-file`; avoid inline shell strings for real sends.
288
297
  - Dry-run claim first to inspect recipient, CC recipients and draft.
289
298
  - Send only after the ticket is claimed by the same CLI user.
290
299
  - CC recipients must be allowed by instance SLA flags.