antarctic 0.3.0 → 0.5.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.
- package/dist/auth.d.ts +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -2
- package/dist/oauth2.d.ts +1 -1
- package/dist/oauth2.js +4 -4
- package/dist/providers/42.js +2 -1
- package/dist/providers/amazon-cognito.d.ts +1 -1
- package/dist/providers/amazon-cognito.js +5 -4
- package/dist/providers/anilist.js +2 -1
- package/dist/providers/apple.js +2 -1
- package/dist/providers/atlassian.js +2 -1
- package/dist/providers/auth0.d.ts +1 -1
- package/dist/providers/auth0.js +5 -4
- package/dist/providers/authentik.d.ts +1 -1
- package/dist/providers/authentik.js +5 -4
- package/dist/providers/autodesk.d.ts +1 -1
- package/dist/providers/autodesk.js +5 -4
- package/dist/providers/battlenet.js +2 -1
- package/dist/providers/bitbucket.js +2 -1
- package/dist/providers/box.js +2 -1
- package/dist/providers/bungie.js +2 -1
- package/dist/providers/coinbase.js +2 -1
- package/dist/providers/discord.d.ts +1 -1
- package/dist/providers/discord.js +5 -4
- package/dist/providers/donation-alerts.js +2 -1
- package/dist/providers/dribbble.js +2 -1
- package/dist/providers/dropbox.js +2 -1
- package/dist/providers/epicgames.js +2 -1
- package/dist/providers/etsy.d.ts +1 -1
- package/dist/providers/etsy.js +5 -4
- package/dist/providers/facebook.js +2 -1
- package/dist/providers/figma.js +2 -1
- package/dist/providers/gitea.d.ts +1 -1
- package/dist/providers/gitea.js +5 -4
- package/dist/providers/github.js +2 -1
- package/dist/providers/gitlab.js +2 -1
- package/dist/providers/google.d.ts +1 -1
- package/dist/providers/google.js +5 -4
- package/dist/providers/intuit.js +2 -1
- package/dist/providers/kakao.js +2 -1
- package/dist/providers/keycloak.d.ts +1 -1
- package/dist/providers/keycloak.js +5 -4
- package/dist/providers/kick.d.ts +1 -1
- package/dist/providers/kick.js +5 -4
- package/dist/providers/lichess.d.ts +1 -1
- package/dist/providers/lichess.js +5 -4
- package/dist/providers/line.d.ts +1 -1
- package/dist/providers/line.js +5 -4
- package/dist/providers/linear.js +2 -1
- package/dist/providers/linkedin.js +2 -1
- package/dist/providers/mastodon.d.ts +1 -1
- package/dist/providers/mastodon.js +5 -4
- package/dist/providers/mercadolibre.d.ts +1 -1
- package/dist/providers/mercadolibre.js +5 -4
- package/dist/providers/mercadopago.d.ts +1 -1
- package/dist/providers/mercadopago.js +5 -4
- package/dist/providers/microsoft-entra-id.d.ts +1 -1
- package/dist/providers/microsoft-entra-id.js +5 -4
- package/dist/providers/myanimelist.d.ts +1 -1
- package/dist/providers/myanimelist.js +5 -4
- package/dist/providers/naver.js +2 -1
- package/dist/providers/notion.js +2 -1
- package/dist/providers/okta.d.ts +1 -1
- package/dist/providers/okta.js +5 -4
- package/dist/providers/osu.js +2 -1
- package/dist/providers/patreon.js +2 -1
- package/dist/providers/polar.d.ts +1 -1
- package/dist/providers/polar.js +5 -4
- package/dist/providers/reddit.js +2 -1
- package/dist/providers/roblox.d.ts +1 -1
- package/dist/providers/roblox.js +5 -4
- package/dist/providers/salesforce.d.ts +1 -1
- package/dist/providers/salesforce.js +5 -4
- package/dist/providers/shikimori.js +2 -1
- package/dist/providers/slack.js +2 -1
- package/dist/providers/spotify.d.ts +1 -1
- package/dist/providers/spotify.js +5 -4
- package/dist/providers/startgg.js +2 -1
- package/dist/providers/strava.js +2 -1
- package/dist/providers/synology.d.ts +1 -1
- package/dist/providers/synology.js +2 -2
- package/dist/providers/tiktok.d.ts +1 -1
- package/dist/providers/tiktok.js +5 -4
- package/dist/providers/tiltify.js +2 -1
- package/dist/providers/tumblr.js +2 -1
- package/dist/providers/twitch.js +2 -1
- package/dist/providers/twitter.d.ts +1 -1
- package/dist/providers/twitter.js +5 -4
- package/dist/providers/vk.js +2 -1
- package/dist/providers/withings.js +2 -1
- package/dist/providers/workos.d.ts +1 -1
- package/dist/providers/workos.js +5 -4
- package/dist/providers/yahoo.js +2 -1
- package/dist/providers/yandex.js +2 -1
- package/dist/providers/zoom.d.ts +1 -1
- package/dist/providers/zoom.js +5 -4
- package/package.json +1 -4
- package/readme.md +1 -1
package/dist/providers/slack.js
CHANGED
|
@@ -7,7 +7,7 @@ export declare class Spotify {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: SpotifyOptions);
|
|
9
9
|
constructor(clientId: string, clientSecret: string | null, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
getAuthorizationURL(scopes?: string[]): Promise<URL>;
|
|
@@ -17,10 +17,10 @@ export class Spotify {
|
|
|
17
17
|
this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? "");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
20
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
21
21
|
let url;
|
|
22
22
|
if (codeVerifier !== null) {
|
|
23
|
-
url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
23
|
+
url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
24
24
|
}
|
|
25
25
|
else {
|
|
26
26
|
url = this.client.createAuthorizationURL(authorizationEndpoint, state, scopes);
|
|
@@ -39,7 +39,7 @@ export class Spotify {
|
|
|
39
39
|
const auth = requireAuthConfig(this.auth);
|
|
40
40
|
const state = generateOAuthState();
|
|
41
41
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
42
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
42
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
43
43
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
44
44
|
return url;
|
|
45
45
|
}
|
|
@@ -61,7 +61,8 @@ export class Spotify {
|
|
|
61
61
|
id: profileId(profile.id),
|
|
62
62
|
name: profileString(profile.display_name),
|
|
63
63
|
email: profileString(profile.email),
|
|
64
|
-
image
|
|
64
|
+
image,
|
|
65
|
+
raw: profile
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
68
|
}
|
package/dist/providers/strava.js
CHANGED
|
@@ -4,6 +4,6 @@ export declare class Synology {
|
|
|
4
4
|
private tokenEndpoint;
|
|
5
5
|
private client;
|
|
6
6
|
constructor(baseURL: string, applicationId: string, applicationSecret: string, redirectURI: string);
|
|
7
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
7
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
8
8
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
9
9
|
}
|
|
@@ -9,8 +9,8 @@ export class Synology {
|
|
|
9
9
|
this.tokenEndpoint = joinURIAndPath(baseURL, "/webman/sso/SSOAccessToken.cgi");
|
|
10
10
|
this.client = new OAuth2Client(applicationId, applicationSecret, redirectURI);
|
|
11
11
|
}
|
|
12
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
13
|
-
const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
12
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
13
|
+
const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
14
14
|
return url;
|
|
15
15
|
}
|
|
16
16
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -9,7 +9,7 @@ export declare class TikTok {
|
|
|
9
9
|
private auth;
|
|
10
10
|
constructor(options: TikTokOptions);
|
|
11
11
|
constructor(clientKey: string, clientSecret: string, redirectURI: string);
|
|
12
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
12
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
13
13
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
14
14
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
15
15
|
revokeToken(token: string): Promise<void>;
|
package/dist/providers/tiktok.js
CHANGED
|
@@ -28,12 +28,12 @@ export class TikTok {
|
|
|
28
28
|
this.redirectURI = redirectURI ?? "";
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
31
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
32
32
|
const url = new URL(authorizationEndpoint);
|
|
33
33
|
url.searchParams.set("response_type", "code");
|
|
34
34
|
url.searchParams.set("client_key", this.clientKey);
|
|
35
35
|
url.searchParams.set("state", state);
|
|
36
|
-
const codeChallenge = createS256CodeChallenge(codeVerifier);
|
|
36
|
+
const codeChallenge = await createS256CodeChallenge(codeVerifier);
|
|
37
37
|
url.searchParams.set("code_challenge_method", "S256");
|
|
38
38
|
url.searchParams.set("code_challenge", codeChallenge);
|
|
39
39
|
if (scopes.length > 0) {
|
|
@@ -76,7 +76,7 @@ export class TikTok {
|
|
|
76
76
|
const auth = requireAuthConfig(this.auth);
|
|
77
77
|
const state = generateOAuthState();
|
|
78
78
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
79
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
79
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
80
80
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
81
81
|
return url;
|
|
82
82
|
}
|
|
@@ -103,7 +103,8 @@ export class TikTok {
|
|
|
103
103
|
id: profileId(user.open_id),
|
|
104
104
|
name: profileString(user.display_name),
|
|
105
105
|
email: null,
|
|
106
|
-
image: profileString(user.avatar_url)
|
|
106
|
+
image: profileString(user.avatar_url),
|
|
107
|
+
raw: user
|
|
107
108
|
};
|
|
108
109
|
}
|
|
109
110
|
}
|
package/dist/providers/tumblr.js
CHANGED
package/dist/providers/twitch.js
CHANGED
|
@@ -85,7 +85,8 @@ export class Twitch {
|
|
|
85
85
|
id: profileId(user.id),
|
|
86
86
|
name: profileString(user.display_name) ?? profileString(user.login),
|
|
87
87
|
email: profileString(user.email),
|
|
88
|
-
image: profileString(user.profile_image_url)
|
|
88
|
+
image: profileString(user.profile_image_url),
|
|
89
|
+
raw: user
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
92
|
}
|
|
@@ -7,7 +7,7 @@ export declare class Twitter {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: TwitterOptions);
|
|
9
9
|
constructor(clientId: string, clientSecret: string | null, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
revokeToken(token: string): Promise<void>;
|
|
@@ -18,8 +18,8 @@ export class Twitter {
|
|
|
18
18
|
this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
|
-
const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
21
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
22
|
+
const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
23
23
|
return url;
|
|
24
24
|
}
|
|
25
25
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -37,7 +37,7 @@ export class Twitter {
|
|
|
37
37
|
const auth = requireAuthConfig(this.auth);
|
|
38
38
|
const state = generateOAuthState();
|
|
39
39
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
40
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
40
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
41
41
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
42
42
|
return url;
|
|
43
43
|
}
|
|
@@ -61,7 +61,8 @@ export class Twitter {
|
|
|
61
61
|
id: profileId(user.id),
|
|
62
62
|
name: profileString(user.name) ?? profileString(user.username),
|
|
63
63
|
email: null,
|
|
64
|
-
image: profileString(user.profile_image_url)
|
|
64
|
+
image: profileString(user.profile_image_url),
|
|
65
|
+
raw: user
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
68
|
}
|
package/dist/providers/vk.js
CHANGED
|
@@ -9,7 +9,7 @@ export declare class WorkOS {
|
|
|
9
9
|
private auth;
|
|
10
10
|
constructor(options: WorkOSOptions);
|
|
11
11
|
constructor(clientId: string, clientSecret: string | null, redirectURI: string);
|
|
12
|
-
createAuthorizationURL(state: string, codeVerifier: string | null): URL
|
|
12
|
+
createAuthorizationURL(state: string, codeVerifier: string | null): Promise<URL>;
|
|
13
13
|
validateAuthorizationCode(code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
|
|
14
14
|
getAuthorizationURL(): Promise<URL>;
|
|
15
15
|
getUser(query: OAuthCallbackQuery): Promise<OAuthUser>;
|
package/dist/providers/workos.js
CHANGED
|
@@ -23,14 +23,14 @@ export class WorkOS {
|
|
|
23
23
|
this.redirectURI = redirectURI ?? "";
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
createAuthorizationURL(state, codeVerifier) {
|
|
26
|
+
async createAuthorizationURL(state, codeVerifier) {
|
|
27
27
|
const url = new URL(authorizationEndpoint);
|
|
28
28
|
url.searchParams.set("response_type", "code");
|
|
29
29
|
url.searchParams.set("client_id", this.clientId);
|
|
30
30
|
url.searchParams.set("state", state);
|
|
31
31
|
url.searchParams.set("redirect_uri", this.redirectURI);
|
|
32
32
|
if (codeVerifier !== null) {
|
|
33
|
-
const codeChallenge = createS256CodeChallenge(codeVerifier);
|
|
33
|
+
const codeChallenge = await createS256CodeChallenge(codeVerifier);
|
|
34
34
|
url.searchParams.set("code_challenge_method", "S256");
|
|
35
35
|
url.searchParams.set("code_challenge", codeChallenge);
|
|
36
36
|
}
|
|
@@ -56,7 +56,7 @@ export class WorkOS {
|
|
|
56
56
|
const auth = requireAuthConfig(this.auth);
|
|
57
57
|
const state = generateOAuthState();
|
|
58
58
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
59
|
-
const url = this.createAuthorizationURL(state, codeVerifier);
|
|
59
|
+
const url = await this.createAuthorizationURL(state, codeVerifier);
|
|
60
60
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
61
61
|
return url;
|
|
62
62
|
}
|
|
@@ -76,7 +76,8 @@ export class WorkOS {
|
|
|
76
76
|
id: profileId(profile.id),
|
|
77
77
|
name: profileString(profile.name) ?? (fullName !== "" ? fullName : null),
|
|
78
78
|
email: profileString(profile.email),
|
|
79
|
-
image: profileString(profile.profile_picture_url)
|
|
79
|
+
image: profileString(profile.profile_picture_url),
|
|
80
|
+
raw: profile
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
}
|
package/dist/providers/yahoo.js
CHANGED
|
@@ -59,7 +59,8 @@ export class Yahoo {
|
|
|
59
59
|
id: profileId(claims.sub),
|
|
60
60
|
name: profileString(claims.name) ?? (fullName !== "" ? fullName : null),
|
|
61
61
|
email: profileString(claims.email),
|
|
62
|
-
image: profileString(claims.picture)
|
|
62
|
+
image: profileString(claims.picture),
|
|
63
|
+
raw: claims
|
|
63
64
|
};
|
|
64
65
|
}
|
|
65
66
|
}
|
package/dist/providers/yandex.js
CHANGED
package/dist/providers/zoom.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class Zoom {
|
|
|
7
7
|
private auth;
|
|
8
8
|
constructor(options: ZoomOptions);
|
|
9
9
|
constructor(clientId: string, clientSecret: string, redirectURI: string);
|
|
10
|
-
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL
|
|
10
|
+
createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
|
|
11
11
|
validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
|
|
12
12
|
refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
|
|
13
13
|
revokeToken(token: string): Promise<void>;
|
package/dist/providers/zoom.js
CHANGED
|
@@ -21,8 +21,8 @@ export class Zoom {
|
|
|
21
21
|
this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? "", redirectURI ?? "");
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
createAuthorizationURL(state, codeVerifier, scopes) {
|
|
25
|
-
const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
24
|
+
async createAuthorizationURL(state, codeVerifier, scopes) {
|
|
25
|
+
const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
|
|
26
26
|
return url;
|
|
27
27
|
}
|
|
28
28
|
async validateAuthorizationCode(code, codeVerifier) {
|
|
@@ -40,7 +40,7 @@ export class Zoom {
|
|
|
40
40
|
const auth = requireAuthConfig(this.auth);
|
|
41
41
|
const state = generateOAuthState();
|
|
42
42
|
const codeVerifier = generateOAuthCodeVerifier();
|
|
43
|
-
const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
43
|
+
const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
|
|
44
44
|
await saveOAuthState(auth.store, state, { codeVerifier });
|
|
45
45
|
return url;
|
|
46
46
|
}
|
|
@@ -60,7 +60,8 @@ export class Zoom {
|
|
|
60
60
|
id: profileId(profile.id),
|
|
61
61
|
name: profileString(profile.display_name) ?? (fullName !== "" ? fullName : null),
|
|
62
62
|
email: profileString(profile.email),
|
|
63
|
-
image: profileString(profile.pic_url)
|
|
63
|
+
image: profileString(profile.pic_url),
|
|
64
|
+
raw: profile
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antarctic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "High-level OAuth 2.0 clients for popular providers, forked from Arctic",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,8 +33,5 @@
|
|
|
33
33
|
"prettier": "^3.0.3",
|
|
34
34
|
"typescript": "^5.2.2",
|
|
35
35
|
"vitest": "1.6.0"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@oslojs/crypto": "1.0.1"
|
|
39
36
|
}
|
|
40
37
|
}
|
package/readme.md
CHANGED
|
@@ -57,7 +57,7 @@ Sessions, cookies, and your user database remain your responsibility: take the r
|
|
|
57
57
|
|
|
58
58
|
## Low-level API
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Arctic's low level API remains available on the same objects, including the positional constructors. It is unchanged except that PKCE providers build the URL asynchronously, so `createAuthorizationURL()` returns a promise for them:
|
|
61
61
|
|
|
62
62
|
```ts
|
|
63
63
|
import * as arctic from "antarctic";
|