qatools-cli 1.1.7 → 1.1.8

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.
Files changed (2) hide show
  1. package/package.json +5 -1
  2. package/qatools.js +31 -0
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "qatools-cli",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
5
+ "scripts": {
6
+ "release": "npm version patch --no-git-tag-version && npm publish",
7
+ "release:minor": "npm version minor --no-git-tag-version && npm publish"
8
+ },
5
9
  "bin": {
6
10
  "qatools": "./qatools.js"
7
11
  },
package/qatools.js CHANGED
@@ -465,6 +465,7 @@ program
465
465
  .option("--parent <label>", "Parent item label (e.g. BUG-5)")
466
466
  .option("--requirement-key <key>", "Requirement key (e.g. auth.login)")
467
467
  .option("--tags <tags>", "Tags (comma-separated)")
468
+ .option("--notify", "Enable email notifications on this item (default off)")
468
469
  .option("-e, --email <email>", "Login email")
469
470
  .option("-p, --password <password>", "Login password")
470
471
  .action(async (options) => {
@@ -486,6 +487,7 @@ program
486
487
  parentId: options.parent || "",
487
488
  requirementKey: options.requirementKey || "",
488
489
  tags: options.tags ? options.tags.split(",").map(t => t.trim().toLowerCase()) : [],
490
+ mailNotify: !!options.notify,
489
491
  });
490
492
  console.log(`Created: ${result.data.type.toUpperCase()}-${result.data.bugNumber} (${result.data.id})`);
491
493
  if (options.tags) console.log(` Tags: ${options.tags}`);
@@ -496,6 +498,33 @@ program
496
498
  process.exit(0);
497
499
  });
498
500
 
501
+ program
502
+ .command("notify")
503
+ .description("Send a deliberate notification email to a project member (respects their opt-out)")
504
+ .requiredOption("--to <email>", "Recipient (must be a member of the project)")
505
+ .requiredOption("--subject <text>", "Email subject")
506
+ .requiredOption("--message <text>", "Email body (plain text)")
507
+ .option("--project <id>", "Target project ID (overrides default)")
508
+ .option("-e, --email <email>", "Login email")
509
+ .option("-p, --password <password>", "Login password")
510
+ .action(async (options) => {
511
+ await authenticate(options);
512
+ const creds = getCredentials();
513
+ const projectId = options.project || creds?.projectId;
514
+ if (!projectId) { console.error("No project configured. Run: qatools setup, or pass --project <id>"); process.exit(1); }
515
+
516
+ const notify = httpsCallable(functions, "notifyUser");
517
+ try {
518
+ const result = await notify({ projectId, to: options.to, subject: options.subject, message: options.message });
519
+ if (result.data.skipped) console.log(`Skipped ${options.to}: ${result.data.reason}`);
520
+ else console.log(`Sent to ${result.data.to}`);
521
+ } catch (e) {
522
+ console.error("Failed:", e.message);
523
+ process.exit(1);
524
+ }
525
+ process.exit(0);
526
+ });
527
+
499
528
  program
500
529
  .command("templates")
501
530
  .description("List templates and their review status")
@@ -1290,6 +1319,7 @@ program
1290
1319
  .option("--requirement-key <key>", "Set requirement key")
1291
1320
  .option("--tags <tags>", "Set tags (comma-separated, replaces existing)")
1292
1321
  .option("--description <text>", "Update description")
1322
+ .option("--notify <on|off>", "Turn item email notifications on/off")
1293
1323
  .option("--author <name>", "Author name for comments (default: your email)", "Claude")
1294
1324
  .option("--skip-test-verification", "Allow setting status=resolved without going through ready_for_test (use only when no test applies). Evidence is still required.")
1295
1325
  .option("--project <id>", "Target project ID (overrides default; needed for status pre-check)")
@@ -1317,6 +1347,7 @@ program
1317
1347
  if (options.requirementKey) u.requirementKey = options.requirementKey;
1318
1348
  if (options.tags) u.tags = options.tags.split(",").map(t => t.trim().toLowerCase());
1319
1349
  if (options.description) u.description = options.description;
1350
+ if (options.notify) u.mailNotify = options.notify === 'on';
1320
1351
  updates[options.id] = u;
1321
1352
  } else {
1322
1353
  console.error("Provide --file or --id");