@cyberismo/data-handler 0.0.2
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/LICENSE +702 -0
- package/dist/card-metadata-updater.d.ts +33 -0
- package/dist/card-metadata-updater.js +121 -0
- package/dist/card-metadata-updater.js.map +1 -0
- package/dist/command-handler.d.ts +96 -0
- package/dist/command-handler.js +557 -0
- package/dist/command-handler.js.map +1 -0
- package/dist/command-manager.d.ts +43 -0
- package/dist/command-manager.js +73 -0
- package/dist/command-manager.js.map +1 -0
- package/dist/commands/calculate.d.ts +86 -0
- package/dist/commands/calculate.js +444 -0
- package/dist/commands/calculate.js.map +1 -0
- package/dist/commands/create.d.ts +114 -0
- package/dist/commands/create.js +389 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/edit.d.ts +37 -0
- package/dist/commands/edit.js +99 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/export-site.d.ts +45 -0
- package/dist/commands/export-site.js +301 -0
- package/dist/commands/export-site.js.map +1 -0
- package/dist/commands/export.d.ts +53 -0
- package/dist/commands/export.js +251 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/import.d.ts +53 -0
- package/dist/commands/import.js +133 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/index.d.ts +26 -0
- package/dist/commands/index.js +27 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/move.d.ts +55 -0
- package/dist/commands/move.js +341 -0
- package/dist/commands/move.js.map +1 -0
- package/dist/commands/remove.d.ts +38 -0
- package/dist/commands/remove.js +192 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/rename.d.ts +46 -0
- package/dist/commands/rename.js +289 -0
- package/dist/commands/rename.js.map +1 -0
- package/dist/commands/show.d.ts +124 -0
- package/dist/commands/show.js +345 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/transition.d.ts +27 -0
- package/dist/commands/transition.js +92 -0
- package/dist/commands/transition.js.map +1 -0
- package/dist/commands/update.d.ts +29 -0
- package/dist/commands/update.js +64 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +143 -0
- package/dist/commands/validate.js +689 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/containers/card-container.d.ts +44 -0
- package/dist/containers/card-container.js +282 -0
- package/dist/containers/card-container.js.map +1 -0
- package/dist/containers/project/project-paths.d.ts +46 -0
- package/dist/containers/project/project-paths.js +105 -0
- package/dist/containers/project/project-paths.js.map +1 -0
- package/dist/containers/project/resource-collector.d.ts +86 -0
- package/dist/containers/project/resource-collector.js +331 -0
- package/dist/containers/project/resource-collector.js.map +1 -0
- package/dist/containers/project.d.ts +351 -0
- package/dist/containers/project.js +896 -0
- package/dist/containers/project.js.map +1 -0
- package/dist/containers/template.d.ts +108 -0
- package/dist/containers/template.js +433 -0
- package/dist/containers/template.js.map +1 -0
- package/dist/exceptions/index.d.ts +19 -0
- package/dist/exceptions/index.js +26 -0
- package/dist/exceptions/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/adoc.d.ts +12 -0
- package/dist/interfaces/adoc.js +13 -0
- package/dist/interfaces/adoc.js.map +1 -0
- package/dist/interfaces/macros.d.ts +45 -0
- package/dist/interfaces/macros.js +13 -0
- package/dist/interfaces/macros.js.map +1 -0
- package/dist/interfaces/project-interfaces.d.ts +121 -0
- package/dist/interfaces/project-interfaces.js +21 -0
- package/dist/interfaces/project-interfaces.js.map +1 -0
- package/dist/interfaces/request-status-interfaces.d.ts +28 -0
- package/dist/interfaces/request-status-interfaces.js +20 -0
- package/dist/interfaces/request-status-interfaces.js.map +1 -0
- package/dist/interfaces/resource-interfaces.d.ts +117 -0
- package/dist/interfaces/resource-interfaces.js +20 -0
- package/dist/interfaces/resource-interfaces.js.map +1 -0
- package/dist/macros/base-macro.d.ts +31 -0
- package/dist/macros/base-macro.js +126 -0
- package/dist/macros/base-macro.js.map +1 -0
- package/dist/macros/common.d.ts +17 -0
- package/dist/macros/common.js +23 -0
- package/dist/macros/common.js.map +1 -0
- package/dist/macros/createCards/index.d.ts +36 -0
- package/dist/macros/createCards/index.js +35 -0
- package/dist/macros/createCards/index.js.map +1 -0
- package/dist/macros/createCards/metadata.d.ts +14 -0
- package/dist/macros/createCards/metadata.js +18 -0
- package/dist/macros/createCards/metadata.js.map +1 -0
- package/dist/macros/graph/index.d.ts +29 -0
- package/dist/macros/graph/index.js +91 -0
- package/dist/macros/graph/index.js.map +1 -0
- package/dist/macros/graph/metadata.d.ts +14 -0
- package/dist/macros/graph/metadata.js +18 -0
- package/dist/macros/graph/metadata.js.map +1 -0
- package/dist/macros/index.d.ts +93 -0
- package/dist/macros/index.js +237 -0
- package/dist/macros/index.js.map +1 -0
- package/dist/macros/report/index.d.ts +26 -0
- package/dist/macros/report/index.js +70 -0
- package/dist/macros/report/index.js.map +1 -0
- package/dist/macros/report/metadata.d.ts +14 -0
- package/dist/macros/report/metadata.js +18 -0
- package/dist/macros/report/metadata.js.map +1 -0
- package/dist/macros/scoreCard/index.d.ts +30 -0
- package/dist/macros/scoreCard/index.js +38 -0
- package/dist/macros/scoreCard/index.js.map +1 -0
- package/dist/macros/scoreCard/metadata.d.ts +14 -0
- package/dist/macros/scoreCard/metadata.js +18 -0
- package/dist/macros/scoreCard/metadata.js.map +1 -0
- package/dist/macros/task-queue.d.ts +46 -0
- package/dist/macros/task-queue.js +69 -0
- package/dist/macros/task-queue.js.map +1 -0
- package/dist/module-manager.d.ts +62 -0
- package/dist/module-manager.js +350 -0
- package/dist/module-manager.js.map +1 -0
- package/dist/permissions/action-guard.d.ts +28 -0
- package/dist/permissions/action-guard.js +61 -0
- package/dist/permissions/action-guard.js.map +1 -0
- package/dist/project-settings.d.ts +42 -0
- package/dist/project-settings.js +120 -0
- package/dist/project-settings.js.map +1 -0
- package/dist/resources/array-handler.d.ts +28 -0
- package/dist/resources/array-handler.js +116 -0
- package/dist/resources/array-handler.js.map +1 -0
- package/dist/resources/card-type-resource.d.ts +72 -0
- package/dist/resources/card-type-resource.js +334 -0
- package/dist/resources/card-type-resource.js.map +1 -0
- package/dist/resources/create-defaults.d.ts +81 -0
- package/dist/resources/create-defaults.js +184 -0
- package/dist/resources/create-defaults.js.map +1 -0
- package/dist/resources/field-type-resource.d.ts +88 -0
- package/dist/resources/field-type-resource.js +411 -0
- package/dist/resources/field-type-resource.js.map +1 -0
- package/dist/resources/file-resource.d.ts +50 -0
- package/dist/resources/file-resource.js +301 -0
- package/dist/resources/file-resource.js.map +1 -0
- package/dist/resources/folder-resource.d.ts +66 -0
- package/dist/resources/folder-resource.js +100 -0
- package/dist/resources/folder-resource.js.map +1 -0
- package/dist/resources/graph-model-resource.d.ts +78 -0
- package/dist/resources/graph-model-resource.js +164 -0
- package/dist/resources/graph-model-resource.js.map +1 -0
- package/dist/resources/graph-view-resource.d.ts +78 -0
- package/dist/resources/graph-view-resource.js +163 -0
- package/dist/resources/graph-view-resource.js.map +1 -0
- package/dist/resources/link-type-resource.d.ts +62 -0
- package/dist/resources/link-type-resource.js +150 -0
- package/dist/resources/link-type-resource.js.map +1 -0
- package/dist/resources/report-resource.d.ts +77 -0
- package/dist/resources/report-resource.js +171 -0
- package/dist/resources/report-resource.js.map +1 -0
- package/dist/resources/resource-object.d.ts +108 -0
- package/dist/resources/resource-object.js +147 -0
- package/dist/resources/resource-object.js.map +1 -0
- package/dist/resources/template-resource.d.ts +82 -0
- package/dist/resources/template-resource.js +173 -0
- package/dist/resources/template-resource.js.map +1 -0
- package/dist/resources/workflow-resource.d.ts +67 -0
- package/dist/resources/workflow-resource.js +156 -0
- package/dist/resources/workflow-resource.js.map +1 -0
- package/dist/types/queries.d.ts +142 -0
- package/dist/types/queries.js +16 -0
- package/dist/types/queries.js.map +1 -0
- package/dist/utils/card-utils.d.ts +34 -0
- package/dist/utils/card-utils.js +78 -0
- package/dist/utils/card-utils.js.map +1 -0
- package/dist/utils/clingo-fact-builder.d.ts +58 -0
- package/dist/utils/clingo-fact-builder.js +126 -0
- package/dist/utils/clingo-fact-builder.js.map +1 -0
- package/dist/utils/clingo-facts.d.ts +97 -0
- package/dist/utils/clingo-facts.js +352 -0
- package/dist/utils/clingo-facts.js.map +1 -0
- package/dist/utils/clingo-parser.d.ts +59 -0
- package/dist/utils/clingo-parser.js +403 -0
- package/dist/utils/clingo-parser.js.map +1 -0
- package/dist/utils/clingo-program-builder.d.ts +39 -0
- package/dist/utils/clingo-program-builder.js +57 -0
- package/dist/utils/clingo-program-builder.js.map +1 -0
- package/dist/utils/common-utils.d.ts +24 -0
- package/dist/utils/common-utils.js +47 -0
- package/dist/utils/common-utils.js.map +1 -0
- package/dist/utils/constants.d.ts +18 -0
- package/dist/utils/constants.js +27 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/csv.d.ts +18 -0
- package/dist/utils/csv.js +45 -0
- package/dist/utils/csv.js.map +1 -0
- package/dist/utils/file-utils.d.ts +69 -0
- package/dist/utils/file-utils.js +158 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/dist/utils/json.d.ts +61 -0
- package/dist/utils/json.js +108 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/lexorank.d.ts +59 -0
- package/dist/utils/lexorank.js +159 -0
- package/dist/utils/lexorank.js.map +1 -0
- package/dist/utils/log-utils.d.ts +40 -0
- package/dist/utils/log-utils.js +109 -0
- package/dist/utils/log-utils.js.map +1 -0
- package/dist/utils/random.d.ts +19 -0
- package/dist/utils/random.js +34 -0
- package/dist/utils/random.js.map +1 -0
- package/dist/utils/resource-utils.d.ts +45 -0
- package/dist/utils/resource-utils.js +137 -0
- package/dist/utils/resource-utils.js.map +1 -0
- package/dist/utils/sanitize-svg.d.ts +18 -0
- package/dist/utils/sanitize-svg.js +38 -0
- package/dist/utils/sanitize-svg.js.map +1 -0
- package/dist/utils/user-preferences.d.ts +64 -0
- package/dist/utils/user-preferences.js +106 -0
- package/dist/utils/user-preferences.js.map +1 -0
- package/dist/utils/validate.d.ts +26 -0
- package/dist/utils/validate.js +53 -0
- package/dist/utils/validate.js.map +1 -0
- package/dist/utils/value-utils.d.ts +58 -0
- package/dist/utils/value-utils.js +181 -0
- package/dist/utils/value-utils.js.map +1 -0
- package/package.json +67 -0
- package/src/card-metadata-updater.ts +182 -0
- package/src/command-handler.ts +686 -0
- package/src/command-manager.ts +99 -0
- package/src/commands/calculate.ts +591 -0
- package/src/commands/create.ts +559 -0
- package/src/commands/edit.ts +123 -0
- package/src/commands/export-site.ts +356 -0
- package/src/commands/export.ts +315 -0
- package/src/commands/import.ts +169 -0
- package/src/commands/index.ts +42 -0
- package/src/commands/move.ts +451 -0
- package/src/commands/remove.ts +244 -0
- package/src/commands/rename.ts +378 -0
- package/src/commands/show.ts +442 -0
- package/src/commands/transition.ts +127 -0
- package/src/commands/update.ts +76 -0
- package/src/commands/validate.ts +962 -0
- package/src/containers/card-container.ts +378 -0
- package/src/containers/project/project-paths.ts +127 -0
- package/src/containers/project/resource-collector.ts +379 -0
- package/src/containers/project.ts +1135 -0
- package/src/containers/template.ts +573 -0
- package/src/exceptions/index.ts +29 -0
- package/src/index.ts +33 -0
- package/src/interfaces/adoc.ts +18 -0
- package/src/interfaces/macros.ts +54 -0
- package/src/interfaces/project-interfaces.ts +208 -0
- package/src/interfaces/request-status-interfaces.ts +30 -0
- package/src/interfaces/resource-interfaces.ts +179 -0
- package/src/macros/base-macro.ts +176 -0
- package/src/macros/common.ts +24 -0
- package/src/macros/createCards/index.ts +57 -0
- package/src/macros/createCards/metadata.ts +21 -0
- package/src/macros/graph/index.ts +130 -0
- package/src/macros/graph/metadata.ts +21 -0
- package/src/macros/index.ts +321 -0
- package/src/macros/report/index.ts +88 -0
- package/src/macros/report/metadata.ts +21 -0
- package/src/macros/scoreCard/index.ts +55 -0
- package/src/macros/scoreCard/metadata.ts +21 -0
- package/src/macros/task-queue.ts +79 -0
- package/src/module-manager.ts +443 -0
- package/src/permissions/action-guard.ts +77 -0
- package/src/project-settings.ts +140 -0
- package/src/resources/array-handler.ts +141 -0
- package/src/resources/card-type-resource.ts +455 -0
- package/src/resources/create-defaults.ts +216 -0
- package/src/resources/field-type-resource.ts +533 -0
- package/src/resources/file-resource.ts +433 -0
- package/src/resources/folder-resource.ts +140 -0
- package/src/resources/graph-model-resource.ts +205 -0
- package/src/resources/graph-view-resource.ts +199 -0
- package/src/resources/link-type-resource.ts +191 -0
- package/src/resources/report-resource.ts +224 -0
- package/src/resources/resource-object.ts +246 -0
- package/src/resources/template-resource.ts +210 -0
- package/src/resources/workflow-resource.ts +205 -0
- package/src/types/queries.ts +149 -0
- package/src/utils/card-utils.ts +83 -0
- package/src/utils/clingo-fact-builder.ts +167 -0
- package/src/utils/clingo-facts.ts +550 -0
- package/src/utils/clingo-parser.ts +519 -0
- package/src/utils/clingo-program-builder.ts +71 -0
- package/src/utils/common-utils.ts +54 -0
- package/src/utils/constants.ts +32 -0
- package/src/utils/csv.ts +53 -0
- package/src/utils/file-utils.ts +182 -0
- package/src/utils/json.ts +118 -0
- package/src/utils/lexorank.ts +180 -0
- package/src/utils/log-utils.ts +127 -0
- package/src/utils/random.ts +37 -0
- package/src/utils/resource-utils.ts +180 -0
- package/src/utils/sanitize-svg.ts +46 -0
- package/src/utils/user-preferences.ts +126 -0
- package/src/utils/validate.ts +66 -0
- package/src/utils/value-utils.ts +189 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { Link, TemplateConfiguration } from './resource-interfaces.js';
|
|
14
|
+
|
|
15
|
+
// Single card; either in project or in template.
|
|
16
|
+
export interface Card {
|
|
17
|
+
key: string;
|
|
18
|
+
path: string;
|
|
19
|
+
content?: string;
|
|
20
|
+
metadata?: CardMetadata;
|
|
21
|
+
parent?: string;
|
|
22
|
+
children: Card[];
|
|
23
|
+
attachments: CardAttachment[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Attachment details
|
|
27
|
+
export interface CardAttachment {
|
|
28
|
+
card: string;
|
|
29
|
+
path: string;
|
|
30
|
+
fileName: string;
|
|
31
|
+
mimeType: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// When cards are listed using 'show cards'
|
|
35
|
+
export interface CardListContainer {
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
cards: string[];
|
|
39
|
+
}
|
|
40
|
+
// Remember to add all these keys to utils/constants.ts
|
|
41
|
+
export interface PredefinedCardMetadata {
|
|
42
|
+
title: string;
|
|
43
|
+
cardType: string;
|
|
44
|
+
workflowState: string;
|
|
45
|
+
rank: string;
|
|
46
|
+
lastTransitioned?: string;
|
|
47
|
+
lastUpdated?: string;
|
|
48
|
+
templateCardKey?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// todo: do we need in the future separation between module-template-cards and local template-cards
|
|
52
|
+
export enum CardLocation {
|
|
53
|
+
all = 'all',
|
|
54
|
+
projectOnly = 'project',
|
|
55
|
+
templatesOnly = 'local',
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Card's index.json file content.
|
|
59
|
+
export interface CardMetadata extends PredefinedCardMetadata {
|
|
60
|
+
labels?: string[];
|
|
61
|
+
links: Link[];
|
|
62
|
+
[key: string]: MetadataContent;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Content in project (apart from cards) is either .schema files or cardsConfig.json.
|
|
66
|
+
type ContentType = DotSchemaContent | ProjectSettings;
|
|
67
|
+
|
|
68
|
+
// Single CSV row as read from a file.
|
|
69
|
+
export type CSVRowRaw = {
|
|
70
|
+
[key: string]: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export interface DotSchemaItem {
|
|
74
|
+
id: string;
|
|
75
|
+
version: number;
|
|
76
|
+
file?: string;
|
|
77
|
+
}
|
|
78
|
+
export type DotSchemaContent = DotSchemaItem[];
|
|
79
|
+
|
|
80
|
+
// Defines which details of a card are fetched.
|
|
81
|
+
export interface FetchCardDetails {
|
|
82
|
+
attachments?: boolean;
|
|
83
|
+
calculations?: true;
|
|
84
|
+
children?: boolean;
|
|
85
|
+
content?: boolean;
|
|
86
|
+
contentType?: FileContentType;
|
|
87
|
+
metadata?: boolean;
|
|
88
|
+
parent?: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface ProjectFetchCardDetails extends FetchCardDetails {
|
|
91
|
+
location?: CardLocation;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type FileContentType = 'adoc' | 'html';
|
|
95
|
+
|
|
96
|
+
// Metadata content type.
|
|
97
|
+
export type MetadataContent =
|
|
98
|
+
| bigint
|
|
99
|
+
| number
|
|
100
|
+
| boolean
|
|
101
|
+
| string
|
|
102
|
+
| string[]
|
|
103
|
+
| Link[]
|
|
104
|
+
| null
|
|
105
|
+
| undefined;
|
|
106
|
+
|
|
107
|
+
// Module content
|
|
108
|
+
export interface ModuleContent extends ProjectSettings {
|
|
109
|
+
path: string;
|
|
110
|
+
calculations: string[];
|
|
111
|
+
cardTypes: string[];
|
|
112
|
+
fieldTypes: string[];
|
|
113
|
+
graphModels: string[];
|
|
114
|
+
graphViews: string[];
|
|
115
|
+
linkTypes: string[];
|
|
116
|
+
reports: string[];
|
|
117
|
+
templates: string[];
|
|
118
|
+
workflows: string[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Files in project in addition to cards (.schema files and cardsConfig.json).
|
|
122
|
+
export interface ProjectFile {
|
|
123
|
+
content: ContentType;
|
|
124
|
+
path: string;
|
|
125
|
+
name: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Project metadata details. @todo - this overlaps the above; check & merge
|
|
129
|
+
export interface ProjectMetadata {
|
|
130
|
+
name: string;
|
|
131
|
+
path: string;
|
|
132
|
+
prefix: string;
|
|
133
|
+
modules: string[];
|
|
134
|
+
numberOfCards: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Project's settings (=cardsConfig.json).
|
|
138
|
+
export interface ProjectSettings {
|
|
139
|
+
cardKeyPrefix: string;
|
|
140
|
+
name: string;
|
|
141
|
+
modules: ModuleSetting[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Module configuration.
|
|
145
|
+
export interface ModuleSetting extends ModuleSettingOptions {
|
|
146
|
+
name: string;
|
|
147
|
+
location: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface ModuleSettingOptions {
|
|
151
|
+
branch?: string;
|
|
152
|
+
private?: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Resources that are possible to remove.
|
|
156
|
+
export type RemovableResourceTypes =
|
|
157
|
+
| 'attachment'
|
|
158
|
+
| 'card'
|
|
159
|
+
| 'cardType'
|
|
160
|
+
| 'fieldType'
|
|
161
|
+
| 'graphModel'
|
|
162
|
+
| 'graphView'
|
|
163
|
+
| 'link'
|
|
164
|
+
| 'linkType'
|
|
165
|
+
| 'module'
|
|
166
|
+
| 'report'
|
|
167
|
+
| 'template'
|
|
168
|
+
| 'workflow'
|
|
169
|
+
| 'label';
|
|
170
|
+
|
|
171
|
+
// Project resource, such as workflow, template or card type as file system object.
|
|
172
|
+
export interface Resource {
|
|
173
|
+
name: string;
|
|
174
|
+
path: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Resources that have own folders.
|
|
178
|
+
export type ResourceFolderType =
|
|
179
|
+
| 'calculations'
|
|
180
|
+
| 'cardTypes'
|
|
181
|
+
| 'fieldTypes'
|
|
182
|
+
| 'graphModels'
|
|
183
|
+
| 'graphViews'
|
|
184
|
+
| 'linkTypes'
|
|
185
|
+
| 'modules'
|
|
186
|
+
| 'reports'
|
|
187
|
+
| 'templates'
|
|
188
|
+
| 'workflows';
|
|
189
|
+
|
|
190
|
+
// All resource types; both singular and plural.
|
|
191
|
+
export type ResourceTypes =
|
|
192
|
+
| RemovableResourceTypes
|
|
193
|
+
| ResourceFolderType
|
|
194
|
+
| 'attachments'
|
|
195
|
+
| 'calculation'
|
|
196
|
+
| 'cards'
|
|
197
|
+
| 'label'
|
|
198
|
+
| 'labels'
|
|
199
|
+
| 'links'
|
|
200
|
+
| 'modules'
|
|
201
|
+
| 'project'
|
|
202
|
+
| 'projects';
|
|
203
|
+
|
|
204
|
+
// Re-export Template Configuration to avoid unnecessary changes to other files.
|
|
205
|
+
export { TemplateConfiguration };
|
|
206
|
+
|
|
207
|
+
// Name for a card (consists of prefix and a random 8-character base36 string; e.g. 'test_abcd1234')
|
|
208
|
+
export const CardNameRegEx = new RegExp(/^[a-z]+_[0-9a-z]+$/);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
enum httpStatusCode {
|
|
14
|
+
Info = 100,
|
|
15
|
+
OK = 200,
|
|
16
|
+
BAD = 400,
|
|
17
|
+
SERVER_ERROR = 500,
|
|
18
|
+
}
|
|
19
|
+
export interface requestStatus {
|
|
20
|
+
statusCode: httpStatusCode;
|
|
21
|
+
message?: string;
|
|
22
|
+
affectsCards?: string[];
|
|
23
|
+
payload?: object | attachmentPayload;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// todo: this should be someplace else
|
|
27
|
+
export interface attachmentPayload {
|
|
28
|
+
fileBuffer: Buffer;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { Schema } from 'jsonschema';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Each resource represents a file (or a folder in some cases) with metadata stored
|
|
17
|
+
* in JSON file. Name of the file is the name of the resource. Each resource is expected to be
|
|
18
|
+
* in a correct place in folder structure.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// Calculation does not have own metadata.
|
|
22
|
+
export type CalculationMetadata = ResourceBaseMetadata;
|
|
23
|
+
|
|
24
|
+
// Card type content.
|
|
25
|
+
export interface CardType extends ResourceBaseMetadata {
|
|
26
|
+
workflow: string;
|
|
27
|
+
customFields: CustomField[];
|
|
28
|
+
alwaysVisibleFields: string[];
|
|
29
|
+
optionallyVisibleFields: string[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Custom field
|
|
33
|
+
export interface CustomField {
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
displayName?: string;
|
|
37
|
+
isCalculated: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Supported data types.
|
|
41
|
+
export type DataType =
|
|
42
|
+
| 'boolean'
|
|
43
|
+
| 'date'
|
|
44
|
+
| 'dateTime'
|
|
45
|
+
| 'enum'
|
|
46
|
+
| 'integer'
|
|
47
|
+
| 'list'
|
|
48
|
+
| 'longText'
|
|
49
|
+
| 'number'
|
|
50
|
+
| 'person'
|
|
51
|
+
| 'shortText';
|
|
52
|
+
|
|
53
|
+
// Custom field enum value
|
|
54
|
+
export interface EnumDefinition {
|
|
55
|
+
enumValue: string;
|
|
56
|
+
enumDisplayValue?: string;
|
|
57
|
+
enumDescription?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Field type content.
|
|
61
|
+
export interface FieldType extends ResourceBaseMetadata {
|
|
62
|
+
displayName?: string;
|
|
63
|
+
fieldDescription?: string;
|
|
64
|
+
dataType: DataType;
|
|
65
|
+
enumValues?: Array<EnumDefinition>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Graph model content.
|
|
69
|
+
export interface GraphModelMetadata extends ResourceBaseMetadata {
|
|
70
|
+
category?: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
displayName: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface GraphModel extends GraphModelMetadata {
|
|
76
|
+
calculationFile: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Graph view content.
|
|
80
|
+
export interface GraphViewMetadata extends ResourceBaseMetadata {
|
|
81
|
+
category?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
displayName: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface GraphView extends GraphViewMetadata {
|
|
87
|
+
handleBarFile: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Link content.
|
|
91
|
+
export interface Link {
|
|
92
|
+
linkType: string;
|
|
93
|
+
cardKey: string;
|
|
94
|
+
linkDescription?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Link type resource.
|
|
98
|
+
export interface LinkType extends ResourceBaseMetadata {
|
|
99
|
+
outboundDisplayName: string;
|
|
100
|
+
inboundDisplayName: string;
|
|
101
|
+
sourceCardTypes: string[];
|
|
102
|
+
destinationCardTypes: string[];
|
|
103
|
+
enableLinkDescription: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Report resource.
|
|
107
|
+
export interface Report {
|
|
108
|
+
name: string;
|
|
109
|
+
metadata: ReportMetadata;
|
|
110
|
+
contentTemplate: string;
|
|
111
|
+
queryTemplate: string;
|
|
112
|
+
schema?: Schema;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Metadata for report
|
|
116
|
+
export interface ReportMetadata extends ResourceBaseMetadata {
|
|
117
|
+
displayName: string;
|
|
118
|
+
description: string;
|
|
119
|
+
category: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Base interface for all resources.
|
|
123
|
+
export interface ResourceBaseMetadata {
|
|
124
|
+
name: string;
|
|
125
|
+
usedIn?: string[];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// All resources metadata content.
|
|
129
|
+
export type ResourceContent =
|
|
130
|
+
| CardType
|
|
131
|
+
| FieldType
|
|
132
|
+
| GraphModel
|
|
133
|
+
| GraphView
|
|
134
|
+
| LinkType
|
|
135
|
+
| ReportMetadata
|
|
136
|
+
| TemplateMetadata
|
|
137
|
+
| Workflow;
|
|
138
|
+
|
|
139
|
+
// Template configuration details.
|
|
140
|
+
export interface TemplateConfiguration {
|
|
141
|
+
name: string;
|
|
142
|
+
path: string;
|
|
143
|
+
numberOfCards: number;
|
|
144
|
+
metadata: TemplateMetadata;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Template configuration content details.
|
|
148
|
+
export interface TemplateMetadata extends ResourceBaseMetadata {
|
|
149
|
+
displayName?: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
category?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Workflow's json file content.
|
|
155
|
+
export interface Workflow extends ResourceBaseMetadata {
|
|
156
|
+
states: WorkflowState[];
|
|
157
|
+
transitions: WorkflowTransition[];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Workflow state categories.
|
|
161
|
+
export enum WorkflowCategory {
|
|
162
|
+
initial = 'initial',
|
|
163
|
+
active = 'active',
|
|
164
|
+
closed = 'closed',
|
|
165
|
+
none = 'none',
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Workflow state.
|
|
169
|
+
export interface WorkflowState {
|
|
170
|
+
name: string;
|
|
171
|
+
category?: WorkflowCategory;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Workflow transition.
|
|
175
|
+
export interface WorkflowTransition {
|
|
176
|
+
name: string;
|
|
177
|
+
fromState: string[];
|
|
178
|
+
toState: string;
|
|
179
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type {
|
|
14
|
+
HandlebarsOptions,
|
|
15
|
+
MacroGenerationContext,
|
|
16
|
+
MacroMetadata,
|
|
17
|
+
MacroTaskState,
|
|
18
|
+
} from '../interfaces/macros.js';
|
|
19
|
+
import { generateRandomString } from '../utils/random.js';
|
|
20
|
+
import { handleMacroError } from './index.js';
|
|
21
|
+
import type TaskQueue from './task-queue.js';
|
|
22
|
+
|
|
23
|
+
abstract class BaseMacro {
|
|
24
|
+
private globalId: string;
|
|
25
|
+
private localCounter: number = 0;
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
protected macroMetadata: MacroMetadata,
|
|
29
|
+
private readonly tasks: TaskQueue,
|
|
30
|
+
) {
|
|
31
|
+
// Set a unique global id for each instance of the macro
|
|
32
|
+
this.globalId = `${generateRandomString(36, 10)}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected abstract handleInject(
|
|
36
|
+
context: MacroGenerationContext,
|
|
37
|
+
input: unknown,
|
|
38
|
+
): Promise<string>;
|
|
39
|
+
|
|
40
|
+
protected abstract handleStatic(
|
|
41
|
+
context: MacroGenerationContext,
|
|
42
|
+
input: unknown,
|
|
43
|
+
): Promise<string>;
|
|
44
|
+
|
|
45
|
+
protected abstract handleValidate(input: unknown): void;
|
|
46
|
+
|
|
47
|
+
public get metadata() {
|
|
48
|
+
return this.macroMetadata;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private findDependencies(input: string): MacroTaskState[] {
|
|
52
|
+
// Define a regex pattern to identify dependencies in the input string.
|
|
53
|
+
const dependencyPattern = /<<macro::([a-zA-Z0-9_-]+)::([0-9]+)>>/g;
|
|
54
|
+
|
|
55
|
+
const dependencies: MacroTaskState[] = [];
|
|
56
|
+
|
|
57
|
+
let match;
|
|
58
|
+
while ((match = dependencyPattern.exec(input)) !== null) {
|
|
59
|
+
const [placeholder, globalId, localId] = match;
|
|
60
|
+
|
|
61
|
+
// Retrieve the task corresponding to the globalId and localId
|
|
62
|
+
const task = this.tasks.find(globalId, parseInt(localId, 10));
|
|
63
|
+
|
|
64
|
+
if (task) {
|
|
65
|
+
dependencies.push(task);
|
|
66
|
+
} else {
|
|
67
|
+
console.warn(
|
|
68
|
+
`Dependency not found for placeholder: ${placeholder} (globalId: ${globalId}, localId: ${localId})`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return dependencies;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private generatePlaceholder() {
|
|
77
|
+
const localId = this.localCounter++;
|
|
78
|
+
return {
|
|
79
|
+
localId,
|
|
80
|
+
placeholder: `<<macro::${this.globalId}::${localId}>>`,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Function responsible for starting the promise and storing it along with its localId.
|
|
86
|
+
*/
|
|
87
|
+
public invokeMacro = (
|
|
88
|
+
context: MacroGenerationContext,
|
|
89
|
+
options: HandlebarsOptions,
|
|
90
|
+
) => {
|
|
91
|
+
// Create a unique localId for each invocation
|
|
92
|
+
const { placeholder, localId } = this.generatePlaceholder();
|
|
93
|
+
|
|
94
|
+
const rawInput = options.fn(this);
|
|
95
|
+
let input = '{' + rawInput + '}';
|
|
96
|
+
|
|
97
|
+
if (context.mode === 'validate') {
|
|
98
|
+
try {
|
|
99
|
+
this.handleValidate(JSON.parse(input));
|
|
100
|
+
} catch (error) {
|
|
101
|
+
if (error instanceof Error) {
|
|
102
|
+
const errorMessage = `From card '${context.cardKey}' a macro validation error:\n\n${error.message}.\n\nCard content:\n ${input}`;
|
|
103
|
+
throw new Error(errorMessage);
|
|
104
|
+
}
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Extract dependencies
|
|
111
|
+
const dependencies = this.findDependencies(rawInput);
|
|
112
|
+
|
|
113
|
+
// Create a promise to resolve dependencies, execute the macro, and handle the results
|
|
114
|
+
const promise = Promise.all(dependencies.map((dep) => dep.promise))
|
|
115
|
+
.then(() => {
|
|
116
|
+
for (const dependency of dependencies) {
|
|
117
|
+
input = input.replace(
|
|
118
|
+
dependency.placeholder,
|
|
119
|
+
dependency.promiseResult || '',
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
let parsed;
|
|
123
|
+
try {
|
|
124
|
+
parsed = JSON.parse(input);
|
|
125
|
+
} catch {
|
|
126
|
+
return 'Invalid JSON';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Select the function to execute based on context mode
|
|
130
|
+
const functionToCall =
|
|
131
|
+
context.mode === 'inject' ? this.handleInject : this.handleStatic;
|
|
132
|
+
|
|
133
|
+
// Execute the function and handle its result
|
|
134
|
+
return functionToCall(context, parsed);
|
|
135
|
+
})
|
|
136
|
+
.then((result) => {
|
|
137
|
+
const task = this.tasks.find(this.globalId, localId);
|
|
138
|
+
if (task) {
|
|
139
|
+
task.promiseResult = result;
|
|
140
|
+
} else {
|
|
141
|
+
console.error(
|
|
142
|
+
`Task not found after execution: macro ${this.metadata.name}, local id ${localId}.`,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
.catch((err) => {
|
|
147
|
+
const task = this.tasks.find(this.globalId, localId);
|
|
148
|
+
if (task) {
|
|
149
|
+
task.promiseResult = handleMacroError(
|
|
150
|
+
err,
|
|
151
|
+
this.metadata.name,
|
|
152
|
+
context,
|
|
153
|
+
);
|
|
154
|
+
} else {
|
|
155
|
+
console.error(
|
|
156
|
+
`Error handling task for macro ${this.metadata.name}, local id ${localId}:`,
|
|
157
|
+
err,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
// Store the task
|
|
163
|
+
this.tasks.push({
|
|
164
|
+
globalId: this.globalId,
|
|
165
|
+
localId,
|
|
166
|
+
promise,
|
|
167
|
+
placeholder,
|
|
168
|
+
promiseResult: null,
|
|
169
|
+
macro: this.macroMetadata.name,
|
|
170
|
+
});
|
|
171
|
+
// Return the placeholder
|
|
172
|
+
return placeholder;
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export default BaseMacro;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// important that this file imports only the metadata
|
|
14
|
+
import createCards from './createCards/metadata.js';
|
|
15
|
+
import graph from './graph/metadata.js';
|
|
16
|
+
import report from './report/metadata.js';
|
|
17
|
+
import scoreCard from './scoreCard/metadata.js';
|
|
18
|
+
|
|
19
|
+
export const macroMetadata = {
|
|
20
|
+
createCards,
|
|
21
|
+
graph,
|
|
22
|
+
report,
|
|
23
|
+
scoreCard,
|
|
24
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { MacroOptions } from '../index.js';
|
|
14
|
+
import { createHtmlPlaceholder, validateMacroContent } from '../index.js';
|
|
15
|
+
|
|
16
|
+
import type { MacroGenerationContext } from '../../interfaces/macros.js';
|
|
17
|
+
import macroMetadata from './metadata.js';
|
|
18
|
+
import BaseMacro from '../base-macro.js';
|
|
19
|
+
import type TaskQueue from '../task-queue.js';
|
|
20
|
+
|
|
21
|
+
export interface CreateCardsOptions extends MacroOptions {
|
|
22
|
+
buttonLabel: string;
|
|
23
|
+
template: string;
|
|
24
|
+
cardKey?: string;
|
|
25
|
+
link?: {
|
|
26
|
+
linkType: string;
|
|
27
|
+
direction: string;
|
|
28
|
+
cardKey: string;
|
|
29
|
+
};
|
|
30
|
+
[key: string]: string | undefined | { [key: string]: string | undefined };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class CreateCardsMacro extends BaseMacro {
|
|
34
|
+
constructor(tasksQueue: TaskQueue) {
|
|
35
|
+
super(macroMetadata, tasksQueue);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
handleValidate = (input: unknown) => {
|
|
39
|
+
this.validate(input);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
async handleStatic() {
|
|
43
|
+
// Buttons aren't supported in static mode
|
|
44
|
+
return '';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
handleInject = async (_: MacroGenerationContext, input: unknown) => {
|
|
48
|
+
const options = this.validate(input);
|
|
49
|
+
return createHtmlPlaceholder(this.metadata, options);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
private validate(input: unknown): CreateCardsOptions {
|
|
53
|
+
return validateMacroContent<CreateCardsOptions>(this.metadata, input);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default CreateCardsMacro;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Cyberismo
|
|
3
|
+
Copyright © Cyberismo Ltd and contributors 2024
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
6
|
+
|
|
7
|
+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
8
|
+
|
|
9
|
+
You should have received a copy of the GNU Affero General Public
|
|
10
|
+
License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { MacroMetadata } from '../../interfaces/macros.js';
|
|
14
|
+
|
|
15
|
+
const macroMetadata: MacroMetadata = {
|
|
16
|
+
name: 'createCards',
|
|
17
|
+
tagName: 'create-cards',
|
|
18
|
+
schema: 'createCardsMacroSchema',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default macroMetadata;
|