@zxkane/quip-mcp-server
Version:
MCP server for interacting with Quip spreadsheets
92 lines (91 loc) • 2.53 kB
TypeScript
/**
* Mock data for a spreadsheet thread
*/
interface MockSpreadsheet {
/**
* Thread ID
*/
threadId: string;
/**
* Thread title
*/
title: string;
/**
* Sheets in the spreadsheet
*/
sheets: {
/**
* Sheet name
*/
name: string;
/**
* CSV content
*/
csv: string;
}[];
}
/**
* Mock Quip client for testing without a real Quip API token
*/
export declare class MockQuipClient {
private mockData;
/**
* Initialize the mock client with sample data
*/
constructor();
/**
* Add a mock spreadsheet to the client
*
* @param spreadsheet Mock spreadsheet data
*/
addMockSpreadsheet(spreadsheet: MockSpreadsheet): void;
/**
* Get a thread by ID
*
* @param threadId ID of the thread to retrieve
* @returns Promise resolving to thread information
* @throws Error if the thread is not found
*/
getThread(threadId: string): Promise<Record<string, any>>;
/**
* Export a thread to XLSX format and save it locally
*
* @param threadId ID of the thread to export
* @param outputPath Local file path where the XLSX file should be saved
* @returns Promise resolving to path to the saved XLSX file
* @throws Error if the thread is not found
*/
exportThreadToXLSX(threadId: string, outputPath: string): Promise<string>;
/**
* Export a thread to CSV format using HTML parsing as fallback method
*
* @param threadId ID of the thread to export
* @param sheetName Name of the sheet to extract (optional)
* @returns Promise resolving to CSV data as string
* @throws Error if the thread is not found or does not contain a spreadsheet
*/
exportThreadToCSVFallback(threadId: string, sheetName?: string): Promise<string>;
/**
* Check if a thread is a spreadsheet
*
* @param threadId ID of the thread to check
* @returns Promise resolving to true if the thread is a spreadsheet, false otherwise
*/
isSpreadsheet(threadId: string): Promise<boolean>;
/**
* Generate mock HTML for a spreadsheet
*
* @param spreadsheet Mock spreadsheet data
* @returns HTML string
*/
private generateMockHtml;
/**
* Generate a large CSV sheet for testing
*
* @param rows Number of rows
* @param cols Number of columns
* @returns CSV string
*/
private generateLargeSheet;
}
export {};