@copado/agentia-cli 0.83.0-alpha.0 → 0.85.0-alpha.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/README.md +695 -162
- package/dist/commands/cicd/metadata/dependency/list.js +1 -1
- package/dist/commands/cicd/metadata/dependency/list.js.map +1 -1
- package/dist/commands/cicd/pipeline/connection/create.d.ts +19 -0
- package/dist/commands/cicd/pipeline/connection/create.js +67 -0
- package/dist/commands/cicd/pipeline/connection/create.js.map +1 -0
- package/dist/commands/cicd/pipeline/connection/delete.d.ts +15 -0
- package/dist/commands/cicd/pipeline/connection/delete.js +62 -0
- package/dist/commands/cicd/pipeline/connection/delete.js.map +1 -0
- package/dist/commands/cicd/pipeline/connection/open.d.ts +12 -0
- package/dist/commands/cicd/pipeline/connection/open.js +30 -0
- package/dist/commands/cicd/pipeline/connection/open.js.map +1 -0
- package/dist/commands/cicd/pipeline/connection/update.d.ts +19 -0
- package/dist/commands/cicd/pipeline/connection/update.js +55 -0
- package/dist/commands/cicd/pipeline/connection/update.js.map +1 -0
- package/dist/commands/cicd/pipeline/create.d.ts +19 -0
- package/dist/commands/cicd/pipeline/create.js +42 -0
- package/dist/commands/cicd/pipeline/create.js.map +1 -0
- package/dist/commands/cicd/pipeline/list.d.ts +3 -0
- package/dist/commands/cicd/pipeline/list.js +5 -3
- package/dist/commands/cicd/pipeline/list.js.map +1 -1
- package/dist/commands/cicd/pipeline/stage-connection/create.d.ts +12 -0
- package/dist/commands/cicd/pipeline/stage-connection/create.js +33 -0
- package/dist/commands/cicd/pipeline/stage-connection/create.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/delete.d.ts +16 -0
- package/dist/commands/cicd/pipeline/stage-connection/delete.js +34 -0
- package/dist/commands/cicd/pipeline/stage-connection/delete.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/list.d.ts +10 -0
- package/dist/commands/cicd/pipeline/stage-connection/list.js +37 -0
- package/dist/commands/cicd/pipeline/stage-connection/list.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/open.d.ts +12 -0
- package/dist/commands/cicd/pipeline/stage-connection/open.js +16 -0
- package/dist/commands/cicd/pipeline/stage-connection/open.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/update.d.ts +15 -0
- package/dist/commands/cicd/pipeline/stage-connection/update.js +38 -0
- package/dist/commands/cicd/pipeline/stage-connection/update.js.map +1 -0
- package/dist/commands/cicd/pipeline/update.d.ts +20 -0
- package/dist/commands/cicd/pipeline/update.js +52 -0
- package/dist/commands/cicd/pipeline/update.js.map +1 -0
- package/dist/commands/cicd/stage/create.d.ts +14 -0
- package/dist/commands/cicd/stage/create.js +28 -0
- package/dist/commands/cicd/stage/create.js.map +1 -0
- package/dist/commands/cicd/stage/delete.d.ts +14 -0
- package/dist/commands/cicd/stage/delete.js +28 -0
- package/dist/commands/cicd/stage/delete.js.map +1 -0
- package/dist/commands/cicd/stage/get.d.ts +10 -0
- package/dist/commands/cicd/stage/get.js +17 -0
- package/dist/commands/cicd/stage/get.js.map +1 -0
- package/dist/commands/cicd/stage/list.d.ts +12 -0
- package/dist/commands/cicd/stage/list.js +27 -0
- package/dist/commands/cicd/stage/list.js.map +1 -0
- package/dist/commands/cicd/stage/open.d.ts +12 -0
- package/dist/commands/cicd/stage/open.js +16 -0
- package/dist/commands/cicd/stage/open.js.map +1 -0
- package/dist/commands/cicd/stage/update.d.ts +14 -0
- package/dist/commands/cicd/stage/update.js +30 -0
- package/dist/commands/cicd/stage/update.js.map +1 -0
- package/dist/lib/dependency-from-changes.d.ts +3 -2
- package/dist/lib/dependency-from-changes.js +58 -48
- package/dist/lib/dependency-from-changes.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +134 -2
- package/dist/lib/mcp/tools.js +383 -5
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/navigation.d.ts +1 -1
- package/dist/lib/navigation.js +3 -0
- package/dist/lib/navigation.js.map +1 -1
- package/dist/lib/pipeline-connection-flags.d.ts +62 -0
- package/dist/lib/pipeline-connection-flags.js +309 -0
- package/dist/lib/pipeline-connection-flags.js.map +1 -0
- package/dist/lib/pipeline-flags.d.ts +74 -0
- package/dist/lib/pipeline-flags.js +154 -0
- package/dist/lib/pipeline-flags.js.map +1 -0
- package/dist/lib/pipeline-stage-connection-flags.d.ts +25 -0
- package/dist/lib/pipeline-stage-connection-flags.js +46 -0
- package/dist/lib/pipeline-stage-connection-flags.js.map +1 -0
- package/dist/lib/pipeline-types.d.ts +91 -2
- package/dist/lib/pipeline-types.js +51 -5
- package/dist/lib/pipeline-types.js.map +1 -1
- package/dist/lib/sdr-metadata-registry.generated.d.ts +18 -0
- package/dist/lib/sdr-metadata-registry.generated.js +6330 -0
- package/dist/lib/sdr-metadata-registry.generated.js.map +1 -0
- package/dist/lib/sdr-path-resolver.d.ts +7 -0
- package/dist/lib/sdr-path-resolver.js +116 -0
- package/dist/lib/sdr-path-resolver.js.map +1 -0
- package/dist/lib/stage-flags.d.ts +19 -0
- package/dist/lib/stage-flags.js +29 -0
- package/dist/lib/stage-flags.js.map +1 -0
- package/dist/lib/stage-types.d.ts +67 -0
- package/dist/lib/stage-types.js +69 -0
- package/dist/lib/stage-types.js.map +1 -0
- package/oclif.manifest.json +2977 -1858
- package/package.json +3 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { CicdGateway } from '../../../../lib/cicd-gateway.js';
|
|
5
|
+
import { normalizePipelineDescribe, pipelineDescribeEndpoint, } from '../../../../lib/pipeline-types.js';
|
|
6
|
+
import { formatPipelineStageConnectionTable } from '../../../../lib/stage-types.js';
|
|
7
|
+
export default class PipelineStageConnectionList extends AgentiaCommand {
|
|
8
|
+
static description = 'List stage connections for a Copado pipeline';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
'pipeline-id': Flags.string({
|
|
15
|
+
description: 'Pipeline ID whose stage connections should be listed',
|
|
16
|
+
required: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(PipelineStageConnectionList);
|
|
21
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
22
|
+
const response = await this.withSpinner('Fetching pipeline stage connections', () => CicdGateway.call({
|
|
23
|
+
endpoint: pipelineDescribeEndpoint(pipelineId),
|
|
24
|
+
method: 'GET',
|
|
25
|
+
}));
|
|
26
|
+
const connections = normalizePipelineDescribe(response).stageConnections ?? [];
|
|
27
|
+
this.display(() => {
|
|
28
|
+
if (connections.length === 0) {
|
|
29
|
+
this.log('No pipeline stage connections found.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.log(formatPipelineStageConnectionTable(connections));
|
|
33
|
+
});
|
|
34
|
+
return connections;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/pipeline/stage-connection/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GAEzB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAC,kCAAkC,EAA+B,MAAM,g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Command {
|
|
3
|
+
static args: {
|
|
4
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
run(): Promise<{
|
|
9
|
+
provider: string;
|
|
10
|
+
url: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { openNavigationTarget } from '../../../../lib/navigation-open.js';
|
|
4
|
+
import { resolveNavigationTarget } from '../../../../lib/navigation.js';
|
|
5
|
+
export default class PipelineStageConnectionOpen extends AgentiaCommand {
|
|
6
|
+
static args = { id: Args.string({ description: 'Pipeline stage connection ID', required: true }) };
|
|
7
|
+
static description = 'Open a pipeline stage connection in the browser';
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %> connection-1', '<%= config.bin %> <%= command.id %> connection-1 --json'];
|
|
9
|
+
async run() {
|
|
10
|
+
const { args } = await this.parse(PipelineStageConnectionOpen);
|
|
11
|
+
const target = await this.withSpinner('Resolving navigation URL', () => resolveNavigationTarget({ id: args.id, resourceType: 'pipeline_stage_connection' }));
|
|
12
|
+
await openNavigationTarget(target, { jsonEnabled: this.jsonEnabled(), log: this.log.bind(this) });
|
|
13
|
+
return target;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/pipeline/stage-connection/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAC,uBAAuB,EAAC,MAAM,+BAA+B,CAAA;AAErE,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,cAAc;IACrE,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACvG,MAAM,CAAU,WAAW,GAAG,iDAAiD,CAAA;IAC/E,MAAM,CAAU,QAAQ,GAAG,CAAC,kDAAkD,EAAE,yDAAyD,CAAC,CAAA;IAEnI,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;QAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,GAAG,EAAE,CACrE,uBAAuB,CAAC,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,2BAA2B,EAAC,CAAC,CAClF,CAAA;QACD,MAAM,oBAAoB,CAAC,MAAM,EAAE,EAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC,CAAA;QAC/F,OAAO,MAAM,CAAA;IACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
2
|
+
import { type PipelineStageConnection } from '../../../../lib/stage-types.js';
|
|
3
|
+
export default class PipelineStageConnectionUpdate extends AgentiaCommand {
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
readonly 'pipeline-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
readonly 'next-pipeline-stage-connection-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
readonly 'stage-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<PipelineStageConnection>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { CicdGateway } from '../../../../lib/cicd-gateway.js';
|
|
5
|
+
import { buildPipelineStageConnectionUpdatePayload, pipelineStageConnectionUpdateFlags, } from '../../../../lib/pipeline-stage-connection-flags.js';
|
|
6
|
+
import { normalizePipelineStageConnection, pipelineStageConnectionEndpoint, } from '../../../../lib/stage-types.js';
|
|
7
|
+
export default class PipelineStageConnectionUpdate extends AgentiaCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
id: Args.string({ description: 'Pipeline stage connection ID', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Update a pipeline stage connection';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> <%= command.id %> connection-1 --pipeline-id pipeline-1 --next-pipeline-stage-connection-id connection-2',
|
|
14
|
+
];
|
|
15
|
+
static flags = pipelineStageConnectionUpdateFlags;
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(PipelineStageConnectionUpdate);
|
|
18
|
+
const connectionId = assertRequired(args.id, 'id');
|
|
19
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
20
|
+
let payload;
|
|
21
|
+
try {
|
|
22
|
+
payload = buildPipelineStageConnectionUpdatePayload(flags, connectionId);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
26
|
+
}
|
|
27
|
+
const response = await this.withSpinner('Updating pipeline stage connection', () => CicdGateway.call({
|
|
28
|
+
body: payload,
|
|
29
|
+
endpoint: pipelineStageConnectionEndpoint(pipelineId, connectionId),
|
|
30
|
+
headers: { 'Content-Type': 'application/json' },
|
|
31
|
+
method: 'PATCH',
|
|
32
|
+
}));
|
|
33
|
+
const connection = normalizePipelineStageConnection(response);
|
|
34
|
+
this.display(() => this.log(`Updated pipeline stage connection (ID: ${connection.id ?? connectionId}).`));
|
|
35
|
+
return connection;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/pipeline/stage-connection/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EACL,yCAAyC,EACzC,kCAAkC,GACnC,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EACL,gCAAgC,EAEhC,+BAA+B,GAEhC,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,cAAc;IACvE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC/E,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,oCAAoC,CAAA;IAClE,MAAM,CAAU,QAAQ,GAAG;QACzB,4HAA4H;KAC7H,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,kCAAkC,CAAA;IAEnD,KAAK,CA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eline-types.js';
|
|
3
|
+
export default class PipelineUpdate extends AgentiaCommand {
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
readonly 'calculate-based-on': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
readonly 'git-repository-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
readonly 'main-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
readonly platform: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
readonly active: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
readonly 'block-commits': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
readonly 'enable-smart-conflict-resolution': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<Pipeline>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
|
+
import { buildPipelineMutationPayload, collectPipelineMutationFlagKeys, pipelineUpdateFlags, validatePipelineMutationPayload, } from '../../../lib/pipeline-flags.js';
|
|
5
|
+
import { normalizePipeline, pipelineEndpoint, } from '../../../lib/pipeline-types.js';
|
|
6
|
+
export default class PipelineUpdate extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Pipeline ID',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Update a Copado pipeline by ID';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> pipeline-1 --main-branch develop',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> pipeline-1 --platform SFDX --active',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> pipeline-1 --name "Updated Pipeline" --json',
|
|
18
|
+
];
|
|
19
|
+
static flags = pipelineUpdateFlags;
|
|
20
|
+
async run() {
|
|
21
|
+
const { args, flags } = await this.parse(PipelineUpdate);
|
|
22
|
+
const selectedKeys = collectPipelineMutationFlagKeys(flags);
|
|
23
|
+
if (selectedKeys.length === 0) {
|
|
24
|
+
this.error('Must provide at least one flag to update.', {
|
|
25
|
+
exit: 2,
|
|
26
|
+
suggestions: [
|
|
27
|
+
`${this.config.bin} cicd pipeline update ${args.id} --main-branch develop`,
|
|
28
|
+
`${this.config.bin} cicd pipeline update ${args.id} --platform SFDX`,
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const payload = buildPipelineMutationPayload(flags);
|
|
33
|
+
const validationError = validatePipelineMutationPayload(payload);
|
|
34
|
+
if (validationError !== undefined) {
|
|
35
|
+
this.error(validationError, { exit: 2 });
|
|
36
|
+
}
|
|
37
|
+
const response = await this.withSpinner('Updating pipeline', () => CicdGateway.call({
|
|
38
|
+
body: payload,
|
|
39
|
+
endpoint: pipelineEndpoint(args.id),
|
|
40
|
+
headers: {
|
|
41
|
+
'Content-Type': 'application/json',
|
|
42
|
+
},
|
|
43
|
+
method: 'PATCH',
|
|
44
|
+
}));
|
|
45
|
+
const pipeline = normalizePipeline(response);
|
|
46
|
+
this.display(() => {
|
|
47
|
+
this.log(`Updated pipeline ${pipeline.name ?? payload.name ?? args.id} (ID: ${pipeline.id ?? args.id}).`);
|
|
48
|
+
});
|
|
49
|
+
return pipeline;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/cicd/pipeline/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,EAEjB,gBAAgB,GAEjB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,gCAAgC,CAAA;IAC9D,MAAM,CAAU,QAAQ,GAAG;QACzB,sEAAsE;QACtE,yEAAyE;QACzE,iFAAiF;KAClF,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,mBAAmB,CAAA;IAEpC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACtD,MAAM,YAAY,GAAG,+BAA+B,CAAC,KAAK,CAAC,CAAA;QAE3D,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,2CAA2C,EAAE;gBACtD,IAAI,EAAE,CAAC;gBACP,WAAW,EAAE;oBACX,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,yBAAyB,IAAI,CAAC,EAAE,wBAAwB;oBAC1E,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,yBAAyB,IAAI,CAAC,EAAE,kBAAkB;iBACrE;aACF,CAAC,CAAA;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,eAAe,GAAG,+BAA+B,CAAC,OAAO,CAAC,CAAA;QAEhE,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QACxC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAChE,WAAW,CAAC,IAAI,CAA8B;YAC5C,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,OAAO;SAChB,CAAC,CACH,CAAA;QACD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;QAE5C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,SAAS,QAAQ,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAC3G,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAA;IACjB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type Stage } from '../../../lib/stage-types.js';
|
|
3
|
+
export default class StageCreate extends AgentiaCommand {
|
|
4
|
+
static args: {
|
|
5
|
+
name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
readonly 'meta-stage': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<Stage>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
|
+
import { buildStageMutationPayload, stageCreateFlags, validateStagePayload } from '../../../lib/stage-flags.js';
|
|
5
|
+
import { normalizeStage, stagesEndpoint } from '../../../lib/stage-types.js';
|
|
6
|
+
export default class StageCreate extends AgentiaCommand {
|
|
7
|
+
static args = { name: Args.string({ description: 'Stage name', required: true }) };
|
|
8
|
+
static description = 'Create a Copado stage';
|
|
9
|
+
static examples = ['<%= config.bin %> <%= command.id %> Build', '<%= config.bin %> <%= command.id %> Test --meta-stage Test'];
|
|
10
|
+
static flags = stageCreateFlags;
|
|
11
|
+
async run() {
|
|
12
|
+
const { args, flags } = await this.parse(StageCreate);
|
|
13
|
+
const payload = { ...buildStageMutationPayload(flags), name: args.name };
|
|
14
|
+
const validationError = validateStagePayload(payload, true);
|
|
15
|
+
if (validationError !== undefined)
|
|
16
|
+
this.error(validationError, { exit: 2 });
|
|
17
|
+
const response = await this.withSpinner('Creating stage', () => CicdGateway.call({
|
|
18
|
+
body: payload,
|
|
19
|
+
endpoint: stagesEndpoint(),
|
|
20
|
+
headers: { 'Content-Type': 'application/json' },
|
|
21
|
+
method: 'POST',
|
|
22
|
+
}));
|
|
23
|
+
const stage = normalizeStage(response);
|
|
24
|
+
this.display(() => this.log(`Created stage ${stage.name ?? args.name} (ID: ${stage.id ?? 'unknown id'}).`));
|
|
25
|
+
return stage;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAC,cAAc,EAAkC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAE1G,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAU,IAAI,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACvF,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG,CAAC,2CAA2C,EAAE,4DAA4D,CAAC,CAAA;IACtI,MAAM,CAAU,KAAK,GAAG,gBAAgB,CAAA;IAEjC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,EAAC,GAAG,yBAAyB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC,CAAA;QACtE,MAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAC3D,IAAI,eAAe,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAEzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC7D,WAAW,CAAC,IAAI,CAAwB;YACtC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,cAAc,EAAE;YAC1B,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,MAAM;SACf,CAAC,CACH,CAAA;QACD,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,SAAS,KAAK,CAAC,EAAE,IAAI,YAAY,IAAI,CAAC,CAAC,CAAA;QAC3G,OAAO,KAAK,CAAA;IACd,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
export default class StageDelete extends AgentiaCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<{
|
|
12
|
+
id: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
4
|
+
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
5
|
+
import { stageEndpoint } from '../../../lib/stage-types.js';
|
|
6
|
+
export default class StageDelete extends AgentiaCommand {
|
|
7
|
+
static args = { id: Args.string({ description: 'Stage ID', required: true }) };
|
|
8
|
+
static description = 'Delete a Copado stage';
|
|
9
|
+
static examples = ['<%= config.bin %> <%= command.id %> <stage-id>', '<%= config.bin %> <%= command.id %> <stage-id> --yes --json'];
|
|
10
|
+
static flags = {
|
|
11
|
+
yes: Flags.boolean({ char: 'y', default: false, description: 'Confirm deletion without prompting' }),
|
|
12
|
+
};
|
|
13
|
+
async run() {
|
|
14
|
+
const { args, flags } = await this.parse(StageDelete);
|
|
15
|
+
if (!flags.yes) {
|
|
16
|
+
if (this.jsonEnabled() || !process.stdin.isTTY) {
|
|
17
|
+
this.error('Stage deletion requires confirmation. Pass --yes for headless or JSON execution.', { exit: 2 });
|
|
18
|
+
}
|
|
19
|
+
if (!(await confirm({ default: false, message: `Delete stage ${args.id}?` }))) {
|
|
20
|
+
this.error('Stage deletion canceled.', { exit: 1 });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
await this.withSpinner('Deleting stage', () => CicdGateway.call({ endpoint: stageEndpoint(args.id), method: 'DELETE' }));
|
|
24
|
+
this.display(() => this.log(`Deleted stage (ID: ${args.id}).`));
|
|
25
|
+
return { id: args.id };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AAEzD,MAAM,CAAC,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MAAM,EAAE,QAAQ,EAAC,CAAC,CAC7E,CAAA;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;QAC/D,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAC,CAAA;IACtB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type Stage } from '../../../lib/stage-types.js';
|
|
3
|
+
export default class StageGet extends AgentiaCommand {
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
run(): Promise<Stage>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
|
+
import { formatStageDetail, normalizeStage, stageEndpoint } from '../../../lib/stage-types.js';
|
|
5
|
+
export default class StageGet extends AgentiaCommand {
|
|
6
|
+
static args = { id: Args.string({ description: 'Stage ID', required: true }) };
|
|
7
|
+
static description = 'Get a Copado stage';
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %> <stage-id>', '<%= config.bin %> <%= command.id %> <stage-id> --json'];
|
|
9
|
+
async run() {
|
|
10
|
+
const { args } = await this.parse(StageGet);
|
|
11
|
+
const response = await this.withSpinner('Fetching stage', () => CicdGateway.call({ endpoint: stageEndpoint(args.id), method: 'GET' }));
|
|
12
|
+
const stage = normalizeStage(response);
|
|
13
|
+
this.display(() => this.log(formatStageDetail(stage)));
|
|
14
|
+
return stage;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingUR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
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type PaginatedListResult } from '../../../lib/list-pagination.js';
|
|
3
|
+
import { type Stage } from '../../../lib/stage-types.js';
|
|
4
|
+
export default class StageList extends AgentiaCommand {
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
readonly cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
readonly 'page-size': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<PaginatedListResult<Stage>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
|
+
import { displayListPagination, listPaginationFlags } from '../../../lib/list-pagination.js';
|
|
4
|
+
import { formatStageTable, normalizeStagesListPage, stagesEndpoint } from '../../../lib/stage-types.js';
|
|
5
|
+
export default class StageList extends AgentiaCommand {
|
|
6
|
+
static description = 'List Copado stages';
|
|
7
|
+
static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --json'];
|
|
8
|
+
static flags = listPaginationFlags;
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(StageList);
|
|
11
|
+
const response = await this.withSpinner('Fetching stages', () => CicdGateway.call({
|
|
12
|
+
endpoint: stagesEndpoint({ cursor: flags.cursor, pageSize: flags['page-size'] }),
|
|
13
|
+
method: 'GET',
|
|
14
|
+
}));
|
|
15
|
+
const page = normalizeStagesListPage(response);
|
|
16
|
+
this.display(() => {
|
|
17
|
+
if (page.data.length === 0) {
|
|
18
|
+
this.log('No stages found.');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.log(formatStageTable(page.data));
|
|
22
|
+
displayListPagination(this.log.bind(this), page);
|
|
23
|
+
});
|
|
24
|
+
return page;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,qBAAqB,EAAE,mBAAmB,EAA2B,MAAM,iCAAiC,CAAA;AACpH,OAAO,EAAC,gBAAgB,EAAE,uBAAuB,EAAsC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAEzI,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,MAAM,CAAU,WAAW,GAAG,oBAAoB,CAAA;IAClD,MAAM,CAAU,QAAQ,GAAG,CAAC,qCAAqC,EAAE,4CAA4C,CAAC,CAAA;IAChH,MAAM,CAAU,KAAK,GAAG,mBAAmB,CAAA;IAEpC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAC9D,WAAW,CAAC,IAAI,CAAoB;YAClC,QAAQ,EAAE,cAAc,CAAC,EAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,EAAC,CAAC;YAC9E,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,IAAI,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAA;QAE9C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;gBAC5B,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YACrC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
export default class StageOpen extends AgentiaCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
run(): Promise<{
|
|
9
|
+
provider: string;
|
|
10
|
+
url: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { openNavigationTarget } from '../../../lib/navigation-open.js';
|
|
4
|
+
import { resolveNavigationTarget } from '../../../lib/navigation.js';
|
|
5
|
+
export default class StageOpen extends AgentiaCommand {
|
|
6
|
+
static args = { id: Args.string({ description: 'Stage ID', required: true }) };
|
|
7
|
+
static description = 'Open a Copado stage in the browser';
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %> <stage-id>', '<%= config.bin %> <%= command.id %> <stage-id> --json'];
|
|
9
|
+
async run() {
|
|
10
|
+
const { args } = await this.parse(StageOpen);
|
|
11
|
+
const target = await this.withSpinner('Resolving navigation URL', () => resolveNavigationTarget({ id: args.id, resourceType: 'stage' }));
|
|
12
|
+
await openNavigationTarget(target, { jsonEnabled: this.jsonEnabled(), log: this.log.bind(this) });
|
|
13
|
+
return target;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAA;AAElE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACnF,MAAM,CAAU,WAAW,GAAG,oCAAoC,CAAA;IAClE,MAAM,CAAU,QAAQ,GAAG,CAAC,gDAAgD,EAAE,uDAAuD,CAAC,CAAA;IAE/H,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,GAAG,EAAE,CACrE,uBAAuB,CAAC,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAC,CAAC,CAC9D,CAAA;QACD,MAAM,oBAAoB,CAAC,MAAM,EAAE,EAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC,CAAA;QAC/F,OAAO,MAAM,CAAA;IACf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type Stage } from '../../../lib/stage-types.js';
|
|
3
|
+
export default class StageUpdate extends AgentiaCommand {
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
readonly 'meta-stage': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<Stage>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
|
+
import { buildStageMutationPayload, stageUpdateFlags, validateStagePayload } from '../../../lib/stage-flags.js';
|
|
5
|
+
import { normalizeStage, stageEndpoint } from '../../../lib/stage-types.js';
|
|
6
|
+
export default class StageUpdate extends AgentiaCommand {
|
|
7
|
+
static args = { id: Args.string({ description: 'Stage ID', required: true }) };
|
|
8
|
+
static description = 'Update a Copado stage';
|
|
9
|
+
static examples = ['<%= config.bin %> <%= command.id %> <stage-id> --name QA', '<%= config.bin %> <%= command.id %> <stage-id> --meta-stage Test'];
|
|
10
|
+
static flags = stageUpdateFlags;
|
|
11
|
+
async run() {
|
|
12
|
+
const { args, flags } = await this.parse(StageUpdate);
|
|
13
|
+
const payload = buildStageMutationPayload(flags);
|
|
14
|
+
if (Object.keys(payload).length === 0)
|
|
15
|
+
this.error('Must provide at least one flag to update.', { exit: 2 });
|
|
16
|
+
const validationError = validateStagePayload(payload);
|
|
17
|
+
if (validationError !== undefined)
|
|
18
|
+
this.error(validationError, { exit: 2 });
|
|
19
|
+
const response = await this.withSpinner('Updating stage', () => CicdGateway.call({
|
|
20
|
+
body: payload,
|
|
21
|
+
endpoint: stageEndpoint(args.id),
|
|
22
|
+
headers: { 'Content-Type': 'application/json' },
|
|
23
|
+
method: 'PATCH',
|
|
24
|
+
}));
|
|
25
|
+
const stage = normalizeStage(response);
|
|
26
|
+
this.display(() => this.log(`Updated stage ${stage.name ?? args.id} (ID: ${stage.id ?? args.id}).`));
|
|
27
|
+
return stage;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAC,cAAc,EAAc,aAAa,EAAqB,MAAM,6BAA6B,CAAA;AAEzG,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACnF,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG,CAAC,0DAA0D,EAAE,kEAAkE,CAAC,CAAA;IAC3J,MAAM,CAAU,KAAK,GAAG,gBAAgB,CAAA;IAEjC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAA;QAChD,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QACzG,MAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;QACrD,IAAI,eAAe,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAEzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC7D,WAAW,CAAC,IAAI,CAAwB;YACtC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,OAAO;SAChB,CAAC,CACH,CAAA;QACD,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,SAAS,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;QACpG,OAAO,KAAK,CAAA;IACd,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DependencySelection, ModuleType } from './metadata-common.js';
|
|
2
|
-
export type
|
|
2
|
+
export type GitNameStatusLinesFn = (baseRef: string) => Promise<string[]>;
|
|
3
|
+
export type GitStagedNameStatusLinesFn = () => Promise<string[]>;
|
|
3
4
|
export declare function resolveChangedPath(path: string, moduleType?: ModuleType): DependencySelection | undefined;
|
|
4
5
|
export declare function selectionsFromChangedFiles(baseRef: string, moduleType?: ModuleType): Promise<DependencySelection[]>;
|
|
5
|
-
export declare function setGitChangedFilesForTests(
|
|
6
|
+
export declare function setGitChangedFilesForTests(committedLines: GitNameStatusLinesFn | string[], stagedLines?: GitStagedNameStatusLinesFn | string[]): void;
|
|
6
7
|
export declare function resetGitChangedFilesForTests(): void;
|