@salesforce/plugin-deploy-retrieve 1.20.3 → 2.0.1
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 +66 -64
- package/lib/commands/deploy.d.ts +1 -1
- package/lib/commands/deploy.js +48 -51
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/project/convert/mdapi.d.ts +8 -8
- package/lib/commands/project/convert/mdapi.js +63 -63
- package/lib/commands/project/convert/mdapi.js.map +1 -1
- package/lib/commands/project/convert/source.d.ts +16 -40
- package/lib/commands/project/convert/source.js +71 -72
- package/lib/commands/project/convert/source.js.map +1 -1
- package/lib/commands/project/delete/source.d.ts +9 -61
- package/lib/commands/project/delete/source.js +182 -180
- package/lib/commands/project/delete/source.js.map +1 -1
- package/lib/commands/project/delete/tracking.d.ts +4 -4
- package/lib/commands/project/delete/tracking.js +27 -29
- package/lib/commands/project/delete/tracking.js.map +1 -1
- package/lib/commands/project/deploy/cancel.d.ts +5 -5
- package/lib/commands/project/deploy/cancel.js +58 -59
- package/lib/commands/project/deploy/cancel.js.map +1 -1
- package/lib/commands/project/deploy/preview.d.ts +6 -6
- package/lib/commands/project/deploy/preview.js +57 -58
- package/lib/commands/project/deploy/preview.js.map +1 -1
- package/lib/commands/project/deploy/quick.d.ts +9 -9
- package/lib/commands/project/deploy/quick.js +85 -86
- package/lib/commands/project/deploy/quick.js.map +1 -1
- package/lib/commands/project/deploy/report.d.ts +8 -60
- package/lib/commands/project/deploy/report.js +72 -73
- package/lib/commands/project/deploy/report.js.map +1 -1
- package/lib/commands/project/deploy/resume.d.ts +9 -61
- package/lib/commands/project/deploy/resume.js +82 -83
- package/lib/commands/project/deploy/resume.js.map +1 -1
- package/lib/commands/project/deploy/start.d.ts +24 -128
- package/lib/commands/project/deploy/start.js +168 -169
- package/lib/commands/project/deploy/start.js.map +1 -1
- package/lib/commands/project/deploy/validate.d.ts +21 -125
- package/lib/commands/project/deploy/validate.js +149 -149
- package/lib/commands/project/deploy/validate.js.map +1 -1
- package/lib/commands/project/generate/manifest.d.ts +9 -9
- package/lib/commands/project/generate/manifest.js +73 -78
- package/lib/commands/project/generate/manifest.js.map +1 -1
- package/lib/commands/project/list/ignored.d.ts +1 -1
- package/lib/commands/project/list/ignored.js +27 -29
- package/lib/commands/project/list/ignored.js.map +1 -1
- package/lib/commands/project/reset/tracking.d.ts +5 -5
- package/lib/commands/project/reset/tracking.js +33 -35
- package/lib/commands/project/reset/tracking.js.map +1 -1
- package/lib/commands/project/retrieve/preview.d.ts +3 -3
- package/lib/commands/project/retrieve/preview.js +35 -36
- package/lib/commands/project/retrieve/preview.js.map +1 -1
- package/lib/commands/project/retrieve/start.d.ts +11 -11
- package/lib/commands/project/retrieve/start.js +148 -149
- package/lib/commands/project/retrieve/start.js.map +1 -1
- package/lib/configMeta.js +8 -9
- package/lib/configMeta.js.map +1 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.d.ts +1 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.js +12 -12
- package/lib/formatters/asyncDeployCancelResultFormatter.js.map +1 -1
- package/lib/formatters/asyncDeployResultFormatter.d.ts +1 -1
- package/lib/formatters/asyncDeployResultFormatter.js +14 -14
- package/lib/formatters/asyncDeployResultFormatter.js.map +1 -1
- package/lib/formatters/deleteResultFormatter.d.ts +2 -2
- package/lib/formatters/deleteResultFormatter.js +21 -23
- package/lib/formatters/deleteResultFormatter.js.map +1 -1
- package/lib/formatters/deployCancelResultFormatter.d.ts +1 -1
- package/lib/formatters/deployCancelResultFormatter.js +7 -10
- package/lib/formatters/deployCancelResultFormatter.js.map +1 -1
- package/lib/formatters/deployReportResultFormatter.d.ts +1 -1
- package/lib/formatters/deployReportResultFormatter.js +18 -22
- package/lib/formatters/deployReportResultFormatter.js.map +1 -1
- package/lib/formatters/deployResultFormatter.d.ts +2 -2
- package/lib/formatters/deployResultFormatter.js +53 -50
- package/lib/formatters/deployResultFormatter.js.map +1 -1
- package/lib/formatters/metadataConvertResultFormatter.d.ts +1 -1
- package/lib/formatters/metadataConvertResultFormatter.js +7 -9
- package/lib/formatters/metadataConvertResultFormatter.js.map +1 -1
- package/lib/formatters/metadataRetrieveResultFormatter.d.ts +1 -1
- package/lib/formatters/metadataRetrieveResultFormatter.js +17 -16
- package/lib/formatters/metadataRetrieveResultFormatter.js.map +1 -1
- package/lib/formatters/retrieveResultFormatter.d.ts +1 -1
- package/lib/formatters/retrieveResultFormatter.js +17 -17
- package/lib/formatters/retrieveResultFormatter.js.map +1 -1
- package/lib/formatters/sourceConvertResultFormatter.d.ts +1 -1
- package/lib/formatters/sourceConvertResultFormatter.js +12 -14
- package/lib/formatters/sourceConvertResultFormatter.js.map +1 -1
- package/lib/formatters/testResultsFormatter.d.ts +1 -1
- package/lib/formatters/testResultsFormatter.js +38 -38
- package/lib/formatters/testResultsFormatter.js.map +1 -1
- package/lib/hooks/deploy.d.ts +1 -1
- package/lib/hooks/deploy.js +5 -7
- package/lib/hooks/deploy.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/utils/conflicts.js +3 -7
- package/lib/utils/conflicts.js.map +1 -1
- package/lib/utils/coverage.js +20 -30
- package/lib/utils/coverage.js.map +1 -1
- package/lib/utils/deploy.d.ts +1 -1
- package/lib/utils/deploy.js +55 -64
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/deployCache.d.ts +1 -1
- package/lib/utils/deployCache.js +12 -16
- package/lib/utils/deployCache.js.map +1 -1
- package/lib/utils/errorCodes.js +15 -16
- package/lib/utils/errorCodes.js.map +1 -1
- package/lib/utils/flags.d.ts +25 -7
- package/lib/utils/flags.js +24 -27
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/manifestCache.js +9 -14
- package/lib/utils/manifestCache.js.map +1 -1
- package/lib/utils/metadataDeployer.d.ts +1 -1
- package/lib/utils/metadataDeployer.js +40 -39
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.js +13 -22
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.js +46 -52
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/progressBar.js +19 -21
- package/lib/utils/progressBar.js.map +1 -1
- package/lib/utils/project.js +7 -13
- package/lib/utils/project.js.map +1 -1
- package/lib/utils/promiseQueue.js +3 -7
- package/lib/utils/promiseQueue.js.map +1 -1
- package/lib/utils/types.js +12 -19
- package/lib/utils/types.js.map +1 -1
- package/oclif.lock +8667 -0
- package/oclif.manifest.json +1442 -942
- package/package.json +37 -35
- package/schemas/project-retrieve-start.json +14 -11
|
@@ -1,58 +1,114 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
import { Messages, Org } from '@salesforce/core';
|
|
11
|
+
import { SfCommand, toHelpSection, Flags } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import { MetadataApiDeploy, RequestStatus } from '@salesforce/source-deploy-retrieve';
|
|
13
|
+
import { Duration } from '@salesforce/kit';
|
|
14
|
+
import { determineExitCode, resolveApi } from '../../../utils/deploy.js';
|
|
15
|
+
import { DeployCache } from '../../../utils/deployCache.js';
|
|
16
|
+
import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js';
|
|
17
|
+
import { AsyncDeployResultFormatter } from '../../../formatters/asyncDeployResultFormatter.js';
|
|
18
|
+
import { DeployResultFormatter } from '../../../formatters/deployResultFormatter.js';
|
|
19
|
+
import { API } from '../../../utils/types.js';
|
|
20
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
21
|
+
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.quick');
|
|
22
|
+
export default class DeployMetadataQuick extends SfCommand {
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static summary = messages.getMessage('summary');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static aliases = ['deploy:metadata:quick'];
|
|
27
|
+
static deprecateAliases = true;
|
|
28
|
+
static flags = {
|
|
29
|
+
async: Flags.boolean({
|
|
30
|
+
summary: messages.getMessage('flags.async.summary'),
|
|
31
|
+
description: messages.getMessage('flags.async.description'),
|
|
32
|
+
exclusive: ['wait'],
|
|
33
|
+
}),
|
|
34
|
+
concise: Flags.boolean({
|
|
35
|
+
summary: messages.getMessage('flags.concise.summary'),
|
|
36
|
+
exclusive: ['verbose'],
|
|
37
|
+
}),
|
|
38
|
+
'job-id': Flags.salesforceId({
|
|
39
|
+
char: 'i',
|
|
40
|
+
startsWith: '0Af',
|
|
41
|
+
length: 'both',
|
|
42
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
43
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
44
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
45
|
+
}),
|
|
46
|
+
'target-org': Flags.optionalOrg({
|
|
47
|
+
char: 'o',
|
|
48
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
49
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
50
|
+
}),
|
|
51
|
+
'use-most-recent': Flags.boolean({
|
|
52
|
+
char: 'r',
|
|
53
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
54
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
55
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
56
|
+
}),
|
|
57
|
+
verbose: Flags.boolean({
|
|
58
|
+
summary: messages.getMessage('flags.verbose.summary'),
|
|
59
|
+
exclusive: ['concise'],
|
|
60
|
+
}),
|
|
61
|
+
wait: Flags.duration({
|
|
62
|
+
char: 'w',
|
|
63
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
64
|
+
description: messages.getMessage('flags.wait.description'),
|
|
65
|
+
unit: 'minutes',
|
|
66
|
+
defaultValue: 33,
|
|
67
|
+
default: Duration.minutes(33),
|
|
68
|
+
helpValue: '<minutes>',
|
|
69
|
+
min: 1,
|
|
70
|
+
exclusive: ['async'],
|
|
71
|
+
}),
|
|
72
|
+
'api-version': Flags.orgApiVersion({
|
|
73
|
+
char: 'a',
|
|
74
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
75
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
76
|
+
}),
|
|
77
|
+
};
|
|
78
|
+
static errorCodes = toHelpSection('ERROR CODES', DEPLOY_STATUS_CODES_DESCRIPTIONS);
|
|
23
79
|
async run() {
|
|
24
|
-
const [{ flags }, cache] = await Promise.all([this.parse(DeployMetadataQuick),
|
|
80
|
+
const [{ flags }, cache] = await Promise.all([this.parse(DeployMetadataQuick), DeployCache.create()]);
|
|
25
81
|
// This is the ID of the validation request
|
|
26
82
|
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id'], false);
|
|
27
83
|
const deployOpts = cache.get(jobId) ?? {};
|
|
28
|
-
const org = flags['target-org'] ?? (await
|
|
29
|
-
const api = await
|
|
30
|
-
const mdapiDeploy = new
|
|
84
|
+
const org = flags['target-org'] ?? (await Org.create({ aliasOrUsername: deployOpts['target-org'] }));
|
|
85
|
+
const api = await resolveApi(this.configAggregator);
|
|
86
|
+
const mdapiDeploy = new MetadataApiDeploy({
|
|
31
87
|
usernameOrConnection: org.getConnection(flags['api-version']),
|
|
32
88
|
id: jobId,
|
|
33
89
|
apiOptions: {
|
|
34
|
-
rest: api ===
|
|
90
|
+
rest: api === API['REST'],
|
|
35
91
|
},
|
|
36
92
|
});
|
|
37
93
|
// This is the ID of the deploy (of the validated metadata)
|
|
38
|
-
const deployId = await mdapiDeploy.deployRecentValidation(api ===
|
|
39
|
-
this.log(`Deploy ID: ${
|
|
94
|
+
const deployId = await mdapiDeploy.deployRecentValidation(api === API['REST']);
|
|
95
|
+
this.log(`Deploy ID: ${chalk.bold(deployId)}`);
|
|
40
96
|
if (flags.async) {
|
|
41
|
-
const asyncFormatter = new
|
|
97
|
+
const asyncFormatter = new AsyncDeployResultFormatter(deployId, this.config.bin);
|
|
42
98
|
if (!this.jsonEnabled())
|
|
43
99
|
asyncFormatter.display();
|
|
44
100
|
return asyncFormatter.getJson();
|
|
45
101
|
}
|
|
46
102
|
const result = await mdapiDeploy.pollStatus({
|
|
47
|
-
frequency:
|
|
103
|
+
frequency: Duration.seconds(1),
|
|
48
104
|
timeout: flags.wait,
|
|
49
105
|
});
|
|
50
|
-
const formatter = new
|
|
106
|
+
const formatter = new DeployResultFormatter(result, flags);
|
|
51
107
|
if (!this.jsonEnabled())
|
|
52
108
|
formatter.display();
|
|
53
|
-
await
|
|
54
|
-
process.exitCode =
|
|
55
|
-
if (result.response.status ===
|
|
109
|
+
await DeployCache.update(deployId, { status: result.response.status });
|
|
110
|
+
process.exitCode = determineExitCode(result);
|
|
111
|
+
if (result.response.status === RequestStatus.Succeeded) {
|
|
56
112
|
this.log();
|
|
57
113
|
this.logSuccess(messages.getMessage('info.QuickDeploySuccess', [deployId]));
|
|
58
114
|
}
|
|
@@ -74,61 +130,4 @@ class DeployMetadataQuick extends sf_plugins_core_1.SfCommand {
|
|
|
74
130
|
return super.catch(error);
|
|
75
131
|
}
|
|
76
132
|
}
|
|
77
|
-
DeployMetadataQuick.description = messages.getMessage('description');
|
|
78
|
-
DeployMetadataQuick.summary = messages.getMessage('summary');
|
|
79
|
-
DeployMetadataQuick.examples = messages.getMessages('examples');
|
|
80
|
-
DeployMetadataQuick.aliases = ['deploy:metadata:quick'];
|
|
81
|
-
DeployMetadataQuick.deprecateAliases = true;
|
|
82
|
-
DeployMetadataQuick.flags = {
|
|
83
|
-
async: sf_plugins_core_1.Flags.boolean({
|
|
84
|
-
summary: messages.getMessage('flags.async.summary'),
|
|
85
|
-
description: messages.getMessage('flags.async.description'),
|
|
86
|
-
exclusive: ['wait'],
|
|
87
|
-
}),
|
|
88
|
-
concise: sf_plugins_core_1.Flags.boolean({
|
|
89
|
-
summary: messages.getMessage('flags.concise.summary'),
|
|
90
|
-
exclusive: ['verbose'],
|
|
91
|
-
}),
|
|
92
|
-
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
93
|
-
char: 'i',
|
|
94
|
-
startsWith: '0Af',
|
|
95
|
-
length: 'both',
|
|
96
|
-
description: messages.getMessage('flags.job-id.description'),
|
|
97
|
-
summary: messages.getMessage('flags.job-id.summary'),
|
|
98
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
99
|
-
}),
|
|
100
|
-
'target-org': sf_plugins_core_1.Flags.optionalOrg({
|
|
101
|
-
char: 'o',
|
|
102
|
-
description: messages.getMessage('flags.target-org.description'),
|
|
103
|
-
summary: messages.getMessage('flags.target-org.summary'),
|
|
104
|
-
}),
|
|
105
|
-
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
106
|
-
char: 'r',
|
|
107
|
-
description: messages.getMessage('flags.use-most-recent.description'),
|
|
108
|
-
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
109
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
110
|
-
}),
|
|
111
|
-
verbose: sf_plugins_core_1.Flags.boolean({
|
|
112
|
-
summary: messages.getMessage('flags.verbose.summary'),
|
|
113
|
-
exclusive: ['concise'],
|
|
114
|
-
}),
|
|
115
|
-
wait: sf_plugins_core_1.Flags.duration({
|
|
116
|
-
char: 'w',
|
|
117
|
-
summary: messages.getMessage('flags.wait.summary'),
|
|
118
|
-
description: messages.getMessage('flags.wait.description'),
|
|
119
|
-
unit: 'minutes',
|
|
120
|
-
defaultValue: 33,
|
|
121
|
-
default: kit_1.Duration.minutes(33),
|
|
122
|
-
helpValue: '<minutes>',
|
|
123
|
-
min: 1,
|
|
124
|
-
exclusive: ['async'],
|
|
125
|
-
}),
|
|
126
|
-
'api-version': sf_plugins_core_1.Flags.orgApiVersion({
|
|
127
|
-
char: 'a',
|
|
128
|
-
summary: messages.getMessage('flags.api-version.summary'),
|
|
129
|
-
description: messages.getMessage('flags.api-version.description'),
|
|
130
|
-
}),
|
|
131
|
-
};
|
|
132
|
-
DeployMetadataQuick.errorCodes = (0, sf_plugins_core_1.toHelpSection)('ERROR CODES', errorCodes_1.DEPLOY_STATUS_CODES_DESCRIPTIONS);
|
|
133
|
-
exports.default = DeployMetadataQuick;
|
|
134
133
|
//# sourceMappingURL=quick.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../src/commands/project/deploy/quick.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../src/commands/project/deploy/quick.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAiB,iBAAiB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC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AC,0BAA0B,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SAC/F;QAED,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,KAAsB;QACpC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YAC3C,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;YAC5D,OAAO,KAAK,CAAC,KAAK,CAAC;gBACjB,GAAG,KAAK;gBACR,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,GAAG,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5F,CAAC,CAAC;SACJ;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Org } from '@salesforce/core';
|
|
2
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { DeployResultJson } from '../../../utils/types';
|
|
3
|
+
import { DeployResultJson } from '../../../utils/types.js';
|
|
4
4
|
export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
|
|
5
5
|
static readonly description: string;
|
|
6
6
|
static readonly summary: string;
|
|
@@ -8,65 +8,13 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
|
|
|
8
8
|
static readonly aliases: string[];
|
|
9
9
|
static readonly deprecateAliases = true;
|
|
10
10
|
static readonly flags: {
|
|
11
|
-
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<Org
|
|
12
|
-
'job-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
-
'use-most-recent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
'coverage-formatters':
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
summary?: string | undefined;
|
|
19
|
-
description?: string | undefined;
|
|
20
|
-
helpLabel?: string | undefined;
|
|
21
|
-
env?: string | undefined;
|
|
22
|
-
hidden?: boolean | undefined;
|
|
23
|
-
required?: boolean | undefined;
|
|
24
|
-
dependsOn?: string[] | undefined;
|
|
25
|
-
exclusive?: string[] | undefined;
|
|
26
|
-
exactlyOne?: string[] | undefined;
|
|
27
|
-
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[] | undefined;
|
|
28
|
-
deprecated?: true | import("@oclif/core/lib/interfaces").Deprecation | undefined;
|
|
29
|
-
aliases?: string[] | undefined;
|
|
30
|
-
deprecateAliases?: boolean | undefined;
|
|
31
|
-
delimiter?: "," | undefined;
|
|
32
|
-
type: "option";
|
|
33
|
-
helpValue?: string | undefined;
|
|
34
|
-
options?: string[] | undefined;
|
|
35
|
-
multiple: false;
|
|
36
|
-
parse: import("@oclif/core/lib/interfaces/parser").FlagParser<string[] | undefined, string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
37
|
-
defaultHelp?: import("@oclif/core/lib/interfaces/parser").FlagDefaultHelp<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
38
|
-
input: string[];
|
|
39
|
-
default?: import("@oclif/core/lib/interfaces/parser").FlagDefault<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
40
|
-
} | {
|
|
41
|
-
helpGroup: string;
|
|
42
|
-
name: string;
|
|
43
|
-
char?: import("@oclif/core/lib/interfaces").AlphabetLowercase | import("@oclif/core/lib/interfaces").AlphabetUppercase | undefined;
|
|
44
|
-
summary?: string | undefined;
|
|
45
|
-
description?: string | undefined;
|
|
46
|
-
helpLabel?: string | undefined;
|
|
47
|
-
env?: string | undefined;
|
|
48
|
-
hidden?: boolean | undefined;
|
|
49
|
-
required?: boolean | undefined;
|
|
50
|
-
dependsOn?: string[] | undefined;
|
|
51
|
-
exclusive?: string[] | undefined;
|
|
52
|
-
exactlyOne?: string[] | undefined;
|
|
53
|
-
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[] | undefined;
|
|
54
|
-
deprecated?: true | import("@oclif/core/lib/interfaces").Deprecation | undefined;
|
|
55
|
-
aliases?: string[] | undefined;
|
|
56
|
-
deprecateAliases?: boolean | undefined;
|
|
57
|
-
delimiter?: "," | undefined;
|
|
58
|
-
type: "option";
|
|
59
|
-
helpValue?: string | undefined;
|
|
60
|
-
options?: string[] | undefined;
|
|
61
|
-
multiple: true;
|
|
62
|
-
parse: import("@oclif/core/lib/interfaces/parser").FlagParser<string[] | undefined, string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
63
|
-
defaultHelp?: import("@oclif/core/lib/interfaces/parser").FlagDefaultHelp<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
64
|
-
input: string[];
|
|
65
|
-
default?: import("@oclif/core/lib/interfaces/parser").FlagDefault<(string[] | undefined)[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
66
|
-
};
|
|
67
|
-
junit: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
68
|
-
'results-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
69
|
-
wait: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/kit").Duration | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
'target-org': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<Org, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
12
|
+
'job-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
13
|
+
'use-most-recent': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
14
|
+
'coverage-formatters': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
15
|
+
junit: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
16
|
+
'results-dir': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
17
|
+
wait: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<import("@salesforce/kit").Duration, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
70
18
|
};
|
|
71
19
|
run(): Promise<DeployResultJson>;
|
|
72
20
|
}
|
|
@@ -1,63 +1,109 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
3
|
* All rights reserved.
|
|
5
4
|
* Licensed under the BSD 3-Clause license.
|
|
6
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { Messages, Org, SfProject } from '@salesforce/core';
|
|
10
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
11
|
+
import { ComponentSet, DeployResult, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
|
|
12
|
+
import { buildComponentSet } from '../../../utils/deploy.js';
|
|
13
|
+
import { DeployProgress } from '../../../utils/progressBar.js';
|
|
14
|
+
import { DeployCache } from '../../../utils/deployCache.js';
|
|
15
|
+
import { DeployReportResultFormatter } from '../../../formatters/deployReportResultFormatter.js';
|
|
16
|
+
import { API } from '../../../utils/types.js';
|
|
17
|
+
import { coverageFormattersFlag } from '../../../utils/flags.js';
|
|
18
|
+
Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
|
|
19
|
+
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.report');
|
|
20
|
+
const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata');
|
|
21
21
|
const testFlags = 'Test';
|
|
22
|
-
class DeployMetadataReport extends
|
|
22
|
+
export default class DeployMetadataReport extends SfCommand {
|
|
23
|
+
static description = messages.getMessage('description');
|
|
24
|
+
static summary = messages.getMessage('summary');
|
|
25
|
+
static examples = messages.getMessages('examples');
|
|
26
|
+
static aliases = ['deploy:metadata:report'];
|
|
27
|
+
static deprecateAliases = true;
|
|
28
|
+
static flags = {
|
|
29
|
+
'target-org': Flags.optionalOrg({
|
|
30
|
+
char: 'o',
|
|
31
|
+
description: deployMessages.getMessage('flags.target-org.description'),
|
|
32
|
+
summary: deployMessages.getMessage('flags.target-org.summary'),
|
|
33
|
+
}),
|
|
34
|
+
'job-id': Flags.salesforceId({
|
|
35
|
+
char: 'i',
|
|
36
|
+
startsWith: '0Af',
|
|
37
|
+
length: 'both',
|
|
38
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
39
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
40
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
41
|
+
}),
|
|
42
|
+
'use-most-recent': Flags.boolean({
|
|
43
|
+
char: 'r',
|
|
44
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
45
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
46
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
47
|
+
}),
|
|
48
|
+
'coverage-formatters': coverageFormattersFlag({ helpGroup: testFlags }),
|
|
49
|
+
junit: Flags.boolean({
|
|
50
|
+
summary: messages.getMessage('flags.junit.summary'),
|
|
51
|
+
helpGroup: testFlags,
|
|
52
|
+
}),
|
|
53
|
+
'results-dir': Flags.directory({
|
|
54
|
+
relationships: [{ type: 'some', flags: ['coverage-formatters', 'junit'] }],
|
|
55
|
+
summary: messages.getMessage('flags.results-dir.summary'),
|
|
56
|
+
helpGroup: testFlags,
|
|
57
|
+
}),
|
|
58
|
+
// we want to allow undefined for a simple check deploy status
|
|
59
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default
|
|
60
|
+
wait: Flags.duration({
|
|
61
|
+
char: 'w',
|
|
62
|
+
summary: deployMessages.getMessage('flags.wait.summary'),
|
|
63
|
+
description: deployMessages.getMessage('flags.wait.description'),
|
|
64
|
+
unit: 'minutes',
|
|
65
|
+
helpValue: '<minutes>',
|
|
66
|
+
min: 1,
|
|
67
|
+
}),
|
|
68
|
+
};
|
|
23
69
|
async run() {
|
|
24
|
-
const [{ flags }, cache] = await Promise.all([this.parse(DeployMetadataReport),
|
|
70
|
+
const [{ flags }, cache] = await Promise.all([this.parse(DeployMetadataReport), DeployCache.create()]);
|
|
25
71
|
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id'], false);
|
|
26
72
|
const deployOpts = cache.get(jobId) ?? {};
|
|
27
73
|
const wait = flags['wait'];
|
|
28
|
-
const org = flags['target-org'] ?? (await
|
|
74
|
+
const org = flags['target-org'] ?? (await Org.create({ aliasOrUsername: deployOpts['target-org'] }));
|
|
29
75
|
// if we're using mdapi we won't have a component set
|
|
30
|
-
let componentSet = new
|
|
76
|
+
let componentSet = new ComponentSet();
|
|
31
77
|
if (!deployOpts.isMdapi) {
|
|
32
78
|
if (!cache.get(jobId)) {
|
|
33
79
|
// If the cache file isn't there, use the project package directories for the CompSet
|
|
34
80
|
try {
|
|
35
|
-
this.project = await
|
|
81
|
+
this.project = await SfProject.resolve();
|
|
36
82
|
const sourcepath = this.project.getUniquePackageDirectories().map((pDir) => pDir.fullPath);
|
|
37
|
-
componentSet = await
|
|
83
|
+
componentSet = await buildComponentSet({ 'source-dir': sourcepath, wait });
|
|
38
84
|
}
|
|
39
85
|
catch (err) {
|
|
40
86
|
// ignore the error. this was just to get improved command output.
|
|
41
87
|
}
|
|
42
88
|
}
|
|
43
89
|
else {
|
|
44
|
-
componentSet = await
|
|
90
|
+
componentSet = await buildComponentSet({ ...deployOpts, wait });
|
|
45
91
|
}
|
|
46
92
|
}
|
|
47
|
-
const mdapiDeploy = new
|
|
93
|
+
const mdapiDeploy = new MetadataApiDeploy({
|
|
48
94
|
// setting an API version here won't matter since we're just checking deploy status
|
|
49
95
|
// eslint-disable-next-line sf-plugin/get-connection-with-version
|
|
50
96
|
usernameOrConnection: org.getConnection(),
|
|
51
97
|
id: jobId,
|
|
52
98
|
components: componentSet,
|
|
53
99
|
apiOptions: {
|
|
54
|
-
rest: deployOpts.api ===
|
|
100
|
+
rest: deployOpts.api === API['REST'],
|
|
55
101
|
},
|
|
56
102
|
});
|
|
57
103
|
const getDeployResult = async () => {
|
|
58
104
|
try {
|
|
59
105
|
const deployStatus = await mdapiDeploy.checkStatus();
|
|
60
|
-
return new
|
|
106
|
+
return new DeployResult(deployStatus, componentSet);
|
|
61
107
|
}
|
|
62
108
|
catch (error) {
|
|
63
109
|
if (error instanceof Error && error.name === 'sf:INVALID_CROSS_REFERENCE_KEY') {
|
|
@@ -70,7 +116,7 @@ class DeployMetadataReport extends sf_plugins_core_1.SfCommand {
|
|
|
70
116
|
if (wait) {
|
|
71
117
|
// poll for deploy results
|
|
72
118
|
try {
|
|
73
|
-
new
|
|
119
|
+
new DeployProgress(mdapiDeploy, this.jsonEnabled()).start();
|
|
74
120
|
result = await mdapiDeploy.pollStatus(500, wait.seconds);
|
|
75
121
|
}
|
|
76
122
|
catch (error) {
|
|
@@ -89,7 +135,7 @@ class DeployMetadataReport extends sf_plugins_core_1.SfCommand {
|
|
|
89
135
|
// check the deploy status
|
|
90
136
|
result = await getDeployResult();
|
|
91
137
|
}
|
|
92
|
-
const formatter = new
|
|
138
|
+
const formatter = new DeployReportResultFormatter(result, {
|
|
93
139
|
...deployOpts,
|
|
94
140
|
...flags,
|
|
95
141
|
...{ 'target-org': org },
|
|
@@ -99,51 +145,4 @@ class DeployMetadataReport extends sf_plugins_core_1.SfCommand {
|
|
|
99
145
|
return formatter.getJson();
|
|
100
146
|
}
|
|
101
147
|
}
|
|
102
|
-
DeployMetadataReport.description = messages.getMessage('description');
|
|
103
|
-
DeployMetadataReport.summary = messages.getMessage('summary');
|
|
104
|
-
DeployMetadataReport.examples = messages.getMessages('examples');
|
|
105
|
-
DeployMetadataReport.aliases = ['deploy:metadata:report'];
|
|
106
|
-
DeployMetadataReport.deprecateAliases = true;
|
|
107
|
-
DeployMetadataReport.flags = {
|
|
108
|
-
'target-org': sf_plugins_core_1.Flags.optionalOrg({
|
|
109
|
-
char: 'o',
|
|
110
|
-
description: deployMessages.getMessage('flags.target-org.description'),
|
|
111
|
-
summary: deployMessages.getMessage('flags.target-org.summary'),
|
|
112
|
-
}),
|
|
113
|
-
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
114
|
-
char: 'i',
|
|
115
|
-
startsWith: '0Af',
|
|
116
|
-
length: 'both',
|
|
117
|
-
description: messages.getMessage('flags.job-id.description'),
|
|
118
|
-
summary: messages.getMessage('flags.job-id.summary'),
|
|
119
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
120
|
-
}),
|
|
121
|
-
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
122
|
-
char: 'r',
|
|
123
|
-
description: messages.getMessage('flags.use-most-recent.description'),
|
|
124
|
-
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
125
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
126
|
-
}),
|
|
127
|
-
'coverage-formatters': { ...flags_1.coverageFormattersFlag, helpGroup: testFlags },
|
|
128
|
-
junit: sf_plugins_core_1.Flags.boolean({
|
|
129
|
-
summary: messages.getMessage('flags.junit.summary'),
|
|
130
|
-
helpGroup: testFlags,
|
|
131
|
-
}),
|
|
132
|
-
'results-dir': sf_plugins_core_1.Flags.directory({
|
|
133
|
-
relationships: [{ type: 'some', flags: ['coverage-formatters', 'junit'] }],
|
|
134
|
-
summary: messages.getMessage('flags.results-dir.summary'),
|
|
135
|
-
helpGroup: testFlags,
|
|
136
|
-
}),
|
|
137
|
-
// we want to allow undefined for a simple check deploy status
|
|
138
|
-
// eslint-disable-next-line sf-plugin/flag-min-max-default
|
|
139
|
-
wait: sf_plugins_core_1.Flags.duration({
|
|
140
|
-
char: 'w',
|
|
141
|
-
summary: deployMessages.getMessage('flags.wait.summary'),
|
|
142
|
-
description: deployMessages.getMessage('flags.wait.description'),
|
|
143
|
-
unit: 'minutes',
|
|
144
|
-
helpValue: '<minutes>',
|
|
145
|
-
min: 1,
|
|
146
|
-
}),
|
|
147
|
-
};
|
|
148
|
-
exports.default = DeployMetadataReport;
|
|
149
148
|
//# sourceMappingURL=report.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/commands/project/deploy/report.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/commands/project/deploy/report.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC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