@likec4/leanix-bridge 1.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,559 @@
1
+ //#region src/contracts.d.ts
2
+ /**
3
+ * Canonical bridge contracts for LikeC4 ↔ LeanIX interoperability.
4
+ * LikeC4 remains the semantic source of truth; external IDs are provider-scoped.
5
+ * Uses readFileSync (not require) so when bundled into likec4 CLI the bundler
6
+ * does not emit require('../package.json') which fails in the tarball layout.
7
+ */
8
+ /** Single source of truth: must match package.json version. */
9
+ declare const BRIDGE_VERSION: string;
10
+ /** Semantic anchor: LikeC4 FQN (e.g. cloud.backend.api) */
11
+ type CanonicalId = string;
12
+ /** Provider-scoped external identifier (e.g. LeanIX factSheetId) */
13
+ type ExternalId = string;
14
+ /** LikeC4 view id (e.g. index, saas, landscape.overview) */
15
+ type ViewId = string;
16
+ /** LikeC4 relation id; for composite key use sourceFqn|targetFqn|relationId */
17
+ type RelationId = string;
18
+ /** Version of the manifest schema */
19
+ type ManifestVersion = string;
20
+ /** ISO timestamp when the artifact was generated */
21
+ type GeneratedAt = string;
22
+ /** Version of the bridge that produced the artifact */
23
+ type BridgeVersion = string;
24
+ /** Name or id of the mapping profile used */
25
+ type MappingProfile = string;
26
+ /** Provider name (e.g. leanix, drawio) */
27
+ type Provider = string;
28
+ /** External IDs for a single provider (e.g. factSheetId, externalId). */
29
+ interface ProviderExternalIds {
30
+ factSheetId?: string;
31
+ externalId?: string;
32
+ [key: string]: string | undefined;
33
+ }
34
+ /** Entity entry in the manifest: canonical id + optional external IDs per provider. */
35
+ interface ManifestEntity {
36
+ canonicalId: CanonicalId;
37
+ external?: Partial<Record<Provider, ProviderExternalIds>>;
38
+ }
39
+ /** View entry in the manifest (viewId + optional provider external ids). */
40
+ interface ManifestView {
41
+ viewId: ViewId;
42
+ external?: Partial<Record<Provider, Record<string, string>>>;
43
+ }
44
+ /** Relation entry: composite key and optional external relation id per provider. */
45
+ interface ManifestRelation {
46
+ relationId: RelationId;
47
+ sourceFqn: CanonicalId;
48
+ targetFqn: CanonicalId;
49
+ compositeKey: string;
50
+ external?: Partial<Record<Provider, {
51
+ relationId?: string;
52
+ [key: string]: string | undefined;
53
+ }>>;
54
+ }
55
+ /** Identity manifest: canonical IDs and provider-scoped external IDs */
56
+ interface BridgeManifest {
57
+ manifestVersion: ManifestVersion;
58
+ generatedAt: GeneratedAt;
59
+ bridgeVersion: BridgeVersion;
60
+ mappingProfile: MappingProfile;
61
+ projectId: string;
62
+ entities: Record<CanonicalId, ManifestEntity>;
63
+ views: Record<ViewId, ManifestView>;
64
+ relations: ManifestRelation[];
65
+ }
66
+ /** Manifest schema version (semantic; must match parser). */
67
+ declare const BRIDGE_MANIFEST_VERSION = "1.0";
68
+ /** Provider identifier for LeanIX (single source of truth for external.leanix). */
69
+ declare const LEANIX_PROVIDER: "leanix";
70
+ //#endregion
71
+ //#region src/mapping.d.ts
72
+ /**
73
+ * Configurable LeanIX mapping: LikeC4 kinds/relations/tags → LeanIX fact sheet types and fields.
74
+ * No universal taxonomy; safe defaults. Actor kind maps to 'Provider' unless overridden.
75
+ */
76
+ /** Configurable mapping from LikeC4 kinds/relations/tags to LeanIX fact sheet and relation types. */
77
+ interface LeanixMappingConfig {
78
+ /** LikeC4 element kind → LeanIX fact sheet type */
79
+ factSheetTypes?: Record<string, string>;
80
+ /** LikeC4 relationship kind → LeanIX relation type name */
81
+ relationTypes?: Record<string, string>;
82
+ /** LikeC4 tags / metadata keys → LeanIX field names (optional) */
83
+ metadataToFields?: Record<string, string>;
84
+ }
85
+ /** Fallback when element kind is unknown (G25: named constant). */
86
+ declare const FALLBACK_FACT_SHEET_TYPE = "Application";
87
+ /** Fallback when relation kind is unknown (G25: named constant). */
88
+ declare const FALLBACK_RELATION_TYPE = "depends on";
89
+ /** Default mapping: actor → Provider; override factSheetTypes/relationTypes as needed */
90
+ declare const DEFAULT_LEANIX_MAPPING: Required<LeanixMappingConfig>;
91
+ /**
92
+ * Merges partial mapping config with DEFAULT_LEANIX_MAPPING; returns a full Required<LeanixMappingConfig>.
93
+ */
94
+ declare function mergeWithDefault(partial?: LeanixMappingConfig | null): Required<LeanixMappingConfig>;
95
+ /**
96
+ * Returns LeanIX fact sheet type for a LikeC4 element kind.
97
+ * Uses mapping.factSheetTypes[kind], then 'default', then FALLBACK_FACT_SHEET_TYPE.
98
+ */
99
+ declare function getFactSheetType(likec4Kind: string, mapping: Required<LeanixMappingConfig>): string;
100
+ /**
101
+ * Returns LeanIX relation type for a LikeC4 relationship kind.
102
+ * Uses mapping.relationTypes[kind], then 'default', then FALLBACK_RELATION_TYPE.
103
+ */
104
+ declare function getRelationType(likec4Kind: string | null, mapping: Required<LeanixMappingConfig>): string;
105
+ //#endregion
106
+ //#region src/model-input.d.ts
107
+ /**
108
+ * Minimal model shape required by the bridge. Satisfied by LikeC4Model (layouted).
109
+ * Keeps the bridge decoupled from concrete model class.
110
+ */
111
+ /** Element shape required by the bridge (id, kind, title, tags, getMetadata). */
112
+ interface BridgeElementLike {
113
+ id: string;
114
+ kind: string;
115
+ title: string;
116
+ tags: readonly string[];
117
+ technology?: string | null;
118
+ getMetadata(): Record<string, unknown>;
119
+ }
120
+ /** Relation shape required by the bridge (id, source, target, kind, title). */
121
+ interface BridgeRelationLike {
122
+ id: string;
123
+ source: {
124
+ id: string;
125
+ };
126
+ target: {
127
+ id: string;
128
+ };
129
+ kind: string | null;
130
+ title?: string | null;
131
+ }
132
+ /** View shape required by the bridge (id only). */
133
+ interface BridgeViewLike {
134
+ id: string;
135
+ }
136
+ /** Model input for toBridgeManifest / toLeanixInventoryDryRun */
137
+ interface BridgeModelInput {
138
+ projectId: string;
139
+ elements(): Iterable<BridgeElementLike>;
140
+ relationships(): Iterable<BridgeRelationLike>;
141
+ views(): Iterable<BridgeViewLike>;
142
+ }
143
+ //#endregion
144
+ //#region src/to-bridge-manifest.d.ts
145
+ interface ToBridgeManifestOptions {
146
+ manifestVersion?: string;
147
+ generatedAt?: string;
148
+ bridgeVersion?: string;
149
+ mappingProfile?: string;
150
+ }
151
+ /**
152
+ * Produces the identity manifest from a LikeC4 model (canonical IDs + placeholders for external IDs).
153
+ * Pure function; no live API calls.
154
+ */
155
+ declare function toBridgeManifest(model: BridgeModelInput, options?: ToBridgeManifestOptions): BridgeManifest;
156
+ //#endregion
157
+ //#region src/to-leanix-inventory-dry-run.d.ts
158
+ /** Single LeanIX fact sheet in dry-run shape (no IDs from live API) */
159
+ interface LeanixFactSheetDryRun {
160
+ type: string;
161
+ likec4Id: string;
162
+ name: string;
163
+ description?: string;
164
+ technology?: string;
165
+ tags?: string[];
166
+ metadata?: Record<string, unknown>;
167
+ }
168
+ /** Single LeanIX relation in dry-run shape */
169
+ interface LeanixRelationDryRun {
170
+ type: string;
171
+ likec4RelationId: string;
172
+ sourceLikec4Id: string;
173
+ targetLikec4Id: string;
174
+ title?: string;
175
+ }
176
+ /** Dry-run inventory: fact sheets and relations as would be sent to LeanIX, without live IDs */
177
+ interface LeanixInventoryDryRun {
178
+ generatedAt: string;
179
+ projectId: string;
180
+ mappingProfile: string;
181
+ factSheets: LeanixFactSheetDryRun[];
182
+ relations: LeanixRelationDryRun[];
183
+ }
184
+ /** Options for toLeanixInventoryDryRun (mapping, mappingProfile, generatedAt). */
185
+ interface ToLeanixInventoryDryRunOptions {
186
+ mapping?: LeanixMappingConfig | null;
187
+ mappingProfile?: string;
188
+ generatedAt?: string;
189
+ }
190
+ /**
191
+ * Produces LeanIX-shaped inventory artifacts (fact sheets + relations) from a LikeC4 model.
192
+ * Pure function; no live API. Use for dry-run and planning.
193
+ */
194
+ declare function toLeanixInventoryDryRun(model: BridgeModelInput, options?: ToLeanixInventoryDryRunOptions): LeanixInventoryDryRun;
195
+ //#endregion
196
+ //#region src/report.d.ts
197
+ /** Summary report for the bridge run (no live sync) */
198
+ interface BridgeReport {
199
+ generatedAt: string;
200
+ projectId: string;
201
+ manifestVersion: string;
202
+ bridgeVersion: string;
203
+ mappingProfile: string;
204
+ counts: {
205
+ entities: number;
206
+ views: number;
207
+ relations: number;
208
+ factSheets: number;
209
+ leanixRelations: number;
210
+ };
211
+ artifacts: {
212
+ manifest: string;
213
+ leanixDryRun: string;
214
+ };
215
+ }
216
+ /**
217
+ * Builds a summary report (counts, artifact names) from manifest and dry-run. Throws if projectId or mappingProfile differ.
218
+ */
219
+ declare function buildBridgeReport(manifest: BridgeManifest, leanixDryRun: LeanixInventoryDryRun): BridgeReport;
220
+ //#endregion
221
+ //#region src/leanix-api-client.d.ts
222
+ /**
223
+ * Low-level LeanIX GraphQL API client.
224
+ * Handles authentication (Bearer token), request throttling, and errors.
225
+ */
226
+ /** Configuration for LeanixApiClient (apiToken, baseUrl, requestDelayMs). */
227
+ interface LeanixApiClientConfig {
228
+ /** LeanIX API token (required for auth). */
229
+ apiToken: string;
230
+ /**
231
+ * Base URL for the LeanIX API (e.g. https://app.leanix.net or https://<workspace>.leanix.net).
232
+ * Default: https://app.leanix.net
233
+ */
234
+ baseUrl?: string;
235
+ /**
236
+ * Delay in ms between consecutive GraphQL requests (rate limiting).
237
+ * Default: 200
238
+ */
239
+ requestDelayMs?: number;
240
+ }
241
+ /** Result of a GraphQL request (data or errors). */
242
+ interface GraphQLResponse<T = unknown> {
243
+ data?: T;
244
+ errors?: Array<{
245
+ message: string;
246
+ path?: string[];
247
+ extensions?: Record<string, unknown>;
248
+ }>;
249
+ }
250
+ /** Thrown when the LeanIX API returns errors or non-OK HTTP. */
251
+ declare class LeanixApiError extends Error {
252
+ readonly statusCode?: number | undefined;
253
+ readonly graphqlErrors?: GraphQLResponse['errors'];
254
+ constructor(message: string, statusCode?: number | undefined, graphqlErrors?: GraphQLResponse['errors']);
255
+ }
256
+ /**
257
+ * LeanIX GraphQL API client with Bearer auth and optional rate limiting.
258
+ * Throttle state is per instance so multiple clients do not share delay.
259
+ */
260
+ declare class LeanixApiClient {
261
+ private readonly baseUrl;
262
+ private readonly apiToken;
263
+ private readonly requestDelayMs;
264
+ /** Last request timestamp for throttling (per instance). */
265
+ private lastRequestTime;
266
+ /** Serializes rate-limit and request so only one caller runs at a time. */
267
+ private rateLimitLock;
268
+ constructor(config: LeanixApiClientConfig);
269
+ /**
270
+ * Execute a GraphQL operation (query or mutation).
271
+ * Throttles requests by requestDelayMs. Throws LeanixApiError on HTTP or GraphQL errors.
272
+ */
273
+ graphql<T = unknown>(query: string, variables?: Record<string, unknown>): Promise<T>;
274
+ }
275
+ //#endregion
276
+ //#region src/sync-to-leanix.d.ts
277
+ /** Options for live sync (idempotent lookup, optional likec4Id custom attribute). */
278
+ interface SyncToLeanixOptions {
279
+ /** If true, only create fact sheets that do not exist (by name+type). Default: true. */
280
+ idempotent?: boolean;
281
+ /** Custom attribute key in LeanIX to store likec4Id for lookup. If not set, lookup by name+type. */
282
+ likec4IdAttribute?: string;
283
+ }
284
+ /** Result of syncToLeanix (updated manifest, counts, errors). */
285
+ interface SyncToLeanixResult {
286
+ /** Updated manifest with external.leanix.factSheetId and relation IDs filled. */
287
+ manifest: BridgeManifest;
288
+ /** Count of fact sheets created. */
289
+ factSheetsCreated: number;
290
+ /** Count of fact sheets reused (when idempotent and found; no mutation). */
291
+ factSheetsReused: number;
292
+ /** Count of relations created. */
293
+ relationsCreated: number;
294
+ /** Errors encountered (e.g. rate limit, validation). Partial sync may still have updated manifest. */
295
+ errors: string[];
296
+ }
297
+ /** Single fact sheet entry in a sync plan: what would happen when syncing. */
298
+ interface SyncPlanFactSheetEntry {
299
+ likec4Id: string;
300
+ name: string;
301
+ type: string;
302
+ /** 'create' = not found in LeanIX; 'update' = found by name+type (idempotent). */
303
+ action: 'create' | 'update';
304
+ /** Set when action is 'update': existing LeanIX fact sheet id. */
305
+ existingFactSheetId?: string;
306
+ }
307
+ /** Single relation entry in a sync plan (relations are always created when source/target exist). */
308
+ interface SyncPlanRelationEntry {
309
+ likec4RelationId: string;
310
+ sourceLikec4Id: string;
311
+ targetLikec4Id: string;
312
+ type: string;
313
+ action: 'create';
314
+ }
315
+ /** Summary counts for a sync plan. */
316
+ interface SyncPlanSummary {
317
+ factSheetsToCreate: number;
318
+ factSheetsToUpdate: number;
319
+ relationsToCreate: number;
320
+ }
321
+ /** Sync plan artifact: what would be created/updated in LeanIX (no writes; uses API only to read existing). */
322
+ interface SyncPlan {
323
+ generatedAt: string;
324
+ projectId: string;
325
+ mappingProfile: string;
326
+ summary: SyncPlanSummary;
327
+ factSheetPlans: SyncPlanFactSheetEntry[];
328
+ relationPlans: SyncPlanRelationEntry[];
329
+ /** Errors from read-only queries (e.g. auth, rate limit). Plan may be partial. */
330
+ errors: string[];
331
+ }
332
+ /** Options for planSyncToLeanix (idempotent, likec4Id attribute, generatedAt). */
333
+ interface PlanSyncToLeanixOptions {
334
+ /** If true, plan assumes idempotent sync (look up by likec4IdAttribute or name+type to decide create vs update). Default: true. */
335
+ idempotent?: boolean;
336
+ /** Custom attribute key for likec4Id lookup; when set, plan uses it for idempotent resolution. */
337
+ likec4IdAttribute?: string;
338
+ /** ISO timestamp for the plan. Default: new Date().toISOString() */
339
+ generatedAt?: string;
340
+ }
341
+ /**
342
+ * Produces a sync plan by querying LeanIX for existing fact sheets (read-only; no creates/updates).
343
+ * Use before syncToLeanix to review what would be created vs updated. Phase 2 dry-run sync planning.
344
+ */
345
+ declare function planSyncToLeanix(leanixDryRun: LeanixInventoryDryRun, client: LeanixApiClient, options?: PlanSyncToLeanixOptions): Promise<SyncPlan>;
346
+ /**
347
+ * Syncs the dry-run inventory to LeanIX: creates or finds fact sheets, creates relations,
348
+ * and returns an updated manifest with external LeanIX IDs.
349
+ */
350
+ declare function syncToLeanix(manifest: BridgeManifest, leanixDryRun: LeanixInventoryDryRun, client: LeanixApiClient, options?: SyncToLeanixOptions): Promise<SyncToLeanixResult>;
351
+ //#endregion
352
+ //#region src/drawio-leanix-roundtrip.d.ts
353
+ /** Mapping from LikeC4 canonical id to LeanIX identity (fact sheet id or externalId for Draw.io cells or export). */
354
+ interface DrawioLeanixMapping {
355
+ likec4IdToLeanixId: Record<CanonicalId, string>;
356
+ /** Composite key (sourceFqn|targetFqn|relationId) -> LeanIX relation id. */
357
+ relationKeyToLeanixRelationId: Record<string, string>;
358
+ }
359
+ /**
360
+ * Builds a mapping from manifest (after sync) for use in Draw.io bridge-managed export
361
+ * or when re-importing from LeanIX. Elements can store leanixFactSheetId in style for round-trip.
362
+ */
363
+ declare function manifestToDrawioLeanixMapping(manifest: BridgeManifest): DrawioLeanixMapping;
364
+ //#endregion
365
+ //#region src/leanix-inventory-snapshot.d.ts
366
+ /** Single fact sheet as returned from LeanIX API (read-only snapshot). */
367
+ interface LeanixFactSheetSnapshotItem {
368
+ id: string;
369
+ name: string;
370
+ type: string;
371
+ /** Set when fetched with likec4IdAttribute and the fact sheet has that custom attribute. */
372
+ likec4Id?: string;
373
+ }
374
+ /** Single relation as returned from LeanIX API (read-only snapshot). */
375
+ interface LeanixRelationSnapshotItem {
376
+ id?: string;
377
+ sourceFactSheetId: string;
378
+ targetFactSheetId: string;
379
+ type: string;
380
+ }
381
+ /** Read-only snapshot of LeanIX inventory for reconciliation. */
382
+ interface LeanixInventorySnapshot {
383
+ generatedAt: string;
384
+ /** Workspace or project identifier if available from API. */
385
+ workspaceId?: string;
386
+ factSheets: LeanixFactSheetSnapshotItem[];
387
+ relations: LeanixRelationSnapshotItem[];
388
+ }
389
+ /** Options for fetchLeanixInventorySnapshot (likec4Id attribute, maxFactSheets, generatedAt). */
390
+ interface FetchLeanixInventorySnapshotOptions {
391
+ /** Custom attribute key to read likec4Id from fact sheets (e.g. "likec4Id"). When set, snapshot items get likec4Id when present. */
392
+ likec4IdAttribute?: string;
393
+ /** Max fact sheets to fetch (pagination). Default 1000. */
394
+ maxFactSheets?: number;
395
+ /** ISO timestamp for snapshot. Default: new Date().toISOString() */
396
+ generatedAt?: string;
397
+ }
398
+ /**
399
+ * Fetches a read-only snapshot of the LeanIX inventory (fact sheets, then relations).
400
+ * Uses cursor-based pagination. Does not modify LeanIX.
401
+ */
402
+ declare function fetchLeanixInventorySnapshot(client: LeanixApiClient, options?: FetchLeanixInventorySnapshotOptions): Promise<LeanixInventorySnapshot>;
403
+ //#endregion
404
+ //#region src/reconcile.d.ts
405
+ /** A manifest entity matched to a single LeanIX fact sheet. */
406
+ interface MatchedPair {
407
+ canonicalId: CanonicalId;
408
+ factSheetId: string;
409
+ name: string;
410
+ type: string;
411
+ }
412
+ /** Manifest entity with no matching LeanIX fact sheet. */
413
+ interface UnmatchedInLikec4 {
414
+ canonicalId: CanonicalId;
415
+ name?: string | undefined;
416
+ type?: string | undefined;
417
+ }
418
+ /** LeanIX fact sheet with no matching manifest entity. */
419
+ interface UnmatchedInLeanix {
420
+ factSheetId: string;
421
+ name: string;
422
+ type: string;
423
+ likec4Id?: string | undefined;
424
+ }
425
+ /** Manifest entity that could match multiple LeanIX fact sheets (e.g. same name+type). */
426
+ interface AmbiguousMatch {
427
+ canonicalId: CanonicalId;
428
+ name?: string | undefined;
429
+ type?: string | undefined;
430
+ /** Multiple LeanIX fact sheets could match (e.g. same name+type). */
431
+ candidateFactSheetIds: string[];
432
+ }
433
+ /** Result of reconciling a LeanIX snapshot with the bridge manifest (matched, unmatched, ambiguous). */
434
+ interface ReconciliationResult {
435
+ generatedAt: string;
436
+ manifestProjectId: string;
437
+ snapshotGeneratedAt: string;
438
+ matched: MatchedPair[];
439
+ unmatchedInLikec4: UnmatchedInLikec4[];
440
+ unmatchedInLeanix: UnmatchedInLeanix[];
441
+ ambiguous: AmbiguousMatch[];
442
+ summary: {
443
+ matched: number;
444
+ unmatchedInLikec4: number;
445
+ unmatchedInLeanix: number;
446
+ ambiguous: number;
447
+ };
448
+ }
449
+ /** Options for reconcileInventoryWithManifest (generatedAt, optional dry-run for name/type resolution). */
450
+ interface ReconcileOptions {
451
+ generatedAt?: string;
452
+ /** When provided, name+type matching and ambiguous detection use dry-run fact sheet names/types. */
453
+ dryRun?: LeanixInventoryDryRun;
454
+ }
455
+ /**
456
+ * Reconciles a LeanIX inventory snapshot with the bridge manifest.
457
+ * Matching order: 1) manifest entity has external.leanix.factSheetId; 2) snapshot fact sheet has likec4Id === canonicalId; 3) if dryRun provided, name+type (can be ambiguous).
458
+ * Does not modify any data; no DSL generation.
459
+ */
460
+ declare function reconcileInventoryWithManifest(snapshot: LeanixInventorySnapshot, manifest: BridgeManifest, options?: ReconcileOptions): ReconciliationResult;
461
+ //#endregion
462
+ //#region src/impact-report.d.ts
463
+ /** Impact report from a sync plan (summary counts and human-readable impact summary). */
464
+ interface ImpactReport {
465
+ generatedAt: string;
466
+ projectId: string;
467
+ mappingProfile: string;
468
+ summary: SyncPlanSummary;
469
+ /** Human-readable one-line impact summary. */
470
+ impactSummary: string;
471
+ hasErrors: boolean;
472
+ }
473
+ /**
474
+ * Builds an impact report from a sync plan (read-only).
475
+ * Use before applying sync to understand what would be created/updated.
476
+ */
477
+ declare function impactReportFromSyncPlan(plan: SyncPlan): ImpactReport;
478
+ //#endregion
479
+ //#region src/drift-report.d.ts
480
+ /** Drift status: in_sync, likec4_ahead, leanix_ahead, or diverged. */
481
+ type DriftStatus = 'in_sync' | 'likec4_ahead' | 'leanix_ahead' | 'diverged';
482
+ /** Drift report (status, summary, description). */
483
+ interface DriftReport {
484
+ generatedAt: string;
485
+ manifestProjectId: string;
486
+ snapshotGeneratedAt: string;
487
+ status: DriftStatus;
488
+ summary: ReconciliationResult['summary'];
489
+ /** Short human-readable drift description. */
490
+ description: string;
491
+ }
492
+ /**
493
+ * Builds a drift report from a reconciliation result.
494
+ * In_sync: all matched, no unmatched, no ambiguous. Likec4_ahead: only unmatched in LikeC4. Leanix_ahead: only unmatched in LeanIX. Diverged: mixed or ambiguous.
495
+ */
496
+ declare function buildDriftReport(reconciliation: ReconciliationResult): DriftReport;
497
+ //#endregion
498
+ //#region src/adr-generation.d.ts
499
+ /** Options for ADR generation (title, status, optional impact report). */
500
+ interface AdrGenerationOptions {
501
+ title?: string;
502
+ /** ADR status line. Default: "Proposed". */
503
+ status?: string;
504
+ /** Optional impact report to include. */
505
+ impact?: ImpactReport;
506
+ }
507
+ /**
508
+ * Generates a short ADR-style markdown document from a reconciliation result (and optional impact).
509
+ * Use for governance or audit trail; does not modify any data.
510
+ */
511
+ declare function generateAdrFromReconciliation(reconciliation: ReconciliationResult, options?: AdrGenerationOptions): string;
512
+ /** Options for ADR generation from a drift report (subset of AdrGenerationOptions). */
513
+ type DriftAdrGenerationOptions = Pick<AdrGenerationOptions, 'title' | 'status'>;
514
+ /**
515
+ * Generates a short ADR-style markdown from a drift report.
516
+ */
517
+ declare function generateAdrFromDriftReport(drift: DriftReport, options?: DriftAdrGenerationOptions): string;
518
+ //#endregion
519
+ //#region src/governance-checks.d.ts
520
+ /** Single governance check result (id, name, passed, optional message). */
521
+ interface GovernanceCheckResult {
522
+ id: string;
523
+ name: string;
524
+ passed: boolean;
525
+ message?: string;
526
+ }
527
+ interface GovernanceReport {
528
+ passed: boolean;
529
+ generatedAt: string;
530
+ checks: GovernanceCheckResult[];
531
+ }
532
+ /** Options for runGovernanceChecks (noAmbiguous, allLikec4Matched, noOrphanInLeanix). */
533
+ interface GovernanceCheckOptions {
534
+ /** Fail if any ambiguous matches. Default: true. */
535
+ noAmbiguous?: boolean;
536
+ /** Fail if any LikeC4 entity has no match in LeanIX. Default: false. */
537
+ allLikec4Matched?: boolean;
538
+ /** Fail if any LeanIX fact sheet has no match in LikeC4. Default: false. */
539
+ noOrphanInLeanix?: boolean;
540
+ }
541
+ /**
542
+ * Runs governance checks on a reconciliation result.
543
+ * Returns a report with one entry per check; overall passed iff all checks pass.
544
+ */
545
+ declare function runGovernanceChecks(reconciliation: ReconciliationResult, options?: GovernanceCheckOptions): GovernanceReport;
546
+ //#endregion
547
+ //#region src/validate.d.ts
548
+ /**
549
+ * Returns true if the value is a valid BridgeManifest shape (manifestVersion, generatedAt, bridgeVersion, mappingProfile, projectId, entities, relations, views)
550
+ * and nested entities/views/relations match expected shapes.
551
+ */
552
+ declare function isBridgeManifest(obj: unknown): obj is BridgeManifest;
553
+ /**
554
+ * Returns true if the value is a valid LeanixInventorySnapshot shape (generatedAt, factSheets and relations arrays)
555
+ * and each fact sheet/relation item has required fields.
556
+ */
557
+ declare function isLeanixInventorySnapshot(obj: unknown): obj is LeanixInventorySnapshot;
558
+ //#endregion
559
+ export { type AdrGenerationOptions, type AmbiguousMatch, BRIDGE_MANIFEST_VERSION, BRIDGE_VERSION, type BridgeElementLike, type BridgeManifest, type BridgeModelInput, type RelationId as BridgeRelationId, type BridgeRelationLike, type BridgeReport, type BridgeVersion, type ViewId as BridgeViewId, type BridgeViewLike, type CanonicalId, DEFAULT_LEANIX_MAPPING, type DrawioLeanixMapping, type DriftAdrGenerationOptions, type DriftReport, type DriftStatus, type ExternalId, FALLBACK_FACT_SHEET_TYPE, FALLBACK_RELATION_TYPE, type FetchLeanixInventorySnapshotOptions, type GeneratedAt, type GovernanceCheckOptions, type GovernanceCheckResult, type GovernanceReport, type GraphQLResponse, type ImpactReport, LEANIX_PROVIDER, LeanixApiClient, type LeanixApiClientConfig, LeanixApiError, type LeanixFactSheetDryRun, type LeanixFactSheetSnapshotItem, type LeanixInventoryDryRun, type LeanixInventorySnapshot, type LeanixMappingConfig, type LeanixRelationDryRun, type LeanixRelationSnapshotItem, type ManifestEntity, type ManifestRelation, type ManifestVersion, type ManifestView, type MappingProfile, type MatchedPair, type PlanSyncToLeanixOptions, type Provider, type ProviderExternalIds, type ReconcileOptions, type ReconciliationResult, type SyncPlan, type SyncPlanFactSheetEntry, type SyncPlanRelationEntry, type SyncPlanSummary, type SyncToLeanixOptions, type SyncToLeanixResult, type ToBridgeManifestOptions, type ToLeanixInventoryDryRunOptions, type UnmatchedInLeanix, type UnmatchedInLikec4, buildBridgeReport, buildDriftReport, fetchLeanixInventorySnapshot, generateAdrFromDriftReport, generateAdrFromReconciliation, getFactSheetType, getRelationType, impactReportFromSyncPlan, isBridgeManifest, isLeanixInventorySnapshot, manifestToDrawioLeanixMapping, mergeWithDefault, planSyncToLeanix, reconcileInventoryWithManifest, runGovernanceChecks, syncToLeanix, toBridgeManifest, toLeanixInventoryDryRun };