@salesforce/plugin-devops-center 1.2.26 → 1.2.28
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/LICENSE.txt +200 -6
- package/README.md +430 -19
- package/bin/dev.js +15 -0
- package/bin/run.js +5 -0
- package/lib/commands/devops/pipeline/activate.d.ts +14 -0
- package/lib/commands/devops/pipeline/activate.js +82 -0
- package/lib/commands/devops/pipeline/activate.js.map +1 -0
- package/lib/commands/devops/pipeline/attach-project.d.ts +15 -0
- package/lib/commands/devops/pipeline/attach-project.js +82 -0
- package/lib/commands/devops/pipeline/attach-project.js.map +1 -0
- package/lib/commands/devops/pipeline/create.d.ts +23 -0
- package/lib/commands/devops/pipeline/create.js +136 -0
- package/lib/commands/devops/pipeline/create.js.map +1 -0
- package/lib/commands/devops/pipeline/stage/add.d.ts +16 -0
- package/lib/commands/devops/pipeline/stage/add.js +94 -0
- package/lib/commands/devops/pipeline/stage/add.js.map +1 -0
- package/lib/commands/devops/project/create.d.ts +15 -0
- package/lib/commands/devops/project/create.js +72 -0
- package/lib/commands/devops/project/create.js.map +1 -0
- package/lib/commands/devops/project/list.d.ts +20 -0
- package/lib/commands/devops/project/list.js +59 -0
- package/lib/commands/devops/project/list.js.map +1 -0
- package/lib/commands/devops/pull-request/create.d.ts +17 -0
- package/lib/commands/devops/pull-request/create.js +104 -0
- package/lib/commands/devops/pull-request/create.js.map +1 -0
- package/lib/commands/devops/work-item/create.d.ts +16 -0
- package/lib/commands/devops/work-item/create.js +76 -0
- package/lib/commands/devops/work-item/create.js.map +1 -0
- package/lib/commands/devops/work-item/list.d.ts +17 -0
- package/lib/commands/devops/work-item/list.js +72 -0
- package/lib/commands/devops/work-item/list.js.map +1 -0
- package/lib/commands/devops/work-item/status/update.d.ts +16 -0
- package/lib/commands/devops/work-item/status/update.js +90 -0
- package/lib/commands/devops/work-item/status/update.js.map +1 -0
- package/lib/commands/project/deploy/pipeline/quick.d.ts +2 -2
- package/lib/commands/project/deploy/pipeline/quick.js +24 -21
- package/lib/commands/project/deploy/pipeline/quick.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/report.d.ts +4 -4
- package/lib/commands/project/deploy/pipeline/report.js +38 -35
- package/lib/commands/project/deploy/pipeline/report.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/resume.d.ts +2 -2
- package/lib/commands/project/deploy/pipeline/resume.js +24 -21
- package/lib/commands/project/deploy/pipeline/resume.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/start.d.ts +3 -3
- package/lib/commands/project/deploy/pipeline/start.js +26 -23
- package/lib/commands/project/deploy/pipeline/start.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/validate.d.ts +3 -3
- package/lib/commands/project/deploy/pipeline/validate.js +24 -21
- package/lib/commands/project/deploy/pipeline/validate.js.map +1 -1
- package/lib/common/base/abstractAsyncOperation.d.ts +3 -3
- package/lib/common/base/abstractAsyncOperation.js +31 -23
- package/lib/common/base/abstractAsyncOperation.js.map +1 -1
- package/lib/common/base/abstractPromote.d.ts +5 -4
- package/lib/common/base/abstractPromote.js +52 -38
- package/lib/common/base/abstractPromote.js.map +1 -1
- package/lib/common/base/abstractQuick.d.ts +4 -3
- package/lib/common/base/abstractQuick.js +44 -43
- package/lib/common/base/abstractQuick.js.map +1 -1
- package/lib/common/base/abstractReportOnPromote.d.ts +2 -1
- package/lib/common/base/abstractReportOnPromote.js +31 -24
- package/lib/common/base/abstractReportOnPromote.js.map +1 -1
- package/lib/common/base/abstractResume.d.ts +3 -2
- package/lib/common/base/abstractResume.js +40 -33
- package/lib/common/base/abstractResume.js.map +1 -1
- package/lib/common/constants.js +19 -13
- package/lib/common/constants.js.map +1 -1
- package/lib/common/deployPipelineCache.js +20 -15
- package/lib/common/deployPipelineCache.js.map +1 -1
- package/lib/common/flags/flags.d.ts +2 -2
- package/lib/common/flags/flags.js +34 -29
- package/lib/common/flags/flags.js.map +1 -1
- package/lib/common/flags/promote/promoteFlags.d.ts +3 -3
- package/lib/common/flags/promote/promoteFlags.js +26 -20
- package/lib/common/flags/promote/promoteFlags.js.map +1 -1
- package/lib/common/index.d.ts +3 -2
- package/lib/common/index.js +2 -17
- package/lib/common/index.js.map +1 -1
- package/lib/common/outputColumns.d.ts +3 -13
- package/lib/common/outputColumns.js +23 -19
- package/lib/common/outputColumns.js.map +1 -1
- package/lib/common/outputService/aorOutputService.d.ts +4 -4
- package/lib/common/outputService/aorOutputService.js +27 -20
- package/lib/common/outputService/aorOutputService.js.map +1 -1
- package/lib/common/outputService/deployCommandOutputService.d.ts +2 -2
- package/lib/common/outputService/deployCommandOutputService.js +17 -12
- package/lib/common/outputService/deployCommandOutputService.js.map +1 -1
- package/lib/common/outputService/deploySummaryBuilder.d.ts +1 -1
- package/lib/common/outputService/deploySummaryBuilder.js +45 -31
- package/lib/common/outputService/deploySummaryBuilder.js.map +1 -1
- package/lib/common/outputService/deploymentResultOutputService.d.ts +4 -4
- package/lib/common/outputService/deploymentResultOutputService.js +16 -10
- package/lib/common/outputService/deploymentResultOutputService.js.map +1 -1
- package/lib/common/outputService/index.d.ts +8 -6
- package/lib/common/outputService/index.js +5 -19
- package/lib/common/outputService/index.js.map +1 -1
- package/lib/common/outputService/outputService.d.ts +6 -4
- package/lib/common/outputService/outputService.js +20 -14
- package/lib/common/outputService/outputService.js.map +1 -1
- package/lib/common/outputService/outputServiceFactory.d.ts +8 -8
- package/lib/common/outputService/outputServiceFactory.js +21 -16
- package/lib/common/outputService/outputServiceFactory.js.map +1 -1
- package/lib/common/outputService/outputUtils.d.ts +1 -1
- package/lib/common/outputService/outputUtils.js +24 -19
- package/lib/common/outputService/outputUtils.js.map +1 -1
- package/lib/common/outputService/promoteOutputService.d.ts +4 -5
- package/lib/common/outputService/promoteOutputService.js +19 -13
- package/lib/common/outputService/promoteOutputService.js.map +1 -1
- package/lib/common/outputService/reportOutputService.d.ts +5 -6
- package/lib/common/outputService/reportOutputService.js +32 -27
- package/lib/common/outputService/reportOutputService.js.map +1 -1
- package/lib/common/outputService/resumeCommandOutputService.d.ts +3 -3
- package/lib/common/outputService/resumeCommandOutputService.js +19 -13
- package/lib/common/outputService/resumeCommandOutputService.js.map +1 -1
- package/lib/common/outputService/resumeOutputService.d.ts +3 -3
- package/lib/common/outputService/resumeOutputService.js +23 -17
- package/lib/common/outputService/resumeOutputService.js.map +1 -1
- package/lib/common/selectors/asyncOperationResultsSelector.d.ts +1 -1
- package/lib/common/selectors/asyncOperationResultsSelector.js +16 -10
- package/lib/common/selectors/asyncOperationResultsSelector.js.map +1 -1
- package/lib/common/selectors/deployComponentsSelector.d.ts +1 -1
- package/lib/common/selectors/deployComponentsSelector.js +18 -13
- package/lib/common/selectors/deployComponentsSelector.js.map +1 -1
- package/lib/common/selectors/deployProgressSummarySelector.d.ts +2 -2
- package/lib/common/selectors/deployProgressSummarySelector.js +16 -10
- package/lib/common/selectors/deployProgressSummarySelector.js.map +1 -1
- package/lib/common/selectors/deploymentResultsSelector.d.ts +2 -2
- package/lib/common/selectors/deploymentResultsSelector.js +20 -16
- package/lib/common/selectors/deploymentResultsSelector.js.map +1 -1
- package/lib/common/selectors/environmentSelector.d.ts +2 -2
- package/lib/common/selectors/environmentSelector.js +16 -10
- package/lib/common/selectors/environmentSelector.js.map +1 -1
- package/lib/common/selectors/namedCredentialSelector.d.ts +1 -1
- package/lib/common/selectors/namedCredentialSelector.js +16 -10
- package/lib/common/selectors/namedCredentialSelector.js.map +1 -1
- package/lib/common/selectors/pipelineStageSelector.d.ts +1 -1
- package/lib/common/selectors/pipelineStageSelector.js +18 -13
- package/lib/common/selectors/pipelineStageSelector.js.map +1 -1
- package/lib/common/selectors/selectorUtils.d.ts +1 -1
- package/lib/common/selectors/selectorUtils.js +17 -11
- package/lib/common/selectors/selectorUtils.js.map +1 -1
- package/lib/common/selectors/validateDeploySelector.d.ts +1 -1
- package/lib/common/selectors/validateDeploySelector.js +16 -10
- package/lib/common/selectors/validateDeploySelector.js.map +1 -1
- package/lib/common/selectors/workItemSelector.d.ts +2 -2
- package/lib/common/selectors/workItemSelector.js +16 -10
- package/lib/common/selectors/workItemSelector.js.map +1 -1
- package/lib/common/types.d.ts +4 -4
- package/lib/common/types.js +4 -7
- package/lib/common/types.js.map +1 -1
- package/lib/common/utils.d.ts +4 -4
- package/lib/common/utils.js +42 -43
- package/lib/common/utils.js.map +1 -1
- package/lib/configMeta.js +21 -15
- package/lib/configMeta.js.map +1 -1
- package/lib/streamer/doceMonitor.d.ts +3 -2
- package/lib/streamer/doceMonitor.js +14 -6
- package/lib/streamer/doceMonitor.js.map +1 -1
- package/lib/streamer/doceStream.d.ts +1 -1
- package/lib/streamer/doceStream.js +19 -11
- package/lib/streamer/doceStream.js.map +1 -1
- package/lib/streamer/processors/asyncOpStream.d.ts +2 -2
- package/lib/streamer/processors/asyncOpStream.js +22 -15
- package/lib/streamer/processors/asyncOpStream.js.map +1 -1
- package/lib/streamer/sObjectStream.d.ts +1 -1
- package/lib/streamer/sObjectStream.js +9 -10
- package/lib/streamer/sObjectStream.js.map +1 -1
- package/lib/utils/activatePipeline.d.ts +17 -0
- package/lib/utils/activatePipeline.js +35 -0
- package/lib/utils/activatePipeline.js.map +1 -0
- package/lib/utils/addPipelineStage.d.ts +20 -0
- package/lib/utils/addPipelineStage.js +43 -0
- package/lib/utils/addPipelineStage.js.map +1 -0
- package/lib/utils/attachProject.d.ts +21 -0
- package/lib/utils/attachProject.js +44 -0
- package/lib/utils/attachProject.js.map +1 -0
- package/lib/utils/createPipeline.d.ts +34 -0
- package/lib/utils/createPipeline.js +77 -0
- package/lib/utils/createPipeline.js.map +1 -0
- package/lib/utils/createProject.d.ts +17 -0
- package/lib/utils/createProject.js +39 -0
- package/lib/utils/createProject.js.map +1 -0
- package/lib/utils/createPullRequest.d.ts +49 -0
- package/lib/utils/createPullRequest.js +204 -0
- package/lib/utils/createPullRequest.js.map +1 -0
- package/lib/utils/createWorkItem.d.ts +19 -0
- package/lib/utils/createWorkItem.js +58 -0
- package/lib/utils/createWorkItem.js.map +1 -0
- package/lib/utils/pipelineUtils.d.ts +8 -0
- package/lib/utils/pipelineUtils.js +51 -0
- package/lib/utils/pipelineUtils.js.map +1 -0
- package/lib/utils/types.d.ts +57 -0
- package/lib/utils/types.js +17 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/updateWorkItemStatus.d.ts +34 -0
- package/lib/utils/updateWorkItemStatus.js +71 -0
- package/lib/utils/updateWorkItemStatus.js.map +1 -0
- package/lib/utils/workItems.d.ts +3 -0
- package/lib/utils/workItems.js +181 -0
- package/lib/utils/workItems.js.map +1 -0
- package/messages/commonErrors.md +5 -1
- package/messages/devops.pipeline.activate.md +29 -0
- package/messages/devops.pipeline.attach-project.md +29 -0
- package/messages/devops.pipeline.create.md +81 -0
- package/messages/devops.pipeline.stage.add.md +37 -0
- package/messages/devops.project.create.md +29 -0
- package/messages/devops.project.list.md +17 -0
- package/messages/devops.pull-request.create.md +57 -0
- package/messages/devops.work-item.create.md +29 -0
- package/messages/devops.work-item.list.md +21 -0
- package/messages/devops.work-item.status.update.md +29 -0
- package/npm-shrinkwrap.json +4594 -4552
- package/oclif.lock +3513 -3194
- package/oclif.manifest.json +863 -11
- package/package.json +56 -26
- package/schemas/devops-pipeline-activate.json +28 -0
- package/schemas/devops-pipeline-attach__project.json +25 -0
- package/schemas/devops-pipeline-create.json +50 -0
- package/schemas/devops-pipeline-stage-add.json +31 -0
- package/schemas/devops-project-create.json +28 -0
- package/schemas/devops-project-list.json +35 -0
- package/schemas/devops-pull__request-create.json +34 -0
- package/schemas/devops-work__item-create.json +28 -0
- package/schemas/devops-work__item-list.json +75 -0
- package/schemas/devops-work__item-status-update.json +28 -0
- package/schemas/project-deploy-pipeline-report.json +2 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
19
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'devops.project.list');
|
|
20
|
+
const commonErrorMessages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
21
|
+
export default class DevopsProjectList extends SfCommand {
|
|
22
|
+
static summary = messages.getMessage('summary');
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static examples = messages.getMessages('examples');
|
|
25
|
+
static flags = {
|
|
26
|
+
'target-org': Flags.requiredOrg(),
|
|
27
|
+
'api-version': Flags.orgApiVersion(),
|
|
28
|
+
};
|
|
29
|
+
async run() {
|
|
30
|
+
const { flags } = await this.parse(DevopsProjectList);
|
|
31
|
+
const org = flags['target-org'];
|
|
32
|
+
const connection = org.getConnection(flags['api-version']);
|
|
33
|
+
let projects;
|
|
34
|
+
try {
|
|
35
|
+
const query = 'SELECT Id, Name, Description FROM DevopsProject';
|
|
36
|
+
const result = await connection.query(query);
|
|
37
|
+
projects = result.records ?? [];
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
41
|
+
if (errMsg.includes('sObject type') && errMsg.includes('is not supported')) {
|
|
42
|
+
this.error(commonErrorMessages.getMessage('error.DevopsCenterNotEnabled'));
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
if (projects.length === 0) {
|
|
47
|
+
this.log('No DevOps Center projects found in this org.');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
this.styledHeader('DevOps Center Projects');
|
|
51
|
+
this.table({
|
|
52
|
+
data: projects,
|
|
53
|
+
columns: ['Id', 'Name', 'Description'],
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return { projects };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/devops/project/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAE/D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,qBAAqB,CAAC,CAAC;AAClG,MAAM,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAYtG,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAkC;IACxE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;QACjC,aAAa,EAAE,KAAK,CAAC,aAAa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QAAQ,EAAE,CAAC;IACtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Org } from '@salesforce/core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { CreatePullRequestResult } from '../../../utils/createPullRequest.js';
|
|
4
|
+
export default class DevopsPullRequestCreate extends SfCommand<CreatePullRequestResult> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'work-item-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'work-item-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<CreatePullRequestResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { createPullRequest, fetchWorkItemDetail, resolveGitHubToken, } from '../../../utils/createPullRequest.js';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'devops.pull-request.create');
|
|
21
|
+
const commonErrorMessages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
22
|
+
export default class DevopsPullRequestCreate extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static flags = {
|
|
27
|
+
'target-org': Flags.requiredOrg(),
|
|
28
|
+
'api-version': Flags.orgApiVersion(),
|
|
29
|
+
'work-item-name': Flags.string({
|
|
30
|
+
summary: messages.getMessage('flags.work-item-name.summary'),
|
|
31
|
+
char: 'n',
|
|
32
|
+
exactlyOne: ['work-item-name', 'work-item-id'],
|
|
33
|
+
}),
|
|
34
|
+
'work-item-id': Flags.salesforceId({
|
|
35
|
+
summary: messages.getMessage('flags.work-item-id.summary'),
|
|
36
|
+
char: 'w',
|
|
37
|
+
exactlyOne: ['work-item-name', 'work-item-id'],
|
|
38
|
+
}),
|
|
39
|
+
title: Flags.string({
|
|
40
|
+
summary: messages.getMessage('flags.title.summary'),
|
|
41
|
+
}),
|
|
42
|
+
body: Flags.string({
|
|
43
|
+
summary: messages.getMessage('flags.body.summary'),
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { flags } = await this.parse(DevopsPullRequestCreate);
|
|
48
|
+
const org = flags['target-org'];
|
|
49
|
+
const connection = org.getConnection(flags['api-version']);
|
|
50
|
+
const filter = flags['work-item-name'] ? { name: flags['work-item-name'] } : { id: flags['work-item-id'] };
|
|
51
|
+
let detail;
|
|
52
|
+
try {
|
|
53
|
+
detail = await fetchWorkItemDetail(connection, filter);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
57
|
+
if (errMsg.includes('sObject type') && errMsg.includes('is not supported')) {
|
|
58
|
+
this.error(commonErrorMessages.getMessage('error.DevopsCenterNotEnabled'));
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
if (!detail.branchName) {
|
|
63
|
+
this.error(messages.getMessage('error.NoBranch', [detail.workItemName]));
|
|
64
|
+
}
|
|
65
|
+
if (!detail.repoOwner || !detail.repoName) {
|
|
66
|
+
this.error(messages.getMessage('error.NoRepo', [detail.workItemName]));
|
|
67
|
+
}
|
|
68
|
+
if (!detail.targetBranch) {
|
|
69
|
+
this.error(messages.getMessage('error.NoTargetBranch', [detail.workItemName]));
|
|
70
|
+
}
|
|
71
|
+
if (!detail.provider) {
|
|
72
|
+
this.error(messages.getMessage('error.NoProvider', [detail.workItemName]));
|
|
73
|
+
}
|
|
74
|
+
let token;
|
|
75
|
+
if (detail.provider === 'github') {
|
|
76
|
+
token = await resolveGitHubToken();
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
token = process.env.BITBUCKET_TOKEN;
|
|
80
|
+
}
|
|
81
|
+
if (!token) {
|
|
82
|
+
this.error(messages.getMessage('error.NoToken', [detail.provider]));
|
|
83
|
+
}
|
|
84
|
+
const prTitle = flags['title'] ?? detail.subject;
|
|
85
|
+
const result = await createPullRequest({
|
|
86
|
+
owner: detail.repoOwner,
|
|
87
|
+
repo: detail.repoName,
|
|
88
|
+
head: detail.branchName,
|
|
89
|
+
base: detail.targetBranch,
|
|
90
|
+
title: prTitle,
|
|
91
|
+
body: flags['body'],
|
|
92
|
+
provider: detail.provider,
|
|
93
|
+
token,
|
|
94
|
+
});
|
|
95
|
+
if (result.success) {
|
|
96
|
+
this.log(`Successfully created pull request for ${detail.workItemName}.`);
|
|
97
|
+
this.log(` Title: ${result.title ?? prTitle}`);
|
|
98
|
+
this.log(` URL: ${result.url ?? ''}`);
|
|
99
|
+
this.log(` Source: ${detail.workItemName} → ${result.targetBranch ?? detail.targetBranch}`);
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/devops/pull-request/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EACL,iBAAiB,EAEjB,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,qCAAqC,CAAC;AAE7C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,4BAA4B,CAAC,CAAC;AACzG,MAAM,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAEtG,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,SAAkC;IAC9E,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QA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2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { CreateWorkItemResult } from '../../../utils/createWorkItem.js';
|
|
4
|
+
export default class DevopsWorkItemCreate extends SfCommand<CreateWorkItemResult> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'project-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
subject: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<CreateWorkItemResult>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { createWorkItem } from '../../../utils/createWorkItem.js';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'devops.work-item.create');
|
|
21
|
+
const commonErrorMessages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
22
|
+
export default class DevopsWorkItemCreate extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static flags = {
|
|
27
|
+
'target-org': Flags.requiredOrg(),
|
|
28
|
+
'api-version': Flags.orgApiVersion(),
|
|
29
|
+
'project-id': Flags.salesforceId({
|
|
30
|
+
summary: messages.getMessage('flags.project-id.summary'),
|
|
31
|
+
char: 'p',
|
|
32
|
+
required: true,
|
|
33
|
+
startsWith: '1Qg',
|
|
34
|
+
}),
|
|
35
|
+
subject: Flags.string({
|
|
36
|
+
summary: messages.getMessage('flags.subject.summary'),
|
|
37
|
+
char: 's',
|
|
38
|
+
required: true,
|
|
39
|
+
}),
|
|
40
|
+
description: Flags.string({
|
|
41
|
+
summary: messages.getMessage('flags.description.summary'),
|
|
42
|
+
char: 'd',
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
const { flags } = await this.parse(DevopsWorkItemCreate);
|
|
47
|
+
const org = flags['target-org'];
|
|
48
|
+
const connection = org.getConnection(flags['api-version']);
|
|
49
|
+
let result;
|
|
50
|
+
try {
|
|
51
|
+
result = await createWorkItem({
|
|
52
|
+
connection,
|
|
53
|
+
projectId: flags['project-id'],
|
|
54
|
+
subject: flags['subject'],
|
|
55
|
+
description: flags['description'] ?? '',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
60
|
+
if (errMsg.includes('sObject type') && errMsg.includes('is not supported')) {
|
|
61
|
+
this.error(commonErrorMessages.getMessage('error.DevopsCenterNotEnabled'));
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
if (result.success) {
|
|
66
|
+
this.log(`Successfully created work item: ${result.workItemName ?? result.workItemId ?? ''}`);
|
|
67
|
+
this.log(` ID: ${result.workItemId ?? ''}`);
|
|
68
|
+
this.log(` Subject: ${result.subject ?? ''}`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
this.error(`Failed to create work item: ${result.error ?? ''}`);
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/devops/work-item/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAwB,MAAM,kCAAkC,CAAC;AAExF,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,yBAAyB,CAAC,CAAC;AACtG,MAAM,mBAAmB,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAEtG,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,SAA+B;IACxE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC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CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACtE,IAAI,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBAC3E,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,CAAC;YAC7E,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,mCAAmC,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC,CAAC;YAC9F,IAAI,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,UAAU,IAAI,EAAE,EAAE,CAAC,CAAC;YAC7C,IAAI,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,+BAA+B,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Org } from '@salesforce/core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { WorkItem } from '../../../utils/types.js';
|
|
4
|
+
export type DevopsWorkItemListResult = {
|
|
5
|
+
workItems: WorkItem[];
|
|
6
|
+
};
|
|
7
|
+
export default class DevopsWorkItemList extends SfCommand<DevopsWorkItemListResult> {
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'project-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<DevopsWorkItemListResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { fetchWorkItems } from '../../../utils/workItems.js';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'devops.work-item.list');
|
|
21
|
+
const commonErrorMessages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
22
|
+
export default class DevopsWorkItemList extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static flags = {
|
|
27
|
+
'target-org': Flags.requiredOrg(),
|
|
28
|
+
'api-version': Flags.orgApiVersion(),
|
|
29
|
+
'project-id': Flags.salesforceId({
|
|
30
|
+
summary: messages.getMessage('flags.project-id.summary'),
|
|
31
|
+
char: 'p',
|
|
32
|
+
required: true,
|
|
33
|
+
startsWith: '1Qg',
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const { flags } = await this.parse(DevopsWorkItemList);
|
|
38
|
+
const org = flags['target-org'];
|
|
39
|
+
const projectId = flags['project-id'];
|
|
40
|
+
const connection = org.getConnection(flags['api-version']);
|
|
41
|
+
let workItems;
|
|
42
|
+
try {
|
|
43
|
+
workItems = await fetchWorkItems(connection, projectId);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
47
|
+
if (errMsg.includes('sObject type') && errMsg.includes('is not supported')) {
|
|
48
|
+
this.error(commonErrorMessages.getMessage('error.DevopsCenterNotEnabled'));
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
if (workItems.length === 0) {
|
|
53
|
+
this.log('No work items found for this project.');
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
const tableData = workItems.map((wi) => ({
|
|
57
|
+
Name: wi.name,
|
|
58
|
+
Subject: wi.subject ?? '',
|
|
59
|
+
Status: wi.status,
|
|
60
|
+
Branch: wi.WorkItemBranch ?? '',
|
|
61
|
+
'Target Branch': wi.TargetBranch ?? '',
|
|
62
|
+
}));
|
|
63
|
+
this.styledHeader('DevOps Center Work Items');
|
|
64
|
+
this.table({
|
|
65
|
+
data: tableData,
|
|
66
|
+
columns: ['Name', 'Subject', 'Status', 'Branch', 'Target Branch'],
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return { workItems };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/devops/work-item/list.ts"],"names":[],"mappings":"AA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,QAAQ,EAAE,QAAQ,EAAE,eAAe,CAAC;aAClE,CAAC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,SAAS,EAAE,CAAC;IACvB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Org } from '@salesforce/core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { UpdateWorkItemStatusResult } from '../../../../utils/updateWorkItemStatus.js';
|
|
4
|
+
export default class DevopsWorkItemStatusUpdate extends SfCommand<UpdateWorkItemStatusResult> {
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly description: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly flags: {
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'api-version': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'work-item-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'work-item-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
status: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<UpdateWorkItemStatusResult>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { resolveWorkItemByName, resolveProjectIdForWorkItem, updateWorkItemStatus, ALLOWED_STATUSES, } from '../../../../utils/updateWorkItemStatus.js';
|
|
19
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
20
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'devops.work-item.status.update');
|
|
21
|
+
const commonErrorMessages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
22
|
+
export default class DevopsWorkItemStatusUpdate extends SfCommand {
|
|
23
|
+
static summary = messages.getMessage('summary');
|
|
24
|
+
static description = messages.getMessage('description');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static flags = {
|
|
27
|
+
'target-org': Flags.requiredOrg(),
|
|
28
|
+
'api-version': Flags.orgApiVersion(),
|
|
29
|
+
'work-item-name': Flags.string({
|
|
30
|
+
summary: messages.getMessage('flags.work-item-name.summary'),
|
|
31
|
+
char: 'n',
|
|
32
|
+
exactlyOne: ['work-item-name', 'work-item-id'],
|
|
33
|
+
}),
|
|
34
|
+
'work-item-id': Flags.salesforceId({
|
|
35
|
+
summary: messages.getMessage('flags.work-item-id.summary'),
|
|
36
|
+
char: 'w',
|
|
37
|
+
exactlyOne: ['work-item-name', 'work-item-id'],
|
|
38
|
+
}),
|
|
39
|
+
status: Flags.string({
|
|
40
|
+
summary: messages.getMessage('flags.status.summary'),
|
|
41
|
+
required: true,
|
|
42
|
+
options: [...ALLOWED_STATUSES],
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
const { flags } = await this.parse(DevopsWorkItemStatusUpdate);
|
|
47
|
+
const org = flags['target-org'];
|
|
48
|
+
const connection = org.getConnection(flags['api-version']);
|
|
49
|
+
let workItemId;
|
|
50
|
+
let projectId;
|
|
51
|
+
try {
|
|
52
|
+
if (flags['work-item-name']) {
|
|
53
|
+
const ctx = await resolveWorkItemByName(connection, flags['work-item-name']);
|
|
54
|
+
workItemId = ctx.workItemId;
|
|
55
|
+
projectId = ctx.projectId;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
workItemId = flags['work-item-id'];
|
|
59
|
+
projectId = await resolveProjectIdForWorkItem(connection, workItemId);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
64
|
+
if (errMsg.includes('sObject type') && errMsg.includes('is not supported')) {
|
|
65
|
+
this.error(commonErrorMessages.getMessage('error.DevopsCenterNotEnabled'));
|
|
66
|
+
}
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
let result;
|
|
70
|
+
try {
|
|
71
|
+
result = await updateWorkItemStatus({ connection, workItemId, projectId, status: flags['status'] });
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
75
|
+
if (errMsg.includes('sObject type') && errMsg.includes('is not supported')) {
|
|
76
|
+
this.error(commonErrorMessages.getMessage('error.DevopsCenterNotEnabled'));
|
|
77
|
+
}
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
if (result.success) {
|
|
81
|
+
const identifier = flags['work-item-name'] ?? result.workItemId;
|
|
82
|
+
this.log(`Successfully updated status for work item ${identifier} to "${result.status ?? flags['status']}".`);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
this.error(`Failed to update work item status: ${result.error ?? ''}`);
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 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ommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import QuickPromotionCommand from '../../../../common/base/abstractQuick';
|
|
3
|
-
import { AsyncOperationResultJson, PromoteOptions } from '../../../../common';
|
|
2
|
+
import QuickPromotionCommand from '../../../../common/base/abstractQuick.js';
|
|
3
|
+
import type { AsyncOperationResultJson, PromoteOptions } from '../../../../common/index.js';
|
|
4
4
|
export default class DeployPipelineQuick extends QuickPromotionCommand<typeof SfCommand> {
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly summary: string;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/*
|
|
4
|
-
* Copyright
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the
|
|
7
|
-
*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
8
15
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const messages =
|
|
13
|
-
class DeployPipelineQuick extends
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import QuickPromotionCommand from '../../../../common/base/abstractQuick.js';
|
|
18
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
19
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.quick');
|
|
20
|
+
export default class DeployPipelineQuick extends QuickPromotionCommand {
|
|
21
|
+
static description = messages.getMessage('description');
|
|
22
|
+
static summary = messages.getMessage('summary');
|
|
23
|
+
static examples = messages.getMessages('examples');
|
|
24
|
+
static state = 'beta';
|
|
25
|
+
baseCommand = 'project deploy pipeline';
|
|
26
|
+
isUndeployedOnly = true;
|
|
19
27
|
async run() {
|
|
20
28
|
return this.executeQuickPromotion();
|
|
21
29
|
}
|
|
@@ -37,9 +45,4 @@ class DeployPipelineQuick extends abstractQuick_1.default {
|
|
|
37
45
|
return { undeployedOnly: this.isUndeployedOnly };
|
|
38
46
|
}
|
|
39
47
|
}
|
|
40
|
-
DeployPipelineQuick.description = messages.getMessage('description');
|
|
41
|
-
DeployPipelineQuick.summary = messages.getMessage('summary');
|
|
42
|
-
DeployPipelineQuick.examples = messages.getMessages('examples');
|
|
43
|
-
DeployPipelineQuick.state = 'beta';
|
|
44
|
-
exports.default = DeployPipelineQuick;
|
|
45
48
|
//# sourceMappingURL=quick.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/quick.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/quick.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,qBAAqB,MAAM,0CAA0C,CAAC;AAI7E,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,+BAA+B,CAAC,CAAC;AAE5G,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,qBAAuC;IAC/E,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,GAAG,MAAM,CAAC;IAE5B,WAAW,GAAG,yBAAyB,CAAC;IACjC,gBAAgB,GAAG,IAAI,CAAC;IAElC,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,qBAAqB,EAAE,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACO,gBAAgB;QACxB,2DAA2D;QAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,6BAAuD,CAAC;QACjG,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACnD,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { PromotePipelineResult } from '../../../../common';
|
|
3
|
-
import { ReportOnPromoteCommand } from '../../../../common/base/abstractReportOnPromote';
|
|
2
|
+
import type { PromotePipelineResult } from '../../../../common/index.js';
|
|
3
|
+
import { ReportOnPromoteCommand } from '../../../../common/base/abstractReportOnPromote.js';
|
|
4
4
|
export default class DeployPipelineReport extends ReportOnPromoteCommand<typeof SfCommand> {
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly summary: string;
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static readonly state = "beta";
|
|
9
9
|
static flags: {
|
|
10
|
-
'job-id': import("@oclif/core/
|
|
11
|
-
'use-most-recent': import("@oclif/core/
|
|
10
|
+
'job-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'use-most-recent': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
12
12
|
};
|
|
13
13
|
protected operationName: string;
|
|
14
14
|
run(): Promise<PromotePipelineResult>;
|