@salesforce/plugin-data 2.2.1 → 2.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.
Files changed (69) hide show
  1. package/lib/BulkBaseCommand.js +103 -0
  2. package/lib/BulkBaseCommand.js.map +1 -0
  3. package/lib/api/data/tree/importApi.js +11 -2
  4. package/lib/api/data/tree/importApi.js.map +1 -1
  5. package/lib/batcher.js +24 -3
  6. package/lib/batcher.js.map +1 -1
  7. package/lib/bulkDataRequestCache.js +147 -0
  8. package/lib/bulkDataRequestCache.js.map +1 -0
  9. package/lib/bulkOperationCommand.js +123 -0
  10. package/lib/bulkOperationCommand.js.map +1 -0
  11. package/lib/bulkUtils.js +48 -0
  12. package/lib/bulkUtils.js.map +1 -0
  13. package/lib/commands/data/delete/bulk.js +12 -59
  14. package/lib/commands/data/delete/bulk.js.map +1 -1
  15. package/lib/commands/data/delete/record.js +2 -0
  16. package/lib/commands/data/delete/record.js.map +1 -1
  17. package/lib/commands/data/delete/resume.js +35 -0
  18. package/lib/commands/data/delete/resume.js.map +1 -0
  19. package/lib/commands/data/get/record.js +2 -0
  20. package/lib/commands/data/get/record.js.map +1 -1
  21. package/lib/commands/data/import/tree.js +1 -1
  22. package/lib/commands/data/import/tree.js.map +1 -1
  23. package/lib/commands/data/query/resume.js +22 -14
  24. package/lib/commands/data/query/resume.js.map +1 -1
  25. package/lib/commands/data/query.js +55 -102
  26. package/lib/commands/data/query.js.map +1 -1
  27. package/lib/commands/data/resume.js +9 -4
  28. package/lib/commands/data/resume.js.map +1 -1
  29. package/lib/commands/data/update/record.js +2 -0
  30. package/lib/commands/data/update/record.js.map +1 -1
  31. package/lib/commands/data/upsert/bulk.js +11 -56
  32. package/lib/commands/data/upsert/bulk.js.map +1 -1
  33. package/lib/commands/data/upsert/resume.js +34 -0
  34. package/lib/commands/data/upsert/resume.js.map +1 -0
  35. package/lib/commands/force/data/bulk/delete.js +79 -0
  36. package/lib/commands/force/data/bulk/delete.js.map +1 -0
  37. package/lib/commands/force/data/bulk/status.js +64 -0
  38. package/lib/commands/force/data/bulk/status.js.map +1 -0
  39. package/lib/commands/force/data/bulk/upsert.js +88 -0
  40. package/lib/commands/force/data/bulk/upsert.js.map +1 -0
  41. package/lib/flags.js +16 -3
  42. package/lib/flags.js.map +1 -1
  43. package/lib/queryUtils.js +45 -0
  44. package/lib/queryUtils.js.map +1 -0
  45. package/lib/reporters.js +48 -9
  46. package/lib/reporters.js.map +1 -1
  47. package/lib/resumeBulkCommand.js +63 -0
  48. package/lib/resumeBulkCommand.js.map +1 -0
  49. package/lib/types.js +3 -0
  50. package/lib/types.js.map +1 -0
  51. package/messages/batcher.md +3 -3
  52. package/messages/bulk.base.command.md +24 -0
  53. package/messages/bulk.delete.md +5 -5
  54. package/messages/bulk.delete.resume.md +17 -0
  55. package/messages/bulk.operation.command.md +15 -0
  56. package/messages/bulk.report.md +4 -0
  57. package/messages/bulk.resume.command.md +15 -0
  58. package/messages/bulk.status.md +5 -5
  59. package/messages/bulk.upsert.md +5 -5
  60. package/messages/bulk.upsert.resume.md +17 -0
  61. package/messages/bulkv2.delete.md +19 -0
  62. package/messages/bulkv2.upsert.md +25 -0
  63. package/messages/data.resume.md +29 -0
  64. package/messages/importApi.md +3 -4
  65. package/messages/messages.md +28 -0
  66. package/messages/reporter.md +3 -0
  67. package/messages/soql.query.md +2 -2
  68. package/oclif.manifest.json +503 -63
  69. package/package.json +33 -18
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.2.1",
2
+ "version": "2.3.0",
3
3
  "commands": {
4
4
  "data:query": {
5
5
  "id": "data:query",
@@ -32,7 +32,7 @@
32
32
  "name": "target-org",
33
33
  "type": "option",
34
34
  "char": "o",
35
- "summary": "Username or alias of the target org.",
35
+ "summary": "Org alias or username to use for the target org.",
36
36
  "required": true,
37
37
  "multiple": false,
38
38
  "deprecateAliases": true,
@@ -170,31 +170,31 @@
170
170
  "pluginName": "@salesforce/plugin-data",
171
171
  "pluginAlias": "@salesforce/plugin-data",
172
172
  "pluginType": "core",
173
- "aliases": [
174
- "force:data:bulk:status"
175
- ],
173
+ "state": "deprecated",
174
+ "aliases": [],
176
175
  "examples": [
177
176
  "View the status of a bulk load job:\n<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA",
178
177
  "View the status of a bulk load job and a specific batches:\n<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA --batch-id 751xx000000005nAAA"
179
178
  ],
180
- "deprecateAliases": true,
179
+ "deprecationOptions": {
180
+ "to": "force:data:bulk:status",
181
+ "message": "Use force:data:bulk:status instead"
182
+ },
181
183
  "flags": {
182
184
  "json": {
183
185
  "name": "json",
184
186
  "type": "boolean",
185
187
  "description": "Format output as json.",
186
188
  "helpGroup": "GLOBAL",
187
- "allowNo": false,
188
- "deprecateAliases": true
189
+ "allowNo": false
189
190
  },
190
191
  "target-org": {
191
192
  "name": "target-org",
192
193
  "type": "option",
193
194
  "char": "o",
194
- "summary": "Username or alias of the target org.",
195
+ "summary": "Org alias or username to use for the target org.",
195
196
  "required": true,
196
197
  "multiple": false,
197
- "deprecateAliases": true,
198
198
  "aliases": [
199
199
  "targetusername",
200
200
  "u"
@@ -205,7 +205,6 @@
205
205
  "type": "option",
206
206
  "description": "Override the api version used for api requests made by this command",
207
207
  "multiple": false,
208
- "deprecateAliases": true,
209
208
  "aliases": [
210
209
  "apiversion"
211
210
  ]
@@ -217,8 +216,7 @@
217
216
  "multiple": false,
218
217
  "deprecated": {
219
218
  "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
220
- },
221
- "deprecateAliases": true
219
+ }
222
220
  },
223
221
  "batch-id": {
224
222
  "name": "batch-id",
@@ -226,7 +224,6 @@
226
224
  "char": "b",
227
225
  "summary": "ID of the batch whose status you want to view; you must also specify the job ID.",
228
226
  "multiple": false,
229
- "deprecateAliases": true,
230
227
  "aliases": [
231
228
  "batchid"
232
229
  ]
@@ -238,7 +235,6 @@
238
235
  "summary": "ID of the job whose status you want to view.",
239
236
  "required": true,
240
237
  "multiple": false,
241
- "deprecateAliases": true,
242
238
  "aliases": [
243
239
  "jobid"
244
240
  ]
@@ -277,7 +273,7 @@
277
273
  "name": "target-org",
278
274
  "type": "option",
279
275
  "char": "o",
280
- "summary": "Username or alias of the target org.",
276
+ "summary": "Org alias or username to use for the target org.",
281
277
  "required": true,
282
278
  "multiple": false,
283
279
  "deprecateAliases": true,
@@ -356,37 +352,32 @@
356
352
  },
357
353
  "data:delete:bulk": {
358
354
  "id": "data:delete:bulk",
359
- "summary": "Bulk delete records from an org using a CSV file.",
360
- "description": "The CSV file must have only one column (\"Id\") and then the list of record IDs you want to delete, one ID per line.\n\nWhen you execute this command, it starts a job and one or more batches, displays their IDs, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job and batch IDs to check the status of the job with the \"<%= config.bin %> data resume\" command. A single job can contain many batches, depending on the length of the CSV file.",
355
+ "summary": "Bulk delete records from an org using a CSV file. Uses Bulk API 2.0.",
356
+ "description": "The CSV file must have only one column (\"Id\") and then the list of record IDs you want to delete, one ID per line.\n\nWhen you execute this command, it starts a job, displays the ID, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job ID to check the status of the job with the \"<%= config.bin %> data delete resume\" command.",
361
357
  "strict": true,
362
358
  "pluginName": "@salesforce/plugin-data",
363
359
  "pluginAlias": "@salesforce/plugin-data",
364
360
  "pluginType": "core",
365
- "aliases": [
366
- "force:data:bulk:delete"
367
- ],
361
+ "aliases": [],
368
362
  "examples": [
369
- "Bulk delete Account records using the list of IDs in the \"files/delete.csv\" file:\n<%= config.bin %> <%= command.id %> --sobject Account --file files/delete.csv",
370
- "Bulk delete records from a custom object and wait 5 minutes for the command to complete:\n<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/delete.csv --wait 5"
363
+ "Bulk delete Account records from your default org using the list of IDs in the \"files/delete.csv\" file:\n<%= config.bin %> <%= command.id %> --sobject Account --file files/delete.csv",
364
+ "Bulk delete records from a custom object in an org with alias my-scratch and wait 5 minutes for the command to complete:\n<%= config.bin %> <%= command.id %> --sobject MyObject\\_\\_c --file files/delete.csv --wait 5 --target-org my-scratch"
371
365
  ],
372
- "deprecateAliases": true,
373
366
  "flags": {
374
367
  "json": {
375
368
  "name": "json",
376
369
  "type": "boolean",
377
370
  "description": "Format output as json.",
378
371
  "helpGroup": "GLOBAL",
379
- "allowNo": false,
380
- "deprecateAliases": true
372
+ "allowNo": false
381
373
  },
382
374
  "target-org": {
383
375
  "name": "target-org",
384
376
  "type": "option",
385
377
  "char": "o",
386
- "summary": "Username or alias of the target org.",
378
+ "summary": "Org alias or username to use for the target org.",
387
379
  "required": true,
388
380
  "multiple": false,
389
- "deprecateAliases": true,
390
381
  "aliases": [
391
382
  "targetusername",
392
383
  "u"
@@ -397,7 +388,6 @@
397
388
  "type": "option",
398
389
  "description": "Override the api version used for api requests made by this command",
399
390
  "multiple": false,
400
- "deprecateAliases": true,
401
391
  "aliases": [
402
392
  "apiversion"
403
393
  ]
@@ -409,8 +399,7 @@
409
399
  "multiple": false,
410
400
  "deprecated": {
411
401
  "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
412
- },
413
- "deprecateAliases": true
402
+ }
414
403
  },
415
404
  "file": {
416
405
  "name": "file",
@@ -419,7 +408,6 @@
419
408
  "summary": "CSV file that contains the IDs of the records to delete.",
420
409
  "required": true,
421
410
  "multiple": false,
422
- "deprecateAliases": true,
423
411
  "aliases": [
424
412
  "csvfile"
425
413
  ]
@@ -431,7 +419,6 @@
431
419
  "summary": "API name of the Salesforce object, either standard or custom, that you want to delete records from.",
432
420
  "required": true,
433
421
  "multiple": false,
434
- "deprecateAliases": true,
435
422
  "aliases": [
436
423
  "sobjecttype"
437
424
  ]
@@ -442,11 +429,23 @@
442
429
  "char": "w",
443
430
  "summary": "Number of minutes to wait for the command to complete before displaying the results.",
444
431
  "multiple": false,
432
+ "exclusive": [
433
+ "async"
434
+ ],
445
435
  "default": {
446
436
  "quantity": 0,
447
437
  "unit": 0
448
- },
449
- "deprecateAliases": true
438
+ }
439
+ },
440
+ "async": {
441
+ "name": "async",
442
+ "type": "boolean",
443
+ "char": "a",
444
+ "summary": "Run the command asynchronously.",
445
+ "allowNo": false,
446
+ "exclusive": [
447
+ "wait"
448
+ ]
450
449
  }
451
450
  },
452
451
  "args": {},
@@ -483,7 +482,7 @@
483
482
  "name": "target-org",
484
483
  "type": "option",
485
484
  "char": "o",
486
- "summary": "Username or alias of the target org.",
485
+ "summary": "Org alias or username to use for the target org.",
487
486
  "required": true,
488
487
  "multiple": false,
489
488
  "deprecateAliases": true,
@@ -570,6 +569,94 @@
570
569
  "args": {},
571
570
  "hasDynamicHelp": true
572
571
  },
572
+ "data:delete:resume": {
573
+ "id": "data:delete:resume",
574
+ "summary": "Resume a bulk delete job that you previously started. Uses Bulk API 2.0.",
575
+ "description": "The command uses the job ID returned by the \"<%= config.bin %> data delete bulk\" command or the most recently-run bulk delete job.",
576
+ "strict": true,
577
+ "pluginName": "@salesforce/plugin-data",
578
+ "pluginAlias": "@salesforce/plugin-data",
579
+ "pluginType": "core",
580
+ "aliases": [],
581
+ "examples": [
582
+ "Resume a bulk delete job from your default org using an ID:\n<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA",
583
+ "Resume the most recently run bulk delete job for an org with alias my-scratch:\n<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-scratch"
584
+ ],
585
+ "deprecateAliases": true,
586
+ "flags": {
587
+ "json": {
588
+ "name": "json",
589
+ "type": "boolean",
590
+ "description": "Format output as json.",
591
+ "helpGroup": "GLOBAL",
592
+ "allowNo": false,
593
+ "deprecateAliases": true
594
+ },
595
+ "target-org": {
596
+ "name": "target-org",
597
+ "type": "option",
598
+ "char": "o",
599
+ "summary": "Org alias or username to use for the target org.",
600
+ "multiple": false,
601
+ "deprecateAliases": true,
602
+ "aliases": [
603
+ "targetusername",
604
+ "u"
605
+ ]
606
+ },
607
+ "job-id": {
608
+ "name": "job-id",
609
+ "type": "option",
610
+ "char": "i",
611
+ "summary": "ID of the job you want to resume.",
612
+ "multiple": false,
613
+ "deprecateAliases": true,
614
+ "aliases": [
615
+ "jobid"
616
+ ]
617
+ },
618
+ "use-most-recent": {
619
+ "name": "use-most-recent",
620
+ "type": "boolean",
621
+ "summary": "Use the ID of the most recently-run bulk job.",
622
+ "allowNo": false,
623
+ "exclusive": [
624
+ "job-id"
625
+ ],
626
+ "deprecateAliases": true
627
+ },
628
+ "wait": {
629
+ "name": "wait",
630
+ "type": "option",
631
+ "summary": "Number of minutes to wait for the command to complete before displaying the results.",
632
+ "multiple": false,
633
+ "default": {
634
+ "quantity": 0,
635
+ "unit": 0
636
+ },
637
+ "deprecateAliases": true
638
+ },
639
+ "api-version": {
640
+ "name": "api-version",
641
+ "type": "option",
642
+ "description": "Override the api version used for api requests made by this command",
643
+ "multiple": false,
644
+ "deprecateAliases": true
645
+ },
646
+ "loglevel": {
647
+ "name": "loglevel",
648
+ "type": "option",
649
+ "hidden": true,
650
+ "multiple": false,
651
+ "deprecated": {
652
+ "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
653
+ },
654
+ "deprecateAliases": true
655
+ }
656
+ },
657
+ "args": {},
658
+ "hasDynamicHelp": true
659
+ },
573
660
  "data:export:tree": {
574
661
  "id": "data:export:tree",
575
662
  "summary": "Export data from an org into one or more JSON files.",
@@ -600,7 +687,7 @@
600
687
  "name": "target-org",
601
688
  "type": "option",
602
689
  "char": "o",
603
- "summary": "Username or alias of the target org.",
690
+ "summary": "Org alias or username to use for the target org.",
604
691
  "required": true,
605
692
  "multiple": false,
606
693
  "deprecateAliases": true,
@@ -700,7 +787,7 @@
700
787
  "name": "target-org",
701
788
  "type": "option",
702
789
  "char": "o",
703
- "summary": "Username or alias of the target org.",
790
+ "summary": "Org alias or username to use for the target org.",
704
791
  "required": true,
705
792
  "multiple": false,
706
793
  "deprecateAliases": true,
@@ -816,7 +903,7 @@
816
903
  "name": "target-org",
817
904
  "type": "option",
818
905
  "char": "o",
819
- "summary": "Username or alias of the target org.",
906
+ "summary": "Org alias or username to use for the target org.",
820
907
  "required": true,
821
908
  "multiple": false,
822
909
  "deprecateAliases": true,
@@ -922,8 +1009,7 @@
922
1009
  "name": "target-org",
923
1010
  "type": "option",
924
1011
  "char": "o",
925
- "summary": "Username or alias of the target org.",
926
- "required": true,
1012
+ "summary": "Org alias or username to use for the target org.",
927
1013
  "multiple": false,
928
1014
  "deprecateAliases": true,
929
1015
  "aliases": [
@@ -973,12 +1059,22 @@
973
1059
  "type": "option",
974
1060
  "char": "i",
975
1061
  "summary": "Job ID of the bulk query.",
976
- "required": true,
977
1062
  "multiple": false,
978
1063
  "deprecateAliases": true,
979
1064
  "aliases": [
980
1065
  "bulkqueryid"
981
1066
  ]
1067
+ },
1068
+ "use-most-recent": {
1069
+ "name": "use-most-recent",
1070
+ "type": "boolean",
1071
+ "char": "r",
1072
+ "summary": "Use the most recent bulk query ID from cache.",
1073
+ "allowNo": false,
1074
+ "exclusive": [
1075
+ "bulk-query-id"
1076
+ ],
1077
+ "deprecateAliases": true
982
1078
  }
983
1079
  },
984
1080
  "args": {},
@@ -1015,7 +1111,7 @@
1015
1111
  "name": "target-org",
1016
1112
  "type": "option",
1017
1113
  "char": "o",
1018
- "summary": "Username or alias of the target org.",
1114
+ "summary": "Org alias or username to use for the target org.",
1019
1115
  "required": true,
1020
1116
  "multiple": false,
1021
1117
  "deprecateAliases": true,
@@ -1112,37 +1208,224 @@
1112
1208
  },
1113
1209
  "data:upsert:bulk": {
1114
1210
  "id": "data:upsert:bulk",
1115
- "summary": "Bulk upsert records to an org from a CSV file.",
1116
- "description": "An upsert refers to inserting a record into a Salesforce object if the record doesn't already exist, or updating it if it does exist.\n\nWhen you execute this command, it starts a job and one or more batches, displays their IDs, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job and batch IDs to check the status of the job with the \"<%= config.bin %> data resume\" command. A single job can contain many batches, depending on the length of the CSV file.\n\nSee \"Prepare CSV Files\" in the Bulk API Developer Guide for details on formatting your CSV file. (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm)\n\nBy default, the job runs the batches in parallel, which we recommend. You can run jobs serially by specifying the --serial flag. But don't process data in serial mode unless you know this would otherwise result in lock timeouts and you can't reorganize your batches to avoid the locks.",
1211
+ "summary": "Bulk upsert records to an org from a CSV file. Uses Bulk API 2.0.",
1212
+ "description": "An upsert refers to inserting a record into a Salesforce object if the record doesn't already exist, or updating it if it does exist.\n\nWhen you execute this command, it starts a job, displays the ID, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job and batch IDs to check the status of the job with the \"<%= config.bin %> data upsert resume\" command.\n\nSee \"Prepare CSV Files\" in the Bulk API Developer Guide for details on formatting your CSV file. (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_prepare_csv.htm)",
1117
1213
  "strict": true,
1118
1214
  "pluginName": "@salesforce/plugin-data",
1119
1215
  "pluginAlias": "@salesforce/plugin-data",
1120
1216
  "pluginType": "core",
1121
- "aliases": [
1122
- "force:data:bulk:upsert"
1217
+ "aliases": [],
1218
+ "examples": [
1219
+ "Bulk upsert records to the Contact object in your default org:\n<%= config.bin %> <%= command.id %> --sobject Contact --file files/contacts.csv --external-id Id",
1220
+ "Bulk upsert records to a custom object in an org with alias my-scratch and wait 5 minutes for the command to complete:\n<%= config.bin %> <%= command.id %> --sobject MyObject**c --file files/file.csv --external-id MyField**c --wait 5 --target-org my-scratch"
1123
1221
  ],
1222
+ "flags": {
1223
+ "json": {
1224
+ "name": "json",
1225
+ "type": "boolean",
1226
+ "description": "Format output as json.",
1227
+ "helpGroup": "GLOBAL",
1228
+ "allowNo": false
1229
+ },
1230
+ "target-org": {
1231
+ "name": "target-org",
1232
+ "type": "option",
1233
+ "char": "o",
1234
+ "summary": "Org alias or username to use for the target org.",
1235
+ "required": true,
1236
+ "multiple": false,
1237
+ "aliases": [
1238
+ "targetusername",
1239
+ "u"
1240
+ ]
1241
+ },
1242
+ "api-version": {
1243
+ "name": "api-version",
1244
+ "type": "option",
1245
+ "description": "Override the api version used for api requests made by this command",
1246
+ "multiple": false,
1247
+ "aliases": [
1248
+ "apiversion"
1249
+ ]
1250
+ },
1251
+ "loglevel": {
1252
+ "name": "loglevel",
1253
+ "type": "option",
1254
+ "hidden": true,
1255
+ "multiple": false,
1256
+ "deprecated": {
1257
+ "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
1258
+ }
1259
+ },
1260
+ "file": {
1261
+ "name": "file",
1262
+ "type": "option",
1263
+ "char": "f",
1264
+ "summary": "CSV file that contains the IDs of the records to delete.",
1265
+ "required": true,
1266
+ "multiple": false,
1267
+ "aliases": [
1268
+ "csvfile"
1269
+ ]
1270
+ },
1271
+ "sobject": {
1272
+ "name": "sobject",
1273
+ "type": "option",
1274
+ "char": "s",
1275
+ "summary": "API name of the Salesforce object, either standard or custom, that you want to delete records from.",
1276
+ "required": true,
1277
+ "multiple": false,
1278
+ "aliases": [
1279
+ "sobjecttype"
1280
+ ]
1281
+ },
1282
+ "wait": {
1283
+ "name": "wait",
1284
+ "type": "option",
1285
+ "char": "w",
1286
+ "summary": "Number of minutes to wait for the command to complete before displaying the results.",
1287
+ "multiple": false,
1288
+ "exclusive": [
1289
+ "async"
1290
+ ],
1291
+ "default": {
1292
+ "quantity": 0,
1293
+ "unit": 0
1294
+ }
1295
+ },
1296
+ "async": {
1297
+ "name": "async",
1298
+ "type": "boolean",
1299
+ "char": "a",
1300
+ "summary": "Run the command asynchronously.",
1301
+ "allowNo": false,
1302
+ "exclusive": [
1303
+ "wait"
1304
+ ]
1305
+ },
1306
+ "external-id": {
1307
+ "name": "external-id",
1308
+ "type": "option",
1309
+ "char": "i",
1310
+ "summary": "Name of the external ID field, or the Id field.",
1311
+ "required": true,
1312
+ "multiple": false,
1313
+ "aliases": [
1314
+ "externalid"
1315
+ ]
1316
+ }
1317
+ },
1318
+ "args": {},
1319
+ "hasDynamicHelp": true
1320
+ },
1321
+ "data:upsert:resume": {
1322
+ "id": "data:upsert:resume",
1323
+ "summary": "Resume a bulk upsert job that you previously started. Uses Bulk API 2.0.",
1324
+ "description": "The command uses the job ID returned from the \"<%= config.bin %> data upsert bulk\" command or the most recently-run bulk upsert job.",
1325
+ "strict": true,
1326
+ "pluginName": "@salesforce/plugin-data",
1327
+ "pluginAlias": "@salesforce/plugin-data",
1328
+ "pluginType": "core",
1329
+ "aliases": [],
1124
1330
  "examples": [
1125
- "Bulk upsert records to the Contact object:\n<%= config.bin %> --sobject Contact --file files/contacts.csv --external-id Id",
1126
- "Bulk upsert records to a custom object and wait 5 minutes for the command to complete:\n<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/file.csv --external-id MyField__c --wait 5"
1331
+ "Resume a bulk upsert job from your default org using an ID:\n<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA",
1332
+ "Resume the most recently run bulk upsert job for an org with alias my-scratch:\n<%= config.bin %> <%= command.id %> --use-most-recent --target-org my-scratch"
1127
1333
  ],
1128
- "deprecateAliases": true,
1129
1334
  "flags": {
1130
1335
  "json": {
1131
1336
  "name": "json",
1132
1337
  "type": "boolean",
1133
1338
  "description": "Format output as json.",
1134
1339
  "helpGroup": "GLOBAL",
1340
+ "allowNo": false
1341
+ },
1342
+ "target-org": {
1343
+ "name": "target-org",
1344
+ "type": "option",
1345
+ "char": "o",
1346
+ "summary": "Org alias or username to use for the target org.",
1347
+ "multiple": false,
1348
+ "aliases": [
1349
+ "targetusername",
1350
+ "u"
1351
+ ]
1352
+ },
1353
+ "job-id": {
1354
+ "name": "job-id",
1355
+ "type": "option",
1356
+ "char": "i",
1357
+ "summary": "ID of the job you want to resume.",
1358
+ "multiple": false,
1359
+ "aliases": [
1360
+ "jobid"
1361
+ ]
1362
+ },
1363
+ "use-most-recent": {
1364
+ "name": "use-most-recent",
1365
+ "type": "boolean",
1366
+ "summary": "Use the ID of the most recently-run bulk job.",
1135
1367
  "allowNo": false,
1136
- "deprecateAliases": true
1368
+ "exclusive": [
1369
+ "job-id"
1370
+ ]
1371
+ },
1372
+ "wait": {
1373
+ "name": "wait",
1374
+ "type": "option",
1375
+ "summary": "Number of minutes to wait for the command to complete before displaying the results.",
1376
+ "multiple": false,
1377
+ "default": {
1378
+ "quantity": 0,
1379
+ "unit": 0
1380
+ }
1381
+ },
1382
+ "api-version": {
1383
+ "name": "api-version",
1384
+ "type": "option",
1385
+ "description": "Override the api version used for api requests made by this command",
1386
+ "multiple": false
1387
+ },
1388
+ "loglevel": {
1389
+ "name": "loglevel",
1390
+ "type": "option",
1391
+ "hidden": true,
1392
+ "multiple": false,
1393
+ "deprecated": {
1394
+ "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
1395
+ }
1396
+ }
1397
+ },
1398
+ "args": {},
1399
+ "hasDynamicHelp": true
1400
+ },
1401
+ "force:data:bulk:delete": {
1402
+ "id": "force:data:bulk:delete",
1403
+ "summary": "Bulk delete records from an org using a CSV file. Uses Bulk API 1.0.",
1404
+ "description": "The CSV file must have only one column (\"Id\") and then the list of record IDs you want to delete, one ID per line.\n\nWhen you execute this command, it starts a job and one or more batches, displays their IDs, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job and batch IDs to check the status of the job with the \"<%= config.bin %> force data bulk status\" command. A single job can contain many batches, depending on the length of the CSV file.",
1405
+ "strict": true,
1406
+ "pluginName": "@salesforce/plugin-data",
1407
+ "pluginAlias": "@salesforce/plugin-data",
1408
+ "pluginType": "core",
1409
+ "aliases": [],
1410
+ "examples": [
1411
+ "Bulk delete Account records from your default org using the list of IDs in the \"files/delete.csv\" file:\n<%= config.bin %> <%= command.id %> --sobject Account --file files/delete.csv",
1412
+ "Bulk delete records from a custom object in an org with alias my-scratch and wait 5 minutes for the command to complete:\n<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/delete.csv --wait 5 --target-org my-scratch"
1413
+ ],
1414
+ "flags": {
1415
+ "json": {
1416
+ "name": "json",
1417
+ "type": "boolean",
1418
+ "description": "Format output as json.",
1419
+ "helpGroup": "GLOBAL",
1420
+ "allowNo": false
1137
1421
  },
1138
1422
  "target-org": {
1139
1423
  "name": "target-org",
1140
1424
  "type": "option",
1141
1425
  "char": "o",
1142
- "summary": "Username or alias of the target org.",
1426
+ "summary": "Org alias or username to use for the target org.",
1143
1427
  "required": true,
1144
1428
  "multiple": false,
1145
- "deprecateAliases": true,
1146
1429
  "aliases": [
1147
1430
  "targetusername",
1148
1431
  "u"
@@ -1153,7 +1436,6 @@
1153
1436
  "type": "option",
1154
1437
  "description": "Override the api version used for api requests made by this command",
1155
1438
  "multiple": false,
1156
- "deprecateAliases": true,
1157
1439
  "aliases": [
1158
1440
  "apiversion"
1159
1441
  ]
@@ -1165,8 +1447,171 @@
1165
1447
  "multiple": false,
1166
1448
  "deprecated": {
1167
1449
  "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
1168
- },
1169
- "deprecateAliases": true
1450
+ }
1451
+ },
1452
+ "file": {
1453
+ "name": "file",
1454
+ "type": "option",
1455
+ "char": "f",
1456
+ "summary": "CSV file that contains the IDs of the records to delete.",
1457
+ "required": true,
1458
+ "multiple": false,
1459
+ "aliases": [
1460
+ "csvfile"
1461
+ ]
1462
+ },
1463
+ "sobject": {
1464
+ "name": "sobject",
1465
+ "type": "option",
1466
+ "char": "s",
1467
+ "summary": "API name of the Salesforce object, either standard or custom, that you want to delete records from.",
1468
+ "required": true,
1469
+ "multiple": false,
1470
+ "aliases": [
1471
+ "sobjecttype"
1472
+ ]
1473
+ },
1474
+ "wait": {
1475
+ "name": "wait",
1476
+ "type": "option",
1477
+ "char": "w",
1478
+ "summary": "Number of minutes to wait for the command to complete before displaying the results.",
1479
+ "multiple": false,
1480
+ "default": {
1481
+ "quantity": 0,
1482
+ "unit": 0
1483
+ }
1484
+ }
1485
+ },
1486
+ "args": {},
1487
+ "hasDynamicHelp": true
1488
+ },
1489
+ "force:data:bulk:status": {
1490
+ "id": "force:data:bulk:status",
1491
+ "summary": "View the status of a bulk data load job or batch. Uses Bulk API 1.0.",
1492
+ "description": "Run this command using the job ID or batch ID returned from the \"<%= config.bin %> force data bulk delete\" or \"<%= config.bin %> force data bulk upsert\" commands.",
1493
+ "strict": true,
1494
+ "pluginName": "@salesforce/plugin-data",
1495
+ "pluginAlias": "@salesforce/plugin-data",
1496
+ "pluginType": "core",
1497
+ "aliases": [],
1498
+ "examples": [
1499
+ "View the status of a bulk load job in your default org:\n<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA",
1500
+ "View the status of a bulk load job and a specific batches in an org with alias my-scratch:\n<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA --batch-id 751xx000000005nAAA --target-org my-scratch"
1501
+ ],
1502
+ "flags": {
1503
+ "json": {
1504
+ "name": "json",
1505
+ "type": "boolean",
1506
+ "description": "Format output as json.",
1507
+ "helpGroup": "GLOBAL",
1508
+ "allowNo": false
1509
+ },
1510
+ "target-org": {
1511
+ "name": "target-org",
1512
+ "type": "option",
1513
+ "char": "o",
1514
+ "summary": "Org alias or username to use for the target org.",
1515
+ "required": true,
1516
+ "multiple": false,
1517
+ "aliases": [
1518
+ "targetusername",
1519
+ "u"
1520
+ ]
1521
+ },
1522
+ "api-version": {
1523
+ "name": "api-version",
1524
+ "type": "option",
1525
+ "description": "Override the api version used for api requests made by this command",
1526
+ "multiple": false,
1527
+ "aliases": [
1528
+ "apiversion"
1529
+ ]
1530
+ },
1531
+ "loglevel": {
1532
+ "name": "loglevel",
1533
+ "type": "option",
1534
+ "hidden": true,
1535
+ "multiple": false,
1536
+ "deprecated": {
1537
+ "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
1538
+ }
1539
+ },
1540
+ "batch-id": {
1541
+ "name": "batch-id",
1542
+ "type": "option",
1543
+ "char": "b",
1544
+ "summary": "ID of the batch whose status you want to view; you must also specify the job ID.",
1545
+ "multiple": false,
1546
+ "aliases": [
1547
+ "batchid"
1548
+ ]
1549
+ },
1550
+ "job-id": {
1551
+ "name": "job-id",
1552
+ "type": "option",
1553
+ "char": "i",
1554
+ "summary": "ID of the job whose status you want to view.",
1555
+ "required": true,
1556
+ "multiple": false,
1557
+ "aliases": [
1558
+ "jobid"
1559
+ ]
1560
+ }
1561
+ },
1562
+ "args": {},
1563
+ "hasDynamicHelp": true
1564
+ },
1565
+ "force:data:bulk:upsert": {
1566
+ "id": "force:data:bulk:upsert",
1567
+ "summary": "Bulk upsert records to an org from a CSV file. Uses Bulk API 1.0.",
1568
+ "description": "An upsert refers to inserting a record into a Salesforce object if the record doesn't already exist, or updating it if it does exist.\n\nWhen you execute this command, it starts a job and one or more batches, displays their IDs, and then immediately returns control of the terminal to you by default. If you prefer to wait, set the --wait flag to the number of minutes; if it times out, the command outputs the IDs. Use the job and batch IDs to check the status of the job with the \"<%= config.bin %> force data bulk status\" command. A single job can contain many batches, depending on the length of the CSV file.\n\nSee \"Prepare CSV Files\" in the Bulk API Developer Guide for details on formatting your CSV file. (https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_csv_preparing.htm)\n\nBy default, the job runs the batches in parallel, which we recommend. You can run jobs serially by specifying the --serial flag. But don't process data in serial mode unless you know this would otherwise result in lock timeouts and you can't reorganize your batches to avoid the locks.",
1569
+ "strict": true,
1570
+ "pluginName": "@salesforce/plugin-data",
1571
+ "pluginAlias": "@salesforce/plugin-data",
1572
+ "pluginType": "core",
1573
+ "aliases": [],
1574
+ "examples": [
1575
+ "Bulk upsert records to the Contact object in your default org:\n<%= config.bin %> --sobject Contact --file files/contacts.csv --external-id Id",
1576
+ "Bulk upsert records to a custom object in an org with alias my-scratch and wait 5 minutes for the command to complete:\n<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/file.csv --external-id MyField__c --wait 5 --target-org my-scratch"
1577
+ ],
1578
+ "flags": {
1579
+ "json": {
1580
+ "name": "json",
1581
+ "type": "boolean",
1582
+ "description": "Format output as json.",
1583
+ "helpGroup": "GLOBAL",
1584
+ "allowNo": false
1585
+ },
1586
+ "target-org": {
1587
+ "name": "target-org",
1588
+ "type": "option",
1589
+ "char": "o",
1590
+ "summary": "Org alias or username to use for the target org.",
1591
+ "required": true,
1592
+ "multiple": false,
1593
+ "aliases": [
1594
+ "targetusername",
1595
+ "u"
1596
+ ]
1597
+ },
1598
+ "api-version": {
1599
+ "name": "api-version",
1600
+ "type": "option",
1601
+ "description": "Override the api version used for api requests made by this command",
1602
+ "multiple": false,
1603
+ "aliases": [
1604
+ "apiversion"
1605
+ ]
1606
+ },
1607
+ "loglevel": {
1608
+ "name": "loglevel",
1609
+ "type": "option",
1610
+ "hidden": true,
1611
+ "multiple": false,
1612
+ "deprecated": {
1613
+ "message": "The loglevel flag is no longer in use on this command. You may use it without error, but it will be ignored.\nSet the log level using the `SFDX_LOG_LEVEL` environment variable."
1614
+ }
1170
1615
  },
1171
1616
  "external-id": {
1172
1617
  "name": "external-id",
@@ -1175,7 +1620,6 @@
1175
1620
  "summary": "Name of the external ID field, or the Id field.",
1176
1621
  "required": true,
1177
1622
  "multiple": false,
1178
- "deprecateAliases": true,
1179
1623
  "aliases": [
1180
1624
  "externalid"
1181
1625
  ]
@@ -1187,7 +1631,6 @@
1187
1631
  "summary": "CSV file that contains the records to upsert.",
1188
1632
  "required": true,
1189
1633
  "multiple": false,
1190
- "deprecateAliases": true,
1191
1634
  "aliases": [
1192
1635
  "csvfile"
1193
1636
  ]
@@ -1199,7 +1642,6 @@
1199
1642
  "summary": "API name of the Salesforce object, either standard or custom, that you want to upsert records to.",
1200
1643
  "required": true,
1201
1644
  "multiple": false,
1202
- "deprecateAliases": true,
1203
1645
  "aliases": [
1204
1646
  "sobjecttype"
1205
1647
  ]
@@ -1213,16 +1655,14 @@
1213
1655
  "default": {
1214
1656
  "quantity": 0,
1215
1657
  "unit": 0
1216
- },
1217
- "deprecateAliases": true
1658
+ }
1218
1659
  },
1219
1660
  "serial": {
1220
1661
  "name": "serial",
1221
1662
  "type": "boolean",
1222
1663
  "char": "r",
1223
1664
  "summary": "Run batches in serial mode.",
1224
- "allowNo": false,
1225
- "deprecateAliases": true
1665
+ "allowNo": false
1226
1666
  }
1227
1667
  },
1228
1668
  "args": {},