azdo-cli 0.2.0-feature-integrationtest.111 → 0.2.0-feature-integrationtest.127

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
@@ -102,8 +102,6 @@ azdo get-item 12345 --fields "System.Tags,Microsoft.VSTS.Common.Priority"
102
102
  # Convert rich text fields to markdown
103
103
  azdo get-item 12345 --markdown
104
104
 
105
- # Disable markdown even if config is on
106
- azdo get-item 12345 --no-markdown
107
105
  ```
108
106
 
109
107
  ```bash
@@ -132,7 +130,7 @@ azdo list-fields 12345 --json
132
130
 
133
131
  The `get-item` command can convert HTML rich-text fields to readable markdown. Resolution order:
134
132
 
135
- 1. `--markdown` / `--no-markdown` flag (highest priority)
133
+ 1. `--markdown` flag enables markdown for the current call
136
134
  2. Config setting: `azdo config set markdown true`
137
135
  3. Default: off (HTML stripped to plain text)
138
136
 
@@ -169,7 +167,7 @@ azdo pr comments
169
167
 
170
168
  `azdo pr status`
171
169
 
172
- - Lists all pull requests for the current branch, including active, completed, and abandoned PRs
170
+ - Lists pull requests for the current branch
173
171
  - Prints `No pull requests found for branch <branch>.` when no PRs exist
174
172
  - Supports `--json` for machine-readable output
175
173
 
@@ -302,6 +300,8 @@ These commands support `--json` for machine-readable output:
302
300
  - `assign`
303
301
  - `set-field`
304
302
  - `set-md-field`
303
+ - `upsert`
304
+ - `pr status|open|comments`
305
305
  - `config set|get|list|unset`
306
306
 
307
307
  ## Development
package/dist/index.js CHANGED
@@ -39,7 +39,15 @@ async function fetchWithErrors(url, init) {
39
39
  }
40
40
  if (response.status === 401) throw new Error("AUTH_FAILED");
41
41
  if (response.status === 403) throw new Error("PERMISSION_DENIED");
42
- if (response.status === 404) throw new Error("NOT_FOUND");
42
+ if (response.status === 404) {
43
+ let detail = "";
44
+ try {
45
+ const body = await response.text();
46
+ detail = ` | url=${url} | body=${body}`;
47
+ } catch {
48
+ }
49
+ throw new Error(`NOT_FOUND${detail}`);
50
+ }
43
51
  return response;
44
52
  }
45
53
  async function readResponseMessage(response) {
@@ -633,7 +641,7 @@ function handleCommandError(err, id, context, scope = "write", exit = true) {
633
641
  `Error: Access denied. Your PAT may lack ${scope} permissions for project "${context?.project}".
634
642
  `
635
643
  );
636
- } else if (msg === "NOT_FOUND") {
644
+ } else if (msg.startsWith("NOT_FOUND")) {
637
645
  process.stderr.write(
638
646
  `Error: Work item ${id} not found in ${context?.org}/${context?.project}.
639
647
  `
@@ -1418,7 +1426,7 @@ function buildUpsertResult(action, writeResult, fields) {
1418
1426
  };
1419
1427
  }
1420
1428
  function isUpdateWriteError(err) {
1421
- return err.message === "AUTH_FAILED" || err.message === "PERMISSION_DENIED" || err.message === "NOT_FOUND" || err.message === "NETWORK_ERROR" || err.message.startsWith("BAD_REQUEST:") || err.message.startsWith("UPDATE_REJECTED:");
1429
+ return err.message === "AUTH_FAILED" || err.message === "PERMISSION_DENIED" || err.message.startsWith("NOT_FOUND") || err.message === "NETWORK_ERROR" || err.message.startsWith("BAD_REQUEST:") || err.message.startsWith("UPDATE_REJECTED:");
1422
1430
  }
1423
1431
  function isCreateWriteError(err) {
1424
1432
  return err.message === "AUTH_FAILED" || err.message === "PERMISSION_DENIED" || err.message === "NETWORK_ERROR" || err.message.startsWith("BAD_REQUEST:") || err.message.startsWith("HTTP_");
@@ -1684,7 +1692,7 @@ function handlePrCommandError(err, context, mode = "read") {
1684
1692
  if (error.message === "NETWORK_ERROR") {
1685
1693
  writeError("Could not connect to Azure DevOps. Check your network connection.");
1686
1694
  }
1687
- if (error.message === "NOT_FOUND") {
1695
+ if (error.message.startsWith("NOT_FOUND")) {
1688
1696
  writeError(`Azure DevOps repository not found in ${context?.org}/${context?.project}.`);
1689
1697
  }
1690
1698
  if (error.message.startsWith("HTTP_")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azdo-cli",
3
- "version": "0.2.0-feature-integrationtest.111",
3
+ "version": "0.2.0-feature-integrationtest.127",
4
4
  "description": "Azure DevOps CLI tool",
5
5
  "type": "module",
6
6
  "bin": {