@salesforce/plugin-deploy-retrieve 1.1.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +35 -7
- package/lib/commands/deploy/metadata.d.ts +15 -12
- package/lib/commands/deploy/metadata.js +79 -70
- package/lib/commands/deploy/metadata.js.map +1 -1
- package/lib/commands/deploy.d.ts +2 -0
- package/lib/commands/deploy.js +19 -0
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/retrieve/metadata.d.ts +5 -3
- package/lib/commands/retrieve/metadata.js +49 -47
- package/lib/commands/retrieve/metadata.js.map +1 -1
- package/lib/hooks/deploy.js +1 -1
- package/lib/hooks/deploy.js.map +1 -1
- package/lib/utils/deploy.d.ts +29 -0
- package/lib/utils/deploy.js +81 -0
- package/lib/utils/deploy.js.map +1 -0
- package/lib/utils/metadataDeployer.d.ts +1 -1
- package/lib/utils/metadataDeployer.js +14 -13
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +8 -9
- package/lib/utils/output.js +127 -29
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/progressBar.d.ts +1 -1
- package/lib/utils/project.d.ts +3 -0
- package/lib/utils/project.js +22 -0
- package/lib/utils/project.js.map +1 -0
- package/lib/utils/{testLevel.d.ts → types.d.ts} +10 -0
- package/lib/utils/{testLevel.js → types.js} +7 -2
- package/lib/utils/types.js.map +1 -0
- package/messages/deploy.md +16 -3
- package/messages/deploy.metadata.md +42 -2
- package/messages/retrieve.metadata.md +10 -2
- package/oclif.manifest.json +1 -1
- package/package.json +30 -14
- package/schemas/deploy-metadata.json +5 -2
- package/lib/utils/componentSetBuilder.d.ts +0 -28
- package/lib/utils/componentSetBuilder.js +0 -124
- package/lib/utils/componentSetBuilder.js.map +0 -1
- package/lib/utils/config.d.ts +0 -1
- package/lib/utils/config.js +0 -18
- package/lib/utils/config.js.map +0 -1
- package/lib/utils/orgs.d.ts +0 -4
- package/lib/utils/orgs.js +0 -39
- package/lib/utils/orgs.js.map +0 -1
- package/lib/utils/requiredFlagValidator.d.ts +0 -3
- package/lib/utils/requiredFlagValidator.js +0 -19
- package/lib/utils/requiredFlagValidator.js.map +0 -1
- package/lib/utils/testLevel.js.map +0 -1
- package/messages/required.flag.md +0 -3
|
@@ -1,50 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
4
4
|
* All rights reserved.
|
|
5
5
|
* Licensed under the BSD 3-Clause license.
|
|
6
6
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const path = require("path");
|
|
10
|
-
const core_1 = require("@
|
|
11
|
-
const
|
|
12
|
-
const kit_1 = require("@salesforce/kit");
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
13
12
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
14
13
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
|
-
const orgs_1 = require("../../utils/orgs");
|
|
16
|
-
const componentSetBuilder_1 = require("../../utils/componentSetBuilder");
|
|
17
14
|
const output_1 = require("../../utils/output");
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const messages =
|
|
21
|
-
const mdTrasferMessages =
|
|
22
|
-
// One of these flags must be specified for a valid deploy.
|
|
23
|
-
const requiredFlags = ['manifest', 'metadata', 'package-name', 'source-dir'];
|
|
15
|
+
const project_1 = require("../../utils/project");
|
|
16
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.metadata');
|
|
18
|
+
const mdTrasferMessages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer');
|
|
24
19
|
class RetrieveMetadata extends sf_plugins_core_1.SfCommand {
|
|
25
20
|
async run() {
|
|
26
21
|
const flags = (await this.parse(RetrieveMetadata)).flags;
|
|
27
|
-
(
|
|
28
|
-
const componentSet = await
|
|
22
|
+
this.spinner.start(messages.getMessage('spinner.start'));
|
|
23
|
+
const componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
29
24
|
apiversion: flags['api-version'],
|
|
30
25
|
sourcepath: flags['source-dir'],
|
|
31
26
|
packagenames: flags['package-name'],
|
|
32
|
-
manifest:
|
|
27
|
+
manifest: flags.manifest && {
|
|
33
28
|
manifestPath: flags.manifest,
|
|
34
|
-
directoryPaths: await (0,
|
|
35
|
-
}
|
|
29
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
30
|
+
},
|
|
36
31
|
metadata: flags.metadata && {
|
|
37
32
|
metadataEntries: flags.metadata,
|
|
38
|
-
directoryPaths: await (0,
|
|
33
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
39
34
|
},
|
|
40
35
|
});
|
|
41
|
-
|
|
36
|
+
this.spinner.status = messages.getMessage('spinner.sending', [
|
|
37
|
+
componentSet.sourceApiVersion || componentSet.apiVersion,
|
|
38
|
+
]);
|
|
42
39
|
const retrieve = await componentSet.retrieve({
|
|
43
|
-
usernameOrConnection:
|
|
40
|
+
usernameOrConnection: flags['target-org'].getUsername(),
|
|
44
41
|
merge: true,
|
|
45
|
-
output: project.getDefaultPackage().fullPath,
|
|
42
|
+
output: this.project.getDefaultPackage().fullPath,
|
|
46
43
|
packageOptions: flags['package-name'],
|
|
47
44
|
});
|
|
45
|
+
this.spinner.status = messages.getMessage('spinner.polling');
|
|
48
46
|
retrieve.onUpdate((data) => {
|
|
49
47
|
this.spinner.status = mdTrasferMessages.getMessage(data.status);
|
|
50
48
|
});
|
|
@@ -55,30 +53,30 @@ class RetrieveMetadata extends sf_plugins_core_1.SfCommand {
|
|
|
55
53
|
this.spinner.stop(error.name);
|
|
56
54
|
throw error;
|
|
57
55
|
});
|
|
58
|
-
this.spinner.start(messages.getMessage('RetrieveTitle'));
|
|
59
56
|
await retrieve.start();
|
|
60
|
-
const result = await retrieve.pollStatus(500,
|
|
57
|
+
const result = await retrieve.pollStatus(500, flags.wait.seconds);
|
|
58
|
+
this.spinner.stop();
|
|
61
59
|
const fileResponses = (result === null || result === void 0 ? void 0 : result.getFileResponses()) || [];
|
|
62
|
-
|
|
60
|
+
if (!this.jsonEnabled()) {
|
|
61
|
+
await this.displayResults(result, flags['package-name']);
|
|
62
|
+
}
|
|
63
63
|
return fileResponses;
|
|
64
64
|
}
|
|
65
|
-
async displayResults(result,
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
throw new core_2.SfdxError((0, ts_types_1.getString)(result.response, 'errorMessage', result.response.status), (0, ts_types_1.getString)(result.response, 'errorStatusCode', 'unknown'));
|
|
73
|
-
}
|
|
65
|
+
async displayResults(result, packageNames = []) {
|
|
66
|
+
if (result.response.status === 'Succeeded') {
|
|
67
|
+
(0, output_1.displaySuccesses)(result);
|
|
68
|
+
(0, output_1.displayPackages)(result, await this.getPackages(result, packageNames));
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
throw new core_1.SfError((0, ts_types_1.getString)(result.response, 'errorMessage', result.response.status), (0, ts_types_1.getString)(result.response, 'errorStatusCode', 'unknown'));
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
async getPackages(result,
|
|
74
|
+
async getPackages(result, packageNames = []) {
|
|
77
75
|
const packages = [];
|
|
78
|
-
const projectPath = await
|
|
79
|
-
const packageNames = (0, ts_types_1.getArray)(flags, 'package-name', []);
|
|
76
|
+
const projectPath = await core_1.SfProject.resolveProjectPath();
|
|
80
77
|
packageNames.forEach((name) => {
|
|
81
|
-
|
|
78
|
+
const packagePath = path.join(projectPath, name);
|
|
79
|
+
packages.push({ name, path: packagePath, fullPath: path.resolve(packagePath) });
|
|
82
80
|
});
|
|
83
81
|
return packages;
|
|
84
82
|
}
|
|
@@ -87,48 +85,52 @@ exports.default = RetrieveMetadata;
|
|
|
87
85
|
RetrieveMetadata.summary = messages.getMessage('summary');
|
|
88
86
|
RetrieveMetadata.description = messages.getMessage('description');
|
|
89
87
|
RetrieveMetadata.examples = messages.getMessages('examples');
|
|
88
|
+
RetrieveMetadata.requiresProject = true;
|
|
89
|
+
RetrieveMetadata.state = 'beta';
|
|
90
90
|
RetrieveMetadata.flags = {
|
|
91
|
-
'api-version':
|
|
91
|
+
'api-version': sf_plugins_core_1.Flags.orgApiVersion({
|
|
92
92
|
char: 'a',
|
|
93
93
|
summary: messages.getMessage('flags.api-version.summary'),
|
|
94
94
|
description: messages.getMessage('flags.api-version.description'),
|
|
95
95
|
}),
|
|
96
|
-
manifest:
|
|
96
|
+
manifest: sf_plugins_core_1.Flags.file({
|
|
97
97
|
char: 'x',
|
|
98
98
|
summary: messages.getMessage('flags.manifest.summary'),
|
|
99
99
|
description: messages.getMessage('flags.manifest.description'),
|
|
100
100
|
exclusive: ['metadata', 'source-dir'],
|
|
101
|
+
exists: true,
|
|
101
102
|
}),
|
|
102
|
-
metadata:
|
|
103
|
+
metadata: sf_plugins_core_1.Flags.string({
|
|
103
104
|
char: 'm',
|
|
104
105
|
summary: messages.getMessage('flags.metadata.summary'),
|
|
105
106
|
multiple: true,
|
|
106
107
|
exclusive: ['manifest', 'source-dir'],
|
|
107
108
|
}),
|
|
108
|
-
'package-name':
|
|
109
|
+
'package-name': sf_plugins_core_1.Flags.string({
|
|
109
110
|
char: 'n',
|
|
110
111
|
summary: messages.getMessage('flags.package-name.summary'),
|
|
111
112
|
multiple: true,
|
|
112
113
|
}),
|
|
113
|
-
'source-dir':
|
|
114
|
+
'source-dir': sf_plugins_core_1.Flags.string({
|
|
114
115
|
char: 'd',
|
|
115
116
|
summary: messages.getMessage('flags.source-dir.summary'),
|
|
116
117
|
description: messages.getMessage('flags.source-dir.description'),
|
|
117
118
|
multiple: true,
|
|
118
119
|
exclusive: ['manifest', 'metadata'],
|
|
119
120
|
}),
|
|
120
|
-
'target-org':
|
|
121
|
+
'target-org': sf_plugins_core_1.Flags.requiredOrg({
|
|
121
122
|
char: 'o',
|
|
122
123
|
summary: messages.getMessage('flags.target-org.summary'),
|
|
123
124
|
description: messages.getMessage('flags.target-org.description'),
|
|
124
125
|
}),
|
|
125
|
-
wait:
|
|
126
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
126
127
|
char: 'w',
|
|
127
|
-
|
|
128
|
+
defaultValue: 33,
|
|
129
|
+
unit: 'minutes',
|
|
128
130
|
summary: messages.getMessage('flags.wait.summary'),
|
|
129
131
|
description: messages.getMessage('flags.wait.description'),
|
|
130
132
|
}),
|
|
131
133
|
};
|
|
132
|
-
RetrieveMetadata.configurationVariablesSection = (0, sf_plugins_core_1.toHelpSection)('CONFIGURATION VARIABLES',
|
|
133
|
-
RetrieveMetadata.envVariablesSection = (0, sf_plugins_core_1.toHelpSection)('ENVIRONMENT VARIABLES',
|
|
134
|
+
RetrieveMetadata.configurationVariablesSection = (0, sf_plugins_core_1.toHelpSection)('CONFIGURATION VARIABLES', core_1.OrgConfigProperties.TARGET_ORG, core_1.SfdxPropertyKeys.API_VERSION);
|
|
135
|
+
RetrieveMetadata.envVariablesSection = (0, sf_plugins_core_1.toHelpSection)('ENVIRONMENT VARIABLES', core_1.EnvironmentVariable.SF_TARGET_ORG, core_1.EnvironmentVariable.SFDX_DEFAULTUSERNAME, core_1.EnvironmentVariable.SFDX_USE_PROGRESS_BAR);
|
|
134
136
|
//# sourceMappingURL=metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/commands/retrieve/metadata.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,6BAA6B;AAC7B,
|
|
1
|
+
{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4BAA4B,CAAC;QAC1D,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,YAAY,EAAE,uBAAK,CAAC,MAAM,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAChE,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;KACpC,CAAC;IACF,YAAY,EAAE,uBAAK,CAAC,WAAW,CAAC;QAC9B,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;KACjE,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;KAC3D,CAAC;CACH,CAAC;AAEY,8CAA6B,GAAG,IAAA,+BAAa,EACzD,yBAAyB,EACzB,0BAAmB,CAAC,UAAU,EAC9B,uBAAgB,CAAC,WAAW,CAC7B,CAAC;AACY,oCAAmB,GAAG,IAAA,+BAAa,EAC/C,uBAAuB,EACvB,0BAAmB,CAAC,aAAa,EACjC,0BAAmB,CAAC,oBAAoB,EACxC,0BAAmB,CAAC,qBAAqB,CAC1C,CAAC"}
|
package/lib/hooks/deploy.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
10
|
const metadataDeployer_1 = require("../utils/metadataDeployer");
|
|
11
11
|
const hook = async function () {
|
|
12
|
-
const project = await core_1.
|
|
12
|
+
const project = await core_1.SfProject.resolve();
|
|
13
13
|
const packageDirectories = project.getPackageDirectories();
|
|
14
14
|
return [new metadataDeployer_1.MetadataDeployer(packageDirectories)];
|
|
15
15
|
};
|
package/lib/hooks/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/hooks/deploy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA6C;AAE7C,gEAA6D;AAE7D,MAAM,IAAI,GAAoC,KAAK;IACjD,MAAM,OAAO,GAAG,MAAM,gBAAS,CAAC,OAAO,EAAE,CAAC;IAC1C,MAAM,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAC3D,OAAO,CAAC,IAAI,mCAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACpD,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { Duration } from '@salesforce/kit';
|
|
3
|
+
import { Nullable } from '@salesforce/ts-types';
|
|
4
|
+
import { ComponentSet, DeployResult, MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
|
|
5
|
+
import { API, TestLevel, TestResults } from './types';
|
|
6
|
+
declare type Options = {
|
|
7
|
+
api: API;
|
|
8
|
+
'target-org': string;
|
|
9
|
+
'test-level': TestLevel;
|
|
10
|
+
'api-version'?: string;
|
|
11
|
+
'dry-run'?: boolean;
|
|
12
|
+
'ignore-errors'?: boolean;
|
|
13
|
+
'ignore-warnings'?: boolean;
|
|
14
|
+
manifest?: string;
|
|
15
|
+
metadata?: string[];
|
|
16
|
+
'source-dir'?: string[];
|
|
17
|
+
tests?: string[];
|
|
18
|
+
wait?: Duration;
|
|
19
|
+
verbose?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare function validateTests(testLevel: TestLevel, tests: Nullable<string[]>): boolean;
|
|
22
|
+
export declare function resolveRestDeploy(): API;
|
|
23
|
+
export declare function executeDeploy(opts: Partial<Options>): Promise<{
|
|
24
|
+
deploy: MetadataApiDeploy;
|
|
25
|
+
componentSet: ComponentSet;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const testLevelFlag: (opts?: Partial<Interfaces.OptionFlag<TestLevel | undefined>>) => Interfaces.OptionFlag<TestLevel | undefined>;
|
|
28
|
+
export declare function getTestResults(result: DeployResult): TestResults;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
exports.getTestResults = exports.testLevelFlag = exports.executeDeploy = exports.resolveRestDeploy = exports.validateTests = void 0;
|
|
10
|
+
const core_1 = require("@oclif/core");
|
|
11
|
+
const core_2 = require("@salesforce/core");
|
|
12
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
13
|
+
const project_1 = require("./project");
|
|
14
|
+
const types_1 = require("./types");
|
|
15
|
+
function validateTests(testLevel, tests) {
|
|
16
|
+
if (testLevel === types_1.TestLevel.RunSpecifiedTests && (tests !== null && tests !== void 0 ? tests : []).length === 0)
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
exports.validateTests = validateTests;
|
|
21
|
+
function resolveRestDeploy() {
|
|
22
|
+
const restDeployConfig = core_2.ConfigAggregator.getValue(core_2.SfdxPropertyKeys.REST_DEPLOY).value;
|
|
23
|
+
if (restDeployConfig === 'false') {
|
|
24
|
+
return types_1.API.SOAP;
|
|
25
|
+
}
|
|
26
|
+
else if (restDeployConfig === 'true') {
|
|
27
|
+
return types_1.API.REST;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return types_1.API.SOAP;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.resolveRestDeploy = resolveRestDeploy;
|
|
34
|
+
async function executeDeploy(opts) {
|
|
35
|
+
const componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
36
|
+
apiversion: opts['api-version'],
|
|
37
|
+
sourceapiversion: await (0, project_1.getSourceApiVersion)(),
|
|
38
|
+
sourcepath: opts['source-dir'],
|
|
39
|
+
manifest: opts.manifest && {
|
|
40
|
+
manifestPath: opts.manifest,
|
|
41
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
42
|
+
},
|
|
43
|
+
metadata: opts.metadata && {
|
|
44
|
+
metadataEntries: opts.metadata,
|
|
45
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const deploy = await componentSet.deploy({
|
|
49
|
+
usernameOrConnection: opts['target-org'],
|
|
50
|
+
apiOptions: {
|
|
51
|
+
checkOnly: opts['dry-run'] || false,
|
|
52
|
+
ignoreWarnings: opts['ignore-warnings'] || false,
|
|
53
|
+
rest: opts.api === types_1.API.REST,
|
|
54
|
+
rollbackOnError: !opts['ignore-errors'] || false,
|
|
55
|
+
runTests: opts.tests || [],
|
|
56
|
+
testLevel: opts['test-level'],
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
return { deploy, componentSet };
|
|
60
|
+
}
|
|
61
|
+
exports.executeDeploy = executeDeploy;
|
|
62
|
+
const testLevelFlag = (opts = {}) => {
|
|
63
|
+
return core_1.Flags.build({
|
|
64
|
+
char: 'l',
|
|
65
|
+
parse: (input) => Promise.resolve(input),
|
|
66
|
+
options: Object.values(types_1.TestLevel),
|
|
67
|
+
...opts,
|
|
68
|
+
})();
|
|
69
|
+
};
|
|
70
|
+
exports.testLevelFlag = testLevelFlag;
|
|
71
|
+
function getTestResults(result) {
|
|
72
|
+
var _a, _b, _c;
|
|
73
|
+
const passing = (_a = result.response.numberTestsCompleted) !== null && _a !== void 0 ? _a : 0;
|
|
74
|
+
const failing = (_b = result.response.numberTestErrors) !== null && _b !== void 0 ? _b : 0;
|
|
75
|
+
const total = (_c = result.response.numberTestsTotal) !== null && _c !== void 0 ? _c : 0;
|
|
76
|
+
const testResults = { passing, failing, total };
|
|
77
|
+
const time = result.response.details.runTestResult.totalTime;
|
|
78
|
+
return time ? { ...testResults, time } : testResults;
|
|
79
|
+
}
|
|
80
|
+
exports.getTestResults = getTestResults;
|
|
81
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/utils/deploy.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,sCAAgD;AAChD,2CAAsE;AAGtE,+EAAwH;AACxH,uCAAgE;AAChE,mCAAsD;AAkBtD,SAAgB,aAAa,CAAC,SAAoB,EAAE,KAAyB;IAC3E,IAAI,SAAS,KAAK,iBAAS,CAAC,iBAAiB,IAAI,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1F,OAAO,IAAI,CAAC;AACd,CAAC;AAHD,sCAGC;AAED,SAAgB,iBAAiB;IAC/B,MAAM,gBAAgB,GAAG,uBAAgB,CAAC,QAAQ,CAAC,uBAAgB,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;IAEvF,IAAI,gBAAgB,KAAK,OAAO,EAAE;QAChC,OAAO,WAAG,CAAC,IAAI,CAAC;KACjB;SAAM,IAAI,gBAAgB,KAAK,MAAM,EAAE;QACtC,OAAO,WAAG,CAAC,IAAI,CAAC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I,EAAE,GAAG;QACT,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAkB,CAAC;QAC7D,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAS,CAAC;QACjC,GAAG,IAAI;KACR,CAAC,EAAE,CAAC;AACP,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB;AAEF,SAAgB,cAAc,CAAC,MAAoB;;IACjD,MAAM,OAAO,GAAG,MAAA,MAAM,CAAC,QAAQ,CAAC,oBAAoB,mCAAI,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,MAAA,MAAM,CAAC,QAAQ,CAAC,gBAAgB,mCAAI,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,QAAQ,CAAC,gBAAgB,mCAAI,CAAC,CAAC;IACpD,MAAM,WAAW,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAChD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC;IAC7D,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;AACvD,CAAC;AAPD,wCAOC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NamedPackageDir } from '@salesforce/core';
|
|
2
2
|
import { Deployable, Deployer } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { TestLevel } from './
|
|
3
|
+
import { TestLevel } from './types';
|
|
4
4
|
export interface MetadataDeployOptions extends Deployer.Options {
|
|
5
5
|
testLevel?: TestLevel;
|
|
6
6
|
username?: string;
|
|
@@ -12,13 +12,12 @@ const chalk_1 = require("chalk");
|
|
|
12
12
|
const kit_1 = require("@salesforce/kit");
|
|
13
13
|
const core_1 = require("@salesforce/core");
|
|
14
14
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
15
|
-
const componentSetBuilder_1 = require("./componentSetBuilder");
|
|
16
15
|
const output_1 = require("./output");
|
|
17
|
-
const
|
|
16
|
+
const types_1 = require("./types");
|
|
18
17
|
const progressBar_1 = require("./progressBar");
|
|
19
|
-
const
|
|
18
|
+
const deploy_1 = require("./deploy");
|
|
20
19
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
21
|
-
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy
|
|
20
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy');
|
|
22
21
|
const compareOrgs = (a, b) => {
|
|
23
22
|
// scratch orgs before other orgs
|
|
24
23
|
if (a.isScratchOrg && !b.isScratchOrg) {
|
|
@@ -68,7 +67,7 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
68
67
|
constructor(packages) {
|
|
69
68
|
super();
|
|
70
69
|
this.packages = packages;
|
|
71
|
-
this.testLevel =
|
|
70
|
+
this.testLevel = types_1.TestLevel.NoTestRun;
|
|
72
71
|
this.deployables = this.packages.map((pkg) => new DeployablePackage(pkg, this));
|
|
73
72
|
}
|
|
74
73
|
getName() {
|
|
@@ -98,11 +97,13 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
98
97
|
async deploy() {
|
|
99
98
|
const directories = this.deployables.map((d) => d.pkg.fullPath);
|
|
100
99
|
const name = this.deployables.map((p) => chalk_1.cyan.bold(p.getPath())).join(', ');
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const deploy = await
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
const api = (0, deploy_1.resolveRestDeploy)();
|
|
101
|
+
this.log(`${os_1.EOL}Deploying ${name} to ${this.username} using ${api} API`);
|
|
102
|
+
const { deploy } = await (0, deploy_1.executeDeploy)({
|
|
103
|
+
'target-org': this.username,
|
|
104
|
+
'source-dir': directories,
|
|
105
|
+
'test-level': this.testLevel,
|
|
106
|
+
api,
|
|
106
107
|
});
|
|
107
108
|
new progressBar_1.DeployProgress(deploy).start();
|
|
108
109
|
const result = await deploy.pollStatus(500, kit_1.Duration.minutes(33).seconds);
|
|
@@ -192,11 +193,11 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
192
193
|
loop: false,
|
|
193
194
|
pageSize: 4,
|
|
194
195
|
choices: [
|
|
195
|
-
{ name: "Don't run tests", value:
|
|
196
|
-
{ name: 'Run local tests', value:
|
|
196
|
+
{ name: "Don't run tests", value: types_1.TestLevel.NoTestRun, short: "Don't run tests" },
|
|
197
|
+
{ name: 'Run local tests', value: types_1.TestLevel.RunLocalTests, short: 'Run local tests' },
|
|
197
198
|
{
|
|
198
199
|
name: 'Run all tests in environment',
|
|
199
|
-
value:
|
|
200
|
+
value: types_1.TestLevel.RunAllTestsInOrg,
|
|
200
201
|
short: 'Run all tests in environment',
|
|
201
202
|
},
|
|
202
203
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACzB,iCAAkC;AAClC,yCAA2C;AAC3C,2CAQ0B;AAC1B,iEAAyF;AAEzF
|
|
1
|
+
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2BAAyB;AACzB,iCAAkC;AAClC,yCAA2C;AAC3C,2CAQ0B;AAC1B,iEAAyF;AAEzF,qCAAiF;AACjF,mCAAoC;AACpC,+CAA+C;AAC/C,qCAA4D;AAE5D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,QAAQ,CAAC,CAAC;AAIvF,MAAM,WAAW,GAAG,CAAC,CAAuB,EAAE,CAAuB,EAAU,EAAE;IAC/E,iCAAiC;IACj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AAC,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACjF,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAS,CAAC,aAAa,EAAE,KAAK,EAAE,iBAAiB,EAAE;oBACrF;wBACE,IAAI,EAAE,8BAA8B;wBACpC,KAAK,EAAE,iBAAS,CAAC,gBAAgB;wBACjC,KAAK,EAAE,8BAA8B;qBACtC;iBACF;aACF;SACF,CAAC,CAAC;QACH,OAAO,SAAsB,CAAC;IAChC,CAAC;;AA3JH,4CA4JC;AA3Je,qBAAI,GAAG,iBAAiB,CAAC"}
|
package/lib/utils/output.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { DeployResult, FileResponse, RetrieveResult } from '@
|
|
2
|
-
import {
|
|
3
|
-
import { TestLevel } from './
|
|
4
|
-
export declare type PackageRetrieval = {
|
|
5
|
-
name: string;
|
|
6
|
-
path: string;
|
|
7
|
-
};
|
|
1
|
+
import { DeployResult, FileResponse, RetrieveResult, Failures, Successes, ComponentSet } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
import { NamedPackageDir } from '@salesforce/core';
|
|
3
|
+
import { API, TestLevel } from './types';
|
|
8
4
|
export declare function asRelativePaths(fileResponses: FileResponse[]): FileResponse[];
|
|
9
5
|
/**
|
|
10
6
|
* Sorts file responds by type, then by filePath, then by fullName
|
|
@@ -12,7 +8,10 @@ export declare function asRelativePaths(fileResponses: FileResponse[]): FileResp
|
|
|
12
8
|
export declare function sortFileResponses(fileResponses: FileResponse[]): FileResponse[];
|
|
13
9
|
export declare function sortTestResults(results?: Failures[] | Successes[]): Failures[] | Successes[];
|
|
14
10
|
export declare function toArray<T>(entryOrArray: T | T[] | undefined): T[];
|
|
11
|
+
export declare function displayDeployResults(result: DeployResult, testLevel: TestLevel, verbose: boolean): void;
|
|
15
12
|
export declare function displaySuccesses(result: DeployResult | RetrieveResult): void;
|
|
16
|
-
export declare function displayPackages(result: RetrieveResult, packages:
|
|
17
|
-
export declare function displayTestResults(result: DeployResult, testLevel: TestLevel): void;
|
|
13
|
+
export declare function displayPackages(result: RetrieveResult, packages: NamedPackageDir[]): void;
|
|
14
|
+
export declare function displayTestResults(result: DeployResult, testLevel: TestLevel, verbose?: boolean): void;
|
|
18
15
|
export declare function displayFailures(result: DeployResult | RetrieveResult): void;
|
|
16
|
+
export declare function displayDeletes(result: DeployResult): void;
|
|
17
|
+
export declare function getVersionMessage(action: string, componentSet: ComponentSet, api: API): string;
|