@likec4/core 1.29.1 → 1.31.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.
@@ -1,5 +1,5 @@
1
1
  import { LastArrayElement, Split, Simplify, Writable, IfNever, TupleToUnion, Tagged, IsStringLiteral as IsStringLiteral$1, IsLiteral } from 'type-fest';
2
- import { L as LikeC4Model } from '../shared/core.CiFKryGW.mjs';
2
+ import { L as LikeC4Model } from '../shared/core.CQDU11hR.mjs';
3
3
  import { D as DeploymentElement, i as DeploymentRelation, q as Element, ah as ModelRelation, a9 as Participant, M as ModelLayer, bs as ViewRuleStyle, aT as AutoLayoutDirection, y as ExpressionV2, L as LikeC4View, b0 as DeploymentView, bd as ElementView, t as ElementShape, ap as Color, p as BorderStyle, av as ShapeSize, aw as SpacingSize, ax as TextSize, aj as RelationshipArrowType, am as RelationshipLineType, r as ElementKindSpecification, al as RelationshipKindSpecification, g as DeploymentNodeKindSpecification, V as ParsedLikeC4ModelData } from '../shared/core.DJvmfnEi.mjs';
4
4
  import { F as Fqn, N as NonEmptyArray, K as KeysOf } from '../shared/core.SjLhMA7a.mjs';
5
5
  import { IsStringLiteral } from 'type-fest/source/is-literal';
@@ -1,4 +1,4 @@
1
- import { a as i, l, d, L as LikeC4Model } from '../shared/core.CAcZ6_cP.mjs';
1
+ import { a as i, l, d, L as LikeC4Model } from '../shared/core.Bq753SYD.mjs';
2
2
  import { m, l as l$1, i as i$1 } from '../shared/core.Cu-UdkSl.mjs';
3
3
  import { f as t, n as nameFromFqn, g as isSameHierarchy, p as parentFqn, h as t$1 } from '../shared/core.CQXU9DF7.mjs';
4
4
  import { o, M as ModelLayer, D as DefaultElementShape, b as DefaultThemeColor, n as n$1, c as DeploymentElement, d as isScopedElementView } from '../shared/core.DgfwjBtu.mjs';
@@ -1,4 +1,4 @@
1
- export { C as ComputeViewResult, c as computeView, a as computeViews, u as unsafeComputeView } from '../shared/core.CiFKryGW.mjs';
1
+ export { C as ComputeViewResult, c as computeView, a as computeViews, u as unsafeComputeView } from '../shared/core.CQDU11hR.mjs';
2
2
  import { L as LikeC4View, C as ComputedLikeC4ModelData, a as ComputedView } from '../shared/core.DJvmfnEi.mjs';
3
3
  import 'type-fest';
4
4
  import '../shared/core.SjLhMA7a.mjs';
@@ -1,5 +1,5 @@
1
- import { G as Graph, r, w as willCreateCycle, t as topologicalSortExports, i as i$1, a as i$2, l } from '../shared/core.CAcZ6_cP.mjs';
2
- export { c as computeView, b as computeViews, u as unsafeComputeView } from '../shared/core.CAcZ6_cP.mjs';
1
+ import { G as Graph, r, w as willCreateCycle, t as topologicalSortExports, i as i$1, a as i$2, l } from '../shared/core.Bq753SYD.mjs';
2
+ export { c as computeView, b as computeViews, u as unsafeComputeView } from '../shared/core.Bq753SYD.mjs';
3
3
  import { i as isExtendsElementView, a as isElementView } from '../shared/core.DgfwjBtu.mjs';
4
4
  import { e as isNonEmptyArray } from '../shared/core.CQXU9DF7.mjs';
5
5
  import { i, m } from '../shared/core.Cu-UdkSl.mjs';
@@ -1,4 +1,4 @@
1
- import { A as AnyAux, E as ElementModel, R as RelationshipModel, L as LikeC4Model } from '../../shared/core.CiFKryGW.mjs';
1
+ import { A as AnyAux, E as ElementModel, R as RelationshipModel, L as LikeC4Model } from '../../shared/core.CQDU11hR.mjs';
2
2
  import 'type-fest';
3
3
  import '../../shared/core.SjLhMA7a.mjs';
4
4
  import '../../shared/core.DJvmfnEi.mjs';
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { H as HexColorLiteral, T as ThemeColorValues, b as LikeC4Theme } from './shared/core.DJvmfnEi.mjs';
2
2
  export { ag as AbstractRelation, a1 as AllNever, a2 as AndOperator, O as AnyParsedLikeC4ModelData, aT as AutoLayoutDirection, aW as BBox, aU as BasicElementView, aV as BasicView, p as BorderStyle, B as BorderStyles, ap as Color, aq as ColorLiteral, aX as ComputedDeploymentView, aY as ComputedDynamicView, aZ as ComputedEdge, a_ as ComputedElementView, C as ComputedLikeC4ModelData, az as ComputedNode, a as ComputedView, a$ as CustomColorDefinitions, ad as DefaultArrowType, j as DefaultElementShape, ae as DefaultLineStyle, k as DefaultPaddingSize, af as DefaultRelationshipColor, l as DefaultShapeSize, m as DefaultTextSize, n as DefaultThemeColor, c as DeployedInstance, D as DeploymentElement, d as DeploymentElementStyle, e as DeploymentNode, f as DeploymentNodeKind, g as DeploymentNodeKindSpecification, h as DeploymentRef, i as DeploymentRelation, b0 as DeploymentView, b1 as DeploymentViewRule, b2 as DeploymentViewRulePredicate, b3 as DeploymentViewRuleStyle, b4 as DiagramEdge, aA as DiagramNode, b5 as DiagramView, b6 as DynamicView, b7 as DynamicViewIncludeRule, b8 as DynamicViewParallelSteps, b9 as DynamicViewRule, ba as DynamicViewStep, bb as DynamicViewStepOrParallel, bc as EdgeId, q as Element, E as ElementKind, r as ElementKindSpecification, s as ElementKindSpecificationStyle, bw as ElementNotation, t as ElementShape, o as ElementShapes, u as ElementStyle, as as ElementThemeColorValues, ar as ElementThemeColors, bd as ElementView, a3 as EqualOperator, y as ExpressionV2, be as ExtendsElementView, a4 as Filterable, F as FqnExpr, z as FqnRef, Q as GenericLikeC4ModelData, G as GlobalDynamicPredicates, A as GlobalPredicateId, I as GlobalPredicates, J as GlobalStyleID, K as GlobalStyles, a5 as KindEqual, S as LayoutedLikeC4ModelData, U as LikeC4ModelDump, L as LikeC4View, v as Link, N as ModelGlobals, M as ModelLayer, ah as ModelRelation, bf as NodeId, a6 as NotOperator, a7 as OperatorPredicate, a8 as OrOperator, V as ParsedLikeC4ModelData, a9 as Participant, aa as ParticipantOperator, P as PredicateSelector, R as RelationExpr, ai as RelationId, aj as RelationshipArrowType, ak as RelationshipKind, al as RelationshipKindSpecification, am as RelationshipLineType, au as RelationshipThemeColorValues, at as RelationshipThemeColors, bg as ScopedElementView, av as ShapeSize, aw as SpacingSize, bh as StepEdgeId, bi as StepEdgeIdLiteral, ab as TagEqual, w as TagSpec, ax as TextSize, ay as ThemeColor, ao as ThemeColors, x as TypedElement, bj as ViewAutoLayout, bk as ViewId, bl as ViewManualLayout, bm as ViewRule, bn as ViewRuleAutoLayout, bo as ViewRuleGlobalPredicateRef, bp as ViewRuleGlobalStyle, bq as ViewRuleGroup, br as ViewRulePredicate, bs as ViewRuleStyle, bt as ViewRuleStyleOrGlobalRef, bu as ViewWithHash, bv as ViewWithNotation, ac as WhereOperator, aB as extractStep, aC as getBBoxCenter, aD as getParallelStepsPrefix, W as isAndOperator, aE as isAutoLayoutDirection, aF as isDeploymentView, aG as isDynamicView, aH as isDynamicViewParallelSteps, aI as isElementView, aJ as isExtendsElementView, X as isKindEqual, Y as isNotOperator, Z as isOrOperator, _ as isParticipantOperator, aK as isScopedElementView, aL as isStepEdgeId, $ as isTagEqual, an as isThemeColor, aM as isViewRuleAutoLayout, aN as isViewRuleGlobalPredicateRef, aO as isViewRuleGlobalStyle, aP as isViewRuleGroup, aQ as isViewRulePredicate, aR as isViewRuleStyle, aS as stepEdgeId, a0 as whereOperatorAsPredicate } from './shared/core.DJvmfnEi.mjs';
3
3
  export { BiMap, DefaultMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, commonHead, compareNatural, compareRelations, delay, difference, equalsSet, getOrCreate, hasAtLeast, ifilter, ifind, iflat, imap, intersection, ireduce, isIterable, isNonEmptyArray, isString, isome, iunique, objectHash, stringHash, symmetricDifference, toArray, toSet, union } from './utils/index.mjs';
4
- export { A as AnyAux, b as Aux, C as ComputeViewResult, D as DeployedInstanceModel, d as DeploymentElementModel, e as DeploymentNodeModel, f as DeploymentRelationModel, g as EdgeModel, E as ElementModel, h as LikeC4DeploymentModel, L as LikeC4Model, i as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, c as computeView, a as computeViews, u as unsafeComputeView } from './shared/core.CiFKryGW.mjs';
5
- export { C as Connection, a as ConnectionModel, D as DeploymentConnectionModel } from './shared/core.CZR9J1Qx.mjs';
4
+ export { A as AnyAux, b as Aux, C as ComputeViewResult, D as DeployedInstanceModel, d as DeploymentElementModel, e as DeploymentNodeModel, f as DeploymentRelationModel, g as EdgeModel, E as ElementModel, h as LikeC4DeploymentModel, L as LikeC4Model, i as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, c as computeView, a as computeViews, u as unsafeComputeView } from './shared/core.CQDU11hR.mjs';
5
+ export { C as Connection, a as ConnectionModel, D as DeploymentConnectionModel } from './shared/core.Dx7siloV.mjs';
6
6
  export { A as AsFqn, C as CustomColor, E as ExclusiveUnion, F as Fqn, G as GlobalFqn, d as IconUrl, I as IteratorLike, K as KeysOf, b as NTuple, N as NonEmptyArray, a as NonEmptyReadonlyArray, P as Point, c as Predicate, e as ProjectId, T as Tag, X as XYPoint, i as isGlobalFqn, s as splitGlobalFqn } from './shared/core.SjLhMA7a.mjs';
7
7
  export { OverviewGraph, ViewChange } from './types/index.mjs';
8
8
  export { I as IterableContainer, R as ReorderedArray, a as ancestorsFqn, c as commonAncestor, b as compareByFqnHierarchically, d as compareFqnHierarchically, h as hierarchyDistance, e as hierarchyLevel, i as isAncestor, f as isDescendantOf, g as isSameHierarchy, n as nameFromFqn, p as parentFqn, s as sortByFqnHierarchically, j as sortNaturalByFqn, k as sortParentsFirst } from './shared/core.D2830qgg.mjs';
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { i as invariant, n as nonNullable, a as nonexhaustive } from './shared/core.C-YXI-43.mjs';
2
- export { C as Connection, e as ConnectionModel, D as DeployedInstanceModel, f as DeploymentConnectionModel, g as DeploymentNodeModel, h as DeploymentRelationModel, E as EdgeModel, j as ElementModel, k as LikeC4DeploymentModel, L as LikeC4Model, m as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, c as computeView, b as computeViews, u as unsafeComputeView } from './shared/core.CAcZ6_cP.mjs';
2
+ export { C as Connection, e as ConnectionModel, D as DeployedInstanceModel, f as DeploymentConnectionModel, g as DeploymentNodeModel, h as DeploymentRelationModel, E as EdgeModel, j as ElementModel, k as LikeC4DeploymentModel, L as LikeC4Model, m as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, c as computeView, b as computeViews, u as unsafeComputeView } from './shared/core.Bq753SYD.mjs';
3
3
  export { A as AsFqn, B as BorderStyles, C as ComputedNode, z as ComputedView, v as DefaultArrowType, D as DefaultElementShape, x as DefaultLineStyle, f as DefaultPaddingSize, y as DefaultRelationshipColor, g as DefaultShapeSize, h as DefaultTextSize, b as DefaultThemeColor, c as DeploymentElement, H as DiagramNode, E as ElementKind, j as ElementShapes, k as ExpressionV2, F as FqnExpr, l as FqnRef, G as GlobalFqn, M as ModelLayer, R as RelationExpr, I as extractStep, J as getBBoxCenter, K as getParallelStepsPrefix, m as isAndOperator, L as isAutoLayoutDirection, N as isDeploymentView, O as isDynamicView, P as isDynamicViewParallelSteps, a as isElementView, i as isExtendsElementView, e as isGlobalFqn, p as isKindEqual, q as isNotOperator, r as isOrOperator, t as isParticipantOperator, d as isScopedElementView, Q as isStepEdgeId, u as isTagEqual, S as isViewRuleAutoLayout, T as isViewRuleGlobalPredicateRef, U as isViewRuleGlobalStyle, V as isViewRuleGroup, W as isViewRulePredicate, X as isViewRuleStyle, s as splitGlobalFqn, Y as stepEdgeId, w as whereOperatorAsPredicate } from './shared/core.DgfwjBtu.mjs';
4
4
  export { ThemeColors, isThemeColor } from './types/index.mjs';
5
5
  export { BiMap, DefaultWeakMap, LinkedList, MultiMap, Queue, compareRelations, delay, ireduce } from './utils/index.mjs';
@@ -3488,6 +3488,7 @@ function generateColorsMap(color) {
3488
3488
  const saturationDelta = SATURATION_MAP[i] - SATURATION_MAP[baseColorIndex];
3489
3489
  return saturationDelta >= 0 ? c.saturate(saturationDelta) : c.desaturate(saturationDelta * -1);
3490
3490
  });
3491
+ colors[baseColorIndex] = chroma(color);
3491
3492
  return { baseColorIndex, colors };
3492
3493
  }
3493
3494
  function generateColors(color) {
@@ -1,6 +1,6 @@
1
- import { A as AnyAux, d as DeploymentElementModel, E as ElementModel, D as DeployedInstanceModel, e as DeploymentNodeModel } from '../shared/core.CiFKryGW.mjs';
2
- export { b as Aux, f as DeploymentRelationModel, g as EdgeModel, h as LikeC4DeploymentModel, L as LikeC4Model, i as LikeC4ViewModel, N as NodeModel, R as RelationshipModel } from '../shared/core.CiFKryGW.mjs';
3
- import { C as Connection, D as DeploymentConnectionModel, a as ConnectionModel } from '../shared/core.CZR9J1Qx.mjs';
1
+ import { A as AnyAux, d as DeploymentElementModel, E as ElementModel, D as DeployedInstanceModel, e as DeploymentNodeModel } from '../shared/core.CQDU11hR.mjs';
2
+ export { b as Aux, f as DeploymentRelationModel, g as EdgeModel, h as LikeC4DeploymentModel, L as LikeC4Model, i as LikeC4ViewModel, N as NodeModel, R as RelationshipModel } from '../shared/core.CQDU11hR.mjs';
3
+ import { C as Connection, D as DeploymentConnectionModel, a as ConnectionModel } from '../shared/core.Dx7siloV.mjs';
4
4
  import { I as IterableContainer, R as ReorderedArray } from '../shared/core.D2830qgg.mjs';
5
5
  import 'type-fest';
6
6
  import '../shared/core.SjLhMA7a.mjs';
@@ -1 +1 @@
1
- export { C as Connection, e as ConnectionModel, D as DeployedInstanceModel, f as DeploymentConnectionModel, g as DeploymentNodeModel, h as DeploymentRelationModel, E as EdgeModel, j as ElementModel, k as LikeC4DeploymentModel, L as LikeC4Model, m as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, n as deploymentConnection, o as differenceConnections, p as findAscendingConnections, q as findDeepestNestedConnection, s as findDescendantConnections, v as hasSameSource, x as hasSameSourceTarget, y as hasSameTarget, z as isAnyInOut, M as isDeployedInstance, O as isDeploymentNode, A as isIncoming, B as isNestedConnection, F as isOutgoing, H as mergeConnections, I as modelConnection, J as sortConnectionsByBoundaryHierarchy, K as sortDeepestFirst } from '../shared/core.CAcZ6_cP.mjs';
1
+ export { C as Connection, e as ConnectionModel, D as DeployedInstanceModel, f as DeploymentConnectionModel, g as DeploymentNodeModel, h as DeploymentRelationModel, E as EdgeModel, j as ElementModel, k as LikeC4DeploymentModel, L as LikeC4Model, m as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, n as deploymentConnection, o as differenceConnections, p as findAscendingConnections, q as findDeepestNestedConnection, s as findDescendantConnections, v as hasSameSource, x as hasSameSourceTarget, y as hasSameTarget, z as isAnyInOut, M as isDeployedInstance, O as isDeploymentNode, A as isIncoming, B as isNestedConnection, F as isOutgoing, H as mergeConnections, I as modelConnection, J as sortConnectionsByBoundaryHierarchy, K as sortDeepestFirst } from '../shared/core.Bq753SYD.mjs';
@@ -265,6 +265,12 @@ class ElementModel {
265
265
  deployments() {
266
266
  return this.$model.deployment.instancesOf(this);
267
267
  }
268
+ getMetadata(field) {
269
+ if (field) {
270
+ return this.$element.metadata?.[field];
271
+ }
272
+ return this.$element.metadata ?? {};
273
+ }
268
274
  }
269
275
  function isElementModel(element) {
270
276
  return element instanceof ElementModel;
@@ -1686,6 +1692,12 @@ class AbstractDeploymentElementModel {
1686
1692
  );
1687
1693
  return this.cachedIncoming;
1688
1694
  }
1695
+ getMetadata(field) {
1696
+ if (field) {
1697
+ return this.$node.metadata?.[field];
1698
+ }
1699
+ return this.$node.metadata ?? {};
1700
+ }
1689
1701
  }
1690
1702
  class DeploymentNodeModel extends AbstractDeploymentElementModel {
1691
1703
  constructor($model, $node) {
@@ -1968,6 +1980,12 @@ class DeploymentRelationModel {
1968
1980
  isDeploymentRelation() {
1969
1981
  return true;
1970
1982
  }
1983
+ getMetadata(field) {
1984
+ if (field) {
1985
+ return this.$relationship.metadata?.[field];
1986
+ }
1987
+ return this.$relationship.metadata ?? {};
1988
+ }
1971
1989
  }
1972
1990
  class RelationshipsAccum {
1973
1991
  /**
@@ -6795,6 +6813,12 @@ class RelationshipModel {
6795
6813
  isDeploymentRelation() {
6796
6814
  return false;
6797
6815
  }
6816
+ getMetadata(field) {
6817
+ if (field) {
6818
+ return this.$relationship.metadata?.[field];
6819
+ }
6820
+ return this.$relationship.metadata ?? {};
6821
+ }
6798
6822
  }
6799
6823
 
6800
6824
  class EdgeModel {
@@ -254,6 +254,8 @@ declare class RelationshipModel<M extends AnyAux = AnyAux> {
254
254
  */
255
255
  views(): ViewsIterator<M>;
256
256
  isDeploymentRelation(): this is DeploymentRelationModel<M>;
257
+ getMetadata(): Record<string, string>;
258
+ getMetadata(field: string): string | undefined;
257
259
  }
258
260
 
259
261
  declare class LikeC4Model<M extends AnyAux = LikeC4Model.Any> {
@@ -533,6 +535,8 @@ declare abstract class AbstractDeploymentElementModel<M extends AnyAux = AnyAux>
533
535
  protected cachedIncoming: RelationshipsAccum<M> | null;
534
536
  get allOutgoing(): RelationshipsAccum<M>;
535
537
  get allIncoming(): RelationshipsAccum<M>;
538
+ getMetadata(): Record<string, string>;
539
+ getMetadata(field: string): string | undefined;
536
540
  }
537
541
  declare class DeploymentNodeModel<M extends AnyAux = AnyAux> extends AbstractDeploymentElementModel<M> {
538
542
  readonly $model: LikeC4DeploymentModel<M>;
@@ -635,6 +639,8 @@ declare class DeploymentRelationModel<M extends AnyAux = AnyAux> {
635
639
  get line(): RelationshipLineType;
636
640
  views(): IteratorLike<LikeC4ViewModel<M, ComputedDeploymentView>>;
637
641
  isDeploymentRelation(): this is DeploymentRelationModel<M>;
642
+ getMetadata(): Record<string, string>;
643
+ getMetadata(field: string): string | undefined;
638
644
  }
639
645
  declare class RelationshipsAccum<M extends AnyAux> {
640
646
  readonly model: ReadonlySet<RelationshipModel<M>>;
@@ -740,6 +746,8 @@ declare class ElementModel<M extends AnyAux = AnyAux> {
740
746
  */
741
747
  isDeployed(): boolean;
742
748
  deployments(): DeployedInstancesIterator<M>;
749
+ getMetadata(): Record<string, string>;
750
+ getMetadata(field: string): string | undefined;
743
751
  }
744
752
 
745
753
  export { type AnyAux as A, type ComputeViewResult as C, DeployedInstanceModel as D, ElementModel as E, LikeC4Model as L, NodeModel as N, RelationshipModel as R, computeViews as a, Aux as b, computeView as c, type DeploymentElementModel as d, DeploymentNodeModel as e, DeploymentRelationModel as f, EdgeModel as g, LikeC4DeploymentModel as h, LikeC4ViewModel as i, RelationshipsAccum as j, unsafeComputeView as u };
@@ -1,4 +1,4 @@
1
- import { E as ElementModel, d as DeploymentElementModel, A as AnyAux, e as DeploymentNodeModel, D as DeployedInstanceModel, j as RelationshipsAccum, R as RelationshipModel, f as DeploymentRelationModel } from './core.CiFKryGW.mjs';
1
+ import { E as ElementModel, d as DeploymentElementModel, A as AnyAux, e as DeploymentNodeModel, D as DeployedInstanceModel, j as RelationshipsAccum, R as RelationshipModel, f as DeploymentRelationModel } from './core.CQDU11hR.mjs';
2
2
  import { F as Fqn, I as IteratorLike } from './core.SjLhMA7a.mjs';
3
3
 
4
4
  interface Connection<Elem = ElementModel | DeploymentElementModel, Id = string> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "1.29.1",
3
+ "version": "1.31.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -77,23 +77,24 @@
77
77
  "default": "./dist/types/index.mjs"
78
78
  }
79
79
  },
80
- "./src": "./src/index.ts"
80
+ "./src": "./src/index.ts",
81
+ "./package.json": "./package.json"
81
82
  },
82
83
  "publishConfig": {
83
84
  "registry": "https://registry.npmjs.org",
84
85
  "access": "public"
85
86
  },
86
87
  "dependencies": {
87
- "type-fest": "^4.39.1"
88
+ "type-fest": "^4.40.0"
88
89
  },
89
90
  "devDependencies": {
90
91
  "@dagrejs/dagre": "1.1.4",
91
- "@mantine/colors-generator": "7.17.4",
92
+ "@mantine/colors-generator": "8.0.1",
92
93
  "@types/natural-compare-lite": "^1.4.2",
93
94
  "@types/object-hash": "^3.0.6",
94
95
  "chroma-js": "^3.1.2",
95
96
  "defu": "^6.1.4",
96
- "fdir": "^6.4.3",
97
+ "fdir": "^6.4.4",
97
98
  "graphology": "^0.25.4",
98
99
  "graphology-dag": "^0.4.1",
99
100
  "graphology-types": "^0.24.8",
@@ -101,15 +102,15 @@
101
102
  "natural-compare-lite": "^1.4.0",
102
103
  "object-hash": "^3.0.0",
103
104
  "obliterator": "^2.0.5",
104
- "remeda": "^2.21.2",
105
- "turbo": "^2.5.0",
105
+ "remeda": "^2.21.3",
106
+ "turbo": "^2.5.2",
106
107
  "typescript": "^5.8.3",
107
108
  "unbuild": "^3.5.0",
108
- "vitest": "^3.1.1",
109
- "@likec4/tsconfig": "1.29.1"
109
+ "vitest": "^3.1.2",
110
+ "@likec4/tsconfig": "1.31.0"
110
111
  },
111
112
  "scripts": {
112
- "typecheck": "tsc --noEmit",
113
+ "typecheck": "tsc -b --verbose",
113
114
  "build": "unbuild",
114
115
  "lint": "run -T eslint src/ --fix",
115
116
  "test": "vitest run --no-isolate",
@@ -211,6 +211,15 @@ abstract class AbstractDeploymentElementModel<M extends AnyAux = AnyAux> {
211
211
  )
212
212
  return this.cachedIncoming
213
213
  }
214
+
215
+ public getMetadata(): Record<string, string>
216
+ public getMetadata(field: string): string | undefined
217
+ public getMetadata(field?: string) {
218
+ if (field) {
219
+ return this.$node.metadata?.[field]
220
+ }
221
+ return this.$node.metadata ?? {}
222
+ }
214
223
  }
215
224
 
216
225
  export class DeploymentNodeModel<M extends AnyAux = AnyAux> extends AbstractDeploymentElementModel<M> {
@@ -560,6 +569,15 @@ export class DeploymentRelationModel<M extends AnyAux = AnyAux> {
560
569
  public isDeploymentRelation(): this is DeploymentRelationModel<M> {
561
570
  return true
562
571
  }
572
+
573
+ public getMetadata(): Record<string, string>
574
+ public getMetadata(field: string): string | undefined
575
+ public getMetadata(field?: string) {
576
+ if (field) {
577
+ return this.$relationship.metadata?.[field]
578
+ }
579
+ return this.$relationship.metadata ?? {}
580
+ }
563
581
  }
564
582
 
565
583
  export class RelationshipsAccum<M extends AnyAux> {
@@ -8,9 +8,9 @@ import {
8
8
  type ElementStyle,
9
9
  type Link,
10
10
  DefaultElementShape,
11
+ DefaultShapeSize,
11
12
  DefaultThemeColor,
12
13
  } from '../types/element'
13
- import { DefaultShapeSize } from '../types/element'
14
14
  import {
15
15
  type IconUrl,
16
16
  type ProjectId,
@@ -258,6 +258,15 @@ export class ElementModel<M extends AnyAux = AnyAux> {
258
258
  public deployments(): DeployedInstancesIterator<M> {
259
259
  return this.$model.deployment.instancesOf(this)
260
260
  }
261
+
262
+ public getMetadata(): Record<string, string>
263
+ public getMetadata(field: string): string | undefined
264
+ public getMetadata(field?: string) {
265
+ if (field) {
266
+ return this.$element.metadata?.[field]
267
+ }
268
+ return this.$element.metadata ?? {}
269
+ }
261
270
  }
262
271
 
263
272
  export function isElementModel<M extends AnyAux = AnyAux>(element: any): element is ElementModel<M> {
@@ -106,4 +106,13 @@ export class RelationshipModel<M extends AnyAux = AnyAux> {
106
106
  public isDeploymentRelation(): this is DeploymentRelationModel<M> {
107
107
  return false
108
108
  }
109
+
110
+ public getMetadata(): Record<string, string>
111
+ public getMetadata(field: string): string | undefined
112
+ public getMetadata(field?: string) {
113
+ if (field) {
114
+ return this.$relationship.metadata?.[field]
115
+ }
116
+ return this.$relationship.metadata ?? {}
117
+ }
109
118
  }