@samebase/identity-broker 0.0.0-stage → 0.2.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 (82) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +104 -2
  4. package/dist/cli/index.d.ts +2 -0
  5. package/dist/cli/index.js +39 -0
  6. package/dist/cli/index.js.map +1 -0
  7. package/dist/client/connectors/email.d.ts +6 -0
  8. package/dist/client/connectors/email.js +5 -0
  9. package/dist/client/connectors/email.js.map +1 -0
  10. package/dist/client/connectors/github.d.ts +7 -0
  11. package/dist/client/connectors/github.js +57 -0
  12. package/dist/client/connectors/github.js.map +1 -0
  13. package/dist/client/connectors/google.d.ts +7 -0
  14. package/dist/client/connectors/google.js +13 -0
  15. package/dist/client/connectors/google.js.map +1 -0
  16. package/dist/client/connectors/types.d.ts +47 -0
  17. package/dist/client/connectors/types.js +2 -0
  18. package/dist/client/connectors/types.js.map +1 -0
  19. package/dist/client/connectors/upstream.d.ts +25 -0
  20. package/dist/client/connectors/upstream.js +86 -0
  21. package/dist/client/connectors/upstream.js.map +1 -0
  22. package/dist/client/html.d.ts +34 -0
  23. package/dist/client/html.js +91 -0
  24. package/dist/client/html.js.map +1 -0
  25. package/dist/client/index.d.ts +93 -0
  26. package/dist/client/index.js +819 -0
  27. package/dist/client/index.js.map +1 -0
  28. package/dist/client/jwt.d.ts +31 -0
  29. package/dist/client/jwt.js +55 -0
  30. package/dist/client/jwt.js.map +1 -0
  31. package/dist/client/keys.d.ts +49 -0
  32. package/dist/client/keys.js +138 -0
  33. package/dist/client/keys.js.map +1 -0
  34. package/dist/client/protocol.d.ts +79 -0
  35. package/dist/client/protocol.js +279 -0
  36. package/dist/client/protocol.js.map +1 -0
  37. package/dist/client/responses.d.ts +24 -0
  38. package/dist/client/responses.js +57 -0
  39. package/dist/client/responses.js.map +1 -0
  40. package/dist/client/subject.d.ts +15 -0
  41. package/dist/client/subject.js +32 -0
  42. package/dist/client/subject.js.map +1 -0
  43. package/dist/component/_generated/api.d.ts +45 -0
  44. package/dist/component/_generated/api.js +31 -0
  45. package/dist/component/_generated/api.js.map +1 -0
  46. package/dist/component/_generated/component.d.ts +398 -0
  47. package/dist/component/_generated/component.js +11 -0
  48. package/dist/component/_generated/component.js.map +1 -0
  49. package/dist/component/_generated/dataModel.d.ts +45 -0
  50. package/dist/component/_generated/dataModel.js +11 -0
  51. package/dist/component/_generated/dataModel.js.map +1 -0
  52. package/dist/component/_generated/server.d.ts +132 -0
  53. package/dist/component/_generated/server.js +80 -0
  54. package/dist/component/_generated/server.js.map +1 -0
  55. package/dist/component/apps.d.ts +36 -0
  56. package/dist/component/apps.js +124 -0
  57. package/dist/component/apps.js.map +1 -0
  58. package/dist/component/authRequests.d.ts +274 -0
  59. package/dist/component/authRequests.js +461 -0
  60. package/dist/component/authRequests.js.map +1 -0
  61. package/dist/component/clients.d.ts +43 -0
  62. package/dist/component/clients.js +95 -0
  63. package/dist/component/clients.js.map +1 -0
  64. package/dist/component/convex.config.d.ts +2 -0
  65. package/dist/component/convex.config.js +3 -0
  66. package/dist/component/convex.config.js.map +1 -0
  67. package/dist/component/crypto.d.ts +2 -0
  68. package/dist/component/crypto.js +9 -0
  69. package/dist/component/crypto.js.map +1 -0
  70. package/dist/component/lifecycle.d.ts +18 -0
  71. package/dist/component/lifecycle.js +79 -0
  72. package/dist/component/lifecycle.js.map +1 -0
  73. package/dist/component/registration.d.ts +29 -0
  74. package/dist/component/registration.js +90 -0
  75. package/dist/component/registration.js.map +1 -0
  76. package/dist/component/schema.d.ts +749 -0
  77. package/dist/component/schema.js +140 -0
  78. package/dist/component/schema.js.map +1 -0
  79. package/dist/component/signIns.d.ts +8 -0
  80. package/dist/component/signIns.js +26 -0
  81. package/dist/component/signIns.js.map +1 -0
  82. package/package.json +51 -3
@@ -0,0 +1,749 @@
1
+ /** How a client authenticates at the token endpoint. Public clients are not supported yet. */
2
+ export declare const vTokenEndpointAuthMethod: import("convex/values").VUnion<"client_secret_basic" | "client_secret_post", [import("convex/values").VLiteral<"client_secret_post", "required">, import("convex/values").VLiteral<"client_secret_basic", "required">], "required", never>;
3
+ /** The deployment a client stands for. Preview clients are pruned; the others are deleted by hand. */
4
+ export declare const vDeploymentType: import("convex/values").VUnion<"development" | "preview" | "production", [import("convex/values").VLiteral<"production", "required">, import("convex/values").VLiteral<"development", "required">, import("convex/values").VLiteral<"preview", "required">], "required", never>;
5
+ /**
6
+ * What a connector attested about the user. `upstreamId` is the connector's own stable id for the
7
+ * account (the GitHub user id, the OIDC `sub`, the canonical email address). The pairwise subject
8
+ * is derived from it on the host, where the salt lives.
9
+ */
10
+ export declare const vUpstreamIdentity: import("convex/values").VObject<{
11
+ connector: string;
12
+ email?: string;
13
+ emailVerified?: boolean;
14
+ name?: string;
15
+ picture?: string;
16
+ upstreamId: string;
17
+ }, {
18
+ connector: import("convex/values").VString<string, "required">;
19
+ upstreamId: import("convex/values").VString<string, "required">;
20
+ email: import("convex/values").VString<string | undefined, "optional">;
21
+ emailVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
22
+ name: import("convex/values").VString<string | undefined, "optional">;
23
+ picture: import("convex/values").VString<string | undefined, "optional">;
24
+ }, "required", "connector" | "email" | "emailVerified" | "name" | "picture" | "upstreamId">;
25
+ export declare const vAuthRequest: import("convex/values").VUnion<{
26
+ appId: string;
27
+ clientId: string;
28
+ codeChallenge: string;
29
+ createdAt: number;
30
+ expiresAt: number;
31
+ freshLogin: boolean;
32
+ nonce?: string;
33
+ redirectUri: string;
34
+ requestId: string;
35
+ scope: string;
36
+ state?: string;
37
+ status: "pending";
38
+ txnCookieHash?: string;
39
+ } | {
40
+ appId: string;
41
+ clientId: string;
42
+ codeChallenge: string;
43
+ connector: string;
44
+ createdAt: number;
45
+ expiresAt: number;
46
+ freshLogin: boolean;
47
+ nonce?: string;
48
+ redirectUri: string;
49
+ requestId: string;
50
+ scope: string;
51
+ state?: string;
52
+ status: "upstream";
53
+ txnCookieHash?: string;
54
+ upstreamCodeVerifier: string;
55
+ upstreamNonce?: string;
56
+ upstreamStateHash: string;
57
+ } | {
58
+ appId: string;
59
+ clientId: string;
60
+ codeChallenge: string;
61
+ connector: string;
62
+ createdAt: number;
63
+ expiresAt: number;
64
+ freshLogin: boolean;
65
+ nonce?: string;
66
+ redirectUri: string;
67
+ requestId: string;
68
+ scope: string;
69
+ state?: string;
70
+ status: "claimed";
71
+ txnCookieHash?: string;
72
+ } | {
73
+ appId: string;
74
+ clientId: string;
75
+ codeChallenge: string;
76
+ connector: string;
77
+ createdAt: number;
78
+ email: string;
79
+ emailAttempts: number;
80
+ emailCodeExpiresAt: number;
81
+ emailCodeHash: string;
82
+ emailLastSentAt: number;
83
+ emailSends: number;
84
+ expiresAt: number;
85
+ freshLogin: boolean;
86
+ nonce?: string;
87
+ redirectUri: string;
88
+ requestId: string;
89
+ scope: string;
90
+ state?: string;
91
+ status: "emailSent";
92
+ txnCookieHash?: string;
93
+ } | {
94
+ appId: string;
95
+ authTime: number;
96
+ clientId: string;
97
+ codeChallenge: string;
98
+ createdAt: number;
99
+ expiresAt: number;
100
+ freshLogin: boolean;
101
+ identity: {
102
+ connector: string;
103
+ email?: string;
104
+ emailVerified?: boolean;
105
+ name?: string;
106
+ picture?: string;
107
+ upstreamId: string;
108
+ };
109
+ nonce?: string;
110
+ redirectUri: string;
111
+ requestId: string;
112
+ scope: string;
113
+ state?: string;
114
+ status: "completed";
115
+ txnCookieHash?: string;
116
+ }, [import("convex/values").VObject<{
117
+ appId: string;
118
+ clientId: string;
119
+ codeChallenge: string;
120
+ createdAt: number;
121
+ expiresAt: number;
122
+ freshLogin: boolean;
123
+ nonce?: string;
124
+ redirectUri: string;
125
+ requestId: string;
126
+ scope: string;
127
+ state?: string;
128
+ status: "pending";
129
+ txnCookieHash?: string;
130
+ }, {
131
+ requestId: import("convex/values").VString<string, "required">;
132
+ appId: import("convex/values").VString<string, "required">;
133
+ clientId: import("convex/values").VString<string, "required">;
134
+ redirectUri: import("convex/values").VString<string, "required">;
135
+ scope: import("convex/values").VString<string, "required">;
136
+ state: import("convex/values").VString<string | undefined, "optional">;
137
+ nonce: import("convex/values").VString<string | undefined, "optional">;
138
+ codeChallenge: import("convex/values").VString<string, "required">;
139
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
140
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
141
+ /**
142
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
143
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
144
+ */
145
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
146
+ createdAt: import("convex/values").VFloat64<number, "required">;
147
+ expiresAt: import("convex/values").VFloat64<number, "required">;
148
+ status: import("convex/values").VLiteral<"pending", "required">;
149
+ }, "required", "appId" | "clientId" | "codeChallenge" | "createdAt" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">, import("convex/values").VObject<{
150
+ appId: string;
151
+ clientId: string;
152
+ codeChallenge: string;
153
+ connector: string;
154
+ createdAt: number;
155
+ expiresAt: number;
156
+ freshLogin: boolean;
157
+ nonce?: string;
158
+ redirectUri: string;
159
+ requestId: string;
160
+ scope: string;
161
+ state?: string;
162
+ status: "upstream";
163
+ txnCookieHash?: string;
164
+ upstreamCodeVerifier: string;
165
+ upstreamNonce?: string;
166
+ upstreamStateHash: string;
167
+ }, {
168
+ requestId: import("convex/values").VString<string, "required">;
169
+ appId: import("convex/values").VString<string, "required">;
170
+ clientId: import("convex/values").VString<string, "required">;
171
+ redirectUri: import("convex/values").VString<string, "required">;
172
+ scope: import("convex/values").VString<string, "required">;
173
+ state: import("convex/values").VString<string | undefined, "optional">;
174
+ nonce: import("convex/values").VString<string | undefined, "optional">;
175
+ codeChallenge: import("convex/values").VString<string, "required">;
176
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
177
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
178
+ /**
179
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
180
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
181
+ */
182
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
183
+ createdAt: import("convex/values").VFloat64<number, "required">;
184
+ expiresAt: import("convex/values").VFloat64<number, "required">;
185
+ status: import("convex/values").VLiteral<"upstream", "required">;
186
+ connector: import("convex/values").VString<string, "required">;
187
+ upstreamStateHash: import("convex/values").VString<string, "required">;
188
+ upstreamCodeVerifier: import("convex/values").VString<string, "required">;
189
+ upstreamNonce: import("convex/values").VString<string | undefined, "optional">;
190
+ }, "required", "appId" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash" | "upstreamCodeVerifier" | "upstreamNonce" | "upstreamStateHash">, import("convex/values").VObject<{
191
+ appId: string;
192
+ clientId: string;
193
+ codeChallenge: string;
194
+ connector: string;
195
+ createdAt: number;
196
+ expiresAt: number;
197
+ freshLogin: boolean;
198
+ nonce?: string;
199
+ redirectUri: string;
200
+ requestId: string;
201
+ scope: string;
202
+ state?: string;
203
+ status: "claimed";
204
+ txnCookieHash?: string;
205
+ }, {
206
+ requestId: import("convex/values").VString<string, "required">;
207
+ appId: import("convex/values").VString<string, "required">;
208
+ clientId: import("convex/values").VString<string, "required">;
209
+ redirectUri: import("convex/values").VString<string, "required">;
210
+ scope: import("convex/values").VString<string, "required">;
211
+ state: import("convex/values").VString<string | undefined, "optional">;
212
+ nonce: import("convex/values").VString<string | undefined, "optional">;
213
+ codeChallenge: import("convex/values").VString<string, "required">;
214
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
215
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
216
+ /**
217
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
218
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
219
+ */
220
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
221
+ createdAt: import("convex/values").VFloat64<number, "required">;
222
+ expiresAt: import("convex/values").VFloat64<number, "required">;
223
+ status: import("convex/values").VLiteral<"claimed", "required">;
224
+ connector: import("convex/values").VString<string, "required">;
225
+ }, "required", "appId" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">, import("convex/values").VObject<{
226
+ appId: string;
227
+ clientId: string;
228
+ codeChallenge: string;
229
+ connector: string;
230
+ createdAt: number;
231
+ email: string;
232
+ emailAttempts: number;
233
+ emailCodeExpiresAt: number;
234
+ emailCodeHash: string;
235
+ emailLastSentAt: number;
236
+ emailSends: number;
237
+ expiresAt: number;
238
+ freshLogin: boolean;
239
+ nonce?: string;
240
+ redirectUri: string;
241
+ requestId: string;
242
+ scope: string;
243
+ state?: string;
244
+ status: "emailSent";
245
+ txnCookieHash?: string;
246
+ }, {
247
+ requestId: import("convex/values").VString<string, "required">;
248
+ appId: import("convex/values").VString<string, "required">;
249
+ clientId: import("convex/values").VString<string, "required">;
250
+ redirectUri: import("convex/values").VString<string, "required">;
251
+ scope: import("convex/values").VString<string, "required">;
252
+ state: import("convex/values").VString<string | undefined, "optional">;
253
+ nonce: import("convex/values").VString<string | undefined, "optional">;
254
+ codeChallenge: import("convex/values").VString<string, "required">;
255
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
256
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
257
+ /**
258
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
259
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
260
+ */
261
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
262
+ createdAt: import("convex/values").VFloat64<number, "required">;
263
+ expiresAt: import("convex/values").VFloat64<number, "required">;
264
+ status: import("convex/values").VLiteral<"emailSent", "required">;
265
+ connector: import("convex/values").VString<string, "required">;
266
+ email: import("convex/values").VString<string, "required">;
267
+ emailCodeHash: import("convex/values").VString<string, "required">;
268
+ emailCodeExpiresAt: import("convex/values").VFloat64<number, "required">;
269
+ /** Wrong codes typed, across every code sent for this request. */
270
+ emailAttempts: import("convex/values").VFloat64<number, "required">;
271
+ /** Codes sent for this request. */
272
+ emailSends: import("convex/values").VFloat64<number, "required">;
273
+ emailLastSentAt: import("convex/values").VFloat64<number, "required">;
274
+ }, "required", "appId" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "email" | "emailAttempts" | "emailCodeExpiresAt" | "emailCodeHash" | "emailLastSentAt" | "emailSends" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">, import("convex/values").VObject<{
275
+ appId: string;
276
+ authTime: number;
277
+ clientId: string;
278
+ codeChallenge: string;
279
+ createdAt: number;
280
+ expiresAt: number;
281
+ freshLogin: boolean;
282
+ identity: {
283
+ connector: string;
284
+ email?: string;
285
+ emailVerified?: boolean;
286
+ name?: string;
287
+ picture?: string;
288
+ upstreamId: string;
289
+ };
290
+ nonce?: string;
291
+ redirectUri: string;
292
+ requestId: string;
293
+ scope: string;
294
+ state?: string;
295
+ status: "completed";
296
+ txnCookieHash?: string;
297
+ }, {
298
+ requestId: import("convex/values").VString<string, "required">;
299
+ appId: import("convex/values").VString<string, "required">;
300
+ clientId: import("convex/values").VString<string, "required">;
301
+ redirectUri: import("convex/values").VString<string, "required">;
302
+ scope: import("convex/values").VString<string, "required">;
303
+ state: import("convex/values").VString<string | undefined, "optional">;
304
+ nonce: import("convex/values").VString<string | undefined, "optional">;
305
+ codeChallenge: import("convex/values").VString<string, "required">;
306
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
307
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
308
+ /**
309
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
310
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
311
+ */
312
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
313
+ createdAt: import("convex/values").VFloat64<number, "required">;
314
+ expiresAt: import("convex/values").VFloat64<number, "required">;
315
+ status: import("convex/values").VLiteral<"completed", "required">;
316
+ identity: import("convex/values").VObject<{
317
+ connector: string;
318
+ email?: string;
319
+ emailVerified?: boolean;
320
+ name?: string;
321
+ picture?: string;
322
+ upstreamId: string;
323
+ }, {
324
+ connector: import("convex/values").VString<string, "required">;
325
+ upstreamId: import("convex/values").VString<string, "required">;
326
+ email: import("convex/values").VString<string | undefined, "optional">;
327
+ emailVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
328
+ name: import("convex/values").VString<string | undefined, "optional">;
329
+ picture: import("convex/values").VString<string | undefined, "optional">;
330
+ }, "required", "connector" | "email" | "emailVerified" | "name" | "picture" | "upstreamId">;
331
+ authTime: import("convex/values").VFloat64<number, "required">;
332
+ }, "required", "appId" | "authTime" | "clientId" | "codeChallenge" | "createdAt" | "expiresAt" | "freshLogin" | "identity" | "identity.connector" | "identity.email" | "identity.emailVerified" | "identity.name" | "identity.picture" | "identity.upstreamId" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">], "required", "appId" | "authTime" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "email" | "emailAttempts" | "emailCodeExpiresAt" | "emailCodeHash" | "emailLastSentAt" | "emailSends" | "expiresAt" | "freshLogin" | "identity" | "identity.connector" | "identity.email" | "identity.emailVerified" | "identity.name" | "identity.picture" | "identity.upstreamId" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash" | "upstreamCodeVerifier" | "upstreamNonce" | "upstreamStateHash">;
333
+ declare const _default: import("convex/server").SchemaDefinition<{
334
+ apps: import("convex/server").TableDefinition<import("convex/values").VObject<{
335
+ allowedCallbackHosts: string[];
336
+ appId: string;
337
+ createdAt: number;
338
+ firstParty: boolean;
339
+ name: string;
340
+ }, {
341
+ appId: import("convex/values").VString<string, "required">;
342
+ name: import("convex/values").VString<string, "required">;
343
+ firstParty: import("convex/values").VBoolean<boolean, "required">;
344
+ /** Exact hosts or `*.suffix` patterns a client callback may use, e.g. `*.convex.site`. */
345
+ allowedCallbackHosts: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
346
+ createdAt: import("convex/values").VFloat64<number, "required">;
347
+ }, "required", "allowedCallbackHosts" | "appId" | "createdAt" | "firstParty" | "name">, {
348
+ by_app_id: ["appId", "_creationTime"];
349
+ }, {}, {}>;
350
+ registrationTokens: import("convex/server").TableDefinition<import("convex/values").VObject<{
351
+ appId: string;
352
+ createdAt: number;
353
+ expiresAt: number;
354
+ tokenHash: string;
355
+ }, {
356
+ tokenHash: import("convex/values").VString<string, "required">;
357
+ appId: import("convex/values").VString<string, "required">;
358
+ expiresAt: import("convex/values").VFloat64<number, "required">;
359
+ createdAt: import("convex/values").VFloat64<number, "required">;
360
+ }, "required", "appId" | "createdAt" | "expiresAt" | "tokenHash">, {
361
+ by_app_id: ["appId", "_creationTime"];
362
+ by_expires_at: ["expiresAt", "_creationTime"];
363
+ by_token_hash: ["tokenHash", "_creationTime"];
364
+ }, {}, {}>;
365
+ clients: import("convex/server").TableDefinition<import("convex/values").VObject<{
366
+ appId: string;
367
+ clientId: string;
368
+ clientName: string;
369
+ createdAt: number;
370
+ deploymentType: "development" | "preview" | "production";
371
+ lastSignInAt?: number;
372
+ redirectUri: string;
373
+ secretHash: string;
374
+ softwareVersion: string;
375
+ tokenEndpointAuthMethod: "client_secret_basic" | "client_secret_post";
376
+ }, {
377
+ clientId: import("convex/values").VString<string, "required">;
378
+ appId: import("convex/values").VString<string, "required">;
379
+ secretHash: import("convex/values").VString<string, "required">;
380
+ tokenEndpointAuthMethod: import("convex/values").VUnion<"client_secret_basic" | "client_secret_post", [import("convex/values").VLiteral<"client_secret_post", "required">, import("convex/values").VLiteral<"client_secret_basic", "required">], "required", never>;
381
+ redirectUri: import("convex/values").VString<string, "required">;
382
+ deploymentType: import("convex/values").VUnion<"development" | "preview" | "production", [import("convex/values").VLiteral<"production", "required">, import("convex/values").VLiteral<"development", "required">, import("convex/values").VLiteral<"preview", "required">], "required", never>;
383
+ clientName: import("convex/values").VString<string, "required">;
384
+ softwareVersion: import("convex/values").VString<string, "required">;
385
+ createdAt: import("convex/values").VFloat64<number, "required">;
386
+ lastSignInAt: import("convex/values").VFloat64<number | undefined, "optional">;
387
+ }, "required", "appId" | "clientId" | "clientName" | "createdAt" | "deploymentType" | "lastSignInAt" | "redirectUri" | "secretHash" | "softwareVersion" | "tokenEndpointAuthMethod">, {
388
+ by_app_id: ["appId", "_creationTime"];
389
+ by_client_id: ["clientId", "_creationTime"];
390
+ by_deployment_type: ["deploymentType", "_creationTime"];
391
+ }, {}, {}>;
392
+ authRequests: import("convex/server").TableDefinition<import("convex/values").VUnion<{
393
+ appId: string;
394
+ clientId: string;
395
+ codeChallenge: string;
396
+ createdAt: number;
397
+ expiresAt: number;
398
+ freshLogin: boolean;
399
+ nonce?: string;
400
+ redirectUri: string;
401
+ requestId: string;
402
+ scope: string;
403
+ state?: string;
404
+ status: "pending";
405
+ txnCookieHash?: string;
406
+ } | {
407
+ appId: string;
408
+ clientId: string;
409
+ codeChallenge: string;
410
+ connector: string;
411
+ createdAt: number;
412
+ expiresAt: number;
413
+ freshLogin: boolean;
414
+ nonce?: string;
415
+ redirectUri: string;
416
+ requestId: string;
417
+ scope: string;
418
+ state?: string;
419
+ status: "upstream";
420
+ txnCookieHash?: string;
421
+ upstreamCodeVerifier: string;
422
+ upstreamNonce?: string;
423
+ upstreamStateHash: string;
424
+ } | {
425
+ appId: string;
426
+ clientId: string;
427
+ codeChallenge: string;
428
+ connector: string;
429
+ createdAt: number;
430
+ expiresAt: number;
431
+ freshLogin: boolean;
432
+ nonce?: string;
433
+ redirectUri: string;
434
+ requestId: string;
435
+ scope: string;
436
+ state?: string;
437
+ status: "claimed";
438
+ txnCookieHash?: string;
439
+ } | {
440
+ appId: string;
441
+ clientId: string;
442
+ codeChallenge: string;
443
+ connector: string;
444
+ createdAt: number;
445
+ email: string;
446
+ emailAttempts: number;
447
+ emailCodeExpiresAt: number;
448
+ emailCodeHash: string;
449
+ emailLastSentAt: number;
450
+ emailSends: number;
451
+ expiresAt: number;
452
+ freshLogin: boolean;
453
+ nonce?: string;
454
+ redirectUri: string;
455
+ requestId: string;
456
+ scope: string;
457
+ state?: string;
458
+ status: "emailSent";
459
+ txnCookieHash?: string;
460
+ } | {
461
+ appId: string;
462
+ authTime: number;
463
+ clientId: string;
464
+ codeChallenge: string;
465
+ createdAt: number;
466
+ expiresAt: number;
467
+ freshLogin: boolean;
468
+ identity: {
469
+ connector: string;
470
+ email?: string;
471
+ emailVerified?: boolean;
472
+ name?: string;
473
+ picture?: string;
474
+ upstreamId: string;
475
+ };
476
+ nonce?: string;
477
+ redirectUri: string;
478
+ requestId: string;
479
+ scope: string;
480
+ state?: string;
481
+ status: "completed";
482
+ txnCookieHash?: string;
483
+ }, [import("convex/values").VObject<{
484
+ appId: string;
485
+ clientId: string;
486
+ codeChallenge: string;
487
+ createdAt: number;
488
+ expiresAt: number;
489
+ freshLogin: boolean;
490
+ nonce?: string;
491
+ redirectUri: string;
492
+ requestId: string;
493
+ scope: string;
494
+ state?: string;
495
+ status: "pending";
496
+ txnCookieHash?: string;
497
+ }, {
498
+ requestId: import("convex/values").VString<string, "required">;
499
+ appId: import("convex/values").VString<string, "required">;
500
+ clientId: import("convex/values").VString<string, "required">;
501
+ redirectUri: import("convex/values").VString<string, "required">;
502
+ scope: import("convex/values").VString<string, "required">;
503
+ state: import("convex/values").VString<string | undefined, "optional">;
504
+ nonce: import("convex/values").VString<string | undefined, "optional">;
505
+ codeChallenge: import("convex/values").VString<string, "required">;
506
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
507
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
508
+ /**
509
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
510
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
511
+ */
512
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
513
+ createdAt: import("convex/values").VFloat64<number, "required">;
514
+ expiresAt: import("convex/values").VFloat64<number, "required">;
515
+ status: import("convex/values").VLiteral<"pending", "required">;
516
+ }, "required", "appId" | "clientId" | "codeChallenge" | "createdAt" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">, import("convex/values").VObject<{
517
+ appId: string;
518
+ clientId: string;
519
+ codeChallenge: string;
520
+ connector: string;
521
+ createdAt: number;
522
+ expiresAt: number;
523
+ freshLogin: boolean;
524
+ nonce?: string;
525
+ redirectUri: string;
526
+ requestId: string;
527
+ scope: string;
528
+ state?: string;
529
+ status: "upstream";
530
+ txnCookieHash?: string;
531
+ upstreamCodeVerifier: string;
532
+ upstreamNonce?: string;
533
+ upstreamStateHash: string;
534
+ }, {
535
+ requestId: import("convex/values").VString<string, "required">;
536
+ appId: import("convex/values").VString<string, "required">;
537
+ clientId: import("convex/values").VString<string, "required">;
538
+ redirectUri: import("convex/values").VString<string, "required">;
539
+ scope: import("convex/values").VString<string, "required">;
540
+ state: import("convex/values").VString<string | undefined, "optional">;
541
+ nonce: import("convex/values").VString<string | undefined, "optional">;
542
+ codeChallenge: import("convex/values").VString<string, "required">;
543
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
544
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
545
+ /**
546
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
547
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
548
+ */
549
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
550
+ createdAt: import("convex/values").VFloat64<number, "required">;
551
+ expiresAt: import("convex/values").VFloat64<number, "required">;
552
+ status: import("convex/values").VLiteral<"upstream", "required">;
553
+ connector: import("convex/values").VString<string, "required">;
554
+ upstreamStateHash: import("convex/values").VString<string, "required">;
555
+ upstreamCodeVerifier: import("convex/values").VString<string, "required">;
556
+ upstreamNonce: import("convex/values").VString<string | undefined, "optional">;
557
+ }, "required", "appId" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash" | "upstreamCodeVerifier" | "upstreamNonce" | "upstreamStateHash">, import("convex/values").VObject<{
558
+ appId: string;
559
+ clientId: string;
560
+ codeChallenge: string;
561
+ connector: string;
562
+ createdAt: number;
563
+ expiresAt: number;
564
+ freshLogin: boolean;
565
+ nonce?: string;
566
+ redirectUri: string;
567
+ requestId: string;
568
+ scope: string;
569
+ state?: string;
570
+ status: "claimed";
571
+ txnCookieHash?: string;
572
+ }, {
573
+ requestId: import("convex/values").VString<string, "required">;
574
+ appId: import("convex/values").VString<string, "required">;
575
+ clientId: import("convex/values").VString<string, "required">;
576
+ redirectUri: import("convex/values").VString<string, "required">;
577
+ scope: import("convex/values").VString<string, "required">;
578
+ state: import("convex/values").VString<string | undefined, "optional">;
579
+ nonce: import("convex/values").VString<string | undefined, "optional">;
580
+ codeChallenge: import("convex/values").VString<string, "required">;
581
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
582
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
583
+ /**
584
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
585
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
586
+ */
587
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
588
+ createdAt: import("convex/values").VFloat64<number, "required">;
589
+ expiresAt: import("convex/values").VFloat64<number, "required">;
590
+ status: import("convex/values").VLiteral<"claimed", "required">;
591
+ connector: import("convex/values").VString<string, "required">;
592
+ }, "required", "appId" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">, import("convex/values").VObject<{
593
+ appId: string;
594
+ clientId: string;
595
+ codeChallenge: string;
596
+ connector: string;
597
+ createdAt: number;
598
+ email: string;
599
+ emailAttempts: number;
600
+ emailCodeExpiresAt: number;
601
+ emailCodeHash: string;
602
+ emailLastSentAt: number;
603
+ emailSends: number;
604
+ expiresAt: number;
605
+ freshLogin: boolean;
606
+ nonce?: string;
607
+ redirectUri: string;
608
+ requestId: string;
609
+ scope: string;
610
+ state?: string;
611
+ status: "emailSent";
612
+ txnCookieHash?: string;
613
+ }, {
614
+ requestId: import("convex/values").VString<string, "required">;
615
+ appId: import("convex/values").VString<string, "required">;
616
+ clientId: import("convex/values").VString<string, "required">;
617
+ redirectUri: import("convex/values").VString<string, "required">;
618
+ scope: import("convex/values").VString<string, "required">;
619
+ state: import("convex/values").VString<string | undefined, "optional">;
620
+ nonce: import("convex/values").VString<string | undefined, "optional">;
621
+ codeChallenge: import("convex/values").VString<string, "required">;
622
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
623
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
624
+ /**
625
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
626
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
627
+ */
628
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
629
+ createdAt: import("convex/values").VFloat64<number, "required">;
630
+ expiresAt: import("convex/values").VFloat64<number, "required">;
631
+ status: import("convex/values").VLiteral<"emailSent", "required">;
632
+ connector: import("convex/values").VString<string, "required">;
633
+ email: import("convex/values").VString<string, "required">;
634
+ emailCodeHash: import("convex/values").VString<string, "required">;
635
+ emailCodeExpiresAt: import("convex/values").VFloat64<number, "required">;
636
+ /** Wrong codes typed, across every code sent for this request. */
637
+ emailAttempts: import("convex/values").VFloat64<number, "required">;
638
+ /** Codes sent for this request. */
639
+ emailSends: import("convex/values").VFloat64<number, "required">;
640
+ emailLastSentAt: import("convex/values").VFloat64<number, "required">;
641
+ }, "required", "appId" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "email" | "emailAttempts" | "emailCodeExpiresAt" | "emailCodeHash" | "emailLastSentAt" | "emailSends" | "expiresAt" | "freshLogin" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">, import("convex/values").VObject<{
642
+ appId: string;
643
+ authTime: number;
644
+ clientId: string;
645
+ codeChallenge: string;
646
+ createdAt: number;
647
+ expiresAt: number;
648
+ freshLogin: boolean;
649
+ identity: {
650
+ connector: string;
651
+ email?: string;
652
+ emailVerified?: boolean;
653
+ name?: string;
654
+ picture?: string;
655
+ upstreamId: string;
656
+ };
657
+ nonce?: string;
658
+ redirectUri: string;
659
+ requestId: string;
660
+ scope: string;
661
+ state?: string;
662
+ status: "completed";
663
+ txnCookieHash?: string;
664
+ }, {
665
+ requestId: import("convex/values").VString<string, "required">;
666
+ appId: import("convex/values").VString<string, "required">;
667
+ clientId: import("convex/values").VString<string, "required">;
668
+ redirectUri: import("convex/values").VString<string, "required">;
669
+ scope: import("convex/values").VString<string, "required">;
670
+ state: import("convex/values").VString<string | undefined, "optional">;
671
+ nonce: import("convex/values").VString<string | undefined, "optional">;
672
+ codeChallenge: import("convex/values").VString<string, "required">;
673
+ /** `prompt=login` or `max_age` was sent: the connector must reauthenticate or refuse. */
674
+ freshLogin: import("convex/values").VBoolean<boolean, "required">;
675
+ /**
676
+ * SHA-256 hex of the `broker_txn` cookie set with the chooser page: `/continue` needs the cookie,
677
+ * so only the browser that saw the chooser can continue. Absent when /authorize skipped the chooser.
678
+ */
679
+ txnCookieHash: import("convex/values").VString<string | undefined, "optional">;
680
+ createdAt: import("convex/values").VFloat64<number, "required">;
681
+ expiresAt: import("convex/values").VFloat64<number, "required">;
682
+ status: import("convex/values").VLiteral<"completed", "required">;
683
+ identity: import("convex/values").VObject<{
684
+ connector: string;
685
+ email?: string;
686
+ emailVerified?: boolean;
687
+ name?: string;
688
+ picture?: string;
689
+ upstreamId: string;
690
+ }, {
691
+ connector: import("convex/values").VString<string, "required">;
692
+ upstreamId: import("convex/values").VString<string, "required">;
693
+ email: import("convex/values").VString<string | undefined, "optional">;
694
+ emailVerified: import("convex/values").VBoolean<boolean | undefined, "optional">;
695
+ name: import("convex/values").VString<string | undefined, "optional">;
696
+ picture: import("convex/values").VString<string | undefined, "optional">;
697
+ }, "required", "connector" | "email" | "emailVerified" | "name" | "picture" | "upstreamId">;
698
+ authTime: import("convex/values").VFloat64<number, "required">;
699
+ }, "required", "appId" | "authTime" | "clientId" | "codeChallenge" | "createdAt" | "expiresAt" | "freshLogin" | "identity" | "identity.connector" | "identity.email" | "identity.emailVerified" | "identity.name" | "identity.picture" | "identity.upstreamId" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash">], "required", "appId" | "authTime" | "clientId" | "codeChallenge" | "connector" | "createdAt" | "email" | "emailAttempts" | "emailCodeExpiresAt" | "emailCodeHash" | "emailLastSentAt" | "emailSends" | "expiresAt" | "freshLogin" | "identity" | "identity.connector" | "identity.email" | "identity.emailVerified" | "identity.name" | "identity.picture" | "identity.upstreamId" | "nonce" | "redirectUri" | "requestId" | "scope" | "state" | "status" | "txnCookieHash" | "upstreamCodeVerifier" | "upstreamNonce" | "upstreamStateHash">, {
700
+ by_expires_at: ["expiresAt", "_creationTime"];
701
+ by_request_id: ["requestId", "_creationTime"];
702
+ by_upstream_state_hash: ["upstreamStateHash", "_creationTime"];
703
+ }, {}, {}>;
704
+ authorizationCodes: import("convex/server").TableDefinition<import("convex/values").VObject<{
705
+ authRequestId: import("convex/values").GenericId<"authRequests">;
706
+ clientId: string;
707
+ codeHash: string;
708
+ expiresAt: number;
709
+ usedAt?: number;
710
+ }, {
711
+ codeHash: import("convex/values").VString<string, "required">;
712
+ authRequestId: import("convex/values").VId<import("convex/values").GenericId<"authRequests">, "required">;
713
+ clientId: import("convex/values").VString<string, "required">;
714
+ expiresAt: import("convex/values").VFloat64<number, "required">;
715
+ usedAt: import("convex/values").VFloat64<number | undefined, "optional">;
716
+ }, "required", "authRequestId" | "clientId" | "codeHash" | "expiresAt" | "usedAt">, {
717
+ by_code_hash: ["codeHash", "_creationTime"];
718
+ by_expires_at: ["expiresAt", "_creationTime"];
719
+ }, {}, {}>;
720
+ /** One row per email code sent, kept for the rolling send window; no address, only its hash. */
721
+ emailSends: import("convex/server").TableDefinition<import("convex/values").VObject<{
722
+ at: number;
723
+ emailHash: string;
724
+ }, {
725
+ /** SHA-256 hex of the canonical address. */
726
+ emailHash: import("convex/values").VString<string, "required">;
727
+ at: import("convex/values").VFloat64<number, "required">;
728
+ }, "required", "at" | "emailHash">, {
729
+ by_at: ["at", "_creationTime"];
730
+ by_email_hash_and_at: ["emailHash", "at", "_creationTime"];
731
+ }, {}, {}>;
732
+ signIns: import("convex/server").TableDefinition<import("convex/values").VObject<{
733
+ appId: string;
734
+ at: number;
735
+ clientId: string;
736
+ connector: string;
737
+ sub: string;
738
+ }, {
739
+ appId: import("convex/values").VString<string, "required">;
740
+ clientId: import("convex/values").VString<string, "required">;
741
+ connector: import("convex/values").VString<string, "required">;
742
+ sub: import("convex/values").VString<string, "required">;
743
+ at: import("convex/values").VFloat64<number, "required">;
744
+ }, "required", "appId" | "at" | "clientId" | "connector" | "sub">, {
745
+ by_app_id_and_at: ["appId", "at", "_creationTime"];
746
+ by_at: ["at", "_creationTime"];
747
+ }, {}, {}>;
748
+ }, true>;
749
+ export default _default;