@salesforce/plugin-data 3.0.22 → 3.1.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 +119 -20
- package/lib/api/data/tree/exportApi.js.map +1 -1
- package/lib/api/data/tree/functions.js +12 -0
- package/lib/api/data/tree/functions.js.map +1 -0
- package/lib/api/data/tree/importApi.js.map +1 -1
- package/lib/api/data/tree/importCommon.js +46 -0
- package/lib/api/data/tree/importCommon.js.map +1 -0
- package/lib/api/data/tree/importFiles.js +55 -0
- package/lib/api/data/tree/importFiles.js.map +1 -0
- package/lib/api/data/tree/importPlan.js +164 -0
- package/lib/api/data/tree/importPlan.js.map +1 -0
- package/lib/api/data/tree/importTypes.js +2 -0
- package/lib/api/data/tree/importTypes.js.map +1 -0
- package/lib/bulkDataRequestCache.js +26 -15
- package/lib/bulkDataRequestCache.js.map +1 -1
- package/lib/bulkUtils.js +1 -2
- package/lib/bulkUtils.js.map +1 -1
- package/lib/commands/data/export/beta/tree.js +55 -0
- package/lib/commands/data/export/beta/tree.js.map +1 -0
- package/lib/commands/data/export/tree.js +1 -0
- package/lib/commands/data/export/tree.js.map +1 -1
- package/lib/commands/data/import/beta/tree.js +52 -0
- package/lib/commands/data/import/beta/tree.js.map +1 -0
- package/lib/commands/data/import/tree.js +4 -0
- package/lib/commands/data/import/tree.js.map +1 -1
- package/lib/dataSoqlQueryTypes.js +7 -0
- package/lib/dataSoqlQueryTypes.js.map +1 -1
- package/lib/export.js +249 -0
- package/lib/export.js.map +1 -0
- package/lib/flags.js +7 -0
- package/lib/flags.js.map +1 -1
- package/lib/reporters.js +0 -35
- package/lib/reporters.js.map +1 -1
- package/messages/importApi.md +32 -0
- package/messages/tree.export.md +5 -1
- package/messages/tree.import.beta.md +43 -0
- package/messages/tree.import.md +8 -0
- package/oclif.lock +344 -338
- package/oclif.manifest.json +267 -2
- package/package.json +7 -7
package/oclif.manifest.json
CHANGED
|
@@ -883,7 +883,7 @@
|
|
|
883
883
|
"deprecateAliases": true,
|
|
884
884
|
"description": "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.\n\nIf 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.\n\nThe 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).",
|
|
885
885
|
"examples": [
|
|
886
|
-
"Export records retrieved with the specified SOQL query into a single JSON file in the current directory; the command uses your default org:\n<%= config.bin %> <%= command.id %> --query \"SELECT Id, Name, (SELECT Name,
|
|
886
|
+
"Export records retrieved with the specified SOQL query into a single JSON file in the current directory; the command uses your default org:\n<%= config.bin %> <%= command.id %> --query \"SELECT Id, Name, (SELECT Name, Address\\_\\_c FROM Properties\\_\\_r) FROM Broker\\_\\_c\"",
|
|
887
887
|
"Export data using a SOQL query in the \"query.txt\" file and generate JSON files for each object and a plan that aggregates them:\n<%= config.bin %> <%= command.id %> --query query.txt --plan",
|
|
888
888
|
"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\":\n<%= config.bin %> <%= command.id %> --query query.txt --plan --prefix export-demo --output-dir export-out --target-org my-scratch"
|
|
889
889
|
],
|
|
@@ -1270,6 +1270,9 @@
|
|
|
1270
1270
|
],
|
|
1271
1271
|
"char": "c",
|
|
1272
1272
|
"deprecateAliases": true,
|
|
1273
|
+
"deprecated": {
|
|
1274
|
+
"message": "The `config-type` flag is deprecated and will be moved to a `legacy` command after July 10, 2024. It will be completely removed after Nov 10, 2024. Use the new `data tree beta import` command."
|
|
1275
|
+
},
|
|
1273
1276
|
"hidden": true,
|
|
1274
1277
|
"name": "content-type",
|
|
1275
1278
|
"summary": "Content type of import files if their extention is not .json.",
|
|
@@ -1282,6 +1285,10 @@
|
|
|
1282
1285
|
"confighelp"
|
|
1283
1286
|
],
|
|
1284
1287
|
"deprecateAliases": true,
|
|
1288
|
+
"deprecated": {
|
|
1289
|
+
"message": "The `config-help` flag is deprecated and will be moved to a `legacy` command after July 10, 2024. It will be completely removed after Nov 10, 2024. Use the new `data tree beta import` command."
|
|
1290
|
+
},
|
|
1291
|
+
"hidden": true,
|
|
1285
1292
|
"name": "config-help",
|
|
1286
1293
|
"summary": "Display schema information for the --plan configuration file to stdout; if you specify this flag, all other flags except --json are ignored.",
|
|
1287
1294
|
"allowNo": false,
|
|
@@ -2011,6 +2018,264 @@
|
|
|
2011
2018
|
"resume:upsert:data"
|
|
2012
2019
|
]
|
|
2013
2020
|
},
|
|
2021
|
+
"data:export:beta:tree": {
|
|
2022
|
+
"aliases": [],
|
|
2023
|
+
"args": {},
|
|
2024
|
+
"description": "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.\n\nIf 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.\n\nThe 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).",
|
|
2025
|
+
"examples": [
|
|
2026
|
+
"Export records retrieved with the specified SOQL query into a single JSON file in the current directory; the command uses your default org:\n<%= config.bin %> <%= command.id %> --query \"SELECT Id, Name, (SELECT Name, Address\\_\\_c FROM Properties\\_\\_r) FROM Broker\\_\\_c\"",
|
|
2027
|
+
"Export data using a SOQL query in the \"query.txt\" file and generate JSON files for each object and a plan that aggregates them:\n<%= config.bin %> <%= command.id %> --query query.txt --plan",
|
|
2028
|
+
"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\":\n<%= config.bin %> <%= command.id %> --query query.txt --plan --prefix export-demo --output-dir export-out --target-org my-scratch"
|
|
2029
|
+
],
|
|
2030
|
+
"flags": {
|
|
2031
|
+
"json": {
|
|
2032
|
+
"description": "Format output as json.",
|
|
2033
|
+
"helpGroup": "GLOBAL",
|
|
2034
|
+
"name": "json",
|
|
2035
|
+
"allowNo": false,
|
|
2036
|
+
"type": "boolean"
|
|
2037
|
+
},
|
|
2038
|
+
"target-org": {
|
|
2039
|
+
"aliases": [
|
|
2040
|
+
"targetusername",
|
|
2041
|
+
"u"
|
|
2042
|
+
],
|
|
2043
|
+
"char": "o",
|
|
2044
|
+
"deprecateAliases": true,
|
|
2045
|
+
"name": "target-org",
|
|
2046
|
+
"noCacheDefault": true,
|
|
2047
|
+
"required": true,
|
|
2048
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
2049
|
+
"hasDynamicHelp": true,
|
|
2050
|
+
"multiple": false,
|
|
2051
|
+
"type": "option"
|
|
2052
|
+
},
|
|
2053
|
+
"api-version": {
|
|
2054
|
+
"aliases": [
|
|
2055
|
+
"apiversion"
|
|
2056
|
+
],
|
|
2057
|
+
"deprecateAliases": true,
|
|
2058
|
+
"description": "Override the api version used for api requests made by this command",
|
|
2059
|
+
"name": "api-version",
|
|
2060
|
+
"hasDynamicHelp": false,
|
|
2061
|
+
"multiple": false,
|
|
2062
|
+
"type": "option"
|
|
2063
|
+
},
|
|
2064
|
+
"loglevel": {
|
|
2065
|
+
"deprecated": {
|
|
2066
|
+
"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."
|
|
2067
|
+
},
|
|
2068
|
+
"hidden": true,
|
|
2069
|
+
"name": "loglevel",
|
|
2070
|
+
"hasDynamicHelp": false,
|
|
2071
|
+
"multiple": false,
|
|
2072
|
+
"type": "option"
|
|
2073
|
+
},
|
|
2074
|
+
"query": {
|
|
2075
|
+
"char": "q",
|
|
2076
|
+
"name": "query",
|
|
2077
|
+
"required": true,
|
|
2078
|
+
"summary": "SOQL query, or filepath of a file that contains the query, to retrieve records.",
|
|
2079
|
+
"hasDynamicHelp": false,
|
|
2080
|
+
"multiple": false,
|
|
2081
|
+
"type": "option"
|
|
2082
|
+
},
|
|
2083
|
+
"plan": {
|
|
2084
|
+
"char": "p",
|
|
2085
|
+
"name": "plan",
|
|
2086
|
+
"summary": "Generate multiple sObject tree files and a plan definition file for aggregated import.",
|
|
2087
|
+
"allowNo": false,
|
|
2088
|
+
"type": "boolean"
|
|
2089
|
+
},
|
|
2090
|
+
"prefix": {
|
|
2091
|
+
"char": "x",
|
|
2092
|
+
"name": "prefix",
|
|
2093
|
+
"summary": "Prefix of generated files.",
|
|
2094
|
+
"hasDynamicHelp": false,
|
|
2095
|
+
"multiple": false,
|
|
2096
|
+
"type": "option"
|
|
2097
|
+
},
|
|
2098
|
+
"output-dir": {
|
|
2099
|
+
"aliases": [
|
|
2100
|
+
"outputdir"
|
|
2101
|
+
],
|
|
2102
|
+
"char": "d",
|
|
2103
|
+
"deprecateAliases": true,
|
|
2104
|
+
"name": "output-dir",
|
|
2105
|
+
"summary": "Directory in which to generate the JSON files; default is current directory.",
|
|
2106
|
+
"hasDynamicHelp": false,
|
|
2107
|
+
"multiple": false,
|
|
2108
|
+
"type": "option"
|
|
2109
|
+
}
|
|
2110
|
+
},
|
|
2111
|
+
"hasDynamicHelp": true,
|
|
2112
|
+
"hiddenAliases": [],
|
|
2113
|
+
"id": "data:export:beta:tree",
|
|
2114
|
+
"pluginAlias": "@salesforce/plugin-data",
|
|
2115
|
+
"pluginName": "@salesforce/plugin-data",
|
|
2116
|
+
"pluginType": "core",
|
|
2117
|
+
"state": "beta",
|
|
2118
|
+
"strict": true,
|
|
2119
|
+
"summary": "Export data from an org into one or more JSON files.",
|
|
2120
|
+
"enableJsonFlag": true,
|
|
2121
|
+
"isESM": true,
|
|
2122
|
+
"relativePath": [
|
|
2123
|
+
"lib",
|
|
2124
|
+
"commands",
|
|
2125
|
+
"data",
|
|
2126
|
+
"export",
|
|
2127
|
+
"beta",
|
|
2128
|
+
"tree.js"
|
|
2129
|
+
],
|
|
2130
|
+
"aliasPermutations": [],
|
|
2131
|
+
"permutations": [
|
|
2132
|
+
"data:export:beta:tree",
|
|
2133
|
+
"export:data:beta:tree",
|
|
2134
|
+
"export:beta:data:tree",
|
|
2135
|
+
"export:beta:tree:data",
|
|
2136
|
+
"data:beta:export:tree",
|
|
2137
|
+
"beta:data:export:tree",
|
|
2138
|
+
"beta:export:data:tree",
|
|
2139
|
+
"beta:export:tree:data",
|
|
2140
|
+
"data:beta:tree:export",
|
|
2141
|
+
"beta:data:tree:export",
|
|
2142
|
+
"beta:tree:data:export",
|
|
2143
|
+
"beta:tree:export:data",
|
|
2144
|
+
"data:export:tree:beta",
|
|
2145
|
+
"export:data:tree:beta",
|
|
2146
|
+
"export:tree:data:beta",
|
|
2147
|
+
"export:tree:beta:data",
|
|
2148
|
+
"data:tree:export:beta",
|
|
2149
|
+
"tree:data:export:beta",
|
|
2150
|
+
"tree:export:data:beta",
|
|
2151
|
+
"tree:export:beta:data",
|
|
2152
|
+
"data:tree:beta:export",
|
|
2153
|
+
"tree:data:beta:export",
|
|
2154
|
+
"tree:beta:data:export",
|
|
2155
|
+
"tree:beta:export:data"
|
|
2156
|
+
]
|
|
2157
|
+
},
|
|
2158
|
+
"data:import:beta:tree": {
|
|
2159
|
+
"aliases": [],
|
|
2160
|
+
"args": {},
|
|
2161
|
+
"description": "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.\n\nIf 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.",
|
|
2162
|
+
"examples": [
|
|
2163
|
+
"Import the records contained in two JSON files into the org with alias \"my-scratch\":\n<%= config.bin %> <%= command.id %> --files Contact.json,Account.json --target-org my-scratch",
|
|
2164
|
+
"Import records using a plan definition file into your default org:\n<%= config.bin %> <%= command.id %> --plan Account-Contact-plan.json"
|
|
2165
|
+
],
|
|
2166
|
+
"flags": {
|
|
2167
|
+
"json": {
|
|
2168
|
+
"description": "Format output as json.",
|
|
2169
|
+
"helpGroup": "GLOBAL",
|
|
2170
|
+
"name": "json",
|
|
2171
|
+
"allowNo": false,
|
|
2172
|
+
"type": "boolean"
|
|
2173
|
+
},
|
|
2174
|
+
"target-org": {
|
|
2175
|
+
"aliases": [
|
|
2176
|
+
"targetusername",
|
|
2177
|
+
"u"
|
|
2178
|
+
],
|
|
2179
|
+
"char": "o",
|
|
2180
|
+
"deprecateAliases": true,
|
|
2181
|
+
"name": "target-org",
|
|
2182
|
+
"noCacheDefault": true,
|
|
2183
|
+
"required": true,
|
|
2184
|
+
"summary": "Username or alias of the target org. Not required if the `target-org` configuration variable is already set.",
|
|
2185
|
+
"hasDynamicHelp": true,
|
|
2186
|
+
"multiple": false,
|
|
2187
|
+
"type": "option"
|
|
2188
|
+
},
|
|
2189
|
+
"api-version": {
|
|
2190
|
+
"aliases": [
|
|
2191
|
+
"apiversion"
|
|
2192
|
+
],
|
|
2193
|
+
"deprecateAliases": true,
|
|
2194
|
+
"description": "Override the api version used for api requests made by this command",
|
|
2195
|
+
"name": "api-version",
|
|
2196
|
+
"hasDynamicHelp": false,
|
|
2197
|
+
"multiple": false,
|
|
2198
|
+
"type": "option"
|
|
2199
|
+
},
|
|
2200
|
+
"loglevel": {
|
|
2201
|
+
"deprecated": {
|
|
2202
|
+
"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."
|
|
2203
|
+
},
|
|
2204
|
+
"hidden": true,
|
|
2205
|
+
"name": "loglevel",
|
|
2206
|
+
"hasDynamicHelp": false,
|
|
2207
|
+
"multiple": false,
|
|
2208
|
+
"type": "option"
|
|
2209
|
+
},
|
|
2210
|
+
"files": {
|
|
2211
|
+
"aliases": [
|
|
2212
|
+
"sobjecttreefiles"
|
|
2213
|
+
],
|
|
2214
|
+
"char": "f",
|
|
2215
|
+
"deprecateAliases": true,
|
|
2216
|
+
"name": "files",
|
|
2217
|
+
"summary": "Comma-separated and in-order JSON files that contain the records, in sObject tree format, that you want to insert.",
|
|
2218
|
+
"delimiter": ",",
|
|
2219
|
+
"hasDynamicHelp": false,
|
|
2220
|
+
"multiple": true,
|
|
2221
|
+
"type": "option"
|
|
2222
|
+
},
|
|
2223
|
+
"plan": {
|
|
2224
|
+
"char": "p",
|
|
2225
|
+
"name": "plan",
|
|
2226
|
+
"summary": "Plan definition file to insert multiple data files.",
|
|
2227
|
+
"hasDynamicHelp": false,
|
|
2228
|
+
"multiple": false,
|
|
2229
|
+
"type": "option"
|
|
2230
|
+
}
|
|
2231
|
+
},
|
|
2232
|
+
"hasDynamicHelp": true,
|
|
2233
|
+
"hiddenAliases": [],
|
|
2234
|
+
"id": "data:import:beta:tree",
|
|
2235
|
+
"pluginAlias": "@salesforce/plugin-data",
|
|
2236
|
+
"pluginName": "@salesforce/plugin-data",
|
|
2237
|
+
"pluginType": "core",
|
|
2238
|
+
"state": "beta",
|
|
2239
|
+
"strict": true,
|
|
2240
|
+
"summary": "Import data from one or more JSON files into an org.",
|
|
2241
|
+
"enableJsonFlag": true,
|
|
2242
|
+
"isESM": true,
|
|
2243
|
+
"relativePath": [
|
|
2244
|
+
"lib",
|
|
2245
|
+
"commands",
|
|
2246
|
+
"data",
|
|
2247
|
+
"import",
|
|
2248
|
+
"beta",
|
|
2249
|
+
"tree.js"
|
|
2250
|
+
],
|
|
2251
|
+
"aliasPermutations": [],
|
|
2252
|
+
"permutations": [
|
|
2253
|
+
"data:import:beta:tree",
|
|
2254
|
+
"import:data:beta:tree",
|
|
2255
|
+
"import:beta:data:tree",
|
|
2256
|
+
"import:beta:tree:data",
|
|
2257
|
+
"data:beta:import:tree",
|
|
2258
|
+
"beta:data:import:tree",
|
|
2259
|
+
"beta:import:data:tree",
|
|
2260
|
+
"beta:import:tree:data",
|
|
2261
|
+
"data:beta:tree:import",
|
|
2262
|
+
"beta:data:tree:import",
|
|
2263
|
+
"beta:tree:data:import",
|
|
2264
|
+
"beta:tree:import:data",
|
|
2265
|
+
"data:import:tree:beta",
|
|
2266
|
+
"import:data:tree:beta",
|
|
2267
|
+
"import:tree:data:beta",
|
|
2268
|
+
"import:tree:beta:data",
|
|
2269
|
+
"data:tree:import:beta",
|
|
2270
|
+
"tree:data:import:beta",
|
|
2271
|
+
"tree:import:data:beta",
|
|
2272
|
+
"tree:import:beta:data",
|
|
2273
|
+
"data:tree:beta:import",
|
|
2274
|
+
"tree:data:beta:import",
|
|
2275
|
+
"tree:beta:data:import",
|
|
2276
|
+
"tree:beta:import:data"
|
|
2277
|
+
]
|
|
2278
|
+
},
|
|
2014
2279
|
"force:data:bulk:delete": {
|
|
2015
2280
|
"aliases": [],
|
|
2016
2281
|
"args": {},
|
|
@@ -2430,5 +2695,5 @@
|
|
|
2430
2695
|
]
|
|
2431
2696
|
}
|
|
2432
2697
|
},
|
|
2433
|
-
"version": "3.0
|
|
2698
|
+
"version": "3.1.0"
|
|
2434
2699
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-data",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Plugin for salesforce data commands",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"homepage": "https://github.com/salesforcecli/plugin-data",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"@oclif/core": "^3.19.1",
|
|
112
112
|
"@salesforce/core": "^6.5.3",
|
|
113
113
|
"@salesforce/kit": "^3.0.15",
|
|
114
|
-
"@salesforce/sf-plugins-core": "^7.1.
|
|
114
|
+
"@salesforce/sf-plugins-core": "^7.1.9",
|
|
115
115
|
"@salesforce/ts-types": "^2.0.9",
|
|
116
116
|
"chalk": "^5.3.0",
|
|
117
117
|
"change-case": "^5.4.3",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"jsforce": "^2.0.0-beta.29"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@oclif/plugin-command-snapshot": "^5.0.
|
|
123
|
+
"@oclif/plugin-command-snapshot": "^5.0.9",
|
|
124
124
|
"@salesforce/cli-plugins-testkit": "^5.1.9",
|
|
125
125
|
"@salesforce/dev-scripts": "^8.3.0",
|
|
126
|
-
"@salesforce/plugin-command-reference": "^3.0.
|
|
126
|
+
"@salesforce/plugin-command-reference": "^3.0.67",
|
|
127
127
|
"@types/chai-as-promised": "^7.1.8",
|
|
128
128
|
"chai-as-promised": "^7.1.1",
|
|
129
129
|
"eslint-plugin-sf-plugin": "^1.17.3",
|
|
130
|
-
"oclif": "^4.4.
|
|
130
|
+
"oclif": "^4.4.14",
|
|
131
131
|
"shx": "^0.3.3",
|
|
132
132
|
"ts-node": "^10.9.2",
|
|
133
133
|
"typescript": "^5.2.2"
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
"exports": "./lib/index.js",
|
|
251
251
|
"type": "module",
|
|
252
252
|
"sfdx": {
|
|
253
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.0.
|
|
254
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.0.
|
|
253
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.1.0.crt",
|
|
254
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-data/3.1.0.sig"
|
|
255
255
|
}
|
|
256
256
|
}
|