@aura-stack/auth 0.2.0 → 0.4.0-rc.1

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 (79) hide show
  1. package/dist/@types/index.d.ts +3 -2
  2. package/dist/@types/router.d.d.ts +3 -2
  3. package/dist/actions/callback/access-token.cjs +52 -41
  4. package/dist/actions/callback/access-token.d.ts +5 -4
  5. package/dist/actions/callback/access-token.js +3 -2
  6. package/dist/actions/callback/callback.cjs +69 -52
  7. package/dist/actions/callback/callback.d.ts +26 -3
  8. package/dist/actions/callback/callback.js +6 -5
  9. package/dist/actions/callback/userinfo.cjs +54 -43
  10. package/dist/actions/callback/userinfo.d.ts +3 -2
  11. package/dist/actions/callback/userinfo.js +3 -2
  12. package/dist/actions/csrfToken/csrfToken.cjs +2 -2
  13. package/dist/actions/csrfToken/csrfToken.d.ts +3 -1
  14. package/dist/actions/csrfToken/csrfToken.js +2 -2
  15. package/dist/actions/index.cjs +93 -71
  16. package/dist/actions/index.d.ts +3 -2
  17. package/dist/actions/index.js +15 -14
  18. package/dist/actions/session/session.d.ts +3 -1
  19. package/dist/actions/session/session.js +2 -2
  20. package/dist/actions/signIn/authorization.cjs +40 -40
  21. package/dist/actions/signIn/authorization.d.ts +3 -2
  22. package/dist/actions/signIn/authorization.js +2 -2
  23. package/dist/actions/signIn/signIn.cjs +63 -50
  24. package/dist/actions/signIn/signIn.d.ts +25 -3
  25. package/dist/actions/signIn/signIn.js +4 -3
  26. package/dist/actions/signOut/signOut.cjs +66 -66
  27. package/dist/actions/signOut/signOut.d.ts +9 -1
  28. package/dist/actions/signOut/signOut.js +4 -4
  29. package/dist/assert.d.ts +3 -2
  30. package/dist/{chunk-2RXNXMCZ.js → chunk-3EUWD5BB.js} +15 -7
  31. package/dist/{chunk-NEVKX6K2.js → chunk-A3N4PVAT.js} +3 -3
  32. package/dist/chunk-B737EUJV.js +22 -0
  33. package/dist/{chunk-7H3OR6UU.js → chunk-EMKJA2GJ.js} +18 -10
  34. package/dist/{chunk-4V4JNXVF.js → chunk-GA2SMTJO.js} +9 -6
  35. package/dist/chunk-HP34YGGJ.js +22 -0
  36. package/dist/{chunk-QDO2KSRJ.js → chunk-HT4YLL7N.js} +1 -1
  37. package/dist/{chunk-ZLR3LI6X.js → chunk-IVET23KF.js} +7 -4
  38. package/dist/{chunk-PTJUYB33.js → chunk-JVFTCTTE.js} +1 -1
  39. package/dist/{chunk-UEH3LVON.js → chunk-KSWLO5ZU.js} +21 -16
  40. package/dist/{chunk-QEZL7EYN.js → chunk-N4SX7TZT.js} +3 -3
  41. package/dist/{chunk-IMICRJ5U.js → chunk-W6LG7BFW.js} +14 -14
  42. package/dist/{chunk-WD7AUHQ5.js → chunk-YRCB5FLE.js} +8 -8
  43. package/dist/chunk-ZNCZVF6U.js +14 -0
  44. package/dist/cookie.cjs +14 -14
  45. package/dist/cookie.d.ts +3 -2
  46. package/dist/cookie.js +1 -1
  47. package/dist/errors.d.ts +3 -2
  48. package/dist/{index-EqsoyjrF.d.ts → index-B8jeIElf.d.ts} +57 -8
  49. package/dist/index.cjs +159 -95
  50. package/dist/index.d.ts +66 -5
  51. package/dist/index.js +23 -19
  52. package/dist/jose.cjs +2 -2
  53. package/dist/oauth/bitbucket.d.ts +3 -2
  54. package/dist/oauth/discord.d.ts +3 -2
  55. package/dist/oauth/figma.d.ts +3 -2
  56. package/dist/oauth/github.d.ts +3 -2
  57. package/dist/oauth/gitlab.d.ts +3 -2
  58. package/dist/oauth/index.cjs +85 -41
  59. package/dist/oauth/index.d.ts +3 -2
  60. package/dist/oauth/index.js +16 -8
  61. package/dist/oauth/mailchimp.cjs +46 -0
  62. package/dist/oauth/mailchimp.d.ts +7 -0
  63. package/dist/oauth/mailchimp.js +6 -0
  64. package/dist/oauth/pinterest.cjs +46 -0
  65. package/dist/oauth/pinterest.d.ts +7 -0
  66. package/dist/oauth/pinterest.js +6 -0
  67. package/dist/oauth/spotify.d.ts +3 -2
  68. package/dist/oauth/strava.d.ts +3 -2
  69. package/dist/oauth/x.d.ts +3 -2
  70. package/dist/request.cjs +38 -0
  71. package/dist/request.d.ts +13 -0
  72. package/dist/request.js +6 -0
  73. package/dist/schemas.cjs +40 -40
  74. package/dist/schemas.d.ts +15 -15
  75. package/dist/schemas.js +1 -1
  76. package/dist/secure.cjs +5 -5
  77. package/dist/secure.d.ts +3 -2
  78. package/dist/utils.d.ts +3 -3
  79. package/package.json +7 -5
package/dist/schemas.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- import { z } from 'zod/v4';
1
+ import { z } from 'zod';
2
2
 
3
3
  /**
4
4
  * Schema for OAuth Provider Configuration
5
5
  */
6
6
  declare const OAuthProviderConfigSchema: z.ZodObject<{
7
- authorizeURL: z.ZodURL;
8
- accessToken: z.ZodURL;
7
+ authorizeURL: z.ZodString;
8
+ accessToken: z.ZodString;
9
9
  scope: z.ZodOptional<z.ZodString>;
10
- userInfo: z.ZodURL;
10
+ userInfo: z.ZodString;
11
11
  responseType: z.ZodEnum<{
12
- code: "code";
13
12
  token: "token";
13
+ code: "code";
14
14
  id_token: "id_token";
15
15
  }>;
16
16
  clientId: z.ZodString;
@@ -22,13 +22,13 @@ declare const OAuthProviderConfigSchema: z.ZodObject<{
22
22
  * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.1
23
23
  */
24
24
  declare const OAuthAuthorization: z.ZodObject<{
25
- authorizeURL: z.ZodURL;
26
- accessToken: z.ZodURL;
25
+ authorizeURL: z.ZodString;
26
+ accessToken: z.ZodString;
27
27
  scope: z.ZodOptional<z.ZodString>;
28
- userInfo: z.ZodURL;
28
+ userInfo: z.ZodString;
29
29
  responseType: z.ZodEnum<{
30
- code: "code";
31
30
  token: "token";
31
+ code: "code";
32
32
  id_token: "id_token";
33
33
  }>;
34
34
  clientId: z.ZodString;
@@ -74,13 +74,13 @@ declare const OAuthAuthorizationErrorResponse: z.ZodObject<{
74
74
  * @see https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3
75
75
  */
76
76
  declare const OAuthAccessToken: z.ZodObject<{
77
- authorizeURL: z.ZodURL;
78
- accessToken: z.ZodURL;
77
+ authorizeURL: z.ZodString;
78
+ accessToken: z.ZodString;
79
79
  scope: z.ZodOptional<z.ZodString>;
80
- userInfo: z.ZodURL;
80
+ userInfo: z.ZodString;
81
81
  responseType: z.ZodEnum<{
82
- code: "code";
83
82
  token: "token";
83
+ code: "code";
84
84
  id_token: "id_token";
85
85
  }>;
86
86
  clientId: z.ZodString;
@@ -96,10 +96,10 @@ declare const OAuthAccessToken: z.ZodObject<{
96
96
  */
97
97
  declare const OAuthAccessTokenResponse: z.ZodObject<{
98
98
  access_token: z.ZodString;
99
- token_type: z.ZodString;
99
+ token_type: z.ZodOptional<z.ZodString>;
100
100
  expires_in: z.ZodOptional<z.ZodNumber>;
101
101
  refresh_token: z.ZodOptional<z.ZodString>;
102
- scope: z.ZodOptional<z.ZodString>;
102
+ scope: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodNull]>;
103
103
  }, z.core.$strip>;
104
104
  /**
105
105
  * Schema for OAuth Access Token Error Response
package/dist/schemas.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  OAuthEnvSchema,
9
9
  OAuthErrorResponse,
10
10
  OAuthProviderConfigSchema
11
- } from "./chunk-WD7AUHQ5.js";
11
+ } from "./chunk-YRCB5FLE.js";
12
12
  export {
13
13
  OAuthAccessToken,
14
14
  OAuthAccessTokenErrorResponse,
package/dist/secure.cjs CHANGED
@@ -38,7 +38,7 @@ __export(secure_exports, {
38
38
  verifyCSRF: () => verifyCSRF
39
39
  });
40
40
  module.exports = __toCommonJS(secure_exports);
41
- var import_node_crypto = __toESM(require("crypto"), 1);
41
+ var import_crypto = __toESM(require("crypto"), 1);
42
42
 
43
43
  // src/utils.ts
44
44
  var import_router = require("@aura-stack/router");
@@ -68,10 +68,10 @@ var isJWTPayloadWithToken = (payload) => {
68
68
 
69
69
  // src/secure.ts
70
70
  var generateSecure = (length = 32) => {
71
- return import_node_crypto.default.randomBytes(length).toString("base64url");
71
+ return import_crypto.default.randomBytes(length).toString("base64url");
72
72
  };
73
73
  var createHash = (data, base = "hex") => {
74
- return import_node_crypto.default.createHash("sha256").update(data).digest().toString(base);
74
+ return import_crypto.default.createHash("sha256").update(data).digest().toString(base);
75
75
  };
76
76
  var createPKCE = async (verifier) => {
77
77
  const codeVerifier = verifier ?? generateSecure(86);
@@ -106,7 +106,7 @@ var verifyCSRF = async (jose, cookie, header) => {
106
106
  if (!equals(headerBuffer.length, cookieBuffer.length)) {
107
107
  throw new AuthSecurityError("CSRF_TOKEN_INVALID", "The CSRF tokens do not match.");
108
108
  }
109
- if (!import_node_crypto.default.timingSafeEqual(cookieBuffer, headerBuffer)) {
109
+ if (!import_crypto.default.timingSafeEqual(cookieBuffer, headerBuffer)) {
110
110
  throw new AuthSecurityError("CSRF_TOKEN_INVALID", "The CSRF tokens do not match.");
111
111
  }
112
112
  return true;
@@ -115,7 +115,7 @@ var verifyCSRF = async (jose, cookie, header) => {
115
115
  }
116
116
  };
117
117
  var createDerivedSalt = (secret) => {
118
- return import_node_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex");
118
+ return import_crypto.default.createHash("sha256").update(secret).update("aura-auth-salt").digest("hex");
119
119
  };
120
120
  // Annotate the CommonJS export names for ESM import in node:
121
121
  0 && (module.exports = {
package/dist/secure.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { A as AuthRuntimeConfig } from './index-EqsoyjrF.js';
2
- import 'zod/v4';
1
+ import { A as AuthRuntimeConfig } from './index-B8jeIElf.js';
2
+ import 'zod';
3
3
  import './schemas.js';
4
4
  import '@aura-stack/router/cookie';
5
+ import '@aura-stack/jose';
5
6
  import '@aura-stack/jose/jose';
6
7
  import './@types/utility.js';
7
8
 
package/dist/utils.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { ZodError } from 'zod';
2
1
  import { RouterConfig } from '@aura-stack/router';
3
- import { i as APIErrorMap } from './index-EqsoyjrF.js';
4
- import 'zod/v4';
2
+ import { i as APIErrorMap } from './index-B8jeIElf.js';
3
+ import { ZodError } from 'zod';
5
4
  import './schemas.js';
6
5
  import '@aura-stack/router/cookie';
6
+ import '@aura-stack/jose';
7
7
  import '@aura-stack/jose/jose';
8
8
  import './@types/utility.js';
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura-stack/auth",
3
- "version": "0.2.0",
3
+ "version": "0.4.0-rc.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Core auth for @aura-stack/auth",
@@ -44,14 +44,16 @@
44
44
  },
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
- "@aura-stack/router": "^0.5.0",
47
+ "@aura-stack/router": "0.6.0-rc.1",
48
48
  "dotenv": "^17.2.3",
49
- "zod": "^4.1.12",
49
+ "zod": "^4.3.5",
50
50
  "@aura-stack/jose": "0.2.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@aura-stack/tsup-config": "0.0.0",
54
- "@aura-stack/tsconfig": "0.0.0"
53
+ "@types/node": "^24.9.2",
54
+ "typescript": "^5.9.2",
55
+ "@aura-stack/tsconfig": "0.0.0",
56
+ "@aura-stack/tsup-config": "0.0.0"
55
57
  },
56
58
  "scripts": {
57
59
  "dev": "tsup --watch",