@imenam/mcp-dependabot-tracker 1.0.24 → 1.0.25

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 (73) hide show
  1. package/README.md +186 -75
  2. package/dist/shared/schemas/agent-token.schema.d.ts +47 -0
  3. package/dist/shared/schemas/agent-token.schema.js +18 -0
  4. package/dist/shared/schemas/api.schema.d.ts +23 -23
  5. package/dist/shared/schemas/api.schema.js +8 -8
  6. package/dist/shared/schemas/deploy.schema.d.ts +174 -0
  7. package/dist/shared/schemas/deploy.schema.js +72 -0
  8. package/dist/shared/schemas/model.schema.d.ts +9 -26
  9. package/dist/shared/schemas/model.schema.js +7 -15
  10. package/dist/src/cli/setup-mcp.d.ts +19 -16
  11. package/dist/src/cli/setup-mcp.js +35 -82
  12. package/dist/src/cli/users.d.ts +5 -0
  13. package/dist/src/cli/users.js +164 -0
  14. package/dist/src/core/agent-tokens.d.ts +15 -0
  15. package/dist/src/core/agent-tokens.js +96 -0
  16. package/dist/src/core/auth.d.ts +774 -0
  17. package/dist/src/core/auth.js +191 -0
  18. package/dist/src/core/commands.d.ts +1 -1
  19. package/dist/src/core/commands.js +47 -4
  20. package/dist/src/core/config.d.ts +2 -3
  21. package/dist/src/core/config.js +2 -9
  22. package/dist/src/core/data-dir.d.ts +3 -1
  23. package/dist/src/core/data-dir.js +11 -5
  24. package/dist/src/core/deploy-servers.d.ts +77 -0
  25. package/dist/src/core/deploy-servers.js +480 -0
  26. package/dist/src/core/deployments.d.ts +75 -0
  27. package/dist/src/core/deployments.js +387 -0
  28. package/dist/src/core/github.d.ts +2 -0
  29. package/dist/src/core/github.js +8 -0
  30. package/dist/src/core/log-dir.d.ts +1 -5
  31. package/dist/src/core/log-dir.js +1 -5
  32. package/dist/src/core/npm-sandbox.d.ts +19 -3
  33. package/dist/src/core/npm-sandbox.js +87 -17
  34. package/dist/src/core/operations.d.ts +20 -18
  35. package/dist/src/core/operations.js +86 -70
  36. package/dist/src/core/repair.d.ts +0 -7
  37. package/dist/src/core/repair.js +10 -33
  38. package/dist/src/core/repos.d.ts +2 -3
  39. package/dist/src/core/repos.js +4 -7
  40. package/dist/src/core/server-config.d.ts +29 -0
  41. package/dist/src/core/server-config.js +85 -0
  42. package/dist/src/core/settings.d.ts +9 -3
  43. package/dist/src/core/settings.js +49 -10
  44. package/dist/src/core/ssh.d.ts +31 -0
  45. package/dist/src/core/ssh.js +82 -0
  46. package/dist/src/core/store.d.ts +5 -12
  47. package/dist/src/core/store.js +82 -160
  48. package/dist/src/core/vault.d.ts +10 -0
  49. package/dist/src/core/vault.js +50 -0
  50. package/dist/src/index.d.ts +9 -0
  51. package/dist/src/index.js +46 -455
  52. package/dist/src/mcp.d.ts +6 -0
  53. package/dist/src/mcp.js +59 -0
  54. package/dist/src/server/app.d.ts +47 -0
  55. package/dist/src/server/app.js +273 -0
  56. package/dist/src/server/serve.d.ts +7 -0
  57. package/dist/src/server/serve.js +178 -0
  58. package/dist/src/tools/client.d.ts +15 -0
  59. package/dist/src/tools/client.js +62 -0
  60. package/dist/src/tools/format.d.ts +4 -5
  61. package/dist/src/tools/format.js +39 -16
  62. package/dist/src/tools/tools.d.ts +101 -15
  63. package/dist/src/tools/tools.js +91 -62
  64. package/gui/dist/assets/index-FrRzRTkV.js +71 -0
  65. package/gui/dist/assets/index-o3l3BAZD.css +1 -0
  66. package/gui/dist/index.html +2 -2
  67. package/package.json +11 -4
  68. package/dist/shared/schemas/ipc.schema.d.ts +0 -26
  69. package/dist/shared/schemas/ipc.schema.js +0 -53
  70. package/dist/src/gui-worker.d.ts +0 -1
  71. package/dist/src/gui-worker.js +0 -379
  72. package/gui/dist/assets/index-BFMdldjC.css +0 -1
  73. package/gui/dist/assets/index-BFWRvPPl.js +0 -64
@@ -0,0 +1,774 @@
1
+ import type { AuthEnv } from "./server-config.js";
2
+ /**
3
+ * En-tête où le serveur écrit l'adresse du client, calculée depuis la socket
4
+ * (et X-Forwarded-For quand la socket est un proxy de confiance) ; la valeur
5
+ * reçue du client est toujours écrasée. Le limiteur de débit le lit.
6
+ */
7
+ export declare const CLIENT_IP_HEADER = "x-tracker-client-ip";
8
+ /** Chemin des routes de Better Auth. */
9
+ export declare const AUTH_BASE_PATH = "/api/auth";
10
+ /**
11
+ * Instance Better Auth : comptes e-mail + mot de passe créés en ligne de
12
+ * commande (inscription fermée), sessions en base, limitation de débit active,
13
+ * double authentification par code TOTP ou code de secours pour les comptes qui
14
+ * l'ont activée.
15
+ */
16
+ export declare function createAuth(dataDir: string, env: AuthEnv): import("better-auth").Auth<{
17
+ appName: string;
18
+ baseURL: string;
19
+ basePath: string;
20
+ secret: string;
21
+ trustedOrigins: string[];
22
+ database: any;
23
+ emailAndPassword: {
24
+ enabled: true;
25
+ disableSignUp: true;
26
+ minPasswordLength: number;
27
+ maxPasswordLength: number;
28
+ };
29
+ session: {
30
+ expiresIn: number;
31
+ updateAge: number;
32
+ };
33
+ rateLimit: {
34
+ enabled: true;
35
+ window: number;
36
+ max: number;
37
+ customRules: {
38
+ "/sign-in/email": {
39
+ window: number;
40
+ max: number;
41
+ };
42
+ };
43
+ };
44
+ advanced: {
45
+ ipAddress: {
46
+ ipAddressHeaders: string[];
47
+ trustedProxies: string[];
48
+ };
49
+ };
50
+ plugins: [{
51
+ id: "two-factor";
52
+ version: string;
53
+ shouldRequireTwoFactor: (ctx: import("better-auth").GenericEndpointContext) => Promise<boolean>;
54
+ endpoints: {
55
+ enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", {
56
+ method: "POST";
57
+ body: import("better-auth").ZodObject<{
58
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
59
+ method: import("better-auth").ZodDefault<import("better-auth").ZodEnum<{
60
+ totp: "totp";
61
+ otp: "otp";
62
+ }>>;
63
+ issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
64
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
65
+ password: import("better-auth").ZodString;
66
+ method: import("better-auth").ZodDefault<import("better-auth").ZodEnum<{
67
+ totp: "totp";
68
+ otp: "otp";
69
+ }>>;
70
+ issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
71
+ }, import("zod/v4/core").$strip>;
72
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
73
+ session: {
74
+ session: Record<string, any> & {
75
+ id: string;
76
+ createdAt: Date;
77
+ updatedAt: Date;
78
+ userId: string;
79
+ expiresAt: Date;
80
+ token: string;
81
+ ipAddress?: string | null | undefined;
82
+ userAgent?: string | null | undefined;
83
+ };
84
+ user: Record<string, any> & {
85
+ id: string;
86
+ createdAt: Date;
87
+ updatedAt: Date;
88
+ email: string;
89
+ emailVerified: boolean;
90
+ name: string;
91
+ image?: string | null | undefined;
92
+ };
93
+ };
94
+ }>>[];
95
+ metadata: {
96
+ openapi: {
97
+ summary: string;
98
+ description: string;
99
+ responses: {
100
+ 200: {
101
+ description: string;
102
+ content: {
103
+ "application/json": {
104
+ schema: {
105
+ type: "object";
106
+ properties: {
107
+ method: {
108
+ type: string;
109
+ enum: string[];
110
+ description: string;
111
+ };
112
+ totpURI: {
113
+ type: string;
114
+ description: string;
115
+ };
116
+ backupCodes: {
117
+ type: string;
118
+ items: {
119
+ type: string;
120
+ };
121
+ description: string;
122
+ };
123
+ };
124
+ required: string[];
125
+ };
126
+ };
127
+ };
128
+ };
129
+ };
130
+ };
131
+ };
132
+ }, {
133
+ method: "otp";
134
+ } | {
135
+ method: "totp";
136
+ totpURI: string;
137
+ backupCodes: string[];
138
+ }>;
139
+ disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", {
140
+ method: "POST";
141
+ body: import("better-auth").ZodObject<{
142
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
143
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
144
+ password: import("better-auth").ZodString;
145
+ }, import("zod/v4/core").$strip>;
146
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
147
+ session: {
148
+ session: Record<string, any> & {
149
+ id: string;
150
+ createdAt: Date;
151
+ updatedAt: Date;
152
+ userId: string;
153
+ expiresAt: Date;
154
+ token: string;
155
+ ipAddress?: string | null | undefined;
156
+ userAgent?: string | null | undefined;
157
+ };
158
+ user: Record<string, any> & {
159
+ id: string;
160
+ createdAt: Date;
161
+ updatedAt: Date;
162
+ email: string;
163
+ emailVerified: boolean;
164
+ name: string;
165
+ image?: string | null | undefined;
166
+ };
167
+ };
168
+ }>>[];
169
+ metadata: {
170
+ openapi: {
171
+ summary: string;
172
+ description: string;
173
+ responses: {
174
+ 200: {
175
+ description: string;
176
+ content: {
177
+ "application/json": {
178
+ schema: {
179
+ type: "object";
180
+ properties: {
181
+ status: {
182
+ type: string;
183
+ };
184
+ };
185
+ };
186
+ };
187
+ };
188
+ };
189
+ };
190
+ };
191
+ };
192
+ }, {
193
+ status: boolean;
194
+ }>;
195
+ verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", {
196
+ method: "POST";
197
+ body: import("better-auth").ZodObject<{
198
+ code: import("better-auth").ZodString;
199
+ disableSession: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
200
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
201
+ }, import("zod/v4/core").$strip>;
202
+ metadata: {
203
+ openapi: {
204
+ description: string;
205
+ responses: {
206
+ "200": {
207
+ description: string;
208
+ content: {
209
+ "application/json": {
210
+ schema: {
211
+ type: "object";
212
+ properties: {
213
+ user: {
214
+ type: string;
215
+ properties: {
216
+ id: {
217
+ type: string;
218
+ description: string;
219
+ };
220
+ email: {
221
+ type: string;
222
+ format: string;
223
+ nullable: boolean;
224
+ description: string;
225
+ };
226
+ emailVerified: {
227
+ type: string;
228
+ nullable: boolean;
229
+ description: string;
230
+ };
231
+ name: {
232
+ type: string;
233
+ nullable: boolean;
234
+ description: string;
235
+ };
236
+ image: {
237
+ type: string;
238
+ format: string;
239
+ nullable: boolean;
240
+ description: string;
241
+ };
242
+ twoFactorEnabled: {
243
+ type: string;
244
+ description: string;
245
+ };
246
+ createdAt: {
247
+ type: string;
248
+ format: string;
249
+ description: string;
250
+ };
251
+ updatedAt: {
252
+ type: string;
253
+ format: string;
254
+ description: string;
255
+ };
256
+ };
257
+ required: string[];
258
+ description: string;
259
+ };
260
+ session: {
261
+ type: string;
262
+ properties: {
263
+ token: {
264
+ type: string;
265
+ description: string;
266
+ };
267
+ userId: {
268
+ type: string;
269
+ description: string;
270
+ };
271
+ createdAt: {
272
+ type: string;
273
+ format: string;
274
+ description: string;
275
+ };
276
+ expiresAt: {
277
+ type: string;
278
+ format: string;
279
+ description: string;
280
+ };
281
+ };
282
+ required: string[];
283
+ description: string;
284
+ };
285
+ };
286
+ required: string[];
287
+ };
288
+ };
289
+ };
290
+ };
291
+ };
292
+ };
293
+ };
294
+ }, {
295
+ token: string | undefined;
296
+ user: ({
297
+ id: string;
298
+ createdAt: Date;
299
+ updatedAt: Date;
300
+ email: string;
301
+ emailVerified: boolean;
302
+ name: string;
303
+ image?: string | null | undefined;
304
+ } & Record<string, any>) | import("better-auth/plugins/two-factor").UserWithTwoFactor;
305
+ }>;
306
+ generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", {
307
+ method: "POST";
308
+ body: import("better-auth").ZodObject<{
309
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
310
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
311
+ password: import("better-auth").ZodString;
312
+ }, import("zod/v4/core").$strip>;
313
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
314
+ session: {
315
+ session: Record<string, any> & {
316
+ id: string;
317
+ createdAt: Date;
318
+ updatedAt: Date;
319
+ userId: string;
320
+ expiresAt: Date;
321
+ token: string;
322
+ ipAddress?: string | null | undefined;
323
+ userAgent?: string | null | undefined;
324
+ };
325
+ user: Record<string, any> & {
326
+ id: string;
327
+ createdAt: Date;
328
+ updatedAt: Date;
329
+ email: string;
330
+ emailVerified: boolean;
331
+ name: string;
332
+ image?: string | null | undefined;
333
+ };
334
+ };
335
+ }>>[];
336
+ metadata: {
337
+ openapi: {
338
+ description: string;
339
+ responses: {
340
+ "200": {
341
+ description: string;
342
+ content: {
343
+ "application/json": {
344
+ schema: {
345
+ type: "object";
346
+ properties: {
347
+ status: {
348
+ type: string;
349
+ description: string;
350
+ enum: boolean[];
351
+ };
352
+ backupCodes: {
353
+ type: string;
354
+ items: {
355
+ type: string;
356
+ };
357
+ description: string;
358
+ };
359
+ };
360
+ required: string[];
361
+ };
362
+ };
363
+ };
364
+ };
365
+ };
366
+ };
367
+ };
368
+ }, {
369
+ status: boolean;
370
+ backupCodes: string[];
371
+ }>;
372
+ viewBackupCodes: import("better-auth").StrictEndpoint<string, {
373
+ method: "POST";
374
+ body: import("better-auth").ZodObject<{
375
+ userId: import("better-auth").ZodCoercedString<unknown>;
376
+ }, import("zod/v4/core").$strip>;
377
+ }, {
378
+ status: boolean;
379
+ backupCodes: string[];
380
+ }>;
381
+ sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", {
382
+ method: "POST";
383
+ body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
384
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
385
+ }, import("zod/v4/core").$strip>>;
386
+ metadata: {
387
+ openapi: {
388
+ summary: string;
389
+ description: string;
390
+ responses: {
391
+ 200: {
392
+ description: string;
393
+ content: {
394
+ "application/json": {
395
+ schema: {
396
+ type: "object";
397
+ properties: {
398
+ status: {
399
+ type: string;
400
+ };
401
+ };
402
+ };
403
+ };
404
+ };
405
+ };
406
+ };
407
+ };
408
+ };
409
+ }, {
410
+ status: boolean;
411
+ }>;
412
+ verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", {
413
+ method: "POST";
414
+ body: import("better-auth").ZodObject<{
415
+ code: import("better-auth").ZodString;
416
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
417
+ }, import("zod/v4/core").$strip>;
418
+ metadata: {
419
+ openapi: {
420
+ summary: string;
421
+ description: string;
422
+ responses: {
423
+ "200": {
424
+ description: string;
425
+ content: {
426
+ "application/json": {
427
+ schema: {
428
+ type: "object";
429
+ properties: {
430
+ token: {
431
+ type: string;
432
+ description: string;
433
+ };
434
+ user: {
435
+ type: string;
436
+ properties: {
437
+ id: {
438
+ type: string;
439
+ description: string;
440
+ };
441
+ email: {
442
+ type: string;
443
+ format: string;
444
+ nullable: boolean;
445
+ description: string;
446
+ };
447
+ emailVerified: {
448
+ type: string;
449
+ nullable: boolean;
450
+ description: string;
451
+ };
452
+ name: {
453
+ type: string;
454
+ nullable: boolean;
455
+ description: string;
456
+ };
457
+ image: {
458
+ type: string;
459
+ format: string;
460
+ nullable: boolean;
461
+ description: string;
462
+ };
463
+ createdAt: {
464
+ type: string;
465
+ format: string;
466
+ description: string;
467
+ };
468
+ updatedAt: {
469
+ type: string;
470
+ format: string;
471
+ description: string;
472
+ };
473
+ };
474
+ required: string[];
475
+ description: string;
476
+ };
477
+ };
478
+ required: string[];
479
+ };
480
+ };
481
+ };
482
+ };
483
+ };
484
+ };
485
+ };
486
+ }, {
487
+ token: string;
488
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
489
+ } | {
490
+ token: string;
491
+ user: {
492
+ id: string;
493
+ createdAt: Date;
494
+ updatedAt: Date;
495
+ email: string;
496
+ emailVerified: boolean;
497
+ name: string;
498
+ image?: string | null | undefined;
499
+ } & Record<string, any>;
500
+ }>;
501
+ generateTOTP: import("better-auth").StrictEndpoint<string, {
502
+ method: "POST";
503
+ body: import("better-auth").ZodObject<{
504
+ secret: import("better-auth").ZodString;
505
+ }, import("zod/v4/core").$strip>;
506
+ metadata: {
507
+ openapi: {
508
+ summary: string;
509
+ description: string;
510
+ responses: {
511
+ 200: {
512
+ description: string;
513
+ content: {
514
+ "application/json": {
515
+ schema: {
516
+ type: "object";
517
+ properties: {
518
+ code: {
519
+ type: string;
520
+ };
521
+ };
522
+ };
523
+ };
524
+ };
525
+ };
526
+ };
527
+ };
528
+ };
529
+ }, {
530
+ code: string;
531
+ }>;
532
+ getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", {
533
+ method: "POST";
534
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
535
+ session: {
536
+ session: Record<string, any> & {
537
+ id: string;
538
+ createdAt: Date;
539
+ updatedAt: Date;
540
+ userId: string;
541
+ expiresAt: Date;
542
+ token: string;
543
+ ipAddress?: string | null | undefined;
544
+ userAgent?: string | null | undefined;
545
+ };
546
+ user: Record<string, any> & {
547
+ id: string;
548
+ createdAt: Date;
549
+ updatedAt: Date;
550
+ email: string;
551
+ emailVerified: boolean;
552
+ name: string;
553
+ image?: string | null | undefined;
554
+ };
555
+ };
556
+ }>>[];
557
+ body: import("better-auth").ZodObject<{
558
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
559
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
560
+ password: import("better-auth").ZodString;
561
+ }, import("zod/v4/core").$strip>;
562
+ metadata: {
563
+ openapi: {
564
+ summary: string;
565
+ description: string;
566
+ responses: {
567
+ 200: {
568
+ description: string;
569
+ content: {
570
+ "application/json": {
571
+ schema: {
572
+ type: "object";
573
+ properties: {
574
+ totpURI: {
575
+ type: string;
576
+ };
577
+ };
578
+ };
579
+ };
580
+ };
581
+ };
582
+ };
583
+ };
584
+ };
585
+ }, {
586
+ totpURI: string;
587
+ }>;
588
+ verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", {
589
+ method: "POST";
590
+ body: import("better-auth").ZodObject<{
591
+ code: import("better-auth").ZodString;
592
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
593
+ }, import("zod/v4/core").$strip>;
594
+ metadata: {
595
+ openapi: {
596
+ summary: string;
597
+ description: string;
598
+ responses: {
599
+ 200: {
600
+ description: string;
601
+ content: {
602
+ "application/json": {
603
+ schema: {
604
+ type: "object";
605
+ properties: {
606
+ status: {
607
+ type: string;
608
+ };
609
+ };
610
+ };
611
+ };
612
+ };
613
+ };
614
+ };
615
+ };
616
+ };
617
+ }, {
618
+ token: string;
619
+ user: import("better-auth/plugins/two-factor").UserWithTwoFactor;
620
+ } | {
621
+ token: string;
622
+ user: {
623
+ id: string;
624
+ createdAt: Date;
625
+ updatedAt: Date;
626
+ email: string;
627
+ emailVerified: boolean;
628
+ name: string;
629
+ image?: string | null | undefined;
630
+ } & Record<string, any>;
631
+ }>;
632
+ };
633
+ options: NoInfer<{
634
+ issuer: string;
635
+ totpOptions: {
636
+ digits: 6;
637
+ period: number;
638
+ };
639
+ }>;
640
+ hooks: {
641
+ after: {
642
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
643
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
644
+ twoFactorRedirect: boolean;
645
+ twoFactorMethods: string[];
646
+ } | undefined>>;
647
+ }[];
648
+ };
649
+ schema: {
650
+ user: {
651
+ fields: {
652
+ twoFactorEnabled: {
653
+ type: "boolean";
654
+ required: false;
655
+ defaultValue: false;
656
+ input: false;
657
+ };
658
+ };
659
+ };
660
+ twoFactor: {
661
+ fields: {
662
+ secret: {
663
+ type: "string";
664
+ required: true;
665
+ returned: false;
666
+ index: true;
667
+ };
668
+ backupCodes: {
669
+ type: "string";
670
+ required: true;
671
+ returned: false;
672
+ };
673
+ userId: {
674
+ type: "string";
675
+ required: true;
676
+ returned: false;
677
+ references: {
678
+ model: string;
679
+ field: string;
680
+ };
681
+ index: true;
682
+ };
683
+ verified: {
684
+ type: "boolean";
685
+ required: false;
686
+ defaultValue: true;
687
+ input: false;
688
+ };
689
+ failedVerificationCount: {
690
+ type: "number";
691
+ required: false;
692
+ defaultValue: number;
693
+ input: false;
694
+ returned: false;
695
+ };
696
+ lockedUntil: {
697
+ type: "date";
698
+ required: false;
699
+ input: false;
700
+ returned: false;
701
+ };
702
+ };
703
+ };
704
+ };
705
+ rateLimit: {
706
+ pathMatcher(path: string): boolean;
707
+ window: number;
708
+ max: number;
709
+ }[];
710
+ $ERROR_CODES: {
711
+ OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
712
+ OTP_NOT_CONFIGURED: import("better-auth").RawError<"OTP_NOT_CONFIGURED">;
713
+ OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
714
+ TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
715
+ TOTP_ALREADY_ENABLED: import("better-auth").RawError<"TOTP_ALREADY_ENABLED">;
716
+ TOTP_NOT_CONFIGURED: import("better-auth").RawError<"TOTP_NOT_CONFIGURED">;
717
+ TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
718
+ BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
719
+ INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
720
+ INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
721
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
722
+ ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
723
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
724
+ };
725
+ }];
726
+ }>;
727
+ export type Auth = ReturnType<typeof createAuth>;
728
+ /** Crée ou complète les tables de Better Auth. */
729
+ export declare function migrateAuth(auth: Auth): Promise<void>;
730
+ /** Nouveau secret de session : 48 octets aléatoires en base64. */
731
+ export declare function generateAuthSecret(): string;
732
+ export interface UserSummary {
733
+ email: string;
734
+ name: string;
735
+ createdAt: Date;
736
+ /** La double authentification est activée. */
737
+ twoFactor: boolean;
738
+ }
739
+ /** Crée un compte e-mail + mot de passe. */
740
+ export declare function addUser(auth: Auth, input: {
741
+ email: string;
742
+ name: string;
743
+ password: string;
744
+ }): Promise<UserSummary>;
745
+ /** Remplace le mot de passe d'un compte et ferme toutes ses sessions. */
746
+ export declare function setUserPassword(auth: Auth, email: string, password: string): Promise<void>;
747
+ /** Supprime un compte, ses sessions et son mot de passe. */
748
+ export declare function removeUser(auth: Auth, email: string): Promise<void>;
749
+ /** Comptes existants, du plus ancien au plus récent. */
750
+ export declare function listUsers(auth: Auth): Promise<UserSummary[]>;
751
+ /** Encodage base32 (RFC 4648) sans remplissage, celui des clés des applications d'authentification. */
752
+ export declare function base32Encode(bytes: Uint8Array): string;
753
+ /** Double authentification préparée pour un compte, pas encore enregistrée. */
754
+ export interface TotpEnrollment {
755
+ /** Secret TOTP, tel que le plugin l'enregistre. */
756
+ secret: string;
757
+ /** Clé à saisir dans l'application d'authentification : le secret en base32. */
758
+ key: string;
759
+ /** Adresse `otpauth://` de la clé, pour un QR code ou un gestionnaire de mots de passe. */
760
+ uri: string;
761
+ /** Codes de secours, chacun utilisable une fois à la place du code de l'application. */
762
+ backupCodes: string[];
763
+ }
764
+ /** Prépare un secret TOTP et des codes de secours pour le compte `email`, sans rien enregistrer. */
765
+ export declare function prepareTotp(auth: Auth, email: string): Promise<TotpEnrollment>;
766
+ /** Code TOTP du moment pour `secret`. */
767
+ export declare function currentTotpCode(auth: Auth, secret: string): Promise<string>;
768
+ /**
769
+ * Active la double authentification du compte avec `enrollment`, à la place de
770
+ * celle qu'il avait, et ferme toutes ses sessions.
771
+ */
772
+ export declare function enableTotp(auth: Auth, email: string, enrollment: TotpEnrollment): Promise<void>;
773
+ /** Retire la double authentification du compte : son secret et ses codes de secours sont effacés. */
774
+ export declare function disableTotp(auth: Auth, email: string): Promise<void>;