import type { KindRegistry } from '../model/kind-registry.js'; import type { RelationshipRegistry } from '../model/relationship-registry.js'; /** An element extracted from an EA project */ export interface EaElement { /** EA element ID */ eaId: number; /** Element name */ name: string; /** EA element type (e.g. "Class", "Requirement", "Component") */ eaType: string; /** EA stereotype (e.g. "Hazard", "RiskControlMeasure") */ stereotype: string; /** Mapped MEMO kind (e.g. "Hazard") */ memoKind?: string; /** SysML construct (e.g. "part def", "requirement def") */ construct?: string; /** Element notes/documentation */ doc: string; /** Additional tagged values */ attributes: Record; /** EA package path */ packagePath: string; } /** A relationship extracted from an EA project */ export interface EaRelationship { /** Source element EA ID */ sourceEaId: number; /** Target element EA ID */ targetEaId: number; /** EA connector type (e.g. "Dependency", "Realisation", "Association") */ eaType: string; /** EA connector stereotype */ stereotype: string; /** Mapped MEMO relationship type */ memoRelType?: string; /** Source element name */ sourceName: string; /** Target element name */ targetName: string; } /** Result of importing an EA project */ export interface EaImportResult { /** Extracted and mapped elements */ elements: EaElement[]; /** Extracted and mapped relationships */ relationships: EaRelationship[]; /** Warnings generated during import */ warnings: string[]; /** Errors that prevented import of specific items */ errors: string[]; /** Mapping statistics */ stats: { totalElements: number; mappedElements: number; unmappedElements: number; totalRelationships: number; mappedRelationships: number; unmappedRelationships: number; }; } /** * Parse Sparx EA SQLite (.qea) database structure. * EA stores its model in a SQLite database with tables: * - t_object: elements (Object_ID, Name, Object_Type, Stereotype, Note, Package_ID) * - t_connector: relationships (Connector_ID, Start_Object_ID, End_Object_ID, Connector_Type, Stereotype) * - t_package: packages (Package_ID, Name, Parent_ID) * - t_objectproperties: tagged values (Object_ID, Property, Value) * * Since we cannot use native SQLite bindings (would require node-gyp), * we parse the file as a structured text/XML format for .eap/.eapx files, * or provide a SQL-based import via an intermediate JSON export. */ /** * Import elements and relationships from a Sparx EA JSON export. * * EA projects can be exported as JSON via: * 1. EA's built-in "Publish as HTML" → extract model.json * 2. EA scripting API → custom JSON export * 3. eautils or similar third-party tools * * Expected JSON format: * { * "elements": [{ "id": 1, "name": "...", "type": "Class", "stereotype": "Hazard", "notes": "...", "package": "Risk", "taggedValues": {} }], * "connectors": [{ "id": 1, "sourceId": 1, "targetId": 2, "type": "Dependency", "stereotype": "mitigates" }] * } */ export declare function importEaJson(jsonData: EaJsonExport, kindRegistry?: KindRegistry, relRegistry?: RelationshipRegistry): EaImportResult; /** JSON export format from Sparx EA */ export interface EaJsonExport { elements?: EaJsonElement[]; connectors?: EaJsonConnector[]; } export interface EaJsonElement { id: number; name: string; type: string; stereotype?: string; notes?: string; package?: string; taggedValues?: Record; } export interface EaJsonConnector { id: number; sourceId: number; targetId: number; type: string; stereotype?: string; name?: string; } /** * Generate SysML v2 text from an EA import result. * Groups elements by package path, creates package hierarchy. */ export declare function eaResultToSysml(result: EaImportResult, packageName: string): string; //# sourceMappingURL=ea-importer.d.ts.map