@salesforce/plugin-deploy-retrieve 1.8.5-beta.5 → 1.8.6
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/{project/deploy → deploy/metadata}/cancel.d.ts +0 -2
- package/lib/commands/{project/deploy → deploy/metadata}/cancel.js +6 -17
- package/lib/commands/deploy/metadata/cancel.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/preview.d.ts +0 -2
- package/lib/commands/{project/deploy → deploy/metadata}/preview.js +1 -3
- package/lib/commands/deploy/metadata/preview.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/quick.d.ts +0 -3
- package/lib/commands/{project/deploy → deploy/metadata}/quick.js +6 -14
- package/lib/commands/deploy/metadata/quick.js.map +1 -0
- package/lib/commands/deploy/metadata/report.d.ts +14 -0
- package/lib/commands/{project/deploy → deploy/metadata}/report.js +5 -26
- package/lib/commands/deploy/metadata/report.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/resume.d.ts +0 -5
- package/lib/commands/{project/deploy → deploy/metadata}/resume.js +3 -19
- package/lib/commands/deploy/metadata/resume.js.map +1 -0
- package/lib/commands/{project/deploy → deploy/metadata}/validate.d.ts +0 -2
- package/lib/commands/{project/deploy → deploy/metadata}/validate.js +6 -8
- package/lib/commands/deploy/metadata/validate.js.map +1 -0
- package/lib/commands/{project/deploy/start.d.ts → deploy/metadata.d.ts} +2 -10
- package/lib/commands/{project/deploy/start.js → deploy/metadata.js} +13 -44
- package/lib/commands/deploy/metadata.js.map +1 -0
- package/lib/commands/deploy.d.ts +0 -5
- package/lib/commands/deploy.js +0 -5
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/{project/retrieve → retrieve/metadata}/preview.d.ts +0 -2
- package/lib/commands/{project/retrieve → retrieve/metadata}/preview.js +0 -2
- package/lib/commands/retrieve/metadata/preview.js.map +1 -0
- package/lib/commands/{project/retrieve/start.d.ts → retrieve/metadata.d.ts} +1 -3
- package/lib/commands/{project/retrieve/start.js → retrieve/metadata.js} +8 -11
- package/lib/commands/retrieve/metadata.js.map +1 -0
- package/lib/utils/conflicts.js +1 -1
- package/lib/utils/conflicts.js.map +1 -1
- package/lib/utils/deploy.d.ts +5 -9
- package/lib/utils/deploy.js +24 -21
- package/lib/utils/deploy.js.map +1 -1
- package/lib/utils/deployCache.d.ts +2 -8
- package/lib/utils/deployCache.js +2 -11
- package/lib/utils/deployCache.js.map +1 -1
- package/lib/utils/errorCodes.d.ts +1 -3
- package/lib/utils/errorCodes.js +4 -4
- package/lib/utils/errorCodes.js.map +1 -1
- package/lib/utils/flags.js +8 -3
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/metadataDeployer.js +2 -3
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +83 -6
- package/lib/utils/output.js +385 -3
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.d.ts +0 -1
- package/lib/utils/previewOutput.js +14 -4
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/types.d.ts +0 -39
- package/lib/utils/types.js +1 -3
- package/lib/utils/types.js.map +1 -1
- package/messages/deploy.async.md +3 -3
- package/messages/deploy.md +1 -5
- package/messages/deploy.metadata.cancel.md +6 -10
- package/messages/deploy.metadata.md +5 -33
- package/messages/deploy.metadata.preview.md +3 -7
- package/messages/deploy.metadata.quick.md +3 -11
- package/messages/deploy.metadata.report.md +4 -24
- package/messages/deploy.metadata.resume.md +5 -17
- package/messages/deploy.metadata.validate.md +5 -9
- package/messages/retrieve.metadata.md +1 -1
- package/messages/retrieve.metadata.preview.md +3 -3
- package/oclif.manifest.json +446 -1486
- package/package.json +39 -54
- package/lib/commands/project/convert/mdapi.d.ts +0 -32
- package/lib/commands/project/convert/mdapi.js +0 -170
- package/lib/commands/project/convert/mdapi.js.map +0 -1
- package/lib/commands/project/convert/source.d.ts +0 -29
- package/lib/commands/project/convert/source.js +0 -141
- package/lib/commands/project/convert/source.js.map +0 -1
- package/lib/commands/project/delete/source.d.ts +0 -69
- package/lib/commands/project/delete/source.js +0 -424
- package/lib/commands/project/delete/source.js.map +0 -1
- package/lib/commands/project/delete/tracking.d.ts +0 -19
- package/lib/commands/project/delete/tracking.js +0 -49
- package/lib/commands/project/delete/tracking.js.map +0 -1
- package/lib/commands/project/deploy/cancel.js.map +0 -1
- package/lib/commands/project/deploy/preview.js.map +0 -1
- package/lib/commands/project/deploy/quick.js.map +0 -1
- package/lib/commands/project/deploy/report.d.ts +0 -22
- package/lib/commands/project/deploy/report.js.map +0 -1
- package/lib/commands/project/deploy/resume.js.map +0 -1
- package/lib/commands/project/deploy/start.js.map +0 -1
- package/lib/commands/project/deploy/validate.js.map +0 -1
- package/lib/commands/project/list/ignored.d.ts +0 -24
- package/lib/commands/project/list/ignored.js +0 -85
- package/lib/commands/project/list/ignored.js.map +0 -1
- package/lib/commands/project/manifest/create.d.ts +0 -26
- package/lib/commands/project/manifest/create.js +0 -133
- package/lib/commands/project/manifest/create.js.map +0 -1
- package/lib/commands/project/reset/tracking.d.ts +0 -21
- package/lib/commands/project/reset/tracking.js +0 -64
- package/lib/commands/project/reset/tracking.js.map +0 -1
- package/lib/commands/project/retrieve/preview.js.map +0 -1
- package/lib/commands/project/retrieve/start.js.map +0 -1
- package/lib/formatters/asyncDeployCancelResultFormatter.d.ts +0 -9
- package/lib/formatters/asyncDeployCancelResultFormatter.js +0 -28
- package/lib/formatters/asyncDeployCancelResultFormatter.js.map +0 -1
- package/lib/formatters/asyncDeployResultFormatter.d.ts +0 -9
- package/lib/formatters/asyncDeployResultFormatter.js +0 -30
- package/lib/formatters/asyncDeployResultFormatter.js.map +0 -1
- package/lib/formatters/deleteResultFormatter.d.ts +0 -13
- package/lib/formatters/deleteResultFormatter.js +0 -72
- package/lib/formatters/deleteResultFormatter.js.map +0 -1
- package/lib/formatters/deployCancelResultFormatter.d.ts +0 -8
- package/lib/formatters/deployCancelResultFormatter.js +0 -29
- package/lib/formatters/deployCancelResultFormatter.js.map +0 -1
- package/lib/formatters/deployReportResultFormatter.d.ts +0 -4
- package/lib/formatters/deployReportResultFormatter.js +0 -52
- package/lib/formatters/deployReportResultFormatter.js.map +0 -1
- package/lib/formatters/deployResultFormatter.d.ts +0 -46
- package/lib/formatters/deployResultFormatter.js +0 -296
- package/lib/formatters/deployResultFormatter.js.map +0 -1
- package/lib/formatters/metadataConvertResultFormatter.d.ts +0 -9
- package/lib/formatters/metadataConvertResultFormatter.js +0 -59
- package/lib/formatters/metadataConvertResultFormatter.js.map +0 -1
- package/lib/formatters/metadataRetrieveResultFormatter.d.ts +0 -17
- package/lib/formatters/metadataRetrieveResultFormatter.js +0 -38
- package/lib/formatters/metadataRetrieveResultFormatter.js.map +0 -1
- package/lib/formatters/retrieveResultFormatter.d.ts +0 -13
- package/lib/formatters/retrieveResultFormatter.js +0 -66
- package/lib/formatters/retrieveResultFormatter.js.map +0 -1
- package/lib/formatters/sourceConvertResultFormatter.d.ts +0 -10
- package/lib/formatters/sourceConvertResultFormatter.js +0 -37
- package/lib/formatters/sourceConvertResultFormatter.js.map +0 -1
- package/lib/utils/coverage.d.ts +0 -9
- package/lib/utils/coverage.js +0 -109
- package/lib/utils/coverage.js.map +0 -1
- package/lib/utils/manifestCache.d.ts +0 -5
- package/lib/utils/manifestCache.js +0 -38
- package/lib/utils/manifestCache.js.map +0 -1
- package/messages/convert.mdapi.md +0 -66
- package/messages/convert.source.md +0 -63
- package/messages/delete.source.md +0 -134
- package/messages/delete.tracking.md +0 -39
- package/messages/list.ignored.md +0 -17
- package/messages/manifest.create.md +0 -72
- package/schemas/project-convert-mdapi.json +0 -29
- package/schemas/project-delete-source.json +0 -609
- package/schemas/project-delete-tracking.json +0 -19
- package/schemas/project-list-ignored.json +0 -19
- package/schemas/project-manifest-create.json +0 -19
- package/schemas/project-reset-tracking.json +0 -19
- /package/schemas/{project-deploy-cancel.json → deploy-metadata-cancel.json} +0 -0
- /package/schemas/{project-deploy-preview.json → deploy-metadata-preview.json} +0 -0
- /package/schemas/{project-deploy-quick.json → deploy-metadata-quick.json} +0 -0
- /package/schemas/{project-deploy-report.json → deploy-metadata-report.json} +0 -0
- /package/schemas/{project-deploy-resume.json → deploy-metadata-resume.json} +0 -0
- /package/schemas/{project-deploy-start.json → deploy-metadata-validate.json} +0 -0
- /package/schemas/{project-deploy-validate.json → deploy-metadata.json} +0 -0
- /package/schemas/{project-retrieve-preview.json → retrieve-metadata-preview.json} +0 -0
- /package/schemas/{project-retrieve-start.json → retrieve-metadata.json} +0 -0
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MetadataRetrieveResultFormatter = exports.retrieveMessages = 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 core_1 = require("@oclif/core");
|
|
12
|
-
const core_2 = require("@salesforce/core");
|
|
13
|
-
const output_1 = require("../utils/output");
|
|
14
|
-
core_2.Messages.importMessagesDirectory(__dirname);
|
|
15
|
-
exports.retrieveMessages = core_2.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.metadata');
|
|
16
|
-
class MetadataRetrieveResultFormatter {
|
|
17
|
-
constructor(result, opts) {
|
|
18
|
-
this.result = result;
|
|
19
|
-
this.opts = opts;
|
|
20
|
-
this.zipFilePath = path.join(opts['target-metadata-dir'], opts['zip-file-name']);
|
|
21
|
-
this.files = (0, output_1.sortFileResponses)((0, output_1.asRelativePaths)(this.result.getFileResponses() ?? []));
|
|
22
|
-
}
|
|
23
|
-
getJson() {
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
25
|
-
const { zipFile, ...responseWithoutZipFile } = this.result.response;
|
|
26
|
-
return { ...responseWithoutZipFile, zipFilePath: this.zipFilePath, files: this.files };
|
|
27
|
-
}
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
29
|
-
async display() {
|
|
30
|
-
core_1.ux.log(exports.retrieveMessages.getMessage('info.WroteZipFile', [this.zipFilePath]));
|
|
31
|
-
if (this.opts.unzip) {
|
|
32
|
-
const extractPath = path.join(this.opts['target-metadata-dir'], path.parse(this.opts['zip-file-name']).name);
|
|
33
|
-
core_1.ux.log(exports.retrieveMessages.getMessage('info.ExtractedZipFile', [this.zipFilePath, extractPath]));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.MetadataRetrieveResultFormatter = MetadataRetrieveResultFormatter;
|
|
38
|
-
//# sourceMappingURL=metadataRetrieveResultFormatter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadataRetrieveResultFormatter.js","sourceRoot":"","sources":["../../src/formatters/metadataRetrieveResultFormatter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA6B;AAC7B,sCAAiC;AAEjC,2CAA4C;AAE5C,4CAAqE;AAErE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC/B,QAAA,gBAAgB,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,mBAAmB,CAAC,CAAC;AAEjH,MAAa,+BAA+B;IAG1C,YACU,MAAsB,EACtB,IAAgF;QADhF,WAAM,GAAN,MAAM,CAAgB;QACtB,SAAI,GAAJ,IAAI,CAA4E;QAExF,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QACjF,IAAI,CAAC,KAAK,GAAG,IAAA,0BAAiB,EAAC,IAAA,wBAAe,EAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxF,CAAC;IAEM,OAAO;QACZ,6DAA6D;QAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,sBAAsB,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACpE,OAAO,EAAE,GAAG,sBAAsB,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACzF,CAAC;IAED,4DAA4D;IACrD,KAAK,CAAC,OAAO;QAClB,SAAE,CAAC,GAAG,CAAC,wBAAgB,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC7E,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACnB,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC7G,SAAE,CAAC,GAAG,CAAC,wBAAgB,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;SAC/F;IACH,CAAC;CACF;AAzBD,0EAyBC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FileResponse, RetrieveResult } from '@salesforce/source-deploy-retrieve';
|
|
2
|
-
import { Formatter, RetrieveResultJson } from '../utils/types';
|
|
3
|
-
export declare class RetrieveResultFormatter implements Formatter<RetrieveResultJson> {
|
|
4
|
-
private result;
|
|
5
|
-
private packageNames;
|
|
6
|
-
private files;
|
|
7
|
-
constructor(result: RetrieveResult, packageNames?: string[], deleteResponses?: FileResponse[]);
|
|
8
|
-
getJson(): RetrieveResultJson;
|
|
9
|
-
display(): Promise<void>;
|
|
10
|
-
private displaySuccesses;
|
|
11
|
-
private displayPackages;
|
|
12
|
-
private getPackages;
|
|
13
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RetrieveResultFormatter = 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 core_1 = require("@oclif/core");
|
|
12
|
-
const core_2 = require("@salesforce/core");
|
|
13
|
-
const types_1 = require("../utils/types");
|
|
14
|
-
const output_1 = require("../utils/output");
|
|
15
|
-
class RetrieveResultFormatter {
|
|
16
|
-
constructor(result, packageNames = [], deleteResponses = []) {
|
|
17
|
-
this.result = result;
|
|
18
|
-
this.packageNames = packageNames;
|
|
19
|
-
this.files = (this.result.getFileResponses() ?? []).concat(deleteResponses);
|
|
20
|
-
}
|
|
21
|
-
getJson() {
|
|
22
|
-
const { zipFile, ...responseWithoutZip } = this.result.response;
|
|
23
|
-
return { ...responseWithoutZip, files: this.files };
|
|
24
|
-
}
|
|
25
|
-
async display() {
|
|
26
|
-
this.displaySuccesses();
|
|
27
|
-
await this.displayPackages();
|
|
28
|
-
}
|
|
29
|
-
displaySuccesses() {
|
|
30
|
-
const successes = (0, output_1.sortFileResponses)((0, output_1.asRelativePaths)(this.files.filter(types_1.isSdrSuccess)));
|
|
31
|
-
if (!successes.length)
|
|
32
|
-
return;
|
|
33
|
-
const columns = {
|
|
34
|
-
state: { header: 'State' },
|
|
35
|
-
fullName: { header: 'Name' },
|
|
36
|
-
type: { header: 'Type' },
|
|
37
|
-
filePath: { header: 'Path' },
|
|
38
|
-
};
|
|
39
|
-
const title = 'Retrieved Source';
|
|
40
|
-
const options = { title: (0, output_1.tableHeader)(title) };
|
|
41
|
-
core_1.ux.log();
|
|
42
|
-
core_1.ux.table((0, output_1.getFileResponseSuccessProps)(successes), columns, options);
|
|
43
|
-
}
|
|
44
|
-
async displayPackages() {
|
|
45
|
-
const packages = await this.getPackages();
|
|
46
|
-
if (packages?.length) {
|
|
47
|
-
const columns = {
|
|
48
|
-
name: { header: 'Package Name' },
|
|
49
|
-
fullPath: { header: 'Converted Location' },
|
|
50
|
-
};
|
|
51
|
-
const title = 'Retrieved Packages';
|
|
52
|
-
const options = { title: (0, output_1.tableHeader)(title) };
|
|
53
|
-
core_1.ux.log();
|
|
54
|
-
core_1.ux.table(packages, columns, options);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
async getPackages() {
|
|
58
|
-
const projectPath = await core_2.SfProject.resolveProjectPath();
|
|
59
|
-
return this.packageNames.map((name) => {
|
|
60
|
-
const packagePath = path.join(projectPath, name);
|
|
61
|
-
return { name, path: packagePath, fullPath: path.resolve(packagePath) };
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.RetrieveResultFormatter = RetrieveResultFormatter;
|
|
66
|
-
//# sourceMappingURL=retrieveResultFormatter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveResultFormatter.js","sourceRoot":"","sources":["../../src/formatters/retrieveResultFormatter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA6B;AAC7B,sCAAiC;AAEjC,2CAA8D;AAC9D,0CAA6E;AAC7E,4CAA+G;AAE/G,MAAa,uBAAuB;IAElC,YACU,MAAsB,EACtB,eAAyB,EAAE,EACnC,kBAAkC,EAAE;QAF5B,WAAM,GAAN,MAAM,CAAgB;QACtB,iBAAY,GAAZ,YAAY,CAAe;QAGnC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,MAA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M,EAAE,cAAc,EAAE;gBAChC,QAAQ,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE;aAC3C,CAAC;YACF,MAAM,KAAK,GAAG,oBAAoB,CAAC;YACnC,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,IAAA,oBAAW,EAAC,KAAK,CAAC,EAAE,CAAC;YAC9C,SAAE,CAAC,GAAG,EAAE,CAAC;YACT,SAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SACtC;IACH,CAAC;IAEO,KAAK,CAAC,WAAW;QACvB,MAAM,WAAW,GAAG,MAAM,gBAAS,CAAC,kBAAkB,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1E,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3DD,0DA2DC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ConvertResult } from '@salesforce/source-deploy-retrieve';
|
|
2
|
-
import { Messages } from '@salesforce/core';
|
|
3
|
-
import { ConvertResultJson, Formatter } from '../utils/types';
|
|
4
|
-
export declare const convertMessages: Messages<string>;
|
|
5
|
-
export declare class SourceConvertResultFormatter implements Formatter<ConvertResultJson> {
|
|
6
|
-
private result;
|
|
7
|
-
constructor(result: ConvertResult);
|
|
8
|
-
getJson(): ConvertResultJson;
|
|
9
|
-
display(): void;
|
|
10
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SourceConvertResultFormatter = exports.convertMessages = 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_1 = require("path");
|
|
11
|
-
const core_1 = require("@oclif/core");
|
|
12
|
-
const core_2 = require("@salesforce/core");
|
|
13
|
-
core_2.Messages.importMessagesDirectory(__dirname);
|
|
14
|
-
exports.convertMessages = core_2.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source');
|
|
15
|
-
class SourceConvertResultFormatter {
|
|
16
|
-
constructor(result) {
|
|
17
|
-
this.result = result;
|
|
18
|
-
}
|
|
19
|
-
getJson() {
|
|
20
|
-
if (!this.result.packagePath) {
|
|
21
|
-
throw new core_2.SfError('Convert result contains no packagePath');
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
location: (0, path_1.resolve)(this.result.packagePath),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
display() {
|
|
28
|
-
if ([0, 69].includes(process.exitCode ?? 0)) {
|
|
29
|
-
core_1.ux.log(exports.convertMessages.getMessage('success', [this.result.packagePath]));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
throw new core_2.SfError(exports.convertMessages.getMessage('convertFailed'), 'ConvertFailed');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.SourceConvertResultFormatter = SourceConvertResultFormatter;
|
|
37
|
-
//# sourceMappingURL=sourceConvertResultFormatter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sourceConvertResultFormatter.js","sourceRoot":"","sources":["../../src/formatters/sourceConvertResultFormatter.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,+BAA+B;AAC/B,sCAAiC;AAEjC,2CAAqD;AAGrD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC/B,QAAA,eAAe,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,gBAAgB,CAAC,CAAC;AAE7G,MAAa,4BAA4B;IACvC,YAA2B,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAC7C,OAAO;QACZ,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;YAC5B,MAAM,IAAI,cAAO,CAAC,wCAAwC,CAAC,CAAC;SAC7D;QACD,OAAO;YACL,QAAQ,EAAE,IAAA,cAAO,EAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;SAC3C,CAAC;IACJ,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,EAAE;YAC3C,SAAE,CAAC,GAAG,CAAC,uBAAe,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;SAC1E;aAAM;YACL,MAAM,IAAI,cAAO,CAAC,uBAAe,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC,CAAC;SACjF;IACH,CAAC;CACF;AAlBD,oEAkBC"}
|
package/lib/utils/coverage.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ApexTestResultData, CoverageReporterOptions, ApexCodeCoverageAggregate } from '@salesforce/apex-node';
|
|
2
|
-
import { Successes, Failures, CodeCoverage } from '@salesforce/source-deploy-retrieve';
|
|
3
|
-
export declare const mapTestResults: <T extends Failures | Successes>(testResults: T[]) => ApexTestResultData[];
|
|
4
|
-
export declare const generateCoveredLines: (cov: CodeCoverage) => [number[], number[]];
|
|
5
|
-
export declare const getCoverageFormattersOptions: (formatters?: string[]) => CoverageReporterOptions;
|
|
6
|
-
export declare const transformCoverageToApexCoverage: (mdCoverage: CodeCoverage[]) => ApexCodeCoverageAggregate;
|
|
7
|
-
export declare const coverageOutput: (cov: CodeCoverage) => Pick<CodeCoverage, 'name' | 'numLocations'> & {
|
|
8
|
-
lineNotCovered: string;
|
|
9
|
-
};
|
package/lib/utils/coverage.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.coverageOutput = exports.transformCoverageToApexCoverage = exports.getCoverageFormattersOptions = exports.generateCoveredLines = exports.mapTestResults = 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 apex_node_1 = require("@salesforce/apex-node");
|
|
12
|
-
const kit_1 = require("@salesforce/kit");
|
|
13
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
14
|
-
const mapTestResults = (testResults) => testResults.map((testResult) => ({
|
|
15
|
-
apexClass: { fullName: testResult.name, id: testResult.id, name: testResult.name, namespacePrefix: '' },
|
|
16
|
-
apexLogId: '',
|
|
17
|
-
asyncApexJobId: '',
|
|
18
|
-
fullName: testResult.name,
|
|
19
|
-
id: testResult.id,
|
|
20
|
-
...('message' in testResult && testResult.message
|
|
21
|
-
? { message: testResult.message, outcome: "Pass" /* ApexTestResultOutcome.Pass */ }
|
|
22
|
-
: { message: null, outcome: "Fail" /* ApexTestResultOutcome.Fail */ }),
|
|
23
|
-
methodName: testResult.methodName,
|
|
24
|
-
queueItemId: '',
|
|
25
|
-
runTime: parseInt(testResult.time, 10),
|
|
26
|
-
stackTrace: 'stackTrace' in testResult ? testResult.stackTrace : null,
|
|
27
|
-
testTimestamp: '',
|
|
28
|
-
}));
|
|
29
|
-
exports.mapTestResults = mapTestResults;
|
|
30
|
-
const generateCoveredLines = (cov) => {
|
|
31
|
-
const numCovered = parseInt(cov.numLocations, 10);
|
|
32
|
-
const numUncovered = parseInt(cov.numLocationsNotCovered, 10);
|
|
33
|
-
const uncoveredLines = (0, kit_1.ensureArray)(cov.locationsNotCovered).map((location) => parseInt(location.line, 10));
|
|
34
|
-
const minLineNumber = uncoveredLines.length ? Math.min(...uncoveredLines) : 1;
|
|
35
|
-
const lines = [...Array(numCovered + numUncovered).keys()].map((i) => i + minLineNumber);
|
|
36
|
-
const coveredLines = lines.filter((line) => !uncoveredLines.includes(line));
|
|
37
|
-
return [uncoveredLines, coveredLines];
|
|
38
|
-
};
|
|
39
|
-
exports.generateCoveredLines = generateCoveredLines;
|
|
40
|
-
const getCoverageFormattersOptions = (formatters = []) => {
|
|
41
|
-
const reportFormats = formatters;
|
|
42
|
-
const reportOptions = Object.fromEntries(reportFormats.map((format) => {
|
|
43
|
-
const formatDefaults = apex_node_1.DefaultReportOptions[format];
|
|
44
|
-
return [
|
|
45
|
-
format,
|
|
46
|
-
{
|
|
47
|
-
...formatDefaults,
|
|
48
|
-
// always join any subdir from the defaults with our custom coverage dir
|
|
49
|
-
...('subdir' in formatDefaults ? { subdir: path.join('coverage', formatDefaults.subdir) } : {}),
|
|
50
|
-
// if there is no subdir, we also put the file in the coverage dir, otherwise leave it alone
|
|
51
|
-
...('file' in formatDefaults && !('subdir' in formatDefaults)
|
|
52
|
-
? { file: path.join('coverage', formatDefaults.file) }
|
|
53
|
-
: {}),
|
|
54
|
-
},
|
|
55
|
-
];
|
|
56
|
-
}));
|
|
57
|
-
return {
|
|
58
|
-
reportFormats,
|
|
59
|
-
reportOptions,
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
exports.getCoverageFormattersOptions = getCoverageFormattersOptions;
|
|
63
|
-
const transformCoverageToApexCoverage = (mdCoverage) => {
|
|
64
|
-
const apexCoverage = mdCoverage.map((cov) => {
|
|
65
|
-
const numCovered = parseInt(cov.numLocations, 10);
|
|
66
|
-
const numUncovered = parseInt(cov.numLocationsNotCovered, 10);
|
|
67
|
-
const [uncoveredLines, coveredLines] = (0, exports.generateCoveredLines)(cov);
|
|
68
|
-
const ac = {
|
|
69
|
-
ApexClassOrTrigger: {
|
|
70
|
-
Id: cov.id,
|
|
71
|
-
Name: cov.name,
|
|
72
|
-
},
|
|
73
|
-
NumLinesCovered: numCovered,
|
|
74
|
-
NumLinesUncovered: numUncovered,
|
|
75
|
-
Coverage: {
|
|
76
|
-
coveredLines,
|
|
77
|
-
uncoveredLines,
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
return ac;
|
|
81
|
-
});
|
|
82
|
-
return { done: true, totalSize: apexCoverage.length, records: apexCoverage };
|
|
83
|
-
};
|
|
84
|
-
exports.transformCoverageToApexCoverage = transformCoverageToApexCoverage;
|
|
85
|
-
const coverageOutput = (cov) => {
|
|
86
|
-
const numLocationsNum = parseInt(cov.numLocations, 10);
|
|
87
|
-
const numLocationsNotCovered = parseInt(cov.numLocationsNotCovered, 10);
|
|
88
|
-
const color = numLocationsNotCovered > 0 ? sf_plugins_core_1.StandardColors.error : sf_plugins_core_1.StandardColors.success;
|
|
89
|
-
let pctCovered = 100;
|
|
90
|
-
const coverageDecimal = parseFloat(((numLocationsNum - numLocationsNotCovered) / numLocationsNum).toFixed(2));
|
|
91
|
-
if (numLocationsNum > 0) {
|
|
92
|
-
pctCovered = coverageDecimal * 100;
|
|
93
|
-
}
|
|
94
|
-
// cov.numLocations = color(`${pctCovered}%`);
|
|
95
|
-
const base = {
|
|
96
|
-
name: cov.name,
|
|
97
|
-
numLocations: color(`${pctCovered}%`),
|
|
98
|
-
};
|
|
99
|
-
if (!cov.locationsNotCovered) {
|
|
100
|
-
return { ...base, lineNotCovered: '' };
|
|
101
|
-
}
|
|
102
|
-
const locations = (0, kit_1.ensureArray)(cov.locationsNotCovered);
|
|
103
|
-
return {
|
|
104
|
-
...base,
|
|
105
|
-
lineNotCovered: locations.map((location) => location.line).join(','),
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
exports.coverageOutput = coverageOutput;
|
|
109
|
-
//# sourceMappingURL=coverage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../src/utils/coverage.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA6B;AAE7B,qDAQ+B;AAE/B,yCAA8C;AAC9C,iEAA6D;AAEtD,MAAM,cAAc,GAAG,CAAiC,WAAgB,EAAwB,EAAE,CACvG,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/B,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE,EAAE;IACvG,SAAS,EAAE,EAAE;IACb,cAAc,EAAE,EAAE;IAClB,QAAQ,EAAE,UAAU,CAAC,IAAI;IACzB,EAAE,EAAE,UAAU,CAAC,EAAE;IACjB,GAAG,CAAC,SAAS,IAAI,UAAU,IAAI,UAAU,CAAC,OAAO;QAC/C,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,yCAA4B,EAAE;QACtE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,yCAA4B,EAAE,CAAC;IAC3D,UAAU,EAAE,UAAU,CAAC,UAAU;IACjC,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC;IACtC,UAAU,EAAE,YAAY,IAAI,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI;IACrE,aAAa,EAAE,EAAE;CAClB,CAAC,CAAC,CAAC;AAfO,QAAA,cAAc,kBAerB;AAEC,MAAM,oBA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,CAAC,CAAC;AA3BW,QAAA,cAAc,kBA2BzB"}
|
|
@@ -1,5 +0,0 @@
|
|
|
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>;
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
// when we write a manifest, we will omit the CustomLabels component since it's redundant with the individual labels.
|
|
19
|
-
// 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
|
|
20
|
-
// regardless of whether they were actually deployed
|
|
21
|
-
const xml = await componentSet.filter((c) => c.type.name !== 'CustomLabels').getPackageXml();
|
|
22
|
-
const filePath = getManifestFilePath(jobId);
|
|
23
|
-
await fs.promises.mkdir(path.dirname(filePath), { recursive: true });
|
|
24
|
-
await fs.promises.writeFile(filePath, xml);
|
|
25
|
-
return filePath;
|
|
26
|
-
};
|
|
27
|
-
exports.writeManifest = writeManifest;
|
|
28
|
-
const maybeDestroyManifest = async (jobId) => {
|
|
29
|
-
try {
|
|
30
|
-
return await fs.promises.rm(getManifestFilePath(jobId));
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
// that's ok in a maybe
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.maybeDestroyManifest = maybeDestroyManifest;
|
|
37
|
-
const getManifestFilePath = (jobId) => path.join((0, os_1.homedir)(), core_1.Global.SF_STATE_FOLDER, MANIFEST_CACHE_DIR, `${jobId}.xml`);
|
|
38
|
-
//# sourceMappingURL=manifestCache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifestCache.js","sourceRoot":"","sources":["../../src/utils/manifestCache.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,6BAA6B;AAC7B,2BAA6B;AAC7B,yBAAyB;AAEzB,2CAA0C;AAE1C,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAE3C;uCACuC;AAChC,MAAM,aAAa,GAAG,KAAK,EAAE,KAAa,EAAE,YAA0B,EAAmB,EAAE;IAChG,qHAAqH;IACrH,uJAAuJ;IACvJ,oDAAoD;IACpD,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,aAAa,EAAE,CAAC;IAC7F,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACrE,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AATW,QAAA,aAAa,iBASxB;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"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# summary
|
|
2
|
-
|
|
3
|
-
Convert metadata retrieved via Metadata API into the source format used in Salesforce DX projects.
|
|
4
|
-
|
|
5
|
-
# description
|
|
6
|
-
|
|
7
|
-
To use Salesforce CLI to work with components that you retrieved via Metadata API, first convert your files from the metadata format to the source format using this command.
|
|
8
|
-
|
|
9
|
-
To convert files from the source format back to the metadata format, run "<%= config.bin %> project convert source".
|
|
10
|
-
|
|
11
|
-
# examples
|
|
12
|
-
|
|
13
|
-
- Convert metadata formatted files in the specified directory into source formatted files; writes converted files to your default package directory:
|
|
14
|
-
|
|
15
|
-
$ <%= config.bin %> <%= command.id %> --root-dir path/to/metadata
|
|
16
|
-
|
|
17
|
-
- Similar to previous example, but writes converted files to the specified output directory:
|
|
18
|
-
|
|
19
|
-
$ <%= config.bin %> <%= command.id %> --root-dir path/to/metadata --output-dir path/to/outputdir
|
|
20
|
-
|
|
21
|
-
# flags.root-dir.summary
|
|
22
|
-
|
|
23
|
-
Root directory that contains the Metadata API–formatted metadata.
|
|
24
|
-
|
|
25
|
-
# flags.output-dir.summary
|
|
26
|
-
|
|
27
|
-
Directory to store your files in after they’re converted to source format; can be an absolute or relative path.
|
|
28
|
-
|
|
29
|
-
# flags.manifest.summary
|
|
30
|
-
|
|
31
|
-
File path to manifest (package.xml) of metadata types to convert.
|
|
32
|
-
|
|
33
|
-
# flags.metadata-dir.summary
|
|
34
|
-
|
|
35
|
-
Comma-separated list of paths to the local metadata files to convert.
|
|
36
|
-
|
|
37
|
-
# flags.metadata.summary
|
|
38
|
-
|
|
39
|
-
Comma-separated list of metadata component names to convert.
|
|
40
|
-
|
|
41
|
-
# flags.manifest.description
|
|
42
|
-
|
|
43
|
-
If you specify this parameter, don’t specify --metadata or --source-dir.
|
|
44
|
-
|
|
45
|
-
# flags.metadata-dir.description
|
|
46
|
-
|
|
47
|
-
The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories).
|
|
48
|
-
|
|
49
|
-
If you specify this flag, don’t specify --manifest or --metadata. If the comma-separated list you’re supplying contains spaces, enclose the entire comma-separated list in one set of double quotes.
|
|
50
|
-
|
|
51
|
-
# expectedDirectory
|
|
52
|
-
|
|
53
|
-
Expected a directory but found a file.
|
|
54
|
-
|
|
55
|
-
# expectedFile
|
|
56
|
-
|
|
57
|
-
Expected a file but found a directory.
|
|
58
|
-
|
|
59
|
-
# InvalidFlagPath
|
|
60
|
-
|
|
61
|
-
The %s command parameter specifies an invalid path: %s
|
|
62
|
-
%s
|
|
63
|
-
|
|
64
|
-
# notFound
|
|
65
|
-
|
|
66
|
-
No such file or directory.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# summary
|
|
2
|
-
|
|
3
|
-
Convert source-formatted files into metadata that you can deploy using Metadata API.
|
|
4
|
-
|
|
5
|
-
# description
|
|
6
|
-
|
|
7
|
-
To convert source-formatted files into the metadata format, so that you can deploy them using Metadata API, run this command. Then deploy the metadata using "<%= config.bin %> project deploy".
|
|
8
|
-
|
|
9
|
-
To convert Metadata API–formatted files into the source format, run "<%= config.bin %> project convert mdapi".
|
|
10
|
-
|
|
11
|
-
To specify a package name that includes spaces, enclose the name in single quotes.
|
|
12
|
-
|
|
13
|
-
# examples
|
|
14
|
-
|
|
15
|
-
- Convert source-formatted files in the specified directory into metadata-formatted files; writes converted files into a new directory:
|
|
16
|
-
|
|
17
|
-
$ <%= config.bin %> <%= command.id %> --root-dir path/to/source
|
|
18
|
-
|
|
19
|
-
- Similar to previous example, but writes converted files to the specified output directory and associates the files with the specified package:
|
|
20
|
-
|
|
21
|
-
$ <%= config.bin %> <%= command.id %> --root-dir path/to/source --output-dir path/to/outputdir --package-name 'My Package'
|
|
22
|
-
|
|
23
|
-
# flags.root-dir.summary
|
|
24
|
-
|
|
25
|
-
Source directory other than the default package to convert.
|
|
26
|
-
|
|
27
|
-
# flags.output-dir.summary
|
|
28
|
-
|
|
29
|
-
Output directory to store the Metadata API–formatted files in.
|
|
30
|
-
|
|
31
|
-
# flags.package-name.summary
|
|
32
|
-
|
|
33
|
-
Name of the package to associate with the metadata-formatted files.
|
|
34
|
-
|
|
35
|
-
# flags.manifest.summary
|
|
36
|
-
|
|
37
|
-
Path to the manifest (package.xml) file that specifies the metadata types to convert.
|
|
38
|
-
|
|
39
|
-
# flags.source-dir.summary
|
|
40
|
-
|
|
41
|
-
Comma-separated list of paths to the local source files to convert.
|
|
42
|
-
|
|
43
|
-
# flags.metadata.summary
|
|
44
|
-
|
|
45
|
-
Comma-separated list of metadata component names to convert.
|
|
46
|
-
|
|
47
|
-
# flags.manifest.description
|
|
48
|
-
|
|
49
|
-
If you specify this parameter, don’t specify --metadata or --source-dir.
|
|
50
|
-
|
|
51
|
-
# flags.source-dir.description
|
|
52
|
-
|
|
53
|
-
The supplied paths can be to a single file (in which case the operation is applied to only one file) or to a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories).
|
|
54
|
-
|
|
55
|
-
If you specify this parameter, don’t specify --manifest or --metadata.
|
|
56
|
-
|
|
57
|
-
# success
|
|
58
|
-
|
|
59
|
-
Source was successfully converted to Metadata API format and written to the location: %s
|
|
60
|
-
|
|
61
|
-
# convertFailed
|
|
62
|
-
|
|
63
|
-
Failed to convert source
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# summary
|
|
2
|
-
|
|
3
|
-
Delete source from your project and from a non-source-tracked org.
|
|
4
|
-
|
|
5
|
-
# description
|
|
6
|
-
|
|
7
|
-
Use this command to delete components from orgs that don’t have source tracking. To remove deleted items from orgs that have source tracking enabled, "sf project deploy start".
|
|
8
|
-
|
|
9
|
-
When you run this command, both the local source file and the metadata component in the org are deleted.
|
|
10
|
-
|
|
11
|
-
# examples
|
|
12
|
-
|
|
13
|
-
- Delete all local Apex source files and all Apex classes from the org with alias "my-scratch":
|
|
14
|
-
|
|
15
|
-
<%= config.bin %> <%= command.id %> --metadata ApexClass --target-org my-scratch
|
|
16
|
-
|
|
17
|
-
- Delete a specific Apex class and a Profile that has a space in it from your default org; don't prompt for confirmation:
|
|
18
|
-
|
|
19
|
-
<%= config.bin %> <%= command.id %> --metadata ApexClass:MyFabulousApexClass --metadata "Profile: My Profile" --no-prompt
|
|
20
|
-
|
|
21
|
-
- Run the tests that aren’t in any managed packages as part of the deletion; if the delete succeeds, and the org has source-tracking enabled, update the source tracking information:
|
|
22
|
-
|
|
23
|
-
<%= config.bin %> <%= command.id %> --metadata ApexClass --test-level RunLocalTests --track-source
|
|
24
|
-
|
|
25
|
-
- Delete the Apex source files in a directory and the corresponding components from your default org:
|
|
26
|
-
|
|
27
|
-
<%= config.bin %> <%= command.id %> --source-dir force-app/main/default/classes
|
|
28
|
-
|
|
29
|
-
- Delete all components listed in a manifest:
|
|
30
|
-
|
|
31
|
-
<%= config.bin %> <%= command.id %> --manifest path/to/package.xml
|
|
32
|
-
|
|
33
|
-
# flags.source-dir.summary
|
|
34
|
-
|
|
35
|
-
Comma-separated list of source file paths to delete.
|
|
36
|
-
|
|
37
|
-
# flags.metadata.summary
|
|
38
|
-
|
|
39
|
-
Comma-separated list of names of metadata components to delete.
|
|
40
|
-
|
|
41
|
-
# flags.no-prompt.summary
|
|
42
|
-
|
|
43
|
-
Don't prompt for delete confirmation.
|
|
44
|
-
|
|
45
|
-
# flags.wait.summary
|
|
46
|
-
|
|
47
|
-
Number of minutes to wait for the command to finish.
|
|
48
|
-
|
|
49
|
-
# flags.check-only.summary
|
|
50
|
-
|
|
51
|
-
Validate delete command but don't delete anything from the org or the local project.
|
|
52
|
-
|
|
53
|
-
# flags.test-Level.summary
|
|
54
|
-
|
|
55
|
-
Deployment Apex testing level.
|
|
56
|
-
|
|
57
|
-
# flags.track-source.summary
|
|
58
|
-
|
|
59
|
-
If the delete succeeds, update the source tracking information.
|
|
60
|
-
|
|
61
|
-
# flags.force-overwrite.summary
|
|
62
|
-
|
|
63
|
-
Ignore conflict warnings and overwrite changes to the org.
|
|
64
|
-
|
|
65
|
-
# flags.verbose.summary
|
|
66
|
-
|
|
67
|
-
Verbose output of the delete result.
|
|
68
|
-
|
|
69
|
-
# flags.check-only.description
|
|
70
|
-
|
|
71
|
-
IMPORTANT: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.
|
|
72
|
-
|
|
73
|
-
Validates the deleted metadata and runs all Apex tests, but prevents the deletion from being saved to the org.
|
|
74
|
-
|
|
75
|
-
If you change a field type from Master-Detail to Lookup or vice versa, that change isn’t supported when using the --chec-konly parameter to test a deletion (validation). This kind of change isn’t supported for test deletions to avoid the risk of data loss or corruption. If a change that isn’t supported for test deletions is included in a deletion package, the test deletion fails and issues an error.
|
|
76
|
-
|
|
77
|
-
If your deletion package changes a field type from Master-Detail to Lookup or vice versa, you can still validate the changes prior to deploying to Production by performing a full deletion to another test Sandbox. A full deletion includes a validation of the changes as part of the deletion process.
|
|
78
|
-
|
|
79
|
-
Note: A Metadata API deletion that includes Master-Detail relationships deletes all detail records in the Recycle Bin in the following cases.
|
|
80
|
-
|
|
81
|
-
1. For a deletion with a new Master-Detail field, soft delete (send to the Recycle Bin) all detail records before proceeding to delete the Master-Detail field, or the deletion fails. During the deletion, detail records are permanently deleted from the Recycle Bin and cannot be recovered.
|
|
82
|
-
|
|
83
|
-
2. For a deletion that converts a Lookup field relationship to a Master-Detail relationship, detail records must reference a master record or be soft-deleted (sent to the Recycle Bin) for the deletion to succeed. However, a successful deletion permanently deletes any detail records in the Recycle Bin.
|
|
84
|
-
|
|
85
|
-
# flags.metadata.description
|
|
86
|
-
|
|
87
|
-
If you specify this parameter, don’t specify --source-dir.
|
|
88
|
-
|
|
89
|
-
# flags.source-dir.description
|
|
90
|
-
|
|
91
|
-
The supplied paths can be a single file (in which case the operation is applied to only one file) or a folder (in which case the operation is applied to all metadata types in the directory and its sub-directories).
|
|
92
|
-
|
|
93
|
-
If you specify this parameter, don’t specify --metadata.
|
|
94
|
-
|
|
95
|
-
# flags.wait.description
|
|
96
|
-
|
|
97
|
-
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
|
|
98
|
-
|
|
99
|
-
# flags.test-Level.description
|
|
100
|
-
|
|
101
|
-
Valid values are:
|
|
102
|
-
|
|
103
|
-
- NoTestRun — No tests are run. This test level applies only to deployments to development environments, such as sandbox, Developer Edition, or trial orgs. This test level is the default for development environments.
|
|
104
|
-
- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default for production deployments that include Apex classes or triggers.
|
|
105
|
-
- RunAllTestsInOrg — All tests in your org are run, including tests of managed packages.
|
|
106
|
-
|
|
107
|
-
If you don’t specify a test level, the default behavior depends on the contents of your deployment package. For more information, see “Running Tests in a Deployment” in the Metadata API Developer Guide.
|
|
108
|
-
|
|
109
|
-
# localPrompt
|
|
110
|
-
|
|
111
|
-
This operation will delete the following files on your computer and in your org:
|
|
112
|
-
%s
|
|
113
|
-
|
|
114
|
-
# remotePrompt
|
|
115
|
-
|
|
116
|
-
This operation will delete the following metadata in your org:
|
|
117
|
-
%s
|
|
118
|
-
|
|
119
|
-
# deployPrompt
|
|
120
|
-
|
|
121
|
-
This operation will deploy the following:
|
|
122
|
-
%s
|
|
123
|
-
|
|
124
|
-
# areYouSure
|
|
125
|
-
|
|
126
|
-
Are you sure you want to proceed?
|
|
127
|
-
|
|
128
|
-
# areYouSureCheckOnly
|
|
129
|
-
|
|
130
|
-
Are you sure you want to proceed (this is only a check and won't actually delete anything)?
|
|
131
|
-
|
|
132
|
-
# conflictMsg
|
|
133
|
-
|
|
134
|
-
We couldn't complete the operation due to conflicts. Verify that you want to keep the existing versions, then run the command again with the --force-overwrite (-f) option.
|