From c2ded24e1e6d2a23474a6e738937591daeed2b75 Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Sun, 22 Dec 2024 20:50:40 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20move=20pglite?= =?UTF-8?q?=20to=20client=20service=20(#5133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update locale * update locale * refactor the service name --- locales/en-US/common.json | 4 ++-- src/services/file/{pglite.test.ts => client.test.ts} | 2 +- src/services/file/{pglite.ts => client.ts} | 0 src/services/file/index.ts | 2 +- src/services/import/{pglite.test.ts => client.test.ts} | 2 +- src/services/import/{pglite.ts => client.ts} | 0 src/services/import/index.ts | 2 +- src/services/message/{pglite.test.ts => client.test.ts} | 2 +- src/services/message/{pglite.ts => client.ts} | 0 src/services/message/index.ts | 2 +- src/services/plugin/{pglite.test.ts => client.test.ts} | 2 +- src/services/plugin/{pglite.ts => client.ts} | 0 src/services/plugin/index.ts | 2 +- src/services/session/{pglite.test.ts => client.test.ts} | 2 +- src/services/session/{pglite.ts => client.ts} | 0 src/services/session/index.ts | 2 +- src/services/topic/{client.test.ts => _deprecated.test.ts} | 0 src/services/topic/{pglite.ts => client.ts} | 0 src/services/topic/index.ts | 2 +- src/services/topic/pglite.test.ts | 2 +- src/services/user/{pglite.test.ts => client.test.ts} | 2 +- src/services/user/{pglite.ts => client.ts} | 0 src/services/user/index.ts | 2 +- 23 files changed, 16 insertions(+), 16 deletions(-) rename src/services/file/{pglite.test.ts => client.test.ts} (99%) rename src/services/file/{pglite.ts => client.ts} (100%) rename src/services/import/{pglite.test.ts => client.test.ts} (99%) rename src/services/import/{pglite.ts => client.ts} (100%) rename src/services/message/{pglite.test.ts => client.test.ts} (99%) rename src/services/message/{pglite.ts => client.ts} (100%) rename src/services/plugin/{pglite.test.ts => client.test.ts} (99%) rename src/services/plugin/{pglite.ts => client.ts} (100%) rename src/services/session/{pglite.test.ts => client.test.ts} (99%) rename src/services/session/{pglite.ts => client.ts} (100%) rename src/services/topic/{client.test.ts => _deprecated.test.ts} (100%) rename src/services/topic/{pglite.ts => client.ts} (100%) rename src/services/user/{pglite.test.ts => client.test.ts} (98%) rename src/services/user/{pglite.ts => client.ts} (100%) diff --git a/locales/en-US/common.json b/locales/en-US/common.json index bb4b7c432d67..3fd1d357cb0d 100644 --- a/locales/en-US/common.json +++ b/locales/en-US/common.json @@ -59,14 +59,14 @@ "features": { "knowledgeBase": { "desc": "Build your personal knowledge base and easily start conversations with your assistant (coming soon)", - "title": "Support for knowledge base conversations, unlock your second brain" + "title": "Support for knowledge base conversations" }, "localFirst": { "desc": "Chat data is stored entirely in the browser, keeping your data always under your control.", "title": "Local first, privacy first" }, "pglite": { - "desc": "Built on PGlite, natively supports AI Native advanced features (vector retrieval)", + "desc": "Built on PGlite, natively supports AI Native advanced features (vector search)", "title": "Next-generation client storage architecture" } }, diff --git a/src/services/file/pglite.test.ts b/src/services/file/client.test.ts similarity index 99% rename from src/services/file/pglite.test.ts rename to src/services/file/client.test.ts index 5166f6d3138a..32c3c57f3b1c 100644 --- a/src/services/file/pglite.test.ts +++ b/src/services/file/client.test.ts @@ -6,7 +6,7 @@ import { files, globalFiles, users } from '@/database/schemas'; import { clientS3Storage } from '@/services/file/ClientS3'; import { UploadFileParams } from '@/types/files'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; const userId = 'file-user'; diff --git a/src/services/file/pglite.ts b/src/services/file/client.ts similarity index 100% rename from src/services/file/pglite.ts rename to src/services/file/client.ts diff --git a/src/services/file/index.ts b/src/services/file/index.ts index 655d487974b9..53be6a9bc758 100644 --- a/src/services/file/index.ts +++ b/src/services/file/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService = diff --git a/src/services/import/pglite.test.ts b/src/services/import/client.test.ts similarity index 99% rename from src/services/import/pglite.test.ts rename to src/services/import/client.test.ts index 25d526b78a93..1104a3298cd2 100644 --- a/src/services/import/pglite.test.ts +++ b/src/services/import/client.test.ts @@ -15,7 +15,7 @@ import { import { CURRENT_CONFIG_VERSION } from '@/migrations'; import { ImportResults, ImporterEntryData } from '@/types/importer'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; const userId = 'test-user-id'; const service = new ClientService(userId); diff --git a/src/services/import/pglite.ts b/src/services/import/client.ts similarity index 100% rename from src/services/import/pglite.ts rename to src/services/import/client.ts diff --git a/src/services/import/index.ts b/src/services/import/index.ts index 304b60ca3ef9..e1d22eae3896 100644 --- a/src/services/import/index.ts +++ b/src/services/import/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService = diff --git a/src/services/message/pglite.test.ts b/src/services/message/client.test.ts similarity index 99% rename from src/services/message/pglite.test.ts rename to src/services/message/client.test.ts index 23629732859c..2372330aabf2 100644 --- a/src/services/message/pglite.test.ts +++ b/src/services/message/client.test.ts @@ -23,7 +23,7 @@ import { CreateMessageParams, } from '@/types/message'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; const userId = 'message-db'; const sessionId = '1'; diff --git a/src/services/message/pglite.ts b/src/services/message/client.ts similarity index 100% rename from src/services/message/pglite.ts rename to src/services/message/client.ts diff --git a/src/services/message/index.ts b/src/services/message/index.ts index 9a195919be66..2ab36c5bc6e9 100644 --- a/src/services/message/index.ts +++ b/src/services/message/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService = diff --git a/src/services/plugin/pglite.test.ts b/src/services/plugin/client.test.ts similarity index 99% rename from src/services/plugin/pglite.test.ts rename to src/services/plugin/client.test.ts index 018c4eaab4ef..4f4c45df3aca 100644 --- a/src/services/plugin/pglite.test.ts +++ b/src/services/plugin/client.test.ts @@ -7,7 +7,7 @@ import { installedPlugins, users } from '@/database/schemas'; import { LobeTool } from '@/types/tool'; import { LobeToolCustomPlugin } from '@/types/tool/plugin'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { InstallPluginParams } from './type'; // Mocking modules and functions diff --git a/src/services/plugin/pglite.ts b/src/services/plugin/client.ts similarity index 100% rename from src/services/plugin/pglite.ts rename to src/services/plugin/client.ts diff --git a/src/services/plugin/index.ts b/src/services/plugin/index.ts index 4d7751bda346..b3342cdd6fb2 100644 --- a/src/services/plugin/index.ts +++ b/src/services/plugin/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService = diff --git a/src/services/session/pglite.test.ts b/src/services/session/client.test.ts similarity index 99% rename from src/services/session/pglite.test.ts rename to src/services/session/client.test.ts index 832259a13d8a..e4eaa7a75019 100644 --- a/src/services/session/pglite.test.ts +++ b/src/services/session/client.test.ts @@ -15,7 +15,7 @@ import { import { LobeAgentChatConfig, LobeAgentConfig } from '@/types/agent'; import { LobeAgentSession, LobeSessionType, SessionGroups } from '@/types/session'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; const userId = 'message-db'; const sessionService = new ClientService(userId); diff --git a/src/services/session/pglite.ts b/src/services/session/client.ts similarity index 100% rename from src/services/session/pglite.ts rename to src/services/session/client.ts diff --git a/src/services/session/index.ts b/src/services/session/index.ts index ca99054e04cb..ec3c976de85d 100644 --- a/src/services/session/index.ts +++ b/src/services/session/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService = diff --git a/src/services/topic/client.test.ts b/src/services/topic/_deprecated.test.ts similarity index 100% rename from src/services/topic/client.test.ts rename to src/services/topic/_deprecated.test.ts diff --git a/src/services/topic/pglite.ts b/src/services/topic/client.ts similarity index 100% rename from src/services/topic/pglite.ts rename to src/services/topic/client.ts diff --git a/src/services/topic/index.ts b/src/services/topic/index.ts index 891fecbbb011..ddb95abeb197 100644 --- a/src/services/topic/index.ts +++ b/src/services/topic/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService = diff --git a/src/services/topic/pglite.test.ts b/src/services/topic/pglite.test.ts index c900de550443..476dbb36a6f0 100644 --- a/src/services/topic/pglite.test.ts +++ b/src/services/topic/pglite.test.ts @@ -5,7 +5,7 @@ import { clientDB, initializeDB } from '@/database/client/db'; import { sessions, topics, users } from '@/database/schemas'; import { ChatTopic } from '@/types/topic'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; // Mock data const userId = 'topic-user-test'; diff --git a/src/services/user/pglite.test.ts b/src/services/user/client.test.ts similarity index 98% rename from src/services/user/pglite.test.ts rename to src/services/user/client.test.ts index cab8a0741d03..abb57b37baab 100644 --- a/src/services/user/pglite.test.ts +++ b/src/services/user/client.test.ts @@ -7,7 +7,7 @@ import { userSettings, users } from '@/database/schemas'; import { UserPreference } from '@/types/user'; import { UserSettings } from '@/types/user/settings'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; const mockUser = { avatar: 'avatar.png', diff --git a/src/services/user/pglite.ts b/src/services/user/client.ts similarity index 100% rename from src/services/user/pglite.ts rename to src/services/user/client.ts diff --git a/src/services/user/index.ts b/src/services/user/index.ts index a81a931641a3..56225dc562c8 100644 --- a/src/services/user/index.ts +++ b/src/services/user/index.ts @@ -1,5 +1,5 @@ import { ClientService as DeprecatedService } from './_deprecated'; -import { ClientService } from './pglite'; +import { ClientService } from './client'; import { ServerService } from './server'; const clientService =