@salesforce/plugin-data 2.1.21 → 2.1.23

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 (109) hide show
  1. package/README.md +947 -320
  2. package/lib/api/data/tree/exportApi.js +66 -73
  3. package/lib/api/data/tree/exportApi.js.map +1 -1
  4. package/lib/api/data/tree/importApi.js +62 -62
  5. package/lib/api/data/tree/importApi.js.map +1 -1
  6. package/lib/batcher.js +80 -101
  7. package/lib/batcher.js.map +1 -1
  8. package/lib/commands/data/create/record.js +64 -0
  9. package/lib/commands/data/create/record.js.map +1 -0
  10. package/lib/commands/data/delete/bulk.js +78 -0
  11. package/lib/commands/data/delete/bulk.js.map +1 -0
  12. package/lib/commands/data/delete/record.js +83 -0
  13. package/lib/commands/data/delete/record.js.map +1 -0
  14. package/lib/commands/data/export/tree.js +57 -0
  15. package/lib/commands/data/export/tree.js.map +1 -0
  16. package/lib/commands/data/get/record.js +73 -0
  17. package/lib/commands/data/get/record.js.map +1 -0
  18. package/lib/commands/data/import/tree.js +85 -0
  19. package/lib/commands/data/import/tree.js.map +1 -0
  20. package/lib/commands/data/query/resume.js +55 -0
  21. package/lib/commands/data/query/resume.js.map +1 -0
  22. package/lib/commands/data/query.js +283 -0
  23. package/lib/commands/data/query.js.map +1 -0
  24. package/lib/commands/data/resume.js +64 -0
  25. package/lib/commands/data/resume.js.map +1 -0
  26. package/lib/commands/data/update/record.js +101 -0
  27. package/lib/commands/data/update/record.js.map +1 -0
  28. package/lib/commands/data/upsert/bulk.js +88 -0
  29. package/lib/commands/data/upsert/bulk.js.map +1 -0
  30. package/lib/dataCommand.js +103 -202
  31. package/lib/dataCommand.js.map +1 -1
  32. package/lib/dataSoqlQueryTypes.js +2 -6
  33. package/lib/dataSoqlQueryTypes.js.map +1 -1
  34. package/lib/flags.js +27 -0
  35. package/lib/flags.js.map +1 -0
  36. package/lib/reporters.js +58 -66
  37. package/lib/reporters.js.map +1 -1
  38. package/messages/batcher.md +39 -0
  39. package/messages/bulk.delete.md +31 -0
  40. package/messages/bulk.report.md +17 -0
  41. package/messages/bulk.status.md +29 -0
  42. package/messages/bulk.upsert.md +43 -0
  43. package/messages/exportApi.md +25 -0
  44. package/messages/importApi.md +52 -0
  45. package/messages/messages.md +20 -0
  46. package/messages/record.create.md +45 -0
  47. package/messages/record.delete.md +53 -0
  48. package/messages/record.get.md +47 -0
  49. package/messages/record.update.md +61 -0
  50. package/messages/soql.query.md +72 -0
  51. package/messages/tree.export.md +41 -0
  52. package/messages/tree.import.md +37 -0
  53. package/oclif.manifest.json +1233 -1
  54. package/package.json +55 -56
  55. package/lib/api/data/tree/exportApi.d.ts +0 -77
  56. package/lib/api/data/tree/importApi.d.ts +0 -60
  57. package/lib/batcher.d.ts +0 -79
  58. package/lib/commands/force/data/bulk/delete.d.ts +0 -11
  59. package/lib/commands/force/data/bulk/delete.js +0 -58
  60. package/lib/commands/force/data/bulk/delete.js.map +0 -1
  61. package/lib/commands/force/data/bulk/status.d.ts +0 -11
  62. package/lib/commands/force/data/bulk/status.js +0 -61
  63. package/lib/commands/force/data/bulk/status.js.map +0 -1
  64. package/lib/commands/force/data/bulk/upsert.d.ts +0 -11
  65. package/lib/commands/force/data/bulk/upsert.js +0 -76
  66. package/lib/commands/force/data/bulk/upsert.js.map +0 -1
  67. package/lib/commands/force/data/record/create.d.ts +0 -10
  68. package/lib/commands/force/data/record/create.js +0 -58
  69. package/lib/commands/force/data/record/create.js.map +0 -1
  70. package/lib/commands/force/data/record/delete.d.ts +0 -10
  71. package/lib/commands/force/data/record/delete.js +0 -72
  72. package/lib/commands/force/data/record/delete.js.map +0 -1
  73. package/lib/commands/force/data/record/get.d.ts +0 -10
  74. package/lib/commands/force/data/record/get.js +0 -65
  75. package/lib/commands/force/data/record/get.js.map +0 -1
  76. package/lib/commands/force/data/record/update.d.ts +0 -10
  77. package/lib/commands/force/data/record/update.js +0 -90
  78. package/lib/commands/force/data/record/update.js.map +0 -1
  79. package/lib/commands/force/data/soql/bulk/report.d.ts +0 -9
  80. package/lib/commands/force/data/soql/bulk/report.js +0 -45
  81. package/lib/commands/force/data/soql/bulk/report.js.map +0 -1
  82. package/lib/commands/force/data/soql/query.d.ts +0 -64
  83. package/lib/commands/force/data/soql/query.js +0 -300
  84. package/lib/commands/force/data/soql/query.js.map +0 -1
  85. package/lib/commands/force/data/tree/export.d.ts +0 -10
  86. package/lib/commands/force/data/tree/export.js +0 -52
  87. package/lib/commands/force/data/tree/export.js.map +0 -1
  88. package/lib/commands/force/data/tree/import.d.ts +0 -19
  89. package/lib/commands/force/data/tree/import.js +0 -81
  90. package/lib/commands/force/data/tree/import.js.map +0 -1
  91. package/lib/dataCommand.d.ts +0 -57
  92. package/lib/dataSoqlQueryTypes.d.ts +0 -63
  93. package/lib/index.d.ts +0 -2
  94. package/lib/reporters.d.ts +0 -57
  95. package/messages/batcher.json +0 -12
  96. package/messages/bulk.delete.json +0 -12
  97. package/messages/bulk.report.json +0 -7
  98. package/messages/bulk.status.json +0 -12
  99. package/messages/bulk.upsert.json +0 -14
  100. package/messages/exportApi.json +0 -8
  101. package/messages/importApi.json +0 -16
  102. package/messages/messages.json +0 -11
  103. package/messages/record.create.json +0 -15
  104. package/messages/record.delete.json +0 -16
  105. package/messages/record.get.json +0 -14
  106. package/messages/record.update.json +0 -18
  107. package/messages/soql.query.json +0 -26
  108. package/messages/tree.export.json +0 -11
  109. package/messages/tree.import.json +0 -13
@@ -0,0 +1,47 @@
1
+ # summary
2
+
3
+ Retrieve and display a single record of a Salesforce or Tooling API object.
4
+
5
+ # description
6
+
7
+ Specify the record you want to retrieve with either its ID or with a list of field-value pairs that identify the record. If your list of fields identifies more than one record, the command fails; the error displays how many records were found.
8
+
9
+ When specifying field-value pairs, use the format <fieldName>=<value>. Enclose all field-value pairs in one set of double quotation marks, delimited by spaces. Enclose values that contain spaces in single quotes.
10
+
11
+ The command displays all the record's fields and their values, one field per terminal line. Fields with no values are displayed as "null".
12
+
13
+ This command retrieves a record from Salesforce objects by default. Use the --use-tooling-api flag to retrieve from a Tooling API object.
14
+
15
+ # flags.sobject
16
+
17
+ API name of the Salesforce or Tooling API object that you're retrieving a record from.
18
+
19
+ # flags.recordId
20
+
21
+ ID of the record you’re retrieving.
22
+
23
+ # flags.where
24
+
25
+ List of <fieldName>=<value> pairs that identify the record you want to display.
26
+
27
+ # flags.useToolingApi
28
+
29
+ Use Tooling API so you can retrieve a record from a Tooling API object.
30
+
31
+ # examples
32
+
33
+ - Retrieve and display a record from Account with the specified (truncated) ID:
34
+
35
+ <%= config.bin %> <%= command.id %> --sobject Account --record-id 00180XX
36
+
37
+ - Retrieve a record from Account whose name equals "Acme":
38
+
39
+ <%= config.bin %> <%= command.id %> --sobject Account --where "Name=Acme"
40
+
41
+ - Retrieve a record from Account identified with two field values, one that contains a space; the command uses the org with alias "my-scratch":
42
+
43
+ <%= config.bin %> <%= command.id %> --sobject Account --where "Name='Universal Containers' Phone='(123) 456-7890'" --target-org myscratch
44
+
45
+ - Retrieve a record from the Tooling API object TraceFlag with the specified (truncated) ID:
46
+
47
+ <%= config.bin %> <%= command.id %> --use-tooling-api --sobject TraceFlag --record-id 7tf8c
@@ -0,0 +1,61 @@
1
+ # summary
2
+
3
+ Updates a single record of a Salesforce or Tooling API object.
4
+
5
+ # description
6
+
7
+ Specify the record you want to update with either its ID or with a list of field-value pairs that identify the record. If your list of fields identifies more than one record, the delete fails; the error displays how many records were found.
8
+
9
+ When using field-value pairs for both identifying the record and specifiyng the new field values, use the format <fieldName>=<value>. Enclose all field-value pairs in one set of double quotation marks, delimited by spaces. Enclose values that contain spaces in single quotes.
10
+
11
+ This command updates a record in Salesforce objects by default. Use the --use-tooling-api flag to update a Tooling API object.
12
+
13
+ # flags.sobject
14
+
15
+ API name of the Salesforce or Tooling API object that contains the record you're updating.
16
+
17
+ # flags.recordId
18
+
19
+ ID of the record you’re updating.
20
+
21
+ # flags.where
22
+
23
+ List of <fieldName>=<value> pairs that identify the record you want to update.
24
+
25
+ # flags.useToolingApi
26
+
27
+ Use Tooling API so you can update a record in a Tooling API object.
28
+
29
+ # flags.values
30
+
31
+ Fields that you're updating, in the format of <fieldName>=<value> pairs.
32
+
33
+ # examples
34
+
35
+ - Update the Name field of an Account record with the specified (truncated) ID:
36
+
37
+ <%= config.bin %> <%= command.id %> --sobject Account --record-id 001D0 --values "Name=NewAcme"
38
+
39
+ - Update the Name field of an Account record whose current name is 'Old Acme':
40
+
41
+ <%= config.bin %> <%= command.id %> --sobject Account --where "Name='Old Acme'" --values "Name='New Acme'"
42
+
43
+ - Update the Name and Website fields of an Account record with the specified (truncated) ID:
44
+
45
+ <%= config.bin %> <%= command.id %> --sobject Account --record-id 001D0 --values "Name='Acme III' Website=www.example.com"
46
+
47
+ - Update the ExpirationDate field of a record of the Tooling API object TraceFlag using the specified (truncated) ID:
48
+
49
+ <%= config.bin %> <%= command.id %> -t --sobject TraceFlag --record-id 7tf170000009cUBAAY --values "ExpirationDate=2017-12-01T00:58:04.000+0000"
50
+
51
+ # updateSuccess
52
+
53
+ Successfully updated record: %s.
54
+
55
+ # updateFailure
56
+
57
+ Failed to update record. %s
58
+
59
+ # updateFailureWithFields
60
+
61
+ Failed to update record with code %s. Message: %s. Fields: %s.
@@ -0,0 +1,72 @@
1
+ # summary
2
+
3
+ Execute a SOQL query.
4
+
5
+ # description
6
+
7
+ Specify the SOQL query at the command line with the --query flag or read the query from a file with the --file flag.
8
+
9
+ If your query returns more than 10,000 records, specify the --bulk flag. The command then runs the query using Bulk API 2.0, which has higher limits than the default API used by the command.
10
+
11
+ When using --bulk, the command waits 3 minutes by default for the query to complete. Use the --wait parameter to specify a different number of minutes to wait, or set --wait to 0 to immediately return control to the terminal. If you set --wait to 0, or you use the --async flag, or the command simply times out, the command displays an ID. Pass this ID to the the "data query resume" command using the --bulk-query-id flag to get the results; pass the ID to the "data resume" command to get the job status.
12
+
13
+ # examples
14
+
15
+ - Specify a SOQL query at the command line; the command uses your default org:
16
+
17
+ <%= config.bin %> <%= command.id %> --query "SELECT Id, Name, Account.Name FROM Contact"
18
+
19
+ - Read the SOQL query from a file called "query.txt"; the command uses the org with alias "my-scratch":
20
+
21
+ <%= config.bin %> <%= command.id %> --file query.txt --target-org my-scratch
22
+
23
+ - Use Tooling API to run a query on the ApexTrigger Tooling API object:
24
+
25
+ <%= config.bin %> <%= command.id %> --query "SELECT Name FROM ApexTrigger" --use-tooling-api
26
+
27
+ - Use Bulk API 2.0 to run a query that returns many rows, and return control to the terminal immediately:
28
+
29
+ <%= config.bin %> <%= command.id %> --query "SELECT Id FROM Contact" --bulk --wait 0
30
+
31
+ # flags.queryToExecute
32
+
33
+ SOQL query to execute.
34
+
35
+ # flags.useToolingApi
36
+
37
+ Use Tooling API so you can run queries on Tooling API objects.
38
+
39
+ # flags.file
40
+
41
+ File that contains the SOQL query.
42
+
43
+ # flags.bulk
44
+
45
+ Use Bulk API 2.0 to run the query.
46
+
47
+ # flags.async
48
+
49
+ Use Bulk API 2.0, but don't wait for the job to complete.
50
+
51
+ # flags.wait
52
+
53
+ Time to wait for the command to finish, in minutes.
54
+
55
+ # flags.resultFormat
56
+
57
+ Format to display the results; the --json flag overrides this flag.
58
+
59
+ # displayQueryRecordsRetrieved
60
+
61
+ Total number of records retrieved: %s.
62
+
63
+ # queryRunningMessage
64
+
65
+ Querying Data
66
+
67
+ # bulkQueryTimeout
68
+
69
+ Query ID: %s
70
+ Query is in progress.
71
+
72
+ Run "data query resume -i %s -o %s" to get the latest status and results.
@@ -0,0 +1,41 @@
1
+ # summary
2
+
3
+ Export data from an org into one or more JSON files.
4
+
5
+ # description
6
+
7
+ Specify a SOQL query, either directly at the command line or read from a file, to retrieve the data you want to export. The exported data is written to JSON files in sObject tree format, which is a collection of nested, parent-child records with a single root record. Use these JSON files to import data into an org with the "<%= config.bin %> data import tree" command.
8
+
9
+ If your SOQL query references multiple objects, the command generates a single JSON file by default. You can specify the --plan flag to generate separate JSON files for each object and a plan definition file that aggregates them. You then specify just this plan definition file when you import the data into an org.
10
+
11
+ The SOQL query can return a maximum of 2,000 records. For more information, see the REST API Developer Guide. (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobject_tree.htm).
12
+
13
+ # flags.query
14
+
15
+ SOQL query, or filepath of a file that contains the query, to retrieve records.
16
+
17
+ # flags.plan
18
+
19
+ Generate multiple sObject tree files and a plan definition file for aggregated import.
20
+
21
+ # flags.prefix
22
+
23
+ Prefix of generated files.
24
+
25
+ # flags.outputdir
26
+
27
+ Directory in which to generate the JSON files; default is current directory.
28
+
29
+ # examples
30
+
31
+ - Export records retrieved with the specified SOQL query into a single JSON file in the current directory; the command uses your default org:
32
+
33
+ <%= config.bin %> <%= command.id %> --query "SELECT Id, Name, (SELECT Name, Address__c FROM Properties__r) FROM Broker__c"
34
+
35
+ - Export data using a SOQL query in the "query.txt" file and generate JSON files for each object and a plan that aggregates them:
36
+
37
+ <%= config.bin %> <%= command.id %> --query query.txt --plan
38
+
39
+ - Prepend "export-demo" before each generated file and generate the files in the "export-out" directory; run the command on the org with alias "my-scratch":
40
+
41
+ <%= config.bin %> <%= command.id %> --query query.txt --plan --prefix export-demo --output-dir export-out --target-org my-scratch
@@ -0,0 +1,37 @@
1
+ # summary
2
+
3
+ Import data from one or more JSON files into an org.
4
+
5
+ # description
6
+
7
+ The JSON files that contain the data are in sObject tree format, which is a collection of nested, parent-child records with a single root record. Use the "<%= config.bin %> data export tree" command to generate these JSON files.
8
+
9
+ If you used the --plan flag when exporting the data to generate a plan definition file, use the --plan flag to reference the file when you import. If you're not using a plan, use the --files flag to list the files. If you specify multiple JSON files that depend on each other in a parent-child relationship, be sure you list them in the correct order.
10
+
11
+ The sObject Tree API supports requests that contain up to 200 records. For more information, see the REST API Developer Guide. (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobject_tree.htm)
12
+
13
+ # flags.files
14
+
15
+ Comma-separated and in-order JSON files that contain the records, in sObject tree format, that you want to insert.
16
+
17
+ # flags.plan
18
+
19
+ Plan definition file to insert multiple data files.
20
+
21
+ # flags.contenttype
22
+
23
+ Content type of import files if their extention is not .json.
24
+
25
+ # flags.confighelp
26
+
27
+ Display schema information for the --plan configuration file to stdout; if you specify this flag, all other flags except --json are ignored.
28
+
29
+ # examples
30
+
31
+ - Import the records contained in two JSON files into the org with alias "my-scratch":
32
+
33
+ <%= config.bin %> <%= command.id %> --files Contact.json,Account.json --target-org my-scratch
34
+
35
+ - Import records using a plan definition file into your default org:
36
+
37
+ <%= config.bin %> <%= command.id %> --plan Account-Contact-plan.json