@vestcards/server-types 0.1.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.
- package/dist/apps/server/src/app.d.ts +161 -144
- package/dist/apps/server/src/config/env.d.ts +1 -0
- 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/permissions/permissions.d.ts +6 -1
- package/dist/apps/server/src/modules/deck/index.d.ts +10 -53
- package/dist/apps/server/src/modules/lead/index.d.ts +9 -37
- package/dist/apps/server/src/modules/library/index.d.ts +492 -0
- package/dist/apps/server/src/modules/library/library.test.d.ts +1 -0
- package/dist/apps/server/src/modules/library/model.d.ts +8 -0
- package/dist/apps/server/src/modules/library/service.d.ts +10 -0
- 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 +1 -1
- package/dist/apps/server/src/tests/helpers/http-helpers.d.ts +4 -0
- package/dist/apps/server/src/types/study.d.ts +1 -1
- package/dist/packages/shared/src/types/deck.d.ts +0 -1
- package/dist/packages/shared/src/types/study.d.ts +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { Elysia } from 'elysia';
|
|
2
|
+
export declare const libraryModule: Elysia<"/v1/library", {
|
|
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
|
+
library: {};
|
|
350
|
+
};
|
|
351
|
+
} & {
|
|
352
|
+
v1: {
|
|
353
|
+
library: {
|
|
354
|
+
get: {
|
|
355
|
+
body: {};
|
|
356
|
+
params: {};
|
|
357
|
+
query: {};
|
|
358
|
+
headers: {};
|
|
359
|
+
response: {
|
|
360
|
+
200: import("@vestcards/shared").GroupedLibraryData;
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
} & {
|
|
366
|
+
v1: {
|
|
367
|
+
library: {
|
|
368
|
+
archived: {
|
|
369
|
+
get: {
|
|
370
|
+
body: {};
|
|
371
|
+
params: {};
|
|
372
|
+
query: {};
|
|
373
|
+
headers: {};
|
|
374
|
+
response: {
|
|
375
|
+
200: import("@vestcards/shared").ArchivedLibraryItem[];
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
} & {
|
|
382
|
+
v1: {
|
|
383
|
+
library: {
|
|
384
|
+
decks: {
|
|
385
|
+
":deckId": {
|
|
386
|
+
post: {
|
|
387
|
+
body: {};
|
|
388
|
+
params: {
|
|
389
|
+
deckId: string;
|
|
390
|
+
};
|
|
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
|
+
};
|
|
412
|
+
} & {
|
|
413
|
+
v1: {
|
|
414
|
+
library: {
|
|
415
|
+
decks: {
|
|
416
|
+
":deckId": {
|
|
417
|
+
delete: {
|
|
418
|
+
body: {};
|
|
419
|
+
params: {
|
|
420
|
+
deckId: string;
|
|
421
|
+
};
|
|
422
|
+
query: {};
|
|
423
|
+
headers: {};
|
|
424
|
+
response: {
|
|
425
|
+
200: {
|
|
426
|
+
success: boolean;
|
|
427
|
+
};
|
|
428
|
+
422: {
|
|
429
|
+
type: "validation";
|
|
430
|
+
on: string;
|
|
431
|
+
summary?: string;
|
|
432
|
+
message?: string;
|
|
433
|
+
found?: unknown;
|
|
434
|
+
property?: string;
|
|
435
|
+
expected?: string;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
} & {
|
|
444
|
+
v1: {
|
|
445
|
+
library: {
|
|
446
|
+
decks: {
|
|
447
|
+
":deckId": {
|
|
448
|
+
patch: {
|
|
449
|
+
body: {
|
|
450
|
+
suspended: boolean;
|
|
451
|
+
};
|
|
452
|
+
params: {
|
|
453
|
+
deckId: string;
|
|
454
|
+
};
|
|
455
|
+
query: {};
|
|
456
|
+
headers: {};
|
|
457
|
+
response: {
|
|
458
|
+
200: {
|
|
459
|
+
success: boolean;
|
|
460
|
+
};
|
|
461
|
+
422: {
|
|
462
|
+
type: "validation";
|
|
463
|
+
on: string;
|
|
464
|
+
summary?: string;
|
|
465
|
+
message?: string;
|
|
466
|
+
found?: unknown;
|
|
467
|
+
property?: string;
|
|
468
|
+
expected?: string;
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
}, {
|
|
477
|
+
derive: {};
|
|
478
|
+
resolve: {};
|
|
479
|
+
schema: {};
|
|
480
|
+
standaloneSchema: {};
|
|
481
|
+
response: {};
|
|
482
|
+
}, {
|
|
483
|
+
derive: {};
|
|
484
|
+
resolve: {};
|
|
485
|
+
schema: {};
|
|
486
|
+
standaloneSchema: {};
|
|
487
|
+
response: {
|
|
488
|
+
[x: string]: {
|
|
489
|
+
[x: string]: any;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare namespace LibraryModel {
|
|
2
|
+
const deckIdParams: import("@sinclair/typebox").TObject<{
|
|
3
|
+
deckId: import("@sinclair/typebox").TString;
|
|
4
|
+
}>;
|
|
5
|
+
const updateBody: import("@sinclair/typebox").TObject<{
|
|
6
|
+
suspended: import("@sinclair/typebox").TBoolean;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ArchivedLibraryItem, GroupedLibraryData } from '@vestcards/shared';
|
|
2
|
+
export declare abstract class LibraryService {
|
|
3
|
+
static getGroupedLibraryData(userId: string): Promise<GroupedLibraryData>;
|
|
4
|
+
static getArchivedLibraryData(userId: string): Promise<ArchivedLibraryItem[]>;
|
|
5
|
+
static startDeckStudy(userId: string, deckId: string): Promise<void>;
|
|
6
|
+
static deleteDeckStudy(userId: string, deckId: string): Promise<void>;
|
|
7
|
+
static updateDeckStudySuspended(userId: string, deckId: string, suspended: boolean): Promise<void>;
|
|
8
|
+
private static fetchStudyPlanRows;
|
|
9
|
+
private static buildGroupedData;
|
|
10
|
+
}
|
|
@@ -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
|
}>;
|