@salesforce/plugin-deploy-retrieve 1.8.4 → 1.8.5-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +173 -0
- package/lib/commands/project/convert/mdapi.js.map +1 -0
- package/lib/commands/project/convert/source.d.ts +29 -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 +423 -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 -0
- package/lib/commands/{deploy/metadata → project/deploy}/cancel.js +13 -3
- package/lib/commands/project/deploy/cancel.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/preview.d.ts +3 -0
- package/lib/commands/{deploy/metadata → project/deploy}/preview.js +9 -3
- package/lib/commands/project/deploy/preview.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/quick.d.ts +3 -0
- package/lib/commands/{deploy/metadata → project/deploy}/quick.js +10 -4
- package/lib/commands/project/deploy/quick.js.map +1 -0
- package/lib/commands/project/deploy/report.d.ts +22 -0
- package/lib/commands/{deploy/metadata → project/deploy}/report.js +25 -4
- package/lib/commands/project/deploy/report.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/resume.d.ts +5 -0
- package/lib/commands/{deploy/metadata → project/deploy}/resume.js +17 -2
- package/lib/commands/project/deploy/resume.js.map +1 -0
- package/lib/commands/{deploy/metadata.d.ts → project/deploy/start.d.ts} +10 -2
- package/lib/commands/{deploy/metadata.js → project/deploy/start.js} +40 -11
- package/lib/commands/project/deploy/start.js.map +1 -0
- package/lib/commands/{deploy/metadata → project/deploy}/validate.d.ts +2 -0
- package/lib/commands/{deploy/metadata → project/deploy}/validate.js +4 -4
- package/lib/commands/project/deploy/validate.js.map +1 -0
- package/lib/commands/project/manifest/create.d.ts +26 -0
- package/lib/commands/project/manifest/create.js +133 -0
- package/lib/commands/project/manifest/create.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 -0
- package/lib/commands/{retrieve/metadata → project/retrieve}/preview.js +2 -0
- package/lib/commands/project/retrieve/preview.js.map +1 -0
- package/lib/commands/{retrieve/metadata.d.ts → project/retrieve/start.d.ts} +3 -1
- package/lib/commands/{retrieve/metadata.js → project/retrieve/start.js} +8 -6
- package/lib/commands/project/retrieve/start.js.map +1 -0
- package/lib/utils/coverage.d.ts +9 -0
- package/lib/utils/coverage.js +111 -0
- package/lib/utils/coverage.js.map +1 -0
- package/lib/utils/deploy.d.ts +9 -5
- package/lib/utils/deploy.js +21 -24
- 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/flags.js +1 -5
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/manifestCache.d.ts +5 -0
- package/lib/utils/manifestCache.js +38 -0
- package/lib/utils/manifestCache.js.map +1 -0
- package/lib/utils/metadataDeployer.js +1 -0
- package/lib/utils/metadataDeployer.js.map +1 -1
- package/lib/utils/output.d.ts +44 -4
- package/lib/utils/output.js +220 -38
- package/lib/utils/output.js.map +1 -1
- package/lib/utils/previewOutput.d.ts +2 -1
- package/lib/utils/previewOutput.js +14 -22
- package/lib/utils/previewOutput.js.map +1 -1
- package/lib/utils/types.d.ts +35 -0
- package/lib/utils/types.js +3 -1
- package/lib/utils/types.js.map +1 -1
- package/messages/convert.mdapi.md +78 -0
- package/messages/convert.source.md +64 -0
- package/messages/delete.source.md +122 -0
- package/messages/delete.tracking.md +34 -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 +33 -5
- package/messages/deploy.metadata.preview.md +7 -3
- package/messages/deploy.metadata.quick.md +11 -3
- package/messages/deploy.metadata.report.md +24 -4
- package/messages/deploy.metadata.resume.md +17 -5
- package/messages/deploy.metadata.validate.md +9 -5
- package/messages/manifest.create.md +61 -0
- package/messages/retrieve.metadata.md +1 -1
- package/messages/retrieve.metadata.preview.md +3 -3
- package/oclif.manifest.json +1673 -665
- package/package.json +45 -32
- 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-manifest-create.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.d.ts +0 -14
- 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
|
@@ -0,0 +1,423 @@
|
|
|
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 fs = require("fs");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
const os = require("os");
|
|
13
|
+
const core_1 = require("@salesforce/core");
|
|
14
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
15
|
+
const kit_1 = require("@salesforce/kit");
|
|
16
|
+
const source_tracking_1 = require("@salesforce/source-tracking");
|
|
17
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
18
|
+
const chalk = require("chalk");
|
|
19
|
+
const types_1 = require("../../../utils/types");
|
|
20
|
+
const project_1 = require("../../../utils/project");
|
|
21
|
+
const deploy_1 = require("../../../utils/deploy");
|
|
22
|
+
const output_1 = require("../../../utils/output");
|
|
23
|
+
const progressBar_1 = require("../../../utils/progressBar");
|
|
24
|
+
const deployCache_1 = require("../../../utils/deployCache");
|
|
25
|
+
const fsPromises = fs.promises;
|
|
26
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
27
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.source');
|
|
28
|
+
const xorFlags = ['metadata', 'source-path'];
|
|
29
|
+
class Source extends sf_plugins_core_1.SfCommand {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
// private deleteResultFormatter: DeleteResultFormatter | DeployResultFormatter;
|
|
33
|
+
this.aborted = false;
|
|
34
|
+
// create the delete FileResponse as we're parsing the comp. set to use in the output
|
|
35
|
+
this.mixedDeployDelete = { delete: [], deploy: [] };
|
|
36
|
+
// map of component in project, to where it is stashed
|
|
37
|
+
this.stashPath = new Map();
|
|
38
|
+
this.tempDir = path.join(os.tmpdir(), 'source_delete');
|
|
39
|
+
/**
|
|
40
|
+
* Check if any conflicts exist in a specific component set.
|
|
41
|
+
* If conflicts exist, this will output the table and throw
|
|
42
|
+
*/
|
|
43
|
+
this.filterConflictsByComponentSet = async () => {
|
|
44
|
+
const filteredConflicts = (await this.tracking?.getConflicts())?.filter((cr) => this.componentSet.has({ fullName: cr.name, type: cr.type })) ?? [];
|
|
45
|
+
this.processConflicts(filteredConflicts, messages.getMessage('conflictMsg'));
|
|
46
|
+
return filteredConflicts;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Write a table (if not json) and throw an error that includes a custom message and the conflict data
|
|
50
|
+
*
|
|
51
|
+
* @param conflicts
|
|
52
|
+
* @param message
|
|
53
|
+
*/
|
|
54
|
+
this.processConflicts = (conflicts, message) => {
|
|
55
|
+
if (conflicts.length === 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.table(conflicts, {
|
|
59
|
+
state: { header: 'STATE' },
|
|
60
|
+
fullName: { header: 'FULL NAME' },
|
|
61
|
+
type: { header: 'TYPE' },
|
|
62
|
+
filePath: { header: 'FILE PATH' },
|
|
63
|
+
});
|
|
64
|
+
// map do dedupe by name-type-filename
|
|
65
|
+
const conflictMap = new Map();
|
|
66
|
+
conflicts.forEach((c) => {
|
|
67
|
+
c.filenames?.forEach((f) => {
|
|
68
|
+
conflictMap.set(`${c.name}#${c.type}#${f}`, {
|
|
69
|
+
state: 'Conflict',
|
|
70
|
+
fullName: c.name,
|
|
71
|
+
type: c.type,
|
|
72
|
+
filePath: path.resolve(f),
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const reformattedConflicts = Array.from(conflictMap.values());
|
|
77
|
+
const err = new core_1.SfError(message, 'sourceConflictDetected');
|
|
78
|
+
err.setData(reformattedConflicts);
|
|
79
|
+
throw err;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async run() {
|
|
83
|
+
this.flags = (await this.parse(Source)).flags;
|
|
84
|
+
this.org = this.flags['target-org'];
|
|
85
|
+
await this.preChecks();
|
|
86
|
+
await this.delete();
|
|
87
|
+
await this.resolveSuccess();
|
|
88
|
+
const result = this.formatResult();
|
|
89
|
+
// The DeleteResultFormatter will use SDR and scan the directory, if the files have been deleted, it will throw an error
|
|
90
|
+
// so we'll delete the files locally now
|
|
91
|
+
await this.deleteFilesLocally();
|
|
92
|
+
// makes sure files are deleted before updating tracking files
|
|
93
|
+
await this.maybeUpdateTracking();
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
async preChecks() {
|
|
97
|
+
if (this.flags['track-source']) {
|
|
98
|
+
this.tracking = await source_tracking_1.SourceTracking.create({ org: this.org, project: this.project });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async delete() {
|
|
102
|
+
const sourcepaths = this.flags['source-path'];
|
|
103
|
+
this.componentSet = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
104
|
+
apiversion: this.flags['api-version'],
|
|
105
|
+
sourceapiversion: await (0, project_1.getSourceApiVersion)(),
|
|
106
|
+
sourcepath: sourcepaths,
|
|
107
|
+
metadata: this.flags.metadata
|
|
108
|
+
? {
|
|
109
|
+
metadataEntries: this.flags.metadata,
|
|
110
|
+
directoryPaths: await (0, project_1.getPackageDirs)(),
|
|
111
|
+
}
|
|
112
|
+
: undefined,
|
|
113
|
+
});
|
|
114
|
+
if (this.flags['track-source'] && !this.flags['force-overwrite']) {
|
|
115
|
+
await this.filterConflictsByComponentSet();
|
|
116
|
+
}
|
|
117
|
+
this.components = this.componentSet.toArray();
|
|
118
|
+
if (!this.components.length) {
|
|
119
|
+
// if we didn't find any components to delete, let the user know and exit
|
|
120
|
+
this.styledHeader(chalk.blue('Deleted Source'));
|
|
121
|
+
this.log('No results found');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
// create a new ComponentSet and mark everything for deletion
|
|
125
|
+
const cs = new source_deploy_retrieve_1.ComponentSet([]);
|
|
126
|
+
cs.apiVersion =
|
|
127
|
+
this.componentSet.apiVersion ?? this.flags['api-version'] ?? (await this.org.retrieveMaxApiVersion());
|
|
128
|
+
cs.sourceApiVersion =
|
|
129
|
+
this.componentSet.sourceApiVersion ?? this.flags['api-version'] ?? (await (0, project_1.getSourceApiVersion)());
|
|
130
|
+
this.components.map((component) => {
|
|
131
|
+
if (component instanceof source_deploy_retrieve_1.SourceComponent) {
|
|
132
|
+
cs.add(component, source_deploy_retrieve_1.DestructiveChangesType.POST);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
// a remote-only delete
|
|
136
|
+
cs.add(new source_deploy_retrieve_1.SourceComponent({ name: component.fullName, type: component.type }), source_deploy_retrieve_1.DestructiveChangesType.POST);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
this.componentSet = cs;
|
|
140
|
+
if (sourcepaths) {
|
|
141
|
+
// determine if user is trying to delete a single file from a bundle, which is actually just an fs delete operation
|
|
142
|
+
// and then a constructive deploy on the "new" bundle
|
|
143
|
+
this.components
|
|
144
|
+
.filter((comp) => comp.type.strategies?.adapter === 'bundle')
|
|
145
|
+
.filter(types_1.isSourceComponent)
|
|
146
|
+
.map((bundle) => {
|
|
147
|
+
sourcepaths.map(async (sourcepath) => {
|
|
148
|
+
// walkContent returns absolute paths while sourcepath will usually be relative
|
|
149
|
+
if (bundle.walkContent().find((content) => content.endsWith(sourcepath))) {
|
|
150
|
+
await this.moveBundleToManifest(bundle, sourcepath);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
this.aborted = !(await this.handlePrompt());
|
|
156
|
+
if (this.aborted)
|
|
157
|
+
return;
|
|
158
|
+
// fire predeploy event for the delete
|
|
159
|
+
await core_1.Lifecycle.getInstance().emit('predeploy', this.components);
|
|
160
|
+
this.isRest = (await (0, deploy_1.resolveApi)()) === 'REST';
|
|
161
|
+
this.log(`*** Deleting with ${this.isRest ? 'REST' : 'SOAP'} API ***`);
|
|
162
|
+
const deploy = await this.componentSet.deploy({
|
|
163
|
+
usernameOrConnection: this.org.getUsername(),
|
|
164
|
+
apiOptions: {
|
|
165
|
+
rest: this.isRest,
|
|
166
|
+
checkOnly: this.flags['check-only'] ?? false,
|
|
167
|
+
testLevel: this.flags['test-level'],
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
new progressBar_1.DeployProgress(deploy, this.jsonEnabled()).start();
|
|
171
|
+
this.deployResult = await deploy.pollStatus({ timeout: this.flags.wait });
|
|
172
|
+
await deployCache_1.DeployCache.update(deploy.id, { status: this.deployResult.response.status });
|
|
173
|
+
await core_1.Lifecycle.getInstance().emit('postdeploy', this.deployResult);
|
|
174
|
+
// result.getFileResponses() will crawl the tree, but that would throw after the delete occurs.
|
|
175
|
+
// Extract them here for updateTracking to use later
|
|
176
|
+
this.fileResponses = this.mixedDeployDelete.delete.length
|
|
177
|
+
? this.mixedDeployDelete.delete
|
|
178
|
+
: this.deployResult.getFileResponses();
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Checks the response status to determine whether the delete was successful.
|
|
182
|
+
*/
|
|
183
|
+
async resolveSuccess() {
|
|
184
|
+
const status = this.deployResult?.response?.status;
|
|
185
|
+
if (status !== source_deploy_retrieve_1.RequestStatus.Succeeded && !this.aborted) {
|
|
186
|
+
process.exitCode = 1;
|
|
187
|
+
}
|
|
188
|
+
// if deploy failed OR the operation was cancelled, restore the stashed files if they exist
|
|
189
|
+
else if (status !== source_deploy_retrieve_1.RequestStatus.Succeeded || this.aborted) {
|
|
190
|
+
await Promise.all(this.mixedDeployDelete.delete.map(async (file) => {
|
|
191
|
+
await this.restoreFileFromStash(file.filePath);
|
|
192
|
+
}));
|
|
193
|
+
}
|
|
194
|
+
else if (this.mixedDeployDelete.delete.length) {
|
|
195
|
+
// successful delete -> delete the stashed file
|
|
196
|
+
await this.deleteStash();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
formatResult() {
|
|
200
|
+
const formatterOptions = {
|
|
201
|
+
verbose: this.flags.verbose ?? false,
|
|
202
|
+
};
|
|
203
|
+
this.deleteResultFormatter = this.mixedDeployDelete.deploy.length
|
|
204
|
+
? new output_1.DeployResultFormatter(this.deployResult, formatterOptions)
|
|
205
|
+
: new output_1.DeleteResultFormatter(this.deployResult);
|
|
206
|
+
// Only display results to console when JSON flag is unset.
|
|
207
|
+
if (!this.jsonEnabled()) {
|
|
208
|
+
this.deleteResultFormatter.display();
|
|
209
|
+
}
|
|
210
|
+
if (this.mixedDeployDelete.deploy.length && !this.aborted) {
|
|
211
|
+
// override JSON output when we actually deployed
|
|
212
|
+
const json = this.deleteResultFormatter.getJson();
|
|
213
|
+
json.deletedSource = this.mixedDeployDelete.delete; // to match toolbelt json output
|
|
214
|
+
json.outboundFiles = []; // to match toolbelt version
|
|
215
|
+
json.deletes = json.deploys; // to match toolbelt version
|
|
216
|
+
delete json.deploys;
|
|
217
|
+
return json;
|
|
218
|
+
}
|
|
219
|
+
if (this.aborted) {
|
|
220
|
+
return {
|
|
221
|
+
status: 0,
|
|
222
|
+
result: {
|
|
223
|
+
deletedSource: [],
|
|
224
|
+
deletes: [{}],
|
|
225
|
+
outboundFiles: [],
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return this.deleteResultFormatter.getJson();
|
|
230
|
+
}
|
|
231
|
+
async maybeUpdateTracking() {
|
|
232
|
+
if (this.flags['track-source'] ?? false) {
|
|
233
|
+
// might not exist if we exited from the operation early
|
|
234
|
+
if (!this.deployResult) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
this.spinner.start('Updating source tracking');
|
|
238
|
+
const successes = (this.fileResponses ?? this.deployResult.getFileResponses()).filter((fileResponse) => fileResponse.state !== source_deploy_retrieve_1.ComponentStatus.Failed);
|
|
239
|
+
if (!successes.length) {
|
|
240
|
+
this.spinner.stop();
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
await Promise.all([
|
|
244
|
+
this.tracking?.updateLocalTracking({
|
|
245
|
+
files: successes
|
|
246
|
+
.filter((fileResponse) => fileResponse.state !== source_deploy_retrieve_1.ComponentStatus.Deleted)
|
|
247
|
+
.map((fileResponse) => fileResponse.filePath),
|
|
248
|
+
deletedFiles: successes
|
|
249
|
+
.filter((fileResponse) => fileResponse.state === source_deploy_retrieve_1.ComponentStatus.Deleted)
|
|
250
|
+
.map((fileResponse) => fileResponse.filePath),
|
|
251
|
+
}),
|
|
252
|
+
this.tracking?.updateRemoteTracking(successes.map(({ state, fullName, type, filePath }) => ({ state, fullName, type, filePath }))),
|
|
253
|
+
]);
|
|
254
|
+
this.spinner.stop();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async deleteFilesLocally() {
|
|
258
|
+
if (!this.flags['check-only'] && this.deployResult?.response?.status === source_deploy_retrieve_1.RequestStatus.Succeeded) {
|
|
259
|
+
const promises = [];
|
|
260
|
+
this.components?.filter(types_1.isSourceComponent).map((component) => {
|
|
261
|
+
// mixed delete/deploy operations have already been deleted and stashed
|
|
262
|
+
if (!this.mixedDeployDelete.delete.length) {
|
|
263
|
+
if (component.content) {
|
|
264
|
+
const stats = fs.statSync(component.content);
|
|
265
|
+
if (stats.isDirectory()) {
|
|
266
|
+
promises.push(fsPromises.rm(component.content, { recursive: true }));
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
promises.push(fsPromises.unlink(component.content));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (component.xml) {
|
|
273
|
+
promises.push(fsPromises.unlink(component.xml));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
await Promise.all(promises);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
async moveFileToStash(file) {
|
|
281
|
+
await fsPromises.mkdir(path.dirname(this.stashPath.get(file)), { recursive: true });
|
|
282
|
+
await fsPromises.copyFile(file, this.stashPath.get(file));
|
|
283
|
+
await fsPromises.unlink(file);
|
|
284
|
+
}
|
|
285
|
+
async restoreFileFromStash(file) {
|
|
286
|
+
await fsPromises.rename(this.stashPath.get(file), file);
|
|
287
|
+
}
|
|
288
|
+
async deleteStash() {
|
|
289
|
+
await fsPromises.rm(this.tempDir, { recursive: true, force: true });
|
|
290
|
+
}
|
|
291
|
+
async moveBundleToManifest(bundle, sourcepath) {
|
|
292
|
+
// if one of the passed in sourcepaths is to a bundle component
|
|
293
|
+
const fileName = path.basename(sourcepath);
|
|
294
|
+
const fullName = path.join(bundle.name, fileName);
|
|
295
|
+
this.mixedDeployDelete.delete.push({
|
|
296
|
+
state: source_deploy_retrieve_1.ComponentStatus.Deleted,
|
|
297
|
+
fullName,
|
|
298
|
+
type: bundle.type.name,
|
|
299
|
+
filePath: sourcepath,
|
|
300
|
+
});
|
|
301
|
+
// stash the file in case we need to restore it due to failed deploy/aborted command
|
|
302
|
+
this.stashPath.set(sourcepath, path.join(this.tempDir, fullName));
|
|
303
|
+
await this.moveFileToStash(sourcepath);
|
|
304
|
+
// re-walk the directory to avoid picking up the deleted file
|
|
305
|
+
this.mixedDeployDelete.deploy.push(...bundle.walkContent());
|
|
306
|
+
// now remove the bundle from destructive changes and add to manifest
|
|
307
|
+
// set the bundle as NOT marked for delete
|
|
308
|
+
this.componentSet.destructiveChangesPost.delete(`${bundle.type.id}#${bundle.fullName}`);
|
|
309
|
+
bundle.setMarkedForDelete(false);
|
|
310
|
+
this.componentSet.add(bundle);
|
|
311
|
+
}
|
|
312
|
+
async handlePrompt() {
|
|
313
|
+
if (!this.flags['no-prompt']) {
|
|
314
|
+
const remote = [];
|
|
315
|
+
let local = [];
|
|
316
|
+
const message = [];
|
|
317
|
+
this.components?.flatMap((component) => {
|
|
318
|
+
if (component instanceof source_deploy_retrieve_1.SourceComponent) {
|
|
319
|
+
local.push(component.xml, ...component.walkContent());
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
// remote only metadata
|
|
323
|
+
remote.push(`${component.type.name}:${component.fullName}`);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
if (this.mixedDeployDelete.delete.length) {
|
|
327
|
+
local = this.mixedDeployDelete.delete.map((fr) => fr.fullName);
|
|
328
|
+
}
|
|
329
|
+
if (this.mixedDeployDelete.deploy.length) {
|
|
330
|
+
message.push(messages.getMessage('deployPrompt', [[...new Set(this.mixedDeployDelete.deploy)].join('\n')]));
|
|
331
|
+
}
|
|
332
|
+
if (remote.length) {
|
|
333
|
+
message.push(messages.getMessage('remotePrompt', [[...new Set(remote)].join('\n')]));
|
|
334
|
+
}
|
|
335
|
+
if (local.length) {
|
|
336
|
+
if (message.length) {
|
|
337
|
+
// add a whitespace between remote and local
|
|
338
|
+
message.push('\n');
|
|
339
|
+
}
|
|
340
|
+
message.push('\n', messages.getMessage('localPrompt', [[...new Set(local)].join('\n')]));
|
|
341
|
+
}
|
|
342
|
+
message.push(this.flags['check-only'] ?? false
|
|
343
|
+
? messages.getMessage('areYouSureCheckOnly')
|
|
344
|
+
: messages.getMessage('areYouSure'));
|
|
345
|
+
return this.confirm(message.join('\n'));
|
|
346
|
+
}
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
exports.Source = Source;
|
|
351
|
+
Source.summary = messages.getMessage('summary');
|
|
352
|
+
Source.description = messages.getMessage('description');
|
|
353
|
+
Source.examples = messages.getMessages('examples');
|
|
354
|
+
Source.aliases = ['force:source:delete'];
|
|
355
|
+
Source.deprecateAliases = true;
|
|
356
|
+
Source.requiresProject = true;
|
|
357
|
+
Source.flags = {
|
|
358
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
359
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
360
|
+
'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
|
|
361
|
+
'check-only': sf_plugins_core_1.Flags.boolean({
|
|
362
|
+
aliases: ['checkonly'],
|
|
363
|
+
deprecateAliases: true,
|
|
364
|
+
char: 'c',
|
|
365
|
+
description: messages.getMessage('flagsLong.check-only'),
|
|
366
|
+
summary: messages.getMessage('flags.check-only'),
|
|
367
|
+
}),
|
|
368
|
+
wait: sf_plugins_core_1.Flags.duration({
|
|
369
|
+
unit: 'minutes',
|
|
370
|
+
char: 'w',
|
|
371
|
+
default: kit_1.Duration.minutes(33),
|
|
372
|
+
min: 1,
|
|
373
|
+
description: messages.getMessage('flagsLong.wait'),
|
|
374
|
+
summary: messages.getMessage('flags.wait'),
|
|
375
|
+
}),
|
|
376
|
+
'test-level': sf_plugins_core_1.Flags.string({
|
|
377
|
+
char: 'l',
|
|
378
|
+
aliases: ['testlevel'],
|
|
379
|
+
deprecateAliases: true,
|
|
380
|
+
description: messages.getMessage('flagsLong.test-Level'),
|
|
381
|
+
summary: messages.getMessage('flags.test-Level'),
|
|
382
|
+
options: ['NoTestRun', 'RunLocalTests', 'RunAllTestsInOrg'],
|
|
383
|
+
default: 'NoTestRun',
|
|
384
|
+
}),
|
|
385
|
+
'no-prompt': sf_plugins_core_1.Flags.boolean({
|
|
386
|
+
char: 'r',
|
|
387
|
+
aliases: ['noprompt'],
|
|
388
|
+
deprecateAliases: true,
|
|
389
|
+
summary: messages.getMessage('flags.no-prompt'),
|
|
390
|
+
}),
|
|
391
|
+
metadata: (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
392
|
+
char: 'm',
|
|
393
|
+
description: messages.getMessage('flagsLong.metadata'),
|
|
394
|
+
summary: messages.getMessage('flags.metadata'),
|
|
395
|
+
exactlyOne: xorFlags,
|
|
396
|
+
}),
|
|
397
|
+
'source-path': (0, sf_plugins_core_1.arrayWithDeprecation)({
|
|
398
|
+
char: 'p',
|
|
399
|
+
aliases: ['sourcepath'],
|
|
400
|
+
deprecateAliases: true,
|
|
401
|
+
description: messages.getMessage('flagsLong.source-path'),
|
|
402
|
+
summary: messages.getMessage('flags.source-path'),
|
|
403
|
+
exactlyOne: xorFlags,
|
|
404
|
+
}),
|
|
405
|
+
'track-source': sf_plugins_core_1.Flags.boolean({
|
|
406
|
+
char: 't',
|
|
407
|
+
aliases: ['tracksource'],
|
|
408
|
+
deprecateAliases: true,
|
|
409
|
+
summary: messages.getMessage('flags.track-source'),
|
|
410
|
+
exclusive: ['check-only'],
|
|
411
|
+
}),
|
|
412
|
+
'force-overwrite': sf_plugins_core_1.Flags.boolean({
|
|
413
|
+
char: 'f',
|
|
414
|
+
aliases: ['forceoverwrite'],
|
|
415
|
+
deprecateAliases: true,
|
|
416
|
+
summary: messages.getMessage('flags.force-overwrite'),
|
|
417
|
+
dependsOn: ['track-source'],
|
|
418
|
+
}),
|
|
419
|
+
verbose: sf_plugins_core_1.Flags.boolean({
|
|
420
|
+
summary: messages.getMessage('flags.verbose'),
|
|
421
|
+
}),
|
|
422
|
+
};
|
|
423
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/commands/project/delete/source.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,yBAAyB;AACzB,6BAA6B;AAC7B,yBAAyB;AAEzB,2CAAqE;AACrE,+EAU4C;AAC5C,yCAA2C;AAC3C,iEAA6F;AAC7F,iEAOqC;AACrC,+BAA+B;AAC/B,gDAAsF;AACtF,oDAA6E;AAC7E,kDAAmD;AACnD,kDAAqF;AACrF,4DAA4D;AAC5D,4DAAyD;AAEzD,MAAM,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC;AAE/B,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,C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AO,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC;KAC9C,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type DeleteTrackingResult = {
|
|
3
|
+
clearedFiles: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare class DeleteTracking extends SfCommand<DeleteTrackingResult> {
|
|
6
|
+
static readonly deprecateAliases = true;
|
|
7
|
+
static readonly aliases: string[];
|
|
8
|
+
static readonly summary: string;
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly requiresProject = true;
|
|
11
|
+
static readonly examples: never[];
|
|
12
|
+
static readonly flags: {
|
|
13
|
+
'api-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
loglevel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
+
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
+
'no-prompt': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
run(): Promise<DeleteTrackingResult>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.DeleteTracking = void 0;
|
|
10
|
+
const core_1 = require("@salesforce/core");
|
|
11
|
+
const chalk = require("chalk");
|
|
12
|
+
const source_tracking_1 = require("@salesforce/source-tracking");
|
|
13
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
14
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
15
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'delete.tracking');
|
|
16
|
+
class DeleteTracking extends sf_plugins_core_1.SfCommand {
|
|
17
|
+
async run() {
|
|
18
|
+
const { flags } = await this.parse(DeleteTracking);
|
|
19
|
+
let clearedFiles = [];
|
|
20
|
+
if (flags['no-prompt'] || (await this.confirm(chalk.dim(messages.getMessage('promptMessage'))))) {
|
|
21
|
+
const sourceTracking = await source_tracking_1.SourceTracking.create({
|
|
22
|
+
project: this.project,
|
|
23
|
+
org: flags['target-org'],
|
|
24
|
+
});
|
|
25
|
+
clearedFiles = await Promise.all([sourceTracking.clearLocalTracking(), sourceTracking.clearRemoteTracking()]);
|
|
26
|
+
this.logSuccess('Cleared local tracking files.');
|
|
27
|
+
}
|
|
28
|
+
return { clearedFiles };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.DeleteTracking = DeleteTracking;
|
|
32
|
+
DeleteTracking.deprecateAliases = true;
|
|
33
|
+
DeleteTracking.aliases = ['force:source:beta:tracking:clear', 'force:source:tracking:clear'];
|
|
34
|
+
DeleteTracking.summary = messages.getMessage('deleteDescription');
|
|
35
|
+
DeleteTracking.description = messages.getMessage('deleteDescription');
|
|
36
|
+
DeleteTracking.requiresProject = true;
|
|
37
|
+
DeleteTracking.examples = [];
|
|
38
|
+
DeleteTracking.flags = {
|
|
39
|
+
'api-version': sf_plugins_core_1.orgApiVersionFlagWithDeprecations,
|
|
40
|
+
loglevel: sf_plugins_core_1.loglevel,
|
|
41
|
+
'target-org': sf_plugins_core_1.requiredOrgFlagWithDeprecations,
|
|
42
|
+
'no-prompt': sf_plugins_core_1.Flags.boolean({
|
|
43
|
+
char: 'p',
|
|
44
|
+
summary: messages.getMessage('no-promptDescription'),
|
|
45
|
+
aliases: ['noprompt'],
|
|
46
|
+
deprecateAliases: true,
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../../src/commands/project/delete/tracking.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,2CAA4C;AAC5C,+BAA+B;AAC/B,iEAA6D;AAC7D,iEAMqC;AAErC,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,iBAAiB,CAAC,CAAC;AAMhG,MAAa,cAAe,SAAQ,2BAA+B;IAoB1D,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAEnD,IAAI,YAAY,GAAa,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;YAC/F,MAAM,cAAc,GAAG,MAAM,gCAAc,CAAC,MAAM,CAAC;gBACjD,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC;aACzB,CAAC,CAAC;YACH,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,kBAAkB,EAAE,EAAE,cAAc,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;YAC9G,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;SAClD;QACD,OAAO,EAAE,YAAY,EAAE,CAAC;IAC1B,CAAC;;AAjCH,wCAkCC;AAjCwB,+BAAgB,GAAG,IAAI,CAAC;AACxB,sBAAO,GAAG,CAAC,kCAAkC,EAAE,6BAA6B,CAAC,CAAC;AAC9E,sBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACnD,0BAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;AACvD,8BAAe,GAAG,IAAI,CAAC;AACvB,uBAAQ,GAAG,EAAE,CAAC;AAEd,oBAAK,GAAG;IAC7B,aAAa,EAAE,mDAAiC;IAChD,QAAQ,EAAR,0BAAQ;IACR,YAAY,EAAE,iDAA+B;IAC7C,WAAW,EAAE,uBAAK,CAAC,OAAO,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB,gBAAgB,EAAE,IAAI;KACvB,CAAC;CACH,CAAC"}
|
|
@@ -7,6 +7,8 @@ export default class DeployMetadataCancel extends SfCommand<DeployResultJson> {
|
|
|
7
7
|
static readonly examples: string[];
|
|
8
8
|
static readonly requiresProject = true;
|
|
9
9
|
static readonly state = "beta";
|
|
10
|
+
static readonly aliases: string[];
|
|
11
|
+
static readonly deprecateAliases = true;
|
|
10
12
|
static readonly flags: {
|
|
11
13
|
async: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
14
|
'job-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
const core_1 = require("@salesforce/core");
|
|
10
10
|
const kit_1 = require("@salesforce/kit");
|
|
11
11
|
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
12
|
+
const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
|
|
12
13
|
const deploy_1 = require("../../../utils/deploy");
|
|
13
14
|
const deployCache_1 = require("../../../utils/deployCache");
|
|
14
15
|
const output_1 = require("../../../utils/output");
|
|
@@ -16,10 +17,15 @@ core_1.Messages.importMessagesDirectory(__dirname);
|
|
|
16
17
|
const messages = core_1.Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.cancel');
|
|
17
18
|
class DeployMetadataCancel extends sf_plugins_core_1.SfCommand {
|
|
18
19
|
async run() {
|
|
19
|
-
const { flags } = await this.parse(DeployMetadataCancel);
|
|
20
|
-
const cache = await deployCache_1.DeployCache.create();
|
|
20
|
+
const [{ flags }, cache] = await Promise.all([this.parse(DeployMetadataCancel), deployCache_1.DeployCache.create()]);
|
|
21
21
|
const jobId = cache.resolveLatest(flags['use-most-recent'], flags['job-id']);
|
|
22
|
-
|
|
22
|
+
// cancel don't care about your tracking conflicts
|
|
23
|
+
const deployOpts = { ...cache.get(jobId), 'ignore-conflicts': true };
|
|
24
|
+
// we may already know the job finished
|
|
25
|
+
if (deployOpts.status &&
|
|
26
|
+
[source_deploy_retrieve_1.RequestStatus.Canceled, source_deploy_retrieve_1.RequestStatus.Failed, source_deploy_retrieve_1.RequestStatus.Succeeded, source_deploy_retrieve_1.RequestStatus.SucceededPartial].includes(deployOpts.status)) {
|
|
27
|
+
messages.createError('error.CannotCancelDeployPre', [jobId, deployOpts.status]);
|
|
28
|
+
}
|
|
23
29
|
if (flags.async) {
|
|
24
30
|
const asyncResult = await (0, deploy_1.cancelDeployAsync)({ 'target-org': deployOpts['target-org'] }, jobId);
|
|
25
31
|
const formatter = new output_1.AsyncDeployCancelResultFormatter(asyncResult.id);
|
|
@@ -52,6 +58,8 @@ DeployMetadataCancel.summary = messages.getMessage('summary');
|
|
|
52
58
|
DeployMetadataCancel.examples = messages.getMessages('examples');
|
|
53
59
|
DeployMetadataCancel.requiresProject = true;
|
|
54
60
|
DeployMetadataCancel.state = 'beta';
|
|
61
|
+
DeployMetadataCancel.aliases = ['deploy:metadata:cancel'];
|
|
62
|
+
DeployMetadataCancel.deprecateAliases = true;
|
|
55
63
|
DeployMetadataCancel.flags = {
|
|
56
64
|
async: sf_plugins_core_1.Flags.boolean({
|
|
57
65
|
summary: messages.getMessage('flags.async.summary'),
|
|
@@ -71,6 +79,8 @@ DeployMetadataCancel.flags = {
|
|
|
71
79
|
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
72
80
|
exactlyOne: ['use-most-recent', 'job-id'],
|
|
73
81
|
}),
|
|
82
|
+
// we want to allow undefined to use the value from the cache
|
|
83
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default
|
|
74
84
|
wait: sf_plugins_core_1.Flags.duration({
|
|
75
85
|
char: 'w',
|
|
76
86
|
summary: messages.getMessage('flags.wait.summary'),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../../../src/commands/project/deploy/cancel.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAEH,2CAA4C;AAC5C,yCAA2C;AAC3C,iEAA+D;AAC/D,+EAAmE;AACnE,kDAAwE;AACxE,4DAAyD;AACzD,kDAAsG;AAGtG,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,wBAAwB,CAAC,CAAC;AAEvG,MAAqB,oBAAqB,SAAQ,2BAA2B;IAyCpE,KAAK,CAAC,GAAG;QACd,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,yBAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvG,MAAM,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAE7E,kDAAkD;QAClD,MAAM,UAAU,GAAG,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAA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QAC5D,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,sBAAsB,CAAC;QACpD,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;IACF,iBAAiB,EAAE,uBAAK,CAAC,OAAO,CAAC;QAC/B,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,mCAAmC,CAAC;QACrE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,+BAA+B,CAAC;QAC7D,UAAU,EAAE,CAAC,iBAAiB,EAAE,QAAQ,CAAC;KAC1C,CAAC;IACF,6DAA6D;IAC7D,0DAA0D;IAC1D,IAAI,EAAE,uBAAK,CAAC,QAAQ,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;QAC1D,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,WAAW;QACtB,GAAG,EAAE,CAAC;QACN,SAAS,EAAE,CAAC,OAAO,CAAC;KACrB,CAAC;CACH,CAAC"}
|
|
@@ -6,8 +6,11 @@ export default class DeployMetadataPreview extends SfCommand<PreviewResult> {
|
|
|
6
6
|
static readonly examples: string[];
|
|
7
7
|
static readonly requiresProject = true;
|
|
8
8
|
static readonly state = "beta";
|
|
9
|
+
static readonly aliases: string[];
|
|
10
|
+
static readonly deprecateAliases = true;
|
|
9
11
|
static readonly flags: {
|
|
10
12
|
'ignore-conflicts': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
'only-ignored': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
14
|
manifest: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
15
|
metadata: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
16
|
'source-dir': import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|