diff --git a/TODO b/TODO index 7e11633..b41ccde 100644 --- a/TODO +++ b/TODO @@ -1,12 +1,10 @@ - og / json-sd - logger -- bring sections headers on all pages other than home page further up (reduce top margin / padding) - set game current position on game load to ply 0 and whatever the FEN is (starting position probably, but could be custom position) - privacy policy - have no access to anything you generate, only keep a count of success/failed pdf generations with timestamp and error message - a11y and lighthouse fixes - check wcag compliance - 429 lichess error handling -- add throw errors or return errors in server code - try/catch where needed in client code - generate state and check it against the state returned from lichess https://lichess.org/api#tag/oauth/GET/oauth - checkbox and toggle disabled states diff --git a/src/interfaces.ts b/src/interfaces.ts index 642eaca..ed64d38 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -1,3 +1,6 @@ +import type { infer } from "zod"; +import type { TokenResponseSchema } from "#/schemas.ts"; + export interface IPosition { ply: number; fen: string; @@ -29,3 +32,18 @@ export interface IGameState { diagrams: IPosition[]; diagramClock: boolean; } + +export interface ITokenData extends infer {} + +export interface IUserStudy { + id: string; + name: string; + createdAt: number; + updatedAt: number; +} + +export interface IUserStudyChapter { + chapterId: string; + name: string; + pgn: string; +} diff --git a/src/schemas.ts b/src/schemas.ts index 20203a3..8a6ee7b 100644 --- a/src/schemas.ts +++ b/src/schemas.ts @@ -8,9 +8,9 @@ export const SessionSchema = z.object({ export const TokenResponseSchema = z.object({ access_token: z.string(), - expires_in: z.number().optional(), + expires_in: z.number(), scope: z.string().optional(), - token_type: z.string().optional(), + token_type: z.string(), }); export const LichessAccountSchema = z.object({