diff options
| author | MohamedBassem <me@mbassem.com> | 2025-04-12 19:37:18 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2025-04-12 19:37:40 +0100 |
| commit | 755fc36e912964863d4f46bb32adda6332b419fe (patch) | |
| tree | 3c54e9e6ed7686a119804716ccb6fdd6ad0da3c3 /packages/trpc | |
| parent | 7f569042f153a55189fb28e6ef6ab127b8190afd (diff) | |
| download | karakeep-755fc36e912964863d4f46bb32adda6332b419fe.tar.zst | |
chore: Rename hoarder packages to karakeep
Diffstat (limited to 'packages/trpc')
| -rw-r--r-- | packages/trpc/auth.ts | 8 | ||||
| -rw-r--r-- | packages/trpc/index.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/lib/__tests__/search.test.ts | 8 | ||||
| -rw-r--r-- | packages/trpc/lib/attachments.ts | 7 | ||||
| -rw-r--r-- | packages/trpc/lib/search.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/models/lists.ts | 8 | ||||
| -rw-r--r-- | packages/trpc/package.json | 16 | ||||
| -rw-r--r-- | packages/trpc/routers/admin.ts | 8 | ||||
| -rw-r--r-- | packages/trpc/routers/apiKeys.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/routers/assets.test.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/routers/assets.ts | 6 | ||||
| -rw-r--r-- | packages/trpc/routers/bookmarks.test.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/routers/bookmarks.ts | 24 | ||||
| -rw-r--r-- | packages/trpc/routers/feeds.ts | 6 | ||||
| -rw-r--r-- | packages/trpc/routers/highlights.ts | 6 | ||||
| -rw-r--r-- | packages/trpc/routers/lists.ts | 2 | ||||
| -rw-r--r-- | packages/trpc/routers/prompts.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/routers/tags.ts | 10 | ||||
| -rw-r--r-- | packages/trpc/routers/users.ts | 10 | ||||
| -rw-r--r-- | packages/trpc/routers/webhooks.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/testUtils.ts | 4 | ||||
| -rw-r--r-- | packages/trpc/tsconfig.json | 2 |
22 files changed, 78 insertions, 75 deletions
diff --git a/packages/trpc/auth.ts b/packages/trpc/auth.ts index 1efbdde6..f5ce88e5 100644 --- a/packages/trpc/auth.ts +++ b/packages/trpc/auth.ts @@ -1,10 +1,10 @@ import { randomBytes } from "crypto"; import * as bcrypt from "bcryptjs"; -import { db } from "@hoarder/db"; -import { apiKeys } from "@hoarder/db/schema"; -import serverConfig from "@hoarder/shared/config"; -import { authFailureLogger } from "@hoarder/shared/logger"; +import { db } from "@karakeep/db"; +import { apiKeys } from "@karakeep/db/schema"; +import serverConfig from "@karakeep/shared/config"; +import { authFailureLogger } from "@karakeep/shared/logger"; // API Keys diff --git a/packages/trpc/index.ts b/packages/trpc/index.ts index 26d8ea96..e34e56eb 100644 --- a/packages/trpc/index.ts +++ b/packages/trpc/index.ts @@ -2,8 +2,8 @@ import { initTRPC, TRPCError } from "@trpc/server"; import superjson from "superjson"; import { ZodError } from "zod"; -import type { db } from "@hoarder/db"; -import serverConfig from "@hoarder/shared/config"; +import type { db } from "@karakeep/db"; +import serverConfig from "@karakeep/shared/config"; interface User { id: string; diff --git a/packages/trpc/lib/__tests__/search.test.ts b/packages/trpc/lib/__tests__/search.test.ts index 9f8aac88..9d9b39d7 100644 --- a/packages/trpc/lib/__tests__/search.test.ts +++ b/packages/trpc/lib/__tests__/search.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it } from "vitest"; -import { getInMemoryDB } from "@hoarder/db/drizzle"; +import { getInMemoryDB } from "@karakeep/db/drizzle"; import { bookmarkAssets, bookmarkLinks, @@ -13,9 +13,9 @@ import { rssFeedsTable, tagsOnBookmarks, users, -} from "@hoarder/db/schema"; -import { BookmarkTypes } from "@hoarder/shared/types/bookmarks"; -import { Matcher } from "@hoarder/shared/types/search"; +} from "@karakeep/db/schema"; +import { BookmarkTypes } from "@karakeep/shared/types/bookmarks"; +import { Matcher } from "@karakeep/shared/types/search"; import { AuthedContext } from "../.."; import { getBookmarkIdsFromMatcher } from "../search"; diff --git a/packages/trpc/lib/attachments.ts b/packages/trpc/lib/attachments.ts index 29c99172..15cbba74 100644 --- a/packages/trpc/lib/attachments.ts +++ b/packages/trpc/lib/attachments.ts @@ -1,7 +1,10 @@ import { z } from "zod"; -import { AssetTypes } from "@hoarder/db/schema"; -import { ZAssetType, zAssetTypesSchema } from "@hoarder/shared/types/bookmarks"; +import { AssetTypes } from "@karakeep/db/schema"; +import { + ZAssetType, + zAssetTypesSchema, +} from "@karakeep/shared/types/bookmarks"; export function mapDBAssetTypeToUserType(assetType: AssetTypes): ZAssetType { const map: Record<AssetTypes, z.infer<typeof zAssetTypesSchema>> = { diff --git a/packages/trpc/lib/search.ts b/packages/trpc/lib/search.ts index 83dfa674..ec582ef9 100644 --- a/packages/trpc/lib/search.ts +++ b/packages/trpc/lib/search.ts @@ -23,8 +23,8 @@ import { rssFeedImportsTable, rssFeedsTable, tagsOnBookmarks, -} from "@hoarder/db/schema"; -import { Matcher } from "@hoarder/shared/types/search"; +} from "@karakeep/db/schema"; +import { Matcher } from "@karakeep/shared/types/search"; import { AuthedContext } from ".."; diff --git a/packages/trpc/models/lists.ts b/packages/trpc/models/lists.ts index 7870bf90..5c87a8bd 100644 --- a/packages/trpc/models/lists.ts +++ b/packages/trpc/models/lists.ts @@ -3,14 +3,14 @@ import { and, count, eq } from "drizzle-orm"; import invariant from "tiny-invariant"; import { z } from "zod"; -import { SqliteError } from "@hoarder/db"; -import { bookmarkLists, bookmarksInLists } from "@hoarder/db/schema"; -import { parseSearchQuery } from "@hoarder/shared/searchQueryParser"; +import { SqliteError } from "@karakeep/db"; +import { bookmarkLists, bookmarksInLists } from "@karakeep/db/schema"; +import { parseSearchQuery } from "@karakeep/shared/searchQueryParser"; import { ZBookmarkList, zEditBookmarkListSchemaWithValidation, zNewBookmarkListSchema, -} from "@hoarder/shared/types/lists"; +} from "@karakeep/shared/types/lists"; import { AuthedContext } from ".."; import { getBookmarkIdsFromMatcher } from "../lib/search"; diff --git a/packages/trpc/package.json b/packages/trpc/package.json index 28826e7c..8cb74f0b 100644 --- a/packages/trpc/package.json +++ b/packages/trpc/package.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/package.json", - "name": "@hoarder/trpc", + "name": "@karakeep/trpc", "version": "0.1.0", "private": true, "type": "module", @@ -13,8 +13,8 @@ "test": "vitest" }, "dependencies": { - "@hoarder/db": "workspace:*", - "@hoarder/shared": "workspace:*", + "@karakeep/db": "workspace:*", + "@karakeep/shared": "workspace:*", "@trpc/server": "11.0.0", "bcryptjs": "^2.4.3", "drizzle-orm": "^0.38.3", @@ -23,9 +23,9 @@ "zod": "^3.22.4" }, "devDependencies": { - "@hoarder/eslint-config": "workspace:^0.2.0", - "@hoarder/prettier-config": "workspace:^0.1.0", - "@hoarder/tsconfig": "workspace:^0.1.0", + "@karakeep/eslint-config": "workspace:^0.2.0", + "@karakeep/prettier-config": "workspace:^0.1.0", + "@karakeep/tsconfig": "workspace:^0.1.0", "@types/bcryptjs": "^2.4.6", "vite-tsconfig-paths": "^4.3.1", "vitest": "^1.6.1" @@ -33,8 +33,8 @@ "eslintConfig": { "root": true, "extends": [ - "@hoarder/eslint-config/base" + "@karakeep/eslint-config/base" ] }, - "prettier": "@hoarder/prettier-config" + "prettier": "@karakeep/prettier-config" } diff --git a/packages/trpc/routers/admin.ts b/packages/trpc/routers/admin.ts index 337f050c..9b44f7c9 100644 --- a/packages/trpc/routers/admin.ts +++ b/packages/trpc/routers/admin.ts @@ -2,8 +2,8 @@ import { TRPCError } from "@trpc/server"; import { count, eq, sum } from "drizzle-orm"; import { z } from "zod"; -import { assets, bookmarkLinks, bookmarks, users } from "@hoarder/db/schema"; -import serverConfig from "@hoarder/shared/config"; +import { assets, bookmarkLinks, bookmarks, users } from "@karakeep/db/schema"; +import serverConfig from "@karakeep/shared/config"; import { AssetPreprocessingQueue, FeedQueue, @@ -15,12 +15,12 @@ import { triggerSearchReindex, VideoWorkerQueue, WebhookQueue, -} from "@hoarder/shared/queues"; +} from "@karakeep/shared/queues"; import { changeRoleSchema, resetPasswordSchema, zAdminCreateUserSchema, -} from "@hoarder/shared/types/admin"; +} from "@karakeep/shared/types/admin"; import { hashPassword } from "../auth"; import { adminProcedure, router } from "../index"; diff --git a/packages/trpc/routers/apiKeys.ts b/packages/trpc/routers/apiKeys.ts index c55dc095..eb52189b 100644 --- a/packages/trpc/routers/apiKeys.ts +++ b/packages/trpc/routers/apiKeys.ts @@ -2,8 +2,8 @@ import { TRPCError } from "@trpc/server"; import { and, eq } from "drizzle-orm"; import { z } from "zod"; -import { apiKeys } from "@hoarder/db/schema"; -import serverConfig from "@hoarder/shared/config"; +import { apiKeys } from "@karakeep/db/schema"; +import serverConfig from "@karakeep/shared/config"; import { authenticateApiKey, diff --git a/packages/trpc/routers/assets.test.ts b/packages/trpc/routers/assets.test.ts index d7db35be..822e48b1 100644 --- a/packages/trpc/routers/assets.test.ts +++ b/packages/trpc/routers/assets.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, test } from "vitest"; -import { assets, AssetTypes } from "@hoarder/db/schema"; -import { BookmarkTypes, ZAssetType } from "@hoarder/shared/types/bookmarks"; +import { assets, AssetTypes } from "@karakeep/db/schema"; +import { BookmarkTypes, ZAssetType } from "@karakeep/shared/types/bookmarks"; import type { CustomTestContext } from "../testUtils"; import { defaultBeforeEach } from "../testUtils"; diff --git a/packages/trpc/routers/assets.ts b/packages/trpc/routers/assets.ts index 45eac068..af508a4e 100644 --- a/packages/trpc/routers/assets.ts +++ b/packages/trpc/routers/assets.ts @@ -2,12 +2,12 @@ import { TRPCError } from "@trpc/server"; import { and, desc, eq, sql } from "drizzle-orm"; import { z } from "zod"; -import { assets, bookmarks } from "@hoarder/db/schema"; -import { deleteAsset } from "@hoarder/shared/assetdb"; +import { assets, bookmarks } from "@karakeep/db/schema"; +import { deleteAsset } from "@karakeep/shared/assetdb"; import { zAssetSchema, zAssetTypesSchema, -} from "@hoarder/shared/types/bookmarks"; +} from "@karakeep/shared/types/bookmarks"; import { authedProcedure, Context, router } from "../index"; import { diff --git a/packages/trpc/routers/bookmarks.test.ts b/packages/trpc/routers/bookmarks.test.ts index c3469acc..f83ec5aa 100644 --- a/packages/trpc/routers/bookmarks.test.ts +++ b/packages/trpc/routers/bookmarks.test.ts @@ -1,7 +1,7 @@ import { assert, beforeEach, describe, expect, test } from "vitest"; -import { bookmarks } from "@hoarder/db/schema"; -import { BookmarkTypes } from "@hoarder/shared/types/bookmarks"; +import { bookmarks } from "@karakeep/db/schema"; +import { BookmarkTypes } from "@karakeep/shared/types/bookmarks"; import type { CustomTestContext } from "../testUtils"; import { defaultBeforeEach } from "../testUtils"; diff --git a/packages/trpc/routers/bookmarks.ts b/packages/trpc/routers/bookmarks.ts index 5e6df4a5..fdb99257 100644 --- a/packages/trpc/routers/bookmarks.ts +++ b/packages/trpc/routers/bookmarks.ts @@ -18,9 +18,9 @@ import { z } from "zod"; import type { ZBookmark, ZBookmarkContent, -} from "@hoarder/shared/types/bookmarks"; -import type { ZBookmarkTags } from "@hoarder/shared/types/tags"; -import { db as DONT_USE_db } from "@hoarder/db"; +} from "@karakeep/shared/types/bookmarks"; +import type { ZBookmarkTags } from "@karakeep/shared/types/tags"; +import { db as DONT_USE_db } from "@karakeep/db"; import { assets, AssetTypes, @@ -33,14 +33,14 @@ import { customPrompts, rssFeedImportsTable, tagsOnBookmarks, -} from "@hoarder/db/schema"; +} from "@karakeep/db/schema"; import { deleteAsset, SUPPORTED_BOOKMARK_ASSET_TYPES, -} from "@hoarder/shared/assetdb"; -import serverConfig from "@hoarder/shared/config"; -import { InferenceClientFactory } from "@hoarder/shared/inference"; -import { buildSummaryPrompt } from "@hoarder/shared/prompts"; +} from "@karakeep/shared/assetdb"; +import serverConfig from "@karakeep/shared/config"; +import { InferenceClientFactory } from "@karakeep/shared/inference"; +import { buildSummaryPrompt } from "@karakeep/shared/prompts"; import { AssetPreprocessingQueue, LinkCrawlerQueue, @@ -48,9 +48,9 @@ import { triggerSearchDeletion, triggerSearchReindex, triggerWebhook, -} from "@hoarder/shared/queues"; -import { getSearchIdxClient } from "@hoarder/shared/search"; -import { parseSearchQuery } from "@hoarder/shared/searchQueryParser"; +} from "@karakeep/shared/queues"; +import { getSearchIdxClient } from "@karakeep/shared/search"; +import { parseSearchQuery } from "@karakeep/shared/searchQueryParser"; import { BookmarkTypes, DEFAULT_NUM_BOOKMARKS_PER_PAGE, @@ -62,7 +62,7 @@ import { zSearchBookmarksCursor, zSearchBookmarksRequestSchema, zUpdateBookmarksRequestSchema, -} from "@hoarder/shared/types/bookmarks"; +} from "@karakeep/shared/types/bookmarks"; import type { AuthedContext, Context } from "../index"; import { authedProcedure, router } from "../index"; diff --git a/packages/trpc/routers/feeds.ts b/packages/trpc/routers/feeds.ts index e5520474..819ba8ef 100644 --- a/packages/trpc/routers/feeds.ts +++ b/packages/trpc/routers/feeds.ts @@ -2,13 +2,13 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server"; import { and, eq } from "drizzle-orm"; import { z } from "zod"; -import { rssFeedsTable } from "@hoarder/db/schema"; -import { FeedQueue } from "@hoarder/shared/queues"; +import { rssFeedsTable } from "@karakeep/db/schema"; +import { FeedQueue } from "@karakeep/shared/queues"; import { zFeedSchema, zNewFeedSchema, zUpdateFeedSchema, -} from "@hoarder/shared/types/feeds"; +} from "@karakeep/shared/types/feeds"; import { authedProcedure, Context, router } from "../index"; diff --git a/packages/trpc/routers/highlights.ts b/packages/trpc/routers/highlights.ts index 86da560b..3436653e 100644 --- a/packages/trpc/routers/highlights.ts +++ b/packages/trpc/routers/highlights.ts @@ -2,15 +2,15 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server"; import { and, desc, eq, lt, lte, or } from "drizzle-orm"; import { z } from "zod"; -import { highlights } from "@hoarder/db/schema"; +import { highlights } from "@karakeep/db/schema"; import { DEFAULT_NUM_HIGHLIGHTS_PER_PAGE, zGetAllHighlightsResponseSchema, zHighlightSchema, zNewHighlightSchema, zUpdateHighlightSchema, -} from "@hoarder/shared/types/highlights"; -import { zCursorV2 } from "@hoarder/shared/types/pagination"; +} from "@karakeep/shared/types/highlights"; +import { zCursorV2 } from "@karakeep/shared/types/pagination"; import { authedProcedure, Context, router } from "../index"; import { ensureBookmarkOwnership } from "./bookmarks"; diff --git a/packages/trpc/routers/lists.ts b/packages/trpc/routers/lists.ts index f9e382f2..f988eb8b 100644 --- a/packages/trpc/routers/lists.ts +++ b/packages/trpc/routers/lists.ts @@ -5,7 +5,7 @@ import { zBookmarkListSchema, zEditBookmarkListSchemaWithValidation, zNewBookmarkListSchema, -} from "@hoarder/shared/types/lists"; +} from "@karakeep/shared/types/lists"; import type { AuthedContext } from "../index"; import { authedProcedure, router } from "../index"; diff --git a/packages/trpc/routers/prompts.ts b/packages/trpc/routers/prompts.ts index 629d5829..d3942e69 100644 --- a/packages/trpc/routers/prompts.ts +++ b/packages/trpc/routers/prompts.ts @@ -2,12 +2,12 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server"; import { and, eq } from "drizzle-orm"; import { z } from "zod"; -import { customPrompts } from "@hoarder/db/schema"; +import { customPrompts } from "@karakeep/db/schema"; import { zNewPromptSchema, zPromptSchema, zUpdatePromptSchema, -} from "@hoarder/shared/types/prompts"; +} from "@karakeep/shared/types/prompts"; import { authedProcedure, Context, router } from "../index"; diff --git a/packages/trpc/routers/tags.ts b/packages/trpc/routers/tags.ts index c080bad8..7378c66f 100644 --- a/packages/trpc/routers/tags.ts +++ b/packages/trpc/routers/tags.ts @@ -2,14 +2,14 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server"; import { and, eq, inArray, notExists } from "drizzle-orm"; import { z } from "zod"; -import type { ZAttachedByEnum } from "@hoarder/shared/types/tags"; -import { SqliteError } from "@hoarder/db"; -import { bookmarkTags, tagsOnBookmarks } from "@hoarder/db/schema"; -import { triggerSearchReindex } from "@hoarder/shared/queues"; +import type { ZAttachedByEnum } from "@karakeep/shared/types/tags"; +import { SqliteError } from "@karakeep/db"; +import { bookmarkTags, tagsOnBookmarks } from "@karakeep/db/schema"; +import { triggerSearchReindex } from "@karakeep/shared/queues"; import { zGetTagResponseSchema, zUpdateTagRequestSchema, -} from "@hoarder/shared/types/tags"; +} from "@karakeep/shared/types/tags"; import type { Context } from "../index"; import { authedProcedure, router } from "../index"; diff --git a/packages/trpc/routers/users.ts b/packages/trpc/routers/users.ts index a78ec9b4..75a1db0c 100644 --- a/packages/trpc/routers/users.ts +++ b/packages/trpc/routers/users.ts @@ -3,21 +3,21 @@ import { and, count, eq } from "drizzle-orm"; import invariant from "tiny-invariant"; import { z } from "zod"; -import { SqliteError } from "@hoarder/db"; +import { SqliteError } from "@karakeep/db"; import { bookmarkLists, bookmarks, bookmarkTags, highlights, users, -} from "@hoarder/db/schema"; -import { deleteUserAssets } from "@hoarder/shared/assetdb"; -import serverConfig from "@hoarder/shared/config"; +} from "@karakeep/db/schema"; +import { deleteUserAssets } from "@karakeep/shared/assetdb"; +import serverConfig from "@karakeep/shared/config"; import { zSignUpSchema, zUserStatsResponseSchema, zWhoAmIResponseSchema, -} from "@hoarder/shared/types/users"; +} from "@karakeep/shared/types/users"; import { hashPassword, validatePassword } from "../auth"; import { diff --git a/packages/trpc/routers/webhooks.ts b/packages/trpc/routers/webhooks.ts index 173e4f5a..ab2a6908 100644 --- a/packages/trpc/routers/webhooks.ts +++ b/packages/trpc/routers/webhooks.ts @@ -2,12 +2,12 @@ import { experimental_trpcMiddleware, TRPCError } from "@trpc/server"; import { and, eq } from "drizzle-orm"; import { z } from "zod"; -import { webhooksTable } from "@hoarder/db/schema"; +import { webhooksTable } from "@karakeep/db/schema"; import { zNewWebhookSchema, zUpdateWebhookSchema, zWebhookSchema, -} from "@hoarder/shared/types/webhooks"; +} from "@karakeep/shared/types/webhooks"; import { authedProcedure, Context, router } from "../index"; diff --git a/packages/trpc/testUtils.ts b/packages/trpc/testUtils.ts index 23dcdb33..b8b6ac8d 100644 --- a/packages/trpc/testUtils.ts +++ b/packages/trpc/testUtils.ts @@ -1,5 +1,5 @@ -import { getInMemoryDB } from "@hoarder/db/drizzle"; -import { users } from "@hoarder/db/schema"; +import { getInMemoryDB } from "@karakeep/db/drizzle"; +import { users } from "@karakeep/db/schema"; import { createCallerFactory } from "./index"; import { appRouter } from "./routers/_app"; diff --git a/packages/trpc/tsconfig.json b/packages/trpc/tsconfig.json index dbd0afdc..a795b96a 100644 --- a/packages/trpc/tsconfig.json +++ b/packages/trpc/tsconfig.json @@ -1,6 +1,6 @@ { "$schema": "https://json.schemastore.org/tsconfig", - "extends": "@hoarder/tsconfig/node.json", + "extends": "@karakeep/tsconfig/node.json", "include": ["**/*.ts"], "exclude": ["node_modules"], "compilerOptions": { |
