From e603234800686db71d7cbc46a47b03f540966ffb Mon Sep 17 00:00:00 2001 From: Arvin Xu Date: Sun, 22 Dec 2024 17:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20refactor=20the?= =?UTF-8?q?=20client=20service=20to=20deprecated=20(#5132)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/file/{client.test.ts => _deprecated.test.ts} | 2 +- src/services/file/{client.ts => _deprecated.ts} | 0 src/services/file/index.ts | 2 +- src/services/import/{client.ts => _deprecated.ts} | 0 src/services/import/index.ts | 2 +- src/services/message/{client.test.ts => _deprecated.test.ts} | 2 +- src/services/message/{client.ts => _deprecated.ts} | 0 src/services/message/index.ts | 2 +- src/services/plugin/{client.test.ts => _deprecated.test.ts} | 2 +- src/services/plugin/{client.ts => _deprecated.ts} | 0 src/services/plugin/index.ts | 2 +- src/services/session/{client.test.ts => _deprecated.test.ts} | 2 +- src/services/session/{client.ts => _deprecated.ts} | 0 src/services/session/index.ts | 2 +- src/services/topic/{client.ts => _deprecated.ts} | 0 src/services/topic/client.test.ts | 2 +- src/services/topic/index.ts | 2 +- src/services/user/{client.test.ts => _deprecated.test.ts} | 2 +- src/services/user/{client.ts => _deprecated.ts} | 0 src/services/user/index.ts | 2 +- src/store/chat/slices/builtinTool/action.test.ts | 2 +- src/store/user/slices/common/action.test.ts | 2 +- 22 files changed, 15 insertions(+), 15 deletions(-) rename src/services/file/{client.test.ts => _deprecated.test.ts} (98%) rename src/services/file/{client.ts => _deprecated.ts} (100%) rename src/services/import/{client.ts => _deprecated.ts} (100%) rename src/services/message/{client.test.ts => _deprecated.test.ts} (99%) rename src/services/message/{client.ts => _deprecated.ts} (100%) rename src/services/plugin/{client.test.ts => _deprecated.test.ts} (99%) rename src/services/plugin/{client.ts => _deprecated.ts} (100%) rename src/services/session/{client.test.ts => _deprecated.test.ts} (99%) rename src/services/session/{client.ts => _deprecated.ts} (100%) rename src/services/topic/{client.ts => _deprecated.ts} (100%) rename src/services/user/{client.test.ts => _deprecated.test.ts} (98%) rename src/services/user/{client.ts => _deprecated.ts} (100%) diff --git a/src/services/file/client.test.ts b/src/services/file/_deprecated.test.ts similarity index 98% rename from src/services/file/client.test.ts rename to src/services/file/_deprecated.test.ts index 44850d3f2f13..f1d66134bea1 100644 --- a/src/services/file/client.test.ts +++ b/src/services/file/_deprecated.test.ts @@ -7,7 +7,7 @@ import { clientS3Storage } from '@/services/file/ClientS3'; import { serverConfigSelectors } from '@/store/serverConfig/selectors'; import { createServerConfigStore } from '@/store/serverConfig/store'; -import { ClientService } from './client'; +import { ClientService } from './_deprecated'; const fileService = new ClientService(); diff --git a/src/services/file/client.ts b/src/services/file/_deprecated.ts similarity index 100% rename from src/services/file/client.ts rename to src/services/file/_deprecated.ts diff --git a/src/services/file/index.ts b/src/services/file/index.ts index c148ef7974e1..655d487974b9 100644 --- a/src/services/file/index.ts +++ b/src/services/file/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/services/import/client.ts b/src/services/import/_deprecated.ts similarity index 100% rename from src/services/import/client.ts rename to src/services/import/_deprecated.ts diff --git a/src/services/import/index.ts b/src/services/import/index.ts index 5519bcc434fb..304b60ca3ef9 100644 --- a/src/services/import/index.ts +++ b/src/services/import/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/services/message/client.test.ts b/src/services/message/_deprecated.test.ts similarity index 99% rename from src/services/message/client.test.ts rename to src/services/message/_deprecated.test.ts index 867fda6c5b72..5d1a0018d0c5 100644 --- a/src/services/message/client.test.ts +++ b/src/services/message/_deprecated.test.ts @@ -10,7 +10,7 @@ import { ChatTranslate, } from '@/types/message'; -import { ClientService } from './client'; +import { ClientService } from './_deprecated'; const messageService = new ClientService(); diff --git a/src/services/message/client.ts b/src/services/message/_deprecated.ts similarity index 100% rename from src/services/message/client.ts rename to src/services/message/_deprecated.ts diff --git a/src/services/message/index.ts b/src/services/message/index.ts index 2791b5ab692e..9a195919be66 100644 --- a/src/services/message/index.ts +++ b/src/services/message/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/services/plugin/client.test.ts b/src/services/plugin/_deprecated.test.ts similarity index 99% rename from src/services/plugin/client.test.ts rename to src/services/plugin/_deprecated.test.ts index e2b6ccc66822..ae2d24e1105f 100644 --- a/src/services/plugin/client.test.ts +++ b/src/services/plugin/_deprecated.test.ts @@ -6,7 +6,7 @@ import { DB_Plugin } from '@/database/_deprecated/schemas/plugin'; import { LobeTool } from '@/types/tool'; import { LobeToolCustomPlugin } from '@/types/tool/plugin'; -import { ClientService } from './client'; +import { ClientService } from './_deprecated'; import { InstallPluginParams } from './type'; const pluginService = new ClientService(); diff --git a/src/services/plugin/client.ts b/src/services/plugin/_deprecated.ts similarity index 100% rename from src/services/plugin/client.ts rename to src/services/plugin/_deprecated.ts diff --git a/src/services/plugin/index.ts b/src/services/plugin/index.ts index e06694579939..4d7751bda346 100644 --- a/src/services/plugin/index.ts +++ b/src/services/plugin/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/services/session/client.test.ts b/src/services/session/_deprecated.test.ts similarity index 99% rename from src/services/session/client.test.ts rename to src/services/session/_deprecated.test.ts index 4a7274ce547a..810eeba333e3 100644 --- a/src/services/session/client.test.ts +++ b/src/services/session/_deprecated.test.ts @@ -5,7 +5,7 @@ import { SessionGroupModel } from '@/database/_deprecated/models/sessionGroup'; import { LobeAgentConfig } from '@/types/agent'; import { LobeAgentSession, LobeSessionType, SessionGroups } from '@/types/session'; -import { ClientService } from './client'; +import { ClientService } from './_deprecated'; const sessionService = new ClientService(); diff --git a/src/services/session/client.ts b/src/services/session/_deprecated.ts similarity index 100% rename from src/services/session/client.ts rename to src/services/session/_deprecated.ts diff --git a/src/services/session/index.ts b/src/services/session/index.ts index b4397dd700a8..ca99054e04cb 100644 --- a/src/services/session/index.ts +++ b/src/services/session/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/services/topic/client.ts b/src/services/topic/_deprecated.ts similarity index 100% rename from src/services/topic/client.ts rename to src/services/topic/_deprecated.ts diff --git a/src/services/topic/client.test.ts b/src/services/topic/client.test.ts index 211abefa7d36..1deb6cc1ddd5 100644 --- a/src/services/topic/client.test.ts +++ b/src/services/topic/client.test.ts @@ -4,7 +4,7 @@ import { SessionModel } from '@/database/_deprecated/models/session'; import { CreateTopicParams, TopicModel } from '@/database/_deprecated/models/topic'; import { ChatTopic } from '@/types/topic'; -import { ClientService } from './client'; +import { ClientService } from './_deprecated'; const topicService = new ClientService(); // Mock the TopicModel diff --git a/src/services/topic/index.ts b/src/services/topic/index.ts index 1e1847a18344..891fecbbb011 100644 --- a/src/services/topic/index.ts +++ b/src/services/topic/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/services/user/client.test.ts b/src/services/user/_deprecated.test.ts similarity index 98% rename from src/services/user/client.test.ts rename to src/services/user/_deprecated.test.ts index 5869d58d54ee..87b670fd998a 100644 --- a/src/services/user/client.test.ts +++ b/src/services/user/_deprecated.test.ts @@ -5,7 +5,7 @@ import { UserModel } from '@/database/_deprecated/models/user'; import { UserPreference } from '@/types/user'; import { UserSettings } from '@/types/user/settings'; -import { ClientService } from './client'; +import { ClientService } from './_deprecated'; vi.mock('@/database/_deprecated/models/user', () => ({ UserModel: { diff --git a/src/services/user/client.ts b/src/services/user/_deprecated.ts similarity index 100% rename from src/services/user/client.ts rename to src/services/user/_deprecated.ts diff --git a/src/services/user/index.ts b/src/services/user/index.ts index a7d3b15df07b..a81a931641a3 100644 --- a/src/services/user/index.ts +++ b/src/services/user/index.ts @@ -1,4 +1,4 @@ -import { ClientService as DeprecatedService } from './client'; +import { ClientService as DeprecatedService } from './_deprecated'; import { ClientService } from './pglite'; import { ServerService } from './server'; diff --git a/src/store/chat/slices/builtinTool/action.test.ts b/src/store/chat/slices/builtinTool/action.test.ts index 7d565d1cb6d4..3567c2c4d57a 100644 --- a/src/store/chat/slices/builtinTool/action.test.ts +++ b/src/store/chat/slices/builtinTool/action.test.ts @@ -2,7 +2,7 @@ import { act, renderHook } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; import { fileService } from '@/services/file'; -import { ClientService } from '@/services/file/client'; +import { ClientService } from '@/services/file/_deprecated'; import { messageService } from '@/services/message'; import { imageGenerationService } from '@/services/textToImage'; import { uploadService } from '@/services/upload'; diff --git a/src/store/user/slices/common/action.test.ts b/src/store/user/slices/common/action.test.ts index fa741e6684f7..9417b37fec46 100644 --- a/src/store/user/slices/common/action.test.ts +++ b/src/store/user/slices/common/action.test.ts @@ -5,7 +5,7 @@ import { withSWR } from '~test-utils'; import { DEFAULT_PREFERENCE } from '@/const/user'; import { userService } from '@/services/user'; -import { ClientService } from '@/services/user/client'; +import { ClientService } from '@/services/user/_deprecated'; import { useUserStore } from '@/store/user'; import { preferenceSelectors } from '@/store/user/selectors'; import { GlobalServerConfig } from '@/types/serverConfig';