@aura-stack/auth 0.1.0-rc.7 → 0.1.0-rc.9

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 (117) hide show
  1. package/dist/@types/index.cjs +15 -15
  2. package/dist/@types/index.d.ts +31 -7
  3. package/dist/@types/index.js +1 -1
  4. package/dist/@types/router.d.cjs +1 -1
  5. package/dist/@types/router.d.d.ts +7 -7
  6. package/dist/@types/utility.cjs +15 -15
  7. package/dist/@types/utility.d.ts +6 -6
  8. package/dist/@types/utility.js +1 -1
  9. package/dist/actions/callback/access-token.cjs +143 -143
  10. package/dist/actions/callback/access-token.d.ts +20 -15
  11. package/dist/actions/callback/access-token.js +4 -8
  12. package/dist/actions/callback/callback.cjs +455 -437
  13. package/dist/actions/callback/callback.d.ts +12 -10
  14. package/dist/actions/callback/callback.js +12 -16
  15. package/dist/actions/callback/userinfo.cjs +134 -131
  16. package/dist/actions/callback/userinfo.d.ts +9 -9
  17. package/dist/actions/callback/userinfo.js +6 -10
  18. package/dist/actions/csrfToken/csrfToken.cjs +171 -162
  19. package/dist/actions/csrfToken/csrfToken.d.ts +3 -3
  20. package/dist/actions/csrfToken/csrfToken.js +8 -12
  21. package/dist/actions/index.cjs +773 -746
  22. package/dist/actions/index.d.ts +13 -13
  23. package/dist/actions/index.js +18 -34
  24. package/dist/actions/session/session.cjs +155 -149
  25. package/dist/actions/session/session.d.ts +3 -3
  26. package/dist/actions/session/session.js +7 -11
  27. package/dist/actions/signIn/authorization.cjs +249 -231
  28. package/dist/actions/signIn/authorization.d.ts +18 -12
  29. package/dist/actions/signIn/authorization.js +6 -16
  30. package/dist/actions/signIn/signIn.cjs +423 -396
  31. package/dist/actions/signIn/signIn.d.ts +10 -10
  32. package/dist/actions/signIn/signIn.js +10 -14
  33. package/dist/actions/signOut/signOut.cjs +440 -417
  34. package/dist/actions/signOut/signOut.d.ts +3 -3
  35. package/dist/actions/signOut/signOut.js +11 -15
  36. package/dist/assert.cjs +36 -35
  37. package/dist/assert.d.ts +4 -4
  38. package/dist/assert.js +2 -10
  39. package/dist/chunk-256KIVJL.js +96 -85
  40. package/dist/chunk-42XB3YCW.js +17 -19
  41. package/dist/chunk-6SM22VVJ.js +10 -13
  42. package/dist/chunk-CAKJT3KS.js +69 -84
  43. package/dist/chunk-E3OXBRYF.js +17 -19
  44. package/dist/chunk-EBPE35JT.js +26 -28
  45. package/dist/chunk-FIPU4MLT.js +16 -18
  46. package/dist/chunk-FJUDBLCP.js +43 -50
  47. package/dist/chunk-FKRDCWBF.js +17 -19
  48. package/dist/chunk-GZU3RBTB.js +40 -51
  49. package/dist/chunk-HGJ4TXY4.js +100 -132
  50. package/dist/chunk-HMRKN75I.js +63 -63
  51. package/dist/chunk-IKHPGFCW.js +9 -11
  52. package/dist/chunk-JAPMIE6S.js +5 -7
  53. package/dist/chunk-KRNOMBXQ.js +17 -19
  54. package/dist/chunk-LLR722CL.js +70 -91
  55. package/dist/chunk-RLT4RFKV.js +30 -39
  56. package/dist/chunk-SJPDVKUS.js +88 -107
  57. package/dist/chunk-SMQO5WD7.js +16 -26
  58. package/dist/chunk-STHEPPUZ.js +6 -8
  59. package/dist/chunk-UJJ7R56J.js +37 -47
  60. package/dist/chunk-UTDLUEEG.js +25 -0
  61. package/dist/chunk-VFTYH33W.js +37 -54
  62. package/dist/chunk-XXJKNKGQ.js +23 -33
  63. package/dist/chunk-ZV4BH47P.js +134 -132
  64. package/dist/cookie.cjs +175 -169
  65. package/dist/cookie.d.ts +51 -23
  66. package/dist/cookie.js +34 -34
  67. package/dist/error.cjs +75 -75
  68. package/dist/error.d.ts +30 -30
  69. package/dist/error.js +8 -15
  70. package/dist/headers.cjs +28 -28
  71. package/dist/headers.d.ts +2 -2
  72. package/dist/headers.js +2 -6
  73. package/dist/index-DpfbvTZ_.d.ts +298 -249
  74. package/dist/index.cjs +969 -933
  75. package/dist/index.d.ts +31 -10
  76. package/dist/index.js +50 -70
  77. package/dist/jose.cjs +67 -52
  78. package/dist/jose.d.ts +8 -8
  79. package/dist/jose.js +5 -9
  80. package/dist/oauth/bitbucket.cjs +38 -38
  81. package/dist/oauth/bitbucket.d.ts +7 -7
  82. package/dist/oauth/bitbucket.js +2 -6
  83. package/dist/oauth/discord.cjs +48 -48
  84. package/dist/oauth/discord.d.ts +7 -7
  85. package/dist/oauth/discord.js +2 -6
  86. package/dist/oauth/figma.cjs +39 -39
  87. package/dist/oauth/figma.d.ts +7 -7
  88. package/dist/oauth/figma.js +2 -6
  89. package/dist/oauth/github.cjs +31 -31
  90. package/dist/oauth/github.d.ts +7 -7
  91. package/dist/oauth/github.js +2 -6
  92. package/dist/oauth/gitlab.cjs +39 -39
  93. package/dist/oauth/gitlab.d.ts +7 -7
  94. package/dist/oauth/gitlab.js +2 -6
  95. package/dist/oauth/index.cjs +180 -180
  96. package/dist/oauth/index.d.ts +26 -7
  97. package/dist/oauth/index.js +9 -36
  98. package/dist/oauth/spotify.cjs +39 -39
  99. package/dist/oauth/spotify.d.ts +7 -7
  100. package/dist/oauth/spotify.js +2 -6
  101. package/dist/oauth/x.cjs +39 -39
  102. package/dist/oauth/x.d.ts +7 -7
  103. package/dist/oauth/x.js +2 -6
  104. package/dist/response.cjs +27 -27
  105. package/dist/response.d.ts +2 -2
  106. package/dist/response.js +2 -6
  107. package/dist/schemas.cjs +91 -91
  108. package/dist/schemas.d.ts +126 -93
  109. package/dist/schemas.js +18 -18
  110. package/dist/secure.cjs +98 -95
  111. package/dist/secure.d.ts +17 -17
  112. package/dist/secure.js +4 -18
  113. package/dist/utils.cjs +132 -119
  114. package/dist/utils.d.ts +26 -11
  115. package/dist/utils.js +21 -21
  116. package/package.json +1 -1
  117. package/dist/chunk-X7M4CQTN.js +0 -25
package/dist/error.cjs CHANGED
@@ -1,88 +1,88 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ "use strict"
2
+ var __defProp = Object.defineProperty
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
+ var __getOwnPropNames = Object.getOwnPropertyNames
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty
6
6
  var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
7
+ for (var name in all) __defProp(target, name, { get: all[name], enumerable: true })
8
+ }
10
9
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
10
+ if ((from && typeof from === "object") || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
14
+ }
15
+ return to
16
+ }
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
19
18
 
20
19
  // src/error.ts
21
- var error_exports = {};
20
+ var error_exports = {}
22
21
  __export(error_exports, {
23
- AuthError: () => AuthError,
24
- ERROR_RESPONSE: () => ERROR_RESPONSE,
25
- InvalidCsrfTokenError: () => InvalidCsrfTokenError,
26
- InvalidRedirectToError: () => InvalidRedirectToError,
27
- isAuthError: () => isAuthError,
28
- throwAuthError: () => throwAuthError
29
- });
30
- module.exports = __toCommonJS(error_exports);
22
+ AuthError: () => AuthError,
23
+ ERROR_RESPONSE: () => ERROR_RESPONSE,
24
+ InvalidCsrfTokenError: () => InvalidCsrfTokenError,
25
+ InvalidRedirectToError: () => InvalidRedirectToError,
26
+ isAuthError: () => isAuthError,
27
+ throwAuthError: () => throwAuthError,
28
+ })
29
+ module.exports = __toCommonJS(error_exports)
31
30
  var AuthError = class extends Error {
32
- constructor(type, message) {
33
- super(message);
34
- this.type = type;
35
- this.name = "AuthError";
36
- }
37
- };
31
+ constructor(type, message) {
32
+ super(message)
33
+ this.type = type
34
+ this.name = "AuthError"
35
+ }
36
+ }
38
37
  var InvalidCsrfTokenError = class extends AuthError {
39
- constructor(message = "The provided CSRF token is invalid or has expired") {
40
- super("invalid_csrf_token", message);
41
- this.name = "InvalidCsrfTokenError";
42
- }
43
- };
38
+ constructor(message = "The provided CSRF token is invalid or has expired") {
39
+ super("invalid_csrf_token", message)
40
+ this.name = "InvalidCsrfTokenError"
41
+ }
42
+ }
44
43
  var InvalidRedirectToError = class extends AuthError {
45
- constructor(message = "The redirectTo parameter does not match the hosted origin.") {
46
- super("invalid_redirect_to", message);
47
- this.name = "InvalidRedirectToError";
48
- }
49
- };
44
+ constructor(message = "The redirectTo parameter does not match the hosted origin.") {
45
+ super("invalid_redirect_to", message)
46
+ this.name = "InvalidRedirectToError"
47
+ }
48
+ }
50
49
  var isAuthError = (error) => {
51
- return error instanceof AuthError;
52
- };
50
+ return error instanceof AuthError
51
+ }
53
52
  var throwAuthError = (error, message) => {
54
- if (error instanceof Error) {
55
- if (isAuthError(error)) {
56
- throw error;
53
+ if (error instanceof Error) {
54
+ if (isAuthError(error)) {
55
+ throw error
56
+ }
57
+ throw new AuthError("invalid_request", error.message ?? message)
57
58
  }
58
- throw new AuthError("invalid_request", error.message ?? message);
59
- }
60
- };
59
+ }
61
60
  var ERROR_RESPONSE = {
62
- AUTHORIZATION: {
63
- INVALID_REQUEST: "invalid_request",
64
- UNAUTHORIZED_CLIENT: "unauthorized_client",
65
- ACCESS_DENIED: "access_denied",
66
- UNSUPPORTED_RESPONSE_TYPE: "unsupported_response_type",
67
- INVALID_SCOPE: "invalid_scope",
68
- SERVER_ERROR: "server_error",
69
- TEMPORARILY_UNAVAILABLE: "temporarily_unavailable"
70
- },
71
- ACCESS_TOKEN: {
72
- INVALID_REQUEST: "invalid_request",
73
- INVALID_CLIENT: "invalid_client",
74
- INVALID_GRANT: "invalid_grant",
75
- UNAUTHORIZED_CLIENT: "unauthorized_client",
76
- UNSUPPORTED_GRANT_TYPE: "unsupported_grant_type",
77
- INVALID_SCOPE: "invalid_scope"
78
- }
79
- };
61
+ AUTHORIZATION: {
62
+ INVALID_REQUEST: "invalid_request",
63
+ UNAUTHORIZED_CLIENT: "unauthorized_client",
64
+ ACCESS_DENIED: "access_denied",
65
+ UNSUPPORTED_RESPONSE_TYPE: "unsupported_response_type",
66
+ INVALID_SCOPE: "invalid_scope",
67
+ SERVER_ERROR: "server_error",
68
+ TEMPORARILY_UNAVAILABLE: "temporarily_unavailable",
69
+ },
70
+ ACCESS_TOKEN: {
71
+ INVALID_REQUEST: "invalid_request",
72
+ INVALID_CLIENT: "invalid_client",
73
+ INVALID_GRANT: "invalid_grant",
74
+ UNAUTHORIZED_CLIENT: "unauthorized_client",
75
+ UNSUPPORTED_GRANT_TYPE: "unsupported_grant_type",
76
+ INVALID_SCOPE: "invalid_scope",
77
+ },
78
+ }
80
79
  // Annotate the CommonJS export names for ESM import in node:
81
- 0 && (module.exports = {
82
- AuthError,
83
- ERROR_RESPONSE,
84
- InvalidCsrfTokenError,
85
- InvalidRedirectToError,
86
- isAuthError,
87
- throwAuthError
88
- });
80
+ 0 &&
81
+ (module.exports = {
82
+ AuthError,
83
+ ERROR_RESPONSE,
84
+ InvalidCsrfTokenError,
85
+ InvalidRedirectToError,
86
+ isAuthError,
87
+ throwAuthError,
88
+ })
package/dist/error.d.ts CHANGED
@@ -1,23 +1,23 @@
1
- import { E as ErrorType } from './index-DpfbvTZ_.js';
2
- import { LiteralUnion } from './@types/utility.js';
3
- import 'zod/v4';
4
- import '@aura-stack/jose/jose';
5
- import './schemas.js';
6
- import 'zod/v4/core';
7
- import 'cookie';
1
+ import { E as ErrorType } from "./index-DpfbvTZ_.js"
2
+ import { LiteralUnion } from "./@types/utility.js"
3
+ import "zod/v4"
4
+ import "@aura-stack/jose/jose"
5
+ import "./schemas.js"
6
+ import "zod/v4/core"
7
+ import "cookie"
8
8
 
9
9
  /**
10
10
  * Error class for all Aura Auth errors.
11
11
  */
12
12
  declare class AuthError extends Error {
13
- readonly type: LiteralUnion<ErrorType>;
14
- constructor(type: LiteralUnion<ErrorType>, message: string);
13
+ readonly type: LiteralUnion<ErrorType>
14
+ constructor(type: LiteralUnion<ErrorType>, message: string)
15
15
  }
16
16
  declare class InvalidCsrfTokenError extends AuthError {
17
- constructor(message?: string);
17
+ constructor(message?: string)
18
18
  }
19
19
  declare class InvalidRedirectToError extends AuthError {
20
- constructor(message?: string);
20
+ constructor(message?: string)
21
21
  }
22
22
  /**
23
23
  * Verifies if the provided error is an instance of AuthError.
@@ -25,7 +25,7 @@ declare class InvalidRedirectToError extends AuthError {
25
25
  * @param error The error to be checked
26
26
  * @returns True if the error is an instance of AuthError, false otherwise
27
27
  */
28
- declare const isAuthError: (error: unknown) => error is AuthError;
28
+ declare const isAuthError: (error: unknown) => error is AuthError
29
29
  /**
30
30
  * Captures and Error and verifies if it's an AuthError, rethrowing it if so.
31
31
  * If it's a different type of error, it wraps it in a new AuthError with the provided message.
@@ -33,7 +33,7 @@ declare const isAuthError: (error: unknown) => error is AuthError;
33
33
  * @param error The error to be processed
34
34
  * @param message The error message to be used if wrapping the error
35
35
  */
36
- declare const throwAuthError: (error: unknown, message?: string) => void;
36
+ declare const throwAuthError: (error: unknown, message?: string) => void
37
37
  /**
38
38
  * Errores responses returned by the OAuth flows including Authorization and Access Token errors.
39
39
  * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1
@@ -41,22 +41,22 @@ declare const throwAuthError: (error: unknown, message?: string) => void;
41
41
  */
42
42
  declare const ERROR_RESPONSE: {
43
43
  AUTHORIZATION: {
44
- INVALID_REQUEST: string;
45
- UNAUTHORIZED_CLIENT: string;
46
- ACCESS_DENIED: string;
47
- UNSUPPORTED_RESPONSE_TYPE: string;
48
- INVALID_SCOPE: string;
49
- SERVER_ERROR: string;
50
- TEMPORARILY_UNAVAILABLE: string;
51
- };
44
+ INVALID_REQUEST: string
45
+ UNAUTHORIZED_CLIENT: string
46
+ ACCESS_DENIED: string
47
+ UNSUPPORTED_RESPONSE_TYPE: string
48
+ INVALID_SCOPE: string
49
+ SERVER_ERROR: string
50
+ TEMPORARILY_UNAVAILABLE: string
51
+ }
52
52
  ACCESS_TOKEN: {
53
- INVALID_REQUEST: string;
54
- INVALID_CLIENT: string;
55
- INVALID_GRANT: string;
56
- UNAUTHORIZED_CLIENT: string;
57
- UNSUPPORTED_GRANT_TYPE: string;
58
- INVALID_SCOPE: string;
59
- };
60
- };
53
+ INVALID_REQUEST: string
54
+ INVALID_CLIENT: string
55
+ INVALID_GRANT: string
56
+ UNAUTHORIZED_CLIENT: string
57
+ UNSUPPORTED_GRANT_TYPE: string
58
+ INVALID_SCOPE: string
59
+ }
60
+ }
61
61
 
62
- export { AuthError, ERROR_RESPONSE, InvalidCsrfTokenError, InvalidRedirectToError, isAuthError, throwAuthError };
62
+ export { AuthError, ERROR_RESPONSE, InvalidCsrfTokenError, InvalidRedirectToError, isAuthError, throwAuthError }
package/dist/error.js CHANGED
@@ -1,16 +1,9 @@
1
1
  import {
2
- AuthError,
3
- ERROR_RESPONSE,
4
- InvalidCsrfTokenError,
5
- InvalidRedirectToError,
6
- isAuthError,
7
- throwAuthError
8
- } from "./chunk-FJUDBLCP.js";
9
- export {
10
- AuthError,
11
- ERROR_RESPONSE,
12
- InvalidCsrfTokenError,
13
- InvalidRedirectToError,
14
- isAuthError,
15
- throwAuthError
16
- };
2
+ AuthError,
3
+ ERROR_RESPONSE,
4
+ InvalidCsrfTokenError,
5
+ InvalidRedirectToError,
6
+ isAuthError,
7
+ throwAuthError,
8
+ } from "./chunk-FJUDBLCP.js"
9
+ export { AuthError, ERROR_RESPONSE, InvalidCsrfTokenError, InvalidRedirectToError, isAuthError, throwAuthError }
package/dist/headers.cjs CHANGED
@@ -1,35 +1,35 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
1
+ "use strict"
2
+ var __defProp = Object.defineProperty
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor
4
+ var __getOwnPropNames = Object.getOwnPropertyNames
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty
6
6
  var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
7
+ for (var name in all) __defProp(target, name, { get: all[name], enumerable: true })
8
+ }
10
9
  var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
10
+ if ((from && typeof from === "object") || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable })
14
+ }
15
+ return to
16
+ }
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod)
19
18
 
20
19
  // src/headers.ts
21
- var headers_exports = {};
20
+ var headers_exports = {}
22
21
  __export(headers_exports, {
23
- cacheControl: () => cacheControl
24
- });
25
- module.exports = __toCommonJS(headers_exports);
22
+ cacheControl: () => cacheControl,
23
+ })
24
+ module.exports = __toCommonJS(headers_exports)
26
25
  var cacheControl = {
27
- "Cache-Control": "no-store",
28
- Pragma: "no-cache",
29
- Expires: "0",
30
- Vary: "Cookie"
31
- };
26
+ "Cache-Control": "no-store",
27
+ Pragma: "no-cache",
28
+ Expires: "0",
29
+ Vary: "Cookie",
30
+ }
32
31
  // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- cacheControl
35
- });
32
+ 0 &&
33
+ (module.exports = {
34
+ cacheControl,
35
+ })
package/dist/headers.d.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Pragma
5
5
  * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary
6
6
  */
7
- declare const cacheControl: HeadersInit;
7
+ declare const cacheControl: HeadersInit
8
8
 
9
- export { cacheControl };
9
+ export { cacheControl }
package/dist/headers.js CHANGED
@@ -1,6 +1,2 @@
1
- import {
2
- cacheControl
3
- } from "./chunk-STHEPPUZ.js";
4
- export {
5
- cacheControl
6
- };
1
+ import { cacheControl } from "./chunk-STHEPPUZ.js"
2
+ export { cacheControl }