@aashari/mcp-server-atlassian-bitbucket
Version:
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MC
57 lines (56 loc) • 2.01 kB
TypeScript
import { ResponsePagination } from '../types/common.types.js';
/**
* Represents the possible pagination types.
*/
export declare enum PaginationType {
CURSOR = "cursor",// Confluence, Bitbucket (some endpoints)
OFFSET = "offset",// Jira
PAGE = "page"
}
/**
* Interface representing the common structure of paginated data from APIs.
* This union type covers properties used by offset, cursor, and page-based pagination.
*/
interface PaginationData {
results?: unknown[];
values?: unknown[];
count?: number;
size?: number;
hasMore?: boolean;
_links?: {
next?: string;
};
startAt?: number;
maxResults?: number;
total?: number;
nextPage?: string;
page?: number;
pagelen?: number;
next?: string;
}
/**
* Extract pagination information from API response
* @param data The API response containing pagination information
* @param paginationType The type of pagination mechanism used
* @returns Object with nextCursor, hasMore, and count properties
*/
export declare function extractPaginationInfo<T extends Partial<PaginationData>>(data: T, paginationType: PaginationType): ResponsePagination | undefined;
/**
* Validates and enforces page size limits to prevent excessive data exposure (CWE-770)
* @param requestedPageSize The requested page size from the client
* @param contextInfo Optional context for logging (e.g., endpoint name)
* @returns The validated page size (clamped to maximum allowed)
*/
export declare function validatePageSize(requestedPageSize?: number, contextInfo?: string): number;
/**
* Validates pagination data to ensure it doesn't exceed configured limits
* @param paginationData The pagination data to validate
* @param contextInfo Optional context for logging
* @returns True if data is within limits, false otherwise
*/
export declare function validatePaginationLimits(paginationData: {
count?: number;
size?: number;
pagelen?: number;
}, contextInfo?: string): boolean;
export {};