@kitalive/sfdx-plugin 0.1.6 → 0.3.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/README.md +264 -31
- package/lib/bulk.d.ts +22 -0
- package/lib/bulk.js +282 -0
- package/lib/bulk.js.map +1 -0
- package/lib/commands/kit/data/bulk/delete.d.ts +18 -0
- package/lib/commands/kit/data/bulk/delete.js +91 -0
- package/lib/commands/kit/data/bulk/delete.js.map +1 -0
- package/lib/commands/kit/data/bulk/insert.d.ts +2 -0
- package/lib/commands/kit/data/bulk/insert.js +5 -0
- package/lib/commands/kit/data/bulk/insert.js.map +1 -0
- package/lib/commands/kit/data/bulk/query.d.ts +15 -0
- package/lib/commands/kit/data/bulk/query.js +57 -0
- package/lib/commands/kit/data/bulk/query.js.map +1 -0
- package/lib/commands/kit/data/bulk/update.d.ts +2 -0
- package/lib/commands/kit/data/bulk/update.js +5 -0
- package/lib/commands/kit/data/bulk/update.js.map +1 -0
- package/lib/commands/kit/data/bulk/upsert.d.ts +2 -49
- package/lib/commands/kit/data/bulk/upsert.js +2 -209
- package/lib/commands/kit/data/bulk/upsert.js.map +1 -1
- package/lib/commands/kit/data/csv/convert.js +53 -21
- package/lib/commands/kit/data/csv/convert.js.map +1 -1
- package/lib/commands/kit/layout/assignments/deploy.js +8 -3
- package/lib/commands/kit/layout/assignments/deploy.js.map +1 -1
- package/lib/commands/kit/layout/assignments/retrieve.d.ts +1 -0
- package/lib/commands/kit/layout/assignments/retrieve.js +51 -16
- package/lib/commands/kit/layout/assignments/retrieve.js.map +1 -1
- package/lib/commands/kit/script/execute.d.ts +1 -1
- package/lib/commands/kit/script/execute.js +19 -8
- package/lib/commands/kit/script/execute.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +28 -18
|
@@ -1,212 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
const csv = require("fast-csv");
|
|
6
|
-
const fs = require("fs-extra");
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const utils_1 = require("../../../../utils");
|
|
9
|
-
const convert_1 = require("../csv/convert");
|
|
10
|
-
const convert_2 = require("../csv/convert");
|
|
11
|
-
function normalizeDateString(str, format) {
|
|
12
|
-
if (!str)
|
|
13
|
-
return str;
|
|
14
|
-
const d = dayjs(str);
|
|
15
|
-
return format ? d.format(format) : d.toISOString();
|
|
16
|
-
}
|
|
17
|
-
const converters = {
|
|
18
|
-
date: value => normalizeDateString(value, 'YYYY-MM-DD'),
|
|
19
|
-
datetime: normalizeDateString
|
|
20
|
-
};
|
|
21
|
-
const csvFlags = convert_1.default['flagsConfig'];
|
|
22
|
-
class UpsertCommand extends command_1.SfdxCommand {
|
|
23
|
-
async run() {
|
|
24
|
-
const { csvfile, mapping, converter, encoding, delimiter, quote, skiplines, trim, setnull } = this.flags;
|
|
25
|
-
const mappingJson = (mapping) ? (await fs.readJson(mapping)) : undefined;
|
|
26
|
-
const script = converter ? this.loadScript(converter) : {};
|
|
27
|
-
const fieldTypes = await this.getFieldTypes(this.flags.object);
|
|
28
|
-
this.ux.startSpinner('Processing csv');
|
|
29
|
-
if (script.start)
|
|
30
|
-
await script.start(this);
|
|
31
|
-
let rows = await this.parseCsv(fs.createReadStream(csvfile), {
|
|
32
|
-
encoding,
|
|
33
|
-
delimiter,
|
|
34
|
-
quote,
|
|
35
|
-
skiplines,
|
|
36
|
-
trim: !!trim,
|
|
37
|
-
setnull,
|
|
38
|
-
mapping: mappingJson,
|
|
39
|
-
convert: script.convert,
|
|
40
|
-
fieldTypes
|
|
41
|
-
});
|
|
42
|
-
if (script.finish) {
|
|
43
|
-
const result = await script.finish(rows, this);
|
|
44
|
-
if (result)
|
|
45
|
-
rows = result;
|
|
46
|
-
}
|
|
47
|
-
this.ux.stopSpinner();
|
|
48
|
-
if (this.flags.convertonly) {
|
|
49
|
-
const base = path.basename(csvfile, path.extname(csvfile));
|
|
50
|
-
this.saveCsv(path.join(path.dirname(csvfile), base + '.converted.csv'), rows);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
this.ux.startSpinner('Bulk Upsert');
|
|
54
|
-
let job;
|
|
55
|
-
try {
|
|
56
|
-
job = await this.createJob(this.flags.object, {
|
|
57
|
-
extIdField: this.flags.externalid,
|
|
58
|
-
concurrencyMode: this.flags.concurrencymode,
|
|
59
|
-
assignmentRuleId: this.flags.assignmentruleid
|
|
60
|
-
});
|
|
61
|
-
const batchResults = await this.executeBatches(job, rows, this.flags.batchsize, this.flags.wait);
|
|
62
|
-
const batchErrors = [];
|
|
63
|
-
if (this.flags.wait) {
|
|
64
|
-
rows = rows.map((data, i) => {
|
|
65
|
-
var _a;
|
|
66
|
-
const { id, errors } = (_a = batchResults[i]) !== null && _a !== void 0 ? _a : {};
|
|
67
|
-
const message = errors === null || errors === void 0 ? void 0 : errors.join(', ');
|
|
68
|
-
if (message) {
|
|
69
|
-
batchErrors.push({ line: i + 2, message, data });
|
|
70
|
-
}
|
|
71
|
-
return Object.assign(Object.assign({}, data), { Id: id, Errors: message });
|
|
72
|
-
});
|
|
73
|
-
if (batchErrors.length) {
|
|
74
|
-
this.ux.styledHeader('Upsert errors');
|
|
75
|
-
batchErrors.forEach(({ line, message }) => this.ux.log(`line ${line}: ${message}`));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
const batchInfos = await job.list();
|
|
80
|
-
let command = 'sfdx force:data:bulk:status';
|
|
81
|
-
if (this.flags.targetusername)
|
|
82
|
-
command += ' -u ' + this.flags.targetusername;
|
|
83
|
-
batchInfos.forEach((batch, i) => this.ux.log([
|
|
84
|
-
`Check batch #${i + 1}’s status with the command: `,
|
|
85
|
-
`${command} -i ${batch.jobId} -b ${batch.id}`
|
|
86
|
-
].join('\n')));
|
|
87
|
-
}
|
|
88
|
-
if (this.flags.resultfile)
|
|
89
|
-
this.saveCsv(this.flags.resultfile, rows);
|
|
90
|
-
const jobInfo = await job.check();
|
|
91
|
-
delete jobInfo.$;
|
|
92
|
-
delete jobInfo.state;
|
|
93
|
-
if (this.flags.wait) {
|
|
94
|
-
this.ux.styledHeader('Job Status');
|
|
95
|
-
this.ux.styledObject(jobInfo, Object.keys(jobInfo));
|
|
96
|
-
}
|
|
97
|
-
if (batchErrors.length)
|
|
98
|
-
jobInfo.errors = batchErrors;
|
|
99
|
-
return jobInfo;
|
|
100
|
-
}
|
|
101
|
-
catch (e) {
|
|
102
|
-
this.ux.stopSpinner('error');
|
|
103
|
-
throw e;
|
|
104
|
-
}
|
|
105
|
-
finally {
|
|
106
|
-
job === null || job === void 0 ? void 0 : job.close();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async parseCsv(input, options) {
|
|
110
|
-
const { encoding, delimiter, quote, skiplines, trim, mapping, convert, setnull, fieldTypes } = options !== null && options !== void 0 ? options : {};
|
|
111
|
-
return await convert_2.parseCsv(input, { encoding, delimiter, quote, skiplines, trim, mapping, convert: row => {
|
|
112
|
-
const result = convert ? convert(row) : row;
|
|
113
|
-
if (!result)
|
|
114
|
-
return;
|
|
115
|
-
if (fieldTypes) {
|
|
116
|
-
for (const key of Object.keys(result)) {
|
|
117
|
-
const converter = converters[fieldTypes[key]];
|
|
118
|
-
if (converter)
|
|
119
|
-
result[key] = converter(result[key]);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (setnull) {
|
|
123
|
-
for (const key of Object.keys(result)) {
|
|
124
|
-
if (key.includes('.'))
|
|
125
|
-
continue; // skip reference
|
|
126
|
-
if (result[key] == null || result[key] === '')
|
|
127
|
-
result[key] = '#N/A';
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return result;
|
|
131
|
-
} });
|
|
132
|
-
}
|
|
133
|
-
executeBatches(job, rows, batchSize, wait) {
|
|
134
|
-
return Promise.all(utils_1.chunk(rows, batchSize).map(batchRows => this.executeBatch(job, batchRows, wait))).then(result => result.flat());
|
|
135
|
-
}
|
|
136
|
-
executeBatch(job, rows, wait) {
|
|
137
|
-
return new Promise((resolve, reject) => {
|
|
138
|
-
const batch = job.createBatch();
|
|
139
|
-
batch.on('error', e => {
|
|
140
|
-
if (e.message.startsWith('Polling time out'))
|
|
141
|
-
job.emit('error', e);
|
|
142
|
-
reject(e);
|
|
143
|
-
});
|
|
144
|
-
batch.on('queue', batchInfo => {
|
|
145
|
-
batch.check().then(result => {
|
|
146
|
-
if (result.state === 'Failed') {
|
|
147
|
-
reject(result.stateMessage);
|
|
148
|
-
}
|
|
149
|
-
else if (wait) {
|
|
150
|
-
batch.poll(5000, wait * 60000);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
resolve([]);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
batch.on('response', resolve);
|
|
158
|
-
batch.execute(rows, error => error && reject(error));
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
saveCsv(file, rows) {
|
|
162
|
-
csv.writeToPath(file, rows, { headers: true });
|
|
163
|
-
}
|
|
164
|
-
loadScript(file) {
|
|
165
|
-
return convert_2.loadScript(file);
|
|
166
|
-
}
|
|
167
|
-
async getFieldTypes(sobject) {
|
|
168
|
-
const conn = this.org.getConnection();
|
|
169
|
-
const objectInfo = await conn.describe(sobject);
|
|
170
|
-
return objectInfo.fields.reduce((info, { name, type }) => Object.assign(info, { [name]: type }), {});
|
|
171
|
-
}
|
|
172
|
-
async createJob(sobject, options) {
|
|
173
|
-
const conn = this.org.getConnection();
|
|
174
|
-
const job = conn.bulk.createJob(sobject, 'upsert', options);
|
|
175
|
-
await job.on('error', e => { throw e; }).open();
|
|
176
|
-
return job;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
exports.default = UpsertCommand;
|
|
180
|
-
UpsertCommand.description = [
|
|
181
|
-
'bulk upsert records from a CSV file',
|
|
182
|
-
'Upsert records using Bulk API and returns a job ID and a batch ID. Use these IDs to check job status with data:bulk:status.',
|
|
183
|
-
'For information about CSV file formats, see [Prepare CSV Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm) in the Bulk API Developer Guide.'
|
|
184
|
-
].join('\n');
|
|
185
|
-
UpsertCommand.examples = [
|
|
186
|
-
'$ sfdx kit:data:bulk:upsert -o Account -f ./path/to/Account.csv -m ./path/to/mapping.json',
|
|
187
|
-
'$ sfdx kit:data:bulk:upsert -o MyObject__c -f ./path/to/MyObject__c.csv -c ./path/to/convert.js -i MyExternalId__c -w 10'
|
|
188
|
-
];
|
|
189
|
-
UpsertCommand.requiresUsername = true;
|
|
190
|
-
UpsertCommand.requiresProject = false;
|
|
191
|
-
UpsertCommand.flagsConfig = {
|
|
192
|
-
object: command_1.flags.string({ char: 'o', required: true, description: 'the sObject name to upsert' }),
|
|
193
|
-
externalid: command_1.flags.string({ char: 'i', required: true, default: 'Id', description: 'the column name of the external ID' }),
|
|
194
|
-
// csv settings
|
|
195
|
-
csvfile: command_1.flags.filepath({ char: 'f', required: true, description: 'the CSV file path that defines the records to upsert' }),
|
|
196
|
-
resultfile: command_1.flags.filepath({ char: 'r', description: 'the CSV file path for writing the upsert results' }),
|
|
197
|
-
encoding: csvFlags.encoding,
|
|
198
|
-
delimiter: csvFlags.delimiter,
|
|
199
|
-
quote: csvFlags.quote,
|
|
200
|
-
skiplines: csvFlags.skiplines,
|
|
201
|
-
trim: csvFlags.trim,
|
|
202
|
-
mapping: csvFlags.mapping,
|
|
203
|
-
converter: csvFlags.converter,
|
|
204
|
-
setnull: command_1.flags.boolean({ description: 'set blank values as null values during upsert operations (default: empty field values are ignored)' }),
|
|
205
|
-
convertonly: command_1.flags.boolean({ description: 'output converted.csv file and skip upsert for debugging' }),
|
|
206
|
-
// job settings
|
|
207
|
-
concurrencymode: command_1.flags.string({ default: 'Parallel', description: 'the concurrency mode (Parallel or Serial) for the job' }),
|
|
208
|
-
assignmentruleid: command_1.flags.string({ description: 'the ID of a specific assignment rule to run for a case or a lead.' }),
|
|
209
|
-
batchsize: command_1.flags.integer({ char: 's', min: 1, max: 10000, default: 10000, description: 'the batch size of the job' }),
|
|
210
|
-
wait: command_1.flags.integer({ char: 'w', min: 0, description: 'the number of minutes to wait for the command to complete before displaying the results' })
|
|
211
|
-
};
|
|
3
|
+
const bulk_1 = require("../../../../bulk");
|
|
4
|
+
exports.default = (0, bulk_1.createBulkCommand)('upsert');
|
|
212
5
|
//# sourceMappingURL=upsert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsert.js","sourceRoot":"","sources":["../../../../../src/commands/kit/data/bulk/upsert.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"upsert.js","sourceRoot":"","sources":["../../../../../src/commands/kit/data/bulk/upsert.ts"],"names":[],"mappings":";;AAAA,2CAAqD;AAErD,kBAAe,IAAA,wBAAiB,EAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -9,8 +9,8 @@ const path = require("path");
|
|
|
9
9
|
const stream_1 = require("stream");
|
|
10
10
|
class CsvConvertCommand extends command_1.SfdxCommand {
|
|
11
11
|
async run() {
|
|
12
|
-
const { inputfile, outputfile, mapping, converter, encoding, delimiter, quote, skiplines, trim } = this.flags;
|
|
13
|
-
const mappingJson = mapping ?
|
|
12
|
+
const { inputfile, outputfile, mapping, converter, encoding, delimiter, quote, skiplines, trim, } = this.flags;
|
|
13
|
+
const mappingJson = mapping ? await fs.readJson(mapping) : undefined;
|
|
14
14
|
const convert = converter ? this.loadConverter(converter) : undefined;
|
|
15
15
|
const input = inputfile ? fs.createReadStream(inputfile) : process.stdin;
|
|
16
16
|
const rows = await parseCsv(input, {
|
|
@@ -20,10 +20,12 @@ class CsvConvertCommand extends command_1.SfdxCommand {
|
|
|
20
20
|
skiplines,
|
|
21
21
|
trim,
|
|
22
22
|
mapping: mappingJson,
|
|
23
|
-
convert
|
|
23
|
+
convert,
|
|
24
24
|
});
|
|
25
25
|
if (!this.flags.json) {
|
|
26
|
-
const output = outputfile
|
|
26
|
+
const output = outputfile
|
|
27
|
+
? fs.createWriteStream(outputfile)
|
|
28
|
+
: process.stdout;
|
|
27
29
|
this.writeCsv(rows, output);
|
|
28
30
|
}
|
|
29
31
|
return rows;
|
|
@@ -39,20 +41,47 @@ exports.default = CsvConvertCommand;
|
|
|
39
41
|
CsvConvertCommand.description = 'convert CSV data using column mapping file or Node.js script';
|
|
40
42
|
CsvConvertCommand.examples = [
|
|
41
43
|
'$ 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 :'
|
|
44
|
+
'$ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :',
|
|
43
45
|
];
|
|
44
46
|
CsvConvertCommand.requiresUsername = false;
|
|
45
47
|
CsvConvertCommand.requiresProject = false;
|
|
46
48
|
CsvConvertCommand.flagsConfig = {
|
|
47
|
-
inputfile: command_1.flags.filepath({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
inputfile: command_1.flags.filepath({
|
|
50
|
+
char: 'f',
|
|
51
|
+
description: 'the path of the input CSV file (default: standard input)',
|
|
52
|
+
}),
|
|
53
|
+
outputfile: command_1.flags.filepath({
|
|
54
|
+
char: 'o',
|
|
55
|
+
description: 'the path of the output CSV file (default: standard output)',
|
|
56
|
+
}),
|
|
57
|
+
encoding: command_1.flags.string({
|
|
58
|
+
char: 'e',
|
|
59
|
+
default: 'utf8',
|
|
60
|
+
description: 'the input CSV file encoding',
|
|
61
|
+
}),
|
|
62
|
+
delimiter: command_1.flags.string({
|
|
63
|
+
char: 'd',
|
|
64
|
+
default: ',',
|
|
65
|
+
description: 'the input CSV file delimiter',
|
|
66
|
+
}),
|
|
67
|
+
quote: command_1.flags.string({
|
|
68
|
+
char: 'q',
|
|
69
|
+
default: '"',
|
|
70
|
+
description: 'the input CSV file quote character',
|
|
71
|
+
}),
|
|
72
|
+
skiplines: command_1.flags.integer({
|
|
73
|
+
default: 0,
|
|
74
|
+
description: 'the number of lines to skip',
|
|
75
|
+
}),
|
|
53
76
|
trim: command_1.flags.boolean({ description: 'trim all white space from columns' }),
|
|
54
|
-
mapping: command_1.flags.filepath({
|
|
55
|
-
|
|
77
|
+
mapping: command_1.flags.filepath({
|
|
78
|
+
char: 'm',
|
|
79
|
+
description: 'the path of the JSON file that defines CSV column mappings',
|
|
80
|
+
}),
|
|
81
|
+
converter: command_1.flags.filepath({
|
|
82
|
+
char: 'c',
|
|
83
|
+
description: 'the path of the script to convert CSV rows',
|
|
84
|
+
}),
|
|
56
85
|
};
|
|
57
86
|
function parseCsv(input, options) {
|
|
58
87
|
const { encoding, delimiter, quote, skiplines, trim, mapping, convert } = options !== null && options !== void 0 ? options : {};
|
|
@@ -60,14 +89,16 @@ function parseCsv(input, options) {
|
|
|
60
89
|
const mapper = mapping ? columnMapper(mapping) : undefined;
|
|
61
90
|
let lines = 2;
|
|
62
91
|
const rows = [];
|
|
63
|
-
const parser = csv
|
|
92
|
+
const parser = csv
|
|
93
|
+
.parse({
|
|
64
94
|
headers: true,
|
|
65
95
|
ignoreEmpty: true,
|
|
66
|
-
delimiter: delimiter === '\\t' ? '\t' :
|
|
96
|
+
delimiter: delimiter === '\\t' ? '\t' : delimiter || ',',
|
|
67
97
|
quote: quote !== null && quote !== void 0 ? quote : '"',
|
|
68
98
|
skipLines: skiplines,
|
|
69
|
-
trim
|
|
70
|
-
})
|
|
99
|
+
trim,
|
|
100
|
+
})
|
|
101
|
+
.on('data', (row) => {
|
|
71
102
|
try {
|
|
72
103
|
if (mapper)
|
|
73
104
|
row = mapper(row);
|
|
@@ -81,17 +112,18 @@ function parseCsv(input, options) {
|
|
|
81
112
|
throw new Error(`A error occurred in csv file at line ${lines}: ${e.message}\ndata: ${JSON.stringify(row)}`);
|
|
82
113
|
}
|
|
83
114
|
});
|
|
84
|
-
const callback = e => e ? reject(e) : resolve(rows);
|
|
115
|
+
const callback = (e) => (e ? reject(e) : resolve(rows));
|
|
85
116
|
if (!encoding || encoding === 'utf8') {
|
|
86
|
-
stream_1.pipeline(input, parser, callback);
|
|
117
|
+
(0, stream_1.pipeline)(input, parser, callback);
|
|
87
118
|
}
|
|
88
119
|
else {
|
|
89
|
-
stream_1.pipeline(input, iconv_lite_1.decodeStream(encoding), parser, callback);
|
|
120
|
+
(0, stream_1.pipeline)(input, (0, iconv_lite_1.decodeStream)(encoding), parser, callback);
|
|
90
121
|
}
|
|
91
122
|
});
|
|
92
123
|
}
|
|
93
124
|
exports.parseCsv = parseCsv;
|
|
94
125
|
function loadScript(file) {
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
95
127
|
const script = require(path.resolve(file));
|
|
96
128
|
if (!script.convert)
|
|
97
129
|
throw new Error('function convert is not exported');
|
|
@@ -100,7 +132,7 @@ function loadScript(file) {
|
|
|
100
132
|
exports.loadScript = loadScript;
|
|
101
133
|
function columnMapper(mapping) {
|
|
102
134
|
const keys = Object.keys(mapping);
|
|
103
|
-
return row => {
|
|
135
|
+
return (row) => {
|
|
104
136
|
const result = {};
|
|
105
137
|
for (const to of keys) {
|
|
106
138
|
const from = mapping[to];
|
|
@@ -1 +1 @@
|
|
|
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,2CAA0C;AAC1C,6BAA6B;AAC7B,mCAA4C;AAE5C,MAAqB,iBAAkB,SAAQ,qBAAW;
|
|
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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B,CAAC,CAAC;AACJ,CAAC;AAXD,oCAWC"}
|
|
@@ -10,7 +10,7 @@ class LayoutAssignmentsDeployCommand extends command_1.SfdxCommand {
|
|
|
10
10
|
const layoutAssignmentsPerProfile = await this.readFile(this.flags.file);
|
|
11
11
|
const profiles = Object.entries(layoutAssignmentsPerProfile).map(([fullName, layoutAssignments]) => ({ fullName, layoutAssignments }));
|
|
12
12
|
// limit 10 records per one API call
|
|
13
|
-
return Promise.all(utils_1.chunk(profiles, 10).map(data => this.deploy(data))).then(a => [].concat(...a));
|
|
13
|
+
return Promise.all((0, utils_1.chunk)(profiles, 10).map((data) => this.deploy(data))).then((a) => [].concat(...a));
|
|
14
14
|
}
|
|
15
15
|
readFile(file) {
|
|
16
16
|
const inputFile = path.join(this.project.getPath(), file);
|
|
@@ -25,11 +25,16 @@ LayoutAssignmentsDeployCommand.description = 'deploy page layout assignments fro
|
|
|
25
25
|
LayoutAssignmentsDeployCommand.examples = [
|
|
26
26
|
'$ sfdx kit:layout:assignments:deploy',
|
|
27
27
|
'$ 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'
|
|
28
|
+
'$ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json',
|
|
29
29
|
];
|
|
30
30
|
LayoutAssignmentsDeployCommand.requiresUsername = true;
|
|
31
31
|
LayoutAssignmentsDeployCommand.requiresProject = true;
|
|
32
32
|
LayoutAssignmentsDeployCommand.flagsConfig = {
|
|
33
|
-
file: command_1.flags.string({
|
|
33
|
+
file: command_1.flags.string({
|
|
34
|
+
char: 'f',
|
|
35
|
+
required: true,
|
|
36
|
+
description: 'input file path',
|
|
37
|
+
default: 'config/layout-assignments.json',
|
|
38
|
+
}),
|
|
34
39
|
};
|
|
35
40
|
//# 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;
|
|
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;AAK7B,6CAA0C;AAE1C,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,oCAAoC;QACpC,OAAO,OAAO,CAAC,GAAG,CAChB,IAAA,aAAK,EAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CACrD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACjC,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;IAEO,MAAM,CAAC,IAAuB;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;;AAxCH,iDAyCC;AAxCe,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,6 +13,7 @@ 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
18
|
private getProfiles;
|
|
18
19
|
private findFiles;
|
|
@@ -8,27 +8,36 @@ const path = require("path");
|
|
|
8
8
|
const utils_1 = require("../../../../utils");
|
|
9
9
|
class LayoutAssignmentsRetrieveCommand extends command_1.SfdxCommand {
|
|
10
10
|
async run() {
|
|
11
|
-
const filterObjects = this.flags.object
|
|
11
|
+
const filterObjects = this.flags.object
|
|
12
|
+
? this.flags.object.split(',')
|
|
13
|
+
: await this.objectNamesFromLayouts();
|
|
12
14
|
if (filterObjects.length === 0)
|
|
13
15
|
throw new core_1.SfdxError('There are no objects to retrieve');
|
|
14
|
-
const data = this.flags.merge
|
|
15
|
-
|
|
16
|
+
const data = this.flags.merge
|
|
17
|
+
? await this.readFile(this.flags.file)
|
|
18
|
+
: {};
|
|
19
|
+
const profileNames = this.flags.profile
|
|
20
|
+
? this.flags.profile.split(',')
|
|
21
|
+
: await this.getProfileNames();
|
|
16
22
|
this.ux.log(`retrieve layout assignments\n\tprofiles: ${profileNames.join(', ')}\n\tobjects: ${filterObjects.join(', ')}`);
|
|
17
23
|
// limit 10 records per one API call
|
|
18
|
-
const profiles = await Promise.all(utils_1.chunk(profileNames, 10).map(names => this.getProfiles(names))).then(a => [].concat(...a));
|
|
24
|
+
const profiles = await Promise.all((0, utils_1.chunk)(profileNames, 10).map((names) => this.getProfiles(names))).then((a) => [].concat(...a));
|
|
19
25
|
for (const profile of profiles) {
|
|
20
26
|
if (!profile.fullName || !profile.layoutAssignments)
|
|
21
27
|
continue;
|
|
22
|
-
data[profile.fullName] = profile.layoutAssignments
|
|
28
|
+
data[profile.fullName] = profile.layoutAssignments
|
|
29
|
+
.filter((assignment) => filterObjects.includes(assignment.layout.split('-')[0]))
|
|
30
|
+
.sort((a, b) => a.layout.localeCompare(b.layout));
|
|
23
31
|
}
|
|
24
32
|
this.ux.log('save to ' + this.flags.file);
|
|
25
33
|
await this.writeFile(this.flags.file, data);
|
|
26
34
|
return data;
|
|
27
35
|
}
|
|
28
36
|
async objectNamesFromLayouts() {
|
|
29
|
-
//
|
|
30
|
-
const config = await this.
|
|
31
|
-
const packageDir = config.packageDirectories &&
|
|
37
|
+
// eslint-disable-next-line
|
|
38
|
+
const config = await this.getProjectConfig();
|
|
39
|
+
const packageDir = config.packageDirectories &&
|
|
40
|
+
config.packageDirectories.find((dir) => dir.default);
|
|
32
41
|
if (!packageDir)
|
|
33
42
|
return [];
|
|
34
43
|
const pattern = path.join(this.project.getPath(), packageDir.path, '**/*.layout-meta.xml');
|
|
@@ -37,10 +46,18 @@ class LayoutAssignmentsRetrieveCommand extends command_1.SfdxCommand {
|
|
|
37
46
|
const object = path.basename(filepath).split('-')[0];
|
|
38
47
|
objectCounts[object] = (objectCounts[object] || 0) + 1;
|
|
39
48
|
}
|
|
40
|
-
return Object.keys(objectCounts)
|
|
49
|
+
return Object.keys(objectCounts)
|
|
50
|
+
.filter((object) => objectCounts[object] >= 2)
|
|
51
|
+
.sort();
|
|
52
|
+
}
|
|
53
|
+
getProjectConfig() {
|
|
54
|
+
return this.project.resolveProjectConfig();
|
|
41
55
|
}
|
|
42
56
|
getProfileNames() {
|
|
43
|
-
return this.org
|
|
57
|
+
return this.org
|
|
58
|
+
.getConnection()
|
|
59
|
+
.metadata.list({ type: 'Profile' })
|
|
60
|
+
.then((profiles) => profiles.map((p) => p.fullName));
|
|
44
61
|
}
|
|
45
62
|
getProfiles(names) {
|
|
46
63
|
return this.org.getConnection().metadata.read('Profile', names);
|
|
@@ -52,7 +69,9 @@ class LayoutAssignmentsRetrieveCommand extends command_1.SfdxCommand {
|
|
|
52
69
|
return fs.readJson(path.join(this.project.getPath(), file));
|
|
53
70
|
}
|
|
54
71
|
writeFile(file, data) {
|
|
55
|
-
return fs.outputJson(path.join(this.project.getPath(), file), data, {
|
|
72
|
+
return fs.outputJson(path.join(this.project.getPath(), file), data, {
|
|
73
|
+
spaces: '\t',
|
|
74
|
+
});
|
|
56
75
|
}
|
|
57
76
|
}
|
|
58
77
|
exports.default = LayoutAssignmentsRetrieveCommand;
|
|
@@ -60,14 +79,30 @@ LayoutAssignmentsRetrieveCommand.description = 'retrieve page layout assignments
|
|
|
60
79
|
LayoutAssignmentsRetrieveCommand.examples = [
|
|
61
80
|
'$ sfdx kit:layout:assignments:retrieve',
|
|
62
81
|
'$ 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'
|
|
82
|
+
'$ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json',
|
|
64
83
|
];
|
|
65
84
|
LayoutAssignmentsRetrieveCommand.requiresUsername = true;
|
|
66
85
|
LayoutAssignmentsRetrieveCommand.requiresProject = true;
|
|
67
86
|
LayoutAssignmentsRetrieveCommand.flagsConfig = {
|
|
68
|
-
file: command_1.flags.string({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
87
|
+
file: command_1.flags.string({
|
|
88
|
+
char: 'f',
|
|
89
|
+
required: true,
|
|
90
|
+
description: 'output file path',
|
|
91
|
+
default: 'config/layout-assignments.json',
|
|
92
|
+
}),
|
|
93
|
+
profile: command_1.flags.string({
|
|
94
|
+
char: 'p',
|
|
95
|
+
required: false,
|
|
96
|
+
description: 'comma separated profile names to retrieve (default: all profiles)',
|
|
97
|
+
}),
|
|
98
|
+
object: command_1.flags.string({
|
|
99
|
+
char: 'o',
|
|
100
|
+
required: false,
|
|
101
|
+
description: 'comma separated object names to retrieve (default: objects which have multiple layouts)',
|
|
102
|
+
}),
|
|
103
|
+
merge: command_1.flags.boolean({
|
|
104
|
+
required: false,
|
|
105
|
+
description: 'merge retrieved configurations with existing file',
|
|
106
|
+
}),
|
|
72
107
|
};
|
|
73
108
|
//# 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":";;AAAA,iDAAyD;AACzD,2CAA6C;AAC7C,kCAAkC;AAClC,+BAA+B;AAC/B,6BAA6B;AAK7B,6CAA0C;AAE1C,MAAqB,gCAAiC,SAAQ,qBAAW;IAsChE,KAAK,CAAC,GAAG;QACd,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM;YACrC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;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vB,wCAAwC;IACxC,2IAA2I;IAC3I,+FAA+F;CAChG,CAAC;AAEe,iDAAgB,GAAG,IAAI,CAAC;AACxB,gDAAe,GAAG,IAAI,CAAC;AAEvB,4CAAW,GAAG;IAC7B,IAAI,EAAE,eAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,kBAAkB;QAC/B,OAAO,EAAE,gCAAgC;KAC1C,CAAC;IACF,OAAO,EAAE,eAAK,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,mEAAmE;KACtE,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"}
|
|
@@ -4,7 +4,7 @@ export default class ScriptExecuteCommand extends SfdxCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static aliases: string[];
|
|
6
6
|
static strict: boolean;
|
|
7
|
-
protected static
|
|
7
|
+
protected static supportsUsername: boolean;
|
|
8
8
|
protected static requiresProject: boolean;
|
|
9
9
|
protected static flagsConfig: {
|
|
10
10
|
file: flags.Discriminated<flags.String>;
|