@numericoach/gskills-admin-cli 0.1.9 → 0.1.11

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
@@ -62,7 +62,7 @@ gskills-admin ambassadors label --instance <instanceId> --language fr --output j
62
62
 
63
63
  Feedback reply bodies are file-based on purpose. Production replies are multi-line, and `send-reply` rejects inline body text to avoid shell parsing surprises.
64
64
 
65
- Raw project and analytics data can be read or adjusted through resources such as `project-data`, `ticket-sla-rules`, `analytics`, `quiz-attempts`, `user-paths`, `chromebook-progress`, `user-badges`, `user-learning-paths`, and `user-learning-path-item-completions`.
65
+ Raw project and analytics data can be read or adjusted through resources such as `project-data`, `ticket-sla-rules`, `learning-path-items`, `learning-path-groups`, `quiz-questions`, `quiz-options`, `analytics`, `quiz-attempts`, `user-paths`, `chromebook-progress`, `user-badges`, `user-learning-paths`, and `user-learning-path-item-completions`.
66
66
 
67
67
  ## Agent skill
68
68
 
@@ -177,9 +177,11 @@ var loginWithGSkills = async (input) => {
177
177
  const startUrl = new URL("/api/cli/auth/start", baseUrl);
178
178
  startUrl.searchParams.set("redirect_uri", redirectUri);
179
179
  startUrl.searchParams.set("state", state);
180
- await openUrl(startUrl.toString());
181
- process.stderr.write(`Opened ${startUrl.toString()}
180
+ const opened = await openUrl(startUrl.toString());
181
+ if (opened) {
182
+ process.stderr.write(`Opened ${startUrl.toString()}
182
183
  `);
184
+ }
183
185
  });
184
186
  if (callback.state !== state) {
185
187
  throw new CliError("GSkills auth state mismatch", 403);
@@ -285,13 +287,15 @@ var normalizeBaseUrl = (value) => {
285
287
  return url.toString().replace(/\/$/, "");
286
288
  };
287
289
  var openUrl = async (url) => {
288
- const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
289
- const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
290
+ const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "powershell.exe" : "xdg-open";
291
+ const args = process.platform === "win32" ? ["-NoProfile", "-NonInteractive", "-Command", "Start-Process -FilePath $args[0]", url] : [url];
290
292
  try {
291
293
  await execFileAsync(command, args);
294
+ return true;
292
295
  } catch {
293
296
  process.stderr.write(`Could not open browser automatically. Use ${url}
294
297
  `);
298
+ return false;
295
299
  }
296
300
  };
297
301
 
@@ -377,6 +381,26 @@ var resources = [
377
381
  dangerousDelete: true,
378
382
  cacheScopes: ["pages", "pages-knowledge"]
379
383
  },
384
+ {
385
+ name: "learning-path-items",
386
+ delegate: "learningPathItem",
387
+ label: "Learning path items",
388
+ aliases: ["learning-path-item", "path-items", "path-item"],
389
+ defaultFields: ["id", "learningPathId", "type", "order", "groupId", "pageId", "resourceId", "knowledgeId", "quizId", "estimatedTimeInMinutes", "sourceItemId"],
390
+ instanceField: null,
391
+ dangerousDelete: true,
392
+ cacheScopes: ["pages", "pages-knowledge"]
393
+ },
394
+ {
395
+ name: "learning-path-groups",
396
+ delegate: "learningPathGroup",
397
+ label: "Learning path groups",
398
+ aliases: ["learning-path-group", "path-groups", "path-group"],
399
+ defaultFields: ["id", "learningPathId", "title", "description", "order", "sourceGroupId", "updatedAt"],
400
+ instanceField: null,
401
+ dangerousDelete: true,
402
+ cacheScopes: ["pages", "pages-knowledge"]
403
+ },
380
404
  {
381
405
  name: "changelogs",
382
406
  delegate: "changelog",
@@ -465,6 +489,26 @@ var resources = [
465
489
  dangerousDelete: true,
466
490
  cacheScopes: ["pages", "pages-knowledge"]
467
491
  },
492
+ {
493
+ name: "quiz-questions",
494
+ delegate: "question",
495
+ label: "Quiz questions",
496
+ aliases: ["quiz-question", "questions", "question"],
497
+ defaultFields: ["id", "quizId", "text", "type", "language", "order", "points", "parentId", "updatedAt"],
498
+ instanceField: null,
499
+ dangerousDelete: true,
500
+ cacheScopes: ["pages", "pages-knowledge"]
501
+ },
502
+ {
503
+ name: "quiz-options",
504
+ delegate: "option",
505
+ label: "Quiz options",
506
+ aliases: ["quiz-option", "options", "option"],
507
+ defaultFields: ["id", "questionId", "text", "language", "isCorrect", "order", "explanation", "parentId", "updatedAt"],
508
+ instanceField: null,
509
+ dangerousDelete: true,
510
+ cacheScopes: ["pages", "pages-knowledge"]
511
+ },
468
512
  {
469
513
  name: "badges",
470
514
  delegate: "badge",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@numericoach/gskills-admin-cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Admin-only CLI for GSkills super-admin operations.",