aboutsummaryrefslogtreecommitdiffstats
path: root/packages/trpc
diff options
context:
space:
mode:
authorAhmad Mujahid <55625580+AhmadMuj@users.noreply.github.com>2024-04-11 15:29:51 +0400
committerGitHub <noreply@github.com>2024-04-11 14:29:51 +0300
commitbe622e5594ecb21c82bb6066a82c86e0917bcc35 (patch)
treee77973630b30bb5d51abc2ade6993c523a8413b9 /packages/trpc
parent2806701318dff77b10a5574d4b26ef6032f6b9bc (diff)
downloadkarakeep-be622e5594ecb21c82bb6066a82c86e0917bcc35.tar.zst
feature: Add PDF support (#88)
* feature: Add PDF support * fix: PDF feature enhancements * fix: Freeze expo-share-intent version to prevent breaking changes * fix: set endOfLine to auto for cross-platform development * fix: Upgrading eslint/parser and eslint-plugin to 7.6.0 to solve the linting issues * fix: enhancing PDF feature * fix: Allowing null in fiename for backward compatibility * fix: update pnpm file with pnpm 9.0.0-alpha-8 * fix:(web): PDF Preview for web
Diffstat (limited to 'packages/trpc')
-rw-r--r--packages/trpc/routers/bookmarks.ts3
-rw-r--r--packages/trpc/types/bookmarks.ts3
-rw-r--r--packages/trpc/types/uploads.ts1
3 files changed, 6 insertions, 1 deletions
diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts
index c042d3a1..66766205 100644
--- a/packages/trpc/routers/bookmarks.ts
+++ b/packages/trpc/routers/bookmarks.ts
@@ -173,6 +173,9 @@ export const bookmarksAppRouter = router({
id: bookmark.id,
assetType: input.assetType,
assetId: input.assetId,
+ content: null,
+ metadata: null,
+ fileName: input.fileName ?? null,
})
.returning();
content = {
diff --git a/packages/trpc/types/bookmarks.ts b/packages/trpc/types/bookmarks.ts
index b6c8691f..089007d2 100644
--- a/packages/trpc/types/bookmarks.ts
+++ b/packages/trpc/types/bookmarks.ts
@@ -22,8 +22,9 @@ export type ZBookmarkedText = z.infer<typeof zBookmarkedTextSchema>;
export const zBookmarkedAssetSchema = z.object({
type: z.literal("asset"),
- assetType: z.enum(["image"]),
+ assetType: z.enum(["image", "pdf"]),
assetId: z.string(),
+ fileName: z.string().nullish(),
});
export type ZBookmarkedAsset = z.infer<typeof zBookmarkedAssetSchema>;
diff --git a/packages/trpc/types/uploads.ts b/packages/trpc/types/uploads.ts
index a378f802..b53b86d5 100644
--- a/packages/trpc/types/uploads.ts
+++ b/packages/trpc/types/uploads.ts
@@ -8,6 +8,7 @@ export const zUploadResponseSchema = z.object({
assetId: z.string(),
contentType: z.string(),
size: z.number(),
+ fileName: z.string(),
});
export type ZUploadResponse = z.infer<typeof zUploadResponseSchema>;