@cyberismo/assets 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/THIRD-PARTY.txt +127 -0
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.js +892 -314
  4. package/dist/schemas.d.ts +39601 -38
  5. package/dist/static/pdf-themes/cyberismo-theme.yml +57 -0
  6. package/dist/static/pdf-themes/fonts/PlusJakartaSans-Bold.ttf +0 -0
  7. package/dist/static/pdf-themes/fonts/PlusJakartaSans-BoldItalic.ttf +0 -0
  8. package/dist/static/pdf-themes/fonts/PlusJakartaSans-ExtraBold.ttf +0 -0
  9. package/dist/static/pdf-themes/fonts/PlusJakartaSans-ExtraBoldItalic.ttf +0 -0
  10. package/dist/static/pdf-themes/fonts/PlusJakartaSans-ExtraLight.ttf +0 -0
  11. package/dist/static/pdf-themes/fonts/PlusJakartaSans-ExtraLightItalic.ttf +0 -0
  12. package/dist/static/pdf-themes/fonts/PlusJakartaSans-Italic.ttf +0 -0
  13. package/dist/static/pdf-themes/fonts/PlusJakartaSans-Light.ttf +0 -0
  14. package/dist/static/pdf-themes/fonts/PlusJakartaSans-LightItalic.ttf +0 -0
  15. package/dist/static/pdf-themes/fonts/PlusJakartaSans-Medium.ttf +0 -0
  16. package/dist/static/pdf-themes/fonts/PlusJakartaSans-MediumItalic.ttf +0 -0
  17. package/dist/static/pdf-themes/fonts/PlusJakartaSans-Regular.ttf +0 -0
  18. package/dist/static/pdf-themes/fonts/PlusJakartaSans-SemiBold.ttf +0 -0
  19. package/dist/static/pdf-themes/fonts/PlusJakartaSans-SemiBoldItalic.ttf +0 -0
  20. package/dist/static/pdf-themes/img/cyberismo-logo.png +0 -0
  21. package/package.json +3 -3
  22. package/src/calculations/common/base.lp +0 -14
  23. package/src/calculations/common/queryLanguage.lp +116 -265
  24. package/src/calculations/common/utils.lp +205 -0
  25. package/src/calculations/queries/card.lp +63 -57
  26. package/src/exportPdfReport/index.adoc.hbs +33 -0
  27. package/src/exportPdfReport/query.lp.hbs +47 -0
  28. package/src/graphvizReport/query.lp.hbs +10 -2
  29. package/src/index.ts +10 -1
  30. package/src/schema/cardsConfigSchema.json +3 -3
  31. package/src/schema/macros/imageMacroSchema.json +24 -0
  32. package/src/schema/macros/includeMacroSchema.json +26 -0
  33. package/src/schema/macros/percentageMacroSchema.json +25 -0
  34. package/src/schema/macros/vegaLiteMacroSchema.json +31711 -0
  35. package/src/schema/macros/vegaMacroSchema.json +14931 -0
  36. package/src/schema/macros/xrefMacroSchema.json +12 -0
  37. package/src/schema/resources/fieldTypeSchema.json +2 -1
  38. package/src/schema/resources/linkTypeSchema.json +2 -1
  39. package/src/schemas.ts +12 -0
  40. package/src/static/pdf-themes/cyberismo-theme.yml +57 -0
  41. package/src/static/pdf-themes/fonts/PlusJakartaSans-Bold.ttf +0 -0
  42. package/src/static/pdf-themes/fonts/PlusJakartaSans-BoldItalic.ttf +0 -0
  43. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraBold.ttf +0 -0
  44. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraBoldItalic.ttf +0 -0
  45. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraLight.ttf +0 -0
  46. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraLightItalic.ttf +0 -0
  47. package/src/static/pdf-themes/fonts/PlusJakartaSans-Italic.ttf +0 -0
  48. package/src/static/pdf-themes/fonts/PlusJakartaSans-Light.ttf +0 -0
  49. package/src/static/pdf-themes/fonts/PlusJakartaSans-LightItalic.ttf +0 -0
  50. package/src/static/pdf-themes/fonts/PlusJakartaSans-Medium.ttf +0 -0
  51. package/src/static/pdf-themes/fonts/PlusJakartaSans-MediumItalic.ttf +0 -0
  52. package/src/static/pdf-themes/fonts/PlusJakartaSans-Regular.ttf +0 -0
  53. package/src/static/pdf-themes/fonts/PlusJakartaSans-SemiBold.ttf +0 -0
  54. package/src/static/pdf-themes/fonts/PlusJakartaSans-SemiBoldItalic.ttf +0 -0
  55. package/src/static/pdf-themes/img/cyberismo-logo.png +0 -0
@@ -0,0 +1,205 @@
1
+ % Utils extends the cyberismo query language
2
+
3
+ % policy checks
4
+
5
+ childObject(Card, (Card, "policyChecks"), "policyChecks") :-
6
+ showField(Card, "policyChecks").
7
+
8
+ childResultCollection((Card, "policyChecks"), "successes") :-
9
+ childObject(Card, (Card, "policyChecks"), "policyChecks").
10
+
11
+ childResultCollection((Card, "policyChecks"), "failures") :-
12
+ childObject(Card, (Card, "policyChecks"), "policyChecks").
13
+
14
+ % successes
15
+ childResult((Card, "policyChecks"), (Card, Category, Title), "successes") :-
16
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
17
+ policyCheckSuccess(Card, Category, Title).
18
+
19
+ resultFields((Card, Category, Title), "category", Category, "shortText", "title", Title, "shortText") :-
20
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
21
+ policyCheckSuccess(Card, Category, Title).
22
+
23
+ % failures
24
+
25
+ % add empty field for failures with no field
26
+ policyCheckFailure(Card, Category, Title, ErrorMessage, "") :-
27
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
28
+ policyCheckFailure(Card, Category, Title, ErrorMessage).
29
+
30
+ childResult((Card, "policyChecks"), (Card, Category, Title, ErrorMessage, Field), "failures") :-
31
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
32
+ policyCheckFailure(Card, Category, Title, ErrorMessage, Field).
33
+
34
+ resultFields((Card, Category, Title, ErrorMessage, Field), "category", Category, "shortText", "title", Title, "shortText", "errorMessage", ErrorMessage, "shortText") :-
35
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
36
+ policyCheckFailure(Card, Category, Title, ErrorMessage, Field).
37
+
38
+ resultField((Card, Category, Title, ErrorMessage, Field), "fieldName", Field, "shortText") :-
39
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
40
+ Field != "",
41
+ policyCheckFailure(Card, Category, Title, ErrorMessage, Field).
42
+
43
+
44
+
45
+ % links
46
+
47
+ childResultCollection(Card, "links") :-
48
+ showField(Card, "links").
49
+
50
+ childResult(Card, (Card, Destination, LinkType, "", "outbound"), "links") :-
51
+ link(Card, Destination, LinkType),
52
+ showField(Card, "links").
53
+
54
+ childResult(Card, (Card, Destination, LinkType, LinkDescription, "outbound"), "links") :-
55
+ link(Card, Destination, LinkType, LinkDescription),
56
+ showField(Card, "links").
57
+
58
+ childResult(Card, (Source, Card, LinkType, "", "inbound"), "links") :-
59
+ link(Source, Card, LinkType),
60
+ showField(Card, "links").
61
+
62
+ childResult(Card, (Source, Card, LinkType, LinkDescription, "inbound"), "links") :-
63
+ link(Source, Card, LinkType, LinkDescription),
64
+ showField(Card, "links").
65
+
66
+ % links: displayName
67
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "displayName", DisplayName, "shortText") :-
68
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
69
+ Direction = "outbound",
70
+ field(LinkType, "outboundDisplayName", DisplayName).
71
+
72
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "displayName", DisplayName, "shortText") :-
73
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
74
+ Direction = "inbound",
75
+ field(LinkType, "inboundDisplayName", DisplayName).
76
+
77
+ % links: link description
78
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "linkDescription", LinkDescription, "shortText") :-
79
+ LinkDescription != "",
80
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links").
81
+
82
+ % links: direction and link type
83
+ resultFields((Source, Destination, LinkType, LinkDescription, Direction), "direction", Direction, "shortText", "linkType", LinkType, "shortText") :-
84
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links").
85
+
86
+ % links: link source
87
+
88
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "user", "shortText") :-
89
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
90
+ userLink(Source, Destination, LinkType).
91
+
92
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "user", "shortText") :-
93
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
94
+ userLink(Source, Destination, LinkType, LinkDescription).
95
+
96
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "calculated", "shortText") :-
97
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
98
+ calculatedLink(Source, Destination, LinkType).
99
+
100
+ resultField((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "calculated", "shortText") :-
101
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
102
+ calculatedLink(Source, Destination, LinkType, LinkDescription).
103
+
104
+ % links: title
105
+ resultField((Card, Destination, LinkType, LinkDescription, Direction), "title", Title, "shortText") :-
106
+ childResult(Card, (Card, Destination, LinkType, LinkDescription, Direction), "links"),
107
+ field(Destination, "title", Title).
108
+
109
+ resultField((Source, Card, LinkType, LinkDescription, Direction), "title", Title, "shortText") :-
110
+ childResult(Card, (Source, Card, LinkType, LinkDescription, Direction), "links"),
111
+ field(Source, "title", Title).
112
+
113
+ % links: key
114
+ resultField((Card, Destination, LinkType, LinkDescription, Direction), "key", Destination, "shortText") :-
115
+ childResult(Card, (Card, Destination, LinkType, LinkDescription, Direction), "links").
116
+
117
+ resultField((Source, Card, LinkType, LinkDescription, Direction), "key", Source, "shortText") :-
118
+ childResult(Card, (Source, Card, LinkType, LinkDescription, Direction), "links"),
119
+ field(Source, "title", Title).
120
+
121
+
122
+ % notifications
123
+ childResultCollection(Card, "notifications") :-
124
+ showField(Card, "notifications").
125
+
126
+ % notifications
127
+ childResult(Card, (Card, Category, Title, Message), "notifications") :-
128
+ showField(Card, "notifications"),
129
+ notification(Card, Category, Title, Message).
130
+
131
+ resultFields((Card, Category, Title, Message), "key", Card, "shortText", "category", Category, "shortText", "title", Title, "shortText") :-
132
+ childResult(Card, (Card, Category, Title, Message), "notifications").
133
+
134
+ resultField((Card, Category, Title, Message), "message", Message, "shortText") :-
135
+ childResult(Card, (Card, Category, Title, Message), "notifications").
136
+
137
+
138
+ % denied operations
139
+
140
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations") :-
141
+ showField(Card, "deniedOperations").
142
+
143
+ % transition denied operations
144
+ childResultCollection((Card, "deniedOperations"), "transition") :-
145
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
146
+
147
+ childResult((Card, "deniedOperations"), (Card, TransitionName, ErrorMessage), "transition") :-
148
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
149
+ transitionDenied(Card, TransitionName, ErrorMessage).
150
+
151
+ resultFields((Card, TransitionName, ErrorMessage), "transitionName", TransitionName, "shortText", "errorMessage", ErrorMessage, "shortText") :-
152
+ childResult((Card, "deniedOperations"), (Card, TransitionName, ErrorMessage), "transition").
153
+
154
+ % move denied operations
155
+ childResultCollection((Card, "deniedOperations"), "move") :-
156
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
157
+
158
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "move") :-
159
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
160
+ movingCardDenied(Card, ErrorMessage).
161
+
162
+ resultField((Card, ErrorMessage), "errorMessage", ErrorMessage, "shortText") :-
163
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "move").
164
+
165
+ % delete denied operations
166
+ childResultCollection((Card, "deniedOperations"), "delete") :-
167
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
168
+
169
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "delete") :-
170
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
171
+ deletingCardDenied(Card, ErrorMessage).
172
+
173
+ resultField((Card, ErrorMessage), "errorMessage", ErrorMessage, "shortText") :-
174
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "delete").
175
+
176
+ % editField denied operations
177
+ childResultCollection((Card, "deniedOperations"), "editField") :-
178
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
179
+
180
+ childResult((Card, "deniedOperations"), (Card, FieldName, ErrorMessage), "editField") :-
181
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
182
+ editingFieldDenied(Card, FieldName, ErrorMessage).
183
+
184
+ resultFields((Card, FieldName, ErrorMessage), "fieldName", FieldName, "shortText", "errorMessage", ErrorMessage, "shortText") :-
185
+ childResult((Card, "deniedOperations"), (Card, FieldName, ErrorMessage), "editField").
186
+
187
+ % editContent denied operations
188
+ childResultCollection((Card, "deniedOperations"), "editContent") :-
189
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
190
+
191
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "editContent") :-
192
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
193
+ editingContentDenied(Card, ErrorMessage).
194
+
195
+ resultField((Card, ErrorMessage), "errorMessage", ErrorMessage, "shortText") :-
196
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "editContent").
197
+
198
+
199
+ % labels
200
+ childResultCollection(Card, "labels") :-
201
+ showField(Card, "labels").
202
+
203
+ resultField(Card, "labels", Label, "stringList") :-
204
+ showField(Card, "labels"),
205
+ label(Card, Label).
@@ -6,120 +6,126 @@ result(X) :- projectCard(X).
6
6
 
7
7
  % a helper term for display names
8
8
 
9
- displayName(Card, Field, DisplayName) :-
9
+ displayName(Card, (Card, Field), DisplayName) :-
10
10
  field(Card, Field, _),
11
11
  fieldType(Field),
12
12
  field(Field, "displayName", DisplayName),
13
13
  field(Card, "cardType", CardType),
14
14
  not field((CardType, Field), "displayName", _).
15
15
 
16
- displayName(Card, Field, DisplayName) :-
16
+ displayName(Card, (Card, Field), DisplayName) :-
17
17
  field(Card, "cardType", CardType),
18
+ fieldType(Field),
18
19
  field((CardType, Field), "displayName", DisplayName).
19
20
 
20
21
  % the second level includes metadata for the always visible and optionally visible fields
22
+ % we include the card key in the key of the fields, because the same query is used
23
+ % when generating static sites for all project cards at the same time
21
24
 
22
- field(Field, "visibility", "always") :-
25
+ resultField((Card, Field), "key", Field, "shortText") :-
26
+ customField(CardType, Field),
27
+ field(Card, "cardType", CardType),
28
+ result(Card).
29
+ resultField((Card, Field), "visibility", "always", "shortText") :-
23
30
  alwaysVisibleField(CardType, Field),
24
31
  field(Card, "cardType", CardType),
25
32
  result(Card).
26
33
 
27
- field(Field, "visibility", "optional") :-
34
+ resultField((Card, Field), "visibility", "optional", "shortText") :-
28
35
  optionallyVisibleField(CardType, Field),
29
36
  field(Card, "cardType", CardType),
30
37
  result(Card).
31
38
 
32
- field(Field, "index", Index) :-
39
+ resultField((Card, Field), "index", Index, "integer") :-
33
40
  alwaysVisibleField(CardType, Field),
34
41
  field((CardType, Field), "index", Index),
35
42
  field(Card, "cardType", CardType),
36
43
  result(Card).
37
44
 
38
- field(Field, "index", Index) :-
45
+ resultField((Card, Field), "index", Index, "integer") :-
39
46
  optionallyVisibleField(CardType, Field),
40
47
  field((CardType, Field), "index", Index),
41
48
  field(Card, "cardType", CardType),
42
49
  result(Card).
43
50
 
44
- dataType(Field, "fieldDisplayName", "shortText") :-
45
- childResult(_, Field, "fields"),
46
- field(Field, "fieldDisplayName", _).
51
+ resultField((Card, Field), "fieldDisplayName", DisplayName, "shortText") :-
52
+ childResult(Card, (Card, Field), "fields"),
53
+ result(Card),
54
+ displayName(Card, (Card, Field), DisplayName).
47
55
 
48
- field(Field, "fieldDisplayName", DisplayName) :-
49
- childResult(_, Field, "fields"),
56
+ resultField((Card, Field), "fieldDescription", Description, "shortText") :-
57
+ childResult(Card, (Card, Field), "fields"),
50
58
  result(Card),
51
- displayName(Card, Field, DisplayName).
59
+ field(Field, "description", Description).
52
60
 
53
- dataType(Field, "isCalculated", "boolean") :-
54
- childResult(_, Field, "fields"),
55
- field(Field, "isCalculated", _).
61
+ dataType((Card, Field), "isCalculated", "boolean") :-
62
+ childResult(Card, (Card, Field), "fields"),
63
+ field((Card, Field), "isCalculated", _).
56
64
 
57
- field(Field, "isCalculated", true) :-
65
+ resultField((Card, Field), "isCalculated", true, "boolean") :-
58
66
  result(Card),
59
67
  field(Card, "cardType", CardType),
60
68
  calculatedField(CardType, Field).
61
69
 
62
- field(Field, "isCalculated", false) :-
63
- childResult(_, Field, "fields"),
70
+ field((Card, Field), "isCalculated", false, "boolean") :-
71
+ childResult(Card, (Card, Field), "fields"),
64
72
  result(Card),
65
73
  field(Card, "cardType", CardType),
66
74
  not calculatedField(CardType, Field).
67
75
 
68
-
69
-
70
-
71
- % add value
72
- dataType(Field, "value", DataType) :-
73
- childResult(_, Field, "fields"),
76
+ % add dataType of field
77
+ resultField((Card, Field), "dataType", DataType, "shortText") :-
78
+ childResult(Card, (Card, Field), "fields"),
74
79
  result(Card),
75
- field(Card, Field, Value),
76
- dataType(Card, Field, DataType).
77
-
80
+ field(Field, "dataType", DataType).
78
81
 
79
82
  % add value
80
- field(Field, "value", Value) :-
81
- childResult(Card, Field, "fields"),
83
+ resultField((Card, Field), "value", Value, DataType) :-
84
+ childResult(Card, (Card, Field), "fields"),
85
+ dataType(Card, Field, DataType),
82
86
  field(Card, Field, Value).
83
87
 
88
+ % add cardTypeDisplayName
89
+ resultField(Card, "cardTypeDisplayName", DisplayName, "shortText") :-
90
+ result(Card),
91
+ field(Card, "cardType", CardType),
92
+ field(CardType, "displayName", DisplayName).
84
93
 
85
94
  % select only non-custom fields
86
- select(1, "cardType").
87
- select(1, "title").
88
- select(1, "key").
89
- select(1, "lastUpdated").
90
- select(1, "workflowState").
91
- select(1, "notifications").
92
- select(1, "policyChecks").
93
- select(1, "links").
94
- select(1, "deniedOperations").
95
- select(1, "labels").
96
-
97
- select(2, "visibility").
98
- select(2, "index").
99
- select(2, "fieldDisplayName").
100
- select(2, "fieldDescription").
101
- select(2, "dataType").
102
- select(2, "isCalculated").
103
- select(2, "value").
104
-
105
- childResult(Card, Field, "fields") :-
95
+ select(1, "results", "cardType").
96
+ select(1, "results", "cardTypeDisplayName").
97
+ select(1, "results", "title").
98
+ select(1, "results", "key").
99
+ select(1, "results", "lastUpdated").
100
+ select(1, "results", "workflowState").
101
+ select(1, "results", "policyChecks").
102
+ select(1, "results", "links").
103
+ select(1, "results", "notifications").
104
+ select(1, "results", "deniedOperations").
105
+ select(1, "results", "labels").
106
+
107
+ childResultCollection(Card, "fields") :-
108
+ result(Card).
109
+
110
+ childResult(Card, (Card, Field), "fields") :-
106
111
  alwaysVisibleField(CardType, Field),
107
112
  field(Card, "cardType", CardType),
108
113
  result(Card).
109
114
 
110
- childResult(Card, Field, "fields") :-
115
+ childResult(Card, (Card, Field), "fields") :-
111
116
  optionallyVisibleField(CardType, Field),
112
117
  field(Card, "cardType", CardType),
113
118
  result(Card).
114
119
 
115
120
  % for enum fields, add enum values as child results:
116
- select(3, "index").
117
- select(3, "enumDisplayValue").
118
- select(3, "enumDescription").
119
- select(3, "enumValue").
120
-
121
- childResult(Field, (Field, EnumValue), "enumValues") :-
122
- enumValue(Field, EnumValue).
121
+ select(3, "enumValues", "index").
122
+ select(3, "enumValues", "enumDisplayValue").
123
+ select(3, "enumValues", "enumDescription").
124
+ select(3, "enumValues", "enumValue").
125
+
126
+ childResult((Card, Field), (Field, EnumValue), "enumValues") :-
127
+ enumValue(Field, EnumValue),
128
+ childResult(Card, (Card, Field), "fields").
123
129
 
124
130
  field((Field, EnumValue), "enumValue", EnumValue) :-
125
131
  enumValue(Field, EnumValue).
@@ -0,0 +1,33 @@
1
+ = {{title}}
2
+ {{name}}
3
+ :doctype: book
4
+ :toc: macro
5
+ :numbered:
6
+ :imagesdir: images
7
+ :revnumber: {{version}}
8
+ :revdate: {{date}}
9
+ :revremark: {{revremark}}
10
+ :!chapter-signifier:
11
+ :source-highlighter: rouge
12
+ :toclevels: 5
13
+ +
14
+ toc::[]
15
+ {{#each results}}
16
+ {{#include}}
17
+ "cardKey": "{{this.key}}",
18
+ "levelOffset": "{{this.levelOffset}}",
19
+ "title": "only"
20
+ {{/include}}
21
+ [horizontal]
22
+ {{#each this}}
23
+ {{#if (isCustomField @key)}}
24
+ {{@key}}:: {{formatValue this}}
25
+ {{/if}}
26
+ {{/each}}
27
+ {{#include}}
28
+ "cardKey": "{{this.key}}",
29
+ "levelOffset": "{{this.levelOffset}}",
30
+ "title": "exclude",
31
+ "pageTitles": "discrete"
32
+ {{/include}}
33
+ {{/each}}
@@ -0,0 +1,47 @@
1
+ {{#if cardKey}}
2
+ result({{cardKey}}).
3
+
4
+ {{#if recursive}}
5
+ result(Card) :- parent(Card, Parent), result(Parent).
6
+ {{/if}}
7
+
8
+ {{else}}
9
+ result(Card) :- projectCard(Card), not hiddenInTreeView(Card).
10
+ {{/if}}
11
+
12
+ % Calculate depth levels
13
+ cardLevel(Card, 1) :- result(Card), not parent(Card, _).
14
+ cardLevel(Card, Level + 1) :-
15
+ cardLevel(Parent, Level),
16
+ parent(Card, Parent),
17
+ result(Card).
18
+
19
+ % Create a path-based ordering system using string concatenation
20
+ % For each card, create a path that represents its position in the tree
21
+ % Root cards: just their rank (already lexicographically sortable)
22
+ % Child cards: parent's path + "!" + own rank
23
+
24
+ % Base case: root cards use their rank directly as the path
25
+ treePath(Card, Rank) :-
26
+ cardLevel(Card, 1),
27
+ result(Card),
28
+ field(Card, "rank", Rank).
29
+
30
+ % Recursive case: children append their rank to parent's path
31
+ treePath(Card, FullPath) :-
32
+ cardLevel(Card, Level),
33
+ Level > 1,
34
+ parent(Card, Parent),
35
+ treePath(Parent, ParentPath),
36
+ field(Card, "rank", Rank),
37
+ result(Card),
38
+ FullPath = @concatenate(ParentPath, "!", Rank).
39
+
40
+ % Sort by tree path (lexicographic ordering will give us depth-first)
41
+ order(1, "results", 1, "treePath", "ASC").
42
+
43
+ selectAll.
44
+
45
+ % Map level to levelOffset and add tree path for sorting
46
+ field(Card, "levelOffset", Level) :- cardLevel(Card, Level), result(Card).
47
+ field(Card, "treePath", Path) :- treePath(Card, Path), result(Card).
@@ -100,6 +100,7 @@ field(((node, Node), Field), "value", Value) :-
100
100
  attr(node, Node, Field, Value),
101
101
  not labelAttribute(Field).
102
102
 
103
+ % default graph
103
104
  graph(default) :-
104
105
  node(_).
105
106
 
@@ -112,8 +113,8 @@ node(X, default) :-
112
113
  edge((XR, YR), default) :-
113
114
  edge((XR, YR)).
114
115
 
115
- edge((XR, YR, ""), Graph) :-
116
- edge((XR, YR), Graph).
116
+ edge((XR, YR, Identifier), default) :-
117
+ edge((XR, YR, Identifier)).
117
118
 
118
119
  % edges
119
120
  childResult(Graph, (edge, (XR, YR, Description)), "edges") :-
@@ -138,4 +139,11 @@ field((edge, (XR, YR, Description)), "source", XR) :-
138
139
  field((edge, (XR, YR, Description)), "destination", YR) :-
139
140
  edge((XR, YR, Description), _).
140
141
 
142
+ % edges without a separate identifier use "" as their identifier
143
+ edge((XR, YR, ""), Graph) :-
144
+ edge((XR, YR), Graph).
145
+
146
+ attr(edge, (Source, Destination, ""), Attribute, Value) :-
147
+ attr(edge, (Source, Destination), Attribute, Value).
148
+
141
149
  order(N, Collection, 1, "rank", "ASC") :- resultLevel(_, N, Collection).
package/src/index.ts CHANGED
@@ -4,24 +4,33 @@ export * from './schemas.js';
4
4
  // They rarely change and we get 100% type safety this way
5
5
  import commonBase from './calculations/common/base.lp';
6
6
  import commonQueryLanguage from './calculations/common/queryLanguage.lp';
7
+ import commonUtils from './calculations/common/utils.lp';
7
8
  import queriesCard from './calculations/queries/card.lp';
8
9
  import queriesOnCreation from './calculations/queries/onCreation.lp';
9
10
  import queriesOnTransition from './calculations/queries/onTransition.lp';
10
11
  import queriesTree from './calculations/queries/tree.lp';
11
12
  import testModel from './calculations/test/model.lp';
12
13
 
13
- import graphvizReportQuery from './graphvizReport/query.lp.hbs';
14
+ import pdfReportIndex from './exportPdfReport/index.adoc.hbs';
15
+ import pdfReportQuery from './exportPdfReport/query.lp.hbs';
14
16
  import graphvizReportIndex from './graphvizReport/index.adoc.hbs';
17
+ import graphvizReportQuery from './graphvizReport/query.lp.hbs';
15
18
 
16
19
  export const graphvizReport = {
17
20
  query: graphvizReportQuery,
18
21
  content: graphvizReportIndex,
19
22
  };
20
23
 
24
+ export const pdfReport = {
25
+ query: pdfReportQuery,
26
+ content: pdfReportIndex,
27
+ };
28
+
21
29
  export const lpFiles = {
22
30
  common: {
23
31
  base: commonBase,
24
32
  queryLanguage: commonQueryLanguage,
33
+ utils: commonUtils,
25
34
  },
26
35
  queries: {
27
36
  card: queriesCard,
@@ -29,15 +29,15 @@
29
29
  "type": "string"
30
30
  },
31
31
  "location": {
32
- "description": "URI that is either a git URL with HTTPS, or relative file reference",
32
+ "description": "Git remote URL, or relative file reference.",
33
33
  "type": "string"
34
34
  },
35
35
  "branch": {
36
- "description": "If using git URL in 'location' defines git branch. If empty, assumed to be 'main'. ",
36
+ "description": "If using git remote URL in 'location' defines git branch. If empty, uses repository default branch'.",
37
37
  "type": "string"
38
38
  },
39
39
  "private": {
40
- "description": "If true, the module is private and requires credentials (CYBERISMO_GIT_USER / CYBERISMO_GIT_TOKEN)",
40
+ "description": "If true, the module is private and requires credentials (CYBERISMO_GIT_USER / CYBERISMO_GIT_TOKEN) or SSH. Does not apply for local file modules.",
41
41
  "type": "boolean"
42
42
  }
43
43
  },
@@ -0,0 +1,24 @@
1
+ {
2
+ "type": "object",
3
+ "$id": "imageMacroSchema",
4
+ "properties": {
5
+ "fileName": {
6
+ "type": "string",
7
+ "description": "The filename of the image attachment to display"
8
+ },
9
+ "cardKey": {
10
+ "type": "string",
11
+ "description": "The key of the card containing the image attachment. If not specified, uses the current card"
12
+ },
13
+ "alt": {
14
+ "type": "string",
15
+ "description": "Alternative text for the image"
16
+ },
17
+ "title": {
18
+ "type": "string",
19
+ "description": "Title attribute for the image"
20
+ }
21
+ },
22
+ "additionalProperties": false,
23
+ "required": ["fileName"]
24
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "type": "object",
3
+ "$id": "includeMacroSchema",
4
+ "properties": {
5
+ "cardKey": {
6
+ "type": "string",
7
+ "description": "The key of the card to include content from"
8
+ },
9
+ "levelOffset": {
10
+ "type": "string",
11
+ "description": "Optional offset to adjust the heading levels of the included content. Should be a number as string (e.g., '+1', '+2' or '-1')."
12
+ },
13
+ "title": {
14
+ "type": "enum",
15
+ "description": "Whether to include the title of the card in the included content. If 'only' is selected, the title will be the only content included.",
16
+ "enum": ["include", "exclude", "only"]
17
+ },
18
+ "pageTitles": {
19
+ "type": "enum",
20
+ "description": "If discrete, page titles will be included as discrete headings(read asciidoctor docs for more info). If normal, page titles will be included as normal headings.",
21
+ "enum": ["normal", "discrete"]
22
+ }
23
+ },
24
+ "additionalProperties": false,
25
+ "required": ["cardKey"]
26
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "type": "object",
3
+ "$id": "percentageMacroSchema",
4
+ "properties": {
5
+ "title": {
6
+ "type": "string",
7
+ "description": "Title text on top of the widget"
8
+ },
9
+ "value": {
10
+ "type": "number",
11
+ "description": "Percentage value (0-100)"
12
+ },
13
+ "legend": {
14
+ "type": "string",
15
+ "description": "Description text shown below the value"
16
+ },
17
+ "colour": {
18
+ "type": "string",
19
+ "enum": ["blue", "green", "yellow", "red", "orange", "purple"],
20
+ "description": "Colour of the progress arc (optional)"
21
+ }
22
+ },
23
+ "additionalProperties": false,
24
+ "required": ["title", "value", "legend"]
25
+ }