@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
@@ -1,49 +1 @@
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/oauth/gitlab.ts
21
- var gitlab_exports = {};
22
- __export(gitlab_exports, {
23
- gitlab: () => gitlab
24
- });
25
- module.exports = __toCommonJS(gitlab_exports);
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
- };
45
- };
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- gitlab
49
- });
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>({id:`gitlab`,name:`GitLab`,authorize:{url:`https://gitlab.com/oauth/authorize`,params:{scope:`read_user`,responseType:`code`}},accessToken:`https://gitlab.com/oauth/token`,userInfo:`https://gitlab.com/api/v4/user`,profile:e=>({sub:e.id.toString(),name:e.name??e.username,email:e.email,image:e.avatar_url}),...e});exports.gitlab=e;
@@ -1,8 +1,2 @@
1
- export { G as GitLabProfile, y as gitlab } from '../index-CSyIJmCM.js';
2
- import 'zod';
3
- import '../schemas.js';
4
- import '../jose.js';
5
- import '@aura-stack/jose';
6
- import '@aura-stack/jose/jose';
7
- import '@aura-stack/router/cookie';
8
- import '../@types/utility.js';
1
+ import { On as GitLabProfile, kn as gitlab } from "../index-nqLV2t91.js";
2
+ export { GitLabProfile, gitlab };
@@ -1,6 +1 @@
1
- import {
2
- gitlab
3
- } from "../chunk-5LZ7TOM3.js";
4
- export {
5
- gitlab
6
- };
1
+ const e=e=>({id:`gitlab`,name:`GitLab`,authorize:{url:`https://gitlab.com/oauth/authorize`,params:{scope:`read_user`,responseType:`code`}},accessToken:`https://gitlab.com/oauth/token`,userInfo:`https://gitlab.com/api/v4/user`,profile:e=>({sub:e.id.toString(),name:e.name??e.username,email:e.email,image:e.avatar_url}),...e});export{e as gitlab};
@@ -1,483 +1 @@
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/oauth/index.ts
21
- var oauth_exports = {};
22
- __export(oauth_exports, {
23
- bitbucket: () => bitbucket,
24
- builtInOAuthProviders: () => builtInOAuthProviders,
25
- createBuiltInOAuthProviders: () => createBuiltInOAuthProviders,
26
- discord: () => discord,
27
- figma: () => figma,
28
- github: () => github,
29
- gitlab: () => gitlab,
30
- mailchimp: () => mailchimp,
31
- pinterest: () => pinterest,
32
- spotify: () => spotify,
33
- strava: () => strava,
34
- x: () => x
35
- });
36
- module.exports = __toCommonJS(oauth_exports);
37
-
38
- // src/env.ts
39
- var import_meta = {};
40
- var env = new Proxy({}, {
41
- get(_, prop) {
42
- if (typeof prop !== "string") return void 0;
43
- const hasProperty = (process2) => {
44
- return process2 && Object.prototype.hasOwnProperty.call(process2, prop);
45
- };
46
- try {
47
- if (typeof process !== "undefined" && hasProperty(process.env)) {
48
- return process.env[prop];
49
- }
50
- if (typeof import_meta !== "undefined" && hasProperty(import_meta.env)) {
51
- return import_meta.env[prop];
52
- }
53
- if (typeof Deno !== "undefined" && Deno.env?.get) {
54
- return Deno.env.get(prop);
55
- }
56
- if (typeof Bun !== "undefined" && hasProperty(Bun.env)) {
57
- return Bun.env[prop];
58
- }
59
- const globalValue = globalThis[prop];
60
- return typeof globalValue === "string" ? globalValue : void 0;
61
- } catch {
62
- return void 0;
63
- }
64
- }
65
- });
66
-
67
- // src/oauth/github.ts
68
- var github = (options2) => {
69
- return {
70
- id: "github",
71
- name: "GitHub",
72
- authorizeURL: "https://github.com/login/oauth/authorize",
73
- accessToken: "https://github.com/login/oauth/access_token",
74
- userInfo: "https://api.github.com/user",
75
- scope: "read:user user:email",
76
- responseType: "code",
77
- profile: (profile) => {
78
- return {
79
- sub: profile.id.toString(),
80
- name: profile.name ?? profile.login,
81
- email: profile.email ?? void 0,
82
- image: profile.avatar_url
83
- };
84
- },
85
- ...options2
86
- };
87
- };
88
-
89
- // src/oauth/bitbucket.ts
90
- var bitbucket = (options2) => {
91
- return {
92
- id: "bitbucket",
93
- name: "Bitbucket",
94
- authorizeURL: "https://bitbucket.org/site/oauth2/authorize",
95
- accessToken: "https://bitbucket.org/site/oauth2/access_token",
96
- userInfo: "https://api.bitbucket.org/2.0/user",
97
- scope: "account email",
98
- responseType: "code",
99
- profile(profile) {
100
- return {
101
- sub: profile.uuid ?? profile.account_id,
102
- name: profile.display_name ?? profile.nickname,
103
- image: profile.links.avatar?.href,
104
- email: void 0
105
- };
106
- },
107
- ...options2
108
- };
109
- };
110
-
111
- // src/oauth/figma.ts
112
- var figma = (options2) => {
113
- return {
114
- id: "figma",
115
- name: "Figma",
116
- authorizeURL: "https://www.figma.com/oauth",
117
- accessToken: "https://api.figma.com/v1/oauth/token",
118
- userInfo: "https://api.figma.com/v1/me",
119
- scope: "current_user:read",
120
- responseType: "code",
121
- profile(profile) {
122
- return {
123
- sub: profile.id,
124
- name: profile.handle,
125
- email: profile.email,
126
- image: profile.img_url
127
- };
128
- },
129
- ...options2
130
- };
131
- };
132
-
133
- // src/oauth/discord.ts
134
- var discord = (options2) => {
135
- return {
136
- id: "discord",
137
- name: "Discord",
138
- authorizeURL: "https://discord.com/oauth2/authorize",
139
- accessToken: "https://discord.com/api/oauth2/token",
140
- userInfo: "https://discord.com/api/users/@me",
141
- scope: "identify email",
142
- responseType: "code",
143
- profile(profile) {
144
- let image = "";
145
- if (profile.avatar === null) {
146
- const index = profile.discriminator === "0" ? (BigInt(profile.id) >> 22n) % 6n : Number(profile.discriminator) % 5;
147
- image = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
148
- } else {
149
- const format = profile.avatar.startsWith("a_") ? "gif" : "png";
150
- image = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.${format}`;
151
- }
152
- return {
153
- sub: profile.id,
154
- name: profile.global_name ?? profile.username,
155
- email: profile.email ?? "",
156
- image
157
- };
158
- },
159
- ...options2
160
- };
161
- };
162
-
163
- // src/oauth/gitlab.ts
164
- var gitlab = (options2) => {
165
- return {
166
- id: "gitlab",
167
- name: "GitLab",
168
- authorizeURL: "https://gitlab.com/oauth/authorize",
169
- accessToken: "https://gitlab.com/oauth/token",
170
- userInfo: "https://gitlab.com/api/v4/user",
171
- scope: "read_user",
172
- responseType: "code",
173
- profile(profile) {
174
- return {
175
- sub: profile.id.toString(),
176
- name: profile.name ?? profile.username,
177
- email: profile.email,
178
- image: profile.avatar_url
179
- };
180
- },
181
- ...options2
182
- };
183
- };
184
-
185
- // src/oauth/spotify.ts
186
- var spotify = (options2) => {
187
- return {
188
- id: "spotify",
189
- name: "Spotify",
190
- authorizeURL: "https://accounts.spotify.com/authorize",
191
- accessToken: "https://accounts.spotify.com/api/token",
192
- userInfo: "https://api.spotify.com/v1/me",
193
- scope: "user-read-private user-read-email",
194
- responseType: "code",
195
- profile(profile) {
196
- return {
197
- sub: profile.id,
198
- name: profile.display_name,
199
- email: profile.email,
200
- image: profile.images[0]?.url ?? void 0
201
- };
202
- },
203
- ...options2
204
- };
205
- };
206
-
207
- // src/oauth/x.ts
208
- var x = (options2) => {
209
- return {
210
- id: "x",
211
- name: "X",
212
- authorizeURL: "https://twitter.com/i/oauth2/authorize",
213
- accessToken: "https://api.twitter.com/2/oauth2/token",
214
- userInfo: "https://api.twitter.com/2/users/me?user.fields=profile_image_url",
215
- scope: "tweet.read users.read offline.access",
216
- responseType: "code",
217
- profile(profile) {
218
- return {
219
- sub: profile.data.id,
220
- name: profile.data.name,
221
- image: profile.data.profile_image_url,
222
- email: void 0
223
- };
224
- },
225
- ...options2
226
- };
227
- };
228
-
229
- // src/oauth/strava.ts
230
- var strava = (options2) => {
231
- return {
232
- id: "strava",
233
- name: "Strava",
234
- authorizeURL: "https://www.strava.com/oauth/authorize",
235
- accessToken: "https://www.strava.com/oauth/token",
236
- userInfo: "https://www.strava.com/api/v3/athlete",
237
- scope: "read",
238
- responseType: "code",
239
- profile(profile) {
240
- return {
241
- sub: profile.id.toString(),
242
- name: `${profile.firstname} ${profile.lastname}`,
243
- image: profile.profile,
244
- email: void 0
245
- };
246
- },
247
- ...options2
248
- };
249
- };
250
-
251
- // src/oauth/mailchimp.ts
252
- var mailchimp = (options2) => {
253
- return {
254
- id: "mailchimp",
255
- name: "Mailchimp",
256
- authorizeURL: "https://login.mailchimp.com/oauth2/authorize",
257
- accessToken: "https://login.mailchimp.com/oauth2/token",
258
- userInfo: "https://login.mailchimp.com/oauth2/metadata",
259
- scope: "",
260
- responseType: "code",
261
- profile(profile) {
262
- return {
263
- sub: profile.user_id,
264
- name: profile.accountname,
265
- email: profile.login.email,
266
- image: profile.login.avatar
267
- };
268
- },
269
- ...options2
270
- };
271
- };
272
-
273
- // src/oauth/pinterest.ts
274
- var pinterest = (options2) => {
275
- return {
276
- id: "pinterest",
277
- name: "Pinterest",
278
- authorizeURL: "https://www.pinterest.com/oauth",
279
- accessToken: "https://api.pinterest.com/v5/oauth/token",
280
- userInfo: "https://api.pinterest.com/v5/user_account",
281
- scope: "user_accounts:read",
282
- responseType: "code",
283
- profile(profile) {
284
- return {
285
- sub: profile.id,
286
- name: profile.username,
287
- image: profile.profile_image,
288
- email: void 0
289
- };
290
- },
291
- ...options2
292
- };
293
- };
294
-
295
- // src/schemas.ts
296
- var import_zod = require("zod");
297
- var OAuthProviderCredentialsSchema = (0, import_zod.object)({
298
- id: (0, import_zod.string)(),
299
- name: (0, import_zod.string)(),
300
- authorizeURL: (0, import_zod.string)().url(),
301
- accessToken: (0, import_zod.string)().url(),
302
- scope: (0, import_zod.string)(),
303
- userInfo: (0, import_zod.string)().url(),
304
- responseType: (0, import_zod.enum)(["code", "token", "id_token"]),
305
- clientId: (0, import_zod.string)(),
306
- clientSecret: (0, import_zod.string)(),
307
- profile: import_zod.z.function().optional()
308
- });
309
- var OAuthProviderConfigSchema = (0, import_zod.object)({
310
- authorizeURL: (0, import_zod.string)().url(),
311
- accessToken: (0, import_zod.string)().url(),
312
- scope: (0, import_zod.string)().optional(),
313
- userInfo: (0, import_zod.string)().url(),
314
- responseType: (0, import_zod.enum)(["code", "token", "id_token"]),
315
- clientId: (0, import_zod.string)(),
316
- clientSecret: (0, import_zod.string)()
317
- });
318
- var OAuthAuthorization = OAuthProviderConfigSchema.extend({
319
- redirectURI: (0, import_zod.string)(),
320
- state: (0, import_zod.string)(),
321
- codeChallenge: (0, import_zod.string)(),
322
- codeChallengeMethod: (0, import_zod.enum)(["plain", "S256"])
323
- });
324
- var OAuthAuthorizationResponse = (0, import_zod.object)({
325
- state: (0, import_zod.string)({ message: "Missing state parameter in the OAuth authorization response." }),
326
- code: (0, import_zod.string)({ message: "Missing code parameter in the OAuth authorization response." })
327
- });
328
- var OAuthAuthorizationErrorResponse = (0, import_zod.object)({
329
- error: (0, import_zod.enum)([
330
- "invalid_request",
331
- "unauthorized_client",
332
- "access_denied",
333
- "unsupported_response_type",
334
- "invalid_scope",
335
- "server_error",
336
- "temporarily_unavailable"
337
- ]),
338
- error_description: (0, import_zod.string)().optional(),
339
- error_uri: (0, import_zod.string)().optional(),
340
- state: (0, import_zod.string)()
341
- });
342
- var OAuthAccessToken = OAuthProviderConfigSchema.extend({
343
- redirectURI: (0, import_zod.string)(),
344
- code: (0, import_zod.string)(),
345
- codeVerifier: (0, import_zod.string)().min(43).max(128)
346
- });
347
- var OAuthAccessTokenResponse = (0, import_zod.object)({
348
- access_token: (0, import_zod.string)(),
349
- token_type: (0, import_zod.string)().optional(),
350
- expires_in: (0, import_zod.number)().optional(),
351
- refresh_token: (0, import_zod.string)().optional(),
352
- scope: (0, import_zod.string)().optional().or((0, import_zod.null)())
353
- });
354
- var OAuthAccessTokenErrorResponse = (0, import_zod.object)({
355
- error: (0, import_zod.enum)([
356
- "invalid_request",
357
- "invalid_client",
358
- "invalid_grant",
359
- "unauthorized_client",
360
- "unsupported_grant_type",
361
- "invalid_scope"
362
- ]),
363
- error_description: (0, import_zod.string)().optional(),
364
- error_uri: (0, import_zod.string)().optional()
365
- });
366
- var OAuthErrorResponse = (0, import_zod.object)({
367
- error: (0, import_zod.string)(),
368
- error_description: (0, import_zod.string)().optional()
369
- });
370
- var OAuthEnvSchema = (0, import_zod.object)({
371
- clientId: import_zod.z.string().min(1, "OAuth Client ID is required in the environment variables."),
372
- clientSecret: import_zod.z.string().min(1, "OAuth Client Secret is required in the environment variables.")
373
- });
374
-
375
- // src/errors.ts
376
- var AuthInternalError = class extends Error {
377
- type = "AUTH_INTERNAL_ERROR";
378
- code;
379
- constructor(code, message, options2) {
380
- super(message, options2);
381
- this.code = code;
382
- this.name = new.target.name;
383
- Error.captureStackTrace(this, new.target);
384
- }
385
- };
386
-
387
- // src/utils.ts
388
- var import_router = require("@aura-stack/router");
389
- var formatZodError = (error) => {
390
- if (!error.issues || error.issues.length === 0) {
391
- return {};
392
- }
393
- return error.issues.reduce((previous, issue) => {
394
- const key = issue.path.join(".");
395
- return {
396
- ...previous,
397
- [key]: {
398
- code: issue.code,
399
- message: issue.message
400
- }
401
- };
402
- }, {});
403
- };
404
-
405
- // src/oauth/index.ts
406
- var builtInOAuthProviders = {
407
- github,
408
- bitbucket,
409
- figma,
410
- discord,
411
- gitlab,
412
- spotify,
413
- x,
414
- strava,
415
- mailchimp,
416
- pinterest
417
- };
418
- var defineOAuthEnvironment = (oauth) => {
419
- const clientIdSuffix = `${oauth.toUpperCase()}_CLIENT_ID`;
420
- const clientSecretSuffix = `${oauth.toUpperCase()}_CLIENT_SECRET`;
421
- const loadEnvs = OAuthEnvSchema.safeParse({
422
- clientId: env[`AURA_AUTH_${clientIdSuffix}`] ?? env[`AUTH_${clientIdSuffix}`] ?? env[`${clientIdSuffix}`],
423
- clientSecret: env[`AURA_AUTH_${clientSecretSuffix}`] ?? env[`AUTH_${clientSecretSuffix}`] ?? env[`${clientSecretSuffix}`]
424
- });
425
- if (!loadEnvs.success) {
426
- const msg = JSON.stringify(formatZodError(loadEnvs.error), null, 2);
427
- throw new AuthInternalError("INVALID_ENVIRONMENT_CONFIGURATION", msg);
428
- }
429
- return loadEnvs.data;
430
- };
431
- var defineOAuthProviderConfig = (config) => {
432
- if (typeof config === "string") {
433
- const definition = defineOAuthEnvironment(config);
434
- const oauthConfig = builtInOAuthProviders[config]();
435
- const parsed2 = OAuthProviderCredentialsSchema.safeParse({ ...oauthConfig, ...definition });
436
- if (!parsed2.success) {
437
- const details = JSON.stringify(formatZodError(parsed2.error), null, 2);
438
- throw new AuthInternalError(
439
- "INVALID_OAUTH_PROVIDER_CONFIGURATION",
440
- `Invalid configuration for OAuth provider "${config}": ${details}`
441
- );
442
- }
443
- return parsed2.data;
444
- }
445
- const hasCredentials = config.clientId && config.clientSecret;
446
- const envConfig = hasCredentials ? {} : defineOAuthEnvironment(config.id);
447
- const parsed = OAuthProviderCredentialsSchema.safeParse({ ...envConfig, ...config });
448
- if (!parsed.success) {
449
- const details = JSON.stringify(formatZodError(parsed.error), null, 2);
450
- throw new AuthInternalError(
451
- "INVALID_OAUTH_PROVIDER_CONFIGURATION",
452
- `Invalid configuration for OAuth provider "${config.id}": ${details}`
453
- );
454
- }
455
- return parsed.data;
456
- };
457
- var createBuiltInOAuthProviders = (oauth = []) => {
458
- return oauth.reduce((previous, config) => {
459
- const oauthConfig = defineOAuthProviderConfig(config);
460
- if (oauthConfig.id in previous) {
461
- throw new AuthInternalError(
462
- "DUPLICATED_OAUTH_PROVIDER_ID",
463
- `Duplicate OAuth provider id "${oauthConfig.id}" found. Each provider must have a unique id.`
464
- );
465
- }
466
- return { ...previous, [oauthConfig.id]: oauthConfig };
467
- }, {});
468
- };
469
- // Annotate the CommonJS export names for ESM import in node:
470
- 0 && (module.exports = {
471
- bitbucket,
472
- builtInOAuthProviders,
473
- createBuiltInOAuthProviders,
474
- discord,
475
- figma,
476
- github,
477
- gitlab,
478
- mailchimp,
479
- pinterest,
480
- spotify,
481
- strava,
482
- x
483
- });
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../oauth-BntNm6aE.cjs`),t=require(`./github.cjs`),n=require(`./bitbucket.cjs`),r=require(`./figma.cjs`),i=require(`./discord.cjs`),a=require(`./gitlab.cjs`),o=require(`./spotify.cjs`),s=require(`./x.cjs`),c=require(`./strava.cjs`),l=require(`./mailchimp.cjs`),u=require(`./pinterest.cjs`),d=require(`./twitch.cjs`),f=require(`./notion.cjs`),p=require(`./dropbox.cjs`),m=require(`./atlassian.cjs`);exports.atlassian=m.atlassian,exports.bitbucket=n.bitbucket,exports.builtInOAuthProviders=e.t,exports.createBuiltInOAuthProviders=e.n,exports.discord=i.discord,exports.dropbox=p.dropbox,exports.figma=r.figma,exports.github=t.github,exports.gitlab=a.gitlab,exports.mailchimp=l.mailchimp,exports.notion=f.notion,exports.pinterest=u.pinterest,exports.spotify=o.spotify,exports.strava=c.strava,exports.twitch=d.twitch,exports.x=s.x;
@@ -1,8 +1,2 @@
1
- export { H as BitbucketProfile, Z as BuiltInOAuthProvider, D as DiscordProfile, F as FigmaProfile, Q as GitHubProfile, G as GitLabProfile, n as Login, M as MailchimpProfile, N as Nameplate, P as PinterestProfile, u as SpotifyImage, v as SpotifyProfile, s as StravaProfile, q as SummaryClub, r as SummaryGear, X as XProfile, K as bitbucket, W as builtInOAuthProviders, Y as createBuiltInOAuthProviders, z as discord, B as figma, V as github, y as gitlab, o as mailchimp, p as pinterest, w as spotify, t as strava, x } from '../index-CSyIJmCM.js';
2
- import '../@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';
1
+ import { $t as atlassian, An as DiscordProfile, Cn as XProfile, Dn as spotify, En as SpotifyProfile, Fn as BitbucketProfile, In as bitbucket, Jt as BuiltInOAuthProvider, Ln as GitHubProfile, Mn as discord, Nn as FigmaProfile, On as GitLabProfile, Pn as figma, Qt as ExtendedProfile, Rn as github, Sn as strava, Tn as SpotifyImage, Xt as createBuiltInOAuthProviders, Yt as builtInOAuthProviders, Zt as AtlassianProfile, _n as MailchimpProfile, an as dropbox, bn as SummaryClub, cn as NotionUser, dn as notion, en as AccountType, fn as TwitchProfile, gn as Login, hn as pinterest, in as RootInfo, jn as Nameplate, kn as gitlab, ln as Owner, mn as PinterestProfile, nn as FullTeam, on as Bot, pn as twitch, rn as Name, sn as NotionProfile, tn as DropboxProfile, un as Person, vn as mailchimp, wn as x, xn as SummaryGear, yn as StravaProfile } from "../index-nqLV2t91.js";
2
+ export { AccountType, AtlassianProfile, BitbucketProfile, Bot, BuiltInOAuthProvider, DiscordProfile, DropboxProfile, ExtendedProfile, FigmaProfile, FullTeam, GitHubProfile, GitLabProfile, Login, MailchimpProfile, Name, Nameplate, NotionProfile, NotionUser, Owner, Person, PinterestProfile, RootInfo, SpotifyImage, SpotifyProfile, StravaProfile, SummaryClub, SummaryGear, TwitchProfile, XProfile, atlassian, bitbucket, builtInOAuthProviders, createBuiltInOAuthProviders, discord, dropbox, figma, github, gitlab, mailchimp, notion, pinterest, spotify, strava, twitch, x };
@@ -1,52 +1 @@
1
- import {
2
- builtInOAuthProviders,
3
- createBuiltInOAuthProviders
4
- } from "../chunk-TM5IPSNF.js";
5
- import {
6
- spotify
7
- } from "../chunk-IPKO6UQN.js";
8
- import {
9
- strava
10
- } from "../chunk-54CZPKR4.js";
11
- import {
12
- x
13
- } from "../chunk-EEE7UM5T.js";
14
- import {
15
- bitbucket
16
- } from "../chunk-4YHJ4IEQ.js";
17
- import {
18
- discord
19
- } from "../chunk-OVHNRULD.js";
20
- import {
21
- figma
22
- } from "../chunk-KMMAZFSJ.js";
23
- import {
24
- github
25
- } from "../chunk-FW4W3REU.js";
26
- import {
27
- gitlab
28
- } from "../chunk-5LZ7TOM3.js";
29
- import {
30
- mailchimp
31
- } from "../chunk-LDU7A2JE.js";
32
- import {
33
- pinterest
34
- } from "../chunk-E6G5YCI6.js";
35
- import "../chunk-KJBAQZX2.js";
36
- import "../chunk-QQVSRXGX.js";
37
- import "../chunk-4MYWAOLG.js";
38
- import "../chunk-RRLIF4PQ.js";
39
- export {
40
- bitbucket,
41
- builtInOAuthProviders,
42
- createBuiltInOAuthProviders,
43
- discord,
44
- figma,
45
- github,
46
- gitlab,
47
- mailchimp,
48
- pinterest,
49
- spotify,
50
- strava,
51
- x
52
- };
1
+ import{n as e,t}from"../oauth-DmHy9VrB.js";import{github as n}from"./github.js";import{bitbucket as r}from"./bitbucket.js";import{figma as i}from"./figma.js";import{discord as a}from"./discord.js";import{gitlab as o}from"./gitlab.js";import{spotify as s}from"./spotify.js";import{x as c}from"./x.js";import{strava as l}from"./strava.js";import{mailchimp as u}from"./mailchimp.js";import{pinterest as d}from"./pinterest.js";import{twitch as f}from"./twitch.js";import{notion as p}from"./notion.js";import{dropbox as m}from"./dropbox.js";import{atlassian as h}from"./atlassian.js";export{h as atlassian,r as bitbucket,t as builtInOAuthProviders,e as createBuiltInOAuthProviders,a as discord,m as dropbox,i as figma,n as github,o as gitlab,u as mailchimp,p as notion,d as pinterest,s as spotify,l as strava,f as twitch,c as x};
@@ -1,49 +1 @@
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/oauth/mailchimp.ts
21
- var mailchimp_exports = {};
22
- __export(mailchimp_exports, {
23
- mailchimp: () => mailchimp
24
- });
25
- module.exports = __toCommonJS(mailchimp_exports);
26
- var mailchimp = (options) => {
27
- return {
28
- id: "mailchimp",
29
- name: "Mailchimp",
30
- authorizeURL: "https://login.mailchimp.com/oauth2/authorize",
31
- accessToken: "https://login.mailchimp.com/oauth2/token",
32
- userInfo: "https://login.mailchimp.com/oauth2/metadata",
33
- scope: "",
34
- responseType: "code",
35
- profile(profile) {
36
- return {
37
- sub: profile.user_id,
38
- name: profile.accountname,
39
- email: profile.login.email,
40
- image: profile.login.avatar
41
- };
42
- },
43
- ...options
44
- };
45
- };
46
- // Annotate the CommonJS export names for ESM import in node:
47
- 0 && (module.exports = {
48
- mailchimp
49
- });
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=e=>({id:`mailchimp`,name:`Mailchimp`,authorize:`https://login.mailchimp.com/oauth2/authorize`,accessToken:`https://login.mailchimp.com/oauth2/token`,userInfo:`https://login.mailchimp.com/oauth2/metadata`,profile:e=>({sub:e.user_id,name:e.accountname,email:e.login.email,image:e.login.avatar}),...e});exports.mailchimp=e;
@@ -1,8 +1,2 @@
1
- export { n as Login, M as MailchimpProfile, o as mailchimp } from '../index-CSyIJmCM.js';
2
- import 'zod';
3
- import '../schemas.js';
4
- import '../jose.js';
5
- import '@aura-stack/jose';
6
- import '@aura-stack/jose/jose';
7
- import '@aura-stack/router/cookie';
8
- import '../@types/utility.js';
1
+ import { _n as MailchimpProfile, gn as Login, vn as mailchimp } from "../index-nqLV2t91.js";
2
+ export { Login, MailchimpProfile, mailchimp };