@salesforce/plugin-custom-metadata 1.1.0 → 2.0.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/LICENSE.txt +2 -2
- package/README.md +137 -133
- package/lib/commands/force/cmdt/create.d.ts +8 -2
- package/lib/commands/force/cmdt/create.js +15 -21
- package/lib/commands/force/cmdt/create.js.map +1 -1
- package/lib/commands/force/cmdt/field/create.d.ts +7 -2
- package/lib/commands/force/cmdt/field/create.js +15 -20
- package/lib/commands/force/cmdt/field/create.js.map +1 -1
- package/lib/commands/force/cmdt/generate.d.ts +6 -2
- package/lib/commands/force/cmdt/generate.js +79 -150
- package/lib/commands/force/cmdt/generate.js.map +1 -1
- package/lib/commands/force/cmdt/record/create.d.ts +14 -3
- package/lib/commands/force/cmdt/record/create.js +25 -33
- package/lib/commands/force/cmdt/record/create.js.map +1 -1
- package/lib/commands/force/cmdt/record/insert.d.ts +2 -2
- package/lib/commands/force/cmdt/record/insert.js +28 -40
- package/lib/commands/force/cmdt/record/insert.js.map +1 -1
- package/lib/lib/helpers/createUtil.d.ts +10 -6
- package/lib/lib/helpers/createUtil.js +48 -100
- package/lib/lib/helpers/createUtil.js.map +1 -1
- package/lib/lib/helpers/fileWriter.d.ts +11 -11
- package/lib/lib/helpers/fileWriter.js +14 -24
- package/lib/lib/helpers/fileWriter.js.map +1 -1
- package/lib/lib/helpers/metadataUtil.d.ts +25 -51
- package/lib/lib/helpers/metadataUtil.js +55 -131
- package/lib/lib/helpers/metadataUtil.js.map +1 -1
- package/lib/lib/helpers/validationUtil.d.ts +25 -26
- package/lib/lib/helpers/validationUtil.js +66 -43
- package/lib/lib/helpers/validationUtil.js.map +1 -1
- package/lib/lib/interfaces/createConfig.d.ts +3 -2
- package/lib/lib/templates/templates.d.ts +8 -99
- package/lib/lib/templates/templates.js +38 -67
- 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 +53 -42
- package/CHANGELOG.md +0 -39
- 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,3 +1,4 @@
|
|
|
1
|
+
import { CustomField } from 'jsforce/api/metadata';
|
|
1
2
|
export declare class Templates {
|
|
2
3
|
/**
|
|
3
4
|
* Using the given data and visibility, creates the body of a type metadata file
|
|
@@ -5,110 +6,19 @@ export declare class Templates {
|
|
|
5
6
|
* @param data
|
|
6
7
|
* @param visibility
|
|
7
8
|
*/
|
|
8
|
-
createObjectXML(
|
|
9
|
+
createObjectXML({ label, pluralLabel }: {
|
|
10
|
+
label: string;
|
|
11
|
+
pluralLabel: string;
|
|
12
|
+
}, visibility: string): string;
|
|
9
13
|
/**
|
|
10
14
|
* Using the given data and defaultToString, creates the body for a field file.
|
|
11
15
|
*
|
|
12
16
|
* @param data Record details
|
|
13
17
|
* @param defaultToString If the defaultToString set type to Text for unsupported field types
|
|
14
18
|
*/
|
|
15
|
-
createFieldXML(data:
|
|
16
|
-
createDefaultTypeStructure(fullName: string, type: string, label: string, picklistValues: string[], decimalplaces?: number):
|
|
17
|
-
|
|
18
|
-
defaultValue: string;
|
|
19
|
-
type: "Checkbox";
|
|
20
|
-
label: string;
|
|
21
|
-
unique?: undefined;
|
|
22
|
-
precision?: undefined;
|
|
23
|
-
scale?: undefined;
|
|
24
|
-
valueSet?: undefined;
|
|
25
|
-
length?: undefined;
|
|
26
|
-
visibleLines?: undefined;
|
|
27
|
-
} | {
|
|
28
|
-
fullName: string;
|
|
29
|
-
type: "Email";
|
|
30
|
-
label: string;
|
|
31
|
-
unique: string;
|
|
32
|
-
defaultValue?: undefined;
|
|
33
|
-
precision?: undefined;
|
|
34
|
-
scale?: undefined;
|
|
35
|
-
valueSet?: undefined;
|
|
36
|
-
length?: undefined;
|
|
37
|
-
visibleLines?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
fullName: string;
|
|
40
|
-
type: "Number";
|
|
41
|
-
label: string;
|
|
42
|
-
precision: number;
|
|
43
|
-
scale: number;
|
|
44
|
-
unique: string;
|
|
45
|
-
defaultValue?: undefined;
|
|
46
|
-
valueSet?: undefined;
|
|
47
|
-
length?: undefined;
|
|
48
|
-
visibleLines?: undefined;
|
|
49
|
-
} | {
|
|
50
|
-
fullName: string;
|
|
51
|
-
type: "Percent";
|
|
52
|
-
label: string;
|
|
53
|
-
precision: number;
|
|
54
|
-
scale: number;
|
|
55
|
-
defaultValue?: undefined;
|
|
56
|
-
unique?: undefined;
|
|
57
|
-
valueSet?: undefined;
|
|
58
|
-
length?: undefined;
|
|
59
|
-
visibleLines?: undefined;
|
|
60
|
-
} | {
|
|
61
|
-
fullName: string;
|
|
62
|
-
type: "Picklist";
|
|
63
|
-
label: string;
|
|
64
|
-
valueSet: {
|
|
65
|
-
restricted: string;
|
|
66
|
-
valueSetDefinition: {
|
|
67
|
-
sorted: string;
|
|
68
|
-
value: any[];
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
defaultValue?: undefined;
|
|
72
|
-
unique?: undefined;
|
|
73
|
-
precision?: undefined;
|
|
74
|
-
scale?: undefined;
|
|
75
|
-
length?: undefined;
|
|
76
|
-
visibleLines?: undefined;
|
|
77
|
-
} | {
|
|
78
|
-
fullName: string;
|
|
79
|
-
type: "Text";
|
|
80
|
-
label: string;
|
|
81
|
-
unique: string;
|
|
82
|
-
length: string;
|
|
83
|
-
defaultValue?: undefined;
|
|
84
|
-
precision?: undefined;
|
|
85
|
-
scale?: undefined;
|
|
86
|
-
valueSet?: undefined;
|
|
87
|
-
visibleLines?: undefined;
|
|
88
|
-
} | {
|
|
89
|
-
fullName: string;
|
|
90
|
-
type: "LongTextArea";
|
|
91
|
-
label: string;
|
|
92
|
-
length: string;
|
|
93
|
-
visibleLines: number;
|
|
94
|
-
defaultValue?: undefined;
|
|
95
|
-
unique?: undefined;
|
|
96
|
-
precision?: undefined;
|
|
97
|
-
scale?: undefined;
|
|
98
|
-
valueSet?: undefined;
|
|
99
|
-
} | {
|
|
100
|
-
fullName: string;
|
|
101
|
-
type: string;
|
|
102
|
-
label: string;
|
|
103
|
-
defaultValue?: undefined;
|
|
104
|
-
unique?: undefined;
|
|
105
|
-
precision?: undefined;
|
|
106
|
-
scale?: undefined;
|
|
107
|
-
valueSet?: undefined;
|
|
108
|
-
length?: undefined;
|
|
109
|
-
visibleLines?: undefined;
|
|
110
|
-
};
|
|
111
|
-
canConvert(type: any): boolean;
|
|
19
|
+
createFieldXML(data: CustomField, defaultToString: boolean): string;
|
|
20
|
+
createDefaultTypeStructure(fullName: string, type: string, label: string, picklistValues: string[], decimalplaces?: number): CustomField;
|
|
21
|
+
canConvert(type: string): boolean;
|
|
112
22
|
private getType;
|
|
113
23
|
private getConvertType;
|
|
114
24
|
private getFullName;
|
|
@@ -124,5 +34,4 @@ export declare class Templates {
|
|
|
124
34
|
private getVisibleLines;
|
|
125
35
|
private getDefaultValue;
|
|
126
36
|
private getValueSet;
|
|
127
|
-
private createPicklistValues;
|
|
128
37
|
}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.Templates = void 0;
|
|
10
10
|
const core_1 = require("@salesforce/core");
|
|
11
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
12
|
+
const messages = core_1.Messages.load('@salesforce/plugin-custom-metadata', 'template', ['errorNotAValidType']);
|
|
13
|
+
const createPicklistValues = (values) => values.map((value) => ({ fullName: value, label: value, default: false }));
|
|
11
14
|
class Templates {
|
|
12
15
|
/**
|
|
13
16
|
* Using the given data and visibility, creates the body of a type metadata file
|
|
@@ -15,12 +18,11 @@ class Templates {
|
|
|
15
18
|
* @param data
|
|
16
19
|
* @param visibility
|
|
17
20
|
*/
|
|
18
|
-
createObjectXML(
|
|
21
|
+
createObjectXML({ label, pluralLabel }, visibility) {
|
|
19
22
|
let returnValue = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
20
|
-
returnValue +=
|
|
21
|
-
|
|
22
|
-
returnValue += `\t<
|
|
23
|
-
returnValue += `\t<pluralLabel>${data.pluralLabel}</pluralLabel>\n`;
|
|
23
|
+
returnValue += '<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">\n';
|
|
24
|
+
returnValue += `\t<label>${label}</label>\n`;
|
|
25
|
+
returnValue += `\t<pluralLabel>${pluralLabel}</pluralLabel>\n`;
|
|
24
26
|
returnValue += `\t<visibility>${visibility}</visibility>\n`;
|
|
25
27
|
returnValue += '</CustomObject>\n';
|
|
26
28
|
return returnValue;
|
|
@@ -33,8 +35,7 @@ class Templates {
|
|
|
33
35
|
*/
|
|
34
36
|
createFieldXML(data, defaultToString) {
|
|
35
37
|
let returnValue = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
36
|
-
returnValue +=
|
|
37
|
-
'<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">\n';
|
|
38
|
+
returnValue += '<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">\n';
|
|
38
39
|
returnValue += this.getFullName(data);
|
|
39
40
|
returnValue += this.getDescription(data);
|
|
40
41
|
returnValue += this.getExternalId(data);
|
|
@@ -60,44 +61,40 @@ class Templates {
|
|
|
60
61
|
createDefaultTypeStructure(fullName, type, label, picklistValues, decimalplaces = 0) {
|
|
61
62
|
const precision = 18 - decimalplaces;
|
|
62
63
|
const scale = decimalplaces;
|
|
64
|
+
const baseObject = { fullName, type, label, summaryFilterItems: [] };
|
|
63
65
|
switch (type) {
|
|
64
66
|
case 'Checkbox':
|
|
65
|
-
return {
|
|
66
|
-
case 'Date':
|
|
67
|
-
return { fullName, type, label };
|
|
68
|
-
case 'DateTime':
|
|
69
|
-
return { fullName, type, label };
|
|
67
|
+
return { ...baseObject, defaultValue: 'false' };
|
|
70
68
|
case 'Email':
|
|
71
|
-
return {
|
|
69
|
+
return { ...baseObject, unique: false };
|
|
72
70
|
case 'Number':
|
|
73
|
-
return {
|
|
71
|
+
return { ...baseObject, precision, scale, unique: false };
|
|
74
72
|
case 'Percent':
|
|
75
|
-
return {
|
|
76
|
-
case 'Phone':
|
|
77
|
-
return { fullName, type, label };
|
|
73
|
+
return { ...baseObject, precision, scale };
|
|
78
74
|
case 'Picklist':
|
|
79
75
|
return {
|
|
80
|
-
|
|
81
|
-
type,
|
|
82
|
-
label,
|
|
76
|
+
...baseObject,
|
|
83
77
|
valueSet: {
|
|
84
|
-
restricted:
|
|
78
|
+
restricted: true,
|
|
85
79
|
valueSetDefinition: {
|
|
86
|
-
sorted:
|
|
87
|
-
value:
|
|
80
|
+
sorted: false,
|
|
81
|
+
value: createPicklistValues(picklistValues),
|
|
88
82
|
},
|
|
83
|
+
valueSettings: [],
|
|
89
84
|
},
|
|
90
85
|
};
|
|
91
86
|
case 'Text':
|
|
92
|
-
return {
|
|
93
|
-
case 'TextArea':
|
|
94
|
-
return { fullName, type, label };
|
|
87
|
+
return { ...baseObject, unique: false, length: 100 };
|
|
95
88
|
case 'LongTextArea':
|
|
96
|
-
return {
|
|
89
|
+
return { ...baseObject, length: 32768, visibleLines: 3 };
|
|
90
|
+
case 'Date':
|
|
91
|
+
case 'DateTime':
|
|
92
|
+
case 'Phone':
|
|
93
|
+
case 'TextArea':
|
|
97
94
|
case 'Url':
|
|
98
|
-
return
|
|
95
|
+
return baseObject;
|
|
99
96
|
default:
|
|
100
|
-
return
|
|
97
|
+
return baseObject;
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
canConvert(type) {
|
|
@@ -129,7 +126,7 @@ class Templates {
|
|
|
129
126
|
return `\t<type>${this.getConvertType(data)}</type>\n`;
|
|
130
127
|
}
|
|
131
128
|
else {
|
|
132
|
-
throw core_1.
|
|
129
|
+
throw new core_1.SfError(messages.getMessage('errorNotAValidType', [data.type]));
|
|
133
130
|
}
|
|
134
131
|
}
|
|
135
132
|
getConvertType(data) {
|
|
@@ -143,48 +140,37 @@ class Templates {
|
|
|
143
140
|
}
|
|
144
141
|
}
|
|
145
142
|
getFullName(data) {
|
|
146
|
-
const name = data.fullName.endsWith('__c')
|
|
147
|
-
? data.fullName
|
|
148
|
-
: data.fullName + '__c';
|
|
143
|
+
const name = data.fullName.endsWith('__c') ? data.fullName : data.fullName + '__c';
|
|
149
144
|
return `\t<fullName>${name}</fullName>\n`;
|
|
150
145
|
}
|
|
151
146
|
getDescription(data) {
|
|
152
|
-
return data.description
|
|
153
|
-
? `\t<description>${data.description}</description>\n`
|
|
154
|
-
: '';
|
|
147
|
+
return data.description ? `\t<description>${data.description}</description>\n` : '';
|
|
155
148
|
}
|
|
156
149
|
getExternalId(data) {
|
|
157
|
-
return data.externalId
|
|
158
|
-
? `\t<externalId>${data.externalId}</externalId>\n`
|
|
159
|
-
: '';
|
|
150
|
+
return data.externalId ? `\t<externalId>${data.externalId}</externalId>\n` : '';
|
|
160
151
|
}
|
|
161
152
|
getFieldManageability(data) {
|
|
162
153
|
return `\t<fieldManageability>${data.fieldManageability || 'DeveloperControlled'}</fieldManageability>\n`;
|
|
163
154
|
}
|
|
164
155
|
getInlineHelpText(data) {
|
|
165
|
-
return data.inlineHelpText
|
|
166
|
-
? `\t<inlineHelpText>${data.inlineHelpText}</inlineHelpText>\n`
|
|
167
|
-
: '';
|
|
156
|
+
return data.inlineHelpText ? `\t<inlineHelpText>${data.inlineHelpText}</inlineHelpText>\n` : '';
|
|
168
157
|
}
|
|
169
158
|
getLabel(data) {
|
|
170
159
|
return `\t<label>${data.label}</label>\n`;
|
|
171
160
|
}
|
|
172
161
|
getRequiredTag(data) {
|
|
173
|
-
return data.unique ? `\t<unique>${data.unique}</unique>\n` : '';
|
|
162
|
+
return typeof data.unique === 'boolean' ? `\t<unique>${data.unique}</unique>\n` : '';
|
|
174
163
|
}
|
|
175
164
|
getPrecisionTag(data) {
|
|
176
165
|
return data.precision ? `\t<precision>${data.precision}</precision>\n` : '';
|
|
177
166
|
}
|
|
178
167
|
getScaleTag(data) {
|
|
179
|
-
return typeof data.scale !== 'undefined'
|
|
180
|
-
? `\t<scale>${data.scale}</scale>\n`
|
|
181
|
-
: '';
|
|
168
|
+
return typeof data.scale !== 'undefined' ? `\t<scale>${data.scale}</scale>\n` : '';
|
|
182
169
|
}
|
|
183
170
|
getLengthTag(data) {
|
|
184
171
|
// If field type is multiselect or
|
|
185
172
|
// data type is text with no length attribute then it is formula field then set the length to 32768 as we are setting the type LongTextArea
|
|
186
|
-
if (data.type === 'MultiselectPicklist' ||
|
|
187
|
-
(data.type === 'Text' && data.length === undefined)) {
|
|
173
|
+
if (data.type === 'MultiselectPicklist' || (data.type === 'Text' && data.length === undefined)) {
|
|
188
174
|
return '\t<length>32768</length>\n';
|
|
189
175
|
}
|
|
190
176
|
if (data.length) {
|
|
@@ -193,30 +179,22 @@ class Templates {
|
|
|
193
179
|
// For fields that are being translated from Custom objects that do not have a matching type they are
|
|
194
180
|
// being defaulted to a Text field. They need to have a minimum length to them
|
|
195
181
|
// e.g. Field types that are getting converted: Currency, Location, MasterDetail, Lookup
|
|
196
|
-
return !this.canConvert(data.type) && this.getConvertType(data) === 'Text'
|
|
197
|
-
? '\t<length>100</length>\n'
|
|
198
|
-
: '';
|
|
182
|
+
return !this.canConvert(data.type) && this.getConvertType(data) === 'Text' ? '\t<length>100</length>\n' : '';
|
|
199
183
|
}
|
|
200
184
|
getVisibleLines(data) {
|
|
201
185
|
if (data.type === 'Text' && data.length === undefined) {
|
|
202
186
|
return '\t<visibleLines>3</visibleLines>\n';
|
|
203
187
|
}
|
|
204
|
-
return data.visibleLines
|
|
205
|
-
? `\t<visibleLines>${data.visibleLines}</visibleLines>\n`
|
|
206
|
-
: '';
|
|
188
|
+
return data.visibleLines ? `\t<visibleLines>${data.visibleLines}</visibleLines>\n` : '';
|
|
207
189
|
}
|
|
208
190
|
getDefaultValue(data) {
|
|
209
191
|
if (data.type === 'Currency') {
|
|
210
|
-
return data.defaultValue
|
|
211
|
-
? `\t<defaultValue>'${data.defaultValue}'</defaultValue>\n`
|
|
212
|
-
: '';
|
|
192
|
+
return data.defaultValue ? `\t<defaultValue>'${data.defaultValue}'</defaultValue>\n` : '';
|
|
213
193
|
}
|
|
214
194
|
else if (data.type === 'Checkbox' && data.defaultValue === undefined) {
|
|
215
195
|
return '\t<defaultValue>false</defaultValue>\n';
|
|
216
196
|
}
|
|
217
|
-
return data.defaultValue
|
|
218
|
-
? `\t<defaultValue>${data.defaultValue}</defaultValue>\n`
|
|
219
|
-
: '';
|
|
197
|
+
return data.defaultValue ? `\t<defaultValue>${data.defaultValue}</defaultValue>\n` : '';
|
|
220
198
|
}
|
|
221
199
|
getValueSet(data) {
|
|
222
200
|
let fieldValue = '';
|
|
@@ -237,13 +215,6 @@ class Templates {
|
|
|
237
215
|
}
|
|
238
216
|
return fieldValue;
|
|
239
217
|
}
|
|
240
|
-
createPicklistValues(values) {
|
|
241
|
-
const picklistValues = [];
|
|
242
|
-
values.forEach((value) => {
|
|
243
|
-
picklistValues.push({ fullName: value, label: value });
|
|
244
|
-
});
|
|
245
|
-
return picklistValues;
|
|
246
|
-
}
|
|
247
218
|
}
|
|
248
219
|
exports.Templates = Templates;
|
|
249
220
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/lib/templates/templates.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"templates.js","s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AC,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACvD,UAAU,IAAI,iBAAiB,CAAC;gBAChC,UAAU,IAAI,qBAAqB,KAAK,CAAC,QAAQ,eAAe,CAAC;gBACjE,UAAU,IAAI,oBAAoB,KAAK,CAAC,OAAO,IAAI,KAAK,cAAc,CAAC;gBACvE,UAAU,IAAI,kBAAkB,KAAK,CAAC,KAAK,YAAY,CAAC;gBACxD,UAAU,IAAI,kBAAkB,CAAC;YACnC,CAAC,CAAC,CAAC;YACH,UAAU,IAAI,6BAA6B,CAAC;YAC5C,UAAU,IAAI,iBAAiB,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AApOD,8BAoOC"}
|
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"outputDirectoryFlagDescription": "directory to store newly-created field definition files",
|
|
25
|
-
"outputDirectoryFlagLongDescription": "The directory to store the newly-created field definition files. The location can be an absolute path or relative to the current working directory. The default is the current directory.",
|
|
26
|
-
|
|
27
|
-
"invalidCustomFieldError": "'%s' is an invalid field. Custom fields can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore, and cannot contain two consecutive underscore characters.",
|
|
28
|
-
"picklistValuesNotSuppliedError": "Picklist values are required when field type is Picklist.",
|
|
29
|
-
"invalidDecimalError": "%s is an invalid number. Number of decimal places must be greater than or equal to zero.",
|
|
30
|
-
"targetDirectory" : "target dir = %s",
|
|
31
|
-
"fileCreated": " created %s",
|
|
32
|
-
"fileUpdate":" updated %s"
|
|
2
|
+
"commandDescription": "generate a custom metadata field based on the field type provided",
|
|
3
|
+
"commandLongDescription": "Generate a custom metadata field based on the field type provided.",
|
|
4
|
+
"exampleCaption1": "Create a metadata file for a custom checkbox field:",
|
|
5
|
+
"exampleCaption2": "Create a metadata file for a custom picklist field:",
|
|
6
|
+
"exampleCaption3": "Create a metadata file for a custom number field:",
|
|
7
|
+
"nameFlagDescription": "unique name for the field",
|
|
8
|
+
"nameFlagLongDescription": "The unique name for the field.",
|
|
9
|
+
"fieldTypeDescription": "type of field",
|
|
10
|
+
"fieldTypeLongDescription": "The type of field.",
|
|
11
|
+
"picklistValuesFlagDescription": "comma-separated list of picklist values; required for Picklist fields",
|
|
12
|
+
"picklistValuesFlagLongDescription": "A comma-separated list of picklist values. These values are required when creating a Picklist field.",
|
|
13
|
+
"decimalplacesFlagDescription": "number of decimal places to use for Number or Percent fields",
|
|
14
|
+
"decimalplacesFlagLongDescription": "The number of decimal places to use for Number or Percent fields. The value must be greater than or equal to zero.",
|
|
15
|
+
"labelFlagDescription": "label for the field",
|
|
16
|
+
"labelFlagLongDescription": "The label for the field.",
|
|
17
|
+
"outputDirectoryFlagDescription": "directory to store newly-created field definition files",
|
|
18
|
+
"outputDirectoryFlagLongDescription": "The directory to store the newly-created field definition files. The location can be an absolute path or relative to the current working directory. The default is the current directory.",
|
|
19
|
+
"invalidCustomFieldError": "'%s' is an invalid field. Custom fields can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore, and cannot contain two consecutive underscore characters.",
|
|
20
|
+
"picklistValuesNotSuppliedError": "Picklist values are required when field type is Picklist.",
|
|
21
|
+
"targetDirectory": "target dir = %s",
|
|
22
|
+
"fileCreated": " created %s",
|
|
23
|
+
"fileUpdate": " updated %s"
|
|
33
24
|
}
|
package/messages/generate.json
CHANGED
|
@@ -1,53 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"recordsoutputdirFlagExample": "path/to/my/cmdt/record/directory",
|
|
41
|
-
|
|
42
|
-
"loglevelFlagDescription": "logging level for this command invocation",
|
|
43
|
-
"loglevelFlagLongDescription": "The logging level for this command invocation.",
|
|
44
|
-
|
|
45
|
-
"typenameFlagError": "Not a valid custom metadata type name",
|
|
46
|
-
"sobjectnameFlagError": "Not a valid custom setting/custom object name",
|
|
47
|
-
"sobjectnameNoResultError": "No sObject with name %s found in the org.",
|
|
48
|
-
"sourceusernameError": "No user found with the provided username or alias",
|
|
49
|
-
"sourceuserAuthenticationError": "Issue with authenticating to source org with targetusername provided: %s More info: %s.",
|
|
50
|
-
"generateError": "Failed to generate custom metadata. Reason: %s.",
|
|
51
|
-
"customSettingTypeError": "Cannot generate custom metadata for the custom setting %s. Check type and visibility.",
|
|
52
|
-
"queryError": "Cannot query records on %s. Failed with following error: %s."
|
|
2
|
+
"commandDescription": "generates a custom metadata type and all its records for the provided sObject",
|
|
3
|
+
"commandLongDescription": "Generates a custom metadata type and all its records for the provided sObject.",
|
|
4
|
+
"exampleCaption1": "Generate a custom metadata type from an sObject in the default target org:",
|
|
5
|
+
"exampleCaption2": "Generate a custom metadata type from an sObject in the specified target org; ignore unsupported field types instead of converting them to text:",
|
|
6
|
+
"exampleCaption3": "Generate a protected custom metadata type from an sObject in the default target org:",
|
|
7
|
+
"exampleCaption4": "Generate a protected custom metadata type with a specific label from an sObject in the default target org:",
|
|
8
|
+
"exampleCaption5": "Generate a custom metadata type from an sObject in the default target org; put the resulting type metadata file in the specified directory:",
|
|
9
|
+
"exampleCaption6": "Generate a custom metadata type from an sObject in the default target org; put the resulting record metadata file(s) in the specified directory:",
|
|
10
|
+
"visibilityFlagDescription": "visibility of the custom metadata type",
|
|
11
|
+
"visibilityFlagLongDescription": "The visibility of the custom metadata type.",
|
|
12
|
+
"devnameFlagDescription": "name of the custom metadata type",
|
|
13
|
+
"devnameFlagLongDescription": "The name of the custom metadata type.",
|
|
14
|
+
"labelFlagDescription": "label for the custom metadata type",
|
|
15
|
+
"labelFlagLongDescription": "The label for the custom metadata type.",
|
|
16
|
+
"labelFlagExample": "My CMDT",
|
|
17
|
+
"plurallabelFlagDescription": "plural version of the label value; if blank, uses label",
|
|
18
|
+
"plurallabelFlagLongDescription": "The plural version of the label value. If this flag is missing or blank, the singular label is used as the plural label.",
|
|
19
|
+
"plurallabelFlagExample": "My CMDTs",
|
|
20
|
+
"sobjectnameFlagDescription": "API name of the sObject source for custom metadata generation",
|
|
21
|
+
"sobjectnameFlagLongDescription": "The API name of the sObject source for custom metadata generation.",
|
|
22
|
+
"targetusernameFlagExample": "alias or user email of the org containing the source type",
|
|
23
|
+
"ignoreUnsupportedFlagDescription": "ignore unsupported field types",
|
|
24
|
+
"ignoreUnsupportedFlagLongDescription": "Ignore unsupported field types (these fields will not be created). The default is to create Text fields and convert the source value to text.",
|
|
25
|
+
"typeoutputdirFlagDescription": "directory to store newly-created custom metadata type files",
|
|
26
|
+
"typeoutputdirFlagLongDescription": "The directory to store newly-created custom metadata type files.",
|
|
27
|
+
"typeoutputdirFlagExample": "path/to/my/cmdt/directory",
|
|
28
|
+
"recordsoutputdirFlagDescription": "directory to store newly-created custom metadata record files",
|
|
29
|
+
"recordsoutputdirFlagLongDescription": "The directory to store newly-created custom metadata record files.",
|
|
30
|
+
"recordsoutputdirFlagExample": "path/to/my/cmdt/record/directory",
|
|
31
|
+
"loglevelFlagDescription": "logging level for this command invocation",
|
|
32
|
+
"loglevelFlagLongDescription": "The logging level for this command invocation.",
|
|
33
|
+
"typenameFlagError": "Not a valid custom metadata type name",
|
|
34
|
+
"sobjectnameNoResultError": "No sObject with name %s found in the org.",
|
|
35
|
+
"sourceusernameError": "No user found with the provided username or alias",
|
|
36
|
+
"sourceuserAuthenticationError": "Issue with authenticating to source org with targetusername provided: %s More info: %s.",
|
|
37
|
+
"generateError": "Failed to generate custom metadata. Reason: %s.",
|
|
38
|
+
"customSettingTypeError": "Cannot generate custom metadata for the custom setting %s. Check type and visibility.",
|
|
39
|
+
"queryError": "Cannot query records on %s. Failed with following error: %s."
|
|
53
40
|
}
|
package/messages/template.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
}
|
|
2
|
+
"errorNotAValidType": "'%s' is not a valid field type."
|
|
3
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sobjectnameFlagError": "Not a valid custom setting/custom object name: %s",
|
|
3
|
+
"invalidCMDTApiName": "'%s' is not a valid API name for a custom metadata type. Metadata names can contain only underscores and alphanumeric characters, must begin with a letter, cannot end with an underscore, and cannot contain two consecutive underscore characters.",
|
|
4
|
+
"notAValidRecordNameError": "'%s' is not a valid record name for a custom metadata record. Record names can only contain alphanumeric characters, must begin with a letter, cannot end with an underscore, and cannot contain two consecutive underscore characters."
|
|
5
|
+
}
|