@fnndsc/chili 3.2.5

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 (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -0
  3. package/dist/chefs/chefs.d.ts +15 -0
  4. package/dist/chefs/chefs.js +195 -0
  5. package/dist/commands/compute/fields.d.ts +6 -0
  6. package/dist/commands/compute/fields.js +13 -0
  7. package/dist/commands/compute/list.d.ts +19 -0
  8. package/dist/commands/compute/list.js +20 -0
  9. package/dist/commands/connect/login.d.ts +16 -0
  10. package/dist/commands/connect/login.js +18 -0
  11. package/dist/commands/connect/logout.d.ts +6 -0
  12. package/dist/commands/connect/logout.js +16 -0
  13. package/dist/commands/feed/comments.d.ts +41 -0
  14. package/dist/commands/feed/comments.js +45 -0
  15. package/dist/commands/feed/create.d.ts +13 -0
  16. package/dist/commands/feed/create.js +40 -0
  17. package/dist/commands/feed/note.d.ts +21 -0
  18. package/dist/commands/feed/note.js +24 -0
  19. package/dist/commands/feeds/delete.d.ts +14 -0
  20. package/dist/commands/feeds/delete.js +34 -0
  21. package/dist/commands/feeds/fields.d.ts +6 -0
  22. package/dist/commands/feeds/fields.js +17 -0
  23. package/dist/commands/feeds/list.d.ts +17 -0
  24. package/dist/commands/feeds/list.js +38 -0
  25. package/dist/commands/feeds/share.d.ts +17 -0
  26. package/dist/commands/feeds/share.js +19 -0
  27. package/dist/commands/file/view.d.ts +8 -0
  28. package/dist/commands/file/view.js +25 -0
  29. package/dist/commands/files/delete.d.ts +16 -0
  30. package/dist/commands/files/delete.js +36 -0
  31. package/dist/commands/files/fields.d.ts +7 -0
  32. package/dist/commands/files/fields.js +18 -0
  33. package/dist/commands/files/list.d.ts +11 -0
  34. package/dist/commands/files/list.js +23 -0
  35. package/dist/commands/fs/cat.d.ts +15 -0
  36. package/dist/commands/fs/cat.js +26 -0
  37. package/dist/commands/fs/cp.d.ts +17 -0
  38. package/dist/commands/fs/cp.js +26 -0
  39. package/dist/commands/fs/create.d.ts +15 -0
  40. package/dist/commands/fs/create.js +83 -0
  41. package/dist/commands/fs/download.d.ts +25 -0
  42. package/dist/commands/fs/download.js +235 -0
  43. package/dist/commands/fs/edit.d.ts +16 -0
  44. package/dist/commands/fs/edit.js +25 -0
  45. package/dist/commands/fs/ls.d.ts +18 -0
  46. package/dist/commands/fs/ls.js +142 -0
  47. package/dist/commands/fs/mkdir.d.ts +8 -0
  48. package/dist/commands/fs/mkdir.js +21 -0
  49. package/dist/commands/fs/mv.d.ts +13 -0
  50. package/dist/commands/fs/mv.js +73 -0
  51. package/dist/commands/fs/rm.d.ts +24 -0
  52. package/dist/commands/fs/rm.js +108 -0
  53. package/dist/commands/fs/touch.d.ts +16 -0
  54. package/dist/commands/fs/touch.js +62 -0
  55. package/dist/commands/fs/upload.d.ts +55 -0
  56. package/dist/commands/fs/upload.js +221 -0
  57. package/dist/commands/groups/fields.d.ts +6 -0
  58. package/dist/commands/groups/fields.js +13 -0
  59. package/dist/commands/groups/list.d.ts +16 -0
  60. package/dist/commands/groups/list.js +26 -0
  61. package/dist/commands/man/doc.d.ts +16 -0
  62. package/dist/commands/man/doc.js +32 -0
  63. package/dist/commands/man/topics.d.ts +6 -0
  64. package/dist/commands/man/topics.js +27 -0
  65. package/dist/commands/pipeline/fields.d.ts +6 -0
  66. package/dist/commands/pipeline/fields.js +13 -0
  67. package/dist/commands/pipeline/run.d.ts +18 -0
  68. package/dist/commands/pipeline/run.js +33 -0
  69. package/dist/commands/plugin/readme.d.ts +14 -0
  70. package/dist/commands/plugin/readme.js +49 -0
  71. package/dist/commands/plugin/run.d.ts +10 -0
  72. package/dist/commands/plugin/run.js +29 -0
  73. package/dist/commands/plugin/search.d.ts +7 -0
  74. package/dist/commands/plugin/search.js +18 -0
  75. package/dist/commands/plugininstances/fields.d.ts +6 -0
  76. package/dist/commands/plugininstances/fields.js +13 -0
  77. package/dist/commands/plugininstances/list.d.ts +16 -0
  78. package/dist/commands/plugininstances/list.js +26 -0
  79. package/dist/commands/pluginmetas/fields.d.ts +6 -0
  80. package/dist/commands/pluginmetas/fields.js +13 -0
  81. package/dist/commands/pluginmetas/list.d.ts +16 -0
  82. package/dist/commands/pluginmetas/list.js +26 -0
  83. package/dist/commands/plugins/add.d.ts +34 -0
  84. package/dist/commands/plugins/add.js +374 -0
  85. package/dist/commands/plugins/delete.d.ts +14 -0
  86. package/dist/commands/plugins/delete.js +34 -0
  87. package/dist/commands/plugins/fields.d.ts +6 -0
  88. package/dist/commands/plugins/fields.js +17 -0
  89. package/dist/commands/plugins/list.d.ts +17 -0
  90. package/dist/commands/plugins/list.js +40 -0
  91. package/dist/commands/plugins/overview.d.ts +6 -0
  92. package/dist/commands/plugins/overview.js +17 -0
  93. package/dist/commands/store/list.d.ts +23 -0
  94. package/dist/commands/store/list.js +48 -0
  95. package/dist/commands/tags/fields.d.ts +6 -0
  96. package/dist/commands/tags/fields.js +13 -0
  97. package/dist/commands/tags/list.d.ts +16 -0
  98. package/dist/commands/tags/list.js +26 -0
  99. package/dist/commands/workflows/fields.d.ts +6 -0
  100. package/dist/commands/workflows/fields.js +13 -0
  101. package/dist/commands/workflows/list.d.ts +16 -0
  102. package/dist/commands/workflows/list.js +26 -0
  103. package/dist/config/colorConfig.d.ts +56 -0
  104. package/dist/config/colorConfig.js +161 -0
  105. package/dist/connect/connectHandler.d.ts +15 -0
  106. package/dist/connect/connectHandler.js +48 -0
  107. package/dist/context/contextCommand.d.ts +13 -0
  108. package/dist/context/contextCommand.js +193 -0
  109. package/dist/controllers/baseController.d.ts +43 -0
  110. package/dist/controllers/baseController.js +67 -0
  111. package/dist/controllers/feedController.d.ts +35 -0
  112. package/dist/controllers/feedController.js +53 -0
  113. package/dist/controllers/fileController.d.ts +56 -0
  114. package/dist/controllers/fileController.js +93 -0
  115. package/dist/controllers/pluginContextController.d.ts +24 -0
  116. package/dist/controllers/pluginContextController.js +49 -0
  117. package/dist/controllers/pluginController.d.ts +70 -0
  118. package/dist/controllers/pluginController.js +98 -0
  119. package/dist/controllers/pluginMetaController.d.ts +41 -0
  120. package/dist/controllers/pluginMetaController.js +52 -0
  121. package/dist/feeds/feedHandler.d.ts +64 -0
  122. package/dist/feeds/feedHandler.js +203 -0
  123. package/dist/filesystem/fileGroupHandler.d.ts +92 -0
  124. package/dist/filesystem/fileGroupHandler.js +318 -0
  125. package/dist/filesystem/filesystemHandler.d.ts +12 -0
  126. package/dist/filesystem/filesystemHandler.js +135 -0
  127. package/dist/filesystem/inodeCommand.d.ts +12 -0
  128. package/dist/filesystem/inodeCommand.js +37 -0
  129. package/dist/handlers/baseGroupHandler.d.ts +103 -0
  130. package/dist/handlers/baseGroupHandler.js +342 -0
  131. package/dist/index.d.ts +7 -0
  132. package/dist/index.js +239 -0
  133. package/dist/lfs/lfs.d.ts +25 -0
  134. package/dist/lfs/lfs.js +74 -0
  135. package/dist/man/man.d.ts +15 -0
  136. package/dist/man/man.js +31 -0
  137. package/dist/man/renderer.d.ts +26 -0
  138. package/dist/man/renderer.js +187 -0
  139. package/dist/models/feed.d.ts +18 -0
  140. package/dist/models/feed.js +8 -0
  141. package/dist/models/listing.d.ts +33 -0
  142. package/dist/models/listing.js +9 -0
  143. package/dist/models/plugin.d.ts +27 -0
  144. package/dist/models/plugin.js +1 -0
  145. package/dist/models/resource.d.ts +39 -0
  146. package/dist/models/resource.js +9 -0
  147. package/dist/pacs/pacsQueryHandler.d.ts +55 -0
  148. package/dist/pacs/pacsQueryHandler.js +196 -0
  149. package/dist/pacs/pacsQueryPayload.d.ts +19 -0
  150. package/dist/pacs/pacsQueryPayload.js +44 -0
  151. package/dist/pacs/pacsResultRender.d.ts +20 -0
  152. package/dist/pacs/pacsResultRender.js +141 -0
  153. package/dist/pacs/pacsRetrieveHandler.d.ts +87 -0
  154. package/dist/pacs/pacsRetrieveHandler.js +272 -0
  155. package/dist/pacs/pacsServerHandler.d.ts +15 -0
  156. package/dist/pacs/pacsServerHandler.js +32 -0
  157. package/dist/path/pathCommand.d.ts +64 -0
  158. package/dist/path/pathCommand.js +805 -0
  159. package/dist/path/pathMapper.d.ts +189 -0
  160. package/dist/path/pathMapper.js +382 -0
  161. package/dist/plugins/pluginGroupHandler.d.ts +42 -0
  162. package/dist/plugins/pluginGroupHandler.js +90 -0
  163. package/dist/plugins/pluginHandler.d.ts +87 -0
  164. package/dist/plugins/pluginHandler.js +303 -0
  165. package/dist/plugins/pluginMetaHandler.d.ts +21 -0
  166. package/dist/plugins/pluginMetaHandler.js +27 -0
  167. package/dist/screen/screen.d.ts +214 -0
  168. package/dist/screen/screen.js +478 -0
  169. package/dist/utils/admin_prompt.d.ts +42 -0
  170. package/dist/utils/admin_prompt.js +105 -0
  171. package/dist/utils/cli.d.ts +67 -0
  172. package/dist/utils/cli.js +112 -0
  173. package/dist/utils/docker.d.ts +74 -0
  174. package/dist/utils/docker.js +155 -0
  175. package/dist/utils/input_format.d.ts +77 -0
  176. package/dist/utils/input_format.js +135 -0
  177. package/dist/utils/sort.d.ts +29 -0
  178. package/dist/utils/sort.js +63 -0
  179. package/dist/utils/ui.d.ts +7 -0
  180. package/dist/utils/ui.js +26 -0
  181. package/dist/utils.d.ts +15 -0
  182. package/dist/utils.js +14 -0
  183. package/dist/views/compute.d.ts +17 -0
  184. package/dist/views/compute.js +40 -0
  185. package/dist/views/connect.d.ts +13 -0
  186. package/dist/views/connect.js +35 -0
  187. package/dist/views/feed.d.ts +44 -0
  188. package/dist/views/feed.js +110 -0
  189. package/dist/views/file.d.ts +25 -0
  190. package/dist/views/file.js +71 -0
  191. package/dist/views/fs.d.ts +51 -0
  192. package/dist/views/fs.js +105 -0
  193. package/dist/views/ls.d.ts +37 -0
  194. package/dist/views/ls.js +190 -0
  195. package/dist/views/plugin.d.ts +28 -0
  196. package/dist/views/plugin.js +71 -0
  197. package/dist/views/pluginParameters.d.ts +17 -0
  198. package/dist/views/pluginParameters.js +79 -0
  199. package/docs/00_intro.adoc +25 -0
  200. package/docs/01_setup.adoc +63 -0
  201. package/docs/02_context.adoc +128 -0
  202. package/docs/03_searchable.adoc +134 -0
  203. package/docs/10_everyday_examples.adoc +9 -0
  204. package/docs/11_upload_data.adoc +146 -0
  205. package/docs/12_create_a_feed.adoc +9 -0
  206. package/docs/13_run_a_plugin.adoc +271 -0
  207. package/docs/20_plugins.adoc +16 -0
  208. package/docs/21_pluginReadme.adoc +123 -0
  209. package/docs/30_filesystem.adoc +93 -0
  210. package/docs/31_fileops.adoc +51 -0
  211. package/docs/32_file_content.adoc +471 -0
  212. package/docs/_architecture.adoc +48 -0
  213. package/docs/_deepContext.adoc +84 -0
  214. package/docs/_roadmap.adoc +42 -0
  215. package/docs/_searchable.adoc +187 -0
  216. package/docs/_state.adoc +68 -0
  217. package/docs/pacs.adoc +101 -0
  218. package/docs/pathMapper.md +246 -0
  219. package/package.json +92 -0
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @file Pipeline run command — creates a workflow from a registered pipeline.
3
+ * @module
4
+ */
5
+ import { chrisContext, errorStack, Err, } from "@fnndsc/cumin";
6
+ import { pipeline_run as salsa_pipeline_run, } from "@fnndsc/salsa";
7
+ /**
8
+ * Runs a pipeline by name or ID, attaching it to the current plugin context node
9
+ * or an explicitly supplied previous instance ID.
10
+ *
11
+ * @param nameOrId - Pipeline name or numeric ID.
12
+ * @param options - Optional compute override and explicit previous instance ID.
13
+ * @returns Result containing workflow ID and created plugin instance IDs.
14
+ */
15
+ export async function pipeline_execute(nameOrId, options = {}) {
16
+ let previousInstId;
17
+ if (options.previousInstId !== undefined) {
18
+ previousInstId = options.previousInstId;
19
+ }
20
+ else {
21
+ const contextInstStr = await chrisContext.ChRISplugin_get();
22
+ if (!contextInstStr) {
23
+ errorStack.stack_push('error', 'No plugin instance in context. Navigate to a feed node first, or supply --previous <id>.');
24
+ return Err();
25
+ }
26
+ previousInstId = parseInt(contextInstStr, 10);
27
+ if (isNaN(previousInstId)) {
28
+ errorStack.stack_push('error', `Invalid plugin instance in context: '${contextInstStr}'`);
29
+ return Err();
30
+ }
31
+ }
32
+ return salsa_pipeline_run(nameOrId, previousInstId, options.compute);
33
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Fetches the raw README content for a plugin.
3
+ *
4
+ * @param pluginId - The ID of the plugin.
5
+ * @returns A Promise resolving to the README content as a string, or `null` if not available.
6
+ */
7
+ export declare function pluginReadme_fetch(pluginId: string): Promise<string | null>;
8
+ /**
9
+ * Renders raw README markdown/rst content for terminal display.
10
+ *
11
+ * @param content - Raw README string.
12
+ * @returns ANSI-styled string ready for console output.
13
+ */
14
+ export declare function pluginReadme_render(content: string): string;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @file Implements the logic for retrieving a ChRIS plugin's README.
3
+ *
4
+ * This module provides functionality to fetch the README content
5
+ * for a specific plugin by its ID.
6
+ *
7
+ * @module
8
+ */
9
+ import { plugin_readme as salsaPlugin_readme } from "@fnndsc/salsa";
10
+ import { marked } from "marked";
11
+ import TerminalRenderer from "marked-terminal";
12
+ import chalk from "chalk";
13
+ marked.setOptions({
14
+ renderer: new TerminalRenderer({
15
+ code: chalk.yellow,
16
+ blockquote: chalk.gray.italic,
17
+ html: chalk.gray,
18
+ heading: chalk.green.bold,
19
+ firstHeading: chalk.magenta.underline.bold,
20
+ hr: chalk.reset,
21
+ listitem: chalk.cyan,
22
+ table: chalk.white,
23
+ paragraph: chalk.white,
24
+ strong: chalk.bold,
25
+ em: chalk.italic,
26
+ codespan: chalk.yellow,
27
+ del: chalk.dim.gray.strikethrough,
28
+ link: chalk.cyan,
29
+ href: chalk.blueBright.underline,
30
+ }),
31
+ });
32
+ /**
33
+ * Fetches the raw README content for a plugin.
34
+ *
35
+ * @param pluginId - The ID of the plugin.
36
+ * @returns A Promise resolving to the README content as a string, or `null` if not available.
37
+ */
38
+ export async function pluginReadme_fetch(pluginId) {
39
+ return await salsaPlugin_readme(pluginId);
40
+ }
41
+ /**
42
+ * Renders raw README markdown/rst content for terminal display.
43
+ *
44
+ * @param content - Raw README string.
45
+ * @returns ANSI-styled string ready for console output.
46
+ */
47
+ export function pluginReadme_render(content) {
48
+ return marked(content);
49
+ }
@@ -0,0 +1,10 @@
1
+ import { PluginInstance } from "../../models/plugin.js";
2
+ /**
3
+ * Executes a ChRIS plugin with the specified parameters.
4
+ *
5
+ * @param searchable - The plugin identifier (ID or name) to run.
6
+ * @param params - The raw parameter string from the CLI (e.g., "--param1 value1 --param2 value2").
7
+ * @returns A Promise resolving to the created plugin instance, or `null` on failure.
8
+ * @throws {Error} If the parameter string cannot be parsed.
9
+ */
10
+ export declare function plugin_execute(searchable: string, params: string): Promise<PluginInstance | null>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @file Implements the logic for running (executing) a ChRIS plugin.
3
+ *
4
+ * This module provides functionality to parse CLI parameters and trigger
5
+ * a plugin instance execution on the ChRIS backend.
6
+ *
7
+ * @module
8
+ */
9
+ import { dictionary_fromCLI } from "@fnndsc/cumin";
10
+ import { plugin_run as salsaPlugin_run } from "@fnndsc/salsa";
11
+ /**
12
+ * Executes a ChRIS plugin with the specified parameters.
13
+ *
14
+ * @param searchable - The plugin identifier (ID or name) to run.
15
+ * @param params - The raw parameter string from the CLI (e.g., "--param1 value1 --param2 value2").
16
+ * @returns A Promise resolving to the created plugin instance, or `null` on failure.
17
+ * @throws {Error} If the parameter string cannot be parsed.
18
+ */
19
+ export async function plugin_execute(searchable, params) {
20
+ let parsedParams = {};
21
+ try {
22
+ parsedParams = dictionary_fromCLI(params);
23
+ }
24
+ catch (e) {
25
+ throw new Error(`Error parsing plugin parameters: ${e}`);
26
+ }
27
+ const result = await salsaPlugin_run(searchable, parsedParams);
28
+ return result;
29
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Resolves a search term (name or ID) to a list of matching plugin IDs.
3
+ *
4
+ * @param searchable - The search string (e.g., plugin name or "id:123").
5
+ * @returns A Promise resolving to an array of plugin ID strings, or `null` if none found.
6
+ */
7
+ export declare function pluginIds_resolve(searchable: string): Promise<string[] | null>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file Implements the logic for resolving plugin identifiers to IDs.
3
+ *
4
+ * This module provides functionality to search for plugins and retrieve
5
+ * their IDs, often used as a precursor to other operations like `run` or `readme`.
6
+ *
7
+ * @module
8
+ */
9
+ import { plugins_searchableToIDs as salsaPlugins_searchableToIDs } from "@fnndsc/salsa";
10
+ /**
11
+ * Resolves a search term (name or ID) to a list of matching plugin IDs.
12
+ *
13
+ * @param searchable - The search string (e.g., plugin name or "id:123").
14
+ * @returns A Promise resolving to an array of plugin ID strings, or `null` if none found.
15
+ */
16
+ export async function pluginIds_resolve(searchable) {
17
+ return await salsaPlugins_searchableToIDs(searchable);
18
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Fetches the available plugin-instance field names.
3
+ *
4
+ * @returns The plugin-instance field names, or null on failure.
5
+ */
6
+ export declare function pluginInstanceFields_fetch(): Promise<string[] | null>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file Fetches available fields for plugin instance resources.
3
+ * @module
4
+ */
5
+ import { pluginInstanceFields_get } from '@fnndsc/salsa';
6
+ /**
7
+ * Fetches the available plugin-instance field names.
8
+ *
9
+ * @returns The plugin-instance field names, or null on failure.
10
+ */
11
+ export async function pluginInstanceFields_fetch() {
12
+ return await pluginInstanceFields_get();
13
+ }
@@ -0,0 +1,16 @@
1
+ import { CLIoptions } from '../../utils/cli.js';
2
+ /**
3
+ * Result of listing plugin-instances (table data plus selected fields).
4
+ */
5
+ export interface PluginInstanceListResult {
6
+ pluginInstances: Record<string, unknown>[];
7
+ selectedFields: string[];
8
+ totalCount?: number;
9
+ }
10
+ /**
11
+ * Fetches a list of plugin-instances.
12
+ *
13
+ * @param options - List and filter options.
14
+ * @returns The plugin-instances list result.
15
+ */
16
+ export declare function pluginInstances_fetchList(options: CLIoptions): Promise<PluginInstanceListResult>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @file Implements listing ChRIS plugin instances (jobs).
3
+ * @module
4
+ */
5
+ import { pluginInstances_list as salsaPluginInstances_list, pluginInstances_listAll as salsaPluginInstances_listAll } from '@fnndsc/salsa';
6
+ import { options_toParams } from '../../utils/cli.js';
7
+ import { list_applySort } from '../../utils/sort.js';
8
+ /**
9
+ * Fetches a list of plugin-instances.
10
+ *
11
+ * @param options - List and filter options.
12
+ * @returns The plugin-instances list result.
13
+ */
14
+ export async function pluginInstances_fetchList(options) {
15
+ const params = options_toParams(options);
16
+ const result = options.all
17
+ ? await salsaPluginInstances_listAll(params)
18
+ : await salsaPluginInstances_list(params);
19
+ if (result && result.tableData) {
20
+ let pluginInstances = result.tableData;
21
+ if (options.sort)
22
+ pluginInstances = list_applySort(pluginInstances, options.sort, options.reverse);
23
+ return { pluginInstances, selectedFields: result.selectedFields || [], totalCount: result.totalCount };
24
+ }
25
+ return { pluginInstances: [], selectedFields: [] };
26
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Fetches the available plugin-meta field names.
3
+ *
4
+ * @returns The plugin-meta field names, or null on failure.
5
+ */
6
+ export declare function pluginMetaFields_fetch(): Promise<string[] | null>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @file Fetches available fields for plugin meta resources.
3
+ * @module
4
+ */
5
+ import { pluginMetaFields_get } from '@fnndsc/salsa';
6
+ /**
7
+ * Fetches the available plugin-meta field names.
8
+ *
9
+ * @returns The plugin-meta field names, or null on failure.
10
+ */
11
+ export async function pluginMetaFields_fetch() {
12
+ return await pluginMetaFields_get();
13
+ }
@@ -0,0 +1,16 @@
1
+ import { CLIoptions } from '../../utils/cli.js';
2
+ /**
3
+ * Result of listing plugin-metas (table data plus selected fields).
4
+ */
5
+ export interface PluginMetaListResult {
6
+ pluginMetas: Record<string, unknown>[];
7
+ selectedFields: string[];
8
+ totalCount?: number;
9
+ }
10
+ /**
11
+ * Fetches a list of plugin-metas.
12
+ *
13
+ * @param options - List and filter options.
14
+ * @returns The plugin-metas list result.
15
+ */
16
+ export declare function pluginMetas_fetchList(options: CLIoptions): Promise<PluginMetaListResult>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @file Implements listing ChRIS plugin metas.
3
+ * @module
4
+ */
5
+ import { pluginMetas_list as salsaPluginMetas_list, pluginMetas_listAll as salsaPluginMetas_listAll } from '@fnndsc/salsa';
6
+ import { options_toParams } from '../../utils/cli.js';
7
+ import { list_applySort } from '../../utils/sort.js';
8
+ /**
9
+ * Fetches a list of plugin-metas.
10
+ *
11
+ * @param options - List and filter options.
12
+ * @returns The plugin-metas list result.
13
+ */
14
+ export async function pluginMetas_fetchList(options) {
15
+ const params = options_toParams(options);
16
+ const result = options.all
17
+ ? await salsaPluginMetas_listAll(params)
18
+ : await salsaPluginMetas_list(params);
19
+ if (result && result.tableData) {
20
+ let pluginMetas = result.tableData;
21
+ if (options.sort)
22
+ pluginMetas = list_applySort(pluginMetas, options.sort, options.reverse);
23
+ return { pluginMetas, selectedFields: result.selectedFields || [], totalCount: result.totalCount };
24
+ }
25
+ return { pluginMetas: [], selectedFields: [] };
26
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file Implements the logic for adding (registering) new ChRIS plugins.
3
+ *
4
+ * This module orchestrates a three-phase plugin registration strategy:
5
+ * 1. Check if plugin exists in current CUBE → assign to compute resources
6
+ * 2. Search peer stores → import from store if found
7
+ * 3. Docker extraction → pull image, extract JSON, register
8
+ *
9
+ * @module
10
+ */
11
+ import { CLIoptions } from '../../utils/cli.js';
12
+ /**
13
+ * Options specific to plugin add command.
14
+ */
15
+ interface PluginAddOptions extends CLIoptions {
16
+ compute?: string;
17
+ store?: string;
18
+ adminUser?: string;
19
+ adminPassword?: string;
20
+ public_repo?: string;
21
+ }
22
+ /**
23
+ * Outcome of a plugin add operation.
24
+ */
25
+ export type PluginAddOutcome = 'installed' | 'already_exists' | 'failed';
26
+ /**
27
+ * Adds a plugin to the ChRIS store from the given input.
28
+ *
29
+ * @param input - Plugin source (image, URL, or path).
30
+ * @param options - Plugin add options.
31
+ * @returns The add outcome.
32
+ */
33
+ export declare function plugin_add(input: string, options: PluginAddOptions): Promise<PluginAddOutcome>;
34
+ export {};