@likec4/core 1.32.2 → 1.34.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.
Files changed (113) hide show
  1. package/dist/builder/index.d.mts +6 -4
  2. package/dist/builder/index.mjs +45 -13
  3. package/dist/compute-view/index.d.mts +6 -4
  4. package/dist/compute-view/index.mjs +33 -10
  5. package/dist/compute-view/relationships-view/index.d.mts +6 -4
  6. package/dist/compute-view/relationships-view/index.mjs +6 -3
  7. package/dist/index.d.mts +9 -138
  8. package/dist/index.mjs +31 -3712
  9. package/dist/model/connection/deployment/index.d.mts +10 -0
  10. package/dist/model/connection/deployment/index.mjs +18 -0
  11. package/dist/model/connection/index.d.mts +70 -0
  12. package/dist/model/connection/index.mjs +23 -0
  13. package/dist/model/connection/model/index.d.mts +10 -0
  14. package/dist/model/connection/model/index.mjs +11 -0
  15. package/dist/model/index.d.mts +14 -256
  16. package/dist/model/index.mjs +27 -5
  17. package/dist/shared/{core.cbA9VZ02.mjs → core.4SpVCM9m.mjs} +31 -1073
  18. package/dist/shared/{core.BuO4ncfY.d.mts → core.668kXpZq.d.mts} +42 -52
  19. package/dist/shared/core.8KM0D6va.mjs +33 -0
  20. package/dist/shared/core.B0oEIXqd.mjs +47 -0
  21. package/dist/shared/core.BH9nN-_I.mjs +22 -0
  22. package/dist/shared/core.BMCb0wJI.mjs +177 -0
  23. package/dist/shared/core.BTnf14gD.mjs +331 -0
  24. package/dist/shared/core.BgvIuGGU.mjs +3 -0
  25. package/dist/shared/core.BoyJPEen.mjs +21 -0
  26. package/dist/shared/{core.CUYDgv2-.mjs → core.Br7Fab9l.mjs} +12 -15
  27. package/dist/shared/{core.BrCnZFTn.mjs → core.Btl47GOn.mjs} +3 -3
  28. package/dist/shared/core.ByrmCl9I.mjs +5 -0
  29. package/dist/shared/core.C80Z37Eu.mjs +29 -0
  30. package/dist/shared/{core.Pf5I9o0e.d.mts → core.CF82MWyh.d.mts} +1 -1
  31. package/dist/shared/core.CJSFKrYf.d.mts +83 -0
  32. package/dist/shared/{core.rmvsy0n3.mjs → core.C_C-3c1S.mjs} +5 -198
  33. package/dist/shared/{core.DoK86JEe.mjs → core.CpwrZi3D.mjs} +2 -73
  34. package/dist/shared/{core.CpXlRyE5.mjs → core.CtKXPqN_.mjs} +5 -36
  35. package/dist/shared/core.CxGKeL-L.mjs +144 -0
  36. package/dist/shared/core.CzdwsPmY.d.mts +69 -0
  37. package/dist/shared/core.D3xEWj5B.d.mts +41 -0
  38. package/dist/shared/{core.Cy9smucx.mjs → core.D4npX2q8.mjs} +1 -3
  39. package/dist/shared/core.D56nCp7e.mjs +168 -0
  40. package/dist/shared/core.D5qVzkws.mjs +724 -0
  41. package/dist/shared/{core.CBxTtXMi.d.mts → core.DAj3LuFH.d.mts} +58 -57
  42. package/dist/shared/{core.Bk7wEZFG.mjs → core.DXRAwwDB.mjs} +3 -2
  43. package/dist/shared/core.DcS-0zys.mjs +10 -0
  44. package/dist/shared/core.Di7__sMg.d.mts +87 -0
  45. package/dist/shared/{core.DaAyklhe.d.mts → core.DrS4Bf4y.d.mts} +31 -22
  46. package/dist/shared/core.DsMrjY2q.mjs +34 -0
  47. package/dist/shared/core.DuSLYTG6.d.mts +57 -0
  48. package/dist/shared/{core.Bdz6fBF1.d.mts → core.IWLie-Ma.d.mts} +92 -81
  49. package/dist/shared/{core.CBpKAlhj.mjs → core.PqNe5WxQ.mjs} +96 -56
  50. package/dist/shared/core.XptQjhMA.mjs +1295 -0
  51. package/dist/shared/core.zLlww-07.mjs +3 -0
  52. package/dist/theme/index.d.mts +134 -0
  53. package/dist/theme/index.mjs +3709 -0
  54. package/dist/types/_aux.d.mts +4 -0
  55. package/dist/types/index.d.mts +9 -5
  56. package/dist/types/index.mjs +17 -146
  57. package/dist/utils/index.d.mts +15 -100
  58. package/dist/utils/index.mjs +25 -1315
  59. package/dist/utils/iterable/index.d.mts +100 -0
  60. package/dist/utils/iterable/index.mjs +24 -0
  61. package/package.json +29 -13
  62. package/src/builder/Builder.ts +13 -4
  63. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -13
  64. package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +2 -6
  65. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -7
  66. package/src/compute-view/deployment-view/__test__/fixture.ts +15 -5
  67. package/src/compute-view/deployment-view/utils.ts +13 -13
  68. package/src/compute-view/dynamic-view/compute.ts +2 -1
  69. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +2 -2
  70. package/src/compute-view/relationships-view/layout.ts +1 -1
  71. package/src/compute-view/utils/applyCustomElementProperties.ts +8 -0
  72. package/src/compute-view/utils/applyCustomRelationProperties.ts +2 -0
  73. package/src/compute-view/utils/buildComputedNodes.ts +4 -3
  74. package/src/compute-view/utils/merge-props-from-relationships.ts +6 -5
  75. package/src/compute-view/utils/view-hash.ts +24 -3
  76. package/src/model/DeploymentElementModel.ts +21 -17
  77. package/src/model/DeploymentModel.ts +1 -1
  78. package/src/model/ElementModel.ts +15 -5
  79. package/src/model/LikeC4Model.ts +1 -1
  80. package/src/model/RelationModel.ts +20 -17
  81. package/src/model/index.ts +2 -0
  82. package/src/model/types.ts +2 -1
  83. package/src/model/view/EdgeModel.ts +4 -3
  84. package/src/model/view/LikeC4ViewModel.ts +6 -1
  85. package/src/model/view/NodeModel.ts +5 -3
  86. package/src/theme/index.ts +12 -5
  87. package/src/types/RichText.ts +200 -0
  88. package/src/types/expression-model.ts +2 -2
  89. package/src/types/expression.ts +2 -2
  90. package/src/types/fqnRef.ts +2 -2
  91. package/src/types/global.ts +1 -1
  92. package/src/types/index.ts +4 -2
  93. package/src/types/model-data.ts +2 -2
  94. package/src/types/model-deployment.ts +6 -5
  95. package/src/types/model-dump.ts +1 -1
  96. package/src/types/model-logical.ts +5 -5
  97. package/src/types/model-spec.ts +2 -2
  98. package/src/types/operators.ts +2 -2
  99. package/src/types/scalar.ts +47 -2
  100. package/src/types/view-common.ts +3 -3
  101. package/src/types/view-computed.ts +4 -6
  102. package/src/types/view-layouted.ts +11 -2
  103. package/src/types/view-parsed.deployment.ts +1 -1
  104. package/src/types/view-parsed.dynamic.ts +2 -2
  105. package/src/types/view-parsed.element.ts +2 -2
  106. package/src/types/view.ts +2 -2
  107. package/src/utils/index.ts +4 -9
  108. package/src/utils/markdown/index.ts +2 -0
  109. package/src/utils/markdown/to-html.ts +32 -0
  110. package/src/utils/markdown/to-text.ts +14 -0
  111. package/dist/types/aux.d.mts +0 -3
  112. /package/dist/types/{aux.mjs → _aux.mjs} +0 -0
  113. /package/src/types/{aux.ts → _aux.ts} +0 -0
@@ -0,0 +1,10 @@
1
+ export { C as Connection } from '../../../shared/core.D3xEWj5B.mjs';
2
+ export { D as DeploymentConnectionModel, a as findConnection, b as findConnectionsBetween, c as findConnectionsWithin } from '../../../shared/core.Di7__sMg.mjs';
3
+ import '../../../shared/core.DrS4Bf4y.mjs';
4
+ import '../../../shared/core.DAj3LuFH.mjs';
5
+ import 'type-fest';
6
+ import '../../../shared/core.DuSLYTG6.mjs';
7
+ import '../../../shared/core.668kXpZq.mjs';
8
+ import '../../../shared/core.CywrQs86.mjs';
9
+ import '../../../shared/core.IWLie-Ma.mjs';
10
+ import '../../../shared/core.CzdwsPmY.mjs';
@@ -0,0 +1,18 @@
1
+ export { C as Connection } from '../../../shared/core.C80Z37Eu.mjs';
2
+ export { D as DeploymentConnectionModel, f as findConnection, a as findConnectionsBetween, b as findConnectionsWithin } from '../../../shared/core.D5qVzkws.mjs';
3
+ import '../../../shared/core.C_C-3c1S.mjs';
4
+ import '../../../shared/core.zLlww-07.mjs';
5
+ import '../../../shared/core.CpwrZi3D.mjs';
6
+ import '../../../shared/core.DbRvwARP.mjs';
7
+ import '../../../shared/core.D4npX2q8.mjs';
8
+ import '../../../shared/core.D56nCp7e.mjs';
9
+ import '../../../shared/core.B0oEIXqd.mjs';
10
+ import 'rehype-raw';
11
+ import 'rehype-sanitize';
12
+ import 'rehype-stringify';
13
+ import 'remark-gfm';
14
+ import 'remark-parse';
15
+ import 'remark-rehype';
16
+ import 'unified';
17
+ import 'mdast-util-from-markdown';
18
+ import 'mdast-util-to-string';
@@ -0,0 +1,70 @@
1
+ import { C as Connection } from '../../shared/core.D3xEWj5B.mjs';
2
+ export { D as DeploymentConnectionModel, f as deployment } from '../../shared/core.Di7__sMg.mjs';
3
+ export { C as ConnectionModel, f as model } from '../../shared/core.CJSFKrYf.mjs';
4
+ import { I as IterableContainer, R as ReorderedArray } from '../../shared/core.CF82MWyh.mjs';
5
+ import '../../shared/core.DrS4Bf4y.mjs';
6
+ import '../../shared/core.DAj3LuFH.mjs';
7
+ import 'type-fest';
8
+ import '../../shared/core.DuSLYTG6.mjs';
9
+ import '../../shared/core.668kXpZq.mjs';
10
+ import '../../shared/core.CywrQs86.mjs';
11
+ import '../../shared/core.IWLie-Ma.mjs';
12
+ import '../../shared/core.CzdwsPmY.mjs';
13
+
14
+ /**
15
+ * Check if connection is nested inside another connection
16
+ * (i.e. between descendants)
17
+ */
18
+ declare function isNestedConnection<T extends {
19
+ id: string;
20
+ }>(parent: WithSourceTarget<NoInfer<T>>): (nested: WithSourceTarget<T>) => boolean;
21
+ declare function isNestedConnection<T extends {
22
+ id: string;
23
+ }>(nested: WithSourceTarget<T>, parent: WithSourceTarget<T>): boolean;
24
+ type ConnectionElemId = Connection<{
25
+ readonly id: string;
26
+ }, any>;
27
+ declare function findDeepestNestedConnection<C extends ConnectionElemId>(connections: ReadonlyArray<C>, connection: C): C | null;
28
+ declare function sortDeepestFirst<C extends ConnectionElemId>(connections: ReadonlyArray<C>): C[];
29
+ type WithBoundary = {
30
+ boundary: null | {
31
+ id: string;
32
+ };
33
+ };
34
+ declare function sortConnectionsByBoundaryHierarchy(sort?: 'asc' | 'desc'): <T extends WithBoundary, A extends IterableContainer<T>>(array: A) => ReorderedArray<A>;
35
+ declare function sortConnectionsByBoundaryHierarchy<T extends WithBoundary, A extends IterableContainer<T>>(array: A, sort?: 'asc' | 'desc'): ReorderedArray<A>;
36
+ /**
37
+ * Find connections that includes given connection (i.e between it's ancestors)
38
+ */
39
+ declare function findAscendingConnections<C extends ConnectionElemId>(connections: ReadonlyArray<C>, connection: C): Array<C>;
40
+ /**
41
+ * Find connections that includes given connection (i.e between it's descendants)
42
+ */
43
+ declare function findDescendantConnections<C extends ConnectionElemId>(connections: ReadonlyArray<C>, connection: C): Array<C>;
44
+ declare function mergeConnections<C extends IterableContainer<Connection<any, any>>>(connections: C): Array<C[number]>;
45
+ /**
46
+ * Excludes the values existing in `other` array.
47
+ * The output maintains the same order as the input.
48
+ */
49
+ declare function differenceConnections<C extends Connection<any, any>>(source: Iterable<C>, exclude: Iterable<C>): C[];
50
+ type WithSourceTarget<T = unknown> = {
51
+ source: T;
52
+ target: T;
53
+ };
54
+ declare function hasSameSourceTarget<T>(a: WithSourceTarget<NoInfer<T>>): (b: WithSourceTarget<T>) => boolean;
55
+ declare function hasSameSourceTarget<T>(a: WithSourceTarget<T>, b: WithSourceTarget<T>): boolean;
56
+ declare function hasSameSource<T>(a: WithSourceTarget<NoInfer<T>>): (b: WithSourceTarget<T>) => boolean;
57
+ declare function hasSameSource<T>(a: WithSourceTarget<T>, b: WithSourceTarget<T>): boolean;
58
+ declare function hasSameTarget<T>(a: WithSourceTarget<NoInfer<T>>): (b: WithSourceTarget<T>) => boolean;
59
+ declare function hasSameTarget<T>(a: WithSourceTarget<T>, b: WithSourceTarget<T>): boolean;
60
+ type WithId<T> = {
61
+ id: T;
62
+ };
63
+ declare function isOutgoing<T extends string>(source: WithId<NoInfer<T>>): (a: WithSourceTarget<WithId<T>>) => boolean;
64
+ declare function isOutgoing<T extends string>(a: WithSourceTarget<WithId<T>>, source: WithId<T>): boolean;
65
+ declare function isIncoming<T extends string>(target: WithId<NoInfer<T>>): (a: WithSourceTarget<WithId<T>>) => boolean;
66
+ declare function isIncoming<T extends string>(a: WithSourceTarget<WithId<T>>, target: WithId<T>): boolean;
67
+ declare function isAnyInOut<T extends string>(source: WithId<NoInfer<T>>): (a: WithSourceTarget<WithId<T>>) => boolean;
68
+ declare function isAnyInOut<T extends string>(a: WithSourceTarget<WithId<T>>, source: WithId<T>): boolean;
69
+
70
+ export { Connection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isIncoming, isNestedConnection, isOutgoing, mergeConnections, sortConnectionsByBoundaryHierarchy, sortDeepestFirst };
@@ -0,0 +1,23 @@
1
+ export { C as Connection } from '../../shared/core.C80Z37Eu.mjs';
2
+ export { D as DeploymentConnectionModel, d as deployment } from '../../shared/core.D5qVzkws.mjs';
3
+ export { C as ConnectionModel, d as differenceConnections, f as findAscendingConnections, a as findDeepestNestedConnection, b as findDescendantConnections, h as hasSameSource, c as hasSameSourceTarget, e as hasSameTarget, i as isAnyInOut, g as isIncoming, j as isNestedConnection, k as isOutgoing, m as mergeConnections, n as model, s as sortConnectionsByBoundaryHierarchy, l as sortDeepestFirst } from '../../shared/core.BTnf14gD.mjs';
4
+ import '../../shared/core.C_C-3c1S.mjs';
5
+ import '../../shared/core.zLlww-07.mjs';
6
+ import '../../shared/core.CpwrZi3D.mjs';
7
+ import '../../shared/core.DbRvwARP.mjs';
8
+ import '../../shared/core.D4npX2q8.mjs';
9
+ import '../../shared/core.D56nCp7e.mjs';
10
+ import '../../shared/core.B0oEIXqd.mjs';
11
+ import 'rehype-raw';
12
+ import 'rehype-sanitize';
13
+ import 'rehype-stringify';
14
+ import 'remark-gfm';
15
+ import 'remark-parse';
16
+ import 'remark-rehype';
17
+ import 'unified';
18
+ import 'mdast-util-from-markdown';
19
+ import 'mdast-util-to-string';
20
+ import '../../shared/core.BgvIuGGU.mjs';
21
+ import '../../shared/core.ByrmCl9I.mjs';
22
+ import '../../shared/core.BoyJPEen.mjs';
23
+ import '../../shared/core.BH9nN-_I.mjs';
@@ -0,0 +1,10 @@
1
+ export { C as Connection } from '../../../shared/core.D3xEWj5B.mjs';
2
+ export { C as ConnectionModel, a as findConnection, b as findConnectionsBetween, c as findConnectionsWithin } from '../../../shared/core.CJSFKrYf.mjs';
3
+ import '../../../shared/core.DrS4Bf4y.mjs';
4
+ import '../../../shared/core.DAj3LuFH.mjs';
5
+ import 'type-fest';
6
+ import '../../../shared/core.DuSLYTG6.mjs';
7
+ import '../../../shared/core.668kXpZq.mjs';
8
+ import '../../../shared/core.CywrQs86.mjs';
9
+ import '../../../shared/core.IWLie-Ma.mjs';
10
+ import '../../../shared/core.CzdwsPmY.mjs';
@@ -0,0 +1,11 @@
1
+ export { C as Connection } from '../../../shared/core.C80Z37Eu.mjs';
2
+ export { C as ConnectionModel, q as findConnection, o as findConnectionsBetween, r as findConnectionsWithin } from '../../../shared/core.BTnf14gD.mjs';
3
+ import '../../../shared/core.C_C-3c1S.mjs';
4
+ import '../../../shared/core.zLlww-07.mjs';
5
+ import '../../../shared/core.BgvIuGGU.mjs';
6
+ import '../../../shared/core.CpwrZi3D.mjs';
7
+ import '../../../shared/core.DbRvwARP.mjs';
8
+ import '../../../shared/core.D4npX2q8.mjs';
9
+ import '../../../shared/core.ByrmCl9I.mjs';
10
+ import '../../../shared/core.BoyJPEen.mjs';
11
+ import '../../../shared/core.BH9nN-_I.mjs';
@@ -1,260 +1,18 @@
1
- import { E as ElementModel, D as DeploymentElementModel, a as RelationshipsAccum, b as DeploymentNodeModel, R as RelationshipModel, c as DeploymentRelationModel, d as DeployedInstanceModel, A as AnyRelationshipModel, N as NestedElementOfDeployedInstanceModel, e as LikeC4ViewModel, f as NodeModel, g as EdgeModel } from '../shared/core.DaAyklhe.mjs';
2
- export { h as AnyLikeC4Model, k as DeploymentOrFqn, i as DeploymentRelationEndpoint, l as EdgeOrId, m as ElementOrFqn, I as IncomingFilter, j as LikeC4DeploymentModel, L as LikeC4Model, n as NodeOrId, O as OutgoingFilter, W as WithMetadata, o as WithTags } from '../shared/core.DaAyklhe.mjs';
3
- import { A as Any, h as EdgeId, U as Unknown } from '../shared/core.CBxTtXMi.mjs';
4
- export { b as Aux, S as SpecAux, a as aux } from '../shared/core.CBxTtXMi.mjs';
5
- import { F as Fqn, I as IteratorLike } from '../shared/core.BuO4ncfY.mjs';
6
- import { I as IterableContainer, R as ReorderedArray } from '../shared/core.Pf5I9o0e.mjs';
7
- export { y as AuxFromDump, A as AuxFromLikeC4ModelData } from '../shared/core.Bdz6fBF1.mjs';
1
+ import { D as DeploymentNodeModel, a as DeployedInstanceModel, b as DeploymentRelationModel, A as AnyRelationshipModel, N as NestedElementOfDeployedInstanceModel, E as ElementModel, R as RelationshipModel, L as LikeC4ViewModel, c as NodeModel, d as EdgeModel, e as DeploymentElementModel } from '../shared/core.DrS4Bf4y.mjs';
2
+ export { f as AnyLikeC4Model, k as DeploymentOrFqn, h as DeploymentRelationEndpoint, l as EdgeOrId, m as ElementOrFqn, I as IncomingFilter, j as LikeC4DeploymentModel, g as LikeC4Model, n as NodeOrId, O as OutgoingFilter, i as RelationshipsAccum, W as WithMetadata, o as WithTags } from '../shared/core.DrS4Bf4y.mjs';
3
+ import { A as Any } from '../shared/core.DAj3LuFH.mjs';
4
+ export { a as Aux, S as SpecAux, _ as aux } from '../shared/core.DAj3LuFH.mjs';
5
+ export { C as Connection } from '../shared/core.D3xEWj5B.mjs';
6
+ export { C as ConnectionModel, f as modelConnection } from '../shared/core.CJSFKrYf.mjs';
7
+ export { D as DeploymentConnectionModel, f as deploymentConnection } from '../shared/core.Di7__sMg.mjs';
8
+ export { differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isIncoming, isNestedConnection, isOutgoing, mergeConnections, sortConnectionsByBoundaryHierarchy, sortDeepestFirst } from './connection/index.mjs';
9
+ export { z as AuxFromDump, A as AuxFromLikeC4ModelData, R as RichText, a as RichTextEmpty, b as RichTextOrEmpty } from '../shared/core.IWLie-Ma.mjs';
8
10
  import '../shared/core.CywrQs86.mjs';
9
11
  import 'type-fest';
10
-
11
- interface Connection<Elem = ElementModel<Any> | DeploymentElementModel<Any>, Id = string> {
12
- readonly id: Id;
13
- readonly source: Elem;
14
- readonly target: Elem;
15
- /**
16
- * Common ancestor of the source and target elements.
17
- * Represents the boundary of the connection.
18
- */
19
- readonly boundary: Elem | null;
20
- /**
21
- * Human readable expression of the connection
22
- * Mostly used for testing and debugging
23
- */
24
- readonly expression: string;
25
- mergeWith(this: Connection<Elem, Id>, other: typeof this): typeof this;
26
- nonEmpty(): boolean;
27
- difference(this: Connection<Elem, Id>, other: typeof this): typeof this;
28
- intersect(this: Connection<Elem, Id>, other: typeof this): typeof this;
29
- equals(other: Connection): boolean;
30
- }
31
- declare namespace Connection {
32
- type ConnectionPredicate = <C extends Connection<{
33
- id: string;
34
- }, any>>(connection: C) => boolean;
35
- type ElementId = Fqn | string;
36
- export const isInside: (fqn: ElementId) => ConnectionPredicate;
37
- export const isDirectedBetween: (source: ElementId, target: ElementId) => ConnectionPredicate;
38
- export const isAnyBetween: (source: ElementId, target: ElementId) => ConnectionPredicate;
39
- export const isIncoming: (target: ElementId) => ConnectionPredicate;
40
- export const isOutgoing: (source: ElementId) => ConnectionPredicate;
41
- export const isAnyInOut: (source: ElementId) => ConnectionPredicate;
42
- export { };
43
- }
44
-
45
- declare const customInspectSymbol: unique symbol;
46
-
47
- /**
48
- * Connection is ephemeral entity, result of a resolving relationships between source and target.
49
- * Includes direct relationships and/or between their nested elements.
50
- */
51
- declare class DeploymentConnectionModel<A extends Any = Any> implements Connection<DeploymentElementModel<A>, EdgeId> {
52
- readonly source: DeploymentElementModel<A>;
53
- readonly target: DeploymentElementModel<A>;
54
- readonly relations: RelationshipsAccum<A>;
55
- readonly id: EdgeId;
56
- constructor(source: DeploymentElementModel<A>, target: DeploymentElementModel<A>, relations: RelationshipsAccum<A>);
57
- /**
58
- * Human readable expression of the connection
59
- * Mostly used for testing and debugging
60
- */
61
- get expression(): string;
62
- private _boundary;
63
- /**
64
- * Common ancestor of the source and target elements.
65
- * Represents the boundary of the connection.
66
- */
67
- get boundary(): DeploymentNodeModel<A> | null;
68
- nonEmpty(): boolean;
69
- [customInspectSymbol](depth: any, inspectOptions: any, inspect: any): string;
70
- toString(): string;
71
- /**
72
- * Check if connection contains deployment relation,
73
- * that is directly connected to source or target.
74
- */
75
- hasDirectDeploymentRelation(): boolean;
76
- values(): IteratorLike<RelationshipModel<A> | DeploymentRelationModel<A>>;
77
- /**
78
- * Merge with another connections, if it has the same source and target.
79
- * Returns new connection with union of relationships.
80
- */
81
- mergeWith(others: DeploymentConnectionModel<A>[]): DeploymentConnectionModel<A>;
82
- /**
83
- * Merge with another connection, if it has the same source and target.
84
- * Returns new connection with union of relationships.
85
- */
86
- mergeWith(other: DeploymentConnectionModel<A>): DeploymentConnectionModel<A>;
87
- difference(other: DeploymentConnectionModel<A>): DeploymentConnectionModel<A>;
88
- intersect(other: DeploymentConnectionModel<A>): DeploymentConnectionModel<A>;
89
- equals(other: Connection): boolean;
90
- /**
91
- * Creates a clone of the current `DeploymentConnectionModel` instance with optional overrides.
92
- * if `null` is provided in overrides, the corresponding relation set will be empty.
93
- */
94
- update(overrides?: {
95
- model?: ReadonlySet<RelationshipModel<A>> | null;
96
- deployment?: ReadonlySet<DeploymentRelationModel<A>> | null;
97
- }): DeploymentConnectionModel<A>;
98
- }
99
-
100
- /**
101
- * Connection refers to any relationships between two elements,
102
- * both direct and implicit ones (between their nested elements).
103
- *
104
- * Merges relationships together to an single edge on the diagram.
105
- */
106
- declare class ConnectionModel<A extends Any = Unknown> implements Connection<ElementModel<A>, EdgeId> {
107
- readonly source: ElementModel<A>;
108
- readonly target: ElementModel<A>;
109
- readonly relations: ReadonlySet<RelationshipModel<A>>;
110
- readonly id: EdgeId;
111
- constructor(source: ElementModel<A>, target: ElementModel<A>, relations?: ReadonlySet<RelationshipModel<A>>);
112
- private _boundary;
113
- /**
114
- * Common ancestor of the source and target elements.
115
- * Represents the boundary of the connection.
116
- */
117
- get boundary(): ElementModel<A> | null;
118
- /**
119
- * Human readable expression of the connection
120
- * Mostly used for testing and debugging
121
- */
122
- get expression(): string;
123
- /**
124
- * Returns true if only includes relations between the source and target elements.
125
- */
126
- get isDirect(): boolean;
127
- /**
128
- * Returns true if includes relations between nested elements of the source and target elements.
129
- */
130
- get isImplicit(): boolean;
131
- get directRelations(): ReadonlySet<RelationshipModel<A>>;
132
- nonEmpty(): boolean;
133
- mergeWith(other: ConnectionModel<A>): ConnectionModel<A>;
134
- difference(other: ConnectionModel<A>): ConnectionModel<A>;
135
- intersect(other: ConnectionModel<A>): ConnectionModel<A>;
136
- equals(other: Connection): boolean;
137
- /**
138
- * Returns a new instance with the updated relations.
139
- *
140
- * @param relations - A readonly set of `RelationshipModel` instances representing the new relations.
141
- * @returns A new `ConnectionModel` instance with the updated relations.
142
- */
143
- update(relations: ReadonlySet<RelationshipModel<A>>): ConnectionModel<A>;
144
- [customInspectSymbol](depth: any, inspectOptions: any, inspect: any): string;
145
- toString(): string;
146
- /**
147
- * Creates a new connection with reversed direction (target becomes source and vice versa)
148
- * @param search - When true, attempts to find an existing connection between the reversed nodes
149
- */
150
- reversed(search?: boolean): ConnectionModel<A>;
151
- }
152
-
153
- /**
154
- * Check if connection is nested inside another connection
155
- * (i.e. between descendants)
156
- */
157
- declare function isNestedConnection<T extends {
158
- id: string;
159
- }>(parent: WithSourceTarget<NoInfer<T>>): (nested: WithSourceTarget<T>) => boolean;
160
- declare function isNestedConnection<T extends {
161
- id: string;
162
- }>(nested: WithSourceTarget<T>, parent: WithSourceTarget<T>): boolean;
163
- type ConnectionElemId = Connection<{
164
- readonly id: string;
165
- }, any>;
166
- declare function findDeepestNestedConnection<C extends ConnectionElemId>(connections: ReadonlyArray<C>, connection: C): C | null;
167
- declare function sortDeepestFirst<C extends ConnectionElemId>(connections: ReadonlyArray<C>): C[];
168
- type WithBoundary = {
169
- boundary: null | {
170
- id: string;
171
- };
172
- };
173
- declare function sortConnectionsByBoundaryHierarchy(sort?: 'asc' | 'desc'): <T extends WithBoundary, A extends IterableContainer<T>>(array: A) => ReorderedArray<A>;
174
- declare function sortConnectionsByBoundaryHierarchy<T extends WithBoundary, A extends IterableContainer<T>>(array: A, sort?: 'asc' | 'desc'): ReorderedArray<A>;
175
- /**
176
- * Find connections that includes given connection (i.e between it's ancestors)
177
- */
178
- declare function findAscendingConnections<C extends ConnectionElemId>(connections: ReadonlyArray<C>, connection: C): Array<C>;
179
- /**
180
- * Find connections that includes given connection (i.e between it's descendants)
181
- */
182
- declare function findDescendantConnections<C extends ConnectionElemId>(connections: ReadonlyArray<C>, connection: C): Array<C>;
183
- declare function mergeConnections<C extends IterableContainer<Connection<any, any>>>(connections: C): Array<C[number]>;
184
- /**
185
- * Excludes the values existing in `other` array.
186
- * The output maintains the same order as the input.
187
- */
188
- declare function differenceConnections<C extends Connection<any, any>>(source: Iterable<C>, exclude: Iterable<C>): C[];
189
- type WithSourceTarget<T = unknown> = {
190
- source: T;
191
- target: T;
192
- };
193
- declare function hasSameSourceTarget<T>(a: WithSourceTarget<NoInfer<T>>): (b: WithSourceTarget<T>) => boolean;
194
- declare function hasSameSourceTarget<T>(a: WithSourceTarget<T>, b: WithSourceTarget<T>): boolean;
195
- declare function hasSameSource<T>(a: WithSourceTarget<NoInfer<T>>): (b: WithSourceTarget<T>) => boolean;
196
- declare function hasSameSource<T>(a: WithSourceTarget<T>, b: WithSourceTarget<T>): boolean;
197
- declare function hasSameTarget<T>(a: WithSourceTarget<NoInfer<T>>): (b: WithSourceTarget<T>) => boolean;
198
- declare function hasSameTarget<T>(a: WithSourceTarget<T>, b: WithSourceTarget<T>): boolean;
199
- type WithId<T> = {
200
- id: T;
201
- };
202
- declare function isOutgoing<T extends string>(source: WithId<NoInfer<T>>): (a: WithSourceTarget<WithId<T>>) => boolean;
203
- declare function isOutgoing<T extends string>(a: WithSourceTarget<WithId<T>>, source: WithId<T>): boolean;
204
- declare function isIncoming<T extends string>(target: WithId<NoInfer<T>>): (a: WithSourceTarget<WithId<T>>) => boolean;
205
- declare function isIncoming<T extends string>(a: WithSourceTarget<WithId<T>>, target: WithId<T>): boolean;
206
- declare function isAnyInOut<T extends string>(source: WithId<NoInfer<T>>): (a: WithSourceTarget<WithId<T>>) => boolean;
207
- declare function isAnyInOut<T extends string>(a: WithSourceTarget<WithId<T>>, source: WithId<T>): boolean;
208
-
209
- /**
210
- * Resolve connection from source to target
211
- * If direction is `both`, also look for reverse connection
212
- *
213
- * @default direction directed
214
- */
215
- declare function findConnection$1<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction: 'directed'): readonly [DeploymentConnectionModel<M>] | readonly [];
216
- declare function findConnection$1<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction: 'both'): readonly [DeploymentConnectionModel<M>, DeploymentConnectionModel<M>] | readonly [DeploymentConnectionModel<M>] | readonly [];
217
- declare function findConnection$1<M extends Any>(source: DeploymentElementModel<M>, target: DeploymentElementModel<NoInfer<M>>, direction?: 'directed' | 'both'): readonly [DeploymentConnectionModel<M>, DeploymentConnectionModel<M>] | readonly [DeploymentConnectionModel<M>] | readonly [];
218
- /**
219
- * Resolve all connections between element and others
220
- * By default, look for both directions.
221
- *
222
- * @default direction both
223
- */
224
- declare function findConnectionsBetween$1<M extends Any>(element: DeploymentElementModel<M>, others: Iterable<DeploymentElementModel<NoInfer<M>>>, direction?: 'directed' | 'both'): readonly DeploymentConnectionModel<M>[];
225
- /**
226
- * Resolve all connections within a given set of elements
227
- */
228
- declare function findConnectionsWithin$1<M extends Any>(elements: Iterable<DeploymentElementModel<M>>): readonly DeploymentConnectionModel<M>[];
229
-
230
- declare namespace find$1 {
231
- export { findConnection$1 as findConnection, findConnectionsBetween$1 as findConnectionsBetween, findConnectionsWithin$1 as findConnectionsWithin };
232
- }
233
-
234
- /**
235
- * Resolve connection from source to target
236
- *
237
- * @param direction - if 'both', also returns connection from target to source
238
- * @default `directed`
239
- */
240
- declare function findConnection<A extends Any>(source: ElementModel<A>, target: ElementModel<A>, direction?: 'directed' | 'both'): [ConnectionModel<A>, ConnectionModel<A>] | [ConnectionModel<A>] | [];
241
- /**
242
- * Resolve all connections between element and others
243
- * @param direction - if 'directed', only look for outgoing connections from the element to others
244
- * @default `both`
245
- */
246
- declare function findConnectionsBetween<M extends Any>(element: ElementModel<M>, others: Iterable<ElementModel<M>>, direction?: 'directed' | 'both'): readonly ConnectionModel<M>[];
247
- /**
248
- * Resolve all connections within a given set of elements
249
- */
250
- declare function findConnectionsWithin<M extends Any>(elements: Iterable<ElementModel<M>>): readonly ConnectionModel<M>[];
251
-
252
- declare const find_findConnection: typeof findConnection;
253
- declare const find_findConnectionsBetween: typeof findConnectionsBetween;
254
- declare const find_findConnectionsWithin: typeof findConnectionsWithin;
255
- declare namespace find {
256
- export { find_findConnection as findConnection, find_findConnectionsBetween as findConnectionsBetween, find_findConnectionsWithin as findConnectionsWithin };
257
- }
12
+ import '../shared/core.668kXpZq.mjs';
13
+ import '../shared/core.DuSLYTG6.mjs';
14
+ import '../shared/core.CzdwsPmY.mjs';
15
+ import '../shared/core.CF82MWyh.mjs';
258
16
 
259
17
  type AnyModel<A extends Any> = DeploymentNodeModel<A> | DeployedInstanceModel<A> | DeploymentRelationModel<A> | AnyRelationshipModel<A> | NestedElementOfDeployedInstanceModel<A> | ElementModel<A> | RelationshipModel<A> | LikeC4ViewModel<A> | NodeModel<A> | EdgeModel<A>;
260
18
  declare function isDeploymentNodeModel<M extends Any>(model: AnyModel<M>): model is DeploymentNodeModel<M>;
@@ -269,4 +27,4 @@ declare function isLikeC4ViewModel<M extends Any>(view: AnyModel<M>): view is Li
269
27
  declare function isNodeModel<M extends Any>(node: AnyModel<M>): node is NodeModel<M>;
270
28
  declare function isEdgeModel<M extends Any>(edge: AnyModel<M>): edge is EdgeModel<M>;
271
29
 
272
- export { Any, Any as AnyAux, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4ViewModel, NodeModel, RelationshipModel, RelationshipsAccum, find$1 as deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isRelationModel as isModelRelation, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, isRelationModel as isRelationshipModel, mergeConnections, find as modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst };
30
+ export { Any, Any as AnyAux, DeployedInstanceModel, DeploymentElementModel, DeploymentNodeModel, DeploymentRelationModel, EdgeModel, ElementModel, LikeC4ViewModel, NodeModel, RelationshipModel, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isLikeC4ViewModel, isRelationModel as isModelRelation, isNestedElementOfDeployedInstanceModel, isNodeModel, isRelationModel, isRelationModel as isRelationshipModel };
@@ -1,6 +1,28 @@
1
- export { C as Connection, z as ConnectionModel, I as DeployedInstanceModel, D as DeploymentConnectionModel, J as DeploymentNodeModel, K as DeploymentRelationModel, N as EdgeModel, E as ElementModel, M as LikeC4DeploymentModel, L as LikeC4Model, O as LikeC4ViewModel, P as NodeModel, A as RelationshipModel, R as RelationshipsAccum, d as deploymentConnection, c as differenceConnections, f as findAscendingConnections, v as findDeepestNestedConnection, u as findDescendantConnections, B as hasSameSource, F as hasSameSourceTarget, G as hasSameTarget, w as isAnyInOut, l as isDeployedInstanceModel, o as isDeploymentElementModel, n as isDeploymentNodeModel, Q as isDeploymentRelationModel, V as isEdgeModel, j as isElementModel, y as isIncoming, T as isLikeC4ViewModel, S as isModelRelation, e as isNestedConnection, k as isNestedElementOfDeployedInstanceModel, U as isNodeModel, x as isOutgoing, S as isRelationModel, S as isRelationshipModel, m as mergeConnections, q as modelConnection, s as sortConnectionsByBoundaryHierarchy, H as sortDeepestFirst } from '../shared/core.cbA9VZ02.mjs';
2
- import '../shared/core.rmvsy0n3.mjs';
3
- import '../shared/core.Cy9smucx.mjs';
4
- import '../shared/core.CUYDgv2-.mjs';
1
+ export { b as EdgeModel, E as ElementModel, a as LikeC4DeploymentModel, L as LikeC4Model, c as LikeC4ViewModel, N as NodeModel, R as RelationshipModel, d as isDeployedInstanceModel, e as isDeploymentElementModel, i as isDeploymentNodeModel, g as isDeploymentRelationModel, m as isEdgeModel, j as isElementModel, k as isLikeC4ViewModel, h as isModelRelation, f as isNestedElementOfDeployedInstanceModel, l as isNodeModel, h as isRelationModel, h as isRelationshipModel } from '../shared/core.4SpVCM9m.mjs';
2
+ export { c as DeployedInstanceModel, D as DeploymentConnectionModel, e as DeploymentNodeModel, g as DeploymentRelationModel, R as RelationshipsAccum, d as deploymentConnection } from '../shared/core.D5qVzkws.mjs';
3
+ export { C as Connection } from '../shared/core.C80Z37Eu.mjs';
4
+ export { C as ConnectionModel, d as differenceConnections, f as findAscendingConnections, a as findDeepestNestedConnection, b as findDescendantConnections, h as hasSameSource, c as hasSameSourceTarget, e as hasSameTarget, i as isAnyInOut, g as isIncoming, j as isNestedConnection, k as isOutgoing, m as mergeConnections, n as modelConnection, s as sortConnectionsByBoundaryHierarchy, l as sortDeepestFirst } from '../shared/core.BTnf14gD.mjs';
5
+ export { R as RichText } from '../shared/core.D56nCp7e.mjs';
5
6
  import '../shared/core.DbRvwARP.mjs';
6
- import '../shared/core.DoK86JEe.mjs';
7
+ import '../shared/core.ByrmCl9I.mjs';
8
+ import '../shared/core.C_C-3c1S.mjs';
9
+ import '../shared/core.zLlww-07.mjs';
10
+ import '../shared/core.DcS-0zys.mjs';
11
+ import '../shared/core.BMCb0wJI.mjs';
12
+ import '../shared/core.D4npX2q8.mjs';
13
+ import '../shared/core.Br7Fab9l.mjs';
14
+ import '../shared/core.BgvIuGGU.mjs';
15
+ import '../shared/core.B0oEIXqd.mjs';
16
+ import 'rehype-raw';
17
+ import 'rehype-sanitize';
18
+ import 'rehype-stringify';
19
+ import 'remark-gfm';
20
+ import 'remark-parse';
21
+ import 'remark-rehype';
22
+ import 'unified';
23
+ import 'mdast-util-from-markdown';
24
+ import 'mdast-util-to-string';
25
+ import '../shared/core.BH9nN-_I.mjs';
26
+ import '../shared/core.DsMrjY2q.mjs';
27
+ import '../shared/core.CpwrZi3D.mjs';
28
+ import '../shared/core.BoyJPEen.mjs';