-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
@@ -1,5 +1,3 @@ | |||
{ | |||
"test": { | |||
"testsPath": "test/**/*.test.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: re-enable the tests scripts once I add NUTs.
I skipped this as I'll need to set up some hub credentials for this repo.
"format": "sf-format", | ||
"lint": "sf-lint", | ||
"lint": "eslint \"src/**/*.ts\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sf-lint
will fail as there's no test
folder yet, replaced it to only look at the src
folder.
default: false, | ||
}), | ||
method: Flags.enum<Method>({ | ||
options: ['GET', 'POST', 'PUT', 'PATCH', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got
accepts lowercase HTTP methods but I decided to only support the uppercase ones only, the --help
output for the command adds the possible options so having a bunch seems like a lot of noise.
let body: Buffer; | ||
|
||
if (flags.body) { | ||
body = await readFile(flags.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If body
is passed, it would be convenient if the appropriate Content-Type
header was added for you automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, the command pass the body file to got as a Buffer
so some headers are set:
https://github.com/sindresorhus/got/blob/main/documentation/2-options.md#body
to get the content-type of the buffer we could use this
https://github.com/sindresorhus/file-type/
I'll add a new issue for this 👍🏼
summary: messages.getMessage('flags.target-org.summary'), | ||
char: 'o', | ||
}), | ||
include: Flags.boolean({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include
could have the short character i
to match curl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added ✅
curl also has -I/--head
which makes it only prints the headers and skip the response, I'll add a flag for that later, sometimes you are interested on the headers and if the response is big you need to scroll to the top.
This is awesome @cristiand391! I added a few "nice to haves", but feel free to go ahead and merge QA Notes
|
Thanks @iowillhoit! I added a link to the rest api guide in the command description and the shorter flag version for |
What does this PR do?
Adds the
env api
command to interact with Saleforce APIs.Original idea: https://cli.github.com/manual/gh_api
Benefits over
curl
:Example:
Upsert record field:
Get XML response by setting
Accept
headeralso provides some help if header format is invalid
What issues does this PR fix or reference?
@W-11963169@