diff options
| author | Mohamed Bassem <me@mbassem.com> | 2024-12-27 19:21:43 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-12-27 19:34:04 +0000 |
| commit | 3f56389f55ef116f8cea17c15c684798fb942290 (patch) | |
| tree | 1a398accbcfc75674c5cc4970bc85fd27c637911 /packages/shared | |
| parent | 86d74e3f32dd5bccc8df195b55391e206df9a1c4 (diff) | |
| download | karakeep-3f56389f55ef116f8cea17c15c684798fb942290.tar.zst | |
feat: Add REST APIs for manipulating highlights. Fixes #620
Diffstat (limited to 'packages/shared')
| -rw-r--r-- | packages/shared/types/bookmarks.ts | 6 | ||||
| -rw-r--r-- | packages/shared/types/highlights.ts | 2 | ||||
| -rw-r--r-- | packages/shared/types/pagination.ts | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/packages/shared/types/bookmarks.ts b/packages/shared/types/bookmarks.ts index 359ff7c4..41f689cd 100644 --- a/packages/shared/types/bookmarks.ts +++ b/packages/shared/types/bookmarks.ts @@ -1,5 +1,6 @@ import { z } from "zod"; +import { zCursorV2 } from "./pagination"; import { zBookmarkTagSchema } from "./tags"; const MAX_TITLE_LENGTH = 250; @@ -147,11 +148,6 @@ export type ZNewBookmarkRequest = z.infer<typeof zNewBookmarkRequestSchema>; export const DEFAULT_NUM_BOOKMARKS_PER_PAGE = 20; export const MAX_NUM_BOOKMARKS_PER_PAGE = 100; -export const zCursorV2 = z.object({ - createdAt: z.date(), - id: z.string(), -}); - export const zGetBookmarksRequestSchema = z.object({ ids: z.array(z.string()).optional(), archived: z.boolean().optional(), diff --git a/packages/shared/types/highlights.ts b/packages/shared/types/highlights.ts index b766c360..9bda6029 100644 --- a/packages/shared/types/highlights.ts +++ b/packages/shared/types/highlights.ts @@ -1,5 +1,7 @@ import { z } from "zod"; +export const DEFAULT_NUM_HIGHLIGHTS_PER_PAGE = 20; + const zHighlightColorSchema = z.enum(["yellow", "red", "green", "blue"]); export type ZHighlightColor = z.infer<typeof zHighlightColorSchema>; export const SUPPORTED_HIGHLIGHT_COLORS = zHighlightColorSchema.options; diff --git a/packages/shared/types/pagination.ts b/packages/shared/types/pagination.ts new file mode 100644 index 00000000..d2312982 --- /dev/null +++ b/packages/shared/types/pagination.ts @@ -0,0 +1,6 @@ +import { z } from "zod"; + +export const zCursorV2 = z.object({ + createdAt: z.date(), + id: z.string(), +}); |
