@copado/agentia-cli 1.0.0-beta.5 → 1.0.0-beta.7
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 +20 -0
- package/README.md +906 -245
- package/dist/commands/adv/auth/status.js +20 -0
- package/dist/commands/adv/component/add.js +48 -0
- package/dist/commands/adv/component/list.js +46 -0
- package/dist/commands/adv/component/refresh.js +23 -0
- package/dist/commands/adv/component/remove.js +35 -0
- package/dist/commands/adv/component/selected.js +26 -0
- package/dist/commands/adv/component/types.js +16 -0
- package/dist/commands/adv/deployment/cancel.js +45 -0
- package/dist/commands/adv/deployment/create.js +23 -0
- package/dist/commands/adv/deployment/deploy.js +49 -0
- package/dist/commands/adv/deployment/get.js +21 -0
- package/dist/commands/adv/deployment/list.js +30 -0
- package/dist/commands/adv/deployment/options.js +33 -0
- package/dist/commands/adv/deployment/quick-deploy.js +57 -0
- package/dist/commands/adv/deployment/validate.js +32 -0
- package/dist/commands/adv/job/get.js +21 -0
- package/dist/commands/adv/job/list.js +30 -0
- package/dist/commands/adv/job/wait.js +33 -0
- package/dist/commands/adv/organization/get.js +21 -0
- package/dist/commands/adv/organization/list.js +21 -0
- package/dist/commands/adv/organization/validate.js +20 -0
- package/dist/commands/auth/get.js +24 -3
- package/dist/commands/auth/set.js +18 -0
- package/dist/commands/auth/unset.js +4 -0
- package/dist/commands/cicd/environment/get.js +3 -6
- package/dist/commands/cicd/environment/list.js +2 -7
- package/dist/commands/cicd/job/get.js +3 -7
- package/dist/commands/cicd/job/list.js +3 -7
- package/dist/commands/cicd/notification/get.js +44 -0
- package/dist/commands/cicd/pipeline/get.js +3 -7
- package/dist/commands/cicd/pipeline/list.js +3 -7
- package/dist/commands/cicd/project/get.js +3 -7
- package/dist/commands/cicd/project/list.js +3 -7
- package/dist/commands/cicd/promotion/get.js +3 -7
- package/dist/commands/cicd/promotion/list.js +3 -7
- package/dist/commands/cicd/stage/list.js +5 -6
- package/dist/commands/cicd/user/get.js +3 -7
- package/dist/commands/cicd/work/get.js +2 -2
- package/dist/commands/cicd/work/list.js +3 -7
- package/dist/commands/cicd/work/promote.js +1 -0
- package/dist/commands/cicd/work/publish.js +1 -0
- package/dist/commands/setup/skills/create.js +4 -0
- package/dist/commands/setup/skills/update.js +4 -0
- package/dist/hooks/init/migrate-user-config.js +5 -1
- package/dist/hooks/init/version-warning.js +5 -2
- package/dist/lib/adv-config.js +9 -0
- package/dist/lib/adv-flags.js +8 -0
- package/dist/lib/adv-gateway.js +8 -0
- package/dist/lib/adv-operations.js +29 -0
- package/dist/lib/adv-sanitization.js +8 -0
- package/dist/lib/adv-types.js +9 -0
- package/dist/lib/agentia-command.js +68 -3
- package/dist/lib/ai-config.js +3 -1
- package/dist/lib/auth-config.js +2 -1
- package/dist/lib/auth-profile.js +2 -1
- package/dist/lib/auth-status-format.js +2 -1
- package/dist/lib/cicd-gateway.js +2 -1
- package/dist/lib/cli-severity-color.js +4 -0
- package/dist/lib/environment-get.js +4 -0
- package/dist/lib/job-get.js +4 -0
- package/dist/lib/mcp/adv-tools.js +227 -0
- package/dist/lib/mcp/command-id.js +4 -1
- package/dist/lib/mcp/tool-annotations.js +23 -0
- package/dist/lib/mcp/tools.js +67 -67
- package/dist/lib/mcp/work-tools.js +10 -9
- package/dist/lib/notifications-get.js +10 -0
- package/dist/lib/pipeline-get.js +4 -0
- package/dist/lib/plugin-host/ai.js +5 -0
- package/dist/lib/plugin-host/environment.js +4 -0
- package/dist/lib/plugin-host/event-log.js +2 -1
- package/dist/lib/plugin-host/input.js +7 -0
- package/dist/lib/plugin-host/job.js +4 -0
- package/dist/lib/plugin-host/pipeline.js +4 -0
- package/dist/lib/plugin-host/project.js +5 -0
- package/dist/lib/plugin-host/projection-utils.js +6 -1
- package/dist/lib/plugin-host/promotion.js +4 -0
- package/dist/lib/plugin-host/stage.js +4 -0
- package/dist/lib/plugin-host/user.js +4 -0
- package/dist/lib/plugin-host/workspace.js +3 -0
- package/dist/lib/project-get.js +4 -0
- package/dist/lib/promotion-get.js +4 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/stage-list.js +3 -0
- package/dist/lib/testing-gateway.js +2 -1
- package/dist/lib/user-get.js +3 -0
- package/dist/lib/work-get.js +3 -2
- package/oclif.manifest.json +1578 -144
- package/package.json +35 -2
- package/templates/AGENTS.md +1 -1
- package/templates/skills/agentia-adv/SKILL.md +22 -0
- package/templates/skills/agentia-adv/references/pipelines-advanced.md +50 -0
- package/templates/skills/agentia-cicd/SKILL.md +3 -1
- package/templates/skills/agentia-cicd/references/notifications.md +79 -0
- package/templates/skills/agentia-cicd/references/work.md +19 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getAdvAuthStatus } from '../../../lib/adv-operations.js';
|
|
2
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
3
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
4
|
+
export default class AdvAuthStatus extends AgentiaCommand {
|
|
5
|
+
static description = 'Check the configured Pipelines Advanced PAT';
|
|
6
|
+
static examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %>',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
9
|
+
];
|
|
10
|
+
async run() {
|
|
11
|
+
const result = await this.withSpinner('Checking Pipelines Advanced authentication', () => getAdvAuthStatus());
|
|
12
|
+
this.display(() => {
|
|
13
|
+
this.log(formatAdvRecord(result));
|
|
14
|
+
for (const warning of result.warnings)
|
|
15
|
+
this.warn(warning);
|
|
16
|
+
});
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { addAdvComponents, parseAdvComponentSpec, readAdvComponentsFromJsonFile, readAdvComponentsFromTextFile, } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvComponents } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvComponentAdd extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Add components to a Pipelines Advanced deployment selection';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025 --component ApexClass/Foo --component ApexClass/Bar',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --file components.txt',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> 1025 --json-file components.json',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
component: Flags.string({
|
|
17
|
+
description: 'Component to add as Type/Name; repeat for multiple components.',
|
|
18
|
+
exclusive: ['file', 'json-file'],
|
|
19
|
+
multiple: true,
|
|
20
|
+
}),
|
|
21
|
+
file: Flags.string({
|
|
22
|
+
description: 'Text file with one Type/Name component per line.',
|
|
23
|
+
exclusive: ['component', 'json-file'],
|
|
24
|
+
}),
|
|
25
|
+
'json-file': Flags.string({
|
|
26
|
+
description: 'JSON file containing a bare component array (not a --json envelope); accepts list rows, {type, fullName}, or {nodeType: {name}, fullName}.',
|
|
27
|
+
exclusive: ['component', 'file'],
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
const { args, flags } = await this.parse(AdvComponentAdd);
|
|
32
|
+
const components = flags.file === undefined
|
|
33
|
+
? flags['json-file'] === undefined
|
|
34
|
+
? (flags.component ?? []).map((component) => parseAdvComponentSpec(component))
|
|
35
|
+
: readAdvComponentsFromJsonFile(flags['json-file'])
|
|
36
|
+
: readAdvComponentsFromTextFile(flags.file);
|
|
37
|
+
const mode = flags['json-file'] === undefined ? 'import' : 'json';
|
|
38
|
+
const result = await this.withSpinner('Adding Pipelines Advanced components', () => addAdvComponents({ components, deploymentId: args['deployment-id'], mode }));
|
|
39
|
+
this.display(() => {
|
|
40
|
+
if (result.added.length === 0)
|
|
41
|
+
this.log('No new Pipelines Advanced components were added.');
|
|
42
|
+
else
|
|
43
|
+
this.log(formatAdvComponents(result.added));
|
|
44
|
+
});
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { listAdvComponents } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
4
|
+
import { cellValue, table } from '../../../lib/format.js';
|
|
5
|
+
export default class AdvComponentList extends AgentiaCommand {
|
|
6
|
+
static description = 'List source components for a Pipelines Advanced deployment';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --flow 1025 --type ApexClass',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --flow 1025 --type ApexClass,ApexTrigger --include-managed-package',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
flow: Flags.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
13
|
+
'include-managed-package': Flags.boolean({ default: false, description: 'Include managed package components.' }),
|
|
14
|
+
type: Flags.string({ description: 'Comma-separated component type names.', required: true }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(AdvComponentList);
|
|
18
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced components', () => listAdvComponents({
|
|
19
|
+
flow: flags.flow,
|
|
20
|
+
includeManagedPackage: flags['include-managed-package'],
|
|
21
|
+
type: flags.type,
|
|
22
|
+
}));
|
|
23
|
+
this.display(() => {
|
|
24
|
+
const components = result.components;
|
|
25
|
+
if (components.length === 0)
|
|
26
|
+
this.log('No Pipelines Advanced components found.');
|
|
27
|
+
else {
|
|
28
|
+
this.log(table([
|
|
29
|
+
{ alias: 'TYPE', value: 'type' },
|
|
30
|
+
{ alias: 'NAME', value: 'fullName' },
|
|
31
|
+
{ alias: 'DIFF', value: 'diffType' },
|
|
32
|
+
{ alias: 'MODIFIED', value: 'lastModifiedDate' },
|
|
33
|
+
], components.map((component) => ({
|
|
34
|
+
diffType: cellValue(component.diffType),
|
|
35
|
+
fullName: cellValue(component.fullName),
|
|
36
|
+
lastModifiedDate: cellValue(component.lastModifiedDate),
|
|
37
|
+
type: cellValue(component.type),
|
|
38
|
+
}))));
|
|
39
|
+
}
|
|
40
|
+
if (result.unresolved > 0)
|
|
41
|
+
this.warn(`${result.unresolved} components are still comparing or unknown.`);
|
|
42
|
+
});
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { refreshAdvComponents } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvComponentRefresh extends AgentiaCommand {
|
|
6
|
+
static description = 'Refresh Pipelines Advanced component comparison cache';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --flow 1025 --type ApexClass',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --flow 1025 --type ApexClass,Flow --full',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
flow: Flags.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
13
|
+
full: Flags.boolean({ default: false, description: 'Delete cached comparison data before refreshing.' }),
|
|
14
|
+
type: Flags.string({ description: 'Comma-separated component type names.', required: true }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(AdvComponentRefresh);
|
|
18
|
+
const result = await this.withSpinner('Refreshing Pipelines Advanced component cache', () => refreshAdvComponents({ flow: flags.flow, full: flags.full, type: flags.type }));
|
|
19
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { parseAdvComponentSpec, readAdvComponentsFromJsonFile, removeAdvComponents, } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvComponents } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvComponentRemove extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Remove components from a Pipelines Advanced deployment selection';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025 --component ApexClass/Foo',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --json-file components.json',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
component: Flags.string({
|
|
16
|
+
description: 'Component to remove as Type/Name; repeat for multiple components.',
|
|
17
|
+
exclusive: ['json-file'],
|
|
18
|
+
multiple: true,
|
|
19
|
+
}),
|
|
20
|
+
'json-file': Flags.string({
|
|
21
|
+
description: 'JSON file containing a bare component array (not a --json envelope); text-file input is not supported.',
|
|
22
|
+
exclusive: ['component'],
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
async run() {
|
|
26
|
+
const { args, flags } = await this.parse(AdvComponentRemove);
|
|
27
|
+
const components = flags['json-file'] === undefined
|
|
28
|
+
? (flags.component ?? []).map((component) => parseAdvComponentSpec(component))
|
|
29
|
+
: readAdvComponentsFromJsonFile(flags['json-file']);
|
|
30
|
+
const result = await this.withSpinner('Removing Pipelines Advanced components', () => removeAdvComponents({ components, deploymentId: args['deployment-id'] }));
|
|
31
|
+
this.display(() => this.log(formatAdvComponents(result.requested)));
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=remove.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { selectedAdvComponents } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvComponents } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvComponentSelected extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'List components currently selected for a Pipelines Advanced deployment';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --json',
|
|
13
|
+
];
|
|
14
|
+
async run() {
|
|
15
|
+
const { args } = await this.parse(AdvComponentSelected);
|
|
16
|
+
const result = await this.withSpinner('Fetching selected Pipelines Advanced components', () => selectedAdvComponents(args['deployment-id']));
|
|
17
|
+
this.display(() => {
|
|
18
|
+
if (result.components.length === 0)
|
|
19
|
+
this.log('No selected Pipelines Advanced components found.');
|
|
20
|
+
else
|
|
21
|
+
this.log(formatAdvComponents(result.components));
|
|
22
|
+
});
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=selected.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { listAdvComponentTypes } from '../../../lib/adv-operations.js';
|
|
2
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
3
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
4
|
+
export default class AdvComponentTypes extends AgentiaCommand {
|
|
5
|
+
static description = 'List Pipelines Advanced component type views; a component type can appear in multiple views';
|
|
6
|
+
static examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %>',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
9
|
+
];
|
|
10
|
+
async run() {
|
|
11
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced component types', () => listAdvComponentTypes());
|
|
12
|
+
this.display(() => this.log(formatAdvRecord({ views: result.views.length })));
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { advWaitFlags, advYesFlag, confirmAdvAction, requiresAdvExplicitYes } from '../../../lib/adv-flags.js';
|
|
3
|
+
import { cancelAdvDeployment } from '../../../lib/adv-operations.js';
|
|
4
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
|
+
import { isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
7
|
+
export default class AdvDeploymentCancel extends AgentiaCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
id: Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Request cancellation of the current Pipelines Advanced run';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> 1025 --yes --wait',
|
|
15
|
+
];
|
|
16
|
+
static flags = { ...advWaitFlags, ...advYesFlag };
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(AdvDeploymentCancel);
|
|
19
|
+
const jsonMode = this.jsonEnabled() || flags.json === true || this.argv.includes('--json');
|
|
20
|
+
if (requiresAdvExplicitYes(jsonMode) && !flags.yes) {
|
|
21
|
+
this.error('Refusing to cancel Pipelines Advanced run without confirmation. Re-run with --yes.', { exit: 2 });
|
|
22
|
+
}
|
|
23
|
+
if (!flags.yes) {
|
|
24
|
+
try {
|
|
25
|
+
const confirmed = await confirmAdvAction('cancel', args.id);
|
|
26
|
+
if (!confirmed)
|
|
27
|
+
this.error('Pipelines Advanced cancellation cancelled.', { exit: 1 });
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (isPromptCanceled(error))
|
|
31
|
+
this.error('Pipelines Advanced cancellation cancelled.', { exit: 1 });
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const result = await this.withSpinner('Cancelling Pipelines Advanced run', () => cancelAdvDeployment({
|
|
36
|
+
id: args.id,
|
|
37
|
+
wait: flags.wait,
|
|
38
|
+
waitIntervalSeconds: flags.interval,
|
|
39
|
+
waitTimeoutSeconds: flags.timeout,
|
|
40
|
+
}));
|
|
41
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { createAdvDeployment } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvDeploymentCreate extends AgentiaCommand {
|
|
6
|
+
static description = 'Create a Pipelines Advanced deployment between two organizations';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> --name release-1 --source-org 910001 --target-org 910002',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --name release-1 --source-org 910001 --target-org 910002 --json',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
name: Flags.string({ description: 'Deployment name.', required: true }),
|
|
13
|
+
'source-org': Flags.integer({ description: 'Source organization ID.', required: true }),
|
|
14
|
+
'target-org': Flags.integer({ description: 'Target organization ID.', required: true }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { flags } = await this.parse(AdvDeploymentCreate);
|
|
18
|
+
const result = await this.withSpinner('Creating Pipelines Advanced deployment', () => createAdvDeployment({ name: flags.name, sourceOrg: flags['source-org'], targetOrg: flags['target-org'] }));
|
|
19
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { advWaitFlags, advYesFlag, confirmAdvAction, requiresAdvExplicitYes } from '../../../lib/adv-flags.js';
|
|
3
|
+
import { advRunErrorJson, runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
4
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
|
+
import { isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
7
|
+
export default class AdvDeploymentDeploy extends AgentiaCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
id: Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Start a Pipelines Advanced deploy run';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> 1025 --yes --wait --json',
|
|
15
|
+
];
|
|
16
|
+
static flags = { ...advWaitFlags, ...advYesFlag };
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(AdvDeploymentDeploy);
|
|
19
|
+
const jsonMode = this.jsonEnabled() || flags.json === true || this.argv.includes('--json');
|
|
20
|
+
if (requiresAdvExplicitYes(jsonMode) && !flags.yes) {
|
|
21
|
+
this.error('Refusing to start Pipelines Advanced deploy without confirmation. Re-run with --yes.', { exit: 2 });
|
|
22
|
+
}
|
|
23
|
+
if (!flags.yes) {
|
|
24
|
+
try {
|
|
25
|
+
const confirmed = await confirmAdvAction('deploy', args.id);
|
|
26
|
+
if (!confirmed)
|
|
27
|
+
this.error('Pipelines Advanced deploy cancelled.', { exit: 1 });
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (isPromptCanceled(error))
|
|
31
|
+
this.error('Pipelines Advanced deploy cancelled.', { exit: 1 });
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const result = await this.withSpinner('Starting Pipelines Advanced deploy', () => runAdvDeploymentAction({
|
|
36
|
+
id: args.id,
|
|
37
|
+
kind: 'deploy',
|
|
38
|
+
wait: flags.wait,
|
|
39
|
+
waitIntervalSeconds: flags.interval,
|
|
40
|
+
waitTimeoutSeconds: flags.timeout,
|
|
41
|
+
}));
|
|
42
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
toErrorJson(error) {
|
|
46
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { getAdvDeployment } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvDeploymentGet extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Show one Pipelines Advanced deployment';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --json',
|
|
13
|
+
];
|
|
14
|
+
async run() {
|
|
15
|
+
const { args } = await this.parse(AdvDeploymentGet);
|
|
16
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced deployment', () => getAdvDeployment(args.id));
|
|
17
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { listAdvDeployments } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvDeployments } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvDeploymentList extends AgentiaCommand {
|
|
6
|
+
static description = 'List up to 500 Pipelines Advanced deployments visible to the PAT user; the API does not support filters';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --include-archived',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
11
|
+
];
|
|
12
|
+
static flags = {
|
|
13
|
+
'include-archived': Flags.boolean({
|
|
14
|
+
default: false,
|
|
15
|
+
description: 'Include archived deployments.',
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { flags } = await this.parse(AdvDeploymentList);
|
|
20
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced deployments', () => listAdvDeployments({ includeArchived: flags['include-archived'] }));
|
|
21
|
+
this.display(() => {
|
|
22
|
+
if (result.deployments.length === 0)
|
|
23
|
+
this.log('No Pipelines Advanced deployments found.');
|
|
24
|
+
else
|
|
25
|
+
this.log(formatAdvDeployments(result.deployments));
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { updateAdvDeploymentOptions } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvDeploymentOptions extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Update Pipelines Advanced deployment options';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025 --set deployOptionsIgnoreWarnings=false',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --file options.json',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> 1025 --set deployOptionsTestLevel=RUN_LOCAL_TESTS --json',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
file: Flags.string({
|
|
17
|
+
description: 'JSON file with deployment options to merge over the current options.',
|
|
18
|
+
exclusive: ['set'],
|
|
19
|
+
}),
|
|
20
|
+
set: Flags.string({
|
|
21
|
+
description: 'Deployment option as name=value; true, false, null, and any finite JavaScript Number value (including hex and exponent notation) are converted.',
|
|
22
|
+
exclusive: ['file'],
|
|
23
|
+
multiple: true,
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
async run() {
|
|
27
|
+
const { args, flags } = await this.parse(AdvDeploymentOptions);
|
|
28
|
+
const result = await this.withSpinner('Updating Pipelines Advanced deployment options', () => updateAdvDeploymentOptions({ file: flags.file, id: args.id, set: flags.set }));
|
|
29
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { advWaitFlags, advYesFlag, confirmAdvAction, requiresAdvExplicitYes } from '../../../lib/adv-flags.js';
|
|
3
|
+
import { advRunErrorJson, runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
4
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
|
+
import { isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
7
|
+
export default class AdvDeploymentQuickDeploy extends AgentiaCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
id: Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Start a Pipelines Advanced quick deploy run';
|
|
12
|
+
static examples = [
|
|
13
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> 1025 --backup --yes --wait',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...advWaitFlags,
|
|
18
|
+
...advYesFlag,
|
|
19
|
+
backup: Flags.boolean({
|
|
20
|
+
default: false,
|
|
21
|
+
description: 'Run backupThenDeploy instead of a quick deploy; the returned action reflects backupThenDeploy.',
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
async run() {
|
|
25
|
+
const { args, flags } = await this.parse(AdvDeploymentQuickDeploy);
|
|
26
|
+
const jsonMode = this.jsonEnabled() || flags.json === true || this.argv.includes('--json');
|
|
27
|
+
if (requiresAdvExplicitYes(jsonMode) && !flags.yes) {
|
|
28
|
+
this.error('Refusing to start Pipelines Advanced quick deploy without confirmation. Re-run with --yes.', { exit: 2 });
|
|
29
|
+
}
|
|
30
|
+
if (!flags.yes) {
|
|
31
|
+
try {
|
|
32
|
+
const confirmed = await confirmAdvAction('quick deploy', args.id);
|
|
33
|
+
if (!confirmed)
|
|
34
|
+
this.error('Pipelines Advanced quick deploy cancelled.', { exit: 1 });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
if (isPromptCanceled(error))
|
|
38
|
+
this.error('Pipelines Advanced quick deploy cancelled.', { exit: 1 });
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const result = await this.withSpinner('Starting Pipelines Advanced quick deploy', () => runAdvDeploymentAction({
|
|
43
|
+
backup: flags.backup,
|
|
44
|
+
id: args.id,
|
|
45
|
+
kind: 'quick-deploy',
|
|
46
|
+
wait: flags.wait,
|
|
47
|
+
waitIntervalSeconds: flags.interval,
|
|
48
|
+
waitTimeoutSeconds: flags.timeout,
|
|
49
|
+
}));
|
|
50
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
toErrorJson(error) {
|
|
54
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=quick-deploy.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { advWaitFlags } from '../../../lib/adv-flags.js';
|
|
3
|
+
import { advRunErrorJson, runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
4
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
|
+
export default class AdvDeploymentValidate extends AgentiaCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
id: Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Start a check-only Pipelines Advanced validation run';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> 1025 --wait',
|
|
14
|
+
];
|
|
15
|
+
static flags = { ...advWaitFlags };
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(AdvDeploymentValidate);
|
|
18
|
+
const result = await this.withSpinner('Starting Pipelines Advanced validation', () => runAdvDeploymentAction({
|
|
19
|
+
id: args.id,
|
|
20
|
+
kind: 'validate',
|
|
21
|
+
wait: flags.wait,
|
|
22
|
+
waitIntervalSeconds: flags.interval,
|
|
23
|
+
waitTimeoutSeconds: flags.timeout,
|
|
24
|
+
}));
|
|
25
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
toErrorJson(error) {
|
|
29
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { getAdvJob } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvJobGet extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Show the latest Pipelines Advanced run for a deployment';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --json',
|
|
13
|
+
];
|
|
14
|
+
async run() {
|
|
15
|
+
const { args } = await this.parse(AdvJobGet);
|
|
16
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced job', () => getAdvJob(args['deployment-id']));
|
|
17
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { listAdvJobs } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvJobs } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvJobList extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'List deploy and quick-deploy history for a Pipelines Advanced deployment; validation runs are not included';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --page 1 --page-size 25',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
page: Flags.integer({ description: 'Page number starting at 0 (default: 0).' }),
|
|
16
|
+
'page-size': Flags.integer({ description: 'Rows per page (default: 50; server maximum: 100).' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(AdvJobList);
|
|
20
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced jobs', () => listAdvJobs({ deploymentId: args['deployment-id'], page: flags.page, pageSize: flags['page-size'] }));
|
|
21
|
+
this.display(() => {
|
|
22
|
+
if (result.jobs.length === 0)
|
|
23
|
+
this.log('No Pipelines Advanced job history found.');
|
|
24
|
+
else
|
|
25
|
+
this.log(formatAdvJobs(result.jobs));
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { advRunErrorJson, assertAdvJobSucceeded, waitForAdvJob } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvJobWait extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Wait for the latest Pipelines Advanced run to finish';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 1025',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 1025 --interval 5 --timeout 1800',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
interval: Flags.integer({ description: 'Seconds between job status polls (default: 3).' }),
|
|
16
|
+
timeout: Flags.integer({ description: 'Maximum seconds to wait (default: 3600).' }),
|
|
17
|
+
};
|
|
18
|
+
async run() {
|
|
19
|
+
const { args, flags } = await this.parse(AdvJobWait);
|
|
20
|
+
const result = await this.withSpinner('Waiting for Pipelines Advanced job', () => waitForAdvJob({
|
|
21
|
+
deploymentId: args['deployment-id'],
|
|
22
|
+
intervalSeconds: flags.interval,
|
|
23
|
+
timeoutSeconds: flags.timeout,
|
|
24
|
+
}));
|
|
25
|
+
assertAdvJobSucceeded(result);
|
|
26
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
toErrorJson(error) {
|
|
30
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=wait.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { getAdvOrganization } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
|
+
export default class AdvOrganizationGet extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: Args.integer({ description: 'Pipelines Advanced organization ID.', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Show one Pipelines Advanced organization';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> <%= command.id %> 910001',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> 910001 --json',
|
|
13
|
+
];
|
|
14
|
+
async run() {
|
|
15
|
+
const { args } = await this.parse(AdvOrganizationGet);
|
|
16
|
+
const result = await this.withSpinner('Fetching Pipelines Advanced organization', () => getAdvOrganization(args.id));
|
|
17
|
+
this.display(() => this.log(formatAdvRecord(result)));
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get.js.map
|