@cyberismo/assets 0.0.8 → 0.0.9

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 (52) hide show
  1. package/dist/THIRD-PARTY.txt +127 -0
  2. package/dist/index.d.ts +5 -0
  3. package/dist/index.js +878 -302
  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 +65 -269
  24. package/src/calculations/common/utils.lp +230 -0
  25. package/src/calculations/queries/card.lp +61 -37
  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/macros/imageMacroSchema.json +24 -0
  31. package/src/schema/macros/includeMacroSchema.json +26 -0
  32. package/src/schema/macros/percentageMacroSchema.json +25 -0
  33. package/src/schema/macros/vegaLiteMacroSchema.json +31711 -0
  34. package/src/schema/macros/vegaMacroSchema.json +14931 -0
  35. package/src/schema/macros/xrefMacroSchema.json +12 -0
  36. package/src/schemas.ts +12 -0
  37. package/src/static/pdf-themes/cyberismo-theme.yml +57 -0
  38. package/src/static/pdf-themes/fonts/PlusJakartaSans-Bold.ttf +0 -0
  39. package/src/static/pdf-themes/fonts/PlusJakartaSans-BoldItalic.ttf +0 -0
  40. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraBold.ttf +0 -0
  41. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraBoldItalic.ttf +0 -0
  42. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraLight.ttf +0 -0
  43. package/src/static/pdf-themes/fonts/PlusJakartaSans-ExtraLightItalic.ttf +0 -0
  44. package/src/static/pdf-themes/fonts/PlusJakartaSans-Italic.ttf +0 -0
  45. package/src/static/pdf-themes/fonts/PlusJakartaSans-Light.ttf +0 -0
  46. package/src/static/pdf-themes/fonts/PlusJakartaSans-LightItalic.ttf +0 -0
  47. package/src/static/pdf-themes/fonts/PlusJakartaSans-Medium.ttf +0 -0
  48. package/src/static/pdf-themes/fonts/PlusJakartaSans-MediumItalic.ttf +0 -0
  49. package/src/static/pdf-themes/fonts/PlusJakartaSans-Regular.ttf +0 -0
  50. package/src/static/pdf-themes/fonts/PlusJakartaSans-SemiBold.ttf +0 -0
  51. package/src/static/pdf-themes/fonts/PlusJakartaSans-SemiBoldItalic.ttf +0 -0
  52. package/src/static/pdf-themes/img/cyberismo-logo.png +0 -0
@@ -0,0 +1,230 @@
1
+ % Utils extends the cyberismo query language
2
+
3
+ % policy checks
4
+ selectCollectionField("successes", "title").
5
+ selectCollectionField("successes", "category").
6
+ selectCollectionField("failures", "title").
7
+ selectCollectionField("failures", "category").
8
+ selectCollectionField("failures", "errorMessage").
9
+ selectCollectionField("failures", "fieldName").
10
+
11
+ childObject(Card, (Card, "policyChecks"), "policyChecks") :-
12
+ showField(Card, "policyChecks").
13
+
14
+ childResultCollection((Card, "policyChecks"), "successes") :-
15
+ childObject(Card, (Card, "policyChecks"), "policyChecks").
16
+
17
+ childResultCollection((Card, "policyChecks"), "failures") :-
18
+ childObject(Card, (Card, "policyChecks"), "policyChecks").
19
+
20
+ % successes
21
+ childResult((Card, "policyChecks"), (Card, Category, Title), "successes") :-
22
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
23
+ policyCheckSuccess(Card, Category, Title).
24
+
25
+ fields((Card, Category, Title), "category", Category, "title", Title) :-
26
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
27
+ policyCheckSuccess(Card, Category, Title).
28
+
29
+ % failures
30
+
31
+ % add empty field for failures with no field
32
+ policyCheckFailure(Card, Category, Title, ErrorMessage, "") :-
33
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
34
+ policyCheckFailure(Card, Category, Title, ErrorMessage).
35
+
36
+ childResult((Card, "policyChecks"), (Card, Category, Title, ErrorMessage, Field), "failures") :-
37
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
38
+ policyCheckFailure(Card, Category, Title, ErrorMessage, Field).
39
+
40
+ fields((Card, Category, Title, ErrorMessage, Field), "category", Category, "title", Title, "errorMessage", ErrorMessage) :-
41
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
42
+ policyCheckFailure(Card, Category, Title, ErrorMessage, Field).
43
+
44
+ field((Card, Category, Title, ErrorMessage, Field), "fieldName", Field) :-
45
+ childObject(Card, (Card, "policyChecks"), "policyChecks"),
46
+ Field != "",
47
+ policyCheckFailure(Card, Category, Title, ErrorMessage, Field).
48
+
49
+
50
+
51
+ % links
52
+ selectCollectionField("links", "displayName").
53
+ selectCollectionField("links", "linkDescription").
54
+ selectCollectionField("links", "direction").
55
+ selectCollectionField("links", "linkType").
56
+ selectCollectionField("links", "displayName").
57
+ selectCollectionField("links", "linkSource").
58
+ selectCollectionField("links", "title").
59
+ selectCollectionField("links", "key").
60
+
61
+ childResultCollection(Card, "links") :-
62
+ showField(Card, "links").
63
+
64
+ childResult(Card, (Card, Destination, LinkType, "", "outbound"), "links") :-
65
+ link(Card, Destination, LinkType),
66
+ showField(Card, "links").
67
+
68
+ childResult(Card, (Card, Destination, LinkType, LinkDescription, "outbound"), "links") :-
69
+ link(Card, Destination, LinkType, LinkDescription),
70
+ showField(Card, "links").
71
+
72
+ childResult(Card, (Source, Card, LinkType, "", "inbound"), "links") :-
73
+ link(Source, Card, LinkType),
74
+ showField(Card, "links").
75
+
76
+ childResult(Card, (Source, Card, LinkType, LinkDescription, "inbound"), "links") :-
77
+ link(Source, Card, LinkType, LinkDescription),
78
+ showField(Card, "links").
79
+
80
+ % links: displayName
81
+ field((Source, Destination, LinkType, LinkDescription, Direction), "displayName", DisplayName, "shortText") :-
82
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
83
+ Direction = "outbound",
84
+ field(LinkType, "outboundDisplayName", DisplayName).
85
+
86
+ field((Source, Destination, LinkType, LinkDescription, Direction), "displayName", DisplayName, "shortText") :-
87
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
88
+ Direction = "inbound",
89
+ field(LinkType, "inboundDisplayName", DisplayName).
90
+
91
+ % links: link description
92
+ field((Source, Destination, LinkType, LinkDescription, Direction), "linkDescription", LinkDescription, "shortText") :-
93
+ LinkDescription != "",
94
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links").
95
+
96
+ % links: direction and link type
97
+ fields((Source, Destination, LinkType, LinkDescription, Direction), "direction", Direction, "linkType", LinkType) :-
98
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links").
99
+
100
+ % links: link source
101
+
102
+ field((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "user", "shortText") :-
103
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
104
+ userLink(Source, Destination, LinkType).
105
+
106
+ field((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "user", "shortText") :-
107
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
108
+ userLink(Source, Destination, LinkType, LinkDescription).
109
+
110
+ field((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "calculated", "shortText") :-
111
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
112
+ calculatedLink(Source, Destination, LinkType).
113
+
114
+ field((Source, Destination, LinkType, LinkDescription, Direction), "linkSource", "calculated", "shortText") :-
115
+ childResult(_, (Source, Destination, LinkType, LinkDescription, Direction), "links"),
116
+ calculatedLink(Source, Destination, LinkType, LinkDescription).
117
+
118
+ % links: title
119
+ field((Card, Destination, LinkType, LinkDescription, Direction), "title", Title, "shortText") :-
120
+ childResult(Card, (Card, Destination, LinkType, LinkDescription, Direction), "links"),
121
+ field(Destination, "title", Title).
122
+
123
+ field((Source, Card, LinkType, LinkDescription, Direction), "title", Title, "shortText") :-
124
+ childResult(Card, (Source, Card, LinkType, LinkDescription, Direction), "links"),
125
+ field(Source, "title", Title).
126
+
127
+ % links: key
128
+ field((Card, Destination, LinkType, LinkDescription, Direction), "key", Destination, "shortText") :-
129
+ childResult(Card, (Card, Destination, LinkType, LinkDescription, Direction), "links").
130
+
131
+ field((Source, Card, LinkType, LinkDescription, Direction), "key", Source, "shortText") :-
132
+ childResult(Card, (Source, Card, LinkType, LinkDescription, Direction), "links"),
133
+ field(Source, "title", Title).
134
+
135
+
136
+ % notifications
137
+ select(2, "notifications", "title").
138
+ select(2, "notifications", "category").
139
+ select(2, "notifications", "message").
140
+
141
+ childResultCollection(Card, "notifications") :-
142
+ showField(Card, "notifications").
143
+
144
+ % notifications
145
+ childResult(Card, (Card, Category, Title, Message), "notifications") :-
146
+ showField(Card, "notifications"),
147
+ notification(Card, Category, Title, Message).
148
+
149
+ fields((Card, Category, Title, Message), "key", Card, "category", Category, "title", Title) :-
150
+ childResult(Card, (Card, Category, Title, Message), "notifications").
151
+
152
+ field((Card, Category, Title, Message), "message", Message) :-
153
+ childResult(Card, (Card, Category, Title, Message), "notifications").
154
+
155
+
156
+ % denied operations
157
+ selectCollectionField("transition", "transitionName").
158
+ selectCollectionField("transition", "errorMessage").
159
+ selectCollectionField("move", "errorMessage").
160
+ selectCollectionField("delete", "errorMessage").
161
+ selectCollectionField("editField", "fieldName").
162
+ selectCollectionField("editField", "errorMessage").
163
+ selectCollectionField("editContent", "errorMessage").
164
+
165
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations") :-
166
+ showField(Card, "deniedOperations").
167
+
168
+ % transition denied operations
169
+ childResultCollection((Card, "deniedOperations"), "transition") :-
170
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
171
+
172
+ childResult((Card, "deniedOperations"), (Card, TransitionName, ErrorMessage), "transition") :-
173
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
174
+ transitionDenied(Card, TransitionName, ErrorMessage).
175
+
176
+ fields((Card, TransitionName, ErrorMessage), "transitionName", TransitionName, "errorMessage", ErrorMessage) :-
177
+ childResult((Card, "deniedOperations"), (Card, TransitionName, ErrorMessage), "transition").
178
+
179
+ % move denied operations
180
+ childResultCollection((Card, "deniedOperations"), "move") :-
181
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
182
+
183
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "move") :-
184
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
185
+ movingCardDenied(Card, ErrorMessage).
186
+
187
+ field((Card, ErrorMessage), "errorMessage", ErrorMessage) :-
188
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "move").
189
+
190
+ % delete denied operations
191
+ childResultCollection((Card, "deniedOperations"), "delete") :-
192
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
193
+
194
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "delete") :-
195
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
196
+ deletingCardDenied(Card, ErrorMessage).
197
+
198
+ field((Card, ErrorMessage), "errorMessage", ErrorMessage) :-
199
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "delete").
200
+
201
+ % editField denied operations
202
+ childResultCollection((Card, "deniedOperations"), "editField") :-
203
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
204
+
205
+ childResult((Card, "deniedOperations"), (Card, FieldName, ErrorMessage), "editField") :-
206
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
207
+ editingFieldDenied(Card, FieldName, ErrorMessage).
208
+
209
+ fields((Card, FieldName, ErrorMessage), "fieldName", FieldName, "errorMessage", ErrorMessage) :-
210
+ childResult((Card, "deniedOperations"), (Card, FieldName, ErrorMessage), "editField").
211
+
212
+ % editContent denied operations
213
+ childResultCollection((Card, "deniedOperations"), "editContent") :-
214
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations").
215
+
216
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "editContent") :-
217
+ childObject(Card, (Card, "deniedOperations"), "deniedOperations"),
218
+ editingContentDenied(Card, ErrorMessage).
219
+
220
+ field((Card, ErrorMessage), "errorMessage", ErrorMessage) :-
221
+ childResult((Card, "deniedOperations"), (Card, ErrorMessage), "editContent").
222
+
223
+
224
+ % labels
225
+ childResultCollection(Card, "labels") :-
226
+ showField(Card, "labels").
227
+
228
+ field(Card, "labels", Label, "stringList") :-
229
+ showField(Card, "labels"),
230
+ label(Card, Label).
@@ -6,108 +6,131 @@ 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
+ field((Card, Field), "key", Field) :-
26
+ customField(CardType, Field),
27
+ field(Card, "cardType", CardType),
28
+ result(Card).
29
+
30
+ field((Card, Field), "visibility", "always") :-
23
31
  alwaysVisibleField(CardType, Field),
24
32
  field(Card, "cardType", CardType),
25
33
  result(Card).
26
34
 
27
- field(Field, "visibility", "optional") :-
35
+ field((Card, Field), "visibility", "optional") :-
28
36
  optionallyVisibleField(CardType, Field),
29
37
  field(Card, "cardType", CardType),
30
38
  result(Card).
31
39
 
32
- field(Field, "index", Index) :-
40
+ field((Card, Field), "index", Index) :-
33
41
  alwaysVisibleField(CardType, Field),
34
42
  field((CardType, Field), "index", Index),
35
43
  field(Card, "cardType", CardType),
36
44
  result(Card).
37
45
 
38
- field(Field, "index", Index) :-
46
+ field((Card, Field), "index", Index) :-
39
47
  optionallyVisibleField(CardType, Field),
40
48
  field((CardType, Field), "index", Index),
41
49
  field(Card, "cardType", CardType),
42
50
  result(Card).
43
51
 
44
- dataType(Field, "fieldDisplayName", "shortText") :-
45
- childResult(_, Field, "fields"),
46
- field(Field, "fieldDisplayName", _).
52
+ field((Card, Field), "fieldDisplayName", DisplayName, "shortText") :-
53
+ childResult(Card, (Card, Field), "fields"),
54
+ result(Card),
55
+ displayName(Card, (Card, Field), DisplayName).
47
56
 
48
- field(Field, "fieldDisplayName", DisplayName) :-
49
- childResult(_, Field, "fields"),
57
+ field((Card, Field), "fieldDescription", Description, "shortText") :-
58
+ childResult(Card, (Card, Field), "fields"),
50
59
  result(Card),
51
- displayName(Card, Field, DisplayName).
60
+ field(Field, "description", Description).
52
61
 
53
- dataType(Field, "isCalculated", "boolean") :-
54
- childResult(_, Field, "fields"),
55
- field(Field, "isCalculated", _).
62
+ dataType((Card, Field), "isCalculated", "boolean") :-
63
+ childResult(Card, (Card, Field), "fields"),
64
+ field((Card, Field), "isCalculated", _).
56
65
 
57
- field(Field, "isCalculated", true) :-
66
+ field((Card, Field), "isCalculated", true) :-
58
67
  result(Card),
59
68
  field(Card, "cardType", CardType),
60
69
  calculatedField(CardType, Field).
61
70
 
62
- field(Field, "isCalculated", false) :-
63
- childResult(_, Field, "fields"),
71
+ field((Card, Field), "isCalculated", false) :-
72
+ childResult(Card, (Card, Field), "fields"),
64
73
  result(Card),
65
74
  field(Card, "cardType", CardType),
66
75
  not calculatedField(CardType, Field).
67
76
 
68
-
69
-
77
+ % add dataType of field
78
+ field((Card, Field), "dataType", DataType, "shortText") :-
79
+ childResult(Card, (Card, Field), "fields"),
80
+ result(Card),
81
+ field(Field, "dataType", DataType).
70
82
 
71
83
  % add value
72
- dataType(Field, "value", DataType) :-
73
- childResult(_, Field, "fields"),
84
+ dataType((Card, Field), "value", DataType) :-
85
+ childResult(Card, (Card, Field), "fields"),
74
86
  result(Card),
75
87
  field(Card, Field, Value),
76
88
  dataType(Card, Field, DataType).
77
89
 
78
-
79
90
  % add value
80
- field(Field, "value", Value) :-
81
- childResult(Card, Field, "fields"),
91
+ field((Card, Field), "value", Value) :-
92
+ childResult(Card, (Card, Field), "fields"),
82
93
  field(Card, Field, Value).
83
94
 
95
+ % add cardTypeDisplayName
96
+ field(Card, "cardTypeDisplayName", DisplayName, "shortText") :-
97
+ result(Card),
98
+ field(Card, "cardType", CardType),
99
+ field(CardType, "displayName", DisplayName).
84
100
 
85
101
  % select only non-custom fields
86
102
  select(1, "cardType").
103
+ select(1, "cardTypeDisplayName").
87
104
  select(1, "title").
88
105
  select(1, "key").
89
106
  select(1, "lastUpdated").
90
107
  select(1, "workflowState").
91
- select(1, "notifications").
92
108
  select(1, "policyChecks").
93
109
  select(1, "links").
110
+ select(1, "notifications").
94
111
  select(1, "deniedOperations").
95
112
  select(1, "labels").
96
113
 
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").
114
+ % Fields
104
115
 
105
- childResult(Card, Field, "fields") :-
116
+ select(2, "fields", "key").
117
+ select(2, "fields", "visibility").
118
+ select(2, "fields", "index").
119
+ select(2, "fields", "fieldDisplayName").
120
+ select(2, "fields", "fieldDescription").
121
+ select(2, "fields", "dataType").
122
+ select(2, "fields", "isCalculated").
123
+ select(2, "fields", "value").
124
+
125
+ childResultCollection(Card, "fields") :-
126
+ result(Card).
127
+
128
+ childResult(Card, (Card, Field), "fields") :-
106
129
  alwaysVisibleField(CardType, Field),
107
130
  field(Card, "cardType", CardType),
108
131
  result(Card).
109
132
 
110
- childResult(Card, Field, "fields") :-
133
+ childResult(Card, (Card, Field), "fields") :-
111
134
  optionallyVisibleField(CardType, Field),
112
135
  field(Card, "cardType", CardType),
113
136
  result(Card).
@@ -118,8 +141,9 @@ select(3, "enumDisplayValue").
118
141
  select(3, "enumDescription").
119
142
  select(3, "enumValue").
120
143
 
121
- childResult(Field, (Field, EnumValue), "enumValues") :-
122
- enumValue(Field, EnumValue).
144
+ childResult((Card, Field), (Field, EnumValue), "enumValues") :-
145
+ enumValue(Field, EnumValue),
146
+ childResult(Card, (Card, Field), "fields").
123
147
 
124
148
  field((Field, EnumValue), "enumValue", EnumValue) :-
125
149
  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,
@@ -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
+ }