auth0 3.4.0 → 4.0.0-beta.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.
Files changed (51) hide show
  1. package/README.md +19 -15
  2. package/package.json +47 -33
  3. package/CHANGELOG.md +0 -685
  4. package/src/Auth0RestClient.js +0 -123
  5. package/src/RetryRestClient.js +0 -105
  6. package/src/auth/DatabaseAuthenticator.js +0 -282
  7. package/src/auth/OAUthWithIDTokenValidation.js +0 -124
  8. package/src/auth/OAuthAuthenticator.js +0 -405
  9. package/src/auth/PasswordlessAuthenticator.js +0 -303
  10. package/src/auth/TokensManager.js +0 -254
  11. package/src/auth/UsersManager.js +0 -161
  12. package/src/auth/clientAuthentication.js +0 -86
  13. package/src/auth/idToken.js +0 -167
  14. package/src/auth/index.js +0 -573
  15. package/src/errors.js +0 -60
  16. package/src/index.js +0 -11
  17. package/src/index.mjs +0 -4
  18. package/src/management/ActionsManager.js +0 -526
  19. package/src/management/AttackProtectionManager.js +0 -158
  20. package/src/management/BaseManager.js +0 -41
  21. package/src/management/BlacklistedTokensManager.js +0 -67
  22. package/src/management/BrandingManager.js +0 -250
  23. package/src/management/ClientCredentialsManager.js +0 -112
  24. package/src/management/ClientGrantsManager.js +0 -124
  25. package/src/management/ClientsManager.js +0 -184
  26. package/src/management/ConnectionsManager.js +0 -213
  27. package/src/management/CustomDomainsManager.js +0 -141
  28. package/src/management/DeviceCredentialsManager.js +0 -91
  29. package/src/management/EmailProviderManager.js +0 -101
  30. package/src/management/EmailTemplatesManager.js +0 -90
  31. package/src/management/GrantsManager.js +0 -84
  32. package/src/management/GuardianManager.js +0 -361
  33. package/src/management/HooksManager.js +0 -295
  34. package/src/management/JobsManager.js +0 -324
  35. package/src/management/LogStreamsManager.js +0 -136
  36. package/src/management/LogsManager.js +0 -82
  37. package/src/management/ManagementTokenProvider.js +0 -144
  38. package/src/management/MigrationsManager.js +0 -76
  39. package/src/management/OrganizationsManager.js +0 -721
  40. package/src/management/PromptsManager.js +0 -162
  41. package/src/management/ResourceServersManager.js +0 -143
  42. package/src/management/RolesManager.js +0 -329
  43. package/src/management/RulesConfigsManager.js +0 -86
  44. package/src/management/RulesManager.js +0 -148
  45. package/src/management/StatsManager.js +0 -84
  46. package/src/management/TenantManager.js +0 -76
  47. package/src/management/TicketsManager.js +0 -104
  48. package/src/management/UserBlocksManager.js +0 -121
  49. package/src/management/UsersManager.js +0 -882
  50. package/src/management/index.js +0 -3409
  51. package/src/utils.js +0 -60
package/README.md CHANGED
@@ -1,16 +1,17 @@
1
1
  ![Node.js client library for Auth0](https://cdn.auth0.com/website/sdks/banner/node-auth0-banner.png)
2
2
 
3
+ > ⚠️ Please be aware that v4 is currently in <strong>Beta</strong>. Whilst we encourage you to test the update within your applications, we do no recommend using this version in production yet.
4
+
3
5
  ![Release](https://img.shields.io/npm/v/auth0)
4
6
  [![Codecov](https://img.shields.io/codecov/c/github/auth0/node-auth0)](https://codecov.io/gh/auth0/node-auth0)
5
7
  ![Downloads](https://img.shields.io/npm/dw/auth0)
6
8
  [![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
7
9
  ![CircleCI](https://img.shields.io/circleci/build/github/auth0/node-auth0)
8
10
 
9
- 📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started) - 💻 [API Reference](#api-reference) - 💬 [Feedback](#feedback)
11
+ 📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started) - 💬 [Feedback](#feedback)
10
12
 
11
13
  ## Documentation
12
14
 
13
- - [FAQs](https://github.com/auth0/node-auth0/blob/master/FAQ.md) - frequently asked questions about node-auth0.
14
15
  - [Docs Site](https://auth0.com/docs) - explore our docs site and learn more about Auth0
15
16
 
16
17
  ## Getting Started
@@ -19,56 +20,59 @@
19
20
 
20
21
  This library supports the following tooling versions:
21
22
 
22
- - Node.js: `>=8.3.0`
23
+ - Node.js: `>=16`
23
24
 
24
25
  ### Installation
25
26
 
26
27
  Using [npm](https://npmjs.org) in your project directory run the following command:
27
28
 
28
29
  ```bash
29
- npm install auth0
30
+ npm install auth0@beta
30
31
  ```
31
32
 
32
33
  ### Configure the SDK
33
34
 
34
35
  #### Authentication API Client
35
36
 
36
- This client must be used to access Auth0's [Authentication API](https://auth0.com/docs/api/authentication).
37
+ This client can be used to access Auth0's [Authentication API](https://auth0.com/docs/api/authentication).
37
38
 
38
39
  The **AuthenticationClient** constructor takes an _optional_ client ID, if specified it will be used as default value for all endpoints that accept a client ID.
39
40
 
40
41
  ```js
41
- var AuthenticationClient = require('auth0').AuthenticationClient;
42
+ import { AuthenticationClient } from 'auth0';
42
43
 
43
- var auth0 = new AuthenticationClient({
44
+ const auth0 = new AuthenticationClient({
44
45
  domain: '{YOUR_ACCOUNT}.auth0.com',
45
46
  clientId: '{OPTIONAL_CLIENT_ID}',
47
+ clientSecret: '{OPTIONAL_CLIENT_SECRET}',
46
48
  });
47
49
  ```
48
50
 
49
51
  #### Management API Client
50
52
 
51
- > Note: When using the ManagementClient in a browser you should set `telemetry: false`.
52
-
53
53
  The Auth0 Management API is meant to be used by back-end servers or trusted parties performing administrative tasks. Generally speaking, anything that can be done through the Auth0 dashboard (and more) can also be done through this API.
54
54
 
55
55
  Initialize your client class with an API v2 token and a domain.
56
56
 
57
57
  ```js
58
- var ManagementClient = require('auth0').ManagementClient;
58
+ import { ManagementClient } from 'auth0';
59
59
 
60
60
  var management = new ManagementClient({
61
- token: '{YOUR_API_V2_TOKEN}',
62
61
  domain: '{YOUR_ACCOUNT}.auth0.com',
62
+ token: '{YOUR_API_V2_TOKEN}',
63
63
  });
64
64
  ```
65
65
 
66
- For other examples see the [EXAMPLES.md](https://github.com/auth0/node-auth0/blob/master/EXAMPLES.md) document.
66
+ Or, initialize your client class with a client secret and a domain.
67
67
 
68
- ## API Reference
68
+ ```js
69
+ import { ManagementClient } from 'auth0';
69
70
 
70
- - [AuthenticationClient](https://auth0.github.io/node-auth0/AuthenticationClient.html)
71
- - [ManagementClient](https://auth0.github.io/node-auth0/ManagementClient.html)
71
+ var management = new ManagementClient({
72
+ token: '{YOUR_API_V2_TOKEN}',
73
+ domain: '{YOUR_ACCOUNT}.auth0.com',
74
+ });
75
+ ```
72
76
 
73
77
  ## Feedback
74
78
 
package/package.json CHANGED
@@ -1,27 +1,39 @@
1
1
  {
2
2
  "name": "auth0",
3
- "version": "3.4.0",
3
+ "version": "4.0.0-beta.0",
4
4
  "description": "SDK for Auth0 API v2",
5
- "main": "src/index.js",
6
- "module": "src/index.mjs",
5
+ "main": "dist/cjs/index.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "require": "./dist/cjs/index.js",
11
+ "import": "./dist/esm/index.js",
12
+ "types": "./dist/types/index.d.ts"
13
+ }
14
+ },
7
15
  "sideEffects": false,
8
16
  "files": [
9
- "src"
17
+ "dist"
10
18
  ],
11
19
  "scripts": {
12
- "test": "mocha --reporter spec './test/**/*.tests.js'",
13
- "test:ci": "nyc npm run test -- --forbid-only --reporter mocha-junit-reporter",
14
- "test:watch": "cross-env NODE_ENV=test mocha --timeout 5000 './test/**/*.tests.js' './test/*.tests.js' --watch",
15
- "jsdoc:generate": "jsdoc --configure .jsdoc.json --verbose",
20
+ "prebuild": "rm -rf dist",
21
+ "build": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json ./tsconfig.types.json && echo '{\"type\": \"commonjs\"}'> dist/cjs/package.json",
22
+ "docs": "typedoc --options typedoc.cjs",
23
+ "test": "npm run test:mocha && npm run test:jest",
24
+ "test:mocha": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' mocha",
25
+ "test:jest": "NODE_OPTIONS='--experimental-vm-modules --no-warnings' jest",
26
+ "test:ci": "c8 npm run test",
16
27
  "precommit": "pretty-quick --staged",
17
- "lint": "eslint ."
28
+ "lint": "eslint ./src --ext ts",
29
+ "start:playground": "node --experimental-specifier-resolution=node --no-warnings --loader ts-node/esm playground/index.ts"
18
30
  },
19
31
  "repository": {
20
32
  "type": "git",
21
33
  "url": "https://github.com/auth0/node-auth0"
22
34
  },
23
35
  "engines": {
24
- "node": ">=14"
36
+ "node": ">=16"
25
37
  },
26
38
  "keywords": [
27
39
  "auth0",
@@ -34,39 +46,41 @@
34
46
  },
35
47
  "homepage": "https://github.com/auth0/node-auth0",
36
48
  "dependencies": {
37
- "axios": "^0.27.2",
38
- "form-data": "^3.0.1",
39
- "jsonwebtoken": "^9.0.0",
40
- "jwks-rsa": "^3.0.1",
41
- "lru-memoizer": "^2.1.4",
42
- "rest-facade": "^1.16.3",
43
- "retry": "^0.13.1",
49
+ "form-data": "^4.0.0",
50
+ "jose": "^4.13.2",
51
+ "node-fetch": "^2.6.7",
44
52
  "uuid": "^9.0.0"
45
53
  },
46
54
  "devDependencies": {
55
+ "@types/chai": "^4.3.4",
56
+ "@types/chai-as-promised": "^7.1.5",
57
+ "@types/jest": "^29.5.0",
58
+ "@types/mocha": "^10.0.1",
59
+ "@types/node-fetch": "^2.6.3",
60
+ "@types/uuid": "^9.0.1",
61
+ "@typescript-eslint/eslint-plugin": "^5.58.0",
62
+ "@typescript-eslint/parser": "^5.58.0",
63
+ "c8": "^7.13.0",
47
64
  "chai": "^4.2.0",
48
- "cross-env": "^5.2.0",
65
+ "chai-as-promised": "^7.1.1",
66
+ "commander": "^10.0.1",
67
+ "dotenv": "^16.0.3",
49
68
  "eslint": "^8.16.0",
50
- "eslint-config-prettier": "^8.5.0",
51
- "eslint-plugin-jsdoc": "^37.0.3",
69
+ "eslint-config-prettier": "^8.8.0",
70
+ "eslint-plugin-import": "^2.27.5",
52
71
  "eslint-plugin-node": "^11.1.0",
53
- "eslint-plugin-prettier": "^4.0.0",
72
+ "eslint-plugin-prettier": "^4.2.1",
54
73
  "eslint-plugin-promise": "^6.0.0",
55
74
  "husky": "^3.0.1",
56
- "jsdoc": "^3.6.7",
57
- "json-loader": "^0.5.7",
58
- "jws": "^3.2.2",
59
- "minami": "^1.2.3",
60
- "mocha": "^8.4.0",
61
- "mocha-junit-reporter": "^2.0.0",
75
+ "jest": "^29.5.0",
76
+ "mocha": "^9.1.3",
62
77
  "nock": "^13.2.7",
63
- "nyc": "^14.1.1",
64
- "prettier": "2.4.1",
78
+ "prettier": "^2.8.7",
65
79
  "pretty-quick": "^1.11.1",
66
- "proxyquire": "^2.1.3",
67
80
  "sinon": "^14.0.0",
68
- "string-replace-webpack-plugin": "0.1.3",
69
- "superagent-proxy": "^3.0.0",
70
- "webpack": "^4.36.1"
81
+ "ts-jest": "^29.1.0",
82
+ "ts-node": "^10.9.1",
83
+ "typedoc": "^0.24.6",
84
+ "typescript": "4.9.5"
71
85
  }
72
86
  }