@salesforce/plugin-custom-metadata 1.0.11 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -7
- package/LICENSE.txt +2 -2
- package/README.md +153 -149
- package/lib/commands/force/cmdt/create.d.ts +12 -6
- package/lib/commands/force/cmdt/create.js +80 -82
- package/lib/commands/force/cmdt/create.js.map +1 -1
- package/lib/commands/force/cmdt/field/create.d.ts +10 -5
- package/lib/commands/force/cmdt/field/create.js +98 -90
- package/lib/commands/force/cmdt/field/create.js.map +1 -1
- package/lib/commands/force/cmdt/generate.d.ts +12 -8
- package/lib/commands/force/cmdt/generate.js +199 -257
- package/lib/commands/force/cmdt/generate.js.map +1 -1
- package/lib/commands/force/cmdt/record/create.d.ts +20 -9
- package/lib/commands/force/cmdt/record/create.js +123 -125
- package/lib/commands/force/cmdt/record/create.js.map +1 -1
- package/lib/commands/force/cmdt/record/insert.d.ts +7 -7
- package/lib/commands/force/cmdt/record/insert.js +97 -109
- package/lib/commands/force/cmdt/record/insert.js.map +1 -1
- package/lib/index.js +3 -3
- package/lib/lib/helpers/createUtil.d.ts +10 -6
- package/lib/lib/helpers/createUtil.js +50 -98
- package/lib/lib/helpers/createUtil.js.map +1 -1
- package/lib/lib/helpers/fileWriter.d.ts +13 -11
- package/lib/lib/helpers/fileWriter.js +19 -27
- package/lib/lib/helpers/fileWriter.js.map +1 -1
- package/lib/lib/helpers/metadataUtil.d.ts +25 -51
- package/lib/lib/helpers/metadataUtil.js +58 -127
- package/lib/lib/helpers/metadataUtil.js.map +1 -1
- package/lib/lib/helpers/validationUtil.d.ts +25 -26
- package/lib/lib/helpers/validationUtil.js +69 -43
- package/lib/lib/helpers/validationUtil.js.map +1 -1
- package/lib/lib/interfaces/createConfig.d.ts +3 -2
- package/lib/lib/interfaces/createConfig.js +3 -3
- package/lib/lib/templates/templates.d.ts +10 -99
- package/lib/lib/templates/templates.js +52 -40
- package/lib/lib/templates/templates.js.map +1 -1
- package/messages/createField.json +22 -31
- package/messages/generate.json +38 -51
- package/messages/template.json +2 -2
- package/messages/validation.json +5 -0
- package/oclif.manifest.json +1 -1
- package/package.json +57 -46
- package/lib/lib/interfaces/customField.d.ts +0 -7
- package/lib/lib/interfaces/customField.js +0 -9
- package/lib/lib/interfaces/customField.js.map +0 -1
- package/lib/lib/interfaces/errorMessage.d.ts +0 -4
- package/lib/lib/interfaces/errorMessage.js +0 -9
- package/lib/lib/interfaces/errorMessage.js.map +0 -1
- package/lib/lib/interfaces/record.d.ts +0 -3
- package/lib/lib/interfaces/record.js +0 -9
- package/lib/lib/interfaces/record.js.map +0 -1
- package/lib/lib/interfaces/saveResults.d.ts +0 -5
- package/lib/lib/interfaces/saveResults.js +0 -9
- package/lib/lib/interfaces/saveResults.js.map +0 -1
|
@@ -1,279 +1,221 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
4
|
/*
|
|
3
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) 2020, salesforce.com, inc.
|
|
4
6
|
* All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* For full license text, see
|
|
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
|
|
7
9
|
*/
|
|
8
|
-
|
|
10
|
+
const fs = require("fs");
|
|
11
|
+
const path = require("path");
|
|
9
12
|
const command_1 = require("@salesforce/command");
|
|
10
13
|
const core_1 = require("@salesforce/core");
|
|
11
14
|
const kit_1 = require("@salesforce/kit");
|
|
12
|
-
const ts_types_1 = require("@salesforce/ts-types");
|
|
13
|
-
const util_1 = require("util");
|
|
14
15
|
const createUtil_1 = require("../../../lib/helpers/createUtil");
|
|
15
16
|
const fileWriter_1 = require("../../../lib/helpers/fileWriter");
|
|
16
17
|
const metadataUtil_1 = require("../../../lib/helpers/metadataUtil");
|
|
17
18
|
const validationUtil_1 = require("../../../lib/helpers/validationUtil");
|
|
18
19
|
const templates_1 = require("../../../lib/templates/templates");
|
|
19
20
|
// Initialize Messages with the current plugin directory
|
|
20
|
-
|
|
21
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
21
22
|
// Load the specific messages for this file. Messages from @salesforce/command, @salesforce/core,
|
|
22
23
|
// or any library that is using the messages framework can also be loaded this way.
|
|
23
|
-
const messages =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
username = sourceuser;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (!util_1.isNullOrUndefined(username)) {
|
|
51
|
-
try {
|
|
52
|
-
// connect to source org if source user name provided
|
|
53
|
-
sourceOrgConn = await command_1.core.Connection.create({
|
|
54
|
-
authInfo: await command_1.core.AuthInfo.create({ username })
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
const errMsg = messages.getMessage('sourceuserAuthenticationError', [sourceuser, err.message]);
|
|
59
|
-
throw new core_1.SfdxError(errMsg, 'sourceuserAuthenticationError');
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (!validator.validateAPIName(objname)) {
|
|
63
|
-
throw core_1.SfdxError.create('@salesforce/plugin-custom-metadata', 'generate', 'sobjectnameFlagError', [objname]);
|
|
64
|
-
}
|
|
65
|
-
let devName;
|
|
66
|
-
if (!validator.validateMetadataTypeName(cmdttype)) {
|
|
67
|
-
throw core_1.SfdxError.create('@salesforce/plugin-custom-metadata', 'generate', 'typenameFlagError', [cmdttype]);
|
|
68
|
-
}
|
|
69
|
-
if (cmdttype.endsWith('__mdt') || cmdttype.endsWith('__MDT')) {
|
|
70
|
-
devName = cmdttype.substring(0, cmdttype.indexOf('__mdt'));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
devName = cmdttype;
|
|
74
|
-
}
|
|
75
|
-
let metadataUtil;
|
|
76
|
-
// get defined only if there is source username provided
|
|
77
|
-
if (!sourceOrgConn) {
|
|
78
|
-
metadataUtil = new metadataUtil_1.MetadataUtil(conn);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
metadataUtil = new metadataUtil_1.MetadataUtil(sourceOrgConn);
|
|
82
|
-
}
|
|
83
|
-
// use default target org connection to get object describe if no source is provided.
|
|
84
|
-
describeObj = await metadataUtil.describeObj(objname);
|
|
85
|
-
// throw error if the object doesnot exist(empty json as response from the describe call.)
|
|
86
|
-
if (kit_1.isEmpty(describeObj)) {
|
|
87
|
-
const errMsg = messages.getMessage('sobjectnameNoResultError', [objname]);
|
|
88
|
-
throw new core_1.SfdxError(errMsg, 'sobjectnameNoResultError');
|
|
89
|
-
}
|
|
90
|
-
// check for custom setting
|
|
91
|
-
if (describeObj['customSettingsType'] !== undefined) {
|
|
92
|
-
// if custom setting check for type and visbility
|
|
93
|
-
if (!metadataUtil.validCustomSettingType(describeObj)) {
|
|
94
|
-
const errMsg = messages.getMessage('customSettingTypeError', [objname]);
|
|
95
|
-
throw new core_1.SfdxError(errMsg, 'customSettingTypeError');
|
|
96
|
-
}
|
|
24
|
+
const messages = core_1.Messages.loadMessages('@salesforce/plugin-custom-metadata', 'generate');
|
|
25
|
+
class Generate extends command_1.SfdxCommand {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
27
|
+
async run() {
|
|
28
|
+
var _b, _c;
|
|
29
|
+
const conn = this.org.getConnection();
|
|
30
|
+
const objname = this.flags.sobjectname;
|
|
31
|
+
const devName = this.flags.devname;
|
|
32
|
+
const ignoreFields = this.flags.ignoreunsupported;
|
|
33
|
+
// use default target org connection to get object describe if no source is provided.
|
|
34
|
+
const describeObj = await conn.metadata.read('CustomObject', objname);
|
|
35
|
+
// throw error if the object doesnot exist(empty json as response from the describe call.)
|
|
36
|
+
if ((0, kit_1.isEmpty)(describeObj.fields)) {
|
|
37
|
+
const errMsg = messages.getMessage('sobjectnameNoResultError', [objname]);
|
|
38
|
+
throw new core_1.SfError(errMsg, 'sobjectnameNoResultError');
|
|
39
|
+
}
|
|
40
|
+
// check for custom setting
|
|
41
|
+
if (describeObj.customSettingsType) {
|
|
42
|
+
// if custom setting check for type and visbility
|
|
43
|
+
if (!(0, metadataUtil_1.validCustomSettingType)(describeObj)) {
|
|
44
|
+
const errMsg = messages.getMessage('customSettingTypeError', [objname]);
|
|
45
|
+
throw new core_1.SfError(errMsg, 'customSettingTypeError');
|
|
97
46
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
47
|
+
}
|
|
48
|
+
const visibility = this.flags.visibility;
|
|
49
|
+
const label = (_b = this.flags.label) !== null && _b !== void 0 ? _b : devName;
|
|
50
|
+
const pluralLabel = (_c = this.flags.plurallabel) !== null && _c !== void 0 ? _c : label;
|
|
51
|
+
const outputDir = this.flags.typeoutputdir;
|
|
52
|
+
const recordsOutputDir = this.flags.recordsoutputdir;
|
|
53
|
+
try {
|
|
54
|
+
this.ux.startSpinner('creating the CMDT object');
|
|
55
|
+
// create custom metadata type
|
|
56
|
+
const templates = new templates_1.Templates();
|
|
57
|
+
const objectXML = templates.createObjectXML({ label, pluralLabel }, visibility);
|
|
58
|
+
const fileWriter = new fileWriter_1.FileWriter();
|
|
59
|
+
await fileWriter.writeTypeFile(fs, outputDir, devName, objectXML);
|
|
60
|
+
this.ux.setSpinnerStatus('creating the CMDT fields');
|
|
61
|
+
// get all the field details before creating field metadata
|
|
62
|
+
const fields = (0, metadataUtil_1.describeObjFields)(describeObj)
|
|
63
|
+
// added type check here to skip the creation of un supported fields
|
|
64
|
+
.filter((f) => !ignoreFields || templates.canConvert(f['type']))
|
|
65
|
+
.flatMap((f) =>
|
|
66
|
+
// check for Geo Location fields before hand and create two different fields for longitude and latitude.
|
|
67
|
+
f.type !== 'Location' ? [f] : convertLocationFieldToText(f));
|
|
68
|
+
// create custom metdata fields
|
|
69
|
+
await Promise.all(fields.map((f) => fileWriter.writeFieldFile(fs, path.join(outputDir, `${devName}__mdt`), f.fullName, templates.createFieldXML(f, !ignoreFields))));
|
|
70
|
+
this.ux.setSpinnerStatus('creating the CMDT records');
|
|
71
|
+
const createUtil = new createUtil_1.CreateUtil();
|
|
72
|
+
// if customMetadata folder does not exist, create it
|
|
73
|
+
await fs.promises.mkdir(recordsOutputDir, { recursive: true });
|
|
74
|
+
const fieldDirPath = path.join(outputDir, `${devName}__mdt`, 'fields');
|
|
75
|
+
const fileNames = await fs.promises.readdir(fieldDirPath);
|
|
76
|
+
const fileData = await createUtil.getFileData(fieldDirPath, fileNames);
|
|
77
|
+
// query records from source
|
|
78
|
+
const sObjectRecords = await conn.query(getSoqlQuery(describeObj));
|
|
79
|
+
await Promise.all(sObjectRecords.records.map((rec) => {
|
|
80
|
+
const record = (0, metadataUtil_1.cleanQueryResponse)(rec, describeObj);
|
|
81
|
+
const lblName = rec['Name'];
|
|
82
|
+
const recordName = (0, validationUtil_1.isValidMetadataRecordName)(lblName) ? lblName : lblName.replace(/ +/g, '_');
|
|
83
|
+
return createUtil.createRecord({
|
|
84
|
+
typename: devName,
|
|
85
|
+
recordname: recordName,
|
|
86
|
+
label: lblName,
|
|
87
|
+
inputdir: outputDir,
|
|
88
|
+
outputdir: recordsOutputDir,
|
|
89
|
+
protected: visibility !== 'Public',
|
|
90
|
+
varargs: record,
|
|
91
|
+
fileData,
|
|
92
|
+
ignorefields: ignoreFields,
|
|
144
93
|
});
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
const createUtil = new createUtil_1.CreateUtil();
|
|
156
|
-
// if customMetadata folder does not exist, create it
|
|
157
|
-
await command_1.core.fs.mkdirp(recordsOutputDir);
|
|
158
|
-
const security = (visibility !== 'Public');
|
|
159
|
-
const typename = devName;
|
|
160
|
-
const fieldDirPath = `${fileWriter.createDir(outputDir)}${typename}__mdt/fields`;
|
|
161
|
-
const fileNames = await command_1.core.fs.readdir(fieldDirPath);
|
|
162
|
-
const fileData = await createUtil.getFileData(fieldDirPath, fileNames);
|
|
163
|
-
for (const rec of sObjectRecords.records) {
|
|
164
|
-
const record = metadataUtil.cleanQueryResponse(rec, describeObj);
|
|
165
|
-
const lblName = rec['Name'];
|
|
166
|
-
let recordName = rec['Name'];
|
|
167
|
-
if (!validator.validateMetadataRecordName(rec['Name'])) {
|
|
168
|
-
recordName = recordName.replace(/ +/g, '_');
|
|
169
|
-
}
|
|
170
|
-
await createUtil.createRecord({
|
|
171
|
-
typename,
|
|
172
|
-
recordname: recordName,
|
|
173
|
-
label: lblName,
|
|
174
|
-
inputdir: outputDir,
|
|
175
|
-
outputdir: recordsOutputDir,
|
|
176
|
-
protected: security,
|
|
177
|
-
varargs: record,
|
|
178
|
-
fileData,
|
|
179
|
-
ignorefields: ignoreFields
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
this.ux.stopSpinner('custom metadata type and records creation in completed');
|
|
183
|
-
this.ux.log(`Congrats! Created a ${devName} custom metadata type with ${sObjectRecords.records.length} records!`);
|
|
184
|
-
}
|
|
185
|
-
catch (e) {
|
|
186
|
-
await command_1.core.fs.remove(`${outputDir}${devName}__mdt`);
|
|
187
|
-
const fileNames = await command_1.core.fs.readdir(recordsOutputDir);
|
|
188
|
-
for (const file of fileNames) {
|
|
189
|
-
if (file.startsWith(devName)) {
|
|
190
|
-
try {
|
|
191
|
-
await command_1.core.fs.unlink(`${recordsOutputDir}/${file}`);
|
|
192
|
-
}
|
|
193
|
-
catch (e) {
|
|
194
|
-
this.ux.log(e.message);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
this.ux.stopSpinner('generate command failed to run');
|
|
199
|
-
const errMsg = messages.getMessage('generateError', [e.message]);
|
|
200
|
-
throw new core_1.SfdxError(errMsg, 'generateError');
|
|
94
|
+
}));
|
|
95
|
+
this.ux.stopSpinner('custom metadata type and records creation in completed');
|
|
96
|
+
this.ux.log(`Congrats! Created a ${devName} custom metadata type with ${sObjectRecords.records.length} records!`);
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
const targetDir = `${outputDir}${devName}__mdt`;
|
|
100
|
+
// dir might not exist if we never got to the creation step
|
|
101
|
+
if (fs.existsSync(targetDir)) {
|
|
102
|
+
await fs.promises.rm(targetDir, { recursive: true });
|
|
201
103
|
}
|
|
202
|
-
|
|
104
|
+
await Promise.all((await fs.promises.readdir(recordsOutputDir))
|
|
105
|
+
.filter((f) => f.startsWith(devName))
|
|
106
|
+
.map((f) => fs.promises.unlink(path.join(recordsOutputDir, f))));
|
|
107
|
+
this.ux.stopSpinner('generate command failed to run');
|
|
108
|
+
const errMsg = messages.getMessage('generateError', [e instanceof Error ? e.message : 'unknown error']);
|
|
109
|
+
throw new core_1.SfError(errMsg, 'generateError');
|
|
203
110
|
}
|
|
111
|
+
return { outputDir, recordsOutputDir };
|
|
204
112
|
}
|
|
205
|
-
|
|
206
|
-
Generate.longDescription = messages.getMessage('commandLongDescription');
|
|
207
|
-
Generate.examples = [
|
|
208
|
-
messages.getMessage('exampleCaption1'),
|
|
209
|
-
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname MySourceObject__c',
|
|
210
|
-
messages.getMessage('exampleCaption2'),
|
|
211
|
-
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname MySourceObject__c --ignoreunsupported --targetusername \'' + messages.getMessage('targetusernameFlagExample') + '\'',
|
|
212
|
-
messages.getMessage('exampleCaption3'),
|
|
213
|
-
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomObject__c --visibility Protected',
|
|
214
|
-
messages.getMessage('exampleCaption4'),
|
|
215
|
-
' $ sfdx force:cmdt:generate --devname MyCMDT --label "' + messages.getMessage('labelFlagExample') + '" ' +
|
|
216
|
-
'--plurallabel "' + messages.getMessage('plurallabelFlagExample') + '" --sobjectname SourceCustomSetting__c --visibility Protected',
|
|
217
|
-
messages.getMessage('exampleCaption5'),
|
|
218
|
-
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomSetting__c --typeoutputdir \'' + messages.getMessage('typeoutputdirFlagExample') + '\'',
|
|
219
|
-
messages.getMessage('exampleCaption6'),
|
|
220
|
-
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomSetting__c --recordsoutputdir \'' + messages.getMessage('recordsoutputdirFlagExample') + '\''
|
|
221
|
-
];
|
|
222
|
-
Generate.args = [{ name: 'file' }];
|
|
223
|
-
Generate.flagsConfig = {
|
|
224
|
-
// flag with a value (-n, --name=VALUE)
|
|
225
|
-
devname: command_1.flags.string({
|
|
226
|
-
char: 'n',
|
|
227
|
-
required: true,
|
|
228
|
-
description: messages.getMessage('devnameFlagDescription'),
|
|
229
|
-
longDescription: messages.getMessage('devnameFlagLongDescription')
|
|
230
|
-
}),
|
|
231
|
-
label: command_1.flags.string({
|
|
232
|
-
char: 'l',
|
|
233
|
-
description: messages.getMessage('labelFlagDescription'),
|
|
234
|
-
longDescription: messages.getMessage('labelFlagLongDescription')
|
|
235
|
-
}),
|
|
236
|
-
plurallabel: command_1.flags.string({
|
|
237
|
-
char: 'p',
|
|
238
|
-
description: messages.getMessage('plurallabelFlagDescription'),
|
|
239
|
-
longDescription: messages.getMessage('plurallabelFlagLongDescription')
|
|
240
|
-
}),
|
|
241
|
-
visibility: command_1.flags.enum({
|
|
242
|
-
char: 'v',
|
|
243
|
-
description: messages.getMessage('visibilityFlagDescription'),
|
|
244
|
-
longDescription: messages.getMessage('visibilityFlagLongDescription'),
|
|
245
|
-
options: ['PackageProtected', 'Protected', 'Public'],
|
|
246
|
-
default: 'Public'
|
|
247
|
-
}),
|
|
248
|
-
sobjectname: command_1.flags.string({
|
|
249
|
-
char: 's',
|
|
250
|
-
required: true,
|
|
251
|
-
description: messages.getMessage('sobjectnameFlagDescription'),
|
|
252
|
-
longDescription: messages.getMessage('sobjectnameFlagLongDescription')
|
|
253
|
-
}),
|
|
254
|
-
ignoreunsupported: command_1.flags.boolean({
|
|
255
|
-
char: 'i',
|
|
256
|
-
description: messages.getMessage('ignoreUnsupportedFlagDescription'),
|
|
257
|
-
longDescription: messages.getMessage('ignoreUnsupportedFlagLongDescription')
|
|
258
|
-
}),
|
|
259
|
-
typeoutputdir: command_1.flags.directory({
|
|
260
|
-
char: 'd',
|
|
261
|
-
description: messages.getMessage('typeoutputdirFlagDescription'),
|
|
262
|
-
longDescription: messages.getMessage('typeoutputdirFlagLongDescription'),
|
|
263
|
-
default: 'force-app/main/default/objects/'
|
|
264
|
-
}),
|
|
265
|
-
recordsoutputdir: command_1.flags.directory({
|
|
266
|
-
char: 'r',
|
|
267
|
-
description: messages.getMessage('recordsoutputdirFlagDescription'),
|
|
268
|
-
longDescription: messages.getMessage('recordsoutputdirFlagLongDescription'),
|
|
269
|
-
default: 'force-app/main/default/customMetadata/'
|
|
270
|
-
})
|
|
271
|
-
};
|
|
272
|
-
// Comment this out if your command does not require an org username
|
|
273
|
-
Generate.requiresUsername = true;
|
|
274
|
-
// Set this to true if your command requires a project workspace; 'requiresProject' is false by default
|
|
275
|
-
Generate.requiresProject = true;
|
|
276
|
-
return Generate;
|
|
277
|
-
})();
|
|
113
|
+
}
|
|
278
114
|
exports.default = Generate;
|
|
115
|
+
_a = Generate;
|
|
116
|
+
Generate.description = messages.getMessage('commandDescription');
|
|
117
|
+
Generate.longDescription = messages.getMessage('commandLongDescription');
|
|
118
|
+
Generate.examples = [
|
|
119
|
+
messages.getMessage('exampleCaption1'),
|
|
120
|
+
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname MySourceObject__c',
|
|
121
|
+
messages.getMessage('exampleCaption2'),
|
|
122
|
+
" $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname MySourceObject__c --ignoreunsupported --targetusername '" +
|
|
123
|
+
messages.getMessage('targetusernameFlagExample') +
|
|
124
|
+
"'",
|
|
125
|
+
messages.getMessage('exampleCaption3'),
|
|
126
|
+
' $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomObject__c --visibility Protected',
|
|
127
|
+
messages.getMessage('exampleCaption4'),
|
|
128
|
+
' $ sfdx force:cmdt:generate --devname MyCMDT --label "' +
|
|
129
|
+
messages.getMessage('labelFlagExample') +
|
|
130
|
+
'" ' +
|
|
131
|
+
'--plurallabel "' +
|
|
132
|
+
messages.getMessage('plurallabelFlagExample') +
|
|
133
|
+
'" --sobjectname SourceCustomSetting__c --visibility Protected',
|
|
134
|
+
messages.getMessage('exampleCaption5'),
|
|
135
|
+
" $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomSetting__c --typeoutputdir '" +
|
|
136
|
+
messages.getMessage('typeoutputdirFlagExample') +
|
|
137
|
+
"'",
|
|
138
|
+
messages.getMessage('exampleCaption6'),
|
|
139
|
+
" $ sfdx force:cmdt:generate --devname MyCMDT --sobjectname SourceCustomSetting__c --recordsoutputdir '" +
|
|
140
|
+
messages.getMessage('recordsoutputdirFlagExample') +
|
|
141
|
+
"'",
|
|
142
|
+
];
|
|
143
|
+
Generate.args = [{ name: 'file' }];
|
|
144
|
+
Generate.flagsConfig = {
|
|
145
|
+
// flag with a value (-n, --name=VALUE)
|
|
146
|
+
devname: command_1.flags.string({
|
|
147
|
+
char: 'n',
|
|
148
|
+
required: true,
|
|
149
|
+
description: messages.getMessage('devnameFlagDescription'),
|
|
150
|
+
longDescription: messages.getMessage('devnameFlagLongDescription'),
|
|
151
|
+
parse: async (input) => Promise.resolve((0, validationUtil_1.validateMetadataTypeName)(input)),
|
|
152
|
+
}),
|
|
153
|
+
label: command_1.flags.string({
|
|
154
|
+
char: 'l',
|
|
155
|
+
description: messages.getMessage('labelFlagDescription'),
|
|
156
|
+
longDescription: messages.getMessage('labelFlagLongDescription'),
|
|
157
|
+
}),
|
|
158
|
+
plurallabel: command_1.flags.string({
|
|
159
|
+
char: 'p',
|
|
160
|
+
description: messages.getMessage('plurallabelFlagDescription'),
|
|
161
|
+
longDescription: messages.getMessage('plurallabelFlagLongDescription'),
|
|
162
|
+
}),
|
|
163
|
+
visibility: command_1.flags.enum({
|
|
164
|
+
char: 'v',
|
|
165
|
+
description: messages.getMessage('visibilityFlagDescription'),
|
|
166
|
+
longDescription: messages.getMessage('visibilityFlagLongDescription'),
|
|
167
|
+
options: ['PackageProtected', 'Protected', 'Public'],
|
|
168
|
+
default: 'Public',
|
|
169
|
+
}),
|
|
170
|
+
sobjectname: command_1.flags.string({
|
|
171
|
+
char: 's',
|
|
172
|
+
required: true,
|
|
173
|
+
description: messages.getMessage('sobjectnameFlagDescription'),
|
|
174
|
+
longDescription: messages.getMessage('sobjectnameFlagLongDescription'),
|
|
175
|
+
parse: async (sobjectname) => Promise.resolve((0, validationUtil_1.validateAPIName)(sobjectname)),
|
|
176
|
+
}),
|
|
177
|
+
ignoreunsupported: command_1.flags.boolean({
|
|
178
|
+
char: 'i',
|
|
179
|
+
description: messages.getMessage('ignoreUnsupportedFlagDescription'),
|
|
180
|
+
longDescription: messages.getMessage('ignoreUnsupportedFlagLongDescription'),
|
|
181
|
+
}),
|
|
182
|
+
typeoutputdir: command_1.flags.directory({
|
|
183
|
+
char: 'd',
|
|
184
|
+
description: messages.getMessage('typeoutputdirFlagDescription'),
|
|
185
|
+
longDescription: messages.getMessage('typeoutputdirFlagLongDescription'),
|
|
186
|
+
default: path.join('force-app', 'main', 'default', 'objects'),
|
|
187
|
+
}),
|
|
188
|
+
recordsoutputdir: command_1.flags.directory({
|
|
189
|
+
char: 'r',
|
|
190
|
+
description: messages.getMessage('recordsoutputdirFlagDescription'),
|
|
191
|
+
longDescription: messages.getMessage('recordsoutputdirFlagLongDescription'),
|
|
192
|
+
default: path.join('force-app', 'main', 'default', 'customMetadata'),
|
|
193
|
+
}),
|
|
194
|
+
};
|
|
195
|
+
Generate.requiresUsername = true;
|
|
196
|
+
Generate.requiresProject = true;
|
|
197
|
+
const getSoqlQuery = (describeResult) => {
|
|
198
|
+
const fieldNames = describeResult.fields
|
|
199
|
+
.map((field) => {
|
|
200
|
+
return field.fullName;
|
|
201
|
+
})
|
|
202
|
+
.join(',');
|
|
203
|
+
// Added Name hardcoded as Name field is not retrieved as part of object describe.
|
|
204
|
+
return `SELECT Name, ${fieldNames} FROM ${describeResult.fullName}`;
|
|
205
|
+
};
|
|
206
|
+
const convertLocationFieldToText = (field) => {
|
|
207
|
+
const baseTextField = {
|
|
208
|
+
required: field['required'],
|
|
209
|
+
trackHistory: field['trackHistory'],
|
|
210
|
+
trackTrending: field['trackTrending'],
|
|
211
|
+
type: 'Text',
|
|
212
|
+
length: 40,
|
|
213
|
+
summaryFilterItems: [],
|
|
214
|
+
};
|
|
215
|
+
return ['Lat_', 'Long_'].map((prefix) => ({
|
|
216
|
+
...baseTextField,
|
|
217
|
+
fullName: `${prefix}${field.fullName}`,
|
|
218
|
+
label: `${prefix}${field.label}`,
|
|
219
|
+
}));
|
|
220
|
+
};
|
|
279
221
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/commands/force/cmdt/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/commands/force/cmdt/generate.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yBAAyB;AACzB,6BAA6B;AAC7B,iDAAyD;AACzD,2CAAqD;AACrD,yCAA0C;AAE1C,gEAA6D;AAC7D,gEAA6D;AAC7D,oEAAkH;AAClH,wEAI6C;AAC7C,gEAA6D;AAE7D,wDAAwD;AACxD,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAE5C,iGAAiG;AACjG,mFAAmF;AACnF,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,oCAAoC,EAAE,UAAU,CAAC,CAAC;AAMzF,MAAqB,QAAS,SAAQ,qBAAW;IAuF/C,8DAA8D;IACvD,KAAK,CAAC,GAAG;;QACd,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,WAAqB,CAAC;QACjD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAiB,CAAC;QAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,iBAA4B,CAAC;QAE7D,qFAAqF;QACrF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtE,0FAA0F;QAC1F,IAAI,IAAA,aAAO,EAAC,WAAW,CAAC,MAAM,CAAC,EAAE;YAC/B,MAAM,MAAM,GAAG,QAAQ,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AC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,CAAC;KACrE,CAAC;CACF,CAAA;AAEe,yBAAgB,GAAG,IAAK,CAAA;AACxB,wBAAe,GAAG,IAAK,CAAA;AAkH1C,MAAM,YAAY,GAAG,CAAC,cAA4B,EAAU,EAAE;IAC5D,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM;SACrC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACb,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,kFAAkF;IAClF,OAAO,gBAAgB,UAAU,SAAS,cAAc,CAAC,QAAQ,EAAE,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,KAAkB,EAAiB,EAAE;IACvE,MAAM,aAAa,GAAG;QACpB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC;QAC3B,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC;QACnC,aAAa,EAAE,KAAK,CAAC,eAAe,CAAC;QACrC,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,EAAE;KACvB,CAAC;IACF,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACxC,GAAG,aAAa;QAChB,QAAQ,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE;QACtC,KAAK,EAAE,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE;KACjC,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
-
import {
|
|
2
|
+
import { CustomField } from 'jsforce/api/metadata';
|
|
3
|
+
interface CmdtRecordCreateResponse {
|
|
4
|
+
typename: string;
|
|
5
|
+
recordname: string;
|
|
6
|
+
label: string;
|
|
7
|
+
inputdir: string;
|
|
8
|
+
outputdir: string;
|
|
9
|
+
protectedFlag: boolean;
|
|
10
|
+
varargs: Record<string, unknown>;
|
|
11
|
+
fileData: CustomField[];
|
|
12
|
+
}
|
|
3
13
|
export default class Create extends SfdxCommand {
|
|
4
14
|
static description: string;
|
|
5
15
|
static longDescription: string;
|
|
6
16
|
static examples: string[];
|
|
7
17
|
protected static flagsConfig: {
|
|
8
|
-
typename: flags.Discriminated<flags.
|
|
9
|
-
recordname: flags.Discriminated<flags.
|
|
10
|
-
label: flags.Discriminated<flags.
|
|
11
|
-
protected: flags.Discriminated<flags.
|
|
12
|
-
inputdir: flags.Discriminated<flags.
|
|
13
|
-
outputdir: flags.Discriminated<flags.
|
|
18
|
+
typename: flags.Discriminated<flags.String>;
|
|
19
|
+
recordname: flags.Discriminated<flags.String>;
|
|
20
|
+
label: flags.Discriminated<flags.String>;
|
|
21
|
+
protected: flags.Discriminated<flags.String>;
|
|
22
|
+
inputdir: flags.Discriminated<flags.String>;
|
|
23
|
+
outputdir: flags.Discriminated<flags.String>;
|
|
14
24
|
};
|
|
15
25
|
protected static varargs: {
|
|
16
26
|
required: boolean;
|
|
17
|
-
validator: (name:
|
|
27
|
+
validator: (name: string) => void;
|
|
18
28
|
};
|
|
19
29
|
protected static requiresProject: boolean;
|
|
20
|
-
run(): Promise<
|
|
30
|
+
run(): Promise<CmdtRecordCreateResponse>;
|
|
21
31
|
}
|
|
32
|
+
export {};
|