@vestcards/server-types 0.4.0 → 0.5.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 +124 -0
- package/dist/apps/server/src/db/migrate.d.ts +1 -0
- package/dist/apps/server/src/db/schema/auth.d.ts +13 -13
- package/dist/apps/server/src/modules/data/data.test.d.ts +1 -0
- package/dist/apps/server/src/modules/data/index.d.ts +94 -0
- package/dist/apps/server/src/modules/user/index.d.ts +59 -0
- package/dist/apps/server/src/modules/user/model.d.ts +7 -0
- package/dist/apps/server/src/modules/user/service.d.ts +18 -0
- package/dist/apps/server/src/modules/user/user.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -774,6 +774,130 @@ declare const app: Elysia<"", {
|
|
|
774
774
|
};
|
|
775
775
|
};
|
|
776
776
|
};
|
|
777
|
+
} & {
|
|
778
|
+
v1: {
|
|
779
|
+
user: {};
|
|
780
|
+
};
|
|
781
|
+
} & {
|
|
782
|
+
v1: {
|
|
783
|
+
user: {
|
|
784
|
+
me: {
|
|
785
|
+
get: {
|
|
786
|
+
body: {};
|
|
787
|
+
params: {};
|
|
788
|
+
query: {};
|
|
789
|
+
headers: {};
|
|
790
|
+
response: {
|
|
791
|
+
200: {
|
|
792
|
+
id: string;
|
|
793
|
+
name: string;
|
|
794
|
+
surname: string;
|
|
795
|
+
email: string;
|
|
796
|
+
image: string | null;
|
|
797
|
+
role: import("@vestcards/shared").UserRole;
|
|
798
|
+
learnDailyLimit: number | null;
|
|
799
|
+
universityId: number | null;
|
|
800
|
+
universityName: string | null;
|
|
801
|
+
courseId: number | null;
|
|
802
|
+
courseName: string | null;
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
} & {
|
|
810
|
+
v1: {
|
|
811
|
+
user: {
|
|
812
|
+
settings: {
|
|
813
|
+
patch: {
|
|
814
|
+
body: {
|
|
815
|
+
university?: number | null | undefined;
|
|
816
|
+
course?: number | null | undefined;
|
|
817
|
+
learnDailyLimit?: number | undefined;
|
|
818
|
+
};
|
|
819
|
+
params: {};
|
|
820
|
+
query: {};
|
|
821
|
+
headers: {};
|
|
822
|
+
response: {
|
|
823
|
+
200: {
|
|
824
|
+
success: boolean;
|
|
825
|
+
};
|
|
826
|
+
422: {
|
|
827
|
+
type: "validation";
|
|
828
|
+
on: string;
|
|
829
|
+
summary?: string;
|
|
830
|
+
message?: string;
|
|
831
|
+
found?: unknown;
|
|
832
|
+
property?: string;
|
|
833
|
+
expected?: string;
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
} & {
|
|
841
|
+
v1: {
|
|
842
|
+
data: {
|
|
843
|
+
universities: {
|
|
844
|
+
get: {
|
|
845
|
+
body: unknown;
|
|
846
|
+
params: {};
|
|
847
|
+
query: {
|
|
848
|
+
q?: string | undefined;
|
|
849
|
+
};
|
|
850
|
+
headers: unknown;
|
|
851
|
+
response: {
|
|
852
|
+
200: {
|
|
853
|
+
id: number;
|
|
854
|
+
name: string;
|
|
855
|
+
acronym: string;
|
|
856
|
+
}[];
|
|
857
|
+
422: {
|
|
858
|
+
type: "validation";
|
|
859
|
+
on: string;
|
|
860
|
+
summary?: string;
|
|
861
|
+
message?: string;
|
|
862
|
+
found?: unknown;
|
|
863
|
+
property?: string;
|
|
864
|
+
expected?: string;
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
};
|
|
869
|
+
};
|
|
870
|
+
};
|
|
871
|
+
} & {
|
|
872
|
+
v1: {
|
|
873
|
+
data: {
|
|
874
|
+
courses: {
|
|
875
|
+
get: {
|
|
876
|
+
body: unknown;
|
|
877
|
+
params: {};
|
|
878
|
+
query: {
|
|
879
|
+
q?: string | undefined;
|
|
880
|
+
};
|
|
881
|
+
headers: unknown;
|
|
882
|
+
response: {
|
|
883
|
+
200: {
|
|
884
|
+
id: number;
|
|
885
|
+
name: string;
|
|
886
|
+
}[];
|
|
887
|
+
422: {
|
|
888
|
+
type: "validation";
|
|
889
|
+
on: string;
|
|
890
|
+
summary?: string;
|
|
891
|
+
message?: string;
|
|
892
|
+
found?: unknown;
|
|
893
|
+
property?: string;
|
|
894
|
+
expected?: string;
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
};
|
|
899
|
+
};
|
|
900
|
+
};
|
|
777
901
|
} & {
|
|
778
902
|
health: {
|
|
779
903
|
get: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -659,13 +659,13 @@ export declare const verification: import("drizzle-orm/pg-core").PgTableWithColu
|
|
|
659
659
|
};
|
|
660
660
|
dialect: "pg";
|
|
661
661
|
}>;
|
|
662
|
-
export declare const
|
|
663
|
-
name: "
|
|
662
|
+
export declare const userSettings: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
663
|
+
name: "user_settings";
|
|
664
664
|
schema: undefined;
|
|
665
665
|
columns: {
|
|
666
666
|
userId: import("drizzle-orm/pg-core").PgColumn<{
|
|
667
667
|
name: "userId";
|
|
668
|
-
tableName: "
|
|
668
|
+
tableName: "user_settings";
|
|
669
669
|
dataType: "string";
|
|
670
670
|
columnType: "PgText";
|
|
671
671
|
data: string;
|
|
@@ -682,7 +682,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
682
682
|
}, {}, {}>;
|
|
683
683
|
goal: import("drizzle-orm/pg-core").PgColumn<{
|
|
684
684
|
name: "goal";
|
|
685
|
-
tableName: "
|
|
685
|
+
tableName: "user_settings";
|
|
686
686
|
dataType: "string";
|
|
687
687
|
columnType: "PgText";
|
|
688
688
|
data: string;
|
|
@@ -699,7 +699,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
699
699
|
}, {}, {}>;
|
|
700
700
|
hoursStudied: import("drizzle-orm/pg-core").PgColumn<{
|
|
701
701
|
name: "hours_studied";
|
|
702
|
-
tableName: "
|
|
702
|
+
tableName: "user_settings";
|
|
703
703
|
dataType: "string";
|
|
704
704
|
columnType: "PgText";
|
|
705
705
|
data: string;
|
|
@@ -716,7 +716,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
716
716
|
}, {}, {}>;
|
|
717
717
|
dayTimeReminder: import("drizzle-orm/pg-core").PgColumn<{
|
|
718
718
|
name: "day_time_reminder";
|
|
719
|
-
tableName: "
|
|
719
|
+
tableName: "user_settings";
|
|
720
720
|
dataType: "string";
|
|
721
721
|
columnType: "PgText";
|
|
722
722
|
data: string;
|
|
@@ -733,7 +733,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
733
733
|
}, {}, {}>;
|
|
734
734
|
referral: import("drizzle-orm/pg-core").PgColumn<{
|
|
735
735
|
name: "referral";
|
|
736
|
-
tableName: "
|
|
736
|
+
tableName: "user_settings";
|
|
737
737
|
dataType: "string";
|
|
738
738
|
columnType: "PgText";
|
|
739
739
|
data: string;
|
|
@@ -750,7 +750,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
750
750
|
}, {}, {}>;
|
|
751
751
|
university: import("drizzle-orm/pg-core").PgColumn<{
|
|
752
752
|
name: "university";
|
|
753
|
-
tableName: "
|
|
753
|
+
tableName: "user_settings";
|
|
754
754
|
dataType: "number";
|
|
755
755
|
columnType: "PgInteger";
|
|
756
756
|
data: number;
|
|
@@ -767,7 +767,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
767
767
|
}, {}, {}>;
|
|
768
768
|
course: import("drizzle-orm/pg-core").PgColumn<{
|
|
769
769
|
name: "course";
|
|
770
|
-
tableName: "
|
|
770
|
+
tableName: "user_settings";
|
|
771
771
|
dataType: "number";
|
|
772
772
|
columnType: "PgInteger";
|
|
773
773
|
data: number;
|
|
@@ -784,7 +784,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
784
784
|
}, {}, {}>;
|
|
785
785
|
learnDailyLimit: import("drizzle-orm/pg-core").PgColumn<{
|
|
786
786
|
name: "learn_daily_limit";
|
|
787
|
-
tableName: "
|
|
787
|
+
tableName: "user_settings";
|
|
788
788
|
dataType: "number";
|
|
789
789
|
columnType: "PgInteger";
|
|
790
790
|
data: number;
|
|
@@ -801,7 +801,7 @@ export declare const userAdditionalData: import("drizzle-orm/pg-core").PgTableWi
|
|
|
801
801
|
}, {}, {}>;
|
|
802
802
|
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
803
803
|
name: "created_at";
|
|
804
|
-
tableName: "
|
|
804
|
+
tableName: "user_settings";
|
|
805
805
|
dataType: "date";
|
|
806
806
|
columnType: "PgTimestamp";
|
|
807
807
|
data: Date;
|
|
@@ -833,9 +833,9 @@ export type User = InferSelectModel<typeof user>;
|
|
|
833
833
|
export type Session = InferSelectModel<typeof session>;
|
|
834
834
|
export type Account = InferSelectModel<typeof account>;
|
|
835
835
|
export type Verification = InferSelectModel<typeof verification>;
|
|
836
|
-
export type
|
|
836
|
+
export type UserSettings = InferSelectModel<typeof userSettings>;
|
|
837
837
|
export type NewUser = InferInsertModel<typeof user>;
|
|
838
838
|
export type NewSession = InferInsertModel<typeof session>;
|
|
839
839
|
export type NewAccount = InferInsertModel<typeof account>;
|
|
840
840
|
export type NewVerification = InferInsertModel<typeof verification>;
|
|
841
|
-
export type
|
|
841
|
+
export type NewUserSettings = InferInsertModel<typeof userSettings>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
export declare const dataModule: Elysia<"/v1/data", {
|
|
3
|
+
decorator: {};
|
|
4
|
+
store: {};
|
|
5
|
+
derive: {};
|
|
6
|
+
resolve: {};
|
|
7
|
+
}, {
|
|
8
|
+
typebox: {};
|
|
9
|
+
error: {};
|
|
10
|
+
}, {
|
|
11
|
+
schema: {};
|
|
12
|
+
standaloneSchema: {};
|
|
13
|
+
macro: {};
|
|
14
|
+
macroFn: {};
|
|
15
|
+
parser: {};
|
|
16
|
+
response: {};
|
|
17
|
+
}, {
|
|
18
|
+
v1: {
|
|
19
|
+
data: {
|
|
20
|
+
universities: {
|
|
21
|
+
get: {
|
|
22
|
+
body: unknown;
|
|
23
|
+
params: {};
|
|
24
|
+
query: {
|
|
25
|
+
q?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
headers: unknown;
|
|
28
|
+
response: {
|
|
29
|
+
200: {
|
|
30
|
+
id: number;
|
|
31
|
+
name: string;
|
|
32
|
+
acronym: string;
|
|
33
|
+
}[];
|
|
34
|
+
422: {
|
|
35
|
+
type: "validation";
|
|
36
|
+
on: string;
|
|
37
|
+
summary?: string;
|
|
38
|
+
message?: string;
|
|
39
|
+
found?: unknown;
|
|
40
|
+
property?: string;
|
|
41
|
+
expected?: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
} & {
|
|
49
|
+
v1: {
|
|
50
|
+
data: {
|
|
51
|
+
courses: {
|
|
52
|
+
get: {
|
|
53
|
+
body: unknown;
|
|
54
|
+
params: {};
|
|
55
|
+
query: {
|
|
56
|
+
q?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
headers: unknown;
|
|
59
|
+
response: {
|
|
60
|
+
200: {
|
|
61
|
+
id: number;
|
|
62
|
+
name: string;
|
|
63
|
+
}[];
|
|
64
|
+
422: {
|
|
65
|
+
type: "validation";
|
|
66
|
+
on: string;
|
|
67
|
+
summary?: string;
|
|
68
|
+
message?: string;
|
|
69
|
+
found?: unknown;
|
|
70
|
+
property?: string;
|
|
71
|
+
expected?: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
derive: {};
|
|
80
|
+
resolve: {};
|
|
81
|
+
schema: {};
|
|
82
|
+
standaloneSchema: {};
|
|
83
|
+
response: {};
|
|
84
|
+
}, {
|
|
85
|
+
derive: {};
|
|
86
|
+
resolve: {};
|
|
87
|
+
schema: {};
|
|
88
|
+
standaloneSchema: {};
|
|
89
|
+
response: {
|
|
90
|
+
[x: string]: {
|
|
91
|
+
[x: string]: any;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}>;
|
|
@@ -348,6 +348,65 @@ export declare const userModule: Elysia<"/v1/user", {
|
|
|
348
348
|
v1: {
|
|
349
349
|
user: {};
|
|
350
350
|
};
|
|
351
|
+
} & {
|
|
352
|
+
v1: {
|
|
353
|
+
user: {
|
|
354
|
+
me: {
|
|
355
|
+
get: {
|
|
356
|
+
body: {};
|
|
357
|
+
params: {};
|
|
358
|
+
query: {};
|
|
359
|
+
headers: {};
|
|
360
|
+
response: {
|
|
361
|
+
200: {
|
|
362
|
+
id: string;
|
|
363
|
+
name: string;
|
|
364
|
+
surname: string;
|
|
365
|
+
email: string;
|
|
366
|
+
image: string | null;
|
|
367
|
+
role: import("@vestcards/shared").UserRole;
|
|
368
|
+
learnDailyLimit: number | null;
|
|
369
|
+
universityId: number | null;
|
|
370
|
+
universityName: string | null;
|
|
371
|
+
courseId: number | null;
|
|
372
|
+
courseName: string | null;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
} & {
|
|
380
|
+
v1: {
|
|
381
|
+
user: {
|
|
382
|
+
settings: {
|
|
383
|
+
patch: {
|
|
384
|
+
body: {
|
|
385
|
+
university?: number | null | undefined;
|
|
386
|
+
course?: number | null | undefined;
|
|
387
|
+
learnDailyLimit?: number | undefined;
|
|
388
|
+
};
|
|
389
|
+
params: {};
|
|
390
|
+
query: {};
|
|
391
|
+
headers: {};
|
|
392
|
+
response: {
|
|
393
|
+
200: {
|
|
394
|
+
success: boolean;
|
|
395
|
+
};
|
|
396
|
+
422: {
|
|
397
|
+
type: "validation";
|
|
398
|
+
on: string;
|
|
399
|
+
summary?: string;
|
|
400
|
+
message?: string;
|
|
401
|
+
found?: unknown;
|
|
402
|
+
property?: string;
|
|
403
|
+
expected?: string;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
};
|
|
351
410
|
}, {
|
|
352
411
|
derive: {};
|
|
353
412
|
resolve: {};
|
|
@@ -14,3 +14,10 @@ export declare namespace TopicModel {
|
|
|
14
14
|
subjects?: Subject[];
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
export declare namespace UserModel {
|
|
18
|
+
const updateSettingsBody: import("@sinclair/typebox").TObject<{
|
|
19
|
+
learnDailyLimit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
20
|
+
university: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>>;
|
|
21
|
+
course: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TInteger, import("@sinclair/typebox").TNull]>>;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
export declare abstract class UserService {
|
|
2
2
|
static getLearnDailyLimit(userId: string): Promise<number>;
|
|
3
|
+
static getProfile(userId: string): Promise<{
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
surname: string;
|
|
7
|
+
email: string;
|
|
8
|
+
image: string | null;
|
|
9
|
+
role: import("@vestcards/shared").UserRole;
|
|
10
|
+
learnDailyLimit: number | null;
|
|
11
|
+
universityId: number | null;
|
|
12
|
+
universityName: string | null;
|
|
13
|
+
courseId: number | null;
|
|
14
|
+
courseName: string | null;
|
|
15
|
+
}>;
|
|
16
|
+
static upsertSettings(userId: string, data: {
|
|
17
|
+
learnDailyLimit?: number;
|
|
18
|
+
university?: number | null;
|
|
19
|
+
course?: number | null;
|
|
20
|
+
}): Promise<void>;
|
|
3
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|