azdo-cli 0.19.0-feature-040-auth-token.720 → 0.19.0-feature-040-auth-token.722
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/dist/index.js +52 -46
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
unsetOrgScopedValue
|
|
40
40
|
} from "./chunk-K2CKMY72.js";
|
|
41
41
|
|
|
42
|
-
// src/
|
|
42
|
+
// src/program.ts
|
|
43
43
|
import { Command as Command19 } from "commander";
|
|
44
44
|
|
|
45
45
|
// src/version.ts
|
|
@@ -7215,6 +7215,13 @@ var THROTTLE_MS = 10 * 60 * 1e3;
|
|
|
7215
7215
|
var FETCH_TIMEOUT_MS = 1500;
|
|
7216
7216
|
var REGISTRY_URL = "https://registry.npmjs.org/azdo-cli/latest";
|
|
7217
7217
|
var UPDATE_CHECK_EXEMPT_COMMANDS = /* @__PURE__ */ new Set(["auth token"]);
|
|
7218
|
+
function commandPathOf(command) {
|
|
7219
|
+
const names = [];
|
|
7220
|
+
for (let node = command; node !== null; node = node.parent) {
|
|
7221
|
+
names.unshift(node.name());
|
|
7222
|
+
}
|
|
7223
|
+
return names;
|
|
7224
|
+
}
|
|
7218
7225
|
function skipsUpdateCheck(commandPath) {
|
|
7219
7226
|
const withoutRoot = commandPath.slice(1);
|
|
7220
7227
|
return UPDATE_CHECK_EXEMPT_COMMANDS.has(withoutRoot.join(" "));
|
|
@@ -7316,6 +7323,49 @@ async function getUpdateNotice(opts) {
|
|
|
7316
7323
|
}
|
|
7317
7324
|
}
|
|
7318
7325
|
|
|
7326
|
+
// src/program.ts
|
|
7327
|
+
function createProgram() {
|
|
7328
|
+
const program2 = new Command19();
|
|
7329
|
+
program2.name("azdo").description("Azure DevOps CLI tool").version(version, "-v, --version");
|
|
7330
|
+
program2.option("--no-update-check", "Skip the check for a newer published version");
|
|
7331
|
+
program2.option("--trace <filepath>", "Append redacted HTTP request/response trace to a file (owner-read-only permissions)");
|
|
7332
|
+
program2.addCommand(createGetItemCommand());
|
|
7333
|
+
program2.addCommand(createAuthCommand());
|
|
7334
|
+
program2.addCommand(createClearPatCommand());
|
|
7335
|
+
program2.addCommand(createConfigCommand());
|
|
7336
|
+
program2.addCommand(createSetStateCommand());
|
|
7337
|
+
program2.addCommand(createAssignCommand());
|
|
7338
|
+
program2.addCommand(createSetFieldCommand());
|
|
7339
|
+
program2.addCommand(createGetMdFieldCommand());
|
|
7340
|
+
program2.addCommand(createSetMdFieldCommand());
|
|
7341
|
+
program2.addCommand(createUpsertCommand());
|
|
7342
|
+
program2.addCommand(createListFieldsCommand());
|
|
7343
|
+
program2.addCommand(createPrCommand());
|
|
7344
|
+
program2.addCommand(createPipelineCommand());
|
|
7345
|
+
program2.addCommand(createCommentsCommand());
|
|
7346
|
+
program2.addCommand(createDownloadAttachmentCommand());
|
|
7347
|
+
program2.addCommand(createAddAttachmentCommand());
|
|
7348
|
+
program2.addCommand(createDeleteAttachmentCommand());
|
|
7349
|
+
program2.addCommand(createRelationsCommand());
|
|
7350
|
+
program2.showHelpAfterError();
|
|
7351
|
+
program2.hook("preAction", () => {
|
|
7352
|
+
const { trace } = program2.opts();
|
|
7353
|
+
if (trace) {
|
|
7354
|
+
initTraceWriter(trace);
|
|
7355
|
+
}
|
|
7356
|
+
});
|
|
7357
|
+
program2.hook("postAction", async (_thisCommand, actionCommand) => {
|
|
7358
|
+
if (skipsUpdateCheck(commandPathOf(actionCommand))) {
|
|
7359
|
+
return;
|
|
7360
|
+
}
|
|
7361
|
+
const notice = await getUpdateNotice({ enabled: program2.opts().updateCheck });
|
|
7362
|
+
if (notice) {
|
|
7363
|
+
process.stderr.write(notice + "\n");
|
|
7364
|
+
}
|
|
7365
|
+
});
|
|
7366
|
+
return program2;
|
|
7367
|
+
}
|
|
7368
|
+
|
|
7319
7369
|
// src/index.ts
|
|
7320
7370
|
function exitOnEpipe(err) {
|
|
7321
7371
|
if (err.code === "EPIPE") {
|
|
@@ -7325,51 +7375,7 @@ function exitOnEpipe(err) {
|
|
|
7325
7375
|
}
|
|
7326
7376
|
process.stdout.on("error", exitOnEpipe);
|
|
7327
7377
|
process.stderr.on("error", exitOnEpipe);
|
|
7328
|
-
var program =
|
|
7329
|
-
program.name("azdo").description("Azure DevOps CLI tool").version(version, "-v, --version");
|
|
7330
|
-
program.option("--no-update-check", "Skip the check for a newer published version");
|
|
7331
|
-
program.option("--trace <filepath>", "Append redacted HTTP request/response trace to a file (owner-read-only permissions)");
|
|
7332
|
-
program.addCommand(createGetItemCommand());
|
|
7333
|
-
program.addCommand(createAuthCommand());
|
|
7334
|
-
program.addCommand(createClearPatCommand());
|
|
7335
|
-
program.addCommand(createConfigCommand());
|
|
7336
|
-
program.addCommand(createSetStateCommand());
|
|
7337
|
-
program.addCommand(createAssignCommand());
|
|
7338
|
-
program.addCommand(createSetFieldCommand());
|
|
7339
|
-
program.addCommand(createGetMdFieldCommand());
|
|
7340
|
-
program.addCommand(createSetMdFieldCommand());
|
|
7341
|
-
program.addCommand(createUpsertCommand());
|
|
7342
|
-
program.addCommand(createListFieldsCommand());
|
|
7343
|
-
program.addCommand(createPrCommand());
|
|
7344
|
-
program.addCommand(createPipelineCommand());
|
|
7345
|
-
program.addCommand(createCommentsCommand());
|
|
7346
|
-
program.addCommand(createDownloadAttachmentCommand());
|
|
7347
|
-
program.addCommand(createAddAttachmentCommand());
|
|
7348
|
-
program.addCommand(createDeleteAttachmentCommand());
|
|
7349
|
-
program.addCommand(createRelationsCommand());
|
|
7350
|
-
program.showHelpAfterError();
|
|
7351
|
-
program.hook("preAction", () => {
|
|
7352
|
-
const { trace } = program.opts();
|
|
7353
|
-
if (trace) {
|
|
7354
|
-
initTraceWriter(trace);
|
|
7355
|
-
}
|
|
7356
|
-
});
|
|
7357
|
-
function commandPathOf(command) {
|
|
7358
|
-
const names = [];
|
|
7359
|
-
for (let node = command; node !== null; node = node.parent) {
|
|
7360
|
-
names.unshift(node.name());
|
|
7361
|
-
}
|
|
7362
|
-
return names;
|
|
7363
|
-
}
|
|
7364
|
-
program.hook("postAction", async (_thisCommand, actionCommand) => {
|
|
7365
|
-
if (skipsUpdateCheck(commandPathOf(actionCommand))) {
|
|
7366
|
-
return;
|
|
7367
|
-
}
|
|
7368
|
-
const notice = await getUpdateNotice({ enabled: program.opts().updateCheck });
|
|
7369
|
-
if (notice) {
|
|
7370
|
-
process.stderr.write(notice + "\n");
|
|
7371
|
-
}
|
|
7372
|
-
});
|
|
7378
|
+
var program = createProgram();
|
|
7373
7379
|
await program.parseAsync();
|
|
7374
7380
|
if (process.argv.length <= 2) {
|
|
7375
7381
|
program.help();
|