UNPKG

@answerai/answeragent-mcp

Version:

A lightweight Model Context Protocol (MCP) server for Answer AI chatflow and document store management

25 lines (24 loc) 982 B
import { apiClient } from "./api-client.js"; export class DocumentLoaderService { constructor() { } static getInstance() { if (!DocumentLoaderService.instance) { DocumentLoaderService.instance = new DocumentLoaderService(); } return DocumentLoaderService.instance; } async deleteLoader(storeId, loaderId) { await apiClient.delete(`/document-store/loader/${storeId}/${loaderId}`); } async getChunks(storeId, loaderId, pageNo) { const { data } = await apiClient.get(`/document-store/chunks/${storeId}/${loaderId}/${pageNo}`); return data; } async updateChunk(storeId, loaderId, chunkId, payload) { const { data } = await apiClient.put(`/document-store/chunks/${storeId}/${loaderId}/${chunkId}`, payload); return data; } async deleteChunk(storeId, loaderId, chunkId) { await apiClient.delete(`/document-store/chunks/${storeId}/${loaderId}/${chunkId}`); } }