@vestcards/server-types 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@ declare const app: Elysia<"", {
65
65
  route: string;
66
66
  request: Request;
67
67
  store: {};
68
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
68
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
69
69
  readonly 100: "Continue";
70
70
  readonly 101: "Switching Protocols";
71
71
  readonly 102: "Processing";
@@ -237,7 +237,7 @@ declare const app: Elysia<"", {
237
237
  route: string;
238
238
  request: Request;
239
239
  store: {};
240
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
240
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
241
241
  readonly 100: "Continue";
242
242
  readonly 101: "Switching Protocols";
243
243
  readonly 102: "Processing";
@@ -395,6 +395,11 @@ declare const app: Elysia<"", {
395
395
  };
396
396
  headers: unknown;
397
397
  response: {
398
+ 200: {
399
+ data: import("@vestcards/shared").IDeck[];
400
+ pageCount: number;
401
+ total: number;
402
+ };
398
403
  422: {
399
404
  type: "validation";
400
405
  on: string;
@@ -404,26 +409,6 @@ declare const app: Elysia<"", {
404
409
  property?: string;
405
410
  expected?: string;
406
411
  };
407
- 200: {
408
- error: string;
409
- message: string;
410
- path: any;
411
- details?: undefined;
412
- } | {
413
- error: string;
414
- message: string;
415
- details: any;
416
- path?: undefined;
417
- } | {
418
- error: string;
419
- message: string;
420
- path?: undefined;
421
- details?: undefined;
422
- } | {
423
- data: import("@vestcards/shared").IDeck[];
424
- pageCount: number;
425
- total: number;
426
- };
427
412
  };
428
413
  };
429
414
  };
@@ -440,6 +425,7 @@ declare const app: Elysia<"", {
440
425
  query: {};
441
426
  headers: {};
442
427
  response: {
428
+ 200: import("@vestcards/shared").IDeckDetail;
443
429
  422: {
444
430
  type: "validation";
445
431
  on: string;
@@ -449,22 +435,6 @@ declare const app: Elysia<"", {
449
435
  property?: string;
450
436
  expected?: string;
451
437
  };
452
- 200: {
453
- error: string;
454
- message: string;
455
- path: any;
456
- details?: undefined;
457
- } | {
458
- error: string;
459
- message: string;
460
- details: any;
461
- path?: undefined;
462
- } | {
463
- error: string;
464
- message: string;
465
- path?: undefined;
466
- details?: undefined;
467
- } | import("@vestcards/shared").IDeckDetail;
468
438
  };
469
439
  };
470
440
  };
@@ -490,6 +460,11 @@ declare const app: Elysia<"", {
490
460
  };
491
461
  headers: unknown;
492
462
  response: {
463
+ 200: {
464
+ data: import("@vestcards/shared").Topic[];
465
+ pageCount: number;
466
+ total: number;
467
+ };
493
468
  422: {
494
469
  type: "validation";
495
470
  on: string;
@@ -499,26 +474,6 @@ declare const app: Elysia<"", {
499
474
  property?: string;
500
475
  expected?: string;
501
476
  };
502
- 200: {
503
- error: string;
504
- message: string;
505
- path: any;
506
- details?: undefined;
507
- } | {
508
- error: string;
509
- message: string;
510
- details: any;
511
- path?: undefined;
512
- } | {
513
- error: string;
514
- message: string;
515
- path?: undefined;
516
- details?: undefined;
517
- } | {
518
- data: import("@vestcards/shared").Topic[];
519
- pageCount: number;
520
- total: number;
521
- };
522
477
  };
523
478
  };
524
479
  };
@@ -540,6 +495,7 @@ declare const app: Elysia<"", {
540
495
  };
541
496
  headers: {};
542
497
  response: {
498
+ 200: import("./types/study").SessionData;
543
499
  422: {
544
500
  type: "validation";
545
501
  on: string;
@@ -549,22 +505,6 @@ declare const app: Elysia<"", {
549
505
  property?: string;
550
506
  expected?: string;
551
507
  };
552
- 200: {
553
- error: string;
554
- message: string;
555
- path: any;
556
- details?: undefined;
557
- } | {
558
- error: string;
559
- message: string;
560
- details: any;
561
- path?: undefined;
562
- } | {
563
- error: string;
564
- message: string;
565
- path?: undefined;
566
- details?: undefined;
567
- } | import("./types/study").SessionData;
568
508
  };
569
509
  };
570
510
  };
@@ -583,6 +523,13 @@ declare const app: Elysia<"", {
583
523
  };
584
524
  headers: {};
585
525
  response: {
526
+ 200: import("@vestcards/shared").SessionStats | {
527
+ status: import("@vestcards/shared").StudyStatus;
528
+ review: number;
529
+ learning: number;
530
+ new: number;
531
+ total: number;
532
+ };
586
533
  422: {
587
534
  type: "validation";
588
535
  on: string;
@@ -592,22 +539,6 @@ declare const app: Elysia<"", {
592
539
  property?: string;
593
540
  expected?: string;
594
541
  };
595
- 200: {
596
- error: string;
597
- message: string;
598
- path: any;
599
- details?: undefined;
600
- } | {
601
- error: string;
602
- message: string;
603
- details: any;
604
- path?: undefined;
605
- } | {
606
- error: string;
607
- message: string;
608
- path?: undefined;
609
- details?: undefined;
610
- } | import("@vestcards/shared").SessionStats;
611
542
  };
612
543
  };
613
544
  };
@@ -628,6 +559,9 @@ declare const app: Elysia<"", {
628
559
  query: {};
629
560
  headers: {};
630
561
  response: {
562
+ 200: {
563
+ success: boolean;
564
+ };
631
565
  422: {
632
566
  type: "validation";
633
567
  on: string;
@@ -637,24 +571,6 @@ declare const app: Elysia<"", {
637
571
  property?: string;
638
572
  expected?: string;
639
573
  };
640
- 200: {
641
- error: string;
642
- message: string;
643
- path: any;
644
- details?: undefined;
645
- } | {
646
- error: string;
647
- message: string;
648
- details: any;
649
- path?: undefined;
650
- } | {
651
- error: string;
652
- message: string;
653
- path?: undefined;
654
- details?: undefined;
655
- } | {
656
- success: boolean;
657
- };
658
574
  };
659
575
  };
660
576
  };
@@ -673,22 +589,7 @@ declare const app: Elysia<"", {
673
589
  query: {};
674
590
  headers: {};
675
591
  response: {
676
- 200: {
677
- error: string;
678
- message: string;
679
- path: any;
680
- details?: undefined;
681
- } | {
682
- error: string;
683
- message: string;
684
- details: any;
685
- path?: undefined;
686
- } | {
687
- error: string;
688
- message: string;
689
- path?: undefined;
690
- details?: undefined;
691
- } | import("@vestcards/shared").GroupedLibraryData;
592
+ 200: import("@vestcards/shared").GroupedLibraryData;
692
593
  };
693
594
  };
694
595
  };
@@ -703,22 +604,7 @@ declare const app: Elysia<"", {
703
604
  query: {};
704
605
  headers: {};
705
606
  response: {
706
- 200: {
707
- error: string;
708
- message: string;
709
- path: any;
710
- details?: undefined;
711
- } | {
712
- error: string;
713
- message: string;
714
- details: any;
715
- path?: undefined;
716
- } | {
717
- error: string;
718
- message: string;
719
- path?: undefined;
720
- details?: undefined;
721
- } | import("@vestcards/shared").ArchivedLibraryItem[];
607
+ 200: import("@vestcards/shared").ArchivedLibraryItem[];
722
608
  };
723
609
  };
724
610
  };
@@ -737,6 +623,9 @@ declare const app: Elysia<"", {
737
623
  query: {};
738
624
  headers: {};
739
625
  response: {
626
+ 200: {
627
+ success: boolean;
628
+ };
740
629
  422: {
741
630
  type: "validation";
742
631
  on: string;
@@ -746,24 +635,6 @@ declare const app: Elysia<"", {
746
635
  property?: string;
747
636
  expected?: string;
748
637
  };
749
- 200: {
750
- error: string;
751
- message: string;
752
- path: any;
753
- details?: undefined;
754
- } | {
755
- error: string;
756
- message: string;
757
- details: any;
758
- path?: undefined;
759
- } | {
760
- error: string;
761
- message: string;
762
- path?: undefined;
763
- details?: undefined;
764
- } | {
765
- success: boolean;
766
- };
767
638
  };
768
639
  };
769
640
  };
@@ -783,6 +654,9 @@ declare const app: Elysia<"", {
783
654
  query: {};
784
655
  headers: {};
785
656
  response: {
657
+ 200: {
658
+ success: boolean;
659
+ };
786
660
  422: {
787
661
  type: "validation";
788
662
  on: string;
@@ -792,24 +666,6 @@ declare const app: Elysia<"", {
792
666
  property?: string;
793
667
  expected?: string;
794
668
  };
795
- 200: {
796
- error: string;
797
- message: string;
798
- path: any;
799
- details?: undefined;
800
- } | {
801
- error: string;
802
- message: string;
803
- details: any;
804
- path?: undefined;
805
- } | {
806
- error: string;
807
- message: string;
808
- path?: undefined;
809
- details?: undefined;
810
- } | {
811
- success: boolean;
812
- };
813
669
  };
814
670
  };
815
671
  };
@@ -831,6 +687,9 @@ declare const app: Elysia<"", {
831
687
  query: {};
832
688
  headers: {};
833
689
  response: {
690
+ 200: {
691
+ success: boolean;
692
+ };
834
693
  422: {
835
694
  type: "validation";
836
695
  on: string;
@@ -840,24 +699,6 @@ declare const app: Elysia<"", {
840
699
  property?: string;
841
700
  expected?: string;
842
701
  };
843
- 200: {
844
- error: string;
845
- message: string;
846
- path: any;
847
- details?: undefined;
848
- } | {
849
- error: string;
850
- message: string;
851
- details: any;
852
- path?: undefined;
853
- } | {
854
- error: string;
855
- message: string;
856
- path?: undefined;
857
- details?: undefined;
858
- } | {
859
- success: boolean;
860
- };
861
702
  };
862
703
  };
863
704
  };
@@ -878,6 +719,13 @@ declare const app: Elysia<"", {
878
719
  query: unknown;
879
720
  headers: unknown;
880
721
  response: {
722
+ 200: {
723
+ id: number;
724
+ name: string;
725
+ email: string;
726
+ createdInPage: string;
727
+ createdAt: Date;
728
+ };
881
729
  422: {
882
730
  type: "validation";
883
731
  on: string;
@@ -887,28 +735,6 @@ declare const app: Elysia<"", {
887
735
  property?: string;
888
736
  expected?: string;
889
737
  };
890
- 200: {
891
- error: string;
892
- message: string;
893
- path: any;
894
- details?: undefined;
895
- } | {
896
- error: string;
897
- message: string;
898
- details: any;
899
- path?: undefined;
900
- } | {
901
- error: string;
902
- message: string;
903
- path?: undefined;
904
- details?: undefined;
905
- } | {
906
- id: number;
907
- name: string;
908
- email: string;
909
- createdInPage: string;
910
- createdAt: Date;
911
- };
912
738
  };
913
739
  };
914
740
  };
@@ -940,21 +766,8 @@ declare const app: Elysia<"", {
940
766
  schema: {};
941
767
  standaloneSchema: {};
942
768
  response: {
943
- 200: {
944
- error: string;
945
- message: string;
946
- path: any;
947
- details?: undefined;
948
- } | {
949
- error: string;
950
- message: string;
951
- details: any;
952
- path?: undefined;
953
- } | {
954
- error: string;
955
- message: string;
956
- path?: undefined;
957
- details?: undefined;
769
+ [x: string]: {
770
+ [x: string]: any;
958
771
  };
959
772
  };
960
773
  }>;
@@ -1,16 +1,10 @@
1
- export declare function errorHandler({ code, error, set, request }: any): {
2
- error: string;
3
- message: string;
4
- path: any;
5
- details?: undefined;
6
- } | {
7
- error: string;
8
- message: string;
9
- details: any;
10
- path?: undefined;
11
- } | {
12
- error: string;
13
- message: string;
14
- path?: undefined;
15
- details?: undefined;
16
- };
1
+ import type { ErrorHandler } from 'elysia';
2
+ /**
3
+ * Global error handler returning Response.json() so the return type
4
+ * is NOT merged into Eden treaty's success union — errors stay in
5
+ * React Query's `error` field, not `data`.
6
+ *
7
+ * `set.status` is still needed because Elysia ignores the status
8
+ * from a returned Response object in onError.
9
+ */
10
+ export declare const errorHandler: ErrorHandler;
@@ -41,7 +41,7 @@ export declare const authModule: Elysia<"/v1", {
41
41
  route: string;
42
42
  request: Request;
43
43
  store: {};
44
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
44
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
45
  readonly 100: "Continue";
46
46
  readonly 101: "Switching Protocols";
47
47
  readonly 102: "Processing";
@@ -213,7 +213,7 @@ export declare const authModule: Elysia<"/v1", {
213
213
  route: string;
214
214
  request: Request;
215
215
  store: {};
216
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
216
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
217
217
  readonly 100: "Continue";
218
218
  readonly 101: "Switching Protocols";
219
219
  readonly 102: "Processing";
@@ -42,7 +42,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
42
42
  route: string;
43
43
  request: Request;
44
44
  store: {};
45
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
46
46
  readonly 100: "Continue";
47
47
  readonly 101: "Switching Protocols";
48
48
  readonly 102: "Processing";
@@ -214,7 +214,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
214
214
  route: string;
215
215
  request: Request;
216
216
  store: {};
217
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
217
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
218
218
  readonly 100: "Continue";
219
219
  readonly 101: "Switching Protocols";
220
220
  readonly 102: "Processing";
@@ -366,6 +366,11 @@ export declare const deckModule: Elysia<"/v1/decks", {
366
366
  };
367
367
  headers: unknown;
368
368
  response: {
369
+ 200: {
370
+ data: import("@vestcards/shared").IDeck[];
371
+ pageCount: number;
372
+ total: number;
373
+ };
369
374
  422: {
370
375
  type: "validation";
371
376
  on: string;
@@ -375,26 +380,6 @@ export declare const deckModule: Elysia<"/v1/decks", {
375
380
  property?: string;
376
381
  expected?: string;
377
382
  };
378
- 200: {
379
- error: string;
380
- message: string;
381
- path: any;
382
- details?: undefined;
383
- } | {
384
- error: string;
385
- message: string;
386
- details: any;
387
- path?: undefined;
388
- } | {
389
- error: string;
390
- message: string;
391
- path?: undefined;
392
- details?: undefined;
393
- } | {
394
- data: import("@vestcards/shared").IDeck[];
395
- pageCount: number;
396
- total: number;
397
- };
398
383
  };
399
384
  };
400
385
  };
@@ -411,6 +396,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
411
396
  query: {};
412
397
  headers: {};
413
398
  response: {
399
+ 200: import("@vestcards/shared").IDeckDetail;
414
400
  422: {
415
401
  type: "validation";
416
402
  on: string;
@@ -420,22 +406,6 @@ export declare const deckModule: Elysia<"/v1/decks", {
420
406
  property?: string;
421
407
  expected?: string;
422
408
  };
423
- 200: {
424
- error: string;
425
- message: string;
426
- path: any;
427
- details?: undefined;
428
- } | {
429
- error: string;
430
- message: string;
431
- details: any;
432
- path?: undefined;
433
- } | {
434
- error: string;
435
- message: string;
436
- path?: undefined;
437
- details?: undefined;
438
- } | import("@vestcards/shared").IDeckDetail;
439
409
  };
440
410
  };
441
411
  };
@@ -453,21 +423,8 @@ export declare const deckModule: Elysia<"/v1/decks", {
453
423
  schema: {};
454
424
  standaloneSchema: {};
455
425
  response: {
456
- 200: {
457
- error: string;
458
- message: string;
459
- path: any;
460
- details?: undefined;
461
- } | {
462
- error: string;
463
- message: string;
464
- details: any;
465
- path?: undefined;
466
- } | {
467
- error: string;
468
- message: string;
469
- path?: undefined;
470
- details?: undefined;
426
+ [x: string]: {
427
+ [x: string]: any;
471
428
  };
472
429
  };
473
430
  }>;
@@ -28,6 +28,13 @@ export declare const leadModule: Elysia<"/v1/leads", {
28
28
  query: unknown;
29
29
  headers: unknown;
30
30
  response: {
31
+ 200: {
32
+ id: number;
33
+ name: string;
34
+ email: string;
35
+ createdInPage: string;
36
+ createdAt: Date;
37
+ };
31
38
  422: {
32
39
  type: "validation";
33
40
  on: string;
@@ -37,28 +44,6 @@ export declare const leadModule: Elysia<"/v1/leads", {
37
44
  property?: string;
38
45
  expected?: string;
39
46
  };
40
- 200: {
41
- error: string;
42
- message: string;
43
- path: any;
44
- details?: undefined;
45
- } | {
46
- error: string;
47
- message: string;
48
- details: any;
49
- path?: undefined;
50
- } | {
51
- error: string;
52
- message: string;
53
- path?: undefined;
54
- details?: undefined;
55
- } | {
56
- id: number;
57
- name: string;
58
- email: string;
59
- createdInPage: string;
60
- createdAt: Date;
61
- };
62
47
  };
63
48
  };
64
49
  };
@@ -75,21 +60,8 @@ export declare const leadModule: Elysia<"/v1/leads", {
75
60
  schema: {};
76
61
  standaloneSchema: {};
77
62
  response: {
78
- 200: {
79
- error: string;
80
- message: string;
81
- path: any;
82
- details?: undefined;
83
- } | {
84
- error: string;
85
- message: string;
86
- details: any;
87
- path?: undefined;
88
- } | {
89
- error: string;
90
- message: string;
91
- path?: undefined;
92
- details?: undefined;
63
+ [x: string]: {
64
+ [x: string]: any;
93
65
  };
94
66
  };
95
67
  }>;
@@ -42,7 +42,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
42
42
  route: string;
43
43
  request: Request;
44
44
  store: {};
45
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
46
46
  readonly 100: "Continue";
47
47
  readonly 101: "Switching Protocols";
48
48
  readonly 102: "Processing";
@@ -214,7 +214,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
214
214
  route: string;
215
215
  request: Request;
216
216
  store: {};
217
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
217
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
218
218
  readonly 100: "Continue";
219
219
  readonly 101: "Switching Protocols";
220
220
  readonly 102: "Processing";
@@ -357,22 +357,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
357
357
  query: {};
358
358
  headers: {};
359
359
  response: {
360
- 200: {
361
- error: string;
362
- message: string;
363
- path: any;
364
- details?: undefined;
365
- } | {
366
- error: string;
367
- message: string;
368
- details: any;
369
- path?: undefined;
370
- } | {
371
- error: string;
372
- message: string;
373
- path?: undefined;
374
- details?: undefined;
375
- } | import("@vestcards/shared").GroupedLibraryData;
360
+ 200: import("@vestcards/shared").GroupedLibraryData;
376
361
  };
377
362
  };
378
363
  };
@@ -387,22 +372,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
387
372
  query: {};
388
373
  headers: {};
389
374
  response: {
390
- 200: {
391
- error: string;
392
- message: string;
393
- path: any;
394
- details?: undefined;
395
- } | {
396
- error: string;
397
- message: string;
398
- details: any;
399
- path?: undefined;
400
- } | {
401
- error: string;
402
- message: string;
403
- path?: undefined;
404
- details?: undefined;
405
- } | import("@vestcards/shared").ArchivedLibraryItem[];
375
+ 200: import("@vestcards/shared").ArchivedLibraryItem[];
406
376
  };
407
377
  };
408
378
  };
@@ -421,6 +391,9 @@ export declare const libraryModule: Elysia<"/v1/library", {
421
391
  query: {};
422
392
  headers: {};
423
393
  response: {
394
+ 200: {
395
+ success: boolean;
396
+ };
424
397
  422: {
425
398
  type: "validation";
426
399
  on: string;
@@ -430,24 +403,6 @@ export declare const libraryModule: Elysia<"/v1/library", {
430
403
  property?: string;
431
404
  expected?: string;
432
405
  };
433
- 200: {
434
- error: string;
435
- message: string;
436
- path: any;
437
- details?: undefined;
438
- } | {
439
- error: string;
440
- message: string;
441
- details: any;
442
- path?: undefined;
443
- } | {
444
- error: string;
445
- message: string;
446
- path?: undefined;
447
- details?: undefined;
448
- } | {
449
- success: boolean;
450
- };
451
406
  };
452
407
  };
453
408
  };
@@ -467,6 +422,9 @@ export declare const libraryModule: Elysia<"/v1/library", {
467
422
  query: {};
468
423
  headers: {};
469
424
  response: {
425
+ 200: {
426
+ success: boolean;
427
+ };
470
428
  422: {
471
429
  type: "validation";
472
430
  on: string;
@@ -476,24 +434,6 @@ export declare const libraryModule: Elysia<"/v1/library", {
476
434
  property?: string;
477
435
  expected?: string;
478
436
  };
479
- 200: {
480
- error: string;
481
- message: string;
482
- path: any;
483
- details?: undefined;
484
- } | {
485
- error: string;
486
- message: string;
487
- details: any;
488
- path?: undefined;
489
- } | {
490
- error: string;
491
- message: string;
492
- path?: undefined;
493
- details?: undefined;
494
- } | {
495
- success: boolean;
496
- };
497
437
  };
498
438
  };
499
439
  };
@@ -515,6 +455,9 @@ export declare const libraryModule: Elysia<"/v1/library", {
515
455
  query: {};
516
456
  headers: {};
517
457
  response: {
458
+ 200: {
459
+ success: boolean;
460
+ };
518
461
  422: {
519
462
  type: "validation";
520
463
  on: string;
@@ -524,24 +467,6 @@ export declare const libraryModule: Elysia<"/v1/library", {
524
467
  property?: string;
525
468
  expected?: string;
526
469
  };
527
- 200: {
528
- error: string;
529
- message: string;
530
- path: any;
531
- details?: undefined;
532
- } | {
533
- error: string;
534
- message: string;
535
- details: any;
536
- path?: undefined;
537
- } | {
538
- error: string;
539
- message: string;
540
- path?: undefined;
541
- details?: undefined;
542
- } | {
543
- success: boolean;
544
- };
545
470
  };
546
471
  };
547
472
  };
@@ -560,21 +485,8 @@ export declare const libraryModule: Elysia<"/v1/library", {
560
485
  schema: {};
561
486
  standaloneSchema: {};
562
487
  response: {
563
- 200: {
564
- error: string;
565
- message: string;
566
- path: any;
567
- details?: undefined;
568
- } | {
569
- error: string;
570
- message: string;
571
- details: any;
572
- path?: undefined;
573
- } | {
574
- error: string;
575
- message: string;
576
- path?: undefined;
577
- details?: undefined;
488
+ [x: string]: {
489
+ [x: string]: any;
578
490
  };
579
491
  };
580
492
  }>;
@@ -42,7 +42,7 @@ export declare const studyModule: Elysia<"/v1/study", {
42
42
  route: string;
43
43
  request: Request;
44
44
  store: {};
45
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
46
46
  readonly 100: "Continue";
47
47
  readonly 101: "Switching Protocols";
48
48
  readonly 102: "Processing";
@@ -214,7 +214,7 @@ export declare const studyModule: Elysia<"/v1/study", {
214
214
  route: string;
215
215
  request: Request;
216
216
  store: {};
217
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
217
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
218
218
  readonly 100: "Continue";
219
219
  readonly 101: "Switching Protocols";
220
220
  readonly 102: "Processing";
@@ -361,6 +361,7 @@ export declare const studyModule: Elysia<"/v1/study", {
361
361
  };
362
362
  headers: {};
363
363
  response: {
364
+ 200: import("../../types/study").SessionData;
364
365
  422: {
365
366
  type: "validation";
366
367
  on: string;
@@ -370,22 +371,6 @@ export declare const studyModule: Elysia<"/v1/study", {
370
371
  property?: string;
371
372
  expected?: string;
372
373
  };
373
- 200: {
374
- error: string;
375
- message: string;
376
- path: any;
377
- details?: undefined;
378
- } | {
379
- error: string;
380
- message: string;
381
- details: any;
382
- path?: undefined;
383
- } | {
384
- error: string;
385
- message: string;
386
- path?: undefined;
387
- details?: undefined;
388
- } | import("../../types/study").SessionData;
389
374
  };
390
375
  };
391
376
  };
@@ -404,6 +389,13 @@ export declare const studyModule: Elysia<"/v1/study", {
404
389
  };
405
390
  headers: {};
406
391
  response: {
392
+ 200: import("@vestcards/shared").SessionStats | {
393
+ status: import("@vestcards/shared").StudyStatus;
394
+ review: number;
395
+ learning: number;
396
+ new: number;
397
+ total: number;
398
+ };
407
399
  422: {
408
400
  type: "validation";
409
401
  on: string;
@@ -413,22 +405,6 @@ export declare const studyModule: Elysia<"/v1/study", {
413
405
  property?: string;
414
406
  expected?: string;
415
407
  };
416
- 200: {
417
- error: string;
418
- message: string;
419
- path: any;
420
- details?: undefined;
421
- } | {
422
- error: string;
423
- message: string;
424
- details: any;
425
- path?: undefined;
426
- } | {
427
- error: string;
428
- message: string;
429
- path?: undefined;
430
- details?: undefined;
431
- } | import("@vestcards/shared").SessionStats;
432
408
  };
433
409
  };
434
410
  };
@@ -449,6 +425,9 @@ export declare const studyModule: Elysia<"/v1/study", {
449
425
  query: {};
450
426
  headers: {};
451
427
  response: {
428
+ 200: {
429
+ success: boolean;
430
+ };
452
431
  422: {
453
432
  type: "validation";
454
433
  on: string;
@@ -458,24 +437,6 @@ export declare const studyModule: Elysia<"/v1/study", {
458
437
  property?: string;
459
438
  expected?: string;
460
439
  };
461
- 200: {
462
- error: string;
463
- message: string;
464
- path: any;
465
- details?: undefined;
466
- } | {
467
- error: string;
468
- message: string;
469
- details: any;
470
- path?: undefined;
471
- } | {
472
- error: string;
473
- message: string;
474
- path?: undefined;
475
- details?: undefined;
476
- } | {
477
- success: boolean;
478
- };
479
440
  };
480
441
  };
481
442
  };
@@ -493,21 +454,8 @@ export declare const studyModule: Elysia<"/v1/study", {
493
454
  schema: {};
494
455
  standaloneSchema: {};
495
456
  response: {
496
- 200: {
497
- error: string;
498
- message: string;
499
- path: any;
500
- details?: undefined;
501
- } | {
502
- error: string;
503
- message: string;
504
- details: any;
505
- path?: undefined;
506
- } | {
507
- error: string;
508
- message: string;
509
- path?: undefined;
510
- details?: undefined;
457
+ [x: string]: {
458
+ [x: string]: any;
511
459
  };
512
460
  };
513
461
  }>;
@@ -8,6 +8,13 @@ export declare abstract class StudyService {
8
8
  type: StudyType, id?: string): Promise<SessionStats>;
9
9
  static getReviewCards(userId: string, type: StudyType, id?: string, maxToFetch?: number): Promise<import("../../types/study").SessionCard[]>;
10
10
  static getNewCards(userId: string, allocatedNewForToday: number, type: StudyType, id?: string): Promise<import("../../types/study").SessionCard[]>;
11
+ static getUserDeckStudy(userId: string, deckId: string): Promise<{
12
+ suspended: boolean;
13
+ id: string;
14
+ createdAt: Date;
15
+ userId: string;
16
+ deckId: string;
17
+ }>;
11
18
  static getCardReview(userId: string, cardId: string): Promise<CardReview>;
12
19
  static gradeCard(userId: string, input: StudyModel.GradeCardBody): Promise<void>;
13
20
  }
@@ -1,3 +1,4 @@
1
+ import type { SessionStats, StudyStatus } from '@vestcards/shared';
1
2
  import type { SessionCard, StudyType } from 'src/types/study';
2
3
  import type { SessionCardSelect } from 'src/utils/select';
3
4
  export declare const getSessionFilterByStudyType: (type: StudyType, id?: string) => import("drizzle-orm").SQL<unknown> | undefined;
@@ -11,4 +12,7 @@ export declare const allocateByPriority: (capacityLeft: number, counts: {
11
12
  new: number;
12
13
  total: number;
13
14
  };
15
+ export declare function getStudyStatus(stats: SessionStats, userDeckStudy: {
16
+ suspended: boolean;
17
+ } | undefined): StudyStatus;
14
18
  export declare function sessionCardToICard(sessionRows: SessionCardSelect[]): SessionCard[];
@@ -42,7 +42,7 @@ export declare const topicModule: Elysia<"/v1/topics", {
42
42
  route: string;
43
43
  request: Request;
44
44
  store: {};
45
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
46
46
  readonly 100: "Continue";
47
47
  readonly 101: "Switching Protocols";
48
48
  readonly 102: "Processing";
@@ -214,7 +214,7 @@ export declare const topicModule: Elysia<"/v1/topics", {
214
214
  route: string;
215
215
  request: Request;
216
216
  store: {};
217
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
217
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
218
218
  readonly 100: "Continue";
219
219
  readonly 101: "Switching Protocols";
220
220
  readonly 102: "Processing";
@@ -364,6 +364,11 @@ export declare const topicModule: Elysia<"/v1/topics", {
364
364
  };
365
365
  headers: unknown;
366
366
  response: {
367
+ 200: {
368
+ data: import("@vestcards/shared").Topic[];
369
+ pageCount: number;
370
+ total: number;
371
+ };
367
372
  422: {
368
373
  type: "validation";
369
374
  on: string;
@@ -373,26 +378,6 @@ export declare const topicModule: Elysia<"/v1/topics", {
373
378
  property?: string;
374
379
  expected?: string;
375
380
  };
376
- 200: {
377
- error: string;
378
- message: string;
379
- path: any;
380
- details?: undefined;
381
- } | {
382
- error: string;
383
- message: string;
384
- details: any;
385
- path?: undefined;
386
- } | {
387
- error: string;
388
- message: string;
389
- path?: undefined;
390
- details?: undefined;
391
- } | {
392
- data: import("@vestcards/shared").Topic[];
393
- pageCount: number;
394
- total: number;
395
- };
396
381
  };
397
382
  };
398
383
  };
@@ -409,21 +394,8 @@ export declare const topicModule: Elysia<"/v1/topics", {
409
394
  schema: {};
410
395
  standaloneSchema: {};
411
396
  response: {
412
- 200: {
413
- error: string;
414
- message: string;
415
- path: any;
416
- details?: undefined;
417
- } | {
418
- error: string;
419
- message: string;
420
- details: any;
421
- path?: undefined;
422
- } | {
423
- error: string;
424
- message: string;
425
- path?: undefined;
426
- details?: undefined;
397
+ [x: string]: {
398
+ [x: string]: any;
427
399
  };
428
400
  };
429
401
  }>;
@@ -42,7 +42,7 @@ export declare const userModule: Elysia<"/v1/user", {
42
42
  route: string;
43
43
  request: Request;
44
44
  store: {};
45
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
45
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
46
46
  readonly 100: "Continue";
47
47
  readonly 101: "Switching Protocols";
48
48
  readonly 102: "Processing";
@@ -214,7 +214,7 @@ export declare const userModule: Elysia<"/v1/user", {
214
214
  route: string;
215
215
  request: Request;
216
216
  store: {};
217
- status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 422 | 200 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
217
+ status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 400 | 401 | 403 | 404 | 409 | 429 | 500 | 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 402 | 405 | 406 | 407 | 408 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 431 | 451 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
218
218
  readonly 100: "Continue";
219
219
  readonly 101: "Switching Protocols";
220
220
  readonly 102: "Processing";
@@ -360,21 +360,8 @@ export declare const userModule: Elysia<"/v1/user", {
360
360
  schema: {};
361
361
  standaloneSchema: {};
362
362
  response: {
363
- 200: {
364
- error: string;
365
- message: string;
366
- path: any;
367
- details?: undefined;
368
- } | {
369
- error: string;
370
- message: string;
371
- details: any;
372
- path?: undefined;
373
- } | {
374
- error: string;
375
- message: string;
376
- path?: undefined;
377
- details?: undefined;
363
+ [x: string]: {
364
+ [x: string]: any;
378
365
  };
379
366
  };
380
367
  }>;
@@ -102,11 +102,11 @@ export declare function createUserDeckStudy(data: {
102
102
  userId: string;
103
103
  suspended?: boolean;
104
104
  }): Promise<{
105
+ suspended: boolean;
105
106
  id: string;
106
107
  createdAt: Date;
107
108
  userId: string;
108
109
  deckId: string;
109
- suspended: boolean;
110
110
  }>;
111
111
  /**
112
112
  * Create a card review for a user deck study
@@ -1,6 +1,6 @@
1
1
  import type { Subject } from '@vestcards/shared';
2
2
  import type { CardReview } from 'src/db/schema/deck';
3
- export type { CardState, GradeCardInput, Rating, SessionStats, StudyType } from '@vestcards/shared';
3
+ export type { CardState, GradeCardInput, Rating, SessionStats, StudyStatus, StudyType } from '@vestcards/shared';
4
4
  export interface ICard {
5
5
  id: string;
6
6
  question: string;
@@ -10,7 +10,6 @@ export interface ICard {
10
10
  id: string;
11
11
  question: string;
12
12
  answer: string | null;
13
- order: number;
14
13
  frontImage?: {
15
14
  id: string;
16
15
  url: string;
@@ -22,6 +22,7 @@ export interface GroupedLibraryItem {
22
22
  subRows?: GroupedLibraryItem[];
23
23
  }
24
24
  export type GroupedLibraryData = GroupedLibraryItem[];
25
+ export type StudyStatus = 'not-started' | 'suspended' | 'has-cards' | 'no-cards';
25
26
  export interface ArchivedLibraryItem {
26
27
  deckId: string;
27
28
  subject: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestcards/server-types",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {