@cyberismo/data-handler 0.0.13 → 0.0.15
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 +1 -3
- package/dist/card-metadata-updater.js.map +1 -1
- package/dist/command-handler.js +13 -17
- package/dist/command-handler.js.map +1 -1
- package/dist/command-manager.d.ts +1 -1
- package/dist/command-manager.js +4 -3
- package/dist/command-manager.js.map +1 -1
- package/dist/commands/create.d.ts +3 -3
- package/dist/commands/create.js +20 -81
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/edit.d.ts +12 -25
- package/dist/commands/edit.js +25 -74
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/export.js +4 -17
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/fetch.js +2 -1
- package/dist/commands/fetch.js.map +1 -1
- package/dist/commands/import.js +3 -5
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/move.d.ts +1 -2
- package/dist/commands/move.js +108 -146
- package/dist/commands/move.js.map +1 -1
- package/dist/commands/remove.js +15 -49
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/rename.d.ts +1 -0
- package/dist/commands/rename.js +13 -7
- package/dist/commands/rename.js.map +1 -1
- package/dist/commands/show.d.ts +7 -25
- package/dist/commands/show.js +39 -113
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/transition.js +27 -30
- package/dist/commands/transition.js.map +1 -1
- package/dist/commands/update.d.ts +5 -3
- package/dist/commands/update.js +19 -5
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.d.ts +3 -3
- package/dist/commands/validate.js +20 -27
- 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 +6 -0
- package/dist/containers/project/calculation-engine.js +36 -29
- 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/resource-collector.d.ts +24 -1
- package/dist/containers/project/resource-collector.js +8 -1
- package/dist/containers/project/resource-collector.js.map +1 -1
- package/dist/containers/project.d.ts +119 -84
- package/dist/containers/project.js +423 -253
- package/dist/containers/project.js.map +1 -1
- package/dist/containers/template.d.ts +15 -31
- package/dist/containers/template.js +97 -104
- 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 +12 -5
- package/dist/interfaces/folder-content-interfaces.js +5 -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 +16 -10
- package/dist/interfaces/project-interfaces.js +10 -8
- package/dist/interfaces/project-interfaces.js.map +1 -1
- package/dist/interfaces/resource-interfaces.d.ts +21 -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 +2 -2
- 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/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.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.js +4 -4
- package/dist/module-manager.js.map +1 -1
- package/dist/project-settings.js.map +1 -1
- package/dist/resources/calculation-resource.d.ts +43 -0
- package/dist/resources/calculation-resource.js +75 -0
- package/dist/resources/calculation-resource.js.map +1 -0
- package/dist/resources/card-type-resource.d.ts +4 -21
- package/dist/resources/card-type-resource.js +13 -44
- package/dist/resources/card-type-resource.js.map +1 -1
- package/dist/resources/create-defaults.d.ts +13 -6
- package/dist/resources/create-defaults.js +19 -5
- package/dist/resources/create-defaults.js.map +1 -1
- package/dist/resources/field-type-resource.d.ts +4 -21
- package/dist/resources/field-type-resource.js +14 -38
- package/dist/resources/field-type-resource.js.map +1 -1
- package/dist/resources/file-resource.d.ts +12 -29
- package/dist/resources/file-resource.js +19 -287
- package/dist/resources/file-resource.js.map +1 -1
- package/dist/resources/folder-resource.d.ts +32 -51
- package/dist/resources/folder-resource.js +68 -96
- package/dist/resources/folder-resource.js.map +1 -1
- package/dist/resources/graph-model-resource.d.ts +5 -33
- package/dist/resources/graph-model-resource.js +8 -61
- package/dist/resources/graph-model-resource.js.map +1 -1
- package/dist/resources/graph-view-resource.d.ts +5 -28
- package/dist/resources/graph-view-resource.js +6 -45
- package/dist/resources/graph-view-resource.js.map +1 -1
- package/dist/resources/link-type-resource.d.ts +4 -21
- package/dist/resources/link-type-resource.js +6 -31
- package/dist/resources/link-type-resource.js.map +1 -1
- package/dist/resources/report-resource.d.ts +5 -17
- package/dist/resources/report-resource.js +6 -44
- package/dist/resources/report-resource.js.map +1 -1
- package/dist/resources/resource-object.d.ts +58 -23
- package/dist/resources/resource-object.js +307 -26
- package/dist/resources/resource-object.js.map +1 -1
- package/dist/resources/template-resource.d.ts +4 -15
- package/dist/resources/template-resource.js +10 -25
- package/dist/resources/template-resource.js.map +1 -1
- package/dist/resources/workflow-resource.d.ts +4 -23
- package/dist/resources/workflow-resource.js +12 -38
- 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-facts.js +11 -3
- 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 +5 -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/error-utils.d.ts +34 -0
- package/dist/utils/error-utils.js +56 -0
- package/dist/utils/error-utils.js.map +1 -0
- package/dist/utils/log-utils.d.ts +0 -27
- package/dist/utils/log-utils.js +0 -58
- package/dist/utils/log-utils.js.map +1 -1
- package/dist/utils/user-preferences.js +6 -3
- package/dist/utils/user-preferences.js.map +1 -1
- package/package.json +5 -5
- package/src/card-metadata-updater.ts +3 -5
- package/src/command-handler.ts +14 -19
- package/src/command-manager.ts +4 -3
- package/src/commands/create.ts +28 -112
- package/src/commands/edit.ts +27 -118
- package/src/commands/export.ts +8 -29
- package/src/commands/fetch.ts +2 -1
- package/src/commands/import.ts +4 -6
- package/src/commands/move.ts +144 -179
- package/src/commands/remove.ts +12 -54
- package/src/commands/rename.ts +22 -7
- package/src/commands/show.ts +51 -156
- package/src/commands/transition.ts +30 -33
- package/src/commands/update.ts +27 -9
- package/src/commands/validate.ts +22 -37
- package/src/containers/card-container.ts +200 -360
- package/src/containers/project/calculation-engine.ts +43 -33
- package/src/containers/project/card-cache.ts +497 -0
- package/src/containers/project/resource-collector.ts +9 -1
- package/src/containers/project.ts +533 -328
- package/src/containers/template.ts +109 -127
- package/src/index.ts +1 -0
- package/src/interfaces/folder-content-interfaces.ts +23 -5
- package/src/interfaces/macros.ts +2 -0
- package/src/interfaces/project-interfaces.ts +19 -10
- package/src/interfaces/resource-interfaces.ts +22 -24
- package/src/macros/createCards/index.ts +1 -12
- package/src/macros/createCards/types.ts +46 -0
- package/src/macros/graph/index.ts +3 -7
- 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/percentage/index.ts +1 -7
- package/src/macros/percentage/types.ts +32 -0
- package/src/macros/report/index.ts +1 -4
- 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 +5 -5
- package/src/project-settings.ts +1 -1
- package/src/resources/calculation-resource.ts +101 -0
- package/src/resources/card-type-resource.ts +24 -59
- package/src/resources/create-defaults.ts +21 -5
- package/src/resources/field-type-resource.ts +22 -51
- package/src/resources/file-resource.ts +27 -403
- package/src/resources/folder-resource.ts +99 -125
- package/src/resources/graph-model-resource.ts +17 -74
- package/src/resources/graph-view-resource.ts +14 -54
- package/src/resources/link-type-resource.ts +13 -40
- package/src/resources/report-resource.ts +17 -57
- package/src/resources/resource-object.ts +454 -39
- package/src/resources/template-resource.ts +16 -29
- package/src/resources/workflow-resource.ts +26 -50
- package/src/utils/card-utils.ts +217 -31
- package/src/utils/clingo-facts.ts +13 -3
- package/src/utils/clingo-parser.ts +1 -1
- package/src/utils/constants.ts +7 -0
- package/src/utils/csv.ts +1 -1
- package/src/utils/error-utils.ts +62 -0
- package/src/utils/log-utils.ts +0 -68
- package/src/utils/user-preferences.ts +7 -3
|
@@ -19,6 +19,7 @@ import { ProjectPaths } from './project/project-paths.js';
|
|
|
19
19
|
import { type ResourceName } from '../utils/resource-utils.js';
|
|
20
20
|
import { ResourcesFrom } from './project/resource-collector.js';
|
|
21
21
|
import type { Template } from './template.js';
|
|
22
|
+
import { CalculationResource } from '../resources/calculation-resource.js';
|
|
22
23
|
import { CardTypeResource } from '../resources/card-type-resource.js';
|
|
23
24
|
import { FieldTypeResource } from '../resources/field-type-resource.js';
|
|
24
25
|
import { GraphModelResource } from '../resources/graph-model-resource.js';
|
|
@@ -34,27 +35,58 @@ export { ResourcesFrom };
|
|
|
34
35
|
export declare class Project extends CardContainer {
|
|
35
36
|
private watchResourceChanges?;
|
|
36
37
|
calculationEngine: CalculationEngine;
|
|
37
|
-
private
|
|
38
|
+
private createdResources;
|
|
39
|
+
private logger;
|
|
38
40
|
private projectPaths;
|
|
41
|
+
private resources;
|
|
42
|
+
private resourceWatcher;
|
|
39
43
|
private settings;
|
|
40
44
|
private validator;
|
|
41
|
-
private resourceWatcher;
|
|
42
|
-
private createdResources;
|
|
43
45
|
constructor(path: string, watchResourceChanges?: boolean | undefined);
|
|
44
|
-
private
|
|
46
|
+
private changeParent;
|
|
45
47
|
private findModule;
|
|
48
|
+
private handleAttachmentChange;
|
|
49
|
+
private parentFromPath;
|
|
50
|
+
private removeCachedChildren;
|
|
51
|
+
private replaceCacheValue;
|
|
46
52
|
private resourcesOfType;
|
|
53
|
+
private updateCachedChildren;
|
|
54
|
+
/**
|
|
55
|
+
* Populate template cards into the card cache.
|
|
56
|
+
*/
|
|
57
|
+
protected populateTemplateCards(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Populate both the project cards, and all template cards into card cache.
|
|
60
|
+
*/
|
|
61
|
+
protected populateCardsCache(): Promise<void>;
|
|
47
62
|
/**
|
|
48
63
|
* Add a given 'resource' to the local resource arrays.
|
|
49
64
|
* @param resource Resource to add.
|
|
50
65
|
* @param data JSON data for the resource.
|
|
51
66
|
*/
|
|
52
67
|
addResource(resource: Resource, data: JSON): void;
|
|
68
|
+
/**
|
|
69
|
+
* Returns all template cards from the project. This includes all module templates' cards.
|
|
70
|
+
* @returns all the template cards from the project
|
|
71
|
+
*/
|
|
72
|
+
allTemplateCards(): Card[];
|
|
53
73
|
/**
|
|
54
74
|
* Returns an array of all the attachments in the project card's (excluding ones in templates).
|
|
55
75
|
* @returns all attachments in the project.
|
|
56
76
|
*/
|
|
57
|
-
attachments():
|
|
77
|
+
attachments(): CardAttachment[];
|
|
78
|
+
/**
|
|
79
|
+
* Returns attachments from cards at a specific path using the card cache.
|
|
80
|
+
* This method allows templates to access attachments from the shared cache.
|
|
81
|
+
* @param path The path to get attachments from
|
|
82
|
+
* @returns Array of attachments from cards at the specified path
|
|
83
|
+
*/
|
|
84
|
+
attachmentsByPath(path: string): CardAttachment[];
|
|
85
|
+
/**
|
|
86
|
+
* Returns all the attachments in the template cards.
|
|
87
|
+
* @returns all the attachments in the template cards.
|
|
88
|
+
*/
|
|
89
|
+
attachmentsFromTemplates(): Promise<CardAttachment[]>;
|
|
58
90
|
/**
|
|
59
91
|
* Returns an array of all the calculation files (*.lp) in the project.
|
|
60
92
|
* @param from Defines where resources are collected from.
|
|
@@ -62,52 +94,64 @@ export declare class Project extends CardContainer {
|
|
|
62
94
|
*/
|
|
63
95
|
calculations(from?: ResourcesFrom): Promise<Resource[]>;
|
|
64
96
|
/**
|
|
65
|
-
* Returns path to card's attachment folder.
|
|
97
|
+
* Returns path to a card's attachment folder.
|
|
66
98
|
* @param cardKey card key
|
|
67
|
-
* @returns path to card's attachment folder.
|
|
68
|
-
* @throws if card path cannot be found
|
|
99
|
+
* @returns path to a card's attachment folder.
|
|
69
100
|
*/
|
|
70
|
-
cardAttachmentFolder(cardKey: string):
|
|
101
|
+
cardAttachmentFolder(cardKey: string): string;
|
|
71
102
|
/**
|
|
72
|
-
*
|
|
73
|
-
* @param cardKey card
|
|
74
|
-
* @param
|
|
75
|
-
* @
|
|
103
|
+
* Creates an attachment for a card.
|
|
104
|
+
* @param cardKey The card to add attachment to
|
|
105
|
+
* @param attachmentName The name for the attachment file
|
|
106
|
+
* @param attachmentData The attachment data (file path or buffer)
|
|
107
|
+
* @throws If trying to add attachment to module card, or if attachment is not found
|
|
76
108
|
*/
|
|
77
|
-
|
|
109
|
+
createCardAttachment(cardKey: string, attachmentName: string, attachmentData: string | Buffer): Promise<void>;
|
|
78
110
|
/**
|
|
79
|
-
*
|
|
111
|
+
* Removes an attachment from a card.
|
|
112
|
+
* @param cardKey The card to remove attachment from
|
|
113
|
+
* @param fileName The name of the attachment file to remove
|
|
114
|
+
* @throws if trying to remove module card attachment, or the attachment was not found.
|
|
115
|
+
*/
|
|
116
|
+
removeCardAttachment(cardKey: string, fileName: string): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Returns path to a card's folder.
|
|
80
119
|
* @param cardKey card key
|
|
81
|
-
* @returns path to card's folder.
|
|
120
|
+
* @returns path to a card's folder.
|
|
82
121
|
*/
|
|
83
122
|
cardFolder(cardKey: string): Promise<string>;
|
|
84
123
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* @
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
* @param
|
|
101
|
-
* @param details Which details to include in the cards; by default only "content" and "metadata" are included.
|
|
124
|
+
* Fetches full Card data for given card keys
|
|
125
|
+
* @param cardIds array of card keys to fetch
|
|
126
|
+
* @returns Card data to the given card keys
|
|
127
|
+
*/
|
|
128
|
+
cardKeysToCards(cardIds: string[]): Card[];
|
|
129
|
+
/**
|
|
130
|
+
* Accessor for cards cache.
|
|
131
|
+
* Used by template container (it needs to access project's cache, not their own instance).
|
|
132
|
+
* @note Should not be used directly (other than Template).
|
|
133
|
+
*/
|
|
134
|
+
get cardsCache(): import("./project/card-cache.js").CardCache;
|
|
135
|
+
/**
|
|
136
|
+
* Returns an array of all the cards in the project.
|
|
137
|
+
* @note These are project cards only, by default (unless path dictates otherwise).
|
|
138
|
+
* @param path Path from which to fetch the cards. Generally it is best to fetch from Project root, e.g. Project.cardRootFolder
|
|
139
|
+
* @param details Which details to include in the cards; by default all details are included.
|
|
102
140
|
* @returns all cards from the given path in the project.
|
|
103
141
|
*/
|
|
104
|
-
cards(path?: string, details?: FetchCardDetails):
|
|
142
|
+
cards(path?: string, details?: FetchCardDetails): Card[];
|
|
105
143
|
/**
|
|
106
144
|
* Returns an array of all the card types in the project.
|
|
107
145
|
* @param from Defines where resources are collected from.
|
|
108
146
|
* @returns array of all card types in the project.
|
|
109
147
|
*/
|
|
110
148
|
cardTypes(from?: ResourcesFrom): Promise<Resource[]>;
|
|
149
|
+
/**
|
|
150
|
+
* Returns children of a given card; as Card array
|
|
151
|
+
* @param card Parent card to fetch children from
|
|
152
|
+
* @returns children of a given card; as Card array
|
|
153
|
+
*/
|
|
154
|
+
childrenCards(card: Card): Card[];
|
|
111
155
|
/**
|
|
112
156
|
* Updates all local resources.
|
|
113
157
|
*/
|
|
@@ -115,7 +159,7 @@ export declare class Project extends CardContainer {
|
|
|
115
159
|
/**
|
|
116
160
|
* Updates all imported module resources.
|
|
117
161
|
*/
|
|
118
|
-
collectModuleResources():
|
|
162
|
+
collectModuleResources(): void;
|
|
119
163
|
/**
|
|
120
164
|
* Returns project configuration.
|
|
121
165
|
* @returns project configuration.
|
|
@@ -149,7 +193,7 @@ export declare class Project extends CardContainer {
|
|
|
149
193
|
* @param details Defines which card details are included in the return values.
|
|
150
194
|
* @returns specific card details, or undefined if card is not part of the project.
|
|
151
195
|
*/
|
|
152
|
-
|
|
196
|
+
findCard(cardToFind: string, details?: ProjectFetchCardDetails): Card;
|
|
153
197
|
/**
|
|
154
198
|
* Returns an array of all the graph models in the project.
|
|
155
199
|
* @param from Defines where resources are collected from.
|
|
@@ -171,36 +215,30 @@ export declare class Project extends CardContainer {
|
|
|
171
215
|
* When cards are removed.
|
|
172
216
|
* @param deletedCard Card that is to be removed.
|
|
173
217
|
*/
|
|
174
|
-
|
|
218
|
+
handleCardDeleted(deletedCard: Card): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* When card is moved.
|
|
221
|
+
* @param movedCard Card that moved
|
|
222
|
+
* @param newParentCard New parent for the 'movedCard'
|
|
223
|
+
* @param oldParentCard Previous parent of the 'movedCard'
|
|
224
|
+
*/
|
|
225
|
+
handleCardMoved(movedCard: Card, newParentCard?: Card, oldParentCard?: Card): Promise<void>;
|
|
175
226
|
/**
|
|
176
227
|
* When new cards are added.
|
|
177
228
|
* @param cards Added cards.
|
|
178
229
|
*/
|
|
179
230
|
handleNewCards(cards: Card[]): Promise<void>;
|
|
180
|
-
/**
|
|
181
|
-
* Checks if a given card is part of this project.
|
|
182
|
-
* @param cardKey card to check.
|
|
183
|
-
* @returns true if a given card is found from project, false otherwise.
|
|
184
|
-
*/
|
|
185
|
-
hasCard(cardKey: string): boolean;
|
|
186
231
|
/**
|
|
187
232
|
* Adds a module from project.
|
|
188
|
-
* @param module
|
|
233
|
+
* @param module Module to add
|
|
189
234
|
*/
|
|
190
235
|
importModule(module: ModuleSetting): Promise<void>;
|
|
191
236
|
/**
|
|
192
|
-
* Checks if given path is a project.
|
|
237
|
+
* Checks if a given path is a project.
|
|
193
238
|
* @param path Path to a project
|
|
194
239
|
* @returns true, if in the given path there is a project; false otherwise
|
|
195
240
|
*/
|
|
196
241
|
static isCreated(path: string): boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Returns whether card is a template card or not
|
|
199
|
-
* @param cardKey card to check.
|
|
200
|
-
* @todo: This is only used from 'remove'. Could it use the static checker?
|
|
201
|
-
* @returns true, if card is template card; false otherwise
|
|
202
|
-
*/
|
|
203
|
-
isTemplateCard(cardKey: string): Promise<boolean>;
|
|
204
242
|
/**
|
|
205
243
|
* Returns an array of all the link types in the project.
|
|
206
244
|
* @param from Defines where resources are collected from.
|
|
@@ -211,7 +249,7 @@ export declare class Project extends CardContainer {
|
|
|
211
249
|
* Returns an array of cards in the project, in the templates or both.
|
|
212
250
|
* Cards don't have content and nor metadata.
|
|
213
251
|
* @param cardsFrom Where to return cards from (project, templates, or both)
|
|
214
|
-
* @returns all cards in the project.
|
|
252
|
+
* @returns all cards in the project per container.
|
|
215
253
|
*/
|
|
216
254
|
listCards(cardsFrom?: CardLocation): Promise<CardListContainer[]>;
|
|
217
255
|
/**
|
|
@@ -224,7 +262,7 @@ export declare class Project extends CardContainer {
|
|
|
224
262
|
/**
|
|
225
263
|
* Returns details of a certain module.
|
|
226
264
|
* @param moduleName Name of the module.
|
|
227
|
-
* @returns module details, or undefined if
|
|
265
|
+
* @returns module details, or undefined if module cannot be found.
|
|
228
266
|
*/
|
|
229
267
|
module(moduleName: string): Promise<ModuleContent | undefined>;
|
|
230
268
|
/**
|
|
@@ -254,11 +292,9 @@ export declare class Project extends CardContainer {
|
|
|
254
292
|
*/
|
|
255
293
|
get paths(): ProjectPaths;
|
|
256
294
|
/**
|
|
257
|
-
*
|
|
258
|
-
* @param cardKey card to check path for.
|
|
259
|
-
* @returns path to a given card.
|
|
295
|
+
* Populates the card cache, if it has not been populated.
|
|
260
296
|
*/
|
|
261
|
-
|
|
297
|
+
populateCaches(): Promise<void>;
|
|
262
298
|
/**
|
|
263
299
|
* Returns project name.
|
|
264
300
|
*/
|
|
@@ -274,6 +310,16 @@ export declare class Project extends CardContainer {
|
|
|
274
310
|
* Make it use cached value that is only changed when module is removed/imported.
|
|
275
311
|
*/
|
|
276
312
|
projectPrefixes(): Promise<string[]>;
|
|
313
|
+
/**
|
|
314
|
+
* Removes a module from the project
|
|
315
|
+
* @param module Module (name) to remove.
|
|
316
|
+
*/
|
|
317
|
+
removeModule(moduleName: string): Promise<void>;
|
|
318
|
+
/**
|
|
319
|
+
* Removes a resource from Project.
|
|
320
|
+
* @param resource Resource to remove.
|
|
321
|
+
*/
|
|
322
|
+
removeResource(resource: Resource): void;
|
|
277
323
|
/**
|
|
278
324
|
* Array of reports in the project.
|
|
279
325
|
* @param from Defines where resources are collected from.
|
|
@@ -286,17 +332,12 @@ export declare class Project extends CardContainer {
|
|
|
286
332
|
* @returns handlebar files from reports.
|
|
287
333
|
*/
|
|
288
334
|
reportHandlerBarFiles(from?: ResourcesFrom): Promise<string[]>;
|
|
289
|
-
/**
|
|
290
|
-
* Removes a resource from Project.
|
|
291
|
-
* @param resource Resource to remove.
|
|
292
|
-
*/
|
|
293
|
-
removeResource(resource: Resource): void;
|
|
294
335
|
/**
|
|
295
336
|
* Returns metadata from a given resource
|
|
296
337
|
* @param name Name of a resource
|
|
297
338
|
* @returns Metadata from the resource.
|
|
298
339
|
*/
|
|
299
|
-
resource<Type>(name: string):
|
|
340
|
+
resource<Type>(name: string): Type | undefined;
|
|
300
341
|
/**
|
|
301
342
|
* Returns resource cache.
|
|
302
343
|
*/
|
|
@@ -317,7 +358,7 @@ export declare class Project extends CardContainer {
|
|
|
317
358
|
* @throws if called with unsupported resource type.
|
|
318
359
|
* @returns Created resource.
|
|
319
360
|
*/
|
|
320
|
-
static resourceObject(project: Project, name: ResourceName): CardTypeResource | FieldTypeResource | GraphModelResource | GraphViewResource | LinkTypeResource | ReportResource | TemplateResource | WorkflowResource;
|
|
361
|
+
static resourceObject(project: Project, name: ResourceName): CalculationResource | CardTypeResource | FieldTypeResource | GraphModelResource | GraphViewResource | LinkTypeResource | ReportResource | TemplateResource | WorkflowResource;
|
|
321
362
|
/**
|
|
322
363
|
* Shows details of a project.
|
|
323
364
|
* @returns details of a project.
|
|
@@ -327,20 +368,13 @@ export declare class Project extends CardContainer {
|
|
|
327
368
|
* Show cards of a project.
|
|
328
369
|
* @returns an array of all project cards in the project.
|
|
329
370
|
*/
|
|
330
|
-
showProjectCards():
|
|
331
|
-
/**
|
|
332
|
-
* Returns all template cards from the project. This includes all module templates' cards.
|
|
333
|
-
* @param cardDetails which details to fetch. Optional.
|
|
334
|
-
* @returns all the template cards from the project
|
|
335
|
-
*/
|
|
336
|
-
allTemplateCards(cardDetails?: FetchCardDetails): Promise<Card[]>;
|
|
371
|
+
showProjectCards(): Card[];
|
|
337
372
|
/**
|
|
338
373
|
* Returns cards from single template.
|
|
339
|
-
* @param templateName Name of the template
|
|
340
|
-
* @param cardDetails Card information
|
|
374
|
+
* @param templateName Name of the template (supports both full names like 'decision/templates/decision' and short names like 'decision')
|
|
341
375
|
* @returns List of cards from template.
|
|
342
376
|
*/
|
|
343
|
-
templateCards(templateName: string
|
|
377
|
+
templateCards(templateName: string): Card[];
|
|
344
378
|
/**
|
|
345
379
|
* Array of templates in the project.
|
|
346
380
|
* @param from Defines where resources are collected from.
|
|
@@ -348,8 +382,8 @@ export declare class Project extends CardContainer {
|
|
|
348
382
|
*/
|
|
349
383
|
templates(from?: ResourcesFrom): Promise<Resource[]>;
|
|
350
384
|
/**
|
|
351
|
-
* Update card content.
|
|
352
|
-
* @param cardKey card
|
|
385
|
+
* Update a card's content.
|
|
386
|
+
* @param cardKey card key to update.
|
|
353
387
|
* @param content changed content
|
|
354
388
|
*/
|
|
355
389
|
updateCardContent(cardKey: string, content: string): Promise<void>;
|
|
@@ -361,17 +395,18 @@ export declare class Project extends CardContainer {
|
|
|
361
395
|
*/
|
|
362
396
|
updateCardMetadataKey(cardKey: string, changedKey: string, newValue: MetadataContent): Promise<void>;
|
|
363
397
|
/**
|
|
364
|
-
* Updates card
|
|
398
|
+
* Updates the entire card in the card cache and handles any path/parent changes.
|
|
399
|
+
* Also persists changes to content and metadata files.
|
|
400
|
+
* @param card The card with updated information (path, parent, metadata, etc.)
|
|
401
|
+
*/
|
|
402
|
+
updateCard(card: Card): Promise<void>;
|
|
403
|
+
/**
|
|
404
|
+
* Updates a card's metadata.
|
|
365
405
|
* @param card affected card
|
|
366
406
|
* @param changedMetadata changed content for the card
|
|
367
407
|
*/
|
|
368
408
|
updateCardMetadata(card: Card, changedMetadata: CardMetadata): Promise<void>;
|
|
369
|
-
|
|
370
|
-
* Validates that card's data is valid.
|
|
371
|
-
* @param card Card to validate.
|
|
372
|
-
* @returns validation errors, if any
|
|
373
|
-
*/
|
|
374
|
-
validateCard(card: Card): Promise<string>;
|
|
409
|
+
private validateCard;
|
|
375
410
|
/**
|
|
376
411
|
* Array of workflows in the project.
|
|
377
412
|
* @param from Defines where resources are collected from.
|