@salesforce/plugin-deploy-retrieve 1.8.6 → 1.8.8
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/lib/commands/deploy.d.ts +5 -0
- package/lib/commands/deploy.js +5 -0
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/project/convert/mdapi.d.ts +32 -0
- package/lib/commands/project/convert/mdapi.js +170 -0
- package/lib/commands/project/convert/mdapi.js.map +1 -0
- package/lib/commands/project/convert/source.d.ts +81 -0
- package/lib/commands/project/convert/source.js +141 -0
- package/lib/commands/project/convert/source.js.map +1 -0
- package/lib/commands/project/delete/source.d.ts +69 -0
- package/lib/commands/project/delete/source.js +424 -0
- package/lib/commands/project/delete/source.js.map +1 -0
- package/lib/commands/project/delete/tracking.d.ts +19 -0
- package/lib/commands/project/delete/tracking.js +49 -0
- package/lib/commands/project/delete/tracking.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/cancel.d.ts +2 -1
- package/lib/commands/{deploy/metadata → project/deploy}/cancel.js +20 -7
- package/lib/commands/project/deploy/cancel.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/preview.d.ts +2 -1
- package/lib/commands/{deploy/metadata → project/deploy}/preview.js +3 -2
- package/lib/commands/project/deploy/preview.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/quick.d.ts +3 -1
- package/lib/commands/{deploy/metadata → project/deploy}/quick.js +14 -7
- package/lib/commands/project/deploy/quick.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/report.d.ts +5 -1
- package/lib/commands/{deploy/metadata → project/deploy}/report.js +25 -7
- package/lib/commands/project/deploy/report.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/resume.d.ts +5 -1
- package/lib/commands/{deploy/metadata → project/deploy}/resume.js +21 -6
- package/lib/commands/project/deploy/resume.js.map +1 -0
- package/lib/commands/{deploy/metadata.d.ts → project/deploy/start.d.ts} +10 -3
- package/lib/commands/{deploy/metadata.js → project/deploy/start.js} +56 -17
- package/lib/commands/project/deploy/start.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/validate.d.ts +2 -1
- package/lib/commands/{deploy/metadata → project/deploy}/validate.js +10 -9
- package/lib/commands/project/deploy/validate.js.map +1 -0
- package/lib/commands/project/generate/manifest.d.ts +26 -0
- package/lib/commands/project/generate/manifest.js +132 -0
- package/lib/commands/project/generate/manifest.js.map +1 -0
- package/lib/commands/project/list/ignored.d.ts +24 -0
- package/lib/commands/project/list/ignored.js +85 -0
- package/lib/commands/project/list/ignored.js.map +1 -0
- package/lib/commands/project/reset/tracking.d.ts +21 -0
- package/lib/commands/project/reset/tracking.js +64 -0
- package/lib/commands/project/reset/tracking.js.map +1 -0
- package/lib/commands/{retrieve/metadata → project/retrieve}/preview.d.ts +2 -1
- package/lib/commands/{retrieve/metadata → project/retrieve}/preview.js +2 -1
- package/lib/commands/project/retrieve/preview.js.map +1 -0
- package/lib/commands/{retrieve/metadata.d.ts → project/retrieve/start.d.ts} +3 -2
- package/lib/commands/{retrieve/metadata.js → project/retrieve/start.js} +12 -10
- package/lib/commands/project/retrieve/start.js.map +1 -0
- package/lib/formatters/asyncDeployCancelResultFormatter.d.ts +10 -0
- package/lib/formatters/asyncDeployCancelResultFormatter.js +29 -0
- package/lib/formatters/asyncDeployCancelResultFormatter.js.map +1 -0
- package/lib/formatters/asyncDeployResultFormatter.d.ts +10 -0
- package/lib/formatters/asyncDeployResultFormatter.js +31 -0
- package/lib/formatters/asyncDeployResultFormatter.js.map +1 -0
- package/lib/formatters/deleteResultFormatter.d.ts +13 -0
- package/lib/formatters/deleteResultFormatter.js +72 -0
- package/lib/formatters/deleteResultFormatter.js.map +1 -0
- package/lib/formatters/deployCancelResultFormatter.d.ts +8 -0
- package/lib/formatters/deployCancelResultFormatter.js +29 -0
- package/lib/formatters/deployCancelResultFormatter.js.map +1 -0
- package/lib/formatters/deployReportResultFormatter.d.ts +4 -0
- package/lib/formatters/deployReportResultFormatter.js +52 -0
- package/lib/formatters/deployReportResultFormatter.js.map +1 -0
- package/lib/formatters/deployResultFormatter.d.ts +46 -0
- package/lib/formatters/deployResultFormatter.js +296 -0
- package/lib/formatters/deployResultFormatter.js.map +1 -0
- package/lib/formatters/metadataConvertResultFormatter.d.ts +9 -0
- package/lib/formatters/metadataConvertResultFormatter.js +59 -0
- package/lib/formatters/metadataConvertResultFormatter.js.map +1 -0
- package/lib/formatters/metadataRetrieveResultFormatter.d.ts +17 -0
- package/lib/formatters/metadataRetrieveResultFormatter.js +38 -0
- package/lib/formatters/metadataRetrieveResultFormatter.js.map +1 -0
- package/lib/formatters/retrieveResultFormatter.d.ts +13 -0
- package/lib/formatters/retrieveResultFormatter.js +66 -0
- package/lib/formatters/retrieveResultFormatter.js.map +1 -0
- package/lib/formatters/sourceConvertResultFormatter.d.ts +10 -0
- package/lib/formatters/sourceConvertResultFormatter.js +37 -0
- package/lib/formatters/sourceConvertResultFormatter.js.map +1 -0
- package/lib/utils/conflicts.js +1 -1
- package/lib/utils/conflicts.js.map +1 -1
- package/lib/utils/coverage.d.ts +9 -0
- package/lib/utils/coverage.js +109 -0
- package/lib/utils/coverage.js.map +1 -0
- package/lib/utils/deploy.d.ts +10 -6
- package/lib/utils/deploy.js +23 -26
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/deployCache.d.ts +8 -2
- package/lib/utils/deployCache.js +11 -2
- package/lib/utils/deployCache.js.map +1 -1
- package/lib/utils/errorCodes.d.ts +3 -1
- package/lib/utils/errorCodes.js +4 -4
- package/lib/utils/errorCodes.js.map +1 -1
- package/lib/utils/flags.js +3 -8
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/manifestCache.d.ts +5 -0
- package/lib/utils/manifestCache.js +44 -0
- package/lib/utils/manifestCache.js.map +1 -0
- package/lib/utils/metadataDeployer.js +3 -2
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +6 -83
- package/lib/utils/output.js +3 -385
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.d.ts +1 -0
- package/lib/utils/previewOutput.js +18 -21
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/progressBar.d.ts +1 -0
- package/lib/utils/progressBar.js +21 -17
- package/lib/utils/progressBar.js.map +1 -1
- package/lib/utils/types.d.ts +39 -0
- package/lib/utils/types.js +3 -1
- package/lib/utils/types.js.map +1 -1
- package/messages/convert.mdapi.md +68 -0
- package/messages/convert.source.md +69 -0
- package/messages/delete.source.md +136 -0
- package/messages/delete.tracking.md +39 -0
- package/messages/deploy.async.md +3 -3
- package/messages/deploy.md +5 -1
- package/messages/deploy.metadata.cancel.md +10 -6
- package/messages/deploy.metadata.md +37 -5
- package/messages/deploy.metadata.preview.md +11 -7
- package/messages/deploy.metadata.quick.md +11 -3
- package/messages/deploy.metadata.report.md +16 -4
- package/messages/deploy.metadata.resume.md +17 -5
- package/messages/deploy.metadata.validate.md +9 -5
- package/messages/list.ignored.md +29 -0
- package/messages/manifest.generate.md +74 -0
- package/messages/retrieve.metadata.md +4 -4
- package/messages/retrieve.metadata.preview.md +7 -7
- package/oclif.manifest.json +1476 -463
- package/package.json +58 -42
- package/schemas/project-convert-mdapi.json +29 -0
- package/schemas/project-delete-source.json +609 -0
- package/schemas/project-delete-tracking.json +19 -0
- package/schemas/project-generate-manifest.json +19 -0
- package/schemas/project-list-ignored.json +19 -0
- package/schemas/project-reset-tracking.json +19 -0
- package/lib/commands/deploy/metadata/cancel.js.map +0 -1
- package/lib/commands/deploy/metadata/preview.js.map +0 -1
- package/lib/commands/deploy/metadata/quick.js.map +0 -1
- package/lib/commands/deploy/metadata/report.js.map +0 -1
- package/lib/commands/deploy/metadata/resume.js.map +0 -1
- package/lib/commands/deploy/metadata/validate.js.map +0 -1
- package/lib/commands/deploy/metadata.js.map +0 -1
- package/lib/commands/retrieve/metadata/preview.js.map +0 -1
- package/lib/commands/retrieve/metadata.js.map +0 -1
- /package/schemas/{deploy-metadata-cancel.json → project-deploy-cancel.json} +0 -0
- /package/schemas/{deploy-metadata-preview.json → project-deploy-preview.json} +0 -0
- /package/schemas/{deploy-metadata-quick.json → project-deploy-quick.json} +0 -0
- /package/schemas/{deploy-metadata-report.json → project-deploy-report.json} +0 -0
- /package/schemas/{deploy-metadata-resume.json → project-deploy-resume.json} +0 -0
- /package/schemas/{deploy-metadata-validate.json → project-deploy-start.json} +0 -0
- /package/schemas/{deploy-metadata.json → project-deploy-validate.json} +0 -0
- /package/schemas/{retrieve-metadata-preview.json → project-retrieve-preview.json} +0 -0
- /package/schemas/{retrieve-metadata.json → project-retrieve-start.json} +0 -0
package/lib/utils/flags.js
CHANGED
|
@@ -13,11 +13,7 @@ const core_1 = require("@oclif/core");
|
|
|
13
13
|
const core_2 = require("@salesforce/core");
|
|
14
14
|
const types_1 = require("./types");
|
|
15
15
|
core_2.Messages.importMessagesDirectory(__dirname);
|
|
16
|
-
const messages = core_2.Messages.
|
|
17
|
-
'error.InvalidFlagPath',
|
|
18
|
-
'error.ExpectedDirectory',
|
|
19
|
-
'error.ExpectedFileOrDirToExist',
|
|
20
|
-
]);
|
|
16
|
+
const messages = core_2.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'validation');
|
|
21
17
|
const parsePathInfo = async (input, opts) => {
|
|
22
18
|
if (opts.exists && !fs.existsSync(input)) {
|
|
23
19
|
throw messages.createError('error.InvalidFlagPath', [input, messages.getMessage('error.ExpectedFileOrDirToExist')]);
|
|
@@ -42,9 +38,8 @@ async function ensureDirectoryPath(path) {
|
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
catch (error) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
throw err;
|
|
41
|
+
if (error instanceof Error && 'code' in error && error.code !== 'ENOENT') {
|
|
42
|
+
throw error;
|
|
48
43
|
}
|
|
49
44
|
else {
|
|
50
45
|
await fs.promises.mkdir(resolvedPath, { recursive: true });
|
package/lib/utils/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/utils/flags.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,+BAAwC;AACxC,sCAAoC;AACpC,2CAA4C;AAC5C,mCAA8C;AAE9C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/utils/flags.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,+BAAwC;AACxC,sCAAoC;AACpC,2CAA4C;AAC5C,mCAA8C;AAE9C,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,YAAY,CAAC,CAAC;AAE3F,MAAM,aAAa,GAAG,KAAK,EAAE,KAAa,EAAE,IAA0B,EAAqB,EAAE;IAC3F,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QACxC,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC;KACrH;IAED,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE3C,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;QACtB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;KAC3C;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,mBAAmB,CAAC,IAAY;IAC7C,MAAM,WAAW,GAA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QAAA,aAAa,GAAG,YAAK,CAAC,MAAM,CAAY;IACnD,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAkB,CAAC;IACrD,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAS,CAAC;CAClC,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,aAAa,GAAG,YAAK,CAAC,MAAM,CAAiC;IACxE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC;CAC5D,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,WAAW,GAAG,YAAK,CAAC,MAAM,CAAS;IAC9C,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;CACnE,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ComponentSet } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
/** Give it a jobId, ComponentSet it will write the manifest file
|
|
3
|
+
* returns the file path it wrote to */
|
|
4
|
+
export declare const writeManifest: (jobId: string, componentSet: ComponentSet) => Promise<string>;
|
|
5
|
+
export declare const maybeDestroyManifest: (jobId: string) => Promise<void>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybeDestroyManifest = exports.writeManifest = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
6
|
+
* All rights reserved.
|
|
7
|
+
* Licensed under the BSD 3-Clause license.
|
|
8
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
|
+
*/
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const os_1 = require("os");
|
|
12
|
+
const fs = require("fs");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const MANIFEST_CACHE_DIR = 'manifestCache';
|
|
15
|
+
/** Give it a jobId, ComponentSet it will write the manifest file
|
|
16
|
+
* returns the file path it wrote to */
|
|
17
|
+
const writeManifest = async (jobId, componentSet) => {
|
|
18
|
+
const types = new Set((await componentSet.getObject()).Package.types.map((t) => t.name));
|
|
19
|
+
// when we write a manifest, we will omit the CustomLabels component since it's redundant with the individual labels.
|
|
20
|
+
// this makes the use of the manifest in report/resume/etc accurate in certain mpd scenarios where it would otherwise pull in ALL labels from every dir
|
|
21
|
+
// regardless of whether they were actually deployed
|
|
22
|
+
// we'll only do this when something like `-m CustomLabels:*` or `-d labels/CustomLabels.labels-meta.xml` is specified which will include every CustomLabel
|
|
23
|
+
// in the project. When only a single label is specified, we need to strip out the `CustomLabels` entry otherwise we'll display information for every
|
|
24
|
+
// CustomLabel in the project instead of the single on specified
|
|
25
|
+
const xml = types.has('CustomLabels') && types.has('CustomLabel')
|
|
26
|
+
? await componentSet.filter((c) => c.type.name !== 'CustomLabels').getPackageXml()
|
|
27
|
+
: await componentSet.getPackageXml();
|
|
28
|
+
const filePath = getManifestFilePath(jobId);
|
|
29
|
+
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
30
|
+
await fs.promises.writeFile(filePath, xml);
|
|
31
|
+
return filePath;
|
|
32
|
+
};
|
|
33
|
+
exports.writeManifest = writeManifest;
|
|
34
|
+
const maybeDestroyManifest = async (jobId) => {
|
|
35
|
+
try {
|
|
36
|
+
return await fs.promises.rm(getManifestFilePath(jobId));
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
// that's ok in a maybe
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
exports.maybeDestroyManifest = maybeDestroyManifest;
|
|
43
|
+
const getManifestFilePath = (jobId) => path.join((0, os_1.homedir)(), core_1.Global.SF_STATE_FOLDER, MANIFEST_CACH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C3C,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAlBW,QAAA,aAAa,iBAkBxB;AAEK,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAAa,EAAiB,EAAE;IACzE,IAAI;QACF,OAAO,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;KACzD;IAAC,OAAO,CAAC,EAAE;QACV,uBAAuB;KACxB;AACH,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEF,MAAM,mBAAmB,GAAG,CAAC,KAAa,EAAU,EAAE,CACpD,IAAI,CAAC,IAAI,CAAC,IAAA,YAAO,GAAE,EAAE,aAAM,CAAC,eAAe,EAAE,kBAAkB,EAAE,GAAG,KAAK,MAAM,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ const chalk_1 = require("chalk");
|
|
|
13
13
|
const kit_1 = require("@salesforce/kit");
|
|
14
14
|
const core_1 = require("@salesforce/core");
|
|
15
15
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
16
|
-
const
|
|
16
|
+
const deployResultFormatter_1 = require("../formatters/deployResultFormatter");
|
|
17
17
|
const types_1 = require("./types");
|
|
18
18
|
const progressBar_1 = require("./progressBar");
|
|
19
19
|
const deploy_1 = require("./deploy");
|
|
@@ -107,10 +107,11 @@ class MetadataDeployer extends sf_plugins_core_1.Deployer {
|
|
|
107
107
|
});
|
|
108
108
|
new progressBar_1.DeployProgress(deploy).start();
|
|
109
109
|
const result = await deploy.pollStatus(500, kit_1.Duration.minutes(33).seconds);
|
|
110
|
-
const formatter = new
|
|
110
|
+
const formatter = new deployResultFormatter_1.DeployResultFormatter(result, {
|
|
111
111
|
'test-level': this.testLevel,
|
|
112
112
|
verbose: false,
|
|
113
113
|
concise: false,
|
|
114
|
+
'target-org': await core_1.Org.create({ aliasOrUsername: this.username }),
|
|
114
115
|
});
|
|
115
116
|
formatter.display();
|
|
116
117
|
const deployerResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,2CAA2C;;;AAE3C,2BAAyB;AACzB,iCAAkC;AAClC,yCAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"metadataDeployer.js","sourceRoot":"","sources":["../../src/utils/metadataDeployer.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,2CAA2C;;;AAE3C,2BAAyB;AACzB,iCAAkC;AAClC,yCAA2C;AAC3C,2CAS0B;AAC1B,iEAAyG;AAEzG,+EAA4E;AAC5E,mCAAoC;AACpC,+CAA+C;AAC/C,qCAAwE;AAExE,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;IACjC,IAAI,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE;QACrC,gDAAgD;QAChD,OAAO,CAAC,CAAC,CAAC;KACX;SAAM;QACL,8CAA8C;QAC9C,IAAI,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,YAAY,EAAE;YACpC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzC,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzC,OAAO,UAAU,CAAC,OAAO,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC;SACpD;QACD,mDAAmD;QACnD,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE;YAChD,OAAO,CAAC,CAAC,CAAC;SACX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CAAC,gBAAgB;wBACjC,KAAK,EAAE,8BAA8B;qBACtC;iBACF;aACF;SACF,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;;AAzKH,4CA0KC;AAzKe,qBAAI,GAAG,iBAAiB,CAAC"}
|
package/lib/utils/output.d.ts
CHANGED
|
@@ -1,87 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { API
|
|
3
|
-
export declare function
|
|
1
|
+
import { ComponentSet, FileResponse, FileResponseFailure, FileResponseSuccess } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
import { API } from './types';
|
|
3
|
+
export declare function tableHeader(message: string): string;
|
|
4
|
+
export declare function asRelativePaths<T extends FileResponse | FileResponseSuccess | FileResponseFailure>(fileResponses: T[]): T[];
|
|
4
5
|
/**
|
|
5
6
|
* Sorts file responds by type, then by filePath, then by fullName
|
|
6
7
|
*/
|
|
7
|
-
export declare function sortFileResponses(fileResponses:
|
|
8
|
-
export declare function sortTestResults(results?: Failures[] | Successes[]): Failures[] | Successes[];
|
|
8
|
+
export declare function sortFileResponses<T extends FileResponse | FileResponseSuccess | FileResponseFailure>(fileResponses: T[]): T[];
|
|
9
9
|
export declare function getVersionMessage(action: string, componentSet: ComponentSet | undefined, api: API): string;
|
|
10
|
-
|
|
11
|
-
getJson: () => T;
|
|
12
|
-
display: () => void;
|
|
13
|
-
}
|
|
14
|
-
export declare class DeployResultFormatter implements Formatter<DeployResultJson> {
|
|
15
|
-
protected result: DeployResult;
|
|
16
|
-
protected flags: Partial<{
|
|
17
|
-
'test-level': TestLevel;
|
|
18
|
-
verbose: boolean;
|
|
19
|
-
concise: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
private relativeFiles;
|
|
22
|
-
private absoluteFiles;
|
|
23
|
-
private testLevel;
|
|
24
|
-
private verbosity;
|
|
25
|
-
constructor(result: DeployResult, flags: Partial<{
|
|
26
|
-
'test-level': TestLevel;
|
|
27
|
-
verbose: boolean;
|
|
28
|
-
concise: boolean;
|
|
29
|
-
}>);
|
|
30
|
-
getJson(): DeployResultJson;
|
|
31
|
-
display(): void;
|
|
32
|
-
private displayReplacements;
|
|
33
|
-
private displaySuccesses;
|
|
34
|
-
private displayFailures;
|
|
35
|
-
private displayDeletes;
|
|
36
|
-
private displayTestResults;
|
|
37
|
-
private displayVerboseTestSuccesses;
|
|
38
|
-
private displayVerboseTestFailures;
|
|
39
|
-
private displayVerboseTestCoverage;
|
|
40
|
-
private determineVerbosity;
|
|
41
|
-
}
|
|
42
|
-
export declare class DeployReportResultFormatter extends DeployResultFormatter {
|
|
43
|
-
display(): void;
|
|
44
|
-
}
|
|
45
|
-
export declare class AsyncDeployResultFormatter implements Formatter<AsyncDeployResultJson> {
|
|
46
|
-
private id;
|
|
47
|
-
constructor(id: string);
|
|
48
|
-
getJson(): AsyncDeployResultJson;
|
|
49
|
-
display(): void;
|
|
50
|
-
}
|
|
51
|
-
export declare class DeployCancelResultFormatter implements Formatter<DeployResultJson> {
|
|
52
|
-
protected result: DeployResult;
|
|
53
|
-
constructor(result: DeployResult);
|
|
54
|
-
getJson(): DeployResultJson;
|
|
55
|
-
display(): void;
|
|
56
|
-
}
|
|
57
|
-
export declare class AsyncDeployCancelResultFormatter implements Formatter<AsyncDeployResultJson> {
|
|
58
|
-
private id;
|
|
59
|
-
constructor(id: string);
|
|
60
|
-
getJson(): DeployResultJson;
|
|
61
|
-
display(): void;
|
|
62
|
-
}
|
|
63
|
-
export declare class RetrieveResultFormatter implements Formatter<RetrieveResultJson> {
|
|
64
|
-
private result;
|
|
65
|
-
private packageNames;
|
|
66
|
-
private files;
|
|
67
|
-
constructor(result: RetrieveResult, packageNames?: string[], deleteResponses?: FileResponse[]);
|
|
68
|
-
getJson(): RetrieveResultJson;
|
|
69
|
-
display(): Promise<void>;
|
|
70
|
-
private displaySuccesses;
|
|
71
|
-
private displayPackages;
|
|
72
|
-
private getPackages;
|
|
73
|
-
}
|
|
74
|
-
export declare class MetadataRetrieveResultFormatter implements Formatter<MetadataRetrieveResultJson> {
|
|
75
|
-
private result;
|
|
76
|
-
private opts;
|
|
77
|
-
private zipFilePath;
|
|
78
|
-
private files;
|
|
79
|
-
constructor(result: RetrieveResult, opts: {
|
|
80
|
-
'target-metadata-dir': string;
|
|
81
|
-
'zip-file-name': string;
|
|
82
|
-
unzip: boolean;
|
|
83
|
-
});
|
|
84
|
-
getJson(): MetadataRetrieveResultJson;
|
|
85
|
-
display(): Promise<void>;
|
|
86
|
-
}
|
|
87
|
-
export {};
|
|
10
|
+
export declare const getFileResponseSuccessProps: (successes: FileResponseSuccess[]) => Array<Pick<FileResponseSuccess, 'filePath' | 'fullName' | 'state' | 'type'>>;
|
package/lib/utils/output.js
CHANGED
|
@@ -6,46 +6,13 @@
|
|
|
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
|
-
exports.
|
|
10
|
-
const os = require("os");
|
|
9
|
+
exports.getFileResponseSuccessProps = exports.getVersionMessage = exports.sortFileResponses = exports.asRelativePaths = exports.tableHeader = void 0;
|
|
11
10
|
const path = require("path");
|
|
12
|
-
const core_1 = require("@oclif/core");
|
|
13
11
|
const chalk_1 = require("chalk");
|
|
14
|
-
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
15
|
-
const core_2 = require("@salesforce/core");
|
|
16
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
17
|
-
const kit_1 = require("@salesforce/kit");
|
|
18
|
-
const types_1 = require("./types");
|
|
19
|
-
core_2.Messages.importMessagesDirectory(__dirname);
|
|
20
|
-
const deployAsyncMessages = core_2.Messages.load('@salesforce/plugin-deploy-retrieve', 'deploy.async', [
|
|
21
|
-
'info.AsyncDeployResume',
|
|
22
|
-
'info.AsyncDeployStatus',
|
|
23
|
-
'info.AsyncDeployCancel',
|
|
24
|
-
'info.AsyncDeployQueued',
|
|
25
|
-
'info.AsyncDeployCancelQueued',
|
|
26
|
-
]);
|
|
27
|
-
const retrieveMessages = core_2.Messages.load('@salesforce/plugin-deploy-retrieve', 'retrieve.metadata', [
|
|
28
|
-
'info.WroteZipFile',
|
|
29
|
-
'info.ExtractedZipFile',
|
|
30
|
-
]);
|
|
31
12
|
function tableHeader(message) {
|
|
32
13
|
return (0, chalk_1.blue)((0, chalk_1.bold)(message));
|
|
33
14
|
}
|
|
34
|
-
|
|
35
|
-
return sf_plugins_core_1.StandardColors.error((0, chalk_1.bold)(message));
|
|
36
|
-
}
|
|
37
|
-
function success(message) {
|
|
38
|
-
return sf_plugins_core_1.StandardColors.success((0, chalk_1.bold)(message));
|
|
39
|
-
}
|
|
40
|
-
function colorStatus(status) {
|
|
41
|
-
if (status === source_deploy_retrieve_1.RequestStatus.Succeeded)
|
|
42
|
-
return sf_plugins_core_1.StandardColors.success(status);
|
|
43
|
-
if (status === source_deploy_retrieve_1.RequestStatus.Failed)
|
|
44
|
-
return sf_plugins_core_1.StandardColors.error(status);
|
|
45
|
-
else
|
|
46
|
-
return sf_plugins_core_1.StandardColors.warning(status);
|
|
47
|
-
}
|
|
48
|
-
const check = sf_plugins_core_1.StandardColors.success('✓');
|
|
15
|
+
exports.tableHeader = tableHeader;
|
|
49
16
|
function asRelativePaths(fileResponses) {
|
|
50
17
|
const relative = fileResponses.map((file) => file.filePath ? { ...file, filePath: path.relative(process.cwd(), file.filePath) } : file);
|
|
51
18
|
return relative;
|
|
@@ -66,15 +33,6 @@ function sortFileResponses(fileResponses) {
|
|
|
66
33
|
});
|
|
67
34
|
}
|
|
68
35
|
exports.sortFileResponses = sortFileResponses;
|
|
69
|
-
function sortTestResults(results = []) {
|
|
70
|
-
return results.sort((a, b) => {
|
|
71
|
-
if (a.methodName === b.methodName) {
|
|
72
|
-
return a.name.localeCompare(b.name);
|
|
73
|
-
}
|
|
74
|
-
return a.methodName.localeCompare(b.methodName);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
exports.sortTestResults = sortTestResults;
|
|
78
36
|
function getVersionMessage(action, componentSet, api) {
|
|
79
37
|
// commands pass in the.componentSet, which may not exist in some tests or mdapi deploys
|
|
80
38
|
if (!componentSet) {
|
|
@@ -94,346 +52,6 @@ function getVersionMessage(action, componentSet, api) {
|
|
|
94
52
|
return `*** ${action} v${componentSet.sourceApiVersion} metadata with ${api} API v${componentSet.apiVersion} connection ***`;
|
|
95
53
|
}
|
|
96
54
|
exports.getVersionMessage = getVersionMessage;
|
|
97
|
-
class DeployResultFormatter {
|
|
98
|
-
constructor(result, flags) {
|
|
99
|
-
this.result = result;
|
|
100
|
-
this.flags = flags;
|
|
101
|
-
this.absoluteFiles = sortFileResponses(this.result.getFileResponses() ?? []);
|
|
102
|
-
this.relativeFiles = asRelativePaths(this.absoluteFiles);
|
|
103
|
-
this.testLevel = this.flags['test-level'] ?? types_1.TestLevel.NoTestRun;
|
|
104
|
-
this.verbosity = this.determineVerbosity();
|
|
105
|
-
}
|
|
106
|
-
getJson() {
|
|
107
|
-
if (this.verbosity === 'concise') {
|
|
108
|
-
return {
|
|
109
|
-
...this.result.response,
|
|
110
|
-
details: {
|
|
111
|
-
componentFailures: this.result.response.details.componentFailures,
|
|
112
|
-
runTestResult: this.result.response.details.runTestResult,
|
|
113
|
-
},
|
|
114
|
-
files: this.absoluteFiles.filter((f) => f.state === 'Failed'),
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
return {
|
|
119
|
-
...this.result.response,
|
|
120
|
-
files: this.absoluteFiles,
|
|
121
|
-
...(this.result.replacements.size
|
|
122
|
-
? {
|
|
123
|
-
replacements: Object.fromEntries(this.result.replacements),
|
|
124
|
-
}
|
|
125
|
-
: {}),
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
display() {
|
|
130
|
-
if (this.verbosity !== 'concise') {
|
|
131
|
-
this.displaySuccesses();
|
|
132
|
-
}
|
|
133
|
-
this.displayFailures();
|
|
134
|
-
this.displayDeletes();
|
|
135
|
-
this.displayTestResults();
|
|
136
|
-
this.displayReplacements();
|
|
137
|
-
}
|
|
138
|
-
displayReplacements() {
|
|
139
|
-
if (this.verbosity === 'verbose' && this.result.replacements?.size) {
|
|
140
|
-
const replacements = Array.from(this.result.replacements.entries()).flatMap(([filepath, stringsReplaced]) => stringsReplaced.map((replaced) => ({
|
|
141
|
-
filePath: path.relative(process.cwd(), filepath),
|
|
142
|
-
replaced,
|
|
143
|
-
})));
|
|
144
|
-
core_1.ux.table(replacements, {
|
|
145
|
-
filePath: { header: 'PROJECT PATH' },
|
|
146
|
-
replaced: { header: 'TEXT REPLACED' },
|
|
147
|
-
}, {
|
|
148
|
-
title: tableHeader('Metadata Replacements'),
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
displaySuccesses() {
|
|
153
|
-
const successes = this.relativeFiles.filter((f) => f.state !== 'Failed');
|
|
154
|
-
if (!successes.length || this.result.response.status === source_deploy_retrieve_1.RequestStatus.Failed)
|
|
155
|
-
return;
|
|
156
|
-
const columns = {
|
|
157
|
-
state: { header: 'State' },
|
|
158
|
-
fullName: { header: 'Name' },
|
|
159
|
-
type: { header: 'Type' },
|
|
160
|
-
filePath: { header: 'Path' },
|
|
161
|
-
};
|
|
162
|
-
const title = 'Deployed Source';
|
|
163
|
-
const options = { title: tableHeader(title) };
|
|
164
|
-
core_1.ux.log();
|
|
165
|
-
core_1.ux.table(successes.map((s) => ({ filePath: s.filePath, fullName: s.fullName, type: s.type, state: s.state })), columns, options);
|
|
166
|
-
}
|
|
167
|
-
displayFailures() {
|
|
168
|
-
if (this.result.response.status === source_deploy_retrieve_1.RequestStatus.Succeeded)
|
|
169
|
-
return;
|
|
170
|
-
const failures = this.relativeFiles.filter(types_1.isSdrFailure);
|
|
171
|
-
if (!failures.length)
|
|
172
|
-
return;
|
|
173
|
-
const columns = {
|
|
174
|
-
problemType: { header: 'Type' },
|
|
175
|
-
fullName: { header: 'Name' },
|
|
176
|
-
error: { header: 'Problem' },
|
|
177
|
-
};
|
|
178
|
-
const options = { title: error(`Component Failures [${failures.length}]`) };
|
|
179
|
-
core_1.ux.log();
|
|
180
|
-
core_1.ux.table(failures.map((f) => ({ problemType: f.problemType, fullName: f.fullName, error: f.error })), columns, options);
|
|
181
|
-
}
|
|
182
|
-
displayDeletes() {
|
|
183
|
-
const deletions = this.relativeFiles.filter(types_1.isSdrSuccess).filter((f) => f.state === 'Deleted');
|
|
184
|
-
if (!deletions.length)
|
|
185
|
-
return;
|
|
186
|
-
const columns = {
|
|
187
|
-
fullName: { header: 'Name' },
|
|
188
|
-
type: { header: 'Type' },
|
|
189
|
-
filePath: { header: 'Path' },
|
|
190
|
-
};
|
|
191
|
-
const options = { title: tableHeader('Deleted Source') };
|
|
192
|
-
core_1.ux.log();
|
|
193
|
-
core_1.ux.table(getFileResponseSuccessProps(deletions), columns, options);
|
|
194
|
-
}
|
|
195
|
-
displayTestResults() {
|
|
196
|
-
if (this.testLevel === types_1.TestLevel.NoTestRun) {
|
|
197
|
-
core_1.ux.log();
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
this.displayVerboseTestFailures();
|
|
201
|
-
if (this.verbosity === 'verbose') {
|
|
202
|
-
this.displayVerboseTestSuccesses();
|
|
203
|
-
this.displayVerboseTestCoverage();
|
|
204
|
-
}
|
|
205
|
-
core_1.ux.log();
|
|
206
|
-
core_1.ux.log(tableHeader('Test Results Summary'));
|
|
207
|
-
const passing = this.result.response.numberTestsCompleted ?? 0;
|
|
208
|
-
const failing = this.result.response.numberTestErrors ?? 0;
|
|
209
|
-
const total = this.result.response.numberTestsTotal ?? 0;
|
|
210
|
-
const time = this.result.response.details.runTestResult?.totalTime ?? 0;
|
|
211
|
-
core_1.ux.log(`Passing: ${passing}`);
|
|
212
|
-
core_1.ux.log(`Failing: ${failing}`);
|
|
213
|
-
core_1.ux.log(`Total: ${total}`);
|
|
214
|
-
if (time)
|
|
215
|
-
core_1.ux.log(`Time: ${time}`);
|
|
216
|
-
}
|
|
217
|
-
displayVerboseTestSuccesses() {
|
|
218
|
-
const successes = (0, kit_1.ensureArray)(this.result.response.details.runTestResult?.successes);
|
|
219
|
-
if (successes.length > 0) {
|
|
220
|
-
const testSuccesses = sortTestResults(successes);
|
|
221
|
-
core_1.ux.log();
|
|
222
|
-
core_1.ux.log(success(`Test Success [${successes.length}]`));
|
|
223
|
-
for (const test of testSuccesses) {
|
|
224
|
-
const testName = (0, chalk_1.underline)(`${test.name}.${test.methodName}`);
|
|
225
|
-
core_1.ux.log(`${check} ${testName}`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
displayVerboseTestFailures() {
|
|
230
|
-
if (!this.result.response.numberTestErrors)
|
|
231
|
-
return;
|
|
232
|
-
const failures = (0, kit_1.ensureArray)(this.result.response.details.runTestResult?.failures);
|
|
233
|
-
const failureCount = this.result.response.details.runTestResult?.numFailures;
|
|
234
|
-
const testFailures = sortTestResults(failures);
|
|
235
|
-
core_1.ux.log();
|
|
236
|
-
core_1.ux.log(error(`Test Failures [${failureCount}]`));
|
|
237
|
-
for (const test of testFailures) {
|
|
238
|
-
const testName = (0, chalk_1.underline)(`${test.name}.${test.methodName}`);
|
|
239
|
-
const stackTrace = test.stackTrace.replace(/\n/g, `${os.EOL} `);
|
|
240
|
-
core_1.ux.log(`• ${testName}`);
|
|
241
|
-
core_1.ux.log(` ${(0, chalk_1.dim)('message')}: ${test.message}`);
|
|
242
|
-
core_1.ux.log(` ${(0, chalk_1.dim)('stacktrace')}: ${os.EOL} ${stackTrace}`);
|
|
243
|
-
core_1.ux.log();
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
displayVerboseTestCoverage() {
|
|
247
|
-
const codeCoverage = (0, kit_1.ensureArray)(this.result.response.details.runTestResult?.codeCoverage);
|
|
248
|
-
if (codeCoverage.length) {
|
|
249
|
-
const coverage = codeCoverage.sort((a, b) => (a.name.toUpperCase() > b.name.toUpperCase() ? 1 : -1));
|
|
250
|
-
core_1.ux.log();
|
|
251
|
-
core_1.ux.log(tableHeader('Apex Code Coverage'));
|
|
252
|
-
core_1.ux.table(coverage.map(coverageOutput), {
|
|
253
|
-
name: { header: 'Name' },
|
|
254
|
-
numLocations: { header: '% Covered' },
|
|
255
|
-
lineNotCovered: { header: 'Uncovered Lines' },
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
determineVerbosity() {
|
|
260
|
-
if (this.flags.verbose)
|
|
261
|
-
return 'verbose';
|
|
262
|
-
if (this.flags.concise)
|
|
263
|
-
return 'concise';
|
|
264
|
-
return 'normal';
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
exports.DeployResultFormatter = DeployResultFormatter;
|
|
268
|
-
class DeployReportResultFormatter extends DeployResultFormatter {
|
|
269
|
-
display() {
|
|
270
|
-
core_1.ux.log(`${this.result.response.id}... ${this.result.response.status}`);
|
|
271
|
-
const response = Object.entries(this.result.response).reduce((result, [key, value]) => {
|
|
272
|
-
if (['number', 'boolean', 'string'].includes(typeof value)) {
|
|
273
|
-
if (key === 'status') {
|
|
274
|
-
return result.concat({ key, value: colorStatus(value) });
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
return result.concat({ key, value: value });
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return result;
|
|
281
|
-
}, []);
|
|
282
|
-
core_1.ux.log();
|
|
283
|
-
core_1.ux.table(response, { key: {}, value: {} }, { title: tableHeader('Deploy Info') });
|
|
284
|
-
const opts = Object.entries(this.flags).reduce((result, [key, value]) => {
|
|
285
|
-
if (key === 'timestamp')
|
|
286
|
-
return result;
|
|
287
|
-
return result.concat({ key, value });
|
|
288
|
-
}, []);
|
|
289
|
-
core_1.ux.log();
|
|
290
|
-
core_1.ux.table(opts, { key: {}, value: {} }, { title: tableHeader('Deploy Options') });
|
|
291
|
-
super.display();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
exports.DeployReportResultFormatter = DeployReportResultFormatter;
|
|
295
|
-
class AsyncDeployResultFormatter {
|
|
296
|
-
constructor(id) {
|
|
297
|
-
this.id = id;
|
|
298
|
-
}
|
|
299
|
-
getJson() {
|
|
300
|
-
return { id: this.id, done: false, status: 'Queued', files: [] };
|
|
301
|
-
}
|
|
302
|
-
display() {
|
|
303
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployQueued'));
|
|
304
|
-
core_1.ux.log();
|
|
305
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployResume', [this.id]));
|
|
306
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployStatus', [this.id]));
|
|
307
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployCancel', [this.id]));
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
exports.AsyncDeployResultFormatter = AsyncDeployResultFormatter;
|
|
311
|
-
class DeployCancelResultFormatter {
|
|
312
|
-
constructor(result) {
|
|
313
|
-
this.result = result;
|
|
314
|
-
}
|
|
315
|
-
getJson() {
|
|
316
|
-
return { ...this.result.response, files: this.result.getFileResponses() ?? [] };
|
|
317
|
-
}
|
|
318
|
-
display() {
|
|
319
|
-
if (this.result.response.status === source_deploy_retrieve_1.RequestStatus.Canceled) {
|
|
320
|
-
core_1.ux.log(`Successfully canceled ${this.result.response.id}`);
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
core_1.ux.error(`Could not cancel ${this.result.response.id}`);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
exports.DeployCancelResultFormatter = DeployCancelResultFormatter;
|
|
328
|
-
class AsyncDeployCancelResultFormatter {
|
|
329
|
-
constructor(id) {
|
|
330
|
-
this.id = id;
|
|
331
|
-
}
|
|
332
|
-
getJson() {
|
|
333
|
-
return { id: this.id, done: false, status: 'Queued', files: [] };
|
|
334
|
-
}
|
|
335
|
-
display() {
|
|
336
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployCancelQueued'));
|
|
337
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployResume', [this.id]));
|
|
338
|
-
core_1.ux.log(deployAsyncMessages.getMessage('info.AsyncDeployStatus', [this.id]));
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
exports.AsyncDeployCancelResultFormatter = AsyncDeployCancelResultFormatter;
|
|
342
|
-
class RetrieveResultFormatter {
|
|
343
|
-
constructor(result, packageNames = [], deleteResponses = []) {
|
|
344
|
-
this.result = result;
|
|
345
|
-
this.packageNames = packageNames;
|
|
346
|
-
this.files = sortFileResponses(asRelativePaths((this.result.getFileResponses() ?? []).concat(deleteResponses)));
|
|
347
|
-
}
|
|
348
|
-
getJson() {
|
|
349
|
-
const { zipFile, ...responseWithoutZip } = this.result.response;
|
|
350
|
-
return { ...responseWithoutZip, files: this.files };
|
|
351
|
-
}
|
|
352
|
-
async display() {
|
|
353
|
-
this.displaySuccesses();
|
|
354
|
-
await this.displayPackages();
|
|
355
|
-
}
|
|
356
|
-
displaySuccesses() {
|
|
357
|
-
const successes = this.files.filter(types_1.isSdrSuccess);
|
|
358
|
-
if (!successes.length)
|
|
359
|
-
return;
|
|
360
|
-
const columns = {
|
|
361
|
-
state: { header: 'State' },
|
|
362
|
-
fullName: { header: 'Name' },
|
|
363
|
-
type: { header: 'Type' },
|
|
364
|
-
filePath: { header: 'Path' },
|
|
365
|
-
};
|
|
366
|
-
const title = 'Retrieved Source';
|
|
367
|
-
const options = { title: tableHeader(title) };
|
|
368
|
-
core_1.ux.log();
|
|
369
|
-
core_1.ux.table(getFileResponseSuccessProps(successes), columns, options);
|
|
370
|
-
}
|
|
371
|
-
async displayPackages() {
|
|
372
|
-
const packages = await this.getPackages();
|
|
373
|
-
if (packages?.length) {
|
|
374
|
-
const columns = {
|
|
375
|
-
name: { header: 'Package Name' },
|
|
376
|
-
fullPath: { header: 'Converted Location' },
|
|
377
|
-
};
|
|
378
|
-
const title = 'Retrieved Packages';
|
|
379
|
-
const options = { title: tableHeader(title) };
|
|
380
|
-
core_1.ux.log();
|
|
381
|
-
core_1.ux.table(packages, columns, options);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
async getPackages() {
|
|
385
|
-
const projectPath = await core_2.SfProject.resolveProjectPath();
|
|
386
|
-
return this.packageNames.map((name) => {
|
|
387
|
-
const packagePath = path.join(projectPath, name);
|
|
388
|
-
return { name, path: packagePath, fullPath: path.resolve(packagePath) };
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
exports.RetrieveResultFormatter = RetrieveResultFormatter;
|
|
393
|
-
class MetadataRetrieveResultFormatter {
|
|
394
|
-
constructor(result, opts) {
|
|
395
|
-
this.result = result;
|
|
396
|
-
this.opts = opts;
|
|
397
|
-
this.zipFilePath = path.join(opts['target-metadata-dir'], opts['zip-file-name']);
|
|
398
|
-
this.files = sortFileResponses(asRelativePaths(this.result.getFileResponses() ?? []));
|
|
399
|
-
}
|
|
400
|
-
getJson() {
|
|
401
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
402
|
-
const { zipFile, ...responseWithoutZipFile } = this.result.response;
|
|
403
|
-
return { ...responseWithoutZipFile, zipFilePath: this.zipFilePath, files: this.files };
|
|
404
|
-
}
|
|
405
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
406
|
-
async display() {
|
|
407
|
-
core_1.ux.log(retrieveMessages.getMessage('info.WroteZipFile', [this.zipFilePath]));
|
|
408
|
-
if (this.opts.unzip) {
|
|
409
|
-
const extractPath = path.join(this.opts['target-metadata-dir'], path.parse(this.opts['zip-file-name']).name);
|
|
410
|
-
core_1.ux.log(retrieveMessages.getMessage('info.ExtractedZipFile', [this.zipFilePath, extractPath]));
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
exports.MetadataRetrieveResultFormatter = MetadataRetrieveResultFormatter;
|
|
415
55
|
const getFileResponseSuccessProps = (successes) => successes.map((s) => ({ filePath: s.filePath, fullName: s.fullName, type: s.type, state: s.state }));
|
|
416
|
-
|
|
417
|
-
const numLocationsNum = parseInt(cov.numLocations, 10);
|
|
418
|
-
const numLocationsNotCovered = parseInt(cov.numLocationsNotCovered, 10);
|
|
419
|
-
const color = numLocationsNotCovered > 0 ? sf_plugins_core_1.StandardColors.error : sf_plugins_core_1.StandardColors.success;
|
|
420
|
-
let pctCovered = 100;
|
|
421
|
-
const coverageDecimal = parseFloat(((numLocationsNum - numLocationsNotCovered) / numLocationsNum).toFixed(2));
|
|
422
|
-
if (numLocationsNum > 0) {
|
|
423
|
-
pctCovered = coverageDecimal * 100;
|
|
424
|
-
}
|
|
425
|
-
// cov.numLocations = color(`${pctCovered}%`);
|
|
426
|
-
const base = {
|
|
427
|
-
name: cov.name,
|
|
428
|
-
numLocations: color(`${pctCovered}%`),
|
|
429
|
-
};
|
|
430
|
-
if (!cov.locationsNotCovered) {
|
|
431
|
-
return { ...base, lineNotCovered: '' };
|
|
432
|
-
}
|
|
433
|
-
const locations = (0, kit_1.ensureArray)(cov.locationsNotCovered);
|
|
434
|
-
return {
|
|
435
|
-
...base,
|
|
436
|
-
lineNotCovered: locations.map((location) => location.line).join(','),
|
|
437
|
-
};
|
|
438
|
-
};
|
|
56
|
+
exports.getFileResponseSuccessProps = getFileResponseSuccessProps;
|
|
439
57
|
//# sourceMappingURL=output.js.map
|