auth0 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change Log
2
2
 
3
+ ## [v3.2.0](https://github.com/auth0/node-auth0/tree/v3.2.0) (2023-02-09)
4
+
5
+ [Full Changelog](https://github.com/auth0/node-auth0/compare/v3.1.2...v3.2.0)
6
+
7
+ **Added**
8
+
9
+ - Add DELETE /api/v2/users/{id}/authenticators [\#785](https://github.com/auth0/node-auth0/pull/785) ([adamjmcgrath](https://github.com/adamjmcgrath))
10
+
3
11
  ## [v3.1.2](https://github.com/auth0/node-auth0/tree/v3.1.2) (2023-01-25)
4
12
 
5
13
  [Full Changelog](https://github.com/auth0/node-auth0/compare/v3.1.1...v3.1.2)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "SDK for Auth0 API v2",
5
5
  "main": "src/index.js",
6
6
  "sideEffects": false,
@@ -85,6 +85,13 @@ class UsersManager extends BaseManager {
85
85
  */
86
86
  this.permissions = this._getRestClient('/users/:id/permissions');
87
87
 
88
+ /**
89
+ * For CRUD on user's authenticators
90
+ *
91
+ * @type {external:RestClient}
92
+ */
93
+ this.authenticators = this._getRestClient('/users/:id/authenticators');
94
+
88
95
  this.organizations = this._getRestClient('/users/:id/organizations');
89
96
  }
90
97
 
@@ -742,6 +749,24 @@ class UsersManager extends BaseManager {
742
749
  return this.permissions.delete(query, data);
743
750
  }
744
751
 
752
+ deleteAllAuthenticators(params, cb) {
753
+ const query = params || {};
754
+
755
+ // Require a user ID.
756
+ if (!query.id) {
757
+ throw new ArgumentError('The user_id cannot be null or undefined');
758
+ }
759
+ if (typeof query.id !== 'string') {
760
+ throw new ArgumentError('The user_id has to be a string');
761
+ }
762
+
763
+ if (cb && cb instanceof Function) {
764
+ return this.authenticators.delete(query, cb);
765
+ }
766
+
767
+ return this.authenticators.delete(query);
768
+ }
769
+
745
770
  /**
746
771
  * Get a list of organizations for a user.
747
772
  *