jiradc-cli 1.0.22 → 1.0.23-g3f22a81.1

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/dist/index.js +46 -13
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -48,6 +48,39 @@ function positiveInt(raw) {
48
48
  return n;
49
49
  }
50
50
 
51
+ // ../../cli-utils/dist/resolve-arg.js
52
+ import { readFileSync as readFileSync3 } from "fs";
53
+ import { InvalidArgumentError as InvalidArgumentError2 } from "commander";
54
+ var RESOLVE_ARG_HINT = "(@- reads stdin, @<path> reads a file)";
55
+ function resolveArgValue(raw) {
56
+ if (raw === "@-") {
57
+ if (process.stdin.isTTY) {
58
+ throw new InvalidArgumentError2('received "@-" but stdin is a terminal (nothing piped). Pipe data in (e.g. `... | cmd --body @-`), or pass the value directly.');
59
+ }
60
+ try {
61
+ return readFileSync3(0, "utf8");
62
+ } catch (err) {
63
+ throw new InvalidArgumentError2(`failed to read from stdin for "@-": ${err.message}`);
64
+ }
65
+ }
66
+ if (raw.startsWith("@@")) {
67
+ return raw.slice(1);
68
+ }
69
+ if (raw.startsWith("@")) {
70
+ const path = raw.slice(1);
71
+ try {
72
+ return readFileSync3(path, "utf8");
73
+ } catch (err) {
74
+ const e = err;
75
+ if (e.code === "ENOENT") {
76
+ throw new InvalidArgumentError2(`file not found: "${path}" (resolved from "${raw}"). Use "@-" to read stdin, "@<path>" to read a file, or "@@${path}" to pass the literal text "@${path}".`);
77
+ }
78
+ throw new InvalidArgumentError2(`failed to read file "${path}" (resolved from "${raw}"): ${e.message}`);
79
+ }
80
+ }
81
+ return raw;
82
+ }
83
+
51
84
  // ../../cli-utils/dist/registry.js
52
85
  var SUB_ENTITY_ID_NUMERIC = {
53
86
  comment: true,
@@ -78,7 +111,7 @@ function subEntityOption(cmd, entity, opts = {}) {
78
111
  return defineOption(cmd, `--${entity}-id <id>`, description, numeric ? positiveInt : void 0, opts.mandatory);
79
112
  }
80
113
  function bodyOption(cmd, opts = {}) {
81
- return defineOption(cmd, "--body <text>", "Prose body content", void 0, opts.mandatory);
114
+ return defineOption(cmd, "--body <text>", `Prose body content ${RESOLVE_ARG_HINT}`, resolveArgValue, opts.mandatory);
82
115
  }
83
116
  var EXAMPLES = /* @__PURE__ */ new WeakSet();
84
117
  function commandPath(cmd) {
@@ -717,7 +750,7 @@ var ASSIGNEE_TYPES = [
717
750
  "UNASSIGNED"
718
751
  ];
719
752
  function create(parent) {
720
- const cmd = parent.command("create").description("Create a new component in a project").requiredOption("--project <key>", "Project key (e.g., AI)").requiredOption("--name <name>", "Component name").option("--description <text>", "Component description").option("--lead <username>", "Username of the component lead").addOption(new Option2("--assignee-type <type>", "Assignee strategy").choices(ASSIGNEE_TYPES));
753
+ const cmd = parent.command("create").description("Create a new component in a project").requiredOption("--project <key>", "Project key (e.g., AI)").requiredOption("--name <name>", "Component name").option("--description <text>", `Component description ${RESOLVE_ARG_HINT}`, resolveArgValue).option("--lead <username>", "Username of the component lead").addOption(new Option2("--assignee-type <type>", "Assignee strategy").choices(ASSIGNEE_TYPES));
721
754
  examples(cmd, [
722
755
  "--project AI --name Backend",
723
756
  '--project AI --name Frontend --description "UI work" --lead jsmith',
@@ -791,7 +824,7 @@ var ASSIGNEE_TYPES2 = [
791
824
  "UNASSIGNED"
792
825
  ];
793
826
  function update(parent) {
794
- const cmd = parent.command("update <id>").description("Update an existing component (only provided fields are changed)").option("--name <name>", "New component name").option("--description <text>", "New component description").option("--lead <username>", "Username of the component lead (empty string clears it)").addOption(new Option3("--assignee-type <type>", "New assignee strategy").choices(ASSIGNEE_TYPES2));
827
+ const cmd = parent.command("update <id>").description("Update an existing component (only provided fields are changed)").option("--name <name>", "New component name").option("--description <text>", `New component description ${RESOLVE_ARG_HINT}`, resolveArgValue).option("--lead <username>", "Username of the component lead (empty string clears it)").addOption(new Option3("--assignee-type <type>", "New assignee strategy").choices(ASSIGNEE_TYPES2));
795
828
  examples(cmd, [
796
829
  "11289 --name Backend",
797
830
  '11289 --description "Server-side code"',
@@ -1254,7 +1287,7 @@ function registerCommentCommands(parent) {
1254
1287
 
1255
1288
  // src/commands/issue/create.ts
1256
1289
  function create3(parent) {
1257
- const cmd = parent.command("create").description("Create a new issue").requiredOption("--project <key>", "Project key or ID").requiredOption("--type <name>", "Issue type name (e.g., Task, Bug, Story)").requiredOption("--summary <text>", "Issue summary/title").option("--description <text>", "Issue description in wiki markup").option("--assignee <username>", "Assignee username").option("--reporter <username>", "Reporter username").option("--priority <name>", "Priority name (e.g., High, Medium, Low)").option("--labels <labels>", "Comma-separated labels").option("--components <names>", "Comma-separated component names").option("--fix-versions <versions>", "Comma-separated fix version names").option("--due-date <date>", "Due date in YYYY-MM-DD format").option("--parent <key>", "Parent issue key (for subtasks)").option("--custom-fields <json>", `Additional custom fields as JSON (e.g., '{"customfield_10100": "EPIC-1"}')`);
1290
+ const cmd = parent.command("create").description("Create a new issue").requiredOption("--project <key>", "Project key or ID").requiredOption("--type <name>", "Issue type name (e.g., Task, Bug, Story)").requiredOption("--summary <text>", "Issue summary/title").option("--description <text>", `Issue description in wiki markup ${RESOLVE_ARG_HINT}`, resolveArgValue).option("--assignee <username>", "Assignee username").option("--reporter <username>", "Reporter username").option("--priority <name>", "Priority name (e.g., High, Medium, Low)").option("--labels <labels>", "Comma-separated labels").option("--components <names>", "Comma-separated component names").option("--fix-versions <versions>", "Comma-separated fix version names").option("--due-date <date>", "Due date in YYYY-MM-DD format").option("--parent <key>", "Parent issue key (for subtasks)").option("--custom-fields <json>", `Additional custom fields as JSON (e.g., '{"customfield_10100": "EPIC-1"}')`);
1258
1291
  examples(cmd, [
1259
1292
  '--project PROJ --type Task --summary "Fix login bug"',
1260
1293
  '--project PROJ --type Story --summary "New feature" --assignee jsmith --priority High',
@@ -1454,7 +1487,7 @@ function linkTypes(parent) {
1454
1487
 
1455
1488
  // src/commands/issue/link.ts
1456
1489
  function link(parent) {
1457
- const cmd = parent.command("link").description("Link two issues together").requiredOption("--type <name>", "Link type name (e.g., 'Blocks', 'Duplicate', 'Relates')").requiredOption("--from <key>", 'Source issue key (e.g., the issue that "blocks")').requiredOption("--to <key>", 'Target issue key (e.g., the issue that "is blocked by")').option("--comment <text>", "Optional comment");
1490
+ const cmd = parent.command("link").description("Link two issues together").requiredOption("--type <name>", "Link type name (e.g., 'Blocks', 'Duplicate', 'Relates')").requiredOption("--from <key>", 'Source issue key (e.g., the issue that "blocks")').requiredOption("--to <key>", 'Target issue key (e.g., the issue that "is blocked by")').option("--comment <text>", `Optional comment ${RESOLVE_ARG_HINT}`, resolveArgValue);
1458
1491
  examples(cmd, [
1459
1492
  "--type Relates --from AI-154 --to AI-149",
1460
1493
  ["--type Blocks --from PROJ-456 --to PROJ-123", "PROJ-456 blocks PROJ-123"]
@@ -1499,7 +1532,7 @@ function search2(parent) {
1499
1532
 
1500
1533
  // src/commands/issue/transition.ts
1501
1534
  function transition(parent) {
1502
- const cmd = parent.command("transition <key>").description("Transition issue to a new status").requiredOption("--to <idOrName>", "Transition ID, or status name (case-insensitive)").option("--comment <text>", "Comment to add during transition");
1535
+ const cmd = parent.command("transition <key>").description("Transition issue to a new status").requiredOption("--to <idOrName>", "Transition ID, or status name (case-insensitive)").option("--comment <text>", `Comment to add during transition ${RESOLVE_ARG_HINT}`, resolveArgValue);
1503
1536
  examples(cmd, [
1504
1537
  "PROJ-123 --to 31",
1505
1538
  'PROJ-123 --to "In Review"',
@@ -1559,20 +1592,20 @@ function unlink2(parent) {
1559
1592
  }
1560
1593
 
1561
1594
  // src/utils/multi-value.ts
1562
- import { InvalidArgumentError as InvalidArgumentError2 } from "commander";
1595
+ import { InvalidArgumentError as InvalidArgumentError3 } from "commander";
1563
1596
  function parseMultiValue(flagName, raw) {
1564
1597
  const items = raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
1565
1598
  if (items.length === 0) {
1566
- throw new InvalidArgumentError2(`${flagName} cannot be empty`);
1599
+ throw new InvalidArgumentError3(`${flagName} cannot be empty`);
1567
1600
  }
1568
1601
  const lonePrefix = items.find((s) => s === "+" || s === "-");
1569
1602
  if (lonePrefix !== void 0) {
1570
- throw new InvalidArgumentError2(`${flagName} has an empty value after '${lonePrefix}' prefix`);
1603
+ throw new InvalidArgumentError3(`${flagName} has an empty value after '${lonePrefix}' prefix`);
1571
1604
  }
1572
1605
  const prefixed = items.filter((s) => s.startsWith("+") || s.startsWith("-"));
1573
1606
  const bare = items.filter((s) => !s.startsWith("+") && !s.startsWith("-"));
1574
1607
  if (prefixed.length > 0 && bare.length > 0) {
1575
- throw new InvalidArgumentError2(
1608
+ throw new InvalidArgumentError3(
1576
1609
  `${flagName} mixes set and mutate syntax. Either all values have +/- prefix, or none do.`
1577
1610
  );
1578
1611
  }
@@ -1594,7 +1627,7 @@ function buildSetValue(parsed, wrap) {
1594
1627
  return parsed.values.map(wrap);
1595
1628
  }
1596
1629
  function update3(parent) {
1597
- const cmd = parent.command("update <key>").description("Update issue fields").option("--fields <json>", "JSON string of fields to update (advanced; merges with shortcuts, wins on conflict)").option("--no-notify-users", "Suppress notification emails (default: notify)").option("--attachments <paths>", "Comma-separated local file paths to attach").option("--summary <text>", "Set the issue summary").option("--description <text>", "Set the issue description (wiki markup)").option("--priority <name>", "Set the priority by name (e.g. High)").option("--assignee <user>", 'Set the assignee. Username, "me", or "none" to unassign.').option("--labels <list>", 'Set labels ("a,b,c") or mutate ("+add,-remove")').option("--components <list>", 'Set components ("a,b") or mutate ("+add,-remove")').option("--fix-versions <list>", 'Set fix versions ("1.0,2.0") or mutate ("+1.0,-0.9")');
1630
+ const cmd = parent.command("update <key>").description("Update issue fields").option("--fields <json>", "JSON string of fields to update (advanced; merges with shortcuts, wins on conflict)").option("--no-notify-users", "Suppress notification emails (default: notify)").option("--attachments <paths>", "Comma-separated local file paths to attach").option("--summary <text>", "Set the issue summary").option("--description <text>", `Set the issue description (wiki markup) ${RESOLVE_ARG_HINT}`, resolveArgValue).option("--priority <name>", "Set the priority by name (e.g. High)").option("--assignee <user>", 'Set the assignee. Username, "me", or "none" to unassign.').option("--labels <list>", 'Set labels ("a,b,c") or mutate ("+add,-remove")').option("--components <list>", 'Set components ("a,b") or mutate ("+add,-remove")').option("--fix-versions <list>", 'Set fix versions ("1.0,2.0") or mutate ("+1.0,-0.9")');
1598
1631
  examples(cmd, [
1599
1632
  'PROJ-123 --summary "New title"',
1600
1633
  "PROJ-123 --priority High --assignee me",
@@ -1674,7 +1707,7 @@ function update3(parent) {
1674
1707
 
1675
1708
  // src/commands/issue/worklog/create.ts
1676
1709
  function create4(parent) {
1677
- const cmd = parent.command("create <key>").description("Log time spent on an issue").requiredOption("--time <timeSpent>", "Time spent (e.g., '2h', '30m', '1d 4h')").option("--comment <text>", "Worklog comment").option("--started <datetime>", "Start time in ISO 8601 format");
1710
+ const cmd = parent.command("create <key>").description("Log time spent on an issue").requiredOption("--time <timeSpent>", "Time spent (e.g., '2h', '30m', '1d 4h')").option("--comment <text>", `Worklog comment ${RESOLVE_ARG_HINT}`, resolveArgValue).option("--started <datetime>", "Start time in ISO 8601 format");
1678
1711
  examples(cmd, [
1679
1712
  "PROJ-123 --time 2h",
1680
1713
  'PROJ-123 --time "1d 4h" --comment "Backend implementation"',
@@ -1743,7 +1776,7 @@ var ADJUST_ESTIMATE2 = ["new", "leave", "auto"];
1743
1776
  function update4(parent) {
1744
1777
  const cmd = parent.command("update <key>").description("Update an existing worklog entry");
1745
1778
  subEntityOption(cmd, "worklog", { mandatory: true });
1746
- cmd.option("--time <timeSpent>", "Time spent (e.g., '2h', '30m', '1d 4h')").option("--comment <text>", "Worklog comment").option("--started <datetime>", "Start time in ISO 8601 format").addOption(new Option5("--adjust-estimate <mode>", "How to adjust the remaining estimate").choices(ADJUST_ESTIMATE2)).option("--new-estimate <estimate>", 'New remaining estimate; required when --adjust-estimate is "new"');
1779
+ cmd.option("--time <timeSpent>", "Time spent (e.g., '2h', '30m', '1d 4h')").option("--comment <text>", `Worklog comment ${RESOLVE_ARG_HINT}`, resolveArgValue).option("--started <datetime>", "Start time in ISO 8601 format").addOption(new Option5("--adjust-estimate <mode>", "How to adjust the remaining estimate").choices(ADJUST_ESTIMATE2)).option("--new-estimate <estimate>", 'New remaining estimate; required when --adjust-estimate is "new"');
1747
1780
  examples(cmd, [
1748
1781
  'PROJ-123 --worklog-id 12345 --time "1h 30m"',
1749
1782
  'PROJ-123 --worklog-id 12345 --comment "Revised note"',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jiradc-cli",
3
- "version": "1.0.22",
3
+ "version": "1.0.23-g3f22a81.1",
4
4
  "publish": true,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,8 +12,7 @@
12
12
  ],
13
13
  "dependencies": {
14
14
  "commander": "^13.1.0",
15
- "cli-utils": "1.0.0",
16
- "jira-data-center-client": "1.0.38"
15
+ "jira-data-center-client": "1.0.39-g3f22a81.1"
17
16
  },
18
17
  "devDependencies": {
19
18
  "@types/node": "24.10.4",
@@ -23,8 +22,9 @@
23
22
  "tsx": "^4.19.2",
24
23
  "typescript": "^5.7.2",
25
24
  "vitest": "^4.0.16",
26
- "config-eslint": "0.0.0",
27
- "config-typescript": "0.0.0"
25
+ "cli-utils": "1.0.0",
26
+ "config-typescript": "0.0.0",
27
+ "config-eslint": "0.0.0"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=22.0.0"