@copado/agentia-cli 1.1.0 → 1.2.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/CHANGELOG.md +40 -0
- package/README.md +2370 -1850
- package/dist/commands/ai/agent/ask.js +4 -4
- package/dist/commands/ai/agent/chat.js +4 -4
- package/dist/commands/cicd/credential/auth/status.js +38 -0
- package/dist/commands/cicd/credential/auth/web/login.js +54 -0
- package/dist/commands/cicd/credential/list.js +13 -17
- package/dist/commands/cicd/credential/open.js +30 -0
- package/dist/commands/cicd/credential/update.js +9 -12
- package/dist/commands/cicd/environment/auth/status.js +34 -13
- package/dist/commands/cicd/environment/auth/web/login.js +20 -4
- package/dist/commands/cicd/environment/open.js +6 -22
- package/dist/commands/cicd/extension-configuration/get.js +24 -0
- package/dist/commands/cicd/extension-configuration/list.js +49 -0
- package/dist/commands/cicd/extension-configuration/open.js +38 -0
- package/dist/commands/cicd/metadata/content/get.js +1 -1
- package/dist/commands/cicd/metadata/dependency/list.js +2 -2
- package/dist/commands/cicd/metadata/explore.js +81 -0
- package/dist/commands/cicd/metadata/list.js +3 -3
- package/dist/commands/cicd/metadata/refresh/deleted.js +1 -1
- package/dist/commands/cicd/metadata/refresh/run.js +2 -2
- package/dist/commands/cicd/metadata/refresh/status.js +2 -2
- package/dist/commands/cicd/pipeline/automation/activate.js +39 -0
- package/dist/commands/cicd/pipeline/automation/create.js +33 -0
- package/dist/commands/cicd/pipeline/automation/deactivate.js +39 -0
- package/dist/commands/cicd/pipeline/automation/delete.js +45 -0
- package/dist/commands/cicd/pipeline/automation/get.js +32 -0
- package/dist/commands/cicd/pipeline/automation/list.js +38 -0
- package/dist/commands/cicd/pipeline/automation/open.js +38 -0
- package/dist/commands/cicd/pipeline/automation/update.js +38 -0
- package/dist/commands/cicd/pipeline/quality-gate/activate.js +39 -0
- package/dist/commands/cicd/pipeline/quality-gate/create.js +34 -0
- package/dist/commands/cicd/pipeline/quality-gate/deactivate.js +39 -0
- package/dist/commands/cicd/pipeline/quality-gate/delete.js +45 -0
- package/dist/commands/cicd/pipeline/quality-gate/get.js +32 -0
- package/dist/commands/cicd/pipeline/quality-gate/list.js +34 -0
- package/dist/commands/cicd/pipeline/quality-gate/open.js +38 -0
- package/dist/commands/cicd/pipeline/quality-gate/update.js +38 -0
- package/dist/commands/cicd/work/create.js +1 -0
- package/dist/commands/cicd/work/environment-sync.js +8 -7
- package/dist/commands/cicd/work/set.js +6 -4
- package/dist/commands/cicd/work/submit.js +3 -2
- package/dist/commands/cicd/work/update.js +1 -0
- package/dist/commands/plugins/install.js +2 -5
- package/dist/commands/setup/skills/create.js +28 -2
- package/dist/commands/setup/skills/list.js +55 -0
- package/dist/commands/setup/skills/update.js +36 -3
- package/dist/commands/setup.js +3 -3
- package/dist/commands/testing/data-table/create.js +1 -2
- package/dist/commands/testing/data-table/delete.js +1 -2
- package/dist/commands/testing/data-table/export.js +2 -6
- package/dist/commands/testing/data-table/get.js +2 -4
- package/dist/commands/testing/data-table/list.js +1 -2
- package/dist/commands/testing/data-table/update.js +3 -4
- package/dist/commands/testing/job/create.js +26 -22
- package/dist/commands/testing/job/delete.js +2 -2
- package/dist/commands/testing/job/files/download.js +73 -0
- package/dist/commands/testing/job/files/list.js +43 -0
- package/dist/commands/testing/job/{upload.js → files/upload.js} +13 -9
- package/dist/commands/testing/job/get.js +2 -2
- package/dist/commands/testing/job/list.js +1 -1
- package/dist/commands/testing/job/refs.js +4 -4
- package/dist/commands/testing/job/run.js +134 -1
- package/dist/commands/testing/{build → job/runs}/abort.js +10 -8
- package/dist/commands/testing/job/runs/get.js +42 -0
- package/dist/commands/testing/{build → job/runs}/list.js +19 -10
- package/dist/commands/testing/{logs.js → job/runs/logs.js} +9 -6
- package/dist/commands/testing/{build → job/runs}/search.js +9 -7
- package/dist/commands/testing/job/schedule/get.js +5 -11
- package/dist/commands/testing/job/schedule/remove.js +3 -3
- package/dist/commands/testing/job/schedule/set.js +3 -3
- package/dist/commands/testing/job/update.js +22 -65
- package/dist/commands/testing/live/continue.js +5 -10
- package/dist/commands/testing/live/execute.js +3 -3
- package/dist/commands/testing/live/history.js +7 -2
- package/dist/commands/testing/live/inspect.js +5 -4
- package/dist/commands/testing/live/interrupt.js +5 -10
- package/dist/commands/testing/live/recorder.js +23 -115
- package/dist/commands/testing/live/reports.js +3 -3
- package/dist/commands/testing/live/screenshot.js +3 -3
- package/dist/commands/testing/live/set-options.js +11 -4
- package/dist/commands/testing/live/start.js +9 -4
- package/dist/commands/testing/live/status.js +2 -5
- package/dist/commands/testing/live/stop.js +3 -5
- package/dist/commands/testing/live/view.js +2 -2
- package/dist/commands/testing/project/create.js +1 -17
- package/dist/commands/testing/project/get.js +0 -1
- package/dist/commands/testing/project/list.js +2 -2
- package/dist/commands/testing/project/permission/set.js +3 -7
- package/dist/commands/testing/project/permission/update.js +2 -2
- package/dist/commands/testing/robot/create.js +22 -25
- package/dist/commands/testing/robot/get.js +1 -1
- package/dist/commands/testing/robot/list.js +3 -3
- package/dist/commands/testing/robot/update.js +3 -3
- package/dist/commands/testing/user-parameter/create.js +3 -9
- package/dist/commands/testing/user-parameter/update.js +1 -7
- package/dist/commands/testing/variable/create.js +4 -9
- package/dist/commands/testing/variable/list.js +3 -3
- package/dist/commands/testing/variable/update.js +5 -12
- package/dist/help.js +17 -0
- package/dist/lib/ai-types.js +2 -1
- package/dist/lib/claude-mcp-config.js +15 -0
- package/dist/lib/credential-sync.js +1 -2
- package/dist/lib/defaults-store.js +4 -1
- package/dist/lib/environment-auth-status.js +2 -1
- package/dist/lib/environment-auth.js +2 -1
- package/dist/lib/environment-credential-flags.js +3 -1
- package/dist/lib/environment-credential-operations.js +8 -2
- package/dist/lib/environment-types.js +3 -1
- package/dist/lib/extension-configuration-ops.js +4 -0
- package/dist/lib/extension-configuration-sanitize.js +7 -0
- package/dist/lib/extension-configuration-types.js +8 -0
- package/dist/lib/http-proxy.js +13 -0
- package/dist/lib/mcp/ai-tools.js +3 -3
- package/dist/lib/mcp/command-id.js +2 -0
- package/dist/lib/mcp/pipeline-automation-quality-tools.js +452 -0
- package/dist/lib/mcp/server.js +70 -1
- package/dist/lib/mcp/testing-live-tools.js +24 -13
- package/dist/lib/mcp/testing-tools.js +239 -550
- package/dist/lib/mcp/tool-annotations.js +27 -18
- package/dist/lib/mcp/tools.js +117 -32
- package/dist/lib/mcp/work-tools.js +18 -4
- package/dist/lib/metadata-explore.js +8 -0
- package/dist/lib/network-error.js +8 -0
- package/dist/lib/pipeline-automation-flags.js +12 -0
- package/dist/lib/pipeline-automation-ops.js +9 -0
- package/dist/lib/pipeline-automation-types.js +18 -0
- package/dist/lib/pipeline-lifecycle-id.js +3 -0
- package/dist/lib/pipeline-quality-gate-flags.js +12 -0
- package/dist/lib/pipeline-quality-gate-ops.js +9 -0
- package/dist/lib/pipeline-quality-gate-types.js +17 -0
- package/dist/lib/plugin-host/ai.js +2 -1
- package/dist/lib/plugin-skills.js +22 -0
- package/dist/lib/plugin-trust/gate.js +1 -2
- package/dist/lib/project-root.js +3 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/salesforce-tooling-check.js +6 -0
- package/dist/lib/skill-packs.js +7 -0
- package/dist/lib/testing-archive.js +9 -0
- package/dist/lib/testing-data-table.js +39 -0
- package/dist/lib/testing-execution.js +22 -0
- package/dist/lib/testing-flags.js +6 -2
- package/dist/lib/testing-gateway.js +4 -1
- package/dist/lib/testing-live-command.js +3 -1
- package/dist/lib/testing-live-operations.js +7 -1
- package/dist/lib/testing-live-recorder.js +3 -1
- package/dist/lib/testing-live-state.js +8 -1
- package/dist/lib/testing-operations.js +6 -21
- package/dist/lib/testing-sanitization.js +2 -1
- package/dist/lib/testing-secret-input.js +2 -1
- package/dist/lib/testing-types.js +24 -3
- package/dist/lib/work-environment-sync.js +3 -1
- package/dist/lib/work-flags.js +6 -1
- package/dist/lib/work-local-development-flow.js +4 -0
- package/dist/lib/work-submit-wait.js +3 -1
- package/oclif.manifest.json +6609 -6895
- package/package.json +35 -2
- package/templates/skills/agentia-ai/SKILL.md +3 -4
- package/templates/skills/agentia-ai/references/ai-agents.md +2 -2
- package/templates/skills/agentia-cicd/SKILL.md +7 -4
- package/templates/skills/agentia-cicd/references/environments-and-credentials.md +19 -13
- package/templates/skills/agentia-cicd/references/extensions.md +3 -0
- package/templates/skills/agentia-cicd/references/pipelines.md +36 -2
- package/templates/skills/agentia-cicd/references/work.md +20 -5
- package/templates/skills/agentia-metadata/SKILL.md +140 -0
- package/templates/skills/agentia-metadata/references/metadata-explore.md +142 -0
- package/templates/skills/agentia-testing/SKILL.md +3 -3
- package/templates/skills/agentia-testing/references/tests.md +14 -14
- package/dist/commands/testing/build/get.js +0 -38
- package/dist/commands/testing/build/latest.js +0 -40
- package/dist/commands/testing/build/logs.js +0 -47
- package/dist/commands/testing/build/run.js +0 -26
- package/dist/commands/testing/create.js +0 -2
- package/dist/commands/testing/job/download.js +0 -54
- package/dist/commands/testing/job/files.js +0 -34
- package/dist/commands/testing/run.js +0 -26
- package/dist/commands/testing/status.js +0 -45
- package/dist/commands/testing/test/create.js +0 -2
- package/dist/commands/testing/test/logs.js +0 -2
- package/dist/commands/testing/test/run.js +0 -26
- package/dist/commands/testing/test/status.js +0 -2
- package/dist/commands/testing/test/update.js +0 -2
- package/dist/commands/testing/update.js +0 -65
- package/dist/lib/testing-data-command.js +0 -8
- package/dist/lib/testing-data-core.js +0 -20
- package/dist/lib/testing-data-export.js +0 -6
- package/dist/lib/testing-data-import.js +0 -6
- package/dist/lib/testing-data-io.js +0 -12
- package/dist/lib/testing-data-operations.js +0 -10
- package/dist/lib/testing-data-types.js +0 -4
- package/dist/lib/testing-live-endpoints.js +0 -6
- package/dist/lib/testing-live-history.js +0 -7
- package/dist/lib/testing-run-command.js +0 -3
- package/dist/lib/testing-schedule.js +0 -5
- package/dist/lib/testing-session.js +0 -5
- package/dist/lib/testing-watch.js +0 -4
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { AI_METADATA_ACTIONS, buildAiMetadataToolRequest, callAiMetadataTool, } from '../../../lib/metadata-explore.js';
|
|
4
|
+
export default class MetadataExplore extends AgentiaCommand {
|
|
5
|
+
static description = [
|
|
6
|
+
'Explore Salesforce metadata through Org Intelligence.',
|
|
7
|
+
'Uses the project default credential when --credential-id is omitted;',
|
|
8
|
+
'otherwise pass --credential-id, or both --session-id and --endpoint.',
|
|
9
|
+
].join(' ');
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --action list --object-type ApexClass',
|
|
12
|
+
"<%= config.bin %> <%= command.id %> --action list --object-type ApexClass --pattern 'Account*'",
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --action read --object-type ApexClass --full-name MyClass',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --action find_references --object-type ApexClass --full-name MyClass',
|
|
15
|
+
"<%= config.bin %> <%= command.id %> --action search --pattern 'Cont*' --credential-id <id>",
|
|
16
|
+
'<%= config.bin %> <%= command.id %> --action describe_type --object-type CustomObject --json',
|
|
17
|
+
];
|
|
18
|
+
static experimental = true;
|
|
19
|
+
static flags = {
|
|
20
|
+
action: Flags.string({
|
|
21
|
+
description: 'Metadata action: list, search, read_documentation, describe_type, read, find_references, run_apex_tests',
|
|
22
|
+
options: [...AI_METADATA_ACTIONS],
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
'apex-unit-tests': Flags.string({
|
|
26
|
+
description: 'Comma-separated Apex test classes. Required for run_apex_tests.',
|
|
27
|
+
}),
|
|
28
|
+
// Deferred write/deploy flags (re-add with matching AI_METADATA_ACTIONS when shipping mutate):
|
|
29
|
+
// 'async-id': Flags.string({
|
|
30
|
+
// description: 'Deployment Id from a previous validate/deploy for deploy_validated or check_async_id',
|
|
31
|
+
// }),
|
|
32
|
+
'credential-id': Flags.string({
|
|
33
|
+
description: 'Copado credential Id for the target org. Defaults to the CICD project default credential when set.',
|
|
34
|
+
}),
|
|
35
|
+
endpoint: Flags.string({
|
|
36
|
+
description: 'Salesforce instance URL (with --session-id) when not using a credential. Exclusive with --credential-id.',
|
|
37
|
+
}),
|
|
38
|
+
'full-name': Flags.string({
|
|
39
|
+
description: 'Fully qualified metadata name (required for read; list results emit this as fullName)',
|
|
40
|
+
}),
|
|
41
|
+
// 'metadata-files': Flags.string({
|
|
42
|
+
// description:
|
|
43
|
+
// 'YAML/XML Metadata API files for validate (with --full-name). Each file starts with ~~~~~~~~~~ <pathname> <type> <name> ~~~~~~~~~',
|
|
44
|
+
// }),
|
|
45
|
+
'object-type': Flags.string({
|
|
46
|
+
description: 'Metadata type, for example ApexClass, CustomObject, or Flow',
|
|
47
|
+
}),
|
|
48
|
+
// 'organization-name': Flags.string({
|
|
49
|
+
// description: 'Optional label for logging; not used to select the target org',
|
|
50
|
+
// }),
|
|
51
|
+
pattern: Flags.string({
|
|
52
|
+
default: '*',
|
|
53
|
+
description: 'Wildcard pattern for list/search (name without namespace), for example Account* or *Info',
|
|
54
|
+
}),
|
|
55
|
+
'session-id': Flags.string({
|
|
56
|
+
description: 'Salesforce session Id (with --endpoint) when not using a credential. Exclusive with --credential-id.',
|
|
57
|
+
}),
|
|
58
|
+
// 'test-level': Flags.string({
|
|
59
|
+
// description:
|
|
60
|
+
// 'Salesforce test level for validate/deploy (NoTestRun, RunSpecifiedTests, RunLocalTests). Defaults from --apex-unit-tests when omitted.',
|
|
61
|
+
// }),
|
|
62
|
+
// 'validate-only': Flags.boolean({
|
|
63
|
+
// default: false,
|
|
64
|
+
// description: 'When true, write-style actions validate without deploying',
|
|
65
|
+
// }),
|
|
66
|
+
};
|
|
67
|
+
async run() {
|
|
68
|
+
const { flags } = await this.parse(MetadataExplore);
|
|
69
|
+
const body = await buildAiMetadataToolRequest(flags);
|
|
70
|
+
const output = await this.withSpinner('Running AI metadata tool', () => callAiMetadataTool(body));
|
|
71
|
+
const result = {
|
|
72
|
+
output,
|
|
73
|
+
...(body.credentialId === undefined ? {} : { credentialId: body.credentialId }),
|
|
74
|
+
};
|
|
75
|
+
this.display(() => {
|
|
76
|
+
process.stdout.write(output.endsWith('\n') ? output : `${output}\n`);
|
|
77
|
+
});
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=explore.js.map
|
|
@@ -46,7 +46,7 @@ export function buildMetadataIndexRequest(flags) {
|
|
|
46
46
|
return body;
|
|
47
47
|
}
|
|
48
48
|
export default class MetadataSearch extends AgentiaCommand {
|
|
49
|
-
static description = 'Search the metadata index for an org
|
|
49
|
+
static description = 'Search the metadata index for an org';
|
|
50
50
|
static examples = [
|
|
51
51
|
'<%= config.bin %> <%= command.id %> --pipeline-id <id> --source-org-id <id> --source-credential-id <id>',
|
|
52
52
|
'<%= config.bin %> <%= command.id %> --source Changed --metadata-types ApexClass --limit 100 --pipeline-id <id> --source-org-id <id> --source-credential-id <id>',
|
|
@@ -55,7 +55,7 @@ export default class MetadataSearch extends AgentiaCommand {
|
|
|
55
55
|
static flags = {
|
|
56
56
|
'avoid-source-tracking': Flags.boolean({
|
|
57
57
|
default: false,
|
|
58
|
-
description: 'Pass avoidSourceTracking=true to the
|
|
58
|
+
description: 'Pass avoidSourceTracking=true to the index route',
|
|
59
59
|
}),
|
|
60
60
|
'change-date-from': Flags.string({
|
|
61
61
|
description: 'Optional change-date-from filter (ISO datetime)',
|
|
@@ -92,7 +92,7 @@ export default class MetadataSearch extends AgentiaCommand {
|
|
|
92
92
|
}),
|
|
93
93
|
'platform-experience': Flags.string({
|
|
94
94
|
default: 'salesforce',
|
|
95
|
-
description: '
|
|
95
|
+
description: 'Platform experience header',
|
|
96
96
|
options: [...PLATFORM_EXPERIENCES],
|
|
97
97
|
}),
|
|
98
98
|
source: Flags.string({
|
|
@@ -5,7 +5,7 @@ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
|
|
|
5
5
|
import { MODULE_TYPES } from '../../../../lib/metadata-common.js';
|
|
6
6
|
import { buildRefreshDeletedRequest, formatRefreshDeletedResult, resolveRefreshSourceFromEnv, } from '../../../../lib/metadata-refresh.js';
|
|
7
7
|
export default class MetadataRefreshDeleted extends AgentiaCommand {
|
|
8
|
-
static description = 'Refresh the deleted metadata index
|
|
8
|
+
static description = 'Refresh the deleted metadata index';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> <%= command.id %> --env <environment-id>',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> --env <environment-id> --module-type vlocity --json',
|
|
@@ -5,7 +5,7 @@ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
|
|
|
5
5
|
import { MODULE_TYPES, PLATFORM_EXPERIENCES, splitCsv, } from '../../../../lib/metadata-common.js';
|
|
6
6
|
import { buildRefreshIndexRequest, formatIndexRefreshResult, resolveRefreshSourceFromEnv, } from '../../../../lib/metadata-refresh.js';
|
|
7
7
|
export default class MetadataRefreshRun extends AgentiaCommand {
|
|
8
|
-
static description = 'Trigger a metadata index refresh
|
|
8
|
+
static description = 'Trigger a metadata index refresh';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> <%= command.id %> --env <environment-id>',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> --env <environment-id> --all --json',
|
|
@@ -30,7 +30,7 @@ export default class MetadataRefreshRun extends AgentiaCommand {
|
|
|
30
30
|
}),
|
|
31
31
|
'platform-experience': Flags.string({
|
|
32
32
|
default: 'salesforce',
|
|
33
|
-
description: '
|
|
33
|
+
description: 'Platform experience header',
|
|
34
34
|
options: [...PLATFORM_EXPERIENCES],
|
|
35
35
|
}),
|
|
36
36
|
'refresh-mode': Flags.string({
|
|
@@ -5,7 +5,7 @@ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
|
|
|
5
5
|
import { MODULE_TYPES, PLATFORM_EXPERIENCES } from '../../../../lib/metadata-common.js';
|
|
6
6
|
import { formatIndexRefreshResult, refreshStatusEndpoint } from '../../../../lib/metadata-refresh.js';
|
|
7
7
|
export default class MetadataRefreshStatus extends AgentiaCommand {
|
|
8
|
-
static description = 'Get metadata index refresh status
|
|
8
|
+
static description = 'Get metadata index refresh status';
|
|
9
9
|
static examples = [
|
|
10
10
|
'<%= config.bin %> <%= command.id %> --job-id <event-id>',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> --job-id <event-id> --json',
|
|
@@ -20,7 +20,7 @@ export default class MetadataRefreshStatus extends AgentiaCommand {
|
|
|
20
20
|
}),
|
|
21
21
|
'platform-experience': Flags.string({
|
|
22
22
|
default: 'salesforce',
|
|
23
|
-
description: '
|
|
23
|
+
description: 'Platform experience header used by the trigger request',
|
|
24
24
|
options: [...PLATFORM_EXPERIENCES],
|
|
25
25
|
}),
|
|
26
26
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { activatePipelineAutomationRule } from '../../../../lib/pipeline-automation-ops.js';
|
|
5
|
+
import { assertSalesforceLifecycleId } from '../../../../lib/pipeline-lifecycle-id.js';
|
|
6
|
+
export default class PipelineAutomationActivate extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Automation rule Salesforce ID (not name)',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Activate a Copado pipeline automation rule';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(PipelineAutomationActivate);
|
|
26
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
27
|
+
let ruleId;
|
|
28
|
+
try {
|
|
29
|
+
ruleId = assertSalesforceLifecycleId(args.id, 'Automation rule ID');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
33
|
+
}
|
|
34
|
+
await this.withSpinner('Activating pipeline automation rule', () => activatePipelineAutomationRule(pipelineId, ruleId));
|
|
35
|
+
this.display(() => this.log(`Activated automation rule (ID: ${ruleId}).`));
|
|
36
|
+
return { id: ruleId, pipelineId };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=activate.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
2
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
3
|
+
import { buildPipelineAutomationCreatePayload, pipelineAutomationMutationFlags, } from '../../../../lib/pipeline-automation-flags.js';
|
|
4
|
+
import { createPipelineAutomationRule } from '../../../../lib/pipeline-automation-ops.js';
|
|
5
|
+
import { formatPipelineAutomationRuleDetail, } from '../../../../lib/pipeline-automation-types.js';
|
|
6
|
+
export default class PipelineAutomationCreate extends AgentiaCommand {
|
|
7
|
+
static description = 'Create an inactive Copado pipeline automation rule';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --name "Promote after successful deploy" --scope promotion --execution-time Immediate --promotion-trigger automated --environment-id <env-id>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --name "Nightly back promote" --scope backPromotion --execution-time Scheduled --cron-expression "0 2 * * *" --stage-id <stage-id> --json',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --name "Promote matching stories" --scope promotion --execution-time Immediate --promotion-trigger manual --environment-id <env-id> --filter-criteria \'{"mode":"builder","logic":"AND","conditions":[{"field":"Name","operator":"contains","value":"US-"}]}\'',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --name "Custom after commit" --scope advanced --execution-time Immediate --source-action Commit --source-action-status Successful --custom-automation-connector <connector-id> --environment-id <env-id>',
|
|
13
|
+
];
|
|
14
|
+
static flags = pipelineAutomationMutationFlags;
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(PipelineAutomationCreate);
|
|
17
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
18
|
+
let payload;
|
|
19
|
+
try {
|
|
20
|
+
payload = await buildPipelineAutomationCreatePayload(flags);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
24
|
+
}
|
|
25
|
+
const created = await this.withSpinner('Creating pipeline automation rule', () => createPipelineAutomationRule(pipelineId, payload));
|
|
26
|
+
this.display(() => {
|
|
27
|
+
this.log(`Created inactive automation rule (ID: ${created.id ?? 'unknown'}).`);
|
|
28
|
+
this.log(formatPipelineAutomationRuleDetail(created));
|
|
29
|
+
});
|
|
30
|
+
return created;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { deactivatePipelineAutomationRule } from '../../../../lib/pipeline-automation-ops.js';
|
|
5
|
+
import { assertSalesforceLifecycleId } from '../../../../lib/pipeline-lifecycle-id.js';
|
|
6
|
+
export default class PipelineAutomationDeactivate extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Automation rule Salesforce ID (not name)',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Deactivate a Copado pipeline automation rule';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(PipelineAutomationDeactivate);
|
|
26
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
27
|
+
let ruleId;
|
|
28
|
+
try {
|
|
29
|
+
ruleId = assertSalesforceLifecycleId(args.id, 'Automation rule ID');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
33
|
+
}
|
|
34
|
+
await this.withSpinner('Deactivating pipeline automation rule', () => deactivatePipelineAutomationRule(pipelineId, ruleId));
|
|
35
|
+
this.display(() => this.log(`Deactivated automation rule (ID: ${ruleId}).`));
|
|
36
|
+
return { id: ruleId, pipelineId };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=deactivate.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
4
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
5
|
+
import { deletePipelineAutomationRule } from '../../../../lib/pipeline-automation-ops.js';
|
|
6
|
+
export default class PipelineAutomationDelete extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Automation rule ID or name',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Delete a Copado pipeline automation rule';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --yes',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --yes --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
yes: Flags.boolean({
|
|
24
|
+
char: 'y',
|
|
25
|
+
default: false,
|
|
26
|
+
description: 'Confirm deletion without prompting',
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
const { args, flags } = await this.parse(PipelineAutomationDelete);
|
|
31
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
32
|
+
if (!flags.yes) {
|
|
33
|
+
if (this.jsonEnabled() || !process.stdin.isTTY) {
|
|
34
|
+
this.error('Automation rule deletion requires confirmation. Pass --yes for headless or JSON execution.', { exit: 2 });
|
|
35
|
+
}
|
|
36
|
+
if (!(await confirm({ default: false, message: `Delete automation rule ${args.id}?` }))) {
|
|
37
|
+
this.error('Automation rule deletion canceled.', { exit: 1 });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
await this.withSpinner('Deleting pipeline automation rule', () => deletePipelineAutomationRule(pipelineId, args.id));
|
|
41
|
+
this.display(() => this.log(`Deleted automation rule (ID: ${args.id}).`));
|
|
42
|
+
return { id: args.id, pipelineId };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { fetchPipelineAutomationRule } from '../../../../lib/pipeline-automation-ops.js';
|
|
5
|
+
import { formatPipelineAutomationRuleDetail, } from '../../../../lib/pipeline-automation-types.js';
|
|
6
|
+
export default class PipelineAutomationGet extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Automation rule ID or name',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Get a Copado pipeline automation rule';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(PipelineAutomationGet);
|
|
26
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
27
|
+
const rule = await this.withSpinner('Fetching pipeline automation rule', () => fetchPipelineAutomationRule(pipelineId, args.id));
|
|
28
|
+
this.display(() => this.log(formatPipelineAutomationRuleDetail(rule)));
|
|
29
|
+
return rule;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
2
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
3
|
+
import { displayListPagination } from '../../../../lib/list-pagination.js';
|
|
4
|
+
import { pipelineAutomationListFlags } from '../../../../lib/pipeline-automation-flags.js';
|
|
5
|
+
import { fetchPipelineAutomationRules } from '../../../../lib/pipeline-automation-ops.js';
|
|
6
|
+
import { formatPipelineAutomationRuleTable, } from '../../../../lib/pipeline-automation-types.js';
|
|
7
|
+
export default class PipelineAutomationList extends AgentiaCommand {
|
|
8
|
+
static description = 'List Copado pipeline automation rules';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --active --json',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --include-system-generated',
|
|
13
|
+
];
|
|
14
|
+
static flags = pipelineAutomationListFlags;
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(PipelineAutomationList);
|
|
17
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
18
|
+
const page = await this.withSpinner('Fetching pipeline automation rules', () => fetchPipelineAutomationRules(pipelineId, {
|
|
19
|
+
active: flags.active,
|
|
20
|
+
cursor: flags.cursor,
|
|
21
|
+
executionTime: flags['execution-time'],
|
|
22
|
+
includeSystemGenerated: flags['include-system-generated'] ? true : undefined,
|
|
23
|
+
name: flags.name,
|
|
24
|
+
pageSize: flags['page-size'],
|
|
25
|
+
sourceAction: flags['source-action'],
|
|
26
|
+
}));
|
|
27
|
+
this.display(() => {
|
|
28
|
+
if (page.data.length === 0) {
|
|
29
|
+
this.log('No pipeline automation rules found.');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.log(formatPipelineAutomationRuleTable(page.data));
|
|
33
|
+
displayListPagination(this.log.bind(this), page);
|
|
34
|
+
});
|
|
35
|
+
return page;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
import { assertSalesforceLifecycleId } from '../../../../lib/pipeline-lifecycle-id.js';
|
|
6
|
+
export default class PipelineAutomationOpen extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Automation rule Salesforce ID',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Open a Copado pipeline automation rule in the browser';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --json',
|
|
17
|
+
];
|
|
18
|
+
async run() {
|
|
19
|
+
const { args } = await this.parse(PipelineAutomationOpen);
|
|
20
|
+
let ruleId;
|
|
21
|
+
try {
|
|
22
|
+
ruleId = assertSalesforceLifecycleId(args.id, 'Automation rule ID');
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
26
|
+
}
|
|
27
|
+
const target = await this.withSpinner('Resolving navigation URL', () => resolveNavigationTarget({
|
|
28
|
+
id: ruleId,
|
|
29
|
+
resourceType: 'automation_rule',
|
|
30
|
+
}));
|
|
31
|
+
await openNavigationTarget(target, {
|
|
32
|
+
jsonEnabled: this.jsonEnabled(),
|
|
33
|
+
log: this.log.bind(this),
|
|
34
|
+
});
|
|
35
|
+
return target;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=open.js.map
|
|
@@ -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 { buildPipelineAutomationUpdatePayload, pipelineAutomationMutationFlags, } from '../../../../lib/pipeline-automation-flags.js';
|
|
5
|
+
import { updatePipelineAutomationRule } from '../../../../lib/pipeline-automation-ops.js';
|
|
6
|
+
import { formatPipelineAutomationRuleDetail, } from '../../../../lib/pipeline-automation-types.js';
|
|
7
|
+
export default class PipelineAutomationUpdate extends AgentiaCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
id: Args.string({
|
|
10
|
+
description: 'Automation rule ID or name',
|
|
11
|
+
required: true,
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
static description = 'Update a Copado pipeline automation rule';
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --name "Renamed rule"',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --execution-time Scheduled --cron-expression "0 2 * * *" --json',
|
|
18
|
+
];
|
|
19
|
+
static flags = pipelineAutomationMutationFlags;
|
|
20
|
+
async run() {
|
|
21
|
+
const { args, flags } = await this.parse(PipelineAutomationUpdate);
|
|
22
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
23
|
+
let payload;
|
|
24
|
+
try {
|
|
25
|
+
payload = await buildPipelineAutomationUpdatePayload(flags);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
29
|
+
}
|
|
30
|
+
const updated = await this.withSpinner('Updating pipeline automation rule', () => updatePipelineAutomationRule(pipelineId, args.id, payload));
|
|
31
|
+
this.display(() => {
|
|
32
|
+
this.log(`Updated automation rule (ID: ${updated.id ?? args.id}).`);
|
|
33
|
+
this.log(formatPipelineAutomationRuleDetail(updated));
|
|
34
|
+
});
|
|
35
|
+
return updated;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { assertSalesforceLifecycleId } from '../../../../lib/pipeline-lifecycle-id.js';
|
|
5
|
+
import { activatePipelineQualityGate } from '../../../../lib/pipeline-quality-gate-ops.js';
|
|
6
|
+
export default class PipelineQualityGateActivate extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Quality gate Salesforce ID (not name)',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Activate a Copado pipeline quality gate';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(PipelineQualityGateActivate);
|
|
26
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
27
|
+
let ruleId;
|
|
28
|
+
try {
|
|
29
|
+
ruleId = assertSalesforceLifecycleId(args.id, 'Quality gate ID');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
33
|
+
}
|
|
34
|
+
await this.withSpinner('Activating pipeline quality gate', () => activatePipelineQualityGate(pipelineId, ruleId));
|
|
35
|
+
this.display(() => this.log(`Activated quality gate (ID: ${ruleId}).`));
|
|
36
|
+
return { id: ruleId, pipelineId };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=activate.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
2
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
3
|
+
import { buildPipelineQualityGateCreatePayload, pipelineQualityGateCreateFlags, } from '../../../../lib/pipeline-quality-gate-flags.js';
|
|
4
|
+
import { createPipelineQualityGates } from '../../../../lib/pipeline-quality-gate-ops.js';
|
|
5
|
+
import { formatPipelineQualityGateTable } from '../../../../lib/pipeline-quality-gate-types.js';
|
|
6
|
+
export default class PipelineQualityGateCreate extends AgentiaCommand {
|
|
7
|
+
static description = 'Create inactive Copado pipeline quality gates';
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --tool Selenium --execution-sequence After --action Deployment --extension-configuration-id <ext-conf-id> --environment-id <env-id> --tests-from "User Story"',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --tool PMD --execution-sequence Before --action Commit --extension-configuration-id <ext-conf-id> --entire-pipeline --json',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --tool PMD --execution-sequence Before --action Commit --extension-configuration-id <ext-conf-id> --stage-id <stage-id> --filter-criteria \'{"conditions":[{"field":"Type","operator":"equals","value":"ApexClass"},{"field":"Name","operator":"startsWith","value":"Account"}],"logic":"1 AND 2"}\'',
|
|
12
|
+
];
|
|
13
|
+
static flags = pipelineQualityGateCreateFlags;
|
|
14
|
+
async run() {
|
|
15
|
+
const { flags } = await this.parse(PipelineQualityGateCreate);
|
|
16
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
17
|
+
let payload;
|
|
18
|
+
try {
|
|
19
|
+
payload = await buildPipelineQualityGateCreatePayload(flags);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
23
|
+
}
|
|
24
|
+
const created = await this.withSpinner('Creating pipeline quality gates', () => createPipelineQualityGates(pipelineId, payload));
|
|
25
|
+
this.display(() => {
|
|
26
|
+
this.log(`Created ${created.length} inactive quality gate${created.length === 1 ? '' : 's'}.`);
|
|
27
|
+
if (created.length > 0) {
|
|
28
|
+
this.log(formatPipelineQualityGateTable(created));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return created;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
3
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
4
|
+
import { assertSalesforceLifecycleId } from '../../../../lib/pipeline-lifecycle-id.js';
|
|
5
|
+
import { deactivatePipelineQualityGate } from '../../../../lib/pipeline-quality-gate-ops.js';
|
|
6
|
+
export default class PipelineQualityGateDeactivate extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Quality gate Salesforce ID (not name)',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Deactivate a Copado pipeline quality gate';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(PipelineQualityGateDeactivate);
|
|
26
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
27
|
+
let ruleId;
|
|
28
|
+
try {
|
|
29
|
+
ruleId = assertSalesforceLifecycleId(args.id, 'Quality gate ID');
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
|
|
33
|
+
}
|
|
34
|
+
await this.withSpinner('Deactivating pipeline quality gate', () => deactivatePipelineQualityGate(pipelineId, ruleId));
|
|
35
|
+
this.display(() => this.log(`Deactivated quality gate (ID: ${ruleId}).`));
|
|
36
|
+
return { id: ruleId, pipelineId };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=deactivate.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { AgentiaCommand } from '../../../../lib/agentia-command.js';
|
|
4
|
+
import { assertRequired } from '../../../../lib/assert.js';
|
|
5
|
+
import { deletePipelineQualityGate } from '../../../../lib/pipeline-quality-gate-ops.js';
|
|
6
|
+
export default class PipelineQualityGateDelete extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.string({
|
|
9
|
+
description: 'Quality gate ID or name',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Delete an inactive Copado pipeline quality gate';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --yes',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <rule-id> --pipeline-id <pipeline-id> --yes --json',
|
|
17
|
+
];
|
|
18
|
+
static flags = {
|
|
19
|
+
'pipeline-id': Flags.string({
|
|
20
|
+
description: 'Pipeline ID or name',
|
|
21
|
+
required: true,
|
|
22
|
+
}),
|
|
23
|
+
yes: Flags.boolean({
|
|
24
|
+
char: 'y',
|
|
25
|
+
default: false,
|
|
26
|
+
description: 'Confirm deletion without prompting',
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
const { args, flags } = await this.parse(PipelineQualityGateDelete);
|
|
31
|
+
const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
|
|
32
|
+
if (!flags.yes) {
|
|
33
|
+
if (this.jsonEnabled() || !process.stdin.isTTY) {
|
|
34
|
+
this.error('Quality gate deletion requires confirmation. Pass --yes for headless or JSON execution.', { exit: 2 });
|
|
35
|
+
}
|
|
36
|
+
if (!(await confirm({ default: false, message: `Delete quality gate ${args.id}?` }))) {
|
|
37
|
+
this.error('Quality gate deletion canceled.', { exit: 1 });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
await this.withSpinner('Deleting pipeline quality gate', () => deletePipelineQualityGate(pipelineId, args.id));
|
|
41
|
+
this.display(() => this.log(`Deleted quality gate (ID: ${args.id}).`));
|
|
42
|
+
return { id: args.id, pipelineId };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=delete.js.map
|