@fornari-lanza/domain-design-language-language 0.0.1
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/README.md +24 -0
- package/out/domain-design-language-formatter.d.ts +5 -0
- package/out/domain-design-language-formatter.js +197 -0
- package/out/domain-design-language-formatter.js.map +1 -0
- package/out/domain-design-language-module.d.ts +41 -0
- package/out/domain-design-language-module.js +50 -0
- package/out/domain-design-language-module.js.map +1 -0
- package/out/domain-design-language-scope.d.ts +8 -0
- package/out/domain-design-language-scope.js +79 -0
- package/out/domain-design-language-scope.js.map +1 -0
- package/out/domain-design-language-validator.d.ts +39 -0
- package/out/domain-design-language-validator.js +468 -0
- package/out/domain-design-language-validator.js.map +1 -0
- package/out/generated/ast.d.ts +1393 -0
- package/out/generated/ast.js +1147 -0
- package/out/generated/ast.js.map +1 -0
- package/out/generated/grammar.d.ts +6 -0
- package/out/generated/grammar.js +3430 -0
- package/out/generated/grammar.js.map +1 -0
- package/out/generated/module.d.ts +13 -0
- package/out/generated/module.js +21 -0
- package/out/generated/module.js.map +1 -0
- package/out/index.d.ts +5 -0
- package/out/index.js +6 -0
- package/out/index.js.map +1 -0
- package/package.json +49 -0
- package/src/domain-design-language-formatter.ts +186 -0
- package/src/domain-design-language-module.ts +96 -0
- package/src/domain-design-language-scope.ts +132 -0
- package/src/domain-design-language-validator.ts +699 -0
- package/src/domain-design-language.langium +299 -0
- package/src/generated/ast.ts +1737 -0
- package/src/generated/grammar.ts +3432 -0
- package/src/generated/module.ts +25 -0
- package/src/index.ts +5 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { isActor, isAggregateRoot, isAsymmetricRelationship, isExternalSystem, isPolicyTrigger,
|
|
2
|
+
//isPortReferenceDependency,
|
|
3
|
+
isProjection, isReadModel, isSymmetricRelationship, isValueObject, isMethod, } from './generated/ast.js';
|
|
4
|
+
/**
|
|
5
|
+
* Register custom validation checks.
|
|
6
|
+
*/
|
|
7
|
+
export function registerValidationChecks(services) {
|
|
8
|
+
const registry = services.validation.ValidationRegistry;
|
|
9
|
+
const validator = services.validation.DomainDesignLanguageValidator;
|
|
10
|
+
const checks = {
|
|
11
|
+
DomainModel: validator.checkUniquePurpose,
|
|
12
|
+
BoundedContext: [
|
|
13
|
+
validator.checkUniqueAggregates,
|
|
14
|
+
validator.checkUniqueDomainServices,
|
|
15
|
+
validator.checkUniquePorts,
|
|
16
|
+
validator.checkUniqueCommands,
|
|
17
|
+
validator.checkNameStartsWithCapital,
|
|
18
|
+
],
|
|
19
|
+
UbiquitousLanguageDeclaration: validator.checkUniqueTerms,
|
|
20
|
+
Term: validator.checkNameStartsWithCapital,
|
|
21
|
+
ContextMap: validator.checkUniqueRelationships,
|
|
22
|
+
Relationship: validator.checkSelfRelationships,
|
|
23
|
+
AsymmetricRelationship: validator.checkRelationshipRoles,
|
|
24
|
+
AggregateRoot: [
|
|
25
|
+
validator.checkNameStartsWithCapital,
|
|
26
|
+
validator.checkUniqueAttributes,
|
|
27
|
+
],
|
|
28
|
+
ValueObject: [
|
|
29
|
+
validator.checkNameStartsWithCapital,
|
|
30
|
+
validator.checkUniquePrimitiveAttributes,
|
|
31
|
+
],
|
|
32
|
+
Entity: [
|
|
33
|
+
validator.checkNameStartsWithCapital,
|
|
34
|
+
validator.checkUniqueAttributes,
|
|
35
|
+
],
|
|
36
|
+
DomainEvent: [
|
|
37
|
+
validator.checkNameStartsWithCapital,
|
|
38
|
+
validator.checkNameIsInPastTense,
|
|
39
|
+
],
|
|
40
|
+
DomainService: [
|
|
41
|
+
validator.checkNameStartsWithCapital,
|
|
42
|
+
validator.checkUniqueDtoAttributes,
|
|
43
|
+
],
|
|
44
|
+
Method: [
|
|
45
|
+
validator.checkUniqueDtoAttributes,
|
|
46
|
+
validator.checkNameIsCamelCase,
|
|
47
|
+
],
|
|
48
|
+
DomainException: validator.checkNameStartsWithCapital,
|
|
49
|
+
Payload: validator.checkUniquePrimitiveAttributes,
|
|
50
|
+
MethodsDeclaration: validator.checkUniqueMethods,
|
|
51
|
+
ExceptionsDeclaration: validator.checkUniqueExceptions,
|
|
52
|
+
DomainEventsDeclaration: validator.checkUniqueDomainEvents,
|
|
53
|
+
Port: validator.checkNameStartsWithCapital,
|
|
54
|
+
Command: [
|
|
55
|
+
validator.checkNameStartsWithCapital,
|
|
56
|
+
validator.checkUniqueDtoAttributes,
|
|
57
|
+
validator.checkUniqueCommandElements,
|
|
58
|
+
],
|
|
59
|
+
Enum: validator.checkUniqueValues,
|
|
60
|
+
EventStormingElement: validator.checkNameStartsWithCapital,
|
|
61
|
+
Policy: validator.checkNameStartsWithCapital,
|
|
62
|
+
ProcessFlow: [
|
|
63
|
+
validator.checkNameStartsWithCapital,
|
|
64
|
+
validator.checkUniquePolicies,
|
|
65
|
+
],
|
|
66
|
+
EventStormingDeclaration: validator.checkUniqueEventStormingElements,
|
|
67
|
+
ReactionStep: validator.checkUniqueOutcomes,
|
|
68
|
+
};
|
|
69
|
+
registry.register(checks, validator);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Implementation of custom validations.
|
|
73
|
+
*/
|
|
74
|
+
export class DomainDesignLanguageValidator {
|
|
75
|
+
checkUniquePurpose(model, accept) {
|
|
76
|
+
if (model.boundedContext && model.contextMap)
|
|
77
|
+
accept('error', 'A file cannot contain both a Bounded Context and a Context Map. Please move the Context Map to a separate file.', {
|
|
78
|
+
node: model.contextMap,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
checkUniqueTerms(ubiquitousLanguage, accept) {
|
|
82
|
+
const terms = new Set();
|
|
83
|
+
ubiquitousLanguage.terms.forEach((term) => {
|
|
84
|
+
if (terms.has(term.name))
|
|
85
|
+
accept('error', `Repeated term name '${term.name}' in bounded context '${ubiquitousLanguage.$container.name}'.`, {
|
|
86
|
+
node: term,
|
|
87
|
+
property: 'name',
|
|
88
|
+
});
|
|
89
|
+
terms.add(term.name);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
checkUniqueAggregates(boundedContext, accept) {
|
|
93
|
+
const aggregates = new Set();
|
|
94
|
+
boundedContext.aggregates.forEach((aggregate) => {
|
|
95
|
+
if (aggregates.has(aggregate.name))
|
|
96
|
+
accept('error', `Repeated aggregate root name '${aggregate.name}' in bounded context '${boundedContext.name}'.`, {
|
|
97
|
+
node: aggregate,
|
|
98
|
+
property: 'name',
|
|
99
|
+
});
|
|
100
|
+
aggregates.add(aggregate.name);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
checkUniqueDomainServices(boundedContext, accept) {
|
|
104
|
+
const domainServices = new Set();
|
|
105
|
+
boundedContext.domainServices.forEach((domainService) => {
|
|
106
|
+
if (domainServices.has(domainService.name))
|
|
107
|
+
accept('error', `Repeated domain service name '${domainService.name}' in bounded context '${boundedContext.name}'.`, {
|
|
108
|
+
node: domainService,
|
|
109
|
+
property: 'name',
|
|
110
|
+
});
|
|
111
|
+
domainServices.add(domainService.name);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
checkUniquePorts(boundedContext, accept) {
|
|
115
|
+
const ports = new Set();
|
|
116
|
+
boundedContext.ports.forEach((port) => {
|
|
117
|
+
if (ports.has(port.name))
|
|
118
|
+
accept('error', `Repeated port name '${port.name}' in bounded context '${boundedContext.name}'.`, {
|
|
119
|
+
node: port,
|
|
120
|
+
property: 'name',
|
|
121
|
+
});
|
|
122
|
+
ports.add(port.name);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
checkUniqueCommands(boundedContext, accept) {
|
|
126
|
+
const commands = new Set();
|
|
127
|
+
boundedContext.commands.forEach((command) => {
|
|
128
|
+
if (commands.has(command.name))
|
|
129
|
+
accept('error', `Repeated command name '${command.name}' in bounded context '${boundedContext.name}'.`, {
|
|
130
|
+
node: command,
|
|
131
|
+
property: 'name',
|
|
132
|
+
});
|
|
133
|
+
commands.add(command.name);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
checkUniqueEventStormingElements(eventStormingDeclaration, accept) {
|
|
137
|
+
const actors = new Set();
|
|
138
|
+
const readModels = new Set();
|
|
139
|
+
const externalSystems = new Set();
|
|
140
|
+
eventStormingDeclaration.elements.forEach((element) => {
|
|
141
|
+
if (isActor(element)) {
|
|
142
|
+
if (actors.has(element.name))
|
|
143
|
+
accept('error', `Repeated actor name '${element.name}' in event storming.`, {
|
|
144
|
+
node: element,
|
|
145
|
+
property: 'name',
|
|
146
|
+
});
|
|
147
|
+
actors.add(element.name);
|
|
148
|
+
}
|
|
149
|
+
else if (isReadModel(element)) {
|
|
150
|
+
if (readModels.has(element.name))
|
|
151
|
+
accept('error', `Repeated read model name '${element.name}' in event storming.`, {
|
|
152
|
+
node: element,
|
|
153
|
+
property: 'name',
|
|
154
|
+
});
|
|
155
|
+
readModels.add(element.name);
|
|
156
|
+
}
|
|
157
|
+
else if (isExternalSystem(element)) {
|
|
158
|
+
if (externalSystems.has(element.name))
|
|
159
|
+
accept('error', `Repeated external system name '${element.name}' in event storming.`, {
|
|
160
|
+
node: element,
|
|
161
|
+
property: 'name',
|
|
162
|
+
});
|
|
163
|
+
externalSystems.add(element.name);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const processFlows = new Set();
|
|
167
|
+
eventStormingDeclaration.flows.forEach((processFlow) => {
|
|
168
|
+
if (processFlows.has(processFlow.name))
|
|
169
|
+
accept('error', `Repeated process flow name '${processFlow.name}' in event storming.`, {
|
|
170
|
+
node: processFlow,
|
|
171
|
+
property: 'name',
|
|
172
|
+
});
|
|
173
|
+
processFlows.add(processFlow.name);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
checkUniquePolicies(processFlow, accept) {
|
|
177
|
+
const policies = new Set();
|
|
178
|
+
const outcomes = processFlow.reactions.flatMap((step) => step.outcomes.filter(isPolicyTrigger));
|
|
179
|
+
outcomes.forEach((outcome) => {
|
|
180
|
+
if (outcome.policy.name && policies.has(outcome.policy.name))
|
|
181
|
+
accept('error', `Repeated policy '${outcome.policy.name}' in process flow.`, {
|
|
182
|
+
node: outcome,
|
|
183
|
+
property: 'policy',
|
|
184
|
+
});
|
|
185
|
+
policies.add(outcome.policy?.name || '');
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
checkUniqueOutcomes(step, accept) {
|
|
189
|
+
const readModels = new Set();
|
|
190
|
+
const policies = new Set();
|
|
191
|
+
step.outcomes.forEach((outcome) => {
|
|
192
|
+
if (isProjection(outcome)) {
|
|
193
|
+
if (outcome.readModel.ref?.name &&
|
|
194
|
+
readModels.has(outcome.readModel.ref?.name))
|
|
195
|
+
accept('error', `Repeated read model '${outcome.readModel.ref?.name}' projection in 'on' definition.`, {
|
|
196
|
+
node: outcome,
|
|
197
|
+
property: 'readModel',
|
|
198
|
+
});
|
|
199
|
+
readModels.add(outcome.readModel?.ref?.name || '');
|
|
200
|
+
}
|
|
201
|
+
else if (isPolicyTrigger(outcome)) {
|
|
202
|
+
if (outcome.policy.name && policies.has(outcome.policy.name))
|
|
203
|
+
accept('error', `Repeated policy '${outcome.policy.name}' in 'on' definition.`, {
|
|
204
|
+
node: outcome,
|
|
205
|
+
property: 'policy',
|
|
206
|
+
});
|
|
207
|
+
policies.add(outcome.policy?.name || '');
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
checkUniqueDomainEvents(declaration, accept) {
|
|
212
|
+
const names = new Set();
|
|
213
|
+
declaration.events.forEach((event) => {
|
|
214
|
+
if (names.has(event.name)) {
|
|
215
|
+
accept('error', `Repeated event name '${event.name}' in aggregate ${declaration.$container.name}.`, {
|
|
216
|
+
node: event,
|
|
217
|
+
property: 'name',
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
names.add(event.name);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
checkUniqueMethods(declaration, accept) {
|
|
224
|
+
const names = new Set();
|
|
225
|
+
declaration.methods.forEach((method) => {
|
|
226
|
+
if (names.has(method.name)) {
|
|
227
|
+
accept('error', `Repeated method name '${method.name}' in aggregate ${declaration.$container.name}.`, {
|
|
228
|
+
node: method,
|
|
229
|
+
property: 'name',
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
names.add(method.name);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
checkUniqueExceptions(declaration, accept) {
|
|
236
|
+
const names = new Set();
|
|
237
|
+
declaration.exceptions.forEach((exception) => {
|
|
238
|
+
if (names.has(exception.name)) {
|
|
239
|
+
accept('error', `Repeated exception name '${exception.name}' in aggregate ${declaration.$container.name}.`, {
|
|
240
|
+
node: exception,
|
|
241
|
+
property: 'name',
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
names.add(exception.name);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
checkUniqueAttributes(entity, accept) {
|
|
248
|
+
const attributes = new Set();
|
|
249
|
+
entity.attributes.forEach((attribute) => {
|
|
250
|
+
if (attributes.has(attribute.type.name)) {
|
|
251
|
+
accept('error', `Repeated attribute name '${attribute.type.name}' in ${isAggregateRoot(entity) ? 'aggregate root' : 'entity'} '${entity.name}'.`, {
|
|
252
|
+
node: attribute.type,
|
|
253
|
+
property: 'name',
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
attributes.add(attribute.type.name);
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
checkUniquePrimitiveAttributes(node, accept) {
|
|
260
|
+
const attributes = new Set();
|
|
261
|
+
node.attributes.forEach((attribute) => {
|
|
262
|
+
if (attributes.has(attribute.name)) {
|
|
263
|
+
accept('error', `Repeated attribute name '${attribute.name}' in ${isValueObject(node) ? 'value object' : 'payload'}${isValueObject(node) ? ` '${node.name}'.` : '.'}`, {
|
|
264
|
+
node: attribute,
|
|
265
|
+
property: 'name',
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
attributes.add(attribute.name);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
checkUniqueDtoAttributes(service, accept) {
|
|
272
|
+
let attributes = new Set();
|
|
273
|
+
service.input?.attributes.forEach((input) => {
|
|
274
|
+
if (attributes.has(input.name)) {
|
|
275
|
+
accept('error', `Repeated attribute name '${input.name}' in input object of ${isMethod(service) ? 'method' : 'service'} '${service.name}'.`, {
|
|
276
|
+
node: input,
|
|
277
|
+
property: 'name',
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
attributes.add(input.name);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
checkUniqueCommandElements(service, accept) {
|
|
284
|
+
const events = new Set();
|
|
285
|
+
service.events.forEach((event, index) => {
|
|
286
|
+
if (event.ref?.name && events.has(event.ref.name)) {
|
|
287
|
+
accept('error', `Repeated event '${event.ref.name}' in emit declaration of command '${service.name}'.`, {
|
|
288
|
+
node: service,
|
|
289
|
+
property: 'events',
|
|
290
|
+
index,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
events.add(event.ref?.name ?? '');
|
|
294
|
+
});
|
|
295
|
+
const domainServices = new Set();
|
|
296
|
+
service.domainServices.forEach((domainService, index) => {
|
|
297
|
+
if (domainService.ref?.name &&
|
|
298
|
+
domainServices.has(domainService.ref.name)) {
|
|
299
|
+
accept('error', `Repeated domain service '${domainService.ref.name}' in use declaration of command '${service.name}'.`, {
|
|
300
|
+
node: service,
|
|
301
|
+
property: 'domainServices',
|
|
302
|
+
index,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
domainServices.add(domainService.ref?.name ?? '');
|
|
306
|
+
});
|
|
307
|
+
//const repositories = new Set<string>();
|
|
308
|
+
const ports = new Set();
|
|
309
|
+
service.dependencies.forEach((dependency) => {
|
|
310
|
+
if (dependency.port.ref) {
|
|
311
|
+
if (ports.has(dependency.port.ref.name))
|
|
312
|
+
accept('error', `Repeated port '${dependency.port.ref.name}' in dependencies of service '${service.name}'.`, {
|
|
313
|
+
node: dependency,
|
|
314
|
+
property: 'port',
|
|
315
|
+
});
|
|
316
|
+
ports.add(dependency.port.ref.name);
|
|
317
|
+
}
|
|
318
|
+
/* if (isPortReferenceDependency(dependency)) {
|
|
319
|
+
if (dependency.port.ref) {
|
|
320
|
+
if (ports.has(dependency.port.ref.name))
|
|
321
|
+
accept(
|
|
322
|
+
'error',
|
|
323
|
+
`Repeated port '${dependency.port.ref.name}' in dependencies of service '${service.name}'.`,
|
|
324
|
+
{
|
|
325
|
+
node: dependency,
|
|
326
|
+
property: 'port',
|
|
327
|
+
},
|
|
328
|
+
);
|
|
329
|
+
ports.add(dependency.port.ref.name);
|
|
330
|
+
}
|
|
331
|
+
} */ /* else {
|
|
332
|
+
if (dependency.aggregate.ref) {
|
|
333
|
+
if (repositories.has(dependency.aggregate.ref.name))
|
|
334
|
+
accept(
|
|
335
|
+
'error',
|
|
336
|
+
`Repeated repository of aggregate root '${dependency.aggregate.ref.name}' in dependencies of service '${service.name}'.`,
|
|
337
|
+
{
|
|
338
|
+
node: dependency,
|
|
339
|
+
property: 'aggregate',
|
|
340
|
+
},
|
|
341
|
+
);
|
|
342
|
+
repositories.add(dependency.aggregate.ref.name);
|
|
343
|
+
}
|
|
344
|
+
} */
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
checkUniqueRelationships(contextMap, accept) {
|
|
348
|
+
const registeredRelationships = new Set();
|
|
349
|
+
contextMap.relationships.forEach((relationship) => {
|
|
350
|
+
let boundedContext1;
|
|
351
|
+
let boundedContext2;
|
|
352
|
+
if (isAsymmetricRelationship(relationship)) {
|
|
353
|
+
boundedContext1 = relationship.upstream?.ref?.name;
|
|
354
|
+
boundedContext2 = relationship.downstream?.ref?.name;
|
|
355
|
+
}
|
|
356
|
+
if (isSymmetricRelationship(relationship)) {
|
|
357
|
+
boundedContext1 = relationship.participant1?.ref?.name;
|
|
358
|
+
boundedContext2 = relationship.participant2?.ref?.name;
|
|
359
|
+
}
|
|
360
|
+
if (!boundedContext1 || !boundedContext2)
|
|
361
|
+
return;
|
|
362
|
+
registeredRelationships.forEach((rel) => {
|
|
363
|
+
if ((rel[0] === boundedContext1 && rel[1] === boundedContext2) ||
|
|
364
|
+
(rel[0] === boundedContext2 && rel[1] === boundedContext1)) {
|
|
365
|
+
accept('error', `Repeated relationship between '${boundedContext1}' and '${boundedContext2}' in context map.`, {
|
|
366
|
+
node: relationship,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
registeredRelationships.add([boundedContext1, boundedContext2]);
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
checkSelfRelationships(relationship, accept) {
|
|
374
|
+
let boundedContext1;
|
|
375
|
+
let boundedContext2;
|
|
376
|
+
if (isAsymmetricRelationship(relationship)) {
|
|
377
|
+
boundedContext1 = relationship.upstream?.ref?.name;
|
|
378
|
+
boundedContext2 = relationship.downstream?.ref?.name;
|
|
379
|
+
}
|
|
380
|
+
if (isSymmetricRelationship(relationship)) {
|
|
381
|
+
boundedContext1 = relationship.participant1?.ref?.name;
|
|
382
|
+
boundedContext2 = relationship.participant2?.ref?.name;
|
|
383
|
+
}
|
|
384
|
+
if (boundedContext1 && boundedContext2) {
|
|
385
|
+
if (boundedContext1 === boundedContext2) {
|
|
386
|
+
accept('error', 'Self-referential relationships are not allowed.', {
|
|
387
|
+
node: relationship,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
checkRelationshipRoles(relationship, accept) {
|
|
393
|
+
if (relationship.customerSupplier) {
|
|
394
|
+
if (relationship.downstreamRole === 'Conformist')
|
|
395
|
+
accept('error', 'Cannot have a Conformist role in a customer/supplier relationship.', {
|
|
396
|
+
node: relationship,
|
|
397
|
+
property: 'downstreamRole',
|
|
398
|
+
});
|
|
399
|
+
else if (relationship.downstreamRole === 'AntiCorruptionLayer')
|
|
400
|
+
accept('warning', 'Anti-Corruption Layer pattern should not be used in a customer/supplier relationship.', {
|
|
401
|
+
node: relationship,
|
|
402
|
+
property: 'downstreamRole',
|
|
403
|
+
});
|
|
404
|
+
if (relationship.upstreamRoles.includes('OpenHostService')) {
|
|
405
|
+
accept('error', 'Cannot have an Open Host Service role in a customer/supplier relationship.', {
|
|
406
|
+
node: relationship,
|
|
407
|
+
property: 'upstreamRoles',
|
|
408
|
+
index: relationship.upstreamRoles.indexOf('OpenHostService'),
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (relationship.upstreamRoles?.[0] &&
|
|
413
|
+
relationship.upstreamRoles?.[0] === relationship.upstreamRoles?.[1]) {
|
|
414
|
+
accept('error', 'Cannot have repeated roles.', {
|
|
415
|
+
node: relationship,
|
|
416
|
+
property: 'upstreamRoles',
|
|
417
|
+
index: 1,
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
checkUniqueValues(enumDefinition, accept) {
|
|
422
|
+
const literals = new Set();
|
|
423
|
+
enumDefinition.values.forEach((value) => {
|
|
424
|
+
if (literals.has(value)) {
|
|
425
|
+
accept('error', `Duplicate value found: ${value}`, {
|
|
426
|
+
node: enumDefinition,
|
|
427
|
+
property: 'values',
|
|
428
|
+
index: Array.from(literals).indexOf(value),
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
literals.add(value);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
checkNameIsInPastTense(event, accept) {
|
|
435
|
+
if (event.name) {
|
|
436
|
+
const lastTwoChars = event.name.slice(-2);
|
|
437
|
+
if (lastTwoChars !== 'ed') {
|
|
438
|
+
accept('hint', 'Check if the name is in past tense.', {
|
|
439
|
+
node: event,
|
|
440
|
+
property: 'name',
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
checkNameStartsWithCapital(node, accept) {
|
|
446
|
+
if (node.name) {
|
|
447
|
+
const firstChar = node.name.substring(0, 1);
|
|
448
|
+
if (firstChar.toUpperCase() !== firstChar) {
|
|
449
|
+
accept('warning', 'The name should start with a capital letter.', {
|
|
450
|
+
node: node,
|
|
451
|
+
property: 'name',
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
checkNameIsCamelCase(node, accept) {
|
|
457
|
+
if (node.name) {
|
|
458
|
+
const firstChar = node.name.substring(0, 1);
|
|
459
|
+
if (firstChar.toLowerCase() !== firstChar) {
|
|
460
|
+
accept('warning', 'The name should start with a lowercase letter.', {
|
|
461
|
+
node: node,
|
|
462
|
+
property: 'name',
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
//# sourceMappingURL=domain-design-language-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-design-language-validator.js","sourceRoot":"","sources":["../src/domain-design-language-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAYL,OAAO,EACP,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,eAAe;AACf,4BAA4B;AAC5B,YAAY,EACZ,WAAW,EACX,uBAAuB,EACvB,aAAa,EAYb,QAAQ,GAET,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,QAAsC;IAEtC,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC;IACxD,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;IACpE,MAAM,MAAM,GAAkD;QAC5D,WAAW,EAAE,SAAS,CAAC,kBAAkB;QACzC,cAAc,EAAE;YACd,SAAS,CAAC,qBAAqB;YAC/B,SAAS,CAAC,yBAAyB;YACnC,SAAS,CAAC,gBAAgB;YAC1B,SAAS,CAAC,mBAAmB;YAC7B,SAAS,CAAC,0BAA0B;SACrC;QACD,6BAA6B,EAAE,SAAS,CAAC,gBAAgB;QACzD,IAAI,EAAE,SAAS,CAAC,0BAA0B;QAC1C,UAAU,EAAE,SAAS,CAAC,wBAAwB;QAC9C,YAAY,EAAE,SAAS,CAAC,sBAAsB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