superfaceai / service-client

Library provides client for superface backend apis.
MIT License
5 stars 1 forks source link

Add CLI login #54

Closed janhalama closed 3 years ago

janhalama commented 3 years ago

This PR implements support for CLI login. CLI methods added into ServiceClient are cliLogin, verifyCLILogin and confirmCLILogin.

Passwordless and CLI login endpoints are very similar. Following interfaces has been renamed and the code reused in CLI login methods:

cliLogin and verifyCLILogin methods are designed to be used from CLI confirmCLILogin is designed be used from Air and requires that user is logged in

Renaming interfaces is breaking change and will require minor changes in Air. @kysely

janhalama commented 3 years ago

I just realised that login interfaces should be organised in files differently:

./interfaces/login_api_responses.ts ./interfaces/login_api_options.ts

janhalama commented 3 years ago

Looks good! 👍

2 things:

  • I like the interface files structure you proposed in the added comment, I think it'd be cleaner that way
  • nitpicking: not sure we're following any specific naming conventions, but maybe verifyCLILogin would read nicer to me if it was verifyCliLogin

I changed interface files structure and changed verifyCliLogin and confirmCliLogin method names.

janhalama commented 3 years ago

@kysely there were conflicts with main branch I did not notice yesterday, now main is rebased