@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,57 @@
1
+ extends: default
2
+ page:
3
+ size: a4
4
+ running-content:
5
+ start-at: toc
6
+
7
+ font:
8
+ merge: false
9
+ catalog:
10
+ Plus Jakarta Sans:
11
+ normal: PlusJakartaSans-Medium.ttf
12
+ italic: PlusJakartaSans-Italic.ttf
13
+ bold: PlusJakartaSans-Bold.ttf
14
+ bold_italic: PlusJakartaSans-BoldItalic.ttf
15
+ 'M+ 1mn':
16
+ normal: GEM_FONTS_DIR/mplus1mn-regular-subset.ttf
17
+ bold: GEM_FONTS_DIR/mplus1mn-bold-subset.ttf
18
+ italic: GEM_FONTS_DIR/mplus1mn-italic-subset.ttf
19
+ bold_italic: GEM_FONTS_DIR/mplus1mn-bold_italic-subset.ttf
20
+
21
+ base:
22
+ font-family: Plus Jakarta Sans
23
+ font-style: normal
24
+
25
+ heading:
26
+ font-family: Plus Jakarta Sans
27
+ font-style: bold
28
+
29
+ codespan:
30
+ font_family: Courier
31
+
32
+ code:
33
+ font_family: Courier
34
+
35
+ title-page:
36
+ logo:
37
+ image: image:img/cyberismo-logo.png[pdfwidth=2.5in,align=right]
38
+ title:
39
+ font-color: #ff530f
40
+ font-style: bold
41
+ align: center
42
+
43
+ header:
44
+ height: 0.5in
45
+ recto:
46
+ right:
47
+ content: image:img/cyberismo-logo.png[pdfwidth=12%]
48
+ verso:
49
+ left:
50
+ content: image:img/cyberismo-logo.png[pdfwidth=12%]
51
+
52
+ footer:
53
+ columns: =100%
54
+ recto: &shared_footer
55
+ center:
56
+ content: '{page-number}'
57
+ verso: *shared_footer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyberismo/assets",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "This package contains static resources",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "src"
24
24
  ],
25
25
  "scripts": {
26
- "build": "shx rm -rf dist && shx mkdir -p dist && pnpm script:schemas && node scripts/build.js && tsc && shx cp -r src/static dist/",
27
- "dev": "chokidar 'src/**/*' -c 'pnpm build'",
26
+ "build": "shx rm -rf dist && shx mkdir -p dist && shx cp THIRD-PARTY.txt dist/ && pnpm script:schemas && node scripts/build.js && tsc && shx cp -r src/static dist/",
27
+ "dev": "pnpm build && chokidar 'src/**/*' -i 'src/schemas.ts' -c 'pnpm build'",
28
28
  "script:schemas": "node scripts/generateSchemaImports && prettier --write src/schemas.ts"
29
29
  }
30
30
  }
@@ -34,20 +34,6 @@ dataType(Key, Field, DataType) :-
34
34
  fieldType(Field),
35
35
  field(Field, "dataType", DataType).
36
36
 
37
- % data types for enum values
38
-
39
- dataType((FieldType, EnumValue), "index", "integer") :-
40
- enumValue(FieldType, EnumValue).
41
-
42
- dataType((FieldType, EnumValue), "enumDisplayValue", "shortText") :-
43
- enumValue(FieldType, EnumValue).
44
-
45
- dataType((FieldType, EnumValue), "enumDescription", "longText") :-
46
- enumValue(FieldType, EnumValue).
47
-
48
- dataType((FieldType, EnumValue), "enumValue", "longText") :-
49
- enumValue(FieldType, EnumValue).
50
-
51
37
  % descendants of hidden cards are hidden
52
38
 
53
39
  hiddenInTreeView(Card) :-
@@ -6,7 +6,6 @@
6
6
  % select(field): "field" should be returned on all levels of hierarchy for all collections
7
7
  % selectAll: all fields should be returned on all levels of hierarchy for all collections
8
8
 
9
- % select works similarly for "labels", "links", "notifications", "policyChecks" and "deniedOperations" as it works for fields
10
9
 
11
10
  select(N, Collection, Field) :- select(Field), resultLevel(_, N, Collection).
12
11
 
@@ -22,39 +21,45 @@ childResult(Key, Child, "results") :- childResult(Key, Child).
22
21
  % resultLevel(key, n, collection): result "key" is on result level n in "collection"
23
22
  resultLevel(Key, 1, "results") :- result(Key).
24
23
  resultLevel(Child, N+1, Collection) :- childResult(Key, Child, Collection), resultLevel(Key, N, _).
24
+ resultLevel(Child, N+1, Collection) :- childObject(Key, Child, Collection), resultLevel(Key, N, _).
25
25
 
26
26
  % result(key): key is a result of the query
27
27
  #show result(Key) : result(Key), not queryError.
28
28
 
29
29
  % childResult(key, child key): child key is a child result of key
30
30
  #show childResult(Key, Child, Collection) : childResult(Key, Child, Collection), not queryError.
31
-
31
+ % childObject(key, child, collection): childObject is similar to childResult, expect it is an object
32
+ #show childObject(Key, Child, Collection) : childObject(Key, Child, Collection), not queryError.
32
33
  % helpers for simplifying some of the #show statements
33
34
 
34
- % resultOrChildResult(key): key is included in the results as a result or a child result
35
- resultOrChildResult(Key) :- result(Key).
36
- resultOrChildResult(Key) :- childResult(_, Key, _).
35
+ % anyResult(key): key is included in the results as a result or a child result/object
36
+ anyResult(Key) :- result(Key).
37
+ anyResult(Key) :- childResult(_, Key, _).
38
+ anyResult(Key) :- childObject(_, Key, _).
37
39
 
38
40
  % showAll(key): whether all fields or field-like things of a key should be included in the results
39
41
  showAll(Key) :-
40
- resultOrChildResult(Key),
42
+ anyResult(Key),
41
43
  resultLevel(Key, Level, _),
42
44
  selectAll(Level),
43
45
  not queryError.
44
46
 
45
47
  % showField: whether a certain field or field-like thing of a key should be included in the results
46
48
  showField(Key, Field) :-
47
- resultOrChildResult(Key),
49
+ anyResult(Key),
48
50
  resultLevel(Key, Level, _),
49
51
  select(Level, Field),
50
52
  not queryError.
51
53
 
52
54
  showField(Key, Field) :-
53
- resultOrChildResult(Key),
55
+ anyResult(Key),
54
56
  resultLevel(Key, Level, Collection),
55
57
  select(Level, Collection, Field),
56
58
  not queryError.
57
59
 
60
+ % showField is also defined if showAll is defined so there is only a single show predicate for each result
61
+ showField(Key, Field) :- showAll(Key), field(Key, Field, _).
62
+
58
63
  % Fields
59
64
  %
60
65
  % field(key, field, value, data type):
@@ -74,292 +79,83 @@ showField(Key, Field) :-
74
79
  DataType != "list",
75
80
  showField(Key, Field).
76
81
 
77
- #show field(Key, Field, Value, DataType) :
78
- field(Key, Field, Value),
79
- dataType(Key, Field, DataType),
80
- DataType != "enum",
81
- DataType != "list",
82
- showAll(Key).
83
-
84
82
  #show field(Key, Field, Value, "shortText") :
85
83
  field(Key, Field, Value),
86
84
  not dataType(Key, Field, _),
87
85
  showField(Key, Field).
88
86
 
89
- #show field(Key, Field, Value, "shortText") :
87
+ % list
88
+ childResult(Key, (Key, Field, Value), Field) :-
90
89
  field(Key, Field, Value),
91
- not dataType(Key, Field, _),
92
- showAll(Key).
90
+ dataType(Key, Field, "list"),
91
+ showField(Key, Field).
93
92
 
94
- #show enumField(Key, Field, Value, Index, DisplayValue) :
93
+ field((Key, Field, Value), "value", Value, "shortText") :-
94
+ childResult(Key, (Key, Field, Value), Field),
95
95
  field(Key, Field, Value),
96
- dataType(Key, Field, "enum"),
97
- field((Field, Value), "index", Index),
98
- field((Field, Value), "enumDisplayValue", DisplayValue),
99
- showField(Key, Field).
96
+ dataType(Key, Field, "list").
100
97
 
101
- #show enumField(Key, Field, Value, Index, Value) :
98
+ field((Key, Field, Value), "index", Index, "integer") :-
99
+ childResult(Key, (Key, Field, Value), Field),
102
100
  field(Key, Field, Value),
103
- dataType(Key, Field, "enum"),
104
- field((Field, Value), "index", Index),
105
- not field((Field, Value), "enumDisplayValue", _),
106
- showField(Key, Field).
101
+ dataType(Key, Field, "list"),
102
+ field((Field, Value), "index", Index).
107
103
 
108
- #show enumField(Key, Field, Value) :
104
+ field((Key, Field, Value), "displayName", EnumDisplayValue, "shortText") :-
105
+ childResult(Key, (Key, Field, Value), Field),
109
106
  field(Key, Field, Value),
107
+ dataType(Key, Field, "list"),
108
+ field((Field, Value), "enumDisplayValue", EnumDisplayValue).
109
+
110
+ % enum
111
+ childObject(Key, (Key, Field), Field) :-
112
+ field(Key, Field, _),
110
113
  dataType(Key, Field, "enum"),
111
- not field((Field, Value), "index", _),
112
- not field((Field, Value), "enumDisplayValue", _),
113
114
  showField(Key, Field).
114
115
 
115
- #show enumField(Key, Field, Value, Index, DisplayValue) :
116
+ field((Key, Field), "value", Value, "shortText") :-
117
+ childObject(Key, (Key, Field), Field),
116
118
  field(Key, Field, Value),
117
- dataType(Key, Field, "enum"),
118
- field((Field, Value), "index", Index),
119
- field((Field, Value), "enumDisplayValue", DisplayValue),
120
- showAll(Key).
119
+ dataType(Key, Field, "enum").
121
120
 
122
- #show enumField(Key, Field, Value, Index, Value) :
121
+ field((Key, Field), "index", Index, "integer") :-
122
+ childObject(Key, (Key, Field), Field),
123
123
  field(Key, Field, Value),
124
124
  dataType(Key, Field, "enum"),
125
- field((Field, Value), "index", Index),
126
- not field((Field, Value), "enumDisplayValue", _),
127
- showAll(Key).
128
-
129
- #show enumField(Key, Field, Value) :
130
- field(Key, Field, Value),
131
- dataType(Key, Field, "enum"),
132
- not field((Field, Value), "index", _),
133
- not field((Field, Value), "enumDisplayValue", _),
134
- showAll(Key).
135
-
136
- #show listField(Key, Field, Value, Index, DisplayValue) :
137
- field(Key, Field, Value),
138
- dataType(Key, Field, "list"),
139
- field((Field, Value), "index", Index),
140
- field((Field, Value), "enumDisplayValue", DisplayValue),
141
- showField(Key, Field).
125
+ field((Field, Value), "index", Index).
142
126
 
143
- #show listField(Key, Field, Value, Index, Value) :
127
+ field((Key, Field), "displayValue", EnumDisplayValue, "shortText") :-
128
+ childObject(Key, (Key, Field), Field),
144
129
  field(Key, Field, Value),
145
- dataType(Key, Field, "list"),
146
- field((Field, Value), "index", Index),
147
- not field((Field, Value), "enumDisplayValue", _),
148
- showField(Key, Field).
130
+ dataType(Key, Field, "enum"),
131
+ field((Field, Value), "enumDisplayValue", EnumDisplayValue).
149
132
 
150
- #show listField(Key, Field, Value) :
151
- field(Key, Field, Value),
152
- dataType(Key, Field, "list"),
153
- not field((Field, Value), "index", _),
154
- not field((Field, Value), "enumDisplayValue", _),
155
- showField(Key, Field).
133
+ % Allow specifying up to 3 fields at the same time
134
+ field(Key, Field, Value) :-
135
+ fields(Key, Field, Value, _, _).
156
136
 
157
- #show listField(Key, Field, Value, Index, DisplayValue) :
158
- field(Key, Field, Value),
159
- dataType(Key, Field, "list"),
160
- field((Field, Value), "index", Index),
161
- field((Field, Value), "enumDisplayValue", DisplayValue),
162
- showAll(Key).
137
+ field(Key, Field, Value) :-
138
+ fields(Key, _, _, Field, Value).
163
139
 
164
- #show listField(Key, Field, Value, Index, Value) :
165
- field(Key, Field, Value),
166
- dataType(Key, Field, "list"),
167
- field((Field, Value), "index", Index),
168
- not field((Field, Value), "enumDisplayValue", _),
169
- showAll(Key).
140
+ field(Key, Field, Value) :-
141
+ fields(Key, Field, Value, _, _, _, _).
170
142
 
171
- #show listField(Key, Field, Value) :
172
- field(Key, Field, Value),
173
- dataType(Key, Field, "list"),
174
- not field((Field, Value), "index", _),
175
- not field((Field, Value), "enumDisplayValue", _),
176
- showAll(Key).
177
-
178
- % label(key, label): key is tagged with "label"
179
-
180
- #show label(Key, Label) :
181
- label(Key, Label),
182
- showField(Key, "labels").
183
-
184
- #show label(Key, Label) :
185
- label(Key, Label),
186
- showAll(Key).
187
-
188
- % links
189
-
190
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "user", LinkDescription) :
191
- userLink(Source, Destination, LinkType, LinkDescription),
192
- field(Destination, "title", DestinationTitle),
193
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
194
- showField(Source, "links").
195
-
196
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "user", LinkDescription) :
197
- userLink(Source, Destination, LinkType, LinkDescription),
198
- field(Source, "title", SourceTitle),
199
- field(LinkType, "inboundDisplayName", InboundDisplayName),
200
- showField(Destination, "links").
201
-
202
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "user", LinkDescription) :
203
- userLink(Source, Destination, LinkType, LinkDescription),
204
- field(Destination, "title", DestinationTitle),
205
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
206
- showAll(Source).
207
-
208
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "user", LinkDescription) :
209
- userLink(Source, Destination, LinkType, LinkDescription),
210
- field(Source, "title", SourceTitle),
211
- field(LinkType, "inboundDisplayName", InboundDisplayName),
212
- showAll(Destination).
213
-
214
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "user") :
215
- userLink(Source, Destination, LinkType),
216
- field(Destination, "title", DestinationTitle),
217
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
218
- showField(Source, "links").
219
-
220
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "user") :
221
- userLink(Source, Destination, LinkType),
222
- field(Source, "title", SourceTitle),
223
- field(LinkType, "inboundDisplayName", InboundDisplayName),
224
- showField(Destination, "links").
225
-
226
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "user") :
227
- userLink(Source, Destination, LinkType),
228
- field(Destination, "title", DestinationTitle),
229
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
230
- showAll(Source).
231
-
232
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "user") :
233
- userLink(Source, Destination, LinkType),
234
- field(Source, "title", SourceTitle),
235
- field(LinkType, "inboundDisplayName", InboundDisplayName),
236
- showAll(Destination).
237
-
238
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "calculated", LinkDescription) :
239
- calculatedLink(Source, Destination, LinkType, LinkDescription),
240
- field(Destination, "title", DestinationTitle),
241
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
242
- showField(Source, "links").
243
-
244
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "calculated", LinkDescription) :
245
- calculatedLink(Source, Destination, LinkType, LinkDescription),
246
- field(Source, "title", SourceTitle),
247
- field(LinkType, "inboundDisplayName", InboundDisplayName),
248
- showField(Destination, "links").
249
-
250
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "calculated", LinkDescription) :
251
- calculatedLink(Source, Destination, LinkType, LinkDescription),
252
- field(Destination, "title", DestinationTitle),
253
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
254
- showAll(Source).
255
-
256
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "calculated", LinkDescription) :
257
- calculatedLink(Source, Destination, LinkType, LinkDescription),
258
- field(Source, "title", SourceTitle),
259
- field(LinkType, "inboundDisplayName", InboundDisplayName),
260
- showAll(Destination).
261
-
262
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "calculated") :
263
- calculatedLink(Source, Destination, LinkType),
264
- field(Destination, "title", DestinationTitle),
265
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
266
- showField(Source, "links").
267
-
268
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "calculated") :
269
- calculatedLink(Source, Destination, LinkType),
270
- field(Source, "title", SourceTitle),
271
- field(LinkType, "inboundDisplayName", InboundDisplayName),
272
- showField(Destination, "links").
273
-
274
- #show link(Source, Destination, DestinationTitle, LinkType, OutboundDisplayName, "outbound", "calculated") :
275
- calculatedLink(Source, Destination, LinkType),
276
- field(Destination, "title", DestinationTitle),
277
- field(LinkType, "outboundDisplayName", OutboundDisplayName),
278
- showAll(Source).
279
-
280
- #show link(Destination, Source, SourceTitle, LinkType, InboundDisplayName, "inbound", "calculated") :
281
- calculatedLink(Source, Destination, LinkType),
282
- field(Source, "title", SourceTitle),
283
- field(LinkType, "inboundDisplayName", InboundDisplayName),
284
- showAll(Destination).
285
-
286
- % notifications
287
-
288
- #show notification(Key, Category, Title, Message) :
289
- notification(Key, Category, Title, Message),
290
- showField(Key, "notifications").
291
-
292
- #show notification(Key, Category, Title, Message) :
293
- notification(Key, Category, Title, Message),
294
- showAll(Key).
295
-
296
- % policy checks
297
-
298
- #show policyCheckFailure(Key, Category, Title, ErrorMessage, Field) :
299
- policyCheckFailure(Key, Category, Title, ErrorMessage, Field),
300
- showField(Key, "policyChecks").
301
-
302
- #show policyCheckFailure(Key, Category, Title, ErrorMessage, Field) :
303
- policyCheckFailure(Key, Category, Title, ErrorMessage, Field),
304
- showAll(Key).
305
-
306
- #show policyCheckFailure(Key, Category, Title, ErrorMessage) :
307
- policyCheckFailure(Key, Category, Title, ErrorMessage),
308
- showField(Key, "policyChecks").
309
-
310
- #show policyCheckFailure(Key, Category, Title, ErrorMessage) :
311
- policyCheckFailure(Key, Category, Title, ErrorMessage),
312
- showAll(Key).
313
-
314
- #show policyCheckSuccess(Key, Category, Title) :
315
- policyCheckSuccess(Key, Category, Title),
316
- showField(Key, "policyChecks").
317
-
318
- #show policyCheckSuccess(Key, Category, Title) :
319
- policyCheckSuccess(Key, Category, Title),
320
- showAll(Key).
321
-
322
- % denied operations
323
-
324
- #show transitionDenied(Key, Transition, ErrorMessage) :
325
- transitionDenied(Key, Transition, ErrorMessage),
326
- showField(Key, "deniedOperations").
327
-
328
- #show transitionDenied(Key, Transition, ErrorMessage) :
329
- transitionDenied(Key, Transition, ErrorMessage),
330
- showAll(Key).
331
-
332
- #show movingCardDenied(Key, ErrorMessage) :
333
- movingCardDenied(Key, ErrorMessage),
334
- showField(Key, "deniedOperations").
335
-
336
- #show movingCardDenied(Key, ErrorMessage) :
337
- movingCardDenied(Key, ErrorMessage),
338
- showAll(Key).
339
-
340
- #show deletingCardDenied(Key, ErrorMessage) :
341
- deletingCardDenied(Key, ErrorMessage),
342
- showField(Key, "deniedOperations").
343
-
344
- #show deletingCardDenied(Key, ErrorMessage) :
345
- deletingCardDenied(Key, ErrorMessage),
346
- showAll(Key).
347
-
348
- #show editingFieldDenied(Key, Field, ErrorMessage) :
349
- editingFieldDenied(Key, Field, ErrorMessage),
350
- showField(Key, "deniedOperations").
351
-
352
- #show editingFieldDenied(Key, Field, ErrorMessage) :
353
- editingFieldDenied(Key, Field, ErrorMessage),
354
- showAll(Key).
355
-
356
- #show editingContentDenied(Key, ErrorMessage) :
357
- editingContentDenied(Key, ErrorMessage),
358
- showField(Key, "deniedOperations").
359
-
360
- #show editingContentDenied(Key, ErrorMessage) :
361
- editingContentDenied(Key, ErrorMessage),
362
- showAll(Key).
143
+ field(Key, Field, Value) :-
144
+ fields(Key, _, _, Field, Value, _, _).
145
+
146
+ field(Key, Field, Value) :-
147
+ fields(Key, _, _, _, _, Field, Value).
148
+
149
+ % allow using field directly
150
+ % fields are always shown
151
+ % TODO: instead of creating datatype and showField facts, we should simply show the field directly with #show
152
+ showField(Key, Field) :- field(Key, Field, _, _).
153
+ field(Key, Field, Value) :- field(Key, Field, Value, _).
154
+ dataType(Key, Field, DataType) :- field(Key, Field, _, DataType).
155
+
156
+
157
+ % childResultCollection(ParentKey, Collection): Defines a childResult. Allows guaranteeing an empty list, if no elements are present
158
+ #show childResultCollection(ParentKey, Collection) : childResultCollection(ParentKey, Collection).
363
159
 
364
160
  % order(n, collection, 1, field, direction): the results in the collection on level n should be first ordered by "field" in "direction"
365
161
  % order(n, collection, 2, field, direction): the results in the collection on level n should be secondly ordered by "field" in "direction"