From 3e3d120ef529316298732792f890e9ddba0000f1 Mon Sep 17 00:00:00 2001 From: svc-cli-bot Date: Fri, 20 Sep 2024 02:23:34 +0000 Subject: [PATCH] chore(release): bump to 2.60.8 --- README.md | 130 +++++++++++++++++++++++++++++---------------------- package.json | 4 +- yarn.lock | 8 ++-- 3 files changed, 80 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 2f0290c0..f49af8b1 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ $ npm install -g @salesforce/cli $ sf COMMAND running command... $ sf (--version|-v) -@salesforce/cli/2.60.7 linux-x64 node-v20.17.0 +@salesforce/cli/2.60.8 linux-x64 node-v20.17.0 $ sf --help [COMMAND] USAGE $ sf COMMAND @@ -849,7 +849,7 @@ _See code: [@salesforce/plugin-apex](https://github.com/salesforcecli/plugin-ape ## `sf api request graphql` -Execute GraphQL statements +Execute a GraphQL statement. ``` USAGE @@ -862,48 +862,47 @@ FLAGS -o, --target-org= (required) Username or alias of the target org. Not required if the `target-org` configuration variable is already set. --api-version= Override the api version used for api requests made by this command - --body=file (required) File or content with GraphQL statement. Specify "-" to read from - standard input. + --body=file (required) File or content with the GraphQL statement. Specify "-" to read + from standard input. GLOBAL FLAGS --flags-dir= Import flag values from a directory. --json Format output as json. DESCRIPTION - Execute GraphQL statements - - Run any valid GraphQL statement via the /graphql - [API](https://developer.salesforce.com/docs/platform/graphql/guide/graphql-about.html) - -EXAMPLES - - Runs the graphql query directly via the command line - sf api request graphql --body "query accounts { uiapi { query { Account { edges { node { Id \n Name { value } } } } } } }" - - Runs a mutation to create an Account, with an `example.txt` file, containing - mutation AccountExample{ - uiapi { - AccountCreate(input: { - Account: { - Name: "Trailblazer Express" - } - }) { - Record { - Id - Name { - value - } - } - } - } - } - $ sf api request graphql --body example.txt - will create a new account returning specified fields (Id, Name) -``` - -_See code: [@salesforce/plugin-api](https://github.com/salesforcecli/plugin-api/blob/1.2.1/src/commands/api/request/graphql.ts)_ + Execute a GraphQL statement. + + Specify the GraphQL statement with the "--body" flag, either directly at the command line or with a file that contains + the statement. You can query Salesforce records using a "query" statement or use mutations to modify Salesforce + records. + + This command uses the GraphQL API to query or modify Salesforce objects. For details about the API, and examples of + queries and mutations, see https://developer.salesforce.com/docs/platform/graphql/guide/graphql-about.html. + +EXAMPLES + Execute a GraphQL query on the Account object by specifying the query directly to the "--body" flag; the command + uses your default org: + + $ sf api request graphql --body "query accounts { uiapi { query { Account { edges { node { Id \n Name { value } \ + } } } } } }" + + Read the GraphQL statement from a file called "example.txt" and execute it on an org with alias "my-org": + + $ sf api request graphql --body example.txt --target-org my-org + + Pipe the GraphQL statement that you want to execute from standard input to the command: + $ echo graphql | sf api request graphql --body - + + Write the output of the command to a file called "output.txt" and include the HTTP response status and headers: + + $ sf api request graphql --body example.txt --stream-to-file output.txt --include +``` + +_See code: [@salesforce/plugin-api](https://github.com/salesforcecli/plugin-api/blob/1.2.2/src/commands/api/request/graphql.ts)_ ## `sf api request rest ENDPOINT` -Make an authenticated HTTP request to Salesforce REST API and print the response. +Make an authenticated HTTP request using the Salesforce REST API. ``` USAGE @@ -922,32 +921,51 @@ FLAGS -o, --target-org= (required) Username or alias of the target org. Not required if the `target-org` configuration variable is already set. --api-version= Override the api version used for api requests made by this command - --body=file File to use as the body for the request. Specify "-" to read from standard - input; specify "" for an empty body. + --body=file File or content for the body of the HTTP request. Specify "-" to read from + standard input or "" for an empty body. GLOBAL FLAGS --flags-dir= Import flag values from a directory. +DESCRIPTION + Make an authenticated HTTP request using the Salesforce REST API. + + When sending the HTTP request with the "--body" flag, you can specify the request directly at the command line or with + a file that contains the request. + + For a full list of supported REST endpoints and resources, see + https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_list.htm. + EXAMPLES - - List information about limits in the org with alias "my-org": - sf api request rest 'limits' --target-org my-org - - List all endpoints - sf api request rest '/' - - Get the response in XML format by specifying the "Accept" HTTP header: - sf api request rest 'limits' --target-org my-org --header 'Accept: application/xml' - - POST to create an Account object - sf api request rest 'sobjects/account' --body "{\"Name\" : \"Account from REST API\",\"ShippingCity\" : \"Boise\"}" --method POST - - or with a file 'info.json' containing - { - "Name": "Demo", - "ShippingCity": "Boise" - } - $ sf api request rest 'sobjects/account' --body info.json --method POST - - Update object - sf api request rest 'sobjects/account/' --body "{\"BillingCity\": \"San Francisco\"}" --method PATCH -``` - -_See code: [@salesforce/plugin-api](https://github.com/salesforcecli/plugin-api/blob/1.2.1/src/commands/api/request/rest.ts)_ + List information about limits in the org with alias "my-org": + + $ sf api request rest '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 + + Get the response in XML format by specifying the "Accept" HTTP header: + + $ sf api request rest '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 + + Create an account record using the information in a file called "info.json": + + $ sf api request rest 'sobjects/account' --body info.json --method POST + + Update an account record using the PATCH method: + + $ sf api request rest 'sobjects/account/' --body "{\"BillingCity\": \"San Francisco\"}" --method \ + PATCH +``` + +_See code: [@salesforce/plugin-api](https://github.com/salesforcecli/plugin-api/blob/1.2.2/src/commands/api/request/rest.ts)_ ## `sf autocomplete [SHELL]` diff --git a/package.json b/package.json index 0d2c1248..ae3c2c56 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@salesforce/cli", "description": "The Salesforce CLI", - "version": "2.60.7", + "version": "2.60.8", "author": "Salesforce", "bin": { "sf": "./bin/run.js", @@ -154,7 +154,7 @@ "@salesforce/core": "^8.2.3", "@salesforce/kit": "^3.1.6", "@salesforce/plugin-apex": "3.4.10", - "@salesforce/plugin-api": "1.2.1", + "@salesforce/plugin-api": "1.2.2", "@salesforce/plugin-auth": "3.6.59", "@salesforce/plugin-data": "3.6.5", "@salesforce/plugin-deploy-retrieve": "3.12.10", diff --git a/yarn.lock b/yarn.lock index 71ec652b..ade27162 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2311,10 +2311,10 @@ "@salesforce/sf-plugins-core" "^11.3.7" ansis "^3.3.1" -"@salesforce/plugin-api@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@salesforce/plugin-api/-/plugin-api-1.2.1.tgz#e0977c02fa3768d8078b0673eaabb58ecfdc906b" - integrity sha512-p9AMXmpnZfxqJ3zpwN3TZN1pmum3+Fldj21xpkCX8LQRxPgs4awSZks4H7qUJFwKKj7M5WoAgyXbr6SndnGorA== +"@salesforce/plugin-api@1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@salesforce/plugin-api/-/plugin-api-1.2.2.tgz#39e1aca1cf8f9e240cfc597b7b8ed5044a192058" + integrity sha512-DYcvSvK1J/C0oin9CZltk/UT4d9dOtRBztMxHVUJDR2VC5iJhlx+cjOs76V2/D+7g7Maon0lARYtY0JX+3FZnA== dependencies: "@oclif/core" "^4" "@salesforce/core" "^8.4.0"