diff --git a/src/app/api/assistant/[id]/route.ts b/src/app/webapi/assistant/[id]/route.ts similarity index 100% rename from src/app/api/assistant/[id]/route.ts rename to src/app/webapi/assistant/[id]/route.ts diff --git a/src/app/api/assistant/store/route.ts b/src/app/webapi/assistant/store/route.ts similarity index 100% rename from src/app/api/assistant/store/route.ts rename to src/app/webapi/assistant/store/route.ts diff --git a/src/app/api/plugin/gateway/route.ts b/src/app/webapi/plugin/gateway/route.ts similarity index 100% rename from src/app/api/plugin/gateway/route.ts rename to src/app/webapi/plugin/gateway/route.ts diff --git a/src/app/api/plugin/gateway/settings.test.ts b/src/app/webapi/plugin/gateway/settings.test.ts similarity index 100% rename from src/app/api/plugin/gateway/settings.test.ts rename to src/app/webapi/plugin/gateway/settings.test.ts diff --git a/src/app/api/plugin/gateway/settings.ts b/src/app/webapi/plugin/gateway/settings.ts similarity index 100% rename from src/app/api/plugin/gateway/settings.ts rename to src/app/webapi/plugin/gateway/settings.ts diff --git a/src/app/api/plugin/store/route.ts b/src/app/webapi/plugin/store/route.ts similarity index 100% rename from src/app/api/plugin/store/route.ts rename to src/app/webapi/plugin/store/route.ts diff --git a/src/app/api/text-to-image/[provider]/route.ts b/src/app/webapi/text-to-image/[provider]/route.ts similarity index 100% rename from src/app/api/text-to-image/[provider]/route.ts rename to src/app/webapi/text-to-image/[provider]/route.ts diff --git a/src/app/api/trace/route.ts b/src/app/webapi/trace/route.ts similarity index 100% rename from src/app/api/trace/route.ts rename to src/app/webapi/trace/route.ts diff --git a/src/services/__tests__/assistant.test.ts b/src/services/__tests__/assistant.test.ts index 9e5fd50feffa..6c7eaaaf95f0 100644 --- a/src/services/__tests__/assistant.test.ts +++ b/src/services/__tests__/assistant.test.ts @@ -33,7 +33,7 @@ describe('AssistantService', () => { // Assert expect(globalHelpers.getCurrentLanguage).toHaveBeenCalled(); - expect(fetch).toHaveBeenCalledWith('/api/assistant/store?locale=tt'); + expect(fetch).toHaveBeenCalledWith('/webapi/assistant/store?locale=tt'); expect(assistantList).toEqual(fakeResponse.agents); }); @@ -63,7 +63,7 @@ describe('AssistantService', () => { // Assert expect(globalHelpers.getCurrentLanguage).toHaveBeenCalled(); - expect(fetch).toHaveBeenCalledWith('/api/assistant/test-assisstant?locale=tt'); + expect(fetch).toHaveBeenCalledWith('/webapi/assistant/test-assisstant?locale=tt'); expect(assistant.identifier).toEqual(fakeResponse.identifier); }); diff --git a/src/services/__tests__/tool.test.ts b/src/services/__tests__/tool.test.ts index 8e69fb997890..d52e2106e545 100644 --- a/src/services/__tests__/tool.test.ts +++ b/src/services/__tests__/tool.test.ts @@ -35,7 +35,7 @@ describe('ToolService', () => { // Assert expect(globalHelpers.getCurrentLanguage).toHaveBeenCalled(); - expect(fetch).toHaveBeenCalledWith('/api/plugin/store?locale=tt'); + expect(fetch).toHaveBeenCalledWith('/webapi/plugin/store?locale=tt'); expect(pluginList).toEqual(fakeResponse.plugins); }); diff --git a/src/services/_url.ts b/src/services/_url.ts index 5b110bef7062..36822db03954 100644 --- a/src/services/_url.ts +++ b/src/services/_url.ts @@ -17,26 +17,26 @@ const mapWithBasePath = (apis: T): T => { }; export const API_ENDPOINTS = mapWithBasePath({ - proxy: '/webapi/proxy', + // chat + chat: (provider: string) => withBasePath(`/api/chat/${provider}`), + chatModels: (provider: string) => withBasePath(`/api/chat/models/${provider}`), oauth: '/api/auth', - // agent markets - assistantStore: '/api/assistant/store', - assistant: (identifier: string) => withBasePath(`/api/assistant/${identifier}`), + proxy: '/webapi/proxy', + + // assistant + assistantStore: '/webapi/assistant/store', + assistant: (identifier: string) => withBasePath(`/webapi/assistant/${identifier}`), // plugins - gateway: '/api/plugin/gateway', - pluginStore: '/api/plugin/store', - - // chat - chat: (provider: string) => withBasePath(`/api/chat/${provider}`), - chatModels: (provider: string) => withBasePath(`/api/chat/models/${provider}`), + gateway: '/webapi/plugin/gateway', + pluginStore: '/webapi/plugin/store', // trace - trace: '/api/trace', + trace: '/webapi/trace', // image - images: '/api/text-to-image/openai', + images: '/webapi/api/text-to-image/openai', // STT stt: '/webapi/stt/openai',