Skip to content

Commit

Permalink
♻️ refactor: move pglite to client service (#5133)
Browse files Browse the repository at this point in the history
* update locale

* update locale

* refactor the service name
  • Loading branch information
arvinxx authored Dec 22, 2024
1 parent 5f5ac9e commit c2ded24
Show file tree
Hide file tree
Showing 23 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions locales/en-US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/file/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/import/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
CreateMessageParams,
} from '@/types/message';

import { ClientService } from './pglite';
import { ClientService } from './client';

const userId = 'message-db';
const sessionId = '1';
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/message/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/plugin/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/session/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/topic/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down
2 changes: 1 addition & 1 deletion src/services/topic/pglite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/services/user/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientService as DeprecatedService } from './_deprecated';
import { ClientService } from './pglite';
import { ClientService } from './client';
import { ServerService } from './server';

const clientService =
Expand Down

0 comments on commit c2ded24

Please sign in to comment.