@auth0/auth0-spa-js 1.22.3 → 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 +996 -4901
  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 +1768 -5532
  9. package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
  10. package/dist/typings/Auth0Client.d.ts +21 -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 +407 -562
  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,4 +1,5 @@
1
1
  import { MissingRefreshTokenError } from '../errors';
2
+ import { createQueryParams } from '../utils';
2
3
  import { WorkerRefreshTokenMessage } from './worker.types';
3
4
 
4
5
  let refreshTokens: Record<string, string> = {};
@@ -54,10 +55,10 @@ const messageHandler = async ({
54
55
  }
55
56
 
56
57
  fetchOptions.body = useFormData
57
- ? new URLSearchParams({
58
+ ? createQueryParams({
58
59
  ...body,
59
60
  refresh_token: refreshToken
60
- }).toString()
61
+ })
61
62
  : JSON.stringify({
62
63
  ...body,
63
64
  refresh_token: refreshToken
@@ -122,9 +123,9 @@ const messageHandler = async ({
122
123
  };
123
124
 
124
125
  // Don't run `addEventListener` in our tests (this is replaced in rollup)
125
- /* istanbul ignore else */
126
126
  if (process.env.NODE_ENV === 'test') {
127
127
  module.exports = { messageHandler };
128
+ /* c8 ignore next 4 */
128
129
  } else {
129
130
  // @ts-ignore
130
131
  addEventListener('message', messageHandler);
@@ -1,5 +0,0 @@
1
- /**
2
- * @ignore
3
- */
4
- declare const wrapper: any;
5
- export default wrapper;
@@ -1 +0,0 @@
1
- export declare const isIE11: () => boolean;
package/src/index.cjs.ts DELETED
@@ -1,23 +0,0 @@
1
- import createAuth0Client, {
2
- Auth0Client,
3
- GenericError,
4
- AuthenticationError,
5
- TimeoutError,
6
- PopupTimeoutError,
7
- MfaRequiredError
8
- } from './index';
9
-
10
- /**
11
- * @ignore
12
- */
13
- const wrapper = createAuth0Client as any;
14
-
15
- wrapper.Auth0Client = Auth0Client;
16
- wrapper.createAuth0Client = createAuth0Client;
17
- wrapper.GenericError = GenericError;
18
- wrapper.AuthenticationError = AuthenticationError;
19
- wrapper.TimeoutError = TimeoutError;
20
- wrapper.PopupTimeoutError = PopupTimeoutError;
21
- wrapper.MfaRequiredError = MfaRequiredError;
22
-
23
- export default wrapper;
package/src/user-agent.ts DELETED
@@ -1 +0,0 @@
1
- export const isIE11 = () => /Trident.*rv:11\.0/.test(navigator.userAgent);