auth0 3.6.1 → 3.7.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.7.0](https://github.com/auth0/node-auth0/tree/v3.7.0) (2023-08-29)
4
+
5
+ [Full Changelog](https://github.com/auth0/node-auth0/compare/v3.6.0...v3.7.0)
6
+
7
+ **Added**
8
+
9
+ - feat: add configuration for using persistent connections [\#919](https://github.com/auth0/node-auth0/pull/919) ([alaczi](https://github.com/alaczi))
10
+
3
11
  ## [v3.6.1](https://github.com/auth0/node-auth0/tree/v3.6.1) (2023-08-22)
4
12
 
5
13
  [Full Changelog](https://github.com/auth0/node-auth0/compare/v3.6.0...v3.6.1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0",
3
- "version": "3.6.1",
3
+ "version": "3.7.0",
4
4
  "description": "SDK for Auth0 API v2",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.mjs",
@@ -10,7 +10,8 @@ class DatabaseAuthenticator {
10
10
  * @param {object} options Authenticator options.
11
11
  * @param {string} options.baseUrl The auth0 account URL.
12
12
  * @param {string} [options.clientId] Default client ID.
13
- * @param {string} [options.proxy] Add the `superagent-proxy` dependency and specify a proxy url eg 'https://myproxy.com:1234'
13
+ * @param {string} [options.proxy] Add the `superagent-proxy` dependency and specify a proxy url eg 'https://myproxy.com:1234'
14
+ * @param {boolean} [options.keepAlive] Keep the connection alive
14
15
  * @param {OAuthAuthenticator} oauth OAuthAuthenticator instance.
15
16
  */
16
17
  constructor(options, oauth) {
@@ -31,6 +32,7 @@ class DatabaseAuthenticator {
31
32
  errorFormatter: { message: 'message', name: 'error' },
32
33
  headers: options.headers,
33
34
  proxy: options.proxy,
35
+ keepAlive: options.keepAlive,
34
36
  };
35
37
 
36
38
  this.oauth = oauth;
@@ -56,6 +56,7 @@ class OAuthAuthenticator {
56
56
  errorFormatter: { message: 'message', name: 'error' },
57
57
  headers: options.headers,
58
58
  proxy: options.proxy,
59
+ keepAlive: options.keepAlive,
59
60
  };
60
61
 
61
62
  this.oauth = new RestClient(`${options.baseUrl}/oauth/:type`, clientOptions);
@@ -51,6 +51,7 @@ class PasswordlessAuthenticator {
51
51
  errorFormatter: { message: 'message', name: 'error' },
52
52
  headers: options.headers,
53
53
  proxy: options.proxy,
54
+ keepAlive: options.keepAlive,
54
55
  };
55
56
 
56
57
  this.oauth = oauth;
package/src/auth/index.js CHANGED
@@ -43,6 +43,7 @@ class AuthenticationClient {
43
43
  * @param {boolean} [options.__bypassIdTokenValidation] Whether the id_token should be validated or not
44
44
  * @param {object} [options.headers] Additional headers that will be added to the outgoing requests.
45
45
  * @param {string} [options.proxy] Add the `superagent-proxy` dependency and specify a proxy url eg 'https://myproxy.com:1234'
46
+ * @param {boolean} [options.keepAlive] Keep the http connections alive.
46
47
  */
47
48
  constructor(options) {
48
49
  if (!options || typeof options !== 'object') {
@@ -69,6 +70,7 @@ class AuthenticationClient {
69
70
  supportedAlgorithms: options.supportedAlgorithms,
70
71
  __bypassIdTokenValidation: options.__bypassIdTokenValidation,
71
72
  proxy: options.proxy,
73
+ keepAlive: options.keepAlive,
72
74
  };
73
75
 
74
76
  if (options.telemetry !== false) {
@@ -27,6 +27,7 @@ class BaseManager {
27
27
  proxy: options.proxy,
28
28
  query: { repeatParams: false },
29
29
  includeResponseHeaders: options.includeResponseHeaders,
30
+ keepAlive: options.keepAlive,
30
31
  };
31
32
 
32
33
  const usersAuth0RestClient = new Auth0RestClient(
@@ -108,7 +108,8 @@ class ManagementClient {
108
108
  * @param {number} [options.retry.maxRetries=10] Retry failed requests X times.
109
109
  * @param {object} [options.headers] Additional headers that will be added to the outgoing requests.
110
110
  * @param {string} [options.proxy] Add the `superagent-proxy` dependency and specify a proxy url eg 'https://myproxy.com:1234'
111
- * @param {boolean} [options.includeResponseHeaders] Include the response headers in the payload in the format `{ data, headers }`.
111
+ * @param {boolean} [options.includeResponseHeaders] Include the response headers in the payload in the format `{ data, headers }`.
112
+ * @param {boolean} [options.keepAlive] Keep the http connections alive.
112
113
  */
113
114
  constructor(options) {
114
115
  if (!options || typeof options !== 'object') {
@@ -172,6 +173,7 @@ class ManagementClient {
172
173
  managerOptions.retry = options.retry;
173
174
  managerOptions.includeResponseHeaders = options.includeResponseHeaders;
174
175
  managerOptions.proxy = options.proxy;
176
+ managerOptions.keepAlive = options.keepAlive;
175
177
 
176
178
  /**
177
179
  * Simple abstraction for performing CRUD operations on the