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
@@ -26,8 +26,8 @@ export class KeyCloak {
26
26
  this.tokenRevocationEndpoint = realmURL + "/protocol/openid-connect/revoke";
27
27
  this.userinfoEndpoint = realmURL + "/protocol/openid-connect/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 KeyCloak {
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
  }
@@ -68,7 +68,8 @@ export class KeyCloak {
68
68
  id: profileId(claims.sub),
69
69
  name: profileString(claims.name) ?? profileString(claims.preferred_username),
70
70
  email: profileString(claims.email),
71
- image: profileString(claims.picture)
71
+ image: profileString(claims.picture),
72
+ raw: claims
72
73
  };
73
74
  }
74
75
  }
@@ -9,7 +9,7 @@ export declare class Kick {
9
9
  private auth;
10
10
  constructor(options: KickOptions);
11
11
  constructor(clientId: 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>;
@@ -28,7 +28,7 @@ export class Kick {
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("client_id", this.clientId);
34
34
  url.searchParams.set("response_type", "code");
@@ -37,7 +37,7 @@ export class Kick {
37
37
  if (scopes.length > 0) {
38
38
  url.searchParams.set("scope", scopes.join(" "));
39
39
  }
40
- const codeChallenge = createS256CodeChallenge(codeVerifier);
40
+ const codeChallenge = await createS256CodeChallenge(codeVerifier);
41
41
  url.searchParams.set("code_challenge", codeChallenge);
42
42
  url.searchParams.set("code_challenge_method", "S256");
43
43
  return url;
@@ -74,7 +74,7 @@ export class Kick {
74
74
  const auth = requireAuthConfig(this.auth);
75
75
  const state = generateOAuthState();
76
76
  const codeVerifier = generateOAuthCodeVerifier();
77
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
77
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
78
78
  await saveOAuthState(auth.store, state, { codeVerifier });
79
79
  return url;
80
80
  }
@@ -97,7 +97,8 @@ export class Kick {
97
97
  id: profileId(profile.user_id),
98
98
  name: profileString(profile.name),
99
99
  email: profileString(profile.email),
100
- image: profileString(profile.profile_picture)
100
+ image: profileString(profile.profile_picture),
101
+ raw: profile
101
102
  };
102
103
  }
103
104
  }
@@ -7,7 +7,7 @@ export declare class Lichess {
7
7
  private auth;
8
8
  constructor(options: LichessOptions);
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
  getAuthorizationURL(scopes?: string[]): Promise<URL>;
13
13
  getUser(query: OAuthCallbackQuery): Promise<OAuthUser>;
@@ -18,8 +18,8 @@ export class Lichess {
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) {
@@ -30,7 +30,7 @@ export class Lichess {
30
30
  const auth = requireAuthConfig(this.auth);
31
31
  const state = generateOAuthState();
32
32
  const codeVerifier = generateOAuthCodeVerifier();
33
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
33
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
34
34
  await saveOAuthState(auth.store, state, { codeVerifier });
35
35
  return url;
36
36
  }
@@ -57,7 +57,8 @@ export class Lichess {
57
57
  id: profileId(profile.id),
58
58
  name: profileString(profile.username),
59
59
  email,
60
- image: null
60
+ image: null,
61
+ raw: profile
61
62
  };
62
63
  }
63
64
  }
@@ -9,7 +9,7 @@ export declare class Line {
9
9
  private auth;
10
10
  constructor(options: LineOptions);
11
11
  constructor(clientId: 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
  getAuthorizationURL(scopes?: string[]): Promise<URL>;
@@ -28,7 +28,7 @@ export class Line {
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_id", this.clientId);
@@ -37,7 +37,7 @@ export class Line {
37
37
  url.searchParams.set("scope", scopes.join(" "));
38
38
  }
39
39
  url.searchParams.set("redirect_uri", this.redirectURI);
40
- const codeChallenge = createS256CodeChallenge(codeVerifier);
40
+ const codeChallenge = await createS256CodeChallenge(codeVerifier);
41
41
  url.searchParams.set("code_challenge_method", "S256");
42
42
  url.searchParams.set("code_challenge", codeChallenge);
43
43
  return url;
@@ -68,7 +68,7 @@ export class Line {
68
68
  const auth = requireAuthConfig(this.auth);
69
69
  const state = generateOAuthState();
70
70
  const codeVerifier = generateOAuthCodeVerifier();
71
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
71
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
72
72
  await saveOAuthState(auth.store, state, { codeVerifier });
73
73
  return url;
74
74
  }
@@ -92,7 +92,8 @@ export class Line {
92
92
  id: profileId(claims.sub),
93
93
  name: profileString(claims.name),
94
94
  email: profileString(claims.email),
95
- image: profileString(claims.picture)
95
+ image: profileString(claims.picture),
96
+ raw: claims
96
97
  };
97
98
  }
98
99
  }
@@ -65,7 +65,8 @@ export class Linear {
65
65
  id: profileId(viewer.id),
66
66
  name: profileString(viewer.name),
67
67
  email: profileString(viewer.email),
68
- image: profileString(viewer.avatarUrl)
68
+ image: profileString(viewer.avatarUrl),
69
+ raw: viewer
69
70
  };
70
71
  }
71
72
  }
@@ -83,7 +83,8 @@ export class LinkedIn {
83
83
  id: profileId(claims.sub),
84
84
  name: profileString(claims.name),
85
85
  email: profileString(claims.email),
86
- image: profileString(claims.picture)
86
+ image: profileString(claims.picture),
87
+ raw: claims
87
88
  };
88
89
  }
89
90
  }
@@ -12,7 +12,7 @@ export declare class Mastodon {
12
12
  private auth;
13
13
  constructor(options: MastodonOptions);
14
14
  constructor(baseURL: string, clientId: string, clientSecret: string, 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
  revokeToken(token: string): Promise<void>;
18
18
  getAuthorizationURL(scopes?: string[]): Promise<URL>;
@@ -29,8 +29,8 @@ export class Mastodon {
29
29
  this.tokenRevocationEndpoint = joinURIAndPath(baseURL, "/api/v1/oauth/revoke");
30
30
  this.userEndpoint = joinURIAndPath(baseURL, "/api/v1/accounts/verify_credentials");
31
31
  }
32
- createAuthorizationURL(state, codeVerifier, scopes) {
33
- const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
32
+ async createAuthorizationURL(state, codeVerifier, scopes) {
33
+ const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
34
34
  return url;
35
35
  }
36
36
  async validateAuthorizationCode(code, codeVerifier) {
@@ -44,7 +44,7 @@ export class Mastodon {
44
44
  const auth = requireAuthConfig(this.auth);
45
45
  const state = generateOAuthState();
46
46
  const codeVerifier = generateOAuthCodeVerifier();
47
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
47
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
48
48
  await saveOAuthState(auth.store, state, { codeVerifier });
49
49
  return url;
50
50
  }
@@ -61,7 +61,8 @@ export class Mastodon {
61
61
  id: profileId(profile.id),
62
62
  name: profileString(profile.display_name) ?? profileString(profile.username),
63
63
  email: null,
64
- image: profileString(profile.avatar)
64
+ image: profileString(profile.avatar),
65
+ raw: profile
65
66
  };
66
67
  }
67
68
  }
@@ -9,7 +9,7 @@ export declare class MercadoLibre {
9
9
  private auth;
10
10
  constructor(options: MercadoLibreOptions);
11
11
  constructor(clientId: string, clientSecret: string, redirectURI: string);
12
- createAuthorizationURL(state: string, codeVerifier: string): URL;
12
+ createAuthorizationURL(state: string, codeVerifier: string): Promise<URL>;
13
13
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
14
14
  refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
15
15
  getAuthorizationURL(_scopes?: string[]): Promise<URL>;
@@ -27,13 +27,13 @@ export class MercadoLibre {
27
27
  }
28
28
  }
29
29
  // `scopes` not required since they are defined in the application settings
30
- createAuthorizationURL(state, codeVerifier) {
30
+ async createAuthorizationURL(state, codeVerifier) {
31
31
  const url = new URL(authorizationEndpoint);
32
32
  url.searchParams.set("response_type", "code");
33
33
  url.searchParams.set("client_id", this.clientId);
34
34
  url.searchParams.set("redirect_uri", this.redirectURI);
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
  return url;
@@ -65,7 +65,7 @@ export class MercadoLibre {
65
65
  const auth = requireAuthConfig(this.auth);
66
66
  const state = generateOAuthState();
67
67
  const codeVerifier = generateOAuthCodeVerifier();
68
- const url = this.createAuthorizationURL(state, codeVerifier);
68
+ const url = await this.createAuthorizationURL(state, codeVerifier);
69
69
  await saveOAuthState(auth.store, state, { codeVerifier });
70
70
  return url;
71
71
  }
@@ -89,7 +89,8 @@ export class MercadoLibre {
89
89
  id: profileId(profile.id),
90
90
  name: fullName !== "" ? fullName : profileString(profile.nickname),
91
91
  email: profileString(profile.email),
92
- image
92
+ image,
93
+ raw: profile
93
94
  };
94
95
  }
95
96
  }
@@ -9,7 +9,7 @@ export declare class MercadoPago {
9
9
  private auth;
10
10
  constructor(options: MercadoPagoOptions);
11
11
  constructor(clientId: string, clientSecret: string, redirectURI: string);
12
- createAuthorizationURL(state: string, codeVerifier: string): URL;
12
+ createAuthorizationURL(state: string, codeVerifier: string): Promise<URL>;
13
13
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
14
14
  refreshAccessToken(refreshToken: string): Promise<OAuth2Tokens>;
15
15
  getAuthorizationURL(_scopes?: string[]): Promise<URL>;
@@ -27,13 +27,13 @@ export class MercadoPago {
27
27
  }
28
28
  }
29
29
  // `scopes` not required since they are defined in the application settings
30
- createAuthorizationURL(state, codeVerifier) {
30
+ async createAuthorizationURL(state, codeVerifier) {
31
31
  const url = new URL(authorizationEndpoint);
32
32
  url.searchParams.set("response_type", "code");
33
33
  url.searchParams.set("client_id", this.clientId);
34
34
  url.searchParams.set("redirect_uri", this.redirectURI);
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
  return url;
@@ -65,7 +65,7 @@ export class MercadoPago {
65
65
  const auth = requireAuthConfig(this.auth);
66
66
  const state = generateOAuthState();
67
67
  const codeVerifier = generateOAuthCodeVerifier();
68
- const url = this.createAuthorizationURL(state, codeVerifier);
68
+ const url = await this.createAuthorizationURL(state, codeVerifier);
69
69
  await saveOAuthState(auth.store, state, { codeVerifier });
70
70
  return url;
71
71
  }
@@ -89,7 +89,8 @@ export class MercadoPago {
89
89
  id: profileId(profile.id),
90
90
  name: fullName !== "" ? fullName : profileString(profile.nickname),
91
91
  email: profileString(profile.email),
92
- image
92
+ image,
93
+ raw: profile
93
94
  };
94
95
  }
95
96
  }
@@ -12,7 +12,7 @@ export declare class MicrosoftEntraId {
12
12
  private auth;
13
13
  constructor(options: MicrosoftEntraIdOptions);
14
14
  constructor(tenant: 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
  getAuthorizationURL(scopes?: string[]): Promise<URL>;
@@ -30,13 +30,13 @@ export class MicrosoftEntraId {
30
30
  this.authorizationEndpoint = joinURIAndPath("https://login.microsoftonline.com", tenant, "/oauth2/v2.0/authorize");
31
31
  this.tokenEndpoint = joinURIAndPath("https://login.microsoftonline.com", tenant, "/oauth2/v2.0/token");
32
32
  }
33
- createAuthorizationURL(state, codeVerifier, scopes) {
33
+ async createAuthorizationURL(state, codeVerifier, scopes) {
34
34
  const url = new URL(this.authorizationEndpoint);
35
35
  url.searchParams.set("response_type", "code");
36
36
  url.searchParams.set("client_id", this.clientId);
37
37
  url.searchParams.set("redirect_uri", this.redirectURI);
38
38
  url.searchParams.set("state", state);
39
- const codeChallenge = createS256CodeChallenge(codeVerifier);
39
+ const codeChallenge = await createS256CodeChallenge(codeVerifier);
40
40
  url.searchParams.set("code_challenge_method", "S256");
41
41
  url.searchParams.set("code_challenge", codeChallenge);
42
42
  if (scopes.length > 0) {
@@ -91,7 +91,7 @@ export class MicrosoftEntraId {
91
91
  const auth = requireAuthConfig(this.auth);
92
92
  const state = generateOAuthState();
93
93
  const codeVerifier = generateOAuthCodeVerifier();
94
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
94
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
95
95
  await saveOAuthState(auth.store, state, { codeVerifier });
96
96
  return url;
97
97
  }
@@ -114,7 +114,8 @@ export class MicrosoftEntraId {
114
114
  id: profileId(claims.sub),
115
115
  name: profileString(claims.name),
116
116
  email: profileString(claims.email) ?? profileString(claims.preferred_username),
117
- image: profileString(claims.picture)
117
+ image: profileString(claims.picture),
118
+ raw: claims
118
119
  };
119
120
  }
120
121
  }
@@ -7,7 +7,7 @@ export declare class MyAnimeList {
7
7
  private auth;
8
8
  constructor(options: MyAnimeListOptions);
9
9
  constructor(clientId: string, clientSecret: string, redirectURI: string | null);
10
- createAuthorizationURL(state: string, codeVerifier: string): URL;
10
+ createAuthorizationURL(state: string, codeVerifier: 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>;
@@ -16,8 +16,8 @@ export class MyAnimeList {
16
16
  this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
17
17
  }
18
18
  }
19
- createAuthorizationURL(state, codeVerifier) {
20
- const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.Plain, codeVerifier, []);
19
+ async createAuthorizationURL(state, codeVerifier) {
20
+ const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.Plain, codeVerifier, []);
21
21
  return url;
22
22
  }
23
23
  async validateAuthorizationCode(code, codeVerifier) {
@@ -33,7 +33,7 @@ export class MyAnimeList {
33
33
  const auth = requireAuthConfig(this.auth);
34
34
  const state = generateOAuthState();
35
35
  const codeVerifier = generateOAuthCodeVerifier();
36
- const url = this.createAuthorizationURL(state, codeVerifier);
36
+ const url = await this.createAuthorizationURL(state, codeVerifier);
37
37
  await saveOAuthState(auth.store, state, { codeVerifier });
38
38
  return url;
39
39
  }
@@ -50,7 +50,8 @@ export class MyAnimeList {
50
50
  id: profileId(profile.id),
51
51
  name: profileString(profile.name),
52
52
  email: null,
53
- image: profileString(profile.picture)
53
+ image: profileString(profile.picture),
54
+ raw: profile
54
55
  };
55
56
  }
56
57
  }
@@ -77,7 +77,8 @@ export class Naver {
77
77
  id: profileId(user.id),
78
78
  name: profileString(user.name) ?? profileString(user.nickname),
79
79
  email: profileString(user.email),
80
- image: profileString(user.profile_image)
80
+ image: profileString(user.profile_image),
81
+ raw: user
81
82
  };
82
83
  }
83
84
  }
@@ -59,7 +59,8 @@ export class Notion {
59
59
  id: profileId(profile.id),
60
60
  name: profileString(profile.name),
61
61
  email,
62
- image: profileString(profile.avatar_url)
62
+ image: profileString(profile.avatar_url),
63
+ raw: profile
63
64
  };
64
65
  }
65
66
  }
@@ -13,7 +13,7 @@ export declare class Okta {
13
13
  private auth;
14
14
  constructor(options: OktaOptions);
15
15
  constructor(domain: string, authorizationServerId: string | null, clientId: string, clientSecret: string, redirectURI: string);
16
- createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): URL;
16
+ createAuthorizationURL(state: string, codeVerifier: string, scopes: string[]): Promise<URL>;
17
17
  validateAuthorizationCode(code: string, codeVerifier: string): Promise<OAuth2Tokens>;
18
18
  refreshAccessToken(refreshToken: string, scopes: string[]): Promise<OAuth2Tokens>;
19
19
  revokeToken(token: string): Promise<void>;
@@ -37,8 +37,8 @@ export class Okta {
37
37
  this.tokenRevocationEndpoint = joinURIAndPath(baseURL, "/v1/revoke");
38
38
  this.userinfoEndpoint = joinURIAndPath(baseURL, "/v1/userinfo");
39
39
  }
40
- createAuthorizationURL(state, codeVerifier, scopes) {
41
- const url = this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
40
+ async createAuthorizationURL(state, codeVerifier, scopes) {
41
+ const url = await this.client.createAuthorizationURLWithPKCE(this.authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
42
42
  return url;
43
43
  }
44
44
  async validateAuthorizationCode(code, codeVerifier) {
@@ -56,7 +56,7 @@ export class Okta {
56
56
  const auth = requireAuthConfig(this.auth);
57
57
  const state = generateOAuthState();
58
58
  const codeVerifier = generateOAuthCodeVerifier();
59
- const url = this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
59
+ const url = await this.createAuthorizationURL(state, codeVerifier, resolveScopes(scopes, auth, defaultScopes));
60
60
  await saveOAuthState(auth.store, state, { codeVerifier });
61
61
  return url;
62
62
  }
@@ -79,7 +79,8 @@ export class Okta {
79
79
  id: profileId(claims.sub),
80
80
  name: profileString(claims.name),
81
81
  email: profileString(claims.email),
82
- image: profileString(claims.picture)
82
+ image: profileString(claims.picture),
83
+ raw: claims
83
84
  };
84
85
  }
85
86
  }
@@ -76,7 +76,8 @@ export class Osu {
76
76
  id: profileId(profile.id),
77
77
  name: profileString(profile.username),
78
78
  email: null,
79
- image: profileString(profile.avatar_url)
79
+ image: profileString(profile.avatar_url),
80
+ raw: profile
80
81
  };
81
82
  }
82
83
  }
@@ -83,7 +83,8 @@ export class Patreon {
83
83
  id: profileId(user.id),
84
84
  name: profileString(attributes.full_name),
85
85
  email: profileString(attributes.email),
86
- image: profileString(attributes.image_url)
86
+ image: profileString(attributes.image_url),
87
+ raw: user
87
88
  };
88
89
  }
89
90
  }
@@ -9,7 +9,7 @@ export declare class Polar {
9
9
  private auth;
10
10
  constructor(options: PolarOptions);
11
11
  constructor(clientId: string, clientSecret: string | null, 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>;
@@ -26,7 +26,7 @@ export class Polar {
26
26
  this.redirectURI = redirectURI ?? "";
27
27
  }
28
28
  }
29
- createAuthorizationURL(state, codeVerifier, scopes) {
29
+ async createAuthorizationURL(state, codeVerifier, scopes) {
30
30
  const url = new URL(authorizationEndpoint);
31
31
  url.searchParams.set("client_id", this.clientId);
32
32
  url.searchParams.set("response_type", "code");
@@ -35,7 +35,7 @@ export class Polar {
35
35
  if (scopes.length > 0) {
36
36
  url.searchParams.set("scope", scopes.join(" "));
37
37
  }
38
- const codeChallenge = createS256CodeChallenge(codeVerifier);
38
+ const codeChallenge = await createS256CodeChallenge(codeVerifier);
39
39
  url.searchParams.set("code_challenge", codeChallenge);
40
40
  url.searchParams.set("code_challenge_method", "S256");
41
41
  return url;
@@ -76,7 +76,7 @@ export class Polar {
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
  }
@@ -94,7 +94,8 @@ export class Polar {
94
94
  name: profileString(claims.name),
95
95
  email: profileString(claims.email),
96
96
  // Polar's userinfo response has no avatar field.
97
- image: null
97
+ image: null,
98
+ raw: claims
98
99
  };
99
100
  }
100
101
  }
@@ -49,7 +49,8 @@ export class Reddit {
49
49
  id: profileId(profile.id),
50
50
  name: profileString(profile.name),
51
51
  email: null,
52
- image: profileString(profile.icon_img)
52
+ image: profileString(profile.icon_img),
53
+ raw: profile
53
54
  };
54
55
  }
55
56
  }
@@ -7,7 +7,7 @@ export declare class Roblox {
7
7
  private auth;
8
8
  constructor(options: RobloxOptions);
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>;
@@ -19,8 +19,8 @@ export class Roblox {
19
19
  this.client = new OAuth2Client(clientIdOrOptions, clientSecret ?? null, redirectURI ?? null);
20
20
  }
21
21
  }
22
- createAuthorizationURL(state, codeVerifier, scopes) {
23
- const url = this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
22
+ async createAuthorizationURL(state, codeVerifier, scopes) {
23
+ const url = await this.client.createAuthorizationURLWithPKCE(authorizationEndpoint, state, CodeChallengeMethod.S256, codeVerifier, scopes);
24
24
  return url;
25
25
  }
26
26
  async validateAuthorizationCode(code, codeVerifier) {
@@ -38,7 +38,7 @@ export class Roblox {
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
  }
@@ -61,7 +61,8 @@ export class Roblox {
61
61
  id: profileId(claims.sub),
62
62
  name: profileString(claims.name) ?? profileString(claims.preferred_username),
63
63
  email: null,
64
- image: profileString(claims.picture)
64
+ image: profileString(claims.picture),
65
+ raw: claims
65
66
  };
66
67
  }
67
68
  }
@@ -12,7 +12,7 @@ export declare class Salesforce {
12
12
  private auth;
13
13
  constructor(options: SalesforceOptions);
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): Promise<OAuth2Tokens>;
18
18
  revokeToken(token: string): Promise<void>;
@@ -26,8 +26,8 @@ export class Salesforce {
26
26
  this.tokenRevocationEndpoint = `https://${domain}/services/oauth2/revoke`;
27
27
  this.userinfoEndpoint = `https://${domain}/services/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 Salesforce {
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
  }
@@ -68,7 +68,8 @@ export class Salesforce {
68
68
  id: profileId(claims.sub),
69
69
  name: profileString(claims.name) ?? profileString(claims.preferred_username),
70
70
  email: profileString(claims.email),
71
- image: profileString(claims.picture)
71
+ image: profileString(claims.picture),
72
+ raw: claims
72
73
  };
73
74
  }
74
75
  }
@@ -75,7 +75,8 @@ export class Shikimori {
75
75
  id: profileId(profile.id),
76
76
  name: profileString(profile.nickname),
77
77
  email: null,
78
- image: image ?? profileString(profile.avatar)
78
+ image: image ?? profileString(profile.avatar),
79
+ raw: profile
79
80
  };
80
81
  }
81
82
  }