@kitalive/sfdx-plugin 0.1.3 → 0.2.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 +326 -21
- package/lib/bulk.d.ts +22 -0
- package/lib/bulk.js +235 -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 +64 -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 +50 -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 -48
- package/lib/commands/kit/data/bulk/upsert.js +2 -149
- package/lib/commands/kit/data/bulk/upsert.js.map +1 -1
- package/lib/commands/kit/script/execute.d.ts +13 -0
- package/lib/commands/kit/script/execute.js +54 -0
- package/lib/commands/kit/script/execute.js.map +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @kitalive/sfdx-plugin
|
|
|
18
18
|
$ sfdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ sfdx (-v|--version|version)
|
|
21
|
-
@kitalive/sfdx-plugin/0.
|
|
21
|
+
@kitalive/sfdx-plugin/0.2.0 darwin-x64 node-v14.15.0
|
|
22
22
|
$ sfdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ sfdx COMMAND
|
|
@@ -29,23 +29,72 @@ USAGE
|
|
|
29
29
|
## Commands
|
|
30
30
|
|
|
31
31
|
<!-- commands -->
|
|
32
|
-
* [`sfdx kit:data:bulk:
|
|
32
|
+
* [`sfdx kit:data:bulk:delete -q <string> [--hard] [--concurrencymode <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitdatabulkdelete--q-string---hard---concurrencymode-string--s-integer--w-integer--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
33
|
+
* [`sfdx kit:data:bulk:insert -o <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitdatabulkinsert--o-string--f-filepath--r-filepath--e-string--d-string--q-string---skiplines-integer---trim--m-filepath--c-filepath---setnull---convertonly---concurrencymode-string---assignmentruleid-string--s-integer--w-integer--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
34
|
+
* [`sfdx kit:data:bulk:query -q <string> [-f <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitdatabulkquery--q-string--f-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
35
|
+
* [`sfdx kit:data:bulk:update -o <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitdatabulkupdate--o-string--f-filepath--r-filepath--e-string--d-string--q-string---skiplines-integer---trim--m-filepath--c-filepath---setnull---convertonly---concurrencymode-string---assignmentruleid-string--s-integer--w-integer--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
36
|
+
* [`sfdx kit:data:bulk:upsert -o <string> -f <filepath> -i <string> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitdatabulkupsert--o-string--f-filepath--i-string--r-filepath--e-string--d-string--q-string---skiplines-integer---trim--m-filepath--c-filepath---setnull---convertonly---concurrencymode-string---assignmentruleid-string--s-integer--w-integer--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
33
37
|
* [`sfdx kit:data:csv:convert [-f <filepath>] [-o <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitdatacsvconvert--f-filepath--o-filepath--e-string--d-string--q-string---skiplines-integer---trim--m-filepath--c-filepath---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
34
38
|
* [`sfdx kit:layout:assignments:deploy -f <string> [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitlayoutassignmentsdeploy--f-string--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
35
39
|
* [`sfdx kit:layout:assignments:retrieve -f <string> [-p <string>] [-o <string>] [--merge] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitlayoutassignmentsretrieve--f-string--p-string--o-string---merge--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
40
|
+
* [`sfdx kit:script:execute [-f <filepath>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`](#sfdx-kitscriptexecute--f-filepath--u-string---apiversion-string---json---loglevel-tracedebuginfowarnerrorfataltracedebuginfowarnerrorfatal)
|
|
36
41
|
|
|
37
|
-
## `sfdx kit:data:bulk:
|
|
42
|
+
## `sfdx kit:data:bulk:delete -q <string> [--hard] [--concurrencymode <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
38
43
|
|
|
39
|
-
bulk
|
|
44
|
+
bulk delete records by SOQL select query
|
|
40
45
|
|
|
41
46
|
```
|
|
42
|
-
bulk
|
|
43
|
-
|
|
47
|
+
bulk delete records by SOQL select query
|
|
48
|
+
|
|
49
|
+
USAGE
|
|
50
|
+
$ sfdx kit:data:bulk:delete -q <string> [--hard] [--concurrencymode <string>] [-s <integer>] [-w <integer>] [-u
|
|
51
|
+
<string>] [--apiversion <string>] [--json] [--loglevel
|
|
52
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
53
|
+
|
|
54
|
+
OPTIONS
|
|
55
|
+
-q, --query=query (required) SOQL query to delete
|
|
56
|
+
|
|
57
|
+
-s, --batchsize=batchsize [default: 10000] the batch size of
|
|
58
|
+
the job
|
|
59
|
+
|
|
60
|
+
-u, --targetusername=targetusername username or alias for the target
|
|
61
|
+
org; overrides default target org
|
|
62
|
+
|
|
63
|
+
-w, --wait=wait the number of minutes to wait for
|
|
64
|
+
the command to complete before
|
|
65
|
+
displaying the results
|
|
66
|
+
|
|
67
|
+
--apiversion=apiversion override the api version used for
|
|
68
|
+
api requests made by this command
|
|
69
|
+
|
|
70
|
+
--concurrencymode=concurrencymode [default: Parallel] the concurrency
|
|
71
|
+
mode (Parallel or Serial) for the
|
|
72
|
+
job
|
|
73
|
+
|
|
74
|
+
--hard perform a hard delete
|
|
75
|
+
|
|
76
|
+
--json format output as json
|
|
77
|
+
|
|
78
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
79
|
+
this command invocation
|
|
80
|
+
|
|
81
|
+
EXAMPLE
|
|
82
|
+
$ sfdx kit:data:bulk:delete -q 'SELECT Id FROM Opportunity WHERE CloseDate < LAST_N_YEARS:5'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
_See code: [src/commands/kit/data/bulk/delete.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/data/bulk/delete.ts)_
|
|
86
|
+
|
|
87
|
+
## `sfdx kit:data:bulk:insert -o <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
88
|
+
|
|
89
|
+
bulk insert records from a CSV file
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
bulk insert records from a CSV file
|
|
44
93
|
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.
|
|
45
94
|
|
|
46
95
|
USAGE
|
|
47
|
-
$ sfdx kit:data:bulk:
|
|
48
|
-
[--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--
|
|
96
|
+
$ sfdx kit:data:bulk:insert -o <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>]
|
|
97
|
+
[--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode
|
|
49
98
|
<string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json]
|
|
50
99
|
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
51
100
|
|
|
@@ -59,21 +108,142 @@ OPTIONS
|
|
|
59
108
|
-e, --encoding=encoding [default: utf8] the input CSV file
|
|
60
109
|
encoding
|
|
61
110
|
|
|
62
|
-
-f, --csvfile=csvfile (required) the
|
|
63
|
-
|
|
111
|
+
-f, --csvfile=csvfile (required) the CSV file path that
|
|
112
|
+
defines the records to insert
|
|
64
113
|
|
|
65
|
-
-
|
|
66
|
-
|
|
114
|
+
-m, --mapping=mapping the path of the JSON file that
|
|
115
|
+
defines CSV column mappings
|
|
116
|
+
|
|
117
|
+
-o, --object=object (required) the sObject name to
|
|
118
|
+
insert
|
|
119
|
+
|
|
120
|
+
-q, --quote=quote [default: "] the input CSV file
|
|
121
|
+
quote character
|
|
122
|
+
|
|
123
|
+
-r, --resultfile=resultfile the CSV file path for writing the
|
|
124
|
+
insert results
|
|
125
|
+
|
|
126
|
+
-s, --batchsize=batchsize [default: 10000] the batch size of
|
|
127
|
+
the job
|
|
128
|
+
|
|
129
|
+
-u, --targetusername=targetusername username or alias for the target
|
|
130
|
+
org; overrides default target org
|
|
131
|
+
|
|
132
|
+
-w, --wait=wait the number of minutes to wait for
|
|
133
|
+
the command to complete before
|
|
134
|
+
displaying the results
|
|
135
|
+
|
|
136
|
+
--apiversion=apiversion override the api version used for
|
|
137
|
+
api requests made by this command
|
|
138
|
+
|
|
139
|
+
--assignmentruleid=assignmentruleid the ID of a specific assignment rule
|
|
140
|
+
to run for a case or a lead.
|
|
141
|
+
|
|
142
|
+
--concurrencymode=concurrencymode [default: Parallel] the concurrency
|
|
143
|
+
mode (Parallel or Serial) for the
|
|
144
|
+
job
|
|
145
|
+
|
|
146
|
+
--convertonly output converted.csv file and skip
|
|
147
|
+
insert for debugging
|
|
148
|
+
|
|
149
|
+
--json format output as json
|
|
150
|
+
|
|
151
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
152
|
+
this command invocation
|
|
153
|
+
|
|
154
|
+
--setnull set blank values as null values
|
|
155
|
+
during insert operations (default:
|
|
156
|
+
empty field values are ignored)
|
|
157
|
+
|
|
158
|
+
--skiplines=skiplines the number of lines to skip
|
|
159
|
+
|
|
160
|
+
--trim trim all white space from columns
|
|
161
|
+
|
|
162
|
+
DESCRIPTION
|
|
163
|
+
For information about CSV file formats, see [Prepare CSV
|
|
164
|
+
Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm) in
|
|
165
|
+
the Bulk API Developer Guide.
|
|
166
|
+
|
|
167
|
+
EXAMPLES
|
|
168
|
+
$ sfdx kit:data:bulk:insert -o Account -f ./path/to/Account.csv -m ./path/to/mapping.json
|
|
169
|
+
$ sfdx kit:data:bulk:insert -o MyObject__c -f ./path/to/MyObject__c.csv -c ./path/to/convert.js -w 10
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
_See code: [src/commands/kit/data/bulk/insert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/data/bulk/insert.ts)_
|
|
173
|
+
|
|
174
|
+
## `sfdx kit:data:bulk:query -q <string> [-f <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
175
|
+
|
|
176
|
+
bulk query records
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
bulk query records
|
|
180
|
+
|
|
181
|
+
USAGE
|
|
182
|
+
$ sfdx kit:data:bulk:query -q <string> [-f <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
|
|
183
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
184
|
+
|
|
185
|
+
OPTIONS
|
|
186
|
+
-f, --csvfile=csvfile output csv file (default: standard
|
|
187
|
+
output)
|
|
188
|
+
|
|
189
|
+
-q, --query=query (required) SOQL query to export
|
|
190
|
+
|
|
191
|
+
-u, --targetusername=targetusername username or alias for the target
|
|
192
|
+
org; overrides default target org
|
|
193
|
+
|
|
194
|
+
--apiversion=apiversion override the api version used for
|
|
195
|
+
api requests made by this command
|
|
196
|
+
|
|
197
|
+
--json format output as json
|
|
198
|
+
|
|
199
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
200
|
+
this command invocation
|
|
201
|
+
|
|
202
|
+
EXAMPLE
|
|
203
|
+
$ sfdx kit:data:bulk:query -q 'SELECT Id, Name FROM Account' -f ./path/to/Account.csv
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
_See code: [src/commands/kit/data/bulk/query.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/data/bulk/query.ts)_
|
|
207
|
+
|
|
208
|
+
## `sfdx kit:data:bulk:update -o <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
209
|
+
|
|
210
|
+
bulk update records from a CSV file
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
bulk update records from a CSV file
|
|
214
|
+
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.
|
|
215
|
+
|
|
216
|
+
USAGE
|
|
217
|
+
$ sfdx kit:data:bulk:update -o <string> -f <filepath> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>]
|
|
218
|
+
[--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode
|
|
219
|
+
<string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json]
|
|
220
|
+
[--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
221
|
+
|
|
222
|
+
OPTIONS
|
|
223
|
+
-c, --converter=converter the path of the script to convert
|
|
224
|
+
CSV rows
|
|
225
|
+
|
|
226
|
+
-d, --delimiter=delimiter [default: ,] the input CSV file
|
|
227
|
+
delimiter
|
|
228
|
+
|
|
229
|
+
-e, --encoding=encoding [default: utf8] the input CSV file
|
|
230
|
+
encoding
|
|
231
|
+
|
|
232
|
+
-f, --csvfile=csvfile (required) the CSV file path that
|
|
233
|
+
defines the records to update
|
|
67
234
|
|
|
68
235
|
-m, --mapping=mapping the path of the JSON file that
|
|
69
236
|
defines CSV column mappings
|
|
70
237
|
|
|
71
238
|
-o, --object=object (required) the sObject name to
|
|
72
|
-
|
|
239
|
+
update
|
|
73
240
|
|
|
74
241
|
-q, --quote=quote [default: "] the input CSV file
|
|
75
242
|
quote character
|
|
76
243
|
|
|
244
|
+
-r, --resultfile=resultfile the CSV file path for writing the
|
|
245
|
+
update results
|
|
246
|
+
|
|
77
247
|
-s, --batchsize=batchsize [default: 10000] the batch size of
|
|
78
248
|
the job
|
|
79
249
|
|
|
@@ -94,16 +264,104 @@ OPTIONS
|
|
|
94
264
|
mode (Parallel or Serial) for the
|
|
95
265
|
job
|
|
96
266
|
|
|
267
|
+
--convertonly output converted.csv file and skip
|
|
268
|
+
update for debugging
|
|
269
|
+
|
|
97
270
|
--json format output as json
|
|
98
271
|
|
|
99
272
|
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
100
273
|
this command invocation
|
|
101
274
|
|
|
102
|
-
--
|
|
275
|
+
--setnull set blank values as null values
|
|
276
|
+
during update operations (default:
|
|
277
|
+
empty field values are ignored)
|
|
278
|
+
|
|
279
|
+
--skiplines=skiplines the number of lines to skip
|
|
280
|
+
|
|
281
|
+
--trim trim all white space from columns
|
|
282
|
+
|
|
283
|
+
DESCRIPTION
|
|
284
|
+
For information about CSV file formats, see [Prepare CSV
|
|
285
|
+
Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm) in
|
|
286
|
+
the Bulk API Developer Guide.
|
|
287
|
+
|
|
288
|
+
EXAMPLES
|
|
289
|
+
$ sfdx kit:data:bulk:update -o Account -f ./path/to/Account.csv -m ./path/to/mapping.json
|
|
290
|
+
$ sfdx kit:data:bulk:update -o MyObject__c -f ./path/to/MyObject__c.csv -c ./path/to/convert.js -w 10
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
_See code: [src/commands/kit/data/bulk/update.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/data/bulk/update.ts)_
|
|
294
|
+
|
|
295
|
+
## `sfdx kit:data:bulk:upsert -o <string> -f <filepath> -i <string> [-r <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly] [--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
296
|
+
|
|
297
|
+
bulk upsert records from a CSV file
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
bulk upsert records from a CSV file
|
|
301
|
+
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.
|
|
302
|
+
|
|
303
|
+
USAGE
|
|
304
|
+
$ sfdx kit:data:bulk:upsert -o <string> -f <filepath> -i <string> [-r <filepath>] [-e <string>] [-d <string>] [-q
|
|
305
|
+
<string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--setnull] [--convertonly]
|
|
306
|
+
[--concurrencymode <string>] [--assignmentruleid <string>] [-s <integer>] [-w <integer>] [-u <string>] [--apiversion
|
|
307
|
+
<string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
308
|
+
|
|
309
|
+
OPTIONS
|
|
310
|
+
-c, --converter=converter the path of the script to convert
|
|
311
|
+
CSV rows
|
|
312
|
+
|
|
313
|
+
-d, --delimiter=delimiter [default: ,] the input CSV file
|
|
314
|
+
delimiter
|
|
315
|
+
|
|
316
|
+
-e, --encoding=encoding [default: utf8] the input CSV file
|
|
317
|
+
encoding
|
|
318
|
+
|
|
319
|
+
-f, --csvfile=csvfile (required) the CSV file path that
|
|
320
|
+
defines the records to upsert
|
|
321
|
+
|
|
322
|
+
-i, --externalid=externalid (required) [default: Id] the column
|
|
323
|
+
name of the external ID
|
|
324
|
+
|
|
325
|
+
-m, --mapping=mapping the path of the JSON file that
|
|
326
|
+
defines CSV column mappings
|
|
327
|
+
|
|
328
|
+
-o, --object=object (required) the sObject name to
|
|
329
|
+
upsert
|
|
330
|
+
|
|
331
|
+
-q, --quote=quote [default: "] the input CSV file
|
|
332
|
+
quote character
|
|
333
|
+
|
|
334
|
+
-r, --resultfile=resultfile the CSV file path for writing the
|
|
335
|
+
upsert results
|
|
336
|
+
|
|
337
|
+
-s, --batchsize=batchsize [default: 10000] the batch size of
|
|
338
|
+
the job
|
|
339
|
+
|
|
340
|
+
-u, --targetusername=targetusername username or alias for the target
|
|
341
|
+
org; overrides default target org
|
|
342
|
+
|
|
343
|
+
-w, --wait=wait the number of minutes to wait for
|
|
344
|
+
the command to complete before
|
|
345
|
+
displaying the results
|
|
346
|
+
|
|
347
|
+
--apiversion=apiversion override the api version used for
|
|
348
|
+
api requests made by this command
|
|
349
|
+
|
|
350
|
+
--assignmentruleid=assignmentruleid the ID of a specific assignment rule
|
|
351
|
+
to run for a case or a lead.
|
|
103
352
|
|
|
104
|
-
--
|
|
353
|
+
--concurrencymode=concurrencymode [default: Parallel] the concurrency
|
|
354
|
+
mode (Parallel or Serial) for the
|
|
355
|
+
job
|
|
356
|
+
|
|
357
|
+
--convertonly output converted.csv file and skip
|
|
105
358
|
upsert for debugging
|
|
106
359
|
|
|
360
|
+
--json format output as json
|
|
361
|
+
|
|
362
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
363
|
+
this command invocation
|
|
364
|
+
|
|
107
365
|
--setnull set blank values as null values
|
|
108
366
|
during upsert operations (default:
|
|
109
367
|
empty field values are ignored)
|
|
@@ -113,8 +371,6 @@ OPTIONS
|
|
|
113
371
|
--trim trim all white space from columns
|
|
114
372
|
|
|
115
373
|
DESCRIPTION
|
|
116
|
-
Upsert records using Bulk API and returns a job ID and a batch ID. Use these IDs to check job status with
|
|
117
|
-
data:bulk:status.
|
|
118
374
|
For information about CSV file formats, see [Prepare CSV
|
|
119
375
|
Files](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm) in
|
|
120
376
|
the Bulk API Developer Guide.
|
|
@@ -125,7 +381,7 @@ EXAMPLES
|
|
|
125
381
|
10
|
|
126
382
|
```
|
|
127
383
|
|
|
128
|
-
_See code: [src/commands/kit/data/bulk/upsert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.
|
|
384
|
+
_See code: [src/commands/kit/data/bulk/upsert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/data/bulk/upsert.ts)_
|
|
129
385
|
|
|
130
386
|
## `sfdx kit:data:csv:convert [-f <filepath>] [-o <filepath>] [-e <string>] [-d <string>] [-q <string>] [--skiplines <integer>] [--trim] [-m <filepath>] [-c <filepath>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
131
387
|
|
|
@@ -175,7 +431,7 @@ EXAMPLES
|
|
|
175
431
|
$ sfdx kit:data:csv:convert -f ./path/to/input.csv -o ./path/to/output.csv -c ./path/to/convert.js -e cp932 -d :
|
|
176
432
|
```
|
|
177
433
|
|
|
178
|
-
_See code: [src/commands/kit/data/csv/convert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.
|
|
434
|
+
_See code: [src/commands/kit/data/csv/convert.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/data/csv/convert.ts)_
|
|
179
435
|
|
|
180
436
|
## `sfdx kit:layout:assignments:deploy -f <string> [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
181
437
|
|
|
@@ -210,7 +466,7 @@ EXAMPLES
|
|
|
210
466
|
$ sfdx kit:layout:assignments:deploy -u me@my.org -f config/layout-assignments.sandbox.json
|
|
211
467
|
```
|
|
212
468
|
|
|
213
|
-
_See code: [src/commands/kit/layout/assignments/deploy.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.
|
|
469
|
+
_See code: [src/commands/kit/layout/assignments/deploy.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/layout/assignments/deploy.ts)_
|
|
214
470
|
|
|
215
471
|
## `sfdx kit:layout:assignments:retrieve -f <string> [-p <string>] [-o <string>] [--merge] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
216
472
|
|
|
@@ -256,5 +512,54 @@ EXAMPLES
|
|
|
256
512
|
$ sfdx kit:layout:assignments:retrieve -u me@my.org -f config/layout-assignments.sandbox.json
|
|
257
513
|
```
|
|
258
514
|
|
|
259
|
-
_See code: [src/commands/kit/layout/assignments/retrieve.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.
|
|
515
|
+
_See code: [src/commands/kit/layout/assignments/retrieve.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/layout/assignments/retrieve.ts)_
|
|
516
|
+
|
|
517
|
+
## `sfdx kit:script:execute [-f <filepath>] [-u <string>] [--apiversion <string>] [--json] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]`
|
|
518
|
+
|
|
519
|
+
execute Node.js scripts in SfdxCommand context
|
|
520
|
+
|
|
521
|
+
```
|
|
522
|
+
execute Node.js scripts in SfdxCommand context
|
|
523
|
+
Available variables in Node.js scripts
|
|
524
|
+
argv: Parsed command line arguments after the file option
|
|
525
|
+
conn: jsforce Connection
|
|
526
|
+
context: SfdxCommand
|
|
527
|
+
|
|
528
|
+
USAGE
|
|
529
|
+
$ sfdx kit:script:execute [-f <filepath>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
|
|
530
|
+
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
|
|
531
|
+
|
|
532
|
+
OPTIONS
|
|
533
|
+
-f, --file=file the path of the Node.js script file
|
|
534
|
+
to execute
|
|
535
|
+
|
|
536
|
+
-u, --targetusername=targetusername username or alias for the target
|
|
537
|
+
org; overrides default target org
|
|
538
|
+
|
|
539
|
+
--apiversion=apiversion override the api version used for
|
|
540
|
+
api requests made by this command
|
|
541
|
+
|
|
542
|
+
--json format output as json
|
|
543
|
+
|
|
544
|
+
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
|
|
545
|
+
this command invocation
|
|
546
|
+
|
|
547
|
+
DESCRIPTION
|
|
548
|
+
Available variables in Node.js scripts
|
|
549
|
+
argv: Parsed command line arguments after the file option
|
|
550
|
+
conn: jsforce Connection
|
|
551
|
+
context: SfdxCommand
|
|
552
|
+
|
|
553
|
+
ALIASES
|
|
554
|
+
$ sfdx kit:script
|
|
555
|
+
|
|
556
|
+
EXAMPLES
|
|
557
|
+
$ sfdx kit:script -f ./path/to/script.js
|
|
558
|
+
$ sfdx kit:script:execute
|
|
559
|
+
> await conn.query('SELECT Id, Name FROM Account LIMIT 1')
|
|
560
|
+
Top level await is not enabled by default in REPL before Node.js v16
|
|
561
|
+
$ NODE_OPTIONS=--experimental-repl-await sfdx kit:script:execute
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
_See code: [src/commands/kit/script/execute.ts](https://github.com/Kitalive-Inc/sfdx-plugin/blob/v0.2.0/src/commands/kit/script/execute.ts)_
|
|
260
565
|
<!-- commandsstop -->
|
package/lib/bulk.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SfdxCommand } from '@salesforce/command';
|
|
2
|
+
import { JsonMap } from '@salesforce/ts-types';
|
|
3
|
+
import { BatchInfo, BatchResultInfo, Connection, JobInfo } from 'jsforce';
|
|
4
|
+
declare type BulkOperation = 'insert' | 'update' | 'upsert' | 'delete' | 'hardDelete';
|
|
5
|
+
declare type BulkOptions = {
|
|
6
|
+
extIdField?: string;
|
|
7
|
+
concurrencyMode?: 'Serial' | 'Parallel';
|
|
8
|
+
assignmentRuleId?: string;
|
|
9
|
+
batchSize?: number;
|
|
10
|
+
wait?: number;
|
|
11
|
+
};
|
|
12
|
+
export declare type BulkResult = {
|
|
13
|
+
job?: JobInfo;
|
|
14
|
+
batches?: BatchInfo[];
|
|
15
|
+
records: BatchResultInfo[];
|
|
16
|
+
errors?: JsonMap[];
|
|
17
|
+
};
|
|
18
|
+
export declare function bulkQuery(conn: Connection, query: string): Promise<JsonMap[]>;
|
|
19
|
+
export declare function bulkLoad(conn: Connection, sobject: string, operation: BulkOperation, rows: JsonMap[], options?: BulkOptions): Promise<BulkResult>;
|
|
20
|
+
export declare function normalizeDateString(str: any, format?: any): any;
|
|
21
|
+
export declare const createBulkCommand: (operation: BulkOperation) => new (...args: any[]) => SfdxCommand;
|
|
22
|
+
export {};
|