@vestcards/server-types 0.2.0 → 0.4.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.
- package/dist/apps/server/src/app.d.ts +79 -231
- package/dist/apps/server/src/config/env.d.ts +2 -0
- package/dist/apps/server/src/db/schema/deck.d.ts +130 -0
- package/dist/apps/server/src/db/schema/entity.d.ts +1 -2
- package/dist/apps/server/src/middleware/errorHandler.d.ts +10 -16
- package/dist/apps/server/src/modules/auth/index.d.ts +2 -2
- package/dist/apps/server/src/modules/auth/lib.d.ts +4 -0
- package/dist/apps/server/src/modules/card/card.test.d.ts +1 -0
- package/dist/apps/server/src/modules/card/index.d.ts +398 -0
- package/dist/apps/server/src/modules/card/model.d.ts +8 -0
- package/dist/apps/server/src/modules/card/service.d.ts +4 -0
- package/dist/apps/server/src/modules/deck/index.d.ts +10 -53
- package/dist/apps/server/src/modules/deck/model.d.ts +1 -0
- package/dist/apps/server/src/modules/lead/index.d.ts +9 -37
- package/dist/apps/server/src/modules/library/index.d.ts +15 -103
- package/dist/apps/server/src/modules/study/index.d.ts +15 -67
- package/dist/apps/server/src/modules/study/service.d.ts +7 -0
- package/dist/apps/server/src/modules/study/utils.d.ts +4 -0
- package/dist/apps/server/src/modules/topic/index.d.ts +9 -37
- package/dist/apps/server/src/modules/user/index.d.ts +4 -17
- package/dist/apps/server/src/tests/helpers/fixtures.d.ts +5 -1
- package/dist/apps/server/src/types/study.d.ts +1 -1
- package/dist/packages/shared/src/types/deck.d.ts +4 -1
- package/dist/packages/shared/src/types/study.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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 |
|
|
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 |
|
|
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
|
-
|
|
564
|
-
|
|
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 |
|
|
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 |
|
|
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
|
-
|
|
497
|
-
|
|
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 |
|
|
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 |
|
|
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
|
-
|
|
413
|
-
|
|
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 |
|
|
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 |
|
|
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
|
-
|
|
364
|
-
|
|
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
|
|
@@ -142,3 +142,7 @@ export declare function createCardReview(data: {
|
|
|
142
142
|
* Delete a user deck study (cascade handles card reviews)
|
|
143
143
|
*/
|
|
144
144
|
export declare function deleteUserDeckStudy(userDeckStudyId: string): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Delete a card report (card demand)
|
|
147
|
+
*/
|
|
148
|
+
export declare function deleteCardReport(userId: string, cardId: string): Promise<void>;
|
|
@@ -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;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export declare const cardDemandStatus: readonly ["not-reviewed", "card-updated", "demand-rejected", "card-removed"];
|
|
2
|
+
export type CardDemandStatus = (typeof cardDemandStatus)[number];
|
|
1
3
|
export declare enum DeckStatus {
|
|
2
4
|
Draft = "draft",
|
|
3
5
|
Review = "to_review",
|
|
@@ -10,7 +12,6 @@ export interface ICard {
|
|
|
10
12
|
id: string;
|
|
11
13
|
question: string;
|
|
12
14
|
answer: string | null;
|
|
13
|
-
order: number;
|
|
14
15
|
frontImage?: {
|
|
15
16
|
id: string;
|
|
16
17
|
url: string;
|
|
@@ -20,7 +21,9 @@ export interface ICard {
|
|
|
20
21
|
url: string;
|
|
21
22
|
};
|
|
22
23
|
}
|
|
24
|
+
export type EntityType = 'user' | 'organization' | 'official';
|
|
23
25
|
export interface IOwnerInfo {
|
|
26
|
+
type: EntityType;
|
|
24
27
|
id: string;
|
|
25
28
|
name: string;
|
|
26
29
|
image: string | null;
|
|
@@ -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;
|