@salesforce/plugin-data 3.8.2 → 3.10.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 +137 -36
- package/lib/bulkDataRequestCache.js +63 -0
- package/lib/bulkDataRequestCache.js.map +1 -1
- package/lib/bulkIngest.js +184 -0
- package/lib/bulkIngest.js.map +1 -0
- package/lib/bulkOperationBase.js +6 -7
- package/lib/bulkOperationBase.js.map +1 -1
- package/lib/bulkUtils.js +59 -1
- package/lib/bulkUtils.js.map +1 -1
- package/lib/commands/data/import/bulk.js +18 -89
- package/lib/commands/data/import/bulk.js.map +1 -1
- package/lib/commands/data/import/legacy/tree.js +4 -5
- package/lib/commands/data/import/legacy/tree.js.map +1 -1
- package/lib/commands/data/import/resume.js +7 -55
- package/lib/commands/data/import/resume.js.map +1 -1
- package/lib/commands/data/import/tree.js +8 -5
- package/lib/commands/data/import/tree.js.map +1 -1
- package/lib/commands/data/update/bulk.js +68 -0
- package/lib/commands/data/update/bulk.js.map +1 -0
- package/lib/commands/data/update/resume.js +48 -0
- package/lib/commands/data/update/resume.js.map +1 -0
- package/lib/reporters/query/humanReporter.js +24 -19
- package/lib/reporters/query/humanReporter.js.map +1 -1
- package/lib/reporters/search/humanSearchReporter.js +3 -3
- package/lib/reporters/search/humanSearchReporter.js.map +1 -1
- package/lib/ux/{bulkImportStages.js → bulkIngestStages.js} +4 -4
- package/lib/ux/{bulkImportStages.js.map → bulkIngestStages.js.map} +1 -1
- package/messages/bulkIngest.md +39 -0
- package/messages/data.export.resume.md +1 -1
- package/messages/data.import.bulk.md +3 -35
- package/messages/data.import.resume.md +0 -32
- package/messages/data.update.bulk.md +47 -0
- package/messages/data.update.resume.md +29 -0
- package/oclif.manifest.json +504 -283
- package/package.json +19 -10
|
@@ -37,32 +37,37 @@ export const parseFields = (fields) => ({
|
|
|
37
37
|
children: fields.filter(isSubquery).map((field) => field.name),
|
|
38
38
|
aggregates: fields.filter(isAggregate),
|
|
39
39
|
});
|
|
40
|
-
export const prepColumns = (columns) => {
|
|
41
|
-
const formattedColumns = {};
|
|
42
|
-
columns.filter(isString).map((field) => (formattedColumns[field] = {
|
|
43
|
-
header: field.toUpperCase(),
|
|
44
|
-
get: (row) => {
|
|
45
|
-
// first test if key exists, if so, return value
|
|
46
|
-
if (Reflect.has(row, field)) {
|
|
47
|
-
return Reflect.get(row, field) ?? '';
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
// if not, try to find it query
|
|
51
|
-
return get(row, field) ?? '';
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
}));
|
|
55
|
-
return formattedColumns;
|
|
56
|
-
};
|
|
57
40
|
/** find null/undefined and replace it with a styled string */
|
|
58
41
|
export const prepNullValues = (record) => isPlainObject(record)
|
|
59
42
|
? Object.fromEntries(Object.entries(record).map(([key, value]) => [key, maybeReplaceNulls(maybeRecurseNestedObjects(value))]))
|
|
60
43
|
: record;
|
|
61
44
|
const maybeReplaceNulls = (value) => value ?? nullString;
|
|
62
45
|
const maybeRecurseNestedObjects = (value) => (isPlainObject(value) ? prepNullValues(value) : value);
|
|
63
|
-
|
|
46
|
+
function prepData(records, columns) {
|
|
47
|
+
const fields = columns.filter(isString);
|
|
48
|
+
const data = records.map(prepNullValues).map((record) => {
|
|
49
|
+
const row = {};
|
|
50
|
+
fields.forEach((field) => {
|
|
51
|
+
if (field in record) {
|
|
52
|
+
row[field] = record[field] ?? '';
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// if not, try to find it query
|
|
56
|
+
row[field] = get(record, field) ?? '';
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return row;
|
|
60
|
+
});
|
|
61
|
+
return { data, columns: fields.map((field) => ({ key: field, name: field.toUpperCase() })) };
|
|
62
|
+
}
|
|
63
|
+
const printTable = (records, cols, totalCount) => {
|
|
64
64
|
const ux = new Ux();
|
|
65
|
-
|
|
65
|
+
const { data, columns } = prepData(records, cols);
|
|
66
|
+
ux.table({
|
|
67
|
+
data,
|
|
68
|
+
columns,
|
|
69
|
+
overflow: 'wrap',
|
|
70
|
+
});
|
|
66
71
|
ux.log(ansis.bold(messages.getMessage('displayQueryRecordsRetrieved', [totalCount])));
|
|
67
72
|
};
|
|
68
73
|
const humanNamesFromField = (field) => isSubquery(field)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanReporter.js","sourceRoot":"","sources":["../../../src/reporters/query/humanReporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AACjD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAsC,SAAS,EAAmB,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAYxD,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAE7C,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;AAEvF,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC9C,YAAmB,IAAqB,EAAE,OAAgB;QACxD,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvB,CAAC;IAEM,OAAO;QACZ,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI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
|
9
9
|
}
|
|
10
10
|
this.typeRecordsMap.forEach((records, type) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
11
|
+
this.ux.table({
|
|
12
|
+
data: records,
|
|
13
|
+
overflow: 'wrap',
|
|
14
14
|
title: type,
|
|
15
15
|
});
|
|
16
16
|
this.ux.log();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"humanSearchReporter.js","sourceRoot":"","sources":["../../../src/reporters/search/humanSearchReporter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD,YAAmB,KAAmB;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAEM,OAAO;QACZ,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAClC,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;YAC5C,
|
|
1
|
+
{"version":3,"file":"humanSearchReporter.js","sourceRoot":"","sources":["../../../src/reporters/search/humanSearchReporter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD,YAAmB,KAAmB;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAEM,OAAO;QACZ,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAClC,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE;YAC5C,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;gBACZ,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,MAAM;gBAChB,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YACH,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { MultiStageOutput } from '@oclif/multi-stage-output';
|
|
8
8
|
import terminalLink from 'terminal-link';
|
|
9
|
-
export class
|
|
9
|
+
export class BulkIngestStages {
|
|
10
10
|
mso;
|
|
11
11
|
resume;
|
|
12
12
|
constructor({ resume, title, baseUrl, jsonEnabled }) {
|
|
@@ -87,11 +87,11 @@ export class BulkImportStages {
|
|
|
87
87
|
update(data) {
|
|
88
88
|
this.mso.updateData(data);
|
|
89
89
|
}
|
|
90
|
-
stop() {
|
|
91
|
-
this.mso.stop();
|
|
90
|
+
stop(finalStatus) {
|
|
91
|
+
this.mso.stop(finalStatus);
|
|
92
92
|
}
|
|
93
93
|
error() {
|
|
94
94
|
this.mso.error();
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
//# sourceMappingURL=
|
|
97
|
+
//# sourceMappingURL=bulkIngestStages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"bulkIngestStages.js","sourceRoot":"","sources":["../../src/ux/bulkIngestStages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,YAAY,MAAM,eAAe,CAAC;AAUzC,MAAM,OAAO,gBAAgB;IACnB,GAAG,CAA8B;IACjC,MAAM,CAAU;IAExB,YAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAW;QACjE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,IAA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1,39 @@
|
|
|
1
|
+
# export.resume
|
|
2
|
+
|
|
3
|
+
Run "sf %s --job-id %s" to resume the operation.
|
|
4
|
+
|
|
5
|
+
# error.timeout
|
|
6
|
+
|
|
7
|
+
The operation timed out after %s minutes.
|
|
8
|
+
|
|
9
|
+
Run "sf %s --job-id %s" to resume it.
|
|
10
|
+
|
|
11
|
+
# error.failedRecordDetails
|
|
12
|
+
|
|
13
|
+
Job finished being processed but failed to process %s records.
|
|
14
|
+
|
|
15
|
+
To review the details of this job, run this command:
|
|
16
|
+
|
|
17
|
+
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
18
|
+
|
|
19
|
+
# error.jobFailed
|
|
20
|
+
|
|
21
|
+
Job failed to be processed due to:
|
|
22
|
+
|
|
23
|
+
%s
|
|
24
|
+
|
|
25
|
+
To review the details of this job, run this command:
|
|
26
|
+
|
|
27
|
+
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
28
|
+
|
|
29
|
+
# error.jobAborted
|
|
30
|
+
|
|
31
|
+
Job has been aborted.
|
|
32
|
+
|
|
33
|
+
To review the details of this job, run this command:
|
|
34
|
+
|
|
35
|
+
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
36
|
+
|
|
37
|
+
# flags.column-delimiter.summary
|
|
38
|
+
|
|
39
|
+
Column delimiter used in the CSV file. Default is COMMA.
|
|
@@ -40,40 +40,8 @@ Time to wait for the command to finish, in minutes.
|
|
|
40
40
|
|
|
41
41
|
# flags.line-ending.summary
|
|
42
42
|
|
|
43
|
-
Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `
|
|
43
|
+
Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.
|
|
44
44
|
|
|
45
|
-
#
|
|
45
|
+
# flags.column-delimiter.summary
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
# error.timeout
|
|
50
|
-
|
|
51
|
-
The operation timed out after %s minutes.
|
|
52
|
-
|
|
53
|
-
Run "sf data import resume --job-id %s" to resume it.
|
|
54
|
-
|
|
55
|
-
# error.failedRecordDetails
|
|
56
|
-
|
|
57
|
-
Job finished being processed but failed to import %s records.
|
|
58
|
-
|
|
59
|
-
To review the details of this job, run this command:
|
|
60
|
-
|
|
61
|
-
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
62
|
-
|
|
63
|
-
# error.jobFailed
|
|
64
|
-
|
|
65
|
-
Job failed to be processed due to:
|
|
66
|
-
|
|
67
|
-
%s
|
|
68
|
-
|
|
69
|
-
To review the details of this job, run this command:
|
|
70
|
-
|
|
71
|
-
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
72
|
-
|
|
73
|
-
# error.jobAborted
|
|
74
|
-
|
|
75
|
-
Job has been aborted.
|
|
76
|
-
|
|
77
|
-
To review the details of this job, run this command:
|
|
78
|
-
|
|
79
|
-
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
47
|
+
Column delimiter used in the CSV file. Default is COMMA.
|
|
@@ -27,35 +27,3 @@ Job ID of the bulk import.
|
|
|
27
27
|
# flags.wait.summary
|
|
28
28
|
|
|
29
29
|
Time to wait for the command to finish, in minutes.
|
|
30
|
-
|
|
31
|
-
# error.failedRecordDetails
|
|
32
|
-
|
|
33
|
-
Job finished being processed but failed to import %s records.
|
|
34
|
-
|
|
35
|
-
To review the details of this job, run this command:
|
|
36
|
-
|
|
37
|
-
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
38
|
-
|
|
39
|
-
# error.timeout
|
|
40
|
-
|
|
41
|
-
The operation timed out after %s minutes.
|
|
42
|
-
|
|
43
|
-
Try re-running "sf data import resume --job-id %s" with a bigger wait time.
|
|
44
|
-
|
|
45
|
-
# error.jobFailed
|
|
46
|
-
|
|
47
|
-
Job failed to be processed due to:
|
|
48
|
-
|
|
49
|
-
%s
|
|
50
|
-
|
|
51
|
-
To review the details of this job, run this command:
|
|
52
|
-
|
|
53
|
-
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
54
|
-
|
|
55
|
-
# error.jobAborted
|
|
56
|
-
|
|
57
|
-
Job has been aborted.
|
|
58
|
-
|
|
59
|
-
To review the details of this job, run this command:
|
|
60
|
-
|
|
61
|
-
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Bulk update records to an org from a CSV file. Uses Bulk API 2.0.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
You can use this command to update millions of Salesforce object records based on a file in comma-separated values (CSV) format.
|
|
8
|
+
|
|
9
|
+
All the records in the CSV file must be for the same Salesforce object. Specify the object with the `--sobject` flag. The first column of every line in the CSV file must be an ID of the record you want to update. The CSV file can contain only existing records; if a record in the file doesn't currently exist in the Salesforce object, the command fails. Consider using "sf data upsert bulk" if you also want to insert new records.
|
|
10
|
+
|
|
11
|
+
Bulk updates can take a while, depending on how many records are in the CSV file. If the command times out, or you specified the --async flag, the command displays the job ID. To see the status and get the results of the job, run "sf data update resume" and pass the job ID to the --job-id flag.
|
|
12
|
+
|
|
13
|
+
For information and examples about how to prepare your CSV files, see "Prepare Data to Ingest" in the "Bulk API 2.0 and Bulk API Developer Guide" (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_data.htm).
|
|
14
|
+
|
|
15
|
+
# examples
|
|
16
|
+
|
|
17
|
+
- Update Account records from a CSV-formatted file into an org with alias "my-scratch"; if the update doesn't complete in 10 minutes, the command ends and displays a job ID:
|
|
18
|
+
|
|
19
|
+
<%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --wait 10 --target-org my-scratch
|
|
20
|
+
|
|
21
|
+
- Update asynchronously and use the default org; the command immediately returns a job ID that you then pass to the "sf data update resume" command:
|
|
22
|
+
|
|
23
|
+
<%= config.bin %> <%= command.id %> --file accounts.csv --sobject Account --async
|
|
24
|
+
|
|
25
|
+
# flags.async.summary
|
|
26
|
+
|
|
27
|
+
Don't wait for the command to complete.
|
|
28
|
+
|
|
29
|
+
# flags.wait.summary
|
|
30
|
+
|
|
31
|
+
Time to wait for the command to finish, in minutes.
|
|
32
|
+
|
|
33
|
+
# flags.file.summary
|
|
34
|
+
|
|
35
|
+
CSV file that contains the Salesforce object records you want to update.
|
|
36
|
+
|
|
37
|
+
# flags.sobject.summary
|
|
38
|
+
|
|
39
|
+
API name of the Salesforce object, either standard or custom, which you are updating.
|
|
40
|
+
|
|
41
|
+
# flags.line-ending.summary
|
|
42
|
+
|
|
43
|
+
Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.
|
|
44
|
+
|
|
45
|
+
# flags.column-delimiter.summary
|
|
46
|
+
|
|
47
|
+
Column delimiter used in the CSV file. Default is COMMA.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Resume a bulk update job that you previously started. Uses Bulk API 2.0.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
When the original "sf data update bulk" command either times out or is run with the --async flag, it displays a job ID. To see the status and get the results of the bulk update, run this command by either passing it the job ID or using the --use-most-recent flag to specify the most recent bulk update job.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- Resume a bulk update job of your default org using a job ID:
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA
|
|
14
|
+
|
|
15
|
+
- Resume the most recently run bulk update job for an org with alias "my-scratch":
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-scratch
|
|
18
|
+
|
|
19
|
+
# flags.use-most-recent.summary
|
|
20
|
+
|
|
21
|
+
Use the job ID of the bulk update job that was most recently run.
|
|
22
|
+
|
|
23
|
+
# flags.job-id.summary
|
|
24
|
+
|
|
25
|
+
Job ID of the bulk update.
|
|
26
|
+
|
|
27
|
+
# flags.wait.summary
|
|
28
|
+
|
|
29
|
+
Time to wait for the command to finish, in minutes.
|