Skip to content
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

Merged
merged 10 commits into from
Sep 6, 2021
Merged

Add SLAS tenant APIs #243

merged 10 commits into from
Sep 6, 2021

Conversation

hnestmann
Copy link
Collaborator

No description provided.

Copy link
Contributor

@tobiaslohr tobiaslohr left a 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
Copy link
Contributor

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"
}

Copy link
Collaborator Author

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')
Copy link
Contributor

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')
Copy link
Contributor

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 Show resolved Hide resolved
cli.js Show resolved Hide resolved
cli.js Show resolved Hide resolved
@tobiaslohr tobiaslohr added the enhancement New feature or request label Aug 12, 2021
@tobiaslohr tobiaslohr added this to the 2.8.x milestone Aug 12, 2021
@@ -0,0 +1,281 @@
const fetch = require('node-fetch');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add code comments

@hnestmann
Copy link
Collaborator Author

/home/circleci/project/cli.js
1961:1 error Line 1961 exceeds the maximum line length of 120 max-len

/home/circleci/project/lib/slas.js
8:1 error Line 8 exceeds the maximum line length of 120 max-len
42:1 error Line 42 exceeds the maximum line length of 120 max-len

@hnestmann hnestmann marked this pull request as ready for review August 24, 2021 09:02
@hnestmann
Copy link
Collaborator Author

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.

This has been added

@tobiaslohr tobiaslohr merged commit 1199c9d into master Sep 6, 2021
@tobiaslohr tobiaslohr deleted the feature/slas-admin branch November 3, 2021 13:58
@tobiaslohr tobiaslohr linked an issue Nov 3, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SLAS Admin API
2 participants