Repository: auth0/node-auth0 (ts)

Issue:
[ManagementClient] Delete All User Authenticators
### Describe the problem you'd like to have solved

The [Delete All Authenticators](https://auth0.com/docs/api/management/v2#!/Users/delete_authenticators) endpoint doesn't seem to be available in the `ManagementClient`

### Describe the ideal solution

Make it possible to use the `ManagementClient` to delete all user's authenticators. 

```ts
client.deleteAllUserAuthenticators({ id })
```

### Alternatives and current work-arounds

I currently do this using Axios, and it's preventing me from migrating to this library. 



Pull request description:
Add DELETE /api/v2/users/{id}/authenticators
### Changes

fixes #782 

### References

https://auth0.com/docs/api/management/v2#!/Users/delete_authenticators
https://github.com/auth0/auth0-python/pull/301

### Testing

- [x] This change adds unit test coverage

### Checklist

- [x] I have read the [Auth0 general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [x] I have read the [Auth0 Code of Conduct](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [x] All existing and new tests complete without errors


Patch:
diff --git a/src/management/UsersManager.js b/src/management/UsersManager.js
index 0d7e22383..ee247787a 100644
--- a/src/management/UsersManager.js
+++ b/src/management/UsersManager.js
@@ -85,6 +85,13 @@ class UsersManager extends BaseManager {
      */
     this.permissions = this._getRestClient('/users/:id/permissions');
 
+    /**
+     * For CRUD on user's authenticators
+     *
+     * @type {external:RestClient}
+     */
+    this.authenticators = this._getRestClient('/users/:id/authenticators');
+
     this.organizations = this._getRestClient('/users/:id/organizations');
   }
 
@@ -742,6 +749,24 @@ class UsersManager extends BaseManager {
     return this.permissions.delete(query, data);
   }
 
+  deleteAllAuthenticators(params, cb) {
+    const query = params || {};
+
+    // Require a user ID.
+    if (!query.id) {
+      throw new ArgumentError('The user_id cannot be null or undefined');
+    }
+    if (typeof query.id !== 'string') {
+      throw new ArgumentError('The user_id has to be a string');
+    }
+
+    if (cb && cb instanceof Function) {
+      return this.authenticators.delete(query, cb);
+    }
+
+    return this.authenticators.delete(query);
+  }
+
   /**
    * Get a list of organizations for a user.
    *


Test patch:
diff --git a/test/management/users.tests.js b/test/management/users.tests.js
index 9c0ab1dea..55a3664a2 100644
--- a/test/management/users.tests.js
+++ b/test/management/users.tests.js
@@ -1489,6 +1489,71 @@ describe('UsersManager', () => {
     });
   });
 
+  describe('#deleteAllAuthenticators', () => {
+    let params;
+    let scope;
+
+    beforeEach(() => {
+      params = {
+        id: 'user_id',
+      };
+
+      scope = nock(API_URL).delete(`/users/${params.id}/authenticators`).reply(200);
+    });
+
+    it('should validate empty user_id', () => {
+      expect(() => {
+        usersManager.deleteAllAuthenticators({ id: null }, () => {});
+      }).to.throw('The user_id cannot be null or undefined');
+    });
+
+    it('should validate non-string user_id', () => {
+      expect(() => {
+        usersManager.deleteAllAuthenticators({ id: 123 }, () => {});
+      }).to.throw('The user_id has to be a string');
+    });
+
+    it('should accept a callback', (done) => {
+      usersManager.deleteAllAuthenticators(params, (err) => {
+        expect(err).to.be.null;
+        done();
+      });
+    });
+
+    it('should return a promise if no callback is given', () => {
+      expect(usersManager.deleteAllAuthenticators(params, {})).instanceOf(Promise);
+    });
+
+    it('should pass any errors to the promise catch handler', async () => {
+      nock.cleanAll();
+
+      nock(API_URL).post(`/users/${params.id}/authenticators`).reply(500);
+
+      try {
+        await usersManager.deleteAllAuthenticators(params, {});
+      } catch (err) {
+        expect(err).to.exist;
+      }
+    });
+
+    it('should perform a DELETE request to /api/v2/users/user_id/authenticators', async () => {
+      await usersManager.deleteAllAuthenticators(params, {});
+      expect(scope.isDone()).to.be.true;
+    });
+
+    it('should include the token in the Authorization header', async () => {
+      nock.cleanAll();
+
+      const request = nock(API_URL)
+        .delete(`/users/${params.id}/authenticators`)
+        .matchHeader('Authorization', `Bearer ${token}`)
+        .reply(200);
+
+      await usersManager.deleteAllAuthenticators(params, {});
+      expect(request.isDone()).to.be.true;
+    });
+  });
+
   describe('#getUserOrganizations', () => {
     const data = {
       id: 'user_id',