@vestcards/server-types 1.0.1 → 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.
Files changed (60) hide show
  1. package/dist/apps/server/src/app.d.ts +403 -22
  2. package/dist/apps/server/src/config/env.d.ts +3 -2
  3. package/dist/apps/server/src/modules/auth/index.d.ts +35 -4
  4. package/dist/apps/server/src/modules/auth/lib.d.ts +18 -7
  5. package/dist/apps/server/src/modules/auth/permissions/completed-profile.d.ts +1 -0
  6. package/dist/apps/server/src/modules/auth/permissions/entitlements.d.ts +1 -1
  7. package/dist/apps/server/src/modules/auth/permissions/permissions.d.ts +2 -65
  8. package/dist/apps/server/src/modules/card/index.d.ts +71 -5
  9. package/dist/apps/server/src/modules/card/model.d.ts +4 -0
  10. package/dist/apps/server/src/modules/card/service.d.ts +2 -0
  11. package/dist/apps/server/src/modules/deck/index.d.ts +42 -9
  12. package/dist/apps/server/src/modules/deck/model.d.ts +9 -4
  13. package/dist/apps/server/src/modules/deck/service.d.ts +4 -3
  14. package/dist/apps/server/src/modules/library/index.d.ts +55 -5
  15. package/dist/apps/server/src/modules/library/service.d.ts +4 -0
  16. package/dist/apps/server/src/modules/study/index.d.ts +87 -8
  17. package/dist/apps/server/src/modules/study/lib/fsrs.d.ts +1 -1
  18. package/dist/apps/server/src/modules/study/model.d.ts +7 -1
  19. package/dist/apps/server/src/modules/study/service.d.ts +22 -1
  20. package/dist/apps/server/src/modules/topic/index.d.ts +38 -7
  21. package/dist/apps/server/src/modules/user/index.d.ts +108 -5
  22. package/dist/apps/server/src/modules/user/model.d.ts +8 -0
  23. package/dist/apps/server/src/modules/user/service.d.ts +15 -0
  24. package/dist/apps/server/src/tests/helpers/auth-helpers.d.ts +1 -1
  25. package/dist/apps/server/src/tests/helpers/fixtures.d.ts +44 -2
  26. package/dist/apps/server/src/utils/select.d.ts +1 -1
  27. package/dist/packages/db-core/src/db.d.ts +4 -0
  28. package/dist/packages/db-core/src/index.d.ts +4 -0
  29. package/dist/{apps/server/src/db → packages/db-core/src}/schema/auth.d.ts +26 -9
  30. package/dist/packages/db-core/src/schema/blog.d.ts +219 -0
  31. package/dist/{apps/server/src/db → packages/db-core/src}/schema/entity.d.ts +2 -2
  32. package/dist/{apps/server/src/db → packages/db-core/src}/schema/index.d.ts +3 -0
  33. package/dist/packages/db-core/src/schema/organization.d.ts +158 -0
  34. package/dist/{apps/server/src/db → packages/db-core/src}/schema/payment.d.ts +18 -1
  35. package/dist/packages/db-core/src/schema/studyPlan.d.ts +511 -0
  36. package/dist/{apps/server/src/db → packages/db-core/src}/utils.d.ts +1 -0
  37. package/dist/packages/db-core/src/views/deck.d.ts +79 -0
  38. package/dist/packages/shared/src/date/format.d.ts +1 -0
  39. package/dist/packages/shared/src/eden.d.ts +43 -0
  40. package/dist/packages/shared/src/index.d.ts +1 -0
  41. package/dist/packages/shared/src/theme/data-colors.d.ts +2 -0
  42. package/dist/packages/shared/src/theme/index.d.ts +3 -0
  43. package/dist/packages/shared/src/theme/tokens/border.d.ts +11 -0
  44. package/dist/packages/shared/src/theme/tokens/colors.d.ts +356 -0
  45. package/dist/packages/shared/src/theme/utils.d.ts +7 -0
  46. package/dist/packages/shared/src/types/blog.d.ts +8 -0
  47. package/dist/packages/shared/src/types/deck.d.ts +2 -1
  48. package/dist/packages/shared/src/types/fsrs.d.ts +9 -8
  49. package/dist/packages/shared/src/types/index.d.ts +3 -0
  50. package/dist/packages/shared/src/types/permissions.d.ts +108 -0
  51. package/dist/packages/shared/src/types/studyPlan.d.ts +5 -0
  52. package/dist/packages/shared/src/types/subject.d.ts +19 -2
  53. package/package.json +1 -1
  54. package/dist/apps/server/src/db/index.d.ts +0 -6
  55. package/dist/apps/server/src/db/migrate.d.ts +0 -1
  56. package/dist/apps/server/src/db/types.d.ts +0 -2
  57. package/dist/apps/server/src/utils/uuid.d.ts +0 -1
  58. /package/dist/{apps/server/src/db → packages/db-core/src}/schema/data.d.ts +0 -0
  59. /package/dist/{apps/server/src/db → packages/db-core/src}/schema/deck.d.ts +0 -0
  60. /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: true;
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: "error" | "warn" | "info" | "debug", message: string, ...args: any[]): void;
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: typeof 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 '../../../db/types';
1
+ import { Entitlement } from '@vestcards/shared';
2
2
  export declare function getUserEntitlements(userId: string): Promise<Entitlement[]>;
@@ -1,65 +1,2 @@
1
- import { Entitlement, UserRole } from '@vestcards-server/db';
2
- declare const PERMISSIONS: {
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 UPDATE_OWN: "deck:update:own";
10
- readonly UPDATE_PUBLIC: "deck:update:public";
11
- readonly DELETE_OWN: "deck:delete:own";
12
- readonly DELETE_PUBLIC: "deck:delete:public";
13
- };
14
- readonly CARD_DEMAND: {
15
- readonly READ: "card-demand:read";
16
- readonly CREATE: "card-demand:create";
17
- readonly ACTION: "card-demand:action";
18
- };
19
- readonly USER: {
20
- readonly UPDATE_OWN: "user:update:own";
21
- readonly UPDATE_ALL: "user:update:*";
22
- readonly DELETE_OWN: "user:delete:own";
23
- readonly DELETE_ALL: "user:delete:*";
24
- readonly READ_OWN: "user:read:own";
25
- readonly READ_ALL: "user:read:*";
26
- };
27
- readonly STATS: {
28
- readonly VIEW: "stats:view";
29
- };
30
- readonly MEMBERSHIP: {
31
- readonly MANAGE: "membership:manage";
32
- };
33
- readonly PLAN: {
34
- readonly CREATE: "plan:create";
35
- readonly UPDATE: "plan:update";
36
- readonly DELETE: "plan:delete";
37
- };
38
- readonly BLOGPOST: {
39
- readonly CREATE: "blogpost:create";
40
- readonly UPDATE: "blogpost:update";
41
- readonly DELETE: "blogpost:delete";
42
- };
43
- readonly VESTY: {
44
- readonly CHAT: "vesty:chat";
45
- };
46
- readonly STUDY: {
47
- readonly READ: "study:read";
48
- readonly WRITE: "study:write";
49
- };
50
- readonly LIBRARY: {
51
- readonly READ: "library:read";
52
- readonly WRITE: "library:write";
53
- readonly WRITE_PREMIUM: "library:write:premium";
54
- };
55
- };
56
- declare const ALL_PERMISSIONS: ("deck:create:own" | "deck:create:public" | "deck:read:own" | "deck:read:free" | "deck:read:premium" | "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")[];
57
- declare const ROLE_PERMISSIONS: Record<UserRole, Permission[]>;
58
- declare const ENTITLEMENT_PERMISSIONS: Record<Entitlement, Permission[]>;
59
- type ValueOf<T> = T[keyof T];
60
- type Permission = ValueOf<{
61
- [K in keyof typeof PERMISSIONS]: ValueOf<(typeof PERMISSIONS)[K]>;
62
- }>;
63
- declare const hasPermission: (required: Permission, userRole: UserRole, userEntitlements?: Entitlement[]) => boolean;
64
- export { ALL_PERMISSIONS, ENTITLEMENT_PERMISSIONS, hasPermission, PERMISSIONS, ROLE_PERMISSIONS };
65
- 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("../auth/permissions/permissions").Permission | undefined;
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 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 ? {
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("../auth/permissions/permissions").Permission) => {
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 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 ? {
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("../auth/permissions/permissions").Permission | undefined;
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 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 ? {
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("../auth/permissions/permissions").Permission) => {
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 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 ? {
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,25 +348,56 @@ 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: unknown;
386
+ body: {};
356
387
  params: {};
357
388
  query: {
358
389
  sort?: string | undefined;
359
390
  free?: boolean | undefined;
391
+ ownerId?: string | undefined;
360
392
  order?: "asc" | "desc" | undefined;
361
393
  q?: string | undefined;
362
- topicIds?: string | undefined;
363
- subjects?: string | undefined;
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;
364
397
  size: number;
365
398
  page: number;
366
399
  };
367
- headers: unknown;
400
+ headers: {};
368
401
  response: {
369
402
  200: {
370
403
  data: import("@vestcards/shared").IDeck[];
@@ -1,6 +1,7 @@
1
- import type { Subject } from '@vestcards/shared';
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
+ const deckFilter: (ownerId?: string) => import("drizzle-orm").SQL<unknown> | undefined;
4
5
  const listQuery: import("@sinclair/typebox").TObject<{
5
6
  size: import("@sinclair/typebox").TNumber;
6
7
  page: import("@sinclair/typebox").TNumber;
@@ -8,8 +9,10 @@ export declare namespace DeckModel {
8
9
  order: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"asc">, import("@sinclair/typebox").TLiteral<"desc">]>>;
9
10
  q: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
10
11
  free: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
11
- topicIds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
- subjects: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
+ ownerId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
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">>>>;
13
16
  }>;
14
17
  type ListQuery = typeof listQuery.static;
15
18
  const deckIdParams: import("@sinclair/typebox").TObject<{
@@ -25,8 +28,10 @@ export declare namespace DeckModel {
25
28
  }>;
26
29
  type TopicIdParams = typeof topicIdParams.static;
27
30
  interface DeckListFilters extends Pagination, Sort, Search {
31
+ ids?: string[];
32
+ topicIds?: string[];
28
33
  subjects?: Subject[];
29
34
  free?: boolean;
30
- ownerEntityId?: string;
35
+ ownerId?: string;
31
36
  }
32
37
  }
@@ -1,7 +1,8 @@
1
- import { type IDeck, type IDeckDetail } from '@vestcards/shared';
1
+ import type { IDeck, IDeckDetail, IOwnerInfo } from '@vestcards/shared';
2
2
  import { type Paginated } from '../../utils/api';
3
- import type { DeckModel } from './model';
3
+ import { DeckModel } from './model';
4
4
  export declare abstract class DeckService {
5
- static getAllDecks(filters: DeckModel.DeckListFilters): Promise<Paginated<IDeck>>;
5
+ static getAllDecks(filters: DeckModel.DeckListFilters, loggedUserId?: string): Promise<Paginated<IDeck>>;
6
6
  static getDeck(deckId: string): Promise<IDeckDetail>;
7
+ static getOwnerInfoById(ownerId: string): Promise<IOwnerInfo>;
7
8
  }
@@ -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("../auth/permissions/permissions").Permission | undefined;
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 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 ? {
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("../auth/permissions/permissions").Permission) => {
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 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 ? {
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>;