@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
|
@@ -13,110 +13,113 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { CardContainer } from './card-container.js';
|
|
15
15
|
import { CalculationEngine } from './project/calculation-engine.js';
|
|
16
|
-
import { type Card, type CardAttachment, CardLocation, type CardListContainer, type CardMetadata, type FetchCardDetails, type MetadataContent, type ModuleContent, type ModuleSetting, type ProjectFetchCardDetails, type ProjectMetadata
|
|
16
|
+
import { type Card, type CardAttachment, CardLocation, type CardListContainer, type CardMetadata, type FetchCardDetails, type MetadataContent, type ModuleContent, type ModuleSetting, type ProjectFetchCardDetails, type ProjectMetadata } from '../interfaces/project-interfaces.js';
|
|
17
17
|
import { ProjectConfiguration } from '../project-settings.js';
|
|
18
18
|
import { ProjectPaths } from './project/project-paths.js';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
19
|
+
import { ResourcesFrom } from './project/resource-cache.js';
|
|
20
|
+
import { ResourceHandler } from './project/resource-handler.js';
|
|
21
21
|
import type { Template } from './template.js';
|
|
22
|
-
import { CalculationResource } from '../resources/calculation-resource.js';
|
|
23
|
-
import { CardTypeResource } from '../resources/card-type-resource.js';
|
|
24
|
-
import { FieldTypeResource } from '../resources/field-type-resource.js';
|
|
25
|
-
import { GraphModelResource } from '../resources/graph-model-resource.js';
|
|
26
|
-
import { GraphViewResource } from '../resources/graph-view-resource.js';
|
|
27
|
-
import { LinkTypeResource } from '../resources/link-type-resource.js';
|
|
28
|
-
import { ReportResource } from '../resources/report-resource.js';
|
|
29
|
-
import { TemplateResource } from '../resources/template-resource.js';
|
|
30
|
-
import { WorkflowResource } from '../resources/workflow-resource.js';
|
|
31
22
|
export { ResourcesFrom };
|
|
23
|
+
/**
|
|
24
|
+
* Options for Project initialization.
|
|
25
|
+
* autoSave - If project configuration changes are saved automatically. Default true.
|
|
26
|
+
* watchResourceChanges - If project refresh automatically to filesystem changes. Default false.
|
|
27
|
+
*/
|
|
28
|
+
export interface ProjectOptions {
|
|
29
|
+
autoSave?: boolean;
|
|
30
|
+
watchResourceChanges?: boolean;
|
|
31
|
+
}
|
|
32
32
|
/**
|
|
33
33
|
* Represents project folder.
|
|
34
34
|
*/
|
|
35
35
|
export declare class Project extends CardContainer {
|
|
36
|
-
private
|
|
36
|
+
private options;
|
|
37
37
|
calculationEngine: CalculationEngine;
|
|
38
|
-
private
|
|
38
|
+
private logger;
|
|
39
39
|
private projectPaths;
|
|
40
|
+
private resourceHandler;
|
|
41
|
+
private resourceWatcher;
|
|
40
42
|
private settings;
|
|
41
43
|
private validator;
|
|
42
|
-
|
|
43
|
-
private
|
|
44
|
-
constructor(path: string, watchResourceChanges?: boolean | undefined);
|
|
45
|
-
private replaceCacheValue;
|
|
44
|
+
constructor(path: string, options?: ProjectOptions);
|
|
45
|
+
private changeParent;
|
|
46
46
|
private findModule;
|
|
47
|
-
private
|
|
47
|
+
private handleAttachmentChange;
|
|
48
|
+
private parentFromPath;
|
|
49
|
+
private removeCachedChildren;
|
|
50
|
+
private updateCachedChildren;
|
|
51
|
+
private validateCard;
|
|
52
|
+
/**
|
|
53
|
+
* Populate template cards into the card cache.
|
|
54
|
+
*/
|
|
55
|
+
protected populateTemplateCards(): Promise<void>;
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @param resource Resource to add.
|
|
51
|
-
* @param data JSON data for the resource.
|
|
57
|
+
* Populate both the project cards, and all template cards into card cache.
|
|
52
58
|
*/
|
|
53
|
-
|
|
59
|
+
protected populateCardsCache(): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Returns all template cards from the project. This includes all module templates' cards.
|
|
62
|
+
* @returns all the template cards from the project
|
|
63
|
+
*/
|
|
64
|
+
allTemplateCards(): Card[];
|
|
54
65
|
/**
|
|
55
66
|
* Returns an array of all the attachments in the project card's (excluding ones in templates).
|
|
56
67
|
* @returns all attachments in the project.
|
|
57
68
|
*/
|
|
58
|
-
attachments():
|
|
69
|
+
attachments(): CardAttachment[];
|
|
59
70
|
/**
|
|
60
|
-
* Returns
|
|
61
|
-
*
|
|
62
|
-
* @
|
|
71
|
+
* Returns attachments from cards at a specific path using the card cache.
|
|
72
|
+
* This method allows templates to access attachments from the shared cache.
|
|
73
|
+
* @param path The path to get attachments from
|
|
74
|
+
* @returns Array of attachments from cards at the specified path
|
|
63
75
|
*/
|
|
64
|
-
|
|
76
|
+
attachmentsByPath(path: string): CardAttachment[];
|
|
65
77
|
/**
|
|
66
|
-
* Returns path to card's attachment folder.
|
|
78
|
+
* Returns path to a card's attachment folder.
|
|
67
79
|
* @param cardKey card key
|
|
68
|
-
* @returns path to card's attachment folder.
|
|
69
|
-
* @throws if card path cannot be found
|
|
80
|
+
* @returns path to a card's attachment folder.
|
|
70
81
|
*/
|
|
71
|
-
cardAttachmentFolder(cardKey: string):
|
|
82
|
+
cardAttachmentFolder(cardKey: string): string;
|
|
72
83
|
/**
|
|
73
|
-
*
|
|
74
|
-
* @param cardKey card
|
|
75
|
-
* @param
|
|
76
|
-
* @
|
|
84
|
+
* Creates an attachment for a card.
|
|
85
|
+
* @param cardKey The card to add attachment to
|
|
86
|
+
* @param attachmentName The name for the attachment file
|
|
87
|
+
* @param attachmentData The attachment data (file path or buffer)
|
|
88
|
+
* @throws If trying to add attachment to module card, or if attachment is not found
|
|
77
89
|
*/
|
|
78
|
-
|
|
90
|
+
createCardAttachment(cardKey: string, attachmentName: string, attachmentData: string | Buffer): Promise<void>;
|
|
79
91
|
/**
|
|
80
|
-
* Returns path to card's folder.
|
|
92
|
+
* Returns path to a card's folder.
|
|
81
93
|
* @param cardKey card key
|
|
82
|
-
* @returns path to card's folder.
|
|
94
|
+
* @returns path to a card's folder.
|
|
83
95
|
*/
|
|
84
96
|
cardFolder(cardKey: string): Promise<string>;
|
|
85
97
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* @
|
|
89
|
-
* @returns card path logical parts
|
|
90
|
-
* @throws when called with wrong path, or wrong card owner
|
|
91
|
-
* todo: if prefix would be parameter; this could be static, or util method
|
|
92
|
-
*/
|
|
93
|
-
cardPathParts(cardPath: string): {
|
|
94
|
-
cardKey: string | undefined;
|
|
95
|
-
parents: (string | undefined)[];
|
|
96
|
-
prefix: string;
|
|
97
|
-
template: string;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Returns an array of all the cards in the project. Cards have content and metadata
|
|
101
|
-
* @param path Optional path from which to fetch the cards. Generally it is best to fetch from Project root, e.g. Project.cardRootFolder
|
|
102
|
-
* @param details Which details to include in the cards; by default only "content" and "metadata" are included.
|
|
103
|
-
* @returns all cards from the given path in the project.
|
|
98
|
+
* Fetches full Card data for given card keys
|
|
99
|
+
* @param cardIds array of card keys to fetch
|
|
100
|
+
* @returns Card data to the given card keys
|
|
104
101
|
*/
|
|
105
|
-
|
|
102
|
+
cardKeysToCards(cardIds: string[]): Card[];
|
|
106
103
|
/**
|
|
107
|
-
* Returns an array of all the
|
|
108
|
-
* @
|
|
109
|
-
* @
|
|
104
|
+
* Returns an array of all the cards in the project.
|
|
105
|
+
* @note These are project cards only, by default (unless path dictates otherwise).
|
|
106
|
+
* @param path Path from which to fetch the cards. Generally it is best to fetch from Project root, e.g. Project.cardRootFolder
|
|
107
|
+
* @param details Which details to include in the cards; by default all details are included.
|
|
108
|
+
* @returns all cards from the given path in the project.
|
|
110
109
|
*/
|
|
111
|
-
|
|
110
|
+
cards(path?: string, details?: FetchCardDetails): Card[];
|
|
112
111
|
/**
|
|
113
|
-
*
|
|
112
|
+
* Accessor for cards cache.
|
|
113
|
+
* Used by template container (it needs to access project's cache, not their own instance).
|
|
114
|
+
* @note Should not be used directly (other than Template).
|
|
114
115
|
*/
|
|
115
|
-
|
|
116
|
+
get cardsCache(): import("./project/card-cache.js").CardCache;
|
|
116
117
|
/**
|
|
117
|
-
*
|
|
118
|
+
* Returns children of a given card; as Card array
|
|
119
|
+
* @param card Parent card to fetch children from
|
|
120
|
+
* @returns children of a given card; as Card array
|
|
118
121
|
*/
|
|
119
|
-
|
|
122
|
+
childrenCards(card: Card): Card[];
|
|
120
123
|
/**
|
|
121
124
|
* Returns project configuration.
|
|
122
125
|
* @returns project configuration.
|
|
@@ -132,37 +135,19 @@ export declare class Project extends CardContainer {
|
|
|
132
135
|
* Cleanups project when it is being closed.
|
|
133
136
|
*/
|
|
134
137
|
dispose(): void;
|
|
135
|
-
/**
|
|
136
|
-
* Returns an array of all the field types in the project.
|
|
137
|
-
* @param from Defines where resources are collected from.
|
|
138
|
-
* @returns array of all field types in the project.
|
|
139
|
-
*/
|
|
140
|
-
fieldTypes(from?: ResourcesFrom): Promise<Resource[]>;
|
|
141
|
-
/**
|
|
142
|
-
* Finds root of a project
|
|
143
|
-
* @param path Path where to start looking for the project root.
|
|
144
|
-
* @returns path to a project root, or empty string.
|
|
145
|
-
*/
|
|
146
|
-
static findProjectRoot(path: string): Promise<string>;
|
|
147
138
|
/**
|
|
148
139
|
* Returns specific card.
|
|
149
140
|
* @param cardToFind Card key to find
|
|
150
141
|
* @param details Defines which card details are included in the return values.
|
|
151
142
|
* @returns specific card details, or undefined if card is not part of the project.
|
|
152
143
|
*/
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Returns an array of all the graph models in the project.
|
|
156
|
-
* @param from Defines where resources are collected from.
|
|
157
|
-
* @returns array of all the graph models in the project.
|
|
158
|
-
*/
|
|
159
|
-
graphModels(from?: ResourcesFrom): Promise<Resource[]>;
|
|
144
|
+
findCard(cardToFind: string, details?: ProjectFetchCardDetails): Card;
|
|
160
145
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @param
|
|
163
|
-
* @returns
|
|
146
|
+
* Finds root of a project
|
|
147
|
+
* @param path Path where to start looking for the project root.
|
|
148
|
+
* @returns path to a project root, or empty string.
|
|
164
149
|
*/
|
|
165
|
-
|
|
150
|
+
static findProjectRoot(path: string): Promise<string>;
|
|
166
151
|
/**
|
|
167
152
|
* When card changes.
|
|
168
153
|
* @param changedCard Card that was changed.
|
|
@@ -172,47 +157,35 @@ export declare class Project extends CardContainer {
|
|
|
172
157
|
* When cards are removed.
|
|
173
158
|
* @param deletedCard Card that is to be removed.
|
|
174
159
|
*/
|
|
175
|
-
|
|
160
|
+
handleCardDeleted(deletedCard: Card): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* When card is moved.
|
|
163
|
+
* @param movedCard Card that moved
|
|
164
|
+
* @param newParentCard New parent for the 'movedCard'
|
|
165
|
+
* @param oldParentCard Previous parent of the 'movedCard'
|
|
166
|
+
*/
|
|
167
|
+
handleCardMoved(movedCard: Card, newParentCard?: Card, oldParentCard?: Card): Promise<void>;
|
|
176
168
|
/**
|
|
177
169
|
* When new cards are added.
|
|
178
170
|
* @param cards Added cards.
|
|
179
171
|
*/
|
|
180
172
|
handleNewCards(cards: Card[]): Promise<void>;
|
|
181
|
-
/**
|
|
182
|
-
* Checks if a given card is part of this project.
|
|
183
|
-
* @param cardKey card to check.
|
|
184
|
-
* @returns true if a given card is found from project, false otherwise.
|
|
185
|
-
*/
|
|
186
|
-
hasCard(cardKey: string): boolean;
|
|
187
173
|
/**
|
|
188
174
|
* Adds a module from project.
|
|
189
|
-
* @param module
|
|
175
|
+
* @param module Module to add
|
|
190
176
|
*/
|
|
191
177
|
importModule(module: ModuleSetting): Promise<void>;
|
|
192
178
|
/**
|
|
193
|
-
* Checks if given path is a project.
|
|
179
|
+
* Checks if a given path is a project.
|
|
194
180
|
* @param path Path to a project
|
|
195
181
|
* @returns true, if in the given path there is a project; false otherwise
|
|
196
182
|
*/
|
|
197
183
|
static isCreated(path: string): boolean;
|
|
198
|
-
/**
|
|
199
|
-
* Returns whether card is a template card or not
|
|
200
|
-
* @param cardKey card to check.
|
|
201
|
-
* @todo: This is only used from 'remove'. Could it use the static checker?
|
|
202
|
-
* @returns true, if card is template card; false otherwise
|
|
203
|
-
*/
|
|
204
|
-
isTemplateCard(cardKey: string): Promise<boolean>;
|
|
205
|
-
/**
|
|
206
|
-
* Returns an array of all the link types in the project.
|
|
207
|
-
* @param from Defines where resources are collected from.
|
|
208
|
-
* @returns array of all link types in the project.
|
|
209
|
-
*/
|
|
210
|
-
linkTypes(from?: ResourcesFrom): Promise<Resource[]>;
|
|
211
184
|
/**
|
|
212
185
|
* Returns an array of cards in the project, in the templates or both.
|
|
213
186
|
* Cards don't have content and nor metadata.
|
|
214
187
|
* @param cardsFrom Where to return cards from (project, templates, or both)
|
|
215
|
-
* @returns all cards in the project.
|
|
188
|
+
* @returns all cards in the project per container.
|
|
216
189
|
*/
|
|
217
190
|
listCards(cardsFrom?: CardLocation): Promise<CardListContainer[]>;
|
|
218
191
|
/**
|
|
@@ -225,14 +198,9 @@ export declare class Project extends CardContainer {
|
|
|
225
198
|
/**
|
|
226
199
|
* Returns details of a certain module.
|
|
227
200
|
* @param moduleName Name of the module.
|
|
228
|
-
* @returns module details, or undefined if
|
|
201
|
+
* @returns module details, or undefined if module cannot be found.
|
|
229
202
|
*/
|
|
230
203
|
module(moduleName: string): Promise<ModuleContent | undefined>;
|
|
231
|
-
/**
|
|
232
|
-
* Returns list of modules in the project.
|
|
233
|
-
* @returns list of modules in the project.
|
|
234
|
-
*/
|
|
235
|
-
modules(): Promise<Resource[]>;
|
|
236
204
|
/**
|
|
237
205
|
* Returns a new unique card key with project prefix (e.g. test_x649it4x).
|
|
238
206
|
* Random part of string will be always 8 characters in base-36 (0-9a-z)
|
|
@@ -255,11 +223,9 @@ export declare class Project extends CardContainer {
|
|
|
255
223
|
*/
|
|
256
224
|
get paths(): ProjectPaths;
|
|
257
225
|
/**
|
|
258
|
-
*
|
|
259
|
-
* @param cardKey card to check path for.
|
|
260
|
-
* @returns path to a given card.
|
|
226
|
+
* Populates the card cache, if it has not been populated.
|
|
261
227
|
*/
|
|
262
|
-
|
|
228
|
+
populateCaches(): Promise<void>;
|
|
263
229
|
/**
|
|
264
230
|
* Returns project name.
|
|
265
231
|
*/
|
|
@@ -269,56 +235,28 @@ export declare class Project extends CardContainer {
|
|
|
269
235
|
*/
|
|
270
236
|
get projectPrefix(): string;
|
|
271
237
|
/**
|
|
272
|
-
*
|
|
238
|
+
* Returns all prefixes used in the project (project's own plus all from imported modules).
|
|
273
239
|
* @returns all prefixes used in the project.
|
|
274
|
-
* @todo - move the module prefix fetch to resource-collector.
|
|
275
|
-
* Make it use cached value that is only changed when module is removed/imported.
|
|
276
|
-
*/
|
|
277
|
-
projectPrefixes(): Promise<string[]>;
|
|
278
|
-
/**
|
|
279
|
-
* Array of reports in the project.
|
|
280
|
-
* @param from Defines where resources are collected from.
|
|
281
|
-
* @returns array of all reports in the project.
|
|
282
|
-
*/
|
|
283
|
-
reports(from?: ResourcesFrom): Promise<Resource[]>;
|
|
284
|
-
/**
|
|
285
|
-
* Returns handlebar files from reports.
|
|
286
|
-
* @param from Defines where report handlebar files are collected from.
|
|
287
|
-
* @returns handlebar files from reports.
|
|
288
|
-
*/
|
|
289
|
-
reportHandlerBarFiles(from?: ResourcesFrom): Promise<string[]>;
|
|
290
|
-
/**
|
|
291
|
-
* Removes a resource from Project.
|
|
292
|
-
* @param resource Resource to remove.
|
|
293
240
|
*/
|
|
294
|
-
|
|
241
|
+
projectPrefixes(): string[];
|
|
295
242
|
/**
|
|
296
|
-
*
|
|
297
|
-
* @param
|
|
298
|
-
* @
|
|
243
|
+
* Removes an attachment from a card.
|
|
244
|
+
* @param cardKey The card to remove attachment from
|
|
245
|
+
* @param fileName The name of the attachment file to remove
|
|
246
|
+
* @throws if trying to remove module card attachment, or the attachment was not found.
|
|
299
247
|
*/
|
|
300
|
-
|
|
248
|
+
removeCardAttachment(cardKey: string, fileName: string): Promise<void>;
|
|
301
249
|
/**
|
|
302
|
-
*
|
|
250
|
+
* Removes a module from the project cache and configuration.
|
|
251
|
+
* @note that ModuleManager removes the actual files.
|
|
252
|
+
* @param moduleName Module name to remove.
|
|
303
253
|
*/
|
|
304
|
-
|
|
254
|
+
removeModule(moduleName: string): Promise<void>;
|
|
305
255
|
/**
|
|
306
|
-
*
|
|
307
|
-
* @
|
|
308
|
-
* @param name Valid name of resource.
|
|
309
|
-
* @returns boolean, true if resource exists; false otherwise.
|
|
256
|
+
* Accessor for resource handler.
|
|
257
|
+
* @returns Resource handler instance.
|
|
310
258
|
*/
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Instantiates resource object from project with a resource name.
|
|
314
|
-
* @note that this is memory based object only.
|
|
315
|
-
* To manipulate the resource (create files, delete files etc), use the resource object's API.
|
|
316
|
-
* @param project Project from which resources are created from.
|
|
317
|
-
* @param name Resource name
|
|
318
|
-
* @throws if called with unsupported resource type.
|
|
319
|
-
* @returns Created resource.
|
|
320
|
-
*/
|
|
321
|
-
static resourceObject(project: Project, name: ResourceName): CalculationResource | CardTypeResource | FieldTypeResource | GraphModelResource | GraphViewResource | LinkTypeResource | ReportResource | TemplateResource | WorkflowResource;
|
|
259
|
+
get resources(): ResourceHandler;
|
|
322
260
|
/**
|
|
323
261
|
* Shows details of a project.
|
|
324
262
|
* @returns details of a project.
|
|
@@ -328,29 +266,16 @@ export declare class Project extends CardContainer {
|
|
|
328
266
|
* Show cards of a project.
|
|
329
267
|
* @returns an array of all project cards in the project.
|
|
330
268
|
*/
|
|
331
|
-
showProjectCards():
|
|
332
|
-
/**
|
|
333
|
-
* Returns all template cards from the project. This includes all module templates' cards.
|
|
334
|
-
* @param cardDetails which details to fetch. Optional.
|
|
335
|
-
* @returns all the template cards from the project
|
|
336
|
-
*/
|
|
337
|
-
allTemplateCards(cardDetails?: FetchCardDetails): Promise<Card[]>;
|
|
269
|
+
showProjectCards(): Card[];
|
|
338
270
|
/**
|
|
339
271
|
* Returns cards from single template.
|
|
340
|
-
* @param templateName Name of the template
|
|
341
|
-
* @param cardDetails Card information
|
|
272
|
+
* @param templateName Name of the template (supports both full names like 'decision/templates/decision' and short names like 'decision')
|
|
342
273
|
* @returns List of cards from template.
|
|
343
274
|
*/
|
|
344
|
-
templateCards(templateName: string
|
|
345
|
-
/**
|
|
346
|
-
* Array of templates in the project.
|
|
347
|
-
* @param from Defines where resources are collected from.
|
|
348
|
-
* @returns array of all templates in the project.
|
|
349
|
-
*/
|
|
350
|
-
templates(from?: ResourcesFrom): Promise<Resource[]>;
|
|
275
|
+
templateCards(templateName: string): Card[];
|
|
351
276
|
/**
|
|
352
|
-
* Update card content.
|
|
353
|
-
* @param cardKey card
|
|
277
|
+
* Update a card's content.
|
|
278
|
+
* @param cardKey card key to update.
|
|
354
279
|
* @param content changed content
|
|
355
280
|
*/
|
|
356
281
|
updateCardContent(cardKey: string, content: string): Promise<void>;
|
|
@@ -362,21 +287,15 @@ export declare class Project extends CardContainer {
|
|
|
362
287
|
*/
|
|
363
288
|
updateCardMetadataKey(cardKey: string, changedKey: string, newValue: MetadataContent): Promise<void>;
|
|
364
289
|
/**
|
|
365
|
-
* Updates card
|
|
290
|
+
* Updates the entire card in the card cache and handles any path/parent changes.
|
|
291
|
+
* Also persists changes to content and metadata files.
|
|
292
|
+
* @param card The card with updated information (path, parent, metadata, etc.)
|
|
293
|
+
*/
|
|
294
|
+
updateCard(card: Card): Promise<void>;
|
|
295
|
+
/**
|
|
296
|
+
* Updates a card's metadata.
|
|
366
297
|
* @param card affected card
|
|
367
298
|
* @param changedMetadata changed content for the card
|
|
368
299
|
*/
|
|
369
300
|
updateCardMetadata(card: Card, changedMetadata: CardMetadata): Promise<void>;
|
|
370
|
-
/**
|
|
371
|
-
* Validates that card's data is valid.
|
|
372
|
-
* @param card Card to validate.
|
|
373
|
-
* @returns validation errors, if any
|
|
374
|
-
*/
|
|
375
|
-
validateCard(card: Card): Promise<string>;
|
|
376
|
-
/**
|
|
377
|
-
* Array of workflows in the project.
|
|
378
|
-
* @param from Defines where resources are collected from.
|
|
379
|
-
* @returns array of all workflows in the project.
|
|
380
|
-
*/
|
|
381
|
-
workflows(from?: ResourcesFrom): Promise<Resource[]>;
|
|
382
301
|
}
|