@kitalive/sfdx-plugin 0.2.1 → 0.4.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/README.md +79 -10
- package/lib/bulk.js +81 -38
- package/lib/bulk.js.map +1 -1
- package/lib/commands/kit/data/bulk/delete.js +37 -10
- package/lib/commands/kit/data/bulk/delete.js.map +1 -1
- package/lib/commands/kit/data/bulk/query.js +10 -3
- package/lib/commands/kit/data/bulk/query.js.map +1 -1
- package/lib/commands/kit/data/csv/convert.d.ts +0 -13
- package/lib/commands/kit/data/csv/convert.js +45 -77
- package/lib/commands/kit/data/csv/convert.js.map +1 -1
- package/lib/commands/kit/layout/assignments/deploy.d.ts +0 -1
- package/lib/commands/kit/layout/assignments/deploy.js +9 -8
- package/lib/commands/kit/layout/assignments/deploy.js.map +1 -1
- package/lib/commands/kit/layout/assignments/retrieve.d.ts +1 -1
- package/lib/commands/kit/layout/assignments/retrieve.js +71 -21
- package/lib/commands/kit/layout/assignments/retrieve.js.map +1 -1
- package/lib/commands/kit/object/fields/describe.d.ts +14 -0
- package/lib/commands/kit/object/fields/describe.js +85 -0
- package/lib/commands/kit/object/fields/describe.js.map +1 -0
- package/lib/commands/kit/object/fields/setup.d.ts +21 -0
- package/lib/commands/kit/object/fields/setup.js +197 -0
- package/lib/commands/kit/object/fields/setup.js.map +1 -0
- package/lib/commands/kit/script/execute.d.ts +1 -1
- package/lib/commands/kit/script/execute.js +13 -8
- package/lib/commands/kit/script/execute.js.map +1 -1
- package/lib/metadata.d.ts +18 -0
- package/lib/metadata.js +69 -0
- package/lib/metadata.js.map +1 -0
- package/lib/types.d.ts +25 -0
- package/lib/utils.d.ts +16 -1
- package/lib/utils.js +76 -1
- package/lib/utils.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +26 -14
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.columnMapper = exports.loadScript = exports.parseCsv = void 0;
|
|
4
3
|
const command_1 = require("@salesforce/command");
|
|
5
4
|
const csv = require("fast-csv");
|
|
6
5
|
const fs = require("fs-extra");
|
|
7
|
-
const
|
|
8
|
-
const path = require("path");
|
|
9
|
-
const stream_1 = require("stream");
|
|
6
|
+
const utils_1 = require("../../../../utils");
|
|
10
7
|
class CsvConvertCommand extends command_1.SfdxCommand {
|
|
11
8
|
async run() {
|
|
12
|
-
const { inputfile, outputfile, mapping, converter, encoding, delimiter, quote, skiplines, trim } = this.flags;
|
|
13
|
-
const mappingJson = mapping ?
|
|
9
|
+
const { inputfile, outputfile, mapping, converter, encoding, delimiter, quote, skiplines, trim, } = this.flags;
|
|
10
|
+
const mappingJson = mapping ? await fs.readJson(mapping) : undefined;
|
|
14
11
|
const convert = converter ? this.loadConverter(converter) : undefined;
|
|
15
12
|
const input = inputfile ? fs.createReadStream(inputfile) : process.stdin;
|
|
16
|
-
const rows = await parseCsv(input, {
|
|
13
|
+
const rows = await (0, utils_1.parseCsv)(input, {
|
|
17
14
|
encoding,
|
|
18
15
|
delimiter,
|
|
19
16
|
quote,
|
|
20
17
|
skiplines,
|
|
21
18
|
trim,
|
|
22
19
|
mapping: mappingJson,
|
|
23
|
-
convert
|
|
20
|
+
convert,
|
|
24
21
|
});
|
|
25
22
|
if (!this.flags.json) {
|
|
26
|
-
const output = outputfile
|
|
23
|
+
const output = outputfile
|
|
24
|
+
? fs.createWriteStream(outputfile)
|
|
25
|
+
: process.stdout;
|
|
27
26
|
this.writeCsv(rows, output);
|
|
28
27
|
}
|
|
29
28
|
return rows;
|
|
@@ -32,84 +31,53 @@ class CsvConvertCommand extends command_1.SfdxCommand {
|
|
|
32
31
|
csv.writeToStream(stream, rows, { headers: true });
|
|
33
32
|
}
|
|
34
33
|
loadConverter(file) {
|
|
35
|
-
return loadScript(file).convert;
|
|
34
|
+
return (0, utils_1.loadScript)(file).convert;
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
exports.default = CsvConvertCommand;
|
|
39
38
|
CsvConvertCommand.description = 'convert CSV data using column mapping file or Node.js script';
|
|
40
39
|
CsvConvertCommand.examples = [
|
|
41
40
|
'$ sfdx kit:data:csv:convert -f ./path/to/input.csv -m ./path/to/mapping.json',
|
|
42
|
-
'$ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :'
|
|
41
|
+
'$ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :',
|
|
43
42
|
];
|
|
44
43
|
CsvConvertCommand.requiresUsername = false;
|
|
45
44
|
CsvConvertCommand.requiresProject = false;
|
|
46
45
|
CsvConvertCommand.flagsConfig = {
|
|
47
|
-
inputfile: command_1.flags.filepath({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
inputfile: command_1.flags.filepath({
|
|
47
|
+
char: 'f',
|
|
48
|
+
description: 'the path of the input CSV file (default: standard input)',
|
|
49
|
+
}),
|
|
50
|
+
outputfile: command_1.flags.filepath({
|
|
51
|
+
char: 'o',
|
|
52
|
+
description: 'the path of the output CSV file (default: standard output)',
|
|
53
|
+
}),
|
|
54
|
+
encoding: command_1.flags.string({
|
|
55
|
+
char: 'e',
|
|
56
|
+
default: 'utf8',
|
|
57
|
+
description: 'the input CSV file encoding',
|
|
58
|
+
}),
|
|
59
|
+
delimiter: command_1.flags.string({
|
|
60
|
+
char: 'd',
|
|
61
|
+
default: ',',
|
|
62
|
+
description: 'the input CSV file delimiter',
|
|
63
|
+
}),
|
|
64
|
+
quote: command_1.flags.string({
|
|
65
|
+
char: 'q',
|
|
66
|
+
default: '"',
|
|
67
|
+
description: 'the input CSV file quote character',
|
|
68
|
+
}),
|
|
69
|
+
skiplines: command_1.flags.integer({
|
|
70
|
+
default: 0,
|
|
71
|
+
description: 'the number of lines to skip',
|
|
72
|
+
}),
|
|
53
73
|
trim: command_1.flags.boolean({ description: 'trim all white space from columns' }),
|
|
54
|
-
mapping: command_1.flags.filepath({
|
|
55
|
-
|
|
74
|
+
mapping: command_1.flags.filepath({
|
|
75
|
+
char: 'm',
|
|
76
|
+
description: 'the path of the JSON file that defines CSV column mappings',
|
|
77
|
+
}),
|
|
78
|
+
converter: command_1.flags.filepath({
|
|
79
|
+
char: 'c',
|
|
80
|
+
description: 'the path of the script to convert CSV rows',
|
|
81
|
+
}),
|
|
56
82
|
};
|
|
57
|
-
function parseCsv(input, options) {
|
|
58
|
-
const { encoding, delimiter, quote, skiplines, trim, mapping, convert } = options !== null && options !== void 0 ? options : {};
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
const mapper = mapping ? columnMapper(mapping) : undefined;
|
|
61
|
-
let lines = 2;
|
|
62
|
-
const rows = [];
|
|
63
|
-
const parser = csv.parse({
|
|
64
|
-
headers: true,
|
|
65
|
-
ignoreEmpty: true,
|
|
66
|
-
delimiter: delimiter === '\\t' ? '\t' : (delimiter || ','),
|
|
67
|
-
quote: quote !== null && quote !== void 0 ? quote : '"',
|
|
68
|
-
skipLines: skiplines,
|
|
69
|
-
trim
|
|
70
|
-
}).on('data', row => {
|
|
71
|
-
try {
|
|
72
|
-
if (mapper)
|
|
73
|
-
row = mapper(row);
|
|
74
|
-
if (convert)
|
|
75
|
-
row = convert(row);
|
|
76
|
-
if (row)
|
|
77
|
-
rows.push(row);
|
|
78
|
-
lines++;
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
throw new Error(`A error occurred in csv file at line ${lines}: ${e.message}\ndata: ${JSON.stringify(row)}`);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
const callback = e => e ? reject(e) : resolve(rows);
|
|
85
|
-
if (!encoding || encoding === 'utf8') {
|
|
86
|
-
(0, stream_1.pipeline)(input, parser, callback);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
(0, stream_1.pipeline)(input, (0, iconv_lite_1.decodeStream)(encoding), parser, callback);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
exports.parseCsv = parseCsv;
|
|
94
|
-
function loadScript(file) {
|
|
95
|
-
const script = require(path.resolve(file));
|
|
96
|
-
if (!script.convert)
|
|
97
|
-
throw new Error('function convert is not exported');
|
|
98
|
-
return script;
|
|
99
|
-
}
|
|
100
|
-
exports.loadScript = loadScript;
|
|
101
|
-
function columnMapper(mapping) {
|
|
102
|
-
const keys = Object.keys(mapping);
|
|
103
|
-
return row => {
|
|
104
|
-
const result = {};
|
|
105
|
-
for (const to of keys) {
|
|
106
|
-
const from = mapping[to];
|
|
107
|
-
if (!(from in row))
|
|
108
|
-
throw new Error(`The column '${from}' is not found`);
|
|
109
|
-
result[to] = row[from];
|
|
110
|
-
}
|
|
111
|
-
return result;
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
exports.columnMapper = columnMapper;
|
|
115
83
|
//# sourceMappingURL=convert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../../src/commands/kit/data/csv/convert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert.js","sourceRoot":"","sources":["../../../../../src/commands/kit/data/csv/convert.ts"],"names":[],"mappings":";;AAAA,iDAAyD;AAEzD,gCAAgC;AAChC,+BAA+B;AAC/B,6CAAyD;AAEzD,MAAqB,iBAAkB,SAAQ,qBAAW;IAmDjD,KAAK,CAAC,GAAG;QACd,MAAM,EACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,IAAI,GACL,GAAG,IAAI,CAAC,KAAK,CAAC;QAEf,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACrE,MAAM,OAAO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AAC;IACF,UAAU,EAAE,eAAK,CAAC,QAAQ,CAAC;QACzB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4DAA4D;KAC1E,CAAC;IACF,QAAQ,EAAE,eAAK,CAAC,MAAM,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,6BAA6B;KAC3C,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,MAAM,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,GAAG;QACZ,WAAW,EAAE,8BAA8B;KAC5C,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,MAAM,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,GAAG;QACZ,WAAW,EAAE,oCAAoC;KAClD,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,OAAO,CAAC;QACvB,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,6BAA6B;KAC3C,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;IACzE,OAAO,EAAE,eAAK,CAAC,QAAQ,CAAC;QACtB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4DAA4D;KAC1E,CAAC;IACF,SAAS,EAAE,eAAK,CAAC,QAAQ,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4CAA4C;KAC1D,CAAC;CACH,CAAC"}
|
|
@@ -3,33 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const command_1 = require("@salesforce/command");
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
5
|
const path = require("path");
|
|
6
|
-
const
|
|
6
|
+
const metadata_1 = require("../../../../metadata");
|
|
7
7
|
class LayoutAssignmentsDeployCommand extends command_1.SfdxCommand {
|
|
8
8
|
async run() {
|
|
9
9
|
this.ux.log('deploy layout assignments from ' + this.flags.file);
|
|
10
10
|
const layoutAssignmentsPerProfile = await this.readFile(this.flags.file);
|
|
11
11
|
const profiles = Object.entries(layoutAssignmentsPerProfile).map(([fullName, layoutAssignments]) => ({ fullName, layoutAssignments }));
|
|
12
|
-
|
|
13
|
-
return Promise.all((0, utils_1.chunk)(profiles, 10).map(data => this.deploy(data))).then(a => [].concat(...a));
|
|
12
|
+
return (0, metadata_1.updateMetadata)(this.org.getConnection(), 'Profile', profiles);
|
|
14
13
|
}
|
|
15
14
|
readFile(file) {
|
|
16
15
|
const inputFile = path.join(this.project.getPath(), file);
|
|
17
16
|
return fs.readJson(inputFile);
|
|
18
17
|
}
|
|
19
|
-
deploy(data) {
|
|
20
|
-
return this.org.getConnection().metadata.update('Profile', data);
|
|
21
|
-
}
|
|
22
18
|
}
|
|
23
19
|
exports.default = LayoutAssignmentsDeployCommand;
|
|
24
20
|
LayoutAssignmentsDeployCommand.description = 'deploy page layout assignments from JSON file';
|
|
25
21
|
LayoutAssignmentsDeployCommand.examples = [
|
|
26
22
|
'$ sfdx kit:layout:assignments:deploy',
|
|
27
23
|
'$ sfdx kit:layout:assignments:deploy -f config/layout-assignments.scratch.json',
|
|
28
|
-
'$ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json'
|
|
24
|
+
'$ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json',
|
|
29
25
|
];
|
|
30
26
|
LayoutAssignmentsDeployCommand.requiresUsername = true;
|
|
31
27
|
LayoutAssignmentsDeployCommand.requiresProject = true;
|
|
32
28
|
LayoutAssignmentsDeployCommand.flagsConfig = {
|
|
33
|
-
file: command_1.flags.string({
|
|
29
|
+
file: command_1.flags.string({
|
|
30
|
+
char: 'f',
|
|
31
|
+
required: true,
|
|
32
|
+
description: 'input file path',
|
|
33
|
+
default: 'config/layout-assignments.json',
|
|
34
|
+
}),
|
|
34
35
|
};
|
|
35
36
|
//# sourceMappingURL=deploy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../../src/commands/kit/layout/assignments/deploy.ts"],"names":[],"mappings":";;AAAA,iDAAyD;AACzD,+BAA+B;AAE/B,6BAA6B;AAE7B,
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../../../src/commands/kit/layout/assignments/deploy.ts"],"names":[],"mappings":";;AAAA,iDAAyD;AACzD,+BAA+B;AAE/B,6BAA6B;AAE7B,mDAAsD;AAEtD,MAAqB,8BAA+B,SAAQ,qBAAW;IAqB9D,KAAK,CAAC,GAAG;QACd,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,iCAAiC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjE,MAAM,2BAA2B,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,GAAG,CAC9D,CAAC,CAAC,QAAQ,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CACrE,CAAC;QACF,OAAO,IAAA,yBAAc,EAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvE,CAAC;IAEO,QAAQ,CAAC,IAAI;QACnB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;QAC1D,OAAO,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;;AAjCH,iDAkCC;AAjCe,0CAAW,GAAG,+CAA+C,CAAC;AAE9D,uCAAQ,GAAG;IACvB,sCAAsC;IACtC,gFAAgF;IAChF,6FAA6F;CAC9F,CAAC;AAEe,+CAAgB,GAAG,IAAI,CAAC;AACxB,8CAAe,GAAG,IAAI,CAAC;AAEvB,0CAAW,GAAG;IAC7B,IAAI,EAAE,eAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iBAAiB;QAC9B,OAAO,EAAE,gCAAgC;KAC1C,CAAC;CACH,CAAC"}
|
|
@@ -13,8 +13,8 @@ export default class LayoutAssignmentsRetrieveCommand extends SfdxCommand {
|
|
|
13
13
|
};
|
|
14
14
|
run(): Promise<LayoutAssignmentsPerProfile>;
|
|
15
15
|
objectNamesFromLayouts(): Promise<string[]>;
|
|
16
|
+
private getProjectConfig;
|
|
16
17
|
private getProfileNames;
|
|
17
|
-
private getProfiles;
|
|
18
18
|
private findFiles;
|
|
19
19
|
private readFile;
|
|
20
20
|
private writeFile;
|
|
@@ -5,30 +5,57 @@ const core_1 = require("@salesforce/core");
|
|
|
5
5
|
const glob = require("fast-glob");
|
|
6
6
|
const fs = require("fs-extra");
|
|
7
7
|
const path = require("path");
|
|
8
|
-
const
|
|
8
|
+
const metadata_1 = require("../../../../metadata");
|
|
9
|
+
function assignmentsPerObject(assignments, filterObjects) {
|
|
10
|
+
var _a;
|
|
11
|
+
const result = new Map();
|
|
12
|
+
for (const assignment of assignments) {
|
|
13
|
+
const object = assignment.layout.split('-')[0];
|
|
14
|
+
if (filterObjects && !filterObjects.includes(object))
|
|
15
|
+
continue;
|
|
16
|
+
const a = (_a = result.get(object)) !== null && _a !== void 0 ? _a : [];
|
|
17
|
+
a.push(assignment);
|
|
18
|
+
result.set(object, a);
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
9
22
|
class LayoutAssignmentsRetrieveCommand extends command_1.SfdxCommand {
|
|
10
23
|
async run() {
|
|
11
|
-
const filterObjects = this.flags.object
|
|
24
|
+
const filterObjects = this.flags.object
|
|
25
|
+
? this.flags.object.split(',')
|
|
26
|
+
: await this.objectNamesFromLayouts();
|
|
12
27
|
if (filterObjects.length === 0)
|
|
13
28
|
throw new core_1.SfdxError('There are no objects to retrieve');
|
|
14
|
-
const data = this.flags.merge
|
|
15
|
-
|
|
29
|
+
const data = this.flags.merge
|
|
30
|
+
? await this.readFile(this.flags.file)
|
|
31
|
+
: {};
|
|
32
|
+
const profileNames = this.flags.profile
|
|
33
|
+
? this.flags.profile.split(',')
|
|
34
|
+
: await this.getProfileNames();
|
|
16
35
|
this.ux.log(`retrieve layout assignments\n\tprofiles: ${profileNames.join(', ')}\n\tobjects: ${filterObjects.join(', ')}`);
|
|
17
|
-
|
|
18
|
-
const profiles = await
|
|
36
|
+
const conn = this.org.getConnection();
|
|
37
|
+
const profiles = (await (0, metadata_1.readMetadata)(conn, 'Profile', profileNames));
|
|
19
38
|
for (const profile of profiles) {
|
|
20
39
|
if (!profile.fullName || !profile.layoutAssignments)
|
|
21
40
|
continue;
|
|
22
|
-
|
|
41
|
+
let assignmentsMap = assignmentsPerObject(profile.layoutAssignments, await (0, metadata_1.completeDefaultNamespace)(conn, filterObjects));
|
|
42
|
+
if (data[profile.fullName]) {
|
|
43
|
+
const oldAssignmentsMap = assignmentsPerObject(data[profile.fullName]);
|
|
44
|
+
assignmentsMap = new Map([...oldAssignmentsMap, ...assignmentsMap]);
|
|
45
|
+
}
|
|
46
|
+
data[profile.fullName] = Array.from(assignmentsMap.values())
|
|
47
|
+
.flat()
|
|
48
|
+
.sort((a, b) => a.layout.localeCompare(b.layout));
|
|
23
49
|
}
|
|
24
50
|
this.ux.log('save to ' + this.flags.file);
|
|
25
51
|
await this.writeFile(this.flags.file, data);
|
|
26
52
|
return data;
|
|
27
53
|
}
|
|
28
54
|
async objectNamesFromLayouts() {
|
|
29
|
-
//
|
|
30
|
-
const config = await this.
|
|
31
|
-
const packageDir = config.packageDirectories &&
|
|
55
|
+
// eslint-disable-next-line
|
|
56
|
+
const config = await this.getProjectConfig();
|
|
57
|
+
const packageDir = config.packageDirectories &&
|
|
58
|
+
config.packageDirectories.find((dir) => dir.default);
|
|
32
59
|
if (!packageDir)
|
|
33
60
|
return [];
|
|
34
61
|
const pattern = path.join(this.project.getPath(), packageDir.path, '**/*.layout-meta.xml');
|
|
@@ -37,13 +64,18 @@ class LayoutAssignmentsRetrieveCommand extends command_1.SfdxCommand {
|
|
|
37
64
|
const object = path.basename(filepath).split('-')[0];
|
|
38
65
|
objectCounts[object] = (objectCounts[object] || 0) + 1;
|
|
39
66
|
}
|
|
40
|
-
return Object.keys(objectCounts)
|
|
67
|
+
return Object.keys(objectCounts)
|
|
68
|
+
.filter((object) => objectCounts[object] >= 2)
|
|
69
|
+
.sort();
|
|
41
70
|
}
|
|
42
|
-
|
|
43
|
-
return this.
|
|
71
|
+
getProjectConfig() {
|
|
72
|
+
return this.project.resolveProjectConfig();
|
|
44
73
|
}
|
|
45
|
-
|
|
46
|
-
return this.org
|
|
74
|
+
getProfileNames() {
|
|
75
|
+
return this.org
|
|
76
|
+
.getConnection()
|
|
77
|
+
.metadata.list({ type: 'Profile' })
|
|
78
|
+
.then((profiles) => profiles.map((p) => p.fullName));
|
|
47
79
|
}
|
|
48
80
|
findFiles(pattern) {
|
|
49
81
|
return glob(pattern);
|
|
@@ -52,7 +84,9 @@ class LayoutAssignmentsRetrieveCommand extends command_1.SfdxCommand {
|
|
|
52
84
|
return fs.readJson(path.join(this.project.getPath(), file));
|
|
53
85
|
}
|
|
54
86
|
writeFile(file, data) {
|
|
55
|
-
return fs.outputJson(path.join(this.project.getPath(), file), data, {
|
|
87
|
+
return fs.outputJson(path.join(this.project.getPath(), file), data, {
|
|
88
|
+
spaces: '\t',
|
|
89
|
+
});
|
|
56
90
|
}
|
|
57
91
|
}
|
|
58
92
|
exports.default = LayoutAssignmentsRetrieveCommand;
|
|
@@ -60,14 +94,30 @@ LayoutAssignmentsRetrieveCommand.description = 'retrieve page layout assignments
|
|
|
60
94
|
LayoutAssignmentsRetrieveCommand.examples = [
|
|
61
95
|
'$ sfdx kit:layout:assignments:retrieve',
|
|
62
96
|
'$ sfdx kit:layout:assignments:retrieve -p Admin,Standard,StandardAul -o Account,CustomObject__c -f config/layout-assignments.scratch.json',
|
|
63
|
-
'$ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json'
|
|
97
|
+
'$ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json',
|
|
64
98
|
];
|
|
65
99
|
LayoutAssignmentsRetrieveCommand.requiresUsername = true;
|
|
66
100
|
LayoutAssignmentsRetrieveCommand.requiresProject = true;
|
|
67
101
|
LayoutAssignmentsRetrieveCommand.flagsConfig = {
|
|
68
|
-
file: command_1.flags.string({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
102
|
+
file: command_1.flags.string({
|
|
103
|
+
char: 'f',
|
|
104
|
+
required: true,
|
|
105
|
+
description: 'output file path',
|
|
106
|
+
default: 'config/layout-assignments.json',
|
|
107
|
+
}),
|
|
108
|
+
profile: command_1.flags.string({
|
|
109
|
+
char: 'p',
|
|
110
|
+
required: false,
|
|
111
|
+
description: 'comma separated profile names to retrieve (default: all profiles)',
|
|
112
|
+
}),
|
|
113
|
+
object: command_1.flags.string({
|
|
114
|
+
char: 'o',
|
|
115
|
+
required: false,
|
|
116
|
+
description: 'comma separated object names to retrieve (default: objects which have multiple layouts)',
|
|
117
|
+
}),
|
|
118
|
+
merge: command_1.flags.boolean({
|
|
119
|
+
required: false,
|
|
120
|
+
description: 'merge retrieved configurations with existing file',
|
|
121
|
+
}),
|
|
72
122
|
};
|
|
73
123
|
//# sourceMappingURL=retrieve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve.js","sourceRoot":"","sources":["../../../../../src/commands/kit/layout/assignments/retrieve.ts"],"names":[],"mappings":";;AAAA,iDAAyD;AACzD,2CAA6C;AAC7C,kCAAkC;AAClC,+BAA+B;AAC/B,6BAA6B;
|
|
1
|
+
{"version":3,"file":"retrieve.js","sourceRoot":"","sources":["../../../../../src/commands/kit/layout/assignments/retrieve.ts"],"names":[],"mappings":";;A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CAAC;IACF,MAAM,EAAE,eAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,yFAAyF;KAC5F,CAAC;IACF,KAAK,EAAE,eAAK,CAAC,OAAO,CAAC;QACnB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,mDAAmD;KACjE,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { MetadataInfo } from 'jsforce';
|
|
3
|
+
export default class FieldsDescribeCommand extends SfdxCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
protected static requiresUsername: boolean;
|
|
7
|
+
protected static requiresProject: boolean;
|
|
8
|
+
protected static flagsConfig: {
|
|
9
|
+
object: flags.Discriminated<flags.String>;
|
|
10
|
+
file: flags.Discriminated<flags.String>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<MetadataInfo[]>;
|
|
13
|
+
writeCsv(file: any, rows: any): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@salesforce/command");
|
|
4
|
+
const csv = require("fast-csv");
|
|
5
|
+
const fs = require("fs-extra");
|
|
6
|
+
const metadata_1 = require("../../../../metadata");
|
|
7
|
+
const csvHeaders = [
|
|
8
|
+
'label',
|
|
9
|
+
'fullName',
|
|
10
|
+
'type',
|
|
11
|
+
'length',
|
|
12
|
+
'precision',
|
|
13
|
+
'scale',
|
|
14
|
+
'formula',
|
|
15
|
+
// START picklist specific options
|
|
16
|
+
'valueSetName',
|
|
17
|
+
'values',
|
|
18
|
+
'restricted',
|
|
19
|
+
// END
|
|
20
|
+
'referenceTo',
|
|
21
|
+
'relationshipName',
|
|
22
|
+
'summaryForeignKey',
|
|
23
|
+
'summaryOperation',
|
|
24
|
+
'summarizedField',
|
|
25
|
+
'required',
|
|
26
|
+
'unique',
|
|
27
|
+
'caseSensitive',
|
|
28
|
+
'defaultValue',
|
|
29
|
+
'externalId',
|
|
30
|
+
'description',
|
|
31
|
+
'inlineHelpText',
|
|
32
|
+
];
|
|
33
|
+
class FieldsDescribeCommand extends command_1.SfdxCommand {
|
|
34
|
+
async run() {
|
|
35
|
+
const { object, file, json } = this.flags;
|
|
36
|
+
const conn = this.org.getConnection();
|
|
37
|
+
this.ux.startSpinner(`describe ${object} fields`);
|
|
38
|
+
const results = await (0, metadata_1.getCustomFields)(conn, object);
|
|
39
|
+
this.ux.stopSpinner();
|
|
40
|
+
if (!json) {
|
|
41
|
+
const rows = results.map(({ valueSet, ...row }) => {
|
|
42
|
+
if (valueSet) {
|
|
43
|
+
const { restricted, valueSetDefinition, valueSetName } = valueSet;
|
|
44
|
+
row.restricted = restricted;
|
|
45
|
+
if (valueSetDefinition) {
|
|
46
|
+
row.values = valueSetDefinition.value
|
|
47
|
+
.map((v) => v.valueName)
|
|
48
|
+
.join(';');
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
row.valueSetName = valueSetName;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return row;
|
|
55
|
+
});
|
|
56
|
+
this.writeCsv(file, rows);
|
|
57
|
+
}
|
|
58
|
+
return results;
|
|
59
|
+
}
|
|
60
|
+
writeCsv(file, rows) {
|
|
61
|
+
csv
|
|
62
|
+
.write(rows, { headers: csvHeaders, writeBOM: true })
|
|
63
|
+
.pipe(file ? fs.createWriteStream(file) : process.stdout);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = FieldsDescribeCommand;
|
|
67
|
+
FieldsDescribeCommand.description = 'describe object fields information';
|
|
68
|
+
FieldsDescribeCommand.examples = [
|
|
69
|
+
'$ sfdx kit:object:fields:describe -o Account -f path/to/account_fields.csv',
|
|
70
|
+
'$ sfdx kit:object:fields:describe -u me@my.org -o CustomObject__c --json',
|
|
71
|
+
];
|
|
72
|
+
FieldsDescribeCommand.requiresUsername = true;
|
|
73
|
+
FieldsDescribeCommand.requiresProject = false;
|
|
74
|
+
FieldsDescribeCommand.flagsConfig = {
|
|
75
|
+
object: command_1.flags.string({
|
|
76
|
+
char: 'o',
|
|
77
|
+
required: true,
|
|
78
|
+
description: 'SObject name',
|
|
79
|
+
}),
|
|
80
|
+
file: command_1.flags.string({
|
|
81
|
+
char: 'f',
|
|
82
|
+
description: 'output csv file path',
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=describe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.js","sourceRoot":"","sources":["../../../../../src/commands/kit/object/fields/describe.ts"],"names":[],"mappings":";;AAAA,iDAAyD;AACzD,gCAAgC;AAChC,+BAA+B;AAE/B,mDAAuD;AAEvD,MAAM,UAAU,GAAG;IACjB,OAAO;IACP,UAAU;IACV,MAAM;IACN,QAAQ;IACR,WAAW;IACX,OAAO;IACP,SAAS;IACT,kCAAkC;IAClC,cAAc;IACd,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,aAAa;IACb,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAClB,iBAAiB;IACjB,UAAU;IACV,QAAQ;IACR,eAAe;IACf,cAAc;IACd,YAAY;IACZ,aAAa;IACb,gBAAgB;CACjB,CAAC;AAEF,MAAqB,qBAAsB,SAAQ,qBAAW;IAuBrD,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QACtC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,MAAM,SAAS,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAe,EAAC,IAAI,EAAE,MAAM,CAAC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M,EAAE,eAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,cAAc;KAC5B,CAAC;IACF,IAAI,EAAE,eAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,sBAAsB;KACpC,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { flags, SfdxCommand } from '@salesforce/command';
|
|
2
|
+
declare type SetupResult = {
|
|
3
|
+
field: string;
|
|
4
|
+
result: 'created' | 'updated' | 'deleted' | 'identical' | 'error';
|
|
5
|
+
error?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function setFieldOptions(field: any, existingField: any): void;
|
|
8
|
+
export default class FieldsSetupCommand extends SfdxCommand {
|
|
9
|
+
static description: string;
|
|
10
|
+
static examples: string[];
|
|
11
|
+
protected static requiresUsername: boolean;
|
|
12
|
+
protected static requiresProject: boolean;
|
|
13
|
+
protected static flagsConfig: {
|
|
14
|
+
object: flags.Discriminated<flags.String>;
|
|
15
|
+
file: flags.Discriminated<flags.String>;
|
|
16
|
+
delete: flags.Discriminated<flags.Boolean<boolean>>;
|
|
17
|
+
force: flags.Discriminated<flags.Boolean<boolean>>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<SetupResult[]>;
|
|
20
|
+
}
|
|
21
|
+
export {};
|