@likec4/core 1.38.0 → 1.39.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.
- package/dist/builder/index.d.mts +6 -3
- package/dist/builder/index.mjs +55 -111
- package/dist/compute-view/index.d.mts +6 -3
- package/dist/compute-view/index.mjs +33 -34
- package/dist/compute-view/relationships-view/index.d.mts +6 -3
- package/dist/compute-view/relationships-view/index.mjs +6 -6
- package/dist/index.d.mts +8 -5
- package/dist/index.mjs +15 -24
- package/dist/model/connection/deployment/index.d.mts +8 -5
- package/dist/model/connection/deployment/index.mjs +7 -9
- package/dist/model/connection/index.d.mts +10 -7
- package/dist/model/connection/index.mjs +10 -14
- package/dist/model/connection/model/index.d.mts +8 -5
- package/dist/model/connection/model/index.mjs +7 -10
- package/dist/model/index.d.mts +13 -10
- package/dist/model/index.mjs +17 -20
- package/dist/shared/core.20m8Um0g.d.mts +253 -0
- package/dist/shared/{core.CpwrZi3D.mjs → core.4u1dVmfX.mjs} +3 -5
- package/dist/shared/{core.HUONfQfd.mjs → core.BB6zA-UU.mjs} +9 -214
- package/dist/shared/{core.C1GV0WWV.mjs → core.BVNaR17u.mjs} +1 -1
- package/dist/shared/{core.BL_xjl90.mjs → core.Be1n9a0i.mjs} +4 -5
- package/dist/shared/{core.BoyJPEen.mjs → core.Be4Jy9Qx.mjs} +2 -2
- package/dist/shared/{core.H8NbNp2X.mjs → core.BqVo8LrH.mjs} +1 -1
- package/dist/shared/{core.yaRvRnMW.mjs → core.BuoXfSMj.mjs} +1 -1
- package/dist/shared/{core.DhDo8LAz.d.mts → core.C7pZp1nR.d.mts} +3 -3
- package/dist/shared/{core.BH9nN-_I.mjs → core.CCD1ID81.mjs} +3 -4
- package/dist/shared/{core.8KM0D6va.mjs → core.CNGyqkJh.mjs} +1 -9
- package/dist/shared/{core.B0oEIXqd.mjs → core.CUw_2J9j.mjs} +1 -1
- package/dist/shared/{core.Y3j3s-oq.mjs → core.CWv15GLo.mjs} +11 -15
- package/dist/shared/{core.Bf5zKDK1.d.mts → core.CXCmvCws.d.mts} +2 -2
- package/dist/shared/core.CaT0SUUK.mjs +201 -0
- package/dist/shared/{core.Dtw1SBlz.d.mts → core.ClpXZ4Ib.d.mts} +3 -3
- package/dist/shared/{core.DyzAZvbX.mjs → core.CsbOakly.mjs} +13 -22
- package/dist/shared/{core.Btl47GOn.mjs → core.DLpidoWc.mjs} +2 -2
- package/dist/shared/{core.wwaSalox.d.mts → core.DM3vdkO_.d.mts} +1 -1
- package/dist/shared/core.DXhDWKFZ.d.mts +3 -0
- package/dist/shared/{core.O6FG0HF9.d.mts → core.DdzRtJ9d.d.mts} +1 -1
- package/dist/shared/{core.DQj9iv_y.mjs → core.DgttqsJc.mjs} +8 -11
- package/dist/shared/{core.b2BzqGz0.mjs → core.DlG1xWt2.mjs} +3 -43
- package/dist/shared/core.DnRszv-l.mjs +11982 -0
- package/dist/shared/core.DoM6aM9N.mjs +7 -0
- package/dist/shared/{core.DsznOb9G.mjs → core.DozSPE83.mjs} +43 -60
- package/dist/shared/{core.DsMrjY2q.mjs → core.GTgsmXS_.mjs} +2 -2
- package/dist/shared/core.ILwny7BV.mjs +38 -0
- package/dist/shared/core.PHwHXzkG.d.mts +213 -0
- package/dist/shared/core.T-eLZTW_.mjs +59 -0
- package/dist/shared/{core.CE_hG7EJ.d.mts → core.aWJgARyY.d.mts} +10 -486
- package/dist/shared/{core.BvlHvikl.d.mts → core.v1iEaXaR.d.mts} +5 -3
- package/dist/shared/core.yHe79zEl.mjs +98 -0
- package/dist/theme/index.d.mts +3 -126
- package/dist/theme/index.mjs +2 -3
- package/dist/types/_aux.d.mts +1 -1
- package/dist/types/expression-model.d.mts +191 -0
- package/dist/types/expression-model.mjs +112 -0
- package/dist/types/expression.d.mts +7 -0
- package/dist/types/expression.mjs +116 -0
- package/dist/types/fqnRef.d.mts +61 -0
- package/dist/types/fqnRef.mjs +46 -0
- package/dist/types/index.d.mts +6 -3
- package/dist/types/index.mjs +9 -9
- package/dist/types/scalar.mjs +2 -3
- package/dist/utils/index.d.mts +7 -429
- package/dist/utils/index.mjs +56 -15
- package/dist/utils/iterable/index.d.mts +2 -3
- package/dist/utils/iterable/index.mjs +9 -44
- package/package.json +9 -8
- package/src/index.ts +24 -1
- package/src/model/RelationModel.ts +1 -1
- package/src/model/index.ts +1 -1
- package/src/theme/element.ts +2 -2
- package/src/theme/relationships.ts +2 -2
- package/src/types/RichText.ts +1 -1
- package/src/types/expression-model.ts +3 -1
- package/src/types/expression.ts +3 -1
- package/src/types/fqnRef.ts +4 -1
- package/src/utils/compare-natural.ts +4 -2
- package/src/utils/guards.ts +0 -1
- package/src/utils/index.ts +0 -1
- package/dist/shared/core.BW8K1y6R.mjs +0 -278
- package/dist/shared/core.BgvIuGGU.mjs +0 -3
- package/dist/shared/core.BpJu1RrF.mjs +0 -5
- package/dist/shared/core.ByrmCl9I.mjs +0 -5
- package/dist/shared/core.CnIyafWn.mjs +0 -3
- package/dist/shared/core.DK6I-Nr7.mjs +0 -149
- package/dist/shared/core.DbRvwARP.mjs +0 -5
- package/dist/shared/core.YyjkRVss.mjs +0 -5236
- package/dist/shared/core.zLlww-07.mjs +0 -3
- package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -425
- package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +0 -318
- package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -221
- package/src/compute-view/deployment-view/__test__/TestHelper.ts +0 -249
- package/src/compute-view/deployment-view/__test__/fixture.ts +0 -238
- package/src/compute-view/dynamic-view/__test__/fixture.ts +0 -67
- package/src/compute-view/element-view/__test__/TestHelper.ts +0 -282
- package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +0 -458
- package/src/compute-view/element-view/__test__/fixture.ts +0 -749
- package/src/compute-view/utils/__snapshots__/sortNodes.spec.ts.snap +0 -113
- package/src/model/__test__/fixture.ts +0 -168
- package/src/theme/__test__/theme-index.ts +0 -29
|
@@ -1,487 +1,11 @@
|
|
|
1
1
|
import { Simplify, MergeExclusive, Tagged, NonEmptyTuple, IsNever, IsAny } from 'type-fest';
|
|
2
|
-
import { A as Any,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Reference to logical model element
|
|
10
|
-
*/
|
|
11
|
-
interface ElementRef<A extends Any = Unknown> {
|
|
12
|
-
project?: never;
|
|
13
|
-
model: ElementId<A>;
|
|
14
|
-
}
|
|
15
|
-
function isElementRef<A extends Any>(ref: FqnRef<A>): ref is ElementRef<A>;
|
|
16
|
-
/**
|
|
17
|
-
* Reference to imported logical model element
|
|
18
|
-
*/
|
|
19
|
-
interface ImportRef<A extends Any = Unknown> {
|
|
20
|
-
project: ProjectId<A>;
|
|
21
|
-
model: ElementId<A>;
|
|
22
|
-
}
|
|
23
|
-
function isImportRef<A extends Any>(ref: FqnRef<A>): ref is ImportRef<A>;
|
|
24
|
-
function flatten<A extends Any>(ref: FqnRef<A>): Fqn<A>;
|
|
25
|
-
type ModelRef<A extends Any = Unknown> = ImportRef<A> | ElementRef<A>;
|
|
26
|
-
function isModelRef<A extends Any>(ref: FqnRef<A>): ref is ModelRef<A>;
|
|
27
|
-
/**
|
|
28
|
-
* Represents a reference to an instance within a deployment.
|
|
29
|
-
*
|
|
30
|
-
* @template D - The type representing the deployment fqn. Defaults to `Fqn`.
|
|
31
|
-
* @template M - The type representing the model fqn. Defaults to `Fqn`.
|
|
32
|
-
*
|
|
33
|
-
* @property {D} deployment - TThe fully qualified name (FQN) of the deployed instance.
|
|
34
|
-
* @property {M} element - The element reference within the deployment.
|
|
35
|
-
*/
|
|
36
|
-
interface InsideInstanceRef<A extends Any = Unknown> {
|
|
37
|
-
deployment: DeploymentId<A>;
|
|
38
|
-
element: ElementId<A>;
|
|
39
|
-
}
|
|
40
|
-
function isInsideInstanceRef<A extends Any>(ref: FqnRef<A>): ref is InsideInstanceRef<A>;
|
|
41
|
-
/**
|
|
42
|
-
* Represents a reference to a deployment element.
|
|
43
|
-
*
|
|
44
|
-
* @template F - The type of the fully qualified name (FQN) of the deployment element. Defaults to `Fqn`.
|
|
45
|
-
* @property {F} deployment - The fully qualified name (FQN) of the deployment element.
|
|
46
|
-
*/
|
|
47
|
-
interface DeploymentElementRef<A extends Any> {
|
|
48
|
-
deployment: DeploymentId<A>;
|
|
49
|
-
element?: never;
|
|
50
|
-
}
|
|
51
|
-
function isDeploymentElementRef<A extends Any>(ref: FqnRef<A>): ref is DeploymentElementRef<A>;
|
|
52
|
-
type DeploymentRef<A extends Any> = DeploymentElementRef<A> | InsideInstanceRef<A>;
|
|
53
|
-
function isDeploymentRef<A extends Any>(ref: FqnRef<A>): ref is DeploymentRef<A>;
|
|
54
|
-
}
|
|
55
|
-
type FqnRef<A extends Any = Unknown> = ExclusiveUnion<{
|
|
56
|
-
DeploymentRef: FqnRef.DeploymentRef<A>;
|
|
57
|
-
ModelRef: FqnRef.ModelRef<A>;
|
|
58
|
-
}>;
|
|
59
|
-
|
|
60
|
-
type EqualOperator<V> = {
|
|
61
|
-
eq: V;
|
|
62
|
-
neq?: never;
|
|
63
|
-
} | {
|
|
64
|
-
eq?: never;
|
|
65
|
-
neq: V;
|
|
66
|
-
};
|
|
67
|
-
type AllNever = {
|
|
68
|
-
not?: never;
|
|
69
|
-
and?: never;
|
|
70
|
-
or?: never;
|
|
71
|
-
tag?: never;
|
|
72
|
-
kind?: never;
|
|
73
|
-
participant?: never;
|
|
74
|
-
operator?: never;
|
|
75
|
-
};
|
|
76
|
-
type TagEqual<A extends Any> = Omit<AllNever, 'tag'> & {
|
|
77
|
-
tag: EqualOperator<Tag<A>> | Tag<A>;
|
|
78
|
-
};
|
|
79
|
-
declare function isTagEqual<A extends Any>(operator: WhereOperator<A>): operator is TagEqual<A>;
|
|
80
|
-
type KindEqual<A extends Any> = Omit<AllNever, 'kind'> & {
|
|
81
|
-
kind: EqualOperator<AllKinds<A>> | AllKinds<A>;
|
|
82
|
-
};
|
|
83
|
-
declare function isKindEqual<A extends Any>(operator: WhereOperator<A>): operator is KindEqual<A>;
|
|
84
|
-
type Participant = 'source' | 'target';
|
|
85
|
-
type ParticipantOperator<A extends Any> = Omit<AllNever, 'participant' | 'operator'> & {
|
|
86
|
-
participant: Participant;
|
|
87
|
-
operator: KindEqual<A> | TagEqual<A>;
|
|
88
|
-
};
|
|
89
|
-
declare function isParticipantOperator<A extends Any>(operator: WhereOperator<A>): operator is ParticipantOperator<A>;
|
|
90
|
-
type NotOperator<A extends Any> = Omit<AllNever, 'not'> & {
|
|
91
|
-
not: WhereOperator<A>;
|
|
92
|
-
};
|
|
93
|
-
declare function isNotOperator<A extends Any>(operator: WhereOperator<A>): operator is NotOperator<A>;
|
|
94
|
-
type AndOperator<A extends Any> = Omit<AllNever, 'and'> & {
|
|
95
|
-
and: NonEmptyArray<WhereOperator<A>>;
|
|
96
|
-
};
|
|
97
|
-
declare function isAndOperator<A extends Any>(operator: WhereOperator<A>): operator is AndOperator<A>;
|
|
98
|
-
type OrOperator<A extends Any> = Omit<AllNever, 'or'> & {
|
|
99
|
-
or: NonEmptyArray<WhereOperator<A>>;
|
|
100
|
-
};
|
|
101
|
-
declare function isOrOperator<A extends Any>(operator: WhereOperator<A>): operator is OrOperator<A>;
|
|
102
|
-
type WhereOperator<A extends Any = Any> = TagEqual<A> | KindEqual<A> | ParticipantOperator<A> | NotOperator<A> | AndOperator<A> | OrOperator<A>;
|
|
103
|
-
type Filterable<A extends Any> = {
|
|
104
|
-
tags?: Tags<A> | null | undefined;
|
|
105
|
-
kind?: AllKinds<A> | null | undefined;
|
|
106
|
-
source?: Filterable<A>;
|
|
107
|
-
target?: Filterable<A>;
|
|
108
|
-
};
|
|
109
|
-
type OperatorPredicate<A extends Any> = (value: Filterable<A>) => boolean;
|
|
110
|
-
declare function whereOperatorAsPredicate<A extends Any>(operator: WhereOperator<A>): OperatorPredicate<A>;
|
|
111
|
-
|
|
112
|
-
type PredicateSelector = 'children' | 'expanded' | 'descendants';
|
|
113
|
-
declare namespace FqnExpr {
|
|
114
|
-
type Wildcard = {
|
|
115
|
-
wildcard: true;
|
|
116
|
-
};
|
|
117
|
-
function isWildcard<A extends Any>(expr: Expression<A>): expr is FqnExpr.Wildcard;
|
|
118
|
-
interface ModelRef<M extends Any = Any> {
|
|
119
|
-
ref: FqnRef.ModelRef<M>;
|
|
120
|
-
selector?: PredicateSelector;
|
|
121
|
-
}
|
|
122
|
-
function isModelRef<A extends Any>(ref: Expression<A>): ref is FqnExpr.ModelRef<A>;
|
|
123
|
-
interface DeploymentRef<A extends Any = Any> {
|
|
124
|
-
ref: FqnRef.DeploymentRef<A>;
|
|
125
|
-
selector?: PredicateSelector;
|
|
126
|
-
}
|
|
127
|
-
function isDeploymentRef<A extends Any>(expr: Expression<A>): expr is FqnExpr.DeploymentRef<A>;
|
|
128
|
-
interface ElementKindExpr<A extends Any = Any> {
|
|
129
|
-
elementKind: ElementKind<A>;
|
|
130
|
-
isEqual: boolean;
|
|
131
|
-
}
|
|
132
|
-
function isElementKindExpr<A extends Any>(expr: Expression<A>): expr is ElementKindExpr<A>;
|
|
133
|
-
interface ElementTagExpr<A extends Any = Any> {
|
|
134
|
-
elementTag: Tag<A>;
|
|
135
|
-
isEqual: boolean;
|
|
136
|
-
}
|
|
137
|
-
function isElementTagExpr<A extends Any>(expr: Expression<A>): expr is ElementTagExpr<A>;
|
|
138
|
-
type NonWildcard<A extends Any = Any> = ExclusiveUnion<{
|
|
139
|
-
ModelRef: ModelRef<A>;
|
|
140
|
-
DeploymentRef: DeploymentRef<A>;
|
|
141
|
-
ElementKind: ElementKindExpr<A>;
|
|
142
|
-
ElementTag: ElementTagExpr<A>;
|
|
143
|
-
}>;
|
|
144
|
-
interface Where<A extends Any = Any> {
|
|
145
|
-
where: {
|
|
146
|
-
expr: ExclusiveUnion<{
|
|
147
|
-
Wildcard: Wildcard;
|
|
148
|
-
ModelRef: ModelRef<A>;
|
|
149
|
-
DeploymentRef: DeploymentRef<A>;
|
|
150
|
-
ElementKind: ElementKindExpr<A>;
|
|
151
|
-
ElementTag: ElementTagExpr<A>;
|
|
152
|
-
}>;
|
|
153
|
-
condition: WhereOperator<A>;
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
function isWhere<A extends Any>(expr: Expression<A>): expr is FqnExpr.Where<A>;
|
|
157
|
-
interface Custom<A extends Any = Any> {
|
|
158
|
-
custom: {
|
|
159
|
-
expr: OrWhere<A>;
|
|
160
|
-
title?: string;
|
|
161
|
-
description?: MarkdownOrString;
|
|
162
|
-
technology?: string;
|
|
163
|
-
notation?: string;
|
|
164
|
-
shape?: ElementShape;
|
|
165
|
-
color?: Color;
|
|
166
|
-
icon?: Icon;
|
|
167
|
-
border?: BorderStyle;
|
|
168
|
-
opacity?: number;
|
|
169
|
-
navigateTo?: StrictViewId<A>;
|
|
170
|
-
multiple?: boolean;
|
|
171
|
-
size?: ShapeSize;
|
|
172
|
-
padding?: ShapeSize;
|
|
173
|
-
textSize?: ShapeSize;
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
function isCustom<A extends Any>(expr: Expression<A>): expr is Custom<A>;
|
|
177
|
-
function is<A extends Any>(expr: Expression<A>): expr is FqnExpr<A>;
|
|
178
|
-
type OrWhere<A extends Any = Any> = ExclusiveUnion<{
|
|
179
|
-
Wildcard: FqnExpr.Wildcard;
|
|
180
|
-
ModelRef: FqnExpr.ModelRef<A>;
|
|
181
|
-
DeploymentRef: FqnExpr.DeploymentRef<A>;
|
|
182
|
-
ElementKind: ElementKindExpr<A>;
|
|
183
|
-
ElementTag: ElementTagExpr<A>;
|
|
184
|
-
Where: FqnExpr.Where<A>;
|
|
185
|
-
}>;
|
|
186
|
-
type Any<A extends Any = Any> = ExclusiveUnion<{
|
|
187
|
-
Wildcard: Wildcard;
|
|
188
|
-
ModelRef: ModelRef<A>;
|
|
189
|
-
DeploymentRef: DeploymentRef<A>;
|
|
190
|
-
ElementKind: ElementKindExpr<A>;
|
|
191
|
-
ElementTag: ElementTagExpr<A>;
|
|
192
|
-
Where: Where<A>;
|
|
193
|
-
Custom: Custom<A>;
|
|
194
|
-
}>;
|
|
195
|
-
function unwrap<A extends Any>(expr: FqnExpr.Any<A>): Wildcard | ModelRef<A> | DeploymentRef<A> | ElementKindExpr<A> | ElementTagExpr<A>;
|
|
196
|
-
}
|
|
197
|
-
type FqnExpr<A extends Any = Any> = ExclusiveUnion<{
|
|
198
|
-
Wildcard: FqnExpr.Wildcard;
|
|
199
|
-
ModelRef: FqnExpr.ModelRef<A>;
|
|
200
|
-
DeploymentRef: FqnExpr.DeploymentRef<A>;
|
|
201
|
-
ElementKind: FqnExpr.ElementKindExpr<A>;
|
|
202
|
-
ElementTag: FqnExpr.ElementTagExpr<A>;
|
|
203
|
-
}>;
|
|
204
|
-
declare namespace RelationExpr {
|
|
205
|
-
type Endpoint<A extends Any = Any> = FqnExpr.Where<A>['where']['expr'];
|
|
206
|
-
interface Direct<A extends Any = Any> {
|
|
207
|
-
source: Endpoint<A>;
|
|
208
|
-
target: Endpoint<A>;
|
|
209
|
-
isBidirectional?: boolean;
|
|
210
|
-
}
|
|
211
|
-
function isDirect<A extends Any>(expr: Expression<A>): expr is RelationExpr.Direct<A>;
|
|
212
|
-
interface Incoming<A extends Any = Any> {
|
|
213
|
-
incoming: Endpoint<A>;
|
|
214
|
-
}
|
|
215
|
-
function isIncoming<A extends Any>(expr: Expression<A>): expr is RelationExpr.Incoming<A>;
|
|
216
|
-
interface Outgoing<A extends Any = Any> {
|
|
217
|
-
outgoing: Endpoint<A>;
|
|
218
|
-
}
|
|
219
|
-
function isOutgoing<A extends Any>(expr: Expression<A>): expr is RelationExpr.Outgoing<A>;
|
|
220
|
-
interface InOut<A extends Any = Any> {
|
|
221
|
-
inout: Endpoint<A>;
|
|
222
|
-
}
|
|
223
|
-
function isInOut<A extends Any>(expr: Expression<A>): expr is RelationExpr.InOut<A>;
|
|
224
|
-
interface Where<A extends Any = Any> {
|
|
225
|
-
where: {
|
|
226
|
-
expr: ExclusiveUnion<{
|
|
227
|
-
Direct: RelationExpr.Direct<A>;
|
|
228
|
-
Incoming: RelationExpr.Incoming<A>;
|
|
229
|
-
Outgoing: RelationExpr.Outgoing<A>;
|
|
230
|
-
InOut: RelationExpr.InOut<A>;
|
|
231
|
-
}>;
|
|
232
|
-
condition: WhereOperator<A>;
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
function isWhere<A extends Any>(expr: Expression<A>): expr is RelationExpr.Where<A>;
|
|
236
|
-
interface Custom<A extends Any = Any> {
|
|
237
|
-
customRelation: {
|
|
238
|
-
expr: OrWhere<A>;
|
|
239
|
-
title?: string;
|
|
240
|
-
description?: string;
|
|
241
|
-
technology?: string;
|
|
242
|
-
notation?: string;
|
|
243
|
-
navigateTo?: StrictViewId<A>;
|
|
244
|
-
notes?: string;
|
|
245
|
-
color?: Color;
|
|
246
|
-
line?: RelationshipLineType;
|
|
247
|
-
head?: RelationshipArrowType;
|
|
248
|
-
tail?: RelationshipArrowType;
|
|
249
|
-
};
|
|
250
|
-
}
|
|
251
|
-
function isCustom<A extends Any>(expr: Expression<A>): expr is Custom<A>;
|
|
252
|
-
function is<A extends Any>(expr: Expression<A>): expr is RelationExpr<A>;
|
|
253
|
-
type OrWhere<A extends Any = Any> = ExclusiveUnion<{
|
|
254
|
-
Direct: Direct<A>;
|
|
255
|
-
Incoming: Incoming<A>;
|
|
256
|
-
Outgoing: Outgoing<A>;
|
|
257
|
-
InOut: InOut<A>;
|
|
258
|
-
Where: Where<A>;
|
|
259
|
-
}>;
|
|
260
|
-
type Any<A extends Any = Any> = ExclusiveUnion<{
|
|
261
|
-
Direct: Direct<A>;
|
|
262
|
-
Incoming: Incoming<A>;
|
|
263
|
-
Outgoing: Outgoing<A>;
|
|
264
|
-
InOut: InOut<A>;
|
|
265
|
-
Where: Where<A>;
|
|
266
|
-
Custom: Custom<A>;
|
|
267
|
-
}>;
|
|
268
|
-
function unwrap<A extends Any>(expr: RelationExpr.Any<A>): Direct<A> | Incoming<A> | Outgoing<A> | InOut<A>;
|
|
269
|
-
}
|
|
270
|
-
type RelationExpr<A extends Any = Any> = ExclusiveUnion<{
|
|
271
|
-
Direct: RelationExpr.Direct<A>;
|
|
272
|
-
Incoming: RelationExpr.Incoming<A>;
|
|
273
|
-
Outgoing: RelationExpr.Outgoing<A>;
|
|
274
|
-
InOut: RelationExpr.InOut<A>;
|
|
275
|
-
}>;
|
|
276
|
-
/**
|
|
277
|
-
* Represents a version 2 expression which can be one of several types.
|
|
278
|
-
*
|
|
279
|
-
* @template D - The type for the deployment FQN, defaults to `Fqn`.
|
|
280
|
-
* @template M - The type for the model FQN, defaults to `Fqn`.
|
|
281
|
-
*/
|
|
282
|
-
type Expression<A extends Any = Any> = ExclusiveUnion<{
|
|
283
|
-
Wildcard: FqnExpr.Wildcard;
|
|
284
|
-
ModelRef: FqnExpr.ModelRef<A>;
|
|
285
|
-
DeploymentRef: FqnExpr.DeploymentRef<A>;
|
|
286
|
-
ElementKind: FqnExpr.ElementKindExpr<A>;
|
|
287
|
-
ElementTag: FqnExpr.ElementTagExpr<A>;
|
|
288
|
-
Custom: FqnExpr.Custom<A>;
|
|
289
|
-
Direct: RelationExpr.Direct<A>;
|
|
290
|
-
Incoming: RelationExpr.Incoming<A>;
|
|
291
|
-
Outgoing: RelationExpr.Outgoing<A>;
|
|
292
|
-
InOut: RelationExpr.InOut<A>;
|
|
293
|
-
Where: Expression.Where<A>;
|
|
294
|
-
CustomRelation: RelationExpr.Custom<A>;
|
|
295
|
-
}>;
|
|
296
|
-
declare namespace Expression {
|
|
297
|
-
type Where<A extends Any = Any> = FqnExpr.Where<A> | RelationExpr.Where<A>;
|
|
298
|
-
function isWhere<A extends Any>(expr: Expression<A>): expr is Expression.Where<A>;
|
|
299
|
-
function isRelationWhere<A extends Any>(expr: Expression<A>): expr is RelationExpr.Where<A>;
|
|
300
|
-
function isFqnExprWhere<A extends Any>(expr: Expression<A>): expr is FqnExpr.Where<A>;
|
|
301
|
-
function isFqnExpr<A extends Any>(expr: Expression<A>): expr is FqnExpr.Any<A>;
|
|
302
|
-
function isRelation<A extends Any>(expr: Expression<A>): expr is RelationExpr.Any<A>;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
declare namespace ModelFqnExpr {
|
|
306
|
-
type Wildcard = {
|
|
307
|
-
wildcard: true;
|
|
308
|
-
};
|
|
309
|
-
function isWildcard<A extends Any>(expr: ModelExpression<A>): expr is ModelFqnExpr.Wildcard;
|
|
310
|
-
interface Ref<M extends Any> {
|
|
311
|
-
ref: FqnRef.ModelRef<M>;
|
|
312
|
-
selector?: PredicateSelector;
|
|
313
|
-
}
|
|
314
|
-
function isModelRef<A extends Any>(ref: ModelExpression<A>): ref is ModelFqnExpr.Ref<A>;
|
|
315
|
-
interface ElementKindExpr<A extends Any = Any> {
|
|
316
|
-
elementKind: ElementKind<A>;
|
|
317
|
-
isEqual: boolean;
|
|
318
|
-
}
|
|
319
|
-
function isElementKindExpr<A extends Any>(expr: ModelExpression<A>): expr is ElementKindExpr<A>;
|
|
320
|
-
interface ElementTagExpr<A extends Any> {
|
|
321
|
-
elementTag: Tag<A>;
|
|
322
|
-
isEqual: boolean;
|
|
323
|
-
}
|
|
324
|
-
function isElementTagExpr<A extends Any>(expr: ModelExpression<A>): expr is ElementTagExpr<A>;
|
|
325
|
-
type NonWildcard<A extends Any = Any> = ExclusiveUnion<{
|
|
326
|
-
Ref: Ref<A>;
|
|
327
|
-
ElementKind: ElementKindExpr<A>;
|
|
328
|
-
ElementTag: ElementTagExpr<A>;
|
|
329
|
-
}>;
|
|
330
|
-
interface Where<A extends Any = Any> {
|
|
331
|
-
where: {
|
|
332
|
-
expr: ExclusiveUnion<{
|
|
333
|
-
Wildcard: Wildcard;
|
|
334
|
-
Ref: Ref<A>;
|
|
335
|
-
ElementKind: ElementKindExpr<A>;
|
|
336
|
-
ElementTag: ElementTagExpr<A>;
|
|
337
|
-
}>;
|
|
338
|
-
condition: WhereOperator<A>;
|
|
339
|
-
};
|
|
340
|
-
}
|
|
341
|
-
function isWhere<A extends Any>(expr: ModelExpression<A>): expr is ModelFqnExpr.Where<A>;
|
|
342
|
-
interface Custom<A extends Any = Any> {
|
|
343
|
-
custom: {
|
|
344
|
-
expr: OrWhere<A>;
|
|
345
|
-
title?: string;
|
|
346
|
-
description?: MarkdownOrString;
|
|
347
|
-
technology?: string;
|
|
348
|
-
notation?: string;
|
|
349
|
-
shape?: ElementShape;
|
|
350
|
-
color?: Color;
|
|
351
|
-
icon?: Icon;
|
|
352
|
-
border?: BorderStyle;
|
|
353
|
-
opacity?: number;
|
|
354
|
-
navigateTo?: StrictViewId<A>;
|
|
355
|
-
multiple?: boolean;
|
|
356
|
-
size?: ShapeSize;
|
|
357
|
-
padding?: ShapeSize;
|
|
358
|
-
textSize?: ShapeSize;
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
function isCustom<A extends Any>(expr: ModelExpression<A>): expr is Custom<A>;
|
|
362
|
-
function is<A extends Any>(expr: ModelExpression<A>): expr is ModelFqnExpr<A>;
|
|
363
|
-
type OrWhere<A extends Any = Any> = ExclusiveUnion<{
|
|
364
|
-
Wildcard: ModelFqnExpr.Wildcard;
|
|
365
|
-
Ref: ModelFqnExpr.Ref<A>;
|
|
366
|
-
ElementKind: ElementKindExpr<A>;
|
|
367
|
-
ElementTag: ElementTagExpr<A>;
|
|
368
|
-
Where: ModelFqnExpr.Where<A>;
|
|
369
|
-
}>;
|
|
370
|
-
type Any<A extends Any = Any> = ExclusiveUnion<{
|
|
371
|
-
Wildcard: Wildcard;
|
|
372
|
-
Ref: Ref<A>;
|
|
373
|
-
ElementKind: ElementKindExpr<A>;
|
|
374
|
-
ElementTag: ElementTagExpr<A>;
|
|
375
|
-
Where: Where<A>;
|
|
376
|
-
Custom: Custom<A>;
|
|
377
|
-
}>;
|
|
378
|
-
function unwrap<A extends Any>(expr: ModelFqnExpr.Any<A>): Wildcard | Ref<A> | ElementKindExpr<A> | ElementTagExpr<A>;
|
|
379
|
-
}
|
|
380
|
-
type ModelFqnExpr<A extends Any = Any> = ExclusiveUnion<{
|
|
381
|
-
Wildcard: ModelFqnExpr.Wildcard;
|
|
382
|
-
Ref: ModelFqnExpr.Ref<A>;
|
|
383
|
-
ElementKind: ModelFqnExpr.ElementKindExpr<A>;
|
|
384
|
-
ElementTag: ModelFqnExpr.ElementTagExpr<A>;
|
|
385
|
-
}>;
|
|
386
|
-
declare namespace ModelRelationExpr {
|
|
387
|
-
type Endpoint<A extends Any = Any> = ModelFqnExpr.Where<A>['where']['expr'];
|
|
388
|
-
interface Direct<A extends Any = Any> {
|
|
389
|
-
source: Endpoint<A>;
|
|
390
|
-
target: Endpoint<A>;
|
|
391
|
-
isBidirectional?: boolean;
|
|
392
|
-
}
|
|
393
|
-
function isDirect<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.Direct<A>;
|
|
394
|
-
interface Incoming<A extends Any = Any> {
|
|
395
|
-
incoming: Endpoint<A>;
|
|
396
|
-
}
|
|
397
|
-
function isIncoming<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.Incoming<A>;
|
|
398
|
-
interface Outgoing<A extends Any = Any> {
|
|
399
|
-
outgoing: Endpoint<A>;
|
|
400
|
-
}
|
|
401
|
-
function isOutgoing<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.Outgoing<A>;
|
|
402
|
-
interface InOut<A extends Any = Any> {
|
|
403
|
-
inout: Endpoint<A>;
|
|
404
|
-
}
|
|
405
|
-
function isInOut<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.InOut<A>;
|
|
406
|
-
interface Where<A extends Any = Any> {
|
|
407
|
-
where: {
|
|
408
|
-
expr: ExclusiveUnion<{
|
|
409
|
-
Direct: ModelRelationExpr.Direct<A>;
|
|
410
|
-
Incoming: ModelRelationExpr.Incoming<A>;
|
|
411
|
-
Outgoing: ModelRelationExpr.Outgoing<A>;
|
|
412
|
-
InOut: ModelRelationExpr.InOut<A>;
|
|
413
|
-
}>;
|
|
414
|
-
condition: WhereOperator<A>;
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
function isWhere<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.Where<A>;
|
|
418
|
-
interface Custom<A extends Any = Any> {
|
|
419
|
-
customRelation: {
|
|
420
|
-
expr: OrWhere<A>;
|
|
421
|
-
title?: string;
|
|
422
|
-
description?: string;
|
|
423
|
-
technology?: string;
|
|
424
|
-
notation?: string;
|
|
425
|
-
navigateTo?: StrictViewId<A>;
|
|
426
|
-
notes?: string;
|
|
427
|
-
color?: Color;
|
|
428
|
-
line?: RelationshipLineType;
|
|
429
|
-
head?: RelationshipArrowType;
|
|
430
|
-
tail?: RelationshipArrowType;
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
function isCustom<A extends Any>(expr: ModelExpression<A>): expr is Custom<A>;
|
|
434
|
-
function is<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr<A>;
|
|
435
|
-
type OrWhere<A extends Any = Any> = ExclusiveUnion<{
|
|
436
|
-
Direct: Direct<A>;
|
|
437
|
-
Incoming: Incoming<A>;
|
|
438
|
-
Outgoing: Outgoing<A>;
|
|
439
|
-
InOut: InOut<A>;
|
|
440
|
-
Where: Where<A>;
|
|
441
|
-
}>;
|
|
442
|
-
type Any<A extends Any = Any> = ExclusiveUnion<{
|
|
443
|
-
Direct: Direct<A>;
|
|
444
|
-
Incoming: Incoming<A>;
|
|
445
|
-
Outgoing: Outgoing<A>;
|
|
446
|
-
InOut: InOut<A>;
|
|
447
|
-
Where: Where<A>;
|
|
448
|
-
Custom: Custom<A>;
|
|
449
|
-
}>;
|
|
450
|
-
function unwrap<A extends Any>(expr: ModelRelationExpr.Any<A>): Direct<A> | Incoming<A> | Outgoing<A> | InOut<A>;
|
|
451
|
-
}
|
|
452
|
-
type ModelRelationExpr<A extends Any = Any> = ExclusiveUnion<{
|
|
453
|
-
Direct: ModelRelationExpr.Direct<A>;
|
|
454
|
-
Incoming: ModelRelationExpr.Incoming<A>;
|
|
455
|
-
Outgoing: ModelRelationExpr.Outgoing<A>;
|
|
456
|
-
InOut: ModelRelationExpr.InOut<A>;
|
|
457
|
-
}>;
|
|
458
|
-
/**
|
|
459
|
-
* Represents a version 2 expression which can be one of several types.
|
|
460
|
-
*
|
|
461
|
-
* @template D - The type for the deployment FQN, defaults to `Fqn`.
|
|
462
|
-
* @template M - The type for the model FQN, defaults to `Fqn`.
|
|
463
|
-
*/
|
|
464
|
-
type ModelExpression<A extends Any = Any> = ExclusiveUnion<{
|
|
465
|
-
Wildcard: ModelFqnExpr.Wildcard;
|
|
466
|
-
Ref: ModelFqnExpr.Ref<A>;
|
|
467
|
-
ElementKind: ModelFqnExpr.ElementKindExpr<A>;
|
|
468
|
-
ElementTag: ModelFqnExpr.ElementTagExpr<A>;
|
|
469
|
-
Custom: ModelFqnExpr.Custom<A>;
|
|
470
|
-
Direct: ModelRelationExpr.Direct<A>;
|
|
471
|
-
Incoming: ModelRelationExpr.Incoming<A>;
|
|
472
|
-
Outgoing: ModelRelationExpr.Outgoing<A>;
|
|
473
|
-
InOut: ModelRelationExpr.InOut<A>;
|
|
474
|
-
Where: ModelExpression.Where<A>;
|
|
475
|
-
CustomRelation: ModelRelationExpr.Custom<A>;
|
|
476
|
-
}>;
|
|
477
|
-
declare namespace ModelExpression {
|
|
478
|
-
type Where<A extends Any = Any> = ModelFqnExpr.Where<A> | ModelRelationExpr.Where<A>;
|
|
479
|
-
function isWhere<A extends Any>(expr: ModelExpression<A>): expr is ModelExpression.Where<A>;
|
|
480
|
-
function isRelationWhere<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.Where<A>;
|
|
481
|
-
function isFqnExprWhere<A extends Any>(expr: ModelExpression<A>): expr is ModelFqnExpr.Where<A>;
|
|
482
|
-
function isFqnExpr<A extends Any>(expr: ModelExpression<A>): expr is ModelFqnExpr.Any<A>;
|
|
483
|
-
function isRelationExpr<A extends Any>(expr: ModelExpression<A>): expr is ModelRelationExpr.Any<A>;
|
|
484
|
-
}
|
|
2
|
+
import { A as Any, W as WithOptionalTags, z as WithOptionalLinks, g as StrictViewId, e as _stage, f as _type, F as Fqn, B as WithMetadata, h as ElementKind, l as Tags, m as Metadata, R as RelationKind, V as ViewId, U as Unknown, s as DeploymentFqn, o as DeploymentKind, T as Tag, n as MetadataKey, E as ExtractOnStage, M as ModelStage, P as ProjectId$1, j as ElementId, D as DeploymentId, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted, S as SpecAux, a as Aux, N as Never } from './core.DdzRtJ9d.mjs';
|
|
3
|
+
import { N as NonEmptyArray, E as ExclusiveUnion, L as Link, K as KeysOf } from './core.DuSLYTG6.mjs';
|
|
4
|
+
import { ModelExpression, ModelFqnExpr } from '../types/expression-model.mjs';
|
|
5
|
+
import { I as Icon, M as MarkdownOrString, d as RelationId, T as Tag$1, P as ProjectId, N as NodeId, j as EdgeId, m as StepEdgeKind } from './core.DX-WYEPA.mjs';
|
|
6
|
+
import { b as BorderStyle, a as ShapeSize, S as SpacingSize, T as TextSize, i as Color, c as ElementShape, R as RelationshipLineType, f as RelationshipArrowType, h as ThemeColor, C as ColorLiteral, e as CustomColorDefinitions } from './core.CzdwsPmY.mjs';
|
|
7
|
+
import { FqnRef } from '../types/fqnRef.mjs';
|
|
8
|
+
import { E as Expression, F as FqnExpr } from './core.20m8Um0g.mjs';
|
|
485
9
|
|
|
486
10
|
type Point = readonly [x: number, y: number];
|
|
487
11
|
interface XYPoint {
|
|
@@ -907,7 +431,7 @@ interface LikeC4Project {
|
|
|
907
431
|
/**
|
|
908
432
|
* ID of the project, casted to {@link scalar.ProjectId}
|
|
909
433
|
*/
|
|
910
|
-
readonly id: ProjectId
|
|
434
|
+
readonly id: ProjectId;
|
|
911
435
|
title?: string;
|
|
912
436
|
}
|
|
913
437
|
|
|
@@ -1119,7 +643,7 @@ declare function isDeploymentView<V extends AnyView<any>>(view: V): view is View
|
|
|
1119
643
|
declare function isDynamicView<V extends AnyView<any>>(view: V): view is ViewWithType<V, 'dynamic'>;
|
|
1120
644
|
|
|
1121
645
|
interface BaseLikeC4ModelData<A extends Any> {
|
|
1122
|
-
projectId: ProjectId<A>;
|
|
646
|
+
projectId: ProjectId$1<A>;
|
|
1123
647
|
project: LikeC4Project;
|
|
1124
648
|
specification: Specification<A>;
|
|
1125
649
|
elements: Record<ElementId<A>, Element<A>>;
|
|
@@ -1294,4 +818,4 @@ declare class RichText {
|
|
|
1294
818
|
equals(other: unknown): boolean;
|
|
1295
819
|
}
|
|
1296
820
|
|
|
1297
|
-
export {
|
|
821
|
+
export { isDiagramView as $, type AuxFromLikeC4ModelData as A, BBox as B, type ComputedLikeC4ModelData as C, type DeploymentElementStyle as D, type ElementStyle as E, type Element as F, type GlobalPredicateId as G, DefaultLineStyle as H, DefaultArrowType as I, DefaultRelationshipColor as J, type AbstractRelationship as K, type LayoutedLikeC4ModelData as L, type ModelGlobals as M, type Relationship as N, type ModelRelation as O, type Point as P, type ElementSpecification as Q, RichText as R, type SpecificationDump as S, type TagSpecification as T, isTagColorSpecified as U, type RelationshipSpecification as V, type Specification as W, type XYPoint as X, type LikeC4Project as Y, type ParsedView as Z, type LayoutedView as _, type RichTextEmpty as a, type ElementViewRuleStyle as a$, type ComputedView as a0, type ProcessedView as a1, type AnyView as a2, type ViewOnStage as a3, type ViewWithType as a4, type ViewRule as a5, type ViewRulePredicate as a6, isViewRulePredicate as a7, isViewRuleStyle as a8, isComputedView as a9, type ComputedElementView as aA, type ComputedDeploymentView as aB, type ComputedDynamicView as aC, type DiagramNode as aD, type DiagramEdge as aE, type LayoutedElementView as aF, type LayoutedDeploymentView as aG, type LayoutedDynamicView as aH, type DeploymentViewIncludePredicate as aI, type DeploymentViewExcludePredicate as aJ, type DeploymentViewPredicate as aK, type DeploymentViewRuleStyle as aL, type DeploymentViewRule as aM, type ParsedDeploymentView as aN, type DynamicViewStep as aO, type DynamicViewParallelSteps as aP, getParallelStepsPrefix as aQ, type DynamicViewStepOrParallel as aR, type DynamicViewIncludeRule as aS, type DynamicViewRule as aT, type ParsedDynamicView as aU, isDynamicViewParallelSteps as aV, type ElementViewIncludePredicate as aW, type ElementViewExcludePredicate as aX, type ElementViewPredicate as aY, type ElementViewRuleGroup as aZ, isViewRuleGroup as a_, isElementView as aa, isScopedElementView as ab, isExtendsElementView as ac, isDeploymentView as ad, isDynamicView as ae, type AnyIncludePredicate as af, type AnyExcludePredicate as ag, type AnyViewRuleStyle as ah, type ViewRuleGlobalStyle as ai, isViewRuleGlobalStyle as aj, type ViewRuleGlobalPredicateRef as ak, isViewRuleGlobalPredicateRef as al, type AutoLayoutDirection as am, isAutoLayoutDirection as an, type ViewRuleAutoLayout as ao, isViewRuleAutoLayout as ap, type ViewAutoLayout as aq, type ViewManualLayout as ar, type ViewType as as, type BaseViewProperties as at, type BaseParsedViewProperties as au, type NodeNotation as av, type ViewWithNotation as aw, type ViewWithHash as ax, type ComputedNode as ay, type ComputedEdge as az, type RichTextOrEmpty as b, type ElementViewRule as b0, type ParsedElementView as b1, RectBox as c, type GlobalPredicates as d, type GlobalDynamicPredicates as e, type GlobalStyleID as f, type GlobalStyles as g, type ParsedLikeC4ModelData as h, type LikeC4ModelData as i, type DeploymentNode as j, type DeployedInstance as k, type DeploymentElement as l, type DeploymentElementRef as m, isDeploymentNode as n, isDeployedInstance as o, type DeploymentRelationship as p, type DeploymentRelation as q, type SpecTypesFromDump as r, type LikeC4ModelDump as s, type ProjectDump as t, type AuxFromDump as u, DefaultThemeColor as v, DefaultElementShape as w, DefaultShapeSize as x, DefaultPaddingSize as y, DefaultTextSize as z };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { A as Any, R as RelationKind,
|
|
1
|
+
import { A as Any, R as RelationKind, l as Tags, m as Metadata, n as MetadataKey, L as LooseTag, F as Fqn, j as ElementId, h as ElementKind, o as DeploymentKind, E as ExtractOnStage, p as RelationId$1, g as StrictViewId, f as _type, q as LooseElementId, r as LooseDeploymentId, s as DeploymentFqn, t as toComputed, u as toLayouted, v as Stage, D as DeploymentId, U as Unknown, V as ViewId, T as Tag, w as toParsed, P as ProjectId$1, x as LooseViewId, a as Aux, S as SpecAux, d as UnknownParsed, b as UnknownComputed, c as UnknownLayouted } from './core.DdzRtJ9d.mjs';
|
|
2
2
|
import { d as RelationId, P as ProjectId, a as IconUrl, N as NodeId, G as GroupElementKind, j as EdgeId, k as StepEdgeId, V as ViewId$1 } from './core.DX-WYEPA.mjs';
|
|
3
3
|
import { D as DefaultMap } from './core.CywrQs86.mjs';
|
|
4
4
|
import { SetRequired } from 'type-fest';
|
|
5
|
-
import { b as RichTextOrEmpty,
|
|
5
|
+
import { b as RichTextOrEmpty, N as Relationship, F as Element, E as ElementStyle, a4 as ViewWithType, a0 as ComputedView, _ as LayoutedView, h as ParsedLikeC4ModelData, C as ComputedLikeC4ModelData, L as LayoutedLikeC4ModelData, k as DeployedInstance, D as DeploymentElementStyle, p as DeploymentRelationship, l as DeploymentElement, j as DeploymentNode, s as LikeC4ModelDump, u as AuxFromDump, Y as LikeC4Project, W as Specification, M as ModelGlobals } from './core.aWJgARyY.mjs';
|
|
6
6
|
import { I as IteratorLike, L as Link, N as NonEmptyArray } from './core.DuSLYTG6.mjs';
|
|
7
7
|
import { i as Color, R as RelationshipLineType, c as ElementShape } from './core.CzdwsPmY.mjs';
|
|
8
|
+
import { W as WhereOperator } from './core.20m8Um0g.mjs';
|
|
9
|
+
import { FqnRef } from '../types/fqnRef.mjs';
|
|
8
10
|
|
|
9
11
|
type RelationshipsIterator<A extends Any> = IteratorLike<RelationshipModel<A>>;
|
|
10
12
|
/**
|
|
11
13
|
* A relationship between two elements (in logical or deployment model)
|
|
12
14
|
* use {@link isDeploymentRelationModel} guard to check if the relationship is a deployment relationship
|
|
13
15
|
*/
|
|
14
|
-
interface AnyRelationshipModel<A extends Any> extends WithTags<A>, WithMetadata<A> {
|
|
16
|
+
interface AnyRelationshipModel<A extends Any = Any> extends WithTags<A>, WithMetadata<A> {
|
|
15
17
|
readonly id: RelationId;
|
|
16
18
|
readonly expression: string;
|
|
17
19
|
readonly title: string | null;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { isTruthy, anyPass, allPass, isNot, isString, isNullish } from 'remeda';
|
|
2
|
+
import { n as nonexhaustive } from './core.D4npX2q8.mjs';
|
|
3
|
+
|
|
4
|
+
function isOnStage(value, stage) {
|
|
5
|
+
return value[_stage] === stage;
|
|
6
|
+
}
|
|
7
|
+
const _stage = "_stage";
|
|
8
|
+
const _type = "_type";
|
|
9
|
+
|
|
10
|
+
function isDeploymentNode(el) {
|
|
11
|
+
return "kind" in el && !isTruthy(el.element);
|
|
12
|
+
}
|
|
13
|
+
function isDeployedInstance(el) {
|
|
14
|
+
return "element" in el && isTruthy(el.element);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function isTagEqual(operator) {
|
|
18
|
+
return "tag" in operator;
|
|
19
|
+
}
|
|
20
|
+
function isKindEqual(operator) {
|
|
21
|
+
return "kind" in operator;
|
|
22
|
+
}
|
|
23
|
+
function isParticipantOperator(operator) {
|
|
24
|
+
return "participant" in operator;
|
|
25
|
+
}
|
|
26
|
+
function isNotOperator(operator) {
|
|
27
|
+
return "not" in operator;
|
|
28
|
+
}
|
|
29
|
+
function isAndOperator(operator) {
|
|
30
|
+
return "and" in operator;
|
|
31
|
+
}
|
|
32
|
+
function isOrOperator(operator) {
|
|
33
|
+
return "or" in operator;
|
|
34
|
+
}
|
|
35
|
+
function whereOperatorAsPredicate(operator) {
|
|
36
|
+
switch (true) {
|
|
37
|
+
case isParticipantOperator(operator): {
|
|
38
|
+
const participant = operator.participant;
|
|
39
|
+
const participantPredicate = whereOperatorAsPredicate(operator.operator);
|
|
40
|
+
return participantIs(participant, participantPredicate);
|
|
41
|
+
}
|
|
42
|
+
case isTagEqual(operator): {
|
|
43
|
+
if (isString(operator.tag) || "eq" in operator.tag) {
|
|
44
|
+
const tag2 = isString(operator.tag) ? operator.tag : operator.tag.eq;
|
|
45
|
+
return (value) => {
|
|
46
|
+
return Array.isArray(value.tags) && value.tags.includes(tag2);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const tag = operator.tag.neq;
|
|
50
|
+
return (value) => {
|
|
51
|
+
return !Array.isArray(value.tags) || !value.tags.includes(tag);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
case isKindEqual(operator): {
|
|
55
|
+
if (isString(operator.kind) || "eq" in operator.kind) {
|
|
56
|
+
const kind2 = isString(operator.kind) ? operator.kind : operator.kind.eq;
|
|
57
|
+
return (value) => {
|
|
58
|
+
return value.kind === kind2;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const kind = operator.kind.neq;
|
|
62
|
+
return (value) => {
|
|
63
|
+
return isNullish(value.kind) || value.kind !== kind;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
case isNotOperator(operator): {
|
|
67
|
+
const predicate = whereOperatorAsPredicate(operator.not);
|
|
68
|
+
return isNot(predicate);
|
|
69
|
+
}
|
|
70
|
+
case isAndOperator(operator): {
|
|
71
|
+
const predicates = operator.and.map(whereOperatorAsPredicate);
|
|
72
|
+
return allPass(predicates);
|
|
73
|
+
}
|
|
74
|
+
case isOrOperator(operator): {
|
|
75
|
+
const predicates = operator.or.map(whereOperatorAsPredicate);
|
|
76
|
+
return anyPass(predicates);
|
|
77
|
+
}
|
|
78
|
+
default:
|
|
79
|
+
nonexhaustive(operator);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function participantIs(participant, predicate) {
|
|
83
|
+
return (value) => {
|
|
84
|
+
if (!value.source || !value.target) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
switch (participant) {
|
|
88
|
+
case "source": {
|
|
89
|
+
return predicate(value.source);
|
|
90
|
+
}
|
|
91
|
+
case "target": {
|
|
92
|
+
return predicate(value.target);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { _stage as _, _type as a, isDeploymentNode as b, isDeployedInstance as c, isTagEqual as d, isKindEqual as e, isParticipantOperator as f, isNotOperator as g, isAndOperator as h, isOnStage as i, isOrOperator as j, whereOperatorAsPredicate as w };
|