@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,331 @@
|
|
|
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
|
|
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 { readdirSync } from 'node:fs';
|
|
15
|
+
import { readdir } from 'node:fs/promises';
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import { CardContainer } from '../card-container.js';
|
|
18
|
+
import { resourceName } from '../../utils/resource-utils.js';
|
|
19
|
+
import { stripExtension } from '../../utils/file-utils.js';
|
|
20
|
+
/**
|
|
21
|
+
* Defines where resources are collected from.
|
|
22
|
+
* all - everywhere
|
|
23
|
+
* importOnly - only from imported modules
|
|
24
|
+
* localOnly - only from the project itself; excluding imported modules
|
|
25
|
+
*/
|
|
26
|
+
export var ResourcesFrom;
|
|
27
|
+
(function (ResourcesFrom) {
|
|
28
|
+
ResourcesFrom["all"] = "all";
|
|
29
|
+
ResourcesFrom["importedOnly"] = "imported";
|
|
30
|
+
ResourcesFrom["localOnly"] = "local";
|
|
31
|
+
})(ResourcesFrom || (ResourcesFrom = {}));
|
|
32
|
+
// Helper class to contain collected resources.
|
|
33
|
+
class ResourceCollection {
|
|
34
|
+
calculations = [];
|
|
35
|
+
cardTypes = [];
|
|
36
|
+
fieldTypes = [];
|
|
37
|
+
graphModels = [];
|
|
38
|
+
graphViews = [];
|
|
39
|
+
linkTypes = [];
|
|
40
|
+
reports = [];
|
|
41
|
+
templates = [];
|
|
42
|
+
workflows = [];
|
|
43
|
+
/**
|
|
44
|
+
* Returns resource array of a give type.
|
|
45
|
+
* @param type Resource array type to return.
|
|
46
|
+
* @returns resource array of a give type.
|
|
47
|
+
*/
|
|
48
|
+
resourceArray(type) {
|
|
49
|
+
if (type === 'calculations')
|
|
50
|
+
return this.calculations;
|
|
51
|
+
if (type === 'cardTypes')
|
|
52
|
+
return this.cardTypes;
|
|
53
|
+
if (type === 'fieldTypes')
|
|
54
|
+
return this.fieldTypes;
|
|
55
|
+
if (type === 'graphViews')
|
|
56
|
+
return this.graphViews;
|
|
57
|
+
if (type === 'graphModels')
|
|
58
|
+
return this.graphModels;
|
|
59
|
+
if (type === 'linkTypes')
|
|
60
|
+
return this.linkTypes;
|
|
61
|
+
if (type === 'reports')
|
|
62
|
+
return this.reports;
|
|
63
|
+
if (type === 'templates')
|
|
64
|
+
return this.templates;
|
|
65
|
+
if (type === 'workflows')
|
|
66
|
+
return this.workflows;
|
|
67
|
+
throw new Error(`Unknown resource type '${type}'`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* This class handles local and modules resources.
|
|
72
|
+
*/
|
|
73
|
+
export class ResourceCollector {
|
|
74
|
+
project;
|
|
75
|
+
local = new ResourceCollection();
|
|
76
|
+
modules = new ResourceCollection();
|
|
77
|
+
modulesCollected = false;
|
|
78
|
+
paths;
|
|
79
|
+
constructor(project) {
|
|
80
|
+
this.project = project;
|
|
81
|
+
this.paths = this.project.paths;
|
|
82
|
+
}
|
|
83
|
+
// Add resources of a given type to an array.
|
|
84
|
+
async addResources(resources, requestedType) {
|
|
85
|
+
if (requestedType === 'modules') {
|
|
86
|
+
return resources.map((resource) => ({
|
|
87
|
+
name: resource.name,
|
|
88
|
+
path: resource.parentPath,
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
const isValidFile = (item) => item.isFile() &&
|
|
92
|
+
item.name !== CardContainer.schemaContentFile &&
|
|
93
|
+
item.name !== '.gitkeep';
|
|
94
|
+
const processResource = async (resource) => {
|
|
95
|
+
const resourcePath = join(this.paths.modulesFolder, resource.name, requestedType);
|
|
96
|
+
try {
|
|
97
|
+
const files = await readdir(resourcePath, { withFileTypes: true });
|
|
98
|
+
return files.filter(isValidFile).map((item) => ({
|
|
99
|
+
name: `${resource.name}/${requestedType}/${stripExtension(item.name)}`,
|
|
100
|
+
path: item.parentPath,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const results = await Promise.all(resources.map(processResource));
|
|
108
|
+
return results.flat();
|
|
109
|
+
}
|
|
110
|
+
// Collects all module resources.
|
|
111
|
+
async addModuleResources() {
|
|
112
|
+
if (!this.modulesCollected) {
|
|
113
|
+
const moduleDirectories = await readdir(this.paths.modulesFolder, {
|
|
114
|
+
withFileTypes: true,
|
|
115
|
+
});
|
|
116
|
+
const modules = moduleDirectories.filter((item) => item.isDirectory());
|
|
117
|
+
this.modules.calculations = [
|
|
118
|
+
...(await this.addResources(modules, 'calculations')),
|
|
119
|
+
];
|
|
120
|
+
this.modules.cardTypes = [
|
|
121
|
+
...(await this.addResources(modules, 'cardTypes')),
|
|
122
|
+
];
|
|
123
|
+
this.modules.fieldTypes = [
|
|
124
|
+
...(await this.addResources(modules, 'fieldTypes')),
|
|
125
|
+
];
|
|
126
|
+
this.modules.graphModels = [
|
|
127
|
+
...(await this.addResources(modules, 'graphModels')),
|
|
128
|
+
];
|
|
129
|
+
this.modules.graphViews = [
|
|
130
|
+
...(await this.addResources(modules, 'graphViews')),
|
|
131
|
+
];
|
|
132
|
+
this.modules.linkTypes = [
|
|
133
|
+
...(await this.addResources(modules, 'linkTypes')),
|
|
134
|
+
];
|
|
135
|
+
this.modules.reports = [...(await this.addResources(modules, 'reports'))];
|
|
136
|
+
this.modules.templates = [
|
|
137
|
+
...(await this.addResources(modules, 'templates')),
|
|
138
|
+
];
|
|
139
|
+
this.modules.workflows = [
|
|
140
|
+
...(await this.addResources(modules, 'workflows')),
|
|
141
|
+
];
|
|
142
|
+
this.modulesCollected = true;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Adds a resource type from all modules.
|
|
146
|
+
async addResourcesFromModules(type) {
|
|
147
|
+
try {
|
|
148
|
+
// 'modules' is a bit special; it is collected separately from actual resources.
|
|
149
|
+
if (type === 'modules') {
|
|
150
|
+
const moduleDirectories = await readdir(this.paths.modulesFolder, {
|
|
151
|
+
withFileTypes: true,
|
|
152
|
+
});
|
|
153
|
+
const modules = moduleDirectories.filter((item) => item.isDirectory());
|
|
154
|
+
return [...(await this.addResources(modules, 'modules'))];
|
|
155
|
+
}
|
|
156
|
+
await this.addModuleResources();
|
|
157
|
+
return this.modules.resourceArray(type);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return [];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
// Joins local resources and module resources together to one array.
|
|
164
|
+
joinResources(from, localCollection, moduleCollection) {
|
|
165
|
+
if (from === ResourcesFrom.localOnly) {
|
|
166
|
+
return localCollection;
|
|
167
|
+
}
|
|
168
|
+
if (from === ResourcesFrom.importedOnly) {
|
|
169
|
+
return moduleCollection;
|
|
170
|
+
}
|
|
171
|
+
return [...localCollection, ...moduleCollection];
|
|
172
|
+
}
|
|
173
|
+
// Returns local resources of a given type.
|
|
174
|
+
localResources(type) {
|
|
175
|
+
if (type === 'modules') {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
return this.local.resourceArray(type);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Collects certain kinds of resources.
|
|
183
|
+
resourcesSync(type) {
|
|
184
|
+
const resourceFolder = this.project.paths.resourcePath(type);
|
|
185
|
+
const resources = [];
|
|
186
|
+
let entries = [];
|
|
187
|
+
try {
|
|
188
|
+
entries = readdirSync(resourceFolder, { withFileTypes: true });
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
193
|
+
resources.push(...entries
|
|
194
|
+
.filter((entry) => {
|
|
195
|
+
return (entry.isFile() &&
|
|
196
|
+
entry.name !== '.gitkeep' &&
|
|
197
|
+
entry.name !== CardContainer.schemaContentFile);
|
|
198
|
+
})
|
|
199
|
+
.map((entry) => {
|
|
200
|
+
if (entry.name.endsWith('.json')) {
|
|
201
|
+
entry.name = stripExtension(entry.name);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
name: `${this.project.projectPrefix}/${type}/${entry.name}`,
|
|
205
|
+
path: entry.parentPath,
|
|
206
|
+
};
|
|
207
|
+
}));
|
|
208
|
+
return resources;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Collects all local resources.
|
|
212
|
+
*/
|
|
213
|
+
collectLocalResources() {
|
|
214
|
+
const resourceTypes = [
|
|
215
|
+
'calculations',
|
|
216
|
+
'cardTypes',
|
|
217
|
+
'fieldTypes',
|
|
218
|
+
'graphModels',
|
|
219
|
+
'graphViews',
|
|
220
|
+
'linkTypes',
|
|
221
|
+
'reports',
|
|
222
|
+
'templates',
|
|
223
|
+
'workflows',
|
|
224
|
+
];
|
|
225
|
+
resourceTypes.forEach((type) => {
|
|
226
|
+
this.local[type] = this.resourcesSync(type);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Collect specific resource from modules.
|
|
231
|
+
* @param type Type of resource (e.g. 'templates').
|
|
232
|
+
* @returns array of collected items.
|
|
233
|
+
*/
|
|
234
|
+
async collectResourcesFromModules(type) {
|
|
235
|
+
return (await this.addResourcesFromModules(type)).map((item) => stripExtension(item.name));
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Add a given 'resource' to the local resource arrays.
|
|
239
|
+
* @param resource Resource to add.
|
|
240
|
+
*/
|
|
241
|
+
add(resource) {
|
|
242
|
+
// Helper to avoid adding duplicate entries.
|
|
243
|
+
function addItem(array, item) {
|
|
244
|
+
if (!array.includes(item)) {
|
|
245
|
+
item.name = stripExtension(item.name);
|
|
246
|
+
array.push(item);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const { type } = resourceName(resource.name);
|
|
250
|
+
switch (type) {
|
|
251
|
+
case 'cardTypes':
|
|
252
|
+
addItem(this.local.cardTypes, resource);
|
|
253
|
+
break;
|
|
254
|
+
case 'fieldTypes':
|
|
255
|
+
addItem(this.local.fieldTypes, resource);
|
|
256
|
+
break;
|
|
257
|
+
case 'graphModels':
|
|
258
|
+
addItem(this.local.graphModels, resource);
|
|
259
|
+
break;
|
|
260
|
+
case 'graphViews':
|
|
261
|
+
addItem(this.local.graphViews, resource);
|
|
262
|
+
break;
|
|
263
|
+
case 'linkTypes':
|
|
264
|
+
addItem(this.local.linkTypes, resource);
|
|
265
|
+
break;
|
|
266
|
+
case 'reports':
|
|
267
|
+
addItem(this.local.reports, resource);
|
|
268
|
+
break;
|
|
269
|
+
case 'templates':
|
|
270
|
+
addItem(this.local.templates, resource);
|
|
271
|
+
break;
|
|
272
|
+
case 'workflows':
|
|
273
|
+
addItem(this.local.workflows, resource);
|
|
274
|
+
break;
|
|
275
|
+
default: {
|
|
276
|
+
throw new Error(`Resource type '${type}' not handled in 'addResource'`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Re-collects local resources.
|
|
282
|
+
*/
|
|
283
|
+
changed() {
|
|
284
|
+
this.collectLocalResources();
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Re-collects imported module resources.
|
|
288
|
+
*/
|
|
289
|
+
async moduleImported() {
|
|
290
|
+
this.modulesCollected = false;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Removes a resource from Project.
|
|
294
|
+
* @param resource Resource to remove.
|
|
295
|
+
* @returns the modified array.
|
|
296
|
+
*/
|
|
297
|
+
remove(resource) {
|
|
298
|
+
const { type } = resourceName(resource.name);
|
|
299
|
+
const arrayToModify = this.local
|
|
300
|
+
.resourceArray(type)
|
|
301
|
+
.filter((item) => item.name !== resource.name);
|
|
302
|
+
this.collectLocalResources();
|
|
303
|
+
return arrayToModify;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Checks if resource of 'type' with 'name' exists.
|
|
307
|
+
* @param type Type of resource (e.g. 'templates').
|
|
308
|
+
* @param name Name of the resource.
|
|
309
|
+
* @returns true, if resource exits, false otherwise.
|
|
310
|
+
*/
|
|
311
|
+
async resourceExists(type, name) {
|
|
312
|
+
if (!name) {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
return (await this.resources(type)).some((item) => item.name === name);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Returns resources of 'type'. Returned resources are either local, or from modules or all of them.
|
|
319
|
+
* @param type Type of resource (e.g. 'templates').
|
|
320
|
+
* @param from Defines where resources are collected from.
|
|
321
|
+
* @returns Array of resources.
|
|
322
|
+
*/
|
|
323
|
+
async resources(type, from = ResourcesFrom.all) {
|
|
324
|
+
const moduleResources = from !== ResourcesFrom.localOnly
|
|
325
|
+
? await this.addResourcesFromModules(type)
|
|
326
|
+
: [];
|
|
327
|
+
const localResourcesOfType = this.localResources(type);
|
|
328
|
+
return this.joinResources(from, localResourcesOfType, moduleResources);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=resource-collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-collector.js","sourceRoot":"","sources":["../../../src/containers/project/resource-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAEF,OAAO,EAAe,WAAW,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAOrD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,0CAAyB,CAAA;IACzB,oCAAmB,CAAA;AACrB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,+CAA+C;AAC/C,MAAM,kBAAkB;IACf,YAAY,GAAe,EAAE,CAAC;IAC9B,SAAS,GAAe,EAAE,CAAC;IAC3B,UAA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