Files
drawio-mcp-server/src/types/diagram-types.ts
Alejandro Lembke Barrientos 6aa7e91874
Some checks failed
Main Workflow / Security Audit (push) Successful in 4m39s
Main Workflow / Test and Build (20.x) (push) Failing after 4m56s
Main Workflow / Test and Build (18.x) (push) Failing after 5m9s
Main Workflow / Build Release Artifacts (push) Has been skipped
Main Workflow / Code Quality Check (push) Successful in 1m33s
Main Workflow / Notification (push) Failing after 21s
Adding as a Streamable HTTP MCP Server
2025-07-22 21:31:55 +00:00

170 lines
3.4 KiB
TypeScript

export interface DiagramConfig {
name: string;
type: DiagramType;
format: DiagramFormat;
description?: string;
template?: string;
outputPath?: string;
}
export enum DiagramType {
// BPMN Types
BPMN_PROCESS = 'bpmn-process',
BPMN_COLLABORATION = 'bpmn-collaboration',
BPMN_CHOREOGRAPHY = 'bpmn-choreography',
// UML Types
UML_CLASS = 'uml-class',
UML_SEQUENCE = 'uml-sequence',
UML_USE_CASE = 'uml-use-case',
UML_ACTIVITY = 'uml-activity',
UML_STATE = 'uml-state',
UML_COMPONENT = 'uml-component',
UML_DEPLOYMENT = 'uml-deployment',
// Database Types
ER_DIAGRAM = 'er-diagram',
DATABASE_SCHEMA = 'database-schema',
CONCEPTUAL_MODEL = 'conceptual-model',
// Network Types
NETWORK_TOPOLOGY = 'network-topology',
INFRASTRUCTURE = 'infrastructure',
CLOUD_ARCHITECTURE = 'cloud-architecture',
// Architecture Types
SYSTEM_ARCHITECTURE = 'system-architecture',
MICROSERVICES = 'microservices',
LAYERED_ARCHITECTURE = 'layered-architecture',
C4_CONTEXT = 'c4-context',
C4_CONTAINER = 'c4-container',
C4_COMPONENT = 'c4-component',
// General Types
FLOWCHART = 'flowchart',
ORGCHART = 'orgchart',
MINDMAP = 'mindmap',
WIREFRAME = 'wireframe',
GANTT = 'gantt'
}
export enum DiagramFormat {
DRAWIO = 'drawio',
DRAWIO_SVG = 'drawio.svg',
DRAWIO_PNG = 'drawio.png',
DIO = 'dio',
XML = 'xml',
SVG = 'svg',
PNG = 'png',
PDF = 'pdf',
HTML = 'html',
VSDX = 'vsdx'
}
export enum ExportFormat {
PNG = 'png',
SVG = 'svg',
PDF = 'pdf',
JPEG = 'jpeg',
HTML = 'html',
XML = 'xml',
VSDX = 'vsdx'
}
export interface DiagramElement {
id: string;
type: string;
label?: string;
properties?: Record<string, any>;
geometry?: {
x: number;
y: number;
width: number;
height: number;
};
style?: string;
}
export interface DiagramConnection {
id: string;
source: string;
target: string;
label?: string;
style?: string;
properties?: Record<string, any>;
}
export interface DiagramData {
elements: DiagramElement[];
connections: DiagramConnection[];
metadata: {
type: DiagramType;
format: DiagramFormat;
created: string;
modified: string;
version: string;
};
}
export interface TemplateConfig {
name: string;
type: DiagramType;
description: string;
elements: DiagramElement[];
connections: DiagramConnection[];
defaultStyle?: string;
}
// AI Analysis Types
export interface DiagramAnalysis {
diagramType: DiagramType;
confidence: number;
entities: string[];
relationships: Array<{
from: string;
to: string;
type: string;
label?: string;
}>;
keywords: string[];
reasoning: string;
}
export interface IntelligentDiagramInput {
description: string;
format?: DiagramFormat;
preferences?: {
language?: string;
complexity?: 'simple' | 'detailed';
theme?: 'default' | 'dark' | 'minimal';
};
}
export interface IntelligentDiagramResult {
success: boolean;
diagramType: DiagramType;
format: DiagramFormat;
fileName: string;
content: string;
metadata: {
analysis: DiagramAnalysis;
entities: string[];
relationships: Array<{
from: string;
to: string;
type: string;
label?: string;
}>;
generatedAt: string;
};
error?: string;
}
export interface ProgressUpdate {
type: 'progress' | 'content' | 'complete' | 'error';
status?: string;
progress?: number;
message?: string;
data?: any;
}