faire-auth 1.0.2 → 1.0.4

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 (76) hide show
  1. package/dist/adapters/drizzle-adapter/index.d.cts +1 -1
  2. package/dist/adapters/drizzle-adapter/index.d.mts +1 -1
  3. package/dist/adapters/index.d.cts +1 -1
  4. package/dist/adapters/index.d.mts +1 -1
  5. package/dist/adapters/kysely-adapter/index.d.cts +1 -1
  6. package/dist/adapters/kysely-adapter/index.d.mts +1 -1
  7. package/dist/adapters/memory-adapter/index.d.cts +3 -3
  8. package/dist/adapters/memory-adapter/index.d.mts +3 -3
  9. package/dist/adapters/mongodb-adapter/index.d.cts +1 -1
  10. package/dist/adapters/mongodb-adapter/index.d.mts +1 -1
  11. package/dist/adapters/prisma-adapter/index.d.cts +1 -1
  12. package/dist/adapters/prisma-adapter/index.d.mts +1 -1
  13. package/dist/adapters/test.d.cts +1 -1
  14. package/dist/adapters/test.d.mts +1 -1
  15. package/dist/api/index.d.cts +1 -1
  16. package/dist/api/index.d.mts +1 -1
  17. package/dist/api/middleware/index.d.cts +3 -3
  18. package/dist/api/middleware/index.d.mts +3 -3
  19. package/dist/client/index.d.cts +1 -1
  20. package/dist/client/index.d.mts +1 -1
  21. package/dist/client/lynx/index.d.cts +9 -9
  22. package/dist/client/lynx/index.d.mts +26 -26
  23. package/dist/client/plugins/index.d.cts +1 -1
  24. package/dist/client/plugins/index.d.mts +1 -1
  25. package/dist/client/react/index.d.cts +26 -26
  26. package/dist/client/react/index.d.mts +26 -26
  27. package/dist/client/solid/index.d.cts +6 -6
  28. package/dist/client/solid/index.d.mts +6 -6
  29. package/dist/client/svelte/index.d.cts +26 -26
  30. package/dist/client/svelte/index.d.mts +26 -26
  31. package/dist/client/vue/index.d.cts +24 -24
  32. package/dist/client/vue/index.d.mts +27 -27
  33. package/dist/crypto/index.d.cts +2 -2
  34. package/dist/db/index.d.cts +1 -1
  35. package/dist/db/index.d.mts +1 -1
  36. package/dist/{index-Dfgobqa-.d.mts → index--DLiUhEn.d.mts} +6 -6
  37. package/dist/{index-C0b8eC8h.d.mts → index-B4bqEDYG.d.mts} +15 -15
  38. package/dist/index-Boa0SV4h.d.cts +13350 -0
  39. package/dist/index-Bykgiq3o.d.cts +13350 -0
  40. package/dist/{index-Bw8dyZTc.d.cts → index-ClFGA8tb.d.mts} +2 -2
  41. package/dist/{index-4PEF72Mq.d.cts → index-ClOM0wFf.d.cts} +20 -20
  42. package/dist/{index-CrmLTEj8.d.mts → index-CsxNfGAV.d.mts} +624 -624
  43. package/dist/index-DKnO_Zfm.d.cts +992 -0
  44. package/dist/index-DRYO4mGd.d.cts +33 -0
  45. package/dist/index-Dsua4U8w.d.cts +33 -0
  46. package/dist/{index-BCzB3uDD.d.cts → index-DxXFCG2_.d.mts} +354 -354
  47. package/dist/index-gtCVvDvC.d.mts +992 -0
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.cts +1 -1
  50. package/dist/index.d.mts +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/integrations/next-js.d.cts +3 -3
  53. package/dist/integrations/next-js.d.mts +1 -1
  54. package/dist/integrations/node.d.cts +1 -1
  55. package/dist/integrations/node.d.mts +1 -1
  56. package/dist/integrations/react-start.d.cts +5 -5
  57. package/dist/integrations/react-start.d.mts +1 -1
  58. package/dist/integrations/svelte-kit.d.cts +5 -5
  59. package/dist/integrations/svelte-kit.d.mts +5 -5
  60. package/dist/oauth2/index.d.cts +1 -1
  61. package/dist/oauth2/index.d.mts +1 -1
  62. package/dist/plugins/bearer/index.d.cts +2 -2
  63. package/dist/plugins/bearer/index.d.mts +2 -2
  64. package/dist/plugins/index.d.cts +267 -267
  65. package/dist/plugins/index.d.mts +267 -267
  66. package/dist/plugins/passkey/index.d.cts +2 -2
  67. package/dist/plugins/passkey/index.d.mts +2 -2
  68. package/dist/test-utils/index.cjs +1 -1
  69. package/dist/test-utils/index.d.cts +993 -993
  70. package/dist/test-utils/index.d.mts +997 -997
  71. package/dist/test-utils/index.mjs +1 -1
  72. package/dist/types/index.d.cts +1 -1
  73. package/dist/types/index.d.mts +1 -1
  74. package/dist/utils/cookies.d.cts +1 -1
  75. package/dist/utils/cookies.d.mts +1 -1
  76. package/package.json +2 -2
@@ -0,0 +1,992 @@
1
+ import { tn as AuthEndpoint, vt as InferOptionSchema } from "./index-CsxNfGAV.mjs";
2
+ import { t as ContextVars } from "./hono-D0VqxVy1.mjs";
3
+ import * as hono55 from "hono";
4
+ import * as z$1 from "zod";
5
+ import * as _faire_auth_core_db7 from "@faire-auth/core/db";
6
+ import { AuthenticationResponseJSON, CredentialDeviceType } from "@simplewebauthn/server";
7
+ import * as _faire_auth_core_types43 from "@faire-auth/core/types";
8
+
9
+ //#region src/plugins/passkey/index.d.ts
10
+ interface PasskeyOptions {
11
+ /**
12
+ * A unique identifier for your website. 'localhost' is okay for
13
+ * local dev
14
+ *
15
+ * @default "localhost"
16
+ */
17
+ rpID?: string;
18
+ /**
19
+ * Human-readable title for your website
20
+ *
21
+ * @default "Better Auth"
22
+ */
23
+ rpName?: string;
24
+ /**
25
+ * The URL at which registrations and authentications should occur.
26
+ * `http://localhost` and `http://localhost:PORT` are also valid.
27
+ * Do NOT include any trailing /
28
+ *
29
+ * if this isn't provided. The client itself will
30
+ * pass this value.
31
+ */
32
+ origin?: string | null;
33
+ /**
34
+ * Allow customization of the authenticatorSelection options
35
+ * during passkey registration.
36
+ */
37
+ authenticatorSelection?: AuthenticatorSelectionCriteria;
38
+ /**
39
+ * Advanced options
40
+ */
41
+ advanced?: {
42
+ webAuthnChallengeCookie?: string;
43
+ };
44
+ /**
45
+ * Schema for the passkey model
46
+ */
47
+ schema?: InferOptionSchema<typeof schema>;
48
+ }
49
+ type Passkey = {
50
+ id: string;
51
+ name?: string;
52
+ publicKey: string;
53
+ userId: string;
54
+ credentialID: string;
55
+ counter: number;
56
+ deviceType: CredentialDeviceType;
57
+ backedUp: boolean;
58
+ transports?: string;
59
+ createdAt: Date;
60
+ aaguid?: string;
61
+ };
62
+ declare const passkey: (options?: PasskeyOptions) => {
63
+ id: "passkey";
64
+ routes: {
65
+ generatePasskeyRegistrationOptions: AuthEndpoint<{
66
+ responses: {
67
+ 200: {
68
+ description: string;
69
+ content: {
70
+ "application/json": {
71
+ schema: z$1.ZodPipe<z$1.ZodObject<{
72
+ challenge: z$1.ZodBase64URL;
73
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
74
+ rp: z$1.ZodObject<{
75
+ name: z$1.ZodString;
76
+ id: z$1.ZodOptional<z$1.ZodString>;
77
+ }, z$1.core.$strip>;
78
+ user: z$1.ZodObject<{
79
+ id: z$1.ZodString;
80
+ name: z$1.ZodString;
81
+ displayName: z$1.ZodString;
82
+ }, z$1.core.$strip>;
83
+ pubKeyCredParams: z$1.ZodArray<z$1.ZodObject<{
84
+ type: z$1.ZodString;
85
+ alg: z$1.ZodNumber;
86
+ }, z$1.core.$strip>>;
87
+ excludeCredentials: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
88
+ id: z$1.ZodString;
89
+ type: z$1.ZodString;
90
+ transports: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
91
+ ble: "ble";
92
+ cable: "cable";
93
+ hybrid: "hybrid";
94
+ internal: "internal";
95
+ nfc: "nfc";
96
+ "smart-card": "smart-card";
97
+ usb: "usb";
98
+ }>>>;
99
+ }, z$1.core.$strip>>>;
100
+ authenticatorSelection: z$1.ZodOptional<z$1.ZodObject<{
101
+ authenticatorAttachment: z$1.ZodOptional<z$1.ZodString>;
102
+ requireResidentKey: z$1.ZodOptional<z$1.ZodBoolean>;
103
+ userVerification: z$1.ZodOptional<z$1.ZodString>;
104
+ }, z$1.core.$strip>>;
105
+ attestation: z$1.ZodString;
106
+ extensions: z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>;
107
+ }, z$1.core.$strip>, z$1.ZodTransform<{
108
+ success: true;
109
+ data: {
110
+ challenge: string;
111
+ rp: {
112
+ name: string;
113
+ id?: string | undefined;
114
+ };
115
+ user: {
116
+ id: string;
117
+ name: string;
118
+ displayName: string;
119
+ };
120
+ pubKeyCredParams: {
121
+ type: string;
122
+ alg: number;
123
+ }[];
124
+ attestation: string;
125
+ extensions: Record<string, any>;
126
+ timeout?: number | undefined;
127
+ excludeCredentials?: {
128
+ id: string;
129
+ type: string;
130
+ transports?: ("ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb")[] | undefined;
131
+ }[] | undefined;
132
+ authenticatorSelection?: {
133
+ authenticatorAttachment?: string | undefined;
134
+ requireResidentKey?: boolean | undefined;
135
+ userVerification?: string | undefined;
136
+ } | undefined;
137
+ };
138
+ }, {
139
+ challenge: string;
140
+ rp: {
141
+ name: string;
142
+ id?: string | undefined;
143
+ };
144
+ user: {
145
+ id: string;
146
+ name: string;
147
+ displayName: string;
148
+ };
149
+ pubKeyCredParams: {
150
+ type: string;
151
+ alg: number;
152
+ }[];
153
+ attestation: string;
154
+ extensions: Record<string, any>;
155
+ timeout?: number | undefined;
156
+ excludeCredentials?: {
157
+ id: string;
158
+ type: string;
159
+ transports?: ("ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb")[] | undefined;
160
+ }[] | undefined;
161
+ authenticatorSelection?: {
162
+ authenticatorAttachment?: string | undefined;
163
+ requireResidentKey?: boolean | undefined;
164
+ userVerification?: string | undefined;
165
+ } | undefined;
166
+ }>>;
167
+ };
168
+ };
169
+ };
170
+ } & {
171
+ 401: {
172
+ description: string;
173
+ content: {
174
+ "application/json": {
175
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
176
+ success: z$1.ZodLiteral<false>;
177
+ code: z$1.ZodOptional<z$1.ZodString>;
178
+ message: z$1.ZodOptional<z$1.ZodString>;
179
+ }, z$1.core.$strip>, "error">;
180
+ };
181
+ };
182
+ };
183
+ };
184
+ operationId: "generatePasskeyRegistrationOptions";
185
+ path: "/passkey/generate-register-options";
186
+ method: "get";
187
+ client: false;
188
+ middleware: [(ctx: hono55.Context<ContextVars<{
189
+ session: {
190
+ session: _faire_auth_core_db7.Session;
191
+ user: _faire_auth_core_db7.User;
192
+ };
193
+ }>, string, {}>, next: hono55.Next) => Promise<void | (Response & hono55.TypedResponse<{
194
+ success: false;
195
+ code?: string | undefined;
196
+ message?: string | undefined;
197
+ }, 401>) | _faire_auth_core_types43.JSONRespondReturn<{
198
+ success: false;
199
+ code?: string | undefined;
200
+ message?: string | undefined;
201
+ }, 403>>];
202
+ request: {
203
+ query: z$1.ZodObject<{
204
+ authenticatorAttachment: z$1.ZodOptional<z$1.ZodEnum<{
205
+ platform: "platform";
206
+ "cross-platform": "cross-platform";
207
+ }>>;
208
+ name: z$1.ZodOptional<z$1.ZodString>;
209
+ }, z$1.core.$strip>;
210
+ };
211
+ getRoutingPath: () => "/passkey/generate-register-options";
212
+ }>;
213
+ generatePasskeyAuthenticationOptions: AuthEndpoint<{
214
+ responses: {
215
+ 200: {
216
+ description: string;
217
+ content: {
218
+ "application/json": {
219
+ schema: z$1.ZodPipe<z$1.ZodObject<{
220
+ challenge: z$1.ZodBase64URL;
221
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
222
+ rpId: z$1.ZodOptional<z$1.ZodString>;
223
+ allowCredentials: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
224
+ id: z$1.ZodString;
225
+ type: z$1.ZodString;
226
+ transports: z$1.ZodOptional<z$1.ZodArray<z$1.ZodEnum<{
227
+ ble: "ble";
228
+ cable: "cable";
229
+ hybrid: "hybrid";
230
+ internal: "internal";
231
+ nfc: "nfc";
232
+ "smart-card": "smart-card";
233
+ usb: "usb";
234
+ }>>>;
235
+ }, z$1.core.$strip>>>;
236
+ userVerification: z$1.ZodOptional<z$1.ZodEnum<{
237
+ required: "required";
238
+ discouraged: "discouraged";
239
+ preferred: "preferred";
240
+ }>>;
241
+ extensions: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
242
+ }, z$1.core.$strip>, z$1.ZodTransform<{
243
+ success: true;
244
+ data: {
245
+ challenge: string;
246
+ timeout?: number | undefined;
247
+ rpId?: string | undefined;
248
+ allowCredentials?: {
249
+ id: string;
250
+ type: string;
251
+ transports?: ("ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb")[] | undefined;
252
+ }[] | undefined;
253
+ userVerification?: "required" | "discouraged" | "preferred" | undefined;
254
+ extensions?: Record<string, any> | undefined;
255
+ };
256
+ }, {
257
+ challenge: string;
258
+ timeout?: number | undefined;
259
+ rpId?: string | undefined;
260
+ allowCredentials?: {
261
+ id: string;
262
+ type: string;
263
+ transports?: ("ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb")[] | undefined;
264
+ }[] | undefined;
265
+ userVerification?: "required" | "discouraged" | "preferred" | undefined;
266
+ extensions?: Record<string, any> | undefined;
267
+ }>>;
268
+ };
269
+ };
270
+ };
271
+ };
272
+ operationId: "generatePasskeyAuthenticationOptions";
273
+ path: "/passkey/generate-authenticate-options";
274
+ method: "post";
275
+ request: {
276
+ body: {
277
+ description?: string;
278
+ content: {
279
+ "application/json": {
280
+ schema: z$1.ZodObject<{
281
+ email: z$1.ZodOptional<z$1.ZodEmail>;
282
+ }, z$1.core.$strip>;
283
+ };
284
+ };
285
+ required: true;
286
+ };
287
+ };
288
+ getRoutingPath: () => "/passkey/generate-authenticate-options";
289
+ }>;
290
+ verifyPasskeyRegistration: AuthEndpoint<{
291
+ responses: {
292
+ 200: {
293
+ description: string;
294
+ content: {
295
+ "application/json": {
296
+ schema: z$1.ZodPipe<z$1.ZodObject<{
297
+ id: z$1.ZodString;
298
+ name: z$1.ZodOptional<z$1.ZodString>;
299
+ publicKey: z$1.ZodString;
300
+ userId: z$1.ZodString;
301
+ credentialID: z$1.ZodString;
302
+ counter: z$1.ZodNumber;
303
+ deviceType: z$1.ZodEnum<{
304
+ singleDevice: "singleDevice";
305
+ multiDevice: "multiDevice";
306
+ }>;
307
+ backedUp: z$1.ZodBoolean;
308
+ transports: z$1.ZodOptional<z$1.ZodString>;
309
+ createdAt: z$1.ZodUnion<[z$1.ZodDate, z$1.ZodISODateTime]>;
310
+ aaguid: z$1.ZodOptional<z$1.ZodString>;
311
+ }, z$1.core.$strip>, z$1.ZodTransform<{
312
+ success: true;
313
+ data: {
314
+ id: string;
315
+ publicKey: string;
316
+ userId: string;
317
+ credentialID: string;
318
+ counter: number;
319
+ deviceType: "singleDevice" | "multiDevice";
320
+ backedUp: boolean;
321
+ createdAt: string | Date;
322
+ name?: string | undefined;
323
+ transports?: string | undefined;
324
+ aaguid?: string | undefined;
325
+ };
326
+ }, {
327
+ id: string;
328
+ publicKey: string;
329
+ userId: string;
330
+ credentialID: string;
331
+ counter: number;
332
+ deviceType: "singleDevice" | "multiDevice";
333
+ backedUp: boolean;
334
+ createdAt: string | Date;
335
+ name?: string | undefined;
336
+ transports?: string | undefined;
337
+ aaguid?: string | undefined;
338
+ }>>;
339
+ };
340
+ };
341
+ };
342
+ } & {
343
+ 400: {
344
+ description: string;
345
+ content: {
346
+ "application/json": {
347
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
348
+ success: z$1.ZodLiteral<false>;
349
+ code: z$1.ZodOptional<z$1.ZodString>;
350
+ message: z$1.ZodOptional<z$1.ZodString>;
351
+ }, z$1.core.$strip>, "error">;
352
+ };
353
+ };
354
+ };
355
+ } & {
356
+ 401: {
357
+ description: string;
358
+ content: {
359
+ "application/json": {
360
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
361
+ success: z$1.ZodLiteral<false>;
362
+ code: z$1.ZodOptional<z$1.ZodString>;
363
+ message: z$1.ZodOptional<z$1.ZodString>;
364
+ }, z$1.core.$strip>, "error">;
365
+ };
366
+ };
367
+ };
368
+ } & {
369
+ 500: {
370
+ description: string;
371
+ content: {
372
+ "application/json": {
373
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
374
+ success: z$1.ZodLiteral<false>;
375
+ code: z$1.ZodOptional<z$1.ZodString>;
376
+ message: z$1.ZodOptional<z$1.ZodString>;
377
+ }, z$1.core.$strip>, "error">;
378
+ };
379
+ };
380
+ };
381
+ };
382
+ operationId: "verifyPasskeyRegistration";
383
+ path: "/passkey/verify-registration";
384
+ method: "post";
385
+ middleware: [(ctx: hono55.Context<ContextVars<{
386
+ session: {
387
+ session: _faire_auth_core_db7.Session;
388
+ user: _faire_auth_core_db7.User;
389
+ };
390
+ }>, string, {}>, next: hono55.Next) => Promise<void | (Response & hono55.TypedResponse<{
391
+ success: false;
392
+ code?: string | undefined;
393
+ message?: string | undefined;
394
+ }, 401>) | _faire_auth_core_types43.JSONRespondReturn<{
395
+ success: false;
396
+ code?: string | undefined;
397
+ message?: string | undefined;
398
+ }, 403>>];
399
+ request: {
400
+ body: {
401
+ description?: string;
402
+ content: {
403
+ "application/json": {
404
+ schema: z$1.ZodObject<{
405
+ response: z$1.ZodAny;
406
+ name: z$1.ZodOptional<z$1.ZodString>;
407
+ }, z$1.core.$strip>;
408
+ };
409
+ };
410
+ required: true;
411
+ };
412
+ };
413
+ getRoutingPath: () => "/passkey/verify-registration";
414
+ }>;
415
+ verifyPasskeyAuthentication: AuthEndpoint<{
416
+ responses: {
417
+ 200: {
418
+ description: string;
419
+ content: {
420
+ "application/json": {
421
+ schema: z$1.core.$ZodBranded<z$1.ZodPipe<z$1.core.$ZodBranded<z$1.ZodObject<{
422
+ createdAt: z$1.ZodDefault<z$1.ZodPipe<z$1.ZodUnion<[z$1.ZodDate, z$1.ZodISODateTime]>, z$1.ZodTransform<Date, string | Date>>>;
423
+ updatedAt: z$1.ZodDefault<z$1.ZodPipe<z$1.ZodUnion<[z$1.ZodDate, z$1.ZodISODateTime]>, z$1.ZodTransform<Date, string | Date>>>;
424
+ id: z$1.ZodOptional<z$1.ZodString>;
425
+ userId: z$1.ZodPipe<z$1.ZodUnion<[z$1.ZodString, z$1.ZodNumber]>, z$1.ZodTransform<string, string | number>>;
426
+ expiresAt: z$1.ZodPipe<z$1.ZodUnion<[z$1.ZodDate, z$1.ZodISODateTime]>, z$1.ZodTransform<Date, string | Date>>;
427
+ token: z$1.ZodString;
428
+ ipAddress: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
429
+ userAgent: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
430
+ }, z$1.core.$loose>, "session">, z$1.ZodTransform<{
431
+ success: true;
432
+ data: {
433
+ [x: string]: unknown;
434
+ createdAt: Date;
435
+ updatedAt: Date;
436
+ userId: string;
437
+ expiresAt: Date;
438
+ token: string;
439
+ id?: string | undefined;
440
+ ipAddress?: string | null | undefined;
441
+ userAgent?: string | null | undefined;
442
+ } & z$1.core.$brand<"session">;
443
+ }, {
444
+ [x: string]: unknown;
445
+ createdAt: Date;
446
+ updatedAt: Date;
447
+ userId: string;
448
+ expiresAt: Date;
449
+ token: string;
450
+ id?: string | undefined;
451
+ ipAddress?: string | null | undefined;
452
+ userAgent?: string | null | undefined;
453
+ } & z$1.core.$brand<"session">>>, "sessionResponse">;
454
+ };
455
+ };
456
+ };
457
+ } & {
458
+ 400: {
459
+ description: string;
460
+ content: {
461
+ "application/json": {
462
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
463
+ success: z$1.ZodLiteral<false>;
464
+ code: z$1.ZodOptional<z$1.ZodString>;
465
+ message: z$1.ZodOptional<z$1.ZodString>;
466
+ }, z$1.core.$strip>, "error">;
467
+ };
468
+ };
469
+ };
470
+ } & {
471
+ 401: {
472
+ description: string;
473
+ content: {
474
+ "application/json": {
475
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
476
+ success: z$1.ZodLiteral<false>;
477
+ code: z$1.ZodOptional<z$1.ZodString>;
478
+ message: z$1.ZodOptional<z$1.ZodString>;
479
+ }, z$1.core.$strip>, "error">;
480
+ };
481
+ };
482
+ };
483
+ } & {
484
+ 500: {
485
+ description: string;
486
+ content: {
487
+ "application/json": {
488
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
489
+ success: z$1.ZodLiteral<false>;
490
+ code: z$1.ZodOptional<z$1.ZodString>;
491
+ message: z$1.ZodOptional<z$1.ZodString>;
492
+ }, z$1.core.$strip>, "error">;
493
+ };
494
+ };
495
+ };
496
+ };
497
+ operationId: "verifyPasskeyAuthentication";
498
+ path: "/passkey/verify-authentication";
499
+ method: "post";
500
+ request: {
501
+ body: {
502
+ description?: string;
503
+ content: {
504
+ "application/json": {
505
+ schema: z$1.ZodType<{
506
+ response: AuthenticationResponseJSON;
507
+ }, {
508
+ response: AuthenticationResponseJSON;
509
+ }, z$1.core.$ZodTypeInternals<{
510
+ response: AuthenticationResponseJSON;
511
+ }, {
512
+ response: AuthenticationResponseJSON;
513
+ }>>;
514
+ };
515
+ };
516
+ required: true;
517
+ };
518
+ };
519
+ getRoutingPath: () => "/passkey/verify-authentication";
520
+ }>;
521
+ /**
522
+ * ### Endpoint
523
+ *
524
+ * GET `/passkey/list-user-passkeys`
525
+ *
526
+ * ### API Methods
527
+ *
528
+ * **server:**
529
+ * `auth.api.listPasskeys`
530
+ *
531
+ * **client:**
532
+ * `authClient.passkey.listUserPasskeys`
533
+ *
534
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/passkey#api-method-passkey-list-user-passkeys)
535
+ */
536
+ listPasskeys: AuthEndpoint<{
537
+ responses: {
538
+ 200: {
539
+ description: string;
540
+ content: {
541
+ "application/json": {
542
+ schema: z$1.ZodPipe<z$1.ZodArray<z$1.ZodObject<{
543
+ id: z$1.ZodString;
544
+ name: z$1.ZodOptional<z$1.ZodString>;
545
+ publicKey: z$1.ZodString;
546
+ userId: z$1.ZodString;
547
+ credentialID: z$1.ZodString;
548
+ counter: z$1.ZodNumber;
549
+ deviceType: z$1.ZodEnum<{
550
+ singleDevice: "singleDevice";
551
+ multiDevice: "multiDevice";
552
+ }>;
553
+ backedUp: z$1.ZodBoolean;
554
+ transports: z$1.ZodOptional<z$1.ZodString>;
555
+ createdAt: z$1.ZodUnion<[z$1.ZodDate, z$1.ZodISODateTime]>;
556
+ aaguid: z$1.ZodOptional<z$1.ZodString>;
557
+ }, z$1.core.$strip>>, z$1.ZodTransform<{
558
+ success: true;
559
+ data: {
560
+ id: string;
561
+ publicKey: string;
562
+ userId: string;
563
+ credentialID: string;
564
+ counter: number;
565
+ deviceType: "singleDevice" | "multiDevice";
566
+ backedUp: boolean;
567
+ createdAt: string | Date;
568
+ name?: string | undefined;
569
+ transports?: string | undefined;
570
+ aaguid?: string | undefined;
571
+ }[];
572
+ }, {
573
+ id: string;
574
+ publicKey: string;
575
+ userId: string;
576
+ credentialID: string;
577
+ counter: number;
578
+ deviceType: "singleDevice" | "multiDevice";
579
+ backedUp: boolean;
580
+ createdAt: string | Date;
581
+ name?: string | undefined;
582
+ transports?: string | undefined;
583
+ aaguid?: string | undefined;
584
+ }[]>>;
585
+ };
586
+ };
587
+ };
588
+ } & {
589
+ 401: {
590
+ description: string;
591
+ content: {
592
+ "application/json": {
593
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
594
+ success: z$1.ZodLiteral<false>;
595
+ code: z$1.ZodOptional<z$1.ZodString>;
596
+ message: z$1.ZodOptional<z$1.ZodString>;
597
+ }, z$1.core.$strip>, "error">;
598
+ };
599
+ };
600
+ };
601
+ };
602
+ operationId: "listPasskeys";
603
+ path: "/passkey/list-user-passkeys";
604
+ method: "get";
605
+ middleware: [(ctx: hono55.Context<ContextVars<object & {
606
+ session: {
607
+ session: {
608
+ [x: string]: unknown;
609
+ createdAt: Date;
610
+ updatedAt: Date;
611
+ userId: string;
612
+ expiresAt: Date;
613
+ token: string;
614
+ id?: string;
615
+ ipAddress?: string | null;
616
+ userAgent?: string | null;
617
+ };
618
+ user: {
619
+ [x: string]: unknown;
620
+ id: string;
621
+ createdAt: Date;
622
+ updatedAt: Date;
623
+ email: string;
624
+ emailVerified: boolean;
625
+ name?: string;
626
+ image?: string | null;
627
+ };
628
+ };
629
+ }>, string, {}>, next: hono55.Next) => Promise<void | (Response & hono55.TypedResponse<{
630
+ success: false;
631
+ code?: string | undefined;
632
+ message?: string | undefined;
633
+ }, 401>)>];
634
+ getRoutingPath: () => "/passkey/list-user-passkeys";
635
+ }>;
636
+ /**
637
+ * ### Endpoint
638
+ *
639
+ * POST `/passkey/delete-passkey`
640
+ *
641
+ * ### API Methods
642
+ *
643
+ * **server:**
644
+ * `auth.api.deletePasskey`
645
+ *
646
+ * **client:**
647
+ * `authClient.passkey.deletePasskey`
648
+ *
649
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/passkey#api-method-passkey-delete-passkey)
650
+ */
651
+ deletePasskey: AuthEndpoint<{
652
+ responses: {
653
+ 200: {
654
+ description: string;
655
+ content: {
656
+ "application/json": {
657
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
658
+ success: z$1.ZodLiteral<true>;
659
+ message: z$1.ZodOptional<z$1.ZodString>;
660
+ }, z$1.core.$strip>, "success">;
661
+ };
662
+ };
663
+ };
664
+ } & {
665
+ 401: {
666
+ description: string;
667
+ content: {
668
+ "application/json": {
669
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
670
+ success: z$1.ZodLiteral<false>;
671
+ code: z$1.ZodOptional<z$1.ZodString>;
672
+ message: z$1.ZodOptional<z$1.ZodString>;
673
+ }, z$1.core.$strip>, "error">;
674
+ };
675
+ };
676
+ };
677
+ };
678
+ operationId: "deletePasskey";
679
+ path: "/passkey/delete-passkey";
680
+ method: "post";
681
+ middleware: [(ctx: hono55.Context<ContextVars<object & {
682
+ session: {
683
+ session: {
684
+ [x: string]: unknown;
685
+ createdAt: Date;
686
+ updatedAt: Date;
687
+ userId: string;
688
+ expiresAt: Date;
689
+ token: string;
690
+ id?: string;
691
+ ipAddress?: string | null;
692
+ userAgent?: string | null;
693
+ };
694
+ user: {
695
+ [x: string]: unknown;
696
+ id: string;
697
+ createdAt: Date;
698
+ updatedAt: Date;
699
+ email: string;
700
+ emailVerified: boolean;
701
+ name?: string;
702
+ image?: string | null;
703
+ };
704
+ };
705
+ }>, string, {}>, next: hono55.Next) => Promise<void | (Response & hono55.TypedResponse<{
706
+ success: false;
707
+ code?: string | undefined;
708
+ message?: string | undefined;
709
+ }, 401>)>];
710
+ request: {
711
+ body: {
712
+ description?: string;
713
+ content: {
714
+ "application/json": {
715
+ schema: z$1.ZodObject<{
716
+ id: z$1.ZodString;
717
+ }, z$1.core.$strip>;
718
+ };
719
+ };
720
+ required: true;
721
+ };
722
+ };
723
+ getRoutingPath: () => "/passkey/delete-passkey";
724
+ }>;
725
+ /**
726
+ * ### Endpoint
727
+ *
728
+ * POST `/passkey/update-passkey`
729
+ *
730
+ * ### API Methods
731
+ *
732
+ * **server:**
733
+ * `auth.api.updatePasskey`
734
+ *
735
+ * **client:**
736
+ * `authClient.passkey.updatePasskey`
737
+ *
738
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/passkey#api-method-passkey-update-passkey)
739
+ */
740
+ updatePasskey: AuthEndpoint<{
741
+ responses: {
742
+ 200: {
743
+ description: string;
744
+ content: {
745
+ "application/json": {
746
+ schema: z$1.ZodPipe<z$1.ZodObject<{
747
+ id: z$1.ZodString;
748
+ name: z$1.ZodOptional<z$1.ZodString>;
749
+ publicKey: z$1.ZodString;
750
+ userId: z$1.ZodString;
751
+ credentialID: z$1.ZodString;
752
+ counter: z$1.ZodNumber;
753
+ deviceType: z$1.ZodEnum<{
754
+ singleDevice: "singleDevice";
755
+ multiDevice: "multiDevice";
756
+ }>;
757
+ backedUp: z$1.ZodBoolean;
758
+ transports: z$1.ZodOptional<z$1.ZodString>;
759
+ createdAt: z$1.ZodUnion<[z$1.ZodDate, z$1.ZodISODateTime]>;
760
+ aaguid: z$1.ZodOptional<z$1.ZodString>;
761
+ }, z$1.core.$strip>, z$1.ZodTransform<{
762
+ success: true;
763
+ data: {
764
+ id: string;
765
+ publicKey: string;
766
+ userId: string;
767
+ credentialID: string;
768
+ counter: number;
769
+ deviceType: "singleDevice" | "multiDevice";
770
+ backedUp: boolean;
771
+ createdAt: string | Date;
772
+ name?: string | undefined;
773
+ transports?: string | undefined;
774
+ aaguid?: string | undefined;
775
+ };
776
+ }, {
777
+ id: string;
778
+ publicKey: string;
779
+ userId: string;
780
+ credentialID: string;
781
+ counter: number;
782
+ deviceType: "singleDevice" | "multiDevice";
783
+ backedUp: boolean;
784
+ createdAt: string | Date;
785
+ name?: string | undefined;
786
+ transports?: string | undefined;
787
+ aaguid?: string | undefined;
788
+ }>>;
789
+ };
790
+ };
791
+ };
792
+ } & {
793
+ 401: {
794
+ description: string;
795
+ content: {
796
+ "application/json": {
797
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
798
+ success: z$1.ZodLiteral<false>;
799
+ code: z$1.ZodOptional<z$1.ZodString>;
800
+ message: z$1.ZodOptional<z$1.ZodString>;
801
+ }, z$1.core.$strip>, "error">;
802
+ };
803
+ };
804
+ };
805
+ } & {
806
+ 404: {
807
+ description: string;
808
+ content: {
809
+ "application/json": {
810
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
811
+ success: z$1.ZodLiteral<false>;
812
+ code: z$1.ZodOptional<z$1.ZodString>;
813
+ message: z$1.ZodOptional<z$1.ZodString>;
814
+ }, z$1.core.$strip>, "error">;
815
+ };
816
+ };
817
+ };
818
+ } & {
819
+ 500: {
820
+ description: string;
821
+ content: {
822
+ "application/json": {
823
+ schema: z$1.core.$ZodBranded<z$1.ZodObject<{
824
+ success: z$1.ZodLiteral<false>;
825
+ code: z$1.ZodOptional<z$1.ZodString>;
826
+ message: z$1.ZodOptional<z$1.ZodString>;
827
+ }, z$1.core.$strip>, "error">;
828
+ };
829
+ };
830
+ };
831
+ };
832
+ operationId: "updatePasskey";
833
+ path: "/passkey/update-passkey";
834
+ method: "post";
835
+ middleware: [(ctx: hono55.Context<ContextVars<object & {
836
+ session: {
837
+ session: {
838
+ [x: string]: unknown;
839
+ createdAt: Date;
840
+ updatedAt: Date;
841
+ userId: string;
842
+ expiresAt: Date;
843
+ token: string;
844
+ id?: string;
845
+ ipAddress?: string | null;
846
+ userAgent?: string | null;
847
+ };
848
+ user: {
849
+ [x: string]: unknown;
850
+ id: string;
851
+ createdAt: Date;
852
+ updatedAt: Date;
853
+ email: string;
854
+ emailVerified: boolean;
855
+ name?: string;
856
+ image?: string | null;
857
+ };
858
+ };
859
+ }>, string, {}>, next: hono55.Next) => Promise<void | (Response & hono55.TypedResponse<{
860
+ success: false;
861
+ code?: string | undefined;
862
+ message?: string | undefined;
863
+ }, 401>)>];
864
+ request: {
865
+ body: {
866
+ description?: string;
867
+ content: {
868
+ "application/json": {
869
+ schema: z$1.ZodObject<{
870
+ id: z$1.ZodString;
871
+ name: z$1.ZodString;
872
+ }, z$1.core.$strip>;
873
+ };
874
+ };
875
+ required: true;
876
+ };
877
+ };
878
+ getRoutingPath: () => "/passkey/update-passkey";
879
+ }>;
880
+ };
881
+ schema: {
882
+ passkey: {
883
+ fields: {
884
+ name: {
885
+ type: "string";
886
+ required: false;
887
+ };
888
+ publicKey: {
889
+ type: "string";
890
+ required: true;
891
+ };
892
+ userId: {
893
+ type: "string";
894
+ references: {
895
+ model: string;
896
+ field: string;
897
+ };
898
+ required: true;
899
+ };
900
+ credentialID: {
901
+ type: "string";
902
+ required: true;
903
+ };
904
+ counter: {
905
+ type: "number";
906
+ required: true;
907
+ };
908
+ deviceType: {
909
+ type: "string";
910
+ required: true;
911
+ };
912
+ backedUp: {
913
+ type: "boolean";
914
+ required: true;
915
+ };
916
+ transports: {
917
+ type: "string";
918
+ required: false;
919
+ };
920
+ createdAt: {
921
+ type: "date";
922
+ required: false;
923
+ };
924
+ aaguid: {
925
+ type: "string";
926
+ required: false;
927
+ };
928
+ };
929
+ };
930
+ };
931
+ $ERROR_CODES: {
932
+ CHALLENGE_NOT_FOUND: string;
933
+ YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: string;
934
+ FAILED_TO_VERIFY_REGISTRATION: string;
935
+ PASSKEY_NOT_FOUND: string;
936
+ AUTHENTICATION_FAILED: string;
937
+ UNABLE_TO_CREATE_SESSION: string;
938
+ FAILED_TO_UPDATE_PASSKEY: string;
939
+ };
940
+ };
941
+ declare const schema: {
942
+ passkey: {
943
+ fields: {
944
+ name: {
945
+ type: "string";
946
+ required: false;
947
+ };
948
+ publicKey: {
949
+ type: "string";
950
+ required: true;
951
+ };
952
+ userId: {
953
+ type: "string";
954
+ references: {
955
+ model: string;
956
+ field: string;
957
+ };
958
+ required: true;
959
+ };
960
+ credentialID: {
961
+ type: "string";
962
+ required: true;
963
+ };
964
+ counter: {
965
+ type: "number";
966
+ required: true;
967
+ };
968
+ deviceType: {
969
+ type: "string";
970
+ required: true;
971
+ };
972
+ backedUp: {
973
+ type: "boolean";
974
+ required: true;
975
+ };
976
+ transports: {
977
+ type: "string";
978
+ required: false;
979
+ };
980
+ createdAt: {
981
+ type: "date";
982
+ required: false;
983
+ };
984
+ aaguid: {
985
+ type: "string";
986
+ required: false;
987
+ };
988
+ };
989
+ };
990
+ };
991
+ //#endregion
992
+ export { PasskeyOptions as n, passkey as r, Passkey as t };