@salesforce/plugin-deploy-retrieve 1.8.6 → 1.8.8-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/commands/deploy.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ export default class Deploy extends SfCommand<void> {
|
|
|
6
6
|
static readonly description: string;
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static enableJsonFlag: boolean;
|
|
9
|
+
static state: string;
|
|
10
|
+
static deprecationOptions: {
|
|
11
|
+
version: string;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
9
14
|
static readonly flags: {
|
|
10
15
|
interactive: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
16
|
};
|
package/lib/commands/deploy.js
CHANGED
|
@@ -175,6 +175,11 @@ Deploy.summary = messages.getMessage('summary');
|
|
|
175
175
|
Deploy.description = messages.getMessage('description');
|
|
176
176
|
Deploy.examples = messages.getMessages('examples');
|
|
177
177
|
Deploy.enableJsonFlag = false;
|
|
178
|
+
Deploy.state = 'deprecated';
|
|
179
|
+
Deploy.deprecationOptions = {
|
|
180
|
+
version: '59.0',
|
|
181
|
+
message: messages.getMessage('deprecation'),
|
|
182
|
+
};
|
|
178
183
|
Deploy.flags = {
|
|
179
184
|
interactive: sf_plugins_core_1.Flags.boolean({
|
|
180
185
|
summary: messages.getMessage('flags.interactive.summary'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../src/commands/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,OAAO,EAAE,EAAE,CAAC,CAAC;gBACzD,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI;gBAC7B,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO;aACpC,CAAC,CAAC,CAAC;YACJ,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,4BAA4B,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YACjC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;YACzD,GAAG,CAAC,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC;YAChC,MAAM,GAAG,CAAC;SACX;IACH,CAAC;;AAzLH,yBA0LC;AAzLwB,cAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,kBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,eAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACrD,qBAAc,GAAG,KAAK,CAAC;AACvB,YAAK,GAAG,YAAY,CAAC;AACrB,yBAAkB,GAAG;IACjC,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC;CAC5C,CAAC;AAEqB,YAAK,GAAG;IAC7B,WAAW,EAAE,uBAAK,CAAC,OAAO,CAAC;QACzB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC;KAC1D,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { Interfaces } from '@oclif/core';
|
|
3
|
+
import { ConvertMdapiJson } from '../../../utils/types';
|
|
4
|
+
export interface EnsureFsFlagOptions {
|
|
5
|
+
flagName: string;
|
|
6
|
+
path: string;
|
|
7
|
+
type: 'dir' | 'file' | 'any';
|
|
8
|
+
throwOnENOENT?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class Mdapi extends SfCommand<ConvertMdapiJson> {
|
|
11
|
+
static readonly aliases: string[];
|
|
12
|
+
static readonly deprecateAliases = true;
|
|
13
|
+
static readonly summary: string;
|
|
14
|
+
static readonly description: string;
|
|
15
|
+
static readonly examples: string[];
|
|
16
|
+
static readonly requiresProject = true;
|
|
17
|
+
static readonly flags: {
|
|
18
|
+
'api-version': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
+
loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
20
|
+
'root-dir': Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
+
'output-dir': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
+
manifest: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
+
'metadata-dir': Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
|
+
metadata: Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
|
+
};
|
|
26
|
+
private flags;
|
|
27
|
+
private componentSet?;
|
|
28
|
+
private convertResult?;
|
|
29
|
+
run(): Promise<ConvertMdapiJson>;
|
|
30
|
+
protected convert(): Promise<void>;
|
|
31
|
+
protected formatResult(): ConvertMdapiJson;
|
|
32
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2020, 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.Mdapi = void 0;
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const core_1 = require("@salesforce/core");
|
|
13
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
14
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
15
|
+
const metadataConvertResultFormatter_1 = require("../../../formatters/metadataConvertResultFormatter");
|
|
16
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
17
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.mdapi');
|
|
18
|
+
class Mdapi extends sf_plugins_core_1.SfCommand {
|
|
19
|
+
async run() {
|
|
20
|
+
this.flags = (await this.parse(Mdapi)).flags;
|
|
21
|
+
await this.convert();
|
|
22
|
+
return this.formatResult();
|
|
23
|
+
}
|
|
24
|
+
async convert() {
|
|
25
|
+
const [outputDir] = await Promise.all([
|
|
26
|
+
resolveOutputDir(this.flags['output-dir'] ?? this.project.getDefaultPackage().path),
|
|
27
|
+
resolveMetadataPaths(this.flags['metadata-dir'] ?? []),
|
|
28
|
+
]);
|
|
29
|
+
let paths = [];
|
|
30
|
+
if (this.flags['metadata-dir']) {
|
|
31
|
+
paths = this.flags['metadata-dir'];
|
|
32
|
+
}
|
|
33
|
+
else if (!this.flags.manifest && !this.flags.metadata) {
|
|
34
|
+
paths = [this.flags['root-dir']];
|
|
35
|
+
}
|
|
36
|
+
this.componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
37
|
+
sourcepath: paths,
|
|
38
|
+
manifest: this.flags.manifest
|
|
39
|
+
? {
|
|
40
|
+
manifestPath: this.flags.manifest,
|
|
41
|
+
directoryPaths: [this.flags['root-dir']],
|
|
42
|
+
}
|
|
43
|
+
: undefined,
|
|
44
|
+
metadata: this.flags.metadata
|
|
45
|
+
? {
|
|
46
|
+
metadataEntries: this.flags.metadata,
|
|
47
|
+
directoryPaths: [this.flags['root-dir']],
|
|
48
|
+
}
|
|
49
|
+
: undefined,
|
|
50
|
+
});
|
|
51
|
+
const numOfComponents = this.componentSet.getSourceComponents().toArray().length;
|
|
52
|
+
if (numOfComponents > 0) {
|
|
53
|
+
this.spinner.start(`Converting ${numOfComponents} metadata components`);
|
|
54
|
+
const converter = new source_deploy_retrieve_1.MetadataConverter();
|
|
55
|
+
this.convertResult = await converter.convert(this.componentSet, 'source', {
|
|
56
|
+
type: 'directory',
|
|
57
|
+
outputDirectory: outputDir,
|
|
58
|
+
genUniqueDir: false,
|
|
59
|
+
});
|
|
60
|
+
this.spinner.stop();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
formatResult() {
|
|
64
|
+
if (!this.convertResult) {
|
|
65
|
+
throw new core_1.SfError('No results to format');
|
|
66
|
+
}
|
|
67
|
+
const formatter = new metadataConvertResultFormatter_1.MetadataConvertResultFormatter(this.convertResult);
|
|
68
|
+
if (!this.jsonEnabled()) {
|
|
69
|
+
formatter.display();
|
|
70
|
+
}
|
|
71
|
+
return formatter.getJson();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.Mdapi = Mdapi;
|
|
75
|
+
Mdapi.aliases = ['force:mdapi:convert'];
|
|
76
|
+
Mdapi.deprecateAliases = true;
|
|
77
|
+
Mdapi.summary = messages.getMessage('summary');
|
|
78
|
+
Mdapi.description = messages.getMessage('description');
|
|
79
|
+
Mdapi.examples = messages.getMessages('examples');
|
|
80
|
+
Mdapi.requiresProject = true;
|
|
81
|
+
Mdapi.flags = {
|
|
82
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
83
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
84
|
+
'root-dir': sf_plugins_core_1.Flags.directory({
|
|
85
|
+
aliases: ['rootdir'],
|
|
86
|
+
deprecateAliases: true,
|
|
87
|
+
char: 'r',
|
|
88
|
+
summary: messages.getMessage('flags.root-dir.summary'),
|
|
89
|
+
required: true,
|
|
90
|
+
exists: true,
|
|
91
|
+
}),
|
|
92
|
+
'output-dir': sf_plugins_core_1.Flags.directory({
|
|
93
|
+
aliases: ['outputdir'],
|
|
94
|
+
deprecateAliases: true,
|
|
95
|
+
char: 'd',
|
|
96
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
97
|
+
}),
|
|
98
|
+
manifest: sf_plugins_core_1.Flags.file({
|
|
99
|
+
char: 'x',
|
|
100
|
+
description: messages.getMessage('flags.manifest.description'),
|
|
101
|
+
summary: messages.getMessage('flags.manifest.summary'),
|
|
102
|
+
exists: true,
|
|
103
|
+
}),
|
|
104
|
+
'metadata-dir': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
105
|
+
char: 'p',
|
|
106
|
+
aliases: ['metadatapath'],
|
|
107
|
+
deprecateAliases: true,
|
|
108
|
+
description: messages.getMessage('flags.metadata-dir.description'),
|
|
109
|
+
summary: messages.getMessage('flags.metadata-dir.summary'),
|
|
110
|
+
exclusive: ['manifest', 'metadata'],
|
|
111
|
+
}),
|
|
112
|
+
metadata: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
113
|
+
char: 'm',
|
|
114
|
+
summary: messages.getMessage('flags.metadata.summary'),
|
|
115
|
+
exclusive: ['manifest', 'metadatapath'],
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
const resolveOutputDir = async (outputDir) => ensureFlagPath({
|
|
119
|
+
flagName: 'outputdir',
|
|
120
|
+
path: outputDir,
|
|
121
|
+
type: 'dir',
|
|
122
|
+
});
|
|
123
|
+
const resolveMetadataPaths = async (metadataPaths) => Promise.all(metadataPaths
|
|
124
|
+
.filter((mdPath) => mdPath?.length)
|
|
125
|
+
.map((mdPath) => ensureFlagPath({
|
|
126
|
+
flagName: 'metadatapath',
|
|
127
|
+
path: mdPath,
|
|
128
|
+
type: 'any',
|
|
129
|
+
throwOnENOENT: true,
|
|
130
|
+
})));
|
|
131
|
+
/**
|
|
132
|
+
* Ensures command flags that are file system paths are set properly before
|
|
133
|
+
* continuing command execution. Can also create directories that don't yet
|
|
134
|
+
* exist in the path.
|
|
135
|
+
*
|
|
136
|
+
* @param options defines the path to resolve and the expectations
|
|
137
|
+
* @returns the resolved flag path
|
|
138
|
+
*/
|
|
139
|
+
const ensureFlagPath = async (options) => {
|
|
140
|
+
const { flagName, path, type, throwOnENOENT } = options;
|
|
141
|
+
const resolvedPath = (0, path_1.resolve)(path?.trim());
|
|
142
|
+
try {
|
|
143
|
+
const stats = await fs.promises.stat(resolvedPath);
|
|
144
|
+
if (type !== 'any') {
|
|
145
|
+
const isDir = stats.isDirectory();
|
|
146
|
+
if (type === 'dir' && !isDir) {
|
|
147
|
+
throw messages.createError('InvalidFlagPath', [flagName, path, messages.getMessage('expectedDirectory')]);
|
|
148
|
+
}
|
|
149
|
+
else if (type === 'file' && isDir) {
|
|
150
|
+
throw messages.createError(messages.getMessage('InvalidFlagPath', [flagName, path, messages.getMessage('expectedFile')]));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return resolvedPath;
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
if (error instanceof Error && 'code' in error && error.code !== 'ENOENT') {
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
if (throwOnENOENT) {
|
|
161
|
+
const enoent = messages.getMessage('notFound');
|
|
162
|
+
throw new core_1.SfError(messages.getMessage('InvalidFlagPath', [flagName, path, enoent]), 'InvalidFlagPath');
|
|
163
|
+
}
|
|
164
|
+
const dir = type === 'dir' ? resolvedPath : (0, path_1.dirname)(resolvedPath);
|
|
165
|
+
// using as because fs promises always returns a string when recursive is true
|
|
166
|
+
return fs.promises.mkdir(dir, { recursive: true });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=mdapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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E,IAAI,EAAE,CAAoB,CAAC;SACvE;KACF;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ConvertResult } from '@salesforce/source-deploy-retrieve';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { Interfaces } from '@oclif/core';
|
|
4
|
+
import { ConvertResultJson } from '../../../utils/types';
|
|
5
|
+
export declare class Source extends SfCommand<ConvertResultJson> {
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly description: string;
|
|
8
|
+
static readonly examples: string[];
|
|
9
|
+
static readonly requiresProject = true;
|
|
10
|
+
static readonly aliases: string[];
|
|
11
|
+
static readonly deprecateAliases = true;
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'api-version': {
|
|
14
|
+
summary: string;
|
|
15
|
+
name: string;
|
|
16
|
+
char?: Interfaces.AlphabetLowercase | Interfaces.AlphabetUppercase | undefined;
|
|
17
|
+
description?: string | undefined;
|
|
18
|
+
helpLabel?: string | undefined;
|
|
19
|
+
helpGroup?: string | undefined;
|
|
20
|
+
env?: string | undefined;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
required?: boolean | undefined;
|
|
23
|
+
dependsOn?: string[] | undefined;
|
|
24
|
+
exclusive?: string[] | undefined;
|
|
25
|
+
exactlyOne?: string[] | undefined;
|
|
26
|
+
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[] | undefined;
|
|
27
|
+
deprecated?: true | Interfaces.Deprecation | undefined;
|
|
28
|
+
aliases?: string[] | undefined;
|
|
29
|
+
deprecateAliases?: boolean | undefined;
|
|
30
|
+
delimiter?: "," | undefined;
|
|
31
|
+
type: "option";
|
|
32
|
+
helpValue?: string | undefined;
|
|
33
|
+
options?: string[] | undefined;
|
|
34
|
+
multiple: false;
|
|
35
|
+
parse: import("@oclif/core/lib/interfaces/parser").FlagParser<string | undefined, string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
36
|
+
defaultHelp?: import("@oclif/core/lib/interfaces/parser").FlagDefaultHelp<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
37
|
+
input: string[];
|
|
38
|
+
default?: import("@oclif/core/lib/interfaces/parser").FlagDefault<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
39
|
+
} | {
|
|
40
|
+
summary: string;
|
|
41
|
+
name: string;
|
|
42
|
+
char?: Interfaces.AlphabetLowercase | Interfaces.AlphabetUppercase | undefined;
|
|
43
|
+
description?: string | undefined;
|
|
44
|
+
helpLabel?: string | undefined;
|
|
45
|
+
helpGroup?: string | undefined;
|
|
46
|
+
env?: string | undefined;
|
|
47
|
+
hidden?: boolean | undefined;
|
|
48
|
+
required?: boolean | undefined;
|
|
49
|
+
dependsOn?: string[] | undefined;
|
|
50
|
+
exclusive?: string[] | undefined;
|
|
51
|
+
exactlyOne?: string[] | undefined;
|
|
52
|
+
relationships?: import("@oclif/core/lib/interfaces/parser").Relationship[] | undefined;
|
|
53
|
+
deprecated?: true | Interfaces.Deprecation | undefined;
|
|
54
|
+
aliases?: string[] | undefined;
|
|
55
|
+
deprecateAliases?: boolean | undefined;
|
|
56
|
+
delimiter?: "," | undefined;
|
|
57
|
+
type: "option";
|
|
58
|
+
helpValue?: string | undefined;
|
|
59
|
+
options?: string[] | undefined;
|
|
60
|
+
multiple: true;
|
|
61
|
+
parse: import("@oclif/core/lib/interfaces/parser").FlagParser<string | undefined, string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
62
|
+
defaultHelp?: import("@oclif/core/lib/interfaces/parser").FlagDefaultHelp<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
63
|
+
input: string[];
|
|
64
|
+
default?: import("@oclif/core/lib/interfaces/parser").FlagDefault<(string | undefined)[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
65
|
+
};
|
|
66
|
+
loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
67
|
+
'root-dir': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
68
|
+
'output-dir': Interfaces.OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
69
|
+
'package-name': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
70
|
+
manifest: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
71
|
+
'source-dir': Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
72
|
+
metadata: Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
73
|
+
};
|
|
74
|
+
protected convertResult: ConvertResult;
|
|
75
|
+
private flags;
|
|
76
|
+
private componentSet;
|
|
77
|
+
run(): Promise<ConvertResultJson>;
|
|
78
|
+
protected convert(): Promise<void>;
|
|
79
|
+
protected resolveSuccess(): void;
|
|
80
|
+
protected formatResult(): ConvertResultJson;
|
|
81
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2020, 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.Source = void 0;
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const core_1 = require("@salesforce/core");
|
|
13
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
14
|
+
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
16
|
+
const project_1 = require("../../../utils/project");
|
|
17
|
+
const sourceConvertResultFormatter_1 = require("../../../formatters/sourceConvertResultFormatter");
|
|
18
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
19
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source');
|
|
20
|
+
class Source extends sf_plugins_core_1.SfCommand {
|
|
21
|
+
async run() {
|
|
22
|
+
this.flags = (await this.parse(Source)).flags;
|
|
23
|
+
await this.convert();
|
|
24
|
+
this.resolveSuccess();
|
|
25
|
+
return this.formatResult();
|
|
26
|
+
}
|
|
27
|
+
async convert() {
|
|
28
|
+
const paths = [];
|
|
29
|
+
const { metadata, manifest } = this.flags;
|
|
30
|
+
const sourcepath = this.flags['source-dir'];
|
|
31
|
+
const rootdir = this.flags['root-dir'];
|
|
32
|
+
if (sourcepath) {
|
|
33
|
+
paths.push(...sourcepath);
|
|
34
|
+
}
|
|
35
|
+
// rootdir behaves exclusively to sourcepath, metadata, and manifest... to maintain backwards compatibility
|
|
36
|
+
// we will check here, instead of adding the exclusive option to the flag definition so we don't break scripts
|
|
37
|
+
if (rootdir && !sourcepath && !metadata && !manifest && typeof rootdir === 'string') {
|
|
38
|
+
// only rootdir option passed
|
|
39
|
+
paths.push(rootdir);
|
|
40
|
+
}
|
|
41
|
+
// no options passed, convert the default package (usually force-app)
|
|
42
|
+
if (!sourcepath && !metadata && !manifest && !rootdir) {
|
|
43
|
+
paths.push(this.project.getDefaultPackage().path);
|
|
44
|
+
}
|
|
45
|
+
this.componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
46
|
+
sourceapiversion: this.flags['api-version'] ?? (await (0, project_1.getSourceApiVersion)()),
|
|
47
|
+
sourcepath: paths,
|
|
48
|
+
manifest: manifest
|
|
49
|
+
? {
|
|
50
|
+
manifestPath: manifest,
|
|
51
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
52
|
+
}
|
|
53
|
+
: undefined,
|
|
54
|
+
metadata: metadata
|
|
55
|
+
? {
|
|
56
|
+
metadataEntries: metadata,
|
|
57
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
58
|
+
}
|
|
59
|
+
: undefined,
|
|
60
|
+
});
|
|
61
|
+
const packageName = this.flags['package-name'];
|
|
62
|
+
const outputDirectory = (0, path_1.resolve)(this.flags['output-dir']);
|
|
63
|
+
const converter = new source_deploy_retrieve_1.MetadataConverter();
|
|
64
|
+
this.convertResult = await converter.convert(this.componentSet, 'metadata', {
|
|
65
|
+
type: 'directory',
|
|
66
|
+
outputDirectory,
|
|
67
|
+
packageName,
|
|
68
|
+
genUniqueDir: false,
|
|
69
|
+
});
|
|
70
|
+
if (packageName && this.convertResult.packagePath) {
|
|
71
|
+
// SDR will build an output path like /output/directory/packageName/package.xml
|
|
72
|
+
// this was breaking from toolbelt, so to revert it we copy the directory up a level and delete the original
|
|
73
|
+
fs.cpSync(this.convertResult.packagePath, outputDirectory);
|
|
74
|
+
fs.rmSync(this.convertResult.packagePath, { recursive: true });
|
|
75
|
+
this.convertResult.packagePath = outputDirectory;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
resolveSuccess() {
|
|
79
|
+
if (!(0, ts_types_1.getString)(this.convertResult, 'packagePath')) {
|
|
80
|
+
process.exitCode = 1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
formatResult() {
|
|
84
|
+
const formatter = new sourceConvertResultFormatter_1.SourceConvertResultFormatter(this.convertResult);
|
|
85
|
+
if (!this.jsonEnabled()) {
|
|
86
|
+
formatter.display();
|
|
87
|
+
}
|
|
88
|
+
return formatter.getJson();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.Source = Source;
|
|
92
|
+
Source.summary = messages.getMessage('summary');
|
|
93
|
+
Source.description = messages.getMessage('description');
|
|
94
|
+
Source.examples = messages.getMessages('examples');
|
|
95
|
+
Source.requiresProject = true;
|
|
96
|
+
Source.aliases = ['force:source:convert'];
|
|
97
|
+
Source.deprecateAliases = true;
|
|
98
|
+
Source.flags = {
|
|
99
|
+
'api-version': { ...sf_plugins_core_1.orgApiVersionFlagWithDeprecations, summary: messages.getMessage('flags.api-version.summary') },
|
|
100
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
101
|
+
'root-dir': sf_plugins_core_1.Flags.directory({
|
|
102
|
+
aliases: ['rootdir'],
|
|
103
|
+
deprecateAliases: true,
|
|
104
|
+
char: 'r',
|
|
105
|
+
summary: messages.getMessage('flags.root-dir.summary'),
|
|
106
|
+
exists: true,
|
|
107
|
+
}),
|
|
108
|
+
'output-dir': sf_plugins_core_1.Flags.directory({
|
|
109
|
+
aliases: ['outputdir'],
|
|
110
|
+
deprecateAliases: true,
|
|
111
|
+
default: `metadataPackage_${Date.now()}`,
|
|
112
|
+
char: 'd',
|
|
113
|
+
summary: messages.getMessage('flags.output-dir.summary'),
|
|
114
|
+
}),
|
|
115
|
+
'package-name': sf_plugins_core_1.Flags.string({
|
|
116
|
+
char: 'n',
|
|
117
|
+
aliases: ['packagename'],
|
|
118
|
+
deprecateAliases: true,
|
|
119
|
+
summary: messages.getMessage('flags.package-name.summary'),
|
|
120
|
+
}),
|
|
121
|
+
manifest: sf_plugins_core_1.Flags.file({
|
|
122
|
+
char: 'x',
|
|
123
|
+
summary: messages.getMessage('flags.manifest.summary'),
|
|
124
|
+
description: messages.getMessage('flags.manifest.description'),
|
|
125
|
+
exists: true,
|
|
126
|
+
}),
|
|
127
|
+
'source-dir': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
128
|
+
char: 'p',
|
|
129
|
+
aliases: ['sourcepath'],
|
|
130
|
+
deprecateAliases: true,
|
|
131
|
+
description: messages.getMessage('flags.source-dir.description'),
|
|
132
|
+
summary: messages.getMessage('flags.source-dir.summary'),
|
|
133
|
+
exclusive: ['manifest', 'metadata'],
|
|
134
|
+
}),
|
|
135
|
+
metadata: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
136
|
+
char: 'm',
|
|
137
|
+
summary: messages.getMessage('flags.metadata.summary'),
|
|
138
|
+
exclusive: ['manifest', 'sourcepath'],
|
|
139
|
+
}),
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/commands/project/convert/source.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+BAA+B;AAC/B,yBAAyB;AAEzB,2CAA4C;AAC5C,+EAK4C;AAC5C,mDAAiD;AACjD,iEAMqC;AAErC,oDAA6E;AAC7E,mGAAgG;AAGhG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,gBAAgB,CAAC,CAAC;AAE/F,MAAa,MAAO,SAAQ,2BAA4B;IAuD/C,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,KAAK,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;QAC9C,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACrB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,OAAO;QACrB,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEvC,IAAI,UAAU,EAAE;YACd,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;SAC3B;QAED,2GAA2G;QAC3G,8GAA8G;QAC9G,IAAI,OAAO,IAAI,CAA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E,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QACtD,SAAS,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;KACtC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Interfaces } from '@oclif/core';
|
|
2
|
+
import { Org } from '@salesforce/core';
|
|
3
|
+
import { FileResponse } from '@salesforce/source-deploy-retrieve';
|
|
4
|
+
import { Duration } from '@salesforce/kit';
|
|
5
|
+
import { SourceTracking } from '@salesforce/source-tracking';
|
|
6
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
7
|
+
import { DeleteSourceJson, TestLevel } from '../../../utils/types';
|
|
8
|
+
export declare class Source extends SfCommand<DeleteSourceJson> {
|
|
9
|
+
static readonly summary: string;
|
|
10
|
+
static readonly description: string;
|
|
11
|
+
static readonly examples: string[];
|
|
12
|
+
static readonly aliases: string[];
|
|
13
|
+
static readonly deprecateAliases = true;
|
|
14
|
+
static readonly requiresProject = true;
|
|
15
|
+
static readonly flags: {
|
|
16
|
+
'api-version': Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
17
|
+
loglevel: Interfaces.OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
18
|
+
'target-org': Interfaces.OptionFlag<Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
+
'check-only': Interfaces.BooleanFlag<boolean>;
|
|
20
|
+
wait: Interfaces.OptionFlag<Duration, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
+
'test-level': Interfaces.OptionFlag<TestLevel, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
+
'no-prompt': Interfaces.BooleanFlag<boolean>;
|
|
23
|
+
metadata: Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
24
|
+
'source-dir': Interfaces.OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
25
|
+
'track-source': Interfaces.BooleanFlag<boolean>;
|
|
26
|
+
'force-overwrite': Interfaces.BooleanFlag<boolean>;
|
|
27
|
+
verbose: Interfaces.BooleanFlag<boolean>;
|
|
28
|
+
};
|
|
29
|
+
protected fileResponses: FileResponse[] | undefined;
|
|
30
|
+
protected tracking: SourceTracking | undefined;
|
|
31
|
+
private aborted;
|
|
32
|
+
private components;
|
|
33
|
+
private mixedDeployDelete;
|
|
34
|
+
private stashPath;
|
|
35
|
+
private tempDir;
|
|
36
|
+
private flags;
|
|
37
|
+
private org;
|
|
38
|
+
private componentSet;
|
|
39
|
+
private isRest;
|
|
40
|
+
private deployResult;
|
|
41
|
+
private deleteResultFormatter;
|
|
42
|
+
run(): Promise<DeleteSourceJson>;
|
|
43
|
+
protected preChecks(): Promise<void>;
|
|
44
|
+
protected delete(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Checks the response status to determine whether the delete was successful.
|
|
47
|
+
*/
|
|
48
|
+
protected resolveSuccess(): Promise<void>;
|
|
49
|
+
protected formatResult(): DeleteSourceJson;
|
|
50
|
+
private maybeUpdateTracking;
|
|
51
|
+
private deleteFilesLocally;
|
|
52
|
+
private moveFileToStash;
|
|
53
|
+
private restoreFileFromStash;
|
|
54
|
+
private deleteStash;
|
|
55
|
+
private moveBundleToManifest;
|
|
56
|
+
private handlePrompt;
|
|
57
|
+
/**
|
|
58
|
+
* Check if any conflicts exist in a specific component set.
|
|
59
|
+
* If conflicts exist, this will output the table and throw
|
|
60
|
+
*/
|
|
61
|
+
private filterConflictsByComponentSet;
|
|
62
|
+
/**
|
|
63
|
+
* Write a table (if not json) and throw an error that includes a custom message and the conflict data
|
|
64
|
+
*
|
|
65
|
+
* @param conflicts
|
|
66
|
+
* @param message
|
|
67
|
+
*/
|
|
68
|
+
private processConflicts;
|
|
69
|
+
}
|