azdo-cli 0.5.0-030-auth-diagnostics.537 → 0.5.0-030-auth-diagnostics.541

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 +10 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1705,7 +1705,8 @@ async function diagnoseAuth(org, project, resolveCredential) {
1705
1705
  };
1706
1706
  }
1707
1707
  const connectivity = await runConnectivityTest(org, cred);
1708
- const sourceLabel = cred.source === "env" ? `env:${process.env.AZDO_PAT ? "AZDO_PAT" : "dotenv"}` : "credential-store";
1708
+ const envVarName = process.env.AZDO_PAT ? "AZDO_PAT" : "dotenv";
1709
+ const sourceLabel = cred.source === "env" ? `env:${envVarName}` : "credential-store";
1709
1710
  return {
1710
1711
  authType: cred.kind ?? "pat",
1711
1712
  credentialSource: sourceLabel,
@@ -1719,7 +1720,14 @@ function formatDiagnosticReport(report, json) {
1719
1720
  if (json) {
1720
1721
  return JSON.stringify(report, null, 2);
1721
1722
  }
1722
- const connectivityLine = report.connectivityStatus === "ok" ? "OK" : report.connectivityStatus === "no-credentials" ? "no credentials found" : "FAILED";
1723
+ let connectivityLine;
1724
+ if (report.connectivityStatus === "ok") {
1725
+ connectivityLine = "OK";
1726
+ } else if (report.connectivityStatus === "no-credentials") {
1727
+ connectivityLine = "no credentials found";
1728
+ } else {
1729
+ connectivityLine = "FAILED";
1730
+ }
1723
1731
  const lines = [
1724
1732
  `Auth type: ${report.authType}`,
1725
1733
  `Source: ${report.credentialSource ?? "(none)"}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azdo-cli",
3
- "version": "0.5.0-030-auth-diagnostics.537",
3
+ "version": "0.5.0-030-auth-diagnostics.541",
4
4
  "description": "Azure DevOps CLI tool",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,8 +14,8 @@
14
14
  "lint": "eslint src/",
15
15
  "typecheck": "tsc --noEmit",
16
16
  "format": "prettier --check src/",
17
- "test": "npm run build && vitest run tests/unit tests/integration",
18
- "test:unit": "npm run build && vitest run tests/unit",
17
+ "test": "npm run typecheck && npm run lint && npm run build && vitest run tests/unit tests/integration",
18
+ "test:unit": "npm run typecheck && npm run lint && npm run build && vitest run tests/unit",
19
19
  "test:integration": "npm run build && vitest run tests/integration",
20
20
  "test:integration:full": "bash scripts/setup-keyring.sh && npm run test:integration"
21
21
  },