import { z } from 'zod'; import { ConfluenceBodyMode } from './confluence-response-mapper.js'; /** * Escapes user input for safe use inside a CQL quoted string. * Escapes backslash first, then double quote, so that neither can break out of the phrase. * Only call once per value; double-escaping would over-escape and break the query. */ export declare function escapeSearchTextForCql(searchText: string): string; export interface ConfluenceContent { id?: string; type: string; title: string; space: { key: string; }; body?: { storage: { value: string; representation: 'storage'; }; }; version?: { number: number; message?: string; }; ancestors?: Array<{ id: string; }>; } export declare class ConfluenceService { private readonly getPageSize; constructor(host: string | undefined, token: string | (() => string | undefined), apiBasePath?: string, getPageSize?: () => number); /** * Get a Confluence page by ID * @param contentId The ID of the page to retrieve * @param expand Optional comma-separated list of properties to expand */ getContentRaw(contentId: string, expand?: string): Promise>; getContent(contentId: string, expand?: string, bodyMode?: ConfluenceBodyMode, maxBodyChars?: number): Promise | { data: any; success: boolean; error?: string; details?: any; }>; /** * Search for content in Confluence using CQL * @param cql Confluence Query Language string * @param limit Maximum number of results to return * @param start Start index for pagination * @param expand Optional comma-separated list of properties to expand */ searchContent(cql: string, limit?: number, start?: number, expand?: string, excerpt?: 'none' | 'highlight'): Promise; totalCount?: number; start?: number; limit?: number; size?: number; _links?: { base?: string; context?: string; self?: string; next?: string; prev?: string; }; }>>; /** * Create a new page in Confluence * @param content The content object to create */ createContent(content: ConfluenceContent): Promise>; /** * Update an existing page in Confluence * @param contentId The ID of the content to update * @param content The updated content object */ updateContent(contentId: string, content: ConfluenceContent): Promise>; /** * Search for spaces by text * @param searchText Text to search for in space names or descriptions * @param limit Maximum number of results to return * @param start Start index for pagination * @param expand Optional comma-separated list of properties to expand */ searchSpaces(searchText: string, limit?: number, start?: number, expand?: string, excerpt?: 'none' | 'highlight'): Promise; totalCount?: number; start?: number; limit?: number; size?: number; _links?: { base?: string; context?: string; self?: string; next?: string; prev?: string; }; }>>; /** * Get attachments for a Confluence page * @param contentId The ID of the page * @param expand Optional comma-separated list of properties to expand * @param filename Optional filter by filename * @param limit Maximum number of results * @param start Start index * @param mediaType Optional filter by media type (e.g. "image/png") */ getAttachments(contentId: string, expand?: string, filename?: string, limit?: number, start?: number, mediaType?: string): Promise; totalCount?: number; start?: number; limit?: number; size?: number; _links?: { base?: string; context?: string; self?: string; next?: string; prev?: string; }; }>>; /** * Download attachment binary data from Confluence * Returns the binary content as base64-encoded string, along with metadata. * @param contentId The ID of the page the attachment is on * @param attachmentId The ID of the attachment to download */ downloadAttachmentData(contentId: string, attachmentId: string): Promise>; /** * Download attachment and save directly to a local file. * Skips the base64 encode/decode step - writes binary directly to disk. * @param contentId The ID of the page the attachment is on * @param attachmentId The ID of the attachment to download * @param outputDir Directory to save the file (defaults to system temp) * @param outputFilename Optional custom filename (uses attachment's original name if omitted) * @returns filePath, filename, contentType, size */ saveAttachment(contentId: string, attachmentId: string, outputDir?: string, outputFilename?: string): Promise>; /** * Download all image attachments from a Confluence page to a local directory. * Single call replaces getAttachments + downloadAttachmentData + decode + write. * @param contentId The ID of the page * @param outputDir Directory to save files (defaults to system temp) * @param mediaTypeFilter Filter by media type prefix, defaults to "image/" for all images */ saveAllAttachments(contentId: string, outputDir?: string, mediaTypeFilter?: string): Promise>; validateSetup(): Promise; static validateConfig(): string[]; } export declare const confluenceToolSchemas: { getContent: { contentId: z.ZodString; expand: z.ZodOptional; bodyMode: z.ZodOptional>; maxBodyChars: z.ZodOptional; }; searchContent: { cql: z.ZodString; limit: z.ZodOptional; start: z.ZodOptional; expand: z.ZodOptional; excerpt: z.ZodOptional>; }; createContent: { title: z.ZodString; spaceKey: z.ZodString; type: z.ZodDefault; content: z.ZodString; parentId: z.ZodOptional; output: z.ZodOptional>; }; updateContent: { contentId: z.ZodString; title: z.ZodOptional; content: z.ZodOptional; version: z.ZodNumber; versionComment: z.ZodOptional; output: z.ZodOptional>; }; searchSpaces: { searchText: z.ZodString; limit: z.ZodOptional; start: z.ZodOptional; expand: z.ZodOptional; excerpt: z.ZodOptional>; }; getAttachments: { contentId: z.ZodString; expand: z.ZodOptional; filename: z.ZodOptional; limit: z.ZodOptional; start: z.ZodOptional; mediaType: z.ZodOptional; }; downloadAttachmentData: { contentId: z.ZodString; attachmentId: z.ZodString; }; saveAttachment: { contentId: z.ZodString; attachmentId: z.ZodString; outputDir: z.ZodOptional; outputFilename: z.ZodOptional; }; saveAllAttachments: { contentId: z.ZodString; outputDir: z.ZodOptional; mediaTypeFilter: z.ZodOptional; }; }; //# sourceMappingURL=confluence-service.d.ts.map