@copado/agentia-cli 0.86.0-alpha.0 → 0.87.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 +233 -178
- package/dist/commands/cicd/notification/configure.d.ts +14 -0
- package/dist/commands/cicd/notification/configure.js +62 -0
- package/dist/commands/cicd/notification/configure.js.map +1 -0
- package/dist/lib/notifications-configure.d.ts +34 -0
- package/dist/lib/notifications-configure.js +101 -0
- package/dist/lib/notifications-configure.js.map +1 -0
- package/oclif.manifest.json +209 -97
- package/package.json +4 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type ConfigureNotificationResult } from '../../../lib/notifications-configure.js';
|
|
3
|
+
export default class NotificationConfigure extends AgentiaCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'destination-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'destination-type': import("@oclif/core/interfaces").OptionFlag<"user" | "channel", import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
event: import("@oclif/core/interfaces").OptionFlag<"Promotion_Success" | "Promotion_Failed" | "Promotion_Conflict" | "Failed_Promotion_Creation" | "Deploy_Success" | "Deploy_Failed" | "Commit_Failed" | "Successful_Snapshot" | "Failed_Snapshot" | "ManualTask_Assigned" | "Test_Success" | "Test_Failed" | "Test_Cancelled" | "Test_Not Started" | "Quality_Gate_Success" | "Quality_Gate_Failed" | "Quality_Gate_Cancelled" | "Quality_Gate_Not Started" | "Create_Package_Success" | "Create_Package_Failure" | "Generate_Package_Version_Success" | "Generate_Package_Version_Failure" | "Import_Package_Success" | "Import_Package_Failure" | "Publish_Package_Success" | "Publish_Package_Failure", import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'pipeline-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
subscription: import("@oclif/core/interfaces").OptionFlag<"user" | "all", import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<ConfigureNotificationResult>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { configureNotification, formatConfigureNotificationSummary, NOTIFICATION_DESTINATION_TYPES, NOTIFICATION_EVENTS, NOTIFICATION_SUBSCRIPTIONS, NotificationConfigureInputError, withNotificationConfigureErrorTranslation, } from '../../../lib/notifications-configure.js';
|
|
4
|
+
export default class NotificationConfigure extends AgentiaCommand {
|
|
5
|
+
static description = 'Configure one Slack notification subscription for the current user on a pipeline';
|
|
6
|
+
static examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --event Promotion_Failed --destination-type user --destination-id U0123ABCD --subscription user',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> -p <pipeline-id> --event Commit_Failed --destination-type channel --destination-id C0123ABCD --subscription all',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --event "Test_Not Started" --destination-type user --destination-id @jane --subscription user --json',
|
|
10
|
+
];
|
|
11
|
+
static flags = {
|
|
12
|
+
'destination-id': Flags.string({
|
|
13
|
+
description: 'Slack user or channel id or name',
|
|
14
|
+
required: true,
|
|
15
|
+
}),
|
|
16
|
+
'destination-type': Flags.option({
|
|
17
|
+
description: 'Slack destination type',
|
|
18
|
+
options: [...NOTIFICATION_DESTINATION_TYPES],
|
|
19
|
+
required: true,
|
|
20
|
+
})(),
|
|
21
|
+
event: Flags.option({
|
|
22
|
+
description: 'Notification event',
|
|
23
|
+
options: [...NOTIFICATION_EVENTS],
|
|
24
|
+
required: true,
|
|
25
|
+
})(),
|
|
26
|
+
'pipeline-id': Flags.string({
|
|
27
|
+
char: 'p',
|
|
28
|
+
description: 'Copado pipeline Salesforce Id',
|
|
29
|
+
required: true,
|
|
30
|
+
}),
|
|
31
|
+
subscription: Flags.option({
|
|
32
|
+
description: 'Notification audience for this event',
|
|
33
|
+
options: [...NOTIFICATION_SUBSCRIPTIONS],
|
|
34
|
+
required: true,
|
|
35
|
+
})(),
|
|
36
|
+
};
|
|
37
|
+
async run() {
|
|
38
|
+
const { flags } = await this.parse(NotificationConfigure);
|
|
39
|
+
const result = await this.withSpinner('Configuring notification', async () => {
|
|
40
|
+
try {
|
|
41
|
+
return await withNotificationConfigureErrorTranslation(() => configureNotification({
|
|
42
|
+
destinationId: flags['destination-id'],
|
|
43
|
+
destinationType: flags['destination-type'],
|
|
44
|
+
event: flags.event,
|
|
45
|
+
pipelineId: flags['pipeline-id'],
|
|
46
|
+
subscription: flags.subscription,
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error instanceof NotificationConfigureInputError) {
|
|
51
|
+
this.error(error.message, { exit: error.exitCode });
|
|
52
|
+
}
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.display(() => {
|
|
57
|
+
this.log(formatConfigureNotificationSummary(result));
|
|
58
|
+
});
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=configure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../../src/commands/cicd/notification/configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EACL,qBAAqB,EAErB,kCAAkC,EAClC,8BAA8B,EAC9B,mBAAmB,EACnB,0BAA0B,EAC1B,+BAA+B,EAC/B,yCAAyC,GAC1C,MAAM,yCAAyC,CAA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,EAAE,KAAK,CAAC,gBAAgB,CAAC;oBACtC,eAAe,EAAE,KAAK,CAAC,kBAAkB,CAAC;oBAC1C,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC;oBAChC,YAAY,EAAE,KAAK,CAAC,YAAY;iBACjC,CAAC,CACH,CAAA;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,+BAA+B,EAAE,CAAC;oBACrD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAC,CAAC,CAAA;gBACnD,CAAC;gBAED,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,kCAAkC,CAAC,MAAM,CAAC,CAAC,CAAA;QACtD,CAAC,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CicdGateway } from './cicd-gateway.js';
|
|
2
|
+
export declare const NOTIFICATIONS_CONFIGURE_ENDPOINT = "/notifications/configure";
|
|
3
|
+
export declare const NOTIFICATION_EVENTS: readonly ["Promotion_Success", "Promotion_Failed", "Promotion_Conflict", "Failed_Promotion_Creation", "Deploy_Success", "Deploy_Failed", "Commit_Failed", "Successful_Snapshot", "Failed_Snapshot", "ManualTask_Assigned", "Test_Success", "Test_Failed", "Test_Cancelled", "Test_Not Started", "Quality_Gate_Success", "Quality_Gate_Failed", "Quality_Gate_Cancelled", "Quality_Gate_Not Started", "Create_Package_Success", "Create_Package_Failure", "Generate_Package_Version_Success", "Generate_Package_Version_Failure", "Import_Package_Success", "Import_Package_Failure", "Publish_Package_Success", "Publish_Package_Failure"];
|
|
4
|
+
export declare const NOTIFICATION_DESTINATION_TYPES: readonly ["user", "channel"];
|
|
5
|
+
export declare const NOTIFICATION_SUBSCRIPTIONS: readonly ["user", "all"];
|
|
6
|
+
export type NotificationEvent = (typeof NOTIFICATION_EVENTS)[number];
|
|
7
|
+
export type NotificationDestinationType = (typeof NOTIFICATION_DESTINATION_TYPES)[number];
|
|
8
|
+
export type NotificationSubscription = (typeof NOTIFICATION_SUBSCRIPTIONS)[number];
|
|
9
|
+
export type ConfigureNotificationRequest = {
|
|
10
|
+
destinationId: string;
|
|
11
|
+
destinationType: NotificationDestinationType;
|
|
12
|
+
event: NotificationEvent;
|
|
13
|
+
pipelineId: string;
|
|
14
|
+
providers: ['slack'];
|
|
15
|
+
subscription: NotificationSubscription;
|
|
16
|
+
};
|
|
17
|
+
export type ConfigureNotificationResult = ConfigureNotificationRequest;
|
|
18
|
+
export type ConfigureNotificationInput = {
|
|
19
|
+
destinationId: string;
|
|
20
|
+
destinationType: NotificationDestinationType;
|
|
21
|
+
event: NotificationEvent;
|
|
22
|
+
pipelineId: string;
|
|
23
|
+
subscription: NotificationSubscription;
|
|
24
|
+
};
|
|
25
|
+
export declare class NotificationConfigureInputError extends Error {
|
|
26
|
+
readonly exitCode = 2;
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
export declare function validatePipelineId(value: string): string;
|
|
30
|
+
export declare function buildConfigureNotificationPayload(input: ConfigureNotificationInput): ConfigureNotificationRequest;
|
|
31
|
+
export declare function formatConfigureNotificationSummary(result: ConfigureNotificationResult): string;
|
|
32
|
+
export declare function translateNotificationConfigureError(error: unknown): Error;
|
|
33
|
+
export declare function withNotificationConfigureErrorTranslation<T>(action: () => Promise<T>): Promise<T>;
|
|
34
|
+
export declare function configureNotification(input: ConfigureNotificationInput, gatewayCall?: typeof CicdGateway.call): Promise<ConfigureNotificationResult>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { CicdGateway, CicdGatewayError } from './cicd-gateway.js';
|
|
2
|
+
export const NOTIFICATIONS_CONFIGURE_ENDPOINT = '/notifications/configure';
|
|
3
|
+
export const NOTIFICATION_EVENTS = [
|
|
4
|
+
'Promotion_Success',
|
|
5
|
+
'Promotion_Failed',
|
|
6
|
+
'Promotion_Conflict',
|
|
7
|
+
'Failed_Promotion_Creation',
|
|
8
|
+
'Deploy_Success',
|
|
9
|
+
'Deploy_Failed',
|
|
10
|
+
'Commit_Failed',
|
|
11
|
+
'Successful_Snapshot',
|
|
12
|
+
'Failed_Snapshot',
|
|
13
|
+
'ManualTask_Assigned',
|
|
14
|
+
'Test_Success',
|
|
15
|
+
'Test_Failed',
|
|
16
|
+
'Test_Cancelled',
|
|
17
|
+
'Test_Not Started',
|
|
18
|
+
'Quality_Gate_Success',
|
|
19
|
+
'Quality_Gate_Failed',
|
|
20
|
+
'Quality_Gate_Cancelled',
|
|
21
|
+
'Quality_Gate_Not Started',
|
|
22
|
+
'Create_Package_Success',
|
|
23
|
+
'Create_Package_Failure',
|
|
24
|
+
'Generate_Package_Version_Success',
|
|
25
|
+
'Generate_Package_Version_Failure',
|
|
26
|
+
'Import_Package_Success',
|
|
27
|
+
'Import_Package_Failure',
|
|
28
|
+
'Publish_Package_Success',
|
|
29
|
+
'Publish_Package_Failure',
|
|
30
|
+
];
|
|
31
|
+
export const NOTIFICATION_DESTINATION_TYPES = ['user', 'channel'];
|
|
32
|
+
export const NOTIFICATION_SUBSCRIPTIONS = ['user', 'all'];
|
|
33
|
+
const PIPELINE_ID_PATTERN = /^[A-Za-z0-9_]+$/;
|
|
34
|
+
const NOTIFICATION_CONFIGURE_ERROR_MESSAGES = {
|
|
35
|
+
'NTF-003': 'Slack destination is invalid for the selected destination type. Check destinationId and destinationType.',
|
|
36
|
+
'NTF-004': 'Pipeline id is missing or invalid. Use a 15- or 18-character Copado pipeline Salesforce id.',
|
|
37
|
+
};
|
|
38
|
+
export class NotificationConfigureInputError extends Error {
|
|
39
|
+
exitCode = 2;
|
|
40
|
+
constructor(message) {
|
|
41
|
+
super(message);
|
|
42
|
+
this.name = 'NotificationConfigureInputError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function validatePipelineId(value) {
|
|
46
|
+
const trimmed = value.trim();
|
|
47
|
+
if (trimmed.length === 0) {
|
|
48
|
+
throw new NotificationConfigureInputError('--pipeline-id cannot be empty.');
|
|
49
|
+
}
|
|
50
|
+
if (trimmed.length !== 15 && trimmed.length !== 18) {
|
|
51
|
+
throw new NotificationConfigureInputError('--pipeline-id must be 15 or 18 characters. Use a valid Copado pipeline Salesforce id.');
|
|
52
|
+
}
|
|
53
|
+
if (!PIPELINE_ID_PATTERN.test(trimmed)) {
|
|
54
|
+
throw new NotificationConfigureInputError('--pipeline-id contains invalid characters. Only letters, digits, and underscores are allowed.');
|
|
55
|
+
}
|
|
56
|
+
return trimmed;
|
|
57
|
+
}
|
|
58
|
+
export function buildConfigureNotificationPayload(input) {
|
|
59
|
+
return {
|
|
60
|
+
destinationId: input.destinationId.trim(),
|
|
61
|
+
destinationType: input.destinationType,
|
|
62
|
+
event: input.event,
|
|
63
|
+
pipelineId: validatePipelineId(input.pipelineId),
|
|
64
|
+
providers: ['slack'],
|
|
65
|
+
subscription: input.subscription,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function formatConfigureNotificationSummary(result) {
|
|
69
|
+
return `Configured ${result.event} notification for pipeline ${result.pipelineId} (destination: ${result.destinationId}, type: ${result.destinationType}, subscription: ${result.subscription}).`;
|
|
70
|
+
}
|
|
71
|
+
export function translateNotificationConfigureError(error) {
|
|
72
|
+
if (error instanceof CicdGatewayError) {
|
|
73
|
+
const identifiers = [...error.categories, error.code];
|
|
74
|
+
const identifier = identifiers.find((value) => value !== undefined && value in NOTIFICATION_CONFIGURE_ERROR_MESSAGES);
|
|
75
|
+
if (identifier !== undefined) {
|
|
76
|
+
return new Error(NOTIFICATION_CONFIGURE_ERROR_MESSAGES[identifier]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
80
|
+
}
|
|
81
|
+
export async function withNotificationConfigureErrorTranslation(action) {
|
|
82
|
+
try {
|
|
83
|
+
return await action();
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
throw translateNotificationConfigureError(error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export async function configureNotification(input, gatewayCall = CicdGateway.call) {
|
|
90
|
+
const body = buildConfigureNotificationPayload(input);
|
|
91
|
+
if (body.destinationId.length === 0) {
|
|
92
|
+
throw new NotificationConfigureInputError('--destination-id cannot be empty.');
|
|
93
|
+
}
|
|
94
|
+
return gatewayCall({
|
|
95
|
+
body,
|
|
96
|
+
endpoint: NOTIFICATIONS_CONFIGURE_ENDPOINT,
|
|
97
|
+
headers: { 'Content-Type': 'application/json' },
|
|
98
|
+
method: 'POST',
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=notifications-configure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications-configure.js","sourceRoot":"","sources":["../../src/lib/notifications-configure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AAE/D,MAAM,CAAC,MAAM,gCAAgC,GAAG,0BAA0B,CAAA;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,2BAA2B;IAC3B,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,qBAAqB;IACrB,iBAAiB;IACjB,qBAAqB;IACrB,cAAc;IACd,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,wBAAwB;IACxB,0BAA0B;IAC1B,wBAAwB;IACxB,wBAAwB;IACxB,kCAAkC;IAClC,kCAAkC;IAClC,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,yBAAyB;CACjB,CAAA;AAEV,MAAM,CAAC,MAAM,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C,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,+BAA+B,CAAC,mCAAmC,CAAC,CAAA;IAChF,CAAC;IAED,OAAO,WAAW,CAA8B;QAC9C,IAAI;QACJ,QAAQ,EAAE,gCAAgC;QAC1C,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;QAC7C,MAAM,EAAE,MAAM;KACf,CAAC,CAAA;AACJ,CAAC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -3255,6 +3255,118 @@
|
|
|
3255
3255
|
"list.js"
|
|
3256
3256
|
]
|
|
3257
3257
|
},
|
|
3258
|
+
"cicd:notification:configure": {
|
|
3259
|
+
"aliases": [],
|
|
3260
|
+
"args": {},
|
|
3261
|
+
"description": "Configure one Slack notification subscription for the current user on a pipeline",
|
|
3262
|
+
"examples": [
|
|
3263
|
+
"<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --event Promotion_Failed --destination-type user --destination-id U0123ABCD --subscription user",
|
|
3264
|
+
"<%= config.bin %> <%= command.id %> -p <pipeline-id> --event Commit_Failed --destination-type channel --destination-id C0123ABCD --subscription all",
|
|
3265
|
+
"<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id> --event \"Test_Not Started\" --destination-type user --destination-id @jane --subscription user --json"
|
|
3266
|
+
],
|
|
3267
|
+
"flags": {
|
|
3268
|
+
"json": {
|
|
3269
|
+
"description": "Format output as json.",
|
|
3270
|
+
"helpGroup": "GLOBAL",
|
|
3271
|
+
"name": "json",
|
|
3272
|
+
"allowNo": false,
|
|
3273
|
+
"type": "boolean"
|
|
3274
|
+
},
|
|
3275
|
+
"destination-id": {
|
|
3276
|
+
"description": "Slack user or channel id or name",
|
|
3277
|
+
"name": "destination-id",
|
|
3278
|
+
"required": true,
|
|
3279
|
+
"hasDynamicHelp": false,
|
|
3280
|
+
"multiple": false,
|
|
3281
|
+
"type": "option"
|
|
3282
|
+
},
|
|
3283
|
+
"destination-type": {
|
|
3284
|
+
"description": "Slack destination type",
|
|
3285
|
+
"name": "destination-type",
|
|
3286
|
+
"required": true,
|
|
3287
|
+
"hasDynamicHelp": false,
|
|
3288
|
+
"multiple": false,
|
|
3289
|
+
"options": [
|
|
3290
|
+
"user",
|
|
3291
|
+
"channel"
|
|
3292
|
+
],
|
|
3293
|
+
"type": "option"
|
|
3294
|
+
},
|
|
3295
|
+
"event": {
|
|
3296
|
+
"description": "Notification event",
|
|
3297
|
+
"name": "event",
|
|
3298
|
+
"required": true,
|
|
3299
|
+
"hasDynamicHelp": false,
|
|
3300
|
+
"multiple": false,
|
|
3301
|
+
"options": [
|
|
3302
|
+
"Promotion_Success",
|
|
3303
|
+
"Promotion_Failed",
|
|
3304
|
+
"Promotion_Conflict",
|
|
3305
|
+
"Failed_Promotion_Creation",
|
|
3306
|
+
"Deploy_Success",
|
|
3307
|
+
"Deploy_Failed",
|
|
3308
|
+
"Commit_Failed",
|
|
3309
|
+
"Successful_Snapshot",
|
|
3310
|
+
"Failed_Snapshot",
|
|
3311
|
+
"ManualTask_Assigned",
|
|
3312
|
+
"Test_Success",
|
|
3313
|
+
"Test_Failed",
|
|
3314
|
+
"Test_Cancelled",
|
|
3315
|
+
"Test_Not Started",
|
|
3316
|
+
"Quality_Gate_Success",
|
|
3317
|
+
"Quality_Gate_Failed",
|
|
3318
|
+
"Quality_Gate_Cancelled",
|
|
3319
|
+
"Quality_Gate_Not Started",
|
|
3320
|
+
"Create_Package_Success",
|
|
3321
|
+
"Create_Package_Failure",
|
|
3322
|
+
"Generate_Package_Version_Success",
|
|
3323
|
+
"Generate_Package_Version_Failure",
|
|
3324
|
+
"Import_Package_Success",
|
|
3325
|
+
"Import_Package_Failure",
|
|
3326
|
+
"Publish_Package_Success",
|
|
3327
|
+
"Publish_Package_Failure"
|
|
3328
|
+
],
|
|
3329
|
+
"type": "option"
|
|
3330
|
+
},
|
|
3331
|
+
"pipeline-id": {
|
|
3332
|
+
"char": "p",
|
|
3333
|
+
"description": "Copado pipeline Salesforce Id",
|
|
3334
|
+
"name": "pipeline-id",
|
|
3335
|
+
"required": true,
|
|
3336
|
+
"hasDynamicHelp": false,
|
|
3337
|
+
"multiple": false,
|
|
3338
|
+
"type": "option"
|
|
3339
|
+
},
|
|
3340
|
+
"subscription": {
|
|
3341
|
+
"description": "Notification audience for this event",
|
|
3342
|
+
"name": "subscription",
|
|
3343
|
+
"required": true,
|
|
3344
|
+
"hasDynamicHelp": false,
|
|
3345
|
+
"multiple": false,
|
|
3346
|
+
"options": [
|
|
3347
|
+
"user",
|
|
3348
|
+
"all"
|
|
3349
|
+
],
|
|
3350
|
+
"type": "option"
|
|
3351
|
+
}
|
|
3352
|
+
},
|
|
3353
|
+
"hasDynamicHelp": false,
|
|
3354
|
+
"hiddenAliases": [],
|
|
3355
|
+
"id": "cicd:notification:configure",
|
|
3356
|
+
"pluginAlias": "@copado/agentia-cli",
|
|
3357
|
+
"pluginName": "@copado/agentia-cli",
|
|
3358
|
+
"pluginType": "core",
|
|
3359
|
+
"strict": true,
|
|
3360
|
+
"enableJsonFlag": true,
|
|
3361
|
+
"isESM": true,
|
|
3362
|
+
"relativePath": [
|
|
3363
|
+
"dist",
|
|
3364
|
+
"commands",
|
|
3365
|
+
"cicd",
|
|
3366
|
+
"notification",
|
|
3367
|
+
"configure.js"
|
|
3368
|
+
]
|
|
3369
|
+
},
|
|
3258
3370
|
"cicd:pipeline:create": {
|
|
3259
3371
|
"aliases": [],
|
|
3260
3372
|
"args": {
|
|
@@ -9513,102 +9625,6 @@
|
|
|
9513
9625
|
"list.js"
|
|
9514
9626
|
]
|
|
9515
9627
|
},
|
|
9516
|
-
"cicd:data:commit:create": {
|
|
9517
|
-
"aliases": [],
|
|
9518
|
-
"args": {},
|
|
9519
|
-
"description": "Create a data commit for a user story",
|
|
9520
|
-
"examples": [
|
|
9521
|
-
"<%= config.bin %> <%= command.id %> --file commit.json",
|
|
9522
|
-
"<%= config.bin %> <%= command.id %> --stdin --json"
|
|
9523
|
-
],
|
|
9524
|
-
"flags": {
|
|
9525
|
-
"json": {
|
|
9526
|
-
"description": "Format output as json.",
|
|
9527
|
-
"helpGroup": "GLOBAL",
|
|
9528
|
-
"name": "json",
|
|
9529
|
-
"allowNo": false,
|
|
9530
|
-
"type": "boolean"
|
|
9531
|
-
},
|
|
9532
|
-
"file": {
|
|
9533
|
-
"char": "f",
|
|
9534
|
-
"description": "Path to a JSON file body",
|
|
9535
|
-
"exclusive": [
|
|
9536
|
-
"stdin"
|
|
9537
|
-
],
|
|
9538
|
-
"name": "file",
|
|
9539
|
-
"hasDynamicHelp": false,
|
|
9540
|
-
"multiple": false,
|
|
9541
|
-
"type": "option"
|
|
9542
|
-
},
|
|
9543
|
-
"stdin": {
|
|
9544
|
-
"description": "Read the JSON body from stdin",
|
|
9545
|
-
"exclusive": [
|
|
9546
|
-
"file"
|
|
9547
|
-
],
|
|
9548
|
-
"name": "stdin",
|
|
9549
|
-
"allowNo": false,
|
|
9550
|
-
"type": "boolean"
|
|
9551
|
-
}
|
|
9552
|
-
},
|
|
9553
|
-
"hasDynamicHelp": false,
|
|
9554
|
-
"hiddenAliases": [],
|
|
9555
|
-
"id": "cicd:data:commit:create",
|
|
9556
|
-
"pluginAlias": "@copado/agentia-cli",
|
|
9557
|
-
"pluginName": "@copado/agentia-cli",
|
|
9558
|
-
"pluginType": "core",
|
|
9559
|
-
"strict": true,
|
|
9560
|
-
"enableJsonFlag": true,
|
|
9561
|
-
"isESM": true,
|
|
9562
|
-
"relativePath": [
|
|
9563
|
-
"dist",
|
|
9564
|
-
"commands",
|
|
9565
|
-
"cicd",
|
|
9566
|
-
"data",
|
|
9567
|
-
"commit",
|
|
9568
|
-
"create.js"
|
|
9569
|
-
]
|
|
9570
|
-
},
|
|
9571
|
-
"cicd:data:commit:list": {
|
|
9572
|
-
"aliases": [],
|
|
9573
|
-
"args": {
|
|
9574
|
-
"userStoryId": {
|
|
9575
|
-
"description": "User story Id",
|
|
9576
|
-
"name": "userStoryId",
|
|
9577
|
-
"required": true
|
|
9578
|
-
}
|
|
9579
|
-
},
|
|
9580
|
-
"description": "List data commits for a user story",
|
|
9581
|
-
"examples": [
|
|
9582
|
-
"<%= config.bin %> <%= command.id %> a16P7000006AyU5IAK",
|
|
9583
|
-
"<%= config.bin %> <%= command.id %> a16P7000006AyU5IAK --json"
|
|
9584
|
-
],
|
|
9585
|
-
"flags": {
|
|
9586
|
-
"json": {
|
|
9587
|
-
"description": "Format output as json.",
|
|
9588
|
-
"helpGroup": "GLOBAL",
|
|
9589
|
-
"name": "json",
|
|
9590
|
-
"allowNo": false,
|
|
9591
|
-
"type": "boolean"
|
|
9592
|
-
}
|
|
9593
|
-
},
|
|
9594
|
-
"hasDynamicHelp": false,
|
|
9595
|
-
"hiddenAliases": [],
|
|
9596
|
-
"id": "cicd:data:commit:list",
|
|
9597
|
-
"pluginAlias": "@copado/agentia-cli",
|
|
9598
|
-
"pluginName": "@copado/agentia-cli",
|
|
9599
|
-
"pluginType": "core",
|
|
9600
|
-
"strict": true,
|
|
9601
|
-
"enableJsonFlag": true,
|
|
9602
|
-
"isESM": true,
|
|
9603
|
-
"relativePath": [
|
|
9604
|
-
"dist",
|
|
9605
|
-
"commands",
|
|
9606
|
-
"cicd",
|
|
9607
|
-
"data",
|
|
9608
|
-
"commit",
|
|
9609
|
-
"list.js"
|
|
9610
|
-
]
|
|
9611
|
-
},
|
|
9612
9628
|
"cicd:data:dataset-file:content": {
|
|
9613
9629
|
"aliases": [],
|
|
9614
9630
|
"args": {
|
|
@@ -12912,6 +12928,102 @@
|
|
|
12912
12928
|
"unresolve.js"
|
|
12913
12929
|
]
|
|
12914
12930
|
},
|
|
12931
|
+
"cicd:data:commit:create": {
|
|
12932
|
+
"aliases": [],
|
|
12933
|
+
"args": {},
|
|
12934
|
+
"description": "Create a data commit for a user story",
|
|
12935
|
+
"examples": [
|
|
12936
|
+
"<%= config.bin %> <%= command.id %> --file commit.json",
|
|
12937
|
+
"<%= config.bin %> <%= command.id %> --stdin --json"
|
|
12938
|
+
],
|
|
12939
|
+
"flags": {
|
|
12940
|
+
"json": {
|
|
12941
|
+
"description": "Format output as json.",
|
|
12942
|
+
"helpGroup": "GLOBAL",
|
|
12943
|
+
"name": "json",
|
|
12944
|
+
"allowNo": false,
|
|
12945
|
+
"type": "boolean"
|
|
12946
|
+
},
|
|
12947
|
+
"file": {
|
|
12948
|
+
"char": "f",
|
|
12949
|
+
"description": "Path to a JSON file body",
|
|
12950
|
+
"exclusive": [
|
|
12951
|
+
"stdin"
|
|
12952
|
+
],
|
|
12953
|
+
"name": "file",
|
|
12954
|
+
"hasDynamicHelp": false,
|
|
12955
|
+
"multiple": false,
|
|
12956
|
+
"type": "option"
|
|
12957
|
+
},
|
|
12958
|
+
"stdin": {
|
|
12959
|
+
"description": "Read the JSON body from stdin",
|
|
12960
|
+
"exclusive": [
|
|
12961
|
+
"file"
|
|
12962
|
+
],
|
|
12963
|
+
"name": "stdin",
|
|
12964
|
+
"allowNo": false,
|
|
12965
|
+
"type": "boolean"
|
|
12966
|
+
}
|
|
12967
|
+
},
|
|
12968
|
+
"hasDynamicHelp": false,
|
|
12969
|
+
"hiddenAliases": [],
|
|
12970
|
+
"id": "cicd:data:commit:create",
|
|
12971
|
+
"pluginAlias": "@copado/agentia-cli",
|
|
12972
|
+
"pluginName": "@copado/agentia-cli",
|
|
12973
|
+
"pluginType": "core",
|
|
12974
|
+
"strict": true,
|
|
12975
|
+
"enableJsonFlag": true,
|
|
12976
|
+
"isESM": true,
|
|
12977
|
+
"relativePath": [
|
|
12978
|
+
"dist",
|
|
12979
|
+
"commands",
|
|
12980
|
+
"cicd",
|
|
12981
|
+
"data",
|
|
12982
|
+
"commit",
|
|
12983
|
+
"create.js"
|
|
12984
|
+
]
|
|
12985
|
+
},
|
|
12986
|
+
"cicd:data:commit:list": {
|
|
12987
|
+
"aliases": [],
|
|
12988
|
+
"args": {
|
|
12989
|
+
"userStoryId": {
|
|
12990
|
+
"description": "User story Id",
|
|
12991
|
+
"name": "userStoryId",
|
|
12992
|
+
"required": true
|
|
12993
|
+
}
|
|
12994
|
+
},
|
|
12995
|
+
"description": "List data commits for a user story",
|
|
12996
|
+
"examples": [
|
|
12997
|
+
"<%= config.bin %> <%= command.id %> a16P7000006AyU5IAK",
|
|
12998
|
+
"<%= config.bin %> <%= command.id %> a16P7000006AyU5IAK --json"
|
|
12999
|
+
],
|
|
13000
|
+
"flags": {
|
|
13001
|
+
"json": {
|
|
13002
|
+
"description": "Format output as json.",
|
|
13003
|
+
"helpGroup": "GLOBAL",
|
|
13004
|
+
"name": "json",
|
|
13005
|
+
"allowNo": false,
|
|
13006
|
+
"type": "boolean"
|
|
13007
|
+
}
|
|
13008
|
+
},
|
|
13009
|
+
"hasDynamicHelp": false,
|
|
13010
|
+
"hiddenAliases": [],
|
|
13011
|
+
"id": "cicd:data:commit:list",
|
|
13012
|
+
"pluginAlias": "@copado/agentia-cli",
|
|
13013
|
+
"pluginName": "@copado/agentia-cli",
|
|
13014
|
+
"pluginType": "core",
|
|
13015
|
+
"strict": true,
|
|
13016
|
+
"enableJsonFlag": true,
|
|
13017
|
+
"isESM": true,
|
|
13018
|
+
"relativePath": [
|
|
13019
|
+
"dist",
|
|
13020
|
+
"commands",
|
|
13021
|
+
"cicd",
|
|
13022
|
+
"data",
|
|
13023
|
+
"commit",
|
|
13024
|
+
"list.js"
|
|
13025
|
+
]
|
|
13026
|
+
},
|
|
12915
13027
|
"cicd:work:deployment-step:create": {
|
|
12916
13028
|
"aliases": [],
|
|
12917
13029
|
"args": {},
|
|
@@ -13628,5 +13740,5 @@
|
|
|
13628
13740
|
]
|
|
13629
13741
|
}
|
|
13630
13742
|
},
|
|
13631
|
-
"version": "0.
|
|
13743
|
+
"version": "0.87.0-alpha.0"
|
|
13632
13744
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copado/agentia-cli",
|
|
3
3
|
"description": "Command-line interface for Agentia",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.87.0-alpha.0",
|
|
5
5
|
"author": "Copado Solutions",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agentia": "./bin/run.js"
|
|
@@ -181,6 +181,9 @@
|
|
|
181
181
|
"cicd:promotion:conflict": {
|
|
182
182
|
"description": "Manage Copado promotion conflicts"
|
|
183
183
|
},
|
|
184
|
+
"cicd:notification": {
|
|
185
|
+
"description": "Configure Copado notification subscriptions"
|
|
186
|
+
},
|
|
184
187
|
"mcp": {
|
|
185
188
|
"description": "Start a local Model Context Protocol server for MCP-compatible clients"
|
|
186
189
|
},
|