@cyberismo/data-handler 0.0.15 → 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.
Files changed (173) hide show
  1. package/dist/card-metadata-updater.js +7 -1
  2. package/dist/card-metadata-updater.js.map +1 -1
  3. package/dist/command-handler.d.ts +4 -0
  4. package/dist/command-handler.js +19 -3
  5. package/dist/command-handler.js.map +1 -1
  6. package/dist/command-manager.d.ts +24 -1
  7. package/dist/command-manager.js +27 -3
  8. package/dist/command-manager.js.map +1 -1
  9. package/dist/commands/create.d.ts +1 -1
  10. package/dist/commands/create.js +34 -36
  11. package/dist/commands/create.js.map +1 -1
  12. package/dist/commands/export.d.ts +11 -2
  13. package/dist/commands/export.js +54 -41
  14. package/dist/commands/export.js.map +1 -1
  15. package/dist/commands/import.d.ts +9 -1
  16. package/dist/commands/import.js +15 -7
  17. package/dist/commands/import.js.map +1 -1
  18. package/dist/commands/move.js +0 -1
  19. package/dist/commands/move.js.map +1 -1
  20. package/dist/commands/remove.d.ts +8 -1
  21. package/dist/commands/remove.js +8 -4
  22. package/dist/commands/remove.js.map +1 -1
  23. package/dist/commands/rename.d.ts +4 -9
  24. package/dist/commands/rename.js +32 -101
  25. package/dist/commands/rename.js.map +1 -1
  26. package/dist/commands/show.d.ts +16 -10
  27. package/dist/commands/show.js +71 -55
  28. package/dist/commands/show.js.map +1 -1
  29. package/dist/commands/transition.d.ts +9 -2
  30. package/dist/commands/transition.js +25 -17
  31. package/dist/commands/transition.js.map +1 -1
  32. package/dist/commands/update.d.ts +16 -12
  33. package/dist/commands/update.js +19 -17
  34. package/dist/commands/update.js.map +1 -1
  35. package/dist/commands/validate.d.ts +17 -9
  36. package/dist/commands/validate.js +96 -35
  37. package/dist/commands/validate.js.map +1 -1
  38. package/dist/containers/project/calculation-engine.d.ts +7 -4
  39. package/dist/containers/project/calculation-engine.js +61 -66
  40. package/dist/containers/project/calculation-engine.js.map +1 -1
  41. package/dist/containers/project/project-paths.d.ts +5 -4
  42. package/dist/containers/project/project-paths.js +16 -12
  43. package/dist/containers/project/project-paths.js.map +1 -1
  44. package/dist/containers/project/resource-cache.d.ts +169 -0
  45. package/dist/containers/project/resource-cache.js +507 -0
  46. package/dist/containers/project/resource-cache.js.map +1 -0
  47. package/dist/containers/project/resource-handler.d.ts +129 -0
  48. package/dist/containers/project/resource-handler.js +206 -0
  49. package/dist/containers/project/resource-handler.js.map +1 -0
  50. package/dist/containers/project.d.ts +38 -153
  51. package/dist/containers/project.js +129 -405
  52. package/dist/containers/project.js.map +1 -1
  53. package/dist/containers/template.d.ts +8 -2
  54. package/dist/containers/template.js +20 -15
  55. package/dist/containers/template.js.map +1 -1
  56. package/dist/interfaces/folder-content-interfaces.d.ts +5 -3
  57. package/dist/interfaces/folder-content-interfaces.js +3 -3
  58. package/dist/interfaces/folder-content-interfaces.js.map +1 -1
  59. package/dist/interfaces/project-interfaces.d.ts +2 -4
  60. package/dist/interfaces/project-interfaces.js.map +1 -1
  61. package/dist/interfaces/resource-interfaces.d.ts +14 -1
  62. package/dist/interfaces/resource-interfaces.js.map +1 -1
  63. package/dist/macros/graph/index.js +12 -26
  64. package/dist/macros/graph/index.js.map +1 -1
  65. package/dist/macros/index.d.ts +1 -1
  66. package/dist/macros/index.js +2 -2
  67. package/dist/macros/index.js.map +1 -1
  68. package/dist/macros/report/index.js +3 -6
  69. package/dist/macros/report/index.js.map +1 -1
  70. package/dist/module-manager.d.ts +16 -3
  71. package/dist/module-manager.js +51 -19
  72. package/dist/module-manager.js.map +1 -1
  73. package/dist/project-settings.d.ts +16 -3
  74. package/dist/project-settings.js +79 -14
  75. package/dist/project-settings.js.map +1 -1
  76. package/dist/resources/calculation-resource.d.ts +4 -3
  77. package/dist/resources/calculation-resource.js +11 -5
  78. package/dist/resources/calculation-resource.js.map +1 -1
  79. package/dist/resources/card-type-resource.d.ts +6 -1
  80. package/dist/resources/card-type-resource.js +34 -23
  81. package/dist/resources/card-type-resource.js.map +1 -1
  82. package/dist/resources/create-defaults.d.ts +3 -2
  83. package/dist/resources/create-defaults.js +3 -2
  84. package/dist/resources/create-defaults.js.map +1 -1
  85. package/dist/resources/field-type-resource.d.ts +4 -1
  86. package/dist/resources/field-type-resource.js +22 -23
  87. package/dist/resources/field-type-resource.js.map +1 -1
  88. package/dist/resources/file-resource.d.ts +5 -9
  89. package/dist/resources/file-resource.js +6 -11
  90. package/dist/resources/file-resource.js.map +1 -1
  91. package/dist/resources/folder-resource.d.ts +29 -32
  92. package/dist/resources/folder-resource.js +59 -78
  93. package/dist/resources/folder-resource.js.map +1 -1
  94. package/dist/resources/graph-model-resource.d.ts +4 -1
  95. package/dist/resources/graph-model-resource.js +11 -4
  96. package/dist/resources/graph-model-resource.js.map +1 -1
  97. package/dist/resources/graph-view-resource.d.ts +5 -2
  98. package/dist/resources/graph-view-resource.js +7 -3
  99. package/dist/resources/graph-view-resource.js.map +1 -1
  100. package/dist/resources/link-type-resource.d.ts +5 -2
  101. package/dist/resources/link-type-resource.js +5 -2
  102. package/dist/resources/link-type-resource.js.map +1 -1
  103. package/dist/resources/report-resource.d.ts +6 -7
  104. package/dist/resources/report-resource.js +14 -23
  105. package/dist/resources/report-resource.js.map +1 -1
  106. package/dist/resources/resource-object.d.ts +93 -8
  107. package/dist/resources/resource-object.js +162 -110
  108. package/dist/resources/resource-object.js.map +1 -1
  109. package/dist/resources/template-resource.d.ts +7 -3
  110. package/dist/resources/template-resource.js +10 -3
  111. package/dist/resources/template-resource.js.map +1 -1
  112. package/dist/resources/workflow-resource.d.ts +5 -2
  113. package/dist/resources/workflow-resource.js +18 -22
  114. package/dist/resources/workflow-resource.js.map +1 -1
  115. package/dist/utils/card-utils.d.ts +2 -2
  116. package/dist/utils/card-utils.js +1 -1
  117. package/dist/utils/clingo-fact-builder.d.ts +25 -14
  118. package/dist/utils/clingo-fact-builder.js +27 -5
  119. package/dist/utils/clingo-fact-builder.js.map +1 -1
  120. package/dist/utils/clingo-facts.js +3 -4
  121. package/dist/utils/clingo-facts.js.map +1 -1
  122. package/dist/utils/resource-utils.d.ts +1 -0
  123. package/dist/utils/resource-utils.js +2 -1
  124. package/dist/utils/resource-utils.js.map +1 -1
  125. package/package.json +8 -8
  126. package/src/card-metadata-updater.ts +6 -2
  127. package/src/command-handler.ts +24 -5
  128. package/src/command-manager.ts +29 -17
  129. package/src/commands/create.ts +43 -78
  130. package/src/commands/export.ts +63 -52
  131. package/src/commands/import.ts +24 -14
  132. package/src/commands/move.ts +0 -1
  133. package/src/commands/remove.ts +11 -7
  134. package/src/commands/rename.ts +43 -149
  135. package/src/commands/show.ts +113 -78
  136. package/src/commands/transition.ts +26 -28
  137. package/src/commands/update.ts +25 -22
  138. package/src/commands/validate.ts +108 -67
  139. package/src/containers/project/calculation-engine.ts +61 -93
  140. package/src/containers/project/project-paths.ts +21 -13
  141. package/src/containers/project/resource-cache.ts +648 -0
  142. package/src/containers/project/resource-handler.ts +265 -0
  143. package/src/containers/project.ts +178 -522
  144. package/src/containers/template.ts +24 -19
  145. package/src/interfaces/folder-content-interfaces.ts +7 -6
  146. package/src/interfaces/project-interfaces.ts +7 -6
  147. package/src/interfaces/resource-interfaces.ts +18 -3
  148. package/src/macros/graph/index.ts +26 -47
  149. package/src/macros/index.ts +2 -2
  150. package/src/macros/report/index.ts +3 -9
  151. package/src/module-manager.ts +74 -17
  152. package/src/project-settings.ts +83 -14
  153. package/src/resources/calculation-resource.ts +18 -18
  154. package/src/resources/card-type-resource.ts +50 -50
  155. package/src/resources/create-defaults.ts +3 -2
  156. package/src/resources/field-type-resource.ts +41 -55
  157. package/src/resources/file-resource.ts +10 -36
  158. package/src/resources/folder-resource.ts +69 -120
  159. package/src/resources/graph-model-resource.ts +20 -22
  160. package/src/resources/graph-view-resource.ts +15 -17
  161. package/src/resources/link-type-resource.ts +10 -13
  162. package/src/resources/report-resource.ts +21 -43
  163. package/src/resources/resource-object.ts +194 -152
  164. package/src/resources/template-resource.ts +17 -16
  165. package/src/resources/workflow-resource.ts +25 -44
  166. package/src/utils/card-utils.ts +2 -2
  167. package/src/utils/clingo-fact-builder.ts +28 -16
  168. package/src/utils/clingo-facts.ts +3 -4
  169. package/src/utils/resource-utils.ts +2 -1
  170. package/dist/containers/project/resource-collector.d.ts +0 -110
  171. package/dist/containers/project/resource-collector.js +0 -344
  172. package/dist/containers/project/resource-collector.js.map +0 -1
  173. package/src/containers/project/resource-collector.ts +0 -404
@@ -13,29 +13,24 @@
13
13
  */
14
14
 
15
15
  import type {
16
- CardType,
17
16
  UpdateKey,
18
17
  Workflow,
19
18
  WorkflowState,
20
19
  WorkflowTransition,
21
20
  } from '../interfaces/resource-interfaces.js';
22
- import { CardTypeResource } from './card-type-resource.js';
21
+ import { DefaultContent } from './create-defaults.js';
22
+ import { FileResource } from './file-resource.js';
23
+ import { resourceNameToString } from '../utils/resource-utils.js';
24
+ import { sortCards } from '../utils/card-utils.js';
25
+
26
+ import type { Card } from '../interfaces/project-interfaces.js';
23
27
  import type {
24
- Card,
25
28
  ChangeOperation,
26
29
  Operation,
27
- Project,
28
30
  RemoveOperation,
29
- ResourceName,
30
- } from './file-resource.js';
31
- import {
32
- DefaultContent,
33
- FileResource,
34
- resourceNameToString,
35
- sortCards,
36
- } from './folder-resource.js';
37
- import { ResourcesFrom } from '../containers/project.js';
38
- import { resourceName } from './file-resource.js';
31
+ } from './resource-object.js';
32
+ import type { Project } from '../containers/project.js';
33
+ import type { ResourceName } from '../utils/resource-utils.js';
39
34
 
40
35
  /**
41
36
  * Workflow resource class.
@@ -50,19 +45,11 @@ export class WorkflowResource extends FileResource<Workflow> {
50
45
 
51
46
  // Collect all cards that use this workflow.
52
47
  private async collectCardsUsingWorkflow(): Promise<Card[]> {
53
- const cardTypes = await this.project.cardTypes(ResourcesFrom.localOnly);
48
+ const cardTypes = this.project.resources.cardTypes();
54
49
  const promises: Promise<Card[]>[] = [];
55
50
  for (const cardType of cardTypes) {
56
- const object = new CardTypeResource(
57
- this.project,
58
- resourceName(cardType.name),
59
- );
60
- if (
61
- object.data &&
62
- object.data.workflow === resourceNameToString(this.resourceName)
63
- ) {
64
- // fetch all cards with card type
65
- promises.push(this.collectCards(cardType.name));
51
+ if (cardType.data?.workflow === resourceNameToString(this.resourceName)) {
52
+ promises.push(this.collectCards(cardType.data.name));
66
53
  }
67
54
  }
68
55
  return (await Promise.all(promises)).flat();
@@ -199,25 +186,19 @@ export class WorkflowResource extends FileResource<Workflow> {
199
186
 
200
187
  // Update dependant card types.
201
188
  private async updateCardTypes(oldName: string) {
202
- const cardTypes = await this.project.cardTypes(ResourcesFrom.localOnly);
189
+ const cardTypes = this.project.resources.cardTypes();
203
190
  const op = {
204
191
  name: 'change',
205
192
  target: oldName,
206
193
  to: this.content.name,
207
194
  } as ChangeOperation<string>;
208
195
  for (const cardType of cardTypes) {
209
- const object = new CardTypeResource(
210
- this.project,
211
- resourceName(cardType.name),
196
+ await cardType.update(
197
+ {
198
+ key: 'workflow',
199
+ },
200
+ op,
212
201
  );
213
- if (object.data && object.data.workflow === oldName) {
214
- await object.update(
215
- {
216
- key: 'workflow',
217
- },
218
- op,
219
- );
220
- }
221
202
  }
222
203
  }
223
204
 
@@ -366,13 +347,13 @@ export class WorkflowResource extends FileResource<Workflow> {
366
347
  public async usage(cards?: Card[]): Promise<string[]> {
367
348
  const resourceName = resourceNameToString(this.resourceName);
368
349
  const allCards = cards ?? super.cards();
369
- const cardTypes = await this.project.cardTypes(ResourcesFrom.all);
370
- const cardTypeReferences = await Promise.all(
371
- cardTypes.map(async (cardType) => {
372
- const metadata = await this.project.resource<CardType>(cardType.name);
373
- return metadata?.workflow === resourceName ? cardType.name : null;
374
- }),
375
- );
350
+ const cardTypes = this.project.resources.cardTypes();
351
+ const cardTypeReferences = [];
352
+ for (const cardType of cardTypes) {
353
+ if (cardType.data?.workflow === resourceName) {
354
+ cardTypeReferences.push(cardType.data.name);
355
+ }
356
+ }
376
357
 
377
358
  const [relevantCards, calculations] = await Promise.all([
378
359
  super.usage(allCards),
@@ -18,7 +18,7 @@ import type {
18
18
  Card,
19
19
  CardWithChildrenCards,
20
20
  } from '../interfaces/project-interfaces.js';
21
- import type { Project } from '../resources/folder-resource.js';
21
+ import type { Project } from '../containers/project.js';
22
22
 
23
23
  /**
24
24
  * Builds card hierarchy from flat card list with nested card objects.
@@ -165,7 +165,7 @@ export const findParentPath = (cardPath: string): string | null => {
165
165
  /**
166
166
  * Flattens card tree so that children are shown on same level regardless of nesting level.
167
167
  * @param array Card tree to flatten
168
- * @parent project Project to use
168
+ * @param project Project to use
169
169
  * @returns Flattened card tree.
170
170
  */
171
171
  export const flattenCardArray = (array: Card[], project: Project) => {
@@ -1,17 +1,19 @@
1
- import { INT32_MAX } from './constants.js';
2
- import { getChildLogger } from './log-utils.js';
3
-
4
1
  /**
5
- Cyberismo
6
- Copyright © Cyberismo Ltd and contributors 2024
7
-
8
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
2
+ Cyberismo
3
+ Copyright © Cyberismo Ltd and contributors 2024
4
+ This program is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU Affero General Public License version 3 as published by
6
+ the Free Software Foundation.
7
+ This program is distributed in the hope that it will be useful, but WITHOUT
8
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
+ FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
10
+ details. You should have received a copy of the GNU Affero General Public
11
+ License along with this program. If not, see <https://www.gnu.org/licenses/>.
12
+ */
9
13
 
10
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
14
+ import { INT32_MAX } from './constants.js';
15
+ import { getChildLogger } from './log-utils.js';
11
16
 
12
- You should have received a copy of the GNU Affero General Public
13
- License along with this program. If not, see <https://www.gnu.org/licenses/>.
14
- */
15
17
  export type AllowedClingoType = string | number | boolean;
16
18
 
17
19
  export type NestedBuilder = (builder: ClingoFactBuilder) => ClingoFactBuilder;
@@ -26,6 +28,8 @@ export type ClingoArgument = ClingoArgumentInternal | NestedBuilder;
26
28
  /**
27
29
  * This function takes care of encoding chars, which might produce issues in clingo
28
30
  * This should be done for user provided values
31
+ * @param value Clingo value to encode.
32
+ * @returns Encoded clingo value.
29
33
  */
30
34
  export function encodeClingoValue(value: string) {
31
35
  return value.replace(/[\n\\"]/g, (char) => {
@@ -36,6 +40,9 @@ export function encodeClingoValue(value: string) {
36
40
  });
37
41
  }
38
42
 
43
+ /**
44
+ * Clingo fact builder.
45
+ */
39
46
  export class ClingoFactBuilder {
40
47
  protected predicate: string;
41
48
  private end: string;
@@ -46,6 +53,11 @@ export class ClingoFactBuilder {
46
53
  });
47
54
  }
48
55
 
56
+ /**
57
+ * Constructs an instance of ClingoFactBuilder.
58
+ * @param predicate Predicate
59
+ * @param end End character; by default a dot ('.')
60
+ */
49
61
  constructor(predicate: string, end: string = '.') {
50
62
  this.predicate = predicate;
51
63
  this.end = end;
@@ -71,8 +83,8 @@ export class ClingoFactBuilder {
71
83
 
72
84
  /**
73
85
  * Helper for adding multiple arguments, because it's common
74
- * @param args
75
- * @returns this for chaining
86
+ * @param args Arguments array
87
+ * @returns 'this' for chaining
76
88
  */
77
89
  addArguments(...args: (ClingoArgument | null)[]): ClingoFactBuilder {
78
90
  args.forEach((arg) => this.addArgument(arg));
@@ -82,7 +94,7 @@ export class ClingoFactBuilder {
82
94
  /**
83
95
  * Adds a literal argument, which means that it will not have quotes
84
96
  * @param literal The literal argument to add
85
- * @returns this for chaining
97
+ * @returns 'this' for chaining
86
98
  */
87
99
  addLiteralArgument(literal: string): ClingoFactBuilder {
88
100
  this.arguments.push(new LiteralBuilder(literal));
@@ -91,8 +103,8 @@ export class ClingoFactBuilder {
91
103
 
92
104
  /**
93
105
  * Helper for adding multiple literal arguments, because it's common
94
- * @param literal
95
- * @returns this for chaining
106
+ * @param literals Array of literals
107
+ * @returns 'this' for chaining
96
108
  */
97
109
  addLiteralArguments(...literals: string[]): ClingoFactBuilder {
98
110
  literals.forEach((literal) => this.addLiteralArgument(literal));
@@ -243,10 +243,9 @@ export const createCardFacts = async (card: Card, project: Project) => {
243
243
 
244
244
  if (!isPredefinedField(field)) {
245
245
  // field is a custom field, find it
246
- const fieldType = await project.resource<FieldType>(field);
247
- if (!fieldType) {
248
- continue;
249
- }
246
+ const fieldType = project.resources
247
+ .byType(field, 'fieldTypes')
248
+ .show();
250
249
 
251
250
  // if it's a list, let's generate multiple values
252
251
  if (fieldType.dataType === 'list') {
@@ -88,6 +88,7 @@ export function resourceName(
88
88
  * Converts resource name to path.
89
89
  * @param project Project
90
90
  * @param resourceName Name of the resource (e.g. <prefix>/<type>/<name>)
91
+ * @param extension Extension of resource. By default '.json'.
91
92
  * @returns path to resource metadata file
92
93
  */
93
94
  export function resourceNameToPath(
@@ -204,7 +205,7 @@ export function resourceNameToString(resourceName: ResourceName): string {
204
205
  ) {
205
206
  throw new Error(`Not a valid resource name. Prefix is missing.`);
206
207
  }
207
- return resourceName.prefix && resourceName.type && resourceName.prefix
208
+ return resourceName.prefix && resourceName.type && resourceName.identifier
208
209
  ? `${resourceName.prefix}/${resourceName.type}/${resourceName.identifier}`
209
210
  : `${resourceName.identifier}`;
210
211
  }
@@ -1,110 +0,0 @@
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 type { Project } from '../project.js';
15
- import type { Resource, ResourceFolderType } from '../../interfaces/project-interfaces.js';
16
- /**
17
- * Defines where resources are collected from.
18
- * all - everywhere
19
- * importOnly - only from imported modules
20
- * localOnly - only from the project itself; excluding imported modules
21
- */
22
- export declare enum ResourcesFrom {
23
- all = "all",
24
- importedOnly = "imported",
25
- localOnly = "local"
26
- }
27
- declare class ResourceCollection {
28
- calculations: Resource[];
29
- cardTypes: Resource[];
30
- fieldTypes: Resource[];
31
- graphModels: Resource[];
32
- graphViews: Resource[];
33
- linkTypes: Resource[];
34
- reports: Resource[];
35
- templates: Resource[];
36
- workflows: Resource[];
37
- /**
38
- * Returns resource array of a give type.
39
- * @param type Resource array type to return.
40
- * @param moduleName Name of a module. If given, returns just resources from that module.
41
- * @returns resource array of a give type.
42
- */
43
- resourceArray(type: ResourceFolderType, moduleName?: string): Resource[];
44
- }
45
- /**
46
- * This class handles local and modules resources.
47
- */
48
- export declare class ResourceCollector {
49
- private project;
50
- private local;
51
- private modules;
52
- private modulesCollected;
53
- private paths;
54
- constructor(project: Project);
55
- private addResources;
56
- private addModuleResources;
57
- private addResourcesFromModules;
58
- private joinResources;
59
- private localResources;
60
- private resourcesSync;
61
- /**
62
- * Collects all local resources.
63
- */
64
- collectLocalResources(): void;
65
- /**
66
- * Collect specific resource from modules.
67
- * @param type Type of resource (e.g. 'templates').
68
- * @param moduleName Name of the module to collect resources from
69
- * @returns array of collected items.
70
- */
71
- collectResourcesFromModules(type: ResourceFolderType, moduleName?: string): Promise<string[]>;
72
- /**
73
- * Add a given 'resource' to the local resource arrays.
74
- * @param resource Resource to add.
75
- */
76
- add(resource: Resource): void;
77
- /**
78
- * Re-collects local resources.
79
- */
80
- changed(): void;
81
- /**
82
- * Re-collects imported module resources.
83
- */
84
- moduleImported(): void;
85
- /**
86
- * Getter. Provide access for owner to browse module resources.
87
- */
88
- get moduleResources(): ResourceCollection;
89
- /**
90
- * Removes a resource from Project.
91
- * @param resource Resource to remove.
92
- * @returns the modified array.
93
- */
94
- remove(resource: Resource): Resource[];
95
- /**
96
- * Checks if resource of 'type' with 'name' exists.
97
- * @param type Type of resource (e.g. 'templates').
98
- * @param name Name of the resource.
99
- * @returns true, if resource exits, false otherwise.
100
- */
101
- resourceExists(type: ResourceFolderType, name: string): Promise<boolean>;
102
- /**
103
- * Returns resources of 'type'. Returned resources are either local, or from modules or all of them.
104
- * @param type Type of resource (e.g. 'templates').
105
- * @param from Defines where resources are collected from.
106
- * @returns Array of resources.
107
- */
108
- resources(type: ResourceFolderType, from?: ResourcesFrom): Promise<Resource[]>;
109
- }
110
- export {};