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.
Files changed (98) hide show
  1. package/dist/auth.d.ts +1 -0
  2. package/dist/client.d.ts +1 -1
  3. package/dist/client.js +2 -2
  4. package/dist/oauth2.d.ts +1 -1
  5. package/dist/oauth2.js +4 -4
  6. package/dist/providers/42.js +2 -1
  7. package/dist/providers/amazon-cognito.d.ts +1 -1
  8. package/dist/providers/amazon-cognito.js +5 -4
  9. package/dist/providers/anilist.js +2 -1
  10. package/dist/providers/apple.js +2 -1
  11. package/dist/providers/atlassian.js +2 -1
  12. package/dist/providers/auth0.d.ts +1 -1
  13. package/dist/providers/auth0.js +5 -4
  14. package/dist/providers/authentik.d.ts +1 -1
  15. package/dist/providers/authentik.js +5 -4
  16. package/dist/providers/autodesk.d.ts +1 -1
  17. package/dist/providers/autodesk.js +5 -4
  18. package/dist/providers/battlenet.js +2 -1
  19. package/dist/providers/bitbucket.js +2 -1
  20. package/dist/providers/box.js +2 -1
  21. package/dist/providers/bungie.js +2 -1
  22. package/dist/providers/coinbase.js +2 -1
  23. package/dist/providers/discord.d.ts +1 -1
  24. package/dist/providers/discord.js +5 -4
  25. package/dist/providers/donation-alerts.js +2 -1
  26. package/dist/providers/dribbble.js +2 -1
  27. package/dist/providers/dropbox.js +2 -1
  28. package/dist/providers/epicgames.js +2 -1
  29. package/dist/providers/etsy.d.ts +1 -1
  30. package/dist/providers/etsy.js +5 -4
  31. package/dist/providers/facebook.js +2 -1
  32. package/dist/providers/figma.js +2 -1
  33. package/dist/providers/gitea.d.ts +1 -1
  34. package/dist/providers/gitea.js +5 -4
  35. package/dist/providers/github.js +2 -1
  36. package/dist/providers/gitlab.js +2 -1
  37. package/dist/providers/google.d.ts +1 -1
  38. package/dist/providers/google.js +5 -4
  39. package/dist/providers/intuit.js +2 -1
  40. package/dist/providers/kakao.js +2 -1
  41. package/dist/providers/keycloak.d.ts +1 -1
  42. package/dist/providers/keycloak.js +5 -4
  43. package/dist/providers/kick.d.ts +1 -1
  44. package/dist/providers/kick.js +5 -4
  45. package/dist/providers/lichess.d.ts +1 -1
  46. package/dist/providers/lichess.js +5 -4
  47. package/dist/providers/line.d.ts +1 -1
  48. package/dist/providers/line.js +5 -4
  49. package/dist/providers/linear.js +2 -1
  50. package/dist/providers/linkedin.js +2 -1
  51. package/dist/providers/mastodon.d.ts +1 -1
  52. package/dist/providers/mastodon.js +5 -4
  53. package/dist/providers/mercadolibre.d.ts +1 -1
  54. package/dist/providers/mercadolibre.js +5 -4
  55. package/dist/providers/mercadopago.d.ts +1 -1
  56. package/dist/providers/mercadopago.js +5 -4
  57. package/dist/providers/microsoft-entra-id.d.ts +1 -1
  58. package/dist/providers/microsoft-entra-id.js +5 -4
  59. package/dist/providers/myanimelist.d.ts +1 -1
  60. package/dist/providers/myanimelist.js +5 -4
  61. package/dist/providers/naver.js +2 -1
  62. package/dist/providers/notion.js +2 -1
  63. package/dist/providers/okta.d.ts +1 -1
  64. package/dist/providers/okta.js +5 -4
  65. package/dist/providers/osu.js +2 -1
  66. package/dist/providers/patreon.js +2 -1
  67. package/dist/providers/polar.d.ts +1 -1
  68. package/dist/providers/polar.js +5 -4
  69. package/dist/providers/reddit.js +2 -1
  70. package/dist/providers/roblox.d.ts +1 -1
  71. package/dist/providers/roblox.js +5 -4
  72. package/dist/providers/salesforce.d.ts +1 -1
  73. package/dist/providers/salesforce.js +5 -4
  74. package/dist/providers/shikimori.js +2 -1
  75. package/dist/providers/slack.js +2 -1
  76. package/dist/providers/spotify.d.ts +1 -1
  77. package/dist/providers/spotify.js +5 -4
  78. package/dist/providers/startgg.js +2 -1
  79. package/dist/providers/strava.js +2 -1
  80. package/dist/providers/synology.d.ts +1 -1
  81. package/dist/providers/synology.js +2 -2
  82. package/dist/providers/tiktok.d.ts +1 -1
  83. package/dist/providers/tiktok.js +5 -4
  84. package/dist/providers/tiltify.js +2 -1
  85. package/dist/providers/tumblr.js +2 -1
  86. package/dist/providers/twitch.js +2 -1
  87. package/dist/providers/twitter.d.ts +1 -1
  88. package/dist/providers/twitter.js +5 -4
  89. package/dist/providers/vk.js +2 -1
  90. package/dist/providers/withings.js +2 -1
  91. package/dist/providers/workos.d.ts +1 -1
  92. package/dist/providers/workos.js +5 -4
  93. package/dist/providers/yahoo.js +2 -1
  94. package/dist/providers/yandex.js +2 -1
  95. package/dist/providers/zoom.d.ts +1 -1
  96. package/dist/providers/zoom.js +5 -4
  97. package/package.json +1 -4
  98. package/readme.md +1 -1
package/dist/auth.d.ts CHANGED
@@ -3,6 +3,7 @@ export interface OAuthUser {
3
3
  name?: string | null;
4
4
  email?: string | null;
5
5
  image?: string | null;
6
+ raw?: Record<string, unknown>;
6
7
  }
7
8
  export interface OAuthStateStore {
8
9
  get: (key: string) => Promise<any>;
package/dist/client.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare class OAuth2Client {
5
5
  private redirectURI;
6
6
  constructor(clientId: string, clientPassword: string | null, redirectURI: string | null);
7
7
  createAuthorizationURL(authorizationEndpoint: string, state: string, scopes: string[]): URL;
8
- createAuthorizationURLWithPKCE(authorizationEndpoint: string, state: string, codeChallengeMethod: CodeChallengeMethod, codeVerifier: string, scopes: string[]): URL;
8
+ createAuthorizationURLWithPKCE(authorizationEndpoint: string, state: string, codeChallengeMethod: CodeChallengeMethod, codeVerifier: string, scopes: string[]): Promise<URL>;
9
9
  validateAuthorizationCode(tokenEndpoint: string, code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
10
10
  refreshAccessToken(tokenEndpoint: string, refreshToken: string, scopes: string[]): Promise<OAuth2Tokens>;
11
11
  revokeToken(tokenRevocationEndpoint: string, token: string): Promise<void>;
package/dist/client.js CHANGED
@@ -23,7 +23,7 @@ export class OAuth2Client {
23
23
  }
24
24
  return url;
25
25
  }
26
- createAuthorizationURLWithPKCE(authorizationEndpoint, state, codeChallengeMethod, codeVerifier, scopes) {
26
+ async createAuthorizationURLWithPKCE(authorizationEndpoint, state, codeChallengeMethod, codeVerifier, scopes) {
27
27
  const url = new URL(authorizationEndpoint);
28
28
  url.searchParams.set("response_type", "code");
29
29
  url.searchParams.set("client_id", this.clientId);
@@ -32,7 +32,7 @@ export class OAuth2Client {
32
32
  }
33
33
  url.searchParams.set("state", state);
34
34
  if (codeChallengeMethod === CodeChallengeMethod.S256) {
35
- const codeChallenge = createS256CodeChallenge(codeVerifier);
35
+ const codeChallenge = await createS256CodeChallenge(codeVerifier);
36
36
  url.searchParams.set("code_challenge_method", "S256");
37
37
  url.searchParams.set("code_challenge", codeChallenge);
38
38
  }
package/dist/oauth2.d.ts CHANGED
@@ -11,6 +11,6 @@ export declare class OAuth2Tokens {
11
11
  scopes(): string[];
12
12
  idToken(): string;
13
13
  }
14
- export declare function createS256CodeChallenge(codeVerifier: string): string;
14
+ export declare function createS256CodeChallenge(codeVerifier: string): Promise<string>;
15
15
  export declare function generateCodeVerifier(): string;
16
16
  export declare function generateState(): string;
package/dist/oauth2.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { encodeBase64urlNoPadding } from "./encoding.js";
2
- import * as sha2 from "@oslojs/crypto/sha2";
3
2
  export class OAuth2Tokens {
4
3
  data;
5
4
  constructor(data) {
@@ -51,9 +50,10 @@ export class OAuth2Tokens {
51
50
  throw new Error("Missing or invalid field 'id_token'");
52
51
  }
53
52
  }
54
- export function createS256CodeChallenge(codeVerifier) {
55
- const codeChallengeBytes = sha2.sha256(new TextEncoder().encode(codeVerifier));
56
- return encodeBase64urlNoPadding(codeChallengeBytes);
53
+ export async function createS256CodeChallenge(codeVerifier) {
54
+ const data = new TextEncoder().encode(codeVerifier);
55
+ const digest = await crypto.subtle.digest("SHA-256", data);
56
+ return encodeBase64urlNoPadding(new Uint8Array(digest));
57
57
  }
58
58
  export function generateCodeVerifier() {
59
59
  const randomValues = new Uint8Array(32);
@@ -69,7 +69,8 @@ export class FortyTwo {
69
69
  id: profileId(profile.id),
70
70
  name: profileString(profile.displayname) ?? profileString(profile.login),
71
71
  email: profileString(profile.email),
72
- image
72
+ image,
73
+ raw: profile
73
74
  };
74
75
  }
75
76
  }
@@ -12,7 +12,7 @@ export declare class AmazonCognito {
12
12
  private auth;
13
13
  constructor(options: AmazonCognitoOptions);
14
14
  constructor(domain: string, clientId: string, clientSecret: string | null, redirectURI: string);
15
- createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL;
15
+ createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
16
16
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
17
17
  refreshAccessToken(refreshToken: string, scopes: string[]): Promise<OAuth2Tokens>;
18
18
  revokeToken(token: string): Promise<void>;
@@ -26,8 +26,8 @@ export class AmazonCognito {
26
26
  this.tokenRevocationEndpoint = `https://${domain}/oauth2/revoke`;
27
27
  this.userinfoEndpoint = `https://${domain}/oauth2/userInfo`;
28
28
  }
29
- createAuthorizationURL(state, codeVerifier, scopes) {
30
- const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
29
+ async createAuthorizationURL(state, codeVerifier, scopes) {
30
+ const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
31
31
  return url;
32
32
  }
33
33
  async validateAuthorizationCode(code, codeVerifier) {
@@ -45,7 +45,7 @@ export class AmazonCognito {
45
45
  const auth = requireAuthConfig(this.auth);
46
46
  const state = generateOAuthState();
47
47
  const codeVerifier = generateOAuthCodeVerifier();
48
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
48
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
49
49
  await saveOAuthState(auth.store, state, { codeVerifier });
50
50
  return url;
51
51
  }
@@ -70,7 +70,8 @@ export class AmazonCognito {
70
70
  profileString(claims["cognito:username"]) ??
71
71
  profileString(claims.username),
72
72
  email: profileString(claims.email),
73
- image: profileString(claims.picture)
73
+ image: profileString(claims.picture),
74
+ raw: claims
74
75
  };
75
76
  }
76
77
  }
@@ -48,7 +48,8 @@ export class AniList {
48
48
  id: profileId(viewer.id),
49
49
  name: profileString(viewer.name),
50
50
  email: null,
51
- image
51
+ image,
52
+ raw: viewer
52
53
  };
53
54
  }
54
55
  }
@@ -75,7 +75,8 @@ export class Apple {
75
75
  id: profileId(claims.sub),
76
76
  name: null,
77
77
  email: profileString(claims.email),
78
- image: null
78
+ image: null,
79
+ raw: claims
79
80
  };
80
81
  }
81
82
  async createClientSecret() {
@@ -77,7 +77,8 @@ export class Atlassian {
77
77
  id: profileId(profile.account_id),
78
78
  name: profileString(profile.name) ?? profileString(profile.nickname),
79
79
  email: profileString(profile.email),
80
- image: profileString(profile.picture)
80
+ image: profileString(profile.picture),
81
+ raw: profile
81
82
  };
82
83
  }
83
84
  }
@@ -12,7 +12,7 @@ export declare class Auth0 {
12
12
  private auth;
13
13
  constructor(options: Auth0Options);
14
14
  constructor(domain: string, clientId: string, clientSecret: string | null, redirectURI: string);
15
- createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): URL;
15
+ createAuthorizationURL(state: string, codeVerifier: string | null, scopes: string[]): Promise<URL>;
16
16
  validateAuthorizationCode(code: string, codeVerifier: string | null): Promise<OAuth2Tokens>;
17
17
  refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
18
18
  revokeToken(token: string): Promise<void>;
@@ -26,10 +26,10 @@ export class Auth0 {
26
26
  this.tokenRevocationEndpoint = `https://${domain}/oauth/revoke`;
27
27
  this.userinfoEndpoint = `https://${domain}/userinfo`;
28
28
  }
29
- createAuthorizationURL(state, codeVerifier, scopes) {
29
+ async createAuthorizationURL(state, codeVerifier, scopes) {
30
30
  let url;
31
31
  if (codeVerifier !== null) {
32
- url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
32
+ url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
33
33
  }
34
34
  else {
35
35
  url = this.client.createAuthorizationURL(this.authorizationEndpoint, state, scopes);
@@ -51,7 +51,7 @@ export class Auth0 {
51
51
  const auth = requireAuthConfig(this.auth);
52
52
  const state = generateOAuthState();
53
53
  const codeVerifier = generateOAuthCodeVerifier();
54
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
54
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
55
55
  await saveOAuthState(auth.store, state, { codeVerifier });
56
56
  return url;
57
57
  }
@@ -74,7 +74,8 @@ export class Auth0 {
74
74
  id: profileId(claims.sub),
75
75
  name: profileString(claims.name) ?? profileString(claims.nickname),
76
76
  email: profileString(claims.email),
77
- image: profileString(claims.picture)
77
+ image: profileString(claims.picture),
78
+ raw: claims
78
79
  };
79
80
  }
80
81
  }
@@ -12,7 +12,7 @@ export declare class Authentik {
12
12
  private auth;
13
13
  constructor(options: AuthentikOptions);
14
14
  constructor(baseURL: string, clientId: string, clientSecret: string | null, redirectURI: string);
15
- createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL;
15
+ createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
16
16
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
17
17
  refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
18
18
  revokeToken(token: string): Promise<void>;
@@ -27,8 +27,8 @@ export class Authentik {
27
27
  this.tokenRevocationEndpoint = joinURIAndPath(baseURL, "/application/o/revoke/");
28
28
  this.userinfoEndpoint = joinURIAndPath(baseURL, "/application/o/userinfo/");
29
29
  }
30
- createAuthorizationURL(state, codeVerifier, scopes) {
31
- const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
30
+ async createAuthorizationURL(state, codeVerifier, scopes) {
31
+ const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
32
32
  return url;
33
33
  }
34
34
  async validateAuthorizationCode(code, codeVerifier) {
@@ -46,7 +46,7 @@ export class Authentik {
46
46
  const auth = requireAuthConfig(this.auth);
47
47
  const state = generateOAuthState();
48
48
  const codeVerifier = generateOAuthCodeVerifier();
49
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
49
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
50
50
  await saveOAuthState(auth.store, state, { codeVerifier });
51
51
  return url;
52
52
  }
@@ -69,7 +69,8 @@ export class Authentik {
69
69
  id: profileId(claims.sub),
70
70
  name: profileString(claims.name) ?? profileString(claims.preferred_username),
71
71
  email: profileString(claims.email),
72
- image: profileString(claims.picture)
72
+ image: profileString(claims.picture),
73
+ raw: claims
73
74
  };
74
75
  }
75
76
  }
@@ -7,7 +7,7 @@ export declare class Autodesk {
7
7
  private auth;
8
8
  constructor(options: AutodeskOptions);
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 Autodesk {
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 Autodesk {
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
  }
@@ -54,7 +54,8 @@ export class Autodesk {
54
54
  id: profileId(claims.sub),
55
55
  name: profileString(claims.name) ?? profileString(claims.preferred_username),
56
56
  email: profileString(claims.email),
57
- image: profileString(claims.picture)
57
+ image: profileString(claims.picture),
58
+ raw: claims
58
59
  };
59
60
  }
60
61
  }
@@ -63,7 +63,8 @@ export class BattleNet {
63
63
  id: profileId(profile.sub),
64
64
  name: profileString(profile.battletag),
65
65
  email: null,
66
- image: null
66
+ image: null,
67
+ raw: profile
67
68
  };
68
69
  }
69
70
  }
@@ -57,7 +57,8 @@ export class Bitbucket {
57
57
  id: profileId(profile.uuid ?? profile.account_id),
58
58
  name: profileString(profile.display_name) ?? profileString(profile.username),
59
59
  email: await fetchPrimaryEmail(accessToken),
60
- image
60
+ image,
61
+ raw: profile
61
62
  };
62
63
  }
63
64
  }
@@ -84,7 +84,8 @@ export class Box {
84
84
  id: profileId(profile.id),
85
85
  name: profileString(profile.name),
86
86
  email: profileString(profile.login),
87
- image: profileString(profile.avatar_url)
87
+ image: profileString(profile.avatar_url),
88
+ raw: profile
88
89
  };
89
90
  }
90
91
  }
@@ -66,7 +66,8 @@ export class Bungie {
66
66
  id: profileId(user.membershipId),
67
67
  name: profileString(user.cachedBungieGlobalDisplayName) ?? profileString(user.displayName),
68
68
  email: null,
69
- image
69
+ image,
70
+ raw: user
70
71
  };
71
72
  }
72
73
  }
@@ -89,7 +89,8 @@ export class Coinbase {
89
89
  id: profileId(user.id),
90
90
  name: profileString(user.name) ?? profileString(user.username),
91
91
  email: profileString(user.email),
92
- image: profileString(user.avatar_url)
92
+ image: profileString(user.avatar_url),
93
+ raw: user
93
94
  };
94
95
  }
95
96
  }
@@ -7,7 +7,7 @@ export declare class Discord {
7
7
  private auth;
8
8
  constructor(options: DiscordOptions);
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
  revokeToken(token: string): Promise<void>;
@@ -18,10 +18,10 @@ export class Discord {
18
18
  this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
19
19
  }
20
20
  }
21
- createAuthorizationURL(state, codeVerifier, scopes) {
21
+ async createAuthorizationURL(state, codeVerifier, scopes) {
22
22
  let url;
23
23
  if (codeVerifier !== null) {
24
- url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
24
+ url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
25
25
  }
26
26
  else {
27
27
  url = this.client.createAuthorizationURL(authorizationEndpoint, state, scopes);
@@ -43,7 +43,7 @@ export class Discord {
43
43
  const auth = requireAuthConfig(this.auth);
44
44
  const state = generateOAuthState();
45
45
  const codeVerifier = generateOAuthCodeVerifier();
46
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
46
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
47
47
  await saveOAuthState(auth.store, state, { codeVerifier });
48
48
  return url;
49
49
  }
@@ -62,7 +62,8 @@ export class Discord {
62
62
  id,
63
63
  name: profileString(profile.global_name) ?? profileString(profile.username),
64
64
  email: profileString(profile.email),
65
- image: avatar === null ? null : `https://cdn.discordapp.com/avatars/${id}/${avatar}.png`
65
+ image: avatar === null ? null : `https://cdn.discordapp.com/avatars/${id}/${avatar}.png`,
66
+ raw: profile
66
67
  };
67
68
  }
68
69
  }
@@ -80,7 +80,8 @@ export class DonationAlerts {
80
80
  id: profileId(user.id),
81
81
  name: profileString(user.name) ?? profileString(user.code),
82
82
  email: profileString(user.email),
83
- image: profileString(user.avatar)
83
+ image: profileString(user.avatar),
84
+ raw: user
84
85
  };
85
86
  }
86
87
  }
@@ -67,7 +67,8 @@ export class Dribbble {
67
67
  name: profileString(profile.name) ?? profileString(profile.login),
68
68
  // The v2 user endpoint does not expose an email address.
69
69
  email: null,
70
- image: profileString(profile.avatar_url)
70
+ image: profileString(profile.avatar_url),
71
+ raw: profile
71
72
  };
72
73
  }
73
74
  }
@@ -57,7 +57,8 @@ export class Dropbox {
57
57
  id: profileId(profile.account_id),
58
58
  name,
59
59
  email: profileString(profile.email),
60
- image: profileString(profile.profile_photo_url)
60
+ image: profileString(profile.profile_photo_url),
61
+ raw: profile
61
62
  };
62
63
  }
63
64
  }
@@ -54,7 +54,8 @@ export class EpicGames {
54
54
  name: profileString(claims.preferred_username),
55
55
  // Epic Games does not expose user emails or avatars.
56
56
  email: null,
57
- image: null
57
+ image: null,
58
+ raw: claims
58
59
  };
59
60
  }
60
61
  }
@@ -7,7 +7,7 @@ export declare class Etsy {
7
7
  private auth;
8
8
  constructor(options: EtsyOptions);
9
9
  constructor(clientId: 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
  getAuthorizationURL(scopes?: string[]): Promise<URL>;
@@ -18,8 +18,8 @@ export class Etsy {
18
18
  this.client = new OAuth2Client(clientIdOrOptions, 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) {
@@ -34,7 +34,7 @@ export class Etsy {
34
34
  const auth = requireAuthConfig(this.auth);
35
35
  const state = generateOAuthState();
36
36
  const codeVerifier = generateOAuthCodeVerifier();
37
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
37
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
38
38
  await saveOAuthState(auth.store, state, { codeVerifier });
39
39
  return url;
40
40
  }
@@ -62,7 +62,8 @@ export class Etsy {
62
62
  id: userId,
63
63
  name,
64
64
  email: profileString(profile.primary_email),
65
- image: profileString(profile.image_url_75x75)
65
+ image: profileString(profile.image_url_75x75),
66
+ raw: profile
66
67
  };
67
68
  }
68
69
  }
@@ -74,7 +74,8 @@ export class Facebook {
74
74
  id: profileId(profile.id),
75
75
  name: profileString(profile.name),
76
76
  email: profileString(profile.email),
77
- image
77
+ image,
78
+ raw: profile
78
79
  };
79
80
  }
80
81
  }
@@ -50,7 +50,8 @@ export class Figma {
50
50
  id: profileId(profile.id),
51
51
  name: profileString(profile.handle),
52
52
  email: profileString(profile.email),
53
- image: profileString(profile.img_url)
53
+ image: profileString(profile.img_url),
54
+ raw: profile
54
55
  };
55
56
  }
56
57
  }
@@ -11,7 +11,7 @@ export declare class Gitea {
11
11
  private auth;
12
12
  constructor(options: GiteaOptions);
13
13
  constructor(baseURL: string, clientId: string, clientSecret: string | null, redirectURI: string);
14
- createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL;
14
+ createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
15
15
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
16
16
  refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
17
17
  getAuthorizationURL(scopes?: string[]): Promise<URL>;
@@ -22,8 +22,8 @@ export class Gitea {
22
22
  this.authorizationEndpoint = joinURIAndPath(this.baseURL, "/login/oauth/authorize");
23
23
  this.tokenEndpoint = joinURIAndPath(this.baseURL, "/login/oauth/access_token");
24
24
  }
25
- createAuthorizationURL(state, codeVerifier, scopes) {
26
- const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
25
+ async createAuthorizationURL(state, codeVerifier, scopes) {
26
+ const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
27
27
  return url;
28
28
  }
29
29
  async validateAuthorizationCode(code, codeVerifier) {
@@ -38,7 +38,7 @@ export class Gitea {
38
38
  const auth = requireAuthConfig(this.auth);
39
39
  const state = generateOAuthState();
40
40
  const codeVerifier = generateOAuthCodeVerifier();
41
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
41
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
42
42
  await saveOAuthState(auth.store, state, { codeVerifier });
43
43
  return url;
44
44
  }
@@ -56,7 +56,8 @@ export class Gitea {
56
56
  id: profileId(profile.id),
57
57
  name: profileString(profile.full_name) ?? profileString(profile.login),
58
58
  email: profileString(profile.email),
59
- image: profileString(profile.avatar_url)
59
+ image: profileString(profile.avatar_url),
60
+ raw: profile
60
61
  };
61
62
  }
62
63
  }
@@ -83,7 +83,8 @@ export class GitHub {
83
83
  id: profileId(profile.id),
84
84
  name: profileString(profile.name) ?? profileString(profile.login),
85
85
  email,
86
- image: profileString(profile.avatar_url)
86
+ image: profileString(profile.avatar_url),
87
+ raw: profile
87
88
  };
88
89
  }
89
90
  }
@@ -58,7 +58,8 @@ export class GitLab {
58
58
  id: profileId(claims.sub),
59
59
  name: profileString(claims.name) ?? profileString(claims.nickname),
60
60
  email: profileString(claims.email),
61
- image: profileString(claims.picture)
61
+ image: profileString(claims.picture),
62
+ raw: claims
62
63
  };
63
64
  }
64
65
  }
@@ -7,7 +7,7 @@ export declare class Google {
7
7
  private auth;
8
8
  constructor(options: GoogleOptions);
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>;
@@ -22,8 +22,8 @@ export class Google {
22
22
  this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
23
23
  }
24
24
  }
25
- createAuthorizationURL(state, codeVerifier, scopes) {
26
- const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
25
+ async createAuthorizationURL(state, codeVerifier, scopes) {
26
+ const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
27
27
  return url;
28
28
  }
29
29
  async validateAuthorizationCode(code, codeVerifier) {
@@ -41,7 +41,7 @@ export class Google {
41
41
  const auth = requireAuthConfig(this.auth);
42
42
  const state = generateOAuthState();
43
43
  const codeVerifier = generateOAuthCodeVerifier();
44
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
44
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
45
45
  await saveOAuthState(auth.store, state, { codeVerifier });
46
46
  return url;
47
47
  }
@@ -64,7 +64,8 @@ export class Google {
64
64
  id: profileId(claims.sub),
65
65
  name: profileString(claims.name),
66
66
  email: profileString(claims.email),
67
- image: profileString(claims.picture)
67
+ image: profileString(claims.picture),
68
+ raw: claims
68
69
  };
69
70
  }
70
71
  }
@@ -60,7 +60,8 @@ export class Intuit {
60
60
  id: profileId(claims.sub),
61
61
  name,
62
62
  email: profileString(claims.email),
63
- image: null
63
+ image: null,
64
+ raw: claims
64
65
  };
65
66
  }
66
67
  }
@@ -89,7 +89,8 @@ export class Kakao {
89
89
  id: profileId(profile.id),
90
90
  name,
91
91
  email,
92
- image
92
+ image,
93
+ raw: profile
93
94
  };
94
95
  }
95
96
  }
@@ -12,7 +12,7 @@ export declare class KeyCloak {
12
12
  private auth;
13
13
  constructor(options: KeyCloakOptions);
14
14
  constructor(realmURL: string, clientId: string, clientSecret: string | null, redirectURI: string);
15
- createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL;
15
+ createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
16
16
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
17
17
  refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
18
18
  revokeToken(token: string): Promise<void>;