@vestcards/server-types 0.3.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.
@@ -374,6 +374,41 @@ declare const app: Elysia<"", {
374
374
  macroFn: {};
375
375
  parser: {};
376
376
  }, {
377
+ v1: {
378
+ card: {};
379
+ };
380
+ } & {
381
+ v1: {
382
+ card: {
383
+ report: {
384
+ post: {
385
+ body: {
386
+ type: string;
387
+ cardId: string;
388
+ content: string;
389
+ };
390
+ params: {};
391
+ query: {};
392
+ headers: {};
393
+ response: {
394
+ 200: {
395
+ success: boolean;
396
+ };
397
+ 422: {
398
+ type: "validation";
399
+ on: string;
400
+ summary?: string;
401
+ message?: string;
402
+ found?: unknown;
403
+ property?: string;
404
+ expected?: string;
405
+ };
406
+ };
407
+ };
408
+ };
409
+ };
410
+ };
411
+ } & {
377
412
  v1: {
378
413
  decks: {};
379
414
  };
@@ -739,6 +774,130 @@ declare const app: Elysia<"", {
739
774
  };
740
775
  };
741
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
+ };
742
901
  } & {
743
902
  health: {
744
903
  get: {
@@ -6,6 +6,8 @@ export declare const config: {
6
6
  betterAuthSecret: string;
7
7
  googleClientId: string;
8
8
  googleClientSecret: string;
9
+ appleClientId: string;
10
+ appleClientSecret: string;
9
11
  port: number;
10
12
  nodeEnv: string;
11
13
  corsOrigins: string | undefined;
@@ -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 userAdditionalData: import("drizzle-orm/pg-core").PgTableWithColumns<{
663
- name: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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: "user_additional_data";
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 UserAdditionalData = InferSelectModel<typeof userAdditionalData>;
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 NewUserAdditionalData = InferInsertModel<typeof userAdditionalData>;
841
+ export type NewUserSettings = InferInsertModel<typeof userSettings>;
@@ -1206,3 +1206,133 @@ export declare const reviewLogs: import("drizzle-orm/pg-core").PgTableWithColumn
1206
1206
  }>;
1207
1207
  export type ReviewLog = InferSelectModel<typeof reviewLogs>;
1208
1208
  export type NewReviewLog = InferInsertModel<typeof reviewLogs>;
1209
+ export declare const cardDemand: import("drizzle-orm/pg-core").PgTableWithColumns<{
1210
+ name: "card_demand";
1211
+ schema: undefined;
1212
+ columns: {
1213
+ cardId: import("drizzle-orm/pg-core").PgColumn<{
1214
+ name: "card_id";
1215
+ tableName: "card_demand";
1216
+ dataType: "string";
1217
+ columnType: "PgText";
1218
+ data: string;
1219
+ driverParam: string;
1220
+ notNull: true;
1221
+ hasDefault: false;
1222
+ isPrimaryKey: false;
1223
+ isAutoincrement: false;
1224
+ hasRuntimeDefault: false;
1225
+ enumValues: [string, ...string[]];
1226
+ baseColumn: never;
1227
+ identity: undefined;
1228
+ generated: undefined;
1229
+ }, {}, {}>;
1230
+ userId: import("drizzle-orm/pg-core").PgColumn<{
1231
+ name: "user_id";
1232
+ tableName: "card_demand";
1233
+ dataType: "string";
1234
+ columnType: "PgText";
1235
+ data: string;
1236
+ driverParam: string;
1237
+ notNull: true;
1238
+ hasDefault: false;
1239
+ isPrimaryKey: false;
1240
+ isAutoincrement: false;
1241
+ hasRuntimeDefault: false;
1242
+ enumValues: [string, ...string[]];
1243
+ baseColumn: never;
1244
+ identity: undefined;
1245
+ generated: undefined;
1246
+ }, {}, {}>;
1247
+ content: import("drizzle-orm/pg-core").PgColumn<{
1248
+ name: "content";
1249
+ tableName: "card_demand";
1250
+ dataType: "string";
1251
+ columnType: "PgText";
1252
+ data: string;
1253
+ driverParam: string;
1254
+ notNull: true;
1255
+ hasDefault: false;
1256
+ isPrimaryKey: false;
1257
+ isAutoincrement: false;
1258
+ hasRuntimeDefault: false;
1259
+ enumValues: [string, ...string[]];
1260
+ baseColumn: never;
1261
+ identity: undefined;
1262
+ generated: undefined;
1263
+ }, {}, {}>;
1264
+ type: import("drizzle-orm/pg-core").PgColumn<{
1265
+ name: "type";
1266
+ tableName: "card_demand";
1267
+ dataType: "string";
1268
+ columnType: "PgText";
1269
+ data: string;
1270
+ driverParam: string;
1271
+ notNull: true;
1272
+ hasDefault: false;
1273
+ isPrimaryKey: false;
1274
+ isAutoincrement: false;
1275
+ hasRuntimeDefault: false;
1276
+ enumValues: [string, ...string[]];
1277
+ baseColumn: never;
1278
+ identity: undefined;
1279
+ generated: undefined;
1280
+ }, {}, {}>;
1281
+ status: import("drizzle-orm/pg-core").PgColumn<{
1282
+ name: "status";
1283
+ tableName: "card_demand";
1284
+ dataType: "string";
1285
+ columnType: "PgText";
1286
+ data: "not-reviewed" | "card-updated" | "demand-rejected" | "card-removed";
1287
+ driverParam: string;
1288
+ notNull: true;
1289
+ hasDefault: true;
1290
+ isPrimaryKey: false;
1291
+ isAutoincrement: false;
1292
+ hasRuntimeDefault: false;
1293
+ enumValues: [string, ...string[]];
1294
+ baseColumn: never;
1295
+ identity: undefined;
1296
+ generated: undefined;
1297
+ }, {}, {
1298
+ $type: "not-reviewed" | "card-updated" | "demand-rejected" | "card-removed";
1299
+ }>;
1300
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1301
+ name: "created_at";
1302
+ tableName: "card_demand";
1303
+ dataType: "date";
1304
+ columnType: "PgTimestamp";
1305
+ data: Date;
1306
+ driverParam: string;
1307
+ notNull: true;
1308
+ hasDefault: true;
1309
+ isPrimaryKey: false;
1310
+ isAutoincrement: false;
1311
+ hasRuntimeDefault: false;
1312
+ enumValues: undefined;
1313
+ baseColumn: never;
1314
+ identity: undefined;
1315
+ generated: undefined;
1316
+ }, {}, {}>;
1317
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
1318
+ name: "updated_at";
1319
+ tableName: "card_demand";
1320
+ dataType: "date";
1321
+ columnType: "PgTimestamp";
1322
+ data: Date;
1323
+ driverParam: string;
1324
+ notNull: true;
1325
+ hasDefault: true;
1326
+ isPrimaryKey: false;
1327
+ isAutoincrement: false;
1328
+ hasRuntimeDefault: false;
1329
+ enumValues: undefined;
1330
+ baseColumn: never;
1331
+ identity: undefined;
1332
+ generated: undefined;
1333
+ }, {}, {}>;
1334
+ };
1335
+ dialect: "pg";
1336
+ }>;
1337
+ export type CardDemand = InferSelectModel<typeof cardDemand>;
1338
+ export type NewCardDemand = InferInsertModel<typeof cardDemand>;
@@ -1,5 +1,5 @@
1
+ import type { EntityType } from '@vestcards/shared';
1
2
  import type { InferInsertModel, InferSelectModel } from 'drizzle-orm/table';
2
- type EntityType = 'user' | 'organization' | 'system';
3
3
  export declare const entity: import("drizzle-orm/pg-core").PgTableWithColumns<{
4
4
  name: "entity";
5
5
  schema: undefined;
@@ -45,4 +45,3 @@ export declare const entity: import("drizzle-orm/pg-core").PgTableWithColumns<{
45
45
  }>;
46
46
  export type Entity = InferSelectModel<typeof entity>;
47
47
  export type NewEntity = InferInsertModel<typeof entity>;
48
- export {};
@@ -262,6 +262,10 @@ export declare const auth: import("better-auth").Auth<{
262
262
  clientId: string;
263
263
  clientSecret: string;
264
264
  };
265
+ apple: {
266
+ clientId: string;
267
+ clientSecret: string;
268
+ };
265
269
  };
266
270
  user: {
267
271
  additionalFields: {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,398 @@
1
+ import { Elysia } from 'elysia';
2
+ export declare const cardModule: Elysia<"/v1/card", {
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
+ schema: {};
19
+ standaloneSchema: {};
20
+ macro: Partial<{
21
+ readonly auth: boolean;
22
+ }> & Partial<{
23
+ readonly permission: import("../auth/permissions/permissions").Permission | undefined;
24
+ }>;
25
+ macroFn: {
26
+ readonly auth: {
27
+ readonly resolve: ({ request: { headers } }: {
28
+ body: unknown;
29
+ query: Record<string, string>;
30
+ params: {};
31
+ headers: Record<string, string | undefined>;
32
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
33
+ server: import("elysia/universal/server").Server | null;
34
+ redirect: import("elysia").redirect;
35
+ set: {
36
+ headers: import("elysia").HTTPHeaders;
37
+ status?: number | keyof import("elysia").StatusMap;
38
+ redirect?: string;
39
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
40
+ };
41
+ path: string;
42
+ route: string;
43
+ request: Request;
44
+ store: {};
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
+ readonly 100: "Continue";
47
+ readonly 101: "Switching Protocols";
48
+ readonly 102: "Processing";
49
+ readonly 103: "Early Hints";
50
+ readonly 200: "OK";
51
+ readonly 201: "Created";
52
+ readonly 202: "Accepted";
53
+ readonly 203: "Non-Authoritative Information";
54
+ readonly 204: "No Content";
55
+ readonly 205: "Reset Content";
56
+ readonly 206: "Partial Content";
57
+ readonly 207: "Multi-Status";
58
+ readonly 208: "Already Reported";
59
+ readonly 300: "Multiple Choices";
60
+ readonly 301: "Moved Permanently";
61
+ readonly 302: "Found";
62
+ readonly 303: "See Other";
63
+ readonly 304: "Not Modified";
64
+ readonly 307: "Temporary Redirect";
65
+ readonly 308: "Permanent Redirect";
66
+ readonly 400: "Bad Request";
67
+ readonly 401: "Unauthorized";
68
+ readonly 402: "Payment Required";
69
+ readonly 403: "Forbidden";
70
+ readonly 404: "Not Found";
71
+ readonly 405: "Method Not Allowed";
72
+ readonly 406: "Not Acceptable";
73
+ readonly 407: "Proxy Authentication Required";
74
+ readonly 408: "Request Timeout";
75
+ readonly 409: "Conflict";
76
+ readonly 410: "Gone";
77
+ readonly 411: "Length Required";
78
+ readonly 412: "Precondition Failed";
79
+ readonly 413: "Payload Too Large";
80
+ readonly 414: "URI Too Long";
81
+ readonly 415: "Unsupported Media Type";
82
+ readonly 416: "Range Not Satisfiable";
83
+ readonly 417: "Expectation Failed";
84
+ readonly 418: "I'm a teapot";
85
+ readonly 420: "Enhance Your Calm";
86
+ readonly 421: "Misdirected Request";
87
+ readonly 422: "Unprocessable Content";
88
+ readonly 423: "Locked";
89
+ readonly 424: "Failed Dependency";
90
+ readonly 425: "Too Early";
91
+ readonly 426: "Upgrade Required";
92
+ readonly 428: "Precondition Required";
93
+ readonly 429: "Too Many Requests";
94
+ readonly 431: "Request Header Fields Too Large";
95
+ readonly 451: "Unavailable For Legal Reasons";
96
+ readonly 500: "Internal Server Error";
97
+ readonly 501: "Not Implemented";
98
+ readonly 502: "Bad Gateway";
99
+ readonly 503: "Service Unavailable";
100
+ readonly 504: "Gateway Timeout";
101
+ readonly 505: "HTTP Version Not Supported";
102
+ readonly 506: "Variant Also Negotiates";
103
+ readonly 507: "Insufficient Storage";
104
+ readonly 508: "Loop Detected";
105
+ readonly 510: "Not Extended";
106
+ readonly 511: "Network Authentication Required";
107
+ }[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaCustomStatusResponse<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
108
+ readonly Continue: 100;
109
+ readonly "Switching Protocols": 101;
110
+ readonly Processing: 102;
111
+ readonly "Early Hints": 103;
112
+ readonly OK: 200;
113
+ readonly Created: 201;
114
+ readonly Accepted: 202;
115
+ readonly "Non-Authoritative Information": 203;
116
+ readonly "No Content": 204;
117
+ readonly "Reset Content": 205;
118
+ readonly "Partial Content": 206;
119
+ readonly "Multi-Status": 207;
120
+ readonly "Already Reported": 208;
121
+ readonly "Multiple Choices": 300;
122
+ readonly "Moved Permanently": 301;
123
+ readonly Found: 302;
124
+ readonly "See Other": 303;
125
+ readonly "Not Modified": 304;
126
+ readonly "Temporary Redirect": 307;
127
+ readonly "Permanent Redirect": 308;
128
+ readonly "Bad Request": 400;
129
+ readonly Unauthorized: 401;
130
+ readonly "Payment Required": 402;
131
+ readonly Forbidden: 403;
132
+ readonly "Not Found": 404;
133
+ readonly "Method Not Allowed": 405;
134
+ readonly "Not Acceptable": 406;
135
+ readonly "Proxy Authentication Required": 407;
136
+ readonly "Request Timeout": 408;
137
+ readonly Conflict: 409;
138
+ readonly Gone: 410;
139
+ readonly "Length Required": 411;
140
+ readonly "Precondition Failed": 412;
141
+ readonly "Payload Too Large": 413;
142
+ readonly "URI Too Long": 414;
143
+ readonly "Unsupported Media Type": 415;
144
+ readonly "Range Not Satisfiable": 416;
145
+ readonly "Expectation Failed": 417;
146
+ readonly "I'm a teapot": 418;
147
+ readonly "Enhance Your Calm": 420;
148
+ readonly "Misdirected Request": 421;
149
+ readonly "Unprocessable Content": 422;
150
+ readonly Locked: 423;
151
+ readonly "Failed Dependency": 424;
152
+ readonly "Too Early": 425;
153
+ readonly "Upgrade Required": 426;
154
+ readonly "Precondition Required": 428;
155
+ readonly "Too Many Requests": 429;
156
+ readonly "Request Header Fields Too Large": 431;
157
+ readonly "Unavailable For Legal Reasons": 451;
158
+ readonly "Internal Server Error": 500;
159
+ readonly "Not Implemented": 501;
160
+ readonly "Bad Gateway": 502;
161
+ readonly "Service Unavailable": 503;
162
+ readonly "Gateway Timeout": 504;
163
+ readonly "HTTP Version Not Supported": 505;
164
+ readonly "Variant Also Negotiates": 506;
165
+ readonly "Insufficient Storage": 507;
166
+ readonly "Loop Detected": 508;
167
+ readonly "Not Extended": 510;
168
+ readonly "Network Authentication Required": 511;
169
+ }[Code] : Code>;
170
+ }) => Promise<{
171
+ entitlements: import("@vestcards/shared").Entitlement[];
172
+ user: {
173
+ id: string;
174
+ createdAt: Date;
175
+ updatedAt: Date;
176
+ email: string;
177
+ emailVerified: boolean;
178
+ name: string;
179
+ image?: string | null | undefined;
180
+ role: import("@vestcards/shared").UserRole;
181
+ entityId?: string | null | undefined;
182
+ surname?: string | null | undefined;
183
+ };
184
+ session: {
185
+ entitlements: import("@vestcards/shared").Entitlement[];
186
+ id: string;
187
+ createdAt: Date;
188
+ updatedAt: Date;
189
+ userId: string;
190
+ expiresAt: Date;
191
+ token: string;
192
+ ipAddress?: string | null | undefined;
193
+ userAgent?: string | null | undefined;
194
+ };
195
+ }>;
196
+ };
197
+ } & {
198
+ readonly permission: (permission?: import("../auth/permissions/permissions").Permission) => {
199
+ readonly resolve: ({ request: { headers } }: {
200
+ body: unknown;
201
+ query: Record<string, string>;
202
+ params: {};
203
+ headers: Record<string, string | undefined>;
204
+ cookie: Record<string, import("elysia").Cookie<unknown>>;
205
+ server: import("elysia/universal/server").Server | null;
206
+ redirect: import("elysia").redirect;
207
+ set: {
208
+ headers: import("elysia").HTTPHeaders;
209
+ status?: number | keyof import("elysia").StatusMap;
210
+ redirect?: string;
211
+ cookie?: Record<string, import("elysia/cookies").ElysiaCookie>;
212
+ };
213
+ path: string;
214
+ route: string;
215
+ request: Request;
216
+ store: {};
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
+ readonly 100: "Continue";
219
+ readonly 101: "Switching Protocols";
220
+ readonly 102: "Processing";
221
+ readonly 103: "Early Hints";
222
+ readonly 200: "OK";
223
+ readonly 201: "Created";
224
+ readonly 202: "Accepted";
225
+ readonly 203: "Non-Authoritative Information";
226
+ readonly 204: "No Content";
227
+ readonly 205: "Reset Content";
228
+ readonly 206: "Partial Content";
229
+ readonly 207: "Multi-Status";
230
+ readonly 208: "Already Reported";
231
+ readonly 300: "Multiple Choices";
232
+ readonly 301: "Moved Permanently";
233
+ readonly 302: "Found";
234
+ readonly 303: "See Other";
235
+ readonly 304: "Not Modified";
236
+ readonly 307: "Temporary Redirect";
237
+ readonly 308: "Permanent Redirect";
238
+ readonly 400: "Bad Request";
239
+ readonly 401: "Unauthorized";
240
+ readonly 402: "Payment Required";
241
+ readonly 403: "Forbidden";
242
+ readonly 404: "Not Found";
243
+ readonly 405: "Method Not Allowed";
244
+ readonly 406: "Not Acceptable";
245
+ readonly 407: "Proxy Authentication Required";
246
+ readonly 408: "Request Timeout";
247
+ readonly 409: "Conflict";
248
+ readonly 410: "Gone";
249
+ readonly 411: "Length Required";
250
+ readonly 412: "Precondition Failed";
251
+ readonly 413: "Payload Too Large";
252
+ readonly 414: "URI Too Long";
253
+ readonly 415: "Unsupported Media Type";
254
+ readonly 416: "Range Not Satisfiable";
255
+ readonly 417: "Expectation Failed";
256
+ readonly 418: "I'm a teapot";
257
+ readonly 420: "Enhance Your Calm";
258
+ readonly 421: "Misdirected Request";
259
+ readonly 422: "Unprocessable Content";
260
+ readonly 423: "Locked";
261
+ readonly 424: "Failed Dependency";
262
+ readonly 425: "Too Early";
263
+ readonly 426: "Upgrade Required";
264
+ readonly 428: "Precondition Required";
265
+ readonly 429: "Too Many Requests";
266
+ readonly 431: "Request Header Fields Too Large";
267
+ readonly 451: "Unavailable For Legal Reasons";
268
+ readonly 500: "Internal Server Error";
269
+ readonly 501: "Not Implemented";
270
+ readonly 502: "Bad Gateway";
271
+ readonly 503: "Service Unavailable";
272
+ readonly 504: "Gateway Timeout";
273
+ readonly 505: "HTTP Version Not Supported";
274
+ readonly 506: "Variant Also Negotiates";
275
+ readonly 507: "Insufficient Storage";
276
+ readonly 508: "Loop Detected";
277
+ readonly 510: "Not Extended";
278
+ readonly 511: "Network Authentication Required";
279
+ }[Code] : Code>(code: Code, response?: T) => import("elysia").ElysiaCustomStatusResponse<Code, T, Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Enhance Your Calm" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
280
+ readonly Continue: 100;
281
+ readonly "Switching Protocols": 101;
282
+ readonly Processing: 102;
283
+ readonly "Early Hints": 103;
284
+ readonly OK: 200;
285
+ readonly Created: 201;
286
+ readonly Accepted: 202;
287
+ readonly "Non-Authoritative Information": 203;
288
+ readonly "No Content": 204;
289
+ readonly "Reset Content": 205;
290
+ readonly "Partial Content": 206;
291
+ readonly "Multi-Status": 207;
292
+ readonly "Already Reported": 208;
293
+ readonly "Multiple Choices": 300;
294
+ readonly "Moved Permanently": 301;
295
+ readonly Found: 302;
296
+ readonly "See Other": 303;
297
+ readonly "Not Modified": 304;
298
+ readonly "Temporary Redirect": 307;
299
+ readonly "Permanent Redirect": 308;
300
+ readonly "Bad Request": 400;
301
+ readonly Unauthorized: 401;
302
+ readonly "Payment Required": 402;
303
+ readonly Forbidden: 403;
304
+ readonly "Not Found": 404;
305
+ readonly "Method Not Allowed": 405;
306
+ readonly "Not Acceptable": 406;
307
+ readonly "Proxy Authentication Required": 407;
308
+ readonly "Request Timeout": 408;
309
+ readonly Conflict: 409;
310
+ readonly Gone: 410;
311
+ readonly "Length Required": 411;
312
+ readonly "Precondition Failed": 412;
313
+ readonly "Payload Too Large": 413;
314
+ readonly "URI Too Long": 414;
315
+ readonly "Unsupported Media Type": 415;
316
+ readonly "Range Not Satisfiable": 416;
317
+ readonly "Expectation Failed": 417;
318
+ readonly "I'm a teapot": 418;
319
+ readonly "Enhance Your Calm": 420;
320
+ readonly "Misdirected Request": 421;
321
+ readonly "Unprocessable Content": 422;
322
+ readonly Locked: 423;
323
+ readonly "Failed Dependency": 424;
324
+ readonly "Too Early": 425;
325
+ readonly "Upgrade Required": 426;
326
+ readonly "Precondition Required": 428;
327
+ readonly "Too Many Requests": 429;
328
+ readonly "Request Header Fields Too Large": 431;
329
+ readonly "Unavailable For Legal Reasons": 451;
330
+ readonly "Internal Server Error": 500;
331
+ readonly "Not Implemented": 501;
332
+ readonly "Bad Gateway": 502;
333
+ readonly "Service Unavailable": 503;
334
+ readonly "Gateway Timeout": 504;
335
+ readonly "HTTP Version Not Supported": 505;
336
+ readonly "Variant Also Negotiates": 506;
337
+ readonly "Insufficient Storage": 507;
338
+ readonly "Loop Detected": 508;
339
+ readonly "Not Extended": 510;
340
+ readonly "Network Authentication Required": 511;
341
+ }[Code] : Code>;
342
+ }) => Promise<void>;
343
+ };
344
+ };
345
+ parser: {};
346
+ response: {};
347
+ }, {
348
+ v1: {
349
+ card: {};
350
+ };
351
+ } & {
352
+ v1: {
353
+ card: {
354
+ report: {
355
+ post: {
356
+ body: {
357
+ type: string;
358
+ cardId: string;
359
+ content: string;
360
+ };
361
+ params: {};
362
+ query: {};
363
+ headers: {};
364
+ response: {
365
+ 200: {
366
+ success: boolean;
367
+ };
368
+ 422: {
369
+ type: "validation";
370
+ on: string;
371
+ summary?: string;
372
+ message?: string;
373
+ found?: unknown;
374
+ property?: string;
375
+ expected?: string;
376
+ };
377
+ };
378
+ };
379
+ };
380
+ };
381
+ };
382
+ }, {
383
+ derive: {};
384
+ resolve: {};
385
+ schema: {};
386
+ standaloneSchema: {};
387
+ response: {};
388
+ }, {
389
+ derive: {};
390
+ resolve: {};
391
+ schema: {};
392
+ standaloneSchema: {};
393
+ response: {
394
+ [x: string]: {
395
+ [x: string]: any;
396
+ };
397
+ };
398
+ }>;
@@ -0,0 +1,8 @@
1
+ export declare namespace CardModel {
2
+ const reportBody: import("@sinclair/typebox").TObject<{
3
+ cardId: import("@sinclair/typebox").TString;
4
+ content: import("@sinclair/typebox").TString;
5
+ type: import("@sinclair/typebox").TString;
6
+ }>;
7
+ type ReportBody = typeof reportBody.static;
8
+ }
@@ -0,0 +1,4 @@
1
+ import type { CardModel } from './model';
2
+ export declare abstract class CardService {
3
+ static reportCard(userId: string, body: CardModel.ReportBody): Promise<void>;
4
+ }
@@ -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
+ }>;
@@ -27,5 +27,6 @@ export declare namespace DeckModel {
27
27
  interface DeckListFilters extends Pagination, Sort, Search {
28
28
  subjects?: Subject[];
29
29
  free?: boolean;
30
+ ownerEntityId?: string;
30
31
  }
31
32
  }
@@ -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 {};
@@ -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,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",
@@ -19,7 +21,9 @@ export interface ICard {
19
21
  url: string;
20
22
  };
21
23
  }
24
+ export type EntityType = 'user' | 'organization' | 'official';
22
25
  export interface IOwnerInfo {
26
+ type: EntityType;
23
27
  id: string;
24
28
  name: string;
25
29
  image: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vestcards/server-types",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {