Skip to content

Commit

Permalink
docs: modernize messages
Browse files Browse the repository at this point in the history
* chore(dev-deps): bump @salesforce/ts-sinon from 1.4.1 to 1.4.2

Bumps [@salesforce/ts-sinon](https://github.com/forcedotcom/ts-sinon) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/forcedotcom/ts-sinon/releases)
- [Changelog](https://github.com/forcedotcom/ts-sinon/blob/main/CHANGELOG.md)
- [Commits](forcedotcom/ts-sinon@1.4.1...1.4.2)

---
updated-dependencies:
- dependency-name: "@salesforce/ts-sinon"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(deps): bump @salesforce/command from 5.2.20 to 5.2.25

Bumps [@salesforce/command](https://github.com/salesforcecli/command) from 5.2.20 to 5.2.25.
- [Release notes](https://github.com/salesforcecli/command/releases)
- [Changelog](https://github.com/salesforcecli/command/blob/main/CHANGELOG.md)
- [Commits](salesforcecli/command@5.2.20...5.2.25)

---
updated-dependencies:
- dependency-name: "@salesforce/command"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(release): 2.1.12 [skip ci]

* chore(dev-deps): bump @oclif/plugin-command-snapshot

Bumps [@oclif/plugin-command-snapshot](https://github.com/oclif/plugin-command-snapshot) from 3.1.3 to 3.2.10.
- [Release notes](https://github.com/oclif/plugin-command-snapshot/releases)
- [Changelog](https://github.com/oclif/plugin-command-snapshot/blob/main/CHANGELOG.md)
- [Commits](oclif/plugin-command-snapshot@v3.1.3...3.2.10)

---
updated-dependencies:
- dependency-name: "@oclif/plugin-command-snapshot"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: parking orbit cleanup (#413)

* chore(dev-deps): bump @salesforce/plugin-command-reference

Bumps [@salesforce/plugin-command-reference](https://github.com/forcedotcom/plugin-command-reference) from 1.5.0 to 1.5.2.
- [Release notes](https://github.com/forcedotcom/plugin-command-reference/releases)
- [Commits](https://github.com/forcedotcom/plugin-command-reference/commits)

---
updated-dependencies:
- dependency-name: "@salesforce/plugin-command-reference"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(deps): bump @salesforce/command from 5.2.25 to 5.2.27

Bumps [@salesforce/command](https://github.com/salesforcecli/command) from 5.2.25 to 5.2.27.
- [Release notes](https://github.com/salesforcecli/command/releases)
- [Changelog](https://github.com/salesforcecli/command/blob/main/CHANGELOG.md)
- [Commits](salesforcecli/command@5.2.25...5.2.27)

---
updated-dependencies:
- dependency-name: "@salesforce/command"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(release): 2.1.13 [skip ci]

* chore(dev-deps): bump typescript from 4.8.4 to 4.9.3

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.8.4 to 4.9.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v4.8.4...v4.9.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(dev-deps): bump prettier from 2.7.1 to 2.8.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.7.1 to 2.8.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.7.1...2.8.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(dev-deps): bump @salesforce/plugin-command-reference

Bumps [@salesforce/plugin-command-reference](https://github.com/forcedotcom/plugin-command-reference) from 1.5.2 to 1.5.3.
- [Release notes](https://github.com/forcedotcom/plugin-command-reference/releases)
- [Commits](https://github.com/forcedotcom/plugin-command-reference/commits)

---
updated-dependencies:
- dependency-name: "@salesforce/plugin-command-reference"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(deps): bump @salesforce/command from 5.2.27 to 5.2.28

Bumps [@salesforce/command](https://github.com/salesforcecli/command) from 5.2.27 to 5.2.28.
- [Release notes](https://github.com/salesforcecli/command/releases)
- [Changelog](https://github.com/salesforcecli/command/blob/main/CHANGELOG.md)
- [Commits](salesforcecli/command@5.2.27...5.2.28)

---
updated-dependencies:
- dependency-name: "@salesforce/command"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(release): 2.1.14 [skip ci]

* chore: add some unit tests for dataCommand class (#428)

* chore: add some unit tests for dataCommand class

* chore: whoops, remove .only

* fix: edit messages for "data query"

* fix: allow single quotes in key=value pairs (#427)

* fix: allow single quotes in key=value pairs

This lets you use force:data:record:create and force:data:record:update with values that have single quotes

* fix: check if key=value pairs have a quoted string vs just a quote in the value

* chore: change regex exec() to test()

Co-authored-by: peternhale <[email protected]>

Co-authored-by: peternhale <[email protected]>

* chore(release): 2.1.15 [skip ci]

* fix: edit "data record" messages

* fix: edit messages for "data import/export tree" commands

and other error files.

* fix: edit messages for "data bulk upsert"

* fix(deps): bump @salesforce/core from 3.32.6 to 3.32.9

Bumps [@salesforce/core](https://github.com/forcedotcom/sfdx-core) from 3.32.6 to 3.32.9.
- [Release notes](https://github.com/forcedotcom/sfdx-core/releases)
- [Changelog](https://github.com/forcedotcom/sfdx-core/blob/main/CHANGELOG.md)
- [Commits](forcedotcom/sfdx-core@3.32.6...3.32.9)

---
updated-dependencies:
- dependency-name: "@salesforce/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(release): 2.1.16 [skip ci]

* fix(deps): bump @salesforce/command from 5.2.28 to 5.2.30

Bumps [@salesforce/command](https://github.com/salesforcecli/command) from 5.2.28 to 5.2.30.
- [Release notes](https://github.com/salesforcecli/command/releases)
- [Changelog](https://github.com/salesforcecli/command/blob/main/CHANGELOG.md)
- [Commits](salesforcecli/command@5.2.28...5.2.30)

---
updated-dependencies:
- dependency-name: "@salesforce/command"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(dev-deps): bump oclif from 3.2.28 to 3.4.2

Bumps [oclif](https://github.com/oclif/oclif) from 3.2.28 to 3.4.2.
- [Release notes](https://github.com/oclif/oclif/releases)
- [Changelog](https://github.com/oclif/oclif/blob/main/CHANGELOG.md)
- [Commits](oclif/oclif@3.2.28...3.4.2)

---
updated-dependencies:
- dependency-name: oclif
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(dev-deps): bump @swc/core from 1.3.16 to 1.3.22

Bumps [@swc/core](https://github.com/swc-project/swc) from 1.3.16 to 1.3.22.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](swc-project/swc@v1.3.16...v1.3.22)

---
updated-dependencies:
- dependency-name: "@swc/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore(release): 2.1.17 [skip ci]

* fix: edit messages for "data bulk upsert"

* fix: edit "data bulk" messages

* fix: edit "data query resume" messages

* fix: fix tests that hard-code error messages

* chore(dev-deps): bump @swc/core from 1.3.22 to 1.3.23

Bumps [@swc/core](https://github.com/swc-project/swc) from 1.3.22 to 1.3.23.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
- [Commits](swc-project/swc@v1.3.22...v1.3.23)

---
updated-dependencies:
- dependency-name: "@swc/core"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: cleanup from messages audit

* test: avoid hardcoding messages in tests

* chore: remove unused flag

* fix: edit based on Shane's feedback

* fix: input Shane's feedback

* fix: update --sobject flag description to say "api name..."

* chore: deprecate cmd aliases

* chore: dependency bumps and strict null checks

* refactor: test null exceptions

* chore: bump linter

* test: nuts don't hardcode command name

* chore: bump csv-stringify

* chore: lockfile and snapshot

* chore: bump testkit

* test: nut with more generic command message

* refactor: make flags readonly

* chore: bump linter

* test: fix regex output validation

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: svc-cli-bot <[email protected]>
Co-authored-by: svc-cli-bot <[email protected]>
Co-authored-by: Willhoit <[email protected]>
Co-authored-by: Rodrigo Espinosa de los Monteros <[email protected]>
Co-authored-by: peternhale <[email protected]>
Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
8 people authored Jan 2, 2023
1 parent 7602d85 commit b1990e7
Show file tree
Hide file tree
Showing 40 changed files with 863 additions and 735 deletions.
229 changes: 93 additions & 136 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2022, Salesforce.com, Inc.
Copyright (c) 2023, Salesforce.com, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ yarn install
yarn build
```

To use your plugin, run using the local `./bin/run` or `./bin/run.cmd` file.
To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.

```bash
# Run using local run file.
./bin/run force:data
./bin/dev force:data
```

There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be
Expand Down
2 changes: 0 additions & 2 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env node

require('@oclif/core').run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'));


110 changes: 0 additions & 110 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,115 +108,5 @@
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "external-id", "file", "json", "loglevel", "serial", "sobject", "target-org", "wait"],
"alias": ["force:data:bulk:upsert"]
},
{
"command": "force:data:bulk:delete",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "file", "json", "loglevel", "sobject", "target-org", "wait"],
"alias": ["force:data:bulk:delete"]
},
{
"command": "force:data:bulk:status",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "batch-id", "job-id", "json", "loglevel", "target-org"],
"alias": ["force:data:bulk:status"]
},
{
"command": "force:data:bulk:upsert",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "external-id", "file", "json", "loglevel", "serial", "sobject", "target-org", "wait"],
"alias": ["force:data:bulk:upsert"]
},
{
"command": "force:data:record:create",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "json", "loglevel", "perflog", "sobject", "target-org", "use-tooling-api", "values"],
"alias": ["force:data:record:create"]
},
{
"command": "force:data:record:delete",
"plugin": "@salesforce/plugin-data",
"flags": [
"api-version",
"json",
"loglevel",
"perflog",
"record-id",
"sobject",
"target-org",
"use-tooling-api",
"where"
],
"alias": ["force:data:record:delete"]
},
{
"command": "force:data:record:get",
"plugin": "@salesforce/plugin-data",
"flags": [
"api-version",
"json",
"loglevel",
"perflog",
"record-id",
"sobject",
"target-org",
"use-tooling-api",
"where"
],
"alias": ["force:data:record:get"]
},
{
"command": "force:data:record:update",
"plugin": "@salesforce/plugin-data",
"flags": [
"api-version",
"json",
"loglevel",
"perflog",
"record-id",
"sobject",
"target-org",
"use-tooling-api",
"values",
"where"
],
"alias": ["force:data:record:update"]
},
{
"command": "force:data:soql:bulk:report",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "bulk-query-id", "json", "loglevel", "result-format", "target-org"],
"alias": ["force:data:soql:bulk:report"]
},
{
"command": "force:data:soql:query",
"plugin": "@salesforce/plugin-data",
"flags": [
"api-version",
"async",
"bulk",
"file",
"json",
"loglevel",
"perflog",
"query",
"result-format",
"target-org",
"use-tooling-api",
"wait"
],
"alias": ["force:data:soql:query"]
},
{
"command": "force:data:tree:export",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "json", "loglevel", "output-dir", "plan", "prefix", "query", "target-org"],
"alias": ["force:data:tree:export"]
},
{
"command": "force:data:tree:import",
"plugin": "@salesforce/plugin-data",
"flags": ["api-version", "config-help", "content-type", "files", "json", "loglevel", "plan", "target-org"],
"alias": ["force:data:tree:import"]
}
]
8 changes: 2 additions & 6 deletions messages/batcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Batch #%s

# NoBatchFound

Unable to find batch %s for job %s.

# BulkError

Upsert errors
Expand All @@ -20,7 +16,7 @@ Batch Status

# PollingInfo

Will poll the batch statuses every %s seconds
Will poll the batch statuses every %s seconds.
To fetch the status on your own, press CTRL+C and use the command:
<%= config.bin %> data resume -i %s -b [<batchId>]

Expand All @@ -31,7 +27,7 @@ An External ID is required on %s to perform an upsert.
# TimeOut

The operation timed out. Check the status with command:
sfdx data:resume -i %s -b %s
<%= config.bin %> data resume -i %s -b %s

# CheckStatusCommand

Expand Down
23 changes: 13 additions & 10 deletions messages/bulk.delete.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# summary

bulk delete records from a csv file
Bulk delete records from an org using a CSV file.

# description

bulk delete records from a csv file
The file must be a CSV file with only one column: "Id".
One job can contain many batches, depending on the length of the CSV file.
Returns a job ID and a batch ID. Use these IDs to check job status with data:resume.
The CSV file must have only one column ("Id") and then the list of record IDs you want to delete, one ID per line.

When 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.

# examples

- <%= config.bin %> <%= command.id %> -s Account -f ./path/to/file.csv
- Bulk delete Account records using the list of IDs in the "files/delete.csv" file:

<%= config.bin %> <%= command.id %> --sobject Account --file files/delete.csv

- Bulk delete records from a custom object and wait 5 minutes for the command to complete:

- <%= config.bin %> <%= command.id %> -s MyObject\_\_c -f ./path/to/file.csv
<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/delete.csv --wait 5

# flags.sobjecttype

the sObject type of the records you’re deleting
API name of the Salesforce object, either standard or custom, that you want to delete records from.

# flags.csvfile

the path to the CSV file containing the ids of the records to delete
CSV file that contains the IDs of the records to delete.

# flags.wait

the number of minutes to wait for the command to complete before displaying the results
Number of minutes to wait for the command to complete before displaying the results.
11 changes: 6 additions & 5 deletions messages/bulk.report.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# summary

view the status of a bulk query
View the status of a bulk query.

# description

view the status of a bulk query
Run this command using the job ID returned from the data:query --bulk command.
Run this command using the job ID returned from the "<%= config.bin %> data query --bulk" command.

# examples

- <%= config.bin %> <%= command.id %> -i 7500x000005BdFzXXX
- View the status of a bulk query with the specified ID:

<%= config.bin %> <%= command.id %> --bulk-query-id 7500x000005BdFzXXX

# flags.bulkQueryId

the job ID of the bulk query
Job ID of the bulk query.
17 changes: 10 additions & 7 deletions messages/bulk.status.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# summary

view the status of a bulk data load job or batch
View the status of a bulk data load job or batch.

# description

view the status of a bulk data load job or batch
Run this command using the job ID or batch ID returned from the data:delete:bulk or data:upsert:bulk commands.
Run this command using the job ID or batch ID returned from the "<%= config.bin %> data delete bulk" or "<%= config.bin %> data upsert bulk" commands.

# examples

- <%= config.bin %> <%= command.id %> -i 750xx000000005sAAA
- View the status of a bulk load job:

- <%= config.bin %> <%= command.id %> -i 750xx000000005sAAA -b 751xx000000005nAAA
<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA

- View the status of a bulk load job and a specific batches:

<%= config.bin %> <%= command.id %> --job-id 750xx000000005sAAA --batch-id 751xx000000005nAAA

# flags.jobid

the ID of the job you want to view or of the job whose batch you want to view
ID of the job whose status you want to view.

# flags.batchid

the ID of the batch whose status you want to view
ID of the batch whose status you want to view; you must also specify the job ID.

# NoBatchFound

Expand Down
30 changes: 16 additions & 14 deletions messages/bulk.upsert.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
# summary

bulk upsert records from a CSV file
Bulk upsert records to an org from a CSV file.

# description

bulk upsert records from a CSV file
Inserts or updates records from a CSV file.
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.

One job can contain many batches, depending on the length of the CSV file.
Returns a job ID and a batch ID. Use these IDs to check job status with data:resume.
When 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.

For information about formatting your CSV file, see "Prepare CSV Files" in the Bulk API Developer Guide.
See "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)

By default, the job runs the batches in parallel. Specify --serial to run them serially.
By 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.

# examples

- <%= config.bin %> <%= command.id %> -s MyObject**c -f ./path/to/file.csv -i MyField**c
- Bulk upsert records to the Contact object:

- <%= config.bin %> <%= command.id %> -s MyObject\_\_c -f ./path/to/file.csv -i Id -w 2
<%= config.bin %> --sobject Contact --file files/contacts.csv --external-id Id

- Bulk upsert records to a custom object and wait 5 minutes for the command to complete:

<%= config.bin %> <%= command.id %> --sobject MyObject__c --file files/file.csv --external-id MyField__c --wait 5

# flags.sobjecttype

the sObject type of the records you want to upsert
API name of the Salesforce object, either standard or custom, that you want to upsert records to.

# flags.csvfile

the path to the CSV file that defines the records to upsert
CSV file that contains the records to upsert.

# flags.externalid

the column name of the external ID
Name of the external ID field, or the Id field.

# flags.wait

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

# flags.serial

run batches in serial mode
Run batches in serial mode.
8 changes: 4 additions & 4 deletions messages/exportApi.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# queryNotProvided

Provide a SOQL query statement or file containing a SOQL statement.
Provide a SOQL query or a file that contains a SOQL query.

# soqlInvalid

Invalid SOQL query: %s

# soqlMalformed

The provided SOQL is malformed: %s
The provided SOQL query is malformed: %s

# soqlMalformedAction

Check the SOQL syntax and try again.
Check the SOQL query syntax and try again.

# dataExportRecordCount

Processed %s records from query: %s

# dataExportRecordCountWarning

Query returned more than 200 records. Please run the command using the plan option instead.
Query returned more than 200 records. Run the command using the --plan flag instead.
Record Count: %s
Query: %s
Loading

0 comments on commit b1990e7

Please sign in to comment.