@aura-stack/auth 0.1.0 → 0.2.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 (99) hide show
  1. package/dist/@types/index.d.ts +3 -4
  2. package/dist/@types/router.d.d.ts +3 -4
  3. package/dist/@types/utility.d.ts +1 -5
  4. package/dist/actions/callback/access-token.cjs +51 -41
  5. package/dist/actions/callback/access-token.d.ts +3 -4
  6. package/dist/actions/callback/access-token.js +4 -3
  7. package/dist/actions/callback/callback.cjs +115 -210
  8. package/dist/actions/callback/callback.d.ts +3 -4
  9. package/dist/actions/callback/callback.js +9 -10
  10. package/dist/actions/callback/userinfo.cjs +35 -22
  11. package/dist/actions/callback/userinfo.d.ts +3 -4
  12. package/dist/actions/callback/userinfo.js +6 -5
  13. package/dist/actions/csrfToken/csrfToken.cjs +34 -103
  14. package/dist/actions/csrfToken/csrfToken.js +6 -6
  15. package/dist/actions/index.cjs +234 -391
  16. package/dist/actions/index.d.ts +3 -4
  17. package/dist/actions/index.js +16 -17
  18. package/dist/actions/session/session.cjs +25 -109
  19. package/dist/actions/session/session.js +4 -5
  20. package/dist/actions/signIn/authorization.cjs +64 -55
  21. package/dist/actions/signIn/authorization.d.ts +3 -4
  22. package/dist/actions/signIn/authorization.js +5 -5
  23. package/dist/actions/signIn/signIn.cjs +84 -206
  24. package/dist/actions/signIn/signIn.d.ts +3 -4
  25. package/dist/actions/signIn/signIn.js +7 -9
  26. package/dist/actions/signOut/signOut.cjs +88 -234
  27. package/dist/actions/signOut/signOut.js +8 -9
  28. package/dist/assert.cjs +5 -0
  29. package/dist/assert.d.ts +9 -1
  30. package/dist/assert.js +3 -1
  31. package/dist/chunk-2RXNXMCZ.js +55 -0
  32. package/dist/{chunk-UJJ7R56J.js → chunk-4V4JNXVF.js} +13 -10
  33. package/dist/chunk-6R2YZ4AC.js +22 -0
  34. package/dist/{chunk-VFTYH33W.js → chunk-7H3OR6UU.js} +29 -9
  35. package/dist/{chunk-256KIVJL.js → chunk-CXLATHS5.js} +53 -9
  36. package/dist/{chunk-6SM22VVJ.js → chunk-EIL2FPSS.js} +5 -1
  37. package/dist/chunk-IMICRJ5U.js +197 -0
  38. package/dist/{chunk-EBPE35JT.js → chunk-IUYZQTJV.js} +0 -1
  39. package/dist/{chunk-GZU3RBTB.js → chunk-N2APGLXA.js} +19 -10
  40. package/dist/chunk-NEVKX6K2.js +70 -0
  41. package/dist/{chunk-XXJKNKGQ.js → chunk-PTJUYB33.js} +9 -13
  42. package/dist/chunk-QDO2KSRJ.js +35 -0
  43. package/dist/{chunk-CAKJT3KS.js → chunk-QEZL7EYN.js} +21 -17
  44. package/dist/chunk-RRLIF4PQ.js +55 -0
  45. package/dist/chunk-TLE4PXY3.js +39 -0
  46. package/dist/chunk-UEH3LVON.js +97 -0
  47. package/dist/{chunk-HMRKN75I.js → chunk-WD7AUHQ5.js} +12 -7
  48. package/dist/{chunk-RLT4RFKV.js → chunk-ZLR3LI6X.js} +19 -9
  49. package/dist/cookie.cjs +140 -99
  50. package/dist/cookie.d.ts +33 -43
  51. package/dist/cookie.js +10 -17
  52. package/dist/errors.cjs +85 -0
  53. package/dist/errors.d.ts +48 -0
  54. package/dist/errors.js +18 -0
  55. package/dist/{index-DpfbvTZ_.d.ts → index-EqsoyjrF.d.ts} +139 -57
  56. package/dist/index.cjs +427 -389
  57. package/dist/index.d.ts +4 -5
  58. package/dist/index.js +37 -26
  59. package/dist/jose.cjs +23 -12
  60. package/dist/jose.d.ts +4 -1
  61. package/dist/jose.js +5 -4
  62. package/dist/oauth/bitbucket.d.ts +3 -4
  63. package/dist/oauth/discord.cjs +0 -1
  64. package/dist/oauth/discord.d.ts +3 -4
  65. package/dist/oauth/discord.js +1 -1
  66. package/dist/oauth/figma.d.ts +3 -4
  67. package/dist/oauth/github.d.ts +3 -4
  68. package/dist/oauth/gitlab.d.ts +3 -4
  69. package/dist/oauth/index.cjs +132 -6
  70. package/dist/oauth/index.d.ts +3 -4
  71. package/dist/oauth/index.js +12 -5
  72. package/dist/oauth/spotify.d.ts +3 -4
  73. package/dist/{response.cjs → oauth/strava.cjs} +21 -9
  74. package/dist/oauth/strava.d.ts +6 -0
  75. package/dist/oauth/strava.js +6 -0
  76. package/dist/oauth/x.d.ts +3 -4
  77. package/dist/schemas.cjs +11 -5
  78. package/dist/schemas.d.ts +70 -67
  79. package/dist/schemas.js +3 -1
  80. package/dist/secure.cjs +27 -19
  81. package/dist/secure.d.ts +3 -4
  82. package/dist/secure.js +4 -3
  83. package/dist/utils.cjs +90 -15
  84. package/dist/utils.d.ts +11 -2
  85. package/dist/utils.js +8 -4
  86. package/package.json +5 -6
  87. package/dist/chunk-FJUDBLCP.js +0 -59
  88. package/dist/chunk-HGJ4TXY4.js +0 -137
  89. package/dist/chunk-JAPMIE6S.js +0 -10
  90. package/dist/chunk-LLR722CL.js +0 -96
  91. package/dist/chunk-SJPDVKUS.js +0 -112
  92. package/dist/chunk-SMQO5WD7.js +0 -30
  93. package/dist/chunk-UTDLUEEG.js +0 -31
  94. package/dist/chunk-ZV4BH47P.js +0 -154
  95. package/dist/error.cjs +0 -88
  96. package/dist/error.d.ts +0 -62
  97. package/dist/error.js +0 -16
  98. package/dist/response.d.ts +0 -10
  99. package/dist/response.js +0 -6
package/dist/error.d.ts DELETED
@@ -1,62 +0,0 @@
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
-
9
- /**
10
- * Error class for all Aura Auth errors.
11
- */
12
- declare class AuthError extends Error {
13
- readonly type: LiteralUnion<ErrorType>;
14
- constructor(type: LiteralUnion<ErrorType>, message: string);
15
- }
16
- declare class InvalidCsrfTokenError extends AuthError {
17
- constructor(message?: string);
18
- }
19
- declare class InvalidRedirectToError extends AuthError {
20
- constructor(message?: string);
21
- }
22
- /**
23
- * Verifies if the provided error is an instance of AuthError.
24
- *
25
- * @param error The error to be checked
26
- * @returns True if the error is an instance of AuthError, false otherwise
27
- */
28
- declare const isAuthError: (error: unknown) => error is AuthError;
29
- /**
30
- * Captures and Error and verifies if it's an AuthError, rethrowing it if so.
31
- * If it's a different type of error, it wraps it in a new AuthError with the provided message.
32
- *
33
- * @param error The error to be processed
34
- * @param message The error message to be used if wrapping the error
35
- */
36
- declare const throwAuthError: (error: unknown, message?: string) => void;
37
- /**
38
- * Errores responses returned by the OAuth flows including Authorization and Access Token errors.
39
- * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.2.1
40
- * @see https://datatracker.ietf.org/doc/html/rfc6749#section-5.2
41
- */
42
- declare const ERROR_RESPONSE: {
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
- };
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
- };
61
-
62
- export { AuthError, ERROR_RESPONSE, InvalidCsrfTokenError, InvalidRedirectToError, isAuthError, throwAuthError };
package/dist/error.js DELETED
@@ -1,16 +0,0 @@
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
- };
@@ -1,10 +0,0 @@
1
- /**
2
- * Custom Response class for Aura Auth.
3
- *
4
- * @experimental
5
- */
6
- declare class AuraResponse extends Response {
7
- static json<T>(body: T, init?: ResponseInit): Response;
8
- }
9
-
10
- export { AuraResponse };
package/dist/response.js DELETED
@@ -1,6 +0,0 @@
1
- import {
2
- AuraResponse
3
- } from "./chunk-JAPMIE6S.js";
4
- export {
5
- AuraResponse
6
- };