@domainlang/language 0.12.0 → 0.13.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/out/ast-augmentation.d.ts +7 -2
- package/out/diagram/context-map-diagram-generator.d.ts +9 -2
- package/out/diagram/context-map-diagram-generator.js +112 -63
- package/out/diagram/context-map-diagram-generator.js.map +1 -1
- package/out/generated/ast.d.ts +323 -51
- package/out/generated/ast.js +194 -33
- package/out/generated/ast.js.map +1 -1
- package/out/generated/grammar.js +418 -172
- package/out/generated/grammar.js.map +1 -1
- package/out/lsp/domain-lang-completion.js +39 -15
- package/out/lsp/domain-lang-completion.js.map +1 -1
- package/out/lsp/domain-lang-formatter.js +32 -0
- package/out/lsp/domain-lang-formatter.js.map +1 -1
- package/out/lsp/domain-lang-index-manager.d.ts +2 -3
- package/out/lsp/domain-lang-index-manager.js +5 -8
- package/out/lsp/domain-lang-index-manager.js.map +1 -1
- package/out/lsp/domain-lang-workspace-manager.d.ts +1 -1
- package/out/lsp/domain-lang-workspace-manager.js +2 -26
- package/out/lsp/domain-lang-workspace-manager.js.map +1 -1
- package/out/lsp/explain.js +9 -3
- package/out/lsp/explain.js.map +1 -1
- package/out/lsp/hover/domain-lang-hover.js +13 -11
- package/out/lsp/hover/domain-lang-hover.js.map +1 -1
- package/out/lsp/hover/domain-lang-keywords.js +29 -26
- package/out/lsp/hover/domain-lang-keywords.js.map +1 -1
- package/out/sdk/ast-augmentation.d.ts +29 -21
- package/out/sdk/ast-augmentation.js +11 -7
- package/out/sdk/ast-augmentation.js.map +1 -1
- package/out/sdk/index.d.ts +2 -2
- package/out/sdk/index.js +1 -1
- package/out/sdk/index.js.map +1 -1
- package/out/sdk/loader-node.js +2 -2
- package/out/sdk/loader-node.js.map +1 -1
- package/out/sdk/patterns.d.ts +50 -61
- package/out/sdk/patterns.js +92 -62
- package/out/sdk/patterns.js.map +1 -1
- package/out/sdk/query.js +54 -43
- package/out/sdk/query.js.map +1 -1
- package/out/sdk/serializers.js +20 -7
- package/out/sdk/serializers.js.map +1 -1
- package/out/sdk/types.d.ts +87 -18
- package/out/sdk/types.js.map +1 -1
- package/out/sdk/validator.js +48 -64
- package/out/sdk/validator.js.map +1 -1
- package/out/services/performance-optimizer.d.ts +3 -3
- package/out/services/performance-optimizer.js +1 -3
- package/out/services/performance-optimizer.js.map +1 -1
- package/out/services/relationship-inference.d.ts +4 -4
- package/out/services/relationship-inference.js +34 -46
- package/out/services/relationship-inference.js.map +1 -1
- package/out/syntaxes/domain-lang.monarch.js +1 -1
- package/out/syntaxes/domain-lang.monarch.js.map +1 -1
- package/out/utils/import-utils.d.ts +6 -20
- package/out/utils/import-utils.js +3 -63
- package/out/utils/import-utils.js.map +1 -1
- package/out/validation/constants.d.ts +23 -6
- package/out/validation/constants.js +24 -7
- package/out/validation/constants.js.map +1 -1
- package/out/validation/maps.js +10 -4
- package/out/validation/maps.js.map +1 -1
- package/out/validation/relationships.d.ts +4 -8
- package/out/validation/relationships.js +96 -48
- package/out/validation/relationships.js.map +1 -1
- package/package.json +1 -1
- package/src/ast-augmentation.ts +7 -2
- package/src/diagram/context-map-diagram-generator.ts +132 -70
- package/src/domain-lang.langium +62 -26
- package/src/generated/ast.ts +413 -63
- package/src/generated/grammar.ts +418 -172
- package/src/lsp/domain-lang-completion.ts +42 -15
- package/src/lsp/domain-lang-formatter.ts +34 -0
- package/src/lsp/domain-lang-index-manager.ts +6 -9
- package/src/lsp/domain-lang-workspace-manager.ts +3 -29
- package/src/lsp/explain.ts +10 -2
- package/src/lsp/hover/domain-lang-hover.ts +10 -8
- package/src/lsp/hover/domain-lang-keywords.ts +27 -24
- package/src/sdk/ast-augmentation.ts +30 -21
- package/src/sdk/index.ts +11 -1
- package/src/sdk/loader-node.ts +2 -2
- package/src/sdk/patterns.ts +114 -76
- package/src/sdk/query.ts +57 -48
- package/src/sdk/serializers.ts +20 -7
- package/src/sdk/types.ts +92 -17
- package/src/sdk/validator.ts +52 -69
- package/src/services/performance-optimizer.ts +4 -6
- package/src/services/relationship-inference.ts +43 -54
- package/src/utils/import-utils.ts +9 -74
- package/src/validation/constants.ts +32 -9
- package/src/validation/maps.ts +12 -4
- package/src/validation/relationships.ts +150 -71
package/src/generated/ast.ts
CHANGED
|
@@ -30,11 +30,12 @@ export type DomainLangKeywordNames =
|
|
|
30
30
|
| "BBoM"
|
|
31
31
|
| "BigBallOfMud"
|
|
32
32
|
| "BoundedContext"
|
|
33
|
+
| "C"
|
|
33
34
|
| "CF"
|
|
34
35
|
| "Classification"
|
|
35
36
|
| "Conformist"
|
|
36
37
|
| "ContextMap"
|
|
37
|
-
| "
|
|
38
|
+
| "Customer"
|
|
38
39
|
| "Decision"
|
|
39
40
|
| "Domain"
|
|
40
41
|
| "DomainMap"
|
|
@@ -49,12 +50,14 @@ export type DomainLangKeywordNames =
|
|
|
49
50
|
| "Policy"
|
|
50
51
|
| "PublishedLanguage"
|
|
51
52
|
| "Rule"
|
|
53
|
+
| "S"
|
|
52
54
|
| "SK"
|
|
55
|
+
| "SW"
|
|
53
56
|
| "SeparateWays"
|
|
54
57
|
| "SharedKernel"
|
|
58
|
+
| "Supplier"
|
|
55
59
|
| "Team"
|
|
56
60
|
| "Term"
|
|
57
|
-
| "UpstreamDownstream"
|
|
58
61
|
| "["
|
|
59
62
|
| "]"
|
|
60
63
|
| "aka"
|
|
@@ -114,6 +117,24 @@ export function isAbstractDecision(item: unknown): item is AbstractDecision {
|
|
|
114
117
|
return reflection.isInstance(item, AbstractDecision.$type);
|
|
115
118
|
}
|
|
116
119
|
|
|
120
|
+
/**
|
|
121
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
122
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
123
|
+
* Short and long forms parse to the same node type.
|
|
124
|
+
*/
|
|
125
|
+
export interface AntiCorruptionLayer extends langium.AstNode {
|
|
126
|
+
readonly $container: DirectionalRelationship;
|
|
127
|
+
readonly $type: 'AntiCorruptionLayer';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const AntiCorruptionLayer = {
|
|
131
|
+
$type: 'AntiCorruptionLayer'
|
|
132
|
+
} as const;
|
|
133
|
+
|
|
134
|
+
export function isAntiCorruptionLayer(item: unknown): item is AntiCorruptionLayer {
|
|
135
|
+
return reflection.isInstance(item, AntiCorruptionLayer.$type);
|
|
136
|
+
}
|
|
137
|
+
|
|
117
138
|
/**
|
|
118
139
|
* Assignment operators - flexible syntax.
|
|
119
140
|
*/
|
|
@@ -123,6 +144,24 @@ export function isAssignment(item: unknown): item is Assignment {
|
|
|
123
144
|
return item === ':' || item === 'is' || item === '=';
|
|
124
145
|
}
|
|
125
146
|
|
|
147
|
+
/**
|
|
148
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
149
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
150
|
+
* Short and long forms parse to the same node type.
|
|
151
|
+
*/
|
|
152
|
+
export interface BigBallOfMud extends langium.AstNode {
|
|
153
|
+
readonly $container: DirectionalRelationship;
|
|
154
|
+
readonly $type: 'BigBallOfMud';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const BigBallOfMud = {
|
|
158
|
+
$type: 'BigBallOfMud'
|
|
159
|
+
} as const;
|
|
160
|
+
|
|
161
|
+
export function isBigBallOfMud(item: unknown): item is BigBallOfMud {
|
|
162
|
+
return reflection.isInstance(item, BigBallOfMud.$type);
|
|
163
|
+
}
|
|
164
|
+
|
|
126
165
|
/**
|
|
127
166
|
* Bounded Context - A boundary within which a domain model is defined.
|
|
128
167
|
* Central pattern in DDD for managing complexity and team boundaries.
|
|
@@ -228,6 +267,24 @@ export function isClassification(item: unknown): item is Classification {
|
|
|
228
267
|
return reflection.isInstance(item, Classification.$type);
|
|
229
268
|
}
|
|
230
269
|
|
|
270
|
+
/**
|
|
271
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
272
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
273
|
+
* Short and long forms parse to the same node type.
|
|
274
|
+
*/
|
|
275
|
+
export interface Conformist extends langium.AstNode {
|
|
276
|
+
readonly $container: DirectionalRelationship;
|
|
277
|
+
readonly $type: 'Conformist';
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export const Conformist = {
|
|
281
|
+
$type: 'Conformist'
|
|
282
|
+
} as const;
|
|
283
|
+
|
|
284
|
+
export function isConformist(item: unknown): item is Conformist {
|
|
285
|
+
return reflection.isInstance(item, Conformist.$type);
|
|
286
|
+
}
|
|
287
|
+
|
|
231
288
|
export type Container = Model | NamespaceDeclaration;
|
|
232
289
|
|
|
233
290
|
export const Container = {
|
|
@@ -263,6 +320,24 @@ export function isContextMap(item: unknown): item is ContextMap {
|
|
|
263
320
|
return reflection.isInstance(item, ContextMap.$type);
|
|
264
321
|
}
|
|
265
322
|
|
|
323
|
+
/**
|
|
324
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
325
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
326
|
+
* Short and long forms parse to the same node type.
|
|
327
|
+
*/
|
|
328
|
+
export interface Customer extends langium.AstNode {
|
|
329
|
+
readonly $container: DirectionalRelationship;
|
|
330
|
+
readonly $type: 'Customer';
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export const Customer = {
|
|
334
|
+
$type: 'Customer'
|
|
335
|
+
} as const;
|
|
336
|
+
|
|
337
|
+
export function isCustomer(item: unknown): item is Customer {
|
|
338
|
+
return reflection.isInstance(item, Customer.$type);
|
|
339
|
+
}
|
|
340
|
+
|
|
266
341
|
export interface Decision extends langium.AstNode {
|
|
267
342
|
readonly $container: BoundedContext;
|
|
268
343
|
readonly $type: 'Assignment' | 'Decision';
|
|
@@ -282,6 +357,52 @@ export function isDecision(item: unknown): item is Decision {
|
|
|
282
357
|
return reflection.isInstance(item, Decision.$type);
|
|
283
358
|
}
|
|
284
359
|
|
|
360
|
+
/**
|
|
361
|
+
* Directional relationship arrows.
|
|
362
|
+
*
|
|
363
|
+
* Arrow semantics:
|
|
364
|
+
* -> Upstream to downstream (left provides, right consumes)
|
|
365
|
+
* <- Downstream to upstream (right provides, left consumes)
|
|
366
|
+
* <-> Bidirectional (mutual data flow with explicit patterns)
|
|
367
|
+
*/
|
|
368
|
+
export type DirectionalArrow = '->' | '<-' | '<->';
|
|
369
|
+
|
|
370
|
+
export function isDirectionalArrow(item: unknown): item is DirectionalArrow {
|
|
371
|
+
return item === '<->' || item === '->' || item === '<-';
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Directional relationship - upstream/downstream with optional side patterns.
|
|
376
|
+
*
|
|
377
|
+
* Examples:
|
|
378
|
+
* Orders [OHS] -> [CF] Payments
|
|
379
|
+
* Orders [S] -> [C] Payments
|
|
380
|
+
* Orders -> Payments
|
|
381
|
+
* Orders [OHS] <-> [CF] Payments
|
|
382
|
+
*/
|
|
383
|
+
export interface DirectionalRelationship extends langium.AstNode {
|
|
384
|
+
readonly $container: BoundedContext | ContextMap;
|
|
385
|
+
readonly $type: 'DirectionalRelationship';
|
|
386
|
+
arrow: DirectionalArrow;
|
|
387
|
+
left: BoundedContextRef;
|
|
388
|
+
leftPatterns: Array<SidePattern>;
|
|
389
|
+
right: BoundedContextRef;
|
|
390
|
+
rightPatterns: Array<SidePattern>;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export const DirectionalRelationship = {
|
|
394
|
+
$type: 'DirectionalRelationship',
|
|
395
|
+
arrow: 'arrow',
|
|
396
|
+
left: 'left',
|
|
397
|
+
leftPatterns: 'leftPatterns',
|
|
398
|
+
right: 'right',
|
|
399
|
+
rightPatterns: 'rightPatterns'
|
|
400
|
+
} as const;
|
|
401
|
+
|
|
402
|
+
export function isDirectionalRelationship(item: unknown): item is DirectionalRelationship {
|
|
403
|
+
return reflection.isInstance(item, DirectionalRelationship.$type);
|
|
404
|
+
}
|
|
405
|
+
|
|
285
406
|
/**
|
|
286
407
|
* Domain - A sphere of knowledge or activity in DDD.
|
|
287
408
|
* Can be nested via `in` to show subdomain hierarchy.
|
|
@@ -393,15 +514,6 @@ export function isImportStatement(item: unknown): item is ImportStatement {
|
|
|
393
514
|
return reflection.isInstance(item, ImportStatement.$type);
|
|
394
515
|
}
|
|
395
516
|
|
|
396
|
-
/**
|
|
397
|
-
* DDD Integration Patterns (used in relationships).
|
|
398
|
-
*/
|
|
399
|
-
export type IntegrationPattern = 'ACL' | 'AntiCorruptionLayer' | 'BBoM' | 'BigBallOfMud' | 'CF' | 'Conformist' | 'OHS' | 'OpenHostService' | 'P' | 'PL' | 'Partnership' | 'PublishedLanguage' | 'SK' | 'SharedKernel';
|
|
400
|
-
|
|
401
|
-
export function isIntegrationPattern(item: unknown): item is IntegrationPattern {
|
|
402
|
-
return item === 'PL' || item === 'PublishedLanguage' || item === 'OHS' || item === 'OpenHostService' || item === 'CF' || item === 'Conformist' || item === 'ACL' || item === 'AntiCorruptionLayer' || item === 'P' || item === 'Partnership' || item === 'SK' || item === 'SharedKernel' || item === 'BBoM' || item === 'BigBallOfMud';
|
|
403
|
-
}
|
|
404
|
-
|
|
405
517
|
/**
|
|
406
518
|
* Metadata - Defines a key that can be used in metadata blocks.
|
|
407
519
|
* Examples: Language, Framework, Database, Repository.
|
|
@@ -497,6 +609,41 @@ export function isObjectMap(item: unknown): item is ObjectMap {
|
|
|
497
609
|
return reflection.isInstance(item, ObjectMap.$type);
|
|
498
610
|
}
|
|
499
611
|
|
|
612
|
+
/**
|
|
613
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
614
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
615
|
+
* Short and long forms parse to the same node type.
|
|
616
|
+
*/
|
|
617
|
+
export interface OpenHostService extends langium.AstNode {
|
|
618
|
+
readonly $container: DirectionalRelationship;
|
|
619
|
+
readonly $type: 'OpenHostService';
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
export const OpenHostService = {
|
|
623
|
+
$type: 'OpenHostService'
|
|
624
|
+
} as const;
|
|
625
|
+
|
|
626
|
+
export function isOpenHostService(item: unknown): item is OpenHostService {
|
|
627
|
+
return reflection.isInstance(item, OpenHostService.$type);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* DDD Symmetric Patterns - describe the relationship between two contexts.
|
|
632
|
+
* These are mutual/shared patterns, not directional.
|
|
633
|
+
*/
|
|
634
|
+
export interface Partnership extends langium.AstNode {
|
|
635
|
+
readonly $container: SymmetricRelationship;
|
|
636
|
+
readonly $type: 'Partnership';
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
export const Partnership = {
|
|
640
|
+
$type: 'Partnership'
|
|
641
|
+
} as const;
|
|
642
|
+
|
|
643
|
+
export function isPartnership(item: unknown): item is Partnership {
|
|
644
|
+
return reflection.isInstance(item, Partnership.$type);
|
|
645
|
+
}
|
|
646
|
+
|
|
500
647
|
export interface Policy extends langium.AstNode {
|
|
501
648
|
readonly $container: BoundedContext;
|
|
502
649
|
readonly $type: 'Assignment' | 'Policy';
|
|
@@ -516,6 +663,24 @@ export function isPolicy(item: unknown): item is Policy {
|
|
|
516
663
|
return reflection.isInstance(item, Policy.$type);
|
|
517
664
|
}
|
|
518
665
|
|
|
666
|
+
/**
|
|
667
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
668
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
669
|
+
* Short and long forms parse to the same node type.
|
|
670
|
+
*/
|
|
671
|
+
export interface PublishedLanguage extends langium.AstNode {
|
|
672
|
+
readonly $container: DirectionalRelationship;
|
|
673
|
+
readonly $type: 'PublishedLanguage';
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export const PublishedLanguage = {
|
|
677
|
+
$type: 'PublishedLanguage'
|
|
678
|
+
} as const;
|
|
679
|
+
|
|
680
|
+
export function isPublishedLanguage(item: unknown): item is PublishedLanguage {
|
|
681
|
+
return reflection.isInstance(item, PublishedLanguage.$type);
|
|
682
|
+
}
|
|
683
|
+
|
|
519
684
|
/**
|
|
520
685
|
* Qualified Name - Hierarchical namespacing with dots.
|
|
521
686
|
*/
|
|
@@ -527,29 +692,20 @@ export function isQualifiedName(item: unknown): item is QualifiedName {
|
|
|
527
692
|
|
|
528
693
|
/**
|
|
529
694
|
* Relationship - Connection between two Bounded Contexts.
|
|
530
|
-
*
|
|
695
|
+
* Uses entity–relationship–entity structure where the relationship expression
|
|
696
|
+
* (type, arrow, side annotations) sits between the two entity references.
|
|
697
|
+
*
|
|
698
|
+
* Forms:
|
|
699
|
+
* Directional: Orders [OHS] -> [CF] Payments
|
|
700
|
+
* Symmetric: CardManagement [SK] AccountManagement
|
|
701
|
+
* Separate Ways arrow: Orders >< Payments
|
|
531
702
|
*
|
|
532
703
|
* [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)
|
|
533
704
|
*/
|
|
534
|
-
export
|
|
535
|
-
readonly $container: BoundedContext | ContextMap;
|
|
536
|
-
readonly $type: 'Assignment' | 'Relationship';
|
|
537
|
-
arrow: RelationshipArrow;
|
|
538
|
-
left: BoundedContextRef;
|
|
539
|
-
leftPatterns: Array<IntegrationPattern>;
|
|
540
|
-
right: BoundedContextRef;
|
|
541
|
-
rightPatterns: Array<IntegrationPattern>;
|
|
542
|
-
type?: RelationshipType;
|
|
543
|
-
}
|
|
705
|
+
export type Relationship = DirectionalRelationship | SymmetricRelationship;
|
|
544
706
|
|
|
545
707
|
export const Relationship = {
|
|
546
|
-
$type: 'Relationship'
|
|
547
|
-
arrow: 'arrow',
|
|
548
|
-
left: 'left',
|
|
549
|
-
leftPatterns: 'leftPatterns',
|
|
550
|
-
right: 'right',
|
|
551
|
-
rightPatterns: 'rightPatterns',
|
|
552
|
-
type: 'type'
|
|
708
|
+
$type: 'Relationship'
|
|
553
709
|
} as const;
|
|
554
710
|
|
|
555
711
|
export function isRelationship(item: unknown): item is Relationship {
|
|
@@ -557,27 +713,52 @@ export function isRelationship(item: unknown): item is Relationship {
|
|
|
557
713
|
}
|
|
558
714
|
|
|
559
715
|
/**
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
* Arrow semantics:
|
|
563
|
-
* -> Upstream to downstream (left provides, right consumes)
|
|
564
|
-
* <- Downstream to upstream (right provides, left consumes)
|
|
565
|
-
* <-> Bidirectional/Partnership (mutual dependency)
|
|
566
|
-
* >< Separate Ways (no integration, teams go their own way)
|
|
716
|
+
* DDD Symmetric Patterns - describe the relationship between two contexts.
|
|
717
|
+
* These are mutual/shared patterns, not directional.
|
|
567
718
|
*/
|
|
568
|
-
export
|
|
719
|
+
export interface SeparateWays extends langium.AstNode {
|
|
720
|
+
readonly $container: SymmetricRelationship;
|
|
721
|
+
readonly $type: 'SeparateWays';
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export const SeparateWays = {
|
|
725
|
+
$type: 'SeparateWays'
|
|
726
|
+
} as const;
|
|
727
|
+
|
|
728
|
+
export function isSeparateWays(item: unknown): item is SeparateWays {
|
|
729
|
+
return reflection.isInstance(item, SeparateWays.$type);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* DDD Symmetric Patterns - describe the relationship between two contexts.
|
|
734
|
+
* These are mutual/shared patterns, not directional.
|
|
735
|
+
*/
|
|
736
|
+
export interface SharedKernel extends langium.AstNode {
|
|
737
|
+
readonly $container: SymmetricRelationship;
|
|
738
|
+
readonly $type: 'SharedKernel';
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export const SharedKernel = {
|
|
742
|
+
$type: 'SharedKernel'
|
|
743
|
+
} as const;
|
|
569
744
|
|
|
570
|
-
export function
|
|
571
|
-
return item
|
|
745
|
+
export function isSharedKernel(item: unknown): item is SharedKernel {
|
|
746
|
+
return reflection.isInstance(item, SharedKernel.$type);
|
|
572
747
|
}
|
|
573
748
|
|
|
574
749
|
/**
|
|
575
|
-
* DDD
|
|
750
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
751
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
752
|
+
* Short and long forms parse to the same node type.
|
|
576
753
|
*/
|
|
577
|
-
export type
|
|
754
|
+
export type SidePattern = AntiCorruptionLayer | BigBallOfMud | Conformist | Customer | OpenHostService | PublishedLanguage | Supplier;
|
|
755
|
+
|
|
756
|
+
export const SidePattern = {
|
|
757
|
+
$type: 'SidePattern'
|
|
758
|
+
} as const;
|
|
578
759
|
|
|
579
|
-
export function
|
|
580
|
-
return item
|
|
760
|
+
export function isSidePattern(item: unknown): item is SidePattern {
|
|
761
|
+
return reflection.isInstance(item, SidePattern.$type);
|
|
581
762
|
}
|
|
582
763
|
|
|
583
764
|
/**
|
|
@@ -594,6 +775,68 @@ export function isStructureElement(item: unknown): item is StructureElement {
|
|
|
594
775
|
return reflection.isInstance(item, StructureElement.$type);
|
|
595
776
|
}
|
|
596
777
|
|
|
778
|
+
/**
|
|
779
|
+
* DDD Side Patterns - describe one side's role in a directional relationship.
|
|
780
|
+
* Each pattern produces a distinct AST node type via {infer} actions.
|
|
781
|
+
* Short and long forms parse to the same node type.
|
|
782
|
+
*/
|
|
783
|
+
export interface Supplier extends langium.AstNode {
|
|
784
|
+
readonly $container: DirectionalRelationship;
|
|
785
|
+
readonly $type: 'Supplier';
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export const Supplier = {
|
|
789
|
+
$type: 'Supplier'
|
|
790
|
+
} as const;
|
|
791
|
+
|
|
792
|
+
export function isSupplier(item: unknown): item is Supplier {
|
|
793
|
+
return reflection.isInstance(item, Supplier.$type);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* DDD Symmetric Patterns - describe the relationship between two contexts.
|
|
798
|
+
* These are mutual/shared patterns, not directional.
|
|
799
|
+
*/
|
|
800
|
+
export type SymmetricPattern = Partnership | SeparateWays | SharedKernel;
|
|
801
|
+
|
|
802
|
+
export const SymmetricPattern = {
|
|
803
|
+
$type: 'SymmetricPattern'
|
|
804
|
+
} as const;
|
|
805
|
+
|
|
806
|
+
export function isSymmetricPattern(item: unknown): item is SymmetricPattern {
|
|
807
|
+
return reflection.isInstance(item, SymmetricPattern.$type);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Symmetric relationship - mutual pattern between two contexts, no directionality.
|
|
812
|
+
*
|
|
813
|
+
* Examples:
|
|
814
|
+
* CardManagement [SK] AccountManagement
|
|
815
|
+
* Orders [P] Payments
|
|
816
|
+
* Orders >< Payments
|
|
817
|
+
* Orders [SW] Payments
|
|
818
|
+
*/
|
|
819
|
+
export interface SymmetricRelationship extends langium.AstNode {
|
|
820
|
+
readonly $container: BoundedContext | ContextMap;
|
|
821
|
+
readonly $type: 'SymmetricRelationship';
|
|
822
|
+
arrow?: '><';
|
|
823
|
+
left: BoundedContextRef;
|
|
824
|
+
pattern?: SymmetricPattern;
|
|
825
|
+
right: BoundedContextRef;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export const SymmetricRelationship = {
|
|
829
|
+
$type: 'SymmetricRelationship',
|
|
830
|
+
arrow: 'arrow',
|
|
831
|
+
left: 'left',
|
|
832
|
+
pattern: 'pattern',
|
|
833
|
+
right: 'right'
|
|
834
|
+
} as const;
|
|
835
|
+
|
|
836
|
+
export function isSymmetricRelationship(item: unknown): item is SymmetricRelationship {
|
|
837
|
+
return reflection.isInstance(item, SymmetricRelationship.$type);
|
|
838
|
+
}
|
|
839
|
+
|
|
597
840
|
/**
|
|
598
841
|
* Team - People responsible for a Bounded Context or Domain.
|
|
599
842
|
* Represents organizational boundaries in DDD.
|
|
@@ -646,13 +889,18 @@ export function isType(item: unknown): item is Type {
|
|
|
646
889
|
|
|
647
890
|
export type DomainLangAstType = {
|
|
648
891
|
AbstractDecision: AbstractDecision
|
|
892
|
+
AntiCorruptionLayer: AntiCorruptionLayer
|
|
893
|
+
BigBallOfMud: BigBallOfMud
|
|
649
894
|
BoundedContext: BoundedContext
|
|
650
895
|
BoundedContextRef: BoundedContextRef
|
|
651
896
|
BusinessRule: BusinessRule
|
|
652
897
|
Classification: Classification
|
|
898
|
+
Conformist: Conformist
|
|
653
899
|
Container: Container
|
|
654
900
|
ContextMap: ContextMap
|
|
901
|
+
Customer: Customer
|
|
655
902
|
Decision: Decision
|
|
903
|
+
DirectionalRelationship: DirectionalRelationship
|
|
656
904
|
Domain: Domain
|
|
657
905
|
DomainMap: DomainMap
|
|
658
906
|
DomainTerm: DomainTerm
|
|
@@ -662,9 +910,18 @@ export type DomainLangAstType = {
|
|
|
662
910
|
Model: Model
|
|
663
911
|
NamespaceDeclaration: NamespaceDeclaration
|
|
664
912
|
ObjectMap: ObjectMap
|
|
913
|
+
OpenHostService: OpenHostService
|
|
914
|
+
Partnership: Partnership
|
|
665
915
|
Policy: Policy
|
|
916
|
+
PublishedLanguage: PublishedLanguage
|
|
666
917
|
Relationship: Relationship
|
|
918
|
+
SeparateWays: SeparateWays
|
|
919
|
+
SharedKernel: SharedKernel
|
|
920
|
+
SidePattern: SidePattern
|
|
667
921
|
StructureElement: StructureElement
|
|
922
|
+
Supplier: Supplier
|
|
923
|
+
SymmetricPattern: SymmetricPattern
|
|
924
|
+
SymmetricRelationship: SymmetricRelationship
|
|
668
925
|
Team: Team
|
|
669
926
|
ThisRef: ThisRef
|
|
670
927
|
Type: Type
|
|
@@ -678,6 +935,18 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
678
935
|
},
|
|
679
936
|
superTypes: []
|
|
680
937
|
},
|
|
938
|
+
AntiCorruptionLayer: {
|
|
939
|
+
name: AntiCorruptionLayer.$type,
|
|
940
|
+
properties: {
|
|
941
|
+
},
|
|
942
|
+
superTypes: [SidePattern.$type]
|
|
943
|
+
},
|
|
944
|
+
BigBallOfMud: {
|
|
945
|
+
name: BigBallOfMud.$type,
|
|
946
|
+
properties: {
|
|
947
|
+
},
|
|
948
|
+
superTypes: [SidePattern.$type]
|
|
949
|
+
},
|
|
681
950
|
BoundedContext: {
|
|
682
951
|
name: BoundedContext.$type,
|
|
683
952
|
properties: {
|
|
@@ -767,6 +1036,12 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
767
1036
|
},
|
|
768
1037
|
superTypes: [Type.$type]
|
|
769
1038
|
},
|
|
1039
|
+
Conformist: {
|
|
1040
|
+
name: Conformist.$type,
|
|
1041
|
+
properties: {
|
|
1042
|
+
},
|
|
1043
|
+
superTypes: [SidePattern.$type]
|
|
1044
|
+
},
|
|
770
1045
|
Container: {
|
|
771
1046
|
name: Container.$type,
|
|
772
1047
|
properties: {
|
|
@@ -791,6 +1066,12 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
791
1066
|
},
|
|
792
1067
|
superTypes: [ObjectMap.$type]
|
|
793
1068
|
},
|
|
1069
|
+
Customer: {
|
|
1070
|
+
name: Customer.$type,
|
|
1071
|
+
properties: {
|
|
1072
|
+
},
|
|
1073
|
+
superTypes: [SidePattern.$type]
|
|
1074
|
+
},
|
|
794
1075
|
Decision: {
|
|
795
1076
|
name: Decision.$type,
|
|
796
1077
|
properties: {
|
|
@@ -807,6 +1088,29 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
807
1088
|
},
|
|
808
1089
|
superTypes: [AbstractDecision.$type]
|
|
809
1090
|
},
|
|
1091
|
+
DirectionalRelationship: {
|
|
1092
|
+
name: DirectionalRelationship.$type,
|
|
1093
|
+
properties: {
|
|
1094
|
+
arrow: {
|
|
1095
|
+
name: DirectionalRelationship.arrow
|
|
1096
|
+
},
|
|
1097
|
+
left: {
|
|
1098
|
+
name: DirectionalRelationship.left
|
|
1099
|
+
},
|
|
1100
|
+
leftPatterns: {
|
|
1101
|
+
name: DirectionalRelationship.leftPatterns,
|
|
1102
|
+
defaultValue: []
|
|
1103
|
+
},
|
|
1104
|
+
right: {
|
|
1105
|
+
name: DirectionalRelationship.right
|
|
1106
|
+
},
|
|
1107
|
+
rightPatterns: {
|
|
1108
|
+
name: DirectionalRelationship.rightPatterns,
|
|
1109
|
+
defaultValue: []
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
superTypes: [Relationship.$type]
|
|
1113
|
+
},
|
|
810
1114
|
Domain: {
|
|
811
1115
|
name: Domain.$type,
|
|
812
1116
|
properties: {
|
|
@@ -931,6 +1235,18 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
931
1235
|
},
|
|
932
1236
|
superTypes: [StructureElement.$type]
|
|
933
1237
|
},
|
|
1238
|
+
OpenHostService: {
|
|
1239
|
+
name: OpenHostService.$type,
|
|
1240
|
+
properties: {
|
|
1241
|
+
},
|
|
1242
|
+
superTypes: [SidePattern.$type]
|
|
1243
|
+
},
|
|
1244
|
+
Partnership: {
|
|
1245
|
+
name: Partnership.$type,
|
|
1246
|
+
properties: {
|
|
1247
|
+
},
|
|
1248
|
+
superTypes: [SymmetricPattern.$type]
|
|
1249
|
+
},
|
|
934
1250
|
Policy: {
|
|
935
1251
|
name: Policy.$type,
|
|
936
1252
|
properties: {
|
|
@@ -947,29 +1263,33 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
947
1263
|
},
|
|
948
1264
|
superTypes: [AbstractDecision.$type]
|
|
949
1265
|
},
|
|
1266
|
+
PublishedLanguage: {
|
|
1267
|
+
name: PublishedLanguage.$type,
|
|
1268
|
+
properties: {
|
|
1269
|
+
},
|
|
1270
|
+
superTypes: [SidePattern.$type]
|
|
1271
|
+
},
|
|
950
1272
|
Relationship: {
|
|
951
1273
|
name: Relationship.$type,
|
|
952
1274
|
properties: {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
name: Relationship.type
|
|
972
|
-
}
|
|
1275
|
+
},
|
|
1276
|
+
superTypes: []
|
|
1277
|
+
},
|
|
1278
|
+
SeparateWays: {
|
|
1279
|
+
name: SeparateWays.$type,
|
|
1280
|
+
properties: {
|
|
1281
|
+
},
|
|
1282
|
+
superTypes: [SymmetricPattern.$type]
|
|
1283
|
+
},
|
|
1284
|
+
SharedKernel: {
|
|
1285
|
+
name: SharedKernel.$type,
|
|
1286
|
+
properties: {
|
|
1287
|
+
},
|
|
1288
|
+
superTypes: [SymmetricPattern.$type]
|
|
1289
|
+
},
|
|
1290
|
+
SidePattern: {
|
|
1291
|
+
name: SidePattern.$type,
|
|
1292
|
+
properties: {
|
|
973
1293
|
},
|
|
974
1294
|
superTypes: []
|
|
975
1295
|
},
|
|
@@ -979,6 +1299,36 @@ export class DomainLangAstReflection extends langium.AbstractAstReflection {
|
|
|
979
1299
|
},
|
|
980
1300
|
superTypes: []
|
|
981
1301
|
},
|
|
1302
|
+
Supplier: {
|
|
1303
|
+
name: Supplier.$type,
|
|
1304
|
+
properties: {
|
|
1305
|
+
},
|
|
1306
|
+
superTypes: [SidePattern.$type]
|
|
1307
|
+
},
|
|
1308
|
+
SymmetricPattern: {
|
|
1309
|
+
name: SymmetricPattern.$type,
|
|
1310
|
+
properties: {
|
|
1311
|
+
},
|
|
1312
|
+
superTypes: []
|
|
1313
|
+
},
|
|
1314
|
+
SymmetricRelationship: {
|
|
1315
|
+
name: SymmetricRelationship.$type,
|
|
1316
|
+
properties: {
|
|
1317
|
+
arrow: {
|
|
1318
|
+
name: SymmetricRelationship.arrow
|
|
1319
|
+
},
|
|
1320
|
+
left: {
|
|
1321
|
+
name: SymmetricRelationship.left
|
|
1322
|
+
},
|
|
1323
|
+
pattern: {
|
|
1324
|
+
name: SymmetricRelationship.pattern
|
|
1325
|
+
},
|
|
1326
|
+
right: {
|
|
1327
|
+
name: SymmetricRelationship.right
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1330
|
+
superTypes: [Relationship.$type]
|
|
1331
|
+
},
|
|
982
1332
|
Team: {
|
|
983
1333
|
name: Team.$type,
|
|
984
1334
|
properties: {
|