@convex-dev/better-auth 0.9.11 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-config.d.ts +43 -0
- package/dist/auth-config.d.ts.map +1 -0
- package/dist/auth-config.js +45 -0
- package/dist/auth-config.js.map +1 -0
- package/dist/auth-options.d.ts +3 -0
- package/dist/auth-options.d.ts.map +1 -0
- package/dist/auth-options.js +41 -0
- package/dist/auth-options.js.map +1 -0
- package/dist/auth.d.ts +1 -3
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +2 -42
- package/dist/auth.js.map +1 -1
- package/dist/client/{adapterUtils.d.ts → adapter-utils.d.ts} +15 -15
- package/dist/client/adapter-utils.d.ts.map +1 -0
- package/dist/client/{adapterUtils.js → adapter-utils.js} +1 -1
- package/dist/client/adapter-utils.js.map +1 -0
- package/dist/client/adapter.d.ts +1 -2
- package/dist/client/adapter.d.ts.map +1 -1
- package/dist/client/adapter.js +4 -4
- package/dist/client/adapter.js.map +1 -1
- package/dist/client/create-api.d.ts +139 -0
- package/dist/client/create-api.d.ts.map +1 -0
- package/dist/client/create-api.js +204 -0
- package/dist/client/create-api.js.map +1 -0
- package/dist/client/create-client.d.ts +183 -0
- package/dist/client/create-client.d.ts.map +1 -0
- package/dist/client/create-client.js +311 -0
- package/dist/client/create-client.js.map +1 -0
- package/dist/client/{createSchema.d.ts → create-schema.d.ts} +1 -1
- package/dist/client/create-schema.d.ts.map +1 -0
- package/dist/client/{createSchema.js → create-schema.js} +11 -5
- package/dist/client/create-schema.js.map +1 -0
- package/dist/client/index.d.ts +4 -279
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +6 -463
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +0 -3
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/adapter.d.ts +19 -21
- package/dist/component/adapter.d.ts.map +1 -1
- package/dist/component/adapter.js +2 -2
- package/dist/component/adapter.js.map +1 -1
- package/dist/component/schema.d.ts +50 -50
- package/dist/nextjs/client.d.ts +4 -0
- package/dist/nextjs/client.d.ts.map +1 -0
- package/dist/nextjs/client.js +37 -0
- package/dist/nextjs/client.js.map +1 -0
- package/dist/nextjs/index.d.ts +19 -7
- package/dist/nextjs/index.d.ts.map +1 -1
- package/dist/nextjs/index.js +90 -36
- package/dist/nextjs/index.js.map +1 -1
- package/dist/plugins/convex/client.d.ts +1 -1
- package/dist/plugins/convex/client.d.ts.map +1 -1
- package/dist/plugins/convex/client.js +0 -1
- package/dist/plugins/convex/client.js.map +1 -1
- package/dist/plugins/convex/index.d.ts +239 -227
- package/dist/plugins/convex/index.d.ts.map +1 -1
- package/dist/plugins/convex/index.js +191 -37
- package/dist/plugins/convex/index.js.map +1 -1
- package/dist/plugins/cross-domain/client.d.ts +3 -3
- package/dist/plugins/cross-domain/client.d.ts.map +1 -1
- package/dist/plugins/cross-domain/index.d.ts +15 -70
- package/dist/plugins/cross-domain/index.d.ts.map +1 -1
- package/dist/plugins/cross-domain/index.js +8 -0
- package/dist/plugins/cross-domain/index.js.map +1 -1
- package/dist/react/index.d.ts +52 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +133 -9
- package/dist/react/index.js.map +1 -1
- package/dist/react-start/index.d.ts +11 -41
- package/dist/react-start/index.d.ts.map +1 -1
- package/dist/react-start/index.js +82 -106
- package/dist/react-start/index.js.map +1 -1
- package/dist/utils/index.d.ts +20 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +54 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +19 -12
- package/src/auth-config.ts +82 -0
- package/src/auth-options.ts +54 -0
- package/src/auth.ts +3 -56
- package/src/client/adapter.ts +5 -5
- package/src/client/create-api.ts +337 -0
- package/src/client/create-client.ts +446 -0
- package/src/client/{createSchema.ts → create-schema.ts} +10 -4
- package/src/client/index.ts +22 -771
- package/src/component/_generated/component.ts +0 -7
- package/src/component/adapter.ts +2 -3
- package/src/nextjs/client.tsx +52 -0
- package/src/nextjs/index.ts +138 -45
- package/src/plugins/convex/client.ts +1 -1
- package/src/plugins/convex/index.ts +337 -51
- package/src/plugins/cross-domain/index.ts +10 -2
- package/src/react/index.tsx +195 -9
- package/src/react-start/index.ts +126 -171
- package/src/test.ts +1 -1
- package/src/utils/index.ts +96 -1
- package/dist/client/adapterUtils.d.ts.map +0 -1
- package/dist/client/adapterUtils.js.map +0 -1
- package/dist/client/createSchema.d.ts.map +0 -1
- package/dist/client/createSchema.js.map +0 -1
- /package/src/client/{adapterUtils.ts → adapter-utils.ts} +0 -0
|
@@ -1,39 +1,122 @@
|
|
|
1
|
+
import { type BetterAuthOptions, type Session, type User } from "better-auth";
|
|
2
|
+
import type { AuthConfig } from "convex/server";
|
|
1
3
|
export declare const JWT_COOKIE_NAME = "convex_jwt";
|
|
2
|
-
export declare const convex: (opts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export declare const convex: (opts: {
|
|
5
|
+
/**
|
|
6
|
+
* @param {AuthConfig} authConfig - Auth config from your Convex project.
|
|
7
|
+
*
|
|
8
|
+
* Typically found in `convex/auth.config.ts`.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* // convex/auth.config.ts
|
|
13
|
+
* export default {
|
|
14
|
+
* providers: [getAuthConfigProvider({ jwks: process.env.JWKS })],
|
|
15
|
+
* } satisfies AuthConfig;
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // convex/auth.ts
|
|
21
|
+
* import authConfig from './auth.config';
|
|
22
|
+
* export const createAuth = (ctx: GenericCtx<DataModel>) => {
|
|
23
|
+
* return betterAuth({
|
|
24
|
+
* // ...
|
|
25
|
+
* plugins: [convex({ authConfig })],
|
|
26
|
+
* });
|
|
27
|
+
* };
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
authConfig: AuthConfig;
|
|
31
|
+
/**
|
|
32
|
+
* @param {Object} jwt - JWT options.
|
|
33
|
+
* @param {number} jwt.expirationSeconds - JWT expiration seconds.
|
|
34
|
+
* @param {Function} jwt.definePayload - Function to define the JWT payload. `sessionId` and `iat` are added automatically.
|
|
35
|
+
*/
|
|
36
|
+
jwt?: {
|
|
37
|
+
expirationSeconds?: number;
|
|
38
|
+
definePayload?: (session: {
|
|
39
|
+
user: User & Record<string, any>;
|
|
40
|
+
session: Session & Record<string, any>;
|
|
41
|
+
}) => Promise<Record<string, any>> | Record<string, any> | undefined;
|
|
7
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use jwt.expirationSeconds instead.
|
|
45
|
+
*/
|
|
46
|
+
jwtExpirationSeconds?: number;
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} jwks - Optional static JWKS to avoid fetching from the database.
|
|
49
|
+
*
|
|
50
|
+
* This should be a stringified document from the Better Auth JWKS table. You
|
|
51
|
+
* can create one in the console.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* // convex/auth.ts
|
|
56
|
+
* export const rotateKeys = internalAction({
|
|
57
|
+
* args: {},
|
|
58
|
+
* handler: async (ctx) => {
|
|
59
|
+
* const auth = createAuth(ctx)
|
|
60
|
+
* return await auth.api.rotateKeys()
|
|
61
|
+
* },
|
|
62
|
+
* })
|
|
63
|
+
* ```
|
|
64
|
+
* Run the action and set the JWKS environment variable
|
|
65
|
+
*
|
|
66
|
+
* ```bash
|
|
67
|
+
* npx convex run auth:rotateKeys | npx convex env set JWKS
|
|
68
|
+
* ```
|
|
69
|
+
* Then use it in your auth config and Better Auth options:
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* // convex/auth.config.ts
|
|
73
|
+
* export default {
|
|
74
|
+
* providers: [getAuthConfigProvider({ jwks: process.env.JWKS })],
|
|
75
|
+
* } satisfies AuthConfig;
|
|
76
|
+
*
|
|
77
|
+
* // convex/auth.ts
|
|
78
|
+
* export const createAuth = (ctx: GenericCtx<DataModel>) => {
|
|
79
|
+
* return betterAuth({
|
|
80
|
+
* // ...
|
|
81
|
+
* plugins: [convex({ authConfig, jwks: process.env.JWKS })],
|
|
82
|
+
* });
|
|
83
|
+
* };
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
jwks?: string;
|
|
87
|
+
/**
|
|
88
|
+
* @param {boolean} jwksRotateOnTokenGenerationError - Whether to rotate the JWKS on token generation error.
|
|
89
|
+
*
|
|
90
|
+
* Does nothing if a static JWKS is provided.
|
|
91
|
+
*
|
|
92
|
+
* Handles error that occurs when existing JWKS key does not match configured
|
|
93
|
+
* algorithm, which will be common for 0.10 upgrades switching from EdDSA to RS256.
|
|
94
|
+
*
|
|
95
|
+
* @default true
|
|
96
|
+
*/
|
|
97
|
+
jwksRotateOnTokenGenerationError?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @param {BetterAuthOptions} options - Better Auth options. Not required,
|
|
100
|
+
* currently used to pass the basePath to the oidcProvider plugin.
|
|
101
|
+
*/
|
|
102
|
+
options?: BetterAuthOptions;
|
|
8
103
|
}) => {
|
|
9
104
|
id: "convex";
|
|
10
|
-
init: (
|
|
105
|
+
init: (ctx: import("better-auth").AuthContext<BetterAuthOptions>) => void;
|
|
11
106
|
hooks: {
|
|
12
107
|
before: ({
|
|
13
|
-
matcher(context: import("better-
|
|
14
|
-
context: import("better-auth").AuthContext & {
|
|
15
|
-
returned?: unknown;
|
|
16
|
-
responseHeaders?: Headers;
|
|
17
|
-
};
|
|
18
|
-
headers?: Headers;
|
|
19
|
-
}): boolean;
|
|
108
|
+
matcher(context: import("better-auth").HookEndpointContext): boolean;
|
|
20
109
|
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
21
110
|
context: {
|
|
22
111
|
headers: Headers;
|
|
23
112
|
};
|
|
24
113
|
} | undefined>;
|
|
25
114
|
} | {
|
|
26
|
-
matcher: (ctx: import("better-
|
|
27
|
-
context: import("better-auth").AuthContext & {
|
|
28
|
-
returned?: unknown;
|
|
29
|
-
responseHeaders?: Headers;
|
|
30
|
-
};
|
|
31
|
-
headers?: Headers;
|
|
32
|
-
}) => boolean;
|
|
115
|
+
matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
|
|
33
116
|
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
34
|
-
context: import("better-call").MiddlewareContext<import("better-call").MiddlewareOptions, import("better-auth").AuthContext<
|
|
35
|
-
returned?: unknown;
|
|
36
|
-
responseHeaders?: Headers;
|
|
117
|
+
context: import("better-call").MiddlewareContext<import("better-call").MiddlewareOptions, import("better-auth").AuthContext<BetterAuthOptions> & {
|
|
118
|
+
returned?: unknown | undefined;
|
|
119
|
+
responseHeaders?: Headers | undefined;
|
|
37
120
|
}>;
|
|
38
121
|
}>;
|
|
39
122
|
})[];
|
|
@@ -44,226 +127,152 @@ export declare const convex: (opts?: {
|
|
|
44
127
|
url: string;
|
|
45
128
|
} | undefined>;
|
|
46
129
|
} | {
|
|
47
|
-
matcher: (ctx: import("better-
|
|
48
|
-
context: import("better-auth").AuthContext & {
|
|
49
|
-
returned?: unknown;
|
|
50
|
-
responseHeaders?: Headers;
|
|
51
|
-
};
|
|
52
|
-
headers?: Headers;
|
|
53
|
-
}) => boolean;
|
|
130
|
+
matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
|
|
54
131
|
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>;
|
|
55
132
|
})[];
|
|
56
133
|
};
|
|
57
134
|
endpoints: {
|
|
58
|
-
getOpenIdConfig: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
method?: "GET" | undefined;
|
|
63
|
-
} & {
|
|
64
|
-
query?: Record<string, any> | undefined;
|
|
65
|
-
} & {
|
|
66
|
-
params?: Record<string, any>;
|
|
67
|
-
} & {
|
|
68
|
-
request?: Request;
|
|
69
|
-
} & {
|
|
70
|
-
headers?: HeadersInit;
|
|
71
|
-
} & {
|
|
72
|
-
asResponse?: boolean;
|
|
73
|
-
returnHeaders?: boolean;
|
|
74
|
-
use?: import("better-call").Middleware[];
|
|
75
|
-
path?: string;
|
|
76
|
-
} & {
|
|
77
|
-
asResponse?: AsResponse | undefined;
|
|
78
|
-
returnHeaders?: ReturnHeaders | undefined;
|
|
79
|
-
}) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
80
|
-
headers: Headers;
|
|
81
|
-
response: import("better-auth/plugins").OIDCMetadata;
|
|
82
|
-
} : import("better-auth/plugins").OIDCMetadata>;
|
|
83
|
-
options: {
|
|
84
|
-
method: "GET";
|
|
85
|
-
metadata: {
|
|
86
|
-
isAction: boolean;
|
|
87
|
-
};
|
|
88
|
-
} & {
|
|
89
|
-
use: any[];
|
|
135
|
+
getOpenIdConfig: import("better-call").StrictEndpoint<"/convex/.well-known/openid-configuration", {
|
|
136
|
+
method: "GET";
|
|
137
|
+
metadata: {
|
|
138
|
+
isAction: false;
|
|
90
139
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
use?: import("better-call").Middleware[];
|
|
110
|
-
path?: string;
|
|
111
|
-
} & {
|
|
112
|
-
asResponse?: AsResponse | undefined;
|
|
113
|
-
returnHeaders?: ReturnHeaders | undefined;
|
|
114
|
-
}) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
115
|
-
headers: Headers;
|
|
116
|
-
response: import("jose").JSONWebKeySet;
|
|
117
|
-
} : import("jose").JSONWebKeySet>;
|
|
118
|
-
options: {
|
|
119
|
-
method: "GET";
|
|
120
|
-
metadata: {
|
|
121
|
-
openapi: {
|
|
122
|
-
description: string;
|
|
123
|
-
responses: {
|
|
124
|
-
"200": {
|
|
125
|
-
description: string;
|
|
126
|
-
content: {
|
|
127
|
-
"application/json": {
|
|
128
|
-
schema: {
|
|
129
|
-
type: "object";
|
|
130
|
-
properties: {
|
|
131
|
-
keys: {
|
|
140
|
+
}, import("better-auth/plugins").OIDCMetadata>;
|
|
141
|
+
getJwks: import("better-call").StrictEndpoint<"/convex/jwks", {
|
|
142
|
+
method: "GET";
|
|
143
|
+
metadata: {
|
|
144
|
+
openapi: {
|
|
145
|
+
description: string;
|
|
146
|
+
responses: {
|
|
147
|
+
"200": {
|
|
148
|
+
description: string;
|
|
149
|
+
content: {
|
|
150
|
+
"application/json": {
|
|
151
|
+
schema: {
|
|
152
|
+
type: "object";
|
|
153
|
+
properties: {
|
|
154
|
+
keys: {
|
|
155
|
+
type: string;
|
|
156
|
+
description: string;
|
|
157
|
+
items: {
|
|
132
158
|
type: string;
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
type: string;
|
|
177
|
-
description: string;
|
|
178
|
-
nullable: boolean;
|
|
179
|
-
};
|
|
159
|
+
properties: {
|
|
160
|
+
kid: {
|
|
161
|
+
type: string;
|
|
162
|
+
description: string;
|
|
163
|
+
};
|
|
164
|
+
kty: {
|
|
165
|
+
type: string;
|
|
166
|
+
description: string;
|
|
167
|
+
};
|
|
168
|
+
alg: {
|
|
169
|
+
type: string;
|
|
170
|
+
description: string;
|
|
171
|
+
};
|
|
172
|
+
use: {
|
|
173
|
+
type: string;
|
|
174
|
+
description: string;
|
|
175
|
+
enum: string[];
|
|
176
|
+
nullable: boolean;
|
|
177
|
+
};
|
|
178
|
+
n: {
|
|
179
|
+
type: string;
|
|
180
|
+
description: string;
|
|
181
|
+
nullable: boolean;
|
|
182
|
+
};
|
|
183
|
+
e: {
|
|
184
|
+
type: string;
|
|
185
|
+
description: string;
|
|
186
|
+
nullable: boolean;
|
|
187
|
+
};
|
|
188
|
+
crv: {
|
|
189
|
+
type: string;
|
|
190
|
+
description: string;
|
|
191
|
+
nullable: boolean;
|
|
192
|
+
};
|
|
193
|
+
x: {
|
|
194
|
+
type: string;
|
|
195
|
+
description: string;
|
|
196
|
+
nullable: boolean;
|
|
197
|
+
};
|
|
198
|
+
y: {
|
|
199
|
+
type: string;
|
|
200
|
+
description: string;
|
|
201
|
+
nullable: boolean;
|
|
180
202
|
};
|
|
181
|
-
required: string[];
|
|
182
203
|
};
|
|
204
|
+
required: string[];
|
|
183
205
|
};
|
|
184
206
|
};
|
|
185
|
-
required: string[];
|
|
186
207
|
};
|
|
208
|
+
required: string[];
|
|
187
209
|
};
|
|
188
210
|
};
|
|
189
211
|
};
|
|
190
212
|
};
|
|
191
213
|
};
|
|
192
214
|
};
|
|
193
|
-
} & {
|
|
194
|
-
use: any[];
|
|
195
215
|
};
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
query?: Record<string, any> | undefined;
|
|
205
|
-
} & {
|
|
206
|
-
params?: Record<string, any>;
|
|
207
|
-
} & {
|
|
208
|
-
request?: Request;
|
|
209
|
-
} & {
|
|
210
|
-
headers: HeadersInit;
|
|
211
|
-
} & {
|
|
212
|
-
asResponse?: boolean;
|
|
213
|
-
returnHeaders?: boolean;
|
|
214
|
-
use?: import("better-call").Middleware[];
|
|
215
|
-
path?: string;
|
|
216
|
-
} & {
|
|
217
|
-
asResponse?: AsResponse | undefined;
|
|
218
|
-
returnHeaders?: ReturnHeaders | undefined;
|
|
219
|
-
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
|
|
220
|
-
headers: Headers;
|
|
221
|
-
response: {
|
|
222
|
-
token: string;
|
|
216
|
+
}, import("jose").JSONWebKeySet>;
|
|
217
|
+
getLatestJwks: import("better-call").StrictEndpoint<string, {
|
|
218
|
+
isAction: boolean;
|
|
219
|
+
method: "POST";
|
|
220
|
+
metadata: {
|
|
221
|
+
SERVER_ONLY: true;
|
|
222
|
+
openapi: {
|
|
223
|
+
description: string;
|
|
223
224
|
};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
};
|
|
225
|
+
};
|
|
226
|
+
}, any[]>;
|
|
227
|
+
rotateKeys: import("better-call").StrictEndpoint<string, {
|
|
228
|
+
isAction: boolean;
|
|
229
|
+
method: "POST";
|
|
230
|
+
metadata: {
|
|
231
|
+
SERVER_ONLY: true;
|
|
232
|
+
openapi: {
|
|
233
|
+
description: string;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
}, any[]>;
|
|
237
|
+
getToken: import("better-call").StrictEndpoint<"/convex/token", {
|
|
238
|
+
method: "GET";
|
|
239
|
+
requireHeaders: true;
|
|
240
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
241
|
+
session: {
|
|
242
|
+
session: Record<string, any> & {
|
|
243
|
+
id: string;
|
|
244
|
+
createdAt: Date;
|
|
245
|
+
updatedAt: Date;
|
|
246
|
+
userId: string;
|
|
247
|
+
expiresAt: Date;
|
|
248
|
+
token: string;
|
|
249
|
+
ipAddress?: string | null | undefined;
|
|
250
|
+
userAgent?: string | null | undefined;
|
|
251
251
|
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
252
|
+
user: Record<string, any> & {
|
|
253
|
+
id: string;
|
|
254
|
+
createdAt: Date;
|
|
255
|
+
updatedAt: Date;
|
|
256
|
+
email: string;
|
|
257
|
+
emailVerified: boolean;
|
|
258
|
+
name: string;
|
|
259
|
+
image?: string | null | undefined;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
}>)[];
|
|
263
|
+
metadata: {
|
|
264
|
+
openapi: {
|
|
265
|
+
description: string;
|
|
266
|
+
responses: {
|
|
267
|
+
200: {
|
|
268
|
+
description: string;
|
|
269
|
+
content: {
|
|
270
|
+
"application/json": {
|
|
271
|
+
schema: {
|
|
272
|
+
type: "object";
|
|
273
|
+
properties: {
|
|
274
|
+
token: {
|
|
275
|
+
type: string;
|
|
267
276
|
};
|
|
268
277
|
};
|
|
269
278
|
};
|
|
@@ -272,11 +281,10 @@ export declare const convex: (opts?: {
|
|
|
272
281
|
};
|
|
273
282
|
};
|
|
274
283
|
};
|
|
275
|
-
} & {
|
|
276
|
-
use: any[];
|
|
277
284
|
};
|
|
278
|
-
|
|
279
|
-
|
|
285
|
+
}, {
|
|
286
|
+
token: string;
|
|
287
|
+
}>;
|
|
280
288
|
};
|
|
281
289
|
schema: {
|
|
282
290
|
jwks: {
|
|
@@ -293,6 +301,10 @@ export declare const convex: (opts?: {
|
|
|
293
301
|
type: "date";
|
|
294
302
|
required: true;
|
|
295
303
|
};
|
|
304
|
+
expiresAt: {
|
|
305
|
+
type: "date";
|
|
306
|
+
required: false;
|
|
307
|
+
};
|
|
296
308
|
};
|
|
297
309
|
};
|
|
298
310
|
user: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/convex/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/convex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,OAAO,EACZ,KAAK,IAAI,EACV,MAAM,aAAa,CAAC;AAWrB,OAAO,KAAK,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAE9D,eAAO,MAAM,eAAe,eAAe,CAAC;AA6C5C,eAAO,MAAM,MAAM,GAAI,MAAM;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;;;OAIG;IACH,GAAG,CAAC,EAAE;QACJ,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;YACxB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACjC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;SACxC,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;KACtE,CAAC;IACF;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;OASG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA1FE,CADG;iCACc,CAAC;;;;;;;;;6BASb,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAigBR,CAAC"}
|