@better-auth/core 1.7.0-rc.5 → 1.7.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 (117) hide show
  1. package/dist/api/index.d.mts +28 -28
  2. package/dist/async_hooks/index.d.mts +1 -0
  3. package/dist/async_hooks/pure.index.d.mts +1 -0
  4. package/dist/context/endpoint-context.d.mts +1 -1
  5. package/dist/context/endpoint-context.mjs +4 -4
  6. package/dist/context/global.d.mts +1 -0
  7. package/dist/context/global.mjs +1 -1
  8. package/dist/context/request-state.d.mts +1 -0
  9. package/dist/context/request-state.mjs +3 -6
  10. package/dist/context/transaction.d.mts +3 -4
  11. package/dist/context/transaction.mjs +4 -4
  12. package/dist/db/adapter/factory.d.mts +5 -3
  13. package/dist/db/adapter/factory.mjs +1 -1
  14. package/dist/db/adapter/get-default-field-name.d.mts +9 -2
  15. package/dist/db/adapter/get-default-model-name.d.mts +5 -1
  16. package/dist/db/adapter/get-field-attributes.d.mts +11 -4
  17. package/dist/db/adapter/get-field-name.d.mts +9 -2
  18. package/dist/db/adapter/get-id-field.d.mts +12 -4
  19. package/dist/db/adapter/get-model-name.d.mts +5 -1
  20. package/dist/db/adapter/index.d.mts +32 -7
  21. package/dist/db/adapter/types.d.mts +17 -5
  22. package/dist/db/adapter/utils.d.mts +1 -0
  23. package/dist/db/database-index.d.mts +12 -2
  24. package/dist/db/get-tables.d.mts +0 -1
  25. package/dist/db/plugin.d.mts +3 -3
  26. package/dist/db/schema/account.d.mts +1 -1
  27. package/dist/db/schema/rate-limit.d.mts +1 -1
  28. package/dist/db/schema/session.d.mts +1 -1
  29. package/dist/db/schema/shared.d.mts +1 -0
  30. package/dist/db/schema/user.d.mts +1 -1
  31. package/dist/db/schema/verification.d.mts +1 -1
  32. package/dist/db/type.d.mts +11 -8
  33. package/dist/env/logger.d.mts +25 -25
  34. package/dist/error/codes.d.mts +1 -0
  35. package/dist/error/index.d.mts +1 -0
  36. package/dist/index.d.mts +1 -1
  37. package/dist/instrumentation/attributes.d.mts +1 -0
  38. package/dist/instrumentation/pure.index.d.mts +1 -0
  39. package/dist/instrumentation/tracer.mjs +1 -1
  40. package/dist/oauth2/authorization-params.d.mts +1 -0
  41. package/dist/oauth2/client-assertion.d.mts +13 -3
  42. package/dist/oauth2/client-credentials-token.d.mts +17 -3
  43. package/dist/oauth2/create-authorization-url.d.mts +21 -3
  44. package/dist/oauth2/dpop.d.mts +23 -2
  45. package/dist/oauth2/dpop.mjs +1 -1
  46. package/dist/oauth2/oauth-provider.d.mts +7 -13
  47. package/dist/oauth2/refresh-access-token.d.mts +19 -3
  48. package/dist/oauth2/refresh-access-token.mjs +1 -1
  49. package/dist/oauth2/reject-redirects.mjs +1 -1
  50. package/dist/oauth2/token-endpoint-auth.d.mts +1 -0
  51. package/dist/oauth2/utils.d.mts +1 -0
  52. package/dist/oauth2/utils.mjs +1 -1
  53. package/dist/oauth2/validate-authorization-code.d.mts +29 -5
  54. package/dist/oauth2/verify-id-token.d.mts +1 -1
  55. package/dist/oauth2/verify.d.mts +7 -5
  56. package/dist/oauth2/verify.mjs +2 -2
  57. package/dist/social-providers/apple.d.mts +18 -5
  58. package/dist/social-providers/atlassian.d.mts +15 -4
  59. package/dist/social-providers/cognito.d.mts +18 -5
  60. package/dist/social-providers/discord.d.mts +13 -4
  61. package/dist/social-providers/dropbox.d.mts +15 -4
  62. package/dist/social-providers/facebook.d.mts +18 -6
  63. package/dist/social-providers/figma.d.mts +15 -4
  64. package/dist/social-providers/github.d.mts +16 -4
  65. package/dist/social-providers/gitlab.d.mts +16 -4
  66. package/dist/social-providers/google.d.mts +25 -6
  67. package/dist/social-providers/huggingface.d.mts +15 -4
  68. package/dist/social-providers/index.d.mts +504 -113
  69. package/dist/social-providers/kakao.d.mts +13 -4
  70. package/dist/social-providers/kick.d.mts +15 -4
  71. package/dist/social-providers/line.d.mts +16 -4
  72. package/dist/social-providers/linear.d.mts +14 -4
  73. package/dist/social-providers/linkedin.d.mts +14 -4
  74. package/dist/social-providers/microsoft-entra-id.d.mts +14 -5
  75. package/dist/social-providers/microsoft-entra-id.mjs +1 -2
  76. package/dist/social-providers/naver.d.mts +22 -23
  77. package/dist/social-providers/notion.d.mts +14 -4
  78. package/dist/social-providers/paybin.d.mts +16 -4
  79. package/dist/social-providers/paypal.d.mts +13 -4
  80. package/dist/social-providers/polar.d.mts +15 -4
  81. package/dist/social-providers/railway.d.mts +15 -4
  82. package/dist/social-providers/reddit.d.mts +13 -4
  83. package/dist/social-providers/roblox.d.mts +13 -4
  84. package/dist/social-providers/salesforce.d.mts +15 -4
  85. package/dist/social-providers/slack.d.mts +13 -4
  86. package/dist/social-providers/spotify.d.mts +15 -4
  87. package/dist/social-providers/tiktok.d.mts +14 -6
  88. package/dist/social-providers/twitch.d.mts +13 -4
  89. package/dist/social-providers/twitter.d.mts +19 -26
  90. package/dist/social-providers/vercel.d.mts +15 -4
  91. package/dist/social-providers/vk.d.mts +16 -4
  92. package/dist/social-providers/wechat.d.mts +12 -4
  93. package/dist/social-providers/zoom.d.mts +18 -6
  94. package/dist/types/context.d.mts +2 -2
  95. package/dist/types/cookie.d.mts +1 -1
  96. package/dist/types/helper.d.mts +1 -1
  97. package/dist/types/index.d.mts +1 -1
  98. package/dist/types/init-options.d.mts +18 -26
  99. package/dist/types/plugin-client.d.mts +3 -1
  100. package/dist/types/plugin.d.mts +2 -2
  101. package/dist/utils/async.d.mts +1 -0
  102. package/dist/utils/db.d.mts +0 -1
  103. package/dist/utils/deprecate.d.mts +1 -0
  104. package/dist/utils/email.d.mts +4 -1
  105. package/dist/utils/error-codes.d.mts +2 -2
  106. package/dist/utils/host.d.mts +1 -27
  107. package/dist/utils/host.mjs +1 -1
  108. package/dist/utils/ip.d.mts +0 -1
  109. package/dist/utils/ip.mjs +1 -1
  110. package/dist/utils/is-api-error.d.mts +1 -0
  111. package/dist/utils/redirect-uri.d.mts +1 -0
  112. package/package.json +2 -2
  113. package/src/context/endpoint-context.ts +6 -4
  114. package/src/context/request-state.ts +5 -23
  115. package/src/context/transaction.ts +6 -4
  116. package/src/db/type.ts +2 -1
  117. package/src/types/init-options.ts +6 -4
@@ -4,7 +4,7 @@ import { createInMemoryDpopReplayStore, enforceDpopBinding, getDpopJktFromPayloa
4
4
  import { APIError } from "better-call";
5
5
  import { UnsecuredJWT, createLocalJWKSet, decodeProtectedHeader, errors, jwtVerify } from "jose";
6
6
  //#region src/oauth2/verify.ts
7
- const joseInfrastructureErrorCodes = /* @__PURE__ */ new Set([
7
+ const joseInfrastructureErrorCodes = new Set([
8
8
  errors.JWKSTimeout.code,
9
9
  errors.JWKSInvalid.code,
10
10
  errors.JWKSMultipleMatchingKeys.code
@@ -330,4 +330,4 @@ async function verifyAccessTokenRequest(request, opts) {
330
330
  return payload;
331
331
  }
332
332
  //#endregion
333
- export { createInsufficientScopeError, getJwks, isInsufficientScopeError, jwksCache, requestToResourceInput, verifyAccessTokenRequest, verifyBearerToken, verifyJwsAccessToken };
333
+ export { createInsufficientScopeError, getJwks, isInsufficientScopeError, requestToResourceInput, verifyAccessTokenRequest, verifyBearerToken, verifyJwsAccessToken };
@@ -1,5 +1,6 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
2
+ import * as _$jose from "jose";
3
+
3
4
  //#region src/social-providers/apple.d.ts
4
5
  interface AppleProfile {
5
6
  /**
@@ -68,9 +69,17 @@ interface AppleOptions extends ProviderOptions<AppleProfile> {
68
69
  declare const apple: (options: AppleOptions) => {
69
70
  id: "apple";
70
71
  name: string;
71
- accountSubject: ({ profile }: OAuthAccountKeyContext<AppleProfile>) => string;
72
+ accountSubject: ({
73
+ profile
74
+ }: OAuthAccountKeyContext<AppleProfile>) => string;
72
75
  accountIssuer: string;
73
- createAuthorizationURL({ state, scopes, redirectURI, additionalParams, codeVerifier }: {
76
+ createAuthorizationURL({
77
+ state,
78
+ scopes,
79
+ redirectURI,
80
+ additionalParams,
81
+ codeVerifier
82
+ }: {
74
83
  state: string;
75
84
  codeVerifier: string;
76
85
  scopes?: string[] | undefined;
@@ -80,14 +89,18 @@ declare const apple: (options: AppleOptions) => {
80
89
  idTokenNonce?: string | undefined;
81
90
  additionalParams?: Record<string, string> | undefined;
82
91
  }): Promise<URL>;
83
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
92
+ validateAuthorizationCode: ({
93
+ code,
94
+ codeVerifier,
95
+ redirectURI
96
+ }: {
84
97
  code: string;
85
98
  redirectURI: string;
86
99
  codeVerifier?: string | undefined;
87
100
  deviceId?: string | undefined;
88
101
  }) => Promise<OAuth2Tokens>;
89
102
  idToken: {
90
- jwks: (header: import("jose").JWTHeaderParameters) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
103
+ jwks: (header: _$jose.JWTHeaderParameters) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
91
104
  issuer: string;
92
105
  audience: string | string[];
93
106
  maxTokenAge: string;
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/atlassian.d.ts
4
3
  interface AtlassianProfile {
5
4
  account_type?: string | undefined;
@@ -22,8 +21,16 @@ interface AtlassianOptions extends ProviderOptions<AtlassianProfile> {
22
21
  declare const atlassian: (options: AtlassianOptions) => {
23
22
  id: "atlassian";
24
23
  name: string;
25
- accountSubject: ({ profile }: OAuthAccountKeyContext<AtlassianProfile>) => string;
26
- createAuthorizationURL({ state, scopes, codeVerifier, redirectURI, additionalParams }: {
24
+ accountSubject: ({
25
+ profile
26
+ }: OAuthAccountKeyContext<AtlassianProfile>) => string;
27
+ createAuthorizationURL({
28
+ state,
29
+ scopes,
30
+ codeVerifier,
31
+ redirectURI,
32
+ additionalParams
33
+ }: {
27
34
  state: string;
28
35
  codeVerifier: string;
29
36
  scopes?: string[] | undefined;
@@ -33,7 +40,11 @@ declare const atlassian: (options: AtlassianOptions) => {
33
40
  idTokenNonce?: string | undefined;
34
41
  additionalParams?: Record<string, string> | undefined;
35
42
  }): Promise<URL>;
36
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
43
+ validateAuthorizationCode: ({
44
+ code,
45
+ codeVerifier,
46
+ redirectURI
47
+ }: {
37
48
  code: string;
38
49
  redirectURI: string;
39
50
  codeVerifier?: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
2
+ import * as _$jose from "jose";
3
+
3
4
  //#region src/social-providers/cognito.d.ts
4
5
  interface CognitoProfile {
5
6
  sub: string;
@@ -48,9 +49,17 @@ interface CognitoOptions extends ProviderOptions<CognitoProfile> {
48
49
  declare const cognito: (options: CognitoOptions) => {
49
50
  id: "cognito";
50
51
  name: string;
51
- accountSubject: ({ profile }: OAuthAccountKeyContext<CognitoProfile>) => string;
52
+ accountSubject: ({
53
+ profile
54
+ }: OAuthAccountKeyContext<CognitoProfile>) => string;
52
55
  accountIssuer: string;
53
- createAuthorizationURL({ state, scopes, codeVerifier, redirectURI, additionalParams }: {
56
+ createAuthorizationURL({
57
+ state,
58
+ scopes,
59
+ codeVerifier,
60
+ redirectURI,
61
+ additionalParams
62
+ }: {
54
63
  state: string;
55
64
  codeVerifier: string;
56
65
  scopes?: string[] | undefined;
@@ -60,7 +69,11 @@ declare const cognito: (options: CognitoOptions) => {
60
69
  idTokenNonce?: string | undefined;
61
70
  additionalParams?: Record<string, string> | undefined;
62
71
  }): Promise<URL>;
63
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
72
+ validateAuthorizationCode: ({
73
+ code,
74
+ codeVerifier,
75
+ redirectURI
76
+ }: {
64
77
  code: string;
65
78
  redirectURI: string;
66
79
  codeVerifier?: string | undefined;
@@ -68,7 +81,7 @@ declare const cognito: (options: CognitoOptions) => {
68
81
  }) => Promise<OAuth2Tokens>;
69
82
  refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
70
83
  idToken: {
71
- jwks: (header: import("jose").JWTHeaderParameters) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
84
+ jwks: (header: _$jose.JWTHeaderParameters) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
72
85
  issuer: string;
73
86
  audience: string | string[];
74
87
  maxTokenAge: string;
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/discord.d.ts
4
3
  interface DiscordProfile extends Record<string, any> {
5
4
  /** the user's id (i.e. the numerical snowflake) */
@@ -78,8 +77,15 @@ interface DiscordOptions extends ProviderOptions<DiscordProfile> {
78
77
  declare const discord: (options: DiscordOptions) => {
79
78
  id: "discord";
80
79
  name: string;
81
- accountSubject: ({ profile }: OAuthAccountKeyContext<DiscordProfile>) => string;
82
- createAuthorizationURL({ state, scopes, redirectURI, additionalParams }: {
80
+ accountSubject: ({
81
+ profile
82
+ }: OAuthAccountKeyContext<DiscordProfile>) => string;
83
+ createAuthorizationURL({
84
+ state,
85
+ scopes,
86
+ redirectURI,
87
+ additionalParams
88
+ }: {
83
89
  state: string;
84
90
  codeVerifier: string;
85
91
  scopes?: string[] | undefined;
@@ -89,7 +95,10 @@ declare const discord: (options: DiscordOptions) => {
89
95
  idTokenNonce?: string | undefined;
90
96
  additionalParams?: Record<string, string> | undefined;
91
97
  }): Promise<URL>;
92
- validateAuthorizationCode: ({ code, redirectURI }: {
98
+ validateAuthorizationCode: ({
99
+ code,
100
+ redirectURI
101
+ }: {
93
102
  code: string;
94
103
  redirectURI: string;
95
104
  codeVerifier?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/dropbox.d.ts
4
3
  interface DropboxProfile {
5
4
  account_id: string;
@@ -21,8 +20,16 @@ interface DropboxOptions extends ProviderOptions<DropboxProfile> {
21
20
  declare const dropbox: (options: DropboxOptions) => {
22
21
  id: "dropbox";
23
22
  name: string;
24
- accountSubject: ({ profile }: OAuthAccountKeyContext<DropboxProfile>) => string;
25
- createAuthorizationURL: ({ state, scopes, codeVerifier, redirectURI, additionalParams }: {
23
+ accountSubject: ({
24
+ profile
25
+ }: OAuthAccountKeyContext<DropboxProfile>) => string;
26
+ createAuthorizationURL: ({
27
+ state,
28
+ scopes,
29
+ codeVerifier,
30
+ redirectURI,
31
+ additionalParams
32
+ }: {
26
33
  state: string;
27
34
  codeVerifier: string;
28
35
  scopes?: string[] | undefined;
@@ -32,7 +39,11 @@ declare const dropbox: (options: DropboxOptions) => {
32
39
  idTokenNonce?: string | undefined;
33
40
  additionalParams?: Record<string, string> | undefined;
34
41
  }) => Promise<URL>;
35
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
42
+ validateAuthorizationCode: ({
43
+ code,
44
+ codeVerifier,
45
+ redirectURI
46
+ }: {
36
47
  code: string;
37
48
  redirectURI: string;
38
49
  codeVerifier?: string | undefined;
@@ -1,5 +1,6 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
2
+ import * as _$jose from "jose";
3
+
3
4
  //#region src/social-providers/facebook.d.ts
4
5
  interface FacebookGraphProfile {
5
6
  id: string;
@@ -38,9 +39,17 @@ interface FacebookOptions extends ProviderOptions<FacebookProfile> {
38
39
  declare const facebook: (options: FacebookOptions) => {
39
40
  id: "facebook";
40
41
  name: string;
41
- accountSubject: ({ profile }: OAuthAccountKeyContext<FacebookProfile>) => string;
42
+ accountSubject: ({
43
+ profile
44
+ }: OAuthAccountKeyContext<FacebookProfile>) => string;
42
45
  accountIssuer: string;
43
- createAuthorizationURL({ state, scopes, redirectURI, loginHint, additionalParams }: {
46
+ createAuthorizationURL({
47
+ state,
48
+ scopes,
49
+ redirectURI,
50
+ loginHint,
51
+ additionalParams
52
+ }: {
44
53
  state: string;
45
54
  codeVerifier: string;
46
55
  scopes?: string[] | undefined;
@@ -50,7 +59,10 @@ declare const facebook: (options: FacebookOptions) => {
50
59
  idTokenNonce?: string | undefined;
51
60
  additionalParams?: Record<string, string> | undefined;
52
61
  }): Promise<URL>;
53
- validateAuthorizationCode: ({ code, redirectURI }: {
62
+ validateAuthorizationCode: ({
63
+ code,
64
+ redirectURI
65
+ }: {
54
66
  code: string;
55
67
  redirectURI: string;
56
68
  codeVerifier?: string | undefined;
@@ -58,12 +70,12 @@ declare const facebook: (options: FacebookOptions) => {
58
70
  }) => Promise<OAuth2Tokens>;
59
71
  idToken: {
60
72
  jwks: {
61
- (protectedHeader?: import("jose").JWSHeaderParameters, token?: import("jose").FlattenedJWSInput): Promise<import("jose").CryptoKey>;
73
+ (protectedHeader?: _$jose.JWSHeaderParameters, token?: _$jose.FlattenedJWSInput): Promise<_$jose.CryptoKey>;
62
74
  coolingDown: boolean;
63
75
  fresh: boolean;
64
76
  reloading: boolean;
65
77
  reload: () => Promise<void>;
66
- jwks: () => import("jose").JSONWebKeySet | undefined;
78
+ jwks: () => _$jose.JSONWebKeySet | undefined;
67
79
  };
68
80
  issuer: string;
69
81
  audience: string | string[];
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/figma.d.ts
4
3
  interface FigmaProfile {
5
4
  id: string;
@@ -13,8 +12,16 @@ interface FigmaOptions extends ProviderOptions<FigmaProfile> {
13
12
  declare const figma: (options: FigmaOptions) => {
14
13
  id: "figma";
15
14
  name: string;
16
- accountSubject: ({ profile }: OAuthAccountKeyContext<FigmaProfile>) => string;
17
- createAuthorizationURL({ state, scopes, codeVerifier, redirectURI, additionalParams }: {
15
+ accountSubject: ({
16
+ profile
17
+ }: OAuthAccountKeyContext<FigmaProfile>) => string;
18
+ createAuthorizationURL({
19
+ state,
20
+ scopes,
21
+ codeVerifier,
22
+ redirectURI,
23
+ additionalParams
24
+ }: {
18
25
  state: string;
19
26
  codeVerifier: string;
20
27
  scopes?: string[] | undefined;
@@ -24,7 +31,11 @@ declare const figma: (options: FigmaOptions) => {
24
31
  idTokenNonce?: string | undefined;
25
32
  additionalParams?: Record<string, string> | undefined;
26
33
  }): Promise<URL>;
27
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
34
+ validateAuthorizationCode: ({
35
+ code,
36
+ codeVerifier,
37
+ redirectURI
38
+ }: {
28
39
  code: string;
29
40
  redirectURI: string;
30
41
  codeVerifier?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/github.d.ts
4
3
  interface GithubProfile {
5
4
  login: string;
@@ -53,8 +52,17 @@ interface GithubOptions extends ProviderOptions<GithubProfile> {
53
52
  declare const github: (options: GithubOptions) => {
54
53
  id: "github";
55
54
  name: string;
56
- accountSubject: ({ profile }: OAuthAccountKeyContext<GithubProfile>) => string;
57
- createAuthorizationURL({ state, scopes, loginHint, codeVerifier, redirectURI, additionalParams }: {
55
+ accountSubject: ({
56
+ profile
57
+ }: OAuthAccountKeyContext<GithubProfile>) => string;
58
+ createAuthorizationURL({
59
+ state,
60
+ scopes,
61
+ loginHint,
62
+ codeVerifier,
63
+ redirectURI,
64
+ additionalParams
65
+ }: {
58
66
  state: string;
59
67
  codeVerifier: string;
60
68
  scopes?: string[] | undefined;
@@ -64,7 +72,11 @@ declare const github: (options: GithubOptions) => {
64
72
  idTokenNonce?: string | undefined;
65
73
  additionalParams?: Record<string, string> | undefined;
66
74
  }): Promise<URL>;
67
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
75
+ validateAuthorizationCode: ({
76
+ code,
77
+ codeVerifier,
78
+ redirectURI
79
+ }: {
68
80
  code: string;
69
81
  redirectURI: string;
70
82
  codeVerifier?: string | undefined;
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/gitlab.d.ts
4
3
  interface GitlabProfile extends Record<string, any> {
5
4
  id: number;
@@ -53,8 +52,17 @@ interface GitlabOptions extends ProviderOptions<GitlabProfile> {
53
52
  declare const gitlab: (options: GitlabOptions) => {
54
53
  id: "gitlab";
55
54
  name: string;
56
- accountSubject: ({ profile }: OAuthAccountKeyContext<GitlabProfile>) => number;
57
- createAuthorizationURL: ({ state, scopes, codeVerifier, loginHint, redirectURI, additionalParams }: {
55
+ accountSubject: ({
56
+ profile
57
+ }: OAuthAccountKeyContext<GitlabProfile>) => number;
58
+ createAuthorizationURL: ({
59
+ state,
60
+ scopes,
61
+ codeVerifier,
62
+ loginHint,
63
+ redirectURI,
64
+ additionalParams
65
+ }: {
58
66
  state: string;
59
67
  codeVerifier: string;
60
68
  scopes?: string[] | undefined;
@@ -64,7 +72,11 @@ declare const gitlab: (options: GitlabOptions) => {
64
72
  idTokenNonce?: string | undefined;
65
73
  additionalParams?: Record<string, string> | undefined;
66
74
  }) => Promise<URL>;
67
- validateAuthorizationCode: ({ code, redirectURI, codeVerifier }: {
75
+ validateAuthorizationCode: ({
76
+ code,
77
+ redirectURI,
78
+ codeVerifier
79
+ }: {
68
80
  code: string;
69
81
  redirectURI: string;
70
82
  codeVerifier?: string | undefined;
@@ -1,6 +1,7 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
2
+ import * as _$jose from "jose";
3
3
  import { JWTPayload } from "jose";
4
+
4
5
  //#region src/social-providers/google.d.ts
5
6
  interface GoogleProfile {
6
7
  aud: string;
@@ -68,7 +69,11 @@ interface VerifyGoogleIdTokenOptions {
68
69
  * Verifies a Google ID token against Google's issuer, audience, signature,
69
70
  * expiry, and maximum token age.
70
71
  */
71
- declare const verifyGoogleIdToken: ({ token, audience, nonce }: VerifyGoogleIdTokenOptions) => Promise<JWTPayload | null>;
72
+ declare const verifyGoogleIdToken: ({
73
+ token,
74
+ audience,
75
+ nonce
76
+ }: VerifyGoogleIdTokenOptions) => Promise<JWTPayload | null>;
72
77
  /**
73
78
  * Checks whether Google's verified `hd` claim satisfies the configured hosted
74
79
  * domain restriction. `hd: "*"` accepts any Google Workspace hosted domain.
@@ -77,9 +82,19 @@ declare const isGoogleHostedDomainAllowed: (configuredHostedDomain: string | und
77
82
  declare const google: (options: GoogleOptions) => {
78
83
  id: "google";
79
84
  name: string;
80
- accountSubject: ({ profile }: OAuthAccountKeyContext<GoogleProfile>) => string;
85
+ accountSubject: ({
86
+ profile
87
+ }: OAuthAccountKeyContext<GoogleProfile>) => string;
81
88
  accountIssuer: string;
82
- createAuthorizationURL({ state, scopes, codeVerifier, redirectURI, loginHint, display, additionalParams }: {
89
+ createAuthorizationURL({
90
+ state,
91
+ scopes,
92
+ codeVerifier,
93
+ redirectURI,
94
+ loginHint,
95
+ display,
96
+ additionalParams
97
+ }: {
83
98
  state: string;
84
99
  codeVerifier: string;
85
100
  scopes?: string[] | undefined;
@@ -89,7 +104,11 @@ declare const google: (options: GoogleOptions) => {
89
104
  idTokenNonce?: string | undefined;
90
105
  additionalParams?: Record<string, string> | undefined;
91
106
  }): Promise<URL>;
92
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
107
+ validateAuthorizationCode: ({
108
+ code,
109
+ codeVerifier,
110
+ redirectURI
111
+ }: {
93
112
  code: string;
94
113
  redirectURI: string;
95
114
  codeVerifier?: string | undefined;
@@ -97,7 +116,7 @@ declare const google: (options: GoogleOptions) => {
97
116
  }) => Promise<OAuth2Tokens>;
98
117
  refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
99
118
  idToken: {
100
- jwks: (header: import("jose").JWTHeaderParameters) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
119
+ jwks: (header: _$jose.JWTHeaderParameters) => Promise<Uint8Array<ArrayBufferLike> | CryptoKey>;
101
120
  issuer: string[];
102
121
  audience: string | string[];
103
122
  maxTokenAge: string;
@@ -1,5 +1,4 @@
1
1
  import { OAuth2Tokens, OAuth2UserInfo, OAuthAccountKeyContext, ProviderOptions } from "../oauth2/oauth-provider.mjs";
2
- import "../oauth2/index.mjs";
3
2
  //#region src/social-providers/huggingface.d.ts
4
3
  interface HuggingFaceProfile {
5
4
  sub: string;
@@ -35,8 +34,16 @@ interface HuggingFaceOptions extends ProviderOptions<HuggingFaceProfile> {
35
34
  declare const huggingface: (options: HuggingFaceOptions) => {
36
35
  id: "huggingface";
37
36
  name: string;
38
- accountSubject: ({ profile }: OAuthAccountKeyContext<HuggingFaceProfile>) => string;
39
- createAuthorizationURL({ state, scopes, codeVerifier, redirectURI, additionalParams }: {
37
+ accountSubject: ({
38
+ profile
39
+ }: OAuthAccountKeyContext<HuggingFaceProfile>) => string;
40
+ createAuthorizationURL({
41
+ state,
42
+ scopes,
43
+ codeVerifier,
44
+ redirectURI,
45
+ additionalParams
46
+ }: {
40
47
  state: string;
41
48
  codeVerifier: string;
42
49
  scopes?: string[] | undefined;
@@ -46,7 +53,11 @@ declare const huggingface: (options: HuggingFaceOptions) => {
46
53
  idTokenNonce?: string | undefined;
47
54
  additionalParams?: Record<string, string> | undefined;
48
55
  }): Promise<URL>;
49
- validateAuthorizationCode: ({ code, codeVerifier, redirectURI }: {
56
+ validateAuthorizationCode: ({
57
+ code,
58
+ codeVerifier,
59
+ redirectURI
60
+ }: {
50
61
  code: string;
51
62
  redirectURI: string;
52
63
  codeVerifier?: string | undefined;