@cyberismo/data-handler 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/LICENSE +702 -0
  2. package/dist/card-metadata-updater.d.ts +33 -0
  3. package/dist/card-metadata-updater.js +121 -0
  4. package/dist/card-metadata-updater.js.map +1 -0
  5. package/dist/command-handler.d.ts +96 -0
  6. package/dist/command-handler.js +557 -0
  7. package/dist/command-handler.js.map +1 -0
  8. package/dist/command-manager.d.ts +43 -0
  9. package/dist/command-manager.js +73 -0
  10. package/dist/command-manager.js.map +1 -0
  11. package/dist/commands/calculate.d.ts +86 -0
  12. package/dist/commands/calculate.js +444 -0
  13. package/dist/commands/calculate.js.map +1 -0
  14. package/dist/commands/create.d.ts +114 -0
  15. package/dist/commands/create.js +389 -0
  16. package/dist/commands/create.js.map +1 -0
  17. package/dist/commands/edit.d.ts +37 -0
  18. package/dist/commands/edit.js +99 -0
  19. package/dist/commands/edit.js.map +1 -0
  20. package/dist/commands/export-site.d.ts +45 -0
  21. package/dist/commands/export-site.js +301 -0
  22. package/dist/commands/export-site.js.map +1 -0
  23. package/dist/commands/export.d.ts +53 -0
  24. package/dist/commands/export.js +251 -0
  25. package/dist/commands/export.js.map +1 -0
  26. package/dist/commands/import.d.ts +53 -0
  27. package/dist/commands/import.js +133 -0
  28. package/dist/commands/import.js.map +1 -0
  29. package/dist/commands/index.d.ts +26 -0
  30. package/dist/commands/index.js +27 -0
  31. package/dist/commands/index.js.map +1 -0
  32. package/dist/commands/move.d.ts +55 -0
  33. package/dist/commands/move.js +341 -0
  34. package/dist/commands/move.js.map +1 -0
  35. package/dist/commands/remove.d.ts +38 -0
  36. package/dist/commands/remove.js +192 -0
  37. package/dist/commands/remove.js.map +1 -0
  38. package/dist/commands/rename.d.ts +46 -0
  39. package/dist/commands/rename.js +289 -0
  40. package/dist/commands/rename.js.map +1 -0
  41. package/dist/commands/show.d.ts +124 -0
  42. package/dist/commands/show.js +345 -0
  43. package/dist/commands/show.js.map +1 -0
  44. package/dist/commands/transition.d.ts +27 -0
  45. package/dist/commands/transition.js +92 -0
  46. package/dist/commands/transition.js.map +1 -0
  47. package/dist/commands/update.d.ts +29 -0
  48. package/dist/commands/update.js +64 -0
  49. package/dist/commands/update.js.map +1 -0
  50. package/dist/commands/validate.d.ts +143 -0
  51. package/dist/commands/validate.js +689 -0
  52. package/dist/commands/validate.js.map +1 -0
  53. package/dist/containers/card-container.d.ts +44 -0
  54. package/dist/containers/card-container.js +282 -0
  55. package/dist/containers/card-container.js.map +1 -0
  56. package/dist/containers/project/project-paths.d.ts +46 -0
  57. package/dist/containers/project/project-paths.js +105 -0
  58. package/dist/containers/project/project-paths.js.map +1 -0
  59. package/dist/containers/project/resource-collector.d.ts +86 -0
  60. package/dist/containers/project/resource-collector.js +331 -0
  61. package/dist/containers/project/resource-collector.js.map +1 -0
  62. package/dist/containers/project.d.ts +351 -0
  63. package/dist/containers/project.js +896 -0
  64. package/dist/containers/project.js.map +1 -0
  65. package/dist/containers/template.d.ts +108 -0
  66. package/dist/containers/template.js +433 -0
  67. package/dist/containers/template.js.map +1 -0
  68. package/dist/exceptions/index.d.ts +19 -0
  69. package/dist/exceptions/index.js +26 -0
  70. package/dist/exceptions/index.js.map +1 -0
  71. package/dist/index.d.ts +16 -0
  72. package/dist/index.js +15 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/interfaces/adoc.d.ts +12 -0
  75. package/dist/interfaces/adoc.js +13 -0
  76. package/dist/interfaces/adoc.js.map +1 -0
  77. package/dist/interfaces/macros.d.ts +45 -0
  78. package/dist/interfaces/macros.js +13 -0
  79. package/dist/interfaces/macros.js.map +1 -0
  80. package/dist/interfaces/project-interfaces.d.ts +121 -0
  81. package/dist/interfaces/project-interfaces.js +21 -0
  82. package/dist/interfaces/project-interfaces.js.map +1 -0
  83. package/dist/interfaces/request-status-interfaces.d.ts +28 -0
  84. package/dist/interfaces/request-status-interfaces.js +20 -0
  85. package/dist/interfaces/request-status-interfaces.js.map +1 -0
  86. package/dist/interfaces/resource-interfaces.d.ts +117 -0
  87. package/dist/interfaces/resource-interfaces.js +20 -0
  88. package/dist/interfaces/resource-interfaces.js.map +1 -0
  89. package/dist/macros/base-macro.d.ts +31 -0
  90. package/dist/macros/base-macro.js +126 -0
  91. package/dist/macros/base-macro.js.map +1 -0
  92. package/dist/macros/common.d.ts +17 -0
  93. package/dist/macros/common.js +23 -0
  94. package/dist/macros/common.js.map +1 -0
  95. package/dist/macros/createCards/index.d.ts +36 -0
  96. package/dist/macros/createCards/index.js +35 -0
  97. package/dist/macros/createCards/index.js.map +1 -0
  98. package/dist/macros/createCards/metadata.d.ts +14 -0
  99. package/dist/macros/createCards/metadata.js +18 -0
  100. package/dist/macros/createCards/metadata.js.map +1 -0
  101. package/dist/macros/graph/index.d.ts +29 -0
  102. package/dist/macros/graph/index.js +91 -0
  103. package/dist/macros/graph/index.js.map +1 -0
  104. package/dist/macros/graph/metadata.d.ts +14 -0
  105. package/dist/macros/graph/metadata.js +18 -0
  106. package/dist/macros/graph/metadata.js.map +1 -0
  107. package/dist/macros/index.d.ts +93 -0
  108. package/dist/macros/index.js +237 -0
  109. package/dist/macros/index.js.map +1 -0
  110. package/dist/macros/report/index.d.ts +26 -0
  111. package/dist/macros/report/index.js +70 -0
  112. package/dist/macros/report/index.js.map +1 -0
  113. package/dist/macros/report/metadata.d.ts +14 -0
  114. package/dist/macros/report/metadata.js +18 -0
  115. package/dist/macros/report/metadata.js.map +1 -0
  116. package/dist/macros/scoreCard/index.d.ts +30 -0
  117. package/dist/macros/scoreCard/index.js +38 -0
  118. package/dist/macros/scoreCard/index.js.map +1 -0
  119. package/dist/macros/scoreCard/metadata.d.ts +14 -0
  120. package/dist/macros/scoreCard/metadata.js +18 -0
  121. package/dist/macros/scoreCard/metadata.js.map +1 -0
  122. package/dist/macros/task-queue.d.ts +46 -0
  123. package/dist/macros/task-queue.js +69 -0
  124. package/dist/macros/task-queue.js.map +1 -0
  125. package/dist/module-manager.d.ts +62 -0
  126. package/dist/module-manager.js +350 -0
  127. package/dist/module-manager.js.map +1 -0
  128. package/dist/permissions/action-guard.d.ts +28 -0
  129. package/dist/permissions/action-guard.js +61 -0
  130. package/dist/permissions/action-guard.js.map +1 -0
  131. package/dist/project-settings.d.ts +42 -0
  132. package/dist/project-settings.js +120 -0
  133. package/dist/project-settings.js.map +1 -0
  134. package/dist/resources/array-handler.d.ts +28 -0
  135. package/dist/resources/array-handler.js +116 -0
  136. package/dist/resources/array-handler.js.map +1 -0
  137. package/dist/resources/card-type-resource.d.ts +72 -0
  138. package/dist/resources/card-type-resource.js +334 -0
  139. package/dist/resources/card-type-resource.js.map +1 -0
  140. package/dist/resources/create-defaults.d.ts +81 -0
  141. package/dist/resources/create-defaults.js +184 -0
  142. package/dist/resources/create-defaults.js.map +1 -0
  143. package/dist/resources/field-type-resource.d.ts +88 -0
  144. package/dist/resources/field-type-resource.js +411 -0
  145. package/dist/resources/field-type-resource.js.map +1 -0
  146. package/dist/resources/file-resource.d.ts +50 -0
  147. package/dist/resources/file-resource.js +301 -0
  148. package/dist/resources/file-resource.js.map +1 -0
  149. package/dist/resources/folder-resource.d.ts +66 -0
  150. package/dist/resources/folder-resource.js +100 -0
  151. package/dist/resources/folder-resource.js.map +1 -0
  152. package/dist/resources/graph-model-resource.d.ts +78 -0
  153. package/dist/resources/graph-model-resource.js +164 -0
  154. package/dist/resources/graph-model-resource.js.map +1 -0
  155. package/dist/resources/graph-view-resource.d.ts +78 -0
  156. package/dist/resources/graph-view-resource.js +163 -0
  157. package/dist/resources/graph-view-resource.js.map +1 -0
  158. package/dist/resources/link-type-resource.d.ts +62 -0
  159. package/dist/resources/link-type-resource.js +150 -0
  160. package/dist/resources/link-type-resource.js.map +1 -0
  161. package/dist/resources/report-resource.d.ts +77 -0
  162. package/dist/resources/report-resource.js +171 -0
  163. package/dist/resources/report-resource.js.map +1 -0
  164. package/dist/resources/resource-object.d.ts +108 -0
  165. package/dist/resources/resource-object.js +147 -0
  166. package/dist/resources/resource-object.js.map +1 -0
  167. package/dist/resources/template-resource.d.ts +82 -0
  168. package/dist/resources/template-resource.js +173 -0
  169. package/dist/resources/template-resource.js.map +1 -0
  170. package/dist/resources/workflow-resource.d.ts +67 -0
  171. package/dist/resources/workflow-resource.js +156 -0
  172. package/dist/resources/workflow-resource.js.map +1 -0
  173. package/dist/types/queries.d.ts +142 -0
  174. package/dist/types/queries.js +16 -0
  175. package/dist/types/queries.js.map +1 -0
  176. package/dist/utils/card-utils.d.ts +34 -0
  177. package/dist/utils/card-utils.js +78 -0
  178. package/dist/utils/card-utils.js.map +1 -0
  179. package/dist/utils/clingo-fact-builder.d.ts +58 -0
  180. package/dist/utils/clingo-fact-builder.js +126 -0
  181. package/dist/utils/clingo-fact-builder.js.map +1 -0
  182. package/dist/utils/clingo-facts.d.ts +97 -0
  183. package/dist/utils/clingo-facts.js +352 -0
  184. package/dist/utils/clingo-facts.js.map +1 -0
  185. package/dist/utils/clingo-parser.d.ts +59 -0
  186. package/dist/utils/clingo-parser.js +403 -0
  187. package/dist/utils/clingo-parser.js.map +1 -0
  188. package/dist/utils/clingo-program-builder.d.ts +39 -0
  189. package/dist/utils/clingo-program-builder.js +57 -0
  190. package/dist/utils/clingo-program-builder.js.map +1 -0
  191. package/dist/utils/common-utils.d.ts +24 -0
  192. package/dist/utils/common-utils.js +47 -0
  193. package/dist/utils/common-utils.js.map +1 -0
  194. package/dist/utils/constants.d.ts +18 -0
  195. package/dist/utils/constants.js +27 -0
  196. package/dist/utils/constants.js.map +1 -0
  197. package/dist/utils/csv.d.ts +18 -0
  198. package/dist/utils/csv.js +45 -0
  199. package/dist/utils/csv.js.map +1 -0
  200. package/dist/utils/file-utils.d.ts +69 -0
  201. package/dist/utils/file-utils.js +158 -0
  202. package/dist/utils/file-utils.js.map +1 -0
  203. package/dist/utils/json.d.ts +61 -0
  204. package/dist/utils/json.js +108 -0
  205. package/dist/utils/json.js.map +1 -0
  206. package/dist/utils/lexorank.d.ts +59 -0
  207. package/dist/utils/lexorank.js +159 -0
  208. package/dist/utils/lexorank.js.map +1 -0
  209. package/dist/utils/log-utils.d.ts +40 -0
  210. package/dist/utils/log-utils.js +109 -0
  211. package/dist/utils/log-utils.js.map +1 -0
  212. package/dist/utils/random.d.ts +19 -0
  213. package/dist/utils/random.js +34 -0
  214. package/dist/utils/random.js.map +1 -0
  215. package/dist/utils/resource-utils.d.ts +45 -0
  216. package/dist/utils/resource-utils.js +137 -0
  217. package/dist/utils/resource-utils.js.map +1 -0
  218. package/dist/utils/sanitize-svg.d.ts +18 -0
  219. package/dist/utils/sanitize-svg.js +38 -0
  220. package/dist/utils/sanitize-svg.js.map +1 -0
  221. package/dist/utils/user-preferences.d.ts +64 -0
  222. package/dist/utils/user-preferences.js +106 -0
  223. package/dist/utils/user-preferences.js.map +1 -0
  224. package/dist/utils/validate.d.ts +26 -0
  225. package/dist/utils/validate.js +53 -0
  226. package/dist/utils/validate.js.map +1 -0
  227. package/dist/utils/value-utils.d.ts +58 -0
  228. package/dist/utils/value-utils.js +181 -0
  229. package/dist/utils/value-utils.js.map +1 -0
  230. package/package.json +67 -0
  231. package/src/card-metadata-updater.ts +182 -0
  232. package/src/command-handler.ts +686 -0
  233. package/src/command-manager.ts +99 -0
  234. package/src/commands/calculate.ts +591 -0
  235. package/src/commands/create.ts +559 -0
  236. package/src/commands/edit.ts +123 -0
  237. package/src/commands/export-site.ts +356 -0
  238. package/src/commands/export.ts +315 -0
  239. package/src/commands/import.ts +169 -0
  240. package/src/commands/index.ts +42 -0
  241. package/src/commands/move.ts +451 -0
  242. package/src/commands/remove.ts +244 -0
  243. package/src/commands/rename.ts +378 -0
  244. package/src/commands/show.ts +442 -0
  245. package/src/commands/transition.ts +127 -0
  246. package/src/commands/update.ts +76 -0
  247. package/src/commands/validate.ts +962 -0
  248. package/src/containers/card-container.ts +378 -0
  249. package/src/containers/project/project-paths.ts +127 -0
  250. package/src/containers/project/resource-collector.ts +379 -0
  251. package/src/containers/project.ts +1135 -0
  252. package/src/containers/template.ts +573 -0
  253. package/src/exceptions/index.ts +29 -0
  254. package/src/index.ts +33 -0
  255. package/src/interfaces/adoc.ts +18 -0
  256. package/src/interfaces/macros.ts +54 -0
  257. package/src/interfaces/project-interfaces.ts +208 -0
  258. package/src/interfaces/request-status-interfaces.ts +30 -0
  259. package/src/interfaces/resource-interfaces.ts +179 -0
  260. package/src/macros/base-macro.ts +176 -0
  261. package/src/macros/common.ts +24 -0
  262. package/src/macros/createCards/index.ts +57 -0
  263. package/src/macros/createCards/metadata.ts +21 -0
  264. package/src/macros/graph/index.ts +130 -0
  265. package/src/macros/graph/metadata.ts +21 -0
  266. package/src/macros/index.ts +321 -0
  267. package/src/macros/report/index.ts +88 -0
  268. package/src/macros/report/metadata.ts +21 -0
  269. package/src/macros/scoreCard/index.ts +55 -0
  270. package/src/macros/scoreCard/metadata.ts +21 -0
  271. package/src/macros/task-queue.ts +79 -0
  272. package/src/module-manager.ts +443 -0
  273. package/src/permissions/action-guard.ts +77 -0
  274. package/src/project-settings.ts +140 -0
  275. package/src/resources/array-handler.ts +141 -0
  276. package/src/resources/card-type-resource.ts +455 -0
  277. package/src/resources/create-defaults.ts +216 -0
  278. package/src/resources/field-type-resource.ts +533 -0
  279. package/src/resources/file-resource.ts +433 -0
  280. package/src/resources/folder-resource.ts +140 -0
  281. package/src/resources/graph-model-resource.ts +205 -0
  282. package/src/resources/graph-view-resource.ts +199 -0
  283. package/src/resources/link-type-resource.ts +191 -0
  284. package/src/resources/report-resource.ts +224 -0
  285. package/src/resources/resource-object.ts +246 -0
  286. package/src/resources/template-resource.ts +210 -0
  287. package/src/resources/workflow-resource.ts +205 -0
  288. package/src/types/queries.ts +149 -0
  289. package/src/utils/card-utils.ts +83 -0
  290. package/src/utils/clingo-fact-builder.ts +167 -0
  291. package/src/utils/clingo-facts.ts +550 -0
  292. package/src/utils/clingo-parser.ts +519 -0
  293. package/src/utils/clingo-program-builder.ts +71 -0
  294. package/src/utils/common-utils.ts +54 -0
  295. package/src/utils/constants.ts +32 -0
  296. package/src/utils/csv.ts +53 -0
  297. package/src/utils/file-utils.ts +182 -0
  298. package/src/utils/json.ts +118 -0
  299. package/src/utils/lexorank.ts +180 -0
  300. package/src/utils/log-utils.ts +127 -0
  301. package/src/utils/random.ts +37 -0
  302. package/src/utils/resource-utils.ts +180 -0
  303. package/src/utils/sanitize-svg.ts +46 -0
  304. package/src/utils/user-preferences.ts +126 -0
  305. package/src/utils/validate.ts +66 -0
  306. package/src/utils/value-utils.ts +189 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/commands/export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;EAYE;AAEF,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,cAAc;AACd,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAO1C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,gBAAgB,GAAW,GAAG,CAAC;AAErC,MAAM,OAAO,MAAM;IAEL;IACA;IACA;IAHZ,YACY,OAAgB,EAChB,YAAuB,EACvB,OAAa;QAFb,YAAO,GAAP,OAAO,CAAS;QAChB,iBAAY,GAAZ,YAAY,CAAW;QACvB,YAAO,GAAP,OAAO,CAAM;IACtB,CAAC;IAEJ,wDAAwD;IAChD,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,KAAa;QAClD,MAAM,UAAU,CAAC,IAAI,EAAE,iBAAiB,gBAAgB,KAAK,CAAC,CAAC;QAC/D,MAAM,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,6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CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACzD,OAAO,GAAG,GAAG,CAAC;YACd,MAAM,iBAAiB,GAAG,SAAS,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;YAC5D,iBAAiB,CAAC,WAAW,CAAC,QAAQ,EAAE;gBACtC,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,GAAG;gBACb,UAAU,EAAE,IAAI;aACjB,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -0,0 +1,53 @@
1
+ /**
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
+ */
13
+ import { type Create } from './index.js';
14
+ import type { ModuleSettingOptions } from '../interfaces/project-interfaces.js';
15
+ import type { Project } from '../containers/project.js';
16
+ export declare class Import {
17
+ private project;
18
+ private createCmd;
19
+ private moduleManager;
20
+ constructor(project: Project, createCmd: Create);
21
+ /**
22
+ * Imports cards based on a csv file
23
+ * @param csvFilePath path to the csv file
24
+ * @param parentCardKey the cards in the csv file will be created under this card
25
+ * @returns card keys of the imported cards
26
+ */
27
+ importCsv(csvFilePath: string, parentCardKey?: string): Promise<string[]>;
28
+ /**
29
+ * Imports a module to a project. Copies resources to the project.
30
+ * Resources will be added to a new directory under '.cards/modules'.
31
+ * The name of the new folder will be module's prefix.
32
+ *
33
+ * Note that file references are relative, and thus URI must be
34
+ * 'file:<relative path>', instead of 'file://<relative path>'.
35
+ *
36
+ * @param source Path to module that will be imported
37
+ * @param destination Path to project that will receive the imported module
38
+ * @param options Additional options for module import. Optional.
39
+ * branch: Git branch for module from Git.
40
+ * private: If true, uses credentials to clone the repository
41
+ */
42
+ importModule(source: string, destination?: string, options?: ModuleSettingOptions): Promise<void>;
43
+ /**
44
+ * Updates all imported modules.
45
+ */
46
+ updateAllModules(): Promise<void>;
47
+ /**
48
+ * Updates 'moduleName' module from its source.
49
+ * Modules using gitUrl, are first copied to .temp
50
+ * @param moduleName module name (prefix) to update
51
+ */
52
+ updateExistingModule(moduleName: string): Promise<void>;
53
+ }
@@ -0,0 +1,133 @@
1
+ /**
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
+ */
13
+ import { Validate } from './index.js';
14
+ import { ModuleManager } from '../module-manager.js';
15
+ import { readCsvFile } from '../utils/csv.js';
16
+ import { resourceName } from '../utils/resource-utils.js';
17
+ import { TemplateResource } from '../resources/template-resource.js';
18
+ export class Import {
19
+ project;
20
+ createCmd;
21
+ moduleManager;
22
+ constructor(project, createCmd) {
23
+ this.project = project;
24
+ this.createCmd = createCmd;
25
+ this.moduleManager = new ModuleManager(this.project, this);
26
+ }
27
+ /**
28
+ * Imports cards based on a csv file
29
+ * @param csvFilePath path to the csv file
30
+ * @param parentCardKey the cards in the csv file will be created under this card
31
+ * @returns card keys of the imported cards
32
+ */
33
+ async importCsv(csvFilePath, parentCardKey) {
34
+ const csv = await readCsvFile(csvFilePath);
35
+ const isValid = Validate.getInstance().validateJson(csv, 'csvSchema');
36
+ if (isValid.length !== 0) {
37
+ throw new Error(isValid);
38
+ }
39
+ const importedCards = [];
40
+ for (const row of csv) {
41
+ const { title, template, description, labels, ...customFields } = row;
42
+ const templateResource = new TemplateResource(this.project, resourceName(template));
43
+ const templateObject = templateResource.templateObject();
44
+ if (!templateObject) {
45
+ throw new Error(`Template '${template}' not found`);
46
+ }
47
+ const templateCards = await templateObject.cards();
48
+ if (templateCards.length !== 1) {
49
+ console.warn(`Template '${template}' for card '${title}' does not have exactly one card. Skipping row.`);
50
+ continue;
51
+ }
52
+ // Create card
53
+ const cards = await this.createCmd.createCard(template, parentCardKey);
54
+ if (cards.length !== 1) {
55
+ throw new Error('Card not created');
56
+ }
57
+ const cardKey = cards[0].key;
58
+ const card = await this.project.findSpecificCard(cardKey, {
59
+ metadata: true,
60
+ });
61
+ const cardType = await this.project.resource(card?.metadata?.cardType || '');
62
+ if (!cardType) {
63
+ throw new Error(`Card type not found for card ${cardKey}`);
64
+ }
65
+ if (description) {
66
+ await this.project.updateCardContent(cardKey, description);
67
+ }
68
+ if (labels) {
69
+ for (const label of labels.split(' ')) {
70
+ try {
71
+ await this.createCmd.createLabel(cardKey, label);
72
+ }
73
+ catch (e) {
74
+ console.error(`Failed to create label ${label}: ${e instanceof Error ? e.message : 'Unknown error'}`);
75
+ }
76
+ }
77
+ }
78
+ await this.project.updateCardMetadataKey(cardKey, 'title', title);
79
+ for (const [key, value] of Object.entries(customFields)) {
80
+ if (cardType.customFields.find((field) => field.name === key)) {
81
+ await this.project.updateCardMetadataKey(cardKey, key, value);
82
+ }
83
+ }
84
+ importedCards.push(cardKey);
85
+ }
86
+ return importedCards;
87
+ }
88
+ /**
89
+ * Imports a module to a project. Copies resources to the project.
90
+ * Resources will be added to a new directory under '.cards/modules'.
91
+ * The name of the new folder will be module's prefix.
92
+ *
93
+ * Note that file references are relative, and thus URI must be
94
+ * 'file:<relative path>', instead of 'file://<relative path>'.
95
+ *
96
+ * @param source Path to module that will be imported
97
+ * @param destination Path to project that will receive the imported module
98
+ * @param options Additional options for module import. Optional.
99
+ * branch: Git branch for module from Git.
100
+ * private: If true, uses credentials to clone the repository
101
+ */
102
+ async importModule(source, destination, options) {
103
+ const gitModule = source.startsWith('https');
104
+ const modulePrefix = gitModule
105
+ ? await this.moduleManager.importGitModule(source, options)
106
+ : await this.moduleManager.importFileModule(source, destination);
107
+ if (!modulePrefix) {
108
+ throw new Error(`Cannot find prefix for imported module '${source}'. Import cancelled.`);
109
+ }
110
+ // Add module as a dependency.
111
+ return this.project.importModule({
112
+ name: modulePrefix,
113
+ branch: options ? options.branch : undefined,
114
+ private: options ? options.private : undefined,
115
+ location: gitModule ? source : `file:${source}`,
116
+ });
117
+ }
118
+ /**
119
+ * Updates all imported modules.
120
+ */
121
+ async updateAllModules() {
122
+ return this.moduleManager.update();
123
+ }
124
+ /**
125
+ * Updates 'moduleName' module from its source.
126
+ * Modules using gitUrl, are first copied to .temp
127
+ * @param moduleName module name (prefix) to update
128
+ */
129
+ async updateExistingModule(moduleName) {
130
+ await this.moduleManager.importFileModule(moduleName);
131
+ }
132
+ }
133
+ //# sourceMappingURL=import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.js","sourceRoot":"","sources":["../../src/commands/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAGF,OAAO,EAAe,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,MAAM,OAAO,MAAM;IAGP;IACA;IAHF,aAAa,CAAgB;IACrC,YACU,OAAgB,EAChB,SAAiB;QADjB,YAAO,GAAP,OAAO,CA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AAC,CAAC,QAAQ,MAAM,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,gBAAgB;QAC3B,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,oBAAoB,CAAC,UAAkB;QAClD,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;CACF"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ Cyberismo
3
+ Copyright © Cyberismo Ltd and contributors 2025
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. This program is distributed in the hope that it
7
+ will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
8
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
9
+ General Public License for more details.
10
+ 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
+ */
13
+ import { Calculate } from './calculate.js';
14
+ import { Create } from './create.js';
15
+ import { Edit } from './edit.js';
16
+ import { Export } from './export.js';
17
+ import { ExportSite } from './export-site.js';
18
+ import { Import } from './import.js';
19
+ import { Move } from './move.js';
20
+ import { Remove } from './remove.js';
21
+ import { Rename } from './rename.js';
22
+ import { Show } from './show.js';
23
+ import { Transition } from './transition.js';
24
+ import { Update } from './update.js';
25
+ import { Validate } from './validate.js';
26
+ export { Calculate, Create, Edit, Export, ExportSite, Import, Move, Remove, Rename, Show, Transition, Update, Validate, };
@@ -0,0 +1,27 @@
1
+ /**
2
+ Cyberismo
3
+ Copyright © Cyberismo Ltd and contributors 2025
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. This program is distributed in the hope that it
7
+ will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
8
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
9
+ General Public License for more details.
10
+ 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
+ */
13
+ import { Calculate } from './calculate.js';
14
+ import { Create } from './create.js';
15
+ import { Edit } from './edit.js';
16
+ import { Export } from './export.js';
17
+ import { ExportSite } from './export-site.js';
18
+ import { Import } from './import.js';
19
+ import { Move } from './move.js';
20
+ import { Remove } from './remove.js';
21
+ import { Rename } from './rename.js';
22
+ import { Show } from './show.js';
23
+ import { Transition } from './transition.js';
24
+ import { Update } from './update.js';
25
+ import { Validate } from './validate.js';
26
+ export { Calculate, Create, Edit, Export, ExportSite, Import, Move, Remove, Rename, Show, Transition, Update, Validate, };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;EAWE;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EACL,SAAS,EACT,MAAM,EACN,IAAI,EACJ,MAAM,EACN,UAAU,EACV,MAAM,EACN,IAAI,EACJ,MAAM,EACN,MAAM,EACN,IAAI,EACJ,UAAU,EACV,MAAM,EACN,QAAQ,GACT,CAAC"}
@@ -0,0 +1,55 @@
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 the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
6
+
7
+ 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.
8
+
9
+ You should have received a copy of the GNU Affero General Public
10
+ License along with this program. If not, see <https://www.gnu.org/licenses/>.
11
+ */
12
+ import type { Calculate } from './index.js';
13
+ import { type Project } from '../containers/project.js';
14
+ export declare class Move {
15
+ private project;
16
+ private calculateCmd;
17
+ constructor(project: Project, calculateCmd: Calculate);
18
+ private getCard;
19
+ private getSiblings;
20
+ private rebalanceCards;
21
+ private rebalanceProjectRecursively;
22
+ /**
23
+ * Moves card from 'destination' to 'source'.
24
+ * @param source source card to move
25
+ * @param destination destination card where source card will be moved to; or to root
26
+ */
27
+ moveCard(source: string, destination: string): Promise<void>;
28
+ /**
29
+ * Ranks card using position given as 'index'.
30
+ * @param cardKey card key
31
+ * @param index to which position should card be ranked to
32
+ */
33
+ rankByIndex(cardKey: string, index: number): Promise<void>;
34
+ /**
35
+ * Sets the rank of a card to be after another card.
36
+ * @param cardKey Card to rank
37
+ * @param beforeCardKey Card key after which the card will be ranked
38
+ */
39
+ rankCard(cardKey: string, beforeCardKey: string): Promise<void>;
40
+ /**
41
+ * Ranks card first.
42
+ * @param cardKey card key
43
+ */
44
+ rankFirst(cardKey: string): Promise<void>;
45
+ /**
46
+ * Rebalances the ranks of the children of a card.
47
+ * @param parentCardKey parent card key
48
+ */
49
+ rebalanceChildren(parentCardKey: string): Promise<void>;
50
+ /**
51
+ * Rebalances the ranks of the cards in the whole project, including templates
52
+ * Can be used even if the ranks do not exist
53
+ */
54
+ rebalanceProject(): Promise<void>;
55
+ }
@@ -0,0 +1,341 @@
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 the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
6
+
7
+ 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.
8
+
9
+ You should have received a copy of the GNU Affero General Public
10
+ License along with this program. If not, see <https://www.gnu.org/licenses/>.
11
+ */
12
+ // node
13
+ import { join, sep } from 'node:path';
14
+ import { ActionGuard } from '../permissions/action-guard.js';
15
+ import { copyDir, deleteDir } from '../utils/file-utils.js';
16
+ import { ResourcesFrom } from '../containers/project.js';
17
+ import { EMPTY_RANK, FIRST_RANK, getRankAfter, getRankBetween, rebalanceRanks, sortItems, } from '../utils/lexorank.js';
18
+ import { isTemplateCard } from '../utils/card-utils.js';
19
+ import { resourceName } from '../utils/resource-utils.js';
20
+ import { TemplateResource } from '../resources/template-resource.js';
21
+ // @todo - we should have project wide constants, so that if we need them, only the const value needs to be changed.
22
+ const ROOT = 'root';
23
+ export class Move {
24
+ project;
25
+ calculateCmd;
26
+ constructor(project, calculateCmd) {
27
+ this.project = project;
28
+ this.calculateCmd = calculateCmd;
29
+ }
30
+ // Fetches a card (either template or project card).
31
+ async getCard(cardKey, options) {
32
+ let card;
33
+ const templateCard = await this.project.isTemplateCard(cardKey);
34
+ if (templateCard) {
35
+ card = (await this.project.allTemplateCards(options)).find((card) => card.key === cardKey);
36
+ }
37
+ else {
38
+ card = await this.project.findSpecificCard(cardKey, options);
39
+ }
40
+ if (!card) {
41
+ throw new Error('Card was not found from the project');
42
+ }
43
+ return card;
44
+ }
45
+ // Returns children of a parent card or root cards
46
+ async getSiblings(card) {
47
+ const parentCardKey = card.parent || ROOT;
48
+ // since we don't know if 'root' is templateRoot or cardRoot, we need to check the card
49
+ if (parentCardKey === ROOT) {
50
+ if (isTemplateCard(card)) {
51
+ const template = this.project.createTemplateObjectFromCard(card);
52
+ if (!template) {
53
+ throw new Error(`Cannot find template for the template card '${card.key}'`);
54
+ }
55
+ if (card?.path.includes(`${sep}modules${sep}`)) {
56
+ throw new Error(`Cannot rank module cards`);
57
+ }
58
+ return template.cards();
59
+ }
60
+ }
61
+ let parentCard;
62
+ if (parentCardKey !== ROOT) {
63
+ parentCard = await this.project.findSpecificCard(parentCardKey, {
64
+ children: true,
65
+ metadata: true,
66
+ });
67
+ if (!parentCard) {
68
+ throw new Error(`Card ${parentCardKey} not found from project`);
69
+ }
70
+ }
71
+ if (parentCard) {
72
+ return parentCard.children || [];
73
+ }
74
+ return this.project.showProjectCards();
75
+ }
76
+ //
77
+ async rebalanceCards(cards) {
78
+ const ranks = rebalanceRanks(cards.length);
79
+ cards = sortItems(cards, (item) => item.metadata?.rank || 'z');
80
+ for (let i = 0; i < cards.length; i++) {
81
+ const card = cards[i];
82
+ await this.project.updateCardMetadataKey(card.key, 'rank', ranks[i]);
83
+ }
84
+ }
85
+ // Rebalances the project recursively.
86
+ async rebalanceProjectRecursively(cards) {
87
+ const ranks = rebalanceRanks(cards.length);
88
+ cards = sortItems(cards, (item) => item.metadata?.rank || 'z');
89
+ for (let i = 0; i < cards.length; i++) {
90
+ const card = cards[i];
91
+ await this.project.updateCardMetadataKey(card.key, 'rank', ranks[i]);
92
+ if (card.children && card.children.length > 0) {
93
+ await this.rebalanceProjectRecursively(card.children);
94
+ }
95
+ }
96
+ }
97
+ /**
98
+ * Moves card from 'destination' to 'source'.
99
+ * @param source source card to move
100
+ * @param destination destination card where source card will be moved to; or to root
101
+ */
102
+ async moveCard(source, destination) {
103
+ if (source === ROOT) {
104
+ throw new Error('Cannot move "root"');
105
+ }
106
+ if (source === destination) {
107
+ throw new Error(`Card cannot be moved to itself`);
108
+ }
109
+ const promiseContainer = [];
110
+ promiseContainer.push(this.project.findSpecificCard(source));
111
+ if (destination !== ROOT) {
112
+ promiseContainer.push(this.project.findSpecificCard(destination));
113
+ }
114
+ else {
115
+ const returnObject = {
116
+ key: '',
117
+ path: this.project.paths.cardRootFolder,
118
+ children: [],
119
+ attachments: [],
120
+ };
121
+ promiseContainer.push(Promise.resolve(returnObject));
122
+ }
123
+ const [sourceCard, destinationCard] = await Promise.all(promiseContainer);
124
+ if (!sourceCard) {
125
+ throw new Error(`Card ${source} not found from project`);
126
+ }
127
+ if (!destinationCard) {
128
+ throw new Error(`Card ${destination} not found from project`);
129
+ }
130
+ if (destinationCard.path.includes(source)) {
131
+ throw new Error(`Card cannot be moved to inside itself`);
132
+ }
133
+ // Imported templates cannot be modified.
134
+ if (destinationCard.path.includes(`${sep}modules`) ||
135
+ sourceCard.path.includes(`${sep}modules${sep}`)) {
136
+ throw new Error(`Cannot modify imported module templates`);
137
+ }
138
+ const bothTemplateCards = isTemplateCard(sourceCard) && isTemplateCard(destinationCard);
139
+ const bothProjectCards = this.project.hasCard(sourceCard.key) &&
140
+ this.project.hasCard(destinationCard.key);
141
+ if (!(bothTemplateCards || bothProjectCards)) {
142
+ throw new Error(`Cards cannot be moved from project to template or vice versa`);
143
+ }
144
+ const destinationPath = destination === ROOT
145
+ ? join(this.project.paths.cardRootFolder, sourceCard.key)
146
+ : join(destinationCard.path, 'c', sourceCard.key);
147
+ // if the card is already in the destination, do nothing
148
+ if (sourceCard.path === destinationPath) {
149
+ return;
150
+ }
151
+ // if both are project cards, make sure source card can be moved
152
+ const actionGuard = new ActionGuard(this.calculateCmd);
153
+ await actionGuard.checkPermission('move', source);
154
+ // rerank the card in the new location
155
+ // it will be the last one in the new location
156
+ let children;
157
+ if (destination !== ROOT) {
158
+ const parent = await this.project.findSpecificCard(destination, {
159
+ children: true,
160
+ metadata: true,
161
+ });
162
+ if (!parent) {
163
+ throw new Error(`Parent card ${destination} not found from project`);
164
+ }
165
+ children = parent.children;
166
+ }
167
+ else {
168
+ children = await this.project.showProjectCards();
169
+ }
170
+ if (!children) {
171
+ throw new Error(`Children not found from card ${destination}`);
172
+ }
173
+ children = sortItems(children, (item) => item?.metadata?.rank || '1|z');
174
+ const lastChild = children[children.length - 1];
175
+ const rank = lastChild && lastChild.metadata
176
+ ? getRankAfter(lastChild.metadata.rank)
177
+ : FIRST_RANK;
178
+ await this.project.updateCardMetadataKey(sourceCard.key, 'rank', rank);
179
+ await copyDir(sourceCard.path, destinationPath);
180
+ await deleteDir(sourceCard.path);
181
+ }
182
+ /**
183
+ * Ranks card using position given as 'index'.
184
+ * @param cardKey card key
185
+ * @param index to which position should card be ranked to
186
+ */
187
+ async rankByIndex(cardKey, index) {
188
+ if (index < 0) {
189
+ throw new Error(`Index must be greater than 0`);
190
+ }
191
+ if (index === 0) {
192
+ await this.rankFirst(cardKey);
193
+ return;
194
+ }
195
+ const card = await this.project.findSpecificCard(cardKey, {
196
+ metadata: true,
197
+ parent: true,
198
+ });
199
+ if (!card || !card.parent) {
200
+ throw new Error(`Card ${cardKey} not found from project`);
201
+ }
202
+ const children = sortItems(await this.getSiblings(card), (item) => item.metadata?.rank || EMPTY_RANK);
203
+ if (!children || children.length === 0) {
204
+ throw new Error(`Children not found from card ${card.parent}`);
205
+ }
206
+ if (children.length < index) {
207
+ throw new Error(`Index ${index} is out of bounds`);
208
+ }
209
+ await this.rankCard(cardKey, children[index - 1].key);
210
+ }
211
+ /**
212
+ * Sets the rank of a card to be after another card.
213
+ * @param cardKey Card to rank
214
+ * @param beforeCardKey Card key after which the card will be ranked
215
+ */
216
+ async rankCard(cardKey, beforeCardKey) {
217
+ const card = await this.project.findSpecificCard(cardKey, {
218
+ metadata: true,
219
+ parent: true,
220
+ });
221
+ if (!card) {
222
+ throw new Error(`Card ${cardKey} not found from project`);
223
+ }
224
+ const beforeCard = await this.project.findSpecificCard(beforeCardKey, {
225
+ metadata: true,
226
+ parent: true,
227
+ });
228
+ if (!beforeCard) {
229
+ throw new Error(`Card ${beforeCardKey} not found from project`);
230
+ }
231
+ if (beforeCard.parent !== card.parent) {
232
+ throw new Error(`Cards must be from the same parent`);
233
+ }
234
+ const children = sortItems(await this.getSiblings(beforeCard), (item) => item.metadata?.rank || EMPTY_RANK);
235
+ if (!children) {
236
+ throw new Error(`Children not found from card ${beforeCard.parent}`);
237
+ }
238
+ const beforeCardIndex = children.findIndex((child) => child.key === beforeCard.key);
239
+ if (beforeCardIndex === -1) {
240
+ throw new Error(`Card ${beforeCardKey} is not a child of ${beforeCard.parent}`);
241
+ }
242
+ if (children[beforeCardIndex].key === cardKey ||
243
+ children[beforeCardIndex + 1]?.key === cardKey) {
244
+ throw new Error(`Card ${cardKey} is already in the correct position`);
245
+ }
246
+ if (beforeCardIndex === children.length - 1) {
247
+ await this.project.updateCardMetadataKey(cardKey, 'rank', getRankAfter(beforeCard.metadata?.rank));
248
+ }
249
+ else {
250
+ await this.project.updateCardMetadataKey(cardKey, 'rank', getRankBetween(beforeCard.metadata?.rank, children[beforeCardIndex + 1].metadata?.rank));
251
+ }
252
+ }
253
+ /**
254
+ * Ranks card first.
255
+ * @param cardKey card key
256
+ */
257
+ async rankFirst(cardKey) {
258
+ const card = await this.getCard(cardKey, {
259
+ metadata: true,
260
+ parent: true,
261
+ });
262
+ const children = sortItems(await this.getSiblings(card), (item) => item.metadata?.rank || EMPTY_RANK);
263
+ if (!children || children.length === 0) {
264
+ throw new Error(`Children not found from card ${card.parent}`);
265
+ }
266
+ if (children[0].key === cardKey && children[0].metadata?.rank) {
267
+ return;
268
+ }
269
+ const firstRank = children[0].metadata?.rank;
270
+ if (!firstRank) {
271
+ await this.project.updateCardMetadataKey(cardKey, 'rank', FIRST_RANK);
272
+ return;
273
+ }
274
+ // Set the rank to be the first one
275
+ if (firstRank === FIRST_RANK) {
276
+ // if the first card is already at the first rank, we need to move the card to the next one
277
+ const secondRank = children[1].metadata?.rank;
278
+ if (!secondRank) {
279
+ throw new Error(`Second rank not found`);
280
+ }
281
+ const rankBetween = getRankBetween(firstRank, secondRank);
282
+ await this.project.updateCardMetadataKey(children[0].key, 'rank', rankBetween);
283
+ await this.project.updateCardMetadataKey(cardKey, 'rank', firstRank);
284
+ }
285
+ else {
286
+ // if the card is not at the first rank, we just use the first rank
287
+ await this.project.updateCardMetadataKey(cardKey, 'rank', FIRST_RANK);
288
+ }
289
+ }
290
+ /**
291
+ * Rebalances the ranks of the children of a card.
292
+ * @param parentCardKey parent card key
293
+ */
294
+ async rebalanceChildren(parentCardKey) {
295
+ const parentCard = await this.project.findSpecificCard(parentCardKey, {
296
+ children: true,
297
+ metadata: true,
298
+ });
299
+ if (!parentCard || !parentCard.children) {
300
+ throw new Error(`Card ${parentCardKey} not found from project`);
301
+ }
302
+ await this.rebalanceCards(parentCard.children);
303
+ }
304
+ /**
305
+ * Rebalances the ranks of the cards in the whole project, including templates
306
+ * Can be used even if the ranks do not exist
307
+ */
308
+ async rebalanceProject() {
309
+ const cards = await this.project.showProjectCards();
310
+ await this.rebalanceProjectRecursively(cards);
311
+ // rebalance templates
312
+ const templates = await this.project.templates(ResourcesFrom.localOnly);
313
+ for (const template of templates) {
314
+ const templateResource = new TemplateResource(this.project, resourceName(template.name));
315
+ const templateObject = templateResource.templateObject();
316
+ if (!templateObject) {
317
+ throw new Error(`Template '${template.name}' not found`);
318
+ }
319
+ const templateCards = await templateObject.cards('', {
320
+ parent: true,
321
+ metadata: true,
322
+ });
323
+ const cardGroups = templateCards.reduce((result, card) => {
324
+ // template card root cards have a parent(the template itself) so this shouldn't happen
325
+ if (!card.parent) {
326
+ return result;
327
+ }
328
+ // if the parent does not exist yet in the result, we create it
329
+ if (!result[card.parent]) {
330
+ result[card.parent] = [];
331
+ }
332
+ result[card.parent].push(card);
333
+ return result;
334
+ }, {});
335
+ for (const [, cards] of Object.entries(cardGroups)) {
336
+ await this.rebalanceCards(cards);
337
+ }
338
+ }
339
+ }
340
+ }
341
+ //# sourceMappingURL=move.js.map