-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SLAS tenant APIs #243
Add SLAS tenant APIs #243
Conversation
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.
Thanks @hnestmann ! This is awesome. I've left some comments. In general (for all commands) we should consider offering an option for the user of the CLI to persist the short code via other means, e.g. local CLI config, env vars, .env or dw.json (or similar).
Module secrets
contains the general lookup logic already and we could use it to pull the shortcode
to avoid having it being passed for every command.
@@ -1926,6 +1926,60 @@ program | |||
console.log(); | |||
}); | |||
|
|||
program |
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.
Do we want to allow someone passing the full JSON with the tenant info in there as a short hand version in alternative to passing individual properties through parameters? E.g.
{
"channels": [
"SiteGenesis",
"OtherSite"
],
"clientId": "client-id1",
"ecomSite": "SiteGenesis",
"ecomTenant": "test_prd",
"name": "ShopperClient1",
"privateClient": true,
"redirectUri": "http://localhost:9010/callback",
"scopes": [
"sfcc.products",
"sfcc.catalogs",
"sfcc.products.ro"
],
"secret": "secret12345"
}
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.
I agree, here I have the flat list, but on client:add I reference a file. I think we should allow both approaches on both APIS.
cli.js
Outdated
program | ||
.command('slas:tenant:get') | ||
.description('Gets a SLAS tenant from given organisation') | ||
.requiredOption('--tenant <tenant>', 'the tenant id to add') |
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.
Minor description change needed
cli.js
Outdated
program | ||
.command('slas:tenant:delete') | ||
.description('deletes a SLAS tenant from given organisation') | ||
.requiredOption('--tenant <tenant>', 'the tenant id to add') |
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.
Minor description change needed
@@ -0,0 +1,281 @@ | |||
const fetch = require('node-fetch'); |
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.
Add code comments
/home/circleci/project/cli.js /home/circleci/project/lib/slas.js |
This has been added |
No description provided.