@cyberismo/data-handler 0.0.14 → 0.0.16
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/dist/card-metadata-updater.js +8 -4
- package/dist/card-metadata-updater.js.map +1 -1
- package/dist/command-handler.d.ts +4 -0
- package/dist/command-handler.js +29 -19
- package/dist/command-handler.js.map +1 -1
- package/dist/command-manager.d.ts +25 -2
- package/dist/command-manager.js +30 -5
- package/dist/command-manager.js.map +1 -1
- package/dist/commands/create.d.ts +1 -1
- package/dist/commands/create.js +45 -93
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/edit.d.ts +1 -15
- package/dist/commands/edit.js +15 -89
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/export.d.ts +11 -2
- package/dist/commands/export.js +58 -58
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/import.d.ts +9 -1
- package/dist/commands/import.js +17 -11
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/move.d.ts +1 -2
- package/dist/commands/move.js +107 -146
- package/dist/commands/move.js.map +1 -1
- package/dist/commands/remove.d.ts +8 -1
- package/dist/commands/remove.js +17 -48
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/rename.d.ts +4 -9
- package/dist/commands/rename.js +34 -108
- package/dist/commands/rename.js.map +1 -1
- package/dist/commands/show.d.ts +22 -34
- package/dist/commands/show.js +103 -151
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/transition.d.ts +9 -2
- package/dist/commands/transition.js +49 -44
- package/dist/commands/transition.js.map +1 -1
- package/dist/commands/update.d.ts +18 -12
- package/dist/commands/update.js +34 -18
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.d.ts +18 -10
- package/dist/commands/validate.js +101 -47
- package/dist/commands/validate.js.map +1 -1
- package/dist/containers/card-container.d.ts +87 -24
- package/dist/containers/card-container.js +183 -279
- package/dist/containers/card-container.js.map +1 -1
- package/dist/containers/project/calculation-engine.d.ts +13 -4
- package/dist/containers/project/calculation-engine.js +79 -77
- package/dist/containers/project/calculation-engine.js.map +1 -1
- package/dist/containers/project/card-cache.d.ts +146 -0
- package/dist/containers/project/card-cache.js +411 -0
- package/dist/containers/project/card-cache.js.map +1 -0
- package/dist/containers/project/project-paths.d.ts +5 -4
- package/dist/containers/project/project-paths.js +16 -12
- package/dist/containers/project/project-paths.js.map +1 -1
- package/dist/containers/project/resource-cache.d.ts +169 -0
- package/dist/containers/project/resource-cache.js +507 -0
- package/dist/containers/project/resource-cache.js.map +1 -0
- package/dist/containers/project/resource-handler.d.ts +129 -0
- package/dist/containers/project/resource-handler.js +206 -0
- package/dist/containers/project/resource-handler.js.map +1 -0
- package/dist/containers/project.d.ts +114 -195
- package/dist/containers/project.js +425 -535
- package/dist/containers/project.js.map +1 -1
- package/dist/containers/template.d.ts +22 -32
- package/dist/containers/template.js +113 -115
- package/dist/containers/template.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/folder-content-interfaces.d.ts +7 -4
- package/dist/interfaces/folder-content-interfaces.js +3 -3
- package/dist/interfaces/folder-content-interfaces.js.map +1 -1
- package/dist/interfaces/macros.d.ts +1 -0
- package/dist/interfaces/macros.js +1 -1
- package/dist/interfaces/macros.js.map +1 -1
- package/dist/interfaces/project-interfaces.d.ts +7 -5
- package/dist/interfaces/project-interfaces.js.map +1 -1
- package/dist/interfaces/resource-interfaces.d.ts +25 -22
- package/dist/interfaces/resource-interfaces.js +3 -0
- package/dist/interfaces/resource-interfaces.js.map +1 -1
- package/dist/macros/common.d.ts +10 -10
- package/dist/macros/createCards/index.d.ts +0 -13
- package/dist/macros/createCards/index.js.map +1 -1
- package/dist/macros/createCards/types.d.ts +44 -0
- package/dist/macros/createCards/types.js +15 -0
- package/dist/macros/createCards/types.js.map +1 -0
- package/dist/macros/graph/index.d.ts +2 -6
- package/dist/macros/graph/index.js +14 -28
- package/dist/macros/graph/index.js.map +1 -1
- package/dist/macros/graph/types.d.ts +23 -0
- package/dist/macros/graph/types.js +15 -0
- package/dist/macros/graph/types.js.map +1 -0
- package/dist/macros/image/index.d.ts +8 -16
- package/dist/macros/image/index.js +36 -33
- package/dist/macros/image/index.js.map +1 -1
- package/dist/macros/image/types.d.ts +38 -0
- package/dist/macros/image/types.js +15 -0
- package/dist/macros/image/types.js.map +1 -0
- package/dist/macros/include/index.d.ts +1 -6
- package/dist/macros/include/index.js +4 -7
- package/dist/macros/include/index.js.map +1 -1
- package/dist/macros/include/types.d.ts +31 -0
- package/dist/macros/include/types.js +15 -0
- package/dist/macros/include/types.js.map +1 -0
- package/dist/macros/index.d.ts +1 -1
- package/dist/macros/index.js +2 -2
- package/dist/macros/index.js.map +1 -1
- package/dist/macros/percentage/index.d.ts +0 -6
- package/dist/macros/percentage/index.js.map +1 -1
- package/dist/macros/percentage/types.d.ts +31 -0
- package/dist/macros/percentage/types.js +15 -0
- package/dist/macros/percentage/types.js.map +1 -0
- package/dist/macros/report/index.d.ts +0 -3
- package/dist/macros/report/index.js +3 -6
- package/dist/macros/report/index.js.map +1 -1
- package/dist/macros/report/types.d.ts +19 -0
- package/dist/macros/report/types.js +15 -0
- package/dist/macros/report/types.js.map +1 -0
- package/dist/macros/scoreCard/index.d.ts +0 -6
- package/dist/macros/scoreCard/index.js.map +1 -1
- package/dist/macros/scoreCard/types.d.ts +31 -0
- package/dist/macros/scoreCard/types.js +15 -0
- package/dist/macros/scoreCard/types.js.map +1 -0
- package/dist/macros/types.d.ts +25 -0
- package/dist/macros/types.js +2 -0
- package/dist/macros/types.js.map +1 -0
- package/dist/macros/vega/index.d.ts +0 -4
- package/dist/macros/vega/index.js.map +1 -1
- package/dist/macros/vega/types.d.ts +20 -0
- package/dist/macros/vega/types.js +2 -0
- package/dist/macros/vega/types.js.map +1 -0
- package/dist/macros/vegalite/index.d.ts +0 -4
- package/dist/macros/vegalite/index.js.map +1 -1
- package/dist/macros/vegalite/types.d.ts +20 -0
- package/dist/macros/vegalite/types.js +15 -0
- package/dist/macros/vegalite/types.js.map +1 -0
- package/dist/macros/xref/index.d.ts +0 -3
- package/dist/macros/xref/index.js +5 -14
- package/dist/macros/xref/index.js.map +1 -1
- package/dist/macros/xref/types.d.ts +19 -0
- package/dist/macros/xref/types.js +15 -0
- package/dist/macros/xref/types.js.map +1 -0
- package/dist/module-manager.d.ts +16 -3
- package/dist/module-manager.js +55 -23
- package/dist/module-manager.js.map +1 -1
- package/dist/project-settings.d.ts +16 -3
- package/dist/project-settings.js +79 -14
- package/dist/project-settings.js.map +1 -1
- package/dist/resources/calculation-resource.d.ts +6 -33
- package/dist/resources/calculation-resource.js +11 -60
- package/dist/resources/calculation-resource.js.map +1 -1
- package/dist/resources/card-type-resource.d.ts +10 -22
- package/dist/resources/card-type-resource.js +46 -66
- package/dist/resources/card-type-resource.js.map +1 -1
- package/dist/resources/create-defaults.d.ts +3 -2
- package/dist/resources/create-defaults.js +3 -2
- package/dist/resources/create-defaults.js.map +1 -1
- package/dist/resources/field-type-resource.d.ts +8 -22
- package/dist/resources/field-type-resource.js +35 -60
- package/dist/resources/field-type-resource.js.map +1 -1
- package/dist/resources/file-resource.d.ts +14 -35
- package/dist/resources/file-resource.js +22 -301
- package/dist/resources/file-resource.js.map +1 -1
- package/dist/resources/folder-resource.d.ts +44 -66
- package/dist/resources/folder-resource.js +102 -149
- package/dist/resources/folder-resource.js.map +1 -1
- package/dist/resources/graph-model-resource.d.ts +9 -34
- package/dist/resources/graph-model-resource.js +18 -64
- package/dist/resources/graph-model-resource.js.map +1 -1
- package/dist/resources/graph-view-resource.d.ts +9 -29
- package/dist/resources/graph-view-resource.js +13 -48
- package/dist/resources/graph-view-resource.js.map +1 -1
- package/dist/resources/link-type-resource.d.ts +9 -23
- package/dist/resources/link-type-resource.js +11 -33
- package/dist/resources/link-type-resource.js.map +1 -1
- package/dist/resources/report-resource.d.ts +10 -23
- package/dist/resources/report-resource.js +20 -67
- package/dist/resources/report-resource.js.map +1 -1
- package/dist/resources/resource-object.d.ts +143 -23
- package/dist/resources/resource-object.js +369 -48
- package/dist/resources/resource-object.js.map +1 -1
- package/dist/resources/template-resource.d.ts +10 -17
- package/dist/resources/template-resource.js +19 -27
- package/dist/resources/template-resource.js.map +1 -1
- package/dist/resources/workflow-resource.d.ts +9 -25
- package/dist/resources/workflow-resource.js +25 -55
- package/dist/resources/workflow-resource.js.map +1 -1
- package/dist/utils/card-utils.d.ts +69 -19
- package/dist/utils/card-utils.js +179 -30
- package/dist/utils/card-utils.js.map +1 -1
- package/dist/utils/clingo-fact-builder.d.ts +25 -14
- package/dist/utils/clingo-fact-builder.js +27 -5
- package/dist/utils/clingo-fact-builder.js.map +1 -1
- package/dist/utils/clingo-facts.js +14 -7
- package/dist/utils/clingo-facts.js.map +1 -1
- package/dist/utils/clingo-parser.js +1 -1
- package/dist/utils/clingo-parser.js.map +1 -1
- package/dist/utils/constants.d.ts +2 -0
- package/dist/utils/constants.js +4 -0
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/csv.js +1 -1
- package/dist/utils/csv.js.map +1 -1
- package/dist/utils/resource-utils.d.ts +1 -0
- package/dist/utils/resource-utils.js +2 -1
- package/dist/utils/resource-utils.js.map +1 -1
- package/package.json +11 -11
- package/src/card-metadata-updater.ts +9 -7
- package/src/command-handler.ts +35 -23
- package/src/command-manager.ts +32 -19
- package/src/commands/create.ts +59 -160
- package/src/commands/edit.ts +16 -132
- package/src/commands/export.ts +71 -81
- package/src/commands/import.ts +26 -18
- package/src/commands/move.ts +143 -179
- package/src/commands/remove.ts +20 -59
- package/src/commands/rename.ts +45 -156
- package/src/commands/show.ts +153 -211
- package/src/commands/transition.ts +53 -58
- package/src/commands/update.ts +44 -23
- package/src/commands/validate.ts +108 -82
- package/src/containers/card-container.ts +200 -360
- package/src/containers/project/calculation-engine.ts +81 -105
- package/src/containers/project/card-cache.ts +497 -0
- package/src/containers/project/project-paths.ts +21 -13
- package/src/containers/project/resource-cache.ts +648 -0
- package/src/containers/project/resource-handler.ts +265 -0
- package/src/containers/project.ts +551 -693
- package/src/containers/template.ts +129 -142
- package/src/index.ts +1 -0
- package/src/interfaces/folder-content-interfaces.ts +14 -7
- package/src/interfaces/macros.ts +2 -0
- package/src/interfaces/project-interfaces.ts +14 -7
- package/src/interfaces/resource-interfaces.ts +30 -27
- package/src/macros/createCards/index.ts +1 -12
- package/src/macros/createCards/types.ts +46 -0
- package/src/macros/graph/index.ts +27 -52
- package/src/macros/graph/types.ts +24 -0
- package/src/macros/image/index.ts +50 -61
- package/src/macros/image/types.ts +39 -0
- package/src/macros/include/index.ts +6 -15
- package/src/macros/include/types.ts +32 -0
- package/src/macros/index.ts +2 -2
- package/src/macros/percentage/index.ts +1 -7
- package/src/macros/percentage/types.ts +32 -0
- package/src/macros/report/index.ts +4 -13
- package/src/macros/report/types.ts +20 -0
- package/src/macros/scoreCard/index.ts +1 -7
- package/src/macros/scoreCard/types.ts +32 -0
- package/src/macros/types.ts +48 -0
- package/src/macros/vega/index.ts +1 -4
- package/src/macros/vega/types.ts +21 -0
- package/src/macros/vegalite/index.ts +1 -4
- package/src/macros/vegalite/types.ts +22 -0
- package/src/macros/xref/index.ts +6 -20
- package/src/macros/xref/types.ts +20 -0
- package/src/module-manager.ts +79 -22
- package/src/project-settings.ts +84 -15
- package/src/resources/calculation-resource.ts +21 -91
- package/src/resources/card-type-resource.ts +74 -109
- package/src/resources/create-defaults.ts +3 -2
- package/src/resources/field-type-resource.ts +61 -104
- package/src/resources/file-resource.ts +33 -441
- package/src/resources/folder-resource.ts +130 -207
- package/src/resources/graph-model-resource.ts +36 -95
- package/src/resources/graph-view-resource.ts +28 -70
- package/src/resources/link-type-resource.ts +23 -53
- package/src/resources/report-resource.ts +34 -96
- package/src/resources/resource-object.ts +511 -66
- package/src/resources/template-resource.ts +32 -44
- package/src/resources/workflow-resource.ts +42 -85
- package/src/utils/card-utils.ts +217 -31
- package/src/utils/clingo-fact-builder.ts +28 -16
- package/src/utils/clingo-facts.ts +16 -7
- package/src/utils/clingo-parser.ts +1 -1
- package/src/utils/constants.ts +6 -0
- package/src/utils/csv.ts +1 -1
- package/src/utils/resource-utils.ts +2 -1
- package/dist/containers/project/resource-collector.d.ts +0 -87
- package/dist/containers/project/resource-collector.js +0 -337
- package/dist/containers/project/resource-collector.js.map +0 -1
- package/src/containers/project/resource-collector.ts +0 -396
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/image/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE"}
|
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
14
14
|
import BaseMacro from '../base-macro.js';
|
|
15
15
|
import type TaskQueue from '../task-queue.js';
|
|
16
|
-
export interface IncludeMacroOptions {
|
|
17
|
-
cardKey: string;
|
|
18
|
-
levelOffset?: string;
|
|
19
|
-
title?: 'include' | 'exclude' | 'only';
|
|
20
|
-
pageTitles?: 'normal' | 'discrete';
|
|
21
|
-
}
|
|
22
16
|
export default class IncludeMacro extends BaseMacro {
|
|
23
17
|
constructor(tasksQueue: TaskQueue);
|
|
24
18
|
handleValidate: (_: MacroGenerationContext, input: unknown) => void;
|
|
@@ -27,5 +21,6 @@ export default class IncludeMacro extends BaseMacro {
|
|
|
27
21
|
private generateAnchor;
|
|
28
22
|
private generateTitle;
|
|
29
23
|
private generateCardContent;
|
|
24
|
+
private getCard;
|
|
30
25
|
private adjustTitles;
|
|
31
26
|
}
|
|
@@ -29,17 +29,11 @@ export default class IncludeMacro extends BaseMacro {
|
|
|
29
29
|
if (!options.pageTitles) {
|
|
30
30
|
options.pageTitles = 'normal';
|
|
31
31
|
}
|
|
32
|
-
const card = await context.project.cardDetailsById(options.cardKey, {
|
|
33
|
-
content: true,
|
|
34
|
-
metadata: true,
|
|
35
|
-
});
|
|
36
|
-
if (!card) {
|
|
37
|
-
throw new Error(`Card key ${options.cardKey} not found`);
|
|
38
|
-
}
|
|
39
32
|
const newContext = {
|
|
40
33
|
...context,
|
|
41
34
|
cardKey: options.cardKey,
|
|
42
35
|
};
|
|
36
|
+
const card = this.getCard(options.cardKey, context);
|
|
43
37
|
const anchor = this.generateAnchor(options);
|
|
44
38
|
const title = this.generateTitle(options, card.metadata?.title);
|
|
45
39
|
const cardContent = await this.generateCardContent(options, card.content, newContext);
|
|
@@ -75,6 +69,9 @@ export default class IncludeMacro extends BaseMacro {
|
|
|
75
69
|
}
|
|
76
70
|
return '';
|
|
77
71
|
}
|
|
72
|
+
getCard(cardKey, context) {
|
|
73
|
+
return context.project.findCard(cardKey);
|
|
74
|
+
}
|
|
78
75
|
// Adjust asciidoc titles to match the level offset
|
|
79
76
|
adjustTitles(content, levelOffset, discrete) {
|
|
80
77
|
const lines = content.split('\n');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/include/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","s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AI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export interface IncludeMacroOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Card key of the card being included
|
|
17
|
+
*/
|
|
18
|
+
cardKey: string;
|
|
19
|
+
/**
|
|
20
|
+
* A positive number wil increase the level of headings and a negative alue will the level of headings in the included content
|
|
21
|
+
*/
|
|
22
|
+
levelOffset?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Determines behaviour with the title that is in card metadata
|
|
25
|
+
* include --> includes the title
|
|
26
|
+
* exclude --> excludes the title
|
|
27
|
+
* only --> includes title but does not import content
|
|
28
|
+
*/
|
|
29
|
+
title?: 'include' | 'exclude' | 'only';
|
|
30
|
+
pageTitles?: 'normal' | 'discrete';
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/include/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE"}
|
package/dist/macros/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare function validateMacroContent<T>(macro: MacroMetadata, data: unkn
|
|
|
50
50
|
* @param tasks - Tasks to register
|
|
51
51
|
* @returns macro instances
|
|
52
52
|
*/
|
|
53
|
-
export declare function registerMacros(instance: typeof Handlebars, context: MacroGenerationContext, tasks: TaskQueue): BaseMacro[]
|
|
53
|
+
export declare function registerMacros(instance: typeof Handlebars, context: MacroGenerationContext, tasks: TaskQueue): Promise<BaseMacro[]>;
|
|
54
54
|
/**
|
|
55
55
|
* Calculate amount of handlebars templates inside a string
|
|
56
56
|
* @param input - String to calculate templates from
|
package/dist/macros/index.js
CHANGED
|
@@ -141,7 +141,7 @@ export function validateMacroContent(macro, data, schema) {
|
|
|
141
141
|
* @param tasks - Tasks to register
|
|
142
142
|
* @returns macro instances
|
|
143
143
|
*/
|
|
144
|
-
export function registerMacros(instance, context, tasks) {
|
|
144
|
+
export async function registerMacros(instance, context, tasks) {
|
|
145
145
|
const macroInstances = [];
|
|
146
146
|
for (const macro of Object.keys(macros)) {
|
|
147
147
|
const MacroClass = macros[macro];
|
|
@@ -186,7 +186,7 @@ export function registerEmptyMacros(instance) {
|
|
|
186
186
|
export async function evaluateMacros(content, context, preserveRawBlocks = false) {
|
|
187
187
|
const handlebars = Handlebars.create();
|
|
188
188
|
const tasks = new TaskQueue();
|
|
189
|
-
registerMacros(handlebars, context, tasks);
|
|
189
|
+
await registerMacros(handlebars, context, tasks);
|
|
190
190
|
let result = content;
|
|
191
191
|
while ((context.maxTries ?? 10) > 0) {
|
|
192
192
|
await tasks.reset();
|
package/dist/macros/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/macros/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,KAAK,MAAM,kBAAkB,CAAC;AACrC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQvE,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,UAAU,GAAG,QAAQ,CAAC;AAC5B,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,eAAe,GAAG,UAAU,CAAC;AAEnC;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,OAAe;IAC1C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,sGAAsG;IACtG,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE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AE,IAAI,EAAE,CAAC,CAAC,CAAC;IACrD,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,MAAM,KAAK,KAAK,aAAa,MAAM,KAAK,IAAI,CAAC;AACtD,CAAC"}
|
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
14
14
|
import BaseMacro from '../base-macro.js';
|
|
15
15
|
import type TaskQueue from '../task-queue.js';
|
|
16
|
-
export interface PercentageOptions {
|
|
17
|
-
title: string;
|
|
18
|
-
value: number;
|
|
19
|
-
legend: string;
|
|
20
|
-
colour?: 'blue' | 'green' | 'yellow' | 'red' | 'orange' | 'purple';
|
|
21
|
-
}
|
|
22
16
|
declare class PercentageMacro extends BaseMacro {
|
|
23
17
|
constructor(tasksQueue: TaskQueue);
|
|
24
18
|
handleValidate: (_: MacroGenerationContext, data: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/percentage/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,aAAa,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/percentage/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,eAAgB,SAAQ,SAAS;IACrC,YAAY,UAAqB;QAC/B,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IACD,cAAc,GAAG,CAAC,CAAyB,EAAE,IAAY,EAAE,EAAE;QAC3D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,YAAY,GAAG,KAAK,EAAE,CAAyB,EAAE,KAAc,EAAE,EAAE;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,WAAW,CAChB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACnD,KAAK,CACN,CAAC;IACJ,CAAC,CAAC;IAEM,QAAQ,CAAC,KAAc;QAC7B,OAAO,oBAAoB,CAAoB,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;CACF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export interface PercentageOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Title of percentage macro
|
|
17
|
+
*/
|
|
18
|
+
title: string;
|
|
19
|
+
/**
|
|
20
|
+
* Percentage value
|
|
21
|
+
*/
|
|
22
|
+
value: number;
|
|
23
|
+
/**
|
|
24
|
+
* Legend text below the macro
|
|
25
|
+
*/
|
|
26
|
+
legend: string;
|
|
27
|
+
/**
|
|
28
|
+
* Color of the bar the represents the percentage
|
|
29
|
+
*/
|
|
30
|
+
colour?: 'blue' | 'green' | 'yellow' | 'red' | 'orange' | 'purple';
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/percentage/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE"}
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
14
14
|
import BaseMacro from '../base-macro.js';
|
|
15
15
|
import type TaskQueue from '../task-queue.js';
|
|
16
|
-
export interface ReportOptions {
|
|
17
|
-
name: string;
|
|
18
|
-
}
|
|
19
16
|
declare class ReportMacro extends BaseMacro {
|
|
20
17
|
constructor(tasks: TaskQueue);
|
|
21
18
|
handleValidate: (_: MacroGenerationContext, input: unknown) => void;
|
|
@@ -14,8 +14,6 @@ import { validateMacroContent } from '../index.js';
|
|
|
14
14
|
import macroMetadata from './metadata.js';
|
|
15
15
|
import BaseMacro from '../base-macro.js';
|
|
16
16
|
import { validateJson } from '../../utils/validate.js';
|
|
17
|
-
import { ReportResource } from '../../resources/report-resource.js';
|
|
18
|
-
import { resourceName } from '../../utils/resource-utils.js';
|
|
19
17
|
import { generateReportContent } from '../../utils/report.js';
|
|
20
18
|
import { ClingoError } from '@cyberismo/node-clingo';
|
|
21
19
|
class ReportMacro extends BaseMacro {
|
|
@@ -27,10 +25,9 @@ class ReportMacro extends BaseMacro {
|
|
|
27
25
|
};
|
|
28
26
|
handleStatic = async (context, data) => {
|
|
29
27
|
const options = this.validate(data);
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
throw new Error(`Report ${options.name} does not exist`);
|
|
28
|
+
const report = context.project.resources
|
|
29
|
+
.byType(options.name, 'reports')
|
|
30
|
+
.show();
|
|
34
31
|
if (report.content.schema) {
|
|
35
32
|
validateJson(options, {
|
|
36
33
|
schema: report.content.schema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/report/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,aAAa,MAAM,eAAe,CAAC;AAC1C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/report/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,aAAa,MAAM,eAAe,CAAC;AAC1C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,O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AAI,KAAK,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7F,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEM,QAAQ,CAAC,IAAa;QAC5B,OAAO,oBAAoB,CAAgB,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAClE,CAAC;CACF;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export interface ReportOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Name of the report
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/report/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE"}
|
|
@@ -14,12 +14,6 @@
|
|
|
14
14
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
15
15
|
import BaseMacro from '../base-macro.js';
|
|
16
16
|
import type TaskQueue from '../task-queue.js';
|
|
17
|
-
export interface ScoreCardOptions {
|
|
18
|
-
value: number;
|
|
19
|
-
legend?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
unit?: string;
|
|
22
|
-
}
|
|
23
17
|
declare class ScoreCardMacro extends BaseMacro {
|
|
24
18
|
constructor(tasksQueue: TaskQueue);
|
|
25
19
|
handleValidate: (_: MacroGenerationContext, data: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/scoreCard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAEF,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,aAAa,MAAM,eAAe,CAAC;AAC1C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/scoreCard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAEF,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,aAAa,MAAM,eAAe,CAAC;AAC1C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,cAAe,SAAQ,SAAS;IACpC,YAAY,UAAqB;QAC/B,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IACD,cAAc,GAAG,CAAC,CAAyB,EAAE,IAAY,EAAE,EAAE;QAC3D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,YAAY,GAAG,KAAK,EAAE,CAAyB,EAAE,KAAc,EAAE,EAAE;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,WAAW,CAChB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAClD,KAAK,CACN,CAAC;IACJ,CAAC,CAAC;IAEM,QAAQ,CAAC,KAAc;QAC7B,OAAO,oBAAoB,CAAmB,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export interface ScoreCardOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Value shown in score card
|
|
17
|
+
*/
|
|
18
|
+
value: number;
|
|
19
|
+
/**
|
|
20
|
+
* Optional legend text
|
|
21
|
+
*/
|
|
22
|
+
legend?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Option title text
|
|
25
|
+
*/
|
|
26
|
+
title?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Option unit that is next to the value
|
|
29
|
+
*/
|
|
30
|
+
unit?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/scoreCard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
import { CreateCardsOptions } from './createCards/types.js';
|
|
15
|
+
import { GraphOptions } from './graph/types.js';
|
|
16
|
+
import { ImageMacroOptions } from './image/types.js';
|
|
17
|
+
import { IncludeMacroOptions } from './include/types.js';
|
|
18
|
+
import { PercentageOptions } from './percentage/types.js';
|
|
19
|
+
import { ReportOptions } from './report/types.js';
|
|
20
|
+
import { ScoreCardOptions } from './scoreCard/types.js';
|
|
21
|
+
import { VegaMacroInput } from './vega/types.js';
|
|
22
|
+
import { VegaLiteMacroInput } from './vegalite/types.js';
|
|
23
|
+
import { XrefMacroOptions } from './xref/types.js';
|
|
24
|
+
export type AnyMacroOption = CreateCardsOptions | GraphOptions | ImageMacroOptions | IncludeMacroOptions | PercentageOptions | ReportOptions | ScoreCardOptions | VegaMacroInput | VegaLiteMacroInput | XrefMacroOptions;
|
|
25
|
+
export { CreateCardsOptions, GraphOptions, ImageMacroOptions, IncludeMacroOptions, PercentageOptions, ReportOptions, ScoreCardOptions, VegaMacroInput, VegaLiteMacroInput, XrefMacroOptions, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/macros/types.ts"],"names":[],"mappings":""}
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
15
15
|
import BaseMacro from '../base-macro.js';
|
|
16
16
|
import type TaskQueue from '../task-queue.js';
|
|
17
|
-
import * as vega from 'vega';
|
|
18
|
-
export interface VegaMacroInput {
|
|
19
|
-
spec: vega.Spec;
|
|
20
|
-
}
|
|
21
17
|
declare class VegaMacro extends BaseMacro {
|
|
22
18
|
constructor(tasksQueue: TaskQueue);
|
|
23
19
|
handleValidate: (_: MacroGenerationContext, input: unknown) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/vega/index.ts"],"names":[],"mappings":"AAcA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/vega/index.ts"],"names":[],"mappings":"AAcA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,oBAAoB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,SAAU,SAAQ,SAAS;IAC/B,YAAY,UAAqB;QAC/B,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,cAAc,GAAG,CAAC,CAAyB,EAAE,KAAc,EAAE,EAAE;QAC7D,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,YAAY,GAAG,KAAK,EAAE,CAAyB,EAAE,KAAc,EAAE,EAAE;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAmB,CAAC;QACvD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3E,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC,CAAC;IAEF,YAAY,GAAG,KAAK,EAAE,CAAyB,EAAE,KAAc,EAAE,EAAE;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAmB,CAAC;QACvD,OAAO,qBAAqB,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC,CAAC;IAEM,QAAQ,CAAC,KAAc;QAC7B,OAAO,oBAAoB,CAAiB,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;CACF;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
import type { Spec } from 'vega';
|
|
15
|
+
export interface VegaMacroInput {
|
|
16
|
+
/**
|
|
17
|
+
* Defines spec for vega
|
|
18
|
+
*/
|
|
19
|
+
spec: Spec;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/vega/types.ts"],"names":[],"mappings":""}
|
|
@@ -13,10 +13,6 @@
|
|
|
13
13
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
14
14
|
import BaseMacro from '../base-macro.js';
|
|
15
15
|
import type TaskQueue from '../task-queue.js';
|
|
16
|
-
import * as vegaLite from 'vega-lite';
|
|
17
|
-
export interface VegaLiteMacroInput {
|
|
18
|
-
spec: vegaLite.TopLevelSpec;
|
|
19
|
-
}
|
|
20
16
|
declare class VegaLiteMacro extends BaseMacro {
|
|
21
17
|
constructor(tasksQueue: TaskQueue);
|
|
22
18
|
handleValidate: (_: MacroGenerationContext, input: unknown) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/vegalite/index.ts"],"names":[],"mappings":"AAaA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/macros/vegalite/index.ts"],"names":[],"mappings":"AAaA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,aAAa,MAAM,eAAe,CAAC;AAE1C,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGhE,MAAM,aAAc,SAAQ,SAAS;IACnC,YAAY,UAAqB;QAC/B,KAAK,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,cAAc,GAAG,CAAC,CAAyB,EAAE,KAAc,EAAE,EAAE;QAC7D,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,YAAY,GAAG,KAAK,EAAE,CAAyB,EAAE,KAAc,EAAE,EAAE;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAuB,CAAC;QAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QACrD,OAAO,WAAW,CAAC,MAAM,EAAE;YACzB,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACL,CAAC,CAAC;IAEM,QAAQ,CAAC,KAAc;QAC7B,OAAO,oBAAoB,CAAqB,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
import type { TopLevelSpec } from 'vega-lite';
|
|
15
|
+
export interface VegaLiteMacroInput {
|
|
16
|
+
/**
|
|
17
|
+
* Defines spec for vega-lite
|
|
18
|
+
*/
|
|
19
|
+
spec: TopLevelSpec;
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2025
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU Affero General Public License version 3 as published by
|
|
7
|
+
the Free Software Foundation. This program is distributed in the hope that it
|
|
8
|
+
will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
|
9
|
+
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
10
|
+
See the GNU Affero General Public License for more details.
|
|
11
|
+
You should have received a copy of the GNU Affero General Public
|
|
12
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/macros/vegalite/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE"}
|
|
@@ -13,9 +13,6 @@
|
|
|
13
13
|
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
14
14
|
import BaseMacro from '../base-macro.js';
|
|
15
15
|
import type TaskQueue from '../task-queue.js';
|
|
16
|
-
export interface XrefMacroOptions {
|
|
17
|
-
cardKey: string;
|
|
18
|
-
}
|
|
19
16
|
export default class XrefMacro extends BaseMacro {
|
|
20
17
|
constructor(tasksQueue: TaskQueue);
|
|
21
18
|
handleValidate: (_: MacroGenerationContext, input: unknown) => void;
|