/* eslint-disable sort-keys-fix/sort-keys-fix */ import { transform } from 'lodash-es'; import { withBasePath } from '@/utils/basePath'; const mapWithBasePath = (apis: T): T => { return transform(apis, (result, value, key) => { if (typeof value === 'string') { // @ts-ignore result[key] = withBasePath(value); } else { result[key] = value; } }); }; export const API_ENDPOINTS = mapWithBasePath({ config: '/api/config', proxy: '/api/proxy', oauth: '/api/auth', // agent markets market: '/api/market', marketItem: (identifier: string) => withBasePath(`/api/market/${identifier}`), // plugins gateway: '/api/plugin/gateway', pluginStore: '/api/plugin/store', // chat chat: (provider: string) => withBasePath(`/api/chat/${provider}`), // trace trace: '/api/trace', // image images: '/api/openai/images', // models models: (provider: string) => withBasePath(`/api/models/${provider}`), // TTS & STT stt: '/api/openai/stt', tts: '/api/openai/tts', edge: '/api/tts/edge-speech', microsoft: '/api/tts/microsoft-speech', });