@supabase/lite 0.0.1-next.1

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 (37) hide show
  1. package/dist/Connection-rAPmec1m.d.ts +710 -0
  2. package/dist/cli/index.d.ts +1 -0
  3. package/dist/cli/index.js +30950 -0
  4. package/dist/cli/lib.d.ts +158 -0
  5. package/dist/cli/lib.js +18598 -0
  6. package/dist/db/browser/index.d.ts +550 -0
  7. package/dist/db/browser/index.js +16112 -0
  8. package/dist/db/bun/index.d.ts +548 -0
  9. package/dist/db/bun/index.js +16100 -0
  10. package/dist/db/fallback.d.ts +182 -0
  11. package/dist/db/fallback.js +15996 -0
  12. package/dist/db/node/index.d.ts +547 -0
  13. package/dist/db/node/index.js +16093 -0
  14. package/dist/db/postgres/BasePostgresConnection-B7zHDAib.d.ts +24 -0
  15. package/dist/db/postgres/PostgresConnection.d.ts +16 -0
  16. package/dist/db/postgres/PostgresConnection.js +611 -0
  17. package/dist/db/postgres/pglite/PgliteConnection.d.ts +38 -0
  18. package/dist/db/postgres/pglite/PgliteConnection.js +890 -0
  19. package/dist/db/workerd/index.d.ts +570 -0
  20. package/dist/db/workerd/index.js +16218 -0
  21. package/dist/index-xv_pDjEt.d.ts +769 -0
  22. package/dist/index.d.ts +2498 -0
  23. package/dist/index.js +32305 -0
  24. package/dist/static/.vite/manifest.json +11 -0
  25. package/dist/static/assets/main-BsWx0q9l.js +40913 -0
  26. package/dist/static/assets/main-DexXgo9R.css +4002 -0
  27. package/dist/static/favicon.ico +0 -0
  28. package/dist/static/fonts/CustomFont-Black.woff2 +0 -0
  29. package/dist/static/fonts/CustomFont-BlackItalic.woff2 +0 -0
  30. package/dist/static/fonts/CustomFont-Bold.woff2 +0 -0
  31. package/dist/static/fonts/CustomFont-BoldItalic.woff2 +0 -0
  32. package/dist/static/fonts/CustomFont-Book.woff2 +0 -0
  33. package/dist/static/fonts/CustomFont-BookItalic.woff2 +0 -0
  34. package/dist/static/fonts/CustomFont-Medium.woff2 +0 -0
  35. package/dist/vite/index.d.ts +3017 -0
  36. package/dist/vite/index.js +1923 -0
  37. package/package.json +195 -0
@@ -0,0 +1,3017 @@
1
+ import { Connect, Plugin } from 'vite';
2
+ import * as _supabase_supabase_js from '@supabase/supabase-js';
3
+ import { SupabaseClientOptions } from '@supabase/supabase-js';
4
+ import * as s from 'jsonv-ts';
5
+ import { Connection } from '@supabase/lite';
6
+ import * as hono_hono_base from 'hono/hono-base';
7
+ import * as hono_utils_http_status from 'hono/utils/http-status';
8
+ import * as hono_utils_types from 'hono/utils/types';
9
+ import * as hono_types from 'hono/types';
10
+ import { MiddlewareHandler } from 'hono';
11
+ import { Kysely } from 'kysely';
12
+ import { ReadableStream as ReadableStream$1 } from 'node:stream/web';
13
+
14
+ declare module "jsonv-ts" {
15
+ interface ISchemaOptions {
16
+ tags?: string[];
17
+ links?: {
18
+ name: string;
19
+ link: string;
20
+ }[];
21
+ }
22
+ }
23
+ declare const schema: s.ObjectSchema<{
24
+ readonly project_id: s.Schema<s.ISchemaOptions, string | undefined, string | undefined>;
25
+ readonly analytics: s.Schema<s.ISchemaOptions, {
26
+ enabled?: boolean | undefined;
27
+ port?: number | undefined;
28
+ vector_port?: number | undefined;
29
+ backend?: "postgres" | "bigquery" | undefined;
30
+ } | undefined, {
31
+ enabled?: boolean | undefined;
32
+ port?: number | undefined;
33
+ vector_port?: number | undefined;
34
+ backend?: "postgres" | "bigquery" | undefined;
35
+ } | undefined>;
36
+ readonly api: s.Schema<s.ISchemaOptions, {
37
+ enabled?: boolean | undefined;
38
+ port?: number | undefined;
39
+ schemas?: string[] | undefined;
40
+ extra_search_path?: string[] | undefined;
41
+ max_rows?: number | undefined;
42
+ pg_safe_update?: boolean | undefined;
43
+ plan_enabled?: boolean | undefined;
44
+ aggregates_enabled?: boolean | undefined;
45
+ limited_mutations_enabled?: boolean | undefined;
46
+ anonymous_enabled?: boolean | undefined;
47
+ external_url?: string | undefined;
48
+ tls?: {
49
+ enabled?: boolean | undefined;
50
+ } | undefined;
51
+ } | undefined, {
52
+ enabled?: boolean | undefined;
53
+ port?: number | undefined;
54
+ schemas?: string[] | undefined;
55
+ extra_search_path?: string[] | undefined;
56
+ max_rows?: number | undefined;
57
+ pg_safe_update?: boolean | undefined;
58
+ plan_enabled?: boolean | undefined;
59
+ aggregates_enabled?: boolean | undefined;
60
+ limited_mutations_enabled?: boolean | undefined;
61
+ anonymous_enabled?: boolean | undefined;
62
+ external_url?: string | undefined;
63
+ tls?: {
64
+ enabled?: boolean | undefined;
65
+ } | undefined;
66
+ } | undefined>;
67
+ readonly auth: s.Schema<s.ISchemaOptions, {
68
+ enabled?: boolean | undefined;
69
+ jwt_secret?: string | undefined;
70
+ site_url?: string | undefined;
71
+ additional_redirect_urls?: string[] | undefined;
72
+ jwt_expiry?: number | undefined;
73
+ enable_refresh_token_rotation?: boolean | undefined;
74
+ refresh_token_reuse_interval?: number | undefined;
75
+ enable_manual_linking?: boolean | undefined;
76
+ enable_signup?: boolean | undefined;
77
+ enable_anonymous_sign_ins?: boolean | undefined;
78
+ minimum_password_length?: number | undefined;
79
+ password_requirements?: string | undefined;
80
+ hook?: {
81
+ mfa_verification_attempt?: {
82
+ enabled?: boolean | undefined;
83
+ uri?: string | undefined;
84
+ secrets?: string[] | undefined;
85
+ } | undefined;
86
+ password_verification_attempt?: {
87
+ enabled?: boolean | undefined;
88
+ uri?: string | undefined;
89
+ secrets?: string[] | undefined;
90
+ } | undefined;
91
+ custom_access_token?: {
92
+ enabled?: boolean | undefined;
93
+ uri?: string | undefined;
94
+ secrets?: string[] | undefined;
95
+ } | undefined;
96
+ send_sms?: {
97
+ enabled?: boolean | undefined;
98
+ uri?: string | undefined;
99
+ secrets?: string[] | undefined;
100
+ } | undefined;
101
+ send_email?: {
102
+ enabled?: boolean | undefined;
103
+ uri?: string | undefined;
104
+ secrets?: string[] | undefined;
105
+ } | undefined;
106
+ } | undefined;
107
+ mfa?: {
108
+ max_enrolled_factors?: number | undefined;
109
+ totp?: {
110
+ enroll_enabled?: boolean | undefined;
111
+ verify_enabled?: boolean | undefined;
112
+ } | undefined;
113
+ phone?: {
114
+ template?: string | undefined;
115
+ enroll_enabled?: boolean | undefined;
116
+ verify_enabled?: boolean | undefined;
117
+ otp_length?: number | undefined;
118
+ max_frequency?: string | undefined;
119
+ } | undefined;
120
+ } | undefined;
121
+ sessions?: {
122
+ timebox?: string | undefined;
123
+ inactivity_timeout?: string | undefined;
124
+ single_per_user?: boolean | undefined;
125
+ } | undefined;
126
+ email?: {
127
+ template?: {
128
+ invite?: {
129
+ subject?: string | undefined;
130
+ content_path?: string | undefined;
131
+ } | undefined;
132
+ confirmation?: {
133
+ subject?: string | undefined;
134
+ content_path?: string | undefined;
135
+ } | undefined;
136
+ recovery?: {
137
+ subject?: string | undefined;
138
+ content_path?: string | undefined;
139
+ } | undefined;
140
+ magic_link?: {
141
+ subject?: string | undefined;
142
+ content_path?: string | undefined;
143
+ } | undefined;
144
+ email_change?: {
145
+ subject?: string | undefined;
146
+ content_path?: string | undefined;
147
+ } | undefined;
148
+ } | undefined;
149
+ enable_signup?: boolean | undefined;
150
+ otp_length?: number | undefined;
151
+ max_frequency?: string | undefined;
152
+ double_confirm_changes?: boolean | undefined;
153
+ enable_confirmations?: boolean | undefined;
154
+ secure_password_change?: boolean | undefined;
155
+ otp_expiry?: number | undefined;
156
+ smtp?: {
157
+ port?: number | undefined;
158
+ host?: string | undefined;
159
+ user?: string | undefined;
160
+ pass?: string | undefined;
161
+ admin_email?: string | undefined;
162
+ sender_name?: string | undefined;
163
+ } | undefined;
164
+ } | undefined;
165
+ sms?: {
166
+ template?: string | undefined;
167
+ enable_signup?: boolean | undefined;
168
+ max_frequency?: string | undefined;
169
+ enable_confirmations?: boolean | undefined;
170
+ test_otp?: {
171
+ [x: string]: string;
172
+ } | undefined;
173
+ twilio?: {
174
+ enabled?: boolean | undefined;
175
+ account_sid?: string | undefined;
176
+ message_service_sid?: string | undefined;
177
+ auth_token?: string | undefined;
178
+ } | undefined;
179
+ twilio_verify?: {
180
+ enabled?: boolean | undefined;
181
+ account_sid?: string | undefined;
182
+ message_service_sid?: string | undefined;
183
+ auth_token?: string | undefined;
184
+ } | undefined;
185
+ messagebird?: {
186
+ enabled?: boolean | undefined;
187
+ originator?: string | undefined;
188
+ api_key?: string | undefined;
189
+ } | undefined;
190
+ textlocal?: {
191
+ enabled?: boolean | undefined;
192
+ api_key?: string | undefined;
193
+ sender?: string | undefined;
194
+ } | undefined;
195
+ vonage?: {
196
+ enabled?: boolean | undefined;
197
+ api_key?: string | undefined;
198
+ from?: string | undefined;
199
+ api_secret?: string | undefined;
200
+ } | undefined;
201
+ } | undefined;
202
+ external?: {
203
+ apple?: {
204
+ enabled?: boolean | undefined;
205
+ client_id?: string | undefined;
206
+ secret?: string | undefined;
207
+ url?: string | undefined;
208
+ redirect_uri?: string | undefined;
209
+ skip_nonce_check?: boolean | undefined;
210
+ } | undefined;
211
+ azure?: {
212
+ enabled?: boolean | undefined;
213
+ client_id?: string | undefined;
214
+ secret?: string | undefined;
215
+ url?: string | undefined;
216
+ redirect_uri?: string | undefined;
217
+ skip_nonce_check?: boolean | undefined;
218
+ } | undefined;
219
+ bitbucket?: {
220
+ enabled?: boolean | undefined;
221
+ client_id?: string | undefined;
222
+ secret?: string | undefined;
223
+ url?: string | undefined;
224
+ redirect_uri?: string | undefined;
225
+ skip_nonce_check?: boolean | undefined;
226
+ } | undefined;
227
+ discord?: {
228
+ enabled?: boolean | undefined;
229
+ client_id?: string | undefined;
230
+ secret?: string | undefined;
231
+ url?: string | undefined;
232
+ redirect_uri?: string | undefined;
233
+ skip_nonce_check?: boolean | undefined;
234
+ } | undefined;
235
+ facebook?: {
236
+ enabled?: boolean | undefined;
237
+ client_id?: string | undefined;
238
+ secret?: string | undefined;
239
+ url?: string | undefined;
240
+ redirect_uri?: string | undefined;
241
+ skip_nonce_check?: boolean | undefined;
242
+ } | undefined;
243
+ github?: {
244
+ enabled?: boolean | undefined;
245
+ client_id?: string | undefined;
246
+ secret?: string | undefined;
247
+ url?: string | undefined;
248
+ redirect_uri?: string | undefined;
249
+ skip_nonce_check?: boolean | undefined;
250
+ } | undefined;
251
+ gitlab?: {
252
+ enabled?: boolean | undefined;
253
+ client_id?: string | undefined;
254
+ secret?: string | undefined;
255
+ url?: string | undefined;
256
+ redirect_uri?: string | undefined;
257
+ skip_nonce_check?: boolean | undefined;
258
+ } | undefined;
259
+ google?: {
260
+ enabled?: boolean | undefined;
261
+ client_id?: string | undefined;
262
+ secret?: string | undefined;
263
+ url?: string | undefined;
264
+ redirect_uri?: string | undefined;
265
+ skip_nonce_check?: boolean | undefined;
266
+ } | undefined;
267
+ kakao?: {
268
+ enabled?: boolean | undefined;
269
+ client_id?: string | undefined;
270
+ secret?: string | undefined;
271
+ url?: string | undefined;
272
+ redirect_uri?: string | undefined;
273
+ skip_nonce_check?: boolean | undefined;
274
+ } | undefined;
275
+ keycloak?: {
276
+ enabled?: boolean | undefined;
277
+ client_id?: string | undefined;
278
+ secret?: string | undefined;
279
+ url?: string | undefined;
280
+ redirect_uri?: string | undefined;
281
+ skip_nonce_check?: boolean | undefined;
282
+ } | undefined;
283
+ linkedin?: {
284
+ enabled?: boolean | undefined;
285
+ client_id?: string | undefined;
286
+ secret?: string | undefined;
287
+ url?: string | undefined;
288
+ redirect_uri?: string | undefined;
289
+ skip_nonce_check?: boolean | undefined;
290
+ } | undefined;
291
+ notion?: {
292
+ enabled?: boolean | undefined;
293
+ client_id?: string | undefined;
294
+ secret?: string | undefined;
295
+ url?: string | undefined;
296
+ redirect_uri?: string | undefined;
297
+ skip_nonce_check?: boolean | undefined;
298
+ } | undefined;
299
+ twitch?: {
300
+ enabled?: boolean | undefined;
301
+ client_id?: string | undefined;
302
+ secret?: string | undefined;
303
+ url?: string | undefined;
304
+ redirect_uri?: string | undefined;
305
+ skip_nonce_check?: boolean | undefined;
306
+ } | undefined;
307
+ twitter?: {
308
+ enabled?: boolean | undefined;
309
+ client_id?: string | undefined;
310
+ secret?: string | undefined;
311
+ url?: string | undefined;
312
+ redirect_uri?: string | undefined;
313
+ skip_nonce_check?: boolean | undefined;
314
+ } | undefined;
315
+ slack?: {
316
+ enabled?: boolean | undefined;
317
+ client_id?: string | undefined;
318
+ secret?: string | undefined;
319
+ url?: string | undefined;
320
+ redirect_uri?: string | undefined;
321
+ skip_nonce_check?: boolean | undefined;
322
+ } | undefined;
323
+ spotify?: {
324
+ enabled?: boolean | undefined;
325
+ client_id?: string | undefined;
326
+ secret?: string | undefined;
327
+ url?: string | undefined;
328
+ redirect_uri?: string | undefined;
329
+ skip_nonce_check?: boolean | undefined;
330
+ } | undefined;
331
+ workos?: {
332
+ enabled?: boolean | undefined;
333
+ client_id?: string | undefined;
334
+ secret?: string | undefined;
335
+ url?: string | undefined;
336
+ redirect_uri?: string | undefined;
337
+ skip_nonce_check?: boolean | undefined;
338
+ } | undefined;
339
+ zoom?: {
340
+ enabled?: boolean | undefined;
341
+ client_id?: string | undefined;
342
+ secret?: string | undefined;
343
+ url?: string | undefined;
344
+ redirect_uri?: string | undefined;
345
+ skip_nonce_check?: boolean | undefined;
346
+ } | undefined;
347
+ } | undefined;
348
+ } | undefined, {
349
+ enabled?: boolean | undefined;
350
+ jwt_secret?: string | undefined;
351
+ site_url?: string | undefined;
352
+ additional_redirect_urls?: string[] | undefined;
353
+ jwt_expiry?: number | undefined;
354
+ enable_refresh_token_rotation?: boolean | undefined;
355
+ refresh_token_reuse_interval?: number | undefined;
356
+ enable_manual_linking?: boolean | undefined;
357
+ enable_signup?: boolean | undefined;
358
+ enable_anonymous_sign_ins?: boolean | undefined;
359
+ minimum_password_length?: number | undefined;
360
+ password_requirements?: string | undefined;
361
+ hook?: {
362
+ mfa_verification_attempt?: {
363
+ enabled?: boolean | undefined;
364
+ uri?: string | undefined;
365
+ secrets?: string[] | undefined;
366
+ } | undefined;
367
+ password_verification_attempt?: {
368
+ enabled?: boolean | undefined;
369
+ uri?: string | undefined;
370
+ secrets?: string[] | undefined;
371
+ } | undefined;
372
+ custom_access_token?: {
373
+ enabled?: boolean | undefined;
374
+ uri?: string | undefined;
375
+ secrets?: string[] | undefined;
376
+ } | undefined;
377
+ send_sms?: {
378
+ enabled?: boolean | undefined;
379
+ uri?: string | undefined;
380
+ secrets?: string[] | undefined;
381
+ } | undefined;
382
+ send_email?: {
383
+ enabled?: boolean | undefined;
384
+ uri?: string | undefined;
385
+ secrets?: string[] | undefined;
386
+ } | undefined;
387
+ } | undefined;
388
+ mfa?: {
389
+ max_enrolled_factors?: number | undefined;
390
+ totp?: {
391
+ enroll_enabled?: boolean | undefined;
392
+ verify_enabled?: boolean | undefined;
393
+ } | undefined;
394
+ phone?: {
395
+ template?: string | undefined;
396
+ enroll_enabled?: boolean | undefined;
397
+ verify_enabled?: boolean | undefined;
398
+ otp_length?: number | undefined;
399
+ max_frequency?: string | undefined;
400
+ } | undefined;
401
+ } | undefined;
402
+ sessions?: {
403
+ timebox?: string | undefined;
404
+ inactivity_timeout?: string | undefined;
405
+ single_per_user?: boolean | undefined;
406
+ } | undefined;
407
+ email?: {
408
+ template?: {
409
+ invite?: {
410
+ subject?: string | undefined;
411
+ content_path?: string | undefined;
412
+ } | undefined;
413
+ confirmation?: {
414
+ subject?: string | undefined;
415
+ content_path?: string | undefined;
416
+ } | undefined;
417
+ recovery?: {
418
+ subject?: string | undefined;
419
+ content_path?: string | undefined;
420
+ } | undefined;
421
+ magic_link?: {
422
+ subject?: string | undefined;
423
+ content_path?: string | undefined;
424
+ } | undefined;
425
+ email_change?: {
426
+ subject?: string | undefined;
427
+ content_path?: string | undefined;
428
+ } | undefined;
429
+ } | undefined;
430
+ enable_signup?: boolean | undefined;
431
+ otp_length?: number | undefined;
432
+ max_frequency?: string | undefined;
433
+ double_confirm_changes?: boolean | undefined;
434
+ enable_confirmations?: boolean | undefined;
435
+ secure_password_change?: boolean | undefined;
436
+ otp_expiry?: number | undefined;
437
+ smtp?: {
438
+ port?: number | undefined;
439
+ host?: string | undefined;
440
+ user?: string | undefined;
441
+ pass?: string | undefined;
442
+ admin_email?: string | undefined;
443
+ sender_name?: string | undefined;
444
+ } | undefined;
445
+ } | undefined;
446
+ sms?: {
447
+ template?: string | undefined;
448
+ enable_signup?: boolean | undefined;
449
+ max_frequency?: string | undefined;
450
+ enable_confirmations?: boolean | undefined;
451
+ test_otp?: {
452
+ [x: string]: string;
453
+ } | undefined;
454
+ twilio?: {
455
+ enabled?: boolean | undefined;
456
+ account_sid?: string | undefined;
457
+ message_service_sid?: string | undefined;
458
+ auth_token?: string | undefined;
459
+ } | undefined;
460
+ twilio_verify?: {
461
+ enabled?: boolean | undefined;
462
+ account_sid?: string | undefined;
463
+ message_service_sid?: string | undefined;
464
+ auth_token?: string | undefined;
465
+ } | undefined;
466
+ messagebird?: {
467
+ enabled?: boolean | undefined;
468
+ originator?: string | undefined;
469
+ api_key?: string | undefined;
470
+ } | undefined;
471
+ textlocal?: {
472
+ enabled?: boolean | undefined;
473
+ api_key?: string | undefined;
474
+ sender?: string | undefined;
475
+ } | undefined;
476
+ vonage?: {
477
+ enabled?: boolean | undefined;
478
+ api_key?: string | undefined;
479
+ from?: string | undefined;
480
+ api_secret?: string | undefined;
481
+ } | undefined;
482
+ } | undefined;
483
+ external?: {
484
+ apple?: {
485
+ enabled?: boolean | undefined;
486
+ client_id?: string | undefined;
487
+ secret?: string | undefined;
488
+ url?: string | undefined;
489
+ redirect_uri?: string | undefined;
490
+ skip_nonce_check?: boolean | undefined;
491
+ } | undefined;
492
+ azure?: {
493
+ enabled?: boolean | undefined;
494
+ client_id?: string | undefined;
495
+ secret?: string | undefined;
496
+ url?: string | undefined;
497
+ redirect_uri?: string | undefined;
498
+ skip_nonce_check?: boolean | undefined;
499
+ } | undefined;
500
+ bitbucket?: {
501
+ enabled?: boolean | undefined;
502
+ client_id?: string | undefined;
503
+ secret?: string | undefined;
504
+ url?: string | undefined;
505
+ redirect_uri?: string | undefined;
506
+ skip_nonce_check?: boolean | undefined;
507
+ } | undefined;
508
+ discord?: {
509
+ enabled?: boolean | undefined;
510
+ client_id?: string | undefined;
511
+ secret?: string | undefined;
512
+ url?: string | undefined;
513
+ redirect_uri?: string | undefined;
514
+ skip_nonce_check?: boolean | undefined;
515
+ } | undefined;
516
+ facebook?: {
517
+ enabled?: boolean | undefined;
518
+ client_id?: string | undefined;
519
+ secret?: string | undefined;
520
+ url?: string | undefined;
521
+ redirect_uri?: string | undefined;
522
+ skip_nonce_check?: boolean | undefined;
523
+ } | undefined;
524
+ github?: {
525
+ enabled?: boolean | undefined;
526
+ client_id?: string | undefined;
527
+ secret?: string | undefined;
528
+ url?: string | undefined;
529
+ redirect_uri?: string | undefined;
530
+ skip_nonce_check?: boolean | undefined;
531
+ } | undefined;
532
+ gitlab?: {
533
+ enabled?: boolean | undefined;
534
+ client_id?: string | undefined;
535
+ secret?: string | undefined;
536
+ url?: string | undefined;
537
+ redirect_uri?: string | undefined;
538
+ skip_nonce_check?: boolean | undefined;
539
+ } | undefined;
540
+ google?: {
541
+ enabled?: boolean | undefined;
542
+ client_id?: string | undefined;
543
+ secret?: string | undefined;
544
+ url?: string | undefined;
545
+ redirect_uri?: string | undefined;
546
+ skip_nonce_check?: boolean | undefined;
547
+ } | undefined;
548
+ kakao?: {
549
+ enabled?: boolean | undefined;
550
+ client_id?: string | undefined;
551
+ secret?: string | undefined;
552
+ url?: string | undefined;
553
+ redirect_uri?: string | undefined;
554
+ skip_nonce_check?: boolean | undefined;
555
+ } | undefined;
556
+ keycloak?: {
557
+ enabled?: boolean | undefined;
558
+ client_id?: string | undefined;
559
+ secret?: string | undefined;
560
+ url?: string | undefined;
561
+ redirect_uri?: string | undefined;
562
+ skip_nonce_check?: boolean | undefined;
563
+ } | undefined;
564
+ linkedin?: {
565
+ enabled?: boolean | undefined;
566
+ client_id?: string | undefined;
567
+ secret?: string | undefined;
568
+ url?: string | undefined;
569
+ redirect_uri?: string | undefined;
570
+ skip_nonce_check?: boolean | undefined;
571
+ } | undefined;
572
+ notion?: {
573
+ enabled?: boolean | undefined;
574
+ client_id?: string | undefined;
575
+ secret?: string | undefined;
576
+ url?: string | undefined;
577
+ redirect_uri?: string | undefined;
578
+ skip_nonce_check?: boolean | undefined;
579
+ } | undefined;
580
+ twitch?: {
581
+ enabled?: boolean | undefined;
582
+ client_id?: string | undefined;
583
+ secret?: string | undefined;
584
+ url?: string | undefined;
585
+ redirect_uri?: string | undefined;
586
+ skip_nonce_check?: boolean | undefined;
587
+ } | undefined;
588
+ twitter?: {
589
+ enabled?: boolean | undefined;
590
+ client_id?: string | undefined;
591
+ secret?: string | undefined;
592
+ url?: string | undefined;
593
+ redirect_uri?: string | undefined;
594
+ skip_nonce_check?: boolean | undefined;
595
+ } | undefined;
596
+ slack?: {
597
+ enabled?: boolean | undefined;
598
+ client_id?: string | undefined;
599
+ secret?: string | undefined;
600
+ url?: string | undefined;
601
+ redirect_uri?: string | undefined;
602
+ skip_nonce_check?: boolean | undefined;
603
+ } | undefined;
604
+ spotify?: {
605
+ enabled?: boolean | undefined;
606
+ client_id?: string | undefined;
607
+ secret?: string | undefined;
608
+ url?: string | undefined;
609
+ redirect_uri?: string | undefined;
610
+ skip_nonce_check?: boolean | undefined;
611
+ } | undefined;
612
+ workos?: {
613
+ enabled?: boolean | undefined;
614
+ client_id?: string | undefined;
615
+ secret?: string | undefined;
616
+ url?: string | undefined;
617
+ redirect_uri?: string | undefined;
618
+ skip_nonce_check?: boolean | undefined;
619
+ } | undefined;
620
+ zoom?: {
621
+ enabled?: boolean | undefined;
622
+ client_id?: string | undefined;
623
+ secret?: string | undefined;
624
+ url?: string | undefined;
625
+ redirect_uri?: string | undefined;
626
+ skip_nonce_check?: boolean | undefined;
627
+ } | undefined;
628
+ } | undefined;
629
+ } | undefined>;
630
+ readonly db: s.Schema<s.ISchemaOptions, {
631
+ [x: string]: unknown;
632
+ port?: number | undefined;
633
+ url?: string | undefined;
634
+ driver?: "postgres" | "sqlite" | "sqlite-postgres" | "pglite" | undefined;
635
+ shadow_port?: number | undefined;
636
+ major_version?: number | undefined;
637
+ pooler?: {
638
+ [x: string]: unknown;
639
+ enabled?: boolean | undefined;
640
+ port?: number | undefined;
641
+ pool_mode?: string | undefined;
642
+ default_pool_size?: number | undefined;
643
+ max_client_conn?: number | undefined;
644
+ } | undefined;
645
+ seed?: {
646
+ enabled?: boolean | undefined;
647
+ sql_paths?: string[] | undefined;
648
+ } | undefined;
649
+ migrations?: {
650
+ enabled?: boolean | undefined;
651
+ schema_paths?: string[] | undefined;
652
+ } | undefined;
653
+ } | undefined, {
654
+ [x: string]: unknown;
655
+ port?: number | undefined;
656
+ url?: string | undefined;
657
+ driver?: "postgres" | "sqlite" | "sqlite-postgres" | "pglite" | undefined;
658
+ shadow_port?: number | undefined;
659
+ major_version?: number | undefined;
660
+ pooler?: {
661
+ [x: string]: unknown;
662
+ enabled?: boolean | undefined;
663
+ port?: number | undefined;
664
+ pool_mode?: string | undefined;
665
+ default_pool_size?: number | undefined;
666
+ max_client_conn?: number | undefined;
667
+ } | undefined;
668
+ seed?: {
669
+ enabled?: boolean | undefined;
670
+ sql_paths?: string[] | undefined;
671
+ } | undefined;
672
+ migrations?: {
673
+ enabled?: boolean | undefined;
674
+ schema_paths?: string[] | undefined;
675
+ } | undefined;
676
+ } | undefined>;
677
+ readonly edge_runtime: s.Schema<s.ISchemaOptions, {
678
+ enabled?: boolean | undefined;
679
+ policy?: "oneshot" | "per_worker" | undefined;
680
+ inspector_port?: number | undefined;
681
+ } | undefined, {
682
+ enabled?: boolean | undefined;
683
+ policy?: "oneshot" | "per_worker" | undefined;
684
+ inspector_port?: number | undefined;
685
+ } | undefined>;
686
+ readonly functions: s.Schema<s.ISchemaOptions, {
687
+ [x: string]: {
688
+ enabled?: boolean | undefined;
689
+ verify_jwt?: boolean | undefined;
690
+ import_map?: string | undefined;
691
+ entrypoint?: string | undefined;
692
+ };
693
+ } | undefined, {
694
+ [x: string]: {
695
+ enabled?: boolean | undefined;
696
+ verify_jwt?: boolean | undefined;
697
+ import_map?: string | undefined;
698
+ entrypoint?: string | undefined;
699
+ };
700
+ } | undefined>;
701
+ readonly inbucket: s.Schema<s.ISchemaOptions, {
702
+ enabled?: boolean | undefined;
703
+ port?: number | undefined;
704
+ smtp_port?: number | undefined;
705
+ pop3_port?: number | undefined;
706
+ } | undefined, {
707
+ enabled?: boolean | undefined;
708
+ port?: number | undefined;
709
+ smtp_port?: number | undefined;
710
+ pop3_port?: number | undefined;
711
+ } | undefined>;
712
+ readonly realtime: s.Schema<s.ISchemaOptions, {
713
+ enabled?: boolean | undefined;
714
+ ip_version?: string | undefined;
715
+ max_header_length?: number | undefined;
716
+ } | undefined, {
717
+ enabled?: boolean | undefined;
718
+ ip_version?: string | undefined;
719
+ max_header_length?: number | undefined;
720
+ } | undefined>;
721
+ readonly storage: s.Schema<s.ISchemaOptions, {
722
+ enabled?: boolean | undefined;
723
+ file_size_limit?: string | undefined;
724
+ buckets?: {
725
+ [x: string]: {
726
+ public?: boolean | undefined;
727
+ file_size_limit?: string | undefined;
728
+ allowed_mime_types?: string[] | undefined;
729
+ objects_path?: string | undefined;
730
+ };
731
+ } | undefined;
732
+ image_transformation?: {
733
+ enabled?: boolean | undefined;
734
+ } | undefined;
735
+ } | undefined, {
736
+ enabled?: boolean | undefined;
737
+ file_size_limit?: string | undefined;
738
+ buckets?: {
739
+ [x: string]: {
740
+ public?: boolean | undefined;
741
+ file_size_limit?: string | undefined;
742
+ allowed_mime_types?: string[] | undefined;
743
+ objects_path?: string | undefined;
744
+ };
745
+ } | undefined;
746
+ image_transformation?: {
747
+ enabled?: boolean | undefined;
748
+ } | undefined;
749
+ } | undefined>;
750
+ readonly studio: s.Schema<s.ISchemaOptions, {
751
+ enabled?: boolean | undefined;
752
+ port?: number | undefined;
753
+ api_url?: string | undefined;
754
+ openai_api_key?: string | undefined;
755
+ } | undefined, {
756
+ enabled?: boolean | undefined;
757
+ port?: number | undefined;
758
+ api_url?: string | undefined;
759
+ openai_api_key?: string | undefined;
760
+ } | undefined>;
761
+ readonly experimental: s.Schema<s.ISchemaOptions, {
762
+ orioledb_version?: string | undefined;
763
+ s3_host?: string | undefined;
764
+ s3_region?: string | undefined;
765
+ s3_access_key?: string | undefined;
766
+ s3_secret_key?: string | undefined;
767
+ } | undefined, {
768
+ orioledb_version?: string | undefined;
769
+ s3_host?: string | undefined;
770
+ s3_region?: string | undefined;
771
+ s3_access_key?: string | undefined;
772
+ s3_secret_key?: string | undefined;
773
+ } | undefined>;
774
+ }, s.Merge<s.IObjectOptions & {
775
+ additionalProperties: false;
776
+ }>>;
777
+ type Schema = s.Static<typeof schema>;
778
+ type DefaultSchema = s.StaticCoerced<typeof schema>;
779
+
780
+ type Where = Record<string, unknown>;
781
+
782
+ type PolicyCommand = "SELECT" | "INSERT" | "UPDATE" | "DELETE" | "ALL";
783
+ type PolicyRole = "anon" | "authenticated" | string;
784
+ interface PolicyData {
785
+ name: string;
786
+ table: string;
787
+ schema?: string;
788
+ command: PolicyCommand;
789
+ permissive: boolean;
790
+ roles: PolicyRole[];
791
+ using?: Where;
792
+ withCheck?: Where;
793
+ }
794
+ declare class Policy {
795
+ readonly data: PolicyData;
796
+ constructor(data: PolicyData);
797
+ appliesTo(cmd: "SELECT" | "INSERT" | "UPDATE" | "DELETE"): boolean;
798
+ appliesToRole(role: string): boolean;
799
+ toJSON(): PolicyData;
800
+ static fromJSON(data: PolicyData): Policy;
801
+ }
802
+
803
+ interface UsersTable {
804
+ id: string;
805
+ aud: string;
806
+ role: string;
807
+ email: string | null;
808
+ encrypted_password: string | null;
809
+ phone: string | null;
810
+ email_confirmed_at: string | null;
811
+ confirmed_at: string | null;
812
+ invited_at: string | null;
813
+ confirmation_token: string | null;
814
+ confirmation_sent_at: string | null;
815
+ recovery_token: string | null;
816
+ recovery_sent_at: string | null;
817
+ email_change: string | null;
818
+ email_change_token_new: string | null;
819
+ email_change_token_current: string | null;
820
+ email_change_sent_at: string | null;
821
+ email_change_confirm_status: number;
822
+ phone_confirmed_at: string | null;
823
+ phone_change: string | null;
824
+ phone_change_token: string | null;
825
+ phone_change_sent_at: string | null;
826
+ reauthentication_token: string | null;
827
+ reauthentication_sent_at: string | null;
828
+ raw_app_meta_data: string | Record<string, unknown>;
829
+ raw_user_meta_data: string | Record<string, unknown>;
830
+ banned_until: string | null;
831
+ deleted_at: string | null;
832
+ is_sso_user: boolean;
833
+ is_anonymous: boolean;
834
+ last_sign_in_at: string | null;
835
+ created_at: string;
836
+ updated_at: string;
837
+ }
838
+ interface SessionsTable {
839
+ id: string;
840
+ user_id: string;
841
+ not_after: string | null;
842
+ refreshed_at: string | null;
843
+ user_agent: string | null;
844
+ ip: string | null;
845
+ tag: string | null;
846
+ refresh_token_hmac_key: string | null;
847
+ refresh_token_counter: number | null;
848
+ scopes: string | null;
849
+ created_at: string;
850
+ updated_at: string;
851
+ aal: string | null;
852
+ factor_id: string | null;
853
+ }
854
+ interface RefreshTokensTable {
855
+ id: string;
856
+ token: string;
857
+ user_id: string;
858
+ session_id: string | null;
859
+ revoked: boolean;
860
+ parent: string | null;
861
+ created_at: string;
862
+ updated_at: string;
863
+ }
864
+ interface IdentitiesTable {
865
+ id: string;
866
+ provider: string;
867
+ provider_id: string;
868
+ user_id: string;
869
+ identity_data: string | Record<string, unknown>;
870
+ email?: string;
871
+ last_sign_in_at: string | null;
872
+ created_at: string;
873
+ updated_at: string;
874
+ }
875
+ interface UserResponse {
876
+ id: string;
877
+ aud: string;
878
+ role: string;
879
+ email: string;
880
+ phone: string;
881
+ confirmed_at?: string | null;
882
+ email_confirmed_at?: string | null;
883
+ last_sign_in_at?: string | null;
884
+ app_metadata: Record<string, unknown>;
885
+ user_metadata: Record<string, unknown>;
886
+ identities: IdentityResponse[];
887
+ created_at: string;
888
+ updated_at: string;
889
+ is_anonymous: boolean;
890
+ new_email?: string;
891
+ confirmation_sent_at?: string | null;
892
+ email_change_sent_at?: string | null;
893
+ recovery_sent_at?: string | null;
894
+ }
895
+ interface SessionResponse {
896
+ access_token: string;
897
+ refresh_token: string;
898
+ token_type: "bearer";
899
+ expires_in: number;
900
+ expires_at: number;
901
+ user: UserResponse;
902
+ weak_password?: null;
903
+ }
904
+ interface IdentityResponse {
905
+ identity_id: string;
906
+ id: string;
907
+ user_id: string;
908
+ identity_data: Record<string, unknown>;
909
+ provider: string;
910
+ last_sign_in_at: string | null;
911
+ created_at: string;
912
+ updated_at: string;
913
+ email?: string;
914
+ }
915
+ interface AuthConfig {
916
+ jwt_secret: string;
917
+ jwt_expiry?: number;
918
+ enable_refresh_token_rotation?: boolean;
919
+ refresh_token_reuse_interval?: number;
920
+ minimum_password_length?: number;
921
+ password_required_characters?: string[];
922
+ password_requirements?: string;
923
+ enable_signup?: boolean;
924
+ sessions?: {
925
+ timebox?: string;
926
+ inactivity_timeout?: string;
927
+ single_per_user?: boolean;
928
+ };
929
+ email?: {
930
+ enable_signup?: boolean;
931
+ enable_confirmations?: boolean;
932
+ double_confirm_changes?: boolean;
933
+ };
934
+ enable_confirmations?: boolean;
935
+ site_url?: string;
936
+ }
937
+
938
+ type Dialect$1 = "postgres" | "sqlite";
939
+ declare class AuthRepository {
940
+ private db;
941
+ private dialect;
942
+ private schema;
943
+ constructor(db: Kysely<any>, dialect: Dialect$1);
944
+ private bool;
945
+ private table;
946
+ private insertInto;
947
+ private update;
948
+ private deleteFrom;
949
+ findUserByEmail(email: string): Promise<UsersTable | null>;
950
+ findUserById(id: string): Promise<UsersTable | null>;
951
+ findUserByToken(column: string, token: string): Promise<UsersTable | null>;
952
+ createUser(user: Partial<UsersTable> & {
953
+ id: string;
954
+ email: string;
955
+ }): Promise<UsersTable>;
956
+ updateUser(id: string, updates: Partial<UsersTable>): Promise<UsersTable | null>;
957
+ createSession(session: {
958
+ id: string;
959
+ user_id: string;
960
+ aal?: string;
961
+ }): Promise<SessionsTable>;
962
+ findSessionById(id: string): Promise<SessionsTable | null>;
963
+ updateSessionRefreshedAt(id: string, refreshedAt: string): Promise<SessionsTable | null>;
964
+ deleteSession(id: string): Promise<void>;
965
+ deleteUserSessions(userId: string, exceptSessionId?: string): Promise<void>;
966
+ deleteRefreshTokensForSession(sessionId: string): Promise<void>;
967
+ deleteRefreshTokensForUser(userId: string, exceptSessionId?: string): Promise<void>;
968
+ createRefreshToken(rt: {
969
+ token: string;
970
+ user_id: string;
971
+ session_id: string;
972
+ parent?: string | null;
973
+ }): Promise<RefreshTokensTable>;
974
+ findRefreshToken(token: string): Promise<RefreshTokensTable | null>;
975
+ findRefreshTokensBySession(sessionId: string): Promise<RefreshTokensTable[]>;
976
+ revokeRefreshToken(id: string): Promise<void>;
977
+ revokeSessionRefreshTokens(sessionId: string): Promise<void>;
978
+ revokeRefreshTokensByIds(ids: string[]): Promise<void>;
979
+ revokeUserRefreshTokens(userId: string): Promise<void>;
980
+ createIdentity(identity: {
981
+ id: string;
982
+ provider: string;
983
+ provider_id: string;
984
+ user_id: string;
985
+ identity_data: Record<string, unknown>;
986
+ last_sign_in_at?: string | null;
987
+ }): Promise<IdentitiesTable>;
988
+ findIdentitiesByUserId(userId: string): Promise<IdentitiesTable[]>;
989
+ updateIdentity(id: string, updates: Partial<IdentitiesTable>): Promise<void>;
990
+ createAuditLogEntry(entry: {
991
+ id: string;
992
+ payload?: Record<string, unknown>;
993
+ ip_address?: string;
994
+ }): Promise<void>;
995
+ parseUserJson(user: UsersTable): UsersTable;
996
+ }
997
+
998
+ interface CacheSetOptions {
999
+ ttl?: number;
1000
+ }
1001
+ interface CacheDriver {
1002
+ get(key: string): Promise<string | undefined>;
1003
+ set(key: string, value: string, options?: CacheSetOptions): Promise<void>;
1004
+ delete(key: string): Promise<void>;
1005
+ }
1006
+
1007
+ interface EmailMessage {
1008
+ to: string;
1009
+ subject: string;
1010
+ text?: string;
1011
+ html?: string;
1012
+ }
1013
+ interface EmailDriver {
1014
+ send(message: EmailMessage): Promise<void>;
1015
+ }
1016
+
1017
+ interface SmsMessage {
1018
+ to: string;
1019
+ body: string;
1020
+ }
1021
+ interface SmsDriver {
1022
+ send(message: SmsMessage): Promise<void>;
1023
+ }
1024
+
1025
+ interface AppDrivers {
1026
+ email: EmailDriver;
1027
+ sms: SmsDriver;
1028
+ cache: CacheDriver;
1029
+ }
1030
+ type PartialAppDrivers = Partial<AppDrivers>;
1031
+
1032
+ interface Mailer {
1033
+ sendConfirmation(email: string, token: string, otp: string, meta?: MailMeta): Promise<void>;
1034
+ sendRecovery(email: string, token: string, otp: string, meta?: MailMeta): Promise<void>;
1035
+ sendMagicLink(email: string, token: string, otp: string, meta?: MailMeta): Promise<void>;
1036
+ sendEmailChange(email: string, token: string, otp: string, meta?: MailMeta): Promise<void>;
1037
+ sendReauthentication(email: string, otp: string, meta?: MailMeta): Promise<void>;
1038
+ }
1039
+ interface MailMeta {
1040
+ userId?: string;
1041
+ emailActionType?: string;
1042
+ tokenHash?: string;
1043
+ tokenNew?: string;
1044
+ tokenHashNew?: string;
1045
+ redirectTo?: string;
1046
+ }
1047
+
1048
+ declare class AuthService {
1049
+ repo: AuthRepository;
1050
+ private config;
1051
+ private mailer;
1052
+ private jwtExpiry;
1053
+ private minPasswordLength;
1054
+ private passwordRequiredCharacters;
1055
+ private sessionTimeboxSeconds?;
1056
+ private sessionInactivitySeconds?;
1057
+ constructor(repo: AuthRepository, config: AuthConfig, mailer: Mailer);
1058
+ signUp(email: string | undefined, password: string | undefined, data?: Record<string, unknown>): Promise<{
1059
+ user: UserResponse;
1060
+ session?: SessionResponse;
1061
+ }>;
1062
+ signInWithPassword(email: string | undefined, password: string | undefined): Promise<SessionResponse>;
1063
+ refreshSession(refreshToken: string | undefined): Promise<SessionResponse>;
1064
+ private refreshWithRevokedToken;
1065
+ private createRefreshResponse;
1066
+ private assertSessionRefreshable;
1067
+ getUser(userId: string): Promise<UserResponse>;
1068
+ updateUser(userId: string, updates: {
1069
+ data?: Record<string, unknown>;
1070
+ password?: string;
1071
+ email?: string;
1072
+ }): Promise<UserResponse>;
1073
+ signOut(sessionId: string | undefined, scope: string | undefined, userId: string): Promise<void>;
1074
+ signInWithOtp(email: string | undefined, options?: {
1075
+ shouldCreateUser?: boolean;
1076
+ }): Promise<void>;
1077
+ requestMagicLink(email: string | undefined, _security?: Record<string, unknown>): Promise<void>;
1078
+ verifyOtp(params: {
1079
+ email?: string;
1080
+ token?: string;
1081
+ token_hash?: string;
1082
+ type: string;
1083
+ }): Promise<SessionResponse>;
1084
+ recover(email: string | undefined): Promise<void>;
1085
+ resend(type: string, email: string | undefined): Promise<void>;
1086
+ reauthenticate(userId: string): Promise<void>;
1087
+ private createSessionForUser;
1088
+ private assertPasswordStrong;
1089
+ private mapUserToResponse;
1090
+ private mapIdentityToResponse;
1091
+ private findUserByTokenAndType;
1092
+ private otpMatchesStoredTokenHash;
1093
+ private getTokenColumnsForType;
1094
+ private createAuditLog;
1095
+ }
1096
+
1097
+ type CrossReadableStream = ReadableStream | ReadableStream$1;
1098
+ interface ObjectMetadata {
1099
+ cacheControl: string;
1100
+ contentLength: number;
1101
+ size: number;
1102
+ mimetype: string;
1103
+ lastModified?: Date;
1104
+ eTag: string;
1105
+ contentRange?: string;
1106
+ httpStatusCode?: number;
1107
+ }
1108
+ interface BrowserCacheHeaders {
1109
+ ifModifiedSince?: string;
1110
+ ifNoneMatch?: string;
1111
+ range?: string;
1112
+ }
1113
+ interface ObjectResponse {
1114
+ metadata: ObjectMetadata;
1115
+ httpStatusCode: number;
1116
+ body?: CrossReadableStream | Blob | Buffer;
1117
+ }
1118
+ type StorageAdapterOptions = {};
1119
+ interface StorageAdapter<Options extends StorageAdapterOptions = StorageAdapterOptions, Driver = unknown> {
1120
+ driver: Driver;
1121
+ getObject(bucketName: string, key: string, version: string | undefined, headers?: BrowserCacheHeaders): Promise<ObjectResponse>;
1122
+ uploadObject(bucketName: string, key: string, version: string | undefined, body: CrossReadableStream | Buffer | Uint8Array, contentType: string, cacheControl: string): Promise<ObjectMetadata>;
1123
+ deleteObject(bucket: string, key: string, version: string | undefined): Promise<void>;
1124
+ deleteObjects(bucket: string, prefixes: string[]): Promise<void>;
1125
+ copyObject(bucket: string, source: string, version: string | undefined, destination: string, destinationVersion: string | undefined): Promise<Pick<ObjectMetadata, "httpStatusCode" | "eTag" | "lastModified">>;
1126
+ headObject(bucket: string, key: string, version: string | undefined): Promise<ObjectMetadata>;
1127
+ privateAssetUrl(bucket: string, key: string, version: string | undefined): Promise<string>;
1128
+ }
1129
+
1130
+ interface TransformOptions {
1131
+ width?: number;
1132
+ height?: number;
1133
+ resize?: "cover" | "contain" | "fill";
1134
+ format?: "webp" | "png" | "jpeg" | "avif";
1135
+ quality?: number;
1136
+ }
1137
+ interface TransformResult {
1138
+ body: ReadableStream | Uint8Array;
1139
+ contentType: string;
1140
+ /** Only set when body is a Uint8Array */
1141
+ contentLength?: number;
1142
+ }
1143
+ interface TransformationAdapterOptions {
1144
+ }
1145
+ interface TransformationAdapter<Options extends TransformationAdapterOptions = TransformationAdapterOptions, Driver = unknown> {
1146
+ driver: Driver;
1147
+ /**
1148
+ * Whether this adapter requires the full image buffer upfront.
1149
+ * If false, the service will pass the stream/url through without buffering.
1150
+ * - sharp: true (needs buffer)
1151
+ * - cloudflare: false (transforms via URL subrequest)
1152
+ */
1153
+ requiresBuffer: boolean;
1154
+ /**
1155
+ * Transform from a buffer. Used when requiresBuffer is true.
1156
+ */
1157
+ transform(input: Uint8Array, options: TransformOptions): Promise<TransformResult>;
1158
+ /**
1159
+ * Transform from a URL or Response. Used when requiresBuffer is false.
1160
+ * Adapters that don't support this should set requiresBuffer=true.
1161
+ */
1162
+ transformFromUrl?(url: string, options: TransformOptions): Promise<TransformResult>;
1163
+ }
1164
+
1165
+ type Dialect = "postgres" | "sqlite";
1166
+ interface Bucket {
1167
+ id: string;
1168
+ name: string;
1169
+ owner: string | null;
1170
+ owner_id: string | null;
1171
+ public: boolean;
1172
+ file_size_limit: number | null;
1173
+ allowed_mime_types: string[] | null;
1174
+ created_at: string;
1175
+ updated_at: string;
1176
+ }
1177
+ interface StorageObject {
1178
+ id: string;
1179
+ bucket_id: string;
1180
+ name: string;
1181
+ owner: string | null;
1182
+ owner_id: string | null;
1183
+ metadata: Record<string, unknown>;
1184
+ user_metadata: Record<string, unknown>;
1185
+ path_tokens: string[];
1186
+ version: string | null;
1187
+ created_at: string;
1188
+ updated_at: string;
1189
+ last_accessed_at: string;
1190
+ }
1191
+ interface ListObjectsOptions {
1192
+ limit?: number;
1193
+ offset?: number;
1194
+ sortBy?: {
1195
+ column: string;
1196
+ order: "asc" | "desc";
1197
+ };
1198
+ search?: string;
1199
+ }
1200
+ declare class StorageRepository {
1201
+ private db;
1202
+ private dialect;
1203
+ private schema;
1204
+ constructor(db: Kysely<any>, dialect: Dialect);
1205
+ private table;
1206
+ private insertInto;
1207
+ private update;
1208
+ private deleteFrom;
1209
+ createBucket(bucket: {
1210
+ id: string;
1211
+ name: string;
1212
+ owner?: string | null;
1213
+ owner_id?: string | null;
1214
+ public?: boolean;
1215
+ file_size_limit?: number | null;
1216
+ allowed_mime_types?: string[];
1217
+ }): Promise<Bucket>;
1218
+ findBucketById(id: string): Promise<Bucket | null>;
1219
+ findBucketByName(name: string): Promise<Bucket | null>;
1220
+ listBuckets(): Promise<Bucket[]>;
1221
+ updateBucket(id: string, updates: Partial<{
1222
+ public: boolean;
1223
+ file_size_limit: number | null;
1224
+ allowed_mime_types: string[];
1225
+ }>): Promise<Bucket | null>;
1226
+ deleteBucket(id: string): Promise<void>;
1227
+ isBucketEmpty(id: string): Promise<boolean>;
1228
+ createObject(obj: {
1229
+ id: string;
1230
+ bucket_id: string;
1231
+ name: string;
1232
+ owner?: string | null;
1233
+ owner_id?: string | null;
1234
+ metadata?: Record<string, unknown>;
1235
+ user_metadata?: Record<string, unknown>;
1236
+ version?: string | null;
1237
+ }): Promise<StorageObject>;
1238
+ findObjectById(id: string): Promise<StorageObject | null>;
1239
+ findObjectByPath(bucketId: string, name: string): Promise<StorageObject | null>;
1240
+ listObjects(bucketId: string, prefix?: string, options?: ListObjectsOptions): Promise<StorageObject[]>;
1241
+ updateObject(id: string, updates: Partial<{
1242
+ name: string;
1243
+ metadata: Record<string, unknown>;
1244
+ user_metadata: Record<string, unknown>;
1245
+ version: string | null;
1246
+ owner: string | null;
1247
+ owner_id: string | null;
1248
+ }>): Promise<StorageObject | null>;
1249
+ deleteObject(id: string): Promise<void>;
1250
+ deleteObjectsByBucket(bucketId: string): Promise<string[]>;
1251
+ objectExists(bucketId: string, name: string): Promise<boolean>;
1252
+ touchObject(id: string): Promise<void>;
1253
+ private parseBucketRow;
1254
+ private parseObjectRow;
1255
+ }
1256
+
1257
+ interface StorageServiceConfig {
1258
+ jwtSecret: string;
1259
+ fileSizeLimit?: number;
1260
+ buckets?: Record<string, {
1261
+ public?: boolean;
1262
+ file_size_limit?: string;
1263
+ allowed_mime_types?: string[];
1264
+ }>;
1265
+ }
1266
+ interface StorageServiceOptions {
1267
+ autoCreateBuckets?: boolean;
1268
+ }
1269
+ declare class StorageService {
1270
+ private repo;
1271
+ private adapter;
1272
+ private config;
1273
+ private options;
1274
+ private transformationAdapter?;
1275
+ private initialized;
1276
+ constructor(repo: StorageRepository, adapter: StorageAdapter, config: StorageServiceConfig, options?: StorageServiceOptions, transformationAdapter?: TransformationAdapter | undefined);
1277
+ init(): Promise<void>;
1278
+ createBucket(params: {
1279
+ id: string;
1280
+ name: string;
1281
+ public?: boolean;
1282
+ file_size_limit?: number | null;
1283
+ allowed_mime_types?: string[];
1284
+ owner?: string | null;
1285
+ }): Promise<Bucket>;
1286
+ getBucket(id: string): Promise<Bucket>;
1287
+ listBuckets(): Promise<Bucket[]>;
1288
+ updateBucket(id: string, updates: {
1289
+ public?: boolean;
1290
+ file_size_limit?: number | null;
1291
+ allowed_mime_types?: string[];
1292
+ }): Promise<Bucket>;
1293
+ deleteBucket(id: string): Promise<void>;
1294
+ emptyBucket(id: string): Promise<void>;
1295
+ upload(bucketId: string, path: string, body: ReadableStream | Buffer | Uint8Array, options?: {
1296
+ contentType?: string;
1297
+ cacheControl?: string;
1298
+ contentLength?: number;
1299
+ upsert?: boolean;
1300
+ metadata?: Record<string, unknown>;
1301
+ owner?: string | null;
1302
+ }): Promise<StorageObject>;
1303
+ download(bucketId: string, path: string, options?: {
1304
+ transform?: TransformOptions;
1305
+ }): Promise<{
1306
+ body: CrossReadableStream | Blob | Buffer | Uint8Array;
1307
+ metadata: ObjectMetadata;
1308
+ }>;
1309
+ update(bucketId: string, path: string, body: ReadableStream | Buffer | Uint8Array, options?: {
1310
+ contentType?: string;
1311
+ cacheControl?: string;
1312
+ contentLength?: number;
1313
+ metadata?: Record<string, unknown>;
1314
+ upsert?: boolean;
1315
+ owner?: string | null;
1316
+ }): Promise<StorageObject>;
1317
+ remove(bucketId: string, paths: string[]): Promise<StorageObject[]>;
1318
+ list(bucketId: string, prefix?: string, options?: ListObjectsOptions): Promise<StorageObject[]>;
1319
+ move(bucketId: string, fromPath: string, toPath: string): Promise<void>;
1320
+ copy(bucketId: string, fromPath: string, toPath: string): Promise<{
1321
+ key: string;
1322
+ }>;
1323
+ info(bucketId: string, path: string): Promise<StorageObject & {
1324
+ httpMetadata: ObjectMetadata;
1325
+ }>;
1326
+ exists(bucketId: string, path: string): Promise<boolean>;
1327
+ createSignedUrl(bucketId: string, path: string, expiresIn: number): Promise<{
1328
+ signedUrl: string;
1329
+ }>;
1330
+ createSignedUrls(bucketId: string, paths: string[], expiresIn: number): Promise<{
1331
+ path: string;
1332
+ signedUrl: string;
1333
+ error: string | null;
1334
+ }[]>;
1335
+ createSignedUploadUrl(bucketId: string, path: string): Promise<{
1336
+ signedUrl: string;
1337
+ token: string;
1338
+ path: string;
1339
+ }>;
1340
+ verifySignedUrl(token: string): Promise<{
1341
+ bucket: string;
1342
+ path: string;
1343
+ intent: "download" | "upload";
1344
+ }>;
1345
+ private signStorageToken;
1346
+ }
1347
+
1348
+ type HonoContext = {
1349
+ Variables: {
1350
+ app: App;
1351
+ authService: AuthService;
1352
+ storageService: StorageService;
1353
+ userId?: string;
1354
+ sessionId?: string;
1355
+ jwt?: Record<string, unknown>;
1356
+ };
1357
+ };
1358
+
1359
+ type ServerOptions = {
1360
+ middlewares?: MiddlewareHandler<HonoContext>[];
1361
+ disableStudio?: boolean;
1362
+ disableFallback?: boolean;
1363
+ /**
1364
+ * Test-only PostgREST mode: execute each request in a transaction and roll it back.
1365
+ */
1366
+ forceRollback?: boolean;
1367
+ };
1368
+ declare function createServer(app: App, options?: ServerOptions): hono_hono_base.HonoBase<HonoContext & {
1369
+ Variables: {
1370
+ userId: string;
1371
+ sessionId: string;
1372
+ jwt: Record<string, unknown>;
1373
+ };
1374
+ }, hono_types.BlankSchema | hono_types.MergeSchemaPath<{
1375
+ "*": {
1376
+ $options: {
1377
+ input: {};
1378
+ output: null;
1379
+ outputFormat: "body";
1380
+ status: 204;
1381
+ };
1382
+ };
1383
+ } & {
1384
+ "/signup": {
1385
+ $post: {
1386
+ input: {};
1387
+ output: {
1388
+ access_token: string;
1389
+ refresh_token: string;
1390
+ token_type: "bearer";
1391
+ expires_in: number;
1392
+ expires_at: number;
1393
+ user: {
1394
+ id: string;
1395
+ aud: string;
1396
+ role: string;
1397
+ email: string;
1398
+ phone: string;
1399
+ confirmed_at?: string | null | undefined;
1400
+ email_confirmed_at?: string | null | undefined;
1401
+ last_sign_in_at?: string | null | undefined;
1402
+ app_metadata: {
1403
+ [x: string]: hono_utils_types.JSONValue;
1404
+ };
1405
+ user_metadata: {
1406
+ [x: string]: hono_utils_types.JSONValue;
1407
+ };
1408
+ identities: {
1409
+ identity_id: string;
1410
+ id: string;
1411
+ user_id: string;
1412
+ identity_data: {
1413
+ [x: string]: hono_utils_types.JSONValue;
1414
+ };
1415
+ provider: string;
1416
+ last_sign_in_at: string | null;
1417
+ created_at: string;
1418
+ updated_at: string;
1419
+ email?: string | undefined;
1420
+ }[];
1421
+ created_at: string;
1422
+ updated_at: string;
1423
+ is_anonymous: boolean;
1424
+ new_email?: string | undefined;
1425
+ confirmation_sent_at?: string | null | undefined;
1426
+ email_change_sent_at?: string | null | undefined;
1427
+ recovery_sent_at?: string | null | undefined;
1428
+ };
1429
+ weak_password?: null | undefined;
1430
+ };
1431
+ outputFormat: "json";
1432
+ status: 200;
1433
+ } | {
1434
+ input: {};
1435
+ output: {
1436
+ id: string;
1437
+ aud: string;
1438
+ role: string;
1439
+ email: string;
1440
+ phone: string;
1441
+ confirmed_at?: string | null | undefined;
1442
+ email_confirmed_at?: string | null | undefined;
1443
+ last_sign_in_at?: string | null | undefined;
1444
+ app_metadata: {
1445
+ [x: string]: hono_utils_types.JSONValue;
1446
+ };
1447
+ user_metadata: {
1448
+ [x: string]: hono_utils_types.JSONValue;
1449
+ };
1450
+ identities: {
1451
+ identity_id: string;
1452
+ id: string;
1453
+ user_id: string;
1454
+ identity_data: {
1455
+ [x: string]: hono_utils_types.JSONValue;
1456
+ };
1457
+ provider: string;
1458
+ last_sign_in_at: string | null;
1459
+ created_at: string;
1460
+ updated_at: string;
1461
+ email?: string | undefined;
1462
+ }[];
1463
+ created_at: string;
1464
+ updated_at: string;
1465
+ is_anonymous: boolean;
1466
+ new_email?: string | undefined;
1467
+ confirmation_sent_at?: string | null | undefined;
1468
+ email_change_sent_at?: string | null | undefined;
1469
+ recovery_sent_at?: string | null | undefined;
1470
+ };
1471
+ outputFormat: "json";
1472
+ status: 200;
1473
+ };
1474
+ };
1475
+ } & {
1476
+ "/signup": {
1477
+ $all: {
1478
+ input: {};
1479
+ output: {};
1480
+ outputFormat: string;
1481
+ status: hono_utils_http_status.StatusCode;
1482
+ };
1483
+ };
1484
+ } & {
1485
+ "/token": {
1486
+ $post: {
1487
+ input: {};
1488
+ output: {
1489
+ access_token: string;
1490
+ refresh_token: string;
1491
+ token_type: "bearer";
1492
+ expires_in: number;
1493
+ expires_at: number;
1494
+ user: {
1495
+ id: string;
1496
+ aud: string;
1497
+ role: string;
1498
+ email: string;
1499
+ phone: string;
1500
+ confirmed_at?: string | null | undefined;
1501
+ email_confirmed_at?: string | null | undefined;
1502
+ last_sign_in_at?: string | null | undefined;
1503
+ app_metadata: {
1504
+ [x: string]: hono_utils_types.JSONValue;
1505
+ };
1506
+ user_metadata: {
1507
+ [x: string]: hono_utils_types.JSONValue;
1508
+ };
1509
+ identities: {
1510
+ identity_id: string;
1511
+ id: string;
1512
+ user_id: string;
1513
+ identity_data: {
1514
+ [x: string]: hono_utils_types.JSONValue;
1515
+ };
1516
+ provider: string;
1517
+ last_sign_in_at: string | null;
1518
+ created_at: string;
1519
+ updated_at: string;
1520
+ email?: string | undefined;
1521
+ }[];
1522
+ created_at: string;
1523
+ updated_at: string;
1524
+ is_anonymous: boolean;
1525
+ new_email?: string | undefined;
1526
+ confirmation_sent_at?: string | null | undefined;
1527
+ email_change_sent_at?: string | null | undefined;
1528
+ recovery_sent_at?: string | null | undefined;
1529
+ };
1530
+ weak_password?: null | undefined;
1531
+ };
1532
+ outputFormat: "json";
1533
+ status: 200;
1534
+ };
1535
+ };
1536
+ } & {
1537
+ "/token": {
1538
+ $all: {
1539
+ input: {};
1540
+ output: {};
1541
+ outputFormat: string;
1542
+ status: hono_utils_http_status.StatusCode;
1543
+ };
1544
+ };
1545
+ } & {
1546
+ "/otp": {
1547
+ $post: {
1548
+ input: {};
1549
+ output: {};
1550
+ outputFormat: "json";
1551
+ status: 200;
1552
+ };
1553
+ };
1554
+ } & {
1555
+ "/magiclink": {
1556
+ $post: {
1557
+ input: {};
1558
+ output: {};
1559
+ outputFormat: "json";
1560
+ status: 200;
1561
+ };
1562
+ };
1563
+ } & {
1564
+ "/magiclink": {
1565
+ $all: {
1566
+ input: {};
1567
+ output: {};
1568
+ outputFormat: string;
1569
+ status: hono_utils_http_status.StatusCode;
1570
+ };
1571
+ };
1572
+ } & {
1573
+ "/verify": {
1574
+ $post: {
1575
+ input: {};
1576
+ output: {
1577
+ access_token: string;
1578
+ refresh_token: string;
1579
+ token_type: "bearer";
1580
+ expires_in: number;
1581
+ expires_at: number;
1582
+ user: {
1583
+ id: string;
1584
+ aud: string;
1585
+ role: string;
1586
+ email: string;
1587
+ phone: string;
1588
+ confirmed_at?: string | null | undefined;
1589
+ email_confirmed_at?: string | null | undefined;
1590
+ last_sign_in_at?: string | null | undefined;
1591
+ app_metadata: {
1592
+ [x: string]: hono_utils_types.JSONValue;
1593
+ };
1594
+ user_metadata: {
1595
+ [x: string]: hono_utils_types.JSONValue;
1596
+ };
1597
+ identities: {
1598
+ identity_id: string;
1599
+ id: string;
1600
+ user_id: string;
1601
+ identity_data: {
1602
+ [x: string]: hono_utils_types.JSONValue;
1603
+ };
1604
+ provider: string;
1605
+ last_sign_in_at: string | null;
1606
+ created_at: string;
1607
+ updated_at: string;
1608
+ email?: string | undefined;
1609
+ }[];
1610
+ created_at: string;
1611
+ updated_at: string;
1612
+ is_anonymous: boolean;
1613
+ new_email?: string | undefined;
1614
+ confirmation_sent_at?: string | null | undefined;
1615
+ email_change_sent_at?: string | null | undefined;
1616
+ recovery_sent_at?: string | null | undefined;
1617
+ };
1618
+ weak_password?: null | undefined;
1619
+ };
1620
+ outputFormat: "json";
1621
+ status: 200;
1622
+ };
1623
+ };
1624
+ } & {
1625
+ "/recover": {
1626
+ $post: {
1627
+ input: {};
1628
+ output: {};
1629
+ outputFormat: "json";
1630
+ status: 200;
1631
+ };
1632
+ };
1633
+ } & {
1634
+ "/resend": {
1635
+ $post: {
1636
+ input: {};
1637
+ output: {};
1638
+ outputFormat: "json";
1639
+ status: 200;
1640
+ };
1641
+ };
1642
+ } & {
1643
+ "/health": {
1644
+ $get: {
1645
+ input: {};
1646
+ output: {
1647
+ version: string;
1648
+ name: string;
1649
+ description: string;
1650
+ };
1651
+ outputFormat: "json";
1652
+ status: 200;
1653
+ };
1654
+ };
1655
+ } & {
1656
+ "/health": {
1657
+ $all: {
1658
+ input: {};
1659
+ output: {};
1660
+ outputFormat: string;
1661
+ status: hono_utils_http_status.StatusCode;
1662
+ };
1663
+ };
1664
+ } & {
1665
+ "/settings": {
1666
+ $get: {
1667
+ input: {};
1668
+ output: {
1669
+ external: {
1670
+ anonymous_users: boolean;
1671
+ apple: boolean;
1672
+ azure: boolean;
1673
+ bitbucket: boolean;
1674
+ discord: boolean;
1675
+ facebook: boolean;
1676
+ snapchat: boolean;
1677
+ figma: boolean;
1678
+ fly: boolean;
1679
+ github: boolean;
1680
+ gitlab: boolean;
1681
+ google: boolean;
1682
+ keycloak: boolean;
1683
+ kakao: boolean;
1684
+ linkedin: boolean;
1685
+ linkedin_oidc: boolean;
1686
+ notion: boolean;
1687
+ spotify: boolean;
1688
+ slack: boolean;
1689
+ slack_oidc: boolean;
1690
+ workos: boolean;
1691
+ twitch: boolean;
1692
+ twitter: boolean;
1693
+ email: boolean;
1694
+ phone: boolean;
1695
+ zoom: boolean;
1696
+ };
1697
+ disable_signup: boolean;
1698
+ mailer_autoconfirm: boolean;
1699
+ phone_autoconfirm: boolean;
1700
+ sms_provider: string;
1701
+ saml_enabled: boolean;
1702
+ };
1703
+ outputFormat: "json";
1704
+ status: 200;
1705
+ };
1706
+ };
1707
+ } & {
1708
+ "/settings": {
1709
+ $all: {
1710
+ input: {};
1711
+ output: {};
1712
+ outputFormat: string;
1713
+ status: hono_utils_http_status.StatusCode;
1714
+ };
1715
+ };
1716
+ } & {
1717
+ "/.well-known/jwks.json": {
1718
+ $get: {
1719
+ input: {};
1720
+ output: never;
1721
+ outputFormat: "json";
1722
+ status: 200;
1723
+ };
1724
+ };
1725
+ } & {
1726
+ "/.well-known/openid-configuration": {
1727
+ $get: {
1728
+ input: {};
1729
+ output: {
1730
+ issuer: string;
1731
+ jwks_uri: string;
1732
+ };
1733
+ outputFormat: "json";
1734
+ status: 200;
1735
+ };
1736
+ };
1737
+ } & {
1738
+ "/nonexistent": {
1739
+ $all: {
1740
+ input: {};
1741
+ output: {};
1742
+ outputFormat: string;
1743
+ status: hono_utils_http_status.StatusCode;
1744
+ };
1745
+ };
1746
+ } & {
1747
+ "/logout": {
1748
+ $post: {
1749
+ input: {};
1750
+ output: null;
1751
+ outputFormat: "body";
1752
+ status: 204;
1753
+ };
1754
+ };
1755
+ } & {
1756
+ "/user": {
1757
+ $get: {
1758
+ input: {};
1759
+ output: {
1760
+ id: string;
1761
+ aud: string;
1762
+ role: string;
1763
+ email: string;
1764
+ phone: string;
1765
+ confirmed_at?: string | null | undefined;
1766
+ email_confirmed_at?: string | null | undefined;
1767
+ last_sign_in_at?: string | null | undefined;
1768
+ app_metadata: {
1769
+ [x: string]: hono_utils_types.JSONValue;
1770
+ };
1771
+ user_metadata: {
1772
+ [x: string]: hono_utils_types.JSONValue;
1773
+ };
1774
+ identities: {
1775
+ identity_id: string;
1776
+ id: string;
1777
+ user_id: string;
1778
+ identity_data: {
1779
+ [x: string]: hono_utils_types.JSONValue;
1780
+ };
1781
+ provider: string;
1782
+ last_sign_in_at: string | null;
1783
+ created_at: string;
1784
+ updated_at: string;
1785
+ email?: string | undefined;
1786
+ }[];
1787
+ created_at: string;
1788
+ updated_at: string;
1789
+ is_anonymous: boolean;
1790
+ new_email?: string | undefined;
1791
+ confirmation_sent_at?: string | null | undefined;
1792
+ email_change_sent_at?: string | null | undefined;
1793
+ recovery_sent_at?: string | null | undefined;
1794
+ };
1795
+ outputFormat: "json";
1796
+ status: 200;
1797
+ };
1798
+ };
1799
+ } & {
1800
+ "/user": {
1801
+ $put: {
1802
+ input: {};
1803
+ output: {
1804
+ id: string;
1805
+ aud: string;
1806
+ role: string;
1807
+ email: string;
1808
+ phone: string;
1809
+ confirmed_at?: string | null | undefined;
1810
+ email_confirmed_at?: string | null | undefined;
1811
+ last_sign_in_at?: string | null | undefined;
1812
+ app_metadata: {
1813
+ [x: string]: hono_utils_types.JSONValue;
1814
+ };
1815
+ user_metadata: {
1816
+ [x: string]: hono_utils_types.JSONValue;
1817
+ };
1818
+ identities: {
1819
+ identity_id: string;
1820
+ id: string;
1821
+ user_id: string;
1822
+ identity_data: {
1823
+ [x: string]: hono_utils_types.JSONValue;
1824
+ };
1825
+ provider: string;
1826
+ last_sign_in_at: string | null;
1827
+ created_at: string;
1828
+ updated_at: string;
1829
+ email?: string | undefined;
1830
+ }[];
1831
+ created_at: string;
1832
+ updated_at: string;
1833
+ is_anonymous: boolean;
1834
+ new_email?: string | undefined;
1835
+ confirmation_sent_at?: string | null | undefined;
1836
+ email_change_sent_at?: string | null | undefined;
1837
+ recovery_sent_at?: string | null | undefined;
1838
+ };
1839
+ outputFormat: "json";
1840
+ status: 200;
1841
+ };
1842
+ };
1843
+ } & {
1844
+ "/user": {
1845
+ $all: {
1846
+ input: {};
1847
+ output: {};
1848
+ outputFormat: string;
1849
+ status: hono_utils_http_status.StatusCode;
1850
+ };
1851
+ };
1852
+ } & {
1853
+ "/reauthenticate": {
1854
+ $get: {
1855
+ input: {};
1856
+ output: {};
1857
+ outputFormat: "json";
1858
+ status: 200;
1859
+ };
1860
+ };
1861
+ } & {
1862
+ "/reauthenticate": {
1863
+ $all: {
1864
+ input: {};
1865
+ output: {};
1866
+ outputFormat: string;
1867
+ status: hono_utils_http_status.StatusCode;
1868
+ };
1869
+ };
1870
+ }, "/auth/v1"> | hono_types.MergeSchemaPath<{
1871
+ "/:relation": {
1872
+ $all: {
1873
+ input: {
1874
+ param: {
1875
+ relation: string;
1876
+ };
1877
+ };
1878
+ output: {};
1879
+ outputFormat: string;
1880
+ status: hono_utils_http_status.StatusCode;
1881
+ };
1882
+ };
1883
+ } & {
1884
+ "*": {
1885
+ $all: {
1886
+ input: {};
1887
+ output: {};
1888
+ outputFormat: string;
1889
+ status: hono_utils_http_status.StatusCode;
1890
+ };
1891
+ };
1892
+ }, "/rest/v1"> | hono_types.MergeSchemaPath<hono_types.BlankSchema | hono_types.MergeSchemaPath<{
1893
+ "/object/public/:bucketId/*": {
1894
+ $get: {
1895
+ input: {
1896
+ param: {
1897
+ bucketId: string;
1898
+ };
1899
+ };
1900
+ output: {};
1901
+ outputFormat: string;
1902
+ status: hono_utils_http_status.StatusCode;
1903
+ };
1904
+ };
1905
+ } & {
1906
+ "/object/sign/:bucketId/*": {
1907
+ $get: {
1908
+ input: {
1909
+ param: {
1910
+ bucketId: string;
1911
+ };
1912
+ };
1913
+ output: {};
1914
+ outputFormat: string;
1915
+ status: hono_utils_http_status.StatusCode;
1916
+ };
1917
+ };
1918
+ } & {
1919
+ "/object/upload/sign/:bucketId/*": {
1920
+ $put: {
1921
+ input: {
1922
+ param: {
1923
+ bucketId: string;
1924
+ };
1925
+ };
1926
+ output: {
1927
+ error: string;
1928
+ };
1929
+ outputFormat: "json";
1930
+ status: 400;
1931
+ } | {
1932
+ input: {
1933
+ param: {
1934
+ bucketId: string;
1935
+ };
1936
+ };
1937
+ output: {
1938
+ error: string;
1939
+ };
1940
+ outputFormat: "json";
1941
+ status: 403;
1942
+ } | {
1943
+ input: {
1944
+ param: {
1945
+ bucketId: string;
1946
+ };
1947
+ };
1948
+ output: {
1949
+ Key: string;
1950
+ };
1951
+ outputFormat: "json";
1952
+ status: 200;
1953
+ };
1954
+ };
1955
+ }, "/"> | hono_types.MergeSchemaPath<{
1956
+ "/bucket": {
1957
+ $post: {
1958
+ input: {
1959
+ json: {
1960
+ [x: string]: unknown;
1961
+ public?: boolean | undefined;
1962
+ file_size_limit?: number | undefined;
1963
+ allowed_mime_types?: string[] | undefined;
1964
+ id: string;
1965
+ name: string;
1966
+ };
1967
+ };
1968
+ output: {
1969
+ name: string;
1970
+ };
1971
+ outputFormat: "json";
1972
+ status: 200;
1973
+ };
1974
+ };
1975
+ } & {
1976
+ "/bucket": {
1977
+ $get: {
1978
+ input: {};
1979
+ output: {
1980
+ id: string;
1981
+ name: string;
1982
+ owner: string | null;
1983
+ owner_id: string | null;
1984
+ public: boolean;
1985
+ file_size_limit: number | null;
1986
+ allowed_mime_types: string[] | null;
1987
+ created_at: string;
1988
+ updated_at: string;
1989
+ }[];
1990
+ outputFormat: "json";
1991
+ status: 200;
1992
+ };
1993
+ };
1994
+ } & {
1995
+ "/bucket/:id": {
1996
+ $get: {
1997
+ input: {
1998
+ param: {
1999
+ id: string;
2000
+ };
2001
+ };
2002
+ output: {
2003
+ id: string;
2004
+ name: string;
2005
+ owner: string | null;
2006
+ owner_id: string | null;
2007
+ public: boolean;
2008
+ file_size_limit: number | null;
2009
+ allowed_mime_types: string[] | null;
2010
+ created_at: string;
2011
+ updated_at: string;
2012
+ };
2013
+ outputFormat: "json";
2014
+ status: 200;
2015
+ };
2016
+ };
2017
+ } & {
2018
+ "/bucket/:id": {
2019
+ $put: {
2020
+ input: {
2021
+ json: {
2022
+ [x: string]: unknown;
2023
+ public?: boolean | undefined;
2024
+ file_size_limit?: number | undefined;
2025
+ allowed_mime_types?: string[] | undefined;
2026
+ };
2027
+ } & {
2028
+ param: {
2029
+ id: string;
2030
+ };
2031
+ };
2032
+ output: {
2033
+ message: string;
2034
+ };
2035
+ outputFormat: "json";
2036
+ status: 200;
2037
+ };
2038
+ };
2039
+ } & {
2040
+ "/bucket/:id": {
2041
+ $delete: {
2042
+ input: {
2043
+ param: {
2044
+ id: string;
2045
+ };
2046
+ };
2047
+ output: {
2048
+ message: string;
2049
+ };
2050
+ outputFormat: "json";
2051
+ status: 200;
2052
+ };
2053
+ };
2054
+ } & {
2055
+ "/bucket/:id/empty": {
2056
+ $post: {
2057
+ input: {
2058
+ param: {
2059
+ id: string;
2060
+ };
2061
+ };
2062
+ output: {
2063
+ message: string;
2064
+ };
2065
+ outputFormat: "json";
2066
+ status: 200;
2067
+ };
2068
+ };
2069
+ } & {
2070
+ "/object/list/:bucketId": {
2071
+ $post: {
2072
+ input: {
2073
+ json: {
2074
+ [x: string]: unknown;
2075
+ search?: string | undefined;
2076
+ prefix?: string | undefined;
2077
+ limit?: number | undefined;
2078
+ offset?: number | undefined;
2079
+ sortBy?: {
2080
+ [x: string]: unknown;
2081
+ column: string;
2082
+ order: string;
2083
+ } | undefined;
2084
+ };
2085
+ } & {
2086
+ param: {
2087
+ bucketId: string;
2088
+ };
2089
+ };
2090
+ output: {
2091
+ id: string;
2092
+ bucket_id: string;
2093
+ name: string;
2094
+ owner: string | null;
2095
+ owner_id: string | null;
2096
+ metadata: {
2097
+ [x: string]: hono_utils_types.JSONValue;
2098
+ };
2099
+ user_metadata: {
2100
+ [x: string]: hono_utils_types.JSONValue;
2101
+ };
2102
+ path_tokens: string[];
2103
+ version: string | null;
2104
+ created_at: string;
2105
+ updated_at: string;
2106
+ last_accessed_at: string;
2107
+ }[];
2108
+ outputFormat: "json";
2109
+ status: 200;
2110
+ };
2111
+ };
2112
+ } & {
2113
+ "/object/move": {
2114
+ $post: {
2115
+ input: {
2116
+ json: {
2117
+ [x: string]: unknown;
2118
+ bucketId: string;
2119
+ sourceKey: string;
2120
+ destinationKey: string;
2121
+ };
2122
+ };
2123
+ output: {
2124
+ message: string;
2125
+ };
2126
+ outputFormat: "json";
2127
+ status: 200;
2128
+ };
2129
+ };
2130
+ } & {
2131
+ "/object/copy": {
2132
+ $post: {
2133
+ input: {
2134
+ json: {
2135
+ [x: string]: unknown;
2136
+ bucketId: string;
2137
+ sourceKey: string;
2138
+ destinationKey: string;
2139
+ };
2140
+ };
2141
+ output: {
2142
+ key: string;
2143
+ };
2144
+ outputFormat: "json";
2145
+ status: 200;
2146
+ };
2147
+ };
2148
+ } & {
2149
+ "/object/info/:bucketId/*": {
2150
+ $get: {
2151
+ input: {
2152
+ param: {
2153
+ bucketId: string;
2154
+ };
2155
+ };
2156
+ output: {
2157
+ id: string;
2158
+ bucket_id: string;
2159
+ name: string;
2160
+ owner: string | null;
2161
+ owner_id: string | null;
2162
+ metadata: {
2163
+ [x: string]: hono_utils_types.JSONValue;
2164
+ };
2165
+ user_metadata: {
2166
+ [x: string]: hono_utils_types.JSONValue;
2167
+ };
2168
+ path_tokens: string[];
2169
+ version: string | null;
2170
+ created_at: string;
2171
+ updated_at: string;
2172
+ last_accessed_at: string;
2173
+ httpMetadata: {
2174
+ cacheControl: string;
2175
+ contentLength: number;
2176
+ size: number;
2177
+ mimetype: string;
2178
+ lastModified?: string | undefined;
2179
+ eTag: string;
2180
+ contentRange?: string | undefined;
2181
+ httpStatusCode?: number | undefined;
2182
+ };
2183
+ };
2184
+ outputFormat: "json";
2185
+ status: 200;
2186
+ };
2187
+ };
2188
+ } & {
2189
+ "/object/sign/:bucketId/*": {
2190
+ $post: {
2191
+ input: {
2192
+ json: {
2193
+ [x: string]: unknown;
2194
+ expiresIn: number;
2195
+ };
2196
+ } & {
2197
+ param: {
2198
+ bucketId: string;
2199
+ };
2200
+ };
2201
+ output: {
2202
+ signedUrl: string;
2203
+ };
2204
+ outputFormat: "json";
2205
+ status: 200;
2206
+ };
2207
+ };
2208
+ } & {
2209
+ "/object/sign/:bucketId": {
2210
+ $post: {
2211
+ input: {
2212
+ json: {
2213
+ [x: string]: unknown;
2214
+ expiresIn: number;
2215
+ paths: string[];
2216
+ };
2217
+ } & {
2218
+ param: {
2219
+ bucketId: string;
2220
+ };
2221
+ };
2222
+ output: {
2223
+ path: string;
2224
+ signedUrl: string;
2225
+ error: string | null;
2226
+ }[];
2227
+ outputFormat: "json";
2228
+ status: 200;
2229
+ };
2230
+ };
2231
+ } & {
2232
+ "/object/upload/sign/:bucketId/*": {
2233
+ $post: {
2234
+ input: {
2235
+ param: {
2236
+ bucketId: string;
2237
+ };
2238
+ };
2239
+ output: {
2240
+ signedUrl: string;
2241
+ token: string;
2242
+ path: string;
2243
+ };
2244
+ outputFormat: "json";
2245
+ status: 200;
2246
+ };
2247
+ };
2248
+ } & {
2249
+ "/object/:bucketId": {
2250
+ $delete: {
2251
+ input: {
2252
+ json: {
2253
+ [x: string]: unknown;
2254
+ prefixes: string[];
2255
+ };
2256
+ } & {
2257
+ param: {
2258
+ bucketId: string;
2259
+ };
2260
+ };
2261
+ output: {
2262
+ id: string;
2263
+ bucket_id: string;
2264
+ name: string;
2265
+ owner: string | null;
2266
+ owner_id: string | null;
2267
+ metadata: {
2268
+ [x: string]: hono_utils_types.JSONValue;
2269
+ };
2270
+ user_metadata: {
2271
+ [x: string]: hono_utils_types.JSONValue;
2272
+ };
2273
+ path_tokens: string[];
2274
+ version: string | null;
2275
+ created_at: string;
2276
+ updated_at: string;
2277
+ last_accessed_at: string;
2278
+ }[];
2279
+ outputFormat: "json";
2280
+ status: 200;
2281
+ };
2282
+ };
2283
+ } & {
2284
+ "/object/:bucketId/*": {
2285
+ $post: {
2286
+ input: {
2287
+ param: {
2288
+ bucketId: string;
2289
+ };
2290
+ };
2291
+ output: {
2292
+ Key: string;
2293
+ Id: string;
2294
+ };
2295
+ outputFormat: "json";
2296
+ status: 200;
2297
+ };
2298
+ };
2299
+ } & {
2300
+ "/object/:bucketId/*": {
2301
+ $put: {
2302
+ input: {
2303
+ param: {
2304
+ bucketId: string;
2305
+ };
2306
+ };
2307
+ output: {
2308
+ Key: string;
2309
+ Id: string;
2310
+ };
2311
+ outputFormat: "json";
2312
+ status: 200;
2313
+ };
2314
+ };
2315
+ } & {
2316
+ "/object/:bucketId/*": {
2317
+ $get: {
2318
+ input: {
2319
+ param: {
2320
+ bucketId: string;
2321
+ };
2322
+ };
2323
+ output: {};
2324
+ outputFormat: string;
2325
+ status: hono_utils_http_status.StatusCode;
2326
+ };
2327
+ };
2328
+ } & {
2329
+ "/object/:bucketId/*": {
2330
+ $head: {
2331
+ input: {
2332
+ param: {
2333
+ bucketId: string;
2334
+ };
2335
+ };
2336
+ output: null;
2337
+ outputFormat: "body";
2338
+ status: 200;
2339
+ } | {
2340
+ input: {
2341
+ param: {
2342
+ bucketId: string;
2343
+ };
2344
+ };
2345
+ output: null;
2346
+ outputFormat: "body";
2347
+ status: 404;
2348
+ };
2349
+ };
2350
+ }, "/">, "/storage/v1"> | hono_types.MergeSchemaPath<{
2351
+ "/ping": {
2352
+ $get: {
2353
+ input: {};
2354
+ output: {
2355
+ message: string;
2356
+ };
2357
+ outputFormat: "json";
2358
+ status: hono_utils_http_status.ContentfulStatusCode;
2359
+ };
2360
+ };
2361
+ } & {
2362
+ "/config": {
2363
+ $get: {
2364
+ input: {};
2365
+ output: {
2366
+ project_id?: string | undefined;
2367
+ analytics?: {
2368
+ enabled?: boolean | undefined;
2369
+ port?: number | undefined;
2370
+ vector_port?: number | undefined;
2371
+ backend?: "postgres" | "bigquery" | undefined;
2372
+ } | undefined;
2373
+ api?: {
2374
+ enabled?: boolean | undefined;
2375
+ port?: number | undefined;
2376
+ schemas?: string[] | undefined;
2377
+ extra_search_path?: string[] | undefined;
2378
+ max_rows?: number | undefined;
2379
+ pg_safe_update?: boolean | undefined;
2380
+ plan_enabled?: boolean | undefined;
2381
+ aggregates_enabled?: boolean | undefined;
2382
+ limited_mutations_enabled?: boolean | undefined;
2383
+ anonymous_enabled?: boolean | undefined;
2384
+ external_url?: string | undefined;
2385
+ tls?: {
2386
+ enabled?: boolean | undefined;
2387
+ } | undefined;
2388
+ } | undefined;
2389
+ storage?: {
2390
+ enabled?: boolean | undefined;
2391
+ file_size_limit?: string | undefined;
2392
+ buckets?: {
2393
+ [x: string]: {
2394
+ public?: boolean | undefined;
2395
+ file_size_limit?: string | undefined;
2396
+ allowed_mime_types?: string[] | undefined;
2397
+ objects_path?: string | undefined;
2398
+ };
2399
+ } | undefined;
2400
+ image_transformation?: {
2401
+ enabled?: boolean | undefined;
2402
+ } | undefined;
2403
+ } | undefined;
2404
+ auth?: {
2405
+ enabled?: boolean | undefined;
2406
+ jwt_secret?: string | undefined;
2407
+ site_url?: string | undefined;
2408
+ additional_redirect_urls?: string[] | undefined;
2409
+ jwt_expiry?: number | undefined;
2410
+ enable_refresh_token_rotation?: boolean | undefined;
2411
+ refresh_token_reuse_interval?: number | undefined;
2412
+ enable_manual_linking?: boolean | undefined;
2413
+ enable_signup?: boolean | undefined;
2414
+ enable_anonymous_sign_ins?: boolean | undefined;
2415
+ minimum_password_length?: number | undefined;
2416
+ password_requirements?: string | undefined;
2417
+ hook?: {
2418
+ mfa_verification_attempt?: {
2419
+ enabled?: boolean | undefined;
2420
+ uri?: string | undefined;
2421
+ secrets?: string[] | undefined;
2422
+ } | undefined;
2423
+ password_verification_attempt?: {
2424
+ enabled?: boolean | undefined;
2425
+ uri?: string | undefined;
2426
+ secrets?: string[] | undefined;
2427
+ } | undefined;
2428
+ custom_access_token?: {
2429
+ enabled?: boolean | undefined;
2430
+ uri?: string | undefined;
2431
+ secrets?: string[] | undefined;
2432
+ } | undefined;
2433
+ send_sms?: {
2434
+ enabled?: boolean | undefined;
2435
+ uri?: string | undefined;
2436
+ secrets?: string[] | undefined;
2437
+ } | undefined;
2438
+ send_email?: {
2439
+ enabled?: boolean | undefined;
2440
+ uri?: string | undefined;
2441
+ secrets?: string[] | undefined;
2442
+ } | undefined;
2443
+ } | undefined;
2444
+ mfa?: {
2445
+ max_enrolled_factors?: number | undefined;
2446
+ totp?: {
2447
+ enroll_enabled?: boolean | undefined;
2448
+ verify_enabled?: boolean | undefined;
2449
+ } | undefined;
2450
+ phone?: {
2451
+ template?: string | undefined;
2452
+ enroll_enabled?: boolean | undefined;
2453
+ verify_enabled?: boolean | undefined;
2454
+ otp_length?: number | undefined;
2455
+ max_frequency?: string | undefined;
2456
+ } | undefined;
2457
+ } | undefined;
2458
+ sessions?: {
2459
+ timebox?: string | undefined;
2460
+ inactivity_timeout?: string | undefined;
2461
+ single_per_user?: boolean | undefined;
2462
+ } | undefined;
2463
+ email?: {
2464
+ template?: {
2465
+ invite?: {
2466
+ subject?: string | undefined;
2467
+ content_path?: string | undefined;
2468
+ } | undefined;
2469
+ confirmation?: {
2470
+ subject?: string | undefined;
2471
+ content_path?: string | undefined;
2472
+ } | undefined;
2473
+ recovery?: {
2474
+ subject?: string | undefined;
2475
+ content_path?: string | undefined;
2476
+ } | undefined;
2477
+ magic_link?: {
2478
+ subject?: string | undefined;
2479
+ content_path?: string | undefined;
2480
+ } | undefined;
2481
+ email_change?: {
2482
+ subject?: string | undefined;
2483
+ content_path?: string | undefined;
2484
+ } | undefined;
2485
+ } | undefined;
2486
+ enable_signup?: boolean | undefined;
2487
+ otp_length?: number | undefined;
2488
+ max_frequency?: string | undefined;
2489
+ double_confirm_changes?: boolean | undefined;
2490
+ enable_confirmations?: boolean | undefined;
2491
+ secure_password_change?: boolean | undefined;
2492
+ otp_expiry?: number | undefined;
2493
+ smtp?: {
2494
+ port?: number | undefined;
2495
+ host?: string | undefined;
2496
+ user?: string | undefined;
2497
+ pass?: string | undefined;
2498
+ admin_email?: string | undefined;
2499
+ sender_name?: string | undefined;
2500
+ } | undefined;
2501
+ } | undefined;
2502
+ sms?: {
2503
+ template?: string | undefined;
2504
+ enable_signup?: boolean | undefined;
2505
+ max_frequency?: string | undefined;
2506
+ enable_confirmations?: boolean | undefined;
2507
+ test_otp?: {
2508
+ [x: string]: string;
2509
+ } | undefined;
2510
+ twilio?: {
2511
+ enabled?: boolean | undefined;
2512
+ account_sid?: string | undefined;
2513
+ message_service_sid?: string | undefined;
2514
+ auth_token?: string | undefined;
2515
+ } | undefined;
2516
+ twilio_verify?: {
2517
+ enabled?: boolean | undefined;
2518
+ account_sid?: string | undefined;
2519
+ message_service_sid?: string | undefined;
2520
+ auth_token?: string | undefined;
2521
+ } | undefined;
2522
+ messagebird?: {
2523
+ enabled?: boolean | undefined;
2524
+ originator?: string | undefined;
2525
+ api_key?: string | undefined;
2526
+ } | undefined;
2527
+ textlocal?: {
2528
+ enabled?: boolean | undefined;
2529
+ api_key?: string | undefined;
2530
+ sender?: string | undefined;
2531
+ } | undefined;
2532
+ vonage?: {
2533
+ enabled?: boolean | undefined;
2534
+ api_key?: string | undefined;
2535
+ from?: string | undefined;
2536
+ api_secret?: string | undefined;
2537
+ } | undefined;
2538
+ } | undefined;
2539
+ external?: {
2540
+ apple?: {
2541
+ enabled?: boolean | undefined;
2542
+ client_id?: string | undefined;
2543
+ secret?: string | undefined;
2544
+ url?: string | undefined;
2545
+ redirect_uri?: string | undefined;
2546
+ skip_nonce_check?: boolean | undefined;
2547
+ } | undefined;
2548
+ azure?: {
2549
+ enabled?: boolean | undefined;
2550
+ client_id?: string | undefined;
2551
+ secret?: string | undefined;
2552
+ url?: string | undefined;
2553
+ redirect_uri?: string | undefined;
2554
+ skip_nonce_check?: boolean | undefined;
2555
+ } | undefined;
2556
+ bitbucket?: {
2557
+ enabled?: boolean | undefined;
2558
+ client_id?: string | undefined;
2559
+ secret?: string | undefined;
2560
+ url?: string | undefined;
2561
+ redirect_uri?: string | undefined;
2562
+ skip_nonce_check?: boolean | undefined;
2563
+ } | undefined;
2564
+ discord?: {
2565
+ enabled?: boolean | undefined;
2566
+ client_id?: string | undefined;
2567
+ secret?: string | undefined;
2568
+ url?: string | undefined;
2569
+ redirect_uri?: string | undefined;
2570
+ skip_nonce_check?: boolean | undefined;
2571
+ } | undefined;
2572
+ facebook?: {
2573
+ enabled?: boolean | undefined;
2574
+ client_id?: string | undefined;
2575
+ secret?: string | undefined;
2576
+ url?: string | undefined;
2577
+ redirect_uri?: string | undefined;
2578
+ skip_nonce_check?: boolean | undefined;
2579
+ } | undefined;
2580
+ github?: {
2581
+ enabled?: boolean | undefined;
2582
+ client_id?: string | undefined;
2583
+ secret?: string | undefined;
2584
+ url?: string | undefined;
2585
+ redirect_uri?: string | undefined;
2586
+ skip_nonce_check?: boolean | undefined;
2587
+ } | undefined;
2588
+ gitlab?: {
2589
+ enabled?: boolean | undefined;
2590
+ client_id?: string | undefined;
2591
+ secret?: string | undefined;
2592
+ url?: string | undefined;
2593
+ redirect_uri?: string | undefined;
2594
+ skip_nonce_check?: boolean | undefined;
2595
+ } | undefined;
2596
+ google?: {
2597
+ enabled?: boolean | undefined;
2598
+ client_id?: string | undefined;
2599
+ secret?: string | undefined;
2600
+ url?: string | undefined;
2601
+ redirect_uri?: string | undefined;
2602
+ skip_nonce_check?: boolean | undefined;
2603
+ } | undefined;
2604
+ kakao?: {
2605
+ enabled?: boolean | undefined;
2606
+ client_id?: string | undefined;
2607
+ secret?: string | undefined;
2608
+ url?: string | undefined;
2609
+ redirect_uri?: string | undefined;
2610
+ skip_nonce_check?: boolean | undefined;
2611
+ } | undefined;
2612
+ keycloak?: {
2613
+ enabled?: boolean | undefined;
2614
+ client_id?: string | undefined;
2615
+ secret?: string | undefined;
2616
+ url?: string | undefined;
2617
+ redirect_uri?: string | undefined;
2618
+ skip_nonce_check?: boolean | undefined;
2619
+ } | undefined;
2620
+ linkedin?: {
2621
+ enabled?: boolean | undefined;
2622
+ client_id?: string | undefined;
2623
+ secret?: string | undefined;
2624
+ url?: string | undefined;
2625
+ redirect_uri?: string | undefined;
2626
+ skip_nonce_check?: boolean | undefined;
2627
+ } | undefined;
2628
+ notion?: {
2629
+ enabled?: boolean | undefined;
2630
+ client_id?: string | undefined;
2631
+ secret?: string | undefined;
2632
+ url?: string | undefined;
2633
+ redirect_uri?: string | undefined;
2634
+ skip_nonce_check?: boolean | undefined;
2635
+ } | undefined;
2636
+ twitch?: {
2637
+ enabled?: boolean | undefined;
2638
+ client_id?: string | undefined;
2639
+ secret?: string | undefined;
2640
+ url?: string | undefined;
2641
+ redirect_uri?: string | undefined;
2642
+ skip_nonce_check?: boolean | undefined;
2643
+ } | undefined;
2644
+ twitter?: {
2645
+ enabled?: boolean | undefined;
2646
+ client_id?: string | undefined;
2647
+ secret?: string | undefined;
2648
+ url?: string | undefined;
2649
+ redirect_uri?: string | undefined;
2650
+ skip_nonce_check?: boolean | undefined;
2651
+ } | undefined;
2652
+ slack?: {
2653
+ enabled?: boolean | undefined;
2654
+ client_id?: string | undefined;
2655
+ secret?: string | undefined;
2656
+ url?: string | undefined;
2657
+ redirect_uri?: string | undefined;
2658
+ skip_nonce_check?: boolean | undefined;
2659
+ } | undefined;
2660
+ spotify?: {
2661
+ enabled?: boolean | undefined;
2662
+ client_id?: string | undefined;
2663
+ secret?: string | undefined;
2664
+ url?: string | undefined;
2665
+ redirect_uri?: string | undefined;
2666
+ skip_nonce_check?: boolean | undefined;
2667
+ } | undefined;
2668
+ workos?: {
2669
+ enabled?: boolean | undefined;
2670
+ client_id?: string | undefined;
2671
+ secret?: string | undefined;
2672
+ url?: string | undefined;
2673
+ redirect_uri?: string | undefined;
2674
+ skip_nonce_check?: boolean | undefined;
2675
+ } | undefined;
2676
+ zoom?: {
2677
+ enabled?: boolean | undefined;
2678
+ client_id?: string | undefined;
2679
+ secret?: string | undefined;
2680
+ url?: string | undefined;
2681
+ redirect_uri?: string | undefined;
2682
+ skip_nonce_check?: boolean | undefined;
2683
+ } | undefined;
2684
+ } | undefined;
2685
+ } | undefined;
2686
+ inbucket?: {
2687
+ enabled?: boolean | undefined;
2688
+ port?: number | undefined;
2689
+ smtp_port?: number | undefined;
2690
+ pop3_port?: number | undefined;
2691
+ } | undefined;
2692
+ functions?: {
2693
+ [x: string]: {
2694
+ enabled?: boolean | undefined;
2695
+ verify_jwt?: boolean | undefined;
2696
+ import_map?: string | undefined;
2697
+ entrypoint?: string | undefined;
2698
+ };
2699
+ } | undefined;
2700
+ realtime?: {
2701
+ enabled?: boolean | undefined;
2702
+ ip_version?: string | undefined;
2703
+ max_header_length?: number | undefined;
2704
+ } | undefined;
2705
+ studio?: {
2706
+ enabled?: boolean | undefined;
2707
+ port?: number | undefined;
2708
+ api_url?: string | undefined;
2709
+ openai_api_key?: string | undefined;
2710
+ } | undefined;
2711
+ experimental?: {
2712
+ orioledb_version?: string | undefined;
2713
+ s3_host?: string | undefined;
2714
+ s3_region?: string | undefined;
2715
+ s3_access_key?: string | undefined;
2716
+ s3_secret_key?: string | undefined;
2717
+ } | undefined;
2718
+ db?: {
2719
+ [x: string]: hono_utils_types.JSONValue;
2720
+ port?: number | undefined;
2721
+ url?: string | undefined;
2722
+ driver?: "postgres" | "sqlite" | "sqlite-postgres" | "pglite" | undefined;
2723
+ shadow_port?: number | undefined;
2724
+ major_version?: number | undefined;
2725
+ pooler?: {
2726
+ [x: string]: hono_utils_types.JSONValue;
2727
+ enabled?: boolean | undefined;
2728
+ port?: number | undefined;
2729
+ pool_mode?: string | undefined;
2730
+ default_pool_size?: number | undefined;
2731
+ max_client_conn?: number | undefined;
2732
+ } | undefined;
2733
+ seed?: {
2734
+ enabled?: boolean | undefined;
2735
+ sql_paths?: string[] | undefined;
2736
+ } | undefined;
2737
+ migrations?: {
2738
+ enabled?: boolean | undefined;
2739
+ schema_paths?: string[] | undefined;
2740
+ } | undefined;
2741
+ } | undefined;
2742
+ edge_runtime?: {
2743
+ enabled?: boolean | undefined;
2744
+ policy?: "oneshot" | "per_worker" | undefined;
2745
+ inspector_port?: number | undefined;
2746
+ } | undefined;
2747
+ options?: {
2748
+ defaults?: true | undefined;
2749
+ server?: {
2750
+ middlewares?: never[] | undefined;
2751
+ disableStudio?: boolean | undefined;
2752
+ disableFallback?: boolean | undefined;
2753
+ forceRollback?: boolean | undefined;
2754
+ } | undefined;
2755
+ drivers?: {
2756
+ email?: {
2757
+ send: never;
2758
+ } | undefined;
2759
+ sms?: {
2760
+ send: never;
2761
+ } | undefined;
2762
+ cache?: {
2763
+ get: never;
2764
+ set: never;
2765
+ delete: never;
2766
+ } | undefined;
2767
+ } | undefined;
2768
+ } | undefined;
2769
+ rls?: {
2770
+ tables: string[];
2771
+ policies: {
2772
+ name: string;
2773
+ table: string;
2774
+ schema?: string | undefined;
2775
+ command: PolicyCommand;
2776
+ permissive: boolean;
2777
+ roles: PolicyRole[];
2778
+ using?: {
2779
+ [x: string]: hono_utils_types.JSONValue;
2780
+ } | undefined;
2781
+ withCheck?: {
2782
+ [x: string]: hono_utils_types.JSONValue;
2783
+ } | undefined;
2784
+ }[];
2785
+ } | undefined;
2786
+ };
2787
+ outputFormat: "json";
2788
+ status: hono_utils_http_status.ContentfulStatusCode;
2789
+ };
2790
+ };
2791
+ } & {
2792
+ "/info": {
2793
+ $get: {
2794
+ input: {};
2795
+ output: {};
2796
+ outputFormat: "json";
2797
+ status: hono_utils_http_status.ContentfulStatusCode;
2798
+ };
2799
+ };
2800
+ } & {
2801
+ "/introspect": {
2802
+ $get: {
2803
+ input: {};
2804
+ output: {
2805
+ tables: {
2806
+ name: string;
2807
+ sql: string;
2808
+ schema: string;
2809
+ type: "table" | "view";
2810
+ rows: number;
2811
+ engine: string;
2812
+ collation: string;
2813
+ }[];
2814
+ columns: {
2815
+ table: string;
2816
+ name: string;
2817
+ type: string;
2818
+ nullable: boolean;
2819
+ default_value: string | null;
2820
+ is_primary_key: boolean;
2821
+ schema: string;
2822
+ ordinal_position: number;
2823
+ collation: string;
2824
+ character_maximum_length: string | null;
2825
+ precision: {
2826
+ precision: number | null;
2827
+ scale: number | null;
2828
+ } | null;
2829
+ is_identity: boolean;
2830
+ pg_type?: string | undefined;
2831
+ is_generated?: boolean | undefined;
2832
+ }[];
2833
+ indexes: {
2834
+ table: string;
2835
+ name: string;
2836
+ unique: boolean;
2837
+ columns: string[];
2838
+ schema: string;
2839
+ }[];
2840
+ foreign_keys: {
2841
+ table: string;
2842
+ column: string;
2843
+ ref_table: string;
2844
+ ref_column: string;
2845
+ on_update: string;
2846
+ on_delete: string;
2847
+ schema: string;
2848
+ ref_schema?: string | undefined;
2849
+ foreign_key_name: string;
2850
+ fk_def: string;
2851
+ is_visible?: boolean | undefined;
2852
+ }[];
2853
+ primary_keys: {
2854
+ table: string;
2855
+ columns: string[];
2856
+ schema: string;
2857
+ field_count: number;
2858
+ }[];
2859
+ views: {
2860
+ name: string;
2861
+ sql: string;
2862
+ schema: string;
2863
+ }[];
2864
+ check_constraints: {
2865
+ schema: string;
2866
+ table: string;
2867
+ expression: string;
2868
+ name?: string | undefined;
2869
+ column?: string | undefined;
2870
+ }[];
2871
+ unique_constraints: {
2872
+ schema: string;
2873
+ table: string;
2874
+ name: string;
2875
+ columns: string[];
2876
+ }[];
2877
+ comments: {
2878
+ schema: string;
2879
+ table: string;
2880
+ column?: string | undefined;
2881
+ text: string;
2882
+ }[];
2883
+ custom_types: {
2884
+ schema: string;
2885
+ type: string;
2886
+ kind: "enum" | "composite";
2887
+ values?: string[] | undefined;
2888
+ fields?: {
2889
+ name: string;
2890
+ type: string;
2891
+ }[] | undefined;
2892
+ }[];
2893
+ triggers: {
2894
+ table: string;
2895
+ name: string;
2896
+ sql: string;
2897
+ schema: string;
2898
+ }[];
2899
+ database_name: string;
2900
+ version: string;
2901
+ ddl_dialect?: "postgres" | "sqlite" | undefined;
2902
+ schema_separator?: string | undefined;
2903
+ };
2904
+ outputFormat: "json";
2905
+ status: hono_utils_http_status.ContentfulStatusCode;
2906
+ };
2907
+ };
2908
+ }, "/_system">, "/", "*">;
2909
+
2910
+ interface IAppConfig extends DefaultSchema {
2911
+ connection: Connection | Promise<Connection>;
2912
+ rls?: {
2913
+ tables: string[];
2914
+ policies: Policy[];
2915
+ };
2916
+ options?: {
2917
+ /**
2918
+ * Disable default config values from being applied.
2919
+ */
2920
+ defaults?: boolean;
2921
+ server?: ServerOptions;
2922
+ drivers?: PartialAppDrivers;
2923
+ };
2924
+ }
2925
+ interface DefaultAppConfig extends IAppConfig {
2926
+ connection: Connection;
2927
+ options?: {
2928
+ defaults?: true;
2929
+ server?: ServerOptions;
2930
+ drivers?: PartialAppDrivers;
2931
+ };
2932
+ }
2933
+ declare class App<Config extends IAppConfig = DefaultAppConfig, Conn = Config extends IAppConfig ? Config["connection"] extends Connection ? Config["connection"] : Config["connection"] extends Promise<Connection> ? Awaited<Config["connection"]> : Connection : never> {
2934
+ #private;
2935
+ private readonly _connection;
2936
+ private readonly _rls;
2937
+ readonly config: DefaultSchema & Omit<Config, "connection">;
2938
+ readonly server: ReturnType<typeof createServer>;
2939
+ readonly drivers: AppDrivers;
2940
+ _mailer?: Mailer;
2941
+ _storageAdapter?: StorageAdapter;
2942
+ _transformationAdapter?: TransformationAdapter;
2943
+ constructor({ connection, options, rls, ...config }: Config);
2944
+ get connection(): Conn;
2945
+ /**
2946
+ * Initialize the app. This is called automatically on first request.
2947
+ */
2948
+ init(): Promise<this>;
2949
+ isValidConfig(config: Schema | DefaultSchema | IAppConfig): boolean;
2950
+ getClient<SchemaName extends string = "public">(options?: SupabaseClientOptions<SchemaName>): _supabase_supabase_js.SupabaseClient<any, "public", SchemaName, Omit<any, "__InternalSupabase">[SchemaName] extends {
2951
+ Tables: Record<string, {
2952
+ Row: Record<string, unknown>;
2953
+ Insert: Record<string, unknown>;
2954
+ Update: Record<string, unknown>;
2955
+ Relationships: {
2956
+ foreignKeyName: string;
2957
+ columns: string[];
2958
+ isOneToOne?: boolean;
2959
+ referencedRelation: string;
2960
+ referencedColumns: string[];
2961
+ }[];
2962
+ }>;
2963
+ Views: Record<string, {
2964
+ Row: Record<string, unknown>;
2965
+ Insert: Record<string, unknown>;
2966
+ Update: Record<string, unknown>;
2967
+ Relationships: {
2968
+ foreignKeyName: string;
2969
+ columns: string[];
2970
+ isOneToOne?: boolean;
2971
+ referencedRelation: string;
2972
+ referencedColumns: string[];
2973
+ }[];
2974
+ } | {
2975
+ Row: Record<string, unknown>;
2976
+ Relationships: {
2977
+ foreignKeyName: string;
2978
+ columns: string[];
2979
+ isOneToOne?: boolean;
2980
+ referencedRelation: string;
2981
+ referencedColumns: string[];
2982
+ }[];
2983
+ }>;
2984
+ Functions: Record<string, {
2985
+ Args: Record<string, unknown> | never;
2986
+ Returns: unknown;
2987
+ SetofOptions?: {
2988
+ isSetofReturn?: boolean | undefined;
2989
+ isOneToOne?: boolean | undefined;
2990
+ isNotNullable?: boolean | undefined;
2991
+ to: string;
2992
+ from: string;
2993
+ };
2994
+ }>;
2995
+ } ? Omit<any, "__InternalSupabase">[SchemaName] : never, any>;
2996
+ isLocalRequest(request: Request): boolean;
2997
+ fetch: (request: Request) => Promise<Response>;
2998
+ getInfoJson(): {
2999
+ connection: object;
3000
+ config: Config;
3001
+ };
3002
+ }
3003
+
3004
+ declare const DEFAULT_PREFIXES: string[];
3005
+ declare function honoMiddleware(app: App, prefixes?: string[]): Connect.NextHandleFunction;
3006
+
3007
+ type SupaliteOptions = {
3008
+ config?: string;
3009
+ migrateOnBoot?: boolean;
3010
+ watchSchema?: boolean;
3011
+ forceSchema?: boolean;
3012
+ initOnBoot?: boolean;
3013
+ prefixes?: string[];
3014
+ };
3015
+ declare function supalite(options?: SupaliteOptions): Plugin;
3016
+
3017
+ export { DEFAULT_PREFIXES, type SupaliteOptions, supalite as default, honoMiddleware, supalite };