@salesforce/plugin-deploy-retrieve 1.3.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +385 -7
- package/lib/commands/deploy/metadata/cancel.d.ts +18 -0
- package/lib/commands/deploy/metadata/cancel.js +86 -0
- package/lib/commands/deploy/metadata/cancel.js.map +1 -0
- package/lib/commands/deploy/metadata/quick.d.ts +23 -0
- package/lib/commands/deploy/metadata/quick.js +116 -0
- package/lib/commands/deploy/metadata/quick.js.map +1 -0
- package/lib/commands/deploy/metadata/report.d.ts +14 -0
- package/lib/commands/deploy/metadata/report.js +54 -0
- package/lib/commands/deploy/metadata/report.js.map +1 -0
- package/lib/commands/deploy/metadata/resume.d.ts +21 -0
- package/lib/commands/deploy/metadata/resume.js +89 -0
- package/lib/commands/deploy/metadata/resume.js.map +1 -0
- package/lib/commands/deploy/metadata/validate.d.ts +27 -0
- package/lib/commands/deploy/metadata/validate.js +136 -0
- package/lib/commands/deploy/metadata/validate.js.map +1 -0
- package/lib/commands/deploy/metadata.d.ts +7 -9
- package/lib/commands/deploy/metadata.js +40 -15
- package/lib/commands/deploy/metadata.js.map +1 -1
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/retrieve/metadata.d.ts +4 -6
- package/lib/commands/retrieve/metadata.js +11 -25
- package/lib/commands/retrieve/metadata.js.map +1 -1
- package/lib/configMeta.d.ts +17 -0
- package/lib/configMeta.js +31 -0
- package/lib/configMeta.js.map +1 -0
- package/lib/utils/deploy.d.ts +26 -7
- package/lib/utils/deploy.js +114 -24
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/errorCodes.d.ts +3 -0
- package/lib/utils/errorCodes.js +26 -0
- package/lib/utils/errorCodes.js.map +1 -0
- package/lib/utils/metadataDeployer.js +7 -4
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +65 -8
- package/lib/utils/output.js +320 -169
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/progressBar.js +2 -1
- package/lib/utils/progressBar.js.map +1 -1
- package/lib/utils/types.d.ts +11 -5
- package/lib/utils/types.js.map +1 -1
- package/messages/cache.md +7 -0
- package/messages/config.md +7 -0
- package/messages/deploy.async.md +19 -0
- package/messages/deploy.metadata.cancel.md +62 -0
- package/messages/deploy.metadata.md +17 -3
- package/messages/deploy.metadata.quick.md +81 -0
- package/messages/deploy.metadata.report.md +42 -0
- package/messages/deploy.metadata.resume.md +58 -0
- package/messages/deploy.metadata.validate.md +123 -0
- package/messages/errorCodes.md +27 -0
- package/oclif.manifest.json +1 -1
- package/package.json +16 -9
- package/schemas/deploy-metadata-cancel.json +664 -0
- package/schemas/deploy-metadata-quick.json +664 -0
- package/schemas/deploy-metadata-report.json +664 -0
- package/schemas/deploy-metadata-resume.json +664 -0
- package/schemas/deploy-metadata-validate.json +664 -0
- package/schemas/deploy-metadata.json +592 -29
- package/schemas/hooks/sf-deploy.json +15 -5
- package/schemas/retrieve-metadata.json +178 -11
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const chalk_1 = require("chalk");
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
13
|
+
const deploy_1 = require("../../../utils/deploy");
|
|
14
|
+
const errorCodes_1 = require("../../../utils/errorCodes");
|
|
15
|
+
const output_1 = require("../../../utils/output");
|
|
16
|
+
const types_1 = require("../../../utils/types");
|
|
17
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.quick');
|
|
19
|
+
class DeployMetadataQuick extends sf_plugins_core_1.SfCommand {
|
|
20
|
+
async run() {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const { flags } = await this.parse(DeployMetadataQuick);
|
|
23
|
+
const cache = await deploy_1.DeployCache.create();
|
|
24
|
+
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id'], false);
|
|
25
|
+
const deployOpts = (_a = cache.get(jobId)) !== null && _a !== void 0 ? _a : {};
|
|
26
|
+
const org = (_b = flags['target-org']) !== null && _b !== void 0 ? _b : (await core_1.Org.create({ aliasOrUsername: deployOpts['target-org'] }));
|
|
27
|
+
const api = await (0, deploy_1.resolveApi)();
|
|
28
|
+
await org.getConnection().deployRecentValidation({ id: jobId, rest: api === types_1.API.REST });
|
|
29
|
+
const componentSet = await (0, deploy_1.buildComponentSet)({ ...deployOpts, wait: flags.wait });
|
|
30
|
+
this.log((0, output_1.getVersionMessage)('Deploying', componentSet, api));
|
|
31
|
+
this.log(`Deploy ID: ${(0, chalk_1.bold)(jobId)}`);
|
|
32
|
+
if (flags.async) {
|
|
33
|
+
const asyncFormatter = new output_1.AsyncDeployResultFormatter(jobId);
|
|
34
|
+
if (!this.jsonEnabled())
|
|
35
|
+
asyncFormatter.display();
|
|
36
|
+
return asyncFormatter.getJson();
|
|
37
|
+
}
|
|
38
|
+
const result = await (0, deploy_1.poll)(org, jobId, flags.wait, componentSet);
|
|
39
|
+
const formatter = new output_1.DeployResultFormatter(result, flags);
|
|
40
|
+
if (!this.jsonEnabled())
|
|
41
|
+
formatter.display();
|
|
42
|
+
if ((0, deploy_1.shouldRemoveFromCache)(result.response.status)) {
|
|
43
|
+
await deploy_1.DeployCache.unset(jobId);
|
|
44
|
+
}
|
|
45
|
+
this.setExitCode(result);
|
|
46
|
+
if (result.response.status === source_deploy_retrieve_1.RequestStatus.Succeeded) {
|
|
47
|
+
this.log();
|
|
48
|
+
this.logSuccess(messages.getMessage('info.QuickDeploySuccess', [jobId]));
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.log(messages.getMessage('error.QuickDeployFailure', [jobId, result.response.status]));
|
|
52
|
+
}
|
|
53
|
+
return formatter.getJson();
|
|
54
|
+
}
|
|
55
|
+
catch(error) {
|
|
56
|
+
if (error.name.includes('INVALID_ID_FIELD')) {
|
|
57
|
+
const err = messages.createError('error.CannotQuickDeploy');
|
|
58
|
+
return super.catch({ ...error, name: err.name, message: err.message, code: err.code });
|
|
59
|
+
}
|
|
60
|
+
return super.catch(error);
|
|
61
|
+
}
|
|
62
|
+
setExitCode(result) {
|
|
63
|
+
process.exitCode = (0, deploy_1.determineExitCode)(result);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = DeployMetadataQuick;
|
|
67
|
+
DeployMetadataQuick.description = messages.getMessage('description');
|
|
68
|
+
DeployMetadataQuick.summary = messages.getMessage('summary');
|
|
69
|
+
DeployMetadataQuick.examples = messages.getMessages('examples');
|
|
70
|
+
DeployMetadataQuick.requiresProject = true;
|
|
71
|
+
DeployMetadataQuick.state = 'beta';
|
|
72
|
+
DeployMetadataQuick.flags = {
|
|
73
|
+
async: sf_plugins_core_1.Flags.boolean({
|
|
74
|
+
summary: messages.getMessage('flags.async.summary'),
|
|
75
|
+
description: messages.getMessage('flags.async.description'),
|
|
76
|
+
exclusive: ['wait'],
|
|
77
|
+
}),
|
|
78
|
+
concise: sf_plugins_core_1.Flags.boolean({
|
|
79
|
+
summary: messages.getMessage('flags.concise.summary'),
|
|
80
|
+
exclusive: ['verbose'],
|
|
81
|
+
}),
|
|
82
|
+
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
83
|
+
char: 'i',
|
|
84
|
+
startsWith: '0Af',
|
|
85
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
86
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
87
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
88
|
+
}),
|
|
89
|
+
'target-org': sf_plugins_core_1.Flags.optionalOrg({
|
|
90
|
+
char: 'o',
|
|
91
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
92
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
93
|
+
}),
|
|
94
|
+
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
95
|
+
char: 'r',
|
|
96
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
97
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
98
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
99
|
+
}),
|
|
100
|
+
verbose: sf_plugins_core_1.Flags.boolean({
|
|
101
|
+
summary: messages.getMessage('flags.verbose.summary'),
|
|
102
|
+
exclusive: ['concise'],
|
|
103
|
+
}),
|
|
104
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
105
|
+
char: 'w',
|
|
106
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
107
|
+
description: messages.getMessage('flags.wait.description'),
|
|
108
|
+
unit: 'minutes',
|
|
109
|
+
defaultValue: 33,
|
|
110
|
+
helpValue: '<minutes>',
|
|
111
|
+
min: 1,
|
|
112
|
+
exclusive: ['async'],
|
|
113
|
+
}),
|
|
114
|
+
};
|
|
115
|
+
DeployMetadataQuick.errorCodes = (0, sf_plugins_core_1.toHelpSection)('ERROR CODES', errorCodes_1.DEPLOY_STATUS_CODES_DESCRIPTIONS);
|
|
116
|
+
//# sourceMappingURL=quick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick.js","sourceRoot":"","sources":["../../../../src/commands/deploy/metadata/quick.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,iCAA6B;AAC7B,2CAAiD;AACjD,iEAA8E;AAC9E,+EAAiF;AACjF,kDAQ+B;AAC/B,0DAA6E;AAC7E,kDAA6G;A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';
|
|
3
|
+
export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly requiresProject = true;
|
|
8
|
+
static readonly state = "beta";
|
|
9
|
+
static flags: {
|
|
10
|
+
'job-id': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
|
+
'use-most-recent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<DeployResultJson>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const core_1 = require("@salesforce/core");
|
|
10
|
+
const kit_1 = require("@salesforce/kit");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
13
|
+
const deploy_1 = require("../../../utils/deploy");
|
|
14
|
+
const output_1 = require("../../../utils/output");
|
|
15
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
16
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.report');
|
|
17
|
+
class DeployMetadataReport extends sf_plugins_core_1.SfCommand {
|
|
18
|
+
async run() {
|
|
19
|
+
const flags = (await this.parse(DeployMetadataReport)).flags;
|
|
20
|
+
const cache = await deploy_1.DeployCache.create();
|
|
21
|
+
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id']);
|
|
22
|
+
const deployOpts = cache.get(jobId);
|
|
23
|
+
const org = await core_1.Org.create({ aliasOrUsername: deployOpts['target-org'] });
|
|
24
|
+
const deployStatus = await org.getConnection().metadata.checkDeployStatus(jobId, true);
|
|
25
|
+
const componentSet = await (0, deploy_1.buildComponentSet)({ ...deployOpts, wait: kit_1.Duration.minutes(deployOpts.wait) });
|
|
26
|
+
const result = new source_deploy_retrieve_1.DeployResult(deployStatus, componentSet);
|
|
27
|
+
const formatter = new output_1.DeployReportResultFormatter(result, deployOpts);
|
|
28
|
+
if (!this.jsonEnabled())
|
|
29
|
+
formatter.display();
|
|
30
|
+
return formatter.getJson();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = DeployMetadataReport;
|
|
34
|
+
DeployMetadataReport.description = messages.getMessage('description');
|
|
35
|
+
DeployMetadataReport.summary = messages.getMessage('summary');
|
|
36
|
+
DeployMetadataReport.examples = messages.getMessages('examples');
|
|
37
|
+
DeployMetadataReport.requiresProject = true;
|
|
38
|
+
DeployMetadataReport.state = 'beta';
|
|
39
|
+
DeployMetadataReport.flags = {
|
|
40
|
+
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
41
|
+
char: 'i',
|
|
42
|
+
startsWith: '0Af',
|
|
43
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
44
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
45
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
46
|
+
}),
|
|
47
|
+
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
48
|
+
char: 'r',
|
|
49
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
50
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
51
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../../src/commands/deploy/metadata/report.ts"],"names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CAAC,WAAW,EAAE;YAAE,SAAS,CAAC,OAAO,EAAE,CAAC;QAE7C,OAAO,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;;AAxCH,uCAyCC;AAxCwB,gCAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,4BAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,6BAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC5C,oCAAe,GAAG,IAAI,CAAC;AACvB,0BAAK,GAAG,MAAM,CAAC;AAExB,0BAAK,GAAG;IACpB,QAAQ,EAAE,uBAAK,CAAC,YAAY,CAAC;QAC3B,IAAI,EAAE,GAAG;QACT,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QAC5D,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;IACF,iBAAiB,EAAE,uBAAK,CAAC,OAAO,CAAC;QAC/B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,mCAAmC,CAAC;QACrE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QAC7D,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Duration } from '@salesforce/kit';
|
|
3
|
+
import { DeployResultJson } from '../../../utils/types';
|
|
4
|
+
export default class DeployMetadataResume extends SfCommand<DeployResultJson> {
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly examples: string[];
|
|
8
|
+
static readonly requiresProject = true;
|
|
9
|
+
static readonly state = "beta";
|
|
10
|
+
static flags: {
|
|
11
|
+
concise: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
'job-id': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
13
|
+
'use-most-recent': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
wait: import("@oclif/core/lib/interfaces").OptionFlag<Duration>;
|
|
16
|
+
};
|
|
17
|
+
static envVariablesSection: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
18
|
+
static errorCodes: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
19
|
+
run(): Promise<DeployResultJson>;
|
|
20
|
+
private setExitCode;
|
|
21
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const chalk_1 = require("chalk");
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const kit_1 = require("@salesforce/kit");
|
|
13
|
+
const output_1 = require("../../../utils/output");
|
|
14
|
+
const progressBar_1 = require("../../../utils/progressBar");
|
|
15
|
+
const deploy_1 = require("../../../utils/deploy");
|
|
16
|
+
const errorCodes_1 = require("../../../utils/errorCodes");
|
|
17
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
18
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.resume');
|
|
19
|
+
class DeployMetadataResume extends sf_plugins_core_1.SfCommand {
|
|
20
|
+
async run() {
|
|
21
|
+
const { flags } = await this.parse(DeployMetadataResume);
|
|
22
|
+
const cache = await deploy_1.DeployCache.create();
|
|
23
|
+
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id']);
|
|
24
|
+
const deployOpts = cache.get(jobId);
|
|
25
|
+
const wait = flags.wait || kit_1.Duration.minutes(deployOpts.wait);
|
|
26
|
+
const { deploy, componentSet } = await (0, deploy_1.executeDeploy)({ ...deployOpts, wait, 'dry-run': false }, jobId);
|
|
27
|
+
this.log((0, output_1.getVersionMessage)('Resuming Deployment', componentSet, deployOpts.api));
|
|
28
|
+
this.log(`Deploy ID: ${(0, chalk_1.bold)(jobId)}`);
|
|
29
|
+
new progressBar_1.DeployProgress(deploy, this.jsonEnabled()).start();
|
|
30
|
+
const result = await deploy.pollStatus(500, wait.seconds);
|
|
31
|
+
this.setExitCode(result);
|
|
32
|
+
const formatter = new output_1.DeployResultFormatter(result, {
|
|
33
|
+
...flags,
|
|
34
|
+
verbose: deployOpts.verbose,
|
|
35
|
+
concise: deployOpts.concise,
|
|
36
|
+
});
|
|
37
|
+
if (!this.jsonEnabled())
|
|
38
|
+
formatter.display();
|
|
39
|
+
if ((0, deploy_1.shouldRemoveFromCache)(result.response.status)) {
|
|
40
|
+
cache.unset(deploy.id);
|
|
41
|
+
cache.unset(jobId);
|
|
42
|
+
await cache.write();
|
|
43
|
+
}
|
|
44
|
+
return formatter.getJson();
|
|
45
|
+
}
|
|
46
|
+
setExitCode(result) {
|
|
47
|
+
process.exitCode = (0, deploy_1.determineExitCode)(result);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = DeployMetadataResume;
|
|
51
|
+
DeployMetadataResume.description = messages.getMessage('description');
|
|
52
|
+
DeployMetadataResume.summary = messages.getMessage('summary');
|
|
53
|
+
DeployMetadataResume.examples = messages.getMessages('examples');
|
|
54
|
+
DeployMetadataResume.requiresProject = true;
|
|
55
|
+
DeployMetadataResume.state = 'beta';
|
|
56
|
+
DeployMetadataResume.flags = {
|
|
57
|
+
concise: sf_plugins_core_1.Flags.boolean({
|
|
58
|
+
summary: messages.getMessage('flags.concise.summary'),
|
|
59
|
+
exclusive: ['verbose'],
|
|
60
|
+
}),
|
|
61
|
+
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
62
|
+
char: 'i',
|
|
63
|
+
startsWith: '0Af',
|
|
64
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
65
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
66
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
67
|
+
}),
|
|
68
|
+
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
69
|
+
char: 'r',
|
|
70
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
71
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
72
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
73
|
+
}),
|
|
74
|
+
verbose: sf_plugins_core_1.Flags.boolean({
|
|
75
|
+
summary: messages.getMessage('flags.verbose.summary'),
|
|
76
|
+
exclusive: ['concise'],
|
|
77
|
+
}),
|
|
78
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
79
|
+
char: 'w',
|
|
80
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
81
|
+
description: messages.getMessage('flags.wait.description'),
|
|
82
|
+
unit: 'minutes',
|
|
83
|
+
helpValue: '<minutes>',
|
|
84
|
+
min: 1,
|
|
85
|
+
}),
|
|
86
|
+
};
|
|
87
|
+
DeployMetadataResume.envVariablesSection = (0, sf_plugins_core_1.toHelpSection)('ENVIRONMENT VARIABLES', core_1.EnvironmentVariable.SF_USE_PROGRESS_BAR);
|
|
88
|
+
DeployMetadataResume.errorCodes = (0, sf_plugins_core_1.toHelpSection)('ERROR CODES', errorCodes_1.DEPLOY_STATUS_CODES_DESCRIPTIONS);
|
|
89
|
+
//# sourceMappingURL=resume.js.map
|
|
@@ -0,0 +1 @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|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { DeployResultJson, TestLevel } from '../../../utils/types';
|
|
3
|
+
export default class DeployMetadataValidate extends SfCommand<DeployResultJson> {
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly summary: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly requiresProject = true;
|
|
8
|
+
static readonly state = "beta";
|
|
9
|
+
static flags: {
|
|
10
|
+
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
|
+
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
concise: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
manifest: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
14
|
+
metadata: import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
|
|
15
|
+
'source-dir': import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
|
|
16
|
+
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org>;
|
|
17
|
+
tests: import("@oclif/core/lib/interfaces").OptionFlag<string[]>;
|
|
18
|
+
'test-level': import("@oclif/core/lib/interfaces").OptionFlag<TestLevel>;
|
|
19
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
wait: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/kit").Duration>;
|
|
21
|
+
};
|
|
22
|
+
static configurationVariablesSection: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
23
|
+
static envVariablesSection: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
24
|
+
static errorCodes: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
25
|
+
run(): Promise<DeployResultJson>;
|
|
26
|
+
private setExitCode;
|
|
27
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
5
|
+
* All rights reserved.
|
|
6
|
+
* Licensed under the BSD 3-Clause license.
|
|
7
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
|
+
*/
|
|
9
|
+
const chalk_1 = require("chalk");
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
12
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
13
|
+
const output_1 = require("../../../utils/output");
|
|
14
|
+
const progressBar_1 = require("../../../utils/progressBar");
|
|
15
|
+
const types_1 = require("../../../utils/types");
|
|
16
|
+
const deploy_1 = require("../../../utils/deploy");
|
|
17
|
+
const errorCodes_1 = require("../../../utils/errorCodes");
|
|
18
|
+
const configMeta_1 = require("../../../configMeta");
|
|
19
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
20
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.validate');
|
|
21
|
+
class DeployMetadataValidate extends sf_plugins_core_1.SfCommand {
|
|
22
|
+
async run() {
|
|
23
|
+
const { flags } = await this.parse(DeployMetadataValidate);
|
|
24
|
+
const api = await (0, deploy_1.resolveApi)();
|
|
25
|
+
const { deploy, componentSet } = await (0, deploy_1.executeDeploy)({
|
|
26
|
+
...flags,
|
|
27
|
+
'dry-run': true,
|
|
28
|
+
'target-org': flags['target-org'].getUsername(),
|
|
29
|
+
api,
|
|
30
|
+
});
|
|
31
|
+
this.log((0, output_1.getVersionMessage)('Validating Deployment', componentSet, api));
|
|
32
|
+
this.log(`Deploy ID: ${(0, chalk_1.bold)(deploy.id)}`);
|
|
33
|
+
new progressBar_1.DeployProgress(deploy, this.jsonEnabled()).start();
|
|
34
|
+
if (flags.async) {
|
|
35
|
+
const asyncFormatter = new output_1.AsyncDeployResultFormatter(deploy.id);
|
|
36
|
+
if (!this.jsonEnabled())
|
|
37
|
+
asyncFormatter.display();
|
|
38
|
+
return asyncFormatter.getJson();
|
|
39
|
+
}
|
|
40
|
+
const result = await deploy.pollStatus(500, flags.wait.seconds);
|
|
41
|
+
this.setExitCode(result);
|
|
42
|
+
const formatter = new output_1.DeployResultFormatter(result, flags);
|
|
43
|
+
if (!this.jsonEnabled()) {
|
|
44
|
+
formatter.display();
|
|
45
|
+
}
|
|
46
|
+
if (result.response.status === source_deploy_retrieve_1.RequestStatus.Succeeded) {
|
|
47
|
+
this.log();
|
|
48
|
+
this.logSuccess(messages.getMessage('info.SuccessfulValidation', [deploy.id]));
|
|
49
|
+
const suggestedCommand = `${this.config.bin} deploy metadata quick --job-id ${deploy.id}`;
|
|
50
|
+
this.log(`\nRun ${(0, chalk_1.bold)(suggestedCommand)} to execute this deploy.`);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
throw messages.createError('error.FailedValidation', [deploy.id]);
|
|
54
|
+
}
|
|
55
|
+
return formatter.getJson();
|
|
56
|
+
}
|
|
57
|
+
setExitCode(result) {
|
|
58
|
+
process.exitCode = (0, deploy_1.determineExitCode)(result);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.default = DeployMetadataValidate;
|
|
62
|
+
DeployMetadataValidate.description = messages.getMessage('description');
|
|
63
|
+
DeployMetadataValidate.summary = messages.getMessage('summary');
|
|
64
|
+
DeployMetadataValidate.examples = messages.getMessages('examples');
|
|
65
|
+
DeployMetadataValidate.requiresProject = true;
|
|
66
|
+
DeployMetadataValidate.state = 'beta';
|
|
67
|
+
DeployMetadataValidate.flags = {
|
|
68
|
+
'api-version': sf_plugins_core_1.Flags.orgApiVersion({
|
|
69
|
+
char: 'a',
|
|
70
|
+
summary: messages.getMessage('flags.api-version.summary'),
|
|
71
|
+
description: messages.getMessage('flags.api-version.description'),
|
|
72
|
+
}),
|
|
73
|
+
async: sf_plugins_core_1.Flags.boolean({
|
|
74
|
+
summary: messages.getMessage('flags.async.summary'),
|
|
75
|
+
description: messages.getMessage('flags.async.description'),
|
|
76
|
+
}),
|
|
77
|
+
concise: sf_plugins_core_1.Flags.boolean({
|
|
78
|
+
summary: messages.getMessage('flags.concise.summary'),
|
|
79
|
+
exclusive: ['verbose'],
|
|
80
|
+
}),
|
|
81
|
+
manifest: sf_plugins_core_1.Flags.file({
|
|
82
|
+
char: 'x',
|
|
83
|
+
description: messages.getMessage('flags.manifest.description'),
|
|
84
|
+
summary: messages.getMessage('flags.manifest.summary'),
|
|
85
|
+
exclusive: ['metadata', 'source-dir'],
|
|
86
|
+
exactlyOne: ['manifest', 'source-dir', 'metadata'],
|
|
87
|
+
}),
|
|
88
|
+
metadata: sf_plugins_core_1.Flags.string({
|
|
89
|
+
char: 'm',
|
|
90
|
+
summary: messages.getMessage('flags.metadata.summary'),
|
|
91
|
+
multiple: true,
|
|
92
|
+
exclusive: ['manifest', 'source-dir'],
|
|
93
|
+
exactlyOne: ['manifest', 'source-dir', 'metadata'],
|
|
94
|
+
}),
|
|
95
|
+
'source-dir': sf_plugins_core_1.Flags.string({
|
|
96
|
+
char: 'd',
|
|
97
|
+
description: messages.getMessage('flags.source-dir.description'),
|
|
98
|
+
summary: messages.getMessage('flags.source-dir.summary'),
|
|
99
|
+
multiple: true,
|
|
100
|
+
exclusive: ['manifest', 'metadata'],
|
|
101
|
+
exactlyOne: ['manifest', 'source-dir', 'metadata'],
|
|
102
|
+
}),
|
|
103
|
+
'target-org': sf_plugins_core_1.Flags.requiredOrg({
|
|
104
|
+
char: 'o',
|
|
105
|
+
description: messages.getMessage('flags.target-org.description'),
|
|
106
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
107
|
+
}),
|
|
108
|
+
tests: sf_plugins_core_1.Flags.string({
|
|
109
|
+
char: 't',
|
|
110
|
+
multiple: true,
|
|
111
|
+
summary: messages.getMessage('flags.tests.summary'),
|
|
112
|
+
}),
|
|
113
|
+
'test-level': (0, deploy_1.testLevelFlag)({
|
|
114
|
+
options: [types_1.TestLevel.RunAllTestsInOrg, types_1.TestLevel.RunLocalTests, types_1.TestLevel.RunSpecifiedTests],
|
|
115
|
+
default: types_1.TestLevel.RunLocalTests,
|
|
116
|
+
description: messages.getMessage('flags.test-level.description'),
|
|
117
|
+
summary: messages.getMessage('flags.test-level.summary'),
|
|
118
|
+
}),
|
|
119
|
+
verbose: sf_plugins_core_1.Flags.boolean({
|
|
120
|
+
summary: messages.getMessage('flags.verbose.summary'),
|
|
121
|
+
exclusive: ['concise'],
|
|
122
|
+
}),
|
|
123
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
124
|
+
char: 'w',
|
|
125
|
+
summary: messages.getMessage('flags.wait.summary'),
|
|
126
|
+
description: messages.getMessage('flags.wait.description'),
|
|
127
|
+
unit: 'minutes',
|
|
128
|
+
defaultValue: 33,
|
|
129
|
+
helpValue: '<minutes>',
|
|
130
|
+
min: 1,
|
|
131
|
+
}),
|
|
132
|
+
};
|
|
133
|
+
DeployMetadataValidate.configurationVariablesSection = (0, sf_plugins_core_1.toHelpSection)('CONFIGURATION VARIABLES', core_1.OrgConfigProperties.TARGET_ORG, core_1.OrgConfigProperties.ORG_API_VERSION, configMeta_1.ConfigVars.ORG_METADATA_REST_DEPLOY);
|
|
134
|
+
DeployMetadataValidate.envVariablesSection = (0, sf_plugins_core_1.toHelpSection)('ENVIRONMENT VARIABLES', core_1.EnvironmentVariable.SF_TARGET_ORG, core_1.EnvironmentVariable.SF_USE_PROGRESS_BAR);
|
|
135
|
+
DeployMetadataValidate.errorCodes = (0, sf_plugins_core_1.toHelpSection)('ERROR CODES', errorCodes_1.DEPLOY_STATUS_CODES_DESCRIPTIONS);
|
|
136
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../src/commands/deploy/metadata/validate.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,iCAA6B;AAC7B,2CAAs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S;QACf,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,WAAW;QACtB,GAAG,EAAE,CAAC;KACP,CAAC;CACH,CAAC;AAEY,oDAA6B,GAAG,IAAA,+BAAa,EACzD,yBAAyB,EACzB,0BAAmB,CAAC,UAAU,EAC9B,0BAAmB,CAAC,eAAe,EACnC,uBAAU,CAAC,wBAAwB,CACpC,CAAC;AAEY,0CAAmB,GAAG,IAAA,+BAAa,EAC/C,uBAAuB,EACvB,0BAAmB,CAAC,aAAa,EACjC,0BAAmB,CAAC,mBAAmB,CACxC,CAAC;AAEY,iCAAU,GAAG,IAAA,+BAAa,EAAC,aAAa,EAAE,6CAAgC,CAAC,CAAC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { FileResponse } from '@salesforce/source-deploy-retrieve';
|
|
2
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import {
|
|
4
|
-
export
|
|
5
|
-
files: FileResponse[];
|
|
6
|
-
jobId: string;
|
|
7
|
-
tests?: TestResults;
|
|
8
|
-
};
|
|
9
|
-
export default class DeployMetadata extends SfCommand<DeployMetadataResult> {
|
|
2
|
+
import { DeployResultJson, TestLevel } from '../../utils/types';
|
|
3
|
+
export default class DeployMetadata extends SfCommand<DeployResultJson> {
|
|
10
4
|
static readonly description: string;
|
|
11
5
|
static readonly summary: string;
|
|
12
6
|
static readonly examples: string[];
|
|
@@ -14,6 +8,8 @@ export default class DeployMetadata extends SfCommand<DeployMetadataResult> {
|
|
|
14
8
|
static readonly state = "beta";
|
|
15
9
|
static flags: {
|
|
16
10
|
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
11
|
+
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
concise: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
13
|
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
14
|
'ignore-errors': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
19
15
|
'ignore-warnings': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
@@ -28,6 +24,8 @@ export default class DeployMetadata extends SfCommand<DeployMetadataResult> {
|
|
|
28
24
|
};
|
|
29
25
|
static configurationVariablesSection: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
30
26
|
static envVariablesSection: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
31
|
-
|
|
27
|
+
static errorCodes: import("@salesforce/sf-plugins-core/lib/util").HelpSection;
|
|
28
|
+
run(): Promise<DeployResultJson>;
|
|
29
|
+
protected catch(error: SfCommand.Error): Promise<SfCommand.Error>;
|
|
32
30
|
private setExitCode;
|
|
33
31
|
}
|
|
@@ -6,13 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
* Licensed under the BSD 3-Clause license.
|
|
7
7
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
8
|
*/
|
|
9
|
+
const chalk_1 = require("chalk");
|
|
9
10
|
const core_1 = require("@salesforce/core");
|
|
10
|
-
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
11
11
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
12
|
const output_1 = require("../../utils/output");
|
|
13
13
|
const progressBar_1 = require("../../utils/progressBar");
|
|
14
14
|
const types_1 = require("../../utils/types");
|
|
15
15
|
const deploy_1 = require("../../utils/deploy");
|
|
16
|
+
const errorCodes_1 = require("../../utils/errorCodes");
|
|
17
|
+
const configMeta_1 = require("../../configMeta");
|
|
16
18
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
19
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata');
|
|
18
20
|
class DeployMetadata extends sf_plugins_core_1.SfCommand {
|
|
@@ -21,7 +23,7 @@ class DeployMetadata extends sf_plugins_core_1.SfCommand {
|
|
|
21
23
|
if (!(0, deploy_1.validateTests)(flags['test-level'], flags.tests)) {
|
|
22
24
|
throw messages.createError('error.NoTestsSpecified');
|
|
23
25
|
}
|
|
24
|
-
const api = (0, deploy_1.
|
|
26
|
+
const api = await (0, deploy_1.resolveApi)();
|
|
25
27
|
const { deploy, componentSet } = await (0, deploy_1.executeDeploy)({
|
|
26
28
|
...flags,
|
|
27
29
|
'target-org': flags['target-org'].getUsername(),
|
|
@@ -29,25 +31,36 @@ class DeployMetadata extends sf_plugins_core_1.SfCommand {
|
|
|
29
31
|
});
|
|
30
32
|
const action = flags['dry-run'] ? 'Deploying (dry-run)' : 'Deploying';
|
|
31
33
|
this.log((0, output_1.getVersionMessage)(action, componentSet, api));
|
|
32
|
-
this.log(`Deploy ID: ${deploy.id}`);
|
|
34
|
+
this.log(`Deploy ID: ${(0, chalk_1.bold)(deploy.id)}`);
|
|
35
|
+
if (flags.async) {
|
|
36
|
+
const asyncFormatter = new output_1.AsyncDeployResultFormatter(deploy.id);
|
|
37
|
+
if (!this.jsonEnabled())
|
|
38
|
+
asyncFormatter.display();
|
|
39
|
+
return asyncFormatter.getJson();
|
|
40
|
+
}
|
|
33
41
|
new progressBar_1.DeployProgress(deploy, this.jsonEnabled()).start();
|
|
34
|
-
const result = await deploy.pollStatus(
|
|
42
|
+
const result = await deploy.pollStatus({ timeout: flags.wait });
|
|
35
43
|
this.setExitCode(result);
|
|
44
|
+
const formatter = new output_1.DeployResultFormatter(result, flags);
|
|
36
45
|
if (!this.jsonEnabled()) {
|
|
37
|
-
|
|
46
|
+
formatter.display();
|
|
38
47
|
if (flags['dry-run'])
|
|
39
|
-
this.
|
|
48
|
+
this.logSuccess('Dry-run complete.');
|
|
49
|
+
}
|
|
50
|
+
if ((0, deploy_1.shouldRemoveFromCache)(result.response.status)) {
|
|
51
|
+
await deploy_1.DeployCache.unset(deploy.id);
|
|
40
52
|
}
|
|
41
|
-
return
|
|
42
|
-
jobId: result.response.id,
|
|
43
|
-
files: result.getFileResponses() || [],
|
|
44
|
-
tests: (0, deploy_1.getTestResults)(result),
|
|
45
|
-
};
|
|
53
|
+
return formatter.getJson();
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
55
|
+
catch(error) {
|
|
56
|
+
if (error.message.includes('client has timed out')) {
|
|
57
|
+
const err = messages.createError('error.ClientTimeout');
|
|
58
|
+
return super.catch({ ...error, name: err.name, message: err.message, code: err.code });
|
|
50
59
|
}
|
|
60
|
+
return super.catch(error);
|
|
61
|
+
}
|
|
62
|
+
setExitCode(result) {
|
|
63
|
+
process.exitCode = (0, deploy_1.determineExitCode)(result);
|
|
51
64
|
}
|
|
52
65
|
}
|
|
53
66
|
exports.default = DeployMetadata;
|
|
@@ -62,6 +75,15 @@ DeployMetadata.flags = {
|
|
|
62
75
|
summary: messages.getMessage('flags.api-version.summary'),
|
|
63
76
|
description: messages.getMessage('flags.api-version.description'),
|
|
64
77
|
}),
|
|
78
|
+
async: sf_plugins_core_1.Flags.boolean({
|
|
79
|
+
summary: messages.getMessage('flags.async.summary'),
|
|
80
|
+
description: messages.getMessage('flags.async.description'),
|
|
81
|
+
exclusive: ['wait'],
|
|
82
|
+
}),
|
|
83
|
+
concise: sf_plugins_core_1.Flags.boolean({
|
|
84
|
+
summary: messages.getMessage('flags.concise.summary'),
|
|
85
|
+
exclusive: ['verbose'],
|
|
86
|
+
}),
|
|
65
87
|
'dry-run': sf_plugins_core_1.Flags.boolean({
|
|
66
88
|
summary: messages.getMessage('flags.dry-run.summary'),
|
|
67
89
|
default: false,
|
|
@@ -116,6 +138,7 @@ DeployMetadata.flags = {
|
|
|
116
138
|
}),
|
|
117
139
|
verbose: sf_plugins_core_1.Flags.boolean({
|
|
118
140
|
summary: messages.getMessage('flags.verbose.summary'),
|
|
141
|
+
exclusive: ['concise'],
|
|
119
142
|
}),
|
|
120
143
|
wait: sf_plugins_core_1.Flags.duration({
|
|
121
144
|
char: 'w',
|
|
@@ -125,8 +148,10 @@ DeployMetadata.flags = {
|
|
|
125
148
|
defaultValue: 33,
|
|
126
149
|
helpValue: '<minutes>',
|
|
127
150
|
min: 1,
|
|
151
|
+
exclusive: ['async'],
|
|
128
152
|
}),
|
|
129
153
|
};
|
|
130
|
-
DeployMetadata.configurationVariablesSection = (0, sf_plugins_core_1.toHelpSection)('CONFIGURATION VARIABLES', core_1.OrgConfigProperties.TARGET_ORG, core_1.
|
|
154
|
+
DeployMetadata.configurationVariablesSection = (0, sf_plugins_core_1.toHelpSection)('CONFIGURATION VARIABLES', core_1.OrgConfigProperties.TARGET_ORG, core_1.OrgConfigProperties.ORG_API_VERSION, configMeta_1.ConfigVars.ORG_METADATA_REST_DEPLOY);
|
|
131
155
|
DeployMetadata.envVariablesSection = (0, sf_plugins_core_1.toHelpSection)('ENVIRONMENT VARIABLES', core_1.EnvironmentVariable.SF_TARGET_ORG, core_1.EnvironmentVariable.SF_USE_PROGRESS_BAR);
|
|
156
|
+
DeployMetadata.errorCodes = (0, sf_plugins_core_1.toHelpSection)('ERROR CODES', errorCodes_1.DEPLOY_STATUS_CODES_DESCRIPTIONS);
|
|
132
157
|
//# sourceMappingURL=metadata.js.map
|