@aura-stack/auth 0.4.0-rc.4 → 0.4.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 (143) hide show
  1. package/dist/@types/index.d.ts +4 -3
  2. package/dist/@types/router.d.cjs +0 -17
  3. package/dist/@types/router.d.d.ts +3 -2
  4. package/dist/@types/router.d.js +0 -1
  5. package/dist/actions/callback/access-token.cjs +40 -25
  6. package/dist/actions/callback/access-token.d.ts +4 -3
  7. package/dist/actions/callback/access-token.js +3 -4
  8. package/dist/actions/callback/callback.cjs +287 -77
  9. package/dist/actions/callback/callback.d.ts +5 -26
  10. package/dist/actions/callback/callback.js +13 -10
  11. package/dist/actions/callback/userinfo.cjs +68 -7
  12. package/dist/actions/callback/userinfo.d.ts +4 -3
  13. package/dist/actions/callback/userinfo.js +8 -6
  14. package/dist/actions/csrfToken/csrfToken.cjs +63 -4
  15. package/dist/actions/csrfToken/csrfToken.d.ts +1 -3
  16. package/dist/actions/csrfToken/csrfToken.js +8 -6
  17. package/dist/actions/index.cjs +400 -175
  18. package/dist/actions/index.d.ts +3 -2
  19. package/dist/actions/index.js +21 -19
  20. package/dist/actions/session/session.cjs +40 -11
  21. package/dist/actions/session/session.d.ts +1 -3
  22. package/dist/actions/session/session.js +4 -4
  23. package/dist/actions/signIn/authorization.cjs +171 -132
  24. package/dist/actions/signIn/authorization.d.ts +21 -11
  25. package/dist/actions/signIn/authorization.js +8 -6
  26. package/dist/actions/signIn/signIn.cjs +220 -113
  27. package/dist/actions/signIn/signIn.d.ts +5 -25
  28. package/dist/actions/signIn/signIn.js +9 -7
  29. package/dist/actions/signOut/signOut.cjs +268 -119
  30. package/dist/actions/signOut/signOut.d.ts +1 -9
  31. package/dist/actions/signOut/signOut.js +10 -8
  32. package/dist/assert.cjs +117 -5
  33. package/dist/assert.d.ts +22 -3
  34. package/dist/assert.js +17 -3
  35. package/dist/chunk-4EKY7655.js +123 -0
  36. package/dist/chunk-4MYWAOLG.js +31 -0
  37. package/dist/chunk-4YHJ4IEQ.js +25 -0
  38. package/dist/chunk-54CZPKR4.js +25 -0
  39. package/dist/chunk-5LZ7TOM3.js +25 -0
  40. package/dist/{chunk-W6LG7BFW.js → chunk-5W4BRQYG.js} +24 -20
  41. package/dist/chunk-6MXFPFR3.js +143 -0
  42. package/dist/{chunk-3EUWD5BB.js → chunk-7QF22LHP.js} +13 -9
  43. package/dist/chunk-ALG3GIV4.js +95 -0
  44. package/dist/chunk-E6G5YCI6.js +25 -0
  45. package/dist/chunk-EBAMFRB7.js +34 -0
  46. package/dist/chunk-EEE7UM5T.js +25 -0
  47. package/dist/{chunk-TLE4PXY3.js → chunk-FRJFWTOY.js} +38 -7
  48. package/dist/chunk-FW4W3REU.js +25 -0
  49. package/dist/{chunk-HT4YLL7N.js → chunk-ICAZ4OVS.js} +10 -8
  50. package/dist/chunk-IPKO6UQN.js +25 -0
  51. package/dist/{chunk-YRCB5FLE.js → chunk-KJBAQZX2.js} +13 -0
  52. package/dist/chunk-KMMAZFSJ.js +25 -0
  53. package/dist/chunk-LDU7A2JE.js +25 -0
  54. package/dist/{chunk-N2APGLXA.js → chunk-NUDITUKX.js} +18 -16
  55. package/dist/chunk-OVHNRULD.js +33 -0
  56. package/dist/{chunk-JVFTCTTE.js → chunk-PHFH2MGS.js} +12 -9
  57. package/dist/chunk-QQVSRXGX.js +149 -0
  58. package/dist/chunk-TM5IPSNF.js +113 -0
  59. package/dist/{chunk-GA2SMTJO.js → chunk-TZB6MUXN.js} +33 -13
  60. package/dist/chunk-VNCNJKS2.js +267 -0
  61. package/dist/{chunk-IVET23KF.js → chunk-XGLBNXL4.js} +31 -14
  62. package/dist/chunk-XUP6KKNG.js +106 -0
  63. package/dist/cookie.cjs +24 -20
  64. package/dist/cookie.d.ts +4 -3
  65. package/dist/cookie.js +1 -1
  66. package/dist/env.cjs +56 -0
  67. package/dist/env.d.ts +7 -0
  68. package/dist/env.js +6 -0
  69. package/dist/errors.d.ts +4 -3
  70. package/dist/headers.cjs +28 -2
  71. package/dist/headers.d.ts +25 -1
  72. package/dist/headers.js +9 -3
  73. package/dist/{index-DkaLJFn8.d.ts → index-CSyIJmCM.d.ts} +373 -45
  74. package/dist/index.cjs +1128 -483
  75. package/dist/index.d.ts +6 -10
  76. package/dist/index.js +83 -42
  77. package/dist/jose.cjs +62 -25
  78. package/dist/jose.d.ts +7 -5
  79. package/dist/jose.js +8 -6
  80. package/dist/logger.cjs +292 -0
  81. package/dist/logger.d.ts +8 -0
  82. package/dist/logger.js +8 -0
  83. package/dist/oauth/bitbucket.cjs +19 -15
  84. package/dist/oauth/bitbucket.d.ts +3 -2
  85. package/dist/oauth/bitbucket.js +1 -1
  86. package/dist/oauth/discord.cjs +27 -24
  87. package/dist/oauth/discord.d.ts +3 -2
  88. package/dist/oauth/discord.js +1 -1
  89. package/dist/oauth/figma.cjs +19 -16
  90. package/dist/oauth/figma.d.ts +3 -2
  91. package/dist/oauth/figma.js +1 -1
  92. package/dist/oauth/github.cjs +19 -8
  93. package/dist/oauth/github.d.ts +3 -2
  94. package/dist/oauth/github.js +1 -1
  95. package/dist/oauth/gitlab.cjs +19 -16
  96. package/dist/oauth/gitlab.d.ts +3 -2
  97. package/dist/oauth/gitlab.js +1 -1
  98. package/dist/oauth/index.cjs +266 -166
  99. package/dist/oauth/index.d.ts +3 -2
  100. package/dist/oauth/index.js +22 -21
  101. package/dist/oauth/mailchimp.cjs +19 -16
  102. package/dist/oauth/mailchimp.d.ts +3 -2
  103. package/dist/oauth/mailchimp.js +1 -1
  104. package/dist/oauth/pinterest.cjs +19 -16
  105. package/dist/oauth/pinterest.d.ts +3 -2
  106. package/dist/oauth/pinterest.js +1 -1
  107. package/dist/oauth/spotify.cjs +19 -16
  108. package/dist/oauth/spotify.d.ts +3 -2
  109. package/dist/oauth/spotify.js +1 -1
  110. package/dist/oauth/strava.cjs +19 -16
  111. package/dist/oauth/strava.d.ts +3 -2
  112. package/dist/oauth/strava.js +1 -1
  113. package/dist/oauth/x.cjs +19 -16
  114. package/dist/oauth/x.d.ts +3 -2
  115. package/dist/oauth/x.js +1 -1
  116. package/dist/schemas.cjs +16 -2
  117. package/dist/schemas.d.ts +17 -1
  118. package/dist/schemas.js +5 -3
  119. package/dist/secure.cjs +58 -16
  120. package/dist/secure.d.ts +4 -10
  121. package/dist/secure.js +5 -5
  122. package/dist/utils.cjs +94 -87
  123. package/dist/utils.d.ts +9 -39
  124. package/dist/utils.js +11 -9
  125. package/package.json +3 -4
  126. package/dist/chunk-42XB3YCW.js +0 -22
  127. package/dist/chunk-6R2YZ4AC.js +0 -22
  128. package/dist/chunk-A3N4PVAT.js +0 -70
  129. package/dist/chunk-B737EUJV.js +0 -22
  130. package/dist/chunk-CXLATHS5.js +0 -143
  131. package/dist/chunk-DIVDFNAP.js +0 -0
  132. package/dist/chunk-E3OXBRYF.js +0 -22
  133. package/dist/chunk-EIL2FPSS.js +0 -22
  134. package/dist/chunk-EMKJA2GJ.js +0 -89
  135. package/dist/chunk-FIPU4MLT.js +0 -21
  136. package/dist/chunk-FKRDCWBF.js +0 -22
  137. package/dist/chunk-HP34YGGJ.js +0 -22
  138. package/dist/chunk-IKHPGFCW.js +0 -14
  139. package/dist/chunk-IUYZQTJV.js +0 -30
  140. package/dist/chunk-KRNOMBXQ.js +0 -22
  141. package/dist/chunk-KSWLO5ZU.js +0 -102
  142. package/dist/chunk-N4SX7TZT.js +0 -96
  143. package/dist/chunk-STHEPPUZ.js +0 -11
@@ -23,21 +23,25 @@ __export(bitbucket_exports, {
23
23
  bitbucket: () => bitbucket
24
24
  });
25
25
  module.exports = __toCommonJS(bitbucket_exports);
26
- var bitbucket = {
27
- id: "bitbucket",
28
- name: "Bitbucket",
29
- authorizeURL: "https://bitbucket.org/site/oauth2/authorize",
30
- accessToken: "https://bitbucket.org/site/oauth2/access_token",
31
- userInfo: "https://api.bitbucket.org/2.0/user",
32
- scope: "account email",
33
- responseType: "code",
34
- profile(profile) {
35
- return {
36
- sub: profile.uuid ?? profile.account_id,
37
- name: profile.display_name ?? profile.nickname,
38
- image: profile.links.avatar.href
39
- };
40
- }
26
+ var bitbucket = (options) => {
27
+ return {
28
+ id: "bitbucket",
29
+ name: "Bitbucket",
30
+ authorizeURL: "https://bitbucket.org/site/oauth2/authorize",
31
+ accessToken: "https://bitbucket.org/site/oauth2/access_token",
32
+ userInfo: "https://api.bitbucket.org/2.0/user",
33
+ scope: "account email",
34
+ responseType: "code",
35
+ profile(profile) {
36
+ return {
37
+ sub: profile.uuid ?? profile.account_id,
38
+ name: profile.display_name ?? profile.nickname,
39
+ image: profile.links.avatar?.href,
40
+ email: void 0
41
+ };
42
+ },
43
+ ...options
44
+ };
41
45
  };
42
46
  // Annotate the CommonJS export names for ESM import in node:
43
47
  0 && (module.exports = {
@@ -1,7 +1,8 @@
1
- export { B as BitbucketProfile, v as bitbucket } from '../index-DkaLJFn8.js';
1
+ export { H as BitbucketProfile, K as bitbucket } from '../index-CSyIJmCM.js';
2
2
  import '../@types/utility.js';
3
3
  import 'zod';
4
4
  import '../schemas.js';
5
- import '@aura-stack/router/cookie';
5
+ import '../jose.js';
6
6
  import '@aura-stack/jose';
7
7
  import '@aura-stack/jose/jose';
8
+ import '@aura-stack/router/cookie';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  bitbucket
3
- } from "../chunk-FIPU4MLT.js";
3
+ } from "../chunk-4YHJ4IEQ.js";
4
4
  export {
5
5
  bitbucket
6
6
  };
@@ -23,30 +23,33 @@ __export(discord_exports, {
23
23
  discord: () => discord
24
24
  });
25
25
  module.exports = __toCommonJS(discord_exports);
26
- var discord = {
27
- id: "discord",
28
- name: "Discord",
29
- authorizeURL: "https://discord.com/oauth2/authorize",
30
- accessToken: "https://discord.com/api/oauth2/token",
31
- userInfo: "https://discord.com/api/users/@me",
32
- scope: "identify email",
33
- responseType: "code",
34
- profile(profile) {
35
- let image = "";
36
- if (profile.avatar === null) {
37
- const index = profile.discriminator === "0" ? (BigInt(profile.id) >> 22n) % 6n : Number(profile.discriminator) % 5;
38
- image = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
39
- } else {
40
- const format = profile.avatar.startsWith("a_") ? "gif" : "png";
41
- image = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.${format}`;
42
- }
43
- return {
44
- sub: profile.id,
45
- name: profile.global_name ?? profile.username,
46
- email: profile.email ?? "",
47
- image
48
- };
49
- }
26
+ var discord = (options) => {
27
+ return {
28
+ id: "discord",
29
+ name: "Discord",
30
+ authorizeURL: "https://discord.com/oauth2/authorize",
31
+ accessToken: "https://discord.com/api/oauth2/token",
32
+ userInfo: "https://discord.com/api/users/@me",
33
+ scope: "identify email",
34
+ responseType: "code",
35
+ profile(profile) {
36
+ let image = "";
37
+ if (profile.avatar === null) {
38
+ const index = profile.discriminator === "0" ? (BigInt(profile.id) >> 22n) % 6n : Number(profile.discriminator) % 5;
39
+ image = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
40
+ } else {
41
+ const format = profile.avatar.startsWith("a_") ? "gif" : "png";
42
+ image = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.${format}`;
43
+ }
44
+ return {
45
+ sub: profile.id,
46
+ name: profile.global_name ?? profile.username,
47
+ email: profile.email ?? "",
48
+ image
49
+ };
50
+ },
51
+ ...options
52
+ };
50
53
  };
51
54
  // Annotate the CommonJS export names for ESM import in node:
52
55
  0 && (module.exports = {
@@ -1,7 +1,8 @@
1
- export { D as DiscordProfile, N as Nameplate, t as discord } from '../index-DkaLJFn8.js';
1
+ export { D as DiscordProfile, N as Nameplate, z as discord } from '../index-CSyIJmCM.js';
2
2
  import 'zod';
3
3
  import '../schemas.js';
4
- import '@aura-stack/router/cookie';
4
+ import '../jose.js';
5
5
  import '@aura-stack/jose';
6
6
  import '@aura-stack/jose/jose';
7
+ import '@aura-stack/router/cookie';
7
8
  import '../@types/utility.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  discord
3
- } from "../chunk-IUYZQTJV.js";
3
+ } from "../chunk-OVHNRULD.js";
4
4
  export {
5
5
  discord
6
6
  };
@@ -23,22 +23,25 @@ __export(figma_exports, {
23
23
  figma: () => figma
24
24
  });
25
25
  module.exports = __toCommonJS(figma_exports);
26
- var figma = {
27
- id: "figma",
28
- name: "Figma",
29
- authorizeURL: "https://www.figma.com/oauth",
30
- accessToken: "https://api.figma.com/v1/oauth/token",
31
- userInfo: "https://api.figma.com/v1/me",
32
- scope: "current_user:read",
33
- responseType: "code",
34
- profile(profile) {
35
- return {
36
- sub: profile.id,
37
- name: profile.handle,
38
- email: profile.email,
39
- image: profile.img_url
40
- };
41
- }
26
+ var figma = (options) => {
27
+ return {
28
+ id: "figma",
29
+ name: "Figma",
30
+ authorizeURL: "https://www.figma.com/oauth",
31
+ accessToken: "https://api.figma.com/v1/oauth/token",
32
+ userInfo: "https://api.figma.com/v1/me",
33
+ scope: "current_user:read",
34
+ responseType: "code",
35
+ profile(profile) {
36
+ return {
37
+ sub: profile.id,
38
+ name: profile.handle,
39
+ email: profile.email,
40
+ image: profile.img_url
41
+ };
42
+ },
43
+ ...options
44
+ };
42
45
  };
43
46
  // Annotate the CommonJS export names for ESM import in node:
44
47
  0 && (module.exports = {
@@ -1,7 +1,8 @@
1
- export { F as FigmaProfile, u as figma } from '../index-DkaLJFn8.js';
1
+ export { F as FigmaProfile, B as figma } from '../index-CSyIJmCM.js';
2
2
  import 'zod';
3
3
  import '../schemas.js';
4
- import '@aura-stack/router/cookie';
4
+ import '../jose.js';
5
5
  import '@aura-stack/jose';
6
6
  import '@aura-stack/jose/jose';
7
+ import '@aura-stack/router/cookie';
7
8
  import '../@types/utility.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  figma
3
- } from "../chunk-FKRDCWBF.js";
3
+ } from "../chunk-KMMAZFSJ.js";
4
4
  export {
5
5
  figma
6
6
  };
@@ -23,14 +23,25 @@ __export(github_exports, {
23
23
  github: () => github
24
24
  });
25
25
  module.exports = __toCommonJS(github_exports);
26
- var github = {
27
- id: "github",
28
- name: "GitHub",
29
- authorizeURL: "https://github.com/login/oauth/authorize",
30
- accessToken: "https://github.com/login/oauth/access_token",
31
- userInfo: "https://api.github.com/user",
32
- scope: "read:user user:email",
33
- responseType: "code"
26
+ var github = (options) => {
27
+ return {
28
+ id: "github",
29
+ name: "GitHub",
30
+ authorizeURL: "https://github.com/login/oauth/authorize",
31
+ accessToken: "https://github.com/login/oauth/access_token",
32
+ userInfo: "https://api.github.com/user",
33
+ scope: "read:user user:email",
34
+ responseType: "code",
35
+ profile: (profile) => {
36
+ return {
37
+ sub: profile.id.toString(),
38
+ name: profile.name ?? profile.login,
39
+ email: profile.email ?? void 0,
40
+ image: profile.avatar_url
41
+ };
42
+ },
43
+ ...options
44
+ };
34
45
  };
35
46
  // Annotate the CommonJS export names for ESM import in node:
36
47
  0 && (module.exports = {
@@ -1,7 +1,8 @@
1
- export { w as GitHubProfile, y as github } from '../index-DkaLJFn8.js';
1
+ export { Q as GitHubProfile, V as github } from '../index-CSyIJmCM.js';
2
2
  import 'zod';
3
3
  import '../schemas.js';
4
- import '@aura-stack/router/cookie';
4
+ import '../jose.js';
5
5
  import '@aura-stack/jose';
6
6
  import '@aura-stack/jose/jose';
7
+ import '@aura-stack/router/cookie';
7
8
  import '../@types/utility.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  github
3
- } from "../chunk-IKHPGFCW.js";
3
+ } from "../chunk-FW4W3REU.js";
4
4
  export {
5
5
  github
6
6
  };
@@ -23,22 +23,25 @@ __export(gitlab_exports, {
23
23
  gitlab: () => gitlab
24
24
  });
25
25
  module.exports = __toCommonJS(gitlab_exports);
26
- var gitlab = {
27
- id: "gitlab",
28
- name: "GitLab",
29
- authorizeURL: "https://gitlab.com/oauth/authorize",
30
- accessToken: "https://gitlab.com/oauth/token",
31
- userInfo: "https://gitlab.com/api/v4/user",
32
- scope: "read_user",
33
- responseType: "code",
34
- profile(profile) {
35
- return {
36
- sub: profile.id.toString(),
37
- name: profile.name ?? profile.username,
38
- email: profile.email,
39
- avatar: profile.avatar_url
40
- };
41
- }
26
+ var gitlab = (options) => {
27
+ return {
28
+ id: "gitlab",
29
+ name: "GitLab",
30
+ authorizeURL: "https://gitlab.com/oauth/authorize",
31
+ accessToken: "https://gitlab.com/oauth/token",
32
+ userInfo: "https://gitlab.com/api/v4/user",
33
+ scope: "read_user",
34
+ responseType: "code",
35
+ profile(profile) {
36
+ return {
37
+ sub: profile.id.toString(),
38
+ name: profile.name ?? profile.username,
39
+ email: profile.email,
40
+ image: profile.avatar_url
41
+ };
42
+ },
43
+ ...options
44
+ };
42
45
  };
43
46
  // Annotate the CommonJS export names for ESM import in node:
44
47
  0 && (module.exports = {
@@ -1,7 +1,8 @@
1
- export { G as GitLabProfile, r as gitlab } from '../index-DkaLJFn8.js';
1
+ export { G as GitLabProfile, y as gitlab } from '../index-CSyIJmCM.js';
2
2
  import 'zod';
3
3
  import '../schemas.js';
4
- import '@aura-stack/router/cookie';
4
+ import '../jose.js';
5
5
  import '@aura-stack/jose';
6
6
  import '@aura-stack/jose/jose';
7
+ import '@aura-stack/router/cookie';
7
8
  import '../@types/utility.js';
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  gitlab
3
- } from "../chunk-KRNOMBXQ.js";
3
+ } from "../chunk-5LZ7TOM3.js";
4
4
  export {
5
5
  gitlab
6
6
  };