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(devices): add list and remove devices commands #96

Merged
merged 4 commits into from
Mar 31, 2023

Conversation

quadristan
Copy link
Contributor

@quadristan quadristan commented Mar 29, 2023

List and remove devices

Why ?

I often ends up having thousands of connected devices connected to my tests account.
Sometimes, i need to test device-removal workflows and I do not want to manually scroll and find which device to remove from the back office.

Also added

  • Deleting a single device
  • Listing devices in json format
  • Deleting "other" devices than the CLI instance.

@quadristan quadristan force-pushed the feat/list-and-remove-devices branch 3 times, most recently from a215a30 to dfd2501 Compare March 29, 2023 08:50
@Mikescops Mikescops added the features New feature or request label Mar 29, 2023
src/command-handlers/devices.ts Show resolved Hide resolved
src/command-handlers/devices.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/endpoints/deactivateDevices.ts Show resolved Hide resolved

export async function listAllDevices(options: { json: boolean }) {
const { secrets, deviceConfiguration } = await connectAndPrepare({ autoSync: false });
if (!deviceConfiguration) {
Copy link
Member

Choose a reason for hiding this comment

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

i don't think you need this, the connectAndPrepare will register the device if it doesn't exist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need to fix the typings of connectAndPrepare then because right now it returns a nullable

Copy link
Member

Choose a reason for hiding this comment

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

ah ok my bad, then leave it, i will take a look

src/index.ts Outdated Show resolved Hide resolved
Copy link
Member

@Mikescops Mikescops left a comment

Choose a reason for hiding this comment

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

LGTM, a couple of small comments added

quadristan and others added 2 commits March 31, 2023 11:29
Co-authored-by: Corentin Mors <corentin@dashlane.com>
@quadristan quadristan merged commit c08b2ff into master Mar 31, 2023
@quadristan quadristan deleted the feat/list-and-remove-devices branch March 31, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants