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

feat(cli): refactor invite/invitations/accept/decline commands #188

Merged
merged 9 commits into from
Jun 10, 2019
Merged

feat(cli): refactor invite/invitations/accept/decline commands #188

merged 9 commits into from
Jun 10, 2019

Conversation

superhawk610
Copy link
Contributor

@superhawk610 superhawk610 commented Jun 6, 2019

Description

This PR refactors the invite, invitations, accept, and decline commands as described in #95.

  • split output from ds invitations into either packages or namespaces depending on presence of --packages flag
  • add support for --namespace flag to ds invite
  • add support for --package flag to ds invite
  • add support for --namespace to ds accept
  • add support for --package/--as to ds accept
  • add support for --namespace to ds decline
  • add support for --package/--as to ds decline

Additionally, it includes a couple of other small tweaks:

  • refactor cli option parsing to allow command name to come after flags
  • store username in addition to token when logging in via ds login
  • fallback to ds help if the provided command isn't found

Notes

Closes #95.

@@ -27,6 +27,7 @@ async function login(opts) {
current.registries = current.registries || {};
current.registries[opts.registry] = current.registries[opts.registry] || {};
current.registries[opts.registry].token = token;
current.registries[opts.registry].username = username;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This currently does nothing since the payload returned by profile.loginWeb only contains a token key. This should be extended in services/registry/handlers/auth.js.

@ceejbot
Copy link
Collaborator

ceejbot commented Jun 10, 2019

SO Chris just changed the API out from under you in PR #135. Specifically, namespace memberships are now under /v1/users/user/:username/memberships and package maintainerships are now all /v1/packages/package/:namespace([^@]+)@:host/:name/maintainers. HOWEVER <3 for this, because ugh my first take on those cli commands was a mess.

Update endpoints and I will land this!

@superhawk610
Copy link
Contributor Author

@ceejbot done! You may want to double check my routing but I believe that should do it.

@ceejbot
Copy link
Collaborator

ceejbot commented Jun 10, 2019

Thank you!

@ceejbot ceejbot merged commit 35bdc32 into entropic-dev:master Jun 10, 2019
@ceejbot
Copy link
Collaborator

ceejbot commented Jun 10, 2019

@all-contributors add @superhawk610 for code

@allcontributors
Copy link
Contributor

@ceejbot

I've put up a pull request to add @superhawk610! 🎉

@olingern
Copy link
Contributor

olingern commented Jun 10, 2019

@superhawk610 I'm seeing this on master ( node 12.3.0 )

> node ./lib/main.js whoami
Cannot destructure property `registries` of 'undefined' or 'null'.

Cool if I fix over here #234 ?

@superhawk610
Copy link
Contributor Author

@olingern oops, looks like I forgot to pass opts to whoAmI in cli/lib/commands/whoami.js. Yeah if you've already got something open go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the cli invitation & joining commands need some cleanup
3 participants