@mcp-consultant-tools/azure-devops-admin 28.0.0-beta.6 → 28.0.0
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/build/cli/commands/agent-pool-commands.d.ts +7 -0
- package/build/cli/commands/agent-pool-commands.d.ts.map +1 -0
- package/build/cli/commands/agent-pool-commands.js +117 -0
- package/build/cli/commands/agent-pool-commands.js.map +1 -0
- package/build/cli/commands/artifact-feed-commands.d.ts +7 -0
- package/build/cli/commands/artifact-feed-commands.d.ts.map +1 -0
- package/build/cli/commands/artifact-feed-commands.js +62 -0
- package/build/cli/commands/artifact-feed-commands.js.map +1 -0
- package/build/cli/commands/classification-commands.d.ts +7 -0
- package/build/cli/commands/classification-commands.d.ts.map +1 -0
- package/build/cli/commands/classification-commands.js +192 -0
- package/build/cli/commands/classification-commands.js.map +1 -0
- package/build/cli/commands/environment-commands.d.ts +7 -0
- package/build/cli/commands/environment-commands.d.ts.map +1 -0
- package/build/cli/commands/environment-commands.js +172 -0
- package/build/cli/commands/environment-commands.js.map +1 -0
- package/build/cli/commands/index.d.ts +15 -0
- package/build/cli/commands/index.d.ts.map +1 -0
- package/build/cli/commands/index.js +30 -0
- package/build/cli/commands/index.js.map +1 -0
- package/build/cli/commands/pipeline-commands.d.ts +7 -0
- package/build/cli/commands/pipeline-commands.d.ts.map +1 -0
- package/build/cli/commands/pipeline-commands.js +269 -0
- package/build/cli/commands/pipeline-commands.js.map +1 -0
- package/build/cli/commands/project-commands.d.ts +7 -0
- package/build/cli/commands/project-commands.d.ts.map +1 -0
- package/build/cli/commands/project-commands.js +100 -0
- package/build/cli/commands/project-commands.js.map +1 -0
- package/build/cli/commands/service-connection-commands.d.ts +7 -0
- package/build/cli/commands/service-connection-commands.d.ts.map +1 -0
- package/build/cli/commands/service-connection-commands.js +131 -0
- package/build/cli/commands/service-connection-commands.js.map +1 -0
- package/build/cli/commands/variable-group-commands.d.ts +7 -0
- package/build/cli/commands/variable-group-commands.d.ts.map +1 -0
- package/build/cli/commands/variable-group-commands.js +120 -0
- package/build/cli/commands/variable-group-commands.js.map +1 -0
- package/build/cli/output.d.ts +11 -0
- package/build/cli/output.d.ts.map +1 -0
- package/build/cli/output.js +10 -0
- package/build/cli/output.js.map +1 -0
- package/build/cli.d.ts +9 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +27 -0
- package/build/cli.js.map +1 -0
- package/build/context-factory.d.ts +4 -0
- package/build/context-factory.d.ts.map +1 -0
- package/build/context-factory.js +84 -0
- package/build/context-factory.js.map +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -0
- package/build/index.js.map +1 -1
- package/build/services/admin-client.d.ts.map +1 -1
- package/build/services/admin-client.js +4 -0
- package/build/services/admin-client.js.map +1 -1
- package/build/services/index.d.ts +1 -0
- package/build/services/index.d.ts.map +1 -1
- package/build/services/index.js +1 -0
- package/build/services/index.js.map +1 -1
- package/build/services/project-service.d.ts +21 -0
- package/build/services/project-service.d.ts.map +1 -0
- package/build/services/project-service.js +130 -0
- package/build/services/project-service.js.map +1 -0
- package/build/tool-examples.d.ts +20 -0
- package/build/tool-examples.d.ts.map +1 -1
- package/build/tool-examples.js +24 -0
- package/build/tool-examples.js.map +1 -1
- package/build/tools/index.d.ts +1 -0
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +3 -0
- package/build/tools/index.js.map +1 -1
- package/build/tools/project-tools.d.ts +7 -0
- package/build/tools/project-tools.d.ts.map +1 -0
- package/build/tools/project-tools.js +117 -0
- package/build/tools/project-tools.js.map +1 -0
- package/build/types.d.ts +6 -0
- package/build/types.d.ts.map +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Pool CLI Commands - list, get, agents, update, enable/disable
|
|
3
|
+
*/
|
|
4
|
+
import type { Command } from 'commander';
|
|
5
|
+
import type { ServiceContext } from '../../types.js';
|
|
6
|
+
export declare function registerAgentPoolCommands(program: Command, ctx: ServiceContext): void;
|
|
7
|
+
//# sourceMappingURL=agent-pool-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-pool-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agent-pool-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAiHrF"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Pool CLI Commands - list, get, agents, update, enable/disable
|
|
3
|
+
*/
|
|
4
|
+
import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
|
|
5
|
+
import { outputResult } from '../output.js';
|
|
6
|
+
export function registerAgentPoolCommands(program, ctx) {
|
|
7
|
+
const agentPool = program.command('agent-pool').alias('ap').description('Agent pool operations');
|
|
8
|
+
agentPool
|
|
9
|
+
.command('list')
|
|
10
|
+
.description('List all agent pools in the organization')
|
|
11
|
+
.option('--pool-type <type>', 'Filter by pool type (e.g., automation, deployment)')
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
try {
|
|
14
|
+
const result = await ctx.agentPools.listAgentPools(opts.poolType);
|
|
15
|
+
outputResult({ fileName: 'agent-pools', data: result, summary: `Agent pools` }, getGlobalFlags(program));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
handleCliError(error, 'list agent pools');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
agentPool
|
|
22
|
+
.command('get')
|
|
23
|
+
.description('Get detailed agent pool information')
|
|
24
|
+
.argument('<poolId>', 'Agent pool ID')
|
|
25
|
+
.action(async (poolId) => {
|
|
26
|
+
try {
|
|
27
|
+
const result = await ctx.agentPools.getAgentPool(parseInt(poolId));
|
|
28
|
+
outputResult({ fileName: `agent-pool-${poolId}`, data: result, summary: `Agent pool #${poolId}` }, getGlobalFlags(program));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
handleCliError(error, 'get agent pool');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
agentPool
|
|
35
|
+
.command('agents')
|
|
36
|
+
.description('List agents in an agent pool')
|
|
37
|
+
.argument('<poolId>', 'Agent pool ID')
|
|
38
|
+
.option('-c, --capabilities', 'Include agent capabilities')
|
|
39
|
+
.action(async (poolId, opts) => {
|
|
40
|
+
try {
|
|
41
|
+
const result = await ctx.agentPools.listAgents(parseInt(poolId), opts.capabilities || false);
|
|
42
|
+
outputResult({ fileName: `agents-pool-${poolId}`, data: result, summary: `Agents in pool #${poolId}` }, getGlobalFlags(program));
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
handleCliError(error, 'list agents');
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
agentPool
|
|
49
|
+
.command('agent')
|
|
50
|
+
.description('Get detailed agent information')
|
|
51
|
+
.argument('<poolId>', 'Agent pool ID')
|
|
52
|
+
.argument('<agentId>', 'Agent ID')
|
|
53
|
+
.action(async (poolId, agentId) => {
|
|
54
|
+
try {
|
|
55
|
+
const result = await ctx.agentPools.getAgent(parseInt(poolId), parseInt(agentId));
|
|
56
|
+
outputResult({ fileName: `agent-${poolId}-${agentId}`, data: result, summary: `Agent #${agentId} in pool #${poolId}` }, getGlobalFlags(program));
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
handleCliError(error, 'get agent');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
agentPool
|
|
63
|
+
.command('update')
|
|
64
|
+
.description('Update agent pool settings')
|
|
65
|
+
.argument('<poolId>', 'Agent pool ID')
|
|
66
|
+
.option('--auto-provision <bool>', 'Enable auto-provisioning')
|
|
67
|
+
.option('--auto-update <bool>', 'Enable auto-update')
|
|
68
|
+
.option('--auto-size <bool>', 'Enable auto-sizing')
|
|
69
|
+
.option('--target-size <n>', 'Target pool size')
|
|
70
|
+
.action(async (poolId, opts) => {
|
|
71
|
+
try {
|
|
72
|
+
const updates = {};
|
|
73
|
+
if (opts.autoProvision !== undefined)
|
|
74
|
+
updates.autoProvision = opts.autoProvision === 'true';
|
|
75
|
+
if (opts.autoUpdate !== undefined)
|
|
76
|
+
updates.autoUpdate = opts.autoUpdate === 'true';
|
|
77
|
+
if (opts.autoSize !== undefined)
|
|
78
|
+
updates.autoSize = opts.autoSize === 'true';
|
|
79
|
+
if (opts.targetSize !== undefined)
|
|
80
|
+
updates.targetSize = parseInt(opts.targetSize);
|
|
81
|
+
const result = await ctx.agentPools.updateAgentPool(parseInt(poolId), updates);
|
|
82
|
+
outputResult({ fileName: `agent-pool-updated-${poolId}`, data: result, summary: `Updated agent pool #${poolId}` }, getGlobalFlags(program));
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
handleCliError(error, 'update agent pool');
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
agentPool
|
|
89
|
+
.command('enable-agent')
|
|
90
|
+
.description('Enable an agent in a pool')
|
|
91
|
+
.argument('<poolId>', 'Agent pool ID')
|
|
92
|
+
.argument('<agentId>', 'Agent ID')
|
|
93
|
+
.action(async (poolId, agentId) => {
|
|
94
|
+
try {
|
|
95
|
+
const result = await ctx.agentPools.enableAgent(parseInt(poolId), parseInt(agentId));
|
|
96
|
+
outputResult({ fileName: `agent-enabled-${poolId}-${agentId}`, data: result, summary: `Enabled agent #${agentId} in pool #${poolId}` }, getGlobalFlags(program));
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
handleCliError(error, 'enable agent');
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
agentPool
|
|
103
|
+
.command('disable-agent')
|
|
104
|
+
.description('Disable an agent in a pool')
|
|
105
|
+
.argument('<poolId>', 'Agent pool ID')
|
|
106
|
+
.argument('<agentId>', 'Agent ID')
|
|
107
|
+
.action(async (poolId, agentId) => {
|
|
108
|
+
try {
|
|
109
|
+
const result = await ctx.agentPools.disableAgent(parseInt(poolId), parseInt(agentId));
|
|
110
|
+
outputResult({ fileName: `agent-disabled-${poolId}-${agentId}`, data: result, summary: `Disabled agent #${agentId} in pool #${poolId}` }, getGlobalFlags(program));
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
handleCliError(error, 'disable agent');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=agent-pool-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-pool-commands.js","sourceRoot":"","sources":["../../../src/cli/commands/agent-pool-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,yBAAyB,CAAC,OAAgB,EAAE,GAAmB;IAC7E,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAEjG,SAAS;SACN,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,oBAAoB,EAAE,oDAAoD,CAAC;SAClF,MAAM,CAAC,KAAK,EAAE,IAAS,EAAE,EAAE;QAC1B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClE,YAAY,CACV,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,EACjE,cAAc,CAAC,OAA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../types.js';
|
|
6
|
+
export declare function registerArtifactFeedCommands(program: Command, ctx: ServiceContext): void;
|
|
7
|
+
//# sourceMappingURL=artifact-feed-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-feed-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/artifact-feed-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAiDxF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact Feed CLI Commands - list packages, get versions
|
|
3
|
+
*/
|
|
4
|
+
import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
|
|
5
|
+
import { outputResult } from '../output.js';
|
|
6
|
+
export function registerArtifactFeedCommands(program, ctx) {
|
|
7
|
+
const feed = program.command('feed').alias('af').description('Artifact feed operations');
|
|
8
|
+
feed
|
|
9
|
+
.command('packages')
|
|
10
|
+
.description('List packages in an artifact feed')
|
|
11
|
+
.argument('<feedName>', 'Feed name')
|
|
12
|
+
.option('-p, --project <project>', 'Project-scoped feed (omit for org-scoped)')
|
|
13
|
+
.option('--name-prefix <prefix>', 'Filter by package name prefix')
|
|
14
|
+
.option('--package-type <type>', 'Filter by package type (npm, nuget, maven, etc.)')
|
|
15
|
+
.option('-t, --top <n>', 'Maximum number of results')
|
|
16
|
+
.action(async (feedName, opts) => {
|
|
17
|
+
try {
|
|
18
|
+
const options = {};
|
|
19
|
+
if (opts.project)
|
|
20
|
+
options.project = opts.project;
|
|
21
|
+
if (opts.namePrefix)
|
|
22
|
+
options.namePrefix = opts.namePrefix;
|
|
23
|
+
if (opts.packageType)
|
|
24
|
+
options.packageType = opts.packageType;
|
|
25
|
+
if (opts.top)
|
|
26
|
+
options.top = parseInt(opts.top);
|
|
27
|
+
const result = await ctx.artifactFeeds.listFeedPackages(feedName, options);
|
|
28
|
+
outputResult({ fileName: `feed-packages-${feedName}`, data: result, summary: `Packages in feed '${feedName}'` }, getGlobalFlags(program));
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
handleCliError(error, 'list feed packages');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
feed
|
|
35
|
+
.command('versions')
|
|
36
|
+
.description('Get version history for a package')
|
|
37
|
+
.argument('<feedName>', 'Feed name')
|
|
38
|
+
.argument('<packageName>', 'Package name')
|
|
39
|
+
.option('-p, --project <project>', 'Project-scoped feed (omit for org-scoped)')
|
|
40
|
+
.option('--package-type <type>', 'Package protocol type (npm, nuget, maven, etc.)')
|
|
41
|
+
.option('-t, --top <n>', 'Maximum number of versions')
|
|
42
|
+
.option('--include-delisted', 'Include delisted versions')
|
|
43
|
+
.action(async (feedName, packageName, opts) => {
|
|
44
|
+
try {
|
|
45
|
+
const options = {};
|
|
46
|
+
if (opts.project)
|
|
47
|
+
options.project = opts.project;
|
|
48
|
+
if (opts.packageType)
|
|
49
|
+
options.packageType = opts.packageType;
|
|
50
|
+
if (opts.top)
|
|
51
|
+
options.top = parseInt(opts.top);
|
|
52
|
+
if (opts.includeDelisted)
|
|
53
|
+
options.includeDelisted = true;
|
|
54
|
+
const result = await ctx.artifactFeeds.getPackageVersions(feedName, packageName, options);
|
|
55
|
+
outputResult({ fileName: `feed-versions-${feedName}-${packageName}`, data: result, summary: `Versions of '${packageName}' in feed '${feedName}'` }, getGlobalFlags(program));
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
handleCliError(error, 'get package versions');
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=artifact-feed-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"art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Q,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;YAC1F,YAAY,CACV,EAAE,QAAQ,EAAE,iBAAiB,QAAQ,IAAI,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,WAAW,cAAc,QAAQ,GAAG,EAAE,EACrI,cAAc,CAAC,OAAO,CAAC,CACxB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,cAAc,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC;QAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classification CLI Commands - Iterations and Areas (list, get, CRUD, team assignment)
|
|
3
|
+
*/
|
|
4
|
+
import type { Command } from 'commander';
|
|
5
|
+
import type { ServiceContext } from '../../types.js';
|
|
6
|
+
export declare function registerClassificationCommands(program: Command, ctx: ServiceContext): void;
|
|
7
|
+
//# sourceMappingURL=classification-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classification-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/classification-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAiM1F"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classification CLI Commands - Iterations and Areas (list, get, CRUD, team assignment)
|
|
3
|
+
*/
|
|
4
|
+
import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
|
|
5
|
+
import { outputResult } from '../output.js';
|
|
6
|
+
export function registerClassificationCommands(program, ctx) {
|
|
7
|
+
// --- Iteration commands ---
|
|
8
|
+
const iteration = program.command('iteration').alias('it').description('Iteration (sprint) operations');
|
|
9
|
+
iteration
|
|
10
|
+
.command('list')
|
|
11
|
+
.description('List all iterations in a project')
|
|
12
|
+
.argument('<project>', 'Project name')
|
|
13
|
+
.option('-d, --depth <n>', 'Tree depth to retrieve', '10')
|
|
14
|
+
.action(async (project, opts) => {
|
|
15
|
+
try {
|
|
16
|
+
const result = await ctx.classification.listClassificationNodes(project, 'iterations', parseInt(opts.depth));
|
|
17
|
+
outputResult({ fileName: `iterations-${project}`, data: result, summary: `Iterations in '${project}'` }, getGlobalFlags(program));
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
handleCliError(error, 'list iterations');
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
iteration
|
|
24
|
+
.command('get')
|
|
25
|
+
.description('Get a specific iteration node')
|
|
26
|
+
.argument('<project>', 'Project name')
|
|
27
|
+
.argument('<path>', 'Iteration path (e.g., Sprint 1 or Release\\Sprint 1)')
|
|
28
|
+
.action(async (project, path) => {
|
|
29
|
+
try {
|
|
30
|
+
const result = await ctx.classification.getClassificationNode(project, 'iterations', path);
|
|
31
|
+
outputResult({ fileName: `iteration-${path.replace(/\\/g, '-')}`, data: result, summary: `Iteration '${path}'` }, getGlobalFlags(program));
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
handleCliError(error, 'get iteration');
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
iteration
|
|
38
|
+
.command('create')
|
|
39
|
+
.description('Create a new iteration')
|
|
40
|
+
.argument('<project>', 'Project name')
|
|
41
|
+
.argument('<name>', 'Iteration name')
|
|
42
|
+
.option('-p, --parent-path <path>', 'Parent iteration path')
|
|
43
|
+
.option('--start-date <date>', 'Start date (YYYY-MM-DD)')
|
|
44
|
+
.option('--finish-date <date>', 'Finish date (YYYY-MM-DD)')
|
|
45
|
+
.action(async (project, name, opts) => {
|
|
46
|
+
try {
|
|
47
|
+
const attrs = {};
|
|
48
|
+
if (opts.startDate)
|
|
49
|
+
attrs.startDate = opts.startDate;
|
|
50
|
+
if (opts.finishDate)
|
|
51
|
+
attrs.finishDate = opts.finishDate;
|
|
52
|
+
const result = await ctx.classification.createClassificationNode(project, 'iterations', name, opts.parentPath, Object.keys(attrs).length > 0 ? attrs : undefined);
|
|
53
|
+
outputResult({ fileName: `iteration-created-${name}`, data: result, summary: `Created iteration '${name}'` }, getGlobalFlags(program));
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
handleCliError(error, 'create iteration');
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
iteration
|
|
60
|
+
.command('update')
|
|
61
|
+
.description('Update an iteration')
|
|
62
|
+
.argument('<project>', 'Project name')
|
|
63
|
+
.argument('<path>', 'Iteration path')
|
|
64
|
+
.option('-n, --name <name>', 'New iteration name')
|
|
65
|
+
.option('--start-date <date>', 'New start date (YYYY-MM-DD)')
|
|
66
|
+
.option('--finish-date <date>', 'New finish date (YYYY-MM-DD)')
|
|
67
|
+
.action(async (project, path, opts) => {
|
|
68
|
+
try {
|
|
69
|
+
const updates = {};
|
|
70
|
+
if (opts.name)
|
|
71
|
+
updates.name = opts.name;
|
|
72
|
+
if (opts.startDate)
|
|
73
|
+
updates.startDate = opts.startDate;
|
|
74
|
+
if (opts.finishDate)
|
|
75
|
+
updates.finishDate = opts.finishDate;
|
|
76
|
+
const result = await ctx.classification.updateClassificationNode(project, 'iterations', path, updates);
|
|
77
|
+
outputResult({ fileName: `iteration-updated-${path.replace(/\\/g, '-')}`, data: result, summary: `Updated iteration '${path}'` }, getGlobalFlags(program));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
handleCliError(error, 'update iteration');
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
iteration
|
|
84
|
+
.command('delete')
|
|
85
|
+
.description('Delete an iteration (DESTRUCTIVE)')
|
|
86
|
+
.argument('<project>', 'Project name')
|
|
87
|
+
.argument('<path>', 'Iteration path to delete')
|
|
88
|
+
.argument('<reclassifyId>', 'Node ID to reclassify work items into')
|
|
89
|
+
.action(async (project, path, reclassifyId) => {
|
|
90
|
+
try {
|
|
91
|
+
const result = await ctx.classification.deleteClassificationNode(project, 'iterations', path, parseInt(reclassifyId));
|
|
92
|
+
outputResult({ fileName: `iteration-deleted-${path.replace(/\\/g, '-')}`, data: result, summary: `Deleted iteration '${path}'` }, getGlobalFlags(program));
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
handleCliError(error, 'delete iteration');
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
iteration
|
|
99
|
+
.command('add-to-team')
|
|
100
|
+
.description('Add an iteration to a team\'s backlog')
|
|
101
|
+
.argument('<project>', 'Project name')
|
|
102
|
+
.argument('<team>', 'Team name')
|
|
103
|
+
.argument('<iterationId>', 'Iteration identifier (GUID)')
|
|
104
|
+
.action(async (project, team, iterationId) => {
|
|
105
|
+
try {
|
|
106
|
+
const result = await ctx.classification.addIterationToTeam(project, team, iterationId);
|
|
107
|
+
outputResult({ fileName: `iteration-team-${team}-${iterationId}`, data: result, summary: `Added iteration to team '${team}'` }, getGlobalFlags(program));
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
handleCliError(error, 'add iteration to team');
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
// --- Area commands ---
|
|
114
|
+
const area = program.command('area').alias('ar').description('Area path operations');
|
|
115
|
+
area
|
|
116
|
+
.command('list')
|
|
117
|
+
.description('List all area paths in a project')
|
|
118
|
+
.argument('<project>', 'Project name')
|
|
119
|
+
.option('-d, --depth <n>', 'Tree depth to retrieve', '10')
|
|
120
|
+
.action(async (project, opts) => {
|
|
121
|
+
try {
|
|
122
|
+
const result = await ctx.classification.listClassificationNodes(project, 'areas', parseInt(opts.depth));
|
|
123
|
+
outputResult({ fileName: `areas-${project}`, data: result, summary: `Areas in '${project}'` }, getGlobalFlags(program));
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
handleCliError(error, 'list areas');
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
area
|
|
130
|
+
.command('get')
|
|
131
|
+
.description('Get a specific area path node')
|
|
132
|
+
.argument('<project>', 'Project name')
|
|
133
|
+
.argument('<path>', 'Area path (e.g., Frontend or Platform\\API)')
|
|
134
|
+
.action(async (project, path) => {
|
|
135
|
+
try {
|
|
136
|
+
const result = await ctx.classification.getClassificationNode(project, 'areas', path);
|
|
137
|
+
outputResult({ fileName: `area-${path.replace(/\\/g, '-')}`, data: result, summary: `Area '${path}'` }, getGlobalFlags(program));
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
handleCliError(error, 'get area');
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
area
|
|
144
|
+
.command('create')
|
|
145
|
+
.description('Create a new area path')
|
|
146
|
+
.argument('<project>', 'Project name')
|
|
147
|
+
.argument('<name>', 'Area name')
|
|
148
|
+
.option('-p, --parent-path <path>', 'Parent area path')
|
|
149
|
+
.action(async (project, name, opts) => {
|
|
150
|
+
try {
|
|
151
|
+
const result = await ctx.classification.createClassificationNode(project, 'areas', name, opts.parentPath);
|
|
152
|
+
outputResult({ fileName: `area-created-${name}`, data: result, summary: `Created area '${name}'` }, getGlobalFlags(program));
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
handleCliError(error, 'create area');
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
area
|
|
159
|
+
.command('update')
|
|
160
|
+
.description('Update an area path')
|
|
161
|
+
.argument('<project>', 'Project name')
|
|
162
|
+
.argument('<path>', 'Area path')
|
|
163
|
+
.option('-n, --name <name>', 'New area name')
|
|
164
|
+
.action(async (project, path, opts) => {
|
|
165
|
+
try {
|
|
166
|
+
const updates = {};
|
|
167
|
+
if (opts.name)
|
|
168
|
+
updates.name = opts.name;
|
|
169
|
+
const result = await ctx.classification.updateClassificationNode(project, 'areas', path, updates);
|
|
170
|
+
outputResult({ fileName: `area-updated-${path.replace(/\\/g, '-')}`, data: result, summary: `Updated area '${path}'` }, getGlobalFlags(program));
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
handleCliError(error, 'update area');
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
area
|
|
177
|
+
.command('delete')
|
|
178
|
+
.description('Delete an area path (DESTRUCTIVE)')
|
|
179
|
+
.argument('<project>', 'Project name')
|
|
180
|
+
.argument('<path>', 'Area path to delete')
|
|
181
|
+
.argument('<reclassifyId>', 'Node ID to reclassify work items into')
|
|
182
|
+
.action(async (project, path, reclassifyId) => {
|
|
183
|
+
try {
|
|
184
|
+
const result = await ctx.classification.deleteClassificationNode(project, 'areas', path, parseInt(reclassifyId));
|
|
185
|
+
outputResult({ fileName: `area-deleted-${path.replace(/\\/g, '-')}`, data: result, summary: `Deleted area '${path}'` }, getGlobalFlags(program));
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
handleCliError(error, 'delete area');
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=classification-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classification-commands.js","sourceRoot":"","sources":["../../../src/cli/commands/classification-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,8BAA8B,CAAC,OAAgB,EAAE,GAAmB;IAClF,6BAA6B;IAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAExG,SAAS;SACN,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,kCAA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,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;YACjH,YAAY,CACV,EAAE,QAAQ,EAAE,gBAAgB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,IAAI,GAAG,EAAE,EACzG,cAAc,CAAC,OAAO,CAAC,CACxB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment CLI Commands - list, get, deployments, checks, CRUD
|
|
3
|
+
*/
|
|
4
|
+
import type { Command } from 'commander';
|
|
5
|
+
import type { ServiceContext } from '../../types.js';
|
|
6
|
+
export declare function registerEnvironmentCommands(program: Command, ctx: ServiceContext): void;
|
|
7
|
+
//# sourceMappingURL=environment-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/environment-commands.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGrD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,CAyKvF"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment CLI Commands - list, get, deployments, checks, CRUD
|
|
3
|
+
*/
|
|
4
|
+
import { getGlobalFlags, handleCliError } from '@mcp-consultant-tools/core';
|
|
5
|
+
import { outputResult } from '../output.js';
|
|
6
|
+
export function registerEnvironmentCommands(program, ctx) {
|
|
7
|
+
const env = program.command('env').alias('e').description('Environment operations');
|
|
8
|
+
env
|
|
9
|
+
.command('list')
|
|
10
|
+
.description('List all environments in a project')
|
|
11
|
+
.argument('<project>', 'Project name')
|
|
12
|
+
.action(async (project) => {
|
|
13
|
+
try {
|
|
14
|
+
const result = await ctx.environments.listEnvironments(project);
|
|
15
|
+
outputResult({ fileName: `environments-${project}`, data: result, summary: `Environments in '${project}'` }, getGlobalFlags(program));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
handleCliError(error, 'list environments');
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
env
|
|
22
|
+
.command('get')
|
|
23
|
+
.description('Get detailed environment information')
|
|
24
|
+
.argument('<project>', 'Project name')
|
|
25
|
+
.argument('<envId>', 'Environment ID')
|
|
26
|
+
.action(async (project, envId) => {
|
|
27
|
+
try {
|
|
28
|
+
const result = await ctx.environments.getEnvironment(project, parseInt(envId));
|
|
29
|
+
outputResult({ fileName: `environment-${envId}`, data: result, summary: `Environment #${envId}` }, getGlobalFlags(program));
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
handleCliError(error, 'get environment');
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
env
|
|
36
|
+
.command('deployments')
|
|
37
|
+
.description('Get deployment history for an environment')
|
|
38
|
+
.argument('<project>', 'Project name')
|
|
39
|
+
.argument('<envId>', 'Environment ID')
|
|
40
|
+
.option('-t, --top <n>', 'Maximum number of results', '10')
|
|
41
|
+
.action(async (project, envId, opts) => {
|
|
42
|
+
try {
|
|
43
|
+
const result = await ctx.environments.getEnvironmentDeployments(project, parseInt(envId), parseInt(opts.top));
|
|
44
|
+
outputResult({ fileName: `env-deployments-${envId}`, data: result, summary: `Deployments for environment #${envId}` }, getGlobalFlags(program));
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
handleCliError(error, 'get environment deployments');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
env
|
|
51
|
+
.command('checks')
|
|
52
|
+
.description('Get checks/gates configured for an environment')
|
|
53
|
+
.argument('<project>', 'Project name')
|
|
54
|
+
.argument('<envId>', 'Environment ID')
|
|
55
|
+
.action(async (project, envId) => {
|
|
56
|
+
try {
|
|
57
|
+
const result = await ctx.environments.getEnvironmentChecks(project, parseInt(envId));
|
|
58
|
+
outputResult({ fileName: `env-checks-${envId}`, data: result, summary: `Checks for environment #${envId}` }, getGlobalFlags(program));
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
handleCliError(error, 'get environment checks');
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
env
|
|
65
|
+
.command('create')
|
|
66
|
+
.description('Create a new environment')
|
|
67
|
+
.argument('<project>', 'Project name')
|
|
68
|
+
.argument('<name>', 'Environment name')
|
|
69
|
+
.option('-d, --description <text>', 'Environment description')
|
|
70
|
+
.action(async (project, name, opts) => {
|
|
71
|
+
try {
|
|
72
|
+
const result = await ctx.environments.createEnvironment(project, name, opts.description);
|
|
73
|
+
outputResult({ fileName: `env-created-${name}`, data: result, summary: `Created environment '${name}'` }, getGlobalFlags(program));
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
handleCliError(error, 'create environment');
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
env
|
|
80
|
+
.command('update')
|
|
81
|
+
.description('Update an environment')
|
|
82
|
+
.argument('<project>', 'Project name')
|
|
83
|
+
.argument('<envId>', 'Environment ID')
|
|
84
|
+
.option('-n, --name <name>', 'New environment name')
|
|
85
|
+
.option('-d, --description <text>', 'New description')
|
|
86
|
+
.action(async (project, envId, opts) => {
|
|
87
|
+
try {
|
|
88
|
+
const updates = {};
|
|
89
|
+
if (opts.name)
|
|
90
|
+
updates.name = opts.name;
|
|
91
|
+
if (opts.description)
|
|
92
|
+
updates.description = opts.description;
|
|
93
|
+
const result = await ctx.environments.updateEnvironment(project, parseInt(envId), updates);
|
|
94
|
+
outputResult({ fileName: `env-updated-${envId}`, data: result, summary: `Updated environment #${envId}` }, getGlobalFlags(program));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
handleCliError(error, 'update environment');
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
env
|
|
101
|
+
.command('delete')
|
|
102
|
+
.description('Delete an environment (DESTRUCTIVE)')
|
|
103
|
+
.argument('<project>', 'Project name')
|
|
104
|
+
.argument('<envId>', 'Environment ID')
|
|
105
|
+
.action(async (project, envId) => {
|
|
106
|
+
try {
|
|
107
|
+
const result = await ctx.environments.deleteEnvironment(project, parseInt(envId));
|
|
108
|
+
outputResult({ fileName: `env-deleted-${envId}`, data: result, summary: `Deleted environment #${envId}` }, getGlobalFlags(program));
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
handleCliError(error, 'delete environment');
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
env
|
|
115
|
+
.command('add-check')
|
|
116
|
+
.description('Add a check/gate to an environment')
|
|
117
|
+
.argument('<project>', 'Project name')
|
|
118
|
+
.argument('<envId>', 'Environment ID')
|
|
119
|
+
.argument('<type>', 'Check type (e.g., Approval, ExclusiveLock, TaskCheck)')
|
|
120
|
+
.option('-s, --settings <json>', 'Check settings as JSON')
|
|
121
|
+
.option('--timeout <minutes>', 'Timeout in minutes')
|
|
122
|
+
.action(async (project, envId, type, opts) => {
|
|
123
|
+
try {
|
|
124
|
+
const config = {};
|
|
125
|
+
if (opts.settings)
|
|
126
|
+
config.settings = JSON.parse(opts.settings);
|
|
127
|
+
if (opts.timeout)
|
|
128
|
+
config.timeout = parseInt(opts.timeout);
|
|
129
|
+
const result = await ctx.environments.addEnvironmentCheck(project, parseInt(envId), type, config);
|
|
130
|
+
outputResult({ fileName: `env-check-added-${envId}`, data: result, summary: `Added ${type} check to environment #${envId}` }, getGlobalFlags(program));
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
handleCliError(error, 'add environment check');
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
env
|
|
137
|
+
.command('update-check')
|
|
138
|
+
.description('Update an environment check')
|
|
139
|
+
.argument('<project>', 'Project name')
|
|
140
|
+
.argument('<checkId>', 'Check configuration ID')
|
|
141
|
+
.option('-s, --settings <json>', 'Updated settings as JSON')
|
|
142
|
+
.option('--timeout <minutes>', 'Updated timeout in minutes')
|
|
143
|
+
.action(async (project, checkId, opts) => {
|
|
144
|
+
try {
|
|
145
|
+
const updates = {};
|
|
146
|
+
if (opts.settings)
|
|
147
|
+
updates.settings = JSON.parse(opts.settings);
|
|
148
|
+
if (opts.timeout)
|
|
149
|
+
updates.timeout = parseInt(opts.timeout);
|
|
150
|
+
const result = await ctx.environments.updateEnvironmentCheck(project, parseInt(checkId), updates);
|
|
151
|
+
outputResult({ fileName: `env-check-updated-${checkId}`, data: result, summary: `Updated check #${checkId}` }, getGlobalFlags(program));
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
handleCliError(error, 'update environment check');
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
env
|
|
158
|
+
.command('delete-check')
|
|
159
|
+
.description('Delete an environment check (DESTRUCTIVE)')
|
|
160
|
+
.argument('<project>', 'Project name')
|
|
161
|
+
.argument('<checkId>', 'Check configuration ID')
|
|
162
|
+
.action(async (project, checkId) => {
|
|
163
|
+
try {
|
|
164
|
+
const result = await ctx.environments.removeEnvironmentCheck(project, parseInt(checkId));
|
|
165
|
+
outputResult({ fileName: `env-check-deleted-${checkId}`, data: result, summary: `Deleted check #${checkId}` }, getGlobalFlags(program));
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
handleCliError(error, 'delete environment check');
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=environment-commands.js.map
|