Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cd/remove-legacy-comm…
Browse files Browse the repository at this point in the history
…ands
  • Loading branch information
cristiand391 committed Dec 11, 2024
2 parents e59d5c3 + 8cc9004 commit b5ef71a
Show file tree
Hide file tree
Showing 45 changed files with 70,693 additions and 2,194 deletions.
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
## [3.13.2](https://github.com/salesforcecli/plugin-data/compare/3.13.1...3.13.2) (2024-12-11)

### Bug Fixes

- **import:tree:** avoid recursion when resolving refs ([#1146](https://github.com/salesforcecli/plugin-data/issues/1146)) ([e6326dc](https://github.com/salesforcecli/plugin-data/commit/e6326dcfb4b67f17806d18d783fee14553e9fc93))

## [3.13.1](https://github.com/salesforcecli/plugin-data/compare/3.13.0...3.13.1) (2024-12-06)

### Bug Fixes

- **data:export:** properly handle big JSON exports ([66de715](https://github.com/salesforcecli/plugin-data/commit/66de7158f1f76c35075b01c1fd00989060165351))

# [3.13.0](https://github.com/salesforcecli/plugin-data/compare/3.12.3...3.13.0) (2024-12-06)

### Bug Fixes

- update command snapshot ([334f50b](https://github.com/salesforcecli/plugin-data/commit/334f50b632bbb86005a8369935972fcc4b240667))

### Features

- **data:query:** add `--output-file` flag ([324c5a4](https://github.com/salesforcecli/plugin-data/commit/324c5a4c920bccfa8664e642dcbb3584d3f59166))

## [3.12.3](https://github.com/salesforcecli/plugin-data/compare/3.12.2...3.12.3) (2024-12-01)

### Bug Fixes

- **deps:** bump @salesforce/sf-plugins-core from 12.0.13 to 12.1.0 ([f80affd](https://github.com/salesforcecli/plugin-data/commit/f80affde383264f326aa04b8e90178b1253745b7))

## [3.12.2](https://github.com/salesforcecli/plugin-data/compare/3.12.1...3.12.2) (2024-12-01)

### Bug Fixes

- **deps:** bump csv-parse from 5.5.6 to 5.6.0 ([0053edc](https://github.com/salesforcecli/plugin-data/commit/0053edc517d85da20bdc38649bab55bb8275fcc9))

## [3.12.1](https://github.com/salesforcecli/plugin-data/compare/3.12.0...3.12.1) (2024-11-27)

### Bug Fixes

- **deps:** bump @oclif/multi-stage-output from 0.7.12 to 0.7.15 ([0833543](https://github.com/salesforcecli/plugin-data/commit/083354300388ae8d977ddd472dec87909c8a5cca))

# [3.12.0](https://github.com/salesforcecli/plugin-data/compare/3.11.6...3.12.0) (2024-11-26)

### Features

- multi-stage-output/new csv flags ([#1110](https://github.com/salesforcecli/plugin-data/issues/1110)) ([1d2cf30](https://github.com/salesforcecli/plugin-data/commit/1d2cf30daf33b77d6e129f53d8301e3fde86e05b))

## [3.11.6](https://github.com/salesforcecli/plugin-data/compare/3.11.5...3.11.6) (2024-11-24)

### Bug Fixes

- **deps:** bump @salesforce/sf-plugins-core from 12.0.11 to 12.0.13 ([67d011c](https://github.com/salesforcecli/plugin-data/commit/67d011c0e9b5443528e90162702edb41e2ca50b4))

## [3.11.5](https://github.com/salesforcecli/plugin-data/compare/3.11.4...3.11.5) (2024-11-24)

### Bug Fixes

- **deps:** bump csv-stringify from 6.5.1 to 6.5.2 ([edcc212](https://github.com/salesforcecli/plugin-data/commit/edcc2121e9b4a6776e1d8cd5b9596989ff1de307))

## [3.11.4](https://github.com/salesforcecli/plugin-data/compare/3.11.3...3.11.4) (2024-11-17)

### Bug Fixes

- **deps:** bump cross-spawn from 7.0.3 to 7.0.5 ([8c84d03](https://github.com/salesforcecli/plugin-data/commit/8c84d03d46a760876caf64a2e30b7cce16f6b524))

## [3.11.3](https://github.com/salesforcecli/plugin-data/compare/3.11.2...3.11.3) (2024-11-10)

### Bug Fixes

- **deps:** bump @oclif/multi-stage-output from 0.7.5 to 0.7.12 ([798977d](https://github.com/salesforcecli/plugin-data/commit/798977dfeeca0df2e29dfcd8f239bb0243ca0ef4))

## [3.11.2](https://github.com/salesforcecli/plugin-data/compare/3.11.1...3.11.2) (2024-11-03)

### Bug Fixes
Expand Down
132 changes: 71 additions & 61 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"flags-dir",
"hard-delete",
"json",
"line-ending",
"loglevel",
"sobject",
"target-org",
Expand Down Expand Up @@ -186,6 +187,7 @@
"flags-dir",
"json",
"loglevel",
"output-file",
"perflog",
"query",
"result-format",
Expand Down Expand Up @@ -283,10 +285,12 @@
"flags": [
"api-version",
"async",
"column-delimiter",
"external-id",
"file",
"flags-dir",
"json",
"line-ending",
"loglevel",
"sobject",
"target-org",
Expand Down
23 changes: 0 additions & 23 deletions messages/bulk.operation.command.md

This file was deleted.

15 changes: 0 additions & 15 deletions messages/bulk.resume.command.md

This file was deleted.

55 changes: 54 additions & 1 deletion messages/bulkIngest.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,59 @@ Job has been aborted.
- Get the job results by running: "sf data bulk results -o %s --job-id %s".
- View the job in the org: "sf org open -o %s --path '/lightning/setup/AsyncApiJobStatus/page?address=%2F%s'".

# error.hardDeletePermission

You must have the "Bulk API Hard Delete" system permission to use the --hard-delete flag. This permission is disabled by default and can be enabled only by a system administrator.

# error.noProcessedRecords

Job finished successfully but it didn't process any record.

# error.noProcessedRecords.actions

- Check that the provided CSV file is valid.
- View the job in the org: "sf org open -o %s --path '/lightning/setup/AsyncApiJobStatus/page?address=%2F%s'".

# flags.column-delimiter.summary

Column delimiter used in the CSV file. Default is COMMA.
Column delimiter used in the CSV file.

# flags.line-ending.summary

Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.

# flags.sobject.summary

API name of the Salesforce object, either standard or custom, that you want to update or delete records from.

# flags.csvfile.summary

CSV file that contains the IDs of the records to update or delete.

# flags.wait.summary

Number of minutes to wait for the command to complete before displaying the results.

# flags.async.summary

Run the command asynchronously.

# flags.verbose.summary

Print verbose output of failed records if result is available.

# flags.jobid

ID of the job you want to resume.

# flags.useMostRecent.summary

Use the ID of the most recently-run bulk job.

# flags.targetOrg.summary

Username or alias of the target org. Not required if the "target-org" configuration variable is already set.

# flags.wait.summary

Number of minutes to wait for the command to complete before displaying the results.
4 changes: 0 additions & 4 deletions messages/data.import.bulk.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,3 @@ Time to wait for the command to finish, in minutes.
# flags.line-ending.summary

Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.

# flags.column-delimiter.summary

Column delimiter used in the CSV file. Default is COMMA.
8 changes: 0 additions & 8 deletions messages/data.update.bulk.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,3 @@ CSV file that contains the Salesforce object records you want to update.
# flags.sobject.summary

API name of the Salesforce object, either standard or custom, which you are updating.

# flags.line-ending.summary

Line ending used in the CSV file. Default value on Windows is `CRLF`; on macOS and Linux it's `LF`.

# flags.column-delimiter.summary

Column delimiter used in the CSV file. Default is COMMA.
33 changes: 2 additions & 31 deletions messages/messages.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
# success

Bulk %s request %s started successfully.

# checkStatus

Run the command "sf data %s resume -i %s -o %s" to check the status.

# checkJobViaUi

To review the details of this job, run:
sf org open --target-org %s --path "/lightning/setup/AsyncApiJobStatus/page?address=%2F%s"

# remainingTimeStatus

Remaining time: %d minutes.

# remainingRecordsStatus

Processed %d | Success %d | Fail %d

# bulkJobFailed

The bulk job %s failed. Check the job status for more information.

# perfLogLevelOption

Get API performance data.
Expand All @@ -48,10 +23,6 @@ Malformed key=value pair for value: %s.

Format to display the results; the --json flag overrides this flag.

# bulkRequestIdRequiredWhenNotUsingMostRecent

The bulk request id must be supplied when not looking for most recent cache entry.

# error.bulkRequestIdNotFound

Could not find a cache entry for job ID %s.
Expand All @@ -60,9 +31,9 @@ Could not find a cache entry for job ID %s.

Could not load a most recent cache entry for a bulk request. Please rerun your command with a bulk request id.

# cannotCreateResumeOptionsWithoutAnOrg
# error.skipCacheValidateNoOrg

Cannot create a cache entry without a valid org.
A default target org for the job %s is required to be set because the job isn't in the local cache.

# usernameRequired

Expand Down
3 changes: 0 additions & 3 deletions messages/reporter.md

This file was deleted.

8 changes: 6 additions & 2 deletions messages/soql.query.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ When using --bulk, the command waits 3 minutes by default for the query to compl

<%= config.bin %> <%= command.id %> --query "SELECT Id, Name, Account.Name FROM Contact"

- Read the SOQL query from a file called "query.txt"; the command uses the org with alias "my-scratch":
- Read the SOQL query from a file called "query.txt" and write the CSV-formatted output to a file; the command uses the org with alias "my-scratch":

<%= config.bin %> <%= command.id %> --file query.txt --target-org my-scratch
<%= config.bin %> <%= command.id %> --file query.txt --output-file output.csv --result-format csv --target-org my-scratch

- Use Tooling API to run a query on the ApexTrigger Tooling API object:

Expand Down Expand Up @@ -56,6 +56,10 @@ Include deleted records. By default, deleted records are not returned.

Time to wait for the command to finish, in minutes.

# flags.output-file.summary

File where records are written; only CSV and JSON output formats are supported.

# displayQueryRecordsRetrieved

Total number of records retrieved: %s.
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@salesforce/plugin-data",
"version": "3.11.2",
"version": "3.13.2",
"description": "Plugin for salesforce data commands",
"author": "Salesforce",
"homepage": "https://github.com/salesforcecli/plugin-data",
Expand Down Expand Up @@ -118,31 +118,31 @@
"version": "oclif readme"
},
"dependencies": {
"@jsforce/jsforce-node": "^3.6.2",
"@oclif/multi-stage-output": "^0.7.5",
"@jsforce/jsforce-node": "^3.6.3",
"@oclif/multi-stage-output": "^0.7.15",
"@salesforce/core": "^8.6.1",
"@salesforce/kit": "^3.2.2",
"@salesforce/sf-plugins-core": "^12.0.11",
"@salesforce/sf-plugins-core": "^12.1.0",
"@salesforce/ts-types": "^2.0.11",
"ansis": "^3.2.0",
"change-case": "^5.4.4",
"csv-parse": "^5.5.6",
"csv-stringify": "^6.5.1",
"csv-parse": "^5.6.0",
"csv-stringify": "^6.5.2",
"form-data": "^4.0.0",
"terminal-link": "^3.0.0"
},
"devDependencies": {
"@oclif/core": "^4.0.19",
"@oclif/plugin-command-snapshot": "^5.2.21",
"@oclif/core": "^4.0.34",
"@oclif/plugin-command-snapshot": "^5.2.23",
"@oclif/test": "^4.1.0",
"@salesforce/cli-plugins-testkit": "^5.3.34",
"@salesforce/dev-scripts": "^10.2.10",
"@salesforce/plugin-command-reference": "^3.1.32",
"@salesforce/cli-plugins-testkit": "^5.3.39",
"@salesforce/dev-scripts": "^10.2.11",
"@salesforce/plugin-command-reference": "^3.1.35",
"@salesforce/types": "^1.3.0",
"eslint-plugin-sf-plugin": "^1.20.8",
"oclif": "^4.15.16",
"eslint-plugin-sf-plugin": "^1.20.13",
"oclif": "^4.16.0",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
"typescript": "^5.7.2"
},
"resolutions": {
"@jsforce/jsforce-node/node-fetch/whatwg-url": "^14.0.0"
Expand Down
13 changes: 9 additions & 4 deletions src/api/data/tree/importPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,19 @@ export const replaceRefsInTheSameFile = (
: { ready: planPart };
};

/** recursively replace the `@ref` with the id, using the accumulated results objects */
/** replace the `@ref` with the id, using the results objects */
export const replaceRefs =
(results: ImportResult[]) =>
(records: SObjectTreeInput[]): SObjectTreeInput[] => {
if (results.length === 0) return records;
const [head, ...tail] = results;
const updatedRecords = records.map(replaceRefWithId(head));
return tail.length ? replaceRefs(tail)(updatedRecords) : updatedRecords;

let updatedRecords = records;

for (const rec of results) {
updatedRecords = updatedRecords.map(replaceRefWithId(rec));
}

return updatedRecords;
};

/** replace 1 record with 1 ref for all of its fields */
Expand Down
Loading

0 comments on commit b5ef71a

Please sign in to comment.