@auth0/auth0-spa-js 1.22.4 → 2.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 (41) hide show
  1. package/README.md +50 -41
  2. package/dist/auth0-spa-js.development.js +1000 -4923
  3. package/dist/auth0-spa-js.development.js.map +1 -1
  4. package/dist/auth0-spa-js.production.esm.js +1 -1
  5. package/dist/auth0-spa-js.production.esm.js.map +1 -1
  6. package/dist/auth0-spa-js.production.js +1 -1
  7. package/dist/auth0-spa-js.production.js.map +1 -1
  8. package/dist/lib/auth0-spa-js.cjs.js +1734 -5516
  9. package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
  10. package/dist/typings/Auth0Client.d.ts +14 -41
  11. package/dist/typings/Auth0Client.utils.d.ts +26 -0
  12. package/dist/typings/cache/cache-manager.d.ts +11 -7
  13. package/dist/typings/cache/shared.d.ts +16 -11
  14. package/dist/typings/constants.d.ts +0 -7
  15. package/dist/typings/errors.d.ts +0 -4
  16. package/dist/typings/global.d.ts +125 -167
  17. package/dist/typings/index.d.ts +3 -13
  18. package/dist/typings/transaction-manager.d.ts +1 -1
  19. package/dist/typings/utils.d.ts +8 -7
  20. package/dist/typings/version.d.ts +1 -1
  21. package/package.json +35 -36
  22. package/src/Auth0Client.ts +385 -561
  23. package/src/Auth0Client.utils.ts +73 -0
  24. package/src/cache/cache-localstorage.ts +1 -1
  25. package/src/cache/cache-manager.ts +58 -29
  26. package/src/cache/shared.ts +29 -17
  27. package/src/constants.ts +0 -17
  28. package/src/errors.ts +10 -14
  29. package/src/global.ts +132 -183
  30. package/src/http.ts +0 -5
  31. package/src/index.ts +15 -14
  32. package/src/jwt.ts +3 -3
  33. package/src/storage.ts +1 -1
  34. package/src/transaction-manager.ts +1 -1
  35. package/src/utils.ts +37 -42
  36. package/src/version.ts +1 -1
  37. package/src/worker/token.worker.ts +4 -3
  38. package/dist/typings/index.cjs.d.ts +0 -5
  39. package/dist/typings/user-agent.d.ts +0 -1
  40. package/src/index.cjs.ts +0 -23
  41. package/src/user-agent.ts +0 -1
@@ -1,8 +1,5 @@
1
1
  import { ICache } from './cache';
2
- /**
3
- * @ignore
4
- */
5
- export interface BaseLoginOptions {
2
+ export interface AuthorizationParams {
6
3
  /**
7
4
  * - `'page'`: displays the UI with a full page view
8
5
  * - `'popup'`: displays the UI with a popup window
@@ -18,7 +15,7 @@ export interface BaseLoginOptions {
18
15
  */
19
16
  prompt?: 'none' | 'login' | 'consent' | 'select_account';
20
17
  /**
21
- * Maximum allowable elasped time (in seconds) since authentication.
18
+ * Maximum allowable elapsed time (in seconds) since authentication.
22
19
  * If the last time the user authenticated is greater than this value,
23
20
  * the user must be reauthenticated.
24
21
  */
@@ -51,8 +48,11 @@ export interface BaseLoginOptions {
51
48
  acr_values?: string;
52
49
  /**
53
50
  * The default scope to be used on authentication requests.
54
- * The defaultScope defined in the Auth0Client is included
55
- * along with this scope
51
+ *
52
+ * This defaults to `profile email` if not set. If you are setting extra scopes and require
53
+ * `profile` and `email` to be included then you must include them in the provided scope.
54
+ *
55
+ * Note: The `openid` scope is **always applied** regardless of this setting.
56
56
  */
57
57
  scope?: string;
58
58
  /**
@@ -76,20 +76,26 @@ export interface BaseLoginOptions {
76
76
  * The Id of an invitation to accept. This is available from the user invitation URL that is given when participating in a user invitation flow.
77
77
  */
78
78
  invitation?: string;
79
+ /**
80
+ * The default URL where Auth0 will redirect your browser to with
81
+ * the authentication result. It must be whitelisted in
82
+ * the "Allowed Callback URLs" field in your Auth0 Application's
83
+ * settings. If not provided here, it should be provided in the other
84
+ * methods that provide authentication.
85
+ */
86
+ redirect_uri?: string;
79
87
  /**
80
88
  * If you need to send custom parameters to the Authorization Server,
81
89
  * make sure to use the original parameter name.
82
90
  */
83
91
  [key: string]: any;
84
92
  }
85
- interface AdvancedOptions {
93
+ interface BaseLoginOptions {
86
94
  /**
87
- * The default scope to be included with all requests.
88
- * If not provided, 'openid profile email' is used. This can be set to `null` in order to effectively remove the default scopes.
89
- *
90
- * Note: The `openid` scope is **always applied** regardless of this setting.
95
+ * URL parameters that will be sent back to the Authorization Server. This can be known parameters
96
+ * defined by Auth0 or custom parameters that you define.
91
97
  */
92
- defaultScope?: string;
98
+ authorizationParams?: AuthorizationParams;
93
99
  }
94
100
  export interface Auth0ClientOptions extends BaseLoginOptions {
95
101
  /**
@@ -105,15 +111,7 @@ export interface Auth0ClientOptions extends BaseLoginOptions {
105
111
  /**
106
112
  * The Client ID found on your Application settings page
107
113
  */
108
- client_id: string;
109
- /**
110
- * The default URL where Auth0 will redirect your browser to with
111
- * the authentication result. It must be whitelisted in
112
- * the "Allowed Callback URLs" field in your Auth0 Application's
113
- * settings. If not provided here, it should be provided in the other
114
- * methods that provide authentication.
115
- */
116
- redirect_uri?: string;
114
+ clientId: string;
117
115
  /**
118
116
  * The value in seconds used to account for clock skew in JWT expirations.
119
117
  * Typically, this value is no more than a minute or two at maximum.
@@ -139,23 +137,24 @@ export interface Auth0ClientOptions extends BaseLoginOptions {
139
137
  */
140
138
  useRefreshTokens?: boolean;
141
139
  /**
142
- * If true, fallback to the technique of using a hidden iframe and the `authorization_code` grant with `prompt=none` when unable to use refresh tokens.
143
- * The default setting is `true`.
140
+ * If true, fallback to the technique of using a hidden iframe and the `authorization_code` grant with `prompt=none` when unable to use refresh tokens. If false, the iframe fallback is not used and
141
+ * errors relating to a failed `refresh_token` grant should be handled appropriately. The default setting is `false`.
144
142
  *
145
143
  * **Note**: There might be situations where doing silent auth with a Web Message response from an iframe is not possible,
146
144
  * like when you're serving your application from the file system or a custom protocol (like in a Desktop or Native app).
147
- * In situations like this you can disable the iframe fallback and handle the failed Refresh Grant and prompt the user to login interactively with `loginWithRedirect` or `loginWithPopup`."
145
+ * In situations like this you can disable the iframe fallback and handle the failed `refresh_token` grant and prompt the user to login interactively with `loginWithRedirect` or `loginWithPopup`."
148
146
  *
149
147
  * E.g. Using the `file:` protocol in an Electron application does not support that legacy technique.
150
148
  *
151
- * let token: string;
152
- * try {
153
- * token = await auth0.getTokenSilently();
154
- * } catch (e) {
155
- * if (e.error === 'missing_refresh_token' || e.error === 'invalid_grant') {
156
- * auth0.loginWithRedirect();
157
- * }
158
- * }
149
+ * @example
150
+ * let token: string;
151
+ * try {
152
+ * token = await auth0.getTokenSilently();
153
+ * } catch (e) {
154
+ * if (e.error === 'missing_refresh_token' || e.error === 'invalid_grant') {
155
+ * auth0.loginWithRedirect();
156
+ * }
157
+ * }
159
158
  */
160
159
  useRefreshTokensFallback?: boolean;
161
160
  /**
@@ -199,10 +198,6 @@ export interface Auth0ClientOptions extends BaseLoginOptions {
199
198
  * may end up spanning across multiple tabs (e.g. magic links) or you cannot otherwise rely on session storage being available.
200
199
  */
201
200
  useCookiesForTransactions?: boolean;
202
- /**
203
- * Changes to recommended defaults, like defaultScope
204
- */
205
- advancedOptions?: AdvancedOptions;
206
201
  /**
207
202
  * Number of days until the cookie `auth0.is.authenticated` will expire
208
203
  * Defaults to 1.
@@ -221,11 +216,10 @@ export interface Auth0ClientOptions extends BaseLoginOptions {
221
216
  */
222
217
  cookieDomain?: string;
223
218
  /**
224
- * When true, data to the token endpoint is transmitted as x-www-form-urlencoded data instead of JSON. The default is false, but will default to true in a
225
- * future major version.
219
+ * If true, data to the token endpoint is transmitted as x-www-form-urlencoded data, if false it will be transmitted as JSON. The default setting is `true`.
226
220
  *
227
- * **Note:** Setting this to `true` may affect you if you use Auth0 Rules and are sending custom, non-primative data. If you enable this, please verify that your Auth0 Rules
228
- * continue to work as intended.
221
+ * **Note:** Setting this to `false` may affect you if you use Auth0 Rules and are sending custom, non-primitive data. If you disable this,
222
+ * please verify that your Auth0 Rules continue to work as intended.
229
223
  */
230
224
  useFormData?: boolean;
231
225
  /**
@@ -242,7 +236,7 @@ export declare type CacheLocation = 'memory' | 'localstorage';
242
236
  /**
243
237
  * @ignore
244
238
  */
245
- export interface AuthorizeOptions extends BaseLoginOptions {
239
+ export interface AuthorizeOptions extends AuthorizationParams {
246
240
  response_type: string;
247
241
  response_mode: string;
248
242
  redirect_uri: string;
@@ -253,13 +247,6 @@ export interface AuthorizeOptions extends BaseLoginOptions {
253
247
  code_challenge_method: string;
254
248
  }
255
249
  export interface RedirectLoginOptions<TAppState = any> extends BaseLoginOptions {
256
- /**
257
- * The URL where Auth0 will redirect your browser to with
258
- * the authentication result. It must be whitelisted in
259
- * the "Allowed Callback URLs" field in your Auth0 Application's
260
- * settings.
261
- */
262
- redirect_uri?: string;
263
250
  /**
264
251
  * Used to store state before doing the redirect
265
252
  */
@@ -269,9 +256,16 @@ export interface RedirectLoginOptions<TAppState = any> extends BaseLoginOptions
269
256
  */
270
257
  fragment?: string;
271
258
  /**
272
- * Used to select the window.location method used to redirect
273
- */
274
- redirectMethod?: 'replace' | 'assign';
259
+ * Used to control the redirect and not rely on the SDK to do the actual redirect.
260
+ *
261
+ * @example
262
+ * const client = new Auth0Client({
263
+ * async onRedirect(url) {
264
+ * window.location.replace(url);
265
+ * }
266
+ * });
267
+ */
268
+ onRedirect?: (url: string) => Promise<void>;
275
269
  }
276
270
  export interface RedirectLoginResult<TAppState = any> {
277
271
  /**
@@ -294,50 +288,41 @@ export interface PopupConfigOptions {
294
288
  */
295
289
  popup?: any;
296
290
  }
297
- export interface GetUserOptions {
298
- /**
299
- * The scope that was used in the authentication request
300
- */
301
- scope?: string;
302
- /**
303
- * The audience that was used in the authentication request
304
- */
305
- audience?: string;
306
- }
307
- export interface GetIdTokenClaimsOptions {
308
- /**
309
- * The scope that was used in the authentication request
310
- */
311
- scope?: string;
312
- /**
313
- * The audience that was used in the authentication request
314
- */
315
- audience?: string;
316
- }
317
- export declare type getIdTokenClaimsOptions = GetIdTokenClaimsOptions;
318
291
  export interface GetTokenSilentlyOptions {
319
292
  /**
320
- * When `true`, ignores the cache and always sends a
293
+ * When `off`, ignores the cache and always sends a
321
294
  * request to Auth0.
322
- */
323
- ignoreCache?: boolean;
324
- /**
325
- * There's no actual redirect when getting a token silently,
326
- * but, according to the spec, a `redirect_uri` param is required.
327
- * Auth0 uses this parameter to validate that the current `origin`
328
- * matches the `redirect_uri` `origin` when sending the response.
329
- * It must be whitelisted in the "Allowed Web Origins" in your
330
- * Auth0 Application's settings.
331
- */
332
- redirect_uri?: string;
333
- /**
334
- * The scope that was used in the authentication request
335
- */
336
- scope?: string;
337
- /**
338
- * The audience that was used in the authentication request
339
- */
340
- audience?: string;
295
+ * When `cache-only`, only reads from the cache and never sends a request to Auth0.
296
+ * Defaults to `on`, where it both reads from the cache and sends a request to Auth0 as needed.
297
+ */
298
+ cacheMode?: 'on' | 'off' | 'cache-only';
299
+ /**
300
+ * Parameters that will be sent back to Auth0 as part of a request.
301
+ */
302
+ authorizationParams?: {
303
+ /**
304
+ * There's no actual redirect when getting a token silently,
305
+ * but, according to the spec, a `redirect_uri` param is required.
306
+ * Auth0 uses this parameter to validate that the current `origin`
307
+ * matches the `redirect_uri` `origin` when sending the response.
308
+ * It must be whitelisted in the "Allowed Web Origins" in your
309
+ * Auth0 Application's settings.
310
+ */
311
+ redirect_uri?: string;
312
+ /**
313
+ * The scope that was used in the authentication request
314
+ */
315
+ scope?: string;
316
+ /**
317
+ * The audience that was used in the authentication request
318
+ */
319
+ audience?: string;
320
+ /**
321
+ * If you need to send custom parameters to the Authorization Server,
322
+ * make sure to use the original parameter name.
323
+ */
324
+ [key: string]: any;
325
+ };
341
326
  /** A maximum number of seconds to wait before declaring the background /authorize call as failed for timeout
342
327
  * Defaults to 60s.
343
328
  */
@@ -349,90 +334,69 @@ export interface GetTokenSilentlyOptions {
349
334
  * The default is `false`.
350
335
  */
351
336
  detailedResponse?: boolean;
352
- /**
353
- * If you need to send custom parameters to the Authorization Server,
354
- * make sure to use the original parameter name.
355
- */
356
- [key: string]: any;
357
337
  }
358
338
  export interface GetTokenWithPopupOptions extends PopupLoginOptions {
359
339
  /**
360
- * When `true`, ignores the cache and always sends a
361
- * request to Auth0.
340
+ * When `off`, ignores the cache and always sends a request to Auth0.
341
+ * When `cache-only`, only reads from the cache and never sends a request to Auth0.
342
+ * Defaults to `on`, where it both reads from the cache and sends a request to Auth0 as needed.
362
343
  */
363
- ignoreCache?: boolean;
344
+ cacheMode?: 'on' | 'off' | 'cache-only';
364
345
  }
365
346
  export interface LogoutUrlOptions {
366
347
  /**
367
- * The URL where Auth0 will redirect your browser to after the logout.
368
- *
369
- * **Note**: If the `client_id` parameter is included, the
370
- * `returnTo` URL that is provided must be listed in the
371
- * Application's "Allowed Logout URLs" in the Auth0 dashboard.
372
- * However, if the `client_id` parameter is not included, the
373
- * `returnTo` URL must be listed in the "Allowed Logout URLs" at
374
- * the account level in the Auth0 dashboard.
375
- *
376
- * [Read more about how redirecting after logout works](https://auth0.com/docs/logout/guides/redirect-users-after-logout)
377
- */
378
- returnTo?: string;
379
- /**
380
- * The `client_id` of your application.
348
+ * The `clientId` of your application.
381
349
  *
382
- * If this property is not set, then the `client_id` that was used during initialization of the SDK is sent to the logout endpoint.
350
+ * If this property is not set, then the `clientId` that was used during initialization of the SDK is sent to the logout endpoint.
383
351
  *
384
352
  * If this property is set to `null`, then no client ID value is sent to the logout endpoint.
385
353
  *
386
354
  * [Read more about how redirecting after logout works](https://auth0.com/docs/logout/guides/redirect-users-after-logout)
387
355
  */
388
- client_id?: string;
389
- /**
390
- * When supported by the upstream identity provider,
391
- * forces the user to logout of their identity provider
392
- * and from Auth0.
393
- * [Read more about how federated logout works at Auth0](https://auth0.com/docs/logout/guides/logout-idps)
394
- */
395
- federated?: boolean;
356
+ clientId?: string;
357
+ /**
358
+ * Parameters to pass to the logout endpoint. This can be known parameters defined by Auth0 or custom parameters
359
+ * you wish to provide.
360
+ */
361
+ logoutParams?: {
362
+ /**
363
+ * When supported by the upstream identity provider,
364
+ * forces the user to logout of their identity provider
365
+ * and from Auth0.
366
+ * [Read more about how federated logout works at Auth0](https://auth0.com/docs/logout/guides/logout-idps)
367
+ */
368
+ federated?: boolean;
369
+ /**
370
+ * The URL where Auth0 will redirect your browser to after the logout.
371
+ *
372
+ * **Note**: If the `client_id` parameter is included, the
373
+ * `returnTo` URL that is provided must be listed in the
374
+ * Application's "Allowed Logout URLs" in the Auth0 dashboard.
375
+ * However, if the `client_id` parameter is not included, the
376
+ * `returnTo` URL must be listed in the "Allowed Logout URLs" at
377
+ * the account level in the Auth0 dashboard.
378
+ *
379
+ * [Read more about how redirecting after logout works](https://auth0.com/docs/logout/guides/redirect-users-after-logout)
380
+ */
381
+ returnTo?: string;
382
+ /**
383
+ * If you need to send custom parameters to the logout endpoint, make sure to use the original parameter name.
384
+ */
385
+ [key: string]: any;
386
+ };
396
387
  }
397
- export interface LogoutOptions {
398
- /**
399
- * The URL where Auth0 will redirect your browser to after the logout.
400
- *
401
- * **Note**: If the `client_id` parameter is included, the
402
- * `returnTo` URL that is provided must be listed in the
403
- * Application's "Allowed Logout URLs" in the Auth0 dashboard.
404
- * However, if the `client_id` parameter is not included, the
405
- * `returnTo` URL must be listed in the "Allowed Logout URLs" at
406
- * the account level in the Auth0 dashboard.
407
- *
408
- * [Read more about how redirecting after logout works](https://auth0.com/docs/logout/guides/redirect-users-after-logout)
409
- */
410
- returnTo?: string;
388
+ export interface LogoutOptions extends LogoutUrlOptions {
411
389
  /**
412
- * The `client_id` of your application.
413
- *
414
- * If this property is not set, then the `client_id` that was used during initialization of the SDK is sent to the logout endpoint.
390
+ * Used to control the redirect and not rely on the SDK to do the actual redirect.
415
391
  *
416
- * If this property is set to `null`, then no client ID value is sent to the logout endpoint.
417
- *
418
- * [Read more about how redirecting after logout works](https://auth0.com/docs/logout/guides/redirect-users-after-logout)
419
- */
420
- client_id?: string;
421
- /**
422
- * When supported by the upstream identity provider,
423
- * forces the user to logout of their identity provider
424
- * and from Auth0.
425
- * This option cannot be specified along with the `localOnly` option.
426
- * [Read more about how federated logout works at Auth0](https://auth0.com/docs/logout/guides/logout-idps)
427
- */
428
- federated?: boolean;
429
- /**
430
- * When `true`, this skips the request to the logout endpoint on the authorization server,
431
- * effectively performing a "local" logout of the application. No redirect should take place,
432
- * you should update local logged in state.
433
- * This option cannot be specified along with the `federated` option.
434
- */
435
- localOnly?: boolean;
392
+ * @example
393
+ * await auth0.logout({
394
+ * async onRedirect(url) {
395
+ * window.location.replace(url);
396
+ * }
397
+ * });
398
+ */
399
+ onRedirect?: (url: string) => Promise<void>;
436
400
  }
437
401
  /**
438
402
  * @ignore
@@ -455,9 +419,6 @@ export interface TokenEndpointOptions {
455
419
  useFormData?: boolean;
456
420
  [key: string]: any;
457
421
  }
458
- /**
459
- * @ignore
460
- */
461
422
  export declare type TokenEndpointResponse = {
462
423
  id_token: string;
463
424
  access_token: string;
@@ -494,9 +455,6 @@ export interface JWTVerifyOptions {
494
455
  organizationId?: string;
495
456
  now?: number;
496
457
  }
497
- /**
498
- * @ignore
499
- */
500
458
  export interface IdToken {
501
459
  __raw: string;
502
460
  name?: string;
@@ -1,14 +1,4 @@
1
- import 'core-js/es/string/starts-with';
2
- import 'core-js/es/symbol';
3
- import 'core-js/es/array/from';
4
- import 'core-js/es/typed-array/slice';
5
- import 'core-js/es/array/includes';
6
- import 'core-js/es/string/includes';
7
- import 'core-js/es/set';
8
- import 'promise-polyfill/src/polyfill';
9
- import 'fast-text-encoding';
10
- import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only';
11
- import Auth0Client from './Auth0Client';
1
+ import { Auth0Client } from './Auth0Client';
12
2
  import { Auth0ClientOptions } from './global';
13
3
  import './global';
14
4
  export * from './global';
@@ -21,7 +11,7 @@ export * from './global';
21
11
  * @param options The client options
22
12
  * @returns An instance of Auth0Client
23
13
  */
24
- export default function createAuth0Client(options: Auth0ClientOptions): Promise<Auth0Client>;
14
+ export declare function createAuth0Client(options: Auth0ClientOptions): Promise<Auth0Client>;
25
15
  export { Auth0Client };
26
16
  export { GenericError, AuthenticationError, TimeoutError, PopupTimeoutError, PopupCancelledError, MfaRequiredError } from './errors';
27
- export { ICache, LocalStorageCache, InMemoryCache, Cacheable } from './cache';
17
+ export { ICache, LocalStorageCache, InMemoryCache, Cacheable, DecodedToken, CacheEntry, WrappedCacheEntry, KeyManifestEntry, MaybePromise, CacheKey, CacheKeyData } from './cache';
@@ -9,7 +9,7 @@ interface Transaction {
9
9
  organizationId?: string;
10
10
  state?: string;
11
11
  }
12
- export default class TransactionManager {
12
+ export declare class TransactionManager {
13
13
  private storage;
14
14
  private clientId;
15
15
  private transaction;
@@ -4,19 +4,20 @@ export declare const runIframe: (authorizeUrl: string, eventOrigin: string, time
4
4
  export declare const openPopup: (url: string) => Window;
5
5
  export declare const runPopup: (config: PopupConfigOptions) => Promise<AuthenticationResult>;
6
6
  export declare const getCrypto: () => Crypto;
7
- export declare const getCryptoSubtle: () => any;
8
7
  export declare const createRandomString: () => string;
9
8
  export declare const encode: (value: string) => string;
10
9
  export declare const decode: (value: string) => string;
11
- export declare const createQueryParams: (params: any) => string;
10
+ export declare const createQueryParams: ({ clientId: client_id, ...params }: any) => string;
12
11
  export declare const sha256: (s: string) => Promise<any>;
13
12
  export declare const urlDecodeB64: (input: string) => string;
14
13
  export declare const bufferToBase64UrlEncoded: (input: number[] | Uint8Array) => string;
15
14
  export declare const validateCrypto: () => void;
16
15
  /**
17
- * Returns an empty string when value is falsy, or when it's value is included in the exclude argument.
18
- * @param value The value to check
19
- * @param exclude An array of values that should result in an empty string.
20
- * @returns The value, or an empty string when falsy or included in the exclude argument.
16
+ * @ignore
21
17
  */
22
- export declare function valueOrEmptyString(value: string, exclude?: string[]): string;
18
+ export declare const getDomain: (domainUrl: string) => string;
19
+ /**
20
+ * @ignore
21
+ */
22
+ export declare const getTokenIssuer: (issuer: string, domainUrl: string) => string;
23
+ export declare const parseNumber: (value: any) => number;
@@ -1,2 +1,2 @@
1
- declare const _default: "1.22.4";
1
+ declare const _default: "2.0.0-beta.0";
2
2
  export default _default;
package/package.json CHANGED
@@ -3,60 +3,68 @@
3
3
  "name": "@auth0/auth0-spa-js",
4
4
  "description": "Auth0 SDK for Single Page Applications using Authorization Code Grant Flow with PKCE",
5
5
  "license": "MIT",
6
- "version": "1.22.4",
6
+ "version": "2.0.0-beta.0",
7
7
  "main": "dist/lib/auth0-spa-js.cjs.js",
8
8
  "types": "dist/typings/index.d.ts",
9
9
  "module": "dist/auth0-spa-js.production.esm.js",
10
10
  "scripts": {
11
11
  "dev": "rimraf dist && rollup -c --watch",
12
12
  "start": "npm run dev",
13
- "docs": "typedoc --options ./typedoc.js --module commonjs",
13
+ "docs": "typedoc --options ./typedoc.js src",
14
14
  "build": "rimraf dist && rollup -m -c --environment NODE_ENV:production && npm run test:es-check",
15
- "build:stats": "npm run build -- --environment WITH_STATS:true && open stats.html",
15
+ "build:stats": "rimraf dist && rollup -m -c --environment NODE_ENV:production --environment WITH_STATS:true && npm run test:es-check && open bundle-stats/index.html",
16
16
  "lint:security": "eslint ./src --ext ts --no-eslintrc --config ./.eslintrc.security",
17
17
  "test": "jest --coverage --silent",
18
18
  "test:watch": "jest --coverage --watch",
19
19
  "test:debug": "node --inspect node_modules/.bin/jest --runInBand",
20
20
  "test:open:integration": "cypress open",
21
21
  "test:watch:integration": "concurrently --raw npm:dev 'npm:test:open:integration'",
22
- "test:es-check": "npm run test:es-check:es5 && npm run test:es-check:es2015:module",
23
- "test:es-check:es5": "es-check es5 'dist/auth0-spa-js.production.js'",
24
- "test:es-check:es2015:module": "es-check es2015 'dist/auth0-spa-js.production.esm.js' --module ",
22
+ "test:es-check": "npm run test:es-check:es2017 && npm run test:es-check:es2017:module",
23
+ "test:es-check:es2017": "es-check es2017 'dist/auth0-spa-js.production.js'",
24
+ "test:es-check:es2017:module": "es-check es2017 'dist/auth0-spa-js.production.esm.js' --module ",
25
25
  "test:integration:server": "npm run dev",
26
26
  "test:integration:tests": "wait-on http://localhost:3000/ && cypress run",
27
27
  "test:integration": "concurrently --raw --kill-others --success first npm:test:integration:server npm:test:integration:tests",
28
28
  "serve:coverage": "serve coverage/lcov-report -n",
29
29
  "serve:stats": "serve bundle-stats -n",
30
- "print-bundle-size": "node ./scripts/print-bundle-size",
30
+ "print-bundle-size": "node ./scripts/print-bundle-size.mjs",
31
31
  "prepack": "npm run build && node ./scripts/prepack",
32
32
  "publish:cdn": "ccu --trace"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@auth0/component-cdn-uploader": "github:auth0/component-cdn-uploader#v2.2.2",
36
- "@rollup/plugin-replace": "^2.4.2",
36
+ "@babel/core": "^7.18.13",
37
+ "@babel/preset-env": "^7.18.10",
38
+ "@rollup/plugin-replace": "^4.0.0",
37
39
  "@types/cypress": "^1.1.3",
38
- "@types/jest": "^27.0.2",
39
- "@typescript-eslint/eslint-plugin-tslint": "^4.33.0",
40
- "@typescript-eslint/parser": "^4.33.0",
40
+ "@types/jest": "^28.1.7",
41
+ "@typescript-eslint/eslint-plugin-tslint": "^5.33.1",
42
+ "@typescript-eslint/parser": "^5.33.1",
43
+ "babel-jest": "^28.1.3",
41
44
  "browserstack-cypress-cli": "1.8.1",
45
+ "browser-tabs-lock": "^1.2.15",
42
46
  "cli-table": "^0.3.6",
43
- "concurrently": "^6.4.0",
47
+ "concurrently": "^7.3.0",
44
48
  "cypress": "7.2.0",
45
- "es-check": "^6.1.1",
46
- "eslint": "^7.32.0",
47
- "gzip-size": "^6.0.0",
49
+ "es-check": "^7.0.0",
50
+ "es-cookie": "~1.3.2",
51
+ "eslint": "^8.22.0",
52
+ "gzip-size": "^7.0.0",
48
53
  "husky": "^7.0.4",
49
54
  "idtoken-verifier": "^2.2.2",
50
- "jest": "^27.3.1",
51
- "jest-junit": "^13.0.0",
52
- "jest-localstorage-mock": "^2.4.18",
55
+ "jest": "^28.1.3",
56
+ "jest-environment-jsdom": "^28.1.3",
57
+ "jest-fetch-mock": "^3.0.3",
58
+ "jest-junit": "^14.0.0",
59
+ "jest-localstorage-mock": "^2.4.22",
53
60
  "jsonwebtoken": "^8.5.1",
54
- "oidc-provider": "^7.10.1",
55
- "prettier": "^2.4.1",
61
+ "node-fetch": "^3.2.10",
62
+ "oidc-provider": "^7.11.5",
63
+ "prettier": "^2.7.1",
56
64
  "pretty-quick": "^3.1.2",
57
65
  "qss": "^2.0.3",
58
66
  "rimraf": "^3.0.2",
59
- "rollup": "^2.60.0",
67
+ "rollup": "^2.78.0",
60
68
  "rollup-plugin-analyzer": "^4.0.0",
61
69
  "rollup-plugin-commonjs": "^10.1.0",
62
70
  "rollup-plugin-dev": "^1.1.3",
@@ -64,27 +72,18 @@
64
72
  "rollup-plugin-node-resolve": "^5.2.0",
65
73
  "rollup-plugin-sourcemaps": "^0.6.3",
66
74
  "rollup-plugin-terser": "^7.0.2",
67
- "rollup-plugin-typescript2": "^0.30.0",
68
- "rollup-plugin-visualizer": "^5.5.2",
75
+ "rollup-plugin-typescript2": "^0.32.1",
76
+ "rollup-plugin-visualizer": "^5.7.1",
69
77
  "rollup-plugin-web-worker-loader": "^1.6.1",
70
- "serve": "^12.0.1",
71
- "ts-jest": "^27.0.7",
78
+ "serve": "^14.0.1",
79
+ "ts-jest": "^28.0.8",
72
80
  "tslib": "^2.4.0",
73
81
  "tslint": "^6.1.3",
74
82
  "tslint-config-security": "^1.16.0",
75
- "typedoc": "0.18.0",
76
- "typescript": "^4.4.4",
83
+ "typedoc": "^0.23.10",
84
+ "typescript": "^4.7.4",
77
85
  "wait-on": "^6.0.0"
78
86
  },
79
- "dependencies": {
80
- "abortcontroller-polyfill": "^1.7.3",
81
- "browser-tabs-lock": "^1.2.15",
82
- "core-js": "^3.24.0",
83
- "es-cookie": "~1.3.2",
84
- "fast-text-encoding": "^1.0.4",
85
- "promise-polyfill": "^8.2.3",
86
- "unfetch": "^4.2.0"
87
- },
88
87
  "files": [
89
88
  "src",
90
89
  "dist"