@salesforce/plugin-data 3.6.9 → 3.7.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 +130 -18
- package/lib/bulkDataRequestCache.js +81 -5
- package/lib/bulkDataRequestCache.js.map +1 -1
- package/lib/bulkUtils.js +94 -0
- package/lib/bulkUtils.js.map +1 -1
- package/lib/commands/data/export/bulk.js +213 -0
- package/lib/commands/data/export/bulk.js.map +1 -0
- package/lib/commands/data/export/resume.js +82 -0
- package/lib/commands/data/export/resume.js.map +1 -0
- package/lib/types.js.map +1 -1
- package/messages/data.export.bulk.md +67 -0
- package/messages/data.export.resume.md +25 -0
- package/messages/messages.md +5 -1
- package/oclif.manifest.json +260 -1
- package/package.json +11 -8
package/oclif.manifest.json
CHANGED
|
@@ -1116,6 +1116,265 @@
|
|
|
1116
1116
|
"resume:delete:data"
|
|
1117
1117
|
]
|
|
1118
1118
|
},
|
|
1119
|
+
"data:export:bulk": {
|
|
1120
|
+
"aliases": [],
|
|
1121
|
+
"args": {},
|
|
1122
|
+
"description": "You can use this command to export millions of records from an org, either to migrate data or to back it up.\n\nUse a SOQL query to specify the fields of a standard or custom object that you want to export. Specify the SOQL query either at the command line with the --query flag or read it from a file with the --query-file flag; you can't specify both flags. The --output-file flag is required, which means you can only write the records to a file, in either CSV or JSON format. \n\nBulk exports can take a while, depending on how many records are returned by the SOQL query. 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 export resume\" and pass the job ID to the --job-id flag.\n\nIMPORTANT: This command uses Bulk API 2.0, which limits the type of SOQL queries you can run. For example, you can't use aggregate functions such as count(). For the complete list of limitations, see the \"SOQL Considerations\" section in the \"Bulk API 2.0 and Bulk API Developer Guide\" (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/queries.htm).",
|
|
1123
|
+
"examples": [
|
|
1124
|
+
"Export the Id, Name, and Account.Name fields of the Contact object into a CSV-formatted file; if the export doesn't complete in 10 minutes, the command ends and displays a job ID. Use the org with alias \"my-scratch\":\n<%= config.bin %> <%= command.id %> --query \"SELECT Id, Name, Account.Name FROM Contact\" --output-file export-accounts.csv --wait 10 --target-org my-scratch",
|
|
1125
|
+
"Similar to previous example, but use the default org, export the records into a JSON-formatted file, and include records that have been soft deleted:\n<%= config.bin %> <%= command.id %> --query \"SELECT Id, Name, Account.Name FROM Contact\" --output-file export-accounts.json --result-format json --wait 10 --all-rows",
|
|
1126
|
+
"Export asynchronously; the command immediately returns a job ID that you then pass to the \"sf data export resume\" command:\n<%= config.bin %> <%= command.id %> --query \"SELECT Id, Name, Account.Name FROM Contact\" --output-file export-accounts.json --result-format json --async"
|
|
1127
|
+
],
|
|
1128
|
+
"flags": {
|
|
1129
|
+
"json": {
|
|
1130
|
+
"description": "Format output as json.",
|
|
1131
|
+
"helpGroup": "GLOBAL",
|
|
1132
|
+
"name": "json",
|
|
1133
|
+
"allowNo": false,
|
|
1134
|
+
"type": "boolean"
|
|
1135
|
+
},
|
|
1136
|
+
"flags-dir": {
|
|
1137
|
+
"helpGroup": "GLOBAL",
|
|
1138
|
+
"name": "flags-dir",
|
|
1139
|
+
"summary": "Import flag values from a directory.",
|
|
1140
|
+
"hasDynamicHelp": false,
|
|
1141
|
+
"multiple": false,
|
|
1142
|
+
"type": "option"
|
|
1143
|
+
},
|
|
1144
|
+
"target-org": {
|
|
1145
|
+
"char": "o",
|
|
1146
|
+
"name": "target-org",
|
|
1147
|
+
"noCacheDefault": true,
|
|
1148
|
+
"required": true,
|
|
1149
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
1150
|
+
"hasDynamicHelp": true,
|
|
1151
|
+
"multiple": false,
|
|
1152
|
+
"type": "option"
|
|
1153
|
+
},
|
|
1154
|
+
"api-version": {
|
|
1155
|
+
"description": "Override the api version used for api requests made by this command",
|
|
1156
|
+
"name": "api-version",
|
|
1157
|
+
"hasDynamicHelp": false,
|
|
1158
|
+
"multiple": false,
|
|
1159
|
+
"type": "option"
|
|
1160
|
+
},
|
|
1161
|
+
"wait": {
|
|
1162
|
+
"char": "w",
|
|
1163
|
+
"exclusive": [
|
|
1164
|
+
"async"
|
|
1165
|
+
],
|
|
1166
|
+
"name": "wait",
|
|
1167
|
+
"summary": "Time to wait for the command to finish, in minutes.",
|
|
1168
|
+
"hasDynamicHelp": true,
|
|
1169
|
+
"helpValue": "<minutes>",
|
|
1170
|
+
"multiple": false,
|
|
1171
|
+
"type": "option"
|
|
1172
|
+
},
|
|
1173
|
+
"async": {
|
|
1174
|
+
"exclusive": [
|
|
1175
|
+
"wait"
|
|
1176
|
+
],
|
|
1177
|
+
"name": "async",
|
|
1178
|
+
"summary": "Don't wait for the job to complete.",
|
|
1179
|
+
"allowNo": false,
|
|
1180
|
+
"type": "boolean"
|
|
1181
|
+
},
|
|
1182
|
+
"query": {
|
|
1183
|
+
"char": "q",
|
|
1184
|
+
"exclusive": [
|
|
1185
|
+
"query-file"
|
|
1186
|
+
],
|
|
1187
|
+
"name": "query",
|
|
1188
|
+
"summary": "SOQL query to execute.",
|
|
1189
|
+
"hasDynamicHelp": false,
|
|
1190
|
+
"multiple": false,
|
|
1191
|
+
"type": "option"
|
|
1192
|
+
},
|
|
1193
|
+
"query-file": {
|
|
1194
|
+
"exclusive": [
|
|
1195
|
+
"query"
|
|
1196
|
+
],
|
|
1197
|
+
"name": "query-file",
|
|
1198
|
+
"summary": "File that contains the SOQL query.",
|
|
1199
|
+
"hasDynamicHelp": false,
|
|
1200
|
+
"multiple": false,
|
|
1201
|
+
"type": "option"
|
|
1202
|
+
},
|
|
1203
|
+
"all-rows": {
|
|
1204
|
+
"name": "all-rows",
|
|
1205
|
+
"summary": "Include records that have been soft-deleted due to a merge or delete. By default, deleted records are not returned.",
|
|
1206
|
+
"allowNo": false,
|
|
1207
|
+
"type": "boolean"
|
|
1208
|
+
},
|
|
1209
|
+
"output-file": {
|
|
1210
|
+
"name": "output-file",
|
|
1211
|
+
"required": true,
|
|
1212
|
+
"summary": "File where records are written.",
|
|
1213
|
+
"hasDynamicHelp": false,
|
|
1214
|
+
"multiple": false,
|
|
1215
|
+
"type": "option"
|
|
1216
|
+
},
|
|
1217
|
+
"result-format": {
|
|
1218
|
+
"char": "r",
|
|
1219
|
+
"name": "result-format",
|
|
1220
|
+
"required": true,
|
|
1221
|
+
"summary": "Format to write the results.",
|
|
1222
|
+
"default": "csv",
|
|
1223
|
+
"hasDynamicHelp": false,
|
|
1224
|
+
"multiple": false,
|
|
1225
|
+
"options": [
|
|
1226
|
+
"csv",
|
|
1227
|
+
"json"
|
|
1228
|
+
],
|
|
1229
|
+
"type": "option"
|
|
1230
|
+
},
|
|
1231
|
+
"column-delimiter": {
|
|
1232
|
+
"name": "column-delimiter",
|
|
1233
|
+
"relationships": [
|
|
1234
|
+
{
|
|
1235
|
+
"type": "some",
|
|
1236
|
+
"flags": [
|
|
1237
|
+
{
|
|
1238
|
+
"name": "result-format"
|
|
1239
|
+
}
|
|
1240
|
+
]
|
|
1241
|
+
}
|
|
1242
|
+
],
|
|
1243
|
+
"summary": "Column delimiter to be used when writing CSV output. Default is COMMA.",
|
|
1244
|
+
"hasDynamicHelp": false,
|
|
1245
|
+
"multiple": false,
|
|
1246
|
+
"options": [
|
|
1247
|
+
"BACKQUOTE",
|
|
1248
|
+
"CARET",
|
|
1249
|
+
"COMMA",
|
|
1250
|
+
"PIPE",
|
|
1251
|
+
"SEMICOLON",
|
|
1252
|
+
"TAB"
|
|
1253
|
+
],
|
|
1254
|
+
"type": "option"
|
|
1255
|
+
},
|
|
1256
|
+
"line-ending": {
|
|
1257
|
+
"name": "line-ending",
|
|
1258
|
+
"relationships": [
|
|
1259
|
+
{
|
|
1260
|
+
"type": "some",
|
|
1261
|
+
"flags": [
|
|
1262
|
+
{
|
|
1263
|
+
"name": "result-format"
|
|
1264
|
+
}
|
|
1265
|
+
]
|
|
1266
|
+
}
|
|
1267
|
+
],
|
|
1268
|
+
"summary": "Line ending to be used when writing CSV output. Default value on Windows is is `CRLF`; on macOS and Linux it's `LR`.",
|
|
1269
|
+
"hasDynamicHelp": false,
|
|
1270
|
+
"multiple": false,
|
|
1271
|
+
"options": [
|
|
1272
|
+
"LF",
|
|
1273
|
+
"CRLF"
|
|
1274
|
+
],
|
|
1275
|
+
"type": "option"
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
"hasDynamicHelp": true,
|
|
1279
|
+
"hiddenAliases": [],
|
|
1280
|
+
"id": "data:export:bulk",
|
|
1281
|
+
"pluginAlias": "@salesforce/plugin-data",
|
|
1282
|
+
"pluginName": "@salesforce/plugin-data",
|
|
1283
|
+
"pluginType": "core",
|
|
1284
|
+
"strict": true,
|
|
1285
|
+
"summary": "Bulk export records from an org into a file using a SOQL query. Uses Bulk API 2.0.",
|
|
1286
|
+
"enableJsonFlag": true,
|
|
1287
|
+
"isESM": true,
|
|
1288
|
+
"relativePath": [
|
|
1289
|
+
"lib",
|
|
1290
|
+
"commands",
|
|
1291
|
+
"data",
|
|
1292
|
+
"export",
|
|
1293
|
+
"bulk.js"
|
|
1294
|
+
],
|
|
1295
|
+
"aliasPermutations": [],
|
|
1296
|
+
"permutations": [
|
|
1297
|
+
"data:export:bulk",
|
|
1298
|
+
"export:data:bulk",
|
|
1299
|
+
"export:bulk:data",
|
|
1300
|
+
"data:bulk:export",
|
|
1301
|
+
"bulk:data:export",
|
|
1302
|
+
"bulk:export:data"
|
|
1303
|
+
]
|
|
1304
|
+
},
|
|
1305
|
+
"data:export:resume": {
|
|
1306
|
+
"aliases": [],
|
|
1307
|
+
"args": {},
|
|
1308
|
+
"description": "When the original \"data export 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 export, run this command by either passing it the job ID or using the --use-most-recent flag to specify the most recent bulk export job.",
|
|
1309
|
+
"examples": [
|
|
1310
|
+
"Resume a bulk export job run on your default org by specifying a job ID:\nsf <%= command.id %> --job-id 750xx000000005sAAA",
|
|
1311
|
+
"Resume the most recently-run bulk export job for an org with alias my-scratch:\nsf data export resume --use-most-recent --target-org my-scratch"
|
|
1312
|
+
],
|
|
1313
|
+
"flags": {
|
|
1314
|
+
"json": {
|
|
1315
|
+
"description": "Format output as json.",
|
|
1316
|
+
"helpGroup": "GLOBAL",
|
|
1317
|
+
"name": "json",
|
|
1318
|
+
"allowNo": false,
|
|
1319
|
+
"type": "boolean"
|
|
1320
|
+
},
|
|
1321
|
+
"flags-dir": {
|
|
1322
|
+
"helpGroup": "GLOBAL",
|
|
1323
|
+
"name": "flags-dir",
|
|
1324
|
+
"summary": "Import flag values from a directory.",
|
|
1325
|
+
"hasDynamicHelp": false,
|
|
1326
|
+
"multiple": false,
|
|
1327
|
+
"type": "option"
|
|
1328
|
+
},
|
|
1329
|
+
"job-id": {
|
|
1330
|
+
"char": "i",
|
|
1331
|
+
"name": "job-id",
|
|
1332
|
+
"summary": "Job ID of the bulk export.",
|
|
1333
|
+
"hasDynamicHelp": false,
|
|
1334
|
+
"multiple": false,
|
|
1335
|
+
"type": "option"
|
|
1336
|
+
},
|
|
1337
|
+
"use-most-recent": {
|
|
1338
|
+
"name": "use-most-recent",
|
|
1339
|
+
"summary": "Use the job ID of the bulk export job that was most recently run.",
|
|
1340
|
+
"allowNo": false,
|
|
1341
|
+
"type": "boolean"
|
|
1342
|
+
},
|
|
1343
|
+
"api-version": {
|
|
1344
|
+
"description": "Override the api version used for api requests made by this command",
|
|
1345
|
+
"name": "api-version",
|
|
1346
|
+
"hasDynamicHelp": false,
|
|
1347
|
+
"multiple": false,
|
|
1348
|
+
"type": "option"
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
"hasDynamicHelp": false,
|
|
1352
|
+
"hiddenAliases": [],
|
|
1353
|
+
"id": "data:export:resume",
|
|
1354
|
+
"pluginAlias": "@salesforce/plugin-data",
|
|
1355
|
+
"pluginName": "@salesforce/plugin-data",
|
|
1356
|
+
"pluginType": "core",
|
|
1357
|
+
"strict": true,
|
|
1358
|
+
"summary": "Resume a bulk export job that you previously started.",
|
|
1359
|
+
"enableJsonFlag": true,
|
|
1360
|
+
"isESM": true,
|
|
1361
|
+
"relativePath": [
|
|
1362
|
+
"lib",
|
|
1363
|
+
"commands",
|
|
1364
|
+
"data",
|
|
1365
|
+
"export",
|
|
1366
|
+
"resume.js"
|
|
1367
|
+
],
|
|
1368
|
+
"aliasPermutations": [],
|
|
1369
|
+
"permutations": [
|
|
1370
|
+
"data:export:resume",
|
|
1371
|
+
"export:data:resume",
|
|
1372
|
+
"export:resume:data",
|
|
1373
|
+
"data:resume:export",
|
|
1374
|
+
"resume:data:export",
|
|
1375
|
+
"resume:export:data"
|
|
1376
|
+
]
|
|
1377
|
+
},
|
|
1119
1378
|
"data:export:tree": {
|
|
1120
1379
|
"aliases": [
|
|
1121
1380
|
"force:data:tree:export",
|
|
@@ -3077,5 +3336,5 @@
|
|
|
3077
3336
|
]
|
|
3078
3337
|
}
|
|
3079
3338
|
},
|
|
3080
|
-
"version": "3.
|
|
3339
|
+
"version": "3.7.1"
|
|
3081
3340
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-data",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "Plugin for salesforce data commands",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"homepage": "https://github.com/salesforcecli/plugin-data",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"description": "Delete a single record or multiple records in bulk."
|
|
54
54
|
},
|
|
55
55
|
"export": {
|
|
56
|
-
"description": "Export data from your org."
|
|
56
|
+
"description": "Export data from your org.",
|
|
57
|
+
"external": true
|
|
57
58
|
},
|
|
58
59
|
"get": {
|
|
59
60
|
"description": "Get a single record."
|
|
@@ -108,6 +109,7 @@
|
|
|
108
109
|
},
|
|
109
110
|
"dependencies": {
|
|
110
111
|
"@jsforce/jsforce-node": "^3.5.1",
|
|
112
|
+
"@oclif/multi-stage-output": "^0.7.5",
|
|
111
113
|
"@salesforce/core": "^8.6.1",
|
|
112
114
|
"@salesforce/kit": "^3.2.2",
|
|
113
115
|
"@salesforce/sf-plugins-core": "^11.3.10",
|
|
@@ -116,16 +118,17 @@
|
|
|
116
118
|
"change-case": "^5.4.4",
|
|
117
119
|
"csv-parse": "^5.5.6",
|
|
118
120
|
"csv-stringify": "^6.5.1",
|
|
119
|
-
"form-data": "^4.0.0"
|
|
121
|
+
"form-data": "^4.0.0",
|
|
122
|
+
"terminal-link": "^3.0.0"
|
|
120
123
|
},
|
|
121
124
|
"devDependencies": {
|
|
122
125
|
"@oclif/core": "^4.0.19",
|
|
123
126
|
"@oclif/plugin-command-snapshot": "^5.2.15",
|
|
124
|
-
"@salesforce/cli-plugins-testkit": "^5.3.
|
|
127
|
+
"@salesforce/cli-plugins-testkit": "^5.3.33",
|
|
125
128
|
"@salesforce/dev-scripts": "^10.2.10",
|
|
126
|
-
"@salesforce/plugin-command-reference": "^3.1.
|
|
129
|
+
"@salesforce/plugin-command-reference": "^3.1.27",
|
|
127
130
|
"@salesforce/types": "^1.2.0",
|
|
128
|
-
"eslint-plugin-sf-plugin": "^1.20.
|
|
131
|
+
"eslint-plugin-sf-plugin": "^1.20.8",
|
|
129
132
|
"oclif": "^4.14.36",
|
|
130
133
|
"ts-node": "^10.9.2",
|
|
131
134
|
"typescript": "^5.6.2"
|
|
@@ -251,7 +254,7 @@
|
|
|
251
254
|
"exports": "./lib/index.js",
|
|
252
255
|
"type": "module",
|
|
253
256
|
"sfdx": {
|
|
254
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.
|
|
255
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.
|
|
257
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.7.1.crt",
|
|
258
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.7.1.sig"
|
|
256
259
|
}
|
|
257
260
|
}
|