Skip to content

Commit 4ae0ceb

Browse files
committed
chore(release): 1.3.1 [skip ci]
1 parent 65953b9 commit 4ae0ceb

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [1.3.1](https://github.com/salesforcecli/plugin-api/compare/1.3.0...1.3.1) (2024-10-07)
2+
3+
### Bug Fixes
4+
5+
- change url builder, add @ prefix for files ([4acc1da](https://github.com/salesforcecli/plugin-api/commit/4acc1da182c8c735089348f93bded14f6c685626))
6+
17
# [1.3.0](https://github.com/salesforcecli/plugin-api/compare/1.2.2...1.3.0) (2024-10-03)
28

39
### Features

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ EXAMPLES
113113
$ sf api request graphql --body example.txt --stream-to-file output.txt --include
114114
```
115115

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

118118
## `sf api request rest [URL]`
119119

120120
Make an authenticated HTTP request using the Salesforce REST API.
121121

122122
```
123123
USAGE
124-
$ sf api request rest [URL] -o <value> [--flags-dir <value>] [--api-version <value>] [-i | -S Example: report.xlsx]
125-
[-X GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [-f file] [-b file]
124+
$ sf api request rest [URL] -o <value> [--flags-dir <value>] [-i | -S Example: report.xlsx] [-X
125+
GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE] [-H key:value...] [-f file | -b file]
126126
127127
ARGUMENTS
128128
URL Salesforce API endpoint
@@ -133,13 +133,13 @@ FLAGS
133133
-X, --method=<option> HTTP method for the request.
134134
<options: GET|POST|PUT|PATCH|HEAD|DELETE|OPTIONS|TRACE>
135135
-b, --body=file File or content for the body of the HTTP request. Specify "-" to read from
136-
standard input or "" for an empty body.
136+
standard input or "" for an empty body. If passing a file, prefix the
137+
filename with '@'.
137138
-f, --file=file JSON file that contains values for the request header, body, method, and
138139
URL.
139140
-i, --include Include the HTTP response status and headers in the output.
140141
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the
141142
`target-org` configuration variable is already set.
142-
--api-version=<value> Override the api version used for api requests made by this command
143143
144144
GLOBAL FLAGS
145145
--flags-dir=<value> Import flag values from a directory.
@@ -156,30 +156,30 @@ DESCRIPTION
156156
EXAMPLES
157157
List information about limits in the org with alias "my-org":
158158
159-
$ sf api request rest 'limits' --target-org my-org
159+
$ sf api request rest 'services/data/v56.0/limits' --target-org my-org
160160
161161
List all endpoints in your default org; write the output to a file called "output.txt" and include the HTTP response
162162
status and headers:
163163
164-
$ sf api request rest '/' --stream-to-file output.txt --include
164+
$ sf api request rest '/services/data/v56.0/' --stream-to-file output.txt --include
165165
166166
Get the response in XML format by specifying the "Accept" HTTP header:
167167
168-
$ sf api request rest 'limits' --header 'Accept: application/xml'
168+
$ sf api request rest '/services/data/v56.0/limits' --header 'Accept: application/xml'
169169
170170
Create an account record using the POST method; specify the request details directly in the "--body" flag:
171171
172-
$ sf api request rest sobjects/account --body "{\"Name\" : \"Account from REST API\",\"ShippingCity\" : \
173-
\"Boise\"}" --method POST
172+
$ sf api request rest /services/data/v56.0/sobjects/account --body "{\"Name\" : \"Account from REST \
173+
API\",\"ShippingCity\" : \"Boise\"}" --method POST
174174
175-
Create an account record using the information in a file called "info.json":
175+
Create an account record using the information in a file called "info.json" (note the @ prefixing the file name):
176176
177-
$ sf api request rest 'sobjects/account' --body info.json --method POST
177+
$ sf api request rest '/services/data/v56.0/sobjects/account' --body @info.json --method POST
178178
179179
Update an account record using the PATCH method:
180180
181-
$ sf api request rest 'sobjects/account/<Account ID>' --body "{\"BillingCity\": \"San Francisco\"}" --method \
182-
PATCH
181+
$ sf api request rest '/services/data/v56.0/sobjects/account/<Account ID>' --body "{\"BillingCity\": \"San \
182+
Francisco\"}" --method PATCH
183183
184184
Store the values for the request header, body, and so on, in a file, which you then specify with the --file flag;
185185
see the description of --file for more information:
@@ -222,7 +222,7 @@ FLAG DESCRIPTIONS
222222
https://github.com/salesforcecli/plugin-api/tree/main/test/test-files/data-project.
223223
```
224224

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

227227
<!-- commandsstop -->
228228

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/plugin-api",
33
"description": "A plugin to call API endpoints via CLI commands",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {

0 commit comments

Comments
 (0)