@aura-stack/auth 0.4.0 → 0.6.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 (179) hide show
  1. package/README.md +36 -1
  2. package/dist/@types/index.cjs +0 -18
  3. package/dist/@types/index.d.ts +2 -8
  4. package/dist/@types/index.js +0 -1
  5. package/dist/assert-B3iQSYlK.js +3 -0
  6. package/dist/assert-NJGroSJd.cjs +3 -0
  7. package/dist/client/index.cjs +1 -0
  8. package/dist/client/index.d.ts +11 -0
  9. package/dist/client/index.js +1 -0
  10. package/dist/crypto-Bz8nIciY.js +1 -0
  11. package/dist/crypto-CoXA5w_4.cjs +1 -0
  12. package/dist/env-bq387KyP.cjs +1 -0
  13. package/dist/env-nvh8QBNz.js +1 -0
  14. package/dist/errors-CCYPHuBO.cjs +1 -0
  15. package/dist/errors-DFWHOho6.js +1 -0
  16. package/dist/index-BkpwQ0l4.d.cts +2279 -0
  17. package/dist/index-nqLV2t91.d.ts +2279 -0
  18. package/dist/index.cjs +1 -1839
  19. package/dist/index.d.cts +2 -0
  20. package/dist/index.d.ts +2 -35
  21. package/dist/index.js +1 -132
  22. package/dist/logger-C59_CDMk.js +1 -0
  23. package/dist/logger-UnUhYL2V.cjs +1 -0
  24. package/dist/oauth/atlassian.cjs +1 -0
  25. package/dist/oauth/atlassian.d.ts +2 -0
  26. package/dist/oauth/atlassian.js +1 -0
  27. package/dist/oauth/bitbucket.cjs +1 -49
  28. package/dist/oauth/bitbucket.d.ts +2 -8
  29. package/dist/oauth/bitbucket.js +1 -6
  30. package/dist/oauth/discord.cjs +1 -57
  31. package/dist/oauth/discord.d.ts +2 -8
  32. package/dist/oauth/discord.js +1 -6
  33. package/dist/oauth/dropbox.cjs +1 -0
  34. package/dist/oauth/dropbox.d.ts +2 -0
  35. package/dist/oauth/dropbox.js +1 -0
  36. package/dist/oauth/figma.cjs +1 -49
  37. package/dist/oauth/figma.d.ts +2 -8
  38. package/dist/oauth/figma.js +1 -6
  39. package/dist/oauth/github.cjs +1 -49
  40. package/dist/oauth/github.d.ts +2 -8
  41. package/dist/oauth/github.js +1 -6
  42. package/dist/oauth/gitlab.cjs +1 -49
  43. package/dist/oauth/gitlab.d.ts +2 -8
  44. package/dist/oauth/gitlab.js +1 -6
  45. package/dist/oauth/index.cjs +1 -483
  46. package/dist/oauth/index.d.ts +2 -8
  47. package/dist/oauth/index.js +1 -52
  48. package/dist/oauth/mailchimp.cjs +1 -49
  49. package/dist/oauth/mailchimp.d.ts +2 -8
  50. package/dist/oauth/mailchimp.js +1 -6
  51. package/dist/oauth/notion.cjs +1 -0
  52. package/dist/oauth/notion.d.ts +2 -0
  53. package/dist/oauth/notion.js +1 -0
  54. package/dist/oauth/pinterest.cjs +1 -49
  55. package/dist/oauth/pinterest.d.ts +2 -8
  56. package/dist/oauth/pinterest.js +1 -6
  57. package/dist/oauth/spotify.cjs +1 -49
  58. package/dist/oauth/spotify.d.ts +2 -8
  59. package/dist/oauth/spotify.js +1 -6
  60. package/dist/oauth/strava.cjs +1 -49
  61. package/dist/oauth/strava.d.ts +2 -8
  62. package/dist/oauth/strava.js +1 -6
  63. package/dist/oauth/twitch.cjs +1 -0
  64. package/dist/oauth/twitch.d.ts +2 -0
  65. package/dist/oauth/twitch.js +1 -0
  66. package/dist/oauth/x.cjs +1 -49
  67. package/dist/oauth/x.d.ts +2 -8
  68. package/dist/oauth/x.js +1 -6
  69. package/dist/oauth-BntNm6aE.cjs +1 -0
  70. package/dist/oauth-DmHy9VrB.js +1 -0
  71. package/dist/shared/crypto.cjs +1 -0
  72. package/dist/shared/crypto.d.ts +47 -0
  73. package/dist/shared/crypto.js +1 -0
  74. package/dist/shared/identity.cjs +1 -0
  75. package/dist/shared/identity.d.ts +2 -0
  76. package/dist/shared/identity.js +1 -0
  77. package/dist/shared/index.cjs +1 -0
  78. package/dist/shared/index.d.ts +5 -0
  79. package/dist/shared/index.js +1 -0
  80. package/package.json +39 -12
  81. package/dist/@types/router.d.cjs +0 -1
  82. package/dist/@types/router.d.d.ts +0 -12
  83. package/dist/@types/router.d.js +0 -0
  84. package/dist/@types/utility.cjs +0 -18
  85. package/dist/@types/utility.d.ts +0 -6
  86. package/dist/@types/utility.js +0 -1
  87. package/dist/actions/callback/access-token.cjs +0 -206
  88. package/dist/actions/callback/access-token.d.ts +0 -29
  89. package/dist/actions/callback/access-token.js +0 -9
  90. package/dist/actions/callback/callback.cjs +0 -649
  91. package/dist/actions/callback/callback.d.ts +0 -13
  92. package/dist/actions/callback/callback.js +0 -19
  93. package/dist/actions/callback/userinfo.cjs +0 -250
  94. package/dist/actions/callback/userinfo.d.ts +0 -21
  95. package/dist/actions/callback/userinfo.js +0 -14
  96. package/dist/actions/csrfToken/csrfToken.cjs +0 -197
  97. package/dist/actions/csrfToken/csrfToken.d.ts +0 -5
  98. package/dist/actions/csrfToken/csrfToken.js +0 -14
  99. package/dist/actions/index.cjs +0 -954
  100. package/dist/actions/index.d.ts +0 -14
  101. package/dist/actions/index.js +0 -36
  102. package/dist/actions/session/session.cjs +0 -136
  103. package/dist/actions/session/session.d.ts +0 -5
  104. package/dist/actions/session/session.js +0 -10
  105. package/dist/actions/signIn/authorization.cjs +0 -322
  106. package/dist/actions/signIn/authorization.d.ts +0 -53
  107. package/dist/actions/signIn/authorization.js +0 -18
  108. package/dist/actions/signIn/signIn.cjs +0 -467
  109. package/dist/actions/signIn/signIn.d.ts +0 -13
  110. package/dist/actions/signIn/signIn.js +0 -15
  111. package/dist/actions/signOut/signOut.cjs +0 -493
  112. package/dist/actions/signOut/signOut.d.ts +0 -8
  113. package/dist/actions/signOut/signOut.js +0 -16
  114. package/dist/assert.cjs +0 -161
  115. package/dist/assert.d.ts +0 -33
  116. package/dist/assert.js +0 -26
  117. package/dist/chunk-4EKY7655.js +0 -123
  118. package/dist/chunk-4MYWAOLG.js +0 -31
  119. package/dist/chunk-4YHJ4IEQ.js +0 -25
  120. package/dist/chunk-54CZPKR4.js +0 -25
  121. package/dist/chunk-5LZ7TOM3.js +0 -25
  122. package/dist/chunk-5W4BRQYG.js +0 -201
  123. package/dist/chunk-6MXFPFR3.js +0 -143
  124. package/dist/chunk-7QF22LHP.js +0 -67
  125. package/dist/chunk-ALG3GIV4.js +0 -95
  126. package/dist/chunk-E6G5YCI6.js +0 -25
  127. package/dist/chunk-EBAMFRB7.js +0 -34
  128. package/dist/chunk-EEE7UM5T.js +0 -25
  129. package/dist/chunk-FRJFWTOY.js +0 -70
  130. package/dist/chunk-FW4W3REU.js +0 -25
  131. package/dist/chunk-ICAZ4OVS.js +0 -37
  132. package/dist/chunk-IPKO6UQN.js +0 -25
  133. package/dist/chunk-ITQ7352M.js +0 -0
  134. package/dist/chunk-KJBAQZX2.js +0 -92
  135. package/dist/chunk-KMMAZFSJ.js +0 -25
  136. package/dist/chunk-LDU7A2JE.js +0 -25
  137. package/dist/chunk-NUDITUKX.js +0 -73
  138. package/dist/chunk-OVHNRULD.js +0 -33
  139. package/dist/chunk-PG7UYFG5.js +0 -0
  140. package/dist/chunk-PHFH2MGS.js +0 -36
  141. package/dist/chunk-QQVSRXGX.js +0 -149
  142. package/dist/chunk-RRLIF4PQ.js +0 -55
  143. package/dist/chunk-TM5IPSNF.js +0 -113
  144. package/dist/chunk-TZB6MUXN.js +0 -78
  145. package/dist/chunk-VNCNJKS2.js +0 -267
  146. package/dist/chunk-XGLBNXL4.js +0 -75
  147. package/dist/chunk-XUP6KKNG.js +0 -106
  148. package/dist/chunk-ZNCZVF6U.js +0 -14
  149. package/dist/cookie.cjs +0 -246
  150. package/dist/cookie.d.ts +0 -85
  151. package/dist/cookie.js +0 -29
  152. package/dist/env.cjs +0 -56
  153. package/dist/env.d.ts +0 -7
  154. package/dist/env.js +0 -6
  155. package/dist/errors.cjs +0 -85
  156. package/dist/errors.d.ts +0 -50
  157. package/dist/errors.js +0 -18
  158. package/dist/headers.cjs +0 -61
  159. package/dist/headers.d.ts +0 -33
  160. package/dist/headers.js +0 -12
  161. package/dist/index-CSyIJmCM.d.ts +0 -1007
  162. package/dist/jose.cjs +0 -128
  163. package/dist/jose.d.ts +0 -25
  164. package/dist/jose.js +0 -12
  165. package/dist/logger.cjs +0 -292
  166. package/dist/logger.d.ts +0 -8
  167. package/dist/logger.js +0 -8
  168. package/dist/request.cjs +0 -38
  169. package/dist/request.d.ts +0 -13
  170. package/dist/request.js +0 -6
  171. package/dist/schemas.cjs +0 -125
  172. package/dist/schemas.d.ts +0 -149
  173. package/dist/schemas.js +0 -24
  174. package/dist/secure.cjs +0 -170
  175. package/dist/secure.d.ts +0 -35
  176. package/dist/secure.js +0 -19
  177. package/dist/utils.cjs +0 -223
  178. package/dist/utils.d.ts +0 -24
  179. package/dist/utils.js +0 -29
package/dist/errors.cjs DELETED
@@ -1,85 +0,0 @@
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
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- 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);
19
-
20
- // src/errors.ts
21
- var errors_exports = {};
22
- __export(errors_exports, {
23
- AuthInternalError: () => AuthInternalError,
24
- AuthSecurityError: () => AuthSecurityError,
25
- OAuthProtocolError: () => OAuthProtocolError,
26
- isAuthInternalError: () => isAuthInternalError,
27
- isAuthSecurityError: () => isAuthSecurityError,
28
- isNativeError: () => isNativeError,
29
- isOAuthProtocolError: () => isOAuthProtocolError
30
- });
31
- module.exports = __toCommonJS(errors_exports);
32
- var OAuthProtocolError = class extends Error {
33
- type = "OAUTH_PROTOCOL_ERROR";
34
- error;
35
- errorURI;
36
- constructor(error, description, errorURI, options) {
37
- super(description, options);
38
- this.error = error;
39
- this.errorURI = errorURI;
40
- this.name = new.target.name;
41
- Error.captureStackTrace(this, new.target);
42
- }
43
- };
44
- var AuthInternalError = class extends Error {
45
- type = "AUTH_INTERNAL_ERROR";
46
- code;
47
- constructor(code, message, options) {
48
- super(message, options);
49
- this.code = code;
50
- this.name = new.target.name;
51
- Error.captureStackTrace(this, new.target);
52
- }
53
- };
54
- var AuthSecurityError = class extends Error {
55
- type = "AUTH_SECURITY_ERROR";
56
- code;
57
- constructor(code, message, options) {
58
- super(message, options);
59
- this.code = code;
60
- this.name = new.target.name;
61
- Error.captureStackTrace(this, new.target);
62
- }
63
- };
64
- var isNativeError = (error) => {
65
- return error instanceof Error;
66
- };
67
- var isOAuthProtocolError = (error) => {
68
- return error instanceof OAuthProtocolError;
69
- };
70
- var isAuthInternalError = (error) => {
71
- return error instanceof AuthInternalError;
72
- };
73
- var isAuthSecurityError = (error) => {
74
- return error instanceof AuthSecurityError;
75
- };
76
- // Annotate the CommonJS export names for ESM import in node:
77
- 0 && (module.exports = {
78
- AuthInternalError,
79
- AuthSecurityError,
80
- OAuthProtocolError,
81
- isAuthInternalError,
82
- isAuthSecurityError,
83
- isNativeError,
84
- isOAuthProtocolError
85
- });
package/dist/errors.d.ts DELETED
@@ -1,50 +0,0 @@
1
- import { E as ErrorType, b as AuthInternalErrorCode, c as AuthSecurityErrorCode } from './index-CSyIJmCM.js';
2
- import { LiteralUnion } from './@types/utility.js';
3
- import 'zod';
4
- import './schemas.js';
5
- import './jose.js';
6
- import '@aura-stack/jose';
7
- import '@aura-stack/jose/jose';
8
- import '@aura-stack/router/cookie';
9
-
10
- /**
11
- * The object returned by the class to users its:
12
- * - type: "OAUTH_PROTOCOL_ERROR" to identify the error type
13
- * - error: A short error code
14
- * - description: A human-readable description of the error. The description is obtained from the message property of the Error class
15
- * - errorURI: A URI with more information about the error
16
- */
17
- declare class OAuthProtocolError extends Error {
18
- readonly type = "OAUTH_PROTOCOL_ERROR";
19
- readonly error: string;
20
- readonly errorURI?: string;
21
- constructor(error: LiteralUnion<Uppercase<ErrorType>>, description?: string, errorURI?: string, options?: ErrorOptions);
22
- }
23
- /**
24
- * The object returned when an internal error occurs in the Aura Auth library.
25
- * - type: "AUTH_INTERNAL_ERROR" to identify the error type
26
- * - message: A human-readable description of the error. The description is obtained from the message property of the Error class
27
- * - code: An optional error code that can be used to identify the specific error, for example, LIKE "ERR_AUTH_INTERNAL_ERROR"
28
- */
29
- declare class AuthInternalError extends Error {
30
- readonly type = "AUTH_INTERNAL_ERROR";
31
- readonly code: string;
32
- constructor(code: AuthInternalErrorCode, message?: string, options?: ErrorOptions);
33
- }
34
- /**
35
- * The object returned when a security error occurs in the Aura Auth library.
36
- * - type: "AUTH_SECURITY_ERROR" to identify the error type
37
- * - message: A human-readable description of the error. The description is obtained from the message property of the Error class
38
- * - code: An optional error code that can be used to identify the specific error, for example, LIKE "ERR_AUTH_SECURITY_ERROR"
39
- */
40
- declare class AuthSecurityError extends Error {
41
- readonly type = "AUTH_SECURITY_ERROR";
42
- readonly code: string;
43
- constructor(code: LiteralUnion<AuthSecurityErrorCode>, message?: string, options?: ErrorOptions);
44
- }
45
- declare const isNativeError: (error: unknown) => error is Error;
46
- declare const isOAuthProtocolError: (error: unknown) => error is OAuthProtocolError;
47
- declare const isAuthInternalError: (error: unknown) => error is AuthInternalError;
48
- declare const isAuthSecurityError: (error: unknown) => error is AuthSecurityError;
49
-
50
- export { AuthInternalError, AuthSecurityError, OAuthProtocolError, isAuthInternalError, isAuthSecurityError, isNativeError, isOAuthProtocolError };
package/dist/errors.js DELETED
@@ -1,18 +0,0 @@
1
- import {
2
- AuthInternalError,
3
- AuthSecurityError,
4
- OAuthProtocolError,
5
- isAuthInternalError,
6
- isAuthSecurityError,
7
- isNativeError,
8
- isOAuthProtocolError
9
- } from "./chunk-RRLIF4PQ.js";
10
- export {
11
- AuthInternalError,
12
- AuthSecurityError,
13
- OAuthProtocolError,
14
- isAuthInternalError,
15
- isAuthSecurityError,
16
- isNativeError,
17
- isOAuthProtocolError
18
- };
package/dist/headers.cjs DELETED
@@ -1,61 +0,0 @@
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
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- 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);
19
-
20
- // src/headers.ts
21
- var headers_exports = {};
22
- __export(headers_exports, {
23
- cacheControl: () => cacheControl,
24
- contentSecurityPolicy: () => contentSecurityPolicy,
25
- secureApiHeaders: () => secureApiHeaders,
26
- secureHeaders: () => secureHeaders
27
- });
28
- module.exports = __toCommonJS(headers_exports);
29
- var cacheControl = {
30
- "Cache-Control": "no-store",
31
- Pragma: "no-cache",
32
- Expires: "0",
33
- Vary: "Cookie"
34
- };
35
- var contentSecurityPolicy = {
36
- "Content-Security-Policy": [
37
- "default-src 'none'",
38
- "script-src 'self'",
39
- "frame-src 'none'",
40
- "object-src 'none'",
41
- "frame-ancestors 'none'",
42
- "base-uri 'none'"
43
- ].join("; ")
44
- };
45
- var secureHeaders = {
46
- "X-Content-Type-Options": "nosniff",
47
- "X-Frame-Options": "DENY",
48
- "Referrer-Policy": "strict-origin-when-cross-origin"
49
- };
50
- var secureApiHeaders = {
51
- ...cacheControl,
52
- ...contentSecurityPolicy,
53
- ...secureHeaders
54
- };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- cacheControl,
58
- contentSecurityPolicy,
59
- secureApiHeaders,
60
- secureHeaders
61
- });
package/dist/headers.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /**
2
- * Headers to prevent caching of responses. It includes Pragma header for HTTP/1.0 compatibility.
3
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control
4
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Pragma
5
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary
6
- */
7
- declare const cacheControl: HeadersInit;
8
- /**
9
- * Content Security Policy headers optimized for JSON API endpoints.
10
- * Provides protection against XSS, clickjacking, and code injection attacks.
11
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
12
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy
13
- */
14
- declare const contentSecurityPolicy: HeadersInit;
15
- /**
16
- * X-Frame-Options is overridden by the frame-ancestors directive in CSP.
17
- * However, it's included here for compatibility with older browsers that do not support CSP.
18
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Content-Type-Options
19
- * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Frame-Options
20
- * @see https://developer.mozilla.org/es/docs/Web/HTTP/Reference/Headers/Referrer-Policy
21
- */
22
- declare const secureHeaders: {
23
- "X-Content-Type-Options": string;
24
- "X-Frame-Options": string;
25
- "Referrer-Policy": string;
26
- };
27
- /**
28
- * Combined security headers for JSON API responses.
29
- * Includes cache control, CSP, and other security headers.
30
- */
31
- declare const secureApiHeaders: HeadersInit;
32
-
33
- export { cacheControl, contentSecurityPolicy, secureApiHeaders, secureHeaders };
package/dist/headers.js DELETED
@@ -1,12 +0,0 @@
1
- import {
2
- cacheControl,
3
- contentSecurityPolicy,
4
- secureApiHeaders,
5
- secureHeaders
6
- } from "./chunk-EBAMFRB7.js";
7
- export {
8
- cacheControl,
9
- contentSecurityPolicy,
10
- secureApiHeaders,
11
- secureHeaders
12
- };