archimaid 0.0.0-stage → 0.1.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/CHANGELOG.md +32 -0
- package/FOUNDATION.md +108 -0
- package/LICENSE +21 -0
- package/README.md +271 -2
- package/dist/archimate/catalogue.d.ts +106 -0
- package/dist/archimate/catalogue.js +219 -0
- package/dist/archimate/catalogue.js.map +1 -0
- package/dist/archimate/diagnostics.d.ts +48 -0
- package/dist/archimate/diagnostics.js +64 -0
- package/dist/archimate/diagnostics.js.map +1 -0
- package/dist/archimate/frontmatter.d.ts +13 -0
- package/dist/archimate/frontmatter.js +62 -0
- package/dist/archimate/frontmatter.js.map +1 -0
- package/dist/archimate/grammar.d.ts +60 -0
- package/dist/archimate/grammar.js +273 -0
- package/dist/archimate/grammar.js.map +1 -0
- package/dist/archimate/lexer.d.ts +91 -0
- package/dist/archimate/lexer.js +215 -0
- package/dist/archimate/lexer.js.map +1 -0
- package/dist/archimate/model.d.ts +46 -0
- package/dist/archimate/model.js +2 -0
- package/dist/archimate/model.js.map +1 -0
- package/dist/archimate/nesting.d.ts +14 -0
- package/dist/archimate/nesting.js +84 -0
- package/dist/archimate/nesting.js.map +1 -0
- package/dist/archimate/parser.d.ts +14 -0
- package/dist/archimate/parser.js +53 -0
- package/dist/archimate/parser.js.map +1 -0
- package/dist/archimate/suggestions.d.ts +1 -0
- package/dist/archimate/suggestions.js +44 -0
- package/dist/archimate/suggestions.js.map +1 -0
- package/dist/archimate/validate.d.ts +4 -0
- package/dist/archimate/validate.js +402 -0
- package/dist/archimate/validate.js.map +1 -0
- package/dist/bundle/archimaid.esm.min.mjs +1 -0
- package/dist/bundle/chunks/archimateDiagram-WUCF6KHR.mjs +132 -0
- package/dist/bundle/chunks/chunk-QBMRZFD3.mjs +1 -0
- package/dist/bundle/chunks/elk.bundled-2VSLVJGB.mjs +26 -0
- package/dist/cli/render.d.ts +10 -0
- package/dist/cli/render.js +102 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/report.d.ts +20 -0
- package/dist/cli/report.js +39 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/sources.d.ts +19 -0
- package/dist/cli/sources.js +86 -0
- package/dist/cli/sources.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +137 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/language.d.ts +5 -0
- package/dist/language.js +3 -0
- package/dist/language.js.map +1 -0
- package/dist/mermaid/archimateDetector.d.ts +12 -0
- package/dist/mermaid/archimateDetector.js +29 -0
- package/dist/mermaid/archimateDetector.js.map +1 -0
- package/dist/mermaid/archimateDiagram.d.ts +9 -0
- package/dist/mermaid/archimateDiagram.js +75 -0
- package/dist/mermaid/archimateDiagram.js.map +1 -0
- package/dist/mermaid/archimateRenderer.d.ts +6 -0
- package/dist/mermaid/archimateRenderer.js +40 -0
- package/dist/mermaid/archimateRenderer.js.map +1 -0
- package/dist/mermaid/architectureLayout.d.ts +50 -0
- package/dist/mermaid/architectureLayout.js +144 -0
- package/dist/mermaid/architectureLayout.js.map +1 -0
- package/dist/mermaid/geometry.d.ts +3 -0
- package/dist/mermaid/geometry.js +20 -0
- package/dist/mermaid/geometry.js.map +1 -0
- package/dist/mermaid/hierarchy.d.ts +1 -0
- package/dist/mermaid/hierarchy.js +8 -0
- package/dist/mermaid/hierarchy.js.map +1 -0
- package/dist/mermaid/invariant.d.ts +1 -0
- package/dist/mermaid/invariant.js +7 -0
- package/dist/mermaid/invariant.js.map +1 -0
- package/dist/mermaid/orthogonalRouter.d.ts +4 -0
- package/dist/mermaid/orthogonalRouter.js +249 -0
- package/dist/mermaid/orthogonalRouter.js.map +1 -0
- package/dist/mermaid/relationshipPlacement.d.ts +3 -0
- package/dist/mermaid/relationshipPlacement.js +350 -0
- package/dist/mermaid/relationshipPlacement.js.map +1 -0
- package/dist/mermaid/render/draw.d.ts +17 -0
- package/dist/mermaid/render/draw.js +275 -0
- package/dist/mermaid/render/draw.js.map +1 -0
- package/dist/mermaid/render/elkRoutes.d.ts +6 -0
- package/dist/mermaid/render/elkRoutes.js +216 -0
- package/dist/mermaid/render/elkRoutes.js.map +1 -0
- package/dist/mermaid/render/graph.d.ts +17 -0
- package/dist/mermaid/render/graph.js +200 -0
- package/dist/mermaid/render/graph.js.map +1 -0
- package/dist/mermaid/render/labels.d.ts +12 -0
- package/dist/mermaid/render/labels.js +148 -0
- package/dist/mermaid/render/labels.js.map +1 -0
- package/dist/mermaid/render/layout.d.ts +12 -0
- package/dist/mermaid/render/layout.js +60 -0
- package/dist/mermaid/render/layout.js.map +1 -0
- package/dist/mermaid/render/measure.d.ts +16 -0
- package/dist/mermaid/render/measure.js +96 -0
- package/dist/mermaid/render/measure.js.map +1 -0
- package/dist/mermaid/render/place.d.ts +20 -0
- package/dist/mermaid/render/place.js +63 -0
- package/dist/mermaid/render/place.js.map +1 -0
- package/dist/mermaid/render/route.d.ts +29 -0
- package/dist/mermaid/render/route.js +113 -0
- package/dist/mermaid/render/route.js.map +1 -0
- package/dist/mermaid/render/shared.d.ts +83 -0
- package/dist/mermaid/render/shared.js +52 -0
- package/dist/mermaid/render/shared.js.map +1 -0
- package/dist/mermaid/render/svg.d.ts +6 -0
- package/dist/mermaid/render/svg.js +33 -0
- package/dist/mermaid/render/svg.js.map +1 -0
- package/dist/mermaid/render/viewport.d.ts +14 -0
- package/dist/mermaid/render/viewport.js +58 -0
- package/dist/mermaid/render/viewport.js.map +1 -0
- package/dist/mermaid/routing/anchors.d.ts +14 -0
- package/dist/mermaid/routing/anchors.js +134 -0
- package/dist/mermaid/routing/anchors.js.map +1 -0
- package/dist/mermaid/routing/bundles.d.ts +14 -0
- package/dist/mermaid/routing/bundles.js +94 -0
- package/dist/mermaid/routing/bundles.js.map +1 -0
- package/dist/mermaid/routing/congestion.d.ts +8 -0
- package/dist/mermaid/routing/congestion.js +70 -0
- package/dist/mermaid/routing/congestion.js.map +1 -0
- package/dist/mermaid/routing/constants.d.ts +13 -0
- package/dist/mermaid/routing/constants.js +17 -0
- package/dist/mermaid/routing/constants.js.map +1 -0
- package/dist/mermaid/routing/primitives.d.ts +33 -0
- package/dist/mermaid/routing/primitives.js +110 -0
- package/dist/mermaid/routing/primitives.js.map +1 -0
- package/dist/mermaid/routing/search.d.ts +4 -0
- package/dist/mermaid/routing/search.js +171 -0
- package/dist/mermaid/routing/search.js.map +1 -0
- package/dist/mermaid/routing/shapes.d.ts +8 -0
- package/dist/mermaid/routing/shapes.js +82 -0
- package/dist/mermaid/routing/shapes.js.map +1 -0
- package/dist/mermaid/routing/types.d.ts +37 -0
- package/dist/mermaid/routing/types.js +14 -0
- package/dist/mermaid/routing/types.js.map +1 -0
- package/dist/mermaid/styles.d.ts +89 -0
- package/dist/mermaid/styles.js +166 -0
- package/dist/mermaid/styles.js.map +1 -0
- package/docs/reference.md +86 -0
- package/examples/cross-layer-relationships.mmd +79 -0
- package/examples/cross-layer-relationships.svg +33 -0
- package/examples/element-preview.svg +1 -0
- package/examples/nested-components.mmd +21 -0
- package/examples/nested-components.svg +4 -0
- package/examples/order-fulfilment.mmd +10 -0
- package/examples/order-management.mmd +15 -0
- package/examples/order-management.svg +2 -0
- package/package.json +91 -4
- package/skills/archimaid/SKILL.md +123 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
export const relationshipStroke = '#000000';
|
|
2
|
+
// Original drawings of the default corner symbols, on a 16 × 16 coordinate grid.
|
|
3
|
+
const icons = {
|
|
4
|
+
role: [{ d: 'M4 3H12A3 5 0 0 1 12 13H4A3 5 0 0 1 4 3Z M12 3A3 5 0 0 0 12 13' }],
|
|
5
|
+
driver: [
|
|
6
|
+
{ d: 'M8 2A6 6 0 1 1 8 14A6 6 0 1 1 8 2Z M8 0.5V15.5 M0.5 8H15.5 M2.5 2.5L13.5 13.5 M13.5 2.5L2.5 13.5' },
|
|
7
|
+
{ d: 'M8 6.5A1.5 1.5 0 1 1 8 9.5A1.5 1.5 0 1 1 8 6.5Z', fill: 'ink' },
|
|
8
|
+
],
|
|
9
|
+
assessment: [{ d: 'M9.8 1.5A4.8 4.8 0 1 1 9.8 11.1A4.8 4.8 0 1 1 9.8 1.5Z M6.3 9.7L1.5 14.5' }],
|
|
10
|
+
goal: [
|
|
11
|
+
{ d: 'M8 1A7 7 0 1 1 8 15A7 7 0 1 1 8 1Z M8 3.7A4.3 4.3 0 1 1 8 12.3A4.3 4.3 0 1 1 8 3.7Z' },
|
|
12
|
+
{ d: 'M8 6.2A1.8 1.8 0 1 1 8 9.8A1.8 1.8 0 1 1 8 6.2Z', fill: 'ink' },
|
|
13
|
+
],
|
|
14
|
+
outcome: [
|
|
15
|
+
{ d: 'M6 5A5 5 0 1 1 6 15A5 5 0 1 1 6 5Z M6 7A3 3 0 1 1 6 13A3 3 0 1 1 6 7Z' },
|
|
16
|
+
{ d: 'M14 2L6 10 M6 7V10H9' },
|
|
17
|
+
],
|
|
18
|
+
principle: [
|
|
19
|
+
{ d: 'M3 1.5H13Q14.5 1.5 14.5 3V13Q14.5 14.5 13 14.5H3Q1.5 14.5 1.5 13V3Q1.5 1.5 3 1.5Z' },
|
|
20
|
+
{ d: 'M7.4 4.1H8.6L8.2 9.3H7.8Z M8 11.3A0.7 0.7 0 1 1 8 12.7A0.7 0.7 0 1 1 8 11.3Z', fill: 'ink' },
|
|
21
|
+
],
|
|
22
|
+
requirement: [{ d: 'M4 3.5H15L12 12.5H1Z' }],
|
|
23
|
+
constraint: [{ d: 'M4 3.5H15L12 12.5H1Z M6.1 3.5L3.1 12.5' }],
|
|
24
|
+
meaning: [
|
|
25
|
+
{
|
|
26
|
+
d: 'M4.5 10.5C2.5 10.2 2.2 8 3.7 7.2C2.5 5.3 4.5 3.4 6.3 4.2C7.4 2.8 9.4 2.9 10.4 4.1C12 3.2 14.5 4.2 14 6.3C16 7.6 14.6 10.2 12.9 10.4C12.5 12 10.2 12.3 9.1 11.3C7.8 12.2 5.5 12.2 4.5 10.5Z M3 12A1 1 0 1 1 3 14A1 1 0 1 1 3 12Z M1 14.5H1.1',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
value: [{ d: 'M8 3.2A7 4.8 0 1 1 8 12.8A7 4.8 0 1 1 8 3.2Z' }],
|
|
30
|
+
resource: [
|
|
31
|
+
{
|
|
32
|
+
d: 'M2.5 4H12Q13 4 13 5V11Q13 12 12 12H2.5Q1 12 1 10.5V5.5Q1 4 2.5 4Z M13 6H15V10H13 M4.3 6V10 M7 6V10 M9.7 6V10',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
capability: [{ d: 'M1 10H5V6H9V2H14V14H1Z M5 10V14 M9 6V14 M5 10H14 M9 6H14' }],
|
|
36
|
+
valueStream: [{ d: 'M1 3H9.5L15 8L9.5 13H1L6.5 8Z' }],
|
|
37
|
+
courseOfAction: [
|
|
38
|
+
{ d: 'M10.5 1A4.5 4.5 0 1 1 10.5 10A4.5 4.5 0 1 1 10.5 1Z M10.5 3A2.5 2.5 0 1 1 10.5 8A2.5 2.5 0 1 1 10.5 3Z' },
|
|
39
|
+
{ d: 'M1.5 14.5L7.3 8.7 M4.3 8.7H7.3V11.7' },
|
|
40
|
+
],
|
|
41
|
+
actor: [
|
|
42
|
+
{ d: 'M8 1A2.6 2.6 0 1 1 8 6.2A2.6 2.6 0 1 1 8 1Z M8 6.2V10.7 M4.2 7.7H11.8 M8 10.7L4.4 15 M8 10.7L11.6 15' },
|
|
43
|
+
],
|
|
44
|
+
collaboration: [{ d: 'M6 3A5 5 0 1 1 6 13A5 5 0 1 1 6 3Z M10 3A5 5 0 1 1 10 13A5 5 0 1 1 10 3Z' }],
|
|
45
|
+
interface: [{ d: 'M1 8H6 M10.5 3.5A4.5 4.5 0 1 1 10.5 12.5A4.5 4.5 0 1 1 10.5 3.5Z' }],
|
|
46
|
+
process: [{ d: 'M1 6H9V2L15 8L9 14V10H1Z' }],
|
|
47
|
+
function: [{ d: 'M1.5 7L8 2L14.5 7V13L8 8L1.5 13Z' }],
|
|
48
|
+
interaction: [{ d: 'M6.5 2V14A6 6 0 0 1 6.5 2Z M9.5 2V14A6 6 0 0 0 9.5 2Z' }],
|
|
49
|
+
event: [{ d: 'M1.5 3H10A5 5 0 0 1 10 13H1.5L4.5 8Z' }],
|
|
50
|
+
service: [{ d: 'M5 3.5H11A4.5 4.5 0 0 1 11 12.5H5A4.5 4.5 0 0 1 5 3.5Z' }],
|
|
51
|
+
object: [{ d: 'M1.5 3H14.5V13H1.5Z M1.5 6H14.5' }],
|
|
52
|
+
contract: [{ d: 'M1.5 3H14.5V13H1.5Z M1.5 5.7H14.5 M1.5 10.3H14.5' }],
|
|
53
|
+
representation: [{ d: 'M1.5 3H14.5V12Q11.3 8.7 8 12Q4.7 15.3 1.5 12Z M1.5 6H14.5' }],
|
|
54
|
+
product: [{ d: 'M1.5 3H14.5V13H1.5Z M8 3V7H1.5' }],
|
|
55
|
+
component: [{ d: 'M4.5 4.8V2H14V14H4.5V11.2 M4.5 9V7 M1 4.8H7V7H1Z M1 9H7V11.2H1Z' }],
|
|
56
|
+
node: [{ d: 'M1.5 4.5L4.5 1.5H14.5V11.5L11.5 14.5H1.5Z M1.5 4.5H11.5L14.5 1.5 M11.5 4.5V14.5' }],
|
|
57
|
+
device: [
|
|
58
|
+
{
|
|
59
|
+
d: 'M3 2.5H13Q14.5 2.5 14.5 4V10Q14.5 11.5 13 11.5H3Q1.5 11.5 1.5 10V4Q1.5 2.5 3 2.5Z M3 11.5L1.5 14H14.5L13 11.5',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
systemSoftware: [{ d: 'M4.3 6A5.2 5.2 0 1 1 12 12 M7 5A5.2 5.2 0 1 1 7 15.4A5.2 5.2 0 1 1 7 5Z' }],
|
|
63
|
+
path: [{ d: 'M5.4 3.7L1 8L5.4 12.3 M10.6 3.7L15 8L10.6 12.3 M4.8 8H6.6 M9.4 8H11.2' }],
|
|
64
|
+
communicationNetwork: [
|
|
65
|
+
{ d: 'M4.5 3H13L11.5 13H3Z' },
|
|
66
|
+
{
|
|
67
|
+
d: 'M4.5 1.4A1.6 1.6 0 1 1 4.5 4.6A1.6 1.6 0 1 1 4.5 1.4Z M13 1.4A1.6 1.6 0 1 1 13 4.6A1.6 1.6 0 1 1 13 1.4Z M11.5 11.4A1.6 1.6 0 1 1 11.5 14.6A1.6 1.6 0 1 1 11.5 11.4Z M3 11.4A1.6 1.6 0 1 1 3 14.6A1.6 1.6 0 1 1 3 11.4Z',
|
|
68
|
+
fill: 'ink',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
artifact: [{ d: 'M2.5 1.5H9.5L13.5 5.5V14.5H2.5Z M9.5 1.5V5.5H13.5' }],
|
|
72
|
+
equipment: [
|
|
73
|
+
{
|
|
74
|
+
d: 'M6 5L7 4L9 4.5L9.5 6.3L11.2 7L12.7 6.5L14 8L13.5 9.8L14.5 11.2L13.5 13L11.7 12.8L10.2 14L10 15L7.8 15L7.2 13.8L5.5 13L4.1 13.6L2.6 12.1L3.4 10.6L2.5 9L2.8 7.4L4.7 7.4Z M8.5 7A2.7 2.7 0 1 1 8.5 12.4A2.7 2.7 0 1 1 8.5 7Z',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
d: 'M9.5 3L10 1.8L11.4 2L12.2 0.9L13.5 1.5L13.5 2.8L14.8 3.5L14.4 4.8L13.2 4.9L12.7 6 M12.2 2.8A1.4 1.4 0 1 1 12.2 5.6A1.4 1.4 0 1 1 12.2 2.8Z',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
facility: [{ d: 'M1.5 2H4V9L7.5 7V9L11 7V9L14.5 7V14H1.5Z' }],
|
|
81
|
+
distributionNetwork: [{ d: 'M4.5 4L1 8L4.5 12 M11.5 4L15 8L11.5 12 M2.5 6.5H13.5 M2.5 9.5H13.5' }],
|
|
82
|
+
material: [{ d: 'M4.5 2H11.5L15 8L11.5 14H4.5L1 8Z M3.5 8L6 4 M10 4L12.5 8 M6 12H10' }],
|
|
83
|
+
workPackage: [
|
|
84
|
+
{
|
|
85
|
+
d: 'M8.7 11.1C12.4 8.6 11.1 2.5 6.5 2.5C0.4 2.5 0.1 12.9 6.8 12.9H14.5 M14.5 12.9L11.6 10.7 M14.5 12.9L11.6 15.1',
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
deliverable: [{ d: 'M1.5 3H14.5V12Q11.3 8.7 8 12Q4.7 15.3 1.5 12Z' }],
|
|
89
|
+
plateau: [{ d: 'M5 3H15V4.3H5Z M3 7.3H13V8.6H3Z M1 11.6H11V12.9H1Z', fill: 'ink' }],
|
|
90
|
+
gap: [{ d: 'M8 2.5A5.5 5.5 0 1 1 8 13.5A5.5 5.5 0 1 1 8 2.5Z M0.5 6.2H15.5 M0.5 9.8H15.5' }],
|
|
91
|
+
grouping: [
|
|
92
|
+
{
|
|
93
|
+
d: 'M1.5 13V10 M1.5 8.5V5.5 M1.5 4V2H4.5 M6 2H9 M10.5 2H12V5.5 M12 6H15V9 M15 10.5V13H12 M10.5 13H7.5 M6 13H3 M2 6H5 M6.5 6H9.5',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
location: [{ d: 'M8 1.5A4.5 4.5 0 0 1 12.5 6C12.5 9 9.7 10.5 8 14.7C6.3 10.5 3.5 9 3.5 6A4.5 4.5 0 0 1 8 1.5Z' }],
|
|
97
|
+
};
|
|
98
|
+
function element(name, description, category, aspect, outline, icon) {
|
|
99
|
+
return { name, description, category, aspect, notation: { outline, icon: icons[icon] } };
|
|
100
|
+
}
|
|
101
|
+
export const elementTypes = {
|
|
102
|
+
stakeholder: element('Stakeholder', 'A party with interests in the architecture and its effects.', 'motivation', 'motivation', 'chamfered', 'role'),
|
|
103
|
+
driver: element('Driver', 'A condition that prompts change and shapes goals.', 'motivation', 'motivation', 'chamfered', 'driver'),
|
|
104
|
+
assessment: element('Assessment', 'A finding about the current situation in light of a driver.', 'motivation', 'motivation', 'chamfered', 'assessment'),
|
|
105
|
+
goal: element('Goal', 'A desired state or direction for the organisation.', 'motivation', 'motivation', 'chamfered', 'goal'),
|
|
106
|
+
outcome: element('Outcome', 'A result produced by a state of affairs or by a change.', 'motivation', 'motivation', 'chamfered', 'outcome'),
|
|
107
|
+
principle: element('Principle', 'A general rule or intent that guides architecture choices.', 'motivation', 'motivation', 'chamfered', 'principle'),
|
|
108
|
+
requirement: element('Requirement', 'A need that the architecture describes for a particular system.', 'motivation', 'motivation', 'chamfered', 'requirement'),
|
|
109
|
+
constraint: element('Constraint', 'A limit on the architecture, its implementation or its realisation.', 'motivation', 'motivation', 'chamfered', 'constraint'),
|
|
110
|
+
meaning: element('Meaning', 'An interpretation of a concept in its particular context.', 'motivation', 'motivation', 'chamfered', 'meaning'),
|
|
111
|
+
value: element('Value', 'The benefit, worth or significance attributed to a concept.', 'motivation', 'motivation', 'chamfered', 'value'),
|
|
112
|
+
resource: element('Resource', "An asset under a person's or organisation's control.", 'strategy', null, 'rectangle', 'resource'),
|
|
113
|
+
capability: element('Capability', 'Something a person, organisation or system can do.', 'strategy', 'behavior', 'rounded', 'capability'),
|
|
114
|
+
valueStream: element('Value Stream', 'A sequence of activities that produces value for a recipient.', 'strategy', 'behavior', 'rounded', 'valueStream'),
|
|
115
|
+
courseOfAction: element('Course of Action', 'A plan for using capabilities and resources to reach a goal.', 'strategy', 'behavior', 'rounded', 'courseOfAction'),
|
|
116
|
+
businessActor: element('Business Actor', 'A person, organisation or other business entity that can act.', 'business', 'activeStructure', 'rectangle', 'actor'),
|
|
117
|
+
businessRole: element('Business Role', 'A set of responsibilities a business actor can take on.', 'business', 'activeStructure', 'rectangle', 'role'),
|
|
118
|
+
businessCollaboration: element('Business Collaboration', 'Business actors or roles working together to perform shared behaviour.', 'business', 'activeStructure', 'rectangle', 'collaboration'),
|
|
119
|
+
businessInterface: element('Business Interface', 'An access point for a business service.', 'business', 'activeStructure', 'rectangle', 'interface'),
|
|
120
|
+
businessProcess: element('Business Process', 'Ordered business activities that produce a result.', 'business', 'behavior', 'rounded', 'process'),
|
|
121
|
+
businessFunction: element('Business Function', 'Business activities grouped by criteria such as skills or resources.', 'business', 'behavior', 'rounded', 'function'),
|
|
122
|
+
businessInteraction: element('Business Interaction', 'Behaviour that business participants perform jointly.', 'business', 'behavior', 'rounded', 'interaction'),
|
|
123
|
+
businessEvent: element('Business Event', 'A change of state that matters to the business.', 'business', 'behavior', 'rounded', 'event'),
|
|
124
|
+
businessService: element('Business Service', 'Business behaviour exposed to its consumers.', 'business', 'behavior', 'rounded', 'service'),
|
|
125
|
+
businessObject: element('Business Object', 'A concept that carries information in a business domain.', 'business', 'passiveStructure', 'rectangle', 'object'),
|
|
126
|
+
contract: element('Contract', 'An agreement defining obligations and terms for a product or service.', 'business', 'passiveStructure', 'rectangle', 'contract'),
|
|
127
|
+
representation: element('Representation', "A perceptible form in which a business object's information is expressed.", 'business', 'passiveStructure', 'rectangle', 'representation'),
|
|
128
|
+
product: element('Product', 'Services or passive structure bundled as an offering under an agreement.', 'business', null, 'rectangle', 'product'),
|
|
129
|
+
applicationComponent: element('Application Component', 'A replaceable software module that encapsulates application functionality.', 'application', 'activeStructure', 'rectangle', 'component'),
|
|
130
|
+
applicationCollaboration: element('Application Collaboration', 'Application components working together to perform shared behaviour.', 'application', 'activeStructure', 'rectangle', 'collaboration'),
|
|
131
|
+
applicationInterface: element('Application Interface', 'An access point for an application service.', 'application', 'activeStructure', 'rectangle', 'interface'),
|
|
132
|
+
applicationFunction: element('Application Function', 'Automated behaviour performed by an application component.', 'application', 'behavior', 'rounded', 'function'),
|
|
133
|
+
applicationInteraction: element('Application Interaction', 'Behaviour that application components perform jointly.', 'application', 'behavior', 'rounded', 'interaction'),
|
|
134
|
+
applicationProcess: element('Application Process', 'Ordered application activities that produce a result.', 'application', 'behavior', 'rounded', 'process'),
|
|
135
|
+
applicationEvent: element('Application Event', 'A change of state in an application.', 'application', 'behavior', 'rounded', 'event'),
|
|
136
|
+
applicationService: element('Application Service', 'Application behaviour exposed to its consumers.', 'application', 'behavior', 'rounded', 'service'),
|
|
137
|
+
dataObject: element('Data Object', 'Information organised for automated processing.', 'application', 'passiveStructure', 'rectangle', 'object'),
|
|
138
|
+
node: element('Node', 'A computational or physical resource that hosts or interacts with other resources.', 'technology', 'activeStructure', 'rectangle', 'node'),
|
|
139
|
+
device: element('Device', 'Physical IT equipment that can host software or artifacts.', 'technology', 'activeStructure', 'rectangle', 'device'),
|
|
140
|
+
systemSoftware: element('System Software', 'Software that supplies an environment for running software or using data.', 'technology', 'activeStructure', 'rectangle', 'systemSoftware'),
|
|
141
|
+
technologyCollaboration: element('Technology Collaboration', 'Technology resources working together to perform shared behaviour.', 'technology', 'activeStructure', 'rectangle', 'collaboration'),
|
|
142
|
+
technologyInterface: element('Technology Interface', 'An access point for a technology service.', 'technology', 'activeStructure', 'rectangle', 'interface'),
|
|
143
|
+
path: element('Path', 'A link through which technology resources can exchange information, energy or material.', 'technology', 'activeStructure', 'rectangle', 'path'),
|
|
144
|
+
communicationNetwork: element('Communication Network', 'Infrastructure that connects devices or system software to transmit and route data.', 'technology', 'activeStructure', 'rectangle', 'communicationNetwork'),
|
|
145
|
+
technologyFunction: element('Technology Function', 'A group of activities performed by a technology resource.', 'technology', 'behavior', 'rounded', 'function'),
|
|
146
|
+
technologyProcess: element('Technology Process', 'Ordered technology activities that produce a result.', 'technology', 'behavior', 'rounded', 'process'),
|
|
147
|
+
technologyInteraction: element('Technology Interaction', 'Behaviour that technology resources perform jointly.', 'technology', 'behavior', 'rounded', 'interaction'),
|
|
148
|
+
technologyEvent: element('Technology Event', 'A change of state in the technology layer.', 'technology', 'behavior', 'rounded', 'event'),
|
|
149
|
+
technologyService: element('Technology Service', 'Technology behaviour exposed to its consumers.', 'technology', 'behavior', 'rounded', 'service'),
|
|
150
|
+
artifact: element('Artifact', 'A piece of data used or produced when developing, deploying or running a system.', 'technology', 'passiveStructure', 'rectangle', 'artifact'),
|
|
151
|
+
equipment: element('Equipment', 'Machinery, tools or instruments that act on physical material.', 'physical', 'activeStructure', 'rectangle', 'equipment'),
|
|
152
|
+
facility: element('Facility', 'A physical structure or environment used in operations.', 'physical', 'activeStructure', 'rectangle', 'facility'),
|
|
153
|
+
distributionNetwork: element('Distribution Network', 'Infrastructure that carries material or energy between physical points.', 'physical', 'activeStructure', 'rectangle', 'distributionNetwork'),
|
|
154
|
+
material: element('Material', 'Physical matter or energy involved in the architecture.', 'physical', 'passiveStructure', 'rectangle', 'material'),
|
|
155
|
+
workPackage: element('Work Package', 'A bounded set of actions planned to produce a result.', 'implementationAndMigration', 'behavior', 'rounded', 'workPackage'),
|
|
156
|
+
deliverable: element('Deliverable', 'An identified result produced by a work package.', 'implementationAndMigration', 'passiveStructure', 'rectangle', 'deliverable'),
|
|
157
|
+
implementationEvent: element('Implementation Event', 'A change of state during implementation or migration.', 'implementationAndMigration', 'behavior', 'rounded', 'event'),
|
|
158
|
+
plateau: element('Plateau', 'A relatively stable architecture state within a period of time.', 'implementationAndMigration', null, 'rectangle', 'plateau'),
|
|
159
|
+
gap: element('Gap', 'A difference between two architecture plateaus.', 'implementationAndMigration', null, 'rectangle', 'gap'),
|
|
160
|
+
grouping: element('Grouping', 'A collection of concepts that share a common characteristic.', 'composite', null, 'grouping', 'grouping'),
|
|
161
|
+
location: element('Location', 'A physical or conceptual place where concepts are situated or behaviour occurs.', 'composite', null, 'rectangle', 'location'),
|
|
162
|
+
};
|
|
163
|
+
export function getElementType(type) {
|
|
164
|
+
return Object.hasOwn(elementTypes, type) ? elementTypes[type] : undefined;
|
|
165
|
+
}
|
|
166
|
+
export const relationshipTypes = [
|
|
167
|
+
'composition',
|
|
168
|
+
'aggregation',
|
|
169
|
+
'assignment',
|
|
170
|
+
'realization',
|
|
171
|
+
'serving',
|
|
172
|
+
'access',
|
|
173
|
+
'influence',
|
|
174
|
+
'association',
|
|
175
|
+
'triggering',
|
|
176
|
+
'flow',
|
|
177
|
+
'specialization',
|
|
178
|
+
];
|
|
179
|
+
export const relationshipNames = {
|
|
180
|
+
composition: 'Composition',
|
|
181
|
+
aggregation: 'Aggregation',
|
|
182
|
+
assignment: 'Assignment',
|
|
183
|
+
realization: 'Realization',
|
|
184
|
+
serving: 'Serving',
|
|
185
|
+
access: 'Access',
|
|
186
|
+
influence: 'Influence',
|
|
187
|
+
association: 'Association',
|
|
188
|
+
triggering: 'Triggering',
|
|
189
|
+
flow: 'Flow',
|
|
190
|
+
specialization: 'Specialization',
|
|
191
|
+
};
|
|
192
|
+
// Markers are indexed by model source and target.
|
|
193
|
+
const relationshipNotation = {
|
|
194
|
+
composition: { line: 'solid', start: 'filledDiamond', end: 'none' },
|
|
195
|
+
aggregation: { line: 'solid', start: 'openDiamond', end: 'none' },
|
|
196
|
+
assignment: { line: 'solid', start: 'filledDot', end: 'filledArrow' },
|
|
197
|
+
realization: { line: 'dotted', start: 'none', end: 'openTriangle' },
|
|
198
|
+
serving: { line: 'solid', start: 'none', end: 'openArrow' },
|
|
199
|
+
access: { line: 'dotted', start: 'none', end: 'none' },
|
|
200
|
+
influence: { line: 'dashed', start: 'none', end: 'openArrow' },
|
|
201
|
+
association: { line: 'solid', start: 'none', end: 'none' },
|
|
202
|
+
triggering: { line: 'solid', start: 'none', end: 'filledArrow' },
|
|
203
|
+
flow: { line: 'dashed', start: 'none', end: 'filledArrow' },
|
|
204
|
+
specialization: { line: 'solid', start: 'none', end: 'openTriangle' },
|
|
205
|
+
};
|
|
206
|
+
export function getRelationshipNotation(type, access = 'unspecified', directed = false) {
|
|
207
|
+
if (type === 'access') {
|
|
208
|
+
return {
|
|
209
|
+
line: 'dotted',
|
|
210
|
+
start: access === 'read' || access === 'readWrite' ? 'openArrow' : 'none',
|
|
211
|
+
end: access === 'write' || access === 'readWrite' ? 'openArrow' : 'none',
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
if (type === 'association' && directed) {
|
|
215
|
+
return { line: 'solid', start: 'none', end: 'singleBarb' };
|
|
216
|
+
}
|
|
217
|
+
return Object.hasOwn(relationshipNotation, type) ? relationshipNotation[type] : undefined;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=catalogue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogue.js","sourceRoot":"","sources":["../../src/archimate/catalogue.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAE5C,iFAAiF;AACjF,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,gEAAgE,EAAE,CAAC;IAC/E,MAAM,EAAE;QACN,EAAE,CAAC,EAAE,kGAAkG,EAAE;QACzG,EAAE,CAAC,EAAE,iDAAiD,EAAE,IAAI,EAAE,KAAK,EAAE;KACtE;IACD,UAAU,EAAE,CAAC,EAAE,CAAC,EAAE,0EAA0E,EAAE,CAAC;IAC/F,IAAI,EAAE;QACJ,EAAE,CAAC,EAAE,qFAAqF,EAAE;QAC5F,EAAE,CAAC,EAAE,iDAAiD,EAAE,IAAI,EAAE,KAAK,EAAE;KACtE;IACD,OAAO,EAAE;QACP,EAAE,CAAC,EAAE,uEAAuE,EAAE;QAC9E,EAAE,CAAC,EAAE,sBAAsB,EAAE;KAC9B;IACD,SAAS,EAAE;QACT,EAAE,CAAC,EAAE,mFAAmF,EAAE;QAC1F,EAAE,CAAC,EAAE,8EAA8E,EAAE,IAAI,EAAE,KAAK,EAAE;KACnG;IACD,WAAW,EAAE,CAAC,EAAE,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC5C,UAAU,EAAE,CAAC,EAAE,CAAC,EAAE,wCAAwC,EAAE,CAAC;IAC7D,OAAO,EAAE;QACP;YACE,CAAC,EAAE,6OAA6O;SACjP;KACF;IACD,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,8CAA8C,EAAE,CAAC;IAC9D,QAAQ,EAAE;QACR;YACE,CAAC,EAAE,8GAA8G;SAClH;KACF;IACD,UAAU,EAA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D,OAAO,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,IAAwB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChH,CAAC","sourcesContent":["export type ElementCategory =\n | 'motivation'\n | 'strategy'\n | 'business'\n | 'application'\n | 'technology'\n | 'physical'\n | 'implementationAndMigration'\n | 'composite';\n\nexport type ElementAspect = 'passiveStructure' | 'behavior' | 'activeStructure' | 'motivation';\n\nexport type ElementOutline = 'rectangle' | 'rounded' | 'chamfered' | 'grouping';\n\nexport interface IconPath {\n readonly d: string;\n readonly fill?: 'none' | 'ink';\n}\n\nexport interface ElementTypeDefinition {\n readonly name: string;\n readonly description: string;\n readonly category: ElementCategory;\n readonly aspect: ElementAspect | null;\n readonly notation?: {\n readonly outline: ElementOutline;\n readonly icon?: readonly IconPath[];\n };\n}\n\nexport const relationshipStroke = '#000000';\n\n// Original drawings of the default corner symbols, on a 16 × 16 coordinate grid.\nconst icons = {\n role: [{ d: 'M4 3H12A3 5 0 0 1 12 13H4A3 5 0 0 1 4 3Z M12 3A3 5 0 0 0 12 13' }],\n driver: [\n { d: 'M8 2A6 6 0 1 1 8 14A6 6 0 1 1 8 2Z M8 0.5V15.5 M0.5 8H15.5 M2.5 2.5L13.5 13.5 M13.5 2.5L2.5 13.5' },\n { d: 'M8 6.5A1.5 1.5 0 1 1 8 9.5A1.5 1.5 0 1 1 8 6.5Z', fill: 'ink' },\n ],\n assessment: [{ d: 'M9.8 1.5A4.8 4.8 0 1 1 9.8 11.1A4.8 4.8 0 1 1 9.8 1.5Z M6.3 9.7L1.5 14.5' }],\n goal: [\n { d: 'M8 1A7 7 0 1 1 8 15A7 7 0 1 1 8 1Z M8 3.7A4.3 4.3 0 1 1 8 12.3A4.3 4.3 0 1 1 8 3.7Z' },\n { d: 'M8 6.2A1.8 1.8 0 1 1 8 9.8A1.8 1.8 0 1 1 8 6.2Z', fill: 'ink' },\n ],\n outcome: [\n { d: 'M6 5A5 5 0 1 1 6 15A5 5 0 1 1 6 5Z M6 7A3 3 0 1 1 6 13A3 3 0 1 1 6 7Z' },\n { d: 'M14 2L6 10 M6 7V10H9' },\n ],\n principle: [\n { d: 'M3 1.5H13Q14.5 1.5 14.5 3V13Q14.5 14.5 13 14.5H3Q1.5 14.5 1.5 13V3Q1.5 1.5 3 1.5Z' },\n { d: 'M7.4 4.1H8.6L8.2 9.3H7.8Z M8 11.3A0.7 0.7 0 1 1 8 12.7A0.7 0.7 0 1 1 8 11.3Z', fill: 'ink' },\n ],\n requirement: [{ d: 'M4 3.5H15L12 12.5H1Z' }],\n constraint: [{ d: 'M4 3.5H15L12 12.5H1Z M6.1 3.5L3.1 12.5' }],\n meaning: [\n {\n d: 'M4.5 10.5C2.5 10.2 2.2 8 3.7 7.2C2.5 5.3 4.5 3.4 6.3 4.2C7.4 2.8 9.4 2.9 10.4 4.1C12 3.2 14.5 4.2 14 6.3C16 7.6 14.6 10.2 12.9 10.4C12.5 12 10.2 12.3 9.1 11.3C7.8 12.2 5.5 12.2 4.5 10.5Z M3 12A1 1 0 1 1 3 14A1 1 0 1 1 3 12Z M1 14.5H1.1',\n },\n ],\n value: [{ d: 'M8 3.2A7 4.8 0 1 1 8 12.8A7 4.8 0 1 1 8 3.2Z' }],\n resource: [\n {\n d: 'M2.5 4H12Q13 4 13 5V11Q13 12 12 12H2.5Q1 12 1 10.5V5.5Q1 4 2.5 4Z M13 6H15V10H13 M4.3 6V10 M7 6V10 M9.7 6V10',\n },\n ],\n capability: [{ d: 'M1 10H5V6H9V2H14V14H1Z M5 10V14 M9 6V14 M5 10H14 M9 6H14' }],\n valueStream: [{ d: 'M1 3H9.5L15 8L9.5 13H1L6.5 8Z' }],\n courseOfAction: [\n { d: 'M10.5 1A4.5 4.5 0 1 1 10.5 10A4.5 4.5 0 1 1 10.5 1Z M10.5 3A2.5 2.5 0 1 1 10.5 8A2.5 2.5 0 1 1 10.5 3Z' },\n { d: 'M1.5 14.5L7.3 8.7 M4.3 8.7H7.3V11.7' },\n ],\n actor: [\n { d: 'M8 1A2.6 2.6 0 1 1 8 6.2A2.6 2.6 0 1 1 8 1Z M8 6.2V10.7 M4.2 7.7H11.8 M8 10.7L4.4 15 M8 10.7L11.6 15' },\n ],\n collaboration: [{ d: 'M6 3A5 5 0 1 1 6 13A5 5 0 1 1 6 3Z M10 3A5 5 0 1 1 10 13A5 5 0 1 1 10 3Z' }],\n interface: [{ d: 'M1 8H6 M10.5 3.5A4.5 4.5 0 1 1 10.5 12.5A4.5 4.5 0 1 1 10.5 3.5Z' }],\n process: [{ d: 'M1 6H9V2L15 8L9 14V10H1Z' }],\n function: [{ d: 'M1.5 7L8 2L14.5 7V13L8 8L1.5 13Z' }],\n interaction: [{ d: 'M6.5 2V14A6 6 0 0 1 6.5 2Z M9.5 2V14A6 6 0 0 0 9.5 2Z' }],\n event: [{ d: 'M1.5 3H10A5 5 0 0 1 10 13H1.5L4.5 8Z' }],\n service: [{ d: 'M5 3.5H11A4.5 4.5 0 0 1 11 12.5H5A4.5 4.5 0 0 1 5 3.5Z' }],\n object: [{ d: 'M1.5 3H14.5V13H1.5Z M1.5 6H14.5' }],\n contract: [{ d: 'M1.5 3H14.5V13H1.5Z M1.5 5.7H14.5 M1.5 10.3H14.5' }],\n representation: [{ d: 'M1.5 3H14.5V12Q11.3 8.7 8 12Q4.7 15.3 1.5 12Z M1.5 6H14.5' }],\n product: [{ d: 'M1.5 3H14.5V13H1.5Z M8 3V7H1.5' }],\n component: [{ d: 'M4.5 4.8V2H14V14H4.5V11.2 M4.5 9V7 M1 4.8H7V7H1Z M1 9H7V11.2H1Z' }],\n node: [{ d: 'M1.5 4.5L4.5 1.5H14.5V11.5L11.5 14.5H1.5Z M1.5 4.5H11.5L14.5 1.5 M11.5 4.5V14.5' }],\n device: [\n {\n d: 'M3 2.5H13Q14.5 2.5 14.5 4V10Q14.5 11.5 13 11.5H3Q1.5 11.5 1.5 10V4Q1.5 2.5 3 2.5Z M3 11.5L1.5 14H14.5L13 11.5',\n },\n ],\n systemSoftware: [{ d: 'M4.3 6A5.2 5.2 0 1 1 12 12 M7 5A5.2 5.2 0 1 1 7 15.4A5.2 5.2 0 1 1 7 5Z' }],\n path: [{ d: 'M5.4 3.7L1 8L5.4 12.3 M10.6 3.7L15 8L10.6 12.3 M4.8 8H6.6 M9.4 8H11.2' }],\n communicationNetwork: [\n { d: 'M4.5 3H13L11.5 13H3Z' },\n {\n d: 'M4.5 1.4A1.6 1.6 0 1 1 4.5 4.6A1.6 1.6 0 1 1 4.5 1.4Z M13 1.4A1.6 1.6 0 1 1 13 4.6A1.6 1.6 0 1 1 13 1.4Z M11.5 11.4A1.6 1.6 0 1 1 11.5 14.6A1.6 1.6 0 1 1 11.5 11.4Z M3 11.4A1.6 1.6 0 1 1 3 14.6A1.6 1.6 0 1 1 3 11.4Z',\n fill: 'ink',\n },\n ],\n artifact: [{ d: 'M2.5 1.5H9.5L13.5 5.5V14.5H2.5Z M9.5 1.5V5.5H13.5' }],\n equipment: [\n {\n d: 'M6 5L7 4L9 4.5L9.5 6.3L11.2 7L12.7 6.5L14 8L13.5 9.8L14.5 11.2L13.5 13L11.7 12.8L10.2 14L10 15L7.8 15L7.2 13.8L5.5 13L4.1 13.6L2.6 12.1L3.4 10.6L2.5 9L2.8 7.4L4.7 7.4Z M8.5 7A2.7 2.7 0 1 1 8.5 12.4A2.7 2.7 0 1 1 8.5 7Z',\n },\n {\n d: 'M9.5 3L10 1.8L11.4 2L12.2 0.9L13.5 1.5L13.5 2.8L14.8 3.5L14.4 4.8L13.2 4.9L12.7 6 M12.2 2.8A1.4 1.4 0 1 1 12.2 5.6A1.4 1.4 0 1 1 12.2 2.8Z',\n },\n ],\n facility: [{ d: 'M1.5 2H4V9L7.5 7V9L11 7V9L14.5 7V14H1.5Z' }],\n distributionNetwork: [{ d: 'M4.5 4L1 8L4.5 12 M11.5 4L15 8L11.5 12 M2.5 6.5H13.5 M2.5 9.5H13.5' }],\n material: [{ d: 'M4.5 2H11.5L15 8L11.5 14H4.5L1 8Z M3.5 8L6 4 M10 4L12.5 8 M6 12H10' }],\n workPackage: [\n {\n d: 'M8.7 11.1C12.4 8.6 11.1 2.5 6.5 2.5C0.4 2.5 0.1 12.9 6.8 12.9H14.5 M14.5 12.9L11.6 10.7 M14.5 12.9L11.6 15.1',\n },\n ],\n deliverable: [{ d: 'M1.5 3H14.5V12Q11.3 8.7 8 12Q4.7 15.3 1.5 12Z' }],\n plateau: [{ d: 'M5 3H15V4.3H5Z M3 7.3H13V8.6H3Z M1 11.6H11V12.9H1Z', fill: 'ink' }],\n gap: [{ d: 'M8 2.5A5.5 5.5 0 1 1 8 13.5A5.5 5.5 0 1 1 8 2.5Z M0.5 6.2H15.5 M0.5 9.8H15.5' }],\n grouping: [\n {\n d: 'M1.5 13V10 M1.5 8.5V5.5 M1.5 4V2H4.5 M6 2H9 M10.5 2H12V5.5 M12 6H15V9 M15 10.5V13H12 M10.5 13H7.5 M6 13H3 M2 6H5 M6.5 6H9.5',\n },\n ],\n location: [{ d: 'M8 1.5A4.5 4.5 0 0 1 12.5 6C12.5 9 9.7 10.5 8 14.7C6.3 10.5 3.5 9 3.5 6A4.5 4.5 0 0 1 8 1.5Z' }],\n} as const satisfies Record<string, readonly IconPath[]>;\n\nfunction element(\n name: string,\n description: string,\n category: ElementCategory,\n aspect: ElementAspect | null,\n outline: ElementOutline,\n icon: keyof typeof icons,\n): ElementTypeDefinition {\n return { name, description, category, aspect, notation: { outline, icon: icons[icon] } };\n}\n\nexport const elementTypes = {\n stakeholder: element(\n 'Stakeholder',\n 'A party with interests in the architecture and its effects.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'role',\n ),\n driver: element(\n 'Driver',\n 'A condition that prompts change and shapes goals.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'driver',\n ),\n assessment: element(\n 'Assessment',\n 'A finding about the current situation in light of a driver.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'assessment',\n ),\n goal: element(\n 'Goal',\n 'A desired state or direction for the organisation.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'goal',\n ),\n outcome: element(\n 'Outcome',\n 'A result produced by a state of affairs or by a change.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'outcome',\n ),\n principle: element(\n 'Principle',\n 'A general rule or intent that guides architecture choices.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'principle',\n ),\n requirement: element(\n 'Requirement',\n 'A need that the architecture describes for a particular system.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'requirement',\n ),\n constraint: element(\n 'Constraint',\n 'A limit on the architecture, its implementation or its realisation.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'constraint',\n ),\n meaning: element(\n 'Meaning',\n 'An interpretation of a concept in its particular context.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'meaning',\n ),\n value: element(\n 'Value',\n 'The benefit, worth or significance attributed to a concept.',\n 'motivation',\n 'motivation',\n 'chamfered',\n 'value',\n ),\n resource: element(\n 'Resource',\n \"An asset under a person's or organisation's control.\",\n 'strategy',\n null,\n 'rectangle',\n 'resource',\n ),\n capability: element(\n 'Capability',\n 'Something a person, organisation or system can do.',\n 'strategy',\n 'behavior',\n 'rounded',\n 'capability',\n ),\n valueStream: element(\n 'Value Stream',\n 'A sequence of activities that produces value for a recipient.',\n 'strategy',\n 'behavior',\n 'rounded',\n 'valueStream',\n ),\n courseOfAction: element(\n 'Course of Action',\n 'A plan for using capabilities and resources to reach a goal.',\n 'strategy',\n 'behavior',\n 'rounded',\n 'courseOfAction',\n ),\n businessActor: element(\n 'Business Actor',\n 'A person, organisation or other business entity that can act.',\n 'business',\n 'activeStructure',\n 'rectangle',\n 'actor',\n ),\n businessRole: element(\n 'Business Role',\n 'A set of responsibilities a business actor can take on.',\n 'business',\n 'activeStructure',\n 'rectangle',\n 'role',\n ),\n businessCollaboration: element(\n 'Business Collaboration',\n 'Business actors or roles working together to perform shared behaviour.',\n 'business',\n 'activeStructure',\n 'rectangle',\n 'collaboration',\n ),\n businessInterface: element(\n 'Business Interface',\n 'An access point for a business service.',\n 'business',\n 'activeStructure',\n 'rectangle',\n 'interface',\n ),\n businessProcess: element(\n 'Business Process',\n 'Ordered business activities that produce a result.',\n 'business',\n 'behavior',\n 'rounded',\n 'process',\n ),\n businessFunction: element(\n 'Business Function',\n 'Business activities grouped by criteria such as skills or resources.',\n 'business',\n 'behavior',\n 'rounded',\n 'function',\n ),\n businessInteraction: element(\n 'Business Interaction',\n 'Behaviour that business participants perform jointly.',\n 'business',\n 'behavior',\n 'rounded',\n 'interaction',\n ),\n businessEvent: element(\n 'Business Event',\n 'A change of state that matters to the business.',\n 'business',\n 'behavior',\n 'rounded',\n 'event',\n ),\n businessService: element(\n 'Business Service',\n 'Business behaviour exposed to its consumers.',\n 'business',\n 'behavior',\n 'rounded',\n 'service',\n ),\n businessObject: element(\n 'Business Object',\n 'A concept that carries information in a business domain.',\n 'business',\n 'passiveStructure',\n 'rectangle',\n 'object',\n ),\n contract: element(\n 'Contract',\n 'An agreement defining obligations and terms for a product or service.',\n 'business',\n 'passiveStructure',\n 'rectangle',\n 'contract',\n ),\n representation: element(\n 'Representation',\n \"A perceptible form in which a business object's information is expressed.\",\n 'business',\n 'passiveStructure',\n 'rectangle',\n 'representation',\n ),\n product: element(\n 'Product',\n 'Services or passive structure bundled as an offering under an agreement.',\n 'business',\n null,\n 'rectangle',\n 'product',\n ),\n applicationComponent: element(\n 'Application Component',\n 'A replaceable software module that encapsulates application functionality.',\n 'application',\n 'activeStructure',\n 'rectangle',\n 'component',\n ),\n applicationCollaboration: element(\n 'Application Collaboration',\n 'Application components working together to perform shared behaviour.',\n 'application',\n 'activeStructure',\n 'rectangle',\n 'collaboration',\n ),\n applicationInterface: element(\n 'Application Interface',\n 'An access point for an application service.',\n 'application',\n 'activeStructure',\n 'rectangle',\n 'interface',\n ),\n applicationFunction: element(\n 'Application Function',\n 'Automated behaviour performed by an application component.',\n 'application',\n 'behavior',\n 'rounded',\n 'function',\n ),\n applicationInteraction: element(\n 'Application Interaction',\n 'Behaviour that application components perform jointly.',\n 'application',\n 'behavior',\n 'rounded',\n 'interaction',\n ),\n applicationProcess: element(\n 'Application Process',\n 'Ordered application activities that produce a result.',\n 'application',\n 'behavior',\n 'rounded',\n 'process',\n ),\n applicationEvent: element(\n 'Application Event',\n 'A change of state in an application.',\n 'application',\n 'behavior',\n 'rounded',\n 'event',\n ),\n applicationService: element(\n 'Application Service',\n 'Application behaviour exposed to its consumers.',\n 'application',\n 'behavior',\n 'rounded',\n 'service',\n ),\n dataObject: element(\n 'Data Object',\n 'Information organised for automated processing.',\n 'application',\n 'passiveStructure',\n 'rectangle',\n 'object',\n ),\n node: element(\n 'Node',\n 'A computational or physical resource that hosts or interacts with other resources.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'node',\n ),\n device: element(\n 'Device',\n 'Physical IT equipment that can host software or artifacts.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'device',\n ),\n systemSoftware: element(\n 'System Software',\n 'Software that supplies an environment for running software or using data.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'systemSoftware',\n ),\n technologyCollaboration: element(\n 'Technology Collaboration',\n 'Technology resources working together to perform shared behaviour.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'collaboration',\n ),\n technologyInterface: element(\n 'Technology Interface',\n 'An access point for a technology service.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'interface',\n ),\n path: element(\n 'Path',\n 'A link through which technology resources can exchange information, energy or material.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'path',\n ),\n communicationNetwork: element(\n 'Communication Network',\n 'Infrastructure that connects devices or system software to transmit and route data.',\n 'technology',\n 'activeStructure',\n 'rectangle',\n 'communicationNetwork',\n ),\n technologyFunction: element(\n 'Technology Function',\n 'A group of activities performed by a technology resource.',\n 'technology',\n 'behavior',\n 'rounded',\n 'function',\n ),\n technologyProcess: element(\n 'Technology Process',\n 'Ordered technology activities that produce a result.',\n 'technology',\n 'behavior',\n 'rounded',\n 'process',\n ),\n technologyInteraction: element(\n 'Technology Interaction',\n 'Behaviour that technology resources perform jointly.',\n 'technology',\n 'behavior',\n 'rounded',\n 'interaction',\n ),\n technologyEvent: element(\n 'Technology Event',\n 'A change of state in the technology layer.',\n 'technology',\n 'behavior',\n 'rounded',\n 'event',\n ),\n technologyService: element(\n 'Technology Service',\n 'Technology behaviour exposed to its consumers.',\n 'technology',\n 'behavior',\n 'rounded',\n 'service',\n ),\n artifact: element(\n 'Artifact',\n 'A piece of data used or produced when developing, deploying or running a system.',\n 'technology',\n 'passiveStructure',\n 'rectangle',\n 'artifact',\n ),\n equipment: element(\n 'Equipment',\n 'Machinery, tools or instruments that act on physical material.',\n 'physical',\n 'activeStructure',\n 'rectangle',\n 'equipment',\n ),\n facility: element(\n 'Facility',\n 'A physical structure or environment used in operations.',\n 'physical',\n 'activeStructure',\n 'rectangle',\n 'facility',\n ),\n distributionNetwork: element(\n 'Distribution Network',\n 'Infrastructure that carries material or energy between physical points.',\n 'physical',\n 'activeStructure',\n 'rectangle',\n 'distributionNetwork',\n ),\n material: element(\n 'Material',\n 'Physical matter or energy involved in the architecture.',\n 'physical',\n 'passiveStructure',\n 'rectangle',\n 'material',\n ),\n workPackage: element(\n 'Work Package',\n 'A bounded set of actions planned to produce a result.',\n 'implementationAndMigration',\n 'behavior',\n 'rounded',\n 'workPackage',\n ),\n deliverable: element(\n 'Deliverable',\n 'An identified result produced by a work package.',\n 'implementationAndMigration',\n 'passiveStructure',\n 'rectangle',\n 'deliverable',\n ),\n implementationEvent: element(\n 'Implementation Event',\n 'A change of state during implementation or migration.',\n 'implementationAndMigration',\n 'behavior',\n 'rounded',\n 'event',\n ),\n plateau: element(\n 'Plateau',\n 'A relatively stable architecture state within a period of time.',\n 'implementationAndMigration',\n null,\n 'rectangle',\n 'plateau',\n ),\n gap: element(\n 'Gap',\n 'A difference between two architecture plateaus.',\n 'implementationAndMigration',\n null,\n 'rectangle',\n 'gap',\n ),\n grouping: element(\n 'Grouping',\n 'A collection of concepts that share a common characteristic.',\n 'composite',\n null,\n 'grouping',\n 'grouping',\n ),\n location: element(\n 'Location',\n 'A physical or conceptual place where concepts are situated or behaviour occurs.',\n 'composite',\n null,\n 'rectangle',\n 'location',\n ),\n} as const satisfies Record<string, ElementTypeDefinition>;\n\nexport type ElementType = keyof typeof elementTypes;\n\nexport function getElementType(type: string): ElementTypeDefinition | undefined {\n return Object.hasOwn(elementTypes, type) ? elementTypes[type as ElementType] : undefined;\n}\n\nexport type AccessMode = 'read' | 'write' | 'readWrite' | 'unspecified';\n// The model omits \"unspecified\", so a relationship carries an access mode only when one is given.\nexport type SpecifiedAccessMode = Exclude<AccessMode, 'unspecified'>;\nexport type RelationshipMarker =\n 'none' | 'filledDiamond' | 'openDiamond' | 'filledDot' | 'openArrow' | 'filledArrow' | 'openTriangle' | 'singleBarb';\n\nexport interface RelationshipNotation {\n readonly line: 'solid' | 'dashed' | 'dotted';\n readonly start: RelationshipMarker;\n readonly end: RelationshipMarker;\n}\n\nexport const relationshipTypes = [\n 'composition',\n 'aggregation',\n 'assignment',\n 'realization',\n 'serving',\n 'access',\n 'influence',\n 'association',\n 'triggering',\n 'flow',\n 'specialization',\n] as const;\n\nexport type RelationshipType = (typeof relationshipTypes)[number];\n\nexport const relationshipNames = {\n composition: 'Composition',\n aggregation: 'Aggregation',\n assignment: 'Assignment',\n realization: 'Realization',\n serving: 'Serving',\n access: 'Access',\n influence: 'Influence',\n association: 'Association',\n triggering: 'Triggering',\n flow: 'Flow',\n specialization: 'Specialization',\n} as const satisfies Record<RelationshipType, string>;\n\n// Markers are indexed by model source and target.\nconst relationshipNotation = {\n composition: { line: 'solid', start: 'filledDiamond', end: 'none' },\n aggregation: { line: 'solid', start: 'openDiamond', end: 'none' },\n assignment: { line: 'solid', start: 'filledDot', end: 'filledArrow' },\n realization: { line: 'dotted', start: 'none', end: 'openTriangle' },\n serving: { line: 'solid', start: 'none', end: 'openArrow' },\n access: { line: 'dotted', start: 'none', end: 'none' },\n influence: { line: 'dashed', start: 'none', end: 'openArrow' },\n association: { line: 'solid', start: 'none', end: 'none' },\n triggering: { line: 'solid', start: 'none', end: 'filledArrow' },\n flow: { line: 'dashed', start: 'none', end: 'filledArrow' },\n specialization: { line: 'solid', start: 'none', end: 'openTriangle' },\n} as const satisfies Record<RelationshipType, RelationshipNotation>;\n\nexport function getRelationshipNotation(\n type: string,\n access: AccessMode = 'unspecified',\n directed = false,\n): RelationshipNotation | undefined {\n if (type === 'access') {\n return {\n line: 'dotted',\n start: access === 'read' || access === 'readWrite' ? 'openArrow' : 'none',\n end: access === 'write' || access === 'readWrite' ? 'openArrow' : 'none',\n };\n }\n if (type === 'association' && directed) {\n return { line: 'solid', start: 'none', end: 'singleBarb' };\n }\n return Object.hasOwn(relationshipNotation, type) ? relationshipNotation[type as RelationshipType] : undefined;\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { IToken } from 'chevrotain';
|
|
2
|
+
import type { ArchiMateModel } from './model.js';
|
|
3
|
+
export type ArchiMateErrorCode = 'LEXICAL_ERROR' | 'SYNTAX_ERROR' | 'INVALID_TEXT' | 'INVALID_DIRECTION' | 'INVALID_LAYOUT' | 'DUPLICATE_DECLARATION' | 'DUPLICATE_ID' | 'UNKNOWN_ELEMENT_TYPE' | 'UNKNOWN_RELATIONSHIP_TYPE' | 'UNKNOWN_ELEMENT' | 'UNSUPPORTED_ENDPOINT' | 'INVALID_RELATIONSHIP_PROPERTY' | 'INVALID_NOTE_TARGET' | 'INVALID_NESTING' | 'INVALID_LINK';
|
|
4
|
+
export type ArchiMateWarningCode = 'DUPLICATE_RELATIONSHIP';
|
|
5
|
+
export declare class ArchiMateError extends Error {
|
|
6
|
+
readonly code: ArchiMateErrorCode;
|
|
7
|
+
readonly line: number;
|
|
8
|
+
readonly column: number;
|
|
9
|
+
readonly detail: string;
|
|
10
|
+
constructor(code: ArchiMateErrorCode, line: number, column: number, detail: string);
|
|
11
|
+
}
|
|
12
|
+
/** Lines and columns are 1-based. The end position is exclusive, as in editor ranges. */
|
|
13
|
+
export interface ArchiMateSourceRange {
|
|
14
|
+
readonly line: number;
|
|
15
|
+
readonly column: number;
|
|
16
|
+
readonly endLine: number;
|
|
17
|
+
readonly endColumn: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ArchiMateErrorDiagnostic extends ArchiMateSourceRange {
|
|
20
|
+
readonly severity: 'error';
|
|
21
|
+
readonly code: ArchiMateErrorCode;
|
|
22
|
+
readonly message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ArchiMateWarningDiagnostic extends ArchiMateSourceRange {
|
|
25
|
+
readonly severity: 'warning';
|
|
26
|
+
readonly code: ArchiMateWarningCode;
|
|
27
|
+
readonly message: string;
|
|
28
|
+
}
|
|
29
|
+
export type ArchiMateDiagnostic = ArchiMateErrorDiagnostic | ArchiMateWarningDiagnostic;
|
|
30
|
+
export interface ArchiMateValidationResult {
|
|
31
|
+
readonly model?: ArchiMateModel;
|
|
32
|
+
readonly diagnostics: readonly ArchiMateDiagnostic[];
|
|
33
|
+
}
|
|
34
|
+
export declare class DiagnosticCollector {
|
|
35
|
+
private readonly text;
|
|
36
|
+
private readonly lineOffset;
|
|
37
|
+
readonly diagnostics: ArchiMateDiagnostic[];
|
|
38
|
+
constructor(text: string, lineOffset: number);
|
|
39
|
+
get hasErrors(): boolean;
|
|
40
|
+
error(code: ArchiMateErrorCode, token: IToken, message: string): void;
|
|
41
|
+
errorAt(code: ArchiMateErrorCode, range: ArchiMateSourceRange, message: string): void;
|
|
42
|
+
warning(code: ArchiMateWarningCode, start: IToken, end: IToken, message: string): void;
|
|
43
|
+
line(token: IToken): number;
|
|
44
|
+
sourceRange(line: number, column: number, endLine: number, endColumn: number): ArchiMateSourceRange;
|
|
45
|
+
private range;
|
|
46
|
+
private endOfSource;
|
|
47
|
+
}
|
|
48
|
+
export type Report = (code: ArchiMateErrorCode, token: IToken, message: string) => void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export class ArchiMateError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
line;
|
|
4
|
+
column;
|
|
5
|
+
detail;
|
|
6
|
+
constructor(code, line, column, detail) {
|
|
7
|
+
super(`Line ${line}, column ${column}: ${detail}`);
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.line = line;
|
|
10
|
+
this.column = column;
|
|
11
|
+
this.detail = detail;
|
|
12
|
+
this.name = 'ArchiMateError';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class DiagnosticCollector {
|
|
16
|
+
text;
|
|
17
|
+
lineOffset;
|
|
18
|
+
diagnostics = [];
|
|
19
|
+
constructor(text, lineOffset) {
|
|
20
|
+
this.text = text;
|
|
21
|
+
this.lineOffset = lineOffset;
|
|
22
|
+
}
|
|
23
|
+
get hasErrors() {
|
|
24
|
+
return this.diagnostics.some(({ severity }) => severity === 'error');
|
|
25
|
+
}
|
|
26
|
+
error(code, token, message) {
|
|
27
|
+
this.errorAt(code, this.range(token, token), message);
|
|
28
|
+
}
|
|
29
|
+
errorAt(code, range, message) {
|
|
30
|
+
this.diagnostics.push({ severity: 'error', code, message, ...range });
|
|
31
|
+
}
|
|
32
|
+
warning(code, start, end, message) {
|
|
33
|
+
this.diagnostics.push({ severity: 'warning', code, message, ...this.range(start, end) });
|
|
34
|
+
}
|
|
35
|
+
line(token) {
|
|
36
|
+
return this.range(token, token).line;
|
|
37
|
+
}
|
|
38
|
+
// Lexer line numbers are relative to the text this parser sees; the host adds the lines it removed.
|
|
39
|
+
sourceRange(line, column, endLine, endColumn) {
|
|
40
|
+
return {
|
|
41
|
+
line: line + this.lineOffset,
|
|
42
|
+
column,
|
|
43
|
+
endLine: endLine + this.lineOffset,
|
|
44
|
+
endColumn,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
range(start, end) {
|
|
48
|
+
const { startLine, startColumn } = start;
|
|
49
|
+
if (startLine === undefined || !(startLine > 0) || startColumn === undefined || !(startColumn > 0)) {
|
|
50
|
+
return this.endOfSource();
|
|
51
|
+
}
|
|
52
|
+
const { endLine, endColumn } = end;
|
|
53
|
+
return endLine !== undefined && endLine > 0 && endColumn !== undefined && endColumn > 0
|
|
54
|
+
? this.sourceRange(startLine, startColumn, endLine, endColumn + 1)
|
|
55
|
+
: this.sourceRange(startLine, startColumn, startLine, startColumn);
|
|
56
|
+
}
|
|
57
|
+
// Tokens such as EOF carry no position, so errors at the end of input point after the last character.
|
|
58
|
+
endOfSource() {
|
|
59
|
+
const lines = this.text.split(/\r\n|\n|\r/);
|
|
60
|
+
const column = (lines.at(-1)?.length ?? 0) + 1;
|
|
61
|
+
return this.sourceRange(lines.length, column, lines.length, column);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/archimate/diagnostics.ts"],"names":[],"mappings":"AAsBA,MAAM,OAAO,cAAe,SAAQ,KAAK;IAE5B;IACA;IACA;IACA;IAJX,YACW,IAAwB,EACxB,IAAY,EACZ,MAAc,EACd,MAAc;QAEvB,KAAK,CAAC,QAAQ,IAAI,YAAY,MAAM,KAAK,MAAM,EAAE,CAAC,CAAC;QAL1C,SAAI,GAAJ,IAAI,CAAoB;QACxB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QAGvB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AA6BD,MAAM,OAAO,mBAAmB;IAIX;IACA;IAJV,WAAW,GAA0B,EAAE,CAAC;IAEjD,YACmB,IAAY,EACZ,UAAkB;QADlB,SAAI,GAAJ,IAAI,CAAQ;QACZ,eAAU,GAAV,UAAU,CAAQ;IAClC,CAAC;IAEJ,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,WAAW,CA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AW,KAAK,SAAS,IAAI,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE,CAAC;YACnG,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC;QACnC,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,CAAC,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,GAAG,CAAC;YACrF,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,GAAG,CAAC,CAAC;YAClE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACvE,CAAC;IAED,sGAAsG;IAC9F,WAAW;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC;CACF","sourcesContent":["import type { IToken } from 'chevrotain';\nimport type { ArchiMateModel } from './model.js';\n\nexport type ArchiMateErrorCode =\n | 'LEXICAL_ERROR'\n | 'SYNTAX_ERROR'\n | 'INVALID_TEXT'\n | 'INVALID_DIRECTION'\n | 'INVALID_LAYOUT'\n | 'DUPLICATE_DECLARATION'\n | 'DUPLICATE_ID'\n | 'UNKNOWN_ELEMENT_TYPE'\n | 'UNKNOWN_RELATIONSHIP_TYPE'\n | 'UNKNOWN_ELEMENT'\n | 'UNSUPPORTED_ENDPOINT'\n | 'INVALID_RELATIONSHIP_PROPERTY'\n | 'INVALID_NOTE_TARGET'\n | 'INVALID_NESTING'\n | 'INVALID_LINK';\n\nexport type ArchiMateWarningCode = 'DUPLICATE_RELATIONSHIP';\n\nexport class ArchiMateError extends Error {\n constructor(\n readonly code: ArchiMateErrorCode,\n readonly line: number,\n readonly column: number,\n readonly detail: string,\n ) {\n super(`Line ${line}, column ${column}: ${detail}`);\n this.name = 'ArchiMateError';\n }\n}\n\n/** Lines and columns are 1-based. The end position is exclusive, as in editor ranges. */\nexport interface ArchiMateSourceRange {\n readonly line: number;\n readonly column: number;\n readonly endLine: number;\n readonly endColumn: number;\n}\n\nexport interface ArchiMateErrorDiagnostic extends ArchiMateSourceRange {\n readonly severity: 'error';\n readonly code: ArchiMateErrorCode;\n readonly message: string;\n}\n\nexport interface ArchiMateWarningDiagnostic extends ArchiMateSourceRange {\n readonly severity: 'warning';\n readonly code: ArchiMateWarningCode;\n readonly message: string;\n}\n\nexport type ArchiMateDiagnostic = ArchiMateErrorDiagnostic | ArchiMateWarningDiagnostic;\n\nexport interface ArchiMateValidationResult {\n readonly model?: ArchiMateModel;\n readonly diagnostics: readonly ArchiMateDiagnostic[];\n}\n\nexport class DiagnosticCollector {\n readonly diagnostics: ArchiMateDiagnostic[] = [];\n\n constructor(\n private readonly text: string,\n private readonly lineOffset: number,\n ) {}\n\n get hasErrors(): boolean {\n return this.diagnostics.some(({ severity }) => severity === 'error');\n }\n\n error(code: ArchiMateErrorCode, token: IToken, message: string): void {\n this.errorAt(code, this.range(token, token), message);\n }\n\n errorAt(code: ArchiMateErrorCode, range: ArchiMateSourceRange, message: string): void {\n this.diagnostics.push({ severity: 'error', code, message, ...range });\n }\n\n warning(code: ArchiMateWarningCode, start: IToken, end: IToken, message: string): void {\n this.diagnostics.push({ severity: 'warning', code, message, ...this.range(start, end) });\n }\n\n line(token: IToken): number {\n return this.range(token, token).line;\n }\n\n // Lexer line numbers are relative to the text this parser sees; the host adds the lines it removed.\n sourceRange(line: number, column: number, endLine: number, endColumn: number): ArchiMateSourceRange {\n return {\n line: line + this.lineOffset,\n column,\n endLine: endLine + this.lineOffset,\n endColumn,\n };\n }\n\n private range(start: IToken, end: IToken): ArchiMateSourceRange {\n const { startLine, startColumn } = start;\n if (startLine === undefined || !(startLine > 0) || startColumn === undefined || !(startColumn > 0)) {\n return this.endOfSource();\n }\n const { endLine, endColumn } = end;\n return endLine !== undefined && endLine > 0 && endColumn !== undefined && endColumn > 0\n ? this.sourceRange(startLine, startColumn, endLine, endColumn + 1)\n : this.sourceRange(startLine, startColumn, startLine, startColumn);\n }\n\n // Tokens such as EOF carry no position, so errors at the end of input point after the last character.\n private endOfSource(): ArchiMateSourceRange {\n const lines = this.text.split(/\\r\\n|\\n|\\r/);\n const column = (lines.at(-1)?.length ?? 0) + 1;\n return this.sourceRange(lines.length, column, lines.length, column);\n }\n}\n\nexport type Report = (code: ArchiMateErrorCode, token: IToken, message: string) => void;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type FrontmatterMatch = {
|
|
2
|
+
readonly kind: 'none';
|
|
3
|
+
} | {
|
|
4
|
+
readonly kind: 'closed';
|
|
5
|
+
readonly length: number;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'unclosed';
|
|
8
|
+
readonly column: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function blankFrontmatter(text: string): FrontmatterMatch & {
|
|
11
|
+
readonly text: string;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const yamlWhitespace = /\s/;
|
|
2
|
+
function isLineBreak(character) {
|
|
3
|
+
return character === '\n' || character === '\r';
|
|
4
|
+
}
|
|
5
|
+
function isYamlWhitespace(character) {
|
|
6
|
+
return character !== undefined && yamlWhitespace.test(character);
|
|
7
|
+
}
|
|
8
|
+
function lastLineBreakInWhitespaceRun(text, from) {
|
|
9
|
+
let lineBreak = -1;
|
|
10
|
+
for (let index = from; isYamlWhitespace(text[index]); index++) {
|
|
11
|
+
if (isLineBreak(text[index]))
|
|
12
|
+
lineBreak = index;
|
|
13
|
+
}
|
|
14
|
+
return lineBreak;
|
|
15
|
+
}
|
|
16
|
+
// Mirrors matchFrontMatter in Mermaid 12.3.0 so the validator skips exactly the blocks a Mermaid host strips.
|
|
17
|
+
// Like Mermaid, it expects line breaks already normalized to "\n".
|
|
18
|
+
function matchFrontmatter(text) {
|
|
19
|
+
let cursor = 0;
|
|
20
|
+
while (isYamlWhitespace(text[cursor]) && !isLineBreak(text[cursor]))
|
|
21
|
+
cursor++;
|
|
22
|
+
if (!text.startsWith('---', cursor))
|
|
23
|
+
return { kind: 'none' };
|
|
24
|
+
const openingEnds = [];
|
|
25
|
+
for (let index = cursor + 3; isYamlWhitespace(text[index]); index++) {
|
|
26
|
+
if (isLineBreak(text[index]))
|
|
27
|
+
openingEnds.push(index);
|
|
28
|
+
}
|
|
29
|
+
const [firstOpeningEnd] = openingEnds;
|
|
30
|
+
if (firstOpeningEnd === undefined)
|
|
31
|
+
return { kind: 'none' };
|
|
32
|
+
const closingFence = text.slice(0, cursor) + '---';
|
|
33
|
+
const closingEnd = (index) => isLineBreak(text[index]) && text.startsWith(closingFence, index + 1)
|
|
34
|
+
? lastLineBreakInWhitespaceRun(text, index + 1 + closingFence.length)
|
|
35
|
+
: -1;
|
|
36
|
+
let lastClosingFence = -1;
|
|
37
|
+
for (let index = firstOpeningEnd + 1; index < text.length; index++) {
|
|
38
|
+
if (closingEnd(index) !== -1)
|
|
39
|
+
lastClosingFence = index;
|
|
40
|
+
}
|
|
41
|
+
const openingEnd = openingEnds.filter((candidate) => candidate < lastClosingFence).at(-1) ?? firstOpeningEnd;
|
|
42
|
+
for (let index = openingEnd + 1; index <= lastClosingFence; index++) {
|
|
43
|
+
const end = closingEnd(index);
|
|
44
|
+
if (end !== -1)
|
|
45
|
+
return { kind: 'closed', length: end + 1 };
|
|
46
|
+
}
|
|
47
|
+
return { kind: 'unclosed', column: cursor + 1 };
|
|
48
|
+
}
|
|
49
|
+
// Blanking frontmatter instead of removing it keeps every later token on its original line.
|
|
50
|
+
export function blankFrontmatter(text) {
|
|
51
|
+
const normalized = text.replace(/\r\n?/g, '\n');
|
|
52
|
+
const match = matchFrontmatter(normalized);
|
|
53
|
+
if (match.kind !== 'closed')
|
|
54
|
+
return { ...match, text };
|
|
55
|
+
const lineBreaks = normalized.slice(0, match.length).split('\n').length - 1;
|
|
56
|
+
const end = text
|
|
57
|
+
.split(/(?<=\r\n|\r(?!\n)|\n)/)
|
|
58
|
+
.slice(0, lineBreaks)
|
|
59
|
+
.join('').length;
|
|
60
|
+
return { ...match, text: text.slice(0, end).replace(/[^\r\n]/g, '') + text.slice(end) };
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/archimate/frontmatter.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,SAAS,WAAW,CAAC,SAA6B;IAChD,OAAO,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI,CAAC;AAClD,CAAC;AAED,SAAS,gBAAgB,CAAC,SAA6B;IACrD,OAAO,SAAS,KAAK,SAAS,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,4BAA4B,CAAC,IAAY,EAAE,IAAY;IAC9D,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;IACnB,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9D,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAAE,SAAS,GAAG,KAAK,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAOD,8GAA8G;AAC9G,mEAAmE;AACnE,SAAS,gBAAgB,CAAC,IAAY;IAC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;IACnB,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1F,CAAC","sourcesContent":["const yamlWhitespace = /\\s/;\n\nfunction isLineBreak(character: string | undefined): boolean {\n return character === '\\n' || character === '\\r';\n}\n\nfunction isYamlWhitespace(character: string | undefined): boolean {\n return character !== undefined && yamlWhitespace.test(character);\n}\n\nfunction lastLineBreakInWhitespaceRun(text: string, from: number): number {\n let lineBreak = -1;\n for (let index = from; isYamlWhitespace(text[index]); index++) {\n if (isLineBreak(text[index])) lineBreak = index;\n }\n return lineBreak;\n}\n\ntype FrontmatterMatch =\n | { readonly kind: 'none' }\n | { readonly kind: 'closed'; readonly length: number }\n | { readonly kind: 'unclosed'; readonly column: number };\n\n// Mirrors matchFrontMatter in Mermaid 12.3.0 so the validator skips exactly the blocks a Mermaid host strips.\n// Like Mermaid, it expects line breaks already normalized to \"\\n\".\nfunction matchFrontmatter(text: string): FrontmatterMatch {\n let cursor = 0;\n while (isYamlWhitespace(text[cursor]) && !isLineBreak(text[cursor])) cursor++;\n if (!text.startsWith('---', cursor)) return { kind: 'none' };\n const openingEnds: number[] = [];\n for (let index = cursor + 3; isYamlWhitespace(text[index]); index++) {\n if (isLineBreak(text[index])) openingEnds.push(index);\n }\n const [firstOpeningEnd] = openingEnds;\n if (firstOpeningEnd === undefined) return { kind: 'none' };\n\n const closingFence = text.slice(0, cursor) + '---';\n const closingEnd = (index: number): number =>\n isLineBreak(text[index]) && text.startsWith(closingFence, index + 1)\n ? lastLineBreakInWhitespaceRun(text, index + 1 + closingFence.length)\n : -1;\n let lastClosingFence = -1;\n for (let index = firstOpeningEnd + 1; index < text.length; index++) {\n if (closingEnd(index) !== -1) lastClosingFence = index;\n }\n const openingEnd = openingEnds.filter((candidate) => candidate < lastClosingFence).at(-1) ?? firstOpeningEnd;\n for (let index = openingEnd + 1; index <= lastClosingFence; index++) {\n const end = closingEnd(index);\n if (end !== -1) return { kind: 'closed', length: end + 1 };\n }\n return { kind: 'unclosed', column: cursor + 1 };\n}\n\n// Blanking frontmatter instead of removing it keeps every later token on its original line.\nexport function blankFrontmatter(text: string): FrontmatterMatch & { readonly text: string } {\n const normalized = text.replace(/\\r\\n?/g, '\\n');\n const match = matchFrontmatter(normalized);\n if (match.kind !== 'closed') return { ...match, text };\n const lineBreaks = normalized.slice(0, match.length).split('\\n').length - 1;\n const end = text\n .split(/(?<=\\r\\n|\\r(?!\\n)|\\n)/)\n .slice(0, lineBreaks)\n .join('').length;\n return { ...match, text: text.slice(0, end).replace(/[^\\r\\n]/g, '') + text.slice(end) };\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { IRecognitionException, IToken } from 'chevrotain';
|
|
2
|
+
export type Declaration = {
|
|
3
|
+
kind: 'direction';
|
|
4
|
+
value: IToken;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'layout';
|
|
7
|
+
value: IToken;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'metadata';
|
|
10
|
+
value: IToken;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'element';
|
|
13
|
+
type: IToken;
|
|
14
|
+
id: IToken;
|
|
15
|
+
name: IToken;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'description';
|
|
18
|
+
id: IToken;
|
|
19
|
+
value: IToken;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'note';
|
|
22
|
+
id: IToken;
|
|
23
|
+
text: IToken;
|
|
24
|
+
anchor?: IToken;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'nesting';
|
|
27
|
+
child: IToken;
|
|
28
|
+
parent: IToken;
|
|
29
|
+
relationshipId?: IToken;
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'click';
|
|
32
|
+
id: IToken;
|
|
33
|
+
url: IToken;
|
|
34
|
+
tooltip?: IToken;
|
|
35
|
+
target?: IToken;
|
|
36
|
+
} | RelationshipDeclaration | ConnectorDeclaration;
|
|
37
|
+
export interface RelationshipDeclaration {
|
|
38
|
+
kind: 'relationship';
|
|
39
|
+
type: IToken;
|
|
40
|
+
id: IToken;
|
|
41
|
+
source: IToken;
|
|
42
|
+
target: IToken;
|
|
43
|
+
mode?: IToken;
|
|
44
|
+
directed?: IToken;
|
|
45
|
+
label?: IToken;
|
|
46
|
+
}
|
|
47
|
+
export interface ConnectorDeclaration {
|
|
48
|
+
kind: 'connector';
|
|
49
|
+
source: IToken;
|
|
50
|
+
connector: IToken;
|
|
51
|
+
target: IToken;
|
|
52
|
+
label?: IToken;
|
|
53
|
+
}
|
|
54
|
+
export type GrammarResult = {
|
|
55
|
+
readonly declarations: Declaration[];
|
|
56
|
+
} | {
|
|
57
|
+
readonly syntaxError: IRecognitionException;
|
|
58
|
+
};
|
|
59
|
+
export declare function parseDeclarations(input: IToken[]): GrammarResult;
|
|
60
|
+
export declare function describeSyntaxError(error: IRecognitionException, tokens: readonly IToken[]): string;
|