Skip to main content
Glama
chat-mapper.ts777 B
import type { Chat, ChatResponseData } from '@/client/chats/types/index.js'; import type { ChatInfoBO, ChatListBO } from '../types/index.js'; export class ChatMapper { /** * Convert chat info from API response to BO */ toChatInfoBO = (data: Chat): ChatInfoBO => ({ id: data.chat_id, avatar: data.avatar, name: data.name, description: data.description, ownerId: data.owner_id, ownerIdType: data.owner_id_type, isExternal: data.external, tenantKey: data.tenant_key, status: data.chat_status, }); /** * Convert chat list from API response to BO */ toChatListBO = (data: ChatResponseData): ChatListBO => ({ chats: data.items.map(this.toChatInfoBO), hasMore: data.has_more, pageToken: data.page_token, }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sdd330/feishu-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server