import { z } from 'zod'; import { type AttachmentContentEncoding, type AttachmentGatewaySide } from '@atlassian-dc-mcp/common'; 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; private readonly baseUrl; private readonly tokenProvider; constructor(host: string | undefined, token: string | (() => string | undefined), apiBasePath?: string, getPageSize?: () => number); /** * Builds an absolute download URL from a Confluence attachment `_links.download` * value, which is a path relative to the site base (context path included). */ private buildDownloadUrl; /** * 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, bodyStart?: 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>; /** * Upload a file as an attachment to a Confluence content entity * @param contentId The ID of the content the attachment will be attached to * @param sourcePath Path to the file to upload, relative to a server-configured upload directory * @param uploadSide Resolved upload gateway (roots, size limit, enabled flag) * @param filename Optional override for the attachment filename (defaults to basename of sourcePath) * @param comment Optional comment describing the attachment * @param minorEdit If true, no notification email will be generated * @param hidden If true, no notification email or activity stream entry will be generated * @param allowDuplicated Allow upload even if an attachment with the same filename exists */ uploadAttachment(contentId: string, sourcePath: string, uploadSide: AttachmentGatewaySide, filename?: string, comment?: string, minorEdit?: boolean, hidden?: boolean, allowDuplicated?: boolean, versionIfExists?: boolean): Promise>; /** * Download one or more attachments from a Confluence content entity. * @param params.contentId The ID of the content the attachment(s) are on * @param params.filename If provided, download only the attachment with this exact filename; otherwise download all attachments on the content * @param params.save Whether to write the attachment(s) to the operator-configured download directory * @param params.saveName Optional file name (basename only) when saving a single attachment * @param params.returnContent Whether/how to embed the bytes inline in the response * @param params.maxInlineBytes Inline embedding cap * @param params.downloadSide Resolved download gateway (roots, size limit, enabled flag) */ downloadAttachmentFromContent(params: { contentId: string; filename?: string; save?: boolean; saveName?: string; returnContent?: AttachmentContentEncoding; maxInlineBytes?: number; downloadSide: AttachmentGatewaySide; }): 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; }; }>>; validateSetup(): Promise; static validateConfig(): string[]; } export declare const confluenceToolSchemas: { getContent: { contentId: z.ZodString; expand: z.ZodOptional; bodyMode: z.ZodOptional>; maxBodyChars: z.ZodOptional; bodyStart: 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>; }; uploadAttachment: { contentId: z.ZodString; sourcePath: z.ZodString; filename: z.ZodOptional; comment: z.ZodOptional; minorEdit: z.ZodOptional; hidden: z.ZodOptional; allowDuplicated: z.ZodOptional; versionIfExists: z.ZodOptional; }; downloadAttachment: { contentId: z.ZodString; filename: z.ZodOptional; returnContent: z.ZodOptional>; maxInlineBytes: z.ZodOptional; }; downloadAttachmentSaveFields: { save: z.ZodOptional; saveName: z.ZodOptional; }; }; //# sourceMappingURL=confluence-service.d.ts.map