@cyberismo/data-handler 0.0.8 → 0.0.10

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 (258) hide show
  1. package/dist/command-handler.d.ts +11 -2
  2. package/dist/command-handler.js +61 -18
  3. package/dist/command-handler.js.map +1 -1
  4. package/dist/command-manager.js +8 -8
  5. package/dist/command-manager.js.map +1 -1
  6. package/dist/commands/calculate.d.ts +7 -44
  7. package/dist/commands/calculate.js +8 -389
  8. package/dist/commands/calculate.js.map +1 -1
  9. package/dist/commands/create.d.ts +6 -3
  10. package/dist/commands/create.js +27 -5
  11. package/dist/commands/create.js.map +1 -1
  12. package/dist/commands/edit.d.ts +15 -3
  13. package/dist/commands/edit.js +52 -9
  14. package/dist/commands/edit.js.map +1 -1
  15. package/dist/commands/export.d.ts +11 -9
  16. package/dist/commands/export.js +80 -28
  17. package/dist/commands/export.js.map +1 -1
  18. package/dist/commands/import.d.ts +7 -0
  19. package/dist/commands/import.js +13 -0
  20. package/dist/commands/import.js.map +1 -1
  21. package/dist/commands/move.d.ts +11 -12
  22. package/dist/commands/move.js +12 -13
  23. package/dist/commands/move.js.map +1 -1
  24. package/dist/commands/remove.d.ts +1 -3
  25. package/dist/commands/remove.js +4 -6
  26. package/dist/commands/remove.js.map +1 -1
  27. package/dist/commands/rename.d.ts +1 -3
  28. package/dist/commands/rename.js +3 -6
  29. package/dist/commands/rename.js.map +1 -1
  30. package/dist/commands/show.d.ts +37 -5
  31. package/dist/commands/show.js +89 -8
  32. package/dist/commands/show.js.map +1 -1
  33. package/dist/commands/transition.d.ts +1 -3
  34. package/dist/commands/transition.js +3 -5
  35. package/dist/commands/transition.js.map +1 -1
  36. package/dist/commands/update.d.ts +5 -1
  37. package/dist/commands/update.js +7 -1
  38. package/dist/commands/update.js.map +1 -1
  39. package/dist/commands/validate.d.ts +7 -0
  40. package/dist/commands/validate.js +31 -4
  41. package/dist/commands/validate.js.map +1 -1
  42. package/dist/containers/card-container.d.ts +6 -0
  43. package/dist/containers/card-container.js +61 -0
  44. package/dist/containers/card-container.js.map +1 -1
  45. package/dist/containers/project/calculation-engine.d.ts +90 -0
  46. package/dist/containers/project/calculation-engine.js +402 -0
  47. package/dist/containers/project/calculation-engine.js.map +1 -0
  48. package/dist/containers/project/resource-collector.js +9 -13
  49. package/dist/containers/project/resource-collector.js.map +1 -1
  50. package/dist/containers/project.d.ts +18 -1
  51. package/dist/containers/project.js +28 -55
  52. package/dist/containers/project.js.map +1 -1
  53. package/dist/containers/template.d.ts +5 -0
  54. package/dist/containers/template.js +9 -0
  55. package/dist/containers/template.js.map +1 -1
  56. package/dist/index.d.ts +5 -2
  57. package/dist/index.js +5 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/interfaces/macros.d.ts +4 -2
  60. package/dist/interfaces/project-interfaces.d.ts +21 -0
  61. package/dist/interfaces/project-interfaces.js +4 -0
  62. package/dist/interfaces/project-interfaces.js.map +1 -1
  63. package/dist/interfaces/resource-interfaces.d.ts +4 -2
  64. package/dist/interfaces/resource-interfaces.js.map +1 -1
  65. package/dist/macros/base-macro.d.ts +2 -1
  66. package/dist/macros/base-macro.js +14 -2
  67. package/dist/macros/base-macro.js.map +1 -1
  68. package/dist/macros/common.d.ts +16 -9
  69. package/dist/macros/common.js +22 -9
  70. package/dist/macros/common.js.map +1 -1
  71. package/dist/macros/createCards/index.d.ts +2 -2
  72. package/dist/macros/createCards/index.js +4 -0
  73. package/dist/macros/createCards/index.js.map +1 -1
  74. package/dist/macros/graph/index.d.ts +1 -3
  75. package/dist/macros/graph/index.js +1 -6
  76. package/dist/macros/graph/index.js.map +1 -1
  77. package/dist/macros/image/index.d.ts +39 -0
  78. package/dist/macros/image/index.js +82 -0
  79. package/dist/macros/image/index.js.map +1 -0
  80. package/dist/macros/image/metadata.d.ts +18 -0
  81. package/dist/macros/image/metadata.js +22 -0
  82. package/dist/macros/image/metadata.js.map +1 -0
  83. package/dist/macros/include/index.d.ts +31 -0
  84. package/dist/macros/include/index.js +94 -0
  85. package/dist/macros/include/index.js.map +1 -0
  86. package/dist/macros/include/metadata.d.ts +15 -0
  87. package/dist/macros/include/metadata.js +19 -0
  88. package/dist/macros/include/metadata.js.map +1 -0
  89. package/dist/macros/index.d.ts +33 -31
  90. package/dist/macros/index.js +142 -71
  91. package/dist/macros/index.js.map +1 -1
  92. package/dist/macros/percentage/index.d.ts +28 -0
  93. package/dist/macros/percentage/index.js +33 -0
  94. package/dist/macros/percentage/index.js.map +1 -0
  95. package/dist/macros/percentage/metadata.d.ts +15 -0
  96. package/dist/macros/percentage/metadata.js +19 -0
  97. package/dist/macros/percentage/metadata.js.map +1 -0
  98. package/dist/macros/report/index.d.ts +2 -6
  99. package/dist/macros/report/index.js +3 -7
  100. package/dist/macros/report/index.js.map +1 -1
  101. package/dist/macros/scoreCard/index.d.ts +14 -15
  102. package/dist/macros/scoreCard/index.js +14 -18
  103. package/dist/macros/scoreCard/index.js.map +1 -1
  104. package/dist/macros/vega/index.d.ts +28 -0
  105. package/dist/macros/vega/index.js +27 -0
  106. package/dist/macros/vega/index.js.map +1 -0
  107. package/dist/macros/vega/metadata.d.ts +15 -0
  108. package/dist/macros/vega/metadata.js +7 -0
  109. package/dist/macros/vega/metadata.js.map +1 -0
  110. package/dist/macros/vegalite/index.d.ts +26 -0
  111. package/dist/macros/vegalite/index.js +24 -0
  112. package/dist/macros/vegalite/index.js.map +1 -0
  113. package/dist/macros/vegalite/metadata.d.ts +15 -0
  114. package/dist/macros/vegalite/metadata.js +7 -0
  115. package/dist/macros/vegalite/metadata.js.map +1 -0
  116. package/dist/macros/xref/index.d.ts +26 -0
  117. package/dist/macros/xref/index.js +53 -0
  118. package/dist/macros/xref/index.js.map +1 -0
  119. package/dist/macros/xref/metadata.d.ts +15 -0
  120. package/dist/macros/xref/metadata.js +19 -0
  121. package/dist/macros/xref/metadata.js.map +1 -0
  122. package/dist/module-manager.d.ts +1 -0
  123. package/dist/module-manager.js +14 -4
  124. package/dist/module-manager.js.map +1 -1
  125. package/dist/permissions/action-guard.d.ts +2 -2
  126. package/dist/permissions/action-guard.js +1 -1
  127. package/dist/permissions/action-guard.js.map +1 -1
  128. package/dist/resources/card-type-resource.d.ts +2 -0
  129. package/dist/resources/card-type-resource.js +63 -0
  130. package/dist/resources/card-type-resource.js.map +1 -1
  131. package/dist/resources/file-resource.d.ts +2 -0
  132. package/dist/resources/file-resource.js +12 -4
  133. package/dist/resources/file-resource.js.map +1 -1
  134. package/dist/resources/folder-resource.d.ts +19 -0
  135. package/dist/resources/folder-resource.js +51 -2
  136. package/dist/resources/folder-resource.js.map +1 -1
  137. package/dist/resources/graph-model-resource.js +1 -1
  138. package/dist/resources/graph-model-resource.js.map +1 -1
  139. package/dist/resources/graph-view-resource.js +1 -1
  140. package/dist/resources/graph-view-resource.js.map +1 -1
  141. package/dist/resources/report-resource.js +1 -1
  142. package/dist/resources/report-resource.js.map +1 -1
  143. package/dist/resources/resource-object.d.ts +8 -0
  144. package/dist/resources/resource-object.js +10 -1
  145. package/dist/resources/resource-object.js.map +1 -1
  146. package/dist/resources/template-resource.js +1 -1
  147. package/dist/resources/template-resource.js.map +1 -1
  148. package/dist/resources/workflow-resource.d.ts +2 -0
  149. package/dist/resources/workflow-resource.js +53 -9
  150. package/dist/resources/workflow-resource.js.map +1 -1
  151. package/dist/svg/index.d.ts +15 -0
  152. package/dist/svg/index.js +16 -0
  153. package/dist/svg/index.js.map +1 -0
  154. package/dist/svg/lib.d.ts +9 -0
  155. package/dist/svg/lib.js +26 -0
  156. package/dist/svg/lib.js.map +1 -0
  157. package/dist/svg/percentage.d.ts +25 -0
  158. package/dist/svg/percentage.js +90 -0
  159. package/dist/svg/percentage.js.map +1 -0
  160. package/dist/svg/scoreCard.d.ts +19 -0
  161. package/dist/svg/scoreCard.js +55 -0
  162. package/dist/svg/scoreCard.js.map +1 -0
  163. package/dist/types/queries.d.ts +8 -7
  164. package/dist/types/queries.js.map +1 -1
  165. package/dist/utils/card-utils.d.ts +6 -0
  166. package/dist/utils/card-utils.js +12 -0
  167. package/dist/utils/card-utils.js.map +1 -1
  168. package/dist/utils/clingo-facts.d.ts +2 -1
  169. package/dist/utils/clingo-facts.js +19 -2
  170. package/dist/utils/clingo-facts.js.map +1 -1
  171. package/dist/utils/clingo-parser.d.ts +1 -0
  172. package/dist/utils/clingo-parser.js +22 -100
  173. package/dist/utils/clingo-parser.js.map +1 -1
  174. package/dist/utils/constants.d.ts +7 -0
  175. package/dist/utils/constants.js +14 -0
  176. package/dist/utils/constants.js.map +1 -1
  177. package/dist/utils/csv.js.map +1 -1
  178. package/dist/utils/report.d.ts +17 -3
  179. package/dist/utils/report.js +38 -2
  180. package/dist/utils/report.js.map +1 -1
  181. package/dist/utils/resource-utils.d.ts +2 -1
  182. package/dist/utils/resource-utils.js +12 -3
  183. package/dist/utils/resource-utils.js.map +1 -1
  184. package/dist/utils/user-preferences.d.ts +1 -11
  185. package/dist/utils/user-preferences.js +30 -13
  186. package/dist/utils/user-preferences.js.map +1 -1
  187. package/dist/utils/validate.d.ts +2 -3
  188. package/dist/utils/validate.js +2 -2
  189. package/dist/utils/validate.js.map +1 -1
  190. package/package.json +8 -6
  191. package/src/command-handler.ts +96 -17
  192. package/src/command-manager.ts +8 -8
  193. package/src/commands/calculate.ts +11 -525
  194. package/src/commands/create.ts +35 -6
  195. package/src/commands/edit.ts +94 -11
  196. package/src/commands/export.ts +104 -31
  197. package/src/commands/import.ts +16 -0
  198. package/src/commands/move.ts +12 -15
  199. package/src/commands/remove.ts +4 -8
  200. package/src/commands/rename.ts +3 -12
  201. package/src/commands/show.ts +126 -9
  202. package/src/commands/transition.ts +3 -7
  203. package/src/commands/update.ts +6 -0
  204. package/src/commands/validate.ts +41 -13
  205. package/src/containers/card-container.ts +74 -0
  206. package/src/containers/project/calculation-engine.ts +535 -0
  207. package/src/containers/project/resource-collector.ts +13 -15
  208. package/src/containers/project.ts +30 -66
  209. package/src/containers/template.ts +16 -0
  210. package/src/index.ts +13 -2
  211. package/src/interfaces/macros.ts +4 -1
  212. package/src/interfaces/project-interfaces.ts +27 -0
  213. package/src/interfaces/resource-interfaces.ts +5 -2
  214. package/src/macros/base-macro.ts +19 -4
  215. package/src/macros/common.ts +22 -9
  216. package/src/macros/createCards/index.ts +6 -2
  217. package/src/macros/graph/index.ts +6 -10
  218. package/src/macros/image/index.ts +128 -0
  219. package/src/macros/image/metadata.ts +25 -0
  220. package/src/macros/include/index.ts +143 -0
  221. package/src/macros/include/metadata.ts +22 -0
  222. package/src/macros/index.ts +150 -98
  223. package/src/macros/percentage/index.ts +50 -0
  224. package/src/macros/percentage/metadata.ts +22 -0
  225. package/src/macros/report/index.ts +4 -12
  226. package/src/macros/scoreCard/index.ts +21 -25
  227. package/src/macros/vega/index.ts +55 -0
  228. package/src/macros/vega/metadata.ts +21 -0
  229. package/src/macros/vegalite/index.ts +46 -0
  230. package/src/macros/vegalite/metadata.ts +21 -0
  231. package/src/macros/xref/index.ts +73 -0
  232. package/src/macros/xref/metadata.ts +22 -0
  233. package/src/module-manager.ts +15 -5
  234. package/src/permissions/action-guard.ts +3 -3
  235. package/src/resources/card-type-resource.ts +100 -0
  236. package/src/resources/file-resource.ts +16 -4
  237. package/src/resources/folder-resource.ts +59 -2
  238. package/src/resources/graph-model-resource.ts +1 -1
  239. package/src/resources/graph-view-resource.ts +1 -1
  240. package/src/resources/report-resource.ts +1 -1
  241. package/src/resources/resource-object.ts +19 -1
  242. package/src/resources/template-resource.ts +1 -1
  243. package/src/resources/workflow-resource.ts +68 -13
  244. package/src/svg/index.ts +15 -0
  245. package/src/svg/lib.ts +31 -0
  246. package/src/svg/percentage.ts +97 -0
  247. package/src/svg/scoreCard.ts +88 -0
  248. package/src/types/queries.ts +8 -7
  249. package/src/types/string-pixel-width.d.ts +23 -0
  250. package/src/utils/card-utils.ts +13 -0
  251. package/src/utils/clingo-facts.ts +65 -3
  252. package/src/utils/clingo-parser.ts +31 -144
  253. package/src/utils/constants.ts +16 -0
  254. package/src/utils/csv.ts +1 -1
  255. package/src/utils/report.ts +45 -4
  256. package/src/utils/resource-utils.ts +12 -2
  257. package/src/utils/user-preferences.ts +32 -14
  258. package/src/utils/validate.ts +3 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cyberismo/data-handler",
3
3
  "description": "Command handler for cards and web service",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "author": "sami.merila@cyberismo.com",
6
6
  "license": "AGPL-3.0",
7
7
  "homepage": "https://github.com/CyberismoCom/cyberismo",
@@ -24,28 +24,30 @@
24
24
  "@types/sinon": "^17.0.4",
25
25
  "c8": "^10.1.3",
26
26
  "pino-pretty": "^13.0.0",
27
- "sinon": "^20.0.0"
27
+ "sinon": "^21.0.0"
28
28
  },
29
29
  "dependencies": {
30
30
  "@asciidoctor/core": "^3.0.4",
31
31
  "@viz-js/viz": "^3.12.0",
32
32
  "async-mutex": "^0.5.0",
33
- "csv-parse": "^5.6.0",
33
+ "csv-parse": "^6.1.0",
34
34
  "directory-schema-validator": "^1.0.17",
35
35
  "dompurify": "^3.2.6",
36
36
  "email-validator": "^2.0.4",
37
37
  "handlebars": "^4.7.8",
38
- "isomorphic-git": "^1.30.2",
39
38
  "jsdom": "^26.1.0",
40
39
  "json-schema": "^0.4.0",
41
40
  "jsonschema": "^1.5.0",
42
41
  "mime-types": "^3.0.1",
43
42
  "pino": "^9.7.0",
44
43
  "simple-git": "^3.2.0",
44
+ "string-pixel-width": "^1.11.0",
45
45
  "tslib": "^2.6.2",
46
+ "vega": "^6.1.2",
47
+ "vega-lite": "^6.2.0",
46
48
  "write-json-file": "^6.0.0",
47
- "@cyberismo/node-clingo": "1.0.4",
48
- "@cyberismo/assets": "0.0.8"
49
+ "@cyberismo/assets": "0.0.10",
50
+ "@cyberismo/node-clingo": "1.1.5"
49
51
  },
50
52
  "type": "module",
51
53
  "files": [
@@ -45,6 +45,7 @@ import { readJsonFile } from './utils/json.js';
45
45
  import { resourceName } from './utils/resource-utils.js';
46
46
 
47
47
  import { type Level } from 'pino';
48
+ import { type Context } from './interfaces/project-interfaces.js';
48
49
 
49
50
  // Generic options interface
50
51
  export interface CardsOptions {
@@ -55,6 +56,14 @@ export interface CardsOptions {
55
56
  repeat?: number;
56
57
  showUse?: boolean;
57
58
  logLevel?: Level;
59
+ context?: Context;
60
+ recursive?: boolean;
61
+ title?: string;
62
+ name?: string;
63
+ date?: string;
64
+ version?: string;
65
+ revremark?: string;
66
+ mappingFile?: string;
58
67
  }
59
68
 
60
69
  // Commands that this class supports.
@@ -82,8 +91,8 @@ export enum Cmd {
82
91
  // To what format the content can be exported to.
83
92
  export enum ExportFormats {
84
93
  adoc = 'adoc',
85
- html = 'html',
86
94
  site = 'site',
95
+ pdf = 'pdf',
87
96
  }
88
97
 
89
98
  export { CommandManager } from './command-manager.js';
@@ -195,10 +204,10 @@ export class Commands {
195
204
  return { statusCode: 400, message: 'File path is missing' };
196
205
  }
197
206
  await this.generateLogicProgram();
198
- return this.runLogicProgram(cardKey);
207
+ return this.runLogicProgram(cardKey, options.context || 'localApp');
199
208
  }
200
209
  if (command === 'generate') {
201
- return this.generateLogicProgram(cardKey);
210
+ return this.generateLogicProgram();
202
211
  }
203
212
  } else if (command === Cmd.create) {
204
213
  const [type, ...rest] = args;
@@ -266,7 +275,12 @@ export class Commands {
266
275
  await this.commands?.editCmd.editCard(cardKey);
267
276
  } else if (command === Cmd.export) {
268
277
  const [format, output, cardKey] = args;
269
- await this.export(output, format as ExportFormats, cardKey);
278
+ return await this.export(
279
+ output,
280
+ format as ExportFormats,
281
+ cardKey,
282
+ options,
283
+ );
270
284
  } else if (command === Cmd.import) {
271
285
  const target = args.splice(0, 1)[0];
272
286
  if (target === 'module') {
@@ -322,7 +336,11 @@ export class Commands {
322
336
  );
323
337
  } else if (command === Cmd.report) {
324
338
  const [parameters, outputPath] = args;
325
- return this.runReport(parameters, outputPath);
339
+ return this.runReport(
340
+ parameters,
341
+ options.context || 'localApp',
342
+ outputPath,
343
+ );
326
344
  } else if (command === Cmd.start) {
327
345
  return this.startApp(options.forceStart);
328
346
  } else if (command === Cmd.transition) {
@@ -339,15 +357,61 @@ export class Commands {
339
357
  parsedValue = value;
340
358
  }
341
359
 
360
+ // Handle mapping file for workflow changes
361
+ let mappingTable: { stateMapping: Record<string, string> } | undefined;
362
+ if (
363
+ options.mappingFile &&
364
+ operation === 'change' &&
365
+ key === 'workflow'
366
+ ) {
367
+ try {
368
+ const mappingData = await readJsonFile(
369
+ resolveTilde(options.mappingFile),
370
+ );
371
+ if (
372
+ mappingData &&
373
+ typeof mappingData === 'object' &&
374
+ 'stateMapping' in mappingData
375
+ ) {
376
+ mappingTable = mappingData as {
377
+ stateMapping: Record<string, string>;
378
+ };
379
+ } else {
380
+ throw new Error(
381
+ 'Mapping file must contain a "stateMapping" object',
382
+ );
383
+ }
384
+ } catch (error) {
385
+ throw new Error(
386
+ `Failed to read mapping file: ${errorFunction(error)}`,
387
+ );
388
+ }
389
+ }
390
+
391
+ let parsedNewValue = newValue;
392
+ if (newValue) {
393
+ try {
394
+ parsedNewValue = JSON.parse(newValue);
395
+ } catch {
396
+ parsedNewValue = newValue;
397
+ }
398
+ }
399
+
342
400
  await this.commands?.updateCmd.updateValue(
343
401
  resource,
344
402
  operation as UpdateOperations,
345
403
  key,
346
404
  parsedValue,
347
- newValue ? JSON.parse(newValue) : undefined,
405
+ parsedNewValue,
406
+ mappingTable,
348
407
  );
349
408
  } else if (command === Cmd.updateModules) {
350
- await this.commands?.importCmd.updateAllModules(credentials);
409
+ const [module] = args;
410
+ if (module) {
411
+ await this.commands?.importCmd.updateModule(module, credentials);
412
+ } else {
413
+ await this.commands?.importCmd.updateAllModules(credentials);
414
+ }
351
415
  } else if (command === Cmd.validate) {
352
416
  return this.validate();
353
417
  } else {
@@ -446,31 +510,37 @@ export class Commands {
446
510
  destination: string = 'output',
447
511
  format: ExportFormats,
448
512
  parentCardKey?: string,
513
+ pdfOptions?: CardsOptions,
449
514
  ): Promise<requestStatus> {
450
515
  if (!this.commands) {
451
516
  return { statusCode: 500 };
452
517
  }
453
518
  process.env.EXPORT_FORMAT = format;
454
519
  let message = '';
455
- if (format === 'adoc') {
520
+ if (format === 'pdf') {
521
+ const options = {
522
+ title: pdfOptions?.title || 'Title',
523
+ name: pdfOptions?.name || 'Name',
524
+ version: pdfOptions?.version || '1.0.0',
525
+ revremark: pdfOptions?.revremark || 'Initial version',
526
+ cardKey: parentCardKey,
527
+ date: pdfOptions?.date ? new Date(pdfOptions.date) : new Date(),
528
+ };
529
+ message = await this.commands?.exportCmd.exportPdf(destination, options);
530
+ } else {
456
531
  message = await this.commands?.exportCmd.exportToADoc(
457
532
  destination,
458
533
  parentCardKey,
459
534
  );
460
- } else if (format === 'html') {
461
- message = await this.commands?.exportCmd.exportToHTML(
462
- destination,
463
- parentCardKey,
464
- );
465
535
  }
466
536
  process.env.EXPORT_FORMAT = '';
467
537
  return { statusCode: 200, message: message };
468
538
  }
469
539
 
470
540
  // Generates logic program for a card.
471
- private async generateLogicProgram(cardKey?: string): Promise<requestStatus> {
541
+ private async generateLogicProgram(): Promise<requestStatus> {
472
542
  try {
473
- await this.commands?.calculateCmd.generate(cardKey);
543
+ await this.commands?.calculateCmd.generate();
474
544
  return { statusCode: 200 };
475
545
  } catch (e) {
476
546
  return { statusCode: 500, message: errorFunction(e) };
@@ -517,10 +587,14 @@ export class Commands {
517
587
  }
518
588
 
519
589
  // Runs a given logic program along with the query-language
520
- private async runLogicProgram(filePath: string): Promise<requestStatus> {
590
+ private async runLogicProgram(
591
+ filePath: string,
592
+ context: Context,
593
+ ): Promise<requestStatus> {
521
594
  try {
522
595
  const res = await this.commands?.calculateCmd.runLogicProgram(
523
596
  readFileSync(filePath, 'utf-8'),
597
+ context,
524
598
  );
525
599
  return {
526
600
  statusCode: 200,
@@ -532,7 +606,11 @@ export class Commands {
532
606
  }
533
607
 
534
608
  // Runs a report using Handlebars and the provided parameters.
535
- private async runReport(parametersPath: string, outputPath?: string) {
609
+ private async runReport(
610
+ parametersPath: string,
611
+ context: Context,
612
+ outputPath?: string,
613
+ ) {
536
614
  const parametersFile = await readJsonFile(parametersPath);
537
615
 
538
616
  // Validate the parameters file.
@@ -565,6 +643,7 @@ export class Commands {
565
643
  name,
566
644
  parameters.cardKey,
567
645
  parameters,
646
+ context,
568
647
  outputPath,
569
648
  );
570
649
  } catch (e) {
@@ -59,15 +59,15 @@ export class CommandManager {
59
59
  this.validateCmd = Validate.getInstance();
60
60
 
61
61
  this.calculateCmd = new Calculate(this.project);
62
- this.showCmd = new Show(this.project, this.calculateCmd);
63
- this.createCmd = new Create(this.project, this.calculateCmd);
64
- this.editCmd = new Edit(this.project, this.calculateCmd);
65
- this.exportCmd = new Export(this.project, this.calculateCmd, this.showCmd);
62
+ this.showCmd = new Show(this.project);
63
+ this.createCmd = new Create(this.project);
64
+ this.editCmd = new Edit(this.project);
65
+ this.exportCmd = new Export(this.project, this.showCmd);
66
66
  this.importCmd = new Import(this.project, this.createCmd);
67
- this.moveCmd = new Move(this.project, this.calculateCmd);
68
- this.removeCmd = new Remove(this.project, this.calculateCmd);
69
- this.renameCmd = new Rename(this.project, this.calculateCmd);
70
- this.transitionCmd = new Transition(this.project, this.calculateCmd);
67
+ this.moveCmd = new Move(this.project);
68
+ this.removeCmd = new Remove(this.project);
69
+ this.renameCmd = new Rename(this.project);
70
+ this.transitionCmd = new Transition(this.project);
71
71
  this.updateCmd = new Update(this.project);
72
72
  this.pathHandler = new ProjectPaths(path);
73
73
  }