@vestcards/server-types 1.0.2 → 1.1.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 +402 -22
- package/dist/apps/server/src/config/env.d.ts +3 -2
- package/dist/apps/server/src/modules/auth/index.d.ts +35 -4
- package/dist/apps/server/src/modules/auth/lib.d.ts +18 -7
- package/dist/apps/server/src/modules/auth/permissions/completed-profile.d.ts +1 -0
- package/dist/apps/server/src/modules/auth/permissions/entitlements.d.ts +1 -1
- package/dist/apps/server/src/modules/auth/permissions/permissions.d.ts +2 -66
- package/dist/apps/server/src/modules/card/index.d.ts +71 -5
- package/dist/apps/server/src/modules/card/model.d.ts +4 -0
- package/dist/apps/server/src/modules/card/service.d.ts +2 -0
- package/dist/apps/server/src/modules/deck/index.d.ts +41 -9
- package/dist/apps/server/src/modules/deck/model.d.ts +5 -3
- package/dist/apps/server/src/modules/library/index.d.ts +55 -5
- package/dist/apps/server/src/modules/library/service.d.ts +4 -0
- package/dist/apps/server/src/modules/study/index.d.ts +87 -8
- package/dist/apps/server/src/modules/study/lib/fsrs.d.ts +1 -1
- package/dist/apps/server/src/modules/study/model.d.ts +7 -1
- package/dist/apps/server/src/modules/study/service.d.ts +22 -1
- package/dist/apps/server/src/modules/topic/index.d.ts +38 -7
- package/dist/apps/server/src/modules/user/index.d.ts +108 -5
- package/dist/apps/server/src/modules/user/model.d.ts +8 -0
- package/dist/apps/server/src/modules/user/service.d.ts +15 -0
- package/dist/apps/server/src/tests/helpers/auth-helpers.d.ts +1 -1
- package/dist/apps/server/src/tests/helpers/fixtures.d.ts +33 -2
- package/dist/apps/server/src/utils/select.d.ts +1 -1
- package/dist/packages/db-core/src/db.d.ts +4 -0
- package/dist/packages/db-core/src/index.d.ts +4 -0
- package/dist/{apps/server/src/db → packages/db-core/src}/schema/auth.d.ts +26 -9
- package/dist/packages/db-core/src/schema/blog.d.ts +219 -0
- package/dist/{apps/server/src/db → packages/db-core/src}/schema/entity.d.ts +2 -2
- package/dist/{apps/server/src/db → packages/db-core/src}/schema/index.d.ts +3 -0
- package/dist/packages/db-core/src/schema/organization.d.ts +158 -0
- package/dist/{apps/server/src/db → packages/db-core/src}/schema/payment.d.ts +18 -1
- package/dist/packages/db-core/src/schema/studyPlan.d.ts +511 -0
- package/dist/{apps/server/src/db → packages/db-core/src}/utils.d.ts +1 -0
- package/dist/packages/db-core/src/views/deck.d.ts +79 -0
- package/dist/packages/shared/src/eden.d.ts +43 -0
- package/dist/packages/shared/src/index.d.ts +1 -0
- package/dist/packages/shared/src/theme/data-colors.d.ts +2 -0
- package/dist/packages/shared/src/theme/index.d.ts +3 -0
- package/dist/packages/shared/src/theme/tokens/border.d.ts +11 -0
- package/dist/packages/shared/src/theme/tokens/colors.d.ts +356 -0
- package/dist/packages/shared/src/theme/utils.d.ts +7 -0
- package/dist/packages/shared/src/types/blog.d.ts +8 -0
- package/dist/packages/shared/src/types/deck.d.ts +2 -1
- package/dist/packages/shared/src/types/fsrs.d.ts +9 -8
- package/dist/packages/shared/src/types/index.d.ts +3 -0
- package/dist/packages/shared/src/types/permissions.d.ts +108 -0
- package/dist/packages/shared/src/types/studyPlan.d.ts +5 -0
- package/dist/packages/shared/src/types/subject.d.ts +19 -2
- package/package.json +1 -1
- package/dist/apps/server/src/db/index.d.ts +0 -6
- package/dist/apps/server/src/db/migrate.d.ts +0 -1
- package/dist/apps/server/src/db/types.d.ts +0 -2
- package/dist/apps/server/src/utils/uuid.d.ts +0 -1
- /package/dist/{apps/server/src/db → packages/db-core/src}/schema/data.d.ts +0 -0
- /package/dist/{apps/server/src/db → packages/db-core/src}/schema/deck.d.ts +0 -0
- /package/dist/{apps/server/src/db → packages/db-core/src}/schema/marketing.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
+
import { UserRole } from '@vestcards/shared';
|
|
1
2
|
import { type BetterAuthOptions } from 'better-auth';
|
|
2
|
-
import { UserRole } from '../../db';
|
|
3
|
-
import { generateId } from '../../utils/uuid';
|
|
4
3
|
export declare const auth: import("better-auth").Auth<{
|
|
5
4
|
plugins: [{
|
|
6
5
|
id: "open-api";
|
|
@@ -45,7 +44,7 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
45
44
|
}[];
|
|
46
45
|
paths: Record<string, import("better-auth/plugins").Path>;
|
|
47
46
|
}>;
|
|
48
|
-
openAPIReference: import("better-call").StrictEndpoint<"/reference", {
|
|
47
|
+
openAPIReference: import("better-call").StrictEndpoint<import("better-auth").LiteralString | "/reference", {
|
|
49
48
|
method: "GET";
|
|
50
49
|
metadata: {
|
|
51
50
|
readonly scope: "server";
|
|
@@ -115,6 +114,7 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
115
114
|
};
|
|
116
115
|
session: {
|
|
117
116
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
117
|
+
completedProfile: boolean;
|
|
118
118
|
id: string;
|
|
119
119
|
createdAt: Date;
|
|
120
120
|
updatedAt: Date;
|
|
@@ -172,6 +172,7 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
172
172
|
};
|
|
173
173
|
session: {
|
|
174
174
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
175
|
+
completedProfile: boolean;
|
|
175
176
|
id: string;
|
|
176
177
|
createdAt: Date;
|
|
177
178
|
updatedAt: Date;
|
|
@@ -199,6 +200,7 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
199
200
|
};
|
|
200
201
|
session: {
|
|
201
202
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
203
|
+
completedProfile: boolean;
|
|
202
204
|
id: string;
|
|
203
205
|
createdAt: Date;
|
|
204
206
|
updatedAt: Date;
|
|
@@ -215,10 +217,10 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
215
217
|
baseURL: string;
|
|
216
218
|
basePath: string;
|
|
217
219
|
database: (options: BetterAuthOptions) => import("better-auth").DBAdapter<BetterAuthOptions>;
|
|
218
|
-
secondaryStorage: import("better-auth").SecondaryStorage;
|
|
220
|
+
secondaryStorage: import("better-auth").SecondaryStorage | undefined;
|
|
219
221
|
emailAndPassword: {
|
|
220
222
|
enabled: true;
|
|
221
|
-
autoSignIn:
|
|
223
|
+
autoSignIn: false;
|
|
222
224
|
requireEmailVerification: boolean;
|
|
223
225
|
minPasswordLength: number;
|
|
224
226
|
maxPasswordLength: number;
|
|
@@ -255,6 +257,11 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
255
257
|
required: false;
|
|
256
258
|
defaultValue: never[];
|
|
257
259
|
};
|
|
260
|
+
completedProfile: {
|
|
261
|
+
type: "boolean";
|
|
262
|
+
required: false;
|
|
263
|
+
defaultValue: false;
|
|
264
|
+
};
|
|
258
265
|
};
|
|
259
266
|
};
|
|
260
267
|
socialProviders: {
|
|
@@ -313,14 +320,18 @@ export declare const auth: import("better-auth").Auth<{
|
|
|
313
320
|
};
|
|
314
321
|
};
|
|
315
322
|
logger: {
|
|
316
|
-
log(level: "
|
|
323
|
+
log(level: "info" | "debug" | "warn" | "error", message: string, ...args: any[]): void;
|
|
317
324
|
};
|
|
318
325
|
advanced: {
|
|
319
326
|
useSecureCookies: boolean;
|
|
320
327
|
disableOriginCheck: true;
|
|
321
328
|
cookiePrefix: string;
|
|
329
|
+
defaultCookieAttributes: {
|
|
330
|
+
sameSite: "none" | "lax";
|
|
331
|
+
secure: boolean;
|
|
332
|
+
};
|
|
322
333
|
database: {
|
|
323
|
-
generateId:
|
|
334
|
+
generateId: false;
|
|
324
335
|
};
|
|
325
336
|
};
|
|
326
337
|
trustedOrigins: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hasUserCompletedProfile(userId: string): Promise<boolean>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Entitlement } from '
|
|
1
|
+
import { Entitlement } from '@vestcards/shared';
|
|
2
2
|
export declare function getUserEntitlements(userId: string): Promise<Entitlement[]>;
|
|
@@ -1,66 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly DECK: {
|
|
4
|
-
readonly CREATE_OWN: "deck:create:own";
|
|
5
|
-
readonly CREATE_PUBLIC: "deck:create:public";
|
|
6
|
-
readonly READ_OWN: "deck:read:own";
|
|
7
|
-
readonly READ_FREE: "deck:read:free";
|
|
8
|
-
readonly READ_PREMIUM: "deck:read:premium";
|
|
9
|
-
readonly READ_PRIVATE: "deck:read:private";
|
|
10
|
-
readonly UPDATE_OWN: "deck:update:own";
|
|
11
|
-
readonly UPDATE_PUBLIC: "deck:update:public";
|
|
12
|
-
readonly DELETE_OWN: "deck:delete:own";
|
|
13
|
-
readonly DELETE_PUBLIC: "deck:delete:public";
|
|
14
|
-
};
|
|
15
|
-
readonly CARD_DEMAND: {
|
|
16
|
-
readonly READ: "card-demand:read";
|
|
17
|
-
readonly CREATE: "card-demand:create";
|
|
18
|
-
readonly ACTION: "card-demand:action";
|
|
19
|
-
};
|
|
20
|
-
readonly USER: {
|
|
21
|
-
readonly UPDATE_OWN: "user:update:own";
|
|
22
|
-
readonly UPDATE_ALL: "user:update:*";
|
|
23
|
-
readonly DELETE_OWN: "user:delete:own";
|
|
24
|
-
readonly DELETE_ALL: "user:delete:*";
|
|
25
|
-
readonly READ_OWN: "user:read:own";
|
|
26
|
-
readonly READ_ALL: "user:read:*";
|
|
27
|
-
};
|
|
28
|
-
readonly STATS: {
|
|
29
|
-
readonly VIEW: "stats:view";
|
|
30
|
-
};
|
|
31
|
-
readonly MEMBERSHIP: {
|
|
32
|
-
readonly MANAGE: "membership:manage";
|
|
33
|
-
};
|
|
34
|
-
readonly PLAN: {
|
|
35
|
-
readonly CREATE: "plan:create";
|
|
36
|
-
readonly UPDATE: "plan:update";
|
|
37
|
-
readonly DELETE: "plan:delete";
|
|
38
|
-
};
|
|
39
|
-
readonly BLOGPOST: {
|
|
40
|
-
readonly CREATE: "blogpost:create";
|
|
41
|
-
readonly UPDATE: "blogpost:update";
|
|
42
|
-
readonly DELETE: "blogpost:delete";
|
|
43
|
-
};
|
|
44
|
-
readonly VESTY: {
|
|
45
|
-
readonly CHAT: "vesty:chat";
|
|
46
|
-
};
|
|
47
|
-
readonly STUDY: {
|
|
48
|
-
readonly READ: "study:read";
|
|
49
|
-
readonly WRITE: "study:write";
|
|
50
|
-
};
|
|
51
|
-
readonly LIBRARY: {
|
|
52
|
-
readonly READ: "library:read";
|
|
53
|
-
readonly WRITE: "library:write";
|
|
54
|
-
readonly WRITE_PREMIUM: "library:write:premium";
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
declare const ALL_PERMISSIONS: ("deck:create:own" | "deck:create:public" | "deck:read:own" | "deck:read:free" | "deck:read:premium" | "deck:read:private" | "deck:update:own" | "deck:update:public" | "deck:delete:own" | "deck:delete:public" | "card-demand:read" | "card-demand:create" | "card-demand:action" | "user:update:own" | "user:update:*" | "user:delete:own" | "user:delete:*" | "user:read:own" | "user:read:*" | "stats:view" | "membership:manage" | "plan:create" | "plan:update" | "plan:delete" | "blogpost:create" | "blogpost:update" | "blogpost:delete" | "vesty:chat" | "study:read" | "study:write" | "library:read" | "library:write" | "library:write:premium")[];
|
|
58
|
-
declare const ROLE_PERMISSIONS: Record<UserRole, Permission[]>;
|
|
59
|
-
declare const ENTITLEMENT_PERMISSIONS: Record<Entitlement, Permission[]>;
|
|
60
|
-
type ValueOf<T> = T[keyof T];
|
|
61
|
-
type Permission = ValueOf<{
|
|
62
|
-
[K in keyof typeof PERMISSIONS]: ValueOf<(typeof PERMISSIONS)[K]>;
|
|
63
|
-
}>;
|
|
64
|
-
declare const hasPermission: (required: Permission, userRole?: UserRole, userEntitlements?: Entitlement[]) => boolean;
|
|
65
|
-
export { ALL_PERMISSIONS, ENTITLEMENT_PERMISSIONS, hasPermission, PERMISSIONS, ROLE_PERMISSIONS };
|
|
66
|
-
export type { Permission };
|
|
1
|
+
export type { Permission } from '@vestcards/shared';
|
|
2
|
+
export { ALL_PERMISSIONS, ENTITLEMENT_PERMISSIONS, hasPermission, PERMISSIONS, ROLE_PERMISSIONS } from '@vestcards/shared';
|
|
@@ -20,7 +20,7 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
20
20
|
macro: Partial<{
|
|
21
21
|
readonly auth: boolean;
|
|
22
22
|
}> & Partial<{
|
|
23
|
-
readonly permission: import("
|
|
23
|
+
readonly permission: import("@vestcards/shared").Permission | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
macroFn: {
|
|
26
26
|
readonly auth: {
|
|
@@ -42,7 +42,7 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
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
|
|
45
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 400 | 301 | 302 | 303 | 307 | 308 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 304 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 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";
|
|
@@ -169,6 +169,7 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
169
169
|
}[Code] : Code>;
|
|
170
170
|
}) => Promise<{
|
|
171
171
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
172
|
+
completedProfile: boolean;
|
|
172
173
|
user: {
|
|
173
174
|
id: string;
|
|
174
175
|
createdAt: Date;
|
|
@@ -183,6 +184,7 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
183
184
|
};
|
|
184
185
|
session: {
|
|
185
186
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
187
|
+
completedProfile: boolean;
|
|
186
188
|
id: string;
|
|
187
189
|
createdAt: Date;
|
|
188
190
|
updatedAt: Date;
|
|
@@ -195,7 +197,7 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
195
197
|
}>;
|
|
196
198
|
};
|
|
197
199
|
} & {
|
|
198
|
-
readonly permission: (permission?: import("
|
|
200
|
+
readonly permission: (permission?: import("@vestcards/shared").Permission) => {
|
|
199
201
|
readonly resolve: ({ request: { headers } }: {
|
|
200
202
|
body: unknown;
|
|
201
203
|
query: Record<string, string>;
|
|
@@ -214,7 +216,7 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
214
216
|
route: string;
|
|
215
217
|
request: Request;
|
|
216
218
|
store: {};
|
|
217
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends
|
|
219
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 400 | 301 | 302 | 303 | 307 | 308 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 304 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
218
220
|
readonly 100: "Continue";
|
|
219
221
|
readonly 101: "Switching Protocols";
|
|
220
222
|
readonly 102: "Processing";
|
|
@@ -346,7 +348,71 @@ export declare const cardModule: Elysia<"/v1/card", {
|
|
|
346
348
|
response: {};
|
|
347
349
|
}, {
|
|
348
350
|
v1: {
|
|
349
|
-
card: {
|
|
351
|
+
card: {
|
|
352
|
+
v1: {
|
|
353
|
+
auth: {
|
|
354
|
+
"validate-reset-token": {
|
|
355
|
+
get: {
|
|
356
|
+
body: unknown;
|
|
357
|
+
params: {};
|
|
358
|
+
query: {
|
|
359
|
+
token: string;
|
|
360
|
+
};
|
|
361
|
+
headers: unknown;
|
|
362
|
+
response: {
|
|
363
|
+
200: {
|
|
364
|
+
valid: boolean;
|
|
365
|
+
};
|
|
366
|
+
422: {
|
|
367
|
+
type: "validation";
|
|
368
|
+
on: string;
|
|
369
|
+
summary?: string;
|
|
370
|
+
message?: string;
|
|
371
|
+
found?: unknown;
|
|
372
|
+
property?: string;
|
|
373
|
+
expected?: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
} & {
|
|
383
|
+
v1: {
|
|
384
|
+
card: {
|
|
385
|
+
report: {
|
|
386
|
+
get: {
|
|
387
|
+
body: {};
|
|
388
|
+
params: {};
|
|
389
|
+
query: {
|
|
390
|
+
cardId: string;
|
|
391
|
+
};
|
|
392
|
+
headers: {};
|
|
393
|
+
response: {
|
|
394
|
+
200: {
|
|
395
|
+
type: string;
|
|
396
|
+
createdAt: Date;
|
|
397
|
+
updatedAt: Date;
|
|
398
|
+
userId: string;
|
|
399
|
+
status: "not-reviewed" | "card-updated" | "demand-rejected" | "card-removed";
|
|
400
|
+
cardId: string;
|
|
401
|
+
content: string;
|
|
402
|
+
} | null;
|
|
403
|
+
422: {
|
|
404
|
+
type: "validation";
|
|
405
|
+
on: string;
|
|
406
|
+
summary?: string;
|
|
407
|
+
message?: string;
|
|
408
|
+
found?: unknown;
|
|
409
|
+
property?: string;
|
|
410
|
+
expected?: string;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
};
|
|
350
416
|
};
|
|
351
417
|
} & {
|
|
352
418
|
v1: {
|
|
@@ -5,4 +5,8 @@ export declare namespace CardModel {
|
|
|
5
5
|
type: import("@sinclair/typebox").TString;
|
|
6
6
|
}>;
|
|
7
7
|
type ReportBody = typeof reportBody.static;
|
|
8
|
+
const reportQuery: import("@sinclair/typebox").TObject<{
|
|
9
|
+
cardId: import("@sinclair/typebox").TString;
|
|
10
|
+
}>;
|
|
11
|
+
type ReportQuery = typeof reportQuery.static;
|
|
8
12
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { CardDemand } from '@vestcards/db-core';
|
|
1
2
|
import type { CardModel } from './model';
|
|
2
3
|
export declare abstract class CardService {
|
|
4
|
+
static getReport(userId: string, cardId: string): Promise<CardDemand | null>;
|
|
3
5
|
static reportCard(userId: string, body: CardModel.ReportBody): Promise<void>;
|
|
4
6
|
}
|
|
@@ -20,7 +20,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
20
20
|
macro: Partial<{
|
|
21
21
|
readonly auth: boolean;
|
|
22
22
|
}> & Partial<{
|
|
23
|
-
readonly permission: import("
|
|
23
|
+
readonly permission: import("@vestcards/shared").Permission | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
macroFn: {
|
|
26
26
|
readonly auth: {
|
|
@@ -42,7 +42,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
42
42
|
route: string;
|
|
43
43
|
request: Request;
|
|
44
44
|
store: {};
|
|
45
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends
|
|
45
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 400 | 301 | 302 | 303 | 307 | 308 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 304 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 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";
|
|
@@ -169,6 +169,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
169
169
|
}[Code] : Code>;
|
|
170
170
|
}) => Promise<{
|
|
171
171
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
172
|
+
completedProfile: boolean;
|
|
172
173
|
user: {
|
|
173
174
|
id: string;
|
|
174
175
|
createdAt: Date;
|
|
@@ -183,6 +184,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
183
184
|
};
|
|
184
185
|
session: {
|
|
185
186
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
187
|
+
completedProfile: boolean;
|
|
186
188
|
id: string;
|
|
187
189
|
createdAt: Date;
|
|
188
190
|
updatedAt: Date;
|
|
@@ -195,7 +197,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
195
197
|
}>;
|
|
196
198
|
};
|
|
197
199
|
} & {
|
|
198
|
-
readonly permission: (permission?: import("
|
|
200
|
+
readonly permission: (permission?: import("@vestcards/shared").Permission) => {
|
|
199
201
|
readonly resolve: ({ request: { headers } }: {
|
|
200
202
|
body: unknown;
|
|
201
203
|
query: Record<string, string>;
|
|
@@ -214,7 +216,7 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
214
216
|
route: string;
|
|
215
217
|
request: Request;
|
|
216
218
|
store: {};
|
|
217
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends
|
|
219
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 400 | 301 | 302 | 303 | 307 | 308 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 304 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
218
220
|
readonly 100: "Continue";
|
|
219
221
|
readonly 101: "Switching Protocols";
|
|
220
222
|
readonly 102: "Processing";
|
|
@@ -346,13 +348,42 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
346
348
|
response: {};
|
|
347
349
|
}, {
|
|
348
350
|
v1: {
|
|
349
|
-
decks: {
|
|
351
|
+
decks: {
|
|
352
|
+
v1: {
|
|
353
|
+
auth: {
|
|
354
|
+
"validate-reset-token": {
|
|
355
|
+
get: {
|
|
356
|
+
body: unknown;
|
|
357
|
+
params: {};
|
|
358
|
+
query: {
|
|
359
|
+
token: string;
|
|
360
|
+
};
|
|
361
|
+
headers: unknown;
|
|
362
|
+
response: {
|
|
363
|
+
200: {
|
|
364
|
+
valid: boolean;
|
|
365
|
+
};
|
|
366
|
+
422: {
|
|
367
|
+
type: "validation";
|
|
368
|
+
on: string;
|
|
369
|
+
summary?: string;
|
|
370
|
+
message?: string;
|
|
371
|
+
found?: unknown;
|
|
372
|
+
property?: string;
|
|
373
|
+
expected?: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
350
381
|
};
|
|
351
382
|
} & {
|
|
352
383
|
v1: {
|
|
353
384
|
decks: {
|
|
354
385
|
get: {
|
|
355
|
-
body:
|
|
386
|
+
body: {};
|
|
356
387
|
params: {};
|
|
357
388
|
query: {
|
|
358
389
|
sort?: string | undefined;
|
|
@@ -360,12 +391,13 @@ export declare const deckModule: Elysia<"/v1/decks", {
|
|
|
360
391
|
ownerId?: string | undefined;
|
|
361
392
|
order?: "asc" | "desc" | undefined;
|
|
362
393
|
q?: string | undefined;
|
|
363
|
-
|
|
364
|
-
|
|
394
|
+
ids?: string[] | undefined;
|
|
395
|
+
topicIds?: string[] | undefined;
|
|
396
|
+
subjects?: ("matemática" | "geografia" | "física" | "biologia" | "história" | "literatura" | "gramática" | "sociologia" | "química" | "filosofia" | "redação" | "artes" | "inglês")[] | undefined;
|
|
365
397
|
size: number;
|
|
366
398
|
page: number;
|
|
367
399
|
};
|
|
368
|
-
headers:
|
|
400
|
+
headers: {};
|
|
369
401
|
response: {
|
|
370
402
|
200: {
|
|
371
403
|
data: import("@vestcards/shared").IDeck[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Subject } from '@vestcards/shared';
|
|
2
2
|
import { type Pagination, type Search, type Sort } from '../../utils/api';
|
|
3
3
|
export declare namespace DeckModel {
|
|
4
4
|
const deckFilter: (ownerId?: string) => import("drizzle-orm").SQL<unknown> | undefined;
|
|
@@ -10,8 +10,9 @@ export declare namespace DeckModel {
|
|
|
10
10
|
q: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
11
|
free: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
12
12
|
ownerId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
ids: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
14
|
+
topicIds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
15
|
+
subjects: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TEnum<Record<"matemática" | "geografia" | "física" | "biologia" | "história" | "literatura" | "gramática" | "sociologia" | "química" | "filosofia" | "redação" | "artes" | "inglês", "matemática" | "geografia" | "física" | "biologia" | "história" | "literatura" | "gramática" | "sociologia" | "química" | "filosofia" | "redação" | "artes" | "inglês">>>>;
|
|
15
16
|
}>;
|
|
16
17
|
type ListQuery = typeof listQuery.static;
|
|
17
18
|
const deckIdParams: import("@sinclair/typebox").TObject<{
|
|
@@ -27,6 +28,7 @@ export declare namespace DeckModel {
|
|
|
27
28
|
}>;
|
|
28
29
|
type TopicIdParams = typeof topicIdParams.static;
|
|
29
30
|
interface DeckListFilters extends Pagination, Sort, Search {
|
|
31
|
+
ids?: string[];
|
|
30
32
|
topicIds?: string[];
|
|
31
33
|
subjects?: Subject[];
|
|
32
34
|
free?: boolean;
|
|
@@ -20,7 +20,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
20
20
|
macro: Partial<{
|
|
21
21
|
readonly auth: boolean;
|
|
22
22
|
}> & Partial<{
|
|
23
|
-
readonly permission: import("
|
|
23
|
+
readonly permission: import("@vestcards/shared").Permission | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
macroFn: {
|
|
26
26
|
readonly auth: {
|
|
@@ -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
|
|
45
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 400 | 301 | 302 | 303 | 307 | 308 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 304 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 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";
|
|
@@ -169,6 +169,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
169
169
|
}[Code] : Code>;
|
|
170
170
|
}) => Promise<{
|
|
171
171
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
172
|
+
completedProfile: boolean;
|
|
172
173
|
user: {
|
|
173
174
|
id: string;
|
|
174
175
|
createdAt: Date;
|
|
@@ -183,6 +184,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
183
184
|
};
|
|
184
185
|
session: {
|
|
185
186
|
entitlements: import("@vestcards/shared").Entitlement[];
|
|
187
|
+
completedProfile: boolean;
|
|
186
188
|
id: string;
|
|
187
189
|
createdAt: Date;
|
|
188
190
|
updatedAt: Date;
|
|
@@ -195,7 +197,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
195
197
|
}>;
|
|
196
198
|
};
|
|
197
199
|
} & {
|
|
198
|
-
readonly permission: (permission?: import("
|
|
200
|
+
readonly permission: (permission?: import("@vestcards/shared").Permission) => {
|
|
199
201
|
readonly resolve: ({ request: { headers } }: {
|
|
200
202
|
body: unknown;
|
|
201
203
|
query: Record<string, string>;
|
|
@@ -214,7 +216,7 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
214
216
|
route: string;
|
|
215
217
|
request: Request;
|
|
216
218
|
store: {};
|
|
217
|
-
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends
|
|
219
|
+
status: <const Code extends number | keyof import("elysia").StatusMap, const T = Code extends 200 | 400 | 301 | 302 | 303 | 307 | 308 | 100 | 101 | 102 | 103 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 304 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
218
220
|
readonly 100: "Continue";
|
|
219
221
|
readonly 101: "Switching Protocols";
|
|
220
222
|
readonly 102: "Processing";
|
|
@@ -346,7 +348,36 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
346
348
|
response: {};
|
|
347
349
|
}, {
|
|
348
350
|
v1: {
|
|
349
|
-
library: {
|
|
351
|
+
library: {
|
|
352
|
+
v1: {
|
|
353
|
+
auth: {
|
|
354
|
+
"validate-reset-token": {
|
|
355
|
+
get: {
|
|
356
|
+
body: unknown;
|
|
357
|
+
params: {};
|
|
358
|
+
query: {
|
|
359
|
+
token: string;
|
|
360
|
+
};
|
|
361
|
+
headers: unknown;
|
|
362
|
+
response: {
|
|
363
|
+
200: {
|
|
364
|
+
valid: boolean;
|
|
365
|
+
};
|
|
366
|
+
422: {
|
|
367
|
+
type: "validation";
|
|
368
|
+
on: string;
|
|
369
|
+
summary?: string;
|
|
370
|
+
message?: string;
|
|
371
|
+
found?: unknown;
|
|
372
|
+
property?: string;
|
|
373
|
+
expected?: string;
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
};
|
|
350
381
|
};
|
|
351
382
|
} & {
|
|
352
383
|
v1: {
|
|
@@ -362,6 +393,25 @@ export declare const libraryModule: Elysia<"/v1/library", {
|
|
|
362
393
|
};
|
|
363
394
|
};
|
|
364
395
|
};
|
|
396
|
+
} & {
|
|
397
|
+
v1: {
|
|
398
|
+
library: {
|
|
399
|
+
summary: {
|
|
400
|
+
get: {
|
|
401
|
+
body: {};
|
|
402
|
+
params: {};
|
|
403
|
+
query: {};
|
|
404
|
+
headers: {};
|
|
405
|
+
response: {
|
|
406
|
+
200: {
|
|
407
|
+
deckId: string;
|
|
408
|
+
inLibrary: boolean;
|
|
409
|
+
}[];
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
};
|
|
365
415
|
} & {
|
|
366
416
|
v1: {
|
|
367
417
|
library: {
|
|
@@ -2,6 +2,10 @@ import type { IArchivedLibraryItem, IGroupedLibraryData } from '@vestcards/share
|
|
|
2
2
|
export declare abstract class LibraryService {
|
|
3
3
|
static getGroupedLibraryData(userId: string): Promise<IGroupedLibraryData>;
|
|
4
4
|
static getArchivedLibraryData(userId: string): Promise<IArchivedLibraryItem[]>;
|
|
5
|
+
static getLibrarySummary(userId: string): Promise<{
|
|
6
|
+
deckId: string;
|
|
7
|
+
inLibrary: boolean;
|
|
8
|
+
}[]>;
|
|
5
9
|
static startDeckStudy(userId: string, deckId: string): Promise<void>;
|
|
6
10
|
static deleteDeckStudy(userId: string, deckId: string): Promise<void>;
|
|
7
11
|
static updateDeckStudySuspended(userId: string, deckId: string, suspended: boolean): Promise<void>;
|