@the_cfdude/productboard-mcp
Version:
Model Context Protocol server for Productboard REST API with dynamic tool loading
131 lines (130 loc) • 3.59 kB
TypeScript
/**
* Simplified bulk operations with diff-only focus
* Provides efficient bulk update capabilities with change tracking
*/
export interface BulkUpdateRequest {
entityType: string;
updates: Array<{
id: string;
changes: Record<string, unknown>;
expectedVersion?: string;
metadata?: Record<string, unknown>;
}>;
options?: {
batchSize?: number;
concurrency?: number;
continueOnError?: boolean;
validateBeforeUpdate?: boolean;
trackChanges?: boolean;
};
}
export interface BulkUpdateResult {
successful: string[];
failed: Array<{
id: string;
error: string;
originalData?: Record<string, unknown>;
}>;
skipped: string[];
changes: Array<{
id: string;
before: Record<string, unknown>;
after: Record<string, unknown>;
diff: Record<string, unknown>;
}>;
summary: {
total: number;
successCount: number;
failureCount: number;
skippedCount: number;
changesCount: number;
};
}
export interface DiffOperation {
operation: 'add' | 'remove' | 'change';
path: string;
oldValue?: unknown;
newValue?: unknown;
}
export interface EntityDiff {
id: string;
entityType: string;
operations: DiffOperation[];
hasChanges: boolean;
changeCount: number;
significantChanges: string[];
}
/**
* Simplified bulk operations engine with diff-only focus
*/
export declare class BulkOperationsEngine {
private defaultBatchSize;
private defaultConcurrency;
private maxBatchSize;
/**
* Perform bulk updates with diff tracking
*/
performBulkUpdate(request: BulkUpdateRequest, entityHandler: (operation: string, params: Record<string, unknown>) => Promise<unknown>): Promise<BulkUpdateResult>;
/**
* Process a single batch of updates
*/
private processBatch;
/**
* Generate entity diff between before and after states
*/
createEntityDiff(id: string, before: Record<string, unknown>, after: Record<string, unknown>): EntityDiff;
/**
* Compare field values for differences
*/
private valuesAreDifferent;
/**
* Determine if a change is significant (should be highlighted)
*/
private isSignificantChange;
/**
* Generate diff object for API response
*/
private generateDiffObject;
/**
* Validate updates before processing
*/
private validateUpdates;
/**
* Extract entity data from API response
*/
private extractEntityData;
/**
* Check if error indicates entity not found
*/
private isNotFoundError;
/**
* Merge batch result into main result
*/
private mergeBatchResult;
/**
* Create batches from array of updates
*/
private createBatches;
}
/**
* Utility functions for diff operations
*/
export declare class DiffUtils {
/**
* Generate human-readable summary of changes
*/
static generateChangeSummary(changes: EntityDiff[]): string;
/**
* Filter changes by significance
*/
static filterSignificantChanges(changes: EntityDiff[]): EntityDiff[];
/**
* Group changes by operation type
*/
static groupChangesByOperation(changes: EntityDiff[]): Record<string, DiffOperation[]>;
/**
* Create diff report in various formats
*/
static createDiffReport(changes: EntityDiff[], format?: 'summary' | 'detailed' | 'compact'): string;
}
export declare const bulkOperationsEngine: BulkOperationsEngine;