@fnndsc/salsa 3.2.4

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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +164 -0
  3. package/dist/compute/index.d.ts +17 -0
  4. package/dist/compute/index.js +33 -0
  5. package/dist/compute/index.js.map +1 -0
  6. package/dist/connect/index.d.ts +25 -0
  7. package/dist/connect/index.js +27 -0
  8. package/dist/connect/index.js.map +1 -0
  9. package/dist/context/index.d.ts +38 -0
  10. package/dist/context/index.js +58 -0
  11. package/dist/context/index.js.map +1 -0
  12. package/dist/feeds/index.d.ts +60 -0
  13. package/dist/feeds/index.js +101 -0
  14. package/dist/feeds/index.js.map +1 -0
  15. package/dist/files/index.d.ts +179 -0
  16. package/dist/files/index.js +562 -0
  17. package/dist/files/index.js.map +1 -0
  18. package/dist/files/pacs_content.d.ts +29 -0
  19. package/dist/files/pacs_content.js +121 -0
  20. package/dist/files/pacs_content.js.map +1 -0
  21. package/dist/files/pipeline_content.d.ts +22 -0
  22. package/dist/files/pipeline_content.js +31 -0
  23. package/dist/files/pipeline_content.js.map +1 -0
  24. package/dist/files/regular_content.d.ts +33 -0
  25. package/dist/files/regular_content.js +177 -0
  26. package/dist/files/regular_content.js.map +1 -0
  27. package/dist/groups/index.d.ts +21 -0
  28. package/dist/groups/index.js +37 -0
  29. package/dist/groups/index.js.map +1 -0
  30. package/dist/index.d.ts +21 -0
  31. package/dist/index.js +42 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/jobs/index.d.ts +6 -0
  34. package/dist/jobs/index.js +17 -0
  35. package/dist/jobs/index.js.map +1 -0
  36. package/dist/jobs/jobOps.d.ts +108 -0
  37. package/dist/jobs/jobOps.js +307 -0
  38. package/dist/jobs/jobOps.js.map +1 -0
  39. package/dist/pacs/index.d.ts +64 -0
  40. package/dist/pacs/index.js +91 -0
  41. package/dist/pacs/index.js.map +1 -0
  42. package/dist/pacs/resultDecode.d.ts +13 -0
  43. package/dist/pacs/resultDecode.js +19 -0
  44. package/dist/pacs/resultDecode.js.map +1 -0
  45. package/dist/pipelines/index.d.ts +58 -0
  46. package/dist/pipelines/index.js +194 -0
  47. package/dist/pipelines/index.js.map +1 -0
  48. package/dist/plugininstances/index.d.ts +15 -0
  49. package/dist/plugininstances/index.js +27 -0
  50. package/dist/plugininstances/index.js.map +1 -0
  51. package/dist/pluginmetas/index.d.ts +21 -0
  52. package/dist/pluginmetas/index.js +37 -0
  53. package/dist/pluginmetas/index.js.map +1 -0
  54. package/dist/plugins/index.d.ts +118 -0
  55. package/dist/plugins/index.js +247 -0
  56. package/dist/plugins/index.js.map +1 -0
  57. package/dist/plugins/internal/plugin_executeContinueFeed.d.ts +17 -0
  58. package/dist/plugins/internal/plugin_executeContinueFeed.js +65 -0
  59. package/dist/plugins/internal/plugin_executeContinueFeed.js.map +1 -0
  60. package/dist/plugins/internal/plugin_executeNewFeed.d.ts +32 -0
  61. package/dist/plugins/internal/plugin_executeNewFeed.js +97 -0
  62. package/dist/plugins/internal/plugin_executeNewFeed.js.map +1 -0
  63. package/dist/plugins/peer_search.d.ts +65 -0
  64. package/dist/plugins/peer_search.js +94 -0
  65. package/dist/plugins/peer_search.js.map +1 -0
  66. package/dist/plugins/plugin_executeInPlace.d.ts +69 -0
  67. package/dist/plugins/plugin_executeInPlace.js +66 -0
  68. package/dist/plugins/plugin_executeInPlace.js.map +1 -0
  69. package/dist/plugins/plugin_register.d.ts +64 -0
  70. package/dist/plugins/plugin_register.js +121 -0
  71. package/dist/plugins/plugin_register.js.map +1 -0
  72. package/dist/plugins/store_import.d.ts +64 -0
  73. package/dist/plugins/store_import.js +196 -0
  74. package/dist/plugins/store_import.js.map +1 -0
  75. package/dist/store/index.d.ts +15 -0
  76. package/dist/store/index.js +37 -0
  77. package/dist/store/index.js.map +1 -0
  78. package/dist/tags/index.d.ts +21 -0
  79. package/dist/tags/index.js +37 -0
  80. package/dist/tags/index.js.map +1 -0
  81. package/dist/vfs/dispatcher.d.ts +83 -0
  82. package/dist/vfs/dispatcher.js +192 -0
  83. package/dist/vfs/dispatcher.js.map +1 -0
  84. package/dist/vfs/index.d.ts +9 -0
  85. package/dist/vfs/index.js +26 -0
  86. package/dist/vfs/index.js.map +1 -0
  87. package/dist/vfs/provider.d.ts +80 -0
  88. package/dist/vfs/provider.js +11 -0
  89. package/dist/vfs/provider.js.map +1 -0
  90. package/dist/vfs/providers/etc.d.ts +44 -0
  91. package/dist/vfs/providers/etc.js +119 -0
  92. package/dist/vfs/providers/etc.js.map +1 -0
  93. package/dist/vfs/providers/native.d.ts +34 -0
  94. package/dist/vfs/providers/native.js +168 -0
  95. package/dist/vfs/providers/native.js.map +1 -0
  96. package/dist/vfs/providers/pacs.d.ts +56 -0
  97. package/dist/vfs/providers/pacs.js +413 -0
  98. package/dist/vfs/providers/pacs.js.map +1 -0
  99. package/dist/vfs/providers/pacsHelpers.d.ts +27 -0
  100. package/dist/vfs/providers/pacsHelpers.js +108 -0
  101. package/dist/vfs/providers/pacsHelpers.js.map +1 -0
  102. package/dist/vfs/providers/pacs_content.d.ts +27 -0
  103. package/dist/vfs/providers/pacs_content.js +137 -0
  104. package/dist/vfs/providers/pacs_content.js.map +1 -0
  105. package/dist/vfs/providers/proc.d.ts +62 -0
  106. package/dist/vfs/providers/proc.js +478 -0
  107. package/dist/vfs/providers/proc.js.map +1 -0
  108. package/dist/workflows/index.d.ts +21 -0
  109. package/dist/workflows/index.js +37 -0
  110. package/dist/workflows/index.js.map +1 -0
  111. package/package.json +57 -0
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @file Pipeline business logic for salsa.
3
+ *
4
+ * Wraps cumin's pipeline primitives to provide higher-level operations:
5
+ * listing, running, and fetching source YAML for registered pipelines.
6
+ *
7
+ * @module
8
+ */
9
+ import { FilteredResourceData, ListOptions, Result, PipelineRecord, WorkflowResult } from '@fnndsc/cumin';
10
+ export type { PipelineRecord, WorkflowResult };
11
+ /**
12
+ * Lists registered pipelines, optionally filtered by name substring.
13
+ * Returns FilteredResourceData for table rendering compatibility.
14
+ *
15
+ * @param search - Optional name substring filter.
16
+ */
17
+ export declare function pipelines_list(search?: string): Promise<FilteredResourceData | null>;
18
+ /**
19
+ * Lists all pipelines across all pages.
20
+ *
21
+ * @param options - Search options (limit/offset managed internally).
22
+ */
23
+ export declare function pipelines_listAll(options?: Partial<ListOptions>): Promise<FilteredResourceData | null>;
24
+ /**
25
+ * Returns available field names for pipelines.
26
+ */
27
+ export declare function pipelineFields_get(): Promise<string[] | null>;
28
+ /**
29
+ * Returns all registered pipelines as a flat array for /bin listing.
30
+ * Attaches a filesystem-safe slug derived from each pipeline's source filename.
31
+ * Pipelines without a source file get a slug generated from their name.
32
+ *
33
+ * @returns Result containing array of PipelineRecord (with slug attached).
34
+ */
35
+ export declare function pipelines_getAll(): Promise<Result<PipelineRecord[]>>;
36
+ /**
37
+ * Runs a pipeline by name or ID, attaching it to a previous plugin instance.
38
+ *
39
+ * @param nameOrId - Pipeline name or numeric ID string.
40
+ * @param previousPluginInstId - The plugin instance to attach the pipeline root to.
41
+ * @param computeOverride - Optional compute resource name applied to all nodes.
42
+ * @returns Result containing workflow ID and created plugin instance IDs.
43
+ */
44
+ export declare function pipeline_run(nameOrId: string, previousPluginInstId: number, computeOverride?: string): Promise<Result<WorkflowResult>>;
45
+ /**
46
+ * Fetches the YAML source of a registered pipeline by searching /PIPELINES/ for
47
+ * a file whose basename matches the pipeline name.
48
+ *
49
+ * @param nameOrId - Pipeline name or numeric ID string.
50
+ * @returns Result containing YAML source string.
51
+ */
52
+ export declare function pipeline_sourceGet(nameOrId: string): Promise<Result<string>>;
53
+ /**
54
+ * Gets raw content from a pipeline source URL (legacy helper).
55
+ *
56
+ * @param url - Direct URL to the pipeline source file.
57
+ */
58
+ export declare function pipeline_getContent(url: string): Promise<Result<string>>;
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ /**
3
+ * @file Pipeline business logic for salsa.
4
+ *
5
+ * Wraps cumin's pipeline primitives to provide higher-level operations:
6
+ * listing, running, and fetching source YAML for registered pipelines.
7
+ *
8
+ * @module
9
+ */
10
+ var __importDefault = (this && this.__importDefault) || function (mod) {
11
+ return (mod && mod.__esModule) ? mod : { "default": mod };
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.pipelines_list = pipelines_list;
15
+ exports.pipelines_listAll = pipelines_listAll;
16
+ exports.pipelineFields_get = pipelineFields_get;
17
+ exports.pipelines_getAll = pipelines_getAll;
18
+ exports.pipeline_run = pipeline_run;
19
+ exports.pipeline_sourceGet = pipeline_sourceGet;
20
+ exports.pipeline_getContent = pipeline_getContent;
21
+ const cumin_1 = require("@fnndsc/cumin");
22
+ const axios_1 = __importDefault(require("axios"));
23
+ /**
24
+ * Lists registered pipelines, optionally filtered by name substring.
25
+ * Returns FilteredResourceData for table rendering compatibility.
26
+ *
27
+ * @param search - Optional name substring filter.
28
+ */
29
+ async function pipelines_list(search) {
30
+ const result = await (0, cumin_1.pipelines_list)(search);
31
+ if (!result.ok || result.value.length === 0)
32
+ return null;
33
+ const records = result.value;
34
+ return {
35
+ tableData: records,
36
+ selectedFields: ['id', 'name', 'authors', 'category', 'description'],
37
+ };
38
+ }
39
+ /**
40
+ * Lists all pipelines across all pages.
41
+ *
42
+ * @param options - Search options (limit/offset managed internally).
43
+ */
44
+ async function pipelines_listAll(options = {}) {
45
+ const group = new cumin_1.ChRISPipelineGroup();
46
+ return await group.asset.resources_getAll(options);
47
+ }
48
+ /**
49
+ * Returns available field names for pipelines.
50
+ */
51
+ async function pipelineFields_get() {
52
+ const group = new cumin_1.ChRISPipelineGroup();
53
+ const result = await group.asset.resourceFields_get();
54
+ return result ? result.fields : null;
55
+ }
56
+ /**
57
+ * Returns all registered pipelines as a flat array for /bin listing.
58
+ * Attaches a filesystem-safe slug derived from each pipeline's source filename.
59
+ * Pipelines without a source file get a slug generated from their name.
60
+ *
61
+ * @returns Result containing array of PipelineRecord (with slug attached).
62
+ */
63
+ async function pipelines_getAll() {
64
+ const client = await cumin_1.chrisConnection.client_get();
65
+ if (!client) {
66
+ cumin_1.errorStack.stack_push('error', 'Not connected to ChRIS');
67
+ return (0, cumin_1.Err)();
68
+ }
69
+ const [pipelinesResult, sourceFilesResponse] = await Promise.all([
70
+ (0, cumin_1.pipelines_list)(),
71
+ client.getPipelineSourceFiles({ limit: 1000 }).catch(() => null),
72
+ ]);
73
+ if (!pipelinesResult.ok)
74
+ return (0, cumin_1.Err)();
75
+ const idToSlug = new Map();
76
+ if (sourceFilesResponse) {
77
+ for (const item of sourceFilesResponse.getItems()) {
78
+ const { fname, pipeline_id } = item.data;
79
+ if (pipeline_id && fname) {
80
+ const base = fname.split('/').pop() ?? '';
81
+ const slug = base.replace(/\.(ya?ml)$/i, '');
82
+ idToSlug.set(pipeline_id, slug);
83
+ }
84
+ }
85
+ }
86
+ const records = pipelinesResult.value.map((pipeline) => {
87
+ const sourceSlug = idToSlug.get(pipeline.id);
88
+ const generatedSlug = pipeline.name
89
+ .replace(/[^a-zA-Z0-9]/g, '_')
90
+ .replace(/_+/g, '_')
91
+ .replace(/^_|_$/g, '');
92
+ const base = sourceSlug ?? generatedSlug;
93
+ return {
94
+ ...pipeline,
95
+ slug: `${base}_id${pipeline.id}`,
96
+ };
97
+ });
98
+ return (0, cumin_1.Ok)(records);
99
+ }
100
+ /**
101
+ * Runs a pipeline by name or ID, attaching it to a previous plugin instance.
102
+ *
103
+ * @param nameOrId - Pipeline name or numeric ID string.
104
+ * @param previousPluginInstId - The plugin instance to attach the pipeline root to.
105
+ * @param computeOverride - Optional compute resource name applied to all nodes.
106
+ * @returns Result containing workflow ID and created plugin instance IDs.
107
+ */
108
+ async function pipeline_run(nameOrId, previousPluginInstId, computeOverride) {
109
+ const pipelineResult = await (0, cumin_1.pipeline_resolve)(nameOrId);
110
+ if (!pipelineResult.ok)
111
+ return (0, cumin_1.Err)();
112
+ const pipeline = pipelineResult.value;
113
+ const options = { previousPluginInstId };
114
+ if (computeOverride) {
115
+ const client = await cumin_1.chrisConnection.client_get();
116
+ if (!client) {
117
+ cumin_1.errorStack.stack_push('error', 'Not connected to ChRIS');
118
+ return (0, cumin_1.Err)();
119
+ }
120
+ try {
121
+ const pipelineObj = await client.getPipeline(pipeline.id);
122
+ if (pipelineObj) {
123
+ const pipingsResponse = await pipelineObj.getPluginPipings({ limit: 1000 });
124
+ const pipings = pipingsResponse.getItems();
125
+ options.nodeOverrides = pipings.map((p) => ({
126
+ piping_id: p.data.id,
127
+ compute_resource_name: computeOverride,
128
+ }));
129
+ }
130
+ }
131
+ catch (error) {
132
+ const msg = error instanceof Error ? error.message : String(error);
133
+ cumin_1.errorStack.stack_push('error', `pipeline_run: compute override failed: ${msg}`);
134
+ return (0, cumin_1.Err)();
135
+ }
136
+ }
137
+ return (0, cumin_1.pipeline_createWorkflow)(pipeline.id, options);
138
+ }
139
+ /**
140
+ * Fetches the YAML source of a registered pipeline by searching /PIPELINES/ for
141
+ * a file whose basename matches the pipeline name.
142
+ *
143
+ * @param nameOrId - Pipeline name or numeric ID string.
144
+ * @returns Result containing YAML source string.
145
+ */
146
+ async function pipeline_sourceGet(nameOrId) {
147
+ const pipelineResult = await (0, cumin_1.pipeline_resolve)(nameOrId);
148
+ if (!pipelineResult.ok)
149
+ return (0, cumin_1.Err)();
150
+ const pipeline = pipelineResult.value;
151
+ const client = await cumin_1.chrisConnection.client_get();
152
+ if (!client) {
153
+ cumin_1.errorStack.stack_push('error', 'Not connected to ChRIS');
154
+ return (0, cumin_1.Err)();
155
+ }
156
+ try {
157
+ const sourceFiles = await client.getPipelineSourceFiles({ pipeline_id: pipeline.id, limit: 1 });
158
+ const items = sourceFiles.getItems();
159
+ if (items.length === 0) {
160
+ cumin_1.errorStack.stack_push('error', `No source file registered for pipeline '${pipeline.name}' (id=${pipeline.id})`);
161
+ return (0, cumin_1.Err)();
162
+ }
163
+ return (0, cumin_1.pipelineFile_getTextByPath)('/' + items[0].data.fname);
164
+ }
165
+ catch (error) {
166
+ const msg = error instanceof Error ? error.message : String(error);
167
+ cumin_1.errorStack.stack_push('error', `pipeline_sourceGet: ${msg}`);
168
+ return (0, cumin_1.Err)();
169
+ }
170
+ }
171
+ /**
172
+ * Gets raw content from a pipeline source URL (legacy helper).
173
+ *
174
+ * @param url - Direct URL to the pipeline source file.
175
+ */
176
+ async function pipeline_getContent(url) {
177
+ const token = await cumin_1.chrisConnection.authToken_get();
178
+ if (!token) {
179
+ cumin_1.errorStack.stack_push('error', 'Not connected to ChRIS');
180
+ return (0, cumin_1.Err)();
181
+ }
182
+ try {
183
+ const response = await axios_1.default.get(url, {
184
+ headers: { Authorization: `Token ${token}` },
185
+ });
186
+ return (0, cumin_1.Ok)(response.data);
187
+ }
188
+ catch (error) {
189
+ const msg = error instanceof Error ? error.message : String(error);
190
+ cumin_1.errorStack.stack_push('error', `pipeline_getContent: ${msg}`);
191
+ return (0, cumin_1.Err)();
192
+ }
193
+ }
194
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pipelines/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;AA6BH,wCAWC;AAOD,8CAGC;AAKD,gDAIC;AASD,4CA4CC;AAUD,oCA4CC;AASD,gDAqCC;AAOD,kDAiBC;AA1OD,yCAgBuB;AACvB,kDAA0B;AAI1B;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAClC,MAAe;IAEf,MAAM,MAAM,GAA6B,MAAM,IAAA,sBAAoB,EAAC,MAAM,CAAC,CAAC;IAC5E,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzD,MAAM,OAAO,GAA8B,MAAM,CAAC,KAAkC,CAAC;IACrF,OAAO;QACL,SAAS,EAAE,OAAO;QAClB,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,U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AACH,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,mBAAmB,CAAC,GAAW;IACnD,MAAM,KAAK,GAAkB,MAAM,uBAAe,CAAC,aAAa,EAAE,CAAC;IACnE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,kBAAU,CAAC,UAAU,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;QACzD,OAAO,IAAA,WAAG,GAAE,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,GAAG,EAAE;YACpC,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,KAAK,EAAE,EAAE;SAC7C,CAAC,CAAC;QACH,OAAO,IAAA,UAAE,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,GAAG,GAAW,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3E,kBAAU,CAAC,UAAU,CAAC,OAAO,EAAE,wBAAwB,GAAG,EAAE,CAAC,CAAC;QAC9D,OAAO,IAAA,WAAG,GAAE,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @file PluginInstance resource operations.
3
+ * @module
4
+ */
5
+ import { FilteredResourceData, ListOptions } from '@fnndsc/cumin';
6
+ /**
7
+ * Lists all plugin instances / jobs across all pages.
8
+ *
9
+ * @param options - Search options (limit/offset managed internally).
10
+ */
11
+ export declare function pluginInstances_listAll(options?: Partial<ListOptions>): Promise<FilteredResourceData | null>;
12
+ /**
13
+ * Returns available field names for plugin instances.
14
+ */
15
+ export declare function pluginInstanceFields_get(): Promise<string[] | null>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * @file PluginInstance resource operations.
4
+ * @module
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.pluginInstances_listAll = pluginInstances_listAll;
8
+ exports.pluginInstanceFields_get = pluginInstanceFields_get;
9
+ const cumin_1 = require("@fnndsc/cumin");
10
+ /**
11
+ * Lists all plugin instances / jobs across all pages.
12
+ *
13
+ * @param options - Search options (limit/offset managed internally).
14
+ */
15
+ async function pluginInstances_listAll(options = {}) {
16
+ const group = new cumin_1.ChRISPluginInstanceGroup();
17
+ return await group.asset.resources_getAll(options);
18
+ }
19
+ /**
20
+ * Returns available field names for plugin instances.
21
+ */
22
+ async function pluginInstanceFields_get() {
23
+ const group = new cumin_1.ChRISPluginInstanceGroup();
24
+ const result = await group.asset.resourceFields_get();
25
+ return result ? result.fields : null;
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugininstances/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AASH,0DAGC;AAKD,4DAIC;AAnBD,yCAA4F;AAE5F;;;;GAIG;AACI,KAAK,UAAU,uBAAuB,CAAC,UAAgC,EAAE;IAC9E,MAAM,KAAK,GAA6B,IAAI,gCAAwB,EAAE,CAAC;IACvE,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,wBAAwB;IAC5C,MAAM,KAAK,GAA6B,IAAI,gCAAwB,EAAE,CAAC;IACvE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACtD,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @file PluginMeta resource operations.
3
+ * @module
4
+ */
5
+ import { FilteredResourceData, ListOptions } from '@fnndsc/cumin';
6
+ /**
7
+ * Lists plugin metas (single page).
8
+ *
9
+ * @param options - Search and pagination options.
10
+ */
11
+ export declare function pluginMetas_list(options: ListOptions): Promise<FilteredResourceData | null>;
12
+ /**
13
+ * Lists all plugin metas across all pages.
14
+ *
15
+ * @param options - Search options (limit/offset managed internally).
16
+ */
17
+ export declare function pluginMetas_listAll(options?: Partial<ListOptions>): Promise<FilteredResourceData | null>;
18
+ /**
19
+ * Returns available field names for plugin metas.
20
+ */
21
+ export declare function pluginMetaFields_get(): Promise<string[] | null>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ /**
3
+ * @file PluginMeta resource operations.
4
+ * @module
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.pluginMetas_list = pluginMetas_list;
8
+ exports.pluginMetas_listAll = pluginMetas_listAll;
9
+ exports.pluginMetaFields_get = pluginMetaFields_get;
10
+ const cumin_1 = require("@fnndsc/cumin");
11
+ /**
12
+ * Lists plugin metas (single page).
13
+ *
14
+ * @param options - Search and pagination options.
15
+ */
16
+ async function pluginMetas_list(options) {
17
+ const group = new cumin_1.ChRISPluginMetaGroup();
18
+ return await group.asset.resources_listAndFilterByOptions(options);
19
+ }
20
+ /**
21
+ * Lists all plugin metas across all pages.
22
+ *
23
+ * @param options - Search options (limit/offset managed internally).
24
+ */
25
+ async function pluginMetas_listAll(options = {}) {
26
+ const group = new cumin_1.ChRISPluginMetaGroup();
27
+ return await group.asset.resources_getAll(options);
28
+ }
29
+ /**
30
+ * Returns available field names for plugin metas.
31
+ */
32
+ async function pluginMetaFields_get() {
33
+ const group = new cumin_1.ChRISPluginMetaGroup();
34
+ const result = await group.asset.resourceFields_get();
35
+ return result ? result.fields : null;
36
+ }
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/pluginmetas/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AASH,4CAGC;AAOD,kDAGC;AAKD,oDAIC;AA7BD,yCAAwF;AAExF;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CAAC,OAAoB;IACzD,MAAM,KAAK,GAAyB,IAAI,4BAAoB,EAAE,CAAC;IAC/D,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,mBAAmB,CAAC,UAAgC,EAAE;IAC1E,MAAM,KAAK,GAAyB,IAAI,4BAAoB,EAAE,CAAC;IAC/D,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,oBAAoB;IACxC,MAAM,KAAK,GAAyB,IAAI,4BAAoB,EAAE,CAAC;IAC/D,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACtD,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @file Plugin management operations.
3
+ * @module
4
+ */
5
+ import { Dictionary, FilteredResourceData, ListOptions, Searchable } from '@fnndsc/cumin';
6
+ /**
7
+ * List plugins based on options.
8
+ *
9
+ * @param options - Search and pagination options.
10
+ * @returns A Promise resolving to FilteredResourceData or null.
11
+ */
12
+ export declare function plugins_list(options: ListOptions): Promise<FilteredResourceData | null>;
13
+ /**
14
+ * List *all* plugins by automatically handling pagination.
15
+ *
16
+ * @param options - Search options (limit and offset will be overridden/managed internally).
17
+ * @returns A Promise resolving to FilteredResourceData containing all matching plugins, or null.
18
+ */
19
+ export declare function plugins_listAll(options?: ListOptions): Promise<FilteredResourceData | null>;
20
+ /**
21
+ * Get the list of available fields for plugins.
22
+ *
23
+ * @returns A Promise resolving to an array of field names or null.
24
+ */
25
+ export declare function pluginFields_get(): Promise<string[] | null>;
26
+ /**
27
+ * List plugin instances based on options.
28
+ *
29
+ * @param options - Search and pagination options (e.g., { id: 123 }).
30
+ * @returns A Promise resolving to FilteredResourceData or null.
31
+ */
32
+ export declare function pluginInstances_list(options: ListOptions): Promise<FilteredResourceData | null>;
33
+ /**
34
+ * Interface for options when searching for a plugin.
35
+ * This should be expanded as needed to reflect actual search parameters.
36
+ */
37
+ export interface PluginSearchOptions {
38
+ search?: string;
39
+ name?: string;
40
+ id?: string;
41
+ [key: string]: unknown;
42
+ }
43
+ /**
44
+ * Converts a Dictionary to CLI-style parameter string.
45
+ *
46
+ * @param params - Dictionary of parameters.
47
+ * @returns CLI-style string (e.g., "--key1 value1 --key2 value2").
48
+ */
49
+ export declare function dictionary_toCLI(params: Dictionary): string;
50
+ /**
51
+ * Run a plugin instance.
52
+ *
53
+ * This function orchestrates the execution of a ChRIS plugin with specified parameters.
54
+ *
55
+ * @param searchable - A string that identifies the plugin (e.g., name, ID, or a partial match).
56
+ * @param parameters - An object containing the parameters for the plugin execution.
57
+ * @returns A Promise resolving to a Dictionary representing the created plugin instance, or null if execution failed.
58
+ */
59
+ export declare function plugin_run(searchable: string, parameters: Dictionary): Promise<Dictionary | null>;
60
+ /**
61
+ * Resolve a searchable plugin string to a list of plugin IDs.
62
+ *
63
+ * @param searchable - A string or Searchable object that identifies the plugin (e.g., name, ID, or a partial match).
64
+ * @returns A Promise resolving to an array of plugin IDs, or null if no plugins match.
65
+ */
66
+ export declare function plugins_searchableToIDs(searchable: string | Searchable): Promise<string[] | null>;
67
+ /**
68
+ * Fetch the raw README content from a plugin's repository URL.
69
+ *
70
+ * This function attempts to retrieve README files (Markdown or reStructuredText)
71
+ * from common locations within a given repository URL.
72
+ *
73
+ * @param repoUrl - The base URL of the plugin's Git repository.
74
+ * @returns A Promise resolving to the README content as a string, or null if no README is found or accessible.
75
+ */
76
+ export declare function pluginMeta_readmeContentFetch(repoUrl: string): Promise<string | null>;
77
+ /**
78
+ * Retrieve the documentation URL for a specific plugin ID.
79
+ *
80
+ * @param pluginId - The ID of the plugin.
81
+ * @returns A Promise resolving to the documentation URL as a string, or null if not found.
82
+ */
83
+ export declare function pluginMeta_documentationUrlGet(pluginId: string): Promise<string | null>;
84
+ /**
85
+ * Retrieve a single plugin ID based on search options.
86
+ *
87
+ * This function performs a search for plugins using the provided criteria and
88
+ * returns the ID of the first matching plugin.
89
+ *
90
+ * @param options - An object containing search parameters (e.g., name, id).
91
+ * @returns A Promise resolving to a plugin ID string, or null if no plugin is found or if the search is ambiguous (multiple results).
92
+ */
93
+ export declare function pluginMeta_pluginIDFromSearch(options: PluginSearchOptions): Promise<string | null>;
94
+ /**
95
+ * Delete a plugin by its ID.
96
+ *
97
+ * @param id - The ID of the plugin to delete.
98
+ * @returns A Promise resolving to true on success, false on failure.
99
+ */
100
+ export declare function plugin_delete(id: number): Promise<boolean>;
101
+ /**
102
+ * Provides an overview of plugin operations.
103
+ * Currently a placeholder.
104
+ *
105
+ * @returns A Promise resolving to void.
106
+ */
107
+ export declare function plugins_overview(): Promise<void>;
108
+ /**
109
+ * Fetch the README for a plugin given its ID.
110
+ *
111
+ * @param pluginId - The ID of the plugin.
112
+ * @returns A Promise resolving to the README content or null.
113
+ */
114
+ export declare function plugin_readme(pluginId: string): Promise<string | null>;
115
+ export * from './plugin_register.js';
116
+ export * from './peer_search.js';
117
+ export * from './store_import.js';
118
+ export * from './plugin_executeInPlace.js';