Skip to content

Commit

Permalink
chore(release): 1.3.1 [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-cli-bot committed Oct 7, 2024
1 parent 65953b9 commit 4ae0ceb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.3.1](https://github.com/salesforcecli/plugin-api/compare/1.3.0...1.3.1) (2024-10-07)

### Bug Fixes

- change url builder, add @ prefix for files ([4acc1da](https://github.com/salesforcecli/plugin-api/commit/4acc1da182c8c735089348f93bded14f6c685626))

# [1.3.0](https://github.com/salesforcecli/plugin-api/compare/1.2.2...1.3.0) (2024-10-03)

### Features
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ EXAMPLES
$ sf api request graphql --body example.txt --stream-to-file output.txt --include
```

_See code: [src/commands/api/request/graphql.ts](https://github.com/salesforcecli/plugin-api/blob/1.3.0/src/commands/api/request/graphql.ts)_
_See code: [src/commands/api/request/graphql.ts](https://github.com/salesforcecli/plugin-api/blob/1.3.1/src/commands/api/request/graphql.ts)_

## `sf api request rest [URL]`

Make an authenticated HTTP request using the Salesforce REST API.

```
USAGE
$ sf api request rest [URL] -o <value> [--flags-dir <value>] [--api-version <value>] [-i | -S Example: report.xlsx]
[-X GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [-f file] [-b file]
$ sf api request rest [URL] -o <value> [--flags-dir <value>] [-i | -S Example: report.xlsx] [-X
GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [-f file | -b file]
ARGUMENTS
URL Salesforce API endpoint
Expand All @@ -133,13 +133,13 @@ FLAGS
-X, --method=<option> HTTP method for the request.
<options: GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE>
-b, --body=file File or content for the body of the HTTP request. Specify "-" to read from
standard input or "" for an empty body.
standard input or "" for an empty body. If passing a file, prefix the
filename with '@'.
-f, --file=file JSON file that contains values for the request header, body, method, and
URL.
-i, --include Include the HTTP response status and headers in the output.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the
`target-org` configuration variable is already set.
--api-version=<value> Override the api version used for api requests made by this command
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
Expand All @@ -156,30 +156,30 @@ DESCRIPTION
EXAMPLES
List information about limits in the org with alias "my-org":
$ sf api request rest 'limits' --target-org my-org
$ sf api request rest 'services/data/v56.0/limits' --target-org my-org
List all endpoints in your default org; write the output to a file called "output.txt" and include the HTTP response
status and headers:
$ sf api request rest '/' --stream-to-file output.txt --include
$ sf api request rest '/services/data/v56.0/' --stream-to-file output.txt --include
Get the response in XML format by specifying the "Accept" HTTP header:
$ sf api request rest 'limits' --header 'Accept: application/xml'
$ sf api request rest '/services/data/v56.0/limits' --header 'Accept: application/xml'
Create an account record using the POST method; specify the request details directly in the "--body" flag:
$ sf api request rest sobjects/account --body "{\"Name\" : \"Account from REST API\",\"ShippingCity\" : \
\"Boise\"}" --method POST
$ sf api request rest /services/data/v56.0/sobjects/account --body "{\"Name\" : \"Account from REST \
API\",\"ShippingCity\" : \"Boise\"}" --method POST
Create an account record using the information in a file called "info.json":
Create an account record using the information in a file called "info.json" (note the @ prefixing the file name):
$ sf api request rest 'sobjects/account' --body info.json --method POST
$ sf api request rest '/services/data/v56.0/sobjects/account' --body @info.json --method POST
Update an account record using the PATCH method:
$ sf api request rest 'sobjects/account/<Account ID>' --body "{\"BillingCity\": \"San Francisco\"}" --method \
PATCH
$ sf api request rest '/services/data/v56.0/sobjects/account/<Account ID>' --body "{\"BillingCity\": \"San \
Francisco\"}" --method PATCH
Store the values for the request header, body, and so on, in a file, which you then specify with the --file flag;
see the description of --file for more information:
Expand Down Expand Up @@ -222,7 +222,7 @@ FLAG DESCRIPTIONS
https://github.com/salesforcecli/plugin-api/tree/main/test/test-files/data-project.
```

_See code: [src/commands/api/request/rest.ts](https://github.com/salesforcecli/plugin-api/blob/1.3.0/src/commands/api/request/rest.ts)_
_See code: [src/commands/api/request/rest.ts](https://github.com/salesforcecli/plugin-api/blob/1.3.1/src/commands/api/request/rest.ts)_

<!-- commandsstop -->

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/plugin-api",
"description": "A plugin to call API endpoints via CLI commands",
"version": "1.3.0",
"version": "1.3.1",
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
Expand Down

0 comments on commit 4ae0ceb

Please sign in to comment.