@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.
- package/dist/@types/index.d.ts +3 -2
- package/dist/@types/router.d.d.ts +3 -2
- package/dist/actions/callback/access-token.cjs +52 -41
- package/dist/actions/callback/access-token.d.ts +5 -4
- package/dist/actions/callback/access-token.js +3 -2
- package/dist/actions/callback/callback.cjs +69 -52
- package/dist/actions/callback/callback.d.ts +26 -3
- package/dist/actions/callback/callback.js +6 -5
- package/dist/actions/callback/userinfo.cjs +54 -43
- package/dist/actions/callback/userinfo.d.ts +3 -2
- package/dist/actions/callback/userinfo.js +3 -2
- package/dist/actions/csrfToken/csrfToken.cjs +2 -2
- package/dist/actions/csrfToken/csrfToken.d.ts +3 -1
- package/dist/actions/csrfToken/csrfToken.js +2 -2
- package/dist/actions/index.cjs +93 -71
- package/dist/actions/index.d.ts +3 -2
- package/dist/actions/index.js +15 -14
- package/dist/actions/session/session.d.ts +3 -1
- package/dist/actions/session/session.js +2 -2
- package/dist/actions/signIn/authorization.cjs +40 -40
- package/dist/actions/signIn/authorization.d.ts +3 -2
- package/dist/actions/signIn/authorization.js +2 -2
- package/dist/actions/signIn/signIn.cjs +63 -50
- package/dist/actions/signIn/signIn.d.ts +25 -3
- package/dist/actions/signIn/signIn.js +4 -3
- package/dist/actions/signOut/signOut.cjs +66 -66
- package/dist/actions/signOut/signOut.d.ts +9 -1
- package/dist/actions/signOut/signOut.js +4 -4
- package/dist/assert.d.ts +3 -2
- package/dist/{chunk-2RXNXMCZ.js → chunk-3EUWD5BB.js} +15 -7
- package/dist/{chunk-NEVKX6K2.js → chunk-A3N4PVAT.js} +3 -3
- package/dist/chunk-B737EUJV.js +22 -0
- package/dist/{chunk-7H3OR6UU.js → chunk-EMKJA2GJ.js} +18 -10
- package/dist/{chunk-4V4JNXVF.js → chunk-GA2SMTJO.js} +9 -6
- package/dist/chunk-HP34YGGJ.js +22 -0
- package/dist/{chunk-QDO2KSRJ.js → chunk-HT4YLL7N.js} +1 -1
- package/dist/{chunk-ZLR3LI6X.js → chunk-IVET23KF.js} +7 -4
- package/dist/{chunk-PTJUYB33.js → chunk-JVFTCTTE.js} +1 -1
- package/dist/{chunk-UEH3LVON.js → chunk-KSWLO5ZU.js} +21 -16
- package/dist/{chunk-QEZL7EYN.js → chunk-N4SX7TZT.js} +3 -3
- package/dist/{chunk-IMICRJ5U.js → chunk-W6LG7BFW.js} +14 -14
- package/dist/{chunk-WD7AUHQ5.js → chunk-YRCB5FLE.js} +8 -8
- package/dist/chunk-ZNCZVF6U.js +14 -0
- package/dist/cookie.cjs +14 -14
- package/dist/cookie.d.ts +3 -2
- package/dist/cookie.js +1 -1
- package/dist/errors.d.ts +3 -2
- package/dist/{index-EqsoyjrF.d.ts → index-B8jeIElf.d.ts} +57 -8
- package/dist/index.cjs +159 -95
- package/dist/index.d.ts +66 -5
- package/dist/index.js +23 -19
- package/dist/jose.cjs +2 -2
- package/dist/oauth/bitbucket.d.ts +3 -2
- package/dist/oauth/discord.d.ts +3 -2
- package/dist/oauth/figma.d.ts +3 -2
- package/dist/oauth/github.d.ts +3 -2
- package/dist/oauth/gitlab.d.ts +3 -2
- package/dist/oauth/index.cjs +85 -41
- package/dist/oauth/index.d.ts +3 -2
- package/dist/oauth/index.js +16 -8
- package/dist/oauth/mailchimp.cjs +46 -0
- package/dist/oauth/mailchimp.d.ts +7 -0
- package/dist/oauth/mailchimp.js +6 -0
- package/dist/oauth/pinterest.cjs +46 -0
- package/dist/oauth/pinterest.d.ts +7 -0
- package/dist/oauth/pinterest.js +6 -0
- package/dist/oauth/spotify.d.ts +3 -2
- package/dist/oauth/strava.d.ts +3 -2
- package/dist/oauth/x.d.ts +3 -2
- package/dist/request.cjs +38 -0
- package/dist/request.d.ts +13 -0
- package/dist/request.js +6 -0
- package/dist/schemas.cjs +40 -40
- package/dist/schemas.d.ts +15 -15
- package/dist/schemas.js +1 -1
- package/dist/secure.cjs +5 -5
- package/dist/secure.d.ts +3 -2
- package/dist/utils.d.ts +3 -3
- package/package.json +7 -5
package/dist/oauth/figma.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { F as FigmaProfile,
|
|
2
|
-
import 'zod
|
|
1
|
+
export { F as FigmaProfile, u as figma } 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';
|
package/dist/oauth/github.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import 'zod
|
|
1
|
+
export { w as GitHubProfile, y as github } 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';
|
package/dist/oauth/gitlab.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { G as GitLabProfile,
|
|
2
|
-
import 'zod
|
|
1
|
+
export { G as GitLabProfile, r as gitlab } 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';
|
package/dist/oauth/index.cjs
CHANGED
|
@@ -27,6 +27,8 @@ __export(oauth_exports, {
|
|
|
27
27
|
figma: () => figma,
|
|
28
28
|
github: () => github,
|
|
29
29
|
gitlab: () => gitlab,
|
|
30
|
+
mailchimp: () => mailchimp,
|
|
31
|
+
pinterest: () => pinterest,
|
|
30
32
|
spotify: () => spotify,
|
|
31
33
|
strava: () => strava,
|
|
32
34
|
x: () => x
|
|
@@ -184,29 +186,67 @@ var strava = {
|
|
|
184
186
|
}
|
|
185
187
|
};
|
|
186
188
|
|
|
189
|
+
// src/oauth/mailchimp.ts
|
|
190
|
+
var mailchimp = {
|
|
191
|
+
id: "mailchimp",
|
|
192
|
+
name: "Mailchimp",
|
|
193
|
+
authorizeURL: "https://login.mailchimp.com/oauth2/authorize",
|
|
194
|
+
accessToken: "https://login.mailchimp.com/oauth2/token",
|
|
195
|
+
userInfo: "https://login.mailchimp.com/oauth2/metadata",
|
|
196
|
+
scope: "",
|
|
197
|
+
responseType: "code",
|
|
198
|
+
profile(profile) {
|
|
199
|
+
return {
|
|
200
|
+
sub: profile.user_id,
|
|
201
|
+
name: profile.accountname,
|
|
202
|
+
email: profile.login.login_email,
|
|
203
|
+
image: null
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// src/oauth/pinterest.ts
|
|
209
|
+
var pinterest = {
|
|
210
|
+
id: "pinterest",
|
|
211
|
+
name: "Pinterest",
|
|
212
|
+
authorizeURL: "https://api.pinterest.com/oauth/",
|
|
213
|
+
accessToken: "https://api.pinterest.com/v5/oauth/token",
|
|
214
|
+
userInfo: "https://api.pinterest.com/v5/user_account",
|
|
215
|
+
scope: "user_accounts:read",
|
|
216
|
+
responseType: "code",
|
|
217
|
+
profile(profile) {
|
|
218
|
+
return {
|
|
219
|
+
sub: profile.id,
|
|
220
|
+
name: profile.username,
|
|
221
|
+
email: null,
|
|
222
|
+
image: profile.profile_image
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
187
227
|
// src/schemas.ts
|
|
188
|
-
var
|
|
189
|
-
var OAuthProviderConfigSchema = (0,
|
|
190
|
-
authorizeURL: (0,
|
|
191
|
-
accessToken: (0,
|
|
192
|
-
scope: (0,
|
|
193
|
-
userInfo: (0,
|
|
194
|
-
responseType: (0,
|
|
195
|
-
clientId: (0,
|
|
196
|
-
clientSecret: (0,
|
|
228
|
+
var import_zod = require("zod");
|
|
229
|
+
var OAuthProviderConfigSchema = (0, import_zod.object)({
|
|
230
|
+
authorizeURL: (0, import_zod.string)().url(),
|
|
231
|
+
accessToken: (0, import_zod.string)().url(),
|
|
232
|
+
scope: (0, import_zod.string)().optional(),
|
|
233
|
+
userInfo: (0, import_zod.string)().url(),
|
|
234
|
+
responseType: (0, import_zod.enum)(["code", "token", "id_token"]),
|
|
235
|
+
clientId: (0, import_zod.string)(),
|
|
236
|
+
clientSecret: (0, import_zod.string)()
|
|
197
237
|
});
|
|
198
238
|
var OAuthAuthorization = OAuthProviderConfigSchema.extend({
|
|
199
|
-
redirectURI: (0,
|
|
200
|
-
state: (0,
|
|
201
|
-
codeChallenge: (0,
|
|
202
|
-
codeChallengeMethod: (0,
|
|
239
|
+
redirectURI: (0, import_zod.string)(),
|
|
240
|
+
state: (0, import_zod.string)(),
|
|
241
|
+
codeChallenge: (0, import_zod.string)(),
|
|
242
|
+
codeChallengeMethod: (0, import_zod.enum)(["plain", "S256"])
|
|
203
243
|
});
|
|
204
|
-
var OAuthAuthorizationResponse = (0,
|
|
205
|
-
state: (0,
|
|
206
|
-
code: (0,
|
|
244
|
+
var OAuthAuthorizationResponse = (0, import_zod.object)({
|
|
245
|
+
state: (0, import_zod.string)({ message: "Missing state parameter in the OAuth authorization response." }),
|
|
246
|
+
code: (0, import_zod.string)({ message: "Missing code parameter in the OAuth authorization response." })
|
|
207
247
|
});
|
|
208
|
-
var OAuthAuthorizationErrorResponse = (0,
|
|
209
|
-
error: (0,
|
|
248
|
+
var OAuthAuthorizationErrorResponse = (0, import_zod.object)({
|
|
249
|
+
error: (0, import_zod.enum)([
|
|
210
250
|
"invalid_request",
|
|
211
251
|
"unauthorized_client",
|
|
212
252
|
"access_denied",
|
|
@@ -215,24 +255,24 @@ var OAuthAuthorizationErrorResponse = (0, import_v4.object)({
|
|
|
215
255
|
"server_error",
|
|
216
256
|
"temporarily_unavailable"
|
|
217
257
|
]),
|
|
218
|
-
error_description: (0,
|
|
219
|
-
error_uri: (0,
|
|
220
|
-
state: (0,
|
|
258
|
+
error_description: (0, import_zod.string)().optional(),
|
|
259
|
+
error_uri: (0, import_zod.string)().optional(),
|
|
260
|
+
state: (0, import_zod.string)()
|
|
221
261
|
});
|
|
222
262
|
var OAuthAccessToken = OAuthProviderConfigSchema.extend({
|
|
223
|
-
redirectURI: (0,
|
|
224
|
-
code: (0,
|
|
225
|
-
codeVerifier: (0,
|
|
263
|
+
redirectURI: (0, import_zod.string)(),
|
|
264
|
+
code: (0, import_zod.string)(),
|
|
265
|
+
codeVerifier: (0, import_zod.string)().min(43).max(128)
|
|
226
266
|
});
|
|
227
|
-
var OAuthAccessTokenResponse = (0,
|
|
228
|
-
access_token: (0,
|
|
229
|
-
token_type: (0,
|
|
230
|
-
expires_in: (0,
|
|
231
|
-
refresh_token: (0,
|
|
232
|
-
scope: (0,
|
|
267
|
+
var OAuthAccessTokenResponse = (0, import_zod.object)({
|
|
268
|
+
access_token: (0, import_zod.string)(),
|
|
269
|
+
token_type: (0, import_zod.string)().optional(),
|
|
270
|
+
expires_in: (0, import_zod.number)().optional(),
|
|
271
|
+
refresh_token: (0, import_zod.string)().optional(),
|
|
272
|
+
scope: (0, import_zod.string)().optional().or((0, import_zod.null)())
|
|
233
273
|
});
|
|
234
|
-
var OAuthAccessTokenErrorResponse = (0,
|
|
235
|
-
error: (0,
|
|
274
|
+
var OAuthAccessTokenErrorResponse = (0, import_zod.object)({
|
|
275
|
+
error: (0, import_zod.enum)([
|
|
236
276
|
"invalid_request",
|
|
237
277
|
"invalid_client",
|
|
238
278
|
"invalid_grant",
|
|
@@ -240,16 +280,16 @@ var OAuthAccessTokenErrorResponse = (0, import_v4.object)({
|
|
|
240
280
|
"unsupported_grant_type",
|
|
241
281
|
"invalid_scope"
|
|
242
282
|
]),
|
|
243
|
-
error_description: (0,
|
|
244
|
-
error_uri: (0,
|
|
283
|
+
error_description: (0, import_zod.string)().optional(),
|
|
284
|
+
error_uri: (0, import_zod.string)().optional()
|
|
245
285
|
});
|
|
246
|
-
var OAuthErrorResponse = (0,
|
|
247
|
-
error: (0,
|
|
248
|
-
error_description: (0,
|
|
286
|
+
var OAuthErrorResponse = (0, import_zod.object)({
|
|
287
|
+
error: (0, import_zod.string)(),
|
|
288
|
+
error_description: (0, import_zod.string)().optional()
|
|
249
289
|
});
|
|
250
|
-
var OAuthEnvSchema = (0,
|
|
251
|
-
clientId:
|
|
252
|
-
clientSecret:
|
|
290
|
+
var OAuthEnvSchema = (0, import_zod.object)({
|
|
291
|
+
clientId: import_zod.z.string().min(1, "OAuth Client ID is required in the environment variables."),
|
|
292
|
+
clientSecret: import_zod.z.string().min(1, "OAuth Client Secret is required in the environment variables.")
|
|
253
293
|
});
|
|
254
294
|
|
|
255
295
|
// src/errors.ts
|
|
@@ -291,7 +331,9 @@ var builtInOAuthProviders = {
|
|
|
291
331
|
gitlab,
|
|
292
332
|
spotify,
|
|
293
333
|
x,
|
|
294
|
-
strava
|
|
334
|
+
strava,
|
|
335
|
+
mailchimp,
|
|
336
|
+
pinterest
|
|
295
337
|
};
|
|
296
338
|
var defineOAuthEnvironment = (oauth) => {
|
|
297
339
|
const env = process.env;
|
|
@@ -333,6 +375,8 @@ var createBuiltInOAuthProviders = (oauth = []) => {
|
|
|
333
375
|
figma,
|
|
334
376
|
github,
|
|
335
377
|
gitlab,
|
|
378
|
+
mailchimp,
|
|
379
|
+
pinterest,
|
|
336
380
|
spotify,
|
|
337
381
|
strava,
|
|
338
382
|
x
|
package/dist/oauth/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { B as BitbucketProfile,
|
|
1
|
+
export { B as BitbucketProfile, K as BuiltInOAuthProvider, D as DiscordProfile, F as FigmaProfile, w as GitHubProfile, G as GitLabProfile, I as Image, L as Login, M as MailchimpProfile, N as Nameplate, P as PinterestProfile, o as SpotifyProfile, n as StravaProfile, k as SummaryClub, l as SummaryGear, X as XProfile, v as bitbucket, z as builtInOAuthProviders, H as createBuiltInOAuthProviders, t as discord, u as figma, y as github, r as gitlab, m as mailchimp, p as pinterest, q as spotify, s as strava, x } from '../index-B8jeIElf.js';
|
|
2
2
|
import '../@types/utility.js';
|
|
3
|
-
import 'zod
|
|
3
|
+
import 'zod';
|
|
4
4
|
import '../schemas.js';
|
|
5
5
|
import '@aura-stack/router/cookie';
|
|
6
|
+
import '@aura-stack/jose';
|
|
6
7
|
import '@aura-stack/jose/jose';
|
package/dist/oauth/index.js
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
builtInOAuthProviders,
|
|
3
3
|
createBuiltInOAuthProviders
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-EMKJA2GJ.js";
|
|
5
|
+
import {
|
|
6
|
+
x
|
|
7
|
+
} from "../chunk-42XB3YCW.js";
|
|
8
|
+
import {
|
|
9
|
+
figma
|
|
10
|
+
} from "../chunk-FKRDCWBF.js";
|
|
5
11
|
import {
|
|
6
12
|
github
|
|
7
13
|
} from "../chunk-IKHPGFCW.js";
|
|
8
14
|
import {
|
|
9
15
|
gitlab
|
|
10
16
|
} from "../chunk-KRNOMBXQ.js";
|
|
17
|
+
import {
|
|
18
|
+
mailchimp
|
|
19
|
+
} from "../chunk-B737EUJV.js";
|
|
20
|
+
import {
|
|
21
|
+
pinterest
|
|
22
|
+
} from "../chunk-HP34YGGJ.js";
|
|
11
23
|
import {
|
|
12
24
|
spotify
|
|
13
25
|
} from "../chunk-E3OXBRYF.js";
|
|
14
26
|
import {
|
|
15
27
|
strava
|
|
16
28
|
} from "../chunk-6R2YZ4AC.js";
|
|
17
|
-
import {
|
|
18
|
-
x
|
|
19
|
-
} from "../chunk-42XB3YCW.js";
|
|
20
29
|
import {
|
|
21
30
|
bitbucket
|
|
22
31
|
} from "../chunk-FIPU4MLT.js";
|
|
23
32
|
import {
|
|
24
33
|
discord
|
|
25
34
|
} from "../chunk-IUYZQTJV.js";
|
|
26
|
-
import {
|
|
27
|
-
figma
|
|
28
|
-
} from "../chunk-FKRDCWBF.js";
|
|
29
|
-
import "../chunk-WD7AUHQ5.js";
|
|
30
35
|
import "../chunk-CXLATHS5.js";
|
|
31
36
|
import "../chunk-RRLIF4PQ.js";
|
|
37
|
+
import "../chunk-YRCB5FLE.js";
|
|
32
38
|
export {
|
|
33
39
|
bitbucket,
|
|
34
40
|
builtInOAuthProviders,
|
|
@@ -37,6 +43,8 @@ export {
|
|
|
37
43
|
figma,
|
|
38
44
|
github,
|
|
39
45
|
gitlab,
|
|
46
|
+
mailchimp,
|
|
47
|
+
pinterest,
|
|
40
48
|
spotify,
|
|
41
49
|
strava,
|
|
42
50
|
x
|
|
@@ -0,0 +1,46 @@
|
|
|
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 = {
|
|
27
|
+
id: "mailchimp",
|
|
28
|
+
name: "Mailchimp",
|
|
29
|
+
authorizeURL: "https://login.mailchimp.com/oauth2/authorize",
|
|
30
|
+
accessToken: "https://login.mailchimp.com/oauth2/token",
|
|
31
|
+
userInfo: "https://login.mailchimp.com/oauth2/metadata",
|
|
32
|
+
scope: "",
|
|
33
|
+
responseType: "code",
|
|
34
|
+
profile(profile) {
|
|
35
|
+
return {
|
|
36
|
+
sub: profile.user_id,
|
|
37
|
+
name: profile.accountname,
|
|
38
|
+
email: profile.login.login_email,
|
|
39
|
+
image: null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
mailchimp
|
|
46
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
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/pinterest.ts
|
|
21
|
+
var pinterest_exports = {};
|
|
22
|
+
__export(pinterest_exports, {
|
|
23
|
+
pinterest: () => pinterest
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(pinterest_exports);
|
|
26
|
+
var pinterest = {
|
|
27
|
+
id: "pinterest",
|
|
28
|
+
name: "Pinterest",
|
|
29
|
+
authorizeURL: "https://api.pinterest.com/oauth/",
|
|
30
|
+
accessToken: "https://api.pinterest.com/v5/oauth/token",
|
|
31
|
+
userInfo: "https://api.pinterest.com/v5/user_account",
|
|
32
|
+
scope: "user_accounts:read",
|
|
33
|
+
responseType: "code",
|
|
34
|
+
profile(profile) {
|
|
35
|
+
return {
|
|
36
|
+
sub: profile.id,
|
|
37
|
+
name: profile.username,
|
|
38
|
+
email: null,
|
|
39
|
+
image: profile.profile_image
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
pinterest
|
|
46
|
+
});
|
package/dist/oauth/spotify.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { I as Image,
|
|
2
|
-
import 'zod
|
|
1
|
+
export { I as Image, o as SpotifyProfile, q as spotify } 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';
|
package/dist/oauth/strava.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import 'zod
|
|
1
|
+
export { n as StravaProfile, k as SummaryClub, l as SummaryGear, s as strava } 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';
|
package/dist/oauth/x.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { X as XProfile, x } from '../index-
|
|
2
|
-
import 'zod
|
|
1
|
+
export { X as XProfile, x } 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';
|
package/dist/request.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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/request.ts
|
|
21
|
+
var request_exports = {};
|
|
22
|
+
__export(request_exports, {
|
|
23
|
+
fetchAsync: () => fetchAsync
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(request_exports);
|
|
26
|
+
var fetchAsync = async (url, options = {}, timeout = 5e3) => {
|
|
27
|
+
const controller = new AbortController();
|
|
28
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
29
|
+
const response = await fetch(url, {
|
|
30
|
+
...options,
|
|
31
|
+
signal: controller.signal
|
|
32
|
+
}).finally(() => clearTimeout(timeoutId));
|
|
33
|
+
return response;
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
fetchAsync
|
|
38
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches a resource with a timeout mechanism.
|
|
3
|
+
*
|
|
4
|
+
* @param url - The URL or Request object to fetch
|
|
5
|
+
* @param options - Optional RequestInit configuration object
|
|
6
|
+
* @param timeout - Timeout duration in milliseconds (default: 5000ms)
|
|
7
|
+
* @returns A promise that resolves to the Response object
|
|
8
|
+
* @example
|
|
9
|
+
* const response = await fetchAsync('https://api.example.com/data', {}, 3000);
|
|
10
|
+
*/
|
|
11
|
+
declare const fetchAsync: (url: string | Request, options?: RequestInit, timeout?: number) => Promise<Response>;
|
|
12
|
+
|
|
13
|
+
export { fetchAsync };
|
package/dist/request.js
ADDED
package/dist/schemas.cjs
CHANGED
|
@@ -31,28 +31,28 @@ __export(schemas_exports, {
|
|
|
31
31
|
OAuthProviderConfigSchema: () => OAuthProviderConfigSchema
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(schemas_exports);
|
|
34
|
-
var
|
|
35
|
-
var OAuthProviderConfigSchema = (0,
|
|
36
|
-
authorizeURL: (0,
|
|
37
|
-
accessToken: (0,
|
|
38
|
-
scope: (0,
|
|
39
|
-
userInfo: (0,
|
|
40
|
-
responseType: (0,
|
|
41
|
-
clientId: (0,
|
|
42
|
-
clientSecret: (0,
|
|
34
|
+
var import_zod = require("zod");
|
|
35
|
+
var OAuthProviderConfigSchema = (0, import_zod.object)({
|
|
36
|
+
authorizeURL: (0, import_zod.string)().url(),
|
|
37
|
+
accessToken: (0, import_zod.string)().url(),
|
|
38
|
+
scope: (0, import_zod.string)().optional(),
|
|
39
|
+
userInfo: (0, import_zod.string)().url(),
|
|
40
|
+
responseType: (0, import_zod.enum)(["code", "token", "id_token"]),
|
|
41
|
+
clientId: (0, import_zod.string)(),
|
|
42
|
+
clientSecret: (0, import_zod.string)()
|
|
43
43
|
});
|
|
44
44
|
var OAuthAuthorization = OAuthProviderConfigSchema.extend({
|
|
45
|
-
redirectURI: (0,
|
|
46
|
-
state: (0,
|
|
47
|
-
codeChallenge: (0,
|
|
48
|
-
codeChallengeMethod: (0,
|
|
45
|
+
redirectURI: (0, import_zod.string)(),
|
|
46
|
+
state: (0, import_zod.string)(),
|
|
47
|
+
codeChallenge: (0, import_zod.string)(),
|
|
48
|
+
codeChallengeMethod: (0, import_zod.enum)(["plain", "S256"])
|
|
49
49
|
});
|
|
50
|
-
var OAuthAuthorizationResponse = (0,
|
|
51
|
-
state: (0,
|
|
52
|
-
code: (0,
|
|
50
|
+
var OAuthAuthorizationResponse = (0, import_zod.object)({
|
|
51
|
+
state: (0, import_zod.string)({ message: "Missing state parameter in the OAuth authorization response." }),
|
|
52
|
+
code: (0, import_zod.string)({ message: "Missing code parameter in the OAuth authorization response." })
|
|
53
53
|
});
|
|
54
|
-
var OAuthAuthorizationErrorResponse = (0,
|
|
55
|
-
error: (0,
|
|
54
|
+
var OAuthAuthorizationErrorResponse = (0, import_zod.object)({
|
|
55
|
+
error: (0, import_zod.enum)([
|
|
56
56
|
"invalid_request",
|
|
57
57
|
"unauthorized_client",
|
|
58
58
|
"access_denied",
|
|
@@ -61,24 +61,24 @@ var OAuthAuthorizationErrorResponse = (0, import_v4.object)({
|
|
|
61
61
|
"server_error",
|
|
62
62
|
"temporarily_unavailable"
|
|
63
63
|
]),
|
|
64
|
-
error_description: (0,
|
|
65
|
-
error_uri: (0,
|
|
66
|
-
state: (0,
|
|
64
|
+
error_description: (0, import_zod.string)().optional(),
|
|
65
|
+
error_uri: (0, import_zod.string)().optional(),
|
|
66
|
+
state: (0, import_zod.string)()
|
|
67
67
|
});
|
|
68
68
|
var OAuthAccessToken = OAuthProviderConfigSchema.extend({
|
|
69
|
-
redirectURI: (0,
|
|
70
|
-
code: (0,
|
|
71
|
-
codeVerifier: (0,
|
|
69
|
+
redirectURI: (0, import_zod.string)(),
|
|
70
|
+
code: (0, import_zod.string)(),
|
|
71
|
+
codeVerifier: (0, import_zod.string)().min(43).max(128)
|
|
72
72
|
});
|
|
73
|
-
var OAuthAccessTokenResponse = (0,
|
|
74
|
-
access_token: (0,
|
|
75
|
-
token_type: (0,
|
|
76
|
-
expires_in: (0,
|
|
77
|
-
refresh_token: (0,
|
|
78
|
-
scope: (0,
|
|
73
|
+
var OAuthAccessTokenResponse = (0, import_zod.object)({
|
|
74
|
+
access_token: (0, import_zod.string)(),
|
|
75
|
+
token_type: (0, import_zod.string)().optional(),
|
|
76
|
+
expires_in: (0, import_zod.number)().optional(),
|
|
77
|
+
refresh_token: (0, import_zod.string)().optional(),
|
|
78
|
+
scope: (0, import_zod.string)().optional().or((0, import_zod.null)())
|
|
79
79
|
});
|
|
80
|
-
var OAuthAccessTokenErrorResponse = (0,
|
|
81
|
-
error: (0,
|
|
80
|
+
var OAuthAccessTokenErrorResponse = (0, import_zod.object)({
|
|
81
|
+
error: (0, import_zod.enum)([
|
|
82
82
|
"invalid_request",
|
|
83
83
|
"invalid_client",
|
|
84
84
|
"invalid_grant",
|
|
@@ -86,16 +86,16 @@ var OAuthAccessTokenErrorResponse = (0, import_v4.object)({
|
|
|
86
86
|
"unsupported_grant_type",
|
|
87
87
|
"invalid_scope"
|
|
88
88
|
]),
|
|
89
|
-
error_description: (0,
|
|
90
|
-
error_uri: (0,
|
|
89
|
+
error_description: (0, import_zod.string)().optional(),
|
|
90
|
+
error_uri: (0, import_zod.string)().optional()
|
|
91
91
|
});
|
|
92
|
-
var OAuthErrorResponse = (0,
|
|
93
|
-
error: (0,
|
|
94
|
-
error_description: (0,
|
|
92
|
+
var OAuthErrorResponse = (0, import_zod.object)({
|
|
93
|
+
error: (0, import_zod.string)(),
|
|
94
|
+
error_description: (0, import_zod.string)().optional()
|
|
95
95
|
});
|
|
96
|
-
var OAuthEnvSchema = (0,
|
|
97
|
-
clientId:
|
|
98
|
-
clientSecret:
|
|
96
|
+
var OAuthEnvSchema = (0, import_zod.object)({
|
|
97
|
+
clientId: import_zod.z.string().min(1, "OAuth Client ID is required in the environment variables."),
|
|
98
|
+
clientSecret: import_zod.z.string().min(1, "OAuth Client Secret is required in the environment variables.")
|
|
99
99
|
});
|
|
100
100
|
// Annotate the CommonJS export names for ESM import in node:
|
|
101
101
|
0 && (module.exports = {
|